Getting Started
Trader Explorer
Trader Profile
Open Interest
Trader Board
Copy Trades
Open Interest Position By GraphQL
Retrieve open interest positions for multi protocols
curl --request POST \
--url https://api.copin.io/graphql \
--header 'Content-Type: application/json' \
--data '{
"operationName": "<string>",
"variables": {
"index": "<string>",
"body": {
"filter": {
"and": [
{}
]
},
"sorts": [
{}
],
"paging": {
"size": 123,
"from": 123
}
}
},
"query": "<string>"
}'
{
"data": [
{
"id": "<string>",
"account": "<string>",
"key": "<string>",
"logId": 123,
"openBlockNumber": 123,
"openBlockTime": "<string>",
"closeBlockNumber": 123,
"closeBlockTime": "<string>",
"indexToken": "<string>",
"pair": "<string>",
"size": 123,
"fee": 123,
"collateral": 123,
"averagePrice": 123,
"funding": 123,
"pnl": 123,
"realisedPnl": 123,
"roi": 123,
"realisedRoi": 123,
"isLong": true,
"isWin": true,
"isLiquidate": true,
"leverage": 123,
"orderCount": 123,
"orderIncreaseCount": 123,
"orderDecreaseCount": 123,
"durationInSecond": 123,
"status": "<string>",
"createdAt": "<string>",
"protocol": "<string>"
}
],
"meta": {
"limit": 123,
"offset": 123,
"total": 123,
"totalPages": 123
}
}
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}
Request Query
Query name: searchTopOpeningPosition
Request Body
Name of the GraphQL operation (e.g., “Search”)
Variables for the GraphQL query
The index to search in (e.g., “copin.positions”)
Query parameters
Filter criteria for the search
Array of filter conditions that must all be satisfied
Sorting criteria for the results
GraphQL query string
Request Example
curl 'https://api.copin.io/graphql' \
-H 'accept: */*' \
-H 'accept-language: en-US,en;q=0.9,vi;q=0.8' \
-H 'x-api-key: u9jpUfrTAukk45QjWVg7DBtQYxdGgy' \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
--data-raw $'{"operationName":"Search","variables":{"index":"copin.positions","body":{"filter":{"and":[{"field":"status","match":"OPEN"},{"field":"openBlockTime","gte":"2025-08-21T09:41:12.017Z","lte":"2025-08-28T09:41:12.017Z"}]},"sorts":[{"field":"realisedPnl","direction":"desc"}],"paging":{"size":100,"from":0}},"protocols":["JUPITER","GMX_V2"]},"query":"query Search($index: String\u0021, $protocols: [String\u0021]\u0021, $body: SearchPayload\u0021) {\\n searchTopOpeningPosition(index: $index, protocols: $protocols, body: $body) {\\n data {\\n id\\n synthetixPositionId\\n account\\n smartAccount\\n protocol\\n indexToken\\n collateralToken\\n key\\n reverseIndex\\n logId\\n collateralInToken\\n collateral\\n lastCollateral\\n size\\n lastSizeNumber\\n lastSize\\n lastSizeInToken\\n sizeInToken\\n averagePrice\\n fee\\n feeInToken\\n lastFunding\\n funding\\n fundingInToken\\n pnl\\n roi\\n leverage\\n orderCount\\n orderIncreaseCount\\n orderDecreaseCount\\n openBlockNumber\\n openBlockTime\\n closeBlockNumber\\n closeBlockTime\\n durationInSecond\\n isLong\\n isWin\\n isLiquidate\\n status\\n txHashes\\n orderIds\\n createdAt\\n realisedPnlInToken\\n realisedPnl\\n realisedRoi\\n pair\\n __typename\\n }\\n meta {\\n total\\n limit\\n offset\\n totalPages\\n __typename\\n }\\n __typename\\n }\\n}"}'
Response
The response includes a data property containing the requested GraphQL data.
Array of trader positions
Unique identifier for the position
Trader’s account address
Unique key for the position
Log ID
Block number when position was opened
Timestamp when position was opened
Block number when position was closed
Timestamp when position was closed
Token address
Trading pair
Position size
Fee paid
Collateral amount
Average entry price
Funding amount
Profit and loss including fee
Profit and loss without fee
Return on investment including fee
Return on investment without fee
Whether position is long
Whether position is winning
Whether position was liquidated
Leverage used
Number of orders
Number of increase orders
Number of decrease orders
Duration in seconds
Position status (OPEN, CLOSE)
Timestamp when record was created
Protocol name
Response Example
{
"data": {
"searchTopOpeningPosition": {
"data": [
{
"id": "68a8788260ef2b0915e0474a",
"synthetixPositionId": null,
"account": "5qeEx2qiVZPdLkE8gKBiyQFbHUopEpM62rDcViBBf2xJ",
"smartAccount": null,
"protocol": "JUPITER",
"indexToken": "So11111111111111111111111111111111111111112",
"collateralToken": null,
"key": "BSehcYyY5dZzjyfJZoNkiQwwpicjGsHwexkYpMwVYffL",
"reverseIndex": null,
"logId": 7,
"collateralInToken": null,
"collateral": 168796.724899,
"lastCollateral": 168796.724899,
"size": 4606107.06529,
"lastSizeNumber": null,
"lastSize": 4606107.06529,
"lastSizeInToken": null,
"sizeInToken": null,
"averagePrice": 184.44660103134768,
"fee": 14349.384182,
"feeInToken": null,
"lastFunding": null,
"funding": 0,
"fundingInToken": null,
"pnl": -14349.384182,
"roi": -8.500984951328881,
"leverage": 27.287893577592087,
"orderCount": 2,
"orderIncreaseCount": 2,
"orderDecreaseCount": 0,
"openBlockNumber": 361770027,
"openBlockTime": "2025-08-22T14:00:53.000Z",
"closeBlockNumber": null,
"closeBlockTime": null,
"durationInSecond": 122,
"isLong": true,
"isWin": false,
"isLiquidate": false,
"status": "OPEN",
"txHashes": [
"3Gcbk8Bv7BYtoSapYrxFee8BWGmFvBSPe3pHXdBpeK8Jjth9U5oj9N7EvB7wwvauz6fXaqL5jgrhG2fMUtzz1MyN",
"5BqUrxCtWpWpxM8DPDYD9AqzQH9znejVDJFwoUSKF3dbyfXdscGLGfymLDFTV15WEhLbwBGiMwUVFEGLFDCCCGtP"
],
"orderIds": null,
"createdAt": "2025-08-22T14:02:41.363Z",
"realisedPnlInToken": null,
"realisedPnl": 717047.5851464574,
"realisedRoi": 424.79946549644546,
"pair": "SOL-USDT",
"__typename": "TopPosition"
}
],
"meta": {
"total": 4460,
"limit": 100,
"offset": 0,
"totalPages": 45,
"__typename": "PagingOutput"
},
"__typename": "TopPositionSearchResponse"
}
}
}
curl --request POST \
--url https://api.copin.io/graphql \
--header 'Content-Type: application/json' \
--data '{
"operationName": "<string>",
"variables": {
"index": "<string>",
"body": {
"filter": {
"and": [
{}
]
},
"sorts": [
{}
],
"paging": {
"size": 123,
"from": 123
}
}
},
"query": "<string>"
}'
{
"data": [
{
"id": "<string>",
"account": "<string>",
"key": "<string>",
"logId": 123,
"openBlockNumber": 123,
"openBlockTime": "<string>",
"closeBlockNumber": 123,
"closeBlockTime": "<string>",
"indexToken": "<string>",
"pair": "<string>",
"size": 123,
"fee": 123,
"collateral": 123,
"averagePrice": 123,
"funding": 123,
"pnl": 123,
"realisedPnl": 123,
"roi": 123,
"realisedRoi": 123,
"isLong": true,
"isWin": true,
"isLiquidate": true,
"leverage": 123,
"orderCount": 123,
"orderIncreaseCount": 123,
"orderDecreaseCount": 123,
"durationInSecond": 123,
"status": "<string>",
"createdAt": "<string>",
"protocol": "<string>"
}
],
"meta": {
"limit": 123,
"offset": 123,
"total": 123,
"totalPages": 123
}
}