DpExchange.Core.Types.OptionGreeks (DpExchangeCore v0.3.22)

Copy Markdown View Source

Risk sensitivities and implied volatility for one option contract.

These are model output, not market data

Every field here is computed, not observed. A venue picks a pricing model, feeds it its own mark, its own volatility surface, its own rate and its own clock, and publishes the result. Two venues quoting the same contract will publish different Greeks, and neither is wrong.

That is why they are separated from Types.OptionContract, which is fact, and from Types.Quote and Types.TopOfBook, which are observations. A caller comparing deltas across venues is comparing two models, and nothing in this struct tells it so — this moduledoc is where that is said.

:model_price is the venue's theoretical value. It is the number most easily mistaken for a price: it is what the venue's model says the contract is worth, not what anyone paid or offered. It is deliberately not named price.

:implied_volatility is a percentage

Venues publish it as a percentage or as a decimal fraction, and the two differ by 100×. Normalised to a percentage on the way in — 30.0 means 30%, not 3000%.

:open_interest is a count and it is stale

Open interest is published once a day by the clearing house, after settlement. A caller reading it intraday is reading yesterday's number, and :as_of says which day where the venue states it. Volume, by contrast, is live — and lives on Types.Quote.

Summary

Functions

Builds a t/0, failing closed if a required field is absent or nil.

Types

t()

@type t() :: %DpExchange.Core.Types.OptionGreeks{
  as_of: DateTime.t() | nil,
  delta: Decimal.t() | nil,
  gamma: Decimal.t() | nil,
  implied_volatility: Decimal.t() | nil,
  model_price: Decimal.t() | nil,
  open_interest: Decimal.t() | nil,
  provider: atom(),
  rho: Decimal.t() | nil,
  theta: Decimal.t() | nil,
  underlying_price: Decimal.t() | nil,
  vega: Decimal.t() | nil
}

Functions

new(attrs)

@spec new(keyword() | map()) :: t()

Builds a t/0, failing closed if a required field is absent or nil.

@enforce_keys guards presence, not nil — see DpExchange.Core.Types.Validate.