Kujira.Orca (kujira v0.1.24)

Methods for querying the Orca Liquidation Queues, and related data

Summary

Functions

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

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

Loads a bid for a specific Queue. Default Memoization to ~ block time / 2 = 2s

Loads a user's bids for a specific Queue. Default Memoization to ~ block time / 2 = 2s

Loads the current contract state into the Queue; the totals of each bid pool. Default Memoization to ~ block time / 2 = 2s

Creates a lazy stream for fetching all bids for a Queue

Functions

Link to this function

get_queue(channel, address)

@spec get_queue(GRPC.Channel.t(), String.t()) ::
  {:ok, Kujira.Orca.Queue.t()} | {:error, :not_found}

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

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

Manually clear with Kujira.Orca.invalidate(:get_queue, address)

Link to this function

invalidate(atom)

Link to this function

invalidate(atom, address)

Link to this function

invalidate(atom, queue, limit)

Link to this function

invalidate(atom, queue, address, start_after)

Link to this function

list_queues(channel, code_ids \\ [108, 220, 234])

@spec list_queues(GRPC.Channel.t(), [integer()]) ::
  {:ok, [Kujira.Orca.Queue.t()]} | {:error, GRPC.RPCError.t()}

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

Manually clear with Kujira.Orca.invalidate(:list_queues)

Link to this function

load_bid(channel, queue, idx)

@spec load_bid(GRPC.Channel.t(), Kujira.Orca.Queue.t(), String.t()) ::
  {:ok, Kujira.Orca.Bid.t()}
  | {:error, :not_found}
  | {:error, GRPC.RPCError.t()}

Loads a bid for a specific Queue. Default Memoization to ~ block time / 2 = 2s

Manually clear with Kujira.Orca.invalidate(:load_bid, queue, idx)

Link to this function

load_bids(channel, queue, address, start_after \\ nil)

Loads a user's bids for a specific Queue. Default Memoization to ~ block time / 2 = 2s

Manually clear with Kujira.Orca.invalidate(:load_bids, queue, address)

Link to this function

load_queue(channel, queue)

@spec load_queue(GRPC.Channel.t(), Kujira.Orca.Queue.t()) ::
  {:ok, Kujira.Orca.Queue.t()} | {:error, GRPC.RPCError.t()}

Loads the current contract state into the Queue; the totals of each bid pool. Default Memoization to ~ block time / 2 = 2s

Manually clear with Kujira.Orca.invalidate(:load_queue, queue)

Link to this function

stream_positions(channel, queue)

@spec stream_positions(GRPC.Channel.t(), Kujira.Orca.Queue.t()) :: %Stream{
  accs: term(),
  done: term(),
  enum: term(),
  funs: term()
}

Creates a lazy stream for fetching all bids for a Queue