查詢倉位資訊
信息
- API 金鑰需要具備 Earn(理財)權限。
- 僅返回活躍倉位,已結算的倉位不返回。
HTTP 請求
GET/v5/earn/advance/position請求參數
| 參數 | 必填 | 類型 | 說明 |
|---|---|---|---|
| category | true | string | 產品類別,DoubleWin |
| productId | false | string | 按產品 ID 篩選 |
| coin | false | string | 按標的資產篩選,例如:BTC, ETH |
| limit | false | int | 每頁返回數量。預設:20,最大:20 |
| cursor | false | string | 分頁游標。使用上次響應中的 nextPageCursor |
響應參數
| 參數 | 類型 | 說明 |
|---|---|---|
| category | string | 產品類別,DoubleWin |
| nextPageCursor | string | 下一頁游標,為空字串表示無更多資料 |
| list | array | 列表 |
| > positionId | string | 倉位 ID |
| > productId | string | 產品 ID |
| > category | string | 產品類別 |
| > investCoin | string | 投資幣種,例如:USDT |
| > underlyingAsset | string | 標的資產,例如:BTC, ETH |
| > amount | string | 倉位金額,單位為 investCoin |
| > leverage | string | 槓桿倍數 |
| > initialPrice | string | 建倉時的標的資產指數價格 |
| > lowerPrice | string | 價格區間下限 |
| > upperPrice | string | 價格區間上限 |
| > duration | string | 產品期限,例如:1d, 3d |
| > settlementTime | string | 結算時間,毫秒級 Unix 時間戳 |
| > createdTime | string | 倉位創建時間,毫秒級 Unix 時間戳 |
| > status | string | Active:持倉中;Redeeming:提前贖回進行中 |
| > redeemable | bool | 是否可立即贖回。若存在待處理的贖回訂單,或距結算時間不足 30 分鐘,則為 false |
| > accountType | string | 申購帳戶:FUND(資金帳戶),UNIFIED(統一帳戶) |
| > orderId | string | 申購訂單 ID |
請求示例
GET /v5/earn/advance/position?category=DoubleWin&productId=20001 HTTP/1.1
Host: api-testnet.bybit.com
X-BAPI-SIGN: XXXXX
X-BAPI-API-KEY: xxxxxxxxxxxxxxxxxx
X-BAPI-TIMESTAMP: 1672280218882
X-BAPI-RECV-WINDOW: 5000
響應示例
{
"retCode": 0,
"retMsg": "",
"result": {
"category": "DoubleWin",
"list": [
{
"positionId": "2848",
"productId": "14084",
"category": "DoubleWin",
"investCoin": "USDT",
"underlyingAsset": "BTC",
"amount": "150",
"leverage": "9.3309793178843419",
"initialPrice": "66445.69",
"lowerPrice": "66245.69",
"upperPrice": "66645.69",
"duration": "1d",
"settlementTime": "1775203200000",
"createdTime": "1775107014000",
"status": "Active",
"redeemable": true,
"accountType": "FUND",
"orderId": "05184c23-8a98-456c-a2af-0ef1c45116cc"
}
],
"nextPageCursor": ""
},
"retExtInfo": {},
"time": 1775107714828
}