Liquidations on youves

youves
4 min readJul 18, 2022

Please refer to the updated blog about liquidation on youves. The information covered here do not account for the v3 engines.

Introduction

This blog aims to clarify the concept of liquidation on youves, how it works, why it is important, profit opportunity, why the automated solutions will have a great advantage over manual interactions, and code examples on GitHub.

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 and sell a particular synthetic asset which could be uUSD, uDEFI, or uBTC. Once your collateral is locked in the minting smart contract, you have to monitor your vault’s collateral ratio to prevent liquidation. Currently the target collateral ratio is 300% and the emergency collateral ratio is 200%. However, there are upcoming changes to that, as decided in YIP-007. On the vaults which build on the new engines, there will no longer be a target collateral ratio. In a case where your collateral ratio drops to or below the emergency level, your vault becomes available for step-in/liquidation by a third-party.

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 has any economic incentive to burn tokens or top-up collateral. For this reason, Liquidation becomes very important in maintaining an adequately collateralized vault.

Incentives

As stated earlier, an under-collateralized vault at or below the emergency collateral ratio of currently 200% 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.

--

--

youves

Your tool on Tezos for asset creation and management.