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 implemented on EVM (Ethereum Virtual machine) offering enhanced capital efficiency, higher loan-to-value, lower liquidation penalties, and better rates. It utilizes advanced liquidation mechanisms, better oracles, and highly optimized allocation of liquidity.

Introduction

The Vault protocol redefines the landscape of borrow and lending protocols. It introduces enhanced capital efficiency, higher LTV, lower liquidation penalty and better rates with smart debt & smart collateral.

Smart debt & Smart collateral is a combination of Vault & DEX protocol of Fluid and hence won't be the focus of this whitepaper.

At its core, the Vault protocol addresses the inherent capital inefficiency & liquidity segregation present in current lending protocols. By optimizing the liquidity aggregation into ticks or slots (inspired by Uniswap v3) & advanced liquidation mechanism, the protocol is able to offer increased loan-to-value (LTV) ratios, lower liquidation penalty & minimum liquidation.

In traditional borrow & lending protocol, liquidation is like a limit order & highly inefficient, where liquidator selects each position to liquidate. Vault protocol revolutionizes liquidations similar to how Uniswap v3 has revolutionized limit orders. Allowing all the positions in range to get liquidated without any increase in gas. Rather than liquidating 50 to 100% of user's position, vault protocol only liquidates what's required, reducing the market sell offs and cascading effects that comes with it.

In this whitepaper, we will delve into the intricacies of the protocol, exploring its core components, mechanisms, and the underlying technology that powers it.

Liquidations and Loan-to-Value

The Vault protocol recognizes that the implementation of liquidations plays a critical role in determining the Loan-to-Value (LTV) of a lending protocol. Liquidations are essential for maintaining the safety and stability of the protocol by eliminating bad debts on time. However, there are two approaches to enhancing protocol safety: reducing the LTV or improving the liquidation mechanism.

While reducing the LTV may enhance protocol safety, it also limits end-users’ borrowing capacity, giving competitors an advantage by offering better LTV ratios. On the other hand, optimizing the liquidation process can lead to a safer protocol with a higher LTV, thereby improving the overall experience and utility for end-users.

In this regard, the Vault protocol introduces a groundbreaking liquidation mechanism that represents a significant advancement in design. This mechanism has the potential to enable users to borrow up to 95% of the value of their ETH. By implementing this innovative liquidation engine, the protocol aims to strike a balance between safety and borrowing capacity, providing users with increased flexibility and maximizing the utility of their assets.

Oracles

Oracles play a critical role in the functioning of lending and borrowing protocols, serving as a key component for ensuring protocol security and efficient liquidity management. These oracles enables the timely identification and liquidation of bad debt, while also providing up-to-date pricing information. By leveraging oracles, protocols can enhance their overall security and potentially increase their LTV ratios.

A robust and reliable oracle system has been implemented in the case of the Vault protocol. This oracle system combines the strengths of Uniswap and Chainlink to ensure the utmost accuracy and reliability of pricing data. The protocol incorporates three different time-weighted average price (TWAP) checkpoints in conjunction with the Chainlink price. These data points are compared against the current Uniswap price, verifying that it falls within a specific range and has not been subject to manipulation.

By utilizing this comprehensive oracle system, the Vault protocol ensures that it can rely on the most recent and accurate DeFi prices for the purpose of liquidations. This enhances the protocol’s security and minimizes the risk of price manipulation, providing users with a more transparent and trustworthy borrowing experience.

Liquidation Mechanism

The liquidation mechanism at the core of the Vault protocol represents a significant leap forward, drawing inspiration from Uniswap v3 while surpassing the effectiveness of existing borrowing and lending protocols by 100x. When a user creates a position, the protocol assigns it to a specific tick based on the user’s debt-to-collateral ratio, with the tick calculated as,

ratio = 1.0015^t, where t = tick

This innovative approach consolidates all users’ liquidity and streamlines the liquidation process for liquidators, resembling a simple swap-like operation.

