Account Endpoints

Get closed (realized) trading positions for an account

Changed on

Get 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.

get/api/v2/account/{address}/pnl/closed-positions

Request

Path parameters

addressstring required

The wallet address

Query parameters

sort_bystring

Sort order: TOP_TRADES (default) or RECENT

limitinteger

Number of results to return per page (1-200, default 20)

nextstring

Cursor for the next page of results

Response

Closed positions

nextstring nullable

Cursor for the next page of results, or null if there are no more pages

total_countinteger required

Total number of closed positions for the wallet across all pages

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 from object to 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 #2 to the // response property anyOf list for the response status