Curve
A stableswap pool with liquidity controlled and owned predominantly by the protocol
Last updated
A stableswap pool with liquidity controlled and owned predominantly by the protocol
Last updated
β οΈ This specific AMO has been deprecated, but the underlying rationale (Curve/Convex protocol-owned liquidity to achieve peg stability and protocol income) and math is still used by newer AMOs. See V3 AMOs β οΈ The Curve AMO puts FRAX and USDC collateral to work providing liquidity for the protocol and tightening the peg. Frax has deployed its own FRAX3CRV metapool. This means that the Frax deployer address owns admin privileges to its own Curve pool. This allows the Curve AMO controller to set and collect admin fees for FXS holders and various future functions. The protocol can move idle USDC collateral or new FRAX to its own Curve pool to create even more liquidity and tighten the peg while earning trading revenue.
CurveAMO (deprecated): 0xbd061885260F176e05699fED9C5a4604fc7F2BDC
Decollateralize - Places idle collateral and newly minted FRAX into the FRAX3CRV pool.
Market operations - Accrues transaction fees, CRV rewards, and periodically rebalances the pool. The FRAX3CRV LP tokens are deposited into Yearn crvFRAX vault, Stake DAO, and Convex Finance for extra yield.
Recollateralize - Withdraws excess FRAX from pool first, then withdraws USDC to increase CR.
FXS1559 - Daily transaction fees and LP value accrued over the CR. (currently in development)
Curve's Stableswap invariant allows for dampened price volatility between stablecoin swaps when reserves are not extremely imbalanced, approximating a linear swap curve when doing so.
In cases of extreme imbalance, the invariant approaches the Uniswap constant-product curve.
The combination of two such curves allows for the expression of one or another, depending on what the ratio of the balances in the pool are, according to a coefficient. Using a dimensionless parameter as the coefficient, one may generalize the combination of the two curves to N coins.
The protocol calculates the amount of underlying collateral the AMO has access to by finding the balance of USDC it can withdraw if the price of FRAX were to drop to the CR. Since FRAX is always backed by collateral at the value of the CR, it should never go below the value of the collateral itself. For example, FRAX should never go below $.85 at an 85% CR. This calculation is the safest and most conservative way to calculate the amount of collateral the Curve AMO has access to. This allows the Curve AMO to mint FRAX to place inside the pool in addition to USDC collateral to tighten the peg while knowing exactly how much collateral it has access to if FRAX were to break its peg.
Additionally, the AMOβs overall strategy allows for optimizing the minimum FRAX supply Y such that selling all of Y at once into a Curve pool with Z TVL and A amplification factor will impact the price of FRAX by less than X%, where X is the CRβs band sensitivity. Said in another way, the Curve AMO can put FRAX+USDC into its own Curve pool and control TVL. Since the CR recollateralizes when FRAX price drops by more than 1 cent under $1, that means that there is some value of FRAX that can be sold directly into the Curve pool before the FRAX price slips by 1%. The protocol can have at least that amount of algorithmic FRAX circulating on the open market since a sale of that entire amount at once into the Curve poolβs TVL would not impact the price enough to cause the CR to move. These amounts are quite large and impressive when considering Curveβs stablecoin optimized curve. For example, a 330m TVL FRAX3Pool (assuming balanced underlying 3Pool) can support at minimum a $39.2m FRAX sell order without moving the price by more than 1 cent. If the CR band is 1% then the protocol should have at least 39.2m algorithmic FRAX in the open market at minimum.
The above strategy is an extremely powerful market operation which would mathematically create a floor of algorithmic FRAX that can circulate without any danger of breaking the peg. Additionally, Curve allocates CRV tokens as rewards for liquidity providers to select pools (called gauge rewards). Since the Frax protocol will likely be the largest liquidity provider of the FRAX3CRV pool, it can allocate all its FRAX3CRV LP tokens into Curve gauges to earn a significant return. The CRV tokens held within the Curve AMO can be used to vote in future Curve DAO governance controlled by FXS holders. This essentially means that the more the protocol employs liquidity to its own Curve pool, the more of the Curve protocol it will own and control through its earned CRV rewards. The long term effect of the Curve AMO is that Frax could become a large governance participant in Curve itself.
iterate()
The iterate function calculates the balances of FRAX and 3CRV in the metapool in the hypothetical worst-case assumption of FRAX price falling to the CR. To start, the function takes the current live balances of the metapool and simulates an external arbitrageur swapping 10% of the current FRAX in the metapool until the price given is equal (or close to) the CR, swapping out the corresponding amount of 3CRV. This simulates the situation wherein the open-market price of FRAX falls to the CR, and the resulting 1-to-1 swap normally offered by the metapool is picked off by arbitrageurs until there is no more profit to be had by buying FRAX elsewhere for the CR price and selling it into the metapool. Line 282 is the specific location where the price of FRAX is checked.
Then, the metapool checks how much its LP tokens would withdraw in that worst-case scenarios in terms of the underlying FRAX and 3CRV. The ratio between the two is normally tilted roughly 10-to-1 in terms of FRAX withdrawable to 3CRV withdrawable. For the protocol's accounting of how much collateral it has, it values each 3CRV withdrawable at the underlying collateral value (i.e. how much USDC it can redeem for it) and each FRAX at the collateral ratio. Since the protocol never actually sends this much FRAX into circulation under normal circumstances, this is a highly conservative estimate on the amount of collateral it is actually entitled to in terms of USDC.
To check scenarios of how much reserves would be indebted to the Curve AMO at other prices, one may simply adjust the fraxFloor()
value in local testing through setting a custom_floor
.