pub fn parse_combined_account_balances_and_margins(
perp_state: &ClearinghouseState,
spot_state: &SpotClearinghouseState,
) -> Result<(Vec<AccountBalance>, Vec<MarginBalance>)>Expand description
Merges perp clearinghouse balances with spot balances into a unified set.
The perp parser already reflects combined USDC when its cross-margin summary carries collateral or margin state, so this helper appends only non-USDC spot tokens in that case. If the perp state has no margin summary, or the summary is present but zeroed, spot USDC is used verbatim.
ยงErrors
Returns an error if any balance conversion fails.