Bourse.OptionProposal.Result (bourse v0.1.0)

Copy Markdown View Source

Non-mutating option-proposal preflight outcome.

status is :approved only when every mechanical check passes. Rejections keep every projected quantity, selected hedge, residual, and violation so the caller can adjust strategy without the library inventing one.

Summary

Types

check()

@type check() :: %{
  name: atom(),
  status: :ok | :violation | :unknown | :unsupported,
  detail: term()
}

t()

@type t() :: %Bourse.OptionProposal.Result{
  checks: [check()],
  cross_venue: map() | nil,
  failures: [map()],
  hedge: map() | nil,
  margin_domains: [map()],
  observed_at: integer(),
  plan: map(),
  projected: map(),
  status: :approved | :rejected,
  strategy: map(),
  violations: [violation()]
}

violation()

@type violation() :: %{
  :code => atom(),
  :message => String.t(),
  optional(:check) => atom(),
  optional(:leg_id) => term(),
  optional(:detail) => term()
}