Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/deniszidbaev-cmyk/polyclaw-cmyk/llms.txt

Use this file to discover all available pages before exploring further.

PolyClaw’s market commands connect to the Polymarket Gamma API to fetch live prediction markets. You can browse by volume, filter by keyword, look up individual markets by ID or slug, and explore event groups — all from the terminal or in JSON mode for agent/script pipelines.
Market IDs can be obtained from the output of polyclaw markets trending or polyclaw markets search, or extracted from the Polymarket URL slug (e.g. https://polymarket.com/event/will-trump-win-2028 → ID will-trump-win-2028).
Lists the top prediction markets sorted by 24-hour trading volume. Usage
polyclaw markets trending [--limit N] [--full] [--json]
Flags
--limit N
integer
default:"20"
Number of markets to return.
--full
boolean
Show the full question text without truncation. By default questions are truncated at 60 characters in table mode.
--json
boolean
Output as a JSON array for agent or script consumption. Full question text is always included in JSON mode.
Example — table output
polyclaw markets trending --limit 5
ID           YES    NO   24h Vol   Question
--------------------------------------------------------------------------------
abc123def...  $0.65  $0.35   $1.2M  Will Trump win the 2028 election?...
def456ghi...  $0.82  $0.18    $890K  Will the Fed cut rates in June?...
Example — JSON output
polyclaw markets trending --limit 2 --json
[
  {
    "id": "abc123def456...",
    "question": "Will Trump win the 2028 election?",
    "yes": "$0.65",
    "no": "$0.35",
    "volume_24h": "$1.2M",
    "volume_total": "$8.5M"
  }
]

polyclaw markets search <query>

Searches markets by keyword, filtering client-side from a large batch fetched via the Gamma API. Usage
polyclaw markets search <query> [--limit N] [--full] [--json]
The Gamma API does not support server-side text search. PolyClaw fetches a large batch of markets and filters client-side by matching your query against market questions. Results are ranked by 24h volume.
Parameters
query
string
required
Keyword or phrase to search for in market questions.
Flags
--limit N
integer
default:"20"
Maximum number of matching results to return.
--full
boolean
Show full question text without truncation.
--json
boolean
Output as a JSON array.
Example
polyclaw markets search "election" --limit 10
ID           YES    NO   24h Vol   Question
--------------------------------------------------------------------------------
abc123def...  $0.65  $0.35   $1.2M  Will Trump win the 2028 election?...
xyz789abc...  $0.50  $0.50    $430K  Will the UK election happen in Q3?...

polyclaw market <market_id>

Shortcut for polyclaw markets details <market_id>. Returns the full market object as JSON. Usage
polyclaw market <market_id>
Parameters
market_id
string
required
Accepts any of the following:
  • A numeric Gamma market ID (e.g. 123456)
  • A full market ID string (e.g. abc123def456...)
  • A Polymarket slug (e.g. will-trump-win-2028)
  • A full Polymarket URL (e.g. https://polymarket.com/event/will-trump-win-2028)
Example
polyclaw market will-trump-win-2028
{
  "id": "abc123def456...",
  "question": "Will Trump win the 2028 election?",
  "slug": "will-trump-win-2028",
  "condition_id": "0xabc...",
  "prices": {
    "yes": 0.65,
    "no": 0.35
  },
  "tokens": {
    "yes_token_id": "0x111...",
    "no_token_id": "0x222..."
  },
  "volume": {
    "24h": 1200000.0,
    "total": 8500000.0
  },
  "liquidity": 250000.0,
  "status": {
    "active": true,
    "closed": false,
    "resolved": false,
    "outcome": null
  },
  "end_date": "2028-11-03T00:00:00Z",
  "url": "https://polymarket.com/event/will-trump-win-2028"
}
Response fields
FieldDescription
idMarket ID
questionFull market question
slugURL slug
condition_idCTF condition ID (needed for on-chain operations)
prices.yes / prices.noCurrent YES and NO prices (0–1)
tokens.yes_token_id / tokens.no_token_idERC-1155 token IDs for each outcome
volume.24h / volume.total24-hour and total trading volume in USD
liquidityCurrent liquidity in USD
status.activeWhether the market is still open for trading
status.resolvedWhether the market has been resolved
status.outcomeResolution outcome if resolved
end_dateScheduled closing date
urlLink to the market on polymarket.com

polyclaw markets events

Lists event groups — multi-market events that bundle related markets together under a shared topic. Usage
polyclaw markets events [--limit N] [--full] [--json]
Flags
--limit N
integer
default:"10"
Number of events to return.
--full
boolean
Show full question text for each market without truncation.
--json
boolean
Output full event data as a JSON array. JSON mode includes up to 5 markets per event; table mode shows up to 3.
Example — table output
polyclaw markets events --limit 3
2028 US Presidential Election
  Slug: 2028-us-presidential-election
  Markets: 12
    - Will Trump win the 2028 presidential election? (YES: $0.65)
    - Will the Republican nominee win more than 300 electoral votes? (YES: $0.40)
    - Will there be a third-party candidate in the 2028 election? (YES: $0.25)
Example — JSON output
polyclaw markets events --limit 2 --json
[
  {
    "id": "evt123...",
    "title": "2028 US Presidential Election",
    "slug": "2028-us-presidential-election",
    "markets": [
      {
        "id": "abc123...",
        "question": "Will Trump win the 2028 presidential election?",
        "yes": "$0.65",
        "no": "$0.35",
        "volume_24h": "$1.2M",
        "volume_total": "$8.5M"
      }
    ]
  }
]

Build docs developers (and LLMs) love