查詢利息記錄
獲取利息記錄,按照創建時間倒敘排列
HTTP 請求
GET /v5/account/borrow-history
請求參數
參數 | 是否必需 | 類型 | 說明 |
---|---|---|---|
currency | false | string | USDC、USDT、BTC、ETH |
startTime | false | integer | 開始時間戳 (毫秒)
|
endTime | false | integer | 結束時間 (毫秒) |
limit | false | integer | 每頁數量, 最大50. 默認每頁20條 |
cursor | false | string | 游標,用於翻頁 |
響應參數
參數 | 類型 | 說明 |
---|---|---|
list | array | Object |
> currency | string | USDC、USDT、BTC、ETH |
> createdTime | integer | 時間戳(毫秒) |
> borrowCost | string | 利息 |
> hourlyBorrowRate | string | 利率 |
> InterestBearingBorrowSize | string | 豁免利息額度 |
> costExemption | string | 豁免計息成本 |
> borrowAmount | string | 當前總借貸 |
> unrealisedLoss | string | 浮動虧損 |
> freeBorrowedAmount | string | 借款中免息的數額 |
nextPageCursor | string | 游標,用於翻頁 |
請求示例
- HTTP
- Python
- Node.js
GET /v5/account/borrow-history?currency=BTC&limit=1 HTTP/1.1
Host: api-testnet.bybit.com
X-BAPI-SIGN: XXXXX
X-BAPI-API-KEY: XXXXX
X-BAPI-TIMESTAMP: 1672277745427
X-BAPI-RECV-WINDOW: 5000
from pybit.unified_trading import HTTP
session = HTTP(
testnet=True,
api_key="XXXXX",
api_secret="XXXXX",
)
print(session.get_borrow_history(
currency="BTC",
limit=1,
))
const { RestClientV5 } = require('bybit-api');
const client = new RestClientV5({
testnet: true,
key: 'apikey',
secret: 'apisecret',
});
client
.getBorrowHistory({
currency: 'USDT',
startTime: 1670601600000,
endTime: 1673203200000,
limit: 30,
cursor: 'nextPageCursorToken',
})
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
響應示例
{
"retCode": 0,
"retMsg": "OK",
"result": {
"nextPageCursor": "2671153%3A1%2C2671153%3A1",
"list": [
{
"borrowAmount": "1.06333265702840778",
"costExemption": "0",
"freeBorrowedAmount": "0",
"createdTime": 1697439900204,
"InterestBearingBorrowSize": "1.06333265702840778",
"currency": "BTC",
"unrealisedLoss": "0",
"hourlyBorrowRate": "0.000001216904",
"borrowCost": "0.00000129"
}
]
},
"retExtInfo": {},
"time": 1697442206478
}