LogoLogo
  • Notional V2 Governance Parameters
  • Overview of governance parameters
    • Current parameters
  • Liquidity pools
    • Introduction
    • Max market index
    • Anchor rates
    • Scalar rates
    • Maximum market proportion
  • Collateral assets & liquidations
    • Introduction
    • Cash
    • fCash
    • Liquidity tokens
    • nTokens
    • Settlement
  • nTokens
    • Introduction
    • Deposit shares
    • Leverage thresholds
    • fCash residuals
  • Active Maturities
    • Tenors
    • Idiosyncratic fCash
  • fCash Valuation
    • Interest Rate Oracles
    • fCash Valuation Curve
  • Fees & incentives
    • Trading fees
    • Incentives
  • Notional
  • Analytics Dashboard
  • Blog
Powered by GitBook
On this page
  • Last traded rate
  • Oracle rate

Was this helpful?

  1. fCash Valuation

Interest Rate Oracles

PreviousIdiosyncratic fCashNextfCash Valuation Curve

Last updated 2 years ago

Was this helpful?

Notional V2 liquidity pools track two different interest rates, the last traded rate and the oracle rate.

Last traded rate

The last traded rate reflects the implied interest rate of the last trade executed on the liquidity pool. The last traded rate could be manipulated over short time frames (such as via flash loans) to display a rate that does not reflect the true, or equilibrium interest rate of the liquidity pool at a particular time.

These limitations make the last traded rate insecure as a price oracle by which to value fCash. Given that we allow users to borrow against their fCash, we need to ensure that the price oracle used to value fCash can't be manipulated. If the price oracle can be manipulated, an attacker could artificially move interest rates to a level that would push accounts into a state of under-collateralization. The attacker could then liquidate these accounts at an artificial price.

Oracle rate

The oracle rate is designed to mitigate the risk of price manipulation by providing a lagged, dampened price feed that converges to the last traded rate over a time window set by governance. The oracle rate is defined like this:

oracleRate =
  lastTradedRate *
    min((currentBlockTime - lastTradedTime) / timeWindow, 1) +
  previousOracleRate *
    max(timeWindow - (currentBlockTime - lastTradedTime) / timeWindow, 0)

This design ensures that the oracle rate will not be vulnerable to flash loan attacks - trades within a single block will have a currentBlockTime - lastTradedTime value of 0 which means they will have no effect on the oracle rate. Here is an example that illustrates how the oracle rate will respond to trades and converge to the last traded rate over time: