What gets committed
The event leaves and the state leaf that make up your committed history.
Event leaves
Your event leaves record your account activity:
- orders placed, modified and cancelled, and also orders rejected by the matching engine, with the reason. Refusals are committed too, so a rejection is as accountable as a fill;
- fills: price, size, fee, and whether you were maker or taker, but never who was on the other side;
- funding settlements;
- deposits and withdrawal requests, each tied to its contract on the ledger;
- session key authorisations and linked sign-in credentials;
- liquidations, auto-deleveraging, and any loss covered by the insurance fund;
- take profit and stop loss triggers being set, cancelled and fired;
- leverage and margin mode changes, and margin moved in or out of a position;
- referral credits and claims.
Your event leaves keep the order in which things happened. Change the order, drop one or add one, and your event root changes.
The state leaf
Your account as it stood at the end of the cycle:
- your USDCx balance;
- each open position: market, size, cost basis, margin, leverage and margin mode;
- your withdrawal counter;
- any unclaimed referral credit.
Balances and costs are stored as exact integers, not rounded decimals, so an account can be re-added from its leaves alone with no rounding tolerance.
For the exact bytes of each, see Byte layouts.