fluid ⌘K

Vault Protocol

Vault Whitepaper

By Samyak Jain (samyak@instadapp.io)

Vault_Protocol_Whitepaper_.pdfPDF · 265KB

Open

Dated: July 4, 2023

Abstract

The Vault protocol by Fluid is a borrowing protocol built on EVM (Ethereum Virtual Machine) that delivers improved capital efficiency, higher loan-to-value, lower liquidation penalties, and better rates. It relies on advanced liquidation mechanisms, better oracles, and a highly optimized allocation of liquidity.

Introduction

The Vault protocol reshapes what borrow and lending protocols can do. Through smart debt & smart collateral it brings improved capital efficiency, higher LTV, a lower liquidation penalty and better rates.

Smart debt & Smart collateral blend the Vault & DEX protocol of Fluid, so they are outside the focus of this whitepaper.

At its core, the Vault protocol tackles the capital inefficiency & liquidity segregation found in current lending protocols. It organizes liquidity into ticks or slots (inspired by Uniswap v3) and adds an advanced liquidation mechanism, which lets the protocol offer higher loan-to-value (LTV) ratios, a lower liquidation penalty & minimum liquidation.

In a traditional borrow & lending protocol, liquidation works like a limit order and is highly inefficient, because the liquidator has to choose each position to liquidate. The Vault protocol changes liquidations in the same way Uniswap v3 changed limit orders, letting every position in range get liquidated with no rise in gas. Rather than liquidating 50 to 100% of a user's position, the vault protocol liquidates only what is required, which reduces the market sell-offs and cascading effects that usually follow.

This whitepaper walks through the details of the protocol, covering its core components, its mechanisms, and the technology behind it.

Liquidations and Loan-to-Value

The Vault protocol recognizes that how liquidations are implemented plays a critical role in setting the Loan-to-Value (LTV) of a lending protocol. Liquidations are essential to the safety and stability of the protocol because they clear bad debts on time. Still, there are two ways to make a protocol safer: lowering the LTV or improving the liquidation mechanism.

Lowering the LTV may make the protocol safer, but it also restricts end-users’ borrowing capacity and hands competitors an edge by letting them offer better LTV ratios. Optimizing the liquidation process, on the other hand, can produce a safer protocol with a higher LTV, which improves the overall experience and utility for end-users.

With this in mind, the Vault protocol brings in a groundbreaking liquidation mechanism that marks a significant step forward in design. The mechanism could allow users to borrow up to 95% of the value of their ETH. With this innovative liquidation engine, the protocol aims to balance safety and borrowing capacity, giving users more flexibility and getting the most out of their assets.

Oracles

Oracles play a critical role in lending and borrowing protocols, as a key component for protocol security and efficient liquidity management. They enable timely identification and liquidation of bad debt and also supply up-to-date pricing information. By using oracles, protocols can strengthen their overall security and potentially raise their LTV ratios.

The Vault protocol uses a robust and reliable oracle system. This oracle system combines the strengths of Uniswap and Chainlink to make pricing data as accurate and reliable as possible. The protocol uses three different time-weighted average price (TWAP) checkpoints together with the Chainlink price. These data points are checked against the current Uniswap price to confirm that it sits within a set range and has not been manipulated.

Thanks to this comprehensive oracle system, the Vault protocol can depend on the most recent and accurate DeFi prices when it carries out liquidations. This strengthens the protocol’s security and lowers the risk of price manipulation, giving users a more transparent and trustworthy borrowing experience.

Liquidation Mechanism

The liquidation mechanism at the core of the Vault protocol is a significant leap forward. It draws inspiration from Uniswap v3 and goes beyond existing borrowing and lending protocols by 100x in effectiveness. When a user creates a position, the protocol places it in a specific tick according to the user’s debt-to-collateral ratio, with the tick calculated as,

ratio = 1.0015^t, where t = tick

This innovative approach pools the liquidity of all users and simplifies liquidation for liquidators, so it works much like a simple swap.

