paint-brush
Liquity Review: A Permissionless Lending and Stablecoin Protocolby@alcueca
976 reads
976 reads

Liquity Review: A Permissionless Lending and Stablecoin Protocol

by Alberto Cuesta Cañada January 8th, 2024
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Liquity is a fascinating protocol, and this article aims to provide a detailed review.

Company Mentioned

Mention Thumbnail
featured image - Liquity Review: A Permissionless Lending and Stablecoin Protocol
Alberto Cuesta Cañada  HackerNoon profile picture


Liquity is a fascinating protocol, and this article aims to provide a detailed review.


I am in no way affiliated with Liquity. I’m interested from a technical point of view because Liquity is one of the few original designs for a collateralized debt platform and also one of the few original designs for a crypto-backed stablecoin.


Liquity's vision is to empower anyone to invest in high-yield assets, irrespective of their income level. Their mission is centered on enhancing access to on-chain borrowing by abolishing interest rates and minimizing the need for governance.


In terms of volume, they have been a resounding success. They achieved a peak Total Value Locked (TVL) of $4.5 billion and currently maintain a TVL of $0.6 billion. Moreover, Liquity stands out as one of the most frequently forked projects in the space and has maintained a record of zero hacks to date.


These achievements not only validate it as a solid product but are particularly impressive for a first release, especially considering the level of innovation Liquity incorporates.


This article will explain how Liquity functions, drawing from my experiences in DeFi lending and liquidations. I will also share my perspectives on various features of the Liquity protocol.


Let’s dive in.


Liquity as a Low-Cost Permissionless Stablecoin Issuer

Liquity can be described as a Collateralized Debt Platform, similar to MakerDAO, with the shared goal of issuing a stablecoin on a large scale.


Liquity issues LUSD, a stablecoin loosely tied to the US Dollar. At the time of writing, there is $208 million of LUSD in circulation, representing about 5% of DAI volume or 30% of FRAX volume, the only two other significant crypto-backed stablecoins.


For Liquity, borrowers are the most crucial users. The protocol's value increases as more LUSD is borrowed since this is the sole method for creating LUSD. Liquity has selected its features to ensure that borrowing LUSD is as convenient as possible. Additionally, they have integrated functionalities that provide customers with uses for LUSD.


Liquity's strategy to attract borrowers leans on three main features:

  • Low Collateralization Minimum Requirements
  • Predictable, Low-Interest Rates
  • A Dependable Borrowable Asset


By focusing on these aspects, Liquity aims to attract borrowers, growing its own value. We will describe how Liquity’s implementation builds towards these three main features.

Low Required Collateralization through Simplified Liquidations

Liquity implements a streamlined liquidations system, aiming to make the job of liquidators easy and the liquidations themselves predictable. With efficient liquidations, they are able to reduce the required collateralization ratio below other protocols that need to protect themselves more against unpredictable liquidation performance.


Liquity offers users to borrow LUSD by posting Ether as collateral. The minimum collateralization rate is 110%, meaning that you only need to put $1100 worth of Ether to borrow $1000 of LUSD. That is very cheap, with rates for borrowing Ether-collateralized stablecoins usually at around 133%.


If the value of the collateral in a loan falls below 110% of the value of the loan, a liquidation will happen. The borrower won’t have to repay the loan but won’t recover their collateral either. Their loss will be the value of their over-collateralization or about 10% of their collateral value.


If the Ether price falls quickly and the value of the loan falls below the value of the collateral before the loan is liquidated, Liquity itself would be the one accruing a loss. For this reason, Liquity implements an architecture and liquidations system aimed at resolving loan insolvency events as quickly and predictably as possible.


Firstly, in Liquity, all loans are sorted by their collateralization ratio. In technical terms, this is much more complex and expensive than just storing all accounts in mapping and letting liquidators find who is collateralized and who is not. In Liquity, all loans are on a list, and you can just look at the top of the list to see if a liquidation needs to happen.


Secondly, Liquity eases the work of anonymous liquidators by providing funding for liquidations. Liquity allows users to provide LUSD into a Stability Pool, which will be used to liquidate loans at risk and which will collect Ether as liquidations happen. __Liquidators will be rewarded __with 0.5% of the Ether used as collateral, plus a fixed 200 LUSD bonus.

