> For the complete documentation index, see [llms.txt](https://docs.ionprotocol.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ionprotocol.io/devs/smart-contract-architecture/yieldoraclependle.md).

# YieldOraclePendle

[Git Source](https://github.com/Ion-Protocol/ion-protocol/blob/88cc595825f1dc2eb738fb93e172a3e8ab7a5c43/src/YieldOraclePendle.sol)

**Inherits:** IYieldOracle

Yield Oracle for Pendle Markets

### [State Variables](broken://pages/z2vvosliHS4i4KxULvQ1) <a href="#state-variables" id="state-variables"></a>

#### [MARKET](broken://pages/z2vvosliHS4i4KxULvQ1) <a href="#market" id="market"></a>

```
IPMarketV3 public immutable MARKET;
```

#### [TWAP\_DURATION](broken://pages/z2vvosliHS4i4KxULvQ1) <a href="#twap_duration" id="twap_duration"></a>

```
uint32 public immutable TWAP_DURATION;
```

#### [YIELD\_CEILING](broken://pages/z2vvosliHS4i4KxULvQ1) <a href="#yield_ceiling" id="yield_ceiling"></a>

```
uint256 public immutable YIELD_CEILING;
```

### [Functions](broken://pages/z2vvosliHS4i4KxULvQ1) <a href="#functions" id="functions"></a>

#### [constructor](broken://pages/z2vvosliHS4i4KxULvQ1) <a href="#constructor" id="constructor"></a>

Construct a new `YieldOraclePendle` instance

```
constructor(IPMarketV3 _market, uint32 _twapDuration, uint256 _yieldCeiling);
```

**Parameters**

| Name            | Type         | Description                           |
| --------------- | ------------ | ------------------------------------- |
| `_market`       | `IPMarketV3` | The Pendle Market to get the APY from |
| `_twapDuration` | `uint32`     | The duration of the TWAP              |
| `_yieldCeiling` | `uint256`    | The maximum APY                       |

#### [apys](broken://pages/z2vvosliHS4i4KxULvQ1) <a href="#apys" id="apys"></a>

Get the APY for a given collateral

```
function apys(uint256) external view override returns (uint32);
```

### [Errors](broken://pages/z2vvosliHS4i4KxULvQ1) <a href="#errors" id="errors"></a>

#### [InsufficientOracleSlots](broken://pages/z2vvosliHS4i4KxULvQ1) <a href="#insufficientoracleslots" id="insufficientoracleslots"></a>

```
error InsufficientOracleSlots(uint256 currentSlots);
```


---

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

```
GET https://docs.ionprotocol.io/devs/smart-contract-architecture/yieldoraclependle.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
