Getting Started
Order
Copy Trades
Position Statistics
Position Statistic List Graphql
Retrieve position statistics 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>",
"totalTrade": 123,
"totalWin": 123,
"totalLose": 123,
"totalGain": 123,
"realisedTotalGain": 123,
"totalLoss": 123,
"realisedTotalLoss": 123,
"totalVolume": 123,
"avgVolume": 123,
"avgRoi": 123,
"realisedAvgRoi": 123,
"maxRoi": 123,
"realisedMaxRoi": 123,
"pnl": 123,
"realisedPnl": 123,
"maxPnl": 123,
"realisedMaxPnl": 123,
"realisedMaxDrawdown": 123,
"realisedMaxDrawdownPnl": 123,
"winRate": 123,
"profitRate": 123,
"realisedProfitRate": 123,
"orderPositionRatio": 123,
"profitLossRatio": 123,
"realisedProfitLossRatio": 123,
"longRate": 123,
"gainLossRatio": 123,
"realisedGainLossRatio": 123,
"avgDuration": 123,
"minDuration": 123,
"maxDuration": 123,
"avgLeverage": 123,
"minLeverage": 123,
"maxLeverage": 123,
"totalLiquidation": 123,
"totalLiquidationAmount": 123,
"runTimeDays": 123,
"lastTradeAtTs": 123,
"totalFee": 123,
"type": "<string>",
"statisticAt": "<string>",
"lastTradeAt": "<string>",
"indexTokens": [
{}
],
"protocol": "<string>",
"createdAt": "<string>",
"isOpenPosition": true
}
],
"meta": {
"limit": 123,
"offset": 123,
"total": 123,
"totalPages": 123
}
}
Authentication
This endpoint requires authentication using a JWT token in the Authorization header.
JWT token in the format: Authorization {token}
Token in the format: x-api-key {api-key}
Request Body
Name of the GraphQL operation (e.g., “Search”)
Variables for the GraphQL query
The index to search in (e.g., “copin.position_statistics”)
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 'cache-control: no-cache' \
-H 'content-type: application/json' \
--data-raw $'{"operationName":"Search","variables":{"index":"copin.position_statistics","body":{"filter":{"and":[{"field":"totalTrade","gte":"2"},{"field":"profitRate","gte":"60"},{"field":"pnl","gte":"100"},{"field":"winRate","gte":"51"},{"field":"runTimeDays","gte":"7"},{"field":"protocol","in":["GMX","JUPITER"]},{"field":"type","match":"D30"}]},"sorts":[{"field":"realisedPnl","direction":"desc"}],"paging":{"size":12,"from":0}}},"query":"query Search($index: String\u0021, $body: SearchPayload\u0021) {\\n searchPositionStatistic(index: $index, body: $body) {\\n data {\\n id\\n account\\n protocol\\n type\\n maxDuration\\n minDuration\\n avgDuration\\n realisedTotalGain\\n totalLose\\n totalLoss\\n totalWin\\n totalTrade\\n totalLiquidation\\n totalLiquidationAmount\\n totalFee\\n avgVolume\\n totalVolume\\n gainLossRatio\\n orderPositionRatio\\n profitLossRatio\\n winRate\\n longRate\\n profitRate\\n pnl\\n unrealisedPnl\\n avgRoi\\n maxRoi\\n maxPnl\\n avgLeverage\\n maxLeverage\\n minLeverage\\n runTimeDays\\n indexTokens\\n lastTradeAt\\n lastTradeAtTs\\n statisticAt\\n createdAt\\n updatedAt\\n realisedTotalGain\\n realisedTotalLoss\\n realisedPnl\\n realisedAvgRoi\\n realisedMaxRoi\\n realisedMaxPnl\\n realisedMaxDrawdown\\n realisedMaxDrawdownPnl\\n realisedProfitRate\\n realisedGainLossRatio\\n realisedProfitLossRatio\\n totalGain\\n pairs\\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 position statistic objects
Unique identifier for the position statistic
The trader’s address
Total number of trades
Total number of winning trades
Total number of losing trades
Total gain amount from all trades
Realised total gain from closed positions
Total loss amount from all trades
Realised total loss from closed positions
Total trading volume
Average volume per trade
Average ROI (Return on Investment) across all trades
Realised average ROI from closed positions
Maximum ROI achieved in a single trade
Realised maximum ROI from closed positions
Total profit and loss
Realised profit and loss from closed positions
Maximum profit and loss achieved
Realised maximum profit and loss from closed positions
Maximum drawdown from realised positions
Maximum drawdown amount from realised positions
Percentage of winning trades
Percentage of profitable trades
Percentage of profitable closed positions
Ratio of orders to positions
Ratio of profit to loss
Ratio of realised profit to realised loss
Percentage of long positions
Ratio of gains to losses
Ratio of realised gains to realised losses
Average duration of positions in hours
Minimum duration of any position in hours
Maximum duration of any position in hours
Average leverage used across all positions
Minimum leverage used in any position
Maximum leverage used in any position
Total number of liquidated positions
Total amount lost due to liquidations
Number of days the trader has been active
Timestamp of the last trade (milliseconds)
Total fees paid across all trades
Time period for this statistic (e.g., “D15”, “D30”)
Timestamp when these statistics were calculated
Timestamp of the last trade (ISO format)
List of token identifiers traded
Protocol identifier
Timestamp when this statistic record was created
Whether the trader has any open positions
Response Example
{
"data": [
{
"id": "67fdbfa13219b4577b6973cb",
"account": "0xF13304d2a5A74E8d6f87272503Fbac130B3bb2B0",
"totalTrade": 1,
"totalWin": 0,
"totalLose": 1,
"totalGain": 0,
"realisedTotalGain": 0,
"totalLoss": -8.781451873656628,
"realisedTotalLoss": -2.4097624076006596,
"totalVolume": 5079.55940610314,
"avgVolume": 5079.55940610314,
"avgRoi": -23.94,
"realisedAvgRoi": -6.57,
"maxRoi": -23.94,
"realisedMaxRoi": -6.57,
"pnl": -8.781451873656628,
"realisedPnl": -2.4097624076006596,
"maxPnl": -8.781451873656628,
"realisedMaxPnl": -2.4097624076006596,
"realisedMaxDrawdown": -6.57,
"realisedMaxDrawdownPnl": -2.4097624076006596,
"winRate": 0,
"profitRate": 0,
"realisedProfitRate": 0,
"orderPositionRatio": 2,
"profitLossRatio": 0,
"realisedProfitLossRatio": 0,
"longRate": 100,
"gainLossRatio": 0,
"realisedGainLossRatio": 0,
"avgDuration": 20,
"minDuration": 20,
"maxDuration": 20,
"avgLeverage": 138.5,
"minLeverage": 138.5,
"maxLeverage": 138.5,
"totalLiquidation": 0,
"totalLiquidationAmount": 0,
"runTimeDays": 1,
"lastTradeAtTs": 1744602207000,
"totalFee": 6.371689466055969,
"type": "D15",
"statisticAt": "2025-04-15T02:08:33.740Z",
"lastTradeAt": "2025-04-14T03:43:27.000Z",
"indexTokens": [
"GNS-191"
],
"protocol": "GNS",
"createdAt": "2025-04-15T02:08:33.755Z",
"isOpenPosition": false
}
],
"meta": {
"limit": 20,
"offset": 0,
"total": 56,
"totalPages": 3
}
}
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>",
"totalTrade": 123,
"totalWin": 123,
"totalLose": 123,
"totalGain": 123,
"realisedTotalGain": 123,
"totalLoss": 123,
"realisedTotalLoss": 123,
"totalVolume": 123,
"avgVolume": 123,
"avgRoi": 123,
"realisedAvgRoi": 123,
"maxRoi": 123,
"realisedMaxRoi": 123,
"pnl": 123,
"realisedPnl": 123,
"maxPnl": 123,
"realisedMaxPnl": 123,
"realisedMaxDrawdown": 123,
"realisedMaxDrawdownPnl": 123,
"winRate": 123,
"profitRate": 123,
"realisedProfitRate": 123,
"orderPositionRatio": 123,
"profitLossRatio": 123,
"realisedProfitLossRatio": 123,
"longRate": 123,
"gainLossRatio": 123,
"realisedGainLossRatio": 123,
"avgDuration": 123,
"minDuration": 123,
"maxDuration": 123,
"avgLeverage": 123,
"minLeverage": 123,
"maxLeverage": 123,
"totalLiquidation": 123,
"totalLiquidationAmount": 123,
"runTimeDays": 123,
"lastTradeAtTs": 123,
"totalFee": 123,
"type": "<string>",
"statisticAt": "<string>",
"lastTradeAt": "<string>",
"indexTokens": [
{}
],
"protocol": "<string>",
"createdAt": "<string>",
"isOpenPosition": true
}
],
"meta": {
"limit": 123,
"offset": 123,
"total": 123,
"totalPages": 123
}
}