These features mean that Liquity doesn’t need sophisticated liquidators as other applications do. Liquidators only need to watch the collateralization ratio of the most at-risk loan and call a function if it falls under the collateralization ratio threshold of 110%. In other applications, liquidators would have to check all loans and would also have to use flash loans and swap applications to fund and profit from the liquidation.


Depositors into the Stability Pool make, on average, a 10% return on each share of their LUSD that was used to execute a liquidation. On the other hand, they obtain depreciating Ether, which they will need to hold, hoping for a rebound or sell quickly. Given their status as passive depositors, it is unlikely that the second option will be used often.


The Stability Pool worked fine during an Ether price crash on 19/05/23, and depositors were able to make a profit on the rebound of the Ether price. I think they were lucky.

Recovery Mode as a Global Protection Mechanism

Liquity has a built-in mechanism called recovery mode, which activates when the aggregated collateralization of all loans dips below 150%. In this mode, the threshold for liquidating loans rises to 150%, immediately making all loans with collateralization ratios between 110% and 150% eligible for liquidation. These loans are processed in ascending order of their collateralization ratios. This means that only the loans at the highest risk are liquidated until the overall collateralization level returns to 150% or above.


While this mechanism is designed to enhance the system's safety beyond the standard liquidation process, it also introduces a new layer of uncertainty for borrowers, who now have to consider not only the ETH/USD exchange rate fluctuations but also the behavior of other borrowers on the platform.

Redistribution Mechanism

The Stability Pool exists in part to ensure funding for liquidations since LUSD might be in short supply in other venues like DEXs. Still, it can happen that the assets in the Stability Pool are less than the debt under liquidation. For those cases, there is a redistribution mechanism.


With the redistribution mechanism, the debt and collateral of the loan are distributed among all other loans, effectively socializing the profit or loss from a liquidation among all borrowers. As well as making sure that lack of funding for liquidations (in the Stability Pool or DEXs) doesn’t result in the protocol accruing bad debt, it also socializes any eventual bad debt among borrowers, avoiding an eventual and catastrophic race for the exits if bad debt happens.


It would be impractical to edit all loans when redistribution occurs, so Liquity uses accumulators like those in traditional rewards contracts to keep track of the amounts redistributed. The loans are updated whenever there is a later operation on them.

Dust Limit as Protection

Beyond the Stability Pool, Liquity has implemented a minimum debt limit of 2000 LUSD on loans. This measure is intended to prevent the creation of loans that are not profitable to liquidate.


Drawing from my experience with Yield and discussions with industry peers, I find this minimum debt limit to be unnecessary. Such exploits have not been a significant issue for platforms operating without these limits. Moreover, imposing a minimum debt limit can be more burdensome for users compared to setting minimum collateral limits. With debt limits, users must fully repay their debt to avoid liquidation upon reaching the limit, a requirement that some may find challenging to meet. In contrast, minimum collateral limits do not pose this problem.

Profits for Liquidators

Additionally, Liquity incorporates an extra 200 LUSD of debt in each loan. This additional debt is not meant to be repaid by the borrower, nor is it provided to them, but it is factored into the loan's collateralization ratio. In the event of liquidation, the Stability Pool compensates for this added debt, paying out the 200 LUSD plus 0.5% of the liquidated collateral to the entity executing the liquidation.


While the rationale behind this practice—to compensate liquidators for their expenses, such as gas fees—is understandable, the method of embedding additional debt into the loan seems convoluted. A more straightforward approach could involve the Stability Pool directly covering these expenses without affecting the collateralization ratio of the loan.

Building Trust in LUSD Through Permissionlessness

Liquity operates on immutable contracts and lacks a governance system. This feature builds trust in LUSD as a reliable asset, as it remains unaffected by the decisions of a governing body.


However, a fully permissionless system comes with its own set of challenges. Firstly, it is impossible to patch the software if bugs are discovered. While many projects have struggled with this issue, Liquity continues to operate effectively.


Secondly, once the product is live, it cannot be modified. This can be a problem if initial assumptions about user needs are incorrect. Despite this, Liquity has gained significant traction.


The third challenge involves operational aspects, such as risk management and system maintenance. In a permissionless environment, these processes need to be either eliminated or fully automated. This requires a design approach that prioritizes simplicity and often leads to the exclusion of certain complex business features.


