Skip to main content

derive_limit_from_trigger

Function derive_limit_from_trigger 

Source
pub fn derive_limit_from_trigger(
    trigger_price: Decimal,
    is_buy: bool,
    slippage_bps: u32,
) -> Decimal
Expand description

Derives a limit price from a trigger price with a configurable slippage buffer in basis points, widening the limit so BUY satisfies limit_px >= trigger_px and SELL satisfies limit_px <= trigger_px.