Positions
Authentication
API key only —X-API-Key: <key> (or the PM-compat POLY_API_KEY /
Authorization: Bearer ps_live_... aliases). A Supabase Bearer JWT is not
accepted here.
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
status | string | — | Filter: OPEN or CLOSED. Omit to return all positions. OPEN returns positions with quantity > 0; CLOSED includes reset-archived (CLOSED_BY_RESET) positions. Any other value is ignored (treated as no filter). |
wallet_id | int | "all" | "api" | api | Wallet scope. An integer scopes to a single wallet you own (404 WALLET_NOT_FOUND otherwise). api scopes to your API wallet (including legacy rows recorded before per-wallet attribution). all returns every position across all your wallets, UI MAIN/SANDBOX included. Keywords are case-insensitive; any other value returns 422 VALIDATION_FAILED. Omitted = api. |
envelope | bool | false | When true, wrap the response in the Polymarket-shape { "data": [...], "next_cursor": "" } envelope. next_cursor is always "" because positions are unpaginated. Default false returns the bare array. |
This endpoint is unpaginated — there is no
limit/offset. It returns
every matching position in one response. For paginated results use
Trade History. Polymarket’s status=ALL has no
direct equivalent — simply omit status to get the unfiltered set.Request
Response
| Field | Type | Description |
|---|---|---|
id | int | Position ID |
market_id | string | Market condition_id |
outcome | string | Outcome name (e.g. Yes / No) |
quantity | string | Number of shares held |
avg_entry_price | string | Volume-weighted average entry price |
current_price | string | null | Latest market price for this outcome. null when no live price is cached. |
market_value | string | null | quantity × current_price. null when current_price is null. |
unrealized_pnl | string | null | market_value − (quantity × avg_entry_price). null when current_price is null. |
status | string | OPEN, CLOSED, or CLOSED_BY_RESET |
market_question | string | null | Market question text; null when the market is not in the local cache |
With
envelope=true the same rows are wrapped Polymarket-style:
Python Example
Position Lifecycle
A position closed byPOST /v1/account/reset-api-balance carries the
CLOSED_BY_RESET status. The status=CLOSED filter surfaces both CLOSED
and CLOSED_BY_RESET positions.
Errors
All errors return{"error": "<CODE>", "message": "<human-readable>"}.
| Status | error code | When |
|---|---|---|
| 401 | MISSING_API_KEY | No API key header supplied |
| 401 | INVALID_KEY | API key is unknown, deactivated, or expired |
| 404 | WALLET_NOT_FOUND | Integer wallet_id does not exist or is not owned by the caller |
| 422 | VALIDATION_FAILED | wallet_id is neither an integer, all, nor api |
Next Steps
- Portfolio — Aggregate view with balance + positions
- Equity Curve — Track value over time