openapi: 3.2.0 info: title: Gemini Prediction Markets Positions API description: 'API for trading prediction market contracts on Gemini. **Note:** Only fields documented in this specification are considered stable. Undocumented fields in API responses may change or be removed without notice.' version: 1.0.0 contact: name: Gemini API Support servers: - url: https://api.gemini.com description: Production - url: https://api.sandbox.gemini.com description: Sandbox tags: - name: Positions description: Authenticated endpoints for viewing positions and order history. Use REST positions for recovery or audit snapshots after reconnects, missed WebSocket messages, and settlement windows. paths: /v1/prediction-markets/orders/active: post: tags: - Positions summary: Get active orders description: Returns a list of currently open (active) orders. Requires authentication. operationId: getActiveOrders security: - apiKey: [] payloadAuth: [] signatureAuth: [] requestBody: content: application/json: schema: type: object properties: symbol: type: string description: Filter by contract instrument symbol example: GEMI-FEDJAN26-DN25 limit: type: integer description: Maximum number of results to return (default 50, max 100) default: 50 maximum: 100 offset: type: integer description: Number of results to skip for pagination default: 0 responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/OrdersResponse' examples: activeOrders: summary: List of active orders value: orders: - orderId: 12345678901 status: open symbol: GEMI-FEDJAN26-DN25 side: buy outcome: 'yes' orderType: limit quantity: '100' filledQuantity: '25' remainingQuantity: '75' price: '0.65' avgExecutionPrice: '0.64' createdAt: '2025-12-15T10:30:00.000Z' updatedAt: '2025-12-15T11:00:00.000Z' cancelledAt: null contractMetadata: contractId: contract_123 contractName: FEDJAN26-DN25 contractTicker: FEDJAN26-DN25 eventTicker: FEDJAN26 eventName: Will Fed Funds Rate drop at least 0.25% at January 2026 meeting? category: economics contractStatus: active imageUrl: https://example.com/fed.png expiryDate: '2026-01-31T23:59:59.000Z' resolvedAt: null description: Resolves YES if Federal Reserve lowers the target rate by 0.25% or more at the January 2026 FOMC meeting - orderId: 12345678902 status: open symbol: GEMI-FEDJAN26-DN25 side: sell outcome: 'yes' orderType: limit quantity: '50' filledQuantity: '0' remainingQuantity: '50' price: '0.65' avgExecutionPrice: null createdAt: '2025-12-15T12:00:00.000Z' updatedAt: '2025-12-15T12:00:00.000Z' cancelledAt: null contractMetadata: contractId: contract_123 contractName: FEDJAN26-DN25 contractTicker: FEDJAN26-DN25 eventTicker: FEDJAN26 eventName: Will Fed Funds Rate drop at least 0.25% at January 2026 meeting? category: economics contractStatus: active imageUrl: https://example.com/fed.png expiryDate: '2026-01-31T23:59:59.000Z' resolvedAt: null description: Resolves YES if Federal Reserve lowers the target rate by 0.25% or more at the January 2026 FOMC meeting pagination: limit: 50 offset: 0 count: 2 '401': $ref: '#/components/responses/Unauthorized' '500': $ref: '#/components/responses/InternalError' '503': $ref: '#/components/responses/ServiceUnavailable' /v1/prediction-markets/orders/history: post: tags: - Positions summary: Get order history description: 'Returns historical orders (filled or cancelled) for the authenticated user. Use `status: filled` with `from` and `to` to retrieve fully filled orders in a bounded time window. The range is `[from, to)`: `from` is inclusive and `to` is exclusive. A time-bounded response contains at most `limit` results and ignores `offset`; split high-volume periods into non-overlapping ranges. Use `/orders/active` for open orders.' operationId: getOrderHistory security: - apiKey: [] payloadAuth: [] signatureAuth: [] requestBody: content: application/json: schema: type: object properties: status: type: string description: Filter by order status enum: - filled - cancelled symbol: type: string description: Filter by contract instrument symbol example: GEMI-FEDJAN26-DN25 limit: type: integer description: Maximum number of results to return. Defaults to 50 and is capped at 1000. default: 50 minimum: 1 maximum: 1000 offset: type: integer description: Number of results to skip for pagination. Offset is ignored when `from` or `to` is supplied. default: 0 minimum: 0 maximum: 10000 from: type: integer format: int64 description: Inclusive start of the order-closed time range, expressed as Unix epoch milliseconds. Use with `to` for a UTC daily window. example: 1775001600000 to: type: integer format: int64 description: Exclusive end of the order-closed time range, expressed as Unix epoch milliseconds. `from` must not be later than `to`. example: 1775088000000 responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/OrdersResponse' '400': description: Invalid status parameter or date range content: application/json: schema: $ref: '#/components/schemas/Error' '401': $ref: '#/components/responses/Unauthorized' '500': $ref: '#/components/responses/InternalError' '503': $ref: '#/components/responses/ServiceUnavailable' /v1/prediction-markets/positions: post: tags: - Positions summary: Get positions description: Returns current filled positions for the authenticated user. All query parameters are optional; omitting them preserves the legacy unpaginated, unsorted behavior. operationId: getPositions security: - apiKey: [] payloadAuth: [] signatureAuth: [] parameters: - name: eventTicker in: query required: false description: Filter positions to a single event ticker (e.g. `FEDJAN26`). Positions on sub-events whose `parentEventTicker` matches the value may also be included. schema: type: string - name: limit in: query required: false description: Maximum number of positions to return. Clamped to `[1, 1000]` when supplied. Omit for legacy unpaginated behavior. schema: type: integer minimum: 1 maximum: 1000 - name: offset in: query required: false description: Number of positions to skip for pagination. Floor-clamped to `0` when supplied. Ignored when `limit` is omitted (the response is unpaginated). schema: type: integer minimum: 0 - name: sort in: query required: false description: 'Sort order. Accepts `positionValue`, `unrealizedPnl`, or `expiryDate` (case-insensitive), optionally prefixed with `+` (ascending) or `-` (descending). A bare field name uses each field''s default direction: `positionValue` and `unrealizedPnl` default to descending; `expiryDate` defaults to ascending (soonest-first). `unrealizedPnl` and `expiryDate` sort NULLS LAST so positions without the sort key sink to the bottom regardless of direction. `instrumentId` ascending is the final tiebreaker for stable pagination across quote ticks. A malformed `sort` value silently falls back to `-positionValue` — no `400` is returned. ' schema: type: string enum: - positionValue - +positionValue - -positionValue - unrealizedPnl - +unrealizedPnl - -unrealizedPnl - expiryDate - +expiryDate - -expiryDate responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/PositionsResponse' examples: positions: summary: User positions value: positions: - symbol: GEMI-FEDJAN26-DN25 instrumentId: 1001 totalQuantity: '125' quantityOnHold: '10' avgPrice: '0.63' outcome: 'yes' contractMetadata: contractId: contract_123 contractName: FEDJAN26-DN25 contractTicker: FEDJAN26-DN25 eventTicker: FEDJAN26 eventName: Will Fed Funds Rate drop at least 0.25% at January 2026 meeting? category: economics contractStatus: active imageUrl: https://example.com/fed.png eventImageUrl: https://example.com/fed-event.png eventType: binary expiryDate: '2026-01-31T23:59:59.000Z' resolvedAt: null resolutionSide: null description: Resolves YES if Federal Reserve lowers the target rate by 0.25% or more at the January 2026 FOMC meeting sortOrder: null parentEventTicker: null template: binary color: null startTime: null prices: buy: 'yes': '0.63' 'no': '0.37' sell: 'yes': '0.61' 'no': '0.35' bestBid: '0.61' bestAsk: '0.63' lastTradePrice: '0.62' resolutionSide: null isAboveAutoStartThreshold: false isLive: true realizedPl: '0' marketValue: '78.75' unrealizedPnl: '0' unrealizedPct: 0 - symbol: GEMI-FEDJAN26-DN25 instrumentId: 1001 totalQuantity: '200' quantityOnHold: '0' avgPrice: '0.36' outcome: 'no' contractMetadata: contractId: contract_123 contractName: FEDJAN26-DN25 contractTicker: FEDJAN26-DN25 eventTicker: FEDJAN26 eventName: Will Fed Funds Rate drop at least 0.25% at January 2026 meeting? category: economics contractStatus: active imageUrl: https://example.com/fed.png eventImageUrl: https://example.com/fed-event.png eventType: binary expiryDate: '2026-01-31T23:59:59.000Z' resolvedAt: null resolutionSide: null description: Resolves YES if Federal Reserve lowers the target rate by 0.25% or more at the January 2026 FOMC meeting sortOrder: null parentEventTicker: null template: binary color: null startTime: null prices: buy: 'yes': '0.37' 'no': '0.63' sell: 'yes': '0.35' 'no': '0.61' bestBid: '0.35' bestAsk: '0.37' lastTradePrice: '0.36' resolutionSide: null isAboveAutoStartThreshold: false isLive: true realizedPl: '0' marketValue: '72.00' unrealizedPnl: '0' unrealizedPct: 0 total: 2 '401': $ref: '#/components/responses/Unauthorized' '500': $ref: '#/components/responses/InternalError' '503': $ref: '#/components/responses/ServiceUnavailable' /v1/prediction-markets/positions/settled: post: tags: - Positions summary: Get settled positions description: 'Returns historically settled positions for the authenticated user. Each entry represents a position in a contract that has resolved. - `payout` — the amount received from settlement - `resolutionSide` — indicates which outcome (`yes` or `no`) won. This endpoint differs from Get positions in that it returns closed positions from settled contracts rather than current open positions.' operationId: getSettledPositions security: - apiKey: [] payloadAuth: [] signatureAuth: [] parameters: - name: eventTicker in: query description: Optional event ticker to filter settled positions to a single event (e.g. `FEDJAN26`). If omitted, all settled positions for the account are returned. required: false schema: type: string - name: limit in: query required: false description: Maximum number of settled positions to return. schema: type: integer default: 1000 minimum: 1 maximum: 1000 - name: offset in: query required: false description: Number of settled positions to skip for pagination. schema: type: integer default: 0 minimum: 0 - name: sort in: query required: false description: 'Sort order. Accepts `date` or `payout`, optionally prefixed with `+` (ascending) or `-` (descending). A bare field name defaults to descending. `date` ascending is rejected and silently falls back to the default order — settled positions are conceptually ordered most-recent-first. A malformed `sort` value also falls back silently; no `400` is returned. ' schema: type: string enum: - date - -date - payout - +payout - -payout example: -payout - name: search in: query required: false description: 'Case-insensitive substring filter. Matches against the event name, contract name, event ticker, or any ancestor category name in the contract''s category subtree (up to four levels). Whitespace is trimmed; inputs under 3 characters are dropped (GIN trigram lookup floor); inputs over 64 characters are truncated. ' schema: type: string - name: category in: query required: false description: 'Filter to settled positions whose contract''s event belongs to the named category (or any of its descendants in the category tree). Whitespace is trimmed; empty values are ignored. ' schema: type: string example: sports - name: withCashOuts in: query required: false description: 'Opt-in flag. When `true`, the response carries new sibling fields (`cashOuts`, `totalCashOutProceeds`, `totalCashOutCostBasis`, `totalCashOutNetProfit`) populated with the qualifying cash-outs in the same account-scoped time window as the returned page''s settled positions. When `false` (default) the response shape is byte-identical to the pre-`withCashOuts` contract: the `positions[]` element schema is unchanged regardless of the flag. ' schema: type: boolean default: false example: true responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/SettledPositionsResponse' examples: settledPositions: summary: Settled positions with one winning and one losing position value: positions: - accountId: 12345 instrumentId: 1001 instrumentSymbol: GEMI-FEDJAN26-DN25 position: '125' positionQuantity: '125' outcome: 'yes' payout: '125.00' resolutionSide: 'yes' settledAt: '2026-01-31T23:59:59.000Z' contractMetadata: contractId: contract_123 contractName: FEDJAN26-DN25 contractTicker: FEDJAN26-DN25 eventTicker: FEDJAN26 eventName: Will Fed Funds Rate drop at least 0.25% at January 2026 meeting? category: economics contractStatus: resolved imageUrl: https://example.com/fed.png eventImageUrl: https://example.com/fed-event.png eventType: binary expiryDate: '2026-01-31T23:59:59.000Z' resolvedAt: '2026-01-31T23:59:59.000Z' resolutionSide: 'yes' description: Resolves YES if Federal Reserve lowers the target rate by 0.25% or more at the January 2026 FOMC meeting sortOrder: null parentEventTicker: null template: binary color: null startTime: null costBasis: '78.75' realizedPnl: '0' netProfit: '46.25' - accountId: 12345 instrumentId: 1002 instrumentSymbol: GEMI-FEDJAN26-NOCUT position: '-200' positionQuantity: '200' outcome: 'no' payout: '0' resolutionSide: 'yes' settledAt: '2026-01-31T23:59:59.000Z' contractMetadata: contractId: contract_124 contractName: FEDJAN26-NOCUT contractTicker: FEDJAN26-NOCUT eventTicker: FEDJAN26 eventName: Will Fed Funds Rate drop at least 0.25% at January 2026 meeting? category: economics contractStatus: resolved imageUrl: https://example.com/fed.png eventImageUrl: https://example.com/fed-event.png eventType: binary expiryDate: '2026-01-31T23:59:59.000Z' resolvedAt: '2026-01-31T23:59:59.000Z' resolutionSide: 'yes' description: Resolves YES if Federal Reserve lowers the target rate by 0.25% or more at the January 2026 FOMC meeting sortOrder: null parentEventTicker: null template: binary color: null startTime: null costBasis: '72.00' realizedPnl: '0' netProfit: '-72.00' total: 2 settledPositionsWithCashOuts: summary: Same response with `withCashOuts=true` value: positions: - accountId: 12345 instrumentId: 1001 instrumentSymbol: GEMI-FEDJAN26-DN25 position: '125' positionQuantity: '125' outcome: 'yes' payout: '125.00' resolutionSide: 'yes' settledAt: '2026-01-31T23:59:59.000Z' contractMetadata: contractId: contract_123 contractName: FEDJAN26-DN25 contractTicker: FEDJAN26-DN25 eventTicker: FEDJAN26 eventName: Will Fed Funds Rate drop at least 0.25% at January 2026 meeting? category: economics contractStatus: resolved imageUrl: https://example.com/fed.png eventImageUrl: https://example.com/fed-event.png eventType: binary expiryDate: '2026-01-31T23:59:59.000Z' resolvedAt: '2026-01-31T23:59:59.000Z' resolutionSide: 'yes' description: Resolves YES if Federal Reserve lowers the target rate by 0.25% or more at the January 2026 FOMC meeting sortOrder: null parentEventTicker: null template: binary color: null startTime: null costBasis: '78.75' realizedPnl: '0' netProfit: '46.25' total: 1 cashOuts: - accountId: 12345 instrumentId: 1003 instrumentSymbol: GEMI-FEDJAN26-DN25 timestamp: '2026-01-28T10:15:00.000Z' filledQuantity: '10' side: sell proceeds: '6.50' costBasis: '6.30' netProfit: '0.20' contractMetadata: contractId: contract_123 contractName: FEDJAN26-DN25 contractTicker: FEDJAN26-DN25 eventTicker: FEDJAN26 eventName: Will Fed Funds Rate drop at least 0.25% at January 2026 meeting? category: economics contractStatus: resolved imageUrl: https://example.com/fed.png eventImageUrl: https://example.com/fed-event.png eventType: binary expiryDate: '2026-01-31T23:59:59.000Z' resolvedAt: '2026-01-31T23:59:59.000Z' resolutionSide: 'yes' description: Resolves YES if Federal Reserve lowers the target rate by 0.25% or more at the January 2026 FOMC meeting sortOrder: null parentEventTicker: null template: binary color: null startTime: null totalCashOutProceeds: '6.50' totalCashOutCostBasis: '6.30' totalCashOutNetProfit: '0.20' '401': $ref: '#/components/responses/Unauthorized' '500': $ref: '#/components/responses/InternalError' '503': $ref: '#/components/responses/ServiceUnavailable' /v1/prediction-markets/metrics/volume: post: tags: - Positions summary: Get volume metrics description: 'Returns per-contract share volume metrics for an event, including the authenticated user''s taker and maker volumes. All volumes are in shares (number of contracts traded), not dollar amounts. - `totalQty` — Total taker volume across all participants for this contract - `userAggressorQty` — The authenticated user''s taker (aggressor) volume - `userRestingQty` — The authenticated user''s maker (resting) volume, counted when another order fills against the user''s resting limit order An optional time range can be specified to filter trades within a specific window.' operationId: getVolumeMetrics security: - apiKey: [] payloadAuth: [] signatureAuth: [] requestBody: required: true content: application/json: schema: type: object required: - eventTicker properties: eventTicker: type: string description: The event ticker symbol example: FED260318 startTime: type: integer format: int64 description: Start of time range filter (epoch milliseconds). If omitted, defaults to the earliest contract creation time. endTime: type: integer format: int64 description: End of time range filter (epoch milliseconds). If omitted, includes all trades up to now. examples: allTime: summary: All-time volume for an event value: eventTicker: FED260318 timeRanged: summary: Volume within a specific time range value: eventTicker: FED260318 startTime: 1772412364000 endTime: 1772671564000 responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/VolumeMetricsResponse' examples: volumeMetrics: summary: Volume metrics for a multi-contract event value: eventTicker: FED260318 contracts: - symbol: GEMI-FED260318-CUT25 totalQty: '94625' userAggressorQty: '1' userRestingQty: '0' - symbol: GEMI-FED260318-CUTGT25 totalQty: '68666' userAggressorQty: '0' userRestingQty: '0' - symbol: GEMI-FED260318-HIKE totalQty: '15397' userAggressorQty: '0' userRestingQty: '0' - symbol: GEMI-FED260318-MAINTAIN totalQty: '20400' userAggressorQty: '5' userRestingQty: '0' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '500': $ref: '#/components/responses/InternalError' '503': $ref: '#/components/responses/ServiceUnavailable' components: schemas: OrderSide: type: string enum: - buy - sell Outcome: type: string enum: - 'yes' - 'no' description: The outcome being traded (Yes or No) ContractShareVolume: type: object properties: symbol: type: string description: Contract instrument symbol example: GEMI-FED260318-CUT25 totalQty: type: string description: Total taker volume across all participants (in shares) example: '94625' userAggressorQty: type: - string - 'null' description: The authenticated user's taker (aggressor) volume (in shares) example: '1' userRestingQty: type: - string - 'null' description: The authenticated user's maker (resting) volume (in shares) example: '0' PositionsResponse: type: object properties: positions: type: array items: $ref: '#/components/schemas/Position' total: type: - integer - 'null' description: Total number of positions (for pagination) OrderStatus: type: string enum: - open - filled - cancelled Error: type: object properties: error: type: string description: Error code example: InvalidInput message: type: string description: Human-readable error message example: orderId is required PositionPrices: type: - object - 'null' description: Current bid/ask/last-trade prices for the contract required: - buy - sell properties: buy: type: object properties: 'yes': type: - string - 'null' 'no': type: - string - 'null' sell: type: object properties: 'yes': type: - string - 'null' 'no': type: - string - 'null' bestBid: type: - string - 'null' bestAsk: type: - string - 'null' lastTradePrice: type: - string - 'null' VolumeMetricsResponse: type: object properties: eventTicker: type: string description: The event ticker example: FED260318 contracts: type: array items: $ref: '#/components/schemas/ContractShareVolume' CashedOutPosition: type: object required: - accountId - instrumentId - instrumentSymbol - timestamp - filledQuantity - side - proceeds - costBasis - netProfit description: 'A qualifying cash-out (early sell before contract resolution) with cost-basis context. Exposed only via the `withCashOuts=true` sibling array on `POST /v1/prediction-markets/positions/settled`. Distinct from `SettledPosition` — cash-outs don''t have a `payout` or `resolutionSide` since the contract hadn''t resolved when the user sold. ' properties: accountId: type: integer format: int64 description: Account that held the position. example: 456 instrumentId: type: integer format: int64 description: Contract instrument ID. example: 16789219 instrumentSymbol: type: string description: Contract instrument symbol. example: GEMI-FEDJAN26-DN25 timestamp: type: string format: date-time description: Wall-clock timestamp when the cash-out order closed (ISO 8601). example: '2026-05-15T14:30:00.000Z' filledQuantity: type: string description: Quantity sold (cumulative filled quantity on the cash-out order). example: '10' side: type: string enum: - sell description: Always `sell` for cash-outs. example: sell proceeds: type: string description: Amount received from the sale in USD. For prediction sells, proceeds flow through `cash_balance` rather than `closed_orders.total_spend`, so the value is derived from position-balance snapshots before/after the fill. example: '10.50' costBasis: type: string description: Cost basis allocated proportionally to the filled quantity (`(costBasisSpend / costBasisPositionBalance) * filledQuantity`). example: '10.00' netProfit: type: string description: Realized P&L from this cash-out fill (`proceeds - costBasis`). Equals the ledger `realized_pl` delta on the position-balance row pair around the fill; falls back to `0` under transient market-data lag so a missing post-fill snapshot can't poison the page. example: '0.50' contractMetadata: $ref: '#/components/schemas/ContractMetadata' SettledPosition: type: object description: A historically settled position in a resolved prediction market contract. properties: accountId: type: integer format: int64 description: Account that held the position instrumentId: type: integer format: int64 description: Unique instrument identifier for the contract instrumentSymbol: type: string description: Contract instrument symbol example: GEMI-FEDJAN26-DN25 position: type: string description: Signed position held at settlement. Positive values represent a `yes` position; negative values represent a `no` position. example: '125' positionQuantity: type: string description: Absolute quantity held at settlement (unsigned) example: '125' outcome: $ref: '#/components/schemas/Outcome' payout: type: string description: Payout received from settlement. `0` when the position lost. example: '125.00' resolutionSide: allOf: - $ref: '#/components/schemas/Outcome' description: The winning outcome of the contract settledAt: type: string format: date-time description: Settlement timestamp (ISO 8601) contractMetadata: $ref: '#/components/schemas/ContractMetadata' costBasis: type: - string - 'null' description: Total amount spent to enter the position, net of any prior realized P&L from partial sells. Omitted when cost-basis data is not available. example: '78.75' realizedPnl: type: - string - 'null' description: Realized profit or loss recorded from sells prior to settlement. Omitted when not available. example: '0' netProfit: type: - string - 'null' description: Net profit for the position, computed as `payout - costBasis + realizedPnl`. Omitted when `costBasis` is not available. example: '46.25' Position: type: object properties: symbol: type: string instrumentId: type: integer format: int64 totalQuantity: type: string description: Total position size quantityOnHold: type: string description: Quantity currently on hold from open orders avgPrice: type: string description: Average entry price outcome: $ref: '#/components/schemas/Outcome' contractMetadata: $ref: '#/components/schemas/ContractMetadata' prices: $ref: '#/components/schemas/PositionPrices' resolutionSide: type: - string - 'null' description: Winning outcome ("yes" or "no") if the contract has resolved isAboveAutoStartThreshold: type: boolean description: Whether the position is above the auto-start threshold isLive: type: boolean description: Whether the market is currently live/active realizedPl: type: - string - 'null' description: Realized profit/loss from sells marketValue: type: string description: Mark-to-market value of the position in USD at the current sell price (bestBid for YES, bestAsk for NO). **Absent** from the response when the held outcome has no live sell quote (no liquidity to sell into) — surface a no-liquidity state rather than a price the user cannot transact at. `lastTradePrice` is still returned for display. Treat as `Optional`. example: '65.00' unrealizedPnl: type: string description: Unrealized P&L in USD (`marketValue - costBasis`). **Absent** whenever `marketValue` is absent. Treat as `Optional`. example: '12.50' unrealizedPct: type: number format: double description: Unrealized P&L as a percentage of cost basis. Expressed as a percent (e.g. `12.5` represents 12.5%, **not** `0.125`); rounded to 4 decimal places. **Absent** when there is no live sell quote, or when cost basis is zero. Treat as `Optional`. example: 23.81 OrderResponse: type: object properties: orderId: type: integer format: int64 example: 12345678 hashOrderId: type: - string - 'null' clientOrderId: type: - string - 'null' globalOrderId: type: - string - 'null' status: $ref: '#/components/schemas/OrderStatus' symbol: type: string side: $ref: '#/components/schemas/OrderSide' outcome: $ref: '#/components/schemas/Outcome' orderType: $ref: '#/components/schemas/OrderType' quantity: type: string description: Original order quantity filledQuantity: type: string description: Amount filled so far remainingQuantity: type: string description: Amount remaining to fill price: type: string description: Limit price stopPrice: type: - string - 'null' description: Stop trigger price (populated for `stop-limit` orders) avgExecutionPrice: type: - string - 'null' description: Average price of fills createdAt: type: string format: date-time updatedAt: type: string format: date-time cancelledAt: type: - string - 'null' format: date-time contractMetadata: $ref: '#/components/schemas/ContractMetadata' OrdersResponse: type: object properties: orders: type: array items: $ref: '#/components/schemas/OrderResponse' pagination: $ref: '#/components/schemas/PaginationSimple' OrderType: type: string enum: - limit - stop-limit description: Order type. `stop-limit` orders require a `stopPrice` that triggers a limit order at `price` when the market reaches the trigger. SettledPositionsResponse: type: object properties: positions: type: array items: $ref: '#/components/schemas/SettledPosition' total: type: - integer - 'null' description: Total number of settled positions across all pages for the current filter set. totalPayout: type: string description: Sum of `payout` across all settled positions in the filter set. Retained for binary back-compat with the legacy response shape; **field is absent (not `null`) on the unified backend** because computing a roll-up over the full filtered set would require a separate aggregate query (deferred until a partner asks). Play's default `OptionHandlers` omits absent `Option` fields rather than emitting `null`. totalCostBasis: type: string description: Sum of `costBasis` across all settled positions in the filter set. Retained for binary back-compat; **field is absent (not `null`) on the unified backend** (see `totalPayout`). totalNetProfit: type: string description: Sum of `netProfit` across all settled positions in the filter set. Retained for binary back-compat; **field is absent (not `null`) on the unified backend** (see `totalPayout`). cashOuts: type: array description: 'Cash-outs (early sells before contract resolution) in the same account-scoped time window as the returned page''s settled positions. Field is absent (not `null`) when `withCashOuts=true` is not passed on the request. `positions[]` pagination is unaffected — `limit`/`offset` continue to scope `positions[]` only. ' items: $ref: '#/components/schemas/CashedOutPosition' totalCashOutProceeds: type: string description: Sum of `cashOuts[].proceeds` over the returned cash-outs. Field is absent (not `null`) when `withCashOuts=true` is not passed on the request. example: '120.00' totalCashOutCostBasis: type: string description: Sum of `cashOuts[].costBasis` over the returned cash-outs. Field is absent (not `null`) when `withCashOuts=true` is not passed on the request. example: '100.00' totalCashOutNetProfit: type: string description: Sum of `cashOuts[].netProfit` over the returned cash-outs. Field is absent (not `null`) when `withCashOuts=true` is not passed on the request. example: '20.00' PaginationSimple: type: object properties: limit: type: integer offset: type: integer count: type: integer description: Number of items in current response ContractMetadata: type: object properties: contractId: type: string contractName: type: string contractTicker: type: string eventTicker: type: string eventName: type: string category: type: string contractStatus: type: string eventType: type: string description: Event type ("binary" or "categorical") expiryDate: type: - string - 'null' format: date-time resolvedAt: type: - string - 'null' format: date-time resolutionSide: type: - string - 'null' description: Winning outcome if resolved ("yes" or "no") parentEventTicker: type: - string - 'null' description: Parent event ticker for sub-events startTime: type: - string - 'null' format: date-time description: Start datetime (ISO 8601) responses: ServiceUnavailable: description: Prediction markets feature is temporarily unavailable content: application/json: schema: $ref: '#/components/schemas/Error' BadRequest: description: Invalid request parameters content: application/json: schema: $ref: '#/components/schemas/Error' InternalError: description: Internal server error content: application/json: schema: $ref: '#/components/schemas/Error' Unauthorized: description: Authentication required or invalid credentials content: application/json: schema: $ref: '#/components/schemas/Error' securitySchemes: apiKey: type: apiKey in: header name: X-GEMINI-APIKEY description: Gemini API key with appropriate permissions payloadAuth: type: apiKey in: header name: X-GEMINI-PAYLOAD description: Base64-encoded private REST payload. See Gemini private REST authentication. signatureAuth: type: apiKey in: header name: X-GEMINI-SIGNATURE description: Hex HMAC-SHA384 signature of the payload using the API secret.