Lending / Yield·EVM
Pendle
Yield tokenization protocol. Splits yield-bearing tokens (stETH, sUSDe, eETH, etc.) into Principal Tokens (PT) and Yield Tokens (YT) so users can lock fixed yield, long yield, or LP into the AMM.
- 01fixed-rate yield (buy PT)
- 02leveraged yield speculation (buy YT)
- 03LSD / LRT / stablecoin yield markets
- 04boosted points farming via YT
- pnpm add @pendle/sdk-v2 ethers
| Variable | Scope | Description |
|---|---|---|
| NEXT_PUBLIC_PENDLE_ROUTER | Client | Pendle Router V4 address for the target chain (Ethereum mainnet: 0x888888888889758F76e7103c6CbF23ABbF58F946). |
| PENDLE_HOSTED_SDK_URL | Server | Hosted SDK / API base URL (default: https://api-v2.pendle.finance/core). Preferred over the on-chain SDK for routing. |
Integrate Pendle V2. Each yield asset has a Standardized Yield (SY) wrapper, a PT, a YT, and an AMM Market — all share an `expiry` timestamp. PREFERRED PATH: hit the Hosted SDK (`/v1/sdk/{chainId}/markets/{market}/swap`) which returns ready-to-broadcast calldata for `PendleRouterV4`. Direct contract calls: `IPAllActionV3.swapExactTokenForPt(receiver, market, minPtOut, guessPtOut, input, limit)` to buy fixed yield, `swapExactPtForToken` to exit, `swapExactTokenForYt` to long yield, `addLiquiditySingleToken` to LP. After expiry, redeem PT 1:1 for the underlying via `IPYieldToken.redeemPY(receiver)`. For positions and APYs use `@pendle/sdk-v2` `MarketEntity` / `PtEntity` / `YtEntity`.
- ⚑EVERY market has a hard `expiry` — after that timestamp PT redeems 1:1 for SY (fixed rate locks in), YT becomes worthless, and the AMM stops trading. Track expiry on every position.
- ⚑YT decays toward zero as expiry approaches even if the underlying yield is positive — buying YT late = bad theta.
- ⚑PT trades at a discount; the implied APY is `(1 - ptPrice) / ptPrice * (365d / timeToExpiry)`. Don't quote raw PT price as APY.
- ⚑Each market has its own SY which wraps a specific yield asset (e.g. SY-stETH, SY-sUSDe). Approvals must go to the `Router`, not the market.
- ⚑Slippage on illiquid markets near expiry can be huge — always pass a tight `minOut` and use the hosted SDK's `priceImpact` field.
- ⚑`guessPtOut` / `guessYtOut` are required for on-chain swaps and act as binary-search bounds; off-by-one returns a useless quote — use SDK helpers.
- ⚑Points / boosted-yield campaigns (e.g. Ethena, Eigen) often pay multipliers to YT holders — buying PT forfeits those points entirely.