Kujira.Usk.Position (kujira v0.1.17)
An item representing the collateral deposit vs debt position of a particular address for a particular market
Fields
:market
- The market where the position is held:holder
- The address that owns the position:collateral_amount
- The amount of collateral_token that has been deposited:mint_amount
- The amount of USK minted and owed by this position:interest_amount
- The amount of USK owed in interest. This is ultimately deducted from the collateral during a collateral deposit, withdrawal, or liquidation:debt_amount
- The total amount of USK owed - mint_amount + interest_amount
Summary
Types
The direction of the adjustment to the Position: collateral deposit, collateral withdrawal, debt borrow (mint), debt repay (burn)
Functions
Returns all adjustments to positions found in the tx response
Types
adjustment()
@type adjustment() :: :deposit | :withdrawal | :borrow | :repay
The direction of the adjustment to the Position: collateral deposit, collateral withdrawal, debt borrow (mint), debt repay (burn)
TODO: Add :liquidation
Functions
from_query(market, arg2)
@spec from_query(Kujira.Usk.Market.t(), map()) :: :error | {:ok, t()}
from_tx_response(response)
@spec from_tx_response(TxResponse.t()) :: [{{Kujira.Usk.Market, String.t()}, String.t(), adjustment()}] | nil
Returns all adjustments to positions found in the tx response