Curve Issues $crvUSD White Paper

The much-anticipated $crvUSD white paper dropped this morning, along with the full repository for the backend. Combined with the prior middleware, the only thing missing is frontend and deployment.

Even though parts of it contain complex math and bleeding-edge Titanoboa testing, it’s nonetheless worth a read for even the layperson. The advanced mathematical proofs you might gloss over, but the code is well-documented and the white paper is comprehensible to those who put in the work.

Automated Self-Liquidation

By far the most impressive feature of the entire ecosystem is the LLAMMA, or “Lending-Liquidating AMM Algorithm.”

In most other lending platforms, when the price of your token drops, your loan health rapidly decays and you get liquidated instantly. It’s a horrible experience, and leads to so many sudden pumps and dumps, yet very few have innovated on this method.

Within the $crvUSD universe, once you initially lend your collateral, your portfolio has a balance consisting 100% of this collateral. If the LLAMMA observes the price of this collateral is dropping, it automatically liquidates your portfolio into $crvUSD. If the price goes back up your collateral gets repurchased. Therefore, instead of an instantaneous liquidation, the process occurs smoothly over a continuous range.

This strategy severely limits your potential losses and allows for more passive management of your position. Of course, liquidations remain possible, and remain an active part of the ecosystem. Helpfully, the $crvUSD protocol also allows for self-liquidation for such situations.

Curve v2 pools have been in existence for nearly a year, containing the first example of pools executing the complex logic on-chain to automatically rebalance liquidity internally. Despite the many ways this could, and should, have been applied to other concepts in DeFi, nobody bothered to try. So Curve grabbed the low-hanging fruit, becoming the first lending-based stablecoin connected to an intelligent AMM.

Bands

Under the hood, the collateral price is divided into several “bands.” Instead of depositing at a specific liquidation price, you deposit collateral over a range of liquidation prices. As the price drops, the contract tracks which band is “active” — that is, which band is currently in the process of being liquidated.

Liquidity must be added to at least five bands, up to a maximum of 50. A larger range means your position begins liquidating sooner, but more gradually. A smaller range means the process can be quite sudden.

Imagine you take out a loan using 0.5 $ETH, with a liquidation range between $1000 and $1050. Your liquidations bands might look like the following:

  • Band 100 ($1000 – $1010): 0.1 ETH
  • Band 101 ($1010 – $1020): 0.1 ETH
  • Band 102 ($1020 – $1030): 0.1 ETH
  • Band 103 ($1030 – $1040): 0.1 ETH
  • Band 104 ($1040 – $1050): 0.1 ETH

Once the price drops to the $1040-$1050 range, your position starts getting liquidated. Your $crvUSD position is now backed by 0.4 ETH and ~$104 USD. As the price drops, the effects smooth out the drop nicely.

Much of this happens behind the scene of course, the details of this can be abstracted as much as needed as to provide a clean user experience. Notably, the javascript interface and backend compute this into a user-friendly “health” metric, common to existing lending platforms.

Using liquidity bands in this manner may recall Uniswap v3, which also required liquidity ranges. This implementation ends up being far more useful though. To date, nobody had successfully created a passive LP solution for Uni v3. Here, Egorov not only solves the problem, but manages to do so within the confines of programming on-chain — truly impressive.

Price Oracles

The Curve stablecoin also highlights Curve’s capability of balancing out sudden price swings using smoothing functions.

Curve illustrated this concept vivdly this past month, as they pointed out the effect of how v2 pools apply an exponential moving average to prices helps to smooth out price spikes as are seen elsewhere.

The “big implications when thinking of liquidations” part is now quite clear, as they are applying similar smoothing functions to price oracles. In the newly released repo you can see multiple contracts to handle price oracles, including an EMA.

Some users had questioned what some of the leaks around “adiabatic” processes meant. Indeed, $crvUSD may be the first stablecoin where a rigorous understanding of advanced physics is useful to comprehending its mechanics.

Diabeetus Intensifies GIF - Diabetes Stare Intensifies GIFs

Fortunately, an “adiabatic process” is really just a fancy way of describing whether something happens fast or slow — some systems behave differently when changes occur too fast to react. Same principle applies here — if prices of assets are less volatile it is easier to avoid liquidations than if they move suddenly.

For the quantum physics spin on this, see also: Avoided Crossings

AMM

Another key feature of the LLAMMA ecosystem is that each particular form of collateral serves as its own publicly tradable AMM. For example, the documentation references using ETH as collateral for $crvUSD. This will automatically creates an $ETH / $crvUSD liquidity pool that traders can arbitrage and trade, featuring the same 24/7 uptime and resiliency that makes Curve v2 superior to other DEX/CEX offerings.

That is, you can directly trade between $ETH and $crvUSD through what amounts to a new pool. This has some interesting implications. Hypothetically, the fee on trades for this pool could be set to 0, and the pool would still be profitable from liquidations. In a race to the bottom, Curve could out of the box provide a free ETH/USD trading pair that still printed money for veCRV holders. To think they say crypto has no real use cases.

We don’t know the specific launch pairs (all tea leaves point to launch just with ETH/crvUSD), but the Github repository prominently features a factory. Whether at launch or in the future, this means the system is capable of supporting any number of collateral pairings (up to the factory hard-coded maximum of 50,000) and will probably be able to launch permissionlessly (or through a DAO vote).

This gets extremely big-brained when you think about the implications. Every token eventually listed as collateral ends up creating another trading pair. At first, your $crvUSD may be most useful to interact with $ETH. If this network expands, a $crvUSD can be traded directly with nearly any token (for as low as 0% fee). We may well see $crvUSD gain the most utility of any stablecoin simply by having so many built-in trading pairs.

Your Bags?

What does this mean for your bags? Tough to say (ask your registered financial advisor). The clear implication for the $CRV token here is mostly that it will generate more fees. We also note the DAO is intended to gain admin power over the $crvUSD ecosystem, providing more governance utility for veCRV.

The addition of so many more trading pairs through $crvUSD may also increase overall volume flowing through the broader Curve ecosystem, so it could provide some convexity. Perhaps some base pairings will emerge within the existing v1 or v2 ecosystem to allow other stablecoins to pair well with $crvUSD.

We expect it will prove a valuable addition to the Curve ecosystem long-term.

Leave a Reply