Run Forge tests that walk the SY exchange rate up and back down to observe the PY index floor
Reproduce the 15-unit collateral overvaluation case for an unsafe oracle consumer
Model an 80 percent LTV lending integrator to see borrow-limit drift
Snapshot live Pendle market rates from a Jupyter notebook
Two toolchains: forge install plus forge build for Solidity, and uv sync plus uv run jupyter lab for the Python notebooks.
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.
Generated 2026-05-22 · Model: sonnet-4-6 · Verify against the repo before relying on details.