Accounts
Account Balances
Get account balances
GET
/api/balances/
Get token balances and positions in your configured accounts. Identity is inferred by API token.
Path Parameters
account_names
list of strings
Optional. If specified, only balances for the accounts in this parameter are retrieved.
Refer to MarketType and AssetType in Type Reference for more details on these balance attributes.
notional_pct_total - calculated as the ratio of notional against total notional for all assets within the same market_type
{
"AccountABC": {
"exchange": "Bybit",
"assets": [
{
"symbol": "ETH:PERP-USDT",
"size": 1.69,
"notional": 3051.5284,
"market_type": "perp",
"asset_type": "position",
"unrealized_profit": 24.6772,
"initial_margin": 306.80066534,
"maint_margin": 16.90546734,
"margin_balance": 298.90609459,
"leverage": 10.0,
"notional_pct_total": 0.994565
},
{
"symbol": "USDT",
"size": 275.56989474,
"notional": 275.569895,
"market_type": "unified",
"asset_type": "token",
"unrealized_profit": 23.33619985,
"initial_margin": 308.47710954,
"maint_margin": 17.08121552,
"margin_balance": 298.90609459,
"leverage": null,
"notional_pct_total": 0.817474
},
...
]
},
"Account123": {
"exchange": "Binance",
"assets": [
{
"symbol": "USDT",
"size": 1414.06039641,
"notional": 1414.060396,
"market_type": "perp",
"asset_type": "token",
"unrealized_profit": 11.02638782,
"initial_margin": 155.72429442,
"maint_margin": 3.32015061,
"margin_balance": 1425.08678423,
"leverage": null,
"notional_pct_total": 0.6449
},
{
"symbol": "BTC:PERP-USDT",
"size": 0.021,
"notional": 572.956735,
"market_type": "perp",
"asset_type": "position",
"unrealized_profit": 7.87343483,
"initial_margin": 114.59134696,
"maint_margin": 2.29182693,
"margin_balance": null,
"leverage": 5.0,
"notional_pct_total": 0.261304
},
...
]
}
}
Create an account for an exchange
POST
/api/accounts/
Name must be unique under each user.
Request Body
name*
name of account
api_key*
String
API key for exchange
api_secret*
String
API secret for exchange
password
String
password for exchange if required
{
"message": "Successfully created abcdef"
}
Archive account
DELETE
/api/accounts/
Soft delete the account. It will no longer be usable but reference to orders will be maintained. It will also be renamed to indicate it is archived: ex. {account_name}_archived_{uuid}
Request Body
name*
name of account
{
"message": "Successfully created abcdef"
}
Was this helpful?