Skip to main content

apply_option_withdrawal_to_positions

Function apply_option_withdrawal_to_positions 

Source
pub fn apply_option_withdrawal_to_positions(
    positions: &mut HashMap<(WalletAddress, String), EnginePosition>,
    wallet: WalletAddress,
    symbol: String,
    quantity: Decimal,
) -> Result<(), String>
Expand description

Debit option-token inventory for an on-chain withdrawal.

Withdrawals are custody movements out of the engine, not sells. They can only reduce existing long inventory and must not realize PnL or mutate cash.