Investor's Must-Read: In-Depth Analysis of Curve Stablecoin
Original author: Leo Lau
CurveFinance, a DEX protocol known for its stablecoin exchange and multi-asset pool design, recently announced its stablecoin design.
The two most important pillars of its design are LLAMMA and PegKeeper.
LLAMMA stands for Lending Liquidation AMM Algorithm. This is an automated liquidation/clearing program that references some features of Uniswap v3.
Compared to other lending protocols like Aave, the liquidation process is automated. When the price of collateral drops, the AMM converts the collateral into Curve's stablecoin (let's call it crvUSD for now), and when the price rises, it converts crvUSD back into collateral.
Due to this feature, there exists an intermediate state between complete liquidation and complete de-leveraging/collateralization. More interestingly, due to the range order feature of Uniswap v3, users have the possibility to retrieve their collateral instead of facing permanent liquidation.

But why doesn't Curve use its own internal AMM, Curve v2?
First, there is no concept of price ranges in Curve v2. It is an AMM with a full price range (0 to inf). Secondly, there is no analytical solution to calculate the final state of each "price band." Its calculations involve solving cubic equations.
The crvUSD white paper divides the entire liquidation range into price bands, with the upper and lower prices of each band represented as Pup and Pdown, respectively.
By readjusting the liquidity of each band, the advantage of multi-band step asset rebalancing calculations over a single price band is better slippage.
It represents the relationship between the base price and the upper and lower prices of each band in a manner analogous to the price ticks in Uniswap v3.
In each band, liquidity is uniformly distributed. Therefore, although the author derived these relationships using numerical calculations, we can provide a simple proof for equations (9) and (10) in the white paper:

Homogenized liquidity within each price range also benefits multi-user liquidations.
Due to asset rebalancing, there exists impermanent loss. How to choose the optimal parameters (A, n) seems to be a challenging question.
Impermanent loss, slippage, and gas costs all need to be considered.
The second most important pillar, the PegKeeper of crvUSD, as the name suggests, maintains the dollar peg of crvUSD.
This is achieved by adjusting interest rates based on the difference between the oracle price in LLAMMA and the instantaneous price.
If demand for crvUSD increases, the interest rate is lowered to incentivize borrowing. If demand decreases, the interest rate is raised to incentivize redemption and burning of crvUSD.
Why not choose other stablecoins to achieve this?
First, native stablecoins can generate revenue for Curve. Secondly, there are currently no other stablecoins that support LLAMMA.
crvUSD can also leverage its existing stablecoin exchange infrastructure and related liquidity.
Curve stablecoin white paper: https://github.com/curvefi/curve-stablecoin/blob/master/doc/curve-stablecoin.pdf












