Prediction markets API
The outcome positions one prediction-market trader holds right now
Every outcome token one trader holds, with the share count and its market, including unredeemed positions on resolved markets.
/api/external/prediction/prediction-trader-positions/{id}What it returns
One row per outcome token the trader holds, with its share count and the market it belongs to. The id is a traderId from prediction-trades or prediction-market-traders rows — copy it as given; only venues that settle on-chain have trader ids. Rows come in a fixed order by tokenId compared as text (not numerically), not by size. A position on a resolved market stays listed until it is redeemed, the losing side included — isWinningOutcome tells them apart. Some tiny positions have no known market: their market and outcome fields are null. There is no price here — shares is a count, not a value, and shares of a losing outcome are worth nothing: prediction-trader-markets has each market's current position value. To see who else holds an outcome, pass a row's outcomeId as token_id with its marketId to prediction-token-holders. Keep paging while nextCursor is non-null. An unknown id answers an empty items.
Chains
This endpoint is not tied to a chain: it takes no chain in its request.
Request
Send your key in the x-dex-data-key header. Replace each <placeholder> with a real value.
curl -H "x-dex-data-key: $DEXDATA_API_KEY" \ "https://api.dexdata.io/api/external/prediction/prediction-trader-positions/<id>"
| Parameter | Description |
|---|---|
limitquery · integer · optional | How many rows to return. Defaults to 20; a value above 100 is rejected. |
cursorquery · string · optional | An opaque cursor from a previous response's nextCursor, for the next page. |
idpath · string · required | A prediction-market trader id, e.g. "<walletAddress>:Polymarket", as traderId in prediction-trades and prediction-market-traders rows — not a bare wallet address, and not scoped to any chain this API otherwise supports. |
Response fields
A JSON response. Every field is always present; null means the value could not be established, never zero.
| Field | Type | Description |
|---|---|---|
nextCursor | string | null | Pass back as cursor for the next page. Null on the last page. |
items | object[] | |
items[].tokenId | string | null | The outcome token's on-chain id. Not the token_id other prediction endpoints take — that is outcomeId. |
items[].outcomeId | string | null | The outcome's id, as on prediction-market — the token_id that prediction-token-holders takes. Null when the market or the outcome is unknown. |
items[].outcomeIndex | number | null | Which outcome of the market, 0 first (e.g. Yes, then No). Null when the market or the outcome is unknown. |
items[].outcomeLabel | string | null | e.g. Yes. Null when the market or the outcome is unknown. |
items[].shares | number | null | How many shares of this outcome are held now — a count, not a value. Can be a tiny fraction. |
items[].isWinningOutcome | boolean | null | Whether the outcome held won, once the market has resolved. Null until it resolves, when it names no winner, and when the outcome is unknown. |
items[].marketId | string | null | The market's id, as on prediction-market. |
items[].question | string | null | |
items[].label | string | null | The market's short name within its event, e.g. a candidate. |
items[].eventId | string | null | |
items[].eventLabel | string | null | |
items[].closesAt | number | null | Unix seconds. |
items[].resolvedAt | number | null | Unix seconds. Null while the market is unresolved. |
Start building with DexData today
Sign in, create a key and make your first call in a minute. Free credits every month, and you only pay for calls that succeed.
Get a free API key