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.

TypeScript SDK — Predictions: Positions & Terms

Query open and settled positions, and manage prediction markets terms acceptance. All methods are on client.predictions. See the patterns guide for the recommended terms-acceptance flow.

getPositions

POST /v1/prediction-markets/positions · Authenticated

Retrieve your current open prediction market positions. Despite being a POST endpoint, parameters are passed as query params. Returns a PositionsResponse with a .positions array and .total count.

Code
// All positions const result = await client.predictions.getPositions(); // Filter by event with pagination and sort const filtered = await client.predictions.getPositions({ eventTicker: "FEDJAN26", limit: 50, offset: 0, sort: "-positionValue", }); for (const pos of filtered.positions ?? []) { console.log(pos.symbol, pos.totalQuantity, pos.avgPrice, pos.outcome); } console.log(filtered.total); // total position count

Sort options: "positionValue", "+positionValue", "-positionValue", "unrealizedPnl", "+unrealizedPnl", "-unrealizedPnl", "expiryDate", "+expiryDate", "-expiryDate". Prefix + for ascending, - for descending.

Note — Although this uses POST on the wire, the SDK passes eventTicker, limit, offset, and sort as query parameters, not a request body. POST endpoints are never automatically retried by the SDK.

getSettledPositions

POST /v1/prediction-markets/positions/settled · Authenticated

Retrieve your settled (resolved) prediction market positions. Despite being a POST endpoint, parameters are query params. Returns a SettledPositionsResponse with a .positions array and .total count.

Code
const settled = await client.predictions.getSettledPositions({ eventTicker: "FEDJAN26", limit: 20, sort: "-date", withCashOuts: true, }); for (const pos of settled.positions ?? []) { console.log(pos.instrumentSymbol, pos.payout, pos.resolutionSide, pos.netProfit); } // Cash-outs (only present when withCashOuts: true) if (settled.cashOuts) { for (const co of settled.cashOuts) { console.log(co.instrumentSymbol, co.proceeds, co.netProfit); } }

Sort options: "date", "-date", "payout", "+payout", "-payout". A bare field name defaults to descending.

Note — Although this uses POST on the wire, the SDK passes parameters as query parameters. POST endpoints are never automatically retried by the SDK.

acceptTerms

POST /v1/prediction-markets/terms/accept · Authenticated

Accept the latest prediction markets terms of service. This is a POST mutation — never automatically retried. You must call this before placing orders if you haven't already accepted.

Code
const result = await client.predictions.acceptTerms(); console.log(result.success); // true

getPredictionMarketsTerms

GET /v1/prediction-markets/terms · Public

Retrieve the current prediction markets terms of service. Returns a PredictionMarketsTerms object with termsType, version, content, and updatedAt fields.

Code
const terms = await client.predictions.getPredictionMarketsTerms(); console.log(terms.version); // e.g. 3 console.log(terms.content); // terms text console.log(terms.updatedAt); // ISO 8601 timestamp

Auto-retry — This GET endpoint automatically retries on 429/502/503/504 status codes.

getPredictionMarketsTermsStatus

GET /v1/prediction-markets/terms/status · Authenticated

Check whether the authenticated account has accepted the latest terms. Returns a PredictionMarketsTermsStatus object for callers that want a proactive UI check. Order endpoints remain authoritative and return AcceptTermsRequired when terms are needed.

Code
const status = await client.predictions.getPredictionMarketsTermsStatus(); console.log(status.hasAcceptedLatest); // boolean console.log(status.acceptedVersion); // number | null console.log(status.latestVersion); // number | null if (!status.hasAcceptedLatest) { await client.predictions.acceptTerms(); }

Auto-retry — This GET endpoint automatically retries on transient failures.

Tip — Use this endpoint when the UI needs to show terms state before an order attempt. Otherwise, handle AcceptTermsRequired from the order endpoint. See the patterns guide for the recommended flow.

What's next

  • Events & Discovery — browse and search prediction market events
  • Order Management — place, cancel, and query orders
  • Combos — multi-leg combo instruments
  • Volume & Metrics — daily/hourly volume and per-event share metrics
  • Request Validation — how client-side validation works
On this page
  • What's next
TypeScript
TypeScript
TypeScript
TypeScript
TypeScript