Liquidity Positions

When a liquidity provider calls delegateCollateral, a liquidity position is created or updated in a pool. dUSD can be minted and burned, affecting the amount of debt associated with the position. If this pool is providing liquidity to markets, the performance of these markets can positively or negatively impact the debt associated with the position as well. Performant markets will reduce the debt of liquidity providers over time.

Each liquidity position consists of an amount of collateral, an amount of debt, and a resulting Collateralization Ratio. Liquidity positions are identified as the combination of the relevant Account ID, Pool ID, and Collateral Type Address. (Note that this means one account cannot have two separate positions with the same pool and collateral type.)

Collateralization Ratio (C-Ratio)

Each liquidity position has a collateralization ratio. This represents the relationship between the value of the collateral associated with the liquidity position and the amount of the debt it’s responsible for. This is represented as a percentage. For example, a C-Ratio of 200% means that the value of the collateral is double the amount of debt it’s backing.

The value of the collateral is calculated based on the price of the collateral reported by an oracle via the oracle manager. The value of the debt is the amount of dUSD minted with this liquidity position, minus the amount of dUSD burned with this position, plus/minus the debt/credit it is assigned by the markets backed by its pool.

If a liquidity position’s collateralization ratio falls below the Liquidation C-Ratio corresponding to its collateral type, the position can be liquidated. To reduce the risk of liquidation, collateralization ratios can be increased by depositing additional collateral or burning dUSD.

Retrieving Liquidity Position Data

A position’s collateral, debt, and resulting C-Ratio can be retrieved with the getPositionCollateral, getPositionDebt, and getPositionCollateralRatio functions, respectively.

The getPositionCollateralRatio function returns the C-Ratio of the specified liquidity position. (If the position has more credit than debt, this function returns 0.) The Liquidation C-Ratio of a given collateral type can be retrieved with the getCollateralConfiguration function. All of these values are represented as an integer with 18 decimal places.

All of the functions which reference a position’s debt (such as getPositionDebt and getPositionCollateralRatio) may update cached values in the system so they are not declared as view functions. To use them as such, they can be queried using callStatic. All values returned by the system in this way will be accurate regardless of the recency of any internal caching update.

Last updated