Kujira.Fin (kujira v0.1.23)

Kujira's 100% on-chain, central limit order book style decentralized token exchange.

Summary

Functions

Fetches the Pair contract and its current config from the chain.

Fetches all Pairs. This will only change when config changes or new Pairs are added. It's Memoized, clearing every 24h.

Loads the current Book into the Pair. Default Memoization to ~ block time / 2 = 2s

Functions

Link to this function

get_pair(channel, address)

@spec get_pair(Channel.t(), String.t()) ::
  {:ok, Kujira.Fin.Pair.t()} | {:error, :not_found}

Fetches the Pair contract and its current config from the chain.

Config is very very rarely changed, if ever, and so this function is Memoized by default.

Manually clear with Kujira.Fin.invalidate(:get_pair, address)

Link to this function

invalidate(atom)

Link to this function

invalidate(atom, address)

Link to this function

invalidate(atom, pair, limit)

Link to this function

list_pairs(channel, code_ids \\ [63, 134, 162])

@spec list_pairs(GRPC.Channel.t(), [integer()]) ::
  {:ok, [Kujira.Fin.Pair.t()]} | {:error, GRPC.RPCError.t()}

Fetches all Pairs. This will only change when config changes or new Pairs are added. It's Memoized, clearing every 24h.

Manually clear with Kujira.Fin.invalidate(:list_pairs)

Link to this function

load_pair(channel, pair, limit \\ 100)

@spec load_pair(Channel.t(), Kujira.Fin.Pair.t(), integer()) ::
  {:ok, Kujira.Fin.Pair.t()} | {:error, GRPC.RPCError.t()}

Loads the current Book into the Pair. Default Memoization to ~ block time / 2 = 2s

Manually clear with Kujira.Fin.invalidate(:load_pair, address)