ledgers channel streams each entry written to the account ledger as it happens. Every entry records one change to one balance: a currency balance in a wallet, or the size of a derivatives position.
Entries produced by derivatives activity carry additional detail, such as the trade and mark price, average entry prices, realized profit and loss, and funding.
For current balances, see the balances channel. For open positions, see the positions channel.
This channel contains account specific data, an authentication token is required in the request.
The channel does not currently support snapshots. Each update carries a
sequence number per connection. A gap in the sequence means an update was not delivered; use the REST Ledgers endpoint to recover missed entries.Subscribe
- Request
- Response
asset_class parameter. The ledger is account-wide and records entries for every asset class, so there is nothing to select — read asset_class on each entry to tell them apart. Sending params.asset_class on a subscribe or an unsubscribe is rejected with 'params.asset_class' is not valid for the ledgers channel.
Update
An update is streamed for each new entry in the account ledger.string
Value:
ledgersstring
One of:
updateobject[]
The ledger entry.
integer
The connection’s message sequence number.