pub fn engine_positions_to_portfolio_balance(
positions: &HashMap<(WalletAddress, String), EnginePosition>,
wallet: &WalletAddress,
reference_prices: &HashMap<String, f64>,
) -> PortfolioBalanceExpand description
Convert engine positions to a PortfolioBalance for margin calculations.
This is a runtime helper that uses crate-local types (PortfolioBalance,
PositionData) which cannot live in the pure hypercall-engine crate.