franalgaba/grimoire

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.

All-time #1342 Hot #3455 First seen Feb 26, 2026
8-week activity · all time api

Installation

$ npx skills add franalgaba/grimoire --skill grimoire-polymarket

Summary

  • Query Polymarket markets and manage CLOB orders via the official Polymarket CLI.
  • Provides market discovery through search-markets with filters for query, category, sport, league, event, tag, and trading status; also supports passthrough access to official markets , events , tags , series , and sports commands Exposes CLOB operations including order placement, cancellation, price queries, order book inspection, trade history, and balance checks; supports GTC, GTD, FOK, and FAK order types with flexible argument aliases Requires POLYMARKET_PRIVATE_KEY for authenticated operations; optional API credentials and signature routing via environment variables for advanced configurations Official polymarket CLI binary must be installed separately; adapter runs offchain on Polygon (chain 137)

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from franalgaba/grimoire · top by installs.

npx skills add franalgaba/grimoire

Browse all from franalgaba/grimoire

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 6
License MIT
Default branch main
Open issues 0
Status Active

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 5,592 B
  • docs SUMMARY.md 171 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 11,916 installs

SKILL.md

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

# Wrapper/health
grimoire venue polymarket info --format json
grimoire venue polymarket status --format json

# Canonical discovery
grimoire venue polymarket search-markets --query bitcoin --active-only true --open-only true --format json
grimoire venue polymarket search-markets --category sports --league "la liga" --active-only true --open-only true --format json

# Official passthrough discovery/data
grimoire venue polymarket markets list --limit 25 --format json
grimoire venue polymarket markets search "atleti" --limit 25 --format json
grimoire venue polymarket data positions <address> --limit 25 --format json
grimoire venue polymarket data trades <address> --limit 25 --format json
grimoire venue polymarket data leaderboard --period week --order-by vol --limit 25 --format json

# Legacy compatibility aliases (still supported)
grimoire venue polymarket book --token-id <token_id> --format json
grimoire venue polymarket price --token-id <token_id> --side buy --format json
grimoire venue polymarket order --order-id <order_id> --format json
grimoire venue polymarket open-orders --market <condition_id> --format json

Runtime Configuration

Adapter/runtime auth (for spell execution):

  • required by default: POLYMARKETPRIVATEKEY
  • optional API creds: POLYMARKETAPIKEY, POLYMARKETAPISECRET, POLYMARKETAPIPASSPHRASE
  • optional derive toggle (default true): POLYMARKETDERIVEAPI_KEY=true|false
  • optional signature routing: POLYMARKETSIGNATURETYPE (0 EOA, 1 POLYPROXY, 2 GNOSISSAFE), POLYMARKET_FUNDER
  • grimoire cast / grimoire resume key-based flows inject the same wallet-manager key into the Polymarket adapter, so a separate POLYMARKETPRIVATEKEY env is not required there.

Venue CLI backend:

  • Official binary required: polymarket
  • Install: brew tap Polymarket/polymarket-cli && brew install polymarket
  • Optional path override: POLYMARKETOFFICIALCLI=/custom/path/polymarket

Spell Actions

Polymarket uses custom action type with op: "order" for order placement:

polymarket.custom(
  op="order",
  token_id="TOKEN_ID",
  price="0.55",
  size="100",
  side="BUY",
  order_type="GTC",
)

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:

poly_mid = metric("mid_price", polymarket, USDC, "token_id=<clobTokenId>")

Selector keys accepted: tokenid, tokenid, marketid, 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, cancelorder, cancelorders, 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.