> For the complete documentation index, see [llms.txt](https://docs.inceptionlrt.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.inceptionlrt.com/developers/modules/rate-providers.md).

# 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.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.inceptionlrt.com/developers/modules/rate-providers.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
