Converts option quantities between unified base exposure and venue wire units.
Unified option order quantities and position contracts are expressed in
units of the option's base currency. Each authored venue declares whether its
native quantity field uses base units or contract counts.
Summary
Functions
Converts an option contract count to canonical base exposure.
Converts a venue option quantity to canonical base-currency exposure.
Converts parsed option orders and positions from venue wire units to base exposure.
Applies authored option quantity semantics to a parsed market.
Converts canonical base exposure to an option contract count.
Converts a canonical base-currency option amount to the venue wire unit.
Converts unified option order amounts before venue request shaping.
Functions
@spec from_contracts(Bourse.Market.t(), number() | String.t()) :: {:ok, number()} | {:error, Bourse.Error.t()}
Converts an option contract count to canonical base exposure.
@spec from_native(Bourse.Market.t(), number() | String.t()) :: {:ok, number()} | {:error, Bourse.Error.t()}
Converts a venue option quantity to canonical base-currency exposure.
@spec from_native_result!(term(), Bourse.Exchange.t()) :: term()
Converts parsed option orders and positions from venue wire units to base exposure.
@spec normalize_market(Bourse.Market.t(), map(), Bourse.Exchange.t()) :: Bourse.Market.t()
Applies authored option quantity semantics to a parsed market.
@spec to_contracts(Bourse.Market.t(), number() | String.t()) :: {:ok, number()} | {:error, Bourse.Error.t()}
Converts canonical base exposure to an option contract count.
@spec to_native(Bourse.Market.t(), number() | String.t()) :: {:ok, number()} | {:error, Bourse.Error.t()}
Converts a canonical base-currency option amount to the venue wire unit.
@spec to_native_request!(map(), Bourse.Exchange.t(), String.t()) :: map()
Converts unified option order amounts before venue request shaping.