grimoire-polymarket
Queries Polymarket market data and CLOB state, and manages CLOB orders via the Grimoire venue CLI wrapper backed by the official Polymarket CLI.
By franalgaba · 11,917 installs
npx skills add franalgaba/grimoire --skill grimoire-polymarket
Source repository · Upstream listing
Grimoire Polymarket Skill
Use this skill for Polymarket market discovery, CLOB market data, and order management operations through the polymarket venue adapter.
Preferred invocations:
grimoire venue polymarket ...
npx y @grimoirelabs/cli venue polymarket ... (no install)
bun run packages/cli/src/index.ts venue polymarket ... (repo local)
grimoire polymarket ... (direct binary from @grimoirelabs/venues )
Recommended preflight:
grimoire venue doctor adapter polymarket json
grimoire venue polymarket info format json
Commands
Canonical agent commands:
grimoire venue polymarket info [ format <auto json table ]
grimoire venue polymarket search markets [ query <text ] [ slug <slug url ] [ question <text ] [ event <text ] [ tag <text ] [ category <text ] [ league <text ] [ sport <text ] [ open only <true false ] [ active only <true false ] [ ignore end date <true false ] [ tradable only <true false ] [ all pages <true false ] [ max pages <n ] [ stop after empty pages <n ] [ limit <n ] [ format <auto json table ]
Allowed passthrough groups (official CLI surface, restricted by wrapper policy):
markets ( list get search tags )
data (positions/value/leaderboards/etc.)
Blocked groups in this wrapper (intentionally not exposed for agents):
wallet
bridge
approve
ctf
setup
upgrade
shell
Legacy compatibility aliases are still supported ( market , book , midpoint , spread , price , last trade price , tick size , neg risk , fee rate , price history , order , trades , open orders , balance allowance , closed only mode , server time ) but should not be used for new agent flows.
Examples
Runtime Configuration
Adapter/runtime auth (for spell execution):
required by default: POLYMARKET PRIVATE KEY
optional API creds: POLYMARKET API KEY , POLYMARKET API SECRET , POLYMARKET API PASSPHRASE
optional derive toggle (default true): POLYMARKET DERIVE API KEY=true false
optional signature routing: POLYMARKET SIGNATURE TYPE ( 0 EOA, 1 POLY PROXY, 2 GNOSIS SAFE), POLYMARKET FUNDER
grimoire cast / grimoire resume key based flows inject the same wallet manager key into the Polymarket adapter, so a separate POLYMARKET PRIVATE KEY env is not required there.
Venue CLI backend:
Official binary required: polymarket
Install: brew tap Polymarket/polymarket cli && brew install polymarket
Optional path override: POLYMARKET OFFICIAL CLI=/custom/path/polymarket
Spell Actions
Polymarket uses custom action type with op: "order" for order placement:
The adapter does not support runtime constraints ( max slippage , etc.). Order routing:
GTC / GTD → limit order ( createAndPostOrder )
FOK / FAK → market order ( createAndPostMarketOrder )
Metric Surface (Spell Comparisons)
Polymarket exposes mid price for CLOB token midpoint comparisons:
Selector keys accepted: token id , tokenid , market id , id .
If selector is omitted, the metric falls back to the 3rd argument value.
Adapter Notes
Adapter name: polymarket
Execution type: offchain
Supported chain metadata: 137 (Polygon)
Action type: custom
Supported custom ops: order , cancel order , cancel orders , cancel all , heartbeat
Order argument aliases accepted:
token: token id or tokenID or tokenId or coin
amount: size or amount
side: BUY / SELL
order type: GTC / GTD / FOK / FAK
extra compatibility aliases: arg0..arg5 , reduce only
Order type routing:
GTC / GTD limit order path ( createAndPostOrder )
FOK / FAK market order path ( createAndPostMarketOrder )
Notes
Prefer format json for agent and automation workflows.
search markets is the agent oriented normalized discovery command; passthrough markets search is thinner and closer to official behavior.
Keep prompts/tooling on this CLI surface; do not call Polymarket HTTP APIs directly from advisory tools.