Get Loan Account Info
Covers: Margin trade (Classic Account)
HTTP Request
GET /v5/spot-cross-margin-trade/account
Request Parameters
None
Response Parameters
Parameter | Type | Comments |
---|---|---|
acctBalanceSum | string | Total equity (BTC) |
debtBalanceSum | string | Total liability (BTC) |
loanAccountList | array | Object |
> free | string | Available balance |
> interest | string | Outstanding interest |
> loan | string | Outstanding principle |
> remainAmount | string | Remaining debt = interest + loan |
> locked | string | Locked amount |
> tokenId | string | Coin name |
> total | string | Total |
riskRate | string | Risk rate |
status | integer | Loan account status
|
switchStatus | integer | 0 : margin trade off, 1 : margin trade on |
Request Example
- HTTP
- Python
GET /v5/spot-cross-margin-trade/account HTTP/1.1
Host: api-testnet.bybit.com
X-BAPI-API-KEY: XXXXXX
X-BAPI-TIMESTAMP: 1677751305868
X-BAPI-RECV-WINDOW: 5000
X-BAPI-SIGN: XXXXXX
from pybit.unified_trading import HTTP
session = HTTP(
testnet=True,
api_key="XXXXX",
api_secret="XXXXX",
)
print(session.spot_margin_trade_normal_get_loan_account_info())
Response Example
{
"retCode": 0,
"retMsg": "success",
"result": {
"acctBalanceSum": "0.455189592150138021",
"debtBalanceSum": "0",
"loanAccountList": [
{
"free": "0.01444",
"interest": "0",
"loan": "0",
"locked": "0",
"remainAmount": "0",
"tokenId": "BTC",
"total": "0.01444"
},
{
"free": "0.21147048",
"interest": "0",
"loan": "0",
"locked": "0",
"remainAmount": "0",
"tokenId": "ETH",
"total": "0.21147048"
},
{
"free": "7963.58978991849",
"interest": "0",
"loan": "0",
"locked": "0",
"remainAmount": "0",
"tokenId": "USDT",
"total": "7963.58978991849"
},
{
"free": "1380.28832",
"interest": "0",
"loan": "0",
"locked": "0",
"remainAmount": "0",
"tokenId": "USDC",
"total": "1380.28832"
}
],
"riskRate": "0",
"status": 1,
"switchStatus": 1
},
"retExtInfo": {},
"time": 1677751306287
}