# Rate Providers

The rate providers module exposes logic for retrieving or computing the value of vault tokens or underlying assets. This is often required for integrations with strategies, reward calculations, oracles, and accounting systems.

Each provider follows a consistent interface and can be asset-specific, with isolated logic per supported token.

## Components

#### 1. **Base Provider Logic**

* **`RateProvider.sol`** defines core functionality shared across all implementations.
* Includes methods to retrieve the current rate, normalize decimals, and interface with upstream pricing sources.

#### 2. **Interfaces**

* **`IRateProvider.sol`**: Generic interface for fetching the rate of a vault or token.
* **`IInceptionVault.sol`**: Interface for reading data from vault contracts (used by providers).

#### 3. **Per-Asset Implementations**

* Located under `contracts/lst-providers/`
* Each folder (e.g., `inankrETH`, `inETHx`, etc.) includes:
  * A concrete implementation of a rate provider for that asset.
  * These often wrap external data sources or perform internal calculations.

**Example:**

```
function getRate() external view override returns (uint256);
```

## Flow

1. A vault or strategy contract queries a `RateProvider` contract.
2. The provider retrieves or computes a normalized rate.
3. This rate is used for accounting, reward calculation, or integration purposes.

## Contract Summary

| Contract                                                    | Role                                |
| ----------------------------------------------------------- | ----------------------------------- |
| `RateProvider.sol`                                          | Base logic for rate computation     |
| `IRateProvider.sol`                                         | Interface for all rate providers    |
| `InETHxRateProvider.sol`, `inankrETHRateProvider.sol`, etc. | Asset-specific rate retrieval logic |

## Notes

* All implementations conform to the same interface for compatibility.
* Rate calculation logic may differ depending on the underlying protocol used by the asset (e.g., Lido, Ankr).
* Testing and deployment are handled via Hardhat.
