Performing a Liquidation

Having discussed liquidations, it's important to know how to perform them when they're available.

As a first line of defense, CompX runs its own liquidation bot to maintain the health of our vaults. This bot reviews the collateral ratios of each vault and if any are found to be below the liquidation threshold, the bot pays off a portion of that debt and claims collateral according to the liquidation process described in the liquidation example.

Despite CompX running a bot, any user is free to use the CompX API to develop their own liquidation bots to monitor vault health. The more people and bots are working on this, the better, as the protocol is healthier and safer when the process is decentralized.

Due to the time required to monitor each vault, the CompX bot can be often be beaten by xUSD holders and liquidations can be performed manually.

To perform a liquidation, the users wallet will have to be connected to the CompX dapp. After connecting, the user can open the navigation bar by tapping on the icon with three horizontal lines at the top right of the window. They can then navigate down to the xUSD section and select the Liquidations subsection. Once selected, this button will begin to load the existing Algo vaults by default. Once the vaults pull up they'll be sorted from lowest CR to highest. This means that the vaults at the top of the page will have the lowest collateral ratio, and will therefore be closer to liquidation.

If the user wishes to review a different collateral type, a select-able drop-down menu is set near the top of the page. Using this menu, the user can navigate between collateral types as there may be different opportunities for liquidation with different tokens.

For each wallet with an open CDP for the selected vault, the UI lists the users Address/NFD, amount of debt in xUSD, amount of collateral in kind (e.g. number of Algo tokens), and Collateral Ratio. Keep in mind, CR varies with collateral type. At the far right of the grid, is a Liquidate button. This button will always be locked, unless that user has an unhealthy CR. When a vault is unhealthy, this button will turn a light purple and the user will be able to interact with it.

Click on the liquidate button and run through the process - sign the transaction and the liquidation will occur. The users xUSD will return to that vault, and a portion of the wallets collateral will be transferred to the users wallet.

When a liquidation is performed, a 1% fee is diverted to from the collateral being sent to the users wallet and is routed to the CompX treasury. The net effect of this fee is that the liquidation discount (LD) will be 1% lower than what is listed for that collateral type. This fee will also be assessed for any liquidation bots that are created and maintaining the CompX vaults as well.

Last updated