Skip to main content
Partially verified. As of v0.8.7+, Coinbase Advanced Trade now uses the correct ES256 JWT bearer authentication with PEM-encoded EC P-256 keys (the format from cloud.coinbase.com/access/api). Pass the key ID as api_key and the PEM private key as api_secret. The fixed /orders/historical/batch endpoint is also corrected. Has not been tested against a live Coinbase account, so verify behavior matches expectations before going live with significant size.
Coinbase Advanced Trade is a crypto exchange with deep liquidity across hundreds of trading pairs. Horizon connects to Coinbase for spot crypto trading and cross-asset strategies alongside prediction markets.

Quick Setup

Credentials

Coinbase Configuration

Authentication

Coinbase uses HMAC-SHA256 signature auth. Three headers are sent on every request:
  • CB-ACCESS-KEY: {api_key}
  • CB-ACCESS-SIGN: HMAC-SHA256(timestamp + method + path + body)
  • CB-ACCESS-TIMESTAMP: {unix_timestamp}

Market Data Feed

Real-time crypto ticker via WebSocket:
The feed connects to wss://advanced-trade-ws.coinbase.com and subscribes to the ticker channel with authenticated messages. Each product gets its own snapshot entry keyed by {feed_name}:{PRODUCT_ID} (e.g., btc:BTC-USD), plus a feed-level entry with the latest update.

Symbol Mapping

Coinbase uses product IDs in BASE-QUOTE format:
Coinbase uses Side.Long for all positions. Prediction market concepts like Side.Yes / Side.No do not apply to crypto orders.

Multi-Exchange

Use Coinbase alongside prediction markets for crypto-correlated hedging:

Getting API Keys

  1. Sign in at coinbase.com/advanced-trade
  2. Go to Settings > API
  3. Create a new API key with Trade permissions
  4. Save both the API key and secret securely