validate_conditional_order

Function validate_conditional_order 

Source
pub fn validate_conditional_order(
    order_type: DydxOrderType,
    trigger_price: Option<Decimal>,
    price: Decimal,
    side: OrderSide,
) -> Result<()>
Expand description

Validate conditional order parameters.

Ensures that trigger prices are set correctly relative to limit prices based on order type and side.

ยงErrors

Returns an error if:

  • Conditional order is missing trigger price
  • Trigger price is on wrong side of limit price for the order type