Pre-submit order validation against market metadata.
Checks order shape, exchange order-type support, market limits, tick-size precision, and optional price deviation before an order is submitted.
Unified Bourse.create_order and Bourse.edit_order calls opt in with
sanity: true. The default is false so existing callers retain the
exchange's validation contract; validation is skipped when markets have not
been loaded with Bourse.load_markets/1.
Options
:has— the exchange capability map, used to reject unsupported order types.:partial— whentrue, an absentamountorpriceis treated as a field that is not being changed rather than a missing required field. The unified path sets this foredit_order, which carries only the changed fields.:reference_price/:deviation_threshold— opt into the price-deviation warning.:warnings—:strictpromotes warnings to errors.
Summary
Functions
Validates order amount against market limits and precision.
Validates order notional against market cost limits.
Validates order type and optional exchange capability support.
Validates order price against order type, market limits, and precision.
Warns when price deviates beyond the configured reference-price threshold.
Validates order side.
Validates order symbol against market metadata.
Runs all applicable sanity checks and collects every hard failure.
Types
Functions
Validates order amount against market limits and precision.
Validates order notional against market cost limits.
Validates order type and optional exchange capability support.
Validates order price against order type, market limits, and precision.
Warns when price deviates beyond the configured reference-price threshold.
Validates order side.
Validates order symbol against market metadata.
@spec validate(map() | Bourse.Order.Builder.t(), map() | nil, keyword()) :: result()
Runs all applicable sanity checks and collects every hard failure.