Skip to main content
POST
/
public
/
position
/
statistic
/
pnl-statistics
PnL Statistic
curl --request POST \
  --url https://api.copin.io/public/position/statistic/pnl-statistics \
  --header 'Content-Type: application/json' \
  --data '
{
  "accounts": [
    {
      "account": "<string>",
      "protocol": "<string>"
    }
  ],
  "statisticType": "<string>"
}
'
{
  "{account_address}": {
    "date": [
      {}
    ],
    "realisedPnl": [
      {}
    ],
    "unrealisedPnl": [
      {}
    ],
    "fee": [
      {}
    ]
  }
}

Authentication

This endpoint requires authentication using a JWT token or API-KEY in the header.
Authorization
string
JWT token in the format: Authorization {token}
x-api-key
string
Token in the format: x-api-key {api-key}

Request Body

accounts
array
required
Accounts list for filter
statisticType
string
Statistic for different time periods (FULL, D60, D30, D15, D7).

Request Example

curl --request POST \
--url "https://api.copin.io/public/position/statistic/pnl-statistics" \
--header 'Content-Type: application/json' \
--header 'x-api-key: u9jpUfrTAukk45QjWVg7DBtQYxdGgy' \
--data '{
  "accounts": [
    {
      "account": "0xd649A0876453Fc7626569B28E364262192874E18",
      "protocol": "KILOEX_BASE"
    }
  ],
  "statisticType": "D15"
}'

Response

The response is structured as an object where each key is an account address from your request. For each account, the API returns time series data containing dates and corresponding trading metrics.
{account_address}
object
Data for each requested account, keyed by account address

Response Example

{
  "0xd649A0876453Fc7626569B28E364262192874E18": {
    "date": [
      "2025-04-12T00:00:00.000Z",
      "2025-04-13T00:00:00.000Z",
      "2025-04-14T00:00:00.000Z",
      "2025-04-15T00:00:00.000Z",
      "2025-04-16T00:00:00.000Z",
      "2025-04-17T00:00:00.000Z",
      "2025-04-18T00:00:00.000Z",
      "2025-04-19T00:00:00.000Z",
      "2025-04-20T00:00:00.000Z",
      "2025-04-21T00:00:00.000Z",
      "2025-04-22T00:00:00.000Z",
      "2025-04-23T00:00:00.000Z",
      "2025-04-24T00:00:00.000Z",
      "2025-04-25T00:00:00.000Z",
      "2025-04-26T00:00:00.000Z",
      "2025-04-27T00:00:00.000Z",
      "2025-04-28T00:00:00.000Z",
      "2025-04-29T00:00:00.000Z",
      "2025-04-30T00:00:00.000Z",
      "2025-05-01T00:00:00.000Z",
      "2025-05-02T00:00:00.000Z",
      "2025-05-03T00:00:00.000Z",
      "2025-05-04T00:00:00.000Z",
      "2025-05-05T00:00:00.000Z",
      "2025-05-06T00:00:00.000Z",
      "2025-05-07T00:00:00.000Z",
      "2025-05-08T00:00:00.000Z",
      "2025-05-09T00:00:00.000Z",
      "2025-05-10T00:00:00.000Z",
      "2025-05-11T00:00:00.000Z",
      "2025-05-12T00:00:00.000Z"
    ],
    "realisedPnl": [
      0,
      0,
      3323232.953125,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0
    ],
    "unrealisedPnl": [
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0
    ],
    "fee": [
      0,
      0,
      47.00442682206631,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0
    ]
  }
}