To boost efficiency further, Fluid can be integrated smoothly into DEX aggregators such as 1inch, Paraswap, and 0x, just like other DEX protocols such as Uniswap or Curve. This integration lets traders get better prices and cuts the liquidation penalty to as low as 0.1%. Borrowers benefit from this efficiency, since they can keep their losses small during liquidations. Other borrowing and lending protocols often put users through heavy losses of 50% to 100% in a single liquidation event, whereas Fluid’s liquidation mechanism keeps liquidation amounts typically small, usually between 1% to 10%, just enough to return the user’s position to the liquidation threshold. By limiting the forced selling of collateral during market crashes, Fluid’s approach prevents cascading effects and helps stabilize the wider market in turbulent times.

Ticks and Liquidity

In the Vault protocol, a user’s position is placed in a specific tick based on their debt-to-collateral ratio. This ratio, calculated as ratio = debt/collateral, is key to positioning the user within the protocol. To work out the tick, the protocol uses the formula ratio = 1.0015^t, where t = tick is the specific tick value tied to the user’s position.

These calculations are conceptually simple, but running them at the smart contract level can consume a lot of gas.

Figure 1: How liquidity relates to tick values.

To keep gas usage down, the Vault protocol introduces a newly developed TickMath library. Inspired by the efficient TickMath library in Uniswap v3, it can compute tick values from ratios and the other way around in a highly gas-optimized way.

Branch and Liquidation

In Fluid, user liquidity is pooled into ticks, which keeps position management efficient. When a user undergoes liquidation, their position has to be retrieved in real time. To do this, Fluid uses a branch-based mechanism. A branch holds the result of liquidation related variables and lets users reach their latest position in a gas-optimized manner, no matter how many earlier liquidations they have been through.

The user’s tick before liquidation is the starting point and sets the debt factor and the link to the branch. The system walks through the branch from the user’s tick, finds the minimum tick (minima) and computes the total liquidation that has taken place. This makes liquidation efficient and precise, even when users have been liquidated several times.

The graph below shows how collateral prices move and how that affects ticks. When the collateral price rises, new users come in at higher ticks. When the price falls, the higher ticks gradually undergo liquidation and shift to lower ticks.

A branch in Fluid lives until it reaches the minima tick of its base branch. At that point the branch is merged into the base branch, and liquidation carries on smoothly from there.

Figure 2: Collateral price graph and Branch Cycle

Take a look at the diagram above to better follow these concepts: each new local maxima connects a new branch to the base branch. For example:

  1. Branch 2 is connected with Branch 1 and merges with Branch 1 at point d , which ends the lifespan of Branch 2.
  2. Branch 3 is connected with Branch 1 and is still an active branch. It can merge with Base Branch 1 if the collateral value falls back to that level.

Now consider the positions of users at points a and c , which are two local maxima on the graph. There may be many users at different ticks between points a - c and b - d, but to keep things simple we will focus on these two points.

Looking at the diagrams, users at point a end up with a final debt reduction of 75%, giving a final debt ratio of 0.25. The minimum tick of Branch 1 marks the point down to which their positions were liquidated.

So the final position for users at point a after all the liquidation can be worked out as follows:

debt = (0.25/1) ∗ initialDebt = 0.25 ∗ initialDebt

ratio = 1.0015^m, where m = minimaTick

collateral = debt/ratio

For users at point c the final debt should be 0.3, signifying a 70% reduction in debt. In Branch 2, the debt was reduced by 40% (from 1 to 0.6), and then the branch merged with Branch 1. Subsequently, Branch 1 underwent a liquidation of 50% (from 0.5 to 0.25), resulting in a total debt reduction of 1 * 0.6 * 0.5 = 0.3 or 30% of the initial debt. When branches merge, the debt factor of Branch 2 transitions into the connection factor.

To calculate the connection factor:

To work out the final debt for users at point c :

debt = [finalDebtFactor/(initialDebt ∗ connectionFactor)] ∗ initialDebt

debt = (0.25/(1 ∗ 0.8333333333)) ∗ initialDebt = 0.3 ∗ initialDebt

ratio = 1.0015^m, where m = minimaTick

collateral = debt/ratio

Conclusion

The Vault protocol is a huge leap beyond existing borrow & lending protocols. It brings improved capital efficiency, higher LTV, better rates, the lowest liquidation penalty, smart debt & smart collateral. It liquidates only what is required, which cuts forced sell-offs in the market and makes the whole ecosystem healthier. Just as Uniswap v3 reinvented Limit orders, the Vault protocol brings new thinking to Liquidation.