Liquidations
Describes the various ways that accounts can be liquidated on Notional.
An in depth explanation of liquidation mechanics is described here. In this documentation we will review high level liquidation concepts and give code examples of how to liquidate and how to manage account risk.

Key Concepts

  • Haircut: a percentage amount to reduce a collateral asset's value to account for potential price risks
  • Buffer: a percentage amount to increase a debt amount to account for potential price risks
  • Free Collateral: represents the aggregate value of all an account's holdings, an in depth explanation is here.
  • Local Currency: this is the currency that the liquidator must provide to the account. If an account has borrowed DAI and collateralized with ETH, the DAI is the local currency.
  • Collateral Currency: the currency that collateral is held in. This is unset for local currency only liquidations.
  • Local Available: netPortfolioValue + netCashBalance + netNTokenValue from the free collateral calculation before the conversion to ETH.
  • Collateral Available: Same as local available but in the collateral currency.
  • Local Benefit Required: the amount of local currency required to bring an account back to positive free collateral
  • Collateral Benefit: the amount of collateral currency required to bring an account back to positive free collateral
  • Liquidation Discount: a discount applied to the exchange rate between collateral an local currencies as an incentive to the liquidator.
  • Default Liquidation Portion: the percentage of an an account's collateral available that can be liquidated, currently set to 40% for all liquidations.

Liquidation Types

In general, liquidations can be thought of as a process where risky collateral assets (which by necessity have haircuts applied) are unwound back into risk free assets (i.e. asset cash). When this happens, the liquidated account regains free collateral by the removal of haircuts and the effect of local currency netting (where risk free asset cash is applied against debts).
Because Notional allows accounts to use various types of assets as collateral, there are a number of liquidation routes that can be taken to unwind risky collateral assets to bring an account back into a healthy position.

Collateral Currency

A collateral currency liquidation occurs when there is cash, nToken or liquidity token collateral held in a different currency from the debt. This is the most typical liquidation scenario.
Examples:
  • An account holds cETH or nETH against fDAI debt. cETH or nETH is sold in exchange for cDAI.

Cross Currency fCash

A cross currency fCash liquidation occurs when there is fCash collateral held in a different currency from the debt.
Examples:
  • An account holds fETH lending against fDAI debt. fETH is sold in exchange for cDAI.

Local Currency

Local currency liquidation occurs when local available is negative and the account holds liquidity tokens or local currency nTokens. Because both those assets have haircuts applied, the account's collateral position can increase by the haircut amount minus any incentive paid to the liquidator.

Examples:

  • Account holds debt in local cash or fCash and is collateralized with liquidity tokens or nTokens in the same currency.
    • Example: Using nETH and collateral against an fETH borrow position to get leveraged nToken returns. If interest rates move against the account, they can be liquidated where there nETH is redeemed into cETH.
  • Account holds debt in any currency and and has nToken or liquidity token collateral. By unwinding the nToken or liquidity tokens to cash the account will gain a small benefit.
    • Example: Borrowing fDAI against nUSDC collateral. nUSDC may be converted to cUSDC for a small benefit. It would be more likely that this liquidation would be a collateral currency liquidation.

Local Currency fCash

Local fCash liquidation occurs when the debt and collateral are both denominated in the same currency and the collateral is fCash (as opposed to nTokens). Although fCash has a defined value at maturity, it's mark to market value (present value) fluctuates based on current market interest rates and therefore is considered a risk asset and has a haircut applied.

Examples:

  • Account is borrowing 3 month fDAI and lending 6 month fDAI. Its 6 month fDAI can be converted into cDAI and held as repayment against 3 month fDAI debt.
  • Account is borrowing 3 month fUSDC and lending 6 month fDAI. Its 6 month fDAI can be converted into cDAI and held as repayment against 3 month fUSDC debt. In this case, the cDAI still carries a haircut and cross currency fCash liquidation would be more appropriate.
  • Account is holding cDAI against a 1 year fDAI debt. If interest rates decrease to a point where the cDAI is insufficient to collateralize the 1 year fDAI debt, the account can be liquidated. In this scenario the liquidator will receive both fDAI debt and cDAI cash to reduce the account's debt exposure. This scenario is unlikely to occur in practice.

Calculating Liquidation Profits

There are four calculation methods associated with each liquidation type. The calculation methods are stateful methods because liquidation will settle the liquidated account prior to calculating free collateral. To get the return values off-chain, run a simulated call against these methods.
  • localCurrencyFromLiquidator: is a negative amount representing the cash that the liquidator needs to have available for Notional to transferFrom. If this amount is positive, then the liquidator will receive local currency cash (possible in local currency and local fCash liquidation).
  • The rest of the variables returned denote the amount of collateral assets the liquidator will purchase.
function calculateLocalCurrencyLiquidation(
address liquidateAccount,
uint16 localCurrency,
uint96 maxNTokenLiquidation
) external returns (
int256 localCurrencyFromLiquidator, // may be positive or negative
int256 localNTokensToLiquidator
);
function calculateCollateralCurrencyLiquidation(
address liquidateAccount,
uint16 localCurrency,
uint16 collateralCurrency,
uint128 maxCollateralLiquidation,
uint96 maxNTokenLiquidation
) external returns (
int256 localCurrencyFromLiquidator,
int256 collateralCashToLiquidator,
int256 collateralNTokensToLiquidator
);
function calculatefCashLocalLiquidation(
address liquidateAccount,
uint16 localCurrency,
uint256[] calldata fCashMaturities,
uint256[] calldata maxfCashLiquidateAmounts
) external returns (
int256[] memory fCashNotionalAmounts,
int256 localCurrencyFromLiquidator
);
function calculatefCashCrossCurrencyLiquidation(
address liquidateAccount,
uint16 localCurrency,
uint16 fCashCurrency,
uint256[] calldata fCashMaturities,
uint256[] calldata maxfCashLiquidateAmounts
) external returns (
int256[] memory fCashNotionalAmounts,
int256 localCurrencyFromLiquidator
);

Unique Liquidation Conditions