# 🧯Liquidations

"An eye for an eye keeps DeFi protocols solvent" - Taylor Swift, Eras Tour.

Last updated

"An eye for an eye keeps DeFi protocols solvent" - Taylor Swift, Eras Tour.

Last updated

First of all, Itos's Automated Market Taking is designed to prevent liquidations so if you're concerned about liquidations I'd read that first. However, if you wish to push the limits of capital efficiency we're happy to help. Here we'll discuss how our liquidations attempt to treat users fairly while still incentivizing liquidators.

Solvency

Once all credits and debts have been adjusted by the variance factor to get our virtual balances, a portfolio is solvent if it has a positive net virtual balance in USD terms for cross-margined tokens, and in each token's own balance for tail-tokens.

USD vs Tail Tokens

As mentioned in Cross-Margin Accounting, a portfolio has cross-margin-able balances which are settled in USD, and isolated balances which are settled on a per token basis.

When liquidating, the liquidator has to choose either USD, or a specific token to liquidate. If they're closing for USD, then the tail tokens, which have no USD value on Itos are left untouched. If they're liquidating for a specific tail token, then all other tail token balances and cross-margin-able balances are left untouched.

Some positions are a combination of both cross-margin and tail tokens. When those are closed, the unaffected token must be refunded by the liquidator to the portfolio so that the effective balance is unchanged. For example, if you have a USDC/PEPE AMM liquidity position worth 120 USDC and 1M PEPE getting liquidated for PEPE, then the USDC will be refunded to your portfolio. **However**, the effective balance is what is unchanged. So we use The Variance Factor to adjust the USDC balance by PEPE's variance factor of say 1.2. Since it's collateral we divide by 1.2 to get a 100 USDC refund. For Cross-Margin Accounting purposes, your USD portfolio remains as healthy as it was before. The liquidator receives 20 USDC as their premium for resolving the PEPE debts.

Full vs. Partial Liquidation

For USD insolvent portfolios with low total USD value, and tail token insolvent portfolios, the liquidation is a full liquidation, which closes all related positions.

A USD insolvent portfolio that is sufficiently large will instead be partially liquidated according to our dynamic liquidation scheme. The exact partial liquidation value cut-off is determined by governance. Sometimes, when partial liquidating we'll split an asset in two so that we can cleanly close only the exact amount we're interested in.

Dynamic Liquidation Sizing

Our partial liquidations don't have a pre-determined size like other protocols. A static size can often lead to insufficient liquidations or repeated liquidations. Instead we this formula which guarantees the resulting portfolio is solvent while also giving sufficient incentives to the liquidator.

$q = \frac{\xi + \mu \beta - 1}{\mu \beta - \frac{1}{V^2}}$

Here is what each variable means:

Ultimately what this achieves is a properly incentivized liquidation scheme that always brings portfolios into solvency as long as there is more real collateral than real debt. All liquidation schemes fail when there is more real debt, and so we use a number of parameters, primarily the variance factor to prevent such a scenario in a user-friendly way.

Examples:

$q$ is the liquidation percent. How much of the portfolio can be liquidated.

$\xi$ is the minimum liquidation percent. How much of the insolvent portfolio's collateral the liquidator receives as aa reward. This is determined on per-chain basis by governance.

$\beta$ is the post-liquidation gap. The user can adjust this number for each of their portfolios. A larger $\beta$ increase the liquidation size, but results in a healthier portfolio which is less likely to get re-liquidated. This is useful for long-term holders who don't frequently monitor their positions. A smaller $\beta$ results in smaller liquidations that bring your portfolio ever so slightly into solvency. This is appropriate if you can respond to large market moves quickly and prevent further liquidations.

$V^2$is known as the variance gap. It is the real amount of collateral divided by the real amount of debt in a portfolio. On other platforms, the inverse of this is usually referred to as the utilization ratio. We frequently use both terms.

$\mu$ measures how insolvent the portfolio is. It is the solvent variance gap divided by the current variance gap. Is it greater than 1 when a portfolio is insolvent.

Here are a few examples of USD liquidations. Assume all positions are larger than the full-liquidation cutoff. By default, we use $\xi = 0.5\%, \beta = 1.02.$

$V^2 = \frac{1000}{1.40 * 700} = 1.02$. This is serious trouble! The portfolio is at 98% utilization, much higher than any other protocol allows. (1/1.02 = .98).

$\mu = \frac{1.01 * 1.03}{1.02} = 1.02$

$q = \frac{.005 + 1.02 * 1.02 - 1}{1.02 * 1.02 - \frac{1}{1.02}} = 75.7\%$. So we can return the portfolio all the way from 98% utilization to healthy by liquidating three quarters of this portfolio's virtual debt.

The final portfolio now has 258 USDC and 170 ARB worth 238 USD, thus giving a final utilization ratio of 92.2% which is lower than we started and considered safe by Itos. Had the user used a higher $\beta$ we would have liquidated more and ended up with less utilization.