How Liquidations Work

Sellers must maintain a minimum amount of collateral in their vault to secure the debt they owe. If a seller fails to do so, their vault may be liquidated: their collateral will be seized and auctioned off to repay their debts.

The liquidation action permits any user to initiate the liquidation of an undercollateralized vault. The action liquidates vaults via a reverse Dutch auction. A user vault is undercollateralized if the calculator.isLiquidatable() function returns True.

Undercollateralized vaults can be liquidated by anyone by calling the operate() passing a liquidate action. The liquidate action must have as arguments the user address, the vault id to liquidate, the amount of debt the liquidator is willing to repay and the chainlink round id for the historical price associated with the timestamp where the vault was underwater. The timestamp for that round id should be higher than the latest vault update timestamp.

Every time a user vault gets updated, or synced through the sync(), the vault update timestamp will be set to NOW

The liquidate action takes as arguments the vault owner, vaultId, roundId, and Otoken amount.

Liquidate action will call Calculator.isLiquidatable() to check if the vault can get liquidated or not.

A vault can get liquidated when:

In case vault is liquidatable, the function call will return True, the amount of collateral to payout per 1 Otoken and the dust amount. the DUST is the minimum collateral to deposit for naked margin vault, and also the minimum collateral to leave by the liquidator in a vault in case of partial liquidation.

The calculator.DUST is a mapping that maps each supported option underlying asset for naked margin, with the dust value.

The Oracle will have a getChainlinkRoundData() function that will return round timestamp, round price for a given chainlink round ID. The Oracle contract will be reliant on our pricer to forward the call to the needed chainlink feed.

The liquidate action will call the Oracle module to get the chainlink round data. The round timestamp should be greater than zero.

Liquidate will fetch the latest update timestamp for that vault and compare it to the chainlink round timestamp, the provided timestamp should be greater than the latest update timestamp for that vault.