> 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/ldo.md).

# LDO

Custom price feed for the **Lido DAO governance token (LDO)**. No direct LDO/USD feed exists, so the price is composed from a Chainlink LDO/ETH feed and the NAV's own ETH/USD base price.

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

***

## Approach

Chainlink LDO/ETH × NAV base ETH/USD (`getPriceDataNoDivergence(WETH)`)

{% 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/xriN6NAut4VV8L4lPjeG" alt="Left-to-right flowchart of the LDO price feed: rate and Chainlink inputs combine into a USD price, with a staleness gate."><figcaption><p>LDO price feed — how its oracle inputs compose into a USD price, with the staleness gate.</p></figcaption></figure>

***

## Price calculation

```
price = (LDO/ETH) × (ETH/USD) / 10^(LDO/ETH decimals)
```

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

The LDO/ETH leg is a Chainlink feed; the ETH/USD leg is the NAV's primary base price. The divisor is `10 ** ldoToEth.decimals()`. Output is **8 decimals** (inherited from the ETH/USD leg via `_decimals`).

***

## Constructor

```solidity
constructor(
    address ldo_,
    address ldoToEthChainlinkAddress_,
    uint256 ldoToEthChainlinkHeartbeat_,
    address nav_,
    address baseAsset_
)
```

| Parameter                     | Description                                                                                |
| ----------------------------- | ------------------------------------------------------------------------------------------ |
| `ldo_`                        | LDO token address (the supported underlying asset)                                         |
| `ldoToEthChainlinkAddress_`   | Chainlink LDO/ETH aggregator                                                               |
| `ldoToEthChainlinkHeartbeat_` | Staleness window (seconds) for the LDO/ETH 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 LDO/ETH heartbeat is checked directly. `getLatestPrice()` returns `stale = true` if the LDO/ETH feed satisfies `block.timestamp − updatedAt ≥ heartbeat`, if either leg's answer is `≤ 0`, if the LDO/ETH `updatedAt` is in the future (clamped to `block.timestamp`), or if the NAV reports the base asset (WETH) stale — all its feeds stale. The base leg's `updatedAt` comes from the NAV's selected feed. The reported `updatedAt` is the **older** of the two legs.

***

## Chains

Deployed on **Ethereum**.


---

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