Despite these obstacles, Liquity has successfully navigated these complexities. Their ability to overcome such challenges is commendable and noteworthy.

Oracles in Liquity

Liquity primarily uses Chainlink as its ETH/USD oracle. However, considering its permissionless nature, the platform also integrates a backup oracle using Tellor. This secondary oracle activates under specific scenarios where Chainlink might malfunction.


Significant effort has been invested in designing a robust system for switching between the default and backup oracles. The criteria and conditions governing these transitions are detailed comprehensively in this table.

Fees and Tokenomics

One of the main selling points of Liquity is that of low, predictable fees. Liquity imposes a fee at the time of borrowing but does not charge ongoing interest, promoting predictability in loan costs and favoring long-term borrowing. This fee is dynamic, ranging from 0.5% to 5% of the loan amount, calculated based on LUSD demand. Similarly, fees apply to LUSD redemptions, where LUSD is exchanged for Ether from Liquity’s reserves.


The accrued fees benefit LQTY holders. Since LQTY is not a governance token (aligning with Liquity’s governance-free structure), purchasing LQTY supports the development team and increases the value for existing LQTY holders in return for a share of the operational profits.


With the ongoing development of Liquity v2 and the associated costs of promoting a stablecoin, this approach to monetization appears to be a reasonable strategy.

Redemptions System

An innovative aspect of Liquity is its redemption mechanism. LUSD holders have the option to burn their LUSD in exchange for Ether, derived from the loan with the lowest collateralization ratio. This process allows LUSD holders to exit the system while simultaneously improving the collateralization ratios of the riskiest loans and the system as a whole.


This redemption feature plays a crucial role in maintaining the LUSD peg, ensuring the stablecoin’s value doesn’t fall far below the ETH/USD price feed. If the value of LUSD falls below that of USD, arbitrageurs will buy LUSD from the open market and redeem it for ETH at a profit.


In the current high-interest scenario, the redemption system is leading to the unwinding of Liquity. Any redemption leads to LUSD holders being forced to sell their LUSD if they want to exit the system, pushing the peg down and making redemptions more attractive. With the Stability Pool holding a large amount of existing LUSD and earning low returns, there is an exit flow from Liquity that leads to LUSD being sold and fuels this loop.


Currently, loans over 300% collateralized are being redeemed, forcing loan owners to sell their LUSD for ETH if they want to maintain their exposure to ETH prices. On the whole, guaranteed and forced redemptions seem problematic.

Conclusion

I personally find Liquity very interesting as a fully permissionless stablecoin issuer that has managed to gain considerable traction. While, in my opinion, the liquidation system is overly complicated, I still applaud the innovation.


I think that Liquity might be one of the very few production systems using a doubly linked list, in this case, to order loans by collateralization ratio. Again, I think that a simpler system would have worked just as well, but I’m fond of those pushing the boundaries.


Another of Liquity’s innovations is to entice LUSD borrowers to provide the LUSD as funds for liquidating loans at risk. This feature both simplifies liquidations and provides LUSD holders with a way to get a return on their holdings. As it seems to be the norm, I think this is overly complicated and unnecessary, at least from the liquidations perspective.


On the side of the features within Liquity that I really like are their backup oracle system and their redistribution mechanism. From working on USMFUM, I know how difficult it is to design a truly permissionless but fault-tolerant oracle, and I believe that Liquity’s might be better than ours.


Liquity’s redistribution mechanism is powerful and elegant, and I think it could have worked as the sole backup mechanism to a simpler liquidations mechanism if Liquity had decided not to use the Stability Pool. It is a design that I might steal for some future projects.


In my view, Liquity is a highly successful proof of concept. I think that a simpler version could have worked as well, just drawing on the idea of a permissionless stablecoin. Still, such a quirky lending and liquidations system is great as a learning tool for all developers.


The team is actively developing Liquity v2, which I expect to include features related to current topics like staked Ether as collateral and cross-chain execution. Whether it will be possible to maintain the permissionless ethos while adding new features remains to be seen. Or the team might choose to release a much simpler platform, aiming to become basic DeFi infrastructure instead.


Whatever the features and outcome of new versions, Liquity v1 trialed out a wealth of new ideas at scale, and has earned its place among the greats.


Thanks to @claudedonze for early reviews of this article and to @rick_liquity for his in-depth review and the background on many of the design decisions behind Liquity.