# Introduction to Liquidations

Liquidation is the process where collateral is sold from a vault in order to cover the USDA debt owed. This ensures that USDA is over-collateralized. Since vaults on Argo are independent of one another, the collateral of each position is isolated and only at risk of its own liquidation.

## Collateral Ratio​

When a user opens a vault on Argo and borrows USDA, their CR (collateral ratio) will be determined as:

$Collateral\ Ratio = \frac{Vault\ Collateral}{USDA\ Debt}$

The minimum CR required for opening a collateralized debt position is determined by the ICR - the initial collateral ratio. For example, if an engine has an ICR of 110%, that means $110 of collateral must be deposited in a vault to borrow a maximum of$100 USDA.

As time passes, the collateral ratio will fluctuate due to an increase of USDA debt (accrued borrow interest), collateral asset price volatility, or a combination of both factors. When the collateral ratio of a vault drops below the MCR - maintenance collateral ratio, it will be marked for liquidation.

## Liquidation Process​

While a vault is marked, further borrow of USDA is restricted, and collateral cannot be withdrawn. However, users will have some time to deposit more collateral or repay USDA, in order to raise their collateral ratio above minimum. (In this event, the vault will be un-marked and can be used as normal). This time period is parameterized as the 'liquidation delay'.

During the liquidation process, collateral is sold via dutch auction to 3rd-party liquidators. The auction initiates an oracle-free collateral price via the formula:

$Initial\ Collateral\ Price = Discount\ Factor * Minimum\ Collateral\ Ratio * USDA\ Debt$

The discount factor may depend on the engine, but will be set at 2 to begin with. As the auction proceeds, the discount factor drops, causing the price per unit collateral to also decrease. Note that the discount factor and rate of its decrease are adjustable parameters depending on engine type.

The bid process then proceeds in the following steps:

1. A liquidator bot specifies a repayment of $X$ USDA
2. The vault's debt is reduced by $0.99 * X$
3. The system checks whether the new $CR <= LCR$
4. The liquidator receives ($X$ / collateral price) value of collateral

If (3) fails, the transaction will revert all steps.

Note that, in step (2), a 1% liquidation penalty is taken out from the debt repayment. This penalty is based on the engine type, and can be found here. Liquidation penalties help prevent auction grinding attacks, and are paid to marker bots and the Argo treasury.

The process continues until the amount of USDA repaid (and the amount of collateral auctioned) causes the vault's CR to be between the LCR (liquidation collateral ratio) and the MCR. The LCR varies between engines, but is always in between the MCR and ICR.

## Example​

The XYZ engine has the following parameters:

AssetICRMCRLCRLiq. Penalty
XYZ200%150%160%1%

Bob deposits 1000 XYZ tokens, worth $1.00/ea at time of deposit, into an Argo vault. Bob borrows the maximum amount,$500 USDA, against his XYZ collateral. Bob's position looks like this:

AssetCollateralDebtCR
XYZ$1,000 (1000 XYZ)$500200%

Some time passes, and XYZ is now worth $0.765/ea due to market volatility. Furthermore, Bob's USDA debt has accrued interest, and is now$510. Bob's position now looks like this:

AssetCollateralDebtCR
XYZ$765 (1000 XYZ)$510150%