Balances
Balance
Shorten | Field | Description |
---|---|---|
i | instrumentId | The identifier of the instrument of the balance. |
a | available | The available amount of the balance. |
o | ordersReserved | The active amount of reservation for orders. |
w | withdrawalReserved | The active amount of reservation for withdrawals. |
c | credit | The credit amount of the balance which indicates a negative balance. |
Subscribe
Balance topic will push to the stream any change to the fields above but the initial values should be read from the REST endpoint.
Request
{
"t": "8cc80065-6679-4426-9f96-d7023220226c@balances",
"e": "tdx:subscribe",
"a": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.e30.LwimMJA3puF3ioGeS-tfczR3370GXBZMIL-bdpu4hOU"
}
Replies
{
"t": "8cc80065-6679-4426-9f96-d7023220226c@balances",
"e": "tdx:subscription_received"
}
{
"t": "8cc80065-6679-4426-9f96-d7023220226c@balances",
"e": "balance",
"d": {
"i": "20000000-2000-0000-0000-000000000000",
"a": "1716250.53625186733055873623",
"o": "156.35",
"w": "2045",
"c": "0"
}
}
Unsubscribe
Balance updates can be stopped by unsubscribing to the topic.
Request
{
"t": "8cc80065-6679-4426-9f96-d7023220226c@balances",
"e": "tdx:unsubscribe"
}
Replies
{
"t": "8cc80065-6679-4426-9f96-d7023220226c@balances",
"e": "tdx:unsubscribe_succeeded"
}
Updated 16 days ago