Configuration
PendleConfig
Initialization
Token Flow
Available Actions
SY Wrapper
wrap_sy
wrap_sy
Description: Wrap underlying into SY shares.Parameters:Mechanics:Effects:
amount_underlying(u128): Amount to wrap
- Deducts underlying from wallet
- Credits SY shares to wallet
unwrap_sy
unwrap_sy
Description: Unwrap SY shares to underlying.Parameters:Mechanics:
shares(u128): SY shares to unwrap
PT/YT Lifecycle
mint
mint
Description: Mint PT + YT from underlying (1:1 in shares).Parameters:Mechanics:Effects:
amount_underlying(u128): Amount of underlying to lock
- Deducts underlying from wallet
- Credits PT and YT to wallet
- Locks SY + principal in vault
- Sets YT paid_eray checkpoint
mint_from_sy
mint_from_sy
Description: Mint PT + YT from SY shares.Parameters:Mechanics:
Same as
sy_shares(u128): SY shares to lock
mint but uses pre-wrapped SY.claim
claim
Description: Claim accrued YT yield.Example:Mechanics:Effects:
- Credits accrued underlying to wallet
- Updates user YT checkpoint
redeem_yt
redeem_yt
Description: Burn YT shares and claim final yield.Parameters:Effects:
shares(u128): YT shares to redeem
- Burns YT shares
- Claims remaining accrued yield
- Does NOT return principal (PT is separate)
redeem_pt
redeem_pt
Description: Redeem PT for principal after maturity.Parameters:Checks:Effects:
shares(u128): PT shares to redeem
- Must be at or past
maturity_ts
- Burns PT shares
- Credits underlying principal to wallet
AMM Swaps (V2)
swap_exact_pt_for_sy
swap_exact_pt_for_sy
Description: Sell PT for SY (user has PT, wants SY).Parameters:Pricing:Effects:
amount_in_pt(u128): PT to sellmin_out_sy(u128, optional): Slippage protection
- Deducts PT from wallet
- Credits SY to wallet
- Updates AMM reserves and anchor
swap_exact_sy_for_pt
swap_exact_sy_for_pt
Description: Buy PT with SY (user has SY, wants PT).Parameters:Pricing:
amount_in_sy(u128): SY to spendmin_out_pt(u128, optional): Slippage protection
swap_exact_sy_for_yt
swap_exact_sy_for_yt
Description: Buy YT with SY via flash mint/sell PT.Parameters:Mechanics:
amount_in_sy(u128): SY to spendmin_out_yt(u128, optional): Slippage protection
- Flash mint PT+YT from SY
- Sell PT for SY in pool
- Net SY cost = input - rebate
- User receives YT
This is a flash operation; no actual PT/YT mint is recorded in vault state.
swap_exact_yt_for_sy
swap_exact_yt_for_sy
Description: Sell YT for SY via flash PT leg.Parameters:Mechanics:
amount_in_yt(u128): YT to sellmin_out_sy(u128, optional): Slippage protection
- Burn user YT
- Flash source PT (offset with burned YT)
- Sell PT for SY in pool
- User receives SY
LP Management
lp_add
lp_add
Description: Add liquidity to PT/SY pool.Parameters:Mechanics:Effects:
pt_in(u128): PT to depositsy_in(u128): SY to deposit
- Deducts PT and SY from wallet
- Credits LP shares to wallet
lp_remove
lp_remove
Description: Remove liquidity from pool.Parameters:Mechanics:
lp_shares(u128): LP shares to burn
Admin
set_rate
set_rate
Description: Update SY yield rate.Parameters:
yield_rate_ray_per_tick(u128)
set_maturity
set_maturity
Description: Update maturity timestamp.Parameters:
maturity_ts(u128)
set_anchor
set_anchor
Description: Manually set AMM anchor (admin calibration).Parameters:
anchor(f64)
set_roots
set_roots
Description: Update AMM curve parameters.Parameters:
scalar_root(f64)fee_root(f64)
V2 AMM Pricing
Logit Curve Formula
Interest Rate
Liquidity Fee
Anchor Preservation
The anchor updates each tick to preserve the last observed mid IR:View Methods
view_user
view_market
Usage Examples
Mint PT/YT and LP
PT Discount Arbitrage
YT Farming
Protocol-Specific Behavior
YT Yield Accrual
YT holders earn yield as SY exchange rate grows:PT Maturity Redemption
After maturity, PT redeems for pro-rata principal:AMM Anchor Dynamics
Anchor drifts to preserve mid IR as ttm decreases:Limitations
See Also
- Protocol Overview - Registry setup
- Source:
source/protocols/pendle/src/lib.rs - Pendle V2 Docs