Skip to main content

parse_ws_cfm_account_state

Function parse_ws_cfm_account_state 

Source
pub fn parse_ws_cfm_account_state(
    summary: &WsFcmBalanceSummary,
    account_id: AccountId,
    ts_event: UnixNanos,
    ts_init: UnixNanos,
) -> Result<AccountState>
Expand description

Builds a margin [AccountState] from a WebSocket-delivered FCM balance summary.

The WebSocket payload does not carry explicit currency codes, so the balance is reported in USD (the only CFM settlement currency).

ยงErrors

Returns an error when any component balance cannot be constructed.