To further enhance efficiency, Fluid can be seamlessly integrated into DEX aggregators like 1inch, Paraswap, and 0x, similar to other DEX protocols like Uniswap or Curve. This integration empowers traders to obtain better prices and significantly reduces the liquidation penalty to as low as 0.1%. Such enhanced efficiency benefits borrowers, allowing them to minimize losses during liquidations effectively. Unlike other borrowing and lending protocols, which often subject users to considerable losses ranging from 50% to 100% in a single liquidation event, Fluid’s liquidation mechanism ensures that liquidation amounts are typically minimal, usually between 1% to 10%, just enough to bring the user’s position back to the liquidation threshold. By mitigating the forced selling of collateral during market crashes, Fluid’s approach prevents cascading effects and contributes to stabilizing the overall market during turbulent times.

Ticks and Liquidity

In the Vault protocol, the allocation of a user’s position to a specific tick is determined by their debt-to-collateral ratio. This ratio, calculated as ratio = debt/collateral, plays a crucial role in positioning the user within the protocol. To calculate the tick, the protocol utilizes the formula ratio = 1.0015^t, where t = tick, represents the specific tick value associated with the user’s position.

While these calculations are conceptually straightforward, performing them at the smart contract level can be resource-intensive in terms of gas consumption.

Figure 1: Relationship between liquidity and tick values.

To optimize gas efficiency, the Vault protocol introduces a newly developed TickMath library. Inspired by the efficient TickMath library utilized in Uniswap v3, this library enables the calculation of tick values from ratios and vice versa in a highly gas-optimized manner.

Branch and Liquidation

In Fluid, user liquidity is consolidated into ticks which ensures efficient management of positions. When a user undergoes liquidation, their position needs to be retrieved in real-time. To achieve this, Fluid employs a branch-based mechanism. A branch represents the outcome of liquidation related variables and allows users to access their recent position in a gas-optimized manner, regardless of the number of previous liquidations they have experienced.

The user’s tick prior to liquidation serves as the starting point and establishes the debt factor and connection to the branch. By iterating through the branch, starting from the user’s tick, the system identifies the minimum tick (minima) and calculates the total liquidation that has occurred. This process enables efficient and precise liquidation, even in scenarios where users have been liquidated multiple times.

The graph below visually demonstrates the movement of collateral prices and it's impact on ticks. As the collateral price rises, new users enter at higher ticks. Conversely, when the price declines, higher ticks progressively undergo liquidation and move to lower ticks.

The lifespan of a branch in Fluid extends until it reaches the minima tick of its base branch. At this stage, the branch is merged with the base branch, allowing the liquidation process to continue seamlessly from that point onward.

Figure 2: Collateral price graph and Branch Cycle

Let’s examine the diagram above to better understand the concepts presented: With every new local maxima a new branch gets connected with the base branch. For example:

  1. Branch 2 is connected with Branch 1, gets merged with Branch 1 at point d thus ending the lifespan of Branch 2.
  2. Branch 3 is connected with Branch 1, this branch is currently an active branch. It can merge with Base Branch 1 if the collateral value falls to that level again.

Now, let’s consider the positions of users located at points a and c which represent two local maxima on the graph. Although there may be multiple users at different ticks between points a - c and b - d, for simplicity, we will concentrate on these two points.

By analyzing the diagrams, we observe that users at point a experience a final debt reduction of 75%, resulting in a final debt ratio of 0.25. The minimum tick of Branch 1 indicates the point till which their positions were liquidated.

Therefore, the final position for users at point a after all the liquidation can be calculated 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 determine 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

Vault protocol is a huge leap over existing borrow & lending protocols. It offers enhanced capital efficiency, higher LTV, better rates, lowest liquidation penalty, smart debt & smart collateral. It allows to only liquidate what's required, reduces force sell offs in market, making the overall ecosystem healthier. Similar to how Uniswap v3 innovated the Limit orders, Vault Protocol is bringing innovation to Liquidation.