Kujira.Orca.Queue (kujira v0.1.80)

An individual Orca Liquidation Queue

Fields

  • :address - The contract address

  • :owner - The account authorized to make changes to contract config

  • :collateral_token - The token that is being liquidated

  • :bid_token - The token that is used to buy the collateral

  • :bid_pools - The aggregate amounts of bids at each supported discount amount. The contract confug contains max_slot and premium_rate_per_slot, which define these pools

  • :activation_threshold - The total amount of bids, above which the activation_delay must pass before a bid can be activated. This is bid_threshold on the contract interfaace

  • :activation_delay - The time in seconds that must pass before a bid can be activated. This is waiting_period on the contract interface

Summary

Functions

Assigns the current state to the bd_pools from a direct contract query response

Enumerates all bid pools based on contract config

Types

@type t() :: %Kujira.Orca.Queue{
  activation_delay: integer(),
  activation_threshold: integer(),
  address: String.t(),
  bid_pools: [Kujira.Orca.Pool.t()],
  bid_token: Kujira.Token.t(),
  collateral_token: Kujira.Token.t(),
  liquidation_fee: Decimal.t(),
  owner: String.t(),
  withdrawal_fee: Decimal.t()
}

Functions

Link to this function

from_config(channel, address, map)

@spec from_config(GRPC.Channel.t(), String.t(), map()) :: {:ok, t()} | :error
Link to this function

load_pools(pools, queue)

@spec load_pools([map()], t()) :: t()

Assigns the current state to the bd_pools from a direct contract query response

Link to this function

populate_pools(queue, max_slot, premium_rate_per_slot)

@spec populate_pools(t(), integer(), Decimal.t()) :: t()

Enumerates all bid pools based on contract config