# RateOracle

The Rate Oracle is used to track the rate of the [IBT](https://dev.spectra.finance/glossary#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="principal-token">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`.
