DFlow Kalshi Market Data
Pull data about a known Kalshi market (or set of markets) — orderbook, trades, prices, candles, forecasts, in-game live data — as a snapshot, a historical range, or a live stream.
Prerequisites
- DFlow docs MCP (
https://pond.dflow.net/mcp) — install per the repo README. This skill is the recipe; the MCP is the reference. Query params, pagination, exact payload schemas, WS snapshot-vs-diff semantics, and the category-specificlive_data.detailsshapes all live there — don't guess.
Surface
All data endpoints in this skill run against the Metadata API (https://pond.dflow.net/build/metadata-api) — REST for snapshots and history, WebSockets for live streams. Call it from anywhere: a curl from the command line, a Node/Python script, a cron job, a backend, or a Next.js proxy fronting a browser UI.
If the user says "run this from my terminal", don't reach for the dflow CLI — it has no market-data subcommands. Write a short HTTP/WS script against the Metadata API instead.
Pick the shape first
Three intents, three shapes. Match the user's phrasing, then pick the endpoint:
- Snapshot ("right now", "current") → REST, one call.
- History ("last hour", "between T1 and T2", "last N trades") → REST with time / limit params.
- Stream ("live", "as it happens", "alert me when") → WebSocket subscription.
Data → endpoint map
For each dataset below, the one-liner covers all three shapes. Field-level details (exact params, pagination tokens, payload schemas) → docs MCP.
Orderbook
- Snapshot:
GET /api/v1/orderbook/{ticker}or/api/v1/orderbook/by-mint/{mint}(includessequence). - Stream:
orderbookchannel (yes_bids+no_bidsmaps per update; nosequenceon the stream payload).
Trades — **two endpoints, overlapping but different scopes**
GET /api/v1/trades(and/trades/by-mint/{mint}) — the complete market print tape. All trades that hit Kalshi's orderbook, which includes DFlow onchain fills (those hit Kalshi's book too; see the "Do onchain trades show up on Kalshi's trade websocket?" FAQ). This is the default for "show me trades on this market." Stream equivalent:tradeschannel.GET /api/v1/onchain-trades(and/onchain-trades/by-market/{ticker},/onchain-trades/by-event/{eventTicker}) — DFlow onchain fills only, with onchain-specific fields that/tradesdoesn't carry:wallet,transactionSignature,id,inputAmount,outputAmount,createdAt. Subset of what's on/trades, but richer per-row. No WS stream.- Decision: complete tape →
/trades. Wallet-scoped activity feed, DFlow-execution analytics, tx-signature lookups →/onchain-trades. Real-time fill detection for a specific user order → parse program events directly (see