Hydration in Times of Tribulation ☔
How HydraDX is Building the Liquidity Protocol for the Future
Fellow hydrated fellas,
Over the last three months, the crypto market as a whole has seen tremendous volatility following the implosion of what once used to be a top 10 crypto project, as well as the synchronous fall of both giant CeFi platforms and crypto native hedge funds.
Although it has not been an easy time for anyone in crypto, here at HydraDX we remain determined to continue buidling upon our vision of the next-generation liquidity protocol for the Polkadot ecosystem.
We believe that the time is right to take a step back for some much-needed reflection. In our eyes, the recent fallout does not discredit the ethos behind DeFi but highlights the fine line projects walk when making certain protocol design choices. While making the right choices would not have prevented some of the events from taking place, it would have limited the contagion across the broader DeFi space.
In this post, we relate to three events which shook up the crypto space: Terra with the de-peg of $UST, Three Arrows Capital (3AC) with the widespread contagion, and Bancor with its impermanent loss protection mechanism. We refer to these events without the intention to criticize individual projects or actors involved in these events. On the contrary, our reflection has the aim to identify key takeaways which navigate our design of HydraDX, the liquidity protocol built to serve the future.
Terra ($LUNA) and the de-peg of $UST
Terra was a top-10 crypto project which developed an ecosystem around its algorithmic stablecoin ($UST). In a nutshell, $UST had the following mechanics. In order to mint 1 new unit of $UST, $1 USD worth of $LUNA (Terra’s governance token) would be burned and vice versa ($1 USD worth of LUNA token would be minted to burn 1 UST). The peg was maintained by arbitrageurs who would take advantage when $UST goes above or below $1 by minting/burning $LUNA to arbitrage this difference.
In a bull market, this was reflexively positive for the price of $LUNA as the demand of $UST was on the increase. As more $LUNA was burnt to create new units of $UST, this was dramatically reducing the token’s supply, leading to a significant price appreciation for $LUNA.
However, not all units of $UST were created as equals. When $LUNA was trading at $2, 1 unit of $UST could be minted by burning 0.5 units of $LUNA . When $LUNA was trading at $100, creating that same 1 unit of $UST only required 0.01 units of $LUNA to be burnt.
Looking at the market cap of $UST, most of the $UST supply was created between Nov 2021 and May 2022 (~6x increase during this period to $18.7B). At this time, $LUNA was trading in the $70-90 range.
On 5 May 2022, during a moment of vulnerability coinciding with the transition from the Curve UST-3pool to 4pool, a shallower liquidity UST-3pool was drained of its other stablecoin assets, causing $UST to make up over 95% of the liquidity within the Curve pool.
To quickly note, the UST-3pool is a liquidity pool with 4 assets ($UST, $DAI, $USDT, $USDC). Unlike Uniswap, Curve does not require equal weighting for the individual assets within the pools but typically you would not like to see an overconcentration of one asset from a liquidity pool health perspective.
This significant shift in the balance within the UST-3pool was what led to the initial de-peg of $UST from $1. From there, market forces took over as a number of market participants looked to get out of holding $UST, causing a bank-run.
As on-chain stablecoin swap alternatives were limited other than the UST-3pool, the other options were swapping $UST on centralized exchanges or through the LUNA-UST burn/mint mechanism.
As mentioned previously, most of the $UST was created when $LUNA was trading around $70-90. Once $LUNA’s price declined below this range for a sustained period, the amount of $LUNA needed to be minted to cover the mint/burn became greater and greater. This led to a death spiral situation where $LUNA’s token supply became hyper-inflationary and $UST holders were no longer able to stand a chance in redeeming their holdings at par.
What we can learn from it
The fall of Terra identifies two problem areas which are relevant to the HydraDX Omnipool: The issue of toxic assets, and the issue of governance attack vectors.
The issue of toxic assets can broadly be described as a situation in which (what appears to be) a legitimate asset has been added to the Omnipool by the Governance of the Protocol, however this same asset later experiences a sharp plunge in its price caused by some unforeseen circumstances. In other words, pretty much what happened to $UST. If a toxic asset such as $UST were to be accepted in the Omnipool, exploiters could take advantage of such a situation and deposit the toxic asset in exchange for “good” assets, allowing them to drain the Omnipool’s liquidity.
Here at HydraDX, we have been aware of the toxic asset problem long before the Terra debacle, and we have been actively looking for ways to limit exposure of the Omnipool to toxic assets. The solution which we will be implementing for this purpose consists of mechanisms for early warning which allow us to become quickly aware of the problem, combined with triggers that could potentially be used to pause the trading and/or withdrawals for specific assets.
Governance Attack Vectors
Another issue highlighted is the possibility of governance attacks. In the case of Terra, the two tokens of the protocol - $LUNA and $UST, were economically linked. The protocol was designed in a way which tried to maintain the peg of $UST by excessively minting $LUNA, thereby diluting existing holders of $LUNA. By doing so, volatility of one token got transposed into volatility of the other token. What makes matters worse is that $LUNA was also the governance token of the protocol. In a more doomsday scenario, malicious actors could potentially scoop up the quickly inflating governance tokens and use them to launch a governance attack on the protocol.
To prevent such mishaps, the HydraDX decided to transition to a 2-token model more than half a year ago. Currently, we have $HDX acting as a protocol token with governance voting rights, and $LRNA being the hub token which captures the liquidity movements in the Omnipool. There are no (economic) links between the two tokens, which prevents unforeseen events from opening up a governance attack vector.
3AC and the widespread contagion
Three Arrows Capital (3AC) was one of the most prominent crypto native hedge funds in the space which at - its peak - had ~$6Bn in assets under management. As such, 3AC and its subsidiaries were able to leverage its reputation within the industry and borrow a significant amount of money within the CeFi space - a substantial part of which was under- / un-collateralized.
During the first half of 2022, macroeconomic conditions caused Bitcoin to drop from $30k+ to $20k (a 50% decline), sparking a cascade of liquidations across crypto assets, leading to the liquidation of many long positions held by 3AC. This, combined with outstanding loan payments, forced 3AC to file for bankruptcy. With the latest release of the liquidation application, $2.8B of claims have been filed against the fund, with hints to some seemingly questionable actions taken by the fund.
The liquidation cascades also led to several CeFi bankruptcies (namely Voyager and Celsius). This caused many DEXes to experience a significant amount of traffic as some market participants looked to unwind positions while others tried to make a profit out of the price volatility. The $ETH 7-day implied volatility shot up to >200% during the Jun 9-17th period.
What we can learn from it
The volatility caused by the fall of 3AC shows that in turbulent times, DEXs are heavily relied upon to be up-and-running in order to facilitate trading at all times. This, however, is only possible if there is sufficient liquidity provided by Liquidity Providers (LPs), which serves as the main pillar of any Automated Market Maker (AMM). The question, then, is how to limit the exposure of LPs to the impermanent loss during times of high volatility.
Here at HydraDX, one of the concepts being explored is Volatility Aware AMMs. This is where trading fees become dynamic and adjust based on the observed market volatility. LPs should be compensated for acting as the liquidity provider of last resort during turbulent times.
Bancor ($BNT) and its impermanent loss protection mechanism
With turmoil across all markets, DeFi was not spared from the carnage. One of our peers - Bancor, also witnessed the emergence of a downward spiral situation. Launched in 2017, Bancor is one of the first protocols to pioneer the XYK AMM model, later popularized by Uniswap. From there, they started exploring various models of the AMM.
In October 2021, Bancor launched v2.1 which revolved around two key features. The first feature was single-sided liquidity provisioning which allowed users to become LPs by depositing one token of their choice, as opposed to the usual 50/50 requirement for regular XYK pools. The second was impermanent loss (IL) protection for those who provided long-term liquidity on Bancor (coverage increased to 100% after 100+ days). The IL protection was offered in the form of minting of new $BNT tokens to compensate for the IL experienced by the position during the LP period. The liquidity pools for each asset were capped given the IL protection offered.
In May 2022, Bancor launched v3 which introduced the concept of the Bancor Omnipool (same name as HydraDX Omnipool, however quite a different beast). In this release, Bancor further iterated on their single-sided liquidity staking by incorporating all deposited tokens to a single smart contract, thereby routing all transactions through this single pool (i.e. Bancor’s Omnipool concept). This allowed all trades to occur in one hop instead of using $BNT as an intermediary. Further changes included the removal of the deposit cap on all liquidity pools, and the offer of 100% IL protection to LPs, with a 0.25% withdrawal fee and a 7-day delay.
See link for Bancor’s full mortem: https://blog.bancor.network/bancor-update-june-29-2022-322fbbd993ad
During the week of Jun 12th, a handful of large pending withdrawals appeared in the cooldown contract. This, along with a significant amount of sell pressure from 18+ months worth of accumulated $BNT rewards, resulted in a sharp decline in the price of $BNT.
Because of this price decline, the amount of $BNT required to cover the 100% IL protection (through the minting of new $BNT) rose rapidly, and eventually there was a deficit in the amount of tokens required to be minted vs. the protocol’s holdings and the accrued fees.
This eventually resulted in a hyperinflationary situation for $BNT, as explained by @hasufl:
Per the Bancor DAO’s intervention policy, $BNT distribution was paused to stop this scenario. As such, all LPs who would then like to exit their liquidity pools would not be protected from any IL experienced.
What we can learn from it
Given some similarities in the concepts behind Bancor and HydraDX’s AMM, we note two key design choices that differentiate our model from the one of Bancor: Hub-token stability and Impermanent Loss (IL) protection.
As we mentioned earlier under the Terra collapse, we adopted a two-token model to mitigate the potential attack vector on governance. But that’s not the only reason. The hub-token is key to the stability of the entire Omnipool. In Bancor’s model, the hub-token ($BNT) acted as the liquidity mining (LM) reward token and furthermore was used to protect LPs from IL. These factors introduced unnecessary supply & demand dynamics to the system.
As explained in Omnipool R&D (Part 3), the Omnipool can be thought of as many synthetic 50/50 liquidity pools where the other token in each pool is the hub-token. Thus, all LPs have IL exposure to the price movement of the hub-token. In Bancor’s case, because LPs gained token rewards and IL protection from minting of the hub-token, this increased the volatility in their Omnipool. During market stress, LPs would sell their liquidity mining rewards and IL protection coverage tokens. This eventually resulted in a decrease in the price of the hub-token, which in turn caused greater IL across the Omnipool and led to more hub-tokens being minted to compensate for this greater IL. And thus, a death spiral was created.
For HydraDX’s Omnipool, this further validates the choice of a 2-token model. By reducing external supply & demand pressures from the hub-token, we could materially improve the stability of the Omnipool as a whole.
Impermanent Loss (IL) Protection
At the moment, IL remains a problem largely unresolved by the DeFi community. Different developments have sprung up like Uniswap’s V3 (which is closer to an orderbook system) or multi-asset pools like Balancer or Bancor V3. The problem lies in the fact that AMMs rely on arbitrageurs to update the price of a token and not the LPs. Thus, by taking advantage of the stale pricing offered by AMMs, arbitrageurs end up with most of the profit.
So far, many DEXs across multiple ecosystems have relied on liquidity mining rewards to cover the LPs’ losses from IL. Bancor took this one step further by offering to cover 100% of the IL at the expense of minting more $BNT.
At HydraDX, we believe that using token rewards to paper over a product design flaw is beneficial only in the short-term but at the expense of the long-term viability of the project. Instead, our team has been looking into external demand features and game theory incentives to help reduce IL without giving away moarrr tokensTM. Research into this complex question is still ongoing, and we will share information with you once we have reached more conclusive results.
We are still very early in DeFi.
At this stage, the space resembles a fast-paced Western in which the main actors are recklessly looking for the next big hit. Ship fast, get rich fast, lose all your money faster?
As cowboys come and go, DeFi is here to stay. Back in the 19th century, armed cowboys were robbing banks, but this did not prevent the rise of modern banking because it had a proposition for the future (money lending and bank debt). Now in the 21th century, the proposition of permissionless and decentralized finance will prevail over short-sighted opportunism.
As you already know, we Hydraheads prefer to stay hydrated above getting liquidated. This is why we are building the HydraDX Protocol for the long run. We may sometimes take our time, but this is because we strongly prioritize safety above speed of execution. There are years worth of research behind the Omnipool, which is currently undergoing a rigorous audit by one of the leaders in the space.
We hope you enjoyed reading this piece. Coming up in the next weeks, we will be releasing the final part of the Omnipool series, where we touch on LRNA's role for LPs and HDX Hodlers.
In times of tribulation. ☔
So, what your team learning from HydraDX Omnipool :)))