Getting Started
Copy Trades
Position Statistics
Wallets
Position Statistic List By Search After
Retrieve position statistics with api key
curl --request POST \
--url https://api.copin.io/trial/position/statistic/search-after \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '{
"pitId": "<string>",
"searchAfter": [
{}
],
"size": 123,
"queries": [
{
"fieldName": "<string>",
"value": "<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": {
"pitId": "<string>",
"searchAfter": [
{}
],
"total": 123,
"totalPages": 123
}
}
Authentication
This endpoint requires authentication using api-key in the ‘x-api-key’ header.
Token in the format: x-api-key {api-key}
Help the results of those requests consistent as changes happening between searches are only visible to the more recent point in time. Time to live is 5 mins. In the first time call API, no need this field.
Using to get continuous data after. In the first time call API, no need this field.
Limit per page. Maximum: 1000
Request Body
Request Example
curl --request POST \
--url "https://api.copin.io/trial/position/statistic/search-after" \
--header "Content-Type: application/json' \
--header 'x-api-key: v23XPhHKSP4rFsWcMR1NZ2qXLTUjtn' \
--data '{
"size": 100,
"sort": [{"id": "asc" }],
"pitId": "4YyPBAEZY29waW4ucG9zaXRpb25fc3RhdGlzdGljcxZ0Rnk1Y0YxSVF0V0VxdFdIdW9kcWN3ABYtOHMtQnhZdFMwQ2J6bElvRTUwUDl3AAAAAAAAD8e3FjB3Tjh6eGRpU25hSUlZdTM3ODY2cHcAARZ0Rnk1Y0YxSVF0V0VxdFdIdW9kcWN3AAA=",
"searchAfter": [
"65a5fc59d2d3d9a9063064f0",
755184
]
}'
Response
The response includes a data array containing position statistic objects and a meta object with pagination information.
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
Metadata about the response
Response Example
{
"data": [
{
"id": "65a5ff35d2d3d9a90630c1d0",
"account": "0x05bB0eCffBA75A93BA324321f899D6EB8E0B9748",
"totalTrade": 1,
"totalWin": 0,
"totalLose": 1,
"totalGain": 0,
"realisedTotalGain": 0,
"totalLoss": -0.0078019965081686975,
"realisedTotalLoss": -0.004602316508168698,
"totalVolume": 2.6963,
"avgVolume": 2.6963,
"avgRoi": -0.38,
"realisedAvgRoi": -0.22,
"maxRoi": 0,
"realisedMaxRoi": 0,
"pnl": -0.0078019965081686975,
"realisedPnl": -0.004602316508168698,
"maxPnl": 0,
"realisedMaxPnl": 0,
"realisedMaxDrawdown": -0.22,
"maxDrawdownPnl": null,
"realisedMaxDrawdownPnl": -0.004602316508168698,
"winRate": 0,
"profitRate": 0,
"realisedProfitRate": 0,
"orderPositionRatio": 2,
"profitLossRatio": 0,
"realisedProfitLossRatio": 0,
"longRate": 0,
"gainLossRatio": 0,
"realisedGainLossRatio": 0,
"avgDuration": 216.33333333333334,
"minDuration": 216.33333333333334,
"maxDuration": 216.33333333333334,
"avgLeverage": 1.3000528671129576,
"minLeverage": 1.3000528671129576,
"maxLeverage": 1.3000528671129576,
"totalLiquidation": 0,
"totalLiquidationAmount": 0,
"runTimeDays": 469,
"lastTradeAtTs": 1695863325000,
"totalFee": 0.00319968,
"type": "FULL",
"statisticAt": "2025-01-08T22:17:26.996Z",
"lastTradeAt": "2023-09-28T01:08:45.000Z",
"indexTokens": [
"0xC25cEf6061Cf5dE5eb761b50E4743c1F5D7E5407"
],
"protocol": "GMX_V2",
"createdAt": "2024-01-16T03:59:49.293Z"
}
],
"meta": {
"total": 178562,
"totalPages": 179,
"pitId": "4YyPBAEZY29waW4ucG9zaXRpb25fc3RhdGlzdGljcxZ0Rnk1Y0YxSVF0V0VxdFdIdW9kcWN3ABYtOHMtQnhZdFMwQ2J6bElvRTUwUDl3AAAAAAAAD8e3FjB3Tjh6eGRpU25hSUlZdTM3ODY2cHcAARZ0Rnk1Y0YxSVF0V0VxdFdIdW9kcWN3AAA=",
"searchAfter": [
"65a5ff35d2d3d9a90630c1d0",
756633
]
}
}
curl --request POST \
--url https://api.copin.io/trial/position/statistic/search-after \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '{
"pitId": "<string>",
"searchAfter": [
{}
],
"size": 123,
"queries": [
{
"fieldName": "<string>",
"value": "<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": {
"pitId": "<string>",
"searchAfter": [
{}
],
"total": 123,
"totalPages": 123
}
}