Skip to content

Get closed positions

GET /closed-positions

Server: https://data.openfish.fun (port 3003)

Tags: Core

Lists positions that have been fully exited (zero remaining balance) for a given wallet, along with realized PnL figures.


NameInTypeDefaultDescription
userquerystringRequired. User wallet address
marketquerystringComma-separated condition IDs
eventIdquerystringComma-separated event IDs
titlequerystringTitle search filter
limitqueryinteger50Max results (max 50)
offsetqueryinteger0Pagination offset
sortByquerystringSort field. One of: AVGPRICE, TOTALBOUGHT, REALIZEDPNL, TIMESTAMP, TITLE
sortDirectionquerystringDESCSort direction. One of: ASC, DESC

200 — A JSON array of ClosedPosition objects.

[
{
"proxyWallet": "0xabc...",
"asset": "token123",
"conditionId": "0xdef...",
"avgPrice": "0.65",
"totalBought": "100.5",
"realizedPnl": "15.20",
"curPrice": "1.00",
"timestamp": 1700000000,
"title": "Will BTC exceed $100k?",
"slug": "will-btc-exceed-100k",
"icon": "https://...",
"eventSlug": "bitcoin-milestones",
"outcome": "Yes",
"outcomeIndex": 0,
"oppositeOutcome": "No",
"oppositeAsset": "token456",
"endDate": "2026-12-31"
}
]

Terminal window
curl "https://data.openfish.fun/closed-positions?user=0xabc123...&limit=20"