Trading order for the FIN protocol.
Struct, construction, and queries. Use Rujira.Fin as the public API.
Summary
Functions
Memoized fetch of a single order by (owner, side, price) on a contract.
Memoized full fetch of orders on a contract, optionally filtered by owner.
Types
@type deviation() :: nil | integer()
@type side() :: :base | :quote
@type t() :: %Rujira.Fin.Order{ deviation: deviation(), filled: Rujira.Amount.t(), filled_fee: Rujira.Amount.t(), filled_value: Rujira.Amount.t(), id: String.t() | nil, offer: Rujira.Amount.t(), offer_value: Rujira.Amount.t(), owner: String.t() | nil, pair: String.t() | nil, rate: Decimal.t(), remaining: Rujira.Amount.t(), remaining_value: Rujira.Amount.t(), side: side() | nil, type: type_order() | nil, updated_at: DateTime.t() | nil, value_usd: Rujira.Amount.t() }
@type type_order() :: :fixed | :oracle
Functions
@spec list(Rujira.Fin.Pair.t(), String.t() | nil, integer() | nil) :: {:ok, [t()]} | {:error, term()}
@spec new(Rujira.Fin.Pair.t(), map()) :: {:ok, t()} | {:error, term()}
Memoized fetch of a single order by (owner, side, price) on a contract.
Invalidate with Memoize.invalidate(Rujira.Fin.Order, :query, [address, owner, side, price]).
Memoized full fetch of orders on a contract, optionally filtered by owner.
Returns the flat list of raw order maps from the chain, paginated internally.
Invalidate with Memoize.invalidate(Rujira.Fin.Order, :query_orders, [contract, owner]).