Exact bounded optimization for caller-approved option-risk instruments.
The caller supplies every instrument, side, quantity bound, objective, weight, tolerance, hard limit, and tie-break rule. The optimizer searches only those finite venue-valid quantity grids. It returns a v1-shaped plan when feasible and a labelled diagnosis when no grid point satisfies every objective and hard limit.
Summary
Functions
Solves one finite caller-authored option-risk problem.
Types
@type instrument() :: %{ :id => term(), :venue => String.t(), :account => term(), :symbol => String.t(), :side => String.t(), :market => Bourse.Market.t(), :quantity_limits => %{min: number(), max: number()}, optional(:greeks) => Bourse.InstrumentGreeks.t(), optional(:kind) => atom() | String.t(), optional(:price) => number(), optional(:type) => String.t() }
@type problem() :: %{ :instruments => [instrument()], :objectives => %{required(atom()) => objective()}, :hard_limits => map(), :tie_break_policy => [atom()], :venue_policy => atom(), optional(:baseline_contributions) => [map()], optional(:max_combinations) => pos_integer() }
Functions
Solves one finite caller-authored option-risk problem.
Option quantities are canonical base amounts and are checked with
Bourse.Unified.OptionQuantity. At most one non-option delta hedge is accepted
because the emitted plan.hedge deliberately retains the v1 singular shape.