Skip to content

Commit

Permalink
test(GetPositionInfo): add missing property to response
Browse files Browse the repository at this point in the history
  • Loading branch information
hirokisan committed Dec 22, 2023
1 parent ef28918 commit fbdb332
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 69 deletions.
Original file line number Diff line number Diff line change
@@ -1,58 +1,39 @@
{
"category": "linear",
"nextPageCursor": "",
"nextPageCursor": "BTCUSDT%2C1691735404177%2C0",
"list": [
{
"symbol": "BTCUSDT",
"leverage": "2",
"avgPrice": "22714",
"liqPrice": "0.10",
"riskLimitValue": "2000000",
"takeProfit": "0.00",
"positionValue": "22.714",
"tpslMode": "Full",
"riskId": 1,
"trailingStop": "0.00",
"unrealisedPnl": "1.90344",
"markPrice": "24617.44",
"cumRealisedPnl": "-592.751693",
"positionMM": "0.0000005",
"createdTime": "1637760408825",
"positionIdx": 1,
"positionIM": "0.22714",
"updatedTime": "1676678400081",
"side": "Buy",
"bustPrice": "0.10",
"size": "0.001",
"positionStatus": "Normal",
"stopLoss": "0.00",
"tradeMode": 0
},
{
"symbol": "BTCUSDT",
"leverage": "2",
"leverage": "1",
"avgPrice": "0",
"liqPrice": "0.00",
"riskLimitValue": "2000000",
"takeProfit": "0.00",
"positionValue": "0",
"liqPrice": "",
"riskLimitValue": "6000000",
"takeProfit": "",
"positionValue": "",
"tpslMode": "Full",
"riskId": 1,
"trailingStop": "0.00",
"unrealisedPnl": "0",
"markPrice": "24578.06",
"cumRealisedPnl": "0",
"riskId": 3,
"trailingStop": "0",
"unrealisedPnl": "",
"markPrice": "43577.97",
"cumRealisedPnl": "-1618.71655122",
"adlRankIndicator": 0,
"isReduceOnly": false,
"mmrSysUpdatedTime": "",
"leverageSysUpdatedTime": "",
"positionMM": "0",
"createdTime": "1637760408825",
"positionIdx": 2,
"positionBalance": "0",
"createdTime": "1677287853003",
"updatedTime": "1691735404177",
"seq": 8093271558,
"positionIdx": 0,
"positionIM": "0",
"updatedTime": "1676678400081",
"side": "Sell",
"bustPrice": "0.00",
"size": "0.000",
"side": "",
"bustPrice": "",
"size": "0",
"positionStatus": "Normal",
"stopLoss": "0.00",
"tradeMode": 0
"stopLoss": "",
"tradeMode": 0,
"autoAddMargin": 0
}
]
}
55 changes: 31 additions & 24 deletions v5_position_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,30 +27,37 @@ func TestV5Position_GetPositionInfo(t *testing.T) {
"nextPageCursor": "",
"list": []map[string]interface{}{
{
"symbol": "BTCUSDT",
"leverage": "2",
"avgPrice": "22714",
"liqPrice": "0.10",
"riskLimitValue": "2000000",
"takeProfit": "0.00",
"positionValue": "22.714",
"tpslMode": "Full",
"riskId": 1,
"trailingStop": "0.00",
"unrealisedPnl": "1.90344",
"markPrice": "24617.44",
"cumRealisedPnl": "-592.751693",
"positionMM": "0.0000005",
"createdTime": "1637760408825",
"positionIdx": 1,
"positionIM": "0.22714",
"updatedTime": "1676678400081",
"side": "Buy",
"bustPrice": "0.10",
"size": "0.001",
"positionStatus": "Normal",
"stopLoss": "0.00",
"tradeMode": 0,
"symbol": "BTCUSDT",
"leverage": "1",
"avgPrice": "0",
"liqPrice": "",
"riskLimitValue": "6000000",
"takeProfit": "",
"positionValue": "",
"tpslMode": "Full",
"riskId": 3,
"trailingStop": "0",
"unrealisedPnl": "",
"markPrice": "43577.97",
"cumRealisedPnl": "-1618.71655122",
"adlRankIndicator": 0,
"isReduceOnly": false,
"mmrSysUpdatedTime": "",
"leverageSysUpdatedTime": "",
"positionMM": "0",
"positionBalance": "0",
"createdTime": "1677287853003",
"updatedTime": "1691735404177",
"seq": 8093271558,
"positionIdx": 0,
"positionIM": "0",
"side": "",
"bustPrice": "",
"size": "0",
"positionStatus": "Normal",
"stopLoss": "",
"tradeMode": 0,
"autoAddMargin": 0,
},
},
},
Expand Down

0 comments on commit fbdb332

Please sign in to comment.