ctx.feeds. Each feed runs as an async task on the engine’s tokio runtime.
Available Feeds
BinanceWS
Real-time trade stream from Binance WebSocket.
PolymarketBook
Polymarket orderbook snapshots via WebSocket.
KalshiBook
Kalshi orderbook polling via REST.
RESTFeed
Generic REST API polling for any endpoint.
PredictItFeed
PredictIt market contract prices.
ManifoldFeed
Manifold Markets crowd probabilities.
ESPNFeed
Live sports scores from ESPN.
NWSFeed
National Weather Service forecasts and alerts.
RESTJsonPathFeed
Any REST API with dot-notation JSON path extraction.
ChainlinkFeed
On-chain Chainlink price oracle via JSON-RPC.
MempoolFeed
Polygon mempool watcher for CTF exchange order flow.
AlpacaFeed
Real-time stock data from Alpaca Markets via WebSocket.
CoinbaseFeed
Coinbase Advanced Trade ticker data via WebSocket.
RobinhoodFeed
Robinhood crypto quotes via REST polling.
IBKRFeed
Interactive Brokers market data via REST polling.
CalendarFeed
Economic events and earnings calendar feed.
TreasuryFeed
Treasury yield curve data from FRED API.
BinanceWS
Real-time price stream from Binance via WebSocket:price, bid, ask, and timestamp on each trade.
PolymarketBook
Polymarket orderbook feed via WebSocket. Streams real-time best bid/ask from the CLOB WebSocket and updates on every orderbook change.
The feed handles three Polymarket WebSocket message formats automatically:
- Initial book snapshot - full L2 orderbook with bid/ask levels
- Price change updates - best bid/ask deltas
- Direct book messages - fallback top-of-book format
KalshiBook
Kalshi orderbook feed via REST polling:RESTFeed
Generic REST API polling feed for any JSON endpoint:PredictItFeed
PredictIt market contract prices via REST polling:
Snapshot mapping:
price = lastTradePrice, bid = bestBuyYesCost, ask = bestSellYesCost.
Handles HTTP 429 with automatic exponential backoff.
ManifoldFeed
Manifold Markets probability feed via REST polling:
Snapshot mapping:
price = probability, volume_24h = volume.
ESPNFeed
Live sports scores from ESPN’s scoreboard API:
Snapshot mapping:
price = home score, bid = away score, volume_24h = period/quarter. The source field encodes the game status ("in_progress", "scheduled", "final").
NWSFeed
National Weather Service data in two modes:Forecast mode (default)
Alerts mode
Forecast mapping:
price = temperature, bid = wind speed, ask = precipitation chance.
Alerts mapping: price = 1.0 if active alerts else 0.0, bid = alert count. Source encodes severity.
RESTJsonPathFeed
Flexible REST feed that extracts values from any JSON API using dot-notation paths:"price"→json["price"]"data.market.price"→json["data"]["market"]["price"]"markets.0.lastPrice"→json["markets"][0]["lastPrice"]- Numeric segments try array index first, then object key
- String values are auto-parsed to
f64
ChainlinkFeed
On-chain Chainlink price oracle feed. ReadslatestRoundData() from any Chainlink aggregator proxy contract via JSON-RPC eth_call. Works with any EVM chain - Ethereum, Arbitrum, Polygon, BSC, etc.
Snapshot mapping:
price = on-chain price (divided by 10^decimals), timestamp = on-chain updatedAt.
Common contract addresses (Ethereum mainnet):
MempoolFeed
Polygon mempool watcher that monitors pending transactions to Polymarket’s CTF exchange contracts. Provides visibility into large pending orders before they confirm on-chain.
Snapshot mapping:
price= number of pending CTF tradesvolume_24h= total pending USDC volumebid= largest pending buyask= largest pending selllast_trade_size= largest single trade
AlpacaFeed
Real-time stock and ETF data from Alpaca Markets via WebSocket, streaming trades and quotes for one or more symbols.CoinbaseFeed
Coinbase Advanced Trade real-time ticker data via WebSocket for crypto trading pairs.RobinhoodFeed
Robinhood crypto quotes via REST polling at a configurable interval.IBKRFeed
Interactive Brokers market data feed via REST polling against the Client Portal API. Supports stocks, options, futures, and ForecastEx event contracts.CalendarFeed
Economic event and earnings calendar feed. Polls bundled or API-provided event data and maps the nearest upcoming event to FeedSnapshot fields.
Snapshot mapping:
bid = seconds until next event, ask = event type code.
TreasuryFeed
Treasury yield curve data from the Federal Reserve Economic Data (FRED) API. Polls multiple maturity series and maps the primary series to the price field.
Snapshot mapping:
price = yield for primary_series (default 10Y).
Feed Data in Context
Each feed is accessible in pipeline functions viactx.feeds:
FeedSnapshot (Engine Level)
At the Engine level, feed data is stored asFeedSnapshot objects:
Feed Staleness
In live mode, the strategy loop checks feed staleness before quoting. If any feed is stale (no update within the threshold), quoting is skipped for that cycle:FeedData.is_stale() method checks staleness:
Engine-Level Feed Management
When using the Engine directly, start feeds withstart_feed():