Market Data Ingestion Plan¶
Goal¶
Ingest real-time orderbook data from Polymarket (CLOB) and Kalshi (Exchange) to feed the Arbitrage Engine.
Polymarket (CLOB)¶
- Protocol: WebSocket
- Endpoint:
wss://ws-fidelity.polymarket.com - Message Format: JSON
- Channels:
book(L2 Orderbook)
Kalshi¶
- Protocol: WebSocket
- Endpoint:
wss://api.kalshi.com/trade-api/v2/ws
Implementation Steps¶
- Types: Define normalized
OrderBookstruct intypes/market.rs. - Polymarket Monitor:
- Connect to WS using
tokio-tungstenite. - Parse messages.
- Update local state.