This subscription feed returns balance and margin information for the user account
Authentication is required.
Feed |
Event Type |
API Keys | Original & Signed Challenge |
account_balances_and_margins |
subscribe / unsubscribe
|
Any | Yes |
Sample Sent Message |
{ "event":"subscribe", "feed":"account_balances_and_margins", "api_key":"CMl2SeSn09Tz+2tWuzPiPUjaXEQRGq6qv5UaexXuQ3SnahDQU/gO3aT+", "original_challenge":"226aee50-88fc-4618-a42a-34f7709570b2", "signed_challenge":"RE0DVOc7vS6pzcEjGWd/WJRRBWb54RkyvV+AZQSRl4+rap8Rlk64diR+ Z9DQILm7qxncswMmJyvP/2vgzqqh+g==" } |
Sample Return if Successful. |
{ |
Field |
Type | Description |
event
|
string | The result, subscribed or subscribed_failed or unsubscribed or unsubscribed_failed |
feed | string | The requested subscription feed |
api_key | string | The user api key |
original_challenge | string | The message that is received from a challenge request |
signed_challenge | string | The signed challenge message with user api secret |
Sample Subscription Data |
{ "feed": "account_balances_and_margins", "account": "e258dba9-4dd4-4da5-bfef-75beb91c098e", "margin_accounts": [ { "name": "xbt", "balance": 0, "pnl": 0, "funding": 0, "pv": 0, "am": 0, "im": 0, "mm": 0 }, { "name": "f-xbt:usd", "balance": 9.99730211055, "pnl": -0.00006034858674327812, "funding": 0, "pv": 9.997241761963258, "am": 9.99666885201038, "im": 0.0005729099528781564, "mm": 0.0002864549764390782 }, ], "seq": 14 } |
|
Field |
Type | Description |
feed | string | The subscribed feed |
account | string | The user account name |
seq | positive integer | The subscription message sequence number |
margin_accounts | list of structures | A list containing the margin account structures |
name | string |
The name of the account |
balance | positive float |
The current balance of the account |
pnl | float | The profit and loss of the account |
funding | float |
The unrealised funding of the account |
pv | positive float |
The portfolio value calculated as balance plus unrealised pnl value |
am | positive float |
The available margin for opening new positions |
im | positive float |
The initial margin for open positions and orders |
mm | positive float |
The maintenance margin for open positions |
Sample Return if Unsuccessful |
{ "event":"error", "message":"Invalid product id" } |
Field |
Type | Description |
event | string | Always error |
message | string |
An error message out of:
|