Skip to main content

Get Position History

Description

Get information about previous positions.

HTTP Request

GET /v3/trade/position/history

Request Parameters

ParameterRequiredTypeDescription
symbolNoStringA trading pair
mgnModeNoStringMargin Mode, Enumerate: ISOLATED, CROSS
sTimeNoStringStarting time of the history, Unix timestamp format in milliseconds. The default is the last 180 days
eTimeNoStringEnding time of the history, Unix timestamp format in milliseconds. The default is the last 180 days
fromNoLongIt is id. ID for the query starts at 0 by default.
limitNoIntegerPagination size defaults to 10, with a maximum limit of 100.
directNoStringEnumerate: PREV, NEXT, The default is NEXT

Response Parameters

ParameterTypeDescription
idStringPagination Query Id
symbolStringA trading pair
posSideStringBoth sides
sideStringEnumerate: BUY and SELL
mgnModeStringMargin Mode, Enumerate: ISOLATED, CROSS
openAvgPxStringAverage entry price
closeAvgPxStringAverage closing price
qtyStringConts of positions (Position size after execution)
closedQtyStringclosed qty
availQtyStringConts available to close
pnlStringCumulative realized PnL
feeStringPosition closing fee
fFeeStringCumulative funding charges
stateStringPosition Status: NORMAL, LIQ, and ADL
cTimeStringCreation time
uTimeStringUpdate 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"
}