๐Ÿ““
Notional Finance
  • ๐Ÿ—’๏ธTo-Do List [Notional]
  • ๐ŸงตTwitter Threads
    • fCash Overview
    • AMM Overview and Trades
    • fCash Valuation 1
    • Liquidity Fees
    • Lenders trade (fCash)
    • Lender Trade 2
    • Borrower trade (fCash)
    • What happens at maturity?
    • Page 2
  • Experiment
    • DUNE & Dashboard
    • Docs & Topics
      • Interest Rate Risk
      • Inverse Interest Rate Risk
      • AMM Curve Comparison
      • Understanding Risk adjusted TVL
      • How Notional stays solvent
      • Liquidation!?
      • Prime Cash
    • Excel & Numbers
      • Duration Risk
      • 200% CR rate comparison
    • Trades
  • Weekly Reproducible Vault
    • 29 May - 4 June
      • Activity
      • IR Compare
    • 5 June - 11 June
    • 12 June - 18 June
  • ๐Ÿ’ธfCash
    • What & Why fCash?
    • fCash Use-case
    • fCash maturity
  • โš—๏ธCounterparty liquidity pool
    • Liquidity pool
    • AMM
    • Liquidity pool interactions
      • Lending Trade
      • Borrow Trade
      • Liquidity provisioning trade
  • ๐Ÿ’นfCash Finances
    • Valuing fCash
    • Risks subject to the change in Rates
      • The upside of the change in Rates
  • ๐ŸšฐLiquidity providers
    • Liquidity provisioning
    • Liquidity provider's portfolio
      • Net Lending Position for an LP
      • Net Borrowing Position for an LP
    • Yield earning (v1)
    • Risks (v1)
  • ๐ŸฅBorrower Resources
    • Collateralization
    • Free Collateral Computations
  • ๐Ÿช™nTokens
    • Automated liquidity provisioning for LPs
    • Mechanics
      • Minting nTokens
      • Redeeming nTokens
    • fCash position for nToken holders
    • Yield earning (v2)
    • Risks (v2)
  • โŒ›Tenor Maturity
    • Maturity
    • fCash maturity
    • Quarterly Rolls
  • ๐Ÿ”Leverage vaults
    • Leveraged yield opportunities
    • Vault mechanics
      • Entering
      • Exiting
    • Collateralization & liquidations
    • Balancer/Aura wstETH/WETH Strategy
      • Entering in Bal/Aura wstETH/WETH strategy
      • Exiting from Bal/Aura wstETH/WETH strategy
  • ๐Ÿ›๏ธV3
    • Page 1
Powered by GitBook
On this page
  • Notional AMM
  • Variability
  • Exchange Rate
  • Difficulties with a Static Curve
  • Dynamic Curve
  • Appendix
  1. Counterparty liquidity pool

AMM

PreviousLiquidity poolNextLiquidity pool interactions

Last updated 2 years ago

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

Notional AMM

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.

Proportion(p)=totalFCash(totalFCash+totalCurrency)Proportion (p) = {totalFCash \over (totalFCash + totalCurrency)}Proportion(p)=(totalFCash+totalCurrency)totalFCashโ€‹

Variability

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.

Exchange Rate

The resulting exchange rate determines the fixed interest for the lending or borrowing trade and it can be calculated through this equation:

exchangeRate=(1rateScalar)(lnp(1โˆ’p))+rateAnchorexchangeRate=({1 \over rateScalar})(ln{p \over (1-p)}) + rateAnchorexchangeRate=(rateScalar1โ€‹)(ln(1โˆ’p)pโ€‹)+rateAnchor

fCash quantity can be calculated using this exchange rate by multiplying the Cash quantity by the exchange rate.

fCash=cashโˆ—exchangeRatefCash=cash * exchange RatefCash=cashโˆ—exchangeRate

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.

Difficulties with a Static Curve

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.

Dynamic Curve

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:

scalar(t)=scalarRootโˆ—(periodSizetimeToMaturity)scalar(t)=scalarRoot * ({periodSize \over timeToMaturity})scalar(t)=scalarRootโˆ—(timeToMaturityperiodSizeโ€‹)

liquidityFee(t)=liquidtyFeeRootโˆ—(timeToMaturityperiodSize)liquidityFee(t)=liquidtyFeeRoot * ({timeToMaturity \over periodSize })liquidityFee(t)=liquidtyFeeRootโˆ—(periodSizetimeToMaturityโ€‹)

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.

Appendix

You can play around with the AMM curve to test the impact of rateAnchor, rateScalar and timeToMaturity .

โš—๏ธ
here
Liquidity fees are not considered here
Liquidity fees are not considered here