Rujira.Fin.Book (rujira_ex v0.0.1)

Copy Markdown View Source

Order book for the FIN protocol.

Struct, construction, and queries. Use Rujira.Fin as the public API.

Summary

Types

t()

@type t() :: %Rujira.Fin.Book{
  asks: [Rujira.Fin.Book.Price.t()],
  bids: [Rujira.Fin.Book.Price.t()],
  center: Decimal.t(),
  id: String.t(),
  spread: Decimal.t()
}

Functions

depth(book, atom, deviation)

@spec depth(t(), :bid | :ask, number()) :: non_neg_integer()

from_id(id)

@spec from_id(String.t()) :: {:ok, t()} | {:error, term()}

load(pair, limit \\ 75)

@spec load(Rujira.Fin.Pair.t(), integer()) ::
  {:ok, Rujira.Fin.Pair.t()} | {:error, term()}

new(address, map)

@spec new(String.t(), map()) :: {:ok, t()} | {:error, term()}

price(id)

@spec price(String.t()) :: {:ok, map()} | {:error, term()}

query(t1)

query(t1, t2)