Bourse.OptionProposal.MarginImpact.Provider (bourse v0.1.0)

Copy Markdown View Source

Venue-owned margin simulation adapters.

Each adapter calls the venue's native endpoint and exposes only values the provider returned. The small amount of arithmetic is limited to differences between provider-reported before/after or baseline/scenario values.

Summary

Functions

Calls the venue-native margin endpoint for one caller-supplied plan.

Types

observation()

@type observation() :: %{
  metrics: %{optional(atom()) => number()},
  effects: %{margin: map(), capacity: map(), liquidation: map()},
  provider_response: map()
}

plan()

@type plan() :: %{
  :exchange => Bourse.Exchange.t(),
  :provider_params => map(),
  optional(:baseline_provider_params) => map(),
  optional(:request_opts) => keyword()
}

Functions

fetch(plan)

@spec fetch(plan()) :: {:ok, observation()} | {:error, Bourse.Error.t()}

Calls the venue-native margin endpoint for one caller-supplied plan.