Liquidations on youves

youves
4 min readMay 3, 2024

Introduction

This blog is an update of the previous liquidation blog. It aims to clarify the concept of liquidation for the v3 engines (current engine version) on youves.

In this blog, we will use the words liquidation and step-in as synonyms.

Liquidation Basics

On the youves platform, one of the major activities is minting. Locking up collateral from a list of collateral options enables one to mint a particular synthetic asset which could be uUSD, or uBTC or other available tracker tokens. Once eligible collateral is locked in an engine smart contract to mint tracker tokens, you have to monitor your vault’s collateral ratio to prevent an instance of partial liquidation. Every engine on youves has defined parameters which includes the emergency collateral ratio that is set based on the type of collateral and the token which can be minted on such an engine. For v3 engines, a vault becomes open to partial liquidation when the collateral ratio of the vault drops below the emergency level. A step-in on such a vault reinstates the emergency collateral ratio.

More information can be found in the docs.

Why Is It Important?

The occurrence of liquidation isn’t at any time a nice experience for any of our users and we understand the frustrations that come along with it. However, for the stability of the platform it is inevitable;

If the value of the collateral falls below 100% value of the outstanding tokens in a vault, the tokens are no longer backed by sufficient value and the minter no longer sees a logical reason to burn outstanding tokens or top-up collateral to maintain a healthy collateral ratio. For this reason, Liquidation becomes very important in ensuring that vaults are adequately collateralized.

Incentives

As stated earlier, an under-collateralized vault below the emergency collateral ratio is available for step-in by a third party. As an incentive for carrying out the step-in activity, the third party is rewarded with a bonus which is 12.5% of the target value of the posted tracker token. The equivalent value of the posted tracker token and the bonus is deducted from the collateral in the vault and paid to the third party.

Liquidation Capital Requirements

There are different ways to play this.

Cash Reserve

A liquidator or bot needs to have a cash reserve of x tokens (e.g. uUSD) which will then be used to step-in and collect collateral (e.g. tez).

Swap

The received collateral (e.g. tez) can be swapped on a DEX or a CEX for more tokens (e.g. uUSD).

Minting

If the market price of the tokens becomes too expensive, the liquidator or bot can also mint tokens (e.g. uUSD) with collateral (e.g. USDT) and use these to perform the step-in. This makes sense for bot owners who are comfortable holding tez and do not mind the relatively low capital efficiency as the vaults require a multiple of the value of the minted amount in collateral. This also incurs the minting fee.

Liquidations via Better Call Dev

The youves frontend does not support manual step-ins directly. As a consequence, manual step-ins have to be done through a block explorer, such as Better Call Dev (BCD). Alternatively, a bot can be coded to interact directly with the smart contracts.

The docs contain a manual for this.

Liquidations Via a Bot

Advantage of Automated Solutions

In theory, both bots and humans could perform a step-in on an inadequately collateralized vault. However, most step-ins are done by bots because they are vastly faster than humans.

Code Examples In GitHub

As mentioned above, automated solutions will generally work better. Experienced developers may use the below GitHub repository for inspiration.

We want to stress that any kind of automated trading can be tricky and can quickly lead to significant losses. Make sure you really understand what you are doing, do some testing with small amounts and be extra careful.

While we were careful to avoid any errors when writing the code and we did some testing, consider repository for education and illustration purposes only. There is no guarantee on the correctness of the code, use at your own risk. The creators of this code cannot be held responsible for any potential damages.

The code is set up to work with the current v1 and v2 engines. It will also work with the v3 engines, but some values for the smart contract engine addresses, emergency collateral ratios, and the step-in ratios will likely have to be changed.

--

--