High Level Architecture
Functions of Contracts
StandardizedY Yield (SY)
SY is a wrapped version of the interest-bearing token (ibToken) that can also be staked into other protocols to earn even more interest. In the Pendle system, SY is used instead of the ibToken for all operations, including trading on PendleMarket or minting Principal Token & Yield Token.
The following are true:
|SY||ibToken (1 SY = 1 ib Token)||Asset (ibToken appreciates against)|
|SY GLP||NIL, GLP doesn't appreciate|
|SY rETH-WETH_BalancerLP Aura||Liquidity of rETH-WETH pool|
|SY PENDLE-ETH_Camelot||Liquidity of PENDLE-ETH pool|
SY wstETH was mistakenly named SY stETH on deployment.
Principal Token (PT)
PT is a token that represents the right to redeem for the principal amount at maturity, and is tradable on PendleMarket. While PT represents a claim to a fixed amount of assets, SY wraps an ibToken that increases in value, meaning that
1 PT != 1 SY is always true (except in exceptional cases). Instead,
1 PT = 1 Asset, where "Asset" refers to what SY's ibToken is denominated in.
The following are true:
|PT||Asset (1 PT = 1 Asset)|
|PT rETH-WETH_BalancerLP Aura||1 liquidity of rETH-WETH pool|
|PT PENDLE-ETH_Camelot||1 liquidity of PENDLE-ETH pool|
1 PT = X SY, where satisfies the condition that
X SY = 1 Asset.
Yield Token (YT)
YT is a token that represents the rights to redeem the interest generated by the SY until it reaches maturity. It's important to note that the value of YT is zero once it reaches maturity. The yield can be redeemed at any time and it can be traded on PendleMarket using special methods. ibToken generates yield in two forms, which Pendle denotes as:
- Interest (compounding yield): The yield is denominated in the same unit as the ibToken. For example, as time goes on,
wstETHbecomes worth more in terms of
rETH-WETH LPbecomes worth more in terms of
- Rewards (yield that does not compound): The yield is given out in a different unit than the ibToken. For example,
rETH-WETH LPgenerates both
The following are true:
|YT rETH-WETH_BalancerLP Aura||liquidity of rETH-WETH pool||AURA, BAL|
|YT PENDLE-ETH_Camelot||liquidity of PENDLE-ETH pool||GRAIL, PENDLE|
PT and YT are minted and redeemed using the YT contract. To mint PT and YT, SY is utilized.
1 SY = X PT + X YT is created where
1 SY = X Asset. Prior to maturity, both PT and YT must be provided to redeem the underlying SY. After maturity, only PT is required for redemption.
PendleMarket (or simply Market) is a contract that enables users to trade between PT and its corresponding SY, while still allowing liquidity provision as usual. Swap fees are directly compounded into the LP. Each Market also has its own built-in geometric-mean oracle, similar to UniswapV3.
Currently, there is no market to trade YT, but it is always tradable by the following algorithms:
SY ➝ YT= flashswap SY, mint PT & YT, payback PT, send YT to users.
YT ➝ SY= flashswap PT, use PT & YT, redeem SY, pay back, send excess to users.
PendleGauge is a contract that distributes PENDLE and other rewards generated by SY to Market LP holders. Each Gauge is directly embedded into the corresponding Market, so there is no need to stake LP to receive these rewards. It's important to note that rewards can be redeemed at any time.
The rewards are not distributed based on the amount of LP holdings, but rather on the activeBalance. The activeBalance is calculated as follows:
activeBalance = min(userLpBalance, userBoostedBalance);
userBoostedBalance = 0.4 * userLpBalance + 0.6 * totalLpSupply * userVePendleBalance/ totalVePendleSupply;
The VotingController is a contract that allows users to utilize their vePENDLE to vote for markets. This voting process determines the amount of PENDLE each market will receive in the following epoch. Each epoch lasts for one week, beginning at 0:00 UTC on Thursday and ending at the same time on the following Thursday. During the epoch, users can change their vote as desired, but the vote will only become finalized when the epoch ends.
The GaugeController is a contract that receives the voting results from the VotingController and distributes PENDLE to the Gauges accordingly. The PENDLE for the epoch is not distributed all at once, but instead is released every second throughout the epoch.
The vePENDLE contract allows users to lock their PENDLE in order to receive vePENDLE. Each user's position is represented by a pair of values:
(amount, expiry). After the
expiry, the user can withdraw their
amount of PENDLE from the contract. The balance of a user's vePENDLE will decay weekly until it becomes zero at expiry.
PendleRouter is a contract that aggregates callers' actions with various different SYs, PTs, YTs, and Markets. It is not owned, immutable, and does not have any special permissions or whitelists on any contracts it interacts with. For this reason, any third-party protocols can freely embed the router's logic into their code for better gas efficiency.
The Router is also a static Diamond-Proxy (ERC2535) contract without any upgrade functions as described in this tweet. A summary for ERC2535 is that there can be multiple implementation contracts for a single proxy, with each function (or set of functions) delegatecall to its own implementation.
To interact easily with the PendleRouter, please refer to: https://github.com/pendle-finance/pendle-core-v2-public/blob/main/contracts/interfaces/IPAllAction.sol
For a list of all the functions that can be called on the Router, users can use the
IPAllAction ABI and call it on the Router address, which will resolve the call accordingly.
You can read more about the PendleRouter here.