Skip to main content

build_unified_account_state

Function build_unified_account_state 

Source
pub fn build_unified_account_state(
    balances: Vec<AccountBalance>,
    margin: Option<MarginBalance>,
    account_id: AccountId,
    ts_event: UnixNanos,
    ts_init: UnixNanos,
) -> AccountState
Expand description

Assembles the unified [AccountState] from already-parsed components.

The reconciler in the websocket::account_state module owns the latest snapshot of each input stream and calls this once per emission. AccountType::Margin is invariant for Lighter; base_currency is None because the account holds multiple spot currencies.