查詢USDC結算紀錄
查詢USDC永續的結算紀錄
HTTP 請求
GET /v5/asset/settlement-record
請求參數
參數 | 是否必需 | 類型 | 說明 |
---|---|---|---|
category | true | string | 產品類型. linear |
symbol | false | string | 合約名稱 |
startTime | false | integer | 開始時間戳 (毫秒)
|
endTime | false | integer | 結束時間 (毫秒) |
limit | false | integer | 每頁數量限制. [1 , 50 ]. 默認: 20 |
cursor | false | string | 游標,用於翻頁 |
響應參數
參數 | 類型 | 說明 |
---|---|---|
category | string | 產品類型 |
list | array | Object |
> symbol | string | 合約名稱 |
> side | string | Buy ,Sell |
> size | string | 倉位大小 |
> sessionAvgPrice | string | 結算價格 |
> markPrice | string | 標記價格 |
> realisedPnl | string | 已實現盈虧 |
> createdTime | string | 結算時間 (毫秒) |
nextPageCursor | string | 游標,用於翻頁 |
請求示例
- HTTP
- Python
- Node.js
GET /v5/asset/settlement-record?category=linear HTTP/1.1
Host: api-testnet.bybit.com
X-BAPI-SIGN: XXXXX
X-BAPI-API-KEY: XXXXX
X-BAPI-TIMESTAMP: 1672284883483
X-BAPI-RECV-WINDOW: 5000
from pybit.unified_trading import HTTP
session = HTTP(
testnet=True,
api_key="XXXXX",
api_secret="XXXXX",
)
print(session.get_usdc_contract_settlement(
category="linear",
))
const { RestClientV5 } = require('bybit-api');
const client = new RestClientV5({
testnet: true,
key: 'apikey',
secret: 'apisecret',
});
client
.getSettlementRecords({ category: 'linear' })
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
響應示例
{
"retCode": 0,
"retMsg": "OK",
"result": {
"nextPageCursor": "116952%3A1%2C116952%3A1",
"category": "linear",
"list": [
{
"realisedPnl": "-71.28",
"symbol": "BTCPERP",
"side": "Buy",
"markPrice": "16620",
"size": "1.5",
"createdTime": "1672214400000",
"sessionAvgPrice": "16620"
}
]
},
"retExtInfo": {},
"time": 1672284884285
}