Get Staked Position
info
API key needs "Earn" permission
note
For Flexible Saving, fully redeemed position is also returned in the response For Onchain, only active position will be returned in the response
HTTP Request
GET /v5/earn/position
Request Parameters
Parameter | Required | Type | Comments |
---|---|---|---|
category | true | string | FlexibleSaving ,OnChain |
productId | false | string | Product ID |
coin | false | string | Coin name |
Response Parameters
Parameter | Type | Comments |
---|---|---|
list | array | Object |
> coin | string | Coin name |
> productId | string | Product ID |
> amount | string | Total staked amount |
> totalPnl | string | Return the profit of the current position. Only has value in Onchain non-LST mode |
> claimableYield | string | Yield accrues on an hourly basis and is distributed at 00:30 UTC daily. If you unstake your assets before yield distribution, any undistributed yield will be credited to your account along with your principal. Onchain products do not return values |
> id | string | Position Id. Only for Onchain |
> status | string | Processing ,Active . Only for Onchain |
> orderId | string | Order Id. Only for Onchain |
> estimateRedeemTime | string | Estimate redeem time, in milliseconds. Only for Onchain |
> estimateStakeTime | string | Estimate stake time, in milliseconds. Only for Onchain |
> estimateInterestCalculationTime | string | Estimated Interest accrual time, in milliseconds. Only for Onchain |
> settlementTime | string | Settlement time, in milliseconds. Only has value for Onchain Fixed product |
Request Example
- 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: XXXXXX
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="XXXXX",
api_secret="XXXXX",
)
print(session.get_staked_position(
category="FlexibleSaving",
coin="USDT",
))
Response Example
{
"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
}