Skip to main content
Feeds provide live price data to your pipeline functions via ctx.feeds. Each feed runs as an async task on the engine’s tokio runtime.
Exchange Orderbooks: PolymarketBook, KalshiBook Crypto Prices: BinanceWS, CoinbaseFeed, RobinhoodFeed Equities & Options: AlpacaFeed, IBKRFeed Prediction Markets: PredictIt, Manifold Alternative Data: ESPN, NWS, CalendarFeed, TreasuryFeed On-Chain Oracles: Chainlink, Mempool Generic: REST, RESTJsonPath

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:
The feed connects to Binance’s trade stream and updates 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.
You can pass either a market slug (e.g., "will-btc-hit-100k") or a numeric CLOB token ID. When a slug is provided, Horizon automatically resolves it to the YES token ID via the Gamma API on startup (2 retry attempts, 15s timeout). If resolution fails, the slug is used as-is.
The feed handles three Polymarket WebSocket message formats automatically:
  1. Initial book snapshot - full L2 orderbook with bid/ask levels
  2. Price change updates - best bid/ask deltas
  3. Direct book messages - fallback top-of-book format
Asset ID filtering ensures only data for the subscribed YES token is used (Polymarket sends updates for both YES and NO tokens on the same channel).

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:
Path resolution:
  • "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
RESTJsonPathFeed is the most flexible feed - use it to pull data from any public API (CoinGecko, weather services, sports APIs, etc.) without writing custom feed code.

ChainlinkFeed

On-chain Chainlink price oracle feed. Reads latestRoundData() 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):
Find contract addresses for any chain at data.chain.link. Chainlink feeds work on Ethereum, Arbitrum, Polygon, BSC, Avalanche, and more - just change the rpc_url.

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 trades
  • volume_24h = total pending USDC volume
  • bid = largest pending buy
  • ask = largest pending sell
  • last_trade_size = largest single trade
Default CTF addresses (Polygon):
Use a private/premium RPC endpoint for mempool access. Public RPCs may not support pending block queries.

AlpacaFeed

Real-time stock and ETF data from Alpaca Markets via WebSocket, streaming trades and quotes for one or more symbols.
Credentials are resolved from constructor args first, then environment variables. The sip data source provides consolidated tape from all US exchanges but requires a paid Alpaca subscription.

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.
Look up contract IDs (conids) via the IBKR Contract Search API or TWS. Set paper=False for live trading data.

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 via ctx.feeds:

FeedSnapshot (Engine Level)

At the Engine level, feed data is stored as FeedSnapshot objects:
Other Engine feed methods:

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:
The FeedData.is_stale() method checks staleness:

Engine-Level Feed Management

When using the Engine directly, start feeds with start_feed():

Multiple Feeds

Use multiple feeds to combine data sources across markets: