POST
/
public
/
position
/
statistic
/
pnl-statistics
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 in the Authorization 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 'Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6IjB4MTUzNTQ4NGMxRWVjMUQyMDNmRTFBNTNFQTExYTYyMWE4ODRBRTA2NyIsInRpbWUiOjE3NDQ2MjYxNjIzODksImFjY2VzcyI6IlVmTkNiTWhMVVMxNzQ0NjI2MTYyMzkwIiwiaWF0IjoxNzQ0NjI2MTYyLCJleHAiOjE3NDUyMzA5NjJ9.LpvhBdxyfehzom-v5tKumAqCptSMkVk7HVKKVtjSpk8' \
--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
    ]
  }
}