Kujira.Bow.Leverage (kujira v0.1.80)

A CDP contract that integrates BOW with GHOST, allowing LP tokens to be used as collateral when borrowing the underlying tokens that make up the LP position.

This allows an LP-er to provide eg only the base asset of a pair, and borrow the stable quote-side of the position, in order to avoid having to sell any of their position in order to provide liquidity.

Fields

  • :address - The address of the contract

  • :owner - The owner of the contract

  • :bow - The BOW contract that the liquidity is deposited to

  • :token_base - The base Token of the LP pair

  • :token_quote - The quote Token of the LP pair

  • :oracle_base - The Oracle feed used to price the base token

  • :oracle_quote - The Oracle feed used to price the quote token

  • :ghost_vault_base - The GHOST Vault where the base token is borrowed from

  • :ghost_vault_quote - The GHOST Vault where the quote token is borrowed from

  • :orca_queue_base - The ORCA Queue where the base token is liquidated to repay the GHOST quote Vault

  • :orca_queue_quote - The ORCA Queue where the quote token is liquidated to repay the GHOST base Vault

  • :max_ltv - The maximum ratio of the value of borrowed tokens to value of LP tokens, above which a position can be liquidated

  • :full_liquidation_threshold - The position value below which a liquidation covers all outstanding debt

  • :partial_liquidation_fraction - The target LTV to be achieved when a position is partially liquidated

  • :borrow_fee - The percentage of borrowed assets that are sent to KUJI stakers as a fee

Summary

Functions

Returns a tuple of {token, amount} of collateral at risk for a given position

Types

@type t() :: %Kujira.Bow.Leverage{
  address: String.t(),
  borrow_fee: Decimal.t(),
  bow: {Kujira.Bow.Pool.Xyk, String.t()} | {Kujira.Bow.Pool.Stable, String.t()},
  full_liquidation_threshold: non_neg_integer(),
  ghost_vault_base: {Kujira.Ghost.Vault, String.t()},
  ghost_vault_quote: {Kujira.Ghost.Vault, String.t()},
  max_ltv: Decimal.t(),
  oracle_base: String.t(),
  oracle_quote: String.t(),
  orca_queue_base: {Kujira.Orca.Queue, String.t()},
  orca_queue_quote: {Kujira.Orca.Queue, String.t()},
  owner: String.t(),
  partial_liquidation_fraction: Decimal.t(),
  status: :not_loaded | Kujira.Bow.Leverage.Status.t(),
  token_base: Kujira.Token.t(),
  token_quote: Kujira.Token.t()
}

Functions

Link to this function

at_risk_collateral(leverage, arg2, p)

Returns a tuple of {token, amount} of collateral at risk for a given position

Link to this function

from_config(channel, address, map)

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