# RateOracle

The Rate Oracle is used to track the rate of the [IBT](/glossary.md#ibt) contract and stores the rate once a day.

RateOracle.sol code can be [found on GitHub](https://github.com/APWine/core-v2/blob/main/src/oracle/RateOracle.sol).

## Methods

### pokeRate

```solidity
function pokeRate(IERC4626Upgradeable vault) external returns (uint256)
```

Stores the current rate of the underlying asset of `vault`.&#x20;

Note: Rates are stored once a day. If this method is called when the rate has already been stored, then the current rate for that day will be returned, saving gas.

<table><thead><tr><th width="231.33333333333331">Input Parameter</th><th width="115">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>vault</code></td><td>address</td><td>The address of the <a href="/pages/AOndMDqZNL2aHaFR2EG9">PrincipalToken</a></td></tr></tbody></table>

<table><thead><tr><th width="189.33333333333331">Return Parameter</th><th width="121">Type</th><th>Description</th></tr></thead><tbody><tr><td></td><td>uint256</td><td>The current rate that was set</td></tr></tbody></table>

## View Methods

### getRateOfVaultOnDate

```solidity
function getRateOfVaultOnDate(address vault, uint256 date) public view returns (uint256)
```

Returns the rate of the underlying asset of `vault` at `date`.

### getLastPokedDateOfVault

```solidity
function getLastPokedDateOfVault(address vault) public view returns (uint256)
```

Returns the last date that [`pokeRate()`](#pokerate) was executed for `vault`.


---

# 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://dev.spectra.finance/technical-reference/contract-functions/rateoracle.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.
