This endpoint returns key information relating to all your Crypto Facilities accounts which may either be cash accounts or margin accounts. This includes digital asset balances, instrument balances, margin requirements, margin trigger estimates and auxiliary information such as available funds, PnL of open positions and portfolio value.
Authentication is required.
Endpoint |
Request Type | Permissible API Keys |
/api/v3/accounts
|
GET | Read-only, Read-write, Master |
Arguments
|
None
|
Sample Call |
https://www.cryptofacilities.com/derivatives/api/v3/accounts
|
Sample Return if Successful |
{ "result":"success", "serverTime":"2016-02-25T09:45:53.818Z", "accounts":{ "cash":{ "type":"cashAccount", "balances":{ "xbt":141.31756797, "xrp":52465.1254, }, }, "fi_xbtusd":{ "type":"marginAccount", "currency":"xbt", "balances":{ "fi_xbtusd_171215":50000, "fi_xbtusd_180615":-15000, ..., "xbt":141.31756797, "xrp":0, }, "auxiliary":{ "af":100.73891563, "pnl":12.42134766, "pv":153.73891563, }, "marginRequirements":{ "im":52.8, "mm":23.76, "lt":39.6, "tt":15.84, }, "triggerEstimates":{ "im":3110, "mm":3000, "lt":2890, "tt":2830, }, }, ... }, } |
Field |
Type | Description |
result
|
String | Always success |
serverTime
|
ISO8601 datetime | The server date and time |
accounts
|
structure of structures | A structure containing structures with account-related information for all margin and cash accounts, see below |
<accountSymbol> | structure of structures | A structure containing structures with account-related information for a specific cash or margin account, see below. Named after the symbol of the account, see Section 3.4.4 |
type | string | The type of the account, either cashAccount or marginAccount. |
currency | string | The currency of the account. All figures shown in auxiliary and marginRequirements are in this currency. Returned only for margin accounts |
balances | structure | A structure containing account balances, see below |
<symbol> | string | The number of Futures or currency with symbol in the account, see Section 3.4.4 |
auxiliary | structure | A structure containing auxiliary account information, see below. Returned only for margin accounts |
af | float | The available funds of the account, in currency |
pnl | float | The PnL of current open positions of the account, in currency |
pv | positive float | The portfolio value of the account, in currency |
marginRequirements | structure | A structure containing the account’s margin requirements, see below. Returned only for margin accounts |
im | positive float | The initial margin requirement of the account |
mm | positive float | The maintenance margin requirement of the account |
lt | positive float | The liquidation threshold of the account |
tt | positive float | The assignment threshold of the account |
triggerEstimates | structure | A structure containing the account’s margin trigger estimates, see below. Returned only for margin accounts |
im | positive float | The approximate spot price of the underlying at which the account will reach its initial margin requirement |
mm | positive float | The approximate spot price of the underlying at which the account will reach its maintenance margin requirement |
lt | positive float | The approximate spot price of the underlying at which the account will reach its liquidation threshold |
tt | positive float | The approximate spot price of the underlying at which the account will reach its assignment threshold |
Sample Return if Unsuccessful |
{ "result":"error", "serverTime":"2016-02-25T09:45:53.818Z", "error":"apiLimitExceeded", } |
Field |
Type | Description |
result
|
String | Always error |
serverTime
|
ISO8601 datetime | The server date and time |
error
|
string |
The reason the API call failed, either of:
|