查詢理財持倉
信息
API key需要"理財""權限
備註
對於活期儲蓄,返回訊息裡也返回完全贖回的部分 對於鏈上賺幣,返回訊息中僅返回當前的部分
HTTP 請求
GET /v5/earn/position
請求參數
參數 | 是否必需 | 類型 | 說明 |
---|---|---|---|
category | true | string | 產品類別:FlexibleSaving ,OnChain |
productId | false | string | 持倉對應的產品 ID |
coin | false | string | 幣種名稱 |
響應參數
參數 | 類型 | 說明 |
---|---|---|
list | array | Object |
> coin | string | 幣種名稱 |
> productId | string | 持倉對應的產品 ID |
> amount | string | 持倉金額 |
> totalPnl | string | 持倉總收益。僅在 OnChain 非 LST 模式下有價值 |
> claimableYield | string | 收益按小時累計,並於每天 UTC 時間 00:30 分發。如果您在收益分配之前取消質押資產,任何未分配的收益將與您的本金一起記入您的帳戶。 |
> id | string | 持倉ID. 僅適用於 OnChain |
> status | string | Processing ,Active . 僅適用於 OnChain |
> orderId | string | 訂單編號. 僅適用於 OnChain |
> estimateRedeemTime | string | 預計贖回時間。以毫秒為單位.僅適用於 OnChain |
> estimateStakeTime | string | 預計質押時間。以毫秒為單位.僅適用於 OnChain |
> estimateInterestCalculationTime | string | 預計計息時間。以毫秒為單位.僅適用於 OnChain |
> settlementTime | string | 結算時間。以毫秒為單位.僅對 OnChain Fixed 產品有價值 |
請求示例
- HTTP
- Python
- Node.js
GET /v5/earn/position?category=FlexibleSaving&coin=USDT HTTP/1.1
Host: api-testnet.bybit.com
X-BAPI-SIGN: XXXXXX
X-BAPI-API-KEY: xxxxxxxxxxxxxxxxxx
X-BAPI-TIMESTAMP: 1739944576277
X-BAPI-RECV-WINDOW: 5000
Content-Type: application/json
from pybit.unified_trading import HTTP
session = HTTP(
testnet=True,
api_key="xxxxxxxxxxxxxxxxxx",
api_secret="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
)
print(session.get_staked_position(
category="FlexibleSaving",
coin="USDT",
))
響應示例
{
"retCode": 0,
"retMsg": "",
"result": {
"list": [
{
"coin": "BTC",
"productId": "8",
"amount": "0.1",
"totalPnl": "0.000027397260273973",
"claimableYield": "0",
"id": "326",
"status": "Active",
"orderId": "1a5a8945-e042-4dd5-a93f-c0f0577377ad",
"estimateRedeemTime": "",
"estimateStakeTime": "",
"estimateInterestCalculationTime": "1744243200000",
"settlementTime": "1744675200000"
}
]
},
"retExtInfo": {},
"time": 1739944577575
}