Authentication
This endpoint requires authentication using a JWT token or API-KEY in the header.
JWT token in the format: Authorization {token}
Token in the format: x-api-key {api-key}
Path Parameters
The supported protocols include: GMX,
KWENTA, POLYNOMIAL, POLYNOMIAL_L2, GMX_V2_AVAX, GMX_V2, GNS,
GNS_POLY, GNS_BASE, GNS_APE, LEVEL_BNB, LEVEL_ARB, MUX_ARB,
APOLLOX_BNB, AVANTIS_BASE, EQUATION_ARB, LOGX_BLAST, LOGX_MODE,
MYX_ARB, DEXTORO, VELA_ARB, HMX_ARB, SYNTHETIX_V3,
SYNTHETIX_V3_ARB, KTX_MANTLE, CYBERDEX, YFX_ARB, KILOEX_OPBNB,
KILOEX_BNB, KILOEX_MANTA, KILOEX_BASE, ROLLIE_SCROLL, MUMMY_FANTOM,
HYPERLIQUID, SYNFUTURE_BASE, MORPHEX_FANTOM, PERENNIAL_ARB,
BSX_BASE, DYDX, UNIDEX_ARB, VERTEX_ARB, HORIZON_BNB,
HOLDSTATION_ZKSYNC, ZENO_METIS, LINEHUB_LINEA, BMX_BASE, FOXIFY_ARB,
APOLLOX_BASE, GMX_AVAX, SYNTHETIX, DEPERP_BASE, ELFI_ARB, PERPETUAL_OP,
JUPITER, HOLDSTATION_BERA, GMX_SOL, HYPERLIQUID, OSTIUM_ARB
Request Body
Pagination parameters
Number of records to return
Number of records to skip
Field to sort by. Values: closeBlockTime, openBlockTime, averagePrice,
size, leverage, durationInSecond, orderCount, roi, realisedRoi,
pnl, realisedPnl
Sort direction. Values: desc, asc
Array of query objects
Field name to query. Values: account, status, pair
Value for the field. For status: CLOSE, OPEN. For account: address
string. For pair: ETH-USDT, BTC-USDT,…
Request Example
curl 'https://api.copin.io/JUPITER/position/filter/3XVpxh8hHGhEgnAEmLBy5v7vJuR2gjVk7qMF5yKcfGQy' \
-H 'accept: application/json, text/plain, */*' \
-H 'accept-language: en-US,en;q=0.9,vi;q=0.8' \
-H 'access-control-max-age: 600' \
-H 'x-api-key: u9jpUfrTAukk45QjWVg7DBtQYxdGgy' \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
--data-raw '{"pagination":{"limit":40,"offset":0},"queries":[{"fieldName":"status","value":"CLOSE"}],"sortBy":"closeBlockTime","sortType":"desc"}'
Response
Array of trader positions
Unique identifier for the position
Unique key for the position
Block number when position was opened
Timestamp when position was opened
Block number when position was closed
Timestamp when position was closed
Profit and loss including fee
Profit and loss without fee
Return on investment including fee
Return on investment without fee
Whether position is winning
Whether position was liquidated
Number of increase orders
Number of decrease orders
Position status (OPEN, CLOSE)
Timestamp when record was created
Metadata about the response
Number of records returned
Number of records skipped
Total number of records matching the query
Response Example
{
"data": [
{
"id": "656bd0e0d8fb813a7046c86a",
"account": "0x852610C4BD327C9c7fd93e06505173092f29a39c",
"key": "0x375fa2B494208b0F4f3f5f0b85121844a929AE6C-0x2B3bb4c683BFc5239B029131EEf3B1d214478d93-LONG",
"logId": 16,
"openBlockNumber": 112982925,
"openBlockTime": "2023-12-03T00:50:27.000Z",
"closeBlockNumber": 113022125,
"closeBlockTime": "2023-12-03T22:37:07.000Z",
"indexToken": "0x2B3bb4c683BFc5239B029131EEf3B1d214478d93",
"pair": "ETH-USDT",
"size": 150057.1415073778,
"fee": 126.470238805,
"collateral": 9907.023471108,
"averagePrice": 2165.370462136,
"funding": -158.90564217635142,
"pnl": 5958.737081751136,
"realisedPnl": 6244.112962732488,
"roi": 60.14659296133386,
"realisedRoi": 63.02713404225081,
"isLong": true,
"isWin": true,
"isLiquidate": false,
"leverage": 15.146541435476728,
"orderCount": 2,
"orderIncreaseCount": 1,
"orderDecreaseCount": 1,
"durationInSecond": 78400,
"status": "CLOSE",
"createdAt": "2023-12-03T00:50:40.058Z",
"protocol": "KWENTA"
}
],
"meta": {
"limit": 20,
"offset": 0,
"total": 56,
"totalPages": 3
}
}