> For the complete documentation index, see [llms.txt](https://docs.kpk.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kpk.io/funds/infrastructure/onchain-accounting/price-feeds/cross-rate.md).

# stETH, lsETH & OETH (CrossRate)

Generic custom price feed for an asset **Y** that has no direct Y/USD feed but is quoted in a base asset **X** that does. The price is the cross-rate of the NAV's own X/USD base price and a Chainlink Y/X feed. The shared `CrossRateCustomPriceFeed` base is instantiated as one **named per-token contract** for each asset that needs it. On Ethereum mainnet the **primary** instances are **lsETH** (`lsETH_CustomPriceFeed`, Liquid Collective — Y/X is Chainlink's *LsETH/ETH Exchange Rate*) and **OETH** (`OETH_CustomPriceFeed`) — each `Y/USD = ETH/USD × Y/ETH`, where the cross-rate is the asset's sole pricing feed.

{% hint style="info" %}
**stETH is not priced by a cross-rate.** Its primary is a [fundamental](/funds/infrastructure/onchain-accounting/price-feeds.md#custom-price-feeds) unit-rate feed (`1.0 × ETH/USD`), matching wstETH and eETH; the market `stETH/ETH` cross-rate is registered as a **monitor** (`stETHCrossRate`), deployed from the generic base rather than a named per-token subclass. This page describes how that monitor computes its price — it does not set stETH's NAV value.
{% endhint %}

**Source:** [`CrossRateCustomPriceFeed.sol`](https://github.com/karpatkey/onchain-accounting/blob/main/src/prices/protocols/CrossRateCustomPriceFeed.sol)

The same base also backs **divergence monitors** for the fundamental LST/LRT primaries — **ezETH**, **ETHx**, **osETH**, and **rETH**, where the `Y/ETH` leg is an independent market feed. Three of the four have a named per-token subclass (`ezETH_CrossRateCustomPriceFeed`, `ETHx_CrossRateCustomPriceFeed`, `osETH_CrossRateCustomPriceFeed`); **rETH's monitor is deployed from the generic base** under the config key `rETHCrossRate`, as stETH's is. Those assets are priced by a fundamental protocol-rate primary ([ezETH](/funds/infrastructure/onchain-accounting/price-feeds/ezeth.md), [ETHx](/funds/infrastructure/onchain-accounting/price-feeds/ethx.md), [osETH](/funds/infrastructure/onchain-accounting/price-feeds/ostoken.md), [rETH](/funds/infrastructure/onchain-accounting/price-feeds/reth.md)); the cross-rate is registered as a [monitor feed](/funds/infrastructure/onchain-accounting/price-feeds.md#primary-feed-and-divergence-monitors), so a market depeg makes it diverge from the fundamental primary and NAV flags the asset `irregular` — it never prices NAV. The L2 deployments use the same pattern (e.g. `weETHCrossRate`, `rsETHCrossRate` monitors on Arbitrum/Base).

***

## Approach

NAV base X/USD (`getPriceDataNoDivergence(WETH)`) × Chainlink Y/X

{% hint style="info" %}
The base/USD term is sourced from the NAV's own selector — see [Base/USD from the NAV's own selector](/funds/infrastructure/onchain-accounting/price-feeds.md#base-usd-from-the-navs-own-selector).
{% endhint %}

<figure><img src="/files/vhLZrwvZ53FJwUyjE0I2" alt="Left-to-right flowchart of the stETH, lsETH &#x26; OETH (CrossRate) price feed: rate and Chainlink inputs combine into a USD price, with a staleness gate."><figcaption><p>stETH, lsETH &#x26; OETH (CrossRate) price feed — how its oracle inputs compose into a USD price, with the staleness gate.</p></figcaption></figure>

***

## Price calculation

```
price = (X/USD) × (Y/X) / 10^(Y/X decimals)
```

| Input   | Source                                              | Description                     |
| ------- | --------------------------------------------------- | ------------------------------- |
| `X/USD` | NAV base — `getPriceDataNoDivergence(WETH)` (8 dec) | the NAV's primary ETH/USD price |
| `Y/X`   | Chainlink Y/X feed (`latestRoundData`)              | Underlying Y quoted in X        |

The Y/X leg is a Chainlink feed; the X/USD (ETH/USD) leg is the NAV's primary base price. The divisor is `10 ** yToX.decimals()`, which cancels the Y/X feed's decimals so the result keeps the X/USD leg's scale. Output is **8 decimals** (inherited from the X/USD leg via `_decimals`).

For the mainnet instances, X is ETH (ETH/USD via the NAV base) and Y is stETH, lsETH, or OETH respectively (a stETH/ETH, LsETH/ETH, or OETH/ETH feed).

***

## Constructor

```solidity
constructor(
    address underlyingAsset_,
    address yToXFeed_,
    uint256 yToXHeartbeat_,
    address nav_,
    address baseAsset_
)
```

| Parameter          | Description                                                                                |
| ------------------ | ------------------------------------------------------------------------------------------ |
| `underlyingAsset_` | The asset Y whose USD price is returned (stETH, lsETH, or OETH)                            |
| `yToXFeed_`        | Chainlink Y/X aggregator (e.g. stETH/ETH or OETH/ETH)                                      |
| `yToXHeartbeat_`   | Staleness window (seconds) for the Y/X feed                                                |
| `nav_`             | NAVCalculator (proxy) — supplies the base asset's USD price via `getPriceDataNoDivergence` |
| `baseAsset_`       | The registered base asset whose USD price is read (WETH)                                   |

***

## Staleness

The Y/X heartbeat is checked directly. `getLatestPrice()` returns `stale = true` if the Y/X feed satisfies `block.timestamp − updatedAt ≥ heartbeat`, if either leg's answer is `≤ 0`, if the Y/X `updatedAt` is in the future (clamped to `block.timestamp`), or if the NAV reports the base asset (WETH) primary feed stale. The base leg's `updatedAt` comes from the NAV's selected feed. The reported `updatedAt` is the **older** of the two legs.

***

## Chains

On **Ethereum**, as **primary** feeds: `lsETH` and `OETH`, each configured with the matching Y/X feed. As **monitor** feeds (same base contract, market Y/ETH leg), watching their fundamental primaries: `stETHCrossRate`, `ezETHCrossRate`, `ezETHCrossRateMarket`, `ETHxCrossRate`, `osETHCrossRate`, and `rETHCrossRate` — [ezETH carries two](/funds/infrastructure/onchain-accounting/price-feeds/ezeth.md) because its original monitor's rate leg stopped being a market feed.

On the L2s, all monitors: `weETHCrossRate`, `ezETHCrossRate` and `rsETHCrossRate` on **Arbitrum**, and `weETHCrossRate` on **Base**. Gnosis has no cross-rate instance.

Every one of these takes an external `yToXFeed`, so each is covered by the pre-deploy [rate-feed guard](/funds/infrastructure/onchain-accounting/price-feeds.md#custom-price-feeds) — pair identity where the provider's `description()` names the pair, and a declared `$UNVERIFIABLE` exemption plus a plausibility band where it does not.


---

# 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.kpk.io/funds/infrastructure/onchain-accounting/price-feeds/cross-rate.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.
