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.

GET/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>"
Parameters
ParameterDescription
limit

query · integer · optional

How many rows to return. Defaults to 20; a value above 100 is rejected.
cursor

query · string · optional

An opaque cursor from a previous response's nextCursor, for the next page.
id

path · 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.

Response fields of The outcome positions one prediction-market trader holds right now
FieldTypeDescription
nextCursorstring | nullPass back as cursor for the next page. Null on the last page.
itemsobject[]
items[].tokenIdstring | nullThe outcome token's on-chain id. Not the token_id other prediction endpoints take — that is outcomeId.
items[].outcomeIdstring | nullThe 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[].outcomeIndexnumber | nullWhich outcome of the market, 0 first (e.g. Yes, then No). Null when the market or the outcome is unknown.
items[].outcomeLabelstring | nulle.g. Yes. Null when the market or the outcome is unknown.
items[].sharesnumber | nullHow many shares of this outcome are held now — a count, not a value. Can be a tiny fraction.
items[].isWinningOutcomeboolean | nullWhether 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[].marketIdstring | nullThe market's id, as on prediction-market.
items[].questionstring | null
items[].labelstring | nullThe market's short name within its event, e.g. a candidate.
items[].eventIdstring | null
items[].eventLabelstring | null
items[].closesAtnumber | nullUnix seconds.
items[].resolvedAtnumber | nullUnix 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