Get Closed Options Positions
Query user's closed options positions, sorted by closeTime
in descend order
info
- Only supports users to query closed options positions in recently 6 months
- Fee and price retain 8 decimal places and do not omit the last 0
HTTP Request
GET v5/position/get-closed-positions
Request Parameters
Parameter | Required | Type | Comments |
---|---|---|---|
category | true | string | option |
symbol | false | string | Symbol name |
startTime | false | integer | The start timestamp (ms)
|
endTime | false | integer | The end timestamp (ms) |
limit | false | integer | Limit for data size per page. [1 , 100 ]. Default: 50 |
cursor | false | string | Cursor. Use the nextPageCursor token from the response to retrieve the next page of the result set |
Response Parameters
Parameter | Type | Comments |
---|---|---|
nextPageCursor | string | Refer to the cursor request parameter |
category | string | Product type |
list | array | Object |
> symbol | string | Symbol name |
> side | string | Buy , Sell |
> totalOpenFee | string | Total Open Fee |
> deliveryFee | string | Delivery fee |
> totalCloseFee | string | Total close fee |
> qty | string | Order qty |
> closeTime | integer | The closed time (ms) |
> avgExitPrice | string | Average exit price |
> deliveryPrice | string | Delivery price |
> openTime | integer | The opened time (ms) |
> avgEntryPrice | string | Average entry price |
> totalPnl | string | Total PnL |
Request Example
- HTTP
GET v5/position/get-closed-positions?category=option&limit=1 HTTP/1.1
Host: api-testnet.bybit.com
X-BAPI-SIGN: XXXXX
X-BAPI-API-KEY: xxxxxxxxxxxxxxxxxx
X-BAPI-TIMESTAMP: 1672284128523
X-BAPI-RECV-WINDOW: 5000
Response Example
{
"retCode": 0,
"retMsg": "Success",
"result": {
"nextPageCursor": "1749726002161%3A0%2C1749715220240%3A1",
"category": "option",
"list": [
{
"symbol": "BTC-12JUN25-104019-C-USDT",
"side": "Sell",
"totalOpenFee": "0.94506647",
"deliveryFee": "0.32184533",
"totalCloseFee": "0.00000000",
"qty": "0.02",
"closeTime": 1749726002161,
"avgExitPrice": "107281.77405000",
"deliveryPrice": "107281.77405031",
"openTime": 1749722990063,
"avgEntryPrice": "3371.50000000",
"totalPnl": "0.90760719"
},
{
"symbol": "BTC-12JUN25-104000-C-USDT",
"side": "Buy",
"totalOpenFee": "0.86379999",
"deliveryFee": "0.32287622",
"totalCloseFee": "0.00000000",
"qty": "0.02",
"closeTime": 1749715220240,
"avgExitPrice": "107625.40470150",
"deliveryPrice": "107625.40470159",
"openTime": 1749710568608,
"avgEntryPrice": "3946.50000000",
"totalPnl": "-7.60858218"
}
]
},
"retExtInfo": {
},
"time": 1749736532193
}