Bourse.OptionProposal.Projection (bourse v0.1.0)

Copy Markdown View Source

Pure post-trade exposure projection for caller-supplied option legs.

Quantities use the unified canonical base unit and are checked for exact representability in the venue's confronted native unit before Greeks are applied. This module never chooses trades or places orders.

Summary

Functions

Applies a signed hedge delta contribution to a projected post-trade map.

Projects signed Greek, notional and per-domain margin effects for option legs.

Types

leg()

@type leg() :: %{
  :id => term(),
  :venue => String.t(),
  :account => term(),
  :symbol => String.t(),
  :side => String.t(),
  :amount => number(),
  :market => Bourse.Market.t(),
  :greeks => Bourse.InstrumentGreeks.t(),
  optional(:price) => number() | nil,
  optional(:type) => String.t()
}

Functions

apply_hedge_delta(post_trade, hedge_delta)

@spec apply_hedge_delta(map(), number()) :: map()

Applies a signed hedge delta contribution to a projected post-trade map.

project_legs(legs, baseline_contributions \\ [])

@spec project_legs([leg()], [map()]) ::
  {:ok, map()} | {:error, atom() | {atom(), term()}}

Projects signed Greek, notional and per-domain margin effects for option legs.