Kujira.Bow.Leverage.Position (kujira v0.1.80)

An item representing the collateral deposit vs debt position of a particular address for a particular market

Fields

  • :idx - Position ID

  • :bow - The BOW pool for this position

  • :leverage - The leverage contract that manages this position .

  • :holder - The address that owns the position

  • :debt_shares_base - The amount of the base debt token borrowed by this position

  • :debt_amount_base - The resultant amount of debt owed, based on the debt_ratio

  • :debt_shares_quote - The amount of the quote debt token borrowed by this position

  • :debt_amount_quote - The resultant amount of debt owed, quoted on the debt_ratio

  • :lp_amount - The total LP token collateral owned by the position

  • :collateral_amount_base - The base amount that the current LP token is worth

  • :collateral_amount_quote - The quote amount that the current LP token is worth

Summary

Functions

Returns the liquidation price of the position

Types

@type t() :: %Kujira.Bow.Leverage.Position{
  bow: {Kujira.Bow.Pool.Xyk | Kujira.Bow.Pool.Stable, String.t()},
  collateral_amount_base: integer(),
  collateral_amount_quote: integer(),
  debt_amount_base: integer(),
  debt_amount_quote: integer(),
  debt_shares_base: integer(),
  debt_shares_quote: integer(),
  holder: String.t(),
  idx: String.t(),
  leverage: {Kujira.Bow.Leverage, String.t()},
  lp_amount: integer()
}

Functions

Link to this function

from_query(l, b, q, p, res)

Link to this function

liquidation_price(leverage, position)

@spec liquidation_price(
  Bow.Leverage.t(),
  t()
) :: Decimal.t()

Returns the liquidation price of the position