Bourse.PortfolioRisk (bourse v0.1.0)

Copy Markdown View Source

Builds point-in-time portfolio risk across venue/account domains.

The reader performs no writes and holds no state. Balances, positions, and open orders remain attached to their originating venue/account domain. Aggregates contain only compatible exposure buckets; failures and blocked buckets make incomplete results explicit.

Summary

Functions

Builds one venue/account scope for snapshot/2.

Reads and composes a multi-venue portfolio-risk snapshot.

Types

scope()

@type scope() :: %{
  :exchange => Bourse.Exchange.t(),
  :account => term(),
  optional(:request_opts) => keyword()
}

Functions

scope(exchange, account, request_opts \\ [])

@spec scope(Bourse.Exchange.t(), term(), keyword()) :: scope()

Builds one venue/account scope for snapshot/2.

snapshot(scopes, opts \\ [])

@spec snapshot(
  [scope()],
  keyword()
) :: {:ok, Bourse.PortfolioRisk.Snapshot.t()} | {:error, Bourse.Error.t()}

Reads and composes a multi-venue portfolio-risk snapshot.

Options:

  • :timeout — per-scope and per-component task timeout
  • :observed_at — local observation timestamp override
  • :max_age_ms — optional source-timestamp freshness limit for Greeks