Unstoppable Liquidation Engine

Safeguarding the Unstoppable Ecosystem

Alistor Zimon
unstoppable-official
6 min readOct 8, 2023

--

Unstoppable’s Margin DEX promises sustainable and 100% backed leveraged trading. However, with great power comes great responsibility, and in this ecosystem, the Liquidation Engine acts as a crucial safeguard. This mechanism, although sounding a bit intimidating, is what keeps the solvency and risk management finely tuned within our leveraged trading environment. Let’s dive in to understand this better.

Behind the Boogeyman

Before we look into Unstoppable’s Liquidation Engine, let’s deconstruct what Liquidations are and why they are important. First off, a liquidation is a forcibly close of a traders position on the protocol, usually occuring when the market moves against the traders position. While this sounds intimidating at first glance, the aim of liquidation is to ensure that the borrowed funds are repaid to the protocol.

Liquidations serve as a safety mechanism in leveraged trading environments. They are crucial to maintaining the financial solvency and integrity of the protocol, as well as protecting the interests of lenders and other traders. By forcibly closing positions that are nearing a point of insolvency, liquidations help in ensuring that the borrowed funds are repaid and that the losses do not escalate to a point where they become unmanageable.

A Primer on Leveraged Orders on the Margin DEX

To understand what happens in the case of a liquidation, we should know what happens when a margin leverage order is opened. Let’s illustrate the example of trader ‘Alex’ opening an ETH long with 1,000 USDC utilizing 10x leverage.

This means that his starting balance of 1,000 USDC would be magnified to 10,000 USDC in the market. In order to accomplish this, Alex was loaned 9,000 USDC from Unstoppable’s Liquidity Providers. In exchange for this loan he must pay them interest as long as the trade remains open.

Unstoppable’s Margin DEX trading engine will go over to execute Alex’s long order on a Spot DEX like Uniswap, utilizing his original 1,000 USDC alongside the additional 9,000 USDC borrowed from Unstoppable’s Liquidity Providers.

From here on the Liquidation Engine will begin to monitor Alex’s trade to avoid losses for the Liquidity Providers. If he is at risk of being unable to repay his loan the engine will forcibly close the trade and repay the Liquidity Providers.

However, if Alex successfully closes his position with a profit, he retrieves his initial margin along with the accrued profit. At the same time, the Liquidity Providers are reimbursed in full for their loan.

The Mechanics of Liquidations on Unstoppable

The Liquidation Engine continuously monitors all open trades and their current health ratio, based on the mark price and the remaining margin in the order. Once the value of the posted margin falls below the minimum required margin requirement, the position becomes liquidatable. Let’s delve into some terms:

  • Mark Price: This is the “weighted” market price, disregarding the volatility of the underlying market where the order is executed. This shield protects users from unfair liquidations due to short-term price fluctuations within the specific market their order resides in, especially when the broader market spot price of the asset didn’t reach the liquidation level. Chainlink supplies us this mark price through their robust and proven oracle price feeds.
  • Margin: This refers to the amount a user provides when executing the leverage order. Taking Alex as an example — He provided 1,000 USDC for a 10,000 USDC margin order.
  • Health Ratio: This reflects the available margin within the order. As the market might move against Alex, he still needs to be capable of repaying the money borrowed. For instance, for his 10,000 USDC long, he posted 1,000 USDC margin. If the market moves down by 2%, his margin devalues to 980 USDC, with the borrowed amount now valued at 8,820 USDC, bringing the total value of his position to 9,800 USDC — a total temporary loss of 200 USDC from the initial 10,000 USDC.

As Alex becomes unable to balance out the value loss of the borrowed assets with his remaining margin, the margin requirement to keep the order open isn’t met anymore, and the order will enter forceful liquidation. This will happen once the mark price hits the liquidation price.

Mitigating Losses Through Layered Security

The highest possible resulting loss from this liquidation should be the initial 1,000 USDC margin posted by Alex and 0 USDC for the Liquidity Providers on Unstoppable, as Alex has to pay them back the full amount he borrowed. To achieve this, we have devised a multi-layered security mechanism.

The internal Liquidation Engine, as outlined above, is deployed on various servers spread out globally to ensure a 100% uptime and the quickest possible execution time. Nonetheless, we will provide the liquidation engine in an open-source format so that everyone can run their own liquidation bot. This serves as an additional redundancy to protect either their liquidity position or their UND stake.

The third layer of defense we will use to integrate our liquidation engine is Chainlink’s Smart Contract Automation. This adds another high-performance environment for the engine, while further decentralizing it via Chainlink’s nodes. Chainlink is working on improving their Automation system further, which will allow us to implement this security layer in the near future.

This robust network of liquidation engines creates a security web our liquidity providers and users can rely on. Nonetheless, we believe that a robust platform also has to account for unexpected events, which leads us to the final frontier of our defense layers — The Safety Module.

The final frontier: The safety module

Assuming that despite all the defense layers put in place, the protocol ends up with bad debt after a failed liquidation, the Safety Module will cover this position to ensure further functionality of the protocol. After such an event, the Safety Module temporarily halts the creation of new positions. This pause remains in effect until the cause of the bad debt is identified and corrective measures are taken to prevent a recurrence in the future.

Liquidity Providers on Unstoppable will have the choice to provide liquidity in a ‘high risk’ or ‘low risk’ tranche. The high-risk tranche will be first in line to support the safety module in such a scenario. In exchange for this additional risk taken on, they receive a higher share of real yield compared to liquidity providers in the low-risk tranche.

With the protocol we envisioned and designed, we see little scenarios where this could be applicable, especially since all our trades happen in a 100% backed environment — however, it would be careless to ignore even the slightest possibility of such a scenario arising.

Conclusion

Unstoppable’s cautiously engineered Liquidation Engine, backed by continuous trade monitoring, smart contract automation, and a robust safety module, is what keeps our platform a step ahead in ensuring financial solvency and minimizing losses.

Embark on a journey toward a more secure, sustainable and empowering trading experience. Your thoughts matter! Share and discuss your insights or questions with our community, and let’s fortify the financial future together!

--

--