Rujira.Prices.Default (rujira_ex v0.0.8)

Copy Markdown View Source

Default price adapter: oracle → FIN book mid-price fallback.

Summary

Functions

Memoized FIN-derived price: mid-price of the asset's default pair (a stable pair when one exists, otherwise the first pair quoting that asset), multiplied by the quote asset's USD price.

Memoized oracle price lookup.

Functions

fin_price(t1)

@spec fin_price(String.t()) :: {:ok, Decimal.t()} | {:error, :no_price}

Memoized FIN-derived price: mid-price of the asset's default pair (a stable pair when one exists, otherwise the first pair quoting that asset), multiplied by the quote asset's USD price.

Invalidate with Memoize.invalidate(Rujira.Prices.Default, :fin_price, [ticker]).

oracle_price(t1)

@spec oracle_price(String.t()) :: {:ok, Decimal.t()} | {:error, :no_price}

Memoized oracle price lookup.

Invalidate with Memoize.invalidate(Rujira.Prices.Default, :oracle_price, [ticker]).