---
title: "Horizon + Robinhood"
description: "Trade crypto on Robinhood for commission-free execution alongside prediction markets."
icon: "/images/exchanges/robinhood.svg"
---

[Robinhood](https://robinhood.com) offers commission-free crypto trading. Horizon connects to Robinhood's crypto trading API for spot execution alongside prediction market strategies.

## Quick Setup

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

## Credentials

<Tabs>
  <Tab title="Explicit">
    ```python
    hz.Robinhood(api_key="rh_xxxxxxxx...")
    ```
  </Tab>
  <Tab title="Environment variables">
    ```bash
    export ROBINHOOD_API_KEY="rh_xxxxxxxx..."
    ```

    ```python
    hz.Robinhood()  # reads from env
    ```
  </Tab>
</Tabs>

## Robinhood Configuration

```python
@dataclass
class Robinhood:
    api_key: str | None = None
    api_url: str = "https://trading.robinhood.com/api/v1"
```

| Field | Default | Description |
|-------|---------|-------------|
| `api_key` | `None` | Robinhood API key (env: `ROBINHOOD_API_KEY`) |
| `api_url` | `https://trading.robinhood.com/api/v1` | Override API base URL |

## Authentication

Robinhood uses Bearer token auth:

- `Authorization: Bearer {api_key}`

## Market Data Feed

Robinhood uses REST polling (no public WebSocket):

```python
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.

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `symbols` | `list[str]` | required | Crypto pairs to poll (e.g., `["BTC-USD"]`) |
| `api_key` | `str` | `None` | Override API key (defaults to env vars) |
| `interval` | `float` | `5.0` | Polling interval in seconds |

## Symbol Mapping

Robinhood uses `BASE-QUOTE` format for crypto:

```python
market = hz.Market(id="BTC-USD", name="Bitcoin / USD")
```

| Horizon Field | Robinhood Field | Notes |
|---------------|----------------|-------|
| `OrderRequest.market_id` | `symbol` | e.g., "BTC-USD", "ETH-USD" |
| `OrderRequest.order_side` | `side` | `"buy"` or `"sell"` |
| `OrderRequest.price` | `limit_price` | Limit order price |
| `OrderRequest.size` | `quantity` | Base currency quantity |

## Multi-Exchange

```python
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](https://robinhood.com) or website
2. Navigate to **Account** > **Settings** > **API Trading**
3. Generate a new API key
4. Store the key securely
