GeminiGemini
Demo environmentGet API key
  • Overview
  • Crypto Trading
  • Prediction Markets
  • Perpetuals
  • Stocks
  • API Reference
  • SDKs & Tools
Changelog
Gemini logoGemini logo

© 2026 Gemini Space Station, Inc.

Overview
Spot
    OverviewGet started
    Orders API
    Market Data API
    Fund Management API
    Instant Orders API
    WebSocket API
      OverviewAuthenticationMessage FormatPublic & Private Streams
    FIX API
Margin
    Overview
    Margin REST API
      Get Margin Account SummaryGet Margin Interest RatesPreview Margin Order Impact
Staking
    Overview
    Staking REST API
      List Staking BalancesStake Crypto FundsUnstake Crypto FundsList Staking Event HistoryList Staking RatesList Staking Rewards
Clearing
    Clearing REST API
      Clearing Orders
      Broker & Trade Operations
AuthenticationMessage Format
Streams
    OverviewBook TickerL2 Partial DepthL2 Differential DepthTrade StreamOrder EventsBalance Updates
Utility
    conninfopingsubscribelist_subscriptionsunsubscribetime
L2 Data
    depth
Trading
    order.cancelorder.cancel_allorder.cancel_sessionorder.placerfq.confirm_quoterfq.createrfq.submit_quoterfq.withdraw_quote
WebSocket API

Stream Reference

Core API

Book, depth, trade, order, and balance streams share this reference across supported products.

The Gemini WebSocket API provides real-time market data and account event streams:

  • L2 Order Book depth and tickers
  • Trade events and candles
  • Account-level orders and balance updates

Book Ticker

SchemaFrequencyDescription
{symbol}@bookTickerReal-timeReal time updates to the best bid/ask price for an order book.
Try Itbtcusd@bookTicker
disconnected
Code
{ "u": 1751505576085, "E": 1751508438600117161, "s": "btcusd", "b": "45000.50", "B": "1.25000000", "a": "45001.00", "A": "0.75000000" }
FieldTypeDescription
unumberUpdate ID
EnumberEvent time (nanoseconds)
sstringSymbol
bstringBest bid price
BstringBest bid quantity
astringBest ask price
AstringBest ask quantity
cstringLast trade price (present once the book has traded; omitted otherwise)
CstringLast trade size (present once the book has traded; omitted otherwise)

L2 Partial Depth Streams

SchemaFrequencyDescription
{symbol}@depth5Periodic (1s)Periodic snapshot of the top 5 levels once per second
{symbol}@depth10Periodic (1s)Top 10 levels
{symbol}@depth20Periodic (1s)Top 20 levels
{symbol}@depth5@100msPeriodic (100ms)Top 5 levels every 100 milliseconds
{symbol}@depth10@100msPeriodic (100ms)Top 10 levels
{symbol}@depth20@100msPeriodic (100ms)Top 20 levels
Try Itbtcusd@depth10@100ms
disconnected
Code
{ "lastUpdateId": 12345678, "bids": [ ["45000.50", "1.25000000"], ["45000.25", "0.50000000"] ], "asks": [ ["45001.00", "0.75000000"], ["45001.25", "2.00000000"] ] }
FieldTypeDescription
lastUpdateIdnumberLast update ID
bidsarrayArray of [price, quantity]
asksarrayArray of [price, quantity]

L2 Differential Depth Streams

SchemaFrequencyDescription
{symbol}@depthPeriodic (1s)List of all changed price levels in the last second
{symbol}@depth@100msPeriodic (100ms)In the last 100 milliseconds
Try Itbtcusd@depth@100ms
disconnected

Initial Snapshot

Use the snapshot connection parameter to receive an initial orderbook snapshot when subscribing. Connect with wss://ws.gemini.com?snapshot=-1 for a full snapshot, or specify a positive number for top N levels.

Quantity zero indicates price level removal.

Code
{ "e": "depthUpdate", "E": 1751508260659505382, "s": "btcusd", "U": 12345677, "u": 12345678, "b": [ ["45000.50", "1.25000000"], ["45000.25", "0.00000000"] ], "a": [ ["45001.00", "0.75000000"] ] }
FieldTypeDescription
estringEvent type ("depthUpdate")
EnumberEvent time (nanoseconds)
sstringSymbol
UnumberFirst update ID in this event
unumberLast update ID in this event
barrayBid updates [price, quantity]
aarrayAsk updates [price, quantity]

Trade Stream

SchemaFrequencyDescription
{symbol}@tradeReal-timeReal time trade executions
Try Itbtcusd@trade
disconnected
Code
{ "E": 1759873803503023900, "s": "btcusd", "t": 2840140956529623, "p": "120649.97000", "q": "0.0046190900", "m": true }
FieldTypeDescription
EnumberEvent time (nanoseconds)
sstringSymbol
tnumberTrade ID
pstringPrice
qstringQuantity
mbooleanIs buyer the maker

Order Events

Requires an authenticated session

SchemaFrequencyDescription
orders@accountReal-timeReal time order activity for the account associated with the authenticated API key
orders@sessionReal-timeReal time order activity for the authenticated API key
Code
# Order Event - New { "e":"orderUpdate", "E":1759291847686856569, "s":"BTCUSD", "i":73797746498585286, "c":"my-order-1759291847503", "S":"BUY", "o":"LIMIT", "X":"NEW", "p":"1.00000", "q":"0.0000100000", "z":"0.0000100000", "T":1759291847686856569 } # Order Event - Canceled { "e":"orderUpdate", "E":1759291847731455006, "s":"BTCUSD", "i":73797746498585286, "c":"my-order-1759291847503", "X":"CANCELED", "T":1759291847731455006 }
FieldTypeDescription
estringEvent type (orderUpdate)
EnumberEvent time (nanoseconds)
sstringSymbol
inumberOrder ID
cstringClient order ID. For RFQ maker fills, this is the clientId supplied to rfq.submit_quote, or Gemini's deterministic RFQ client order ID when omitted.
SstringSide, BUY / SELL
ostringType, LIMIT / MARKET / STOP_LIMIT / STOP_MARKET
XstringStatus, NEW / OPEN / FILLED / PARTIALLY_FILLED / CANCELED / REJECTED / MODIFIED
pstringOrder price
PstringStop price (0 when not a stop order)
qstringOriginal quantity
zstringRemaining quantity
ZstringExecuted quantity. For FILLED / PARTIALLY_FILLED events, this is the quantity filled in the last execution. For CANCELED and other events, this is the cumulative quantity filled over the lifetime of the order. Use Z (not the order status) to determine how much filled — e.g. a fully-filled IOC terminates as CANCELED.
LstringLast execution price
tnumberTrade ID
nstringFee amount (only present in 'FILLED' events)
mbooleanMaker flag on fills: true = maker, false = taker (present on fills only)
rstringRejection reason
TnumberUpdate time (nanoseconds)
OstringEvent outcome for event contracts, YES / NO
Prediction markets

Prediction Market order events use this core stream and add the O event-outcome field.

Fields with empty or zero values may be omitted from the event.

Post-only and immediate time-in-force orders are accepted, then cancelled — they are never REJECTED:

  • MOC (maker-or-cancel / post-only): if it would take liquidity, the order is cancelled with MakerOrCancelWouldTake and never fills.
  • IOC (immediate-or-cancel): fills whatever crosses immediately, then cancels the remainder with ImmediateOrCancelWouldPost. A fully-filled IOC still ends with a CANCELED event — so determine what filled from the executed quantity (Z), never from the final order status.
  • FOK (fill-or-kill): fills completely and immediately, or is cancelled in full with FillOrKillWouldNotFill (no partial fills).

order.place for these still returns a 200 response with an initial NEW; a true rejection returns a non-200 status with an error code.

Rejection Reasons

When an order is REJECTED, the r field contains one of:

ReasonDescription
MarketNotOpenMarket is closed or paused
InsufficientFundsAccount lacks sufficient balance
InvalidPricePrice violates constraints
LimitPriceOffTickPrice does not align with tick size
InvalidQuantityQuantity below minimum or off increment
InvalidStopPriceStop price violates constraints
InvalidTotalSpendTotal spend calculation error
DuplicateOrderDuplicate client order ID
InsufficientLiquidityNot enough liquidity at price
UnknownInstrumentTrading pair does not exist

Cancellation Reasons

When an order is CANCELED by the system, the r field contains one of:

ReasonDescription
SelfCrossPreventedSelf-trade prevention triggered
FillOrKillWouldNotFillFOK order could not fill completely
ImmediateOrCancelWouldPostIOC order would post to book
MakerOrCancelWouldTakeMOC order would take liquidity
AuctionCancelledAuction-related cancellation
ExceedsPriceLimitsPrice moved beyond limits

Balance Updates

Requires an authenticated session

SchemaFrequencyDescription
balances@accountReal-timeReal time balance updates for the account associated with the authenticated API key
balances@account@1sPeriodic (1s)Periodic snapshot of all balances every second for the account associated with the authenticated API key

The balances@account stream pushes updates in real time whenever a balance change occurs, and only includes the assets that changed. The balances@account@1s stream sends a complete snapshot of all account balances every second, regardless of whether they changed. On subscribe, balances@account@1s will immediately send the current balances if available.

Code
# Balance Update { "e": "balanceUpdate", "E": 1768250434780000000, "u": 1768250421600000000, "B": [ { "a": "USD", "f": "207.39", "c": "207.39" } ] }
FieldTypeDescription
estringEvent type ("balanceUpdate")
EnumberEvent time (nanoseconds)
unumberTime of the last account update (nanoseconds)
BarrayBalance updates
astringAsset code
fstringAvailable balance (amount available to trade)
cstringConfirmed balance (total balance including pending)

Contract Status

Prediction marketsAdds to or differs from the core API.

Prediction-market contract lifecycle events — status transitions (e.g. Awaiting Approval → Approved → Active) and strike-populated moments for Up/Down contracts.

SchemaFrequencyDescription
contractStatusReal-timeStatus changes and strike-price updates for prediction-market contracts
Code
# Strike-based contract (e.g. HI78999D63) { "e": "contractStatus", "E": 1776871540195, "s": "gemi-btc15m2604221545-hi78999d63", "k": "btc15m2604221545", "c": "HI78999D63", "i": 134794, "p": "78999.63", "o": "Awaiting Approval", "n": "Approved" } # Up/Down contract (no numeric strike — `p` omitted until populated) { "e": "contractStatus", "E": 1776871295498, "s": "gemi-btc05m2604221630-up", "k": "btc05m2604221630", "c": "UP", "i": 134791, "o": "Awaiting Approval", "n": "Approved" }
FieldTypeDescription
estringEvent type (contractStatus)
EnumberEvent time (Unix milliseconds)
sstringInstrument symbol
kstringEvent ticker
cstringContract ticker (e.g. HI78999D63, UP, DOWN)
inumberContract ID
pstringStrike price parsed from the contract ticker. Omitted for Up/Down contracts until the strike is set at activation
ostringPrevious status
nstringNew status

For Up/Down contracts, p is omitted while the strike is unknown and included once it is set — subscribers can detect strike availability by the field's presence.

Message FormatFIX API
On this page
  • Book Ticker
  • L2 Partial Depth Streams
  • L2 Differential Depth Streams
  • Trade Stream
  • Order Events
    • Rejection Reasons
    • Cancellation Reasons
  • Balance Updates
  • Contract Status
JSON
JSON
JSON
JSON
JSON
JSON
JSON