AMM
Last updated
Last updated
The proportion of cTokens and fCash tokens in the liquidity pool defines the exchange rate between them thus the interest rate for the underlying borrowing or lending trade.
Liquidity Pool / Overview
To ensure higher efficiency, the AMM curve needs to be defined in such a manner that the slippage is as low as possible and the curve also needs to be able to accommodate market repricings - if the curve is too flat, or flat throughout, it wonโt be able to respond effectively to large changes in the equilibrium interest rate.
Here is the curve used by Notional AMM:
Here the proportion is the ratio of fCash to the total assets in the liquidity pool.
As the market functions there is no certainty about how much the rates can fluctuate or for how long the rate would trade in a specific range or what the ideal rate is. To cater to this issue Notional came up with two parameters that make the curve dynamic according to market needs.
These parameters are rateAnchor
and rateScalar
. The scalar and anchor allow us to vary the steepness of the curve and its position in the xy-plane, respectively. Here is the same logit curve with different scalar and anchor values.
rateAnchor
determines the rate at which the liquidity of fCash & cToken is concentrated. In the region where the liquidity concentration is higher, the impact of slippage would be the lowest.
rateScalar
defines the steepness of the curve i.e. the amount of liquidity getting concentrated. At a higher rateScalar
value the liquidity is highly concentrated near the rateAnchor
value and the slippage would be low near the rateAnchor
value but the slippage would be substantial near the extreme values of proportion. At a lower rateScalar
the curve covers a greater interest rate range with greater slippage as compared to that of a higher rateScalar
value.
The resulting exchange rate determines the fixed interest for the lending or borrowing trade and it can be calculated through this equation:
fCash quantity can be calculated using this exchange rate by multiplying the Cash quantity by the exchange rate.
Q. This particular equation is not used to compute the fCash quantity. This is for the explanation purpose to understand how the current mechanics were formed.
The exchange rate between cash and fCash implies an interest rate depending on the time to maturity.
In a liquidity pool AMM, if you were to make a single trade, you would incur the same slippage regardless of when you execute the trade. But since fCash, one of the assets in the liquidity pool, matures at a certain date the resulting interest rates would change based on when the trade is being executed.
In the above example, assume you execute a trade where you got 1050 fCash for your 1000 DAI. Here the exchange rate remained constant regardless of the time left for maturity (fCash:DAI as 0.95:1). The interest rate should be a more relevant measure of a fCash tokenโs โpriceโ, and the AMM must try to keep the resulting APY rate constant between trades, not the exchange rate. Failing to do so will result in a fCash tokenโs prevailing interest rate constantly drifting off-market with time. The effect would be minimal throughout most of a fCash tokenโs lifespan but would blow up exponentially as it approached maturity. To solve this, the exchange rate needs to be a function of time to maturity.
The problem of static sensitivity is relevant not only to the liquidity curve itself but also to the liquidity fee. The same reasoning applies - a constant fee in exchange rate terms will grow exponentially more punitive to end users as fCash tokens approach maturity. To solve this problem, we convert the scalar and liquidity fee into functions of time to maturity. Making the scalar a function of time to maturity means that the shape of the liquidity curve changes as we approach maturity:
Here periodSize
is the amount of time between the inception of a fCash token
By making the rateScalar
and the liquidity fee is a function of time to maturity, the impact of slippage would minimize as we approach the maturity date. Simply put, the change in the yields due to rate fluctuations would be maximum when the time to maturity is the highest.
Here is the earlier example after applying the above logic:
Here the mechanism ensures the resulting yield (interest rate) is maintained constant regardless of the trade time. This was not possible earlier with the static curve where the exchange rate was held constant.
The exchange rate (fCash:cToken) might fluctuate based on the lending and borrowing trades in the AMM and the time to maturity but the trader is guaranteed to receive fixed rates provided that they hold their fCash positions till maturity.
You can play around with the AMM curve to test the impact of rateAnchor
, rateScalar
and timeToMaturity
here.