Skip to main content

has_portfolio_positions

Function has_portfolio_positions 

Source
pub fn has_portfolio_positions(account: &Account, delta_threshold: f64) -> bool
Expand description

Detect whether a legacy account has portfolio exposure requiring PM math.

Options always count as live exposure. Perps count when account delta exceeds delta_threshold or when residual perp UPNL is non-zero, so flat but unsettled accounts are not treated as empty.