Returns cached exits for a wallet with filtering, sorting, and pagination. Use this endpoint to retrieve historical positions that have been fully exited, showing realized profit/loss.
Query Parameters
Wallet address whose closed positions should be returned.Example: 0x56687bf447db6ffa42ffe2204a05edaa20f55839
Comma-separated list of condition IDs to filter positions by specific markets.Example: 0xdd22472e552920b8438158ea7238bfadfa4f736aa4cee91a6b86c39ead110917
Substring search against market title (max 100 chars).
Maximum number of rows to return.Range: 0 to 50
Cursor offset for pagination.Range: 0 to 100000
sortBy
string
default:"REALIZEDPNL"
Sort column for the response.Options: REALIZEDPNL, TITLE, PRICE, AVGPRICE, TIMESTAMP
Sort direction (ascending or descending).Options: ASC, DESC
Response
Returns an array of closed position objects with the following fields:
The wallet address that held the position.
The asset identifier in the format conditionId:outcomeIndex.
The condition ID (market identifier) for this position.
Final token balance at the time of exit.
Average price paid for this position.
The initial value invested in this position.
Current market value (typically 0 for closed positions).
Total cash profit/loss realized from this position.
Total tokens bought for this position.
Realized profit/loss from closing the position.
Percentage profit/loss for this position.
Percentage realized profit/loss.
Current market price for this outcome token.
Whether this position can be redeemed.
Whether this position can be merged.
The market title/question.
URL-friendly market slug.
URL to the market icon image.
The outcome name for this position (e.g., “Yes”, “No”, or candidate name).
The numeric index of this outcome.
The name of the opposite outcome.
The asset identifier for the opposite outcome.
Unix timestamp when the position was closed.
ISO 8601 date-time when the market closed.
Example Request
curl -X GET "https://data-api.kuest.com/closed-positions?user=0x56687bf447db6ffa42ffe2204a05edaa20f55839&limit=10&sortBy=REALIZEDPNL&sortDirection=DESC"
Example Response
[
{
"proxyWallet": "0x56687bF447db6fFa42FfE2204a05edAa20f55839",
"asset": "0xdd22472e552920b8438158ea7238bfadfa4f736aa4cee91a6b86c39ead110917:0",
"conditionId": "0xdd22472e552920b8438158ea7238bfadfa4f736aa4cee91a6b86c39ead110917",
"size": 610.2,
"avgPrice": 0.39,
"initialValue": 237.98,
"currentValue": 0,
"cashPnl": 418.56,
"totalBought": 1120.4,
"realizedPnl": 418.56,
"percentPnl": 37.35,
"percentRealizedPnl": 37.35,
"curPrice": 0.68,
"redeemable": false,
"mergeable": false,
"title": "Will the Fed cut rates in September?",
"slug": "fed-rate-cut-sep-2024",
"icon": "https://cdn.domain.com/markets/fed.png",
"eventSlug": "fomc-2024-policy",
"outcome": "Yes",
"outcomeIndex": 0,
"oppositeOutcome": "No",
"oppositeAsset": "0xdd22472e552920b8438158ea7238bfadfa4f736aa4cee91a6b86c39ead110917:1",
"timestamp": 1718121600,
"endDate": "2024-09-18T18:00:00Z"
},
{
"proxyWallet": "0x56687bF447db6fFa42FfE2204a05edAa20f55839",
"asset": "0x8eee3789813eead2d47db3bdf6a1c5021f564ef18e2aefc8b80b9dcd5d6f8ac5:1",
"conditionId": "0x8eee3789813eead2d47db3bdf6a1c5021f564ef18e2aefc8b80b9dcd5d6f8ac5",
"size": 980.5,
"avgPrice": 0.47,
"initialValue": 460.84,
"currentValue": 0,
"cashPnl": 512.91,
"totalBought": 1685.75,
"realizedPnl": 512.91,
"percentPnl": 30.43,
"percentRealizedPnl": 30.43,
"curPrice": 0.9,
"redeemable": false,
"mergeable": false,
"title": "Will turnout exceed 60% in the French election?",
"slug": "france-turnout-60",
"icon": "https://cdn.domain.com/markets/france-election.png",
"eventSlug": "french-presidential-2024",
"outcome": "No",
"outcomeIndex": 1,
"oppositeOutcome": "Yes",
"oppositeAsset": "0x8eee3789813eead2d47db3bdf6a1c5021f564ef18e2aefc8b80b9dcd5d6f8ac5:0",
"timestamp": 1715668800,
"endDate": "2024-07-07T20:00:00Z"
}
]