Get closed (realized) trading positions for an account
Changed onGet a paginated, per-trade breakdown of a wallet's realized P&L. Each closed position reflects FIFO (first-in, first-out) cost-basis lot matching.
Request
- Base URLhttps://api.opensea.io
- AuthAPI key in header x-api-key
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Path parameters
The wallet address
Query parameters
Sort order: TOP_TRADES (default) or RECENT
Number of results to return per page (1-200, default 20)
Cursor for the next page of results
Response
Closed positions
Example response
{
"closed_positions": [
{
"avg_cost_per_token_usd": "0.0425",
"closed_at": 1777334400,
"currency": {
"address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"chain": "ethereum",
"decimals": 6,
"name": "USDC",
"symbol": "USDC",
"usd_price": "1.0"
},
"first_acquired_at": 1768435200,
"realized_pnl_usd": "+1840.25",
"return_percentage": "+12.16",
"total_cost_basis_usd": "3359.75",
"total_proceeds_usd": "5200.0"
}
],
"total_count": 42
}Changes
- breaking
the response property
//became nullable for the status - breaking
the response property
//became nullable for the status - breaking
the response property
became nullable for the status - breaking
the
//response's property type changed fromobjectto no type for status - breaking
removed the required property
///from the response with the status - breaking
removed the required property
///from the response with the status - breaking
removed the required property
///from the response with the status - breaking
removed the required property
///from the response with the status - breaking
removed the required property
///from the response with the status - breaking
removed the required property
///from the response with the status - breaking
removed the required property
///from the response with the status - warning
removed the optional property
///from the response with the status - info
added the media type
*/*for the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added
subschema #2to the//response propertyanyOflist for the response status
- breaking