跳至主要内容

查詢倉位資訊

信息
  • API 金鑰需要具備 Earn(理財)權限。
  • 僅返回活躍倉位,已結算的倉位不返回。

HTTP 請求

GET/v5/earn/advance/position

請求參數

參數必填類型說明
categorytruestring產品類別,DoubleWin
productIdfalsestring按產品 ID 篩選
coinfalsestring按標的資產篩選,例如:BTC, ETH
limitfalseint每頁返回數量。預設:20,最大:20
cursorfalsestring分頁游標。使用上次響應中的 nextPageCursor

響應參數

參數類型說明
categorystring產品類別,DoubleWin
nextPageCursorstring下一頁游標,為空字串表示無更多資料
listarray列表
> positionIdstring倉位 ID
> productIdstring產品 ID
> categorystring產品類別
> investCoinstring投資幣種,例如:USDT
> underlyingAssetstring標的資產,例如:BTC, ETH
> amountstring倉位金額,單位為 investCoin
> leveragestring槓桿倍數
> initialPricestring建倉時的標的資產指數價格
> lowerPricestring價格區間下限
> upperPricestring價格區間上限
> durationstring產品期限,例如:1d, 3d
> settlementTimestring結算時間,毫秒級 Unix 時間戳
> createdTimestring倉位創建時間,毫秒級 Unix 時間戳
> statusstringActive:持倉中;Redeeming:提前贖回進行中
> redeemablebool是否可立即贖回。若存在待處理的贖回訂單,或距結算時間不足 30 分鐘,則為 false
> accountTypestring申購帳戶:FUND(資金帳戶),UNIFIED(統一帳戶)
> orderIdstring申購訂單 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
}