US Only
Prediction markets are currently only available to users in the United States.
Trade on real-world events using Gemini's trading infrastructure. This guide takes you from zero to a live trade in three steps — each one independently runnable so you can verify as you go.
Before You Start
- Accept terms: Log into the Gemini Exchange and accept the Prediction Markets terms of service
- Create an API key: Visit Settings/API and create a key with these settings:
- Scope to your trading account
- Enable "Uses a time-based nonce" (a security timestamp — just check the box)
- Enable "Trading" (grants
NewOrderandCancelOrder)
- Save your API key and API secret — you'll need both below
- Fund your account: You need USD in your Gemini account to trade. Buying 100 contracts at $0.27 costs $27.
API Key Requirements
WebSocket authentication requires account-scoped keys with time-based nonces. Keys without these settings will be rejected at connection time.
Step 1: Find a Market
Use the REST API to browse active markets. This is the only REST call you need — everything else happens over WebSocket.
Code
Code
The field you need is instrumentSymbol — that's GEMI-PRES2028-VANCE. This is the trading symbol you'll use for WebSocket subscriptions and orders. (The shorter ticker field is just for display.)
How Pricing Works
Every contract pays $1 if correct, $0 if wrong. The price is the probability:
- YES at $0.27 = market thinks 27% chance Vance wins
- NO at $0.73 = the other side of that prediction (YES + NO = $1.00 always)
- Buy 100 YES at $0.27 = pay $27, win $100 if correct ($73 profit), lose $27 if wrong
Settlement: When an event resolves, winning contracts automatically pay out $1 each to your account. Losing contracts expire worthless. You don't need to take any action.
Step 2: Connect and See Live Prices
A REST API makes you ask for updates. A WebSocket pushes updates to you the instant they happen. You open one connection and keep it open.
Run this script to connect and stream live prices. Replace your-api-key and your-api-secret with your credentials.
Node.js
You should see prices streaming in your terminal:
Code
If you see prices, your connection and authentication are working. Press Ctrl+C to stop, then move on to Step 3.
Try it in the playground → — subscribe to any stream without writing code.
Step 3: Place an Order
Now add order placement. This script connects, subscribes to prices and your order updates, waits for a price, then places a limit order.
Node.js
You should see:
Code
Try it in the playground → — place orders interactively without writing code.
Your order is now live on the book at $0.27. When someone sells at your price, you'll see:
Code
Cancelling Orders
To cancel, send order.cancel with the order ID from the i field in the order event:
Node.js
REST vs WebSocket
| Use Case | Channel | Why |
|---|---|---|
| Browse markets | REST GET /v1/prediction-markets/events | One-time lookups |
| Check positions | REST POST /v1/prediction-markets/positions | Snapshot queries |
| Live prices | WebSocket {symbol}@bookTicker | Real-time, no polling |
| Place/cancel orders | WebSocket order.place / order.cancel | Lowest latency |
| Order fills | WebSocket orders@account | Pushed as they happen |
| Balance changes | WebSocket balances@account | Real-time buying power |
Next Steps
- WebSocket playground — Test every method interactively
- Stream reference — All data streams (depth, trades, order events)
- Authentication details — Signature generation for other languages
- Prediction Markets API — Full REST API reference
- Ticker formats — How prediction market symbols are structured
Troubleshooting
Connection rejected: Auth headers must be sent during the WebSocket handshake — you cannot authenticate after connecting. Ensure your key is account-scoped with time-based nonces.
-2010 Order rejected: Price must be between $0.01-$0.99, quantity must be greater than 0, and eventOutcome must be YES or NO. The market may also be closed.
-1002 Authentication required: Your connection is not authenticated. Trading methods and orders@account require auth headers at connect time.
403 Forbidden / TERMS_NOT_ACCEPTED: Accept the Prediction Markets terms in the Gemini Exchange UI before trading. On WebSocket, this surfaces as -2010 with a rejection reason.
InsufficientFunds: Ensure your account has enough USD. 100 contracts at $0.27 = $27.
Important Notes
API Stability: Only fields documented in the API specification are considered stable. Undocumented fields in API responses may change or be removed without notice.

