Get Position History
Description
Get information about previous positions.
HTTP Request
GET /v3/trade/position/history
Request Parameters
Parameter | Required | Type | Description |
---|---|---|---|
symbol | No | String | A trading pair |
mgnMode | No | String | Margin Mode, Enumerate: ISOLATED , CROSS |
posSide | No | String | Position side LONG SHORT BOTH |
sTime | No | String | Starting time of the history, Unix timestamp format in milliseconds. The default is the last 90 days |
eTime | No | String | Ending time of the history, Unix timestamp format in milliseconds. The default is the last 90 days |
from | No | Long | It is id . ID for the query starts at 0 by default. |
limit | No | Integer | Pagination size defaults to 10, with a maximum limit of 100. |
direct | No | String | Enumerate: PREV , NEXT , The default is NEXT |
Response Parameters
Parameter | Type | Description |
---|---|---|
id | String | Pagination Query Id |
symbol | String | A trading pair |
side | String | Enumerate: BUY and SELL |
mgnMode | String | Margin Mode, Enumerate: ISOLATED , CROSS |
posSide | String | Position side LONG SHORT BOTH |
openAvgPx | String | Average entry price |
closeAvgPx | String | Average closing price |
qty | String | Conts of positions (Position size after execution) |
closedQty | String | closed qty |
availQty | String | Conts available to close |
pnl | String | Cumulative realized PnL |
fee | String | Position closing fee |
fFee | String | Cumulative funding charges |
state | String | Position Status: NORMAL , LIQ , and ADL |
cTime | String | Creation time |
uTime | String | Update time |
Request Example
{
"from": "0",
"symbol": "BTC_USDT_PERP",
"sTime": "1719880253000",
"eTime": "1719973853000",
"direct": "PREV",
"limit": 100
}
Response Example
{
"code": 200,
"data": [
{
"availQty": "0",
"cTime": "1719910544000",
"closeAvgPx": "0.6271",
"closedQty": "-2",
"fFee": "0.0000025",
"fee": "-0.00012541",
"id": "101000367",
"mgnMode": "CROSS",
"openAvgPx": "0.627",
"pnl": "-0.00002",
"posSide": "BOTH",
"qty": "0",
"side": "SELL",
"state": "NORMAL",
"symbol": "BTC_USDT_PERP",
"uTime": "1719916971000"
},
{
"availQty": "0",
"cTime": "1719919125000",
"closeAvgPx": "0.6272",
"closedQty": "-3",
"fFee": "0.0000345",
"fee": "-0.0001222995",
"id": "101000371",
"mgnMode": "CROSS",
"openAvgPx": "0.6271",
"pnl": "-0.00003",
"posSide": "BOTH",
"qty": "0",
"side": "SELL",
"state": "NORMAL",
"symbol": "BTC_USDT_PERP",
"uTime": "1719973712000"
}
],
"msg": "Success"
}