curl --request GET \
--url https://codex-api.nomos.trade/v1/wallets/{wallet}/positions \
--header 'Authorization: Bearer <token>'import requests
url = "https://codex-api.nomos.trade/v1/wallets/{wallet}/positions"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://codex-api.nomos.trade/v1/wallets/{wallet}/positions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"wallet": "0x885783760858e1bd5dd09a3c3f916cfa251ac270",
"block": 94812402,
"tooLarge": false,
"maxPositions": 50000,
"total": 4,
"offset": 0,
"rows": [
{
"wallet": "0x885783760858e1bd5dd09a3c3f916cfa251ac270",
"outcomeIndex": 0,
"shares": 1200,
"costBasis": 312,
"avgPrice": 0.26,
"avgBuyPrice": 0.26,
"realizedPnl": 0,
"boughtShares": 1200,
"boughtUsd": 312,
"soldShares": 0,
"soldUsd": 0,
"avgSellPrice": 0,
"splitShares": 0,
"mergedShares": 0,
"mergeUsd": 0,
"redeemedShares": 0,
"redeemUsd": 0,
"fees": 1.25,
"fills": 3,
"firstTradeAt": 1783987320,
"lastTradeAt": 1790862117,
"partialHistory": false,
"basisApprox": false,
"converted": false,
"amm": false,
"tokenId": "85254962656314962064648492774584063365849461315753521676016468731069088672",
"conditionId": "0x8db33416a2d1ebde7438c80129e898f89a5deb3852ca64b37c4bf46513204409",
"resolved": false,
"settle": null,
"resolvedAt": null,
"settledPnl": 0,
"invested": 312,
"sharesIn": 1200,
"entryPrice": 0.26,
"pnlPct": 0,
"avgExitPrice": null,
"open": true,
"redeemable": false,
"exitAt": null,
"market": {
"question": "US announces end of Iranian blockade by March 31, 2027?",
"slug": "us-announces-end-of-iranian-blockade-by-march-31-2027",
"eventSlug": "us-announces-end-of-iranian-blockade",
"image": "https://polymarket-upload.s3.us-east-2.amazonaws.com/example.png",
"category": "Politics",
"outcomes": [
"Yes",
"No"
],
"negRisk": false
},
"mark": 0.24,
"markTs": 1790862117,
"value": 288,
"unrealizedPnl": -24
}
],
"next": 1
}Positions
Two forms on one route.
With status=open: what the wallet holds now (unresolved positions and resolved ones not yet redeemed), valued at each token’s last fill price, biggest value first. Rows are WalletRows with mark, markTs, value, unrealizedPnl and market.
With status=closed: the same as Closed Positions.
Without status: the raw positions in the markets you name with conditions (both outcomes each, closed ones included), as positions. Name at least one market: without one it returns every position the wallet has.
curl --request GET \
--url https://codex-api.nomos.trade/v1/wallets/{wallet}/positions \
--header 'Authorization: Bearer <token>'import requests
url = "https://codex-api.nomos.trade/v1/wallets/{wallet}/positions"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://codex-api.nomos.trade/v1/wallets/{wallet}/positions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"wallet": "0x885783760858e1bd5dd09a3c3f916cfa251ac270",
"block": 94812402,
"tooLarge": false,
"maxPositions": 50000,
"total": 4,
"offset": 0,
"rows": [
{
"wallet": "0x885783760858e1bd5dd09a3c3f916cfa251ac270",
"outcomeIndex": 0,
"shares": 1200,
"costBasis": 312,
"avgPrice": 0.26,
"avgBuyPrice": 0.26,
"realizedPnl": 0,
"boughtShares": 1200,
"boughtUsd": 312,
"soldShares": 0,
"soldUsd": 0,
"avgSellPrice": 0,
"splitShares": 0,
"mergedShares": 0,
"mergeUsd": 0,
"redeemedShares": 0,
"redeemUsd": 0,
"fees": 1.25,
"fills": 3,
"firstTradeAt": 1783987320,
"lastTradeAt": 1790862117,
"partialHistory": false,
"basisApprox": false,
"converted": false,
"amm": false,
"tokenId": "85254962656314962064648492774584063365849461315753521676016468731069088672",
"conditionId": "0x8db33416a2d1ebde7438c80129e898f89a5deb3852ca64b37c4bf46513204409",
"resolved": false,
"settle": null,
"resolvedAt": null,
"settledPnl": 0,
"invested": 312,
"sharesIn": 1200,
"entryPrice": 0.26,
"pnlPct": 0,
"avgExitPrice": null,
"open": true,
"redeemable": false,
"exitAt": null,
"market": {
"question": "US announces end of Iranian blockade by March 31, 2027?",
"slug": "us-announces-end-of-iranian-blockade-by-march-31-2027",
"eventSlug": "us-announces-end-of-iranian-blockade",
"image": "https://polymarket-upload.s3.us-east-2.amazonaws.com/example.png",
"category": "Politics",
"outcomes": [
"Yes",
"No"
],
"negRisk": false
},
"mark": 0.24,
"markTs": 1790862117,
"value": 288,
"unrealizedPnl": -24
}
],
"next": 1
}Authorizations
Your API key: codex_ and 48 hex characters.
Path Parameters
The wallet: 0x and 40 hex.
^0x[0-9a-fA-F]{40}$Query Parameters
open or closed. Leave it out for the raw form.
open, closed Rows, 1 to 2,500. Out of range is clamped.
1 <= x <= 2500Rows to skip.
x >= 0Only this category's markets; other for markets in none of them.
Only markets whose question, or the row's outcome name, contains this text.
Raw form: condition ids, comma separated, no spaces.
Response
OK
The finalized block the answer reflects.
Past maxPositions positions the wallet answers with no rows.
50,000.
Rows after filters.
Show child attributes
Show child attributes
The next offset.
Raw form only.
Show child attributes
Show child attributes