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 thedebt_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 thedebt_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
from_query(l, b, q, p, res)
@spec from_query( Kujira.Bow.Leverage.t(), Kujira.Ghost.Vault.t(), Kujira.Ghost.Vault.t(), Kujira.Bow.Pool.Xyk.t() | Kujira.Bow.Pool.Stable.t(), map() ) :: :error | {:ok, t()}
liquidation_price(leverage, position)
Returns the liquidation price of the position