explaingit

chenxu0602/pendle-pt-yt-mechanism-lab

Analysis updated 2026-06-24

0SolidityAudience · researcherComplexity · 5/5Setup · hard

TLDR

Foundry plus Jupyter research lab that runs executable experiments on Pendle's PT and YT yield tokenization, focusing on the monotonic PY index floor and how external lenders mis-value collateral when SY backing falls.

Mindmap

mindmap
  root((pendle-pt-yt-mechanism-lab))
    Inputs
      Mock SY exchange rates
      Pendle PT and YT contracts
      Live market snapshots
    Outputs
      Forge test results
      Mechanism and threat notes
      Collateral overvaluation cases
    Use Cases
      Study PY index floor behaviour
      Stress test integrator pricing
      Build a toy LTV lending example
    Tech Stack
      Solidity
      Foundry
      Python
      Jupyter
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Run Forge tests that walk the SY exchange rate up and back down to observe the PY index floor

USE CASE 2

Reproduce the 15-unit collateral overvaluation case for an unsafe oracle consumer

USE CASE 3

Model an 80 percent LTV lending integrator to see borrow-limit drift

USE CASE 4

Snapshot live Pendle market rates from a Jupyter notebook

What is it built with?

SolidityFoundryPythonJupyter

How does it compare?

chenxu0602/pendle-pt-yt-mechanism-lablifeofifa/dex-panther-amm-evmcapminal/capminal-contracts
Stars0024
LanguageSoliditySoliditySolidity
Last pushed2026-06-28
MaintenanceActive
Setup difficultyhardhardhard
Complexity5/54/54/5
Audienceresearcherdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · hard Time to first run · 1h+

Two toolchains: forge install plus forge build for Solidity, and uv sync plus uv run jupyter lab for the Python notebooks.

In plain English

This repository is a small research lab that studies how Pendle-style yield tokenization protocols behave through executable experiments rather than written analysis alone. Pendle is a well known DeFi protocol that splits a yield-bearing token into two pieces: a principal token, PT, which behaves a bit like a zero-coupon bond, and a yield token, YT, which collects the variable yield. The author is clear up front that this is not an audit and not a claim that Pendle has a live vulnerability. The point is to make some accounting assumptions explicit and testable, especially what happens at the boundaries between SY share accounting, PT and YT minting and redemption, the PT/SY market, and external oracles. The first experiment looks at the PY index floor. In Pendle the PY index is monotonic: once the SY exchange rate has risen, the stored PY index does not drop again even if the live SY exchange rate later falls. The lab walks the SY exchange rate through 1.00, then 1.10, then 0.95, and records what that does to pyIndexStored, PT redemption before and after expiry, YT interest, oracle rates for PT, YT and LP positions, and external collateral valuation. The README presents this asymmetry as a deliberate design choice, then asks who absorbs the loss when SY backing falls below the floored index. The second experiment connects that gap to an external integrator. A mock oracle consumer reads PT, YT, or LP style rates and treats them as current collateral value. With SY at 0.95 but the PY index still at 1.10, the unsafe consumer values 100 SY worth of position at 110 instead of the recoverable 95, a 15 unit overvaluation. A third experiment extends this into a toy lending protocol at 80 percent LTV: an unsafe borrow limit of 88 versus a safe limit of 76 lets a borrower pull 12 units more than the position can actually back. A further set of planned experiments looks at boundary behaviour of the PT/SY market itself, with large PT buys, large sells, extreme reserve ratios, short time to expiry, and low liquidity, asking how implied APY moves and where discontinuities or denial-of-service-like states appear. The code is a Foundry project under src and test, with mocks, test fixtures, and Forge test files for each experiment, plus markdown notes on mechanism, threat model, attack patterns, and limitations, and a Jupyter notebook that snapshots live Pendle market rates. Setup is forge install and forge build for the Solidity side, and uv sync plus uv run jupyter lab for the Python side.

Copy-paste prompts

Prompt 1
Run the Forge tests in pendle-pt-yt-mechanism-lab and explain what each PY index floor case proves
Prompt 2
Walk through the mock oracle consumer and show where the 15-unit overvaluation comes from
Prompt 3
Add a new Forge test that takes the SY exchange rate down to 0.80 and prints the PT and YT oracle rates
Prompt 4
Open the Jupyter notebook and describe how it pulls live Pendle market data

Frequently asked questions

What is pendle-pt-yt-mechanism-lab?

Foundry plus Jupyter research lab that runs executable experiments on Pendle's PT and YT yield tokenization, focusing on the monotonic PY index floor and how external lenders mis-value collateral when SY backing falls.

What language is pendle-pt-yt-mechanism-lab written in?

Mainly Solidity. The stack also includes Solidity, Foundry, Python.

How hard is pendle-pt-yt-mechanism-lab to set up?

Setup difficulty is rated hard, with roughly 1h+ to a first successful run.

Who is pendle-pt-yt-mechanism-lab for?

Mainly researcher.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.