Prediction markets API
Every market one prediction-market trader traded, and how they did on each
One trader's track record market by market, ranked by volume, realized PnL or activity, with the position, entry price, PnL and win or loss per outcome.
/api/external/prediction/prediction-trader-markets/{id}What it returns
One row per market the trader traded, ranked by sort_by, with the market itself, their totals on it and a per-outcome breakdown (position, entry price, realized and unrealized PnL). The id is a traderId from prediction-trades or prediction-market-traders rows — copy it as given rather than building one; only venues that settle on-chain have trader ids. The trader's profile and lifetime totals are not repeated here: prediction-trader has them. Page with offset. There is no total: a page shorter than limit is the last one, and an offset past the end, like an unknown id, answers an empty items. isWinningOutcome is set only once the market has resolved.
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-markets/<id>"
| Parameter | Description |
|---|---|
sort_byquery · string · optional | Which figure to rank the trader's markets by. Defaults to USD volume.volumeUsdrealizedPnlUsdtradeslastTradeTimestampprofitPerTradeUsd |
sort_typequery · string · optional | Sort direction. Defaults to descending.ASCDESC |
limitquery · integer · optional | How many rows to return. Defaults to 20; this endpoint caps it at 100. |
offsetquery · integer · optional | 0-based row offset, for paging through the ranking. At most 1000000. |
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 |
|---|---|---|
items | object[] | |
items[].marketId | string | null | The market's id, as prediction-market and prediction-market-traders take it. |
items[].question | string | null | The market's question. |
items[].label | string | null | The market's short name inside its event, e.g. 25 bps decrease. Null when it has none. |
items[].eventId | string | null | The event the market belongs to, as prediction-event takes it. |
items[].eventLabel | string | null | The event's name. |
items[].status | string | null | The market's status, e.g. OPEN, RESOLVED. Open set: other values can appear. |
items[].closesAt | number | null | When the market closes to trading, Unix seconds. |
items[].resolvedAt | number | null | When the market resolved, Unix seconds. Null while it has not. |
items[].hasOpenPosition | boolean | null | Whether the trader still holds shares on this market. |
items[].realizedPnlUsd | number | null | The trader's realized PnL on this market, USD. A real 0 is possible. |
items[].unrealizedPnlUsd | number | null | Unrealized PnL on the open position, USD. |
items[].currentPositionValueUsd | number | null | What the shares held now are worth, USD. |
items[].volumeUsd | number | null | USD the trader traded on this market. |
items[].volumeShares | number | null | Shares traded, summed across outcomes. |
items[].costBasisUsd | number | null | What the shares held now cost, USD. |
items[].sharesHeld | number | null | Shares held now, summed across outcomes — outcomes has the position per outcome. |
items[].buys | number | null | Number of buy fills. |
items[].sells | number | null | Number of sell fills. |
items[].trades | number | null | Number of fills, buys plus sells. |
items[].pnlPerVolume | number | null | Realized PnL divided by USD volume, as a fraction (0.0021 is 0.21%). |
items[].profitPerTradeUsd | number | null | Realized PnL divided by trades, USD. |
items[].firstTradeTimestamp | number | null | Unix seconds. |
items[].lastTradeTimestamp | number | null | Unix seconds. |
items[].outcomes | object[] | At most one entry per outcome, outcome 0 first (e.g. Yes then No). An outcome with no record is left out, so read label, not the position. |
items[].outcomes[].outcomeId | string | null | |
items[].outcomes[].label | string | null | e.g. Yes. |
items[].outcomes[].isWinningOutcome | boolean | null | Whether this outcome won, once the market has resolved. Null while it is open, and for a market that ended any other way. |
items[].outcomes[].sharesHeld | number | null | Shares of this outcome held now. |
items[].outcomes[].avgEntryPriceUsd | number | null | Average price paid per share of the shares held now, 0 to 1. Null when none are held. |
items[].outcomes[].costBasisUsd | number | null | |
items[].outcomes[].buys | number | null | Number of buy fills. |
items[].outcomes[].sells | number | null | Number of sell fills. |
items[].outcomes[].buyVolumeUsd | number | null | |
items[].outcomes[].sellVolumeUsd | number | null | |
items[].outcomes[].realizedPnlUsd | number | null | |
items[].outcomes[].currentPriceUsd | number | null | The outcome's current price, 0 to 1. Null once the market has resolved. |
items[].outcomes[].currentPositionValueUsd | number | null | |
items[].outcomes[].unrealizedPnlUsd | number | null | |
items[].outcomes[].pnlStatus | string | null | The trader's result on this outcome, e.g. WIN, NEUTRAL — WIN is possible on the losing outcome when it was sold at a profit. Open set: new values can appear. |
items[].outcomes[].firstTradeTimestamp | number | null | Unix seconds. Null when the trader never traded this outcome. |
items[].outcomes[].lastTradeTimestamp | number | null | Unix seconds. Null when the trader never traded this outcome. |
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