# Interest Rate Oracles

Notional V2 liquidity pools track two different interest rates, the **last traded rate** and the **oracle rate**.&#x20;

### 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.&#x20;

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:

<figure><img src="/files/BfzG6EGABwON5j3ULKWO" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.notional.finance/governance/fcash-valuation/interest-rate-oracles.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
