Skip to main content
Robinhood offers commission-free crypto trading. Horizon connects to Robinhood’s crypto trading API for spot execution alongside prediction market strategies.

Quick Setup

hz.run(
    name="rh_crypto",
    exchange=hz.Robinhood(api_key="..."),
    mode="live",
    ...
)

Credentials

hz.Robinhood(api_key="rh_xxxxxxxx...")

Robinhood Configuration

@dataclass
class Robinhood:
    api_key: str | None = None
    api_url: str = "https://trading.robinhood.com/api/v1"
FieldDefaultDescription
api_keyNoneRobinhood API key (env: ROBINHOOD_API_KEY)
api_urlhttps://trading.robinhood.com/api/v1Override API base URL

Authentication

Robinhood uses Bearer token auth:
  • Authorization: Bearer {api_key}

Market Data Feed

Robinhood uses REST polling (no public WebSocket):
hz.run(
    feeds={
        "btc": hz.RobinhoodFeed(symbols=["BTC-USD"]),
        "eth": hz.RobinhoodFeed(symbols=["ETH-USD"], interval=3.0),
    },
    ...
)
The feed polls Robinhood’s quote endpoint at the configured interval for each symbol.
FieldTypeDefaultDescription
symbolslist[str]requiredCrypto pairs to poll (e.g., ["BTC-USD"])
api_keystrNoneOverride API key (defaults to env vars)
intervalfloat5.0Polling interval in seconds

Symbol Mapping

Robinhood uses BASE-QUOTE format for crypto:
market = hz.Market(id="BTC-USD", name="Bitcoin / USD")
Horizon FieldRobinhood FieldNotes
OrderRequest.market_idsymbole.g., “BTC-USD”, “ETH-USD”
OrderRequest.order_sideside"buy" or "sell"
OrderRequest.pricelimit_priceLimit order price
OrderRequest.sizequantityBase currency quantity
Robinhood uses Side.Long for all positions. Prediction market concepts like Side.Yes / Side.No do not apply to crypto orders.

Multi-Exchange

hz.run(
    name="rh_hedge",
    exchange=[
        hz.Kalshi(),       # prediction market
        hz.Robinhood(),    # crypto hedge
    ],
    feeds={
        "btc_event": hz.KalshiBook("KXBTC-25MAR15"),
        "btc_spot": hz.RobinhoodFeed(symbols=["BTC-USD"]),
    },
    pipeline=[my_strategy],
)

Getting API Keys

  1. Open the Robinhood app or website
  2. Navigate to Account > Settings > API Trading
  3. Generate a new API key
  4. Store the key securely