-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathllms-full.txt
More file actions
10933 lines (7584 loc) · 487 KB
/
llms-full.txt
File metadata and controls
10933 lines (7584 loc) · 487 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# Pendle Developer Documentation — Full Reference
> This file contains all Pendle V2 and Boros documentation concatenated for AI consumption.
> Sources: https://docs.pendle.finance/pendle-v2 | https://docs.pendle.finance/pendle-v2-dev | https://docs.pendle.finance/boros-docs | https://docs.pendle.finance/boros-dev
> Generated: 2026-04-28
---
# Part 1: Pendle V2 — Yield Tokenization Protocol
# Introduction to Pendle
<iframe height="400" width="100%" src="https://www.youtube.com/embed/SyjPDpjU6-s" title="Chapter 1: Introduction to Pendle" frameBorder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowFullScreen></iframe>
How much will you earn from lending 1,000 USDC on Aave? 1%? 3%? 5%?
Truth is, you can't say for sure. Yield fluctuates just like token prices. It tends to go up in bull markets, and go down in bear markets, and there are further micro-factors that cause fluctuations within those general market trends.
<figure>
<img src="/pendle-docs/imgs/historical_yield.jpg" alt="Compound historical yield charts" />
<figcaption>Compound historical yield charts from <a href="https://www.theblockcrypto.com/data/decentralized-finance/cryptocurrency-lending/compound-lending-rates">The Block Crypto</a></figcaption>
</figure>
With Pendle, you can always maximise your yield: increase your yield exposure in bull markets and hedge against yield downturns during bear markets.
## What does Pendle do?
We give users the reins to their yield.
[Pendle](https://pendle.finance/) is a permissionless yield-trading protocol where users can execute various yield-management strategies. It acts as a second-order derivative layer, building upon and integrating with existing core yield-generating primitives in the DeFi ecosystem — Liquid Staking Tokens (LSTs), Liquid Restaking Tokens (LRTs), stablecoins, RWAs, and more.
Pendle's smart contract architecture is **permissionless** — any user or protocol can create a new yield-trading market on-chain. While on-chain creation is open to all, the visibility of these markets on the official [Pendle UI](https://app.pendle.finance) is curated through a review process to ensure quality and safety. Community members can also leverage the [Community Listing Portal](https://listing.pendle.finance) for a streamlined listing process.
There are 2 main parts to fully understand Pendle:
1. Yield Tokenization
First, Pendle wrap **yield-bearing tokens** into **SY**(standardized yield tokens), which is a wrapped version of the underlying yield-bearing token that is compatible with the Pendle AMM (e.g. stETH → SY-stETH).
SY is then split into its principal and yield components, **PT** (principal token) and **YT** (yield token) respectively, this process is termed as yield-tokenization, where the yield is tokenized into a separate token.
2. Pendle AMM
Both **PT** and **YT** can be traded via Pendle's **AMM**. Even though this is the core engine of Pendle, understanding of the AMM is not required to trade PT and YT.
As a yield derivative protocol, we are bringing the TradFi interest derivative market ([worth over $400T in notional value](https://www.bis.org/publ/otc_hy2111/intgraphs/graphA3.htm)) into DeFi, making it accessible to all.
By creating a yield market in DeFi, Pendle unlocks the full potential of yield, enabling users to execute advanced yield strategies, such as:
- Fixed yield (e.g. earn fixed yield on stETH)
- Long yield (e.g. bet on stETH yield going up by purchasing more yield)
- Earn more yield without additional risks (e.g. provide liquidity with your stETH)
- A mix of any of the above strategies, learn more on how to execute these strategies at our [Pendle Academy](/pendle-academy/Introduction)
---
# Overview
## Stay Connected
**Important:** Stay up to date with the latest developer updates and get support from our team:
- **Telegram**: Join [t.me/pendledevelopers](https://t.me/pendledevelopers) for all development updates, API changes, and important announcements
- **Telegram bot**: We have a Telegram bot for developers to ask about the API at [t.me/peepo_the_engineer_bot](https://t.me/peepo_the_engineer_bot)
- **Discord**: Get technical support on our [Discord Developer Channel](https://pendle.finance/discord) with responses within 24 hours
## For AI users
- As many of us increasingly rely on AI tools to read and understand project documentation, we’ve added a new folder to the repository: [docs/Developers](https://github.com/pendle-finance/documentation/tree/master/docs/Developers). It contains a list of questions and answers about our system and our API, useful for AI to better understand our system and provide more accurate answers when you query them. Our in-house AI is also using these knowledge bases!
- Follow the instructions in [README.md](https://github.com/pendle-finance/documentation/tree/master?tab=readme-ov-file#ai-knowledge-bases) to index the knowledge bases for your AI.
## What do you want to do?
| Goal | Start here |
|---|---|
| **Build a trading bot or data aggregator** | [Quickstart](./Quickstart.md) → [Backend API Overview](./Backend/ApiOverview.mdx) |
| **Integrate PT/YT into your protocol (on-chain)** | [Router Overview](./Contracts/PendleRouter/PendleRouterOverview.md) → [Integration Guide](./Contracts/PendleRouter/ContractIntegrationGuide.md) |
| **Price PT or LP (oracle / collateral)** | [Oracle Overview](./Oracles/OracleOverview.md) → [How to Integrate](./Oracles/HowToIntegratePtAndLpOracle.md) |
| **Analyze yields & APY composition** | [Market Historical Data API](./Backend/ApiOverview.mdx#market-data-endpoints) |
| **Work with Limit Orders** | [Limit Order Overview](./LimitOrder/Overview.md) |
| **Track sPENDLE rewards** | [sPENDLE API](./Backend/ApiOverview.mdx#spendle-api-endpoints) |
## Core Documentation
- [High Level Architecture](./HighLevelArchitecture.md)
- [StandardizedYield (SY)](./Contracts/StandardizedYield/StandardizedYield.md)
- [Common Questions](./FAQ.md)
## Integration Guides
### On-chain Integration
- **Router**: [Documentation](./Contracts/PendleRouter/PendleRouterOverview.md) | [Integration Guide](./Contracts/PendleRouter/ContractIntegrationGuide.md)
- **Oracles**: [Overview](./Oracles/OracleOverview.md) | [Integration Guide](./Oracles/HowToIntegratePtAndLpOracle.md) | [PT as Collateral](./Oracles/PTAsCollateral.md) | [LP as Collateral](./Oracles/LPAsCollateral.md)
- [Example Repository](https://github.com/pendle-finance/pendle-examples-public) - Various contract interaction examples
### Off-chain Integration
- [Backend API overview](./Backend/ApiOverview.mdx)
- [Market Historical Data & APY Breakdown](./Backend/ApiOverview.mdx#market-data-endpoints) - Time-series data with detailed APY and fee breakdowns
- [RouterStatic](./Backend/RouterStatic.md) - Extensively tested contract for off-chain calculations. Not audited; should not be used for on-chain fund-related operations.
- [sPENDLE API](./Backend/ApiOverview.mdx#spendle-api-endpoints) - Staking stats and per-user reward data
- [Socket.IO Real-time Feeds](./Backend/SocketIO.mdx) - Pushed real-time feeds
### Limit Orders
- [Contract](./LimitOrder/LimitOrderContract.md) | [Create](./LimitOrder/CreateALimitOrder.md) | [Cancel](./LimitOrder/CancelOrders.mdx) | [Fill](./LimitOrder/FillALimitOrder.md)
## Resources
- [Deployed Contract Addresses](./Deployments.md) — Core contracts and market addresses by chain
- [Core Contract Repository](https://github.com/pendle-finance/pendle-core-v2-public)
- [SY Contract Repository](https://github.com/pendle-finance/Pendle-SY-Public)
- [Example Repository](https://github.com/pendle-finance/pendle-examples-public)
- [Whitepapers](https://github.com/pendle-finance/pendle-v2-resources/tree/main/whitepapers)
---
# Quickstart
Pendle V2 is a yield-trading protocol that lets users split yield-bearing assets into Principal Tokens (PT) and Yield Tokens (YT), trade them on AMM markets, and provide liquidity — all on-chain. The fastest way to start is the off-chain Backend API — no wallet required.
## Prerequisites
- `curl` or any HTTP client (browser, `fetch`, `axios`, etc.)
## Step 1 — Browse available markets
**Endpoint:** `GET https://api-v2.pendle.finance/core/v2/markets/all`
Returns all Pendle markets across every supported chain. Supports `skip` and `limit` for pagination (default `limit` is 10, maximum is 100).
```bash
curl "https://api-v2.pendle.finance/core/v2/markets/all?limit=10&skip=0"
```
```js
const res = await fetch(
"https://api-v2.pendle.finance/core/v2/markets/all?limit=10&skip=0"
);
const { markets } = await res.json();
console.log(markets);
```
Key fields in each market object:
| Field | Description |
|-------|-------------|
| `chainId` | Chain the market is deployed on (e.g., `1` for Ethereum, `42161` for Arbitrum) |
| `address` | Market contract address |
| `expiry` | Unix timestamp when the market matures |
| `impliedApy` | Current implied fixed APY of the market |
| `pt.price.usd` | Current PT price in USD |
## Step 2 — Get market data
**Endpoint:** `GET https://api-v2.pendle.finance/core/v2/markets/all`
Use the `address` field from Step 1 to identify markets of interest. For filtering and additional query options (e.g., by chain, by asset category), see the [full API reference](./Backend/ApiOverview.mdx).
The example below fetches all markets on Arbitrum (chainId `42161`) and filters client-side for a known market address:
```bash
curl "https://api-v2.pendle.finance/core/v2/markets/all?limit=100&skip=0" \
| jq '[.markets[] | select(.chainId == 42161 and .address == "{MARKET_ADDRESS}")]'
```
Replace `{MARKET_ADDRESS}` with the address of the market you want to inspect (obtained from Step 1).
## Step 3 — Get sPENDLE staking data (optional)
**Endpoint:** `GET https://api-v2.pendle.finance/core/v1/spendle/data`
```bash
curl "https://api-v2.pendle.finance/core/v1/spendle/data"
```
Returns aggregate sPENDLE staking statistics including total PENDLE staked, historical APRs, per-epoch revenues, and airdrop breakdowns for the last 12 epochs.
## Next steps
:::tip
- **Full API reference** — endpoint details, query parameters, response schemas: [Backend API Overview](./Backend/ApiOverview.mdx)
- **On-chain Router** (swaps, add/remove liquidity, mint/redeem): [Pendle Router Overview](./Contracts/PendleRouter/PendleRouterOverview.md)
- **Deployed contract addresses** — all chains and environments: [Deployments](./Deployments.md)
- **Developer support** — questions, announcements, deprecation notices: [t.me/pendledevelopers](https://t.me/pendledevelopers)
:::
---
# High Level Architecture

## Functions of Contracts
### PendleRouter
PendleRouter is a contract that aggregates callers' actions with various different SYs, PTs, YTs, and Markets. It does not have any special permissions or whitelists on any contracts it interacts with. Therefore, any third-party protocols can freely embed the router's logic into their code for better gas efficiency.
You can read more about the PendleRouter [here](./Contracts/PendleRouter/PendleRouterOverview.md).
### Standardized 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 | `GLP` | NIL, GLP doesn't appreciate |
| SY wstETH | `wstETH` | stETH |
| SY ETHx | `ETHx` | ETH locked in ETHx contract* |
| SY aUSDC | Not 1-1 to aUSDC since it's rebasing | aUSDC |
| SY rETH-WETH_BalancerLP Aura | `rETH-WETH LP` of Balancer staked into the corresponding Aura's gauge | Liquidity of rETH-WETH pool |
For `*`: ETH locked in ETHx is different from normal ETH due to withdrawal from ETHx has delay. Under normal circumstances it's also normal for ETHx to trade at a market price lower than the amount of ETH it can be withdrawn to.
### 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 usually 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 GLP | GLP |
| PT wstETH | stETH |
| PT ETHx | ETH locked in ETHx contract |
| PT aUSDC | aUSDC |
At redemption, `1 PT = X SY`, where `X` satisfies the condition that `X SY = 1 Asset`. For example, assuming `1 wstETH = 1.2 stETH` on 1/1/2024, `1 PT-wstETH-01JAN2024` will be redeemable to `0.8928 wstETH` at maturity.
### 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 asset of ibToken. For example, as time goes on, `wstETH` becomes worth more in terms of `stETH`, and `SY-aUSDC` becomes worth more in terms of `USDC`.
- **Rewards** (yield that does not compound): The yield is given out in a different unit than the ibToken. For example, GLP generates ETH.
The following are true:
| YT | Interest | Rewards |
| :--------------------------: | :-------------------------: | :-------: |
| YT GLP | - | ETH |
| YT wstETH | stETH | - |
| YT ETHx | ETH locked in ETHx contract | - |
| YT aUSDC | aUSDC | - |
| YT rETH-WETH_BalancerLP Aura | liquidity of rETH-WETH pool | AURA, BAL |
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
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.
:::info YT Fungibility
All Yield Tokens (YT) of the same underlying asset are **completely fungible**. It is not programmatically possible to distinguish between YT acquired through minting, swapping, or LPing. User balances are queried on the SY contract, which treats all YT of a given type as identical. Any attempt to classify users or distribute rewards based on how they acquired their YT is not feasible on-chain.
:::
## Contract Factories
Pendle uses a factory pattern for deploying new markets, PTs, and YTs. This standardizes the creation process and provides a single source of truth for identifying valid protocol components.
### Factory Versions
| Version | Timeframe | Key Changes |
|---------|-----------|-------------|
| Pre-V3 | Early deployments | Initial factory implementations |
| **V3** | Late 2023 | Standard for all new deployments across all chains |
| **V4/V5** | Mid-2024 | **Removed `Permit` (EIP-2612) from all new PT, YT, and LP tokens** to mitigate phishing attacks |
| **V6** | Late 2025 | Current recommended version for all new market deployments |
:::caution Security Note: Permit Removal
Starting with V4/V5 factories, the `Permit` function (EIP-2612) was **completely removed** from all newly created PT, YT, and LP tokens. The `Permit` function, which allows gasless approvals via off-chain signatures, was identified as a significant phishing attack vector. Tokens created by V4+ factories no longer support `permit()`.
:::
:::warning
Always use the **latest factory version** for new market deployments. Using deprecated factories can lead to issues including improper contract verification.
:::
### Immutability vs. Upgradability
- **Market contracts are immutable** once deployed. Their fundamental parameters (including the concentrated yield range) cannot be changed. If a pool goes "out of range," a brand new market must be deployed and LPs must manually migrate.
- **SY contracts are upgradable proxies** (for newer deployments). This allows adding support for new deposit assets or adjusting mechanisms without requiring a full market migration. When developing an SY externally, it is recommended to deploy it as an upgradeable contract using Pendle's proxy admin and transfer ownership to Pendle's pause controller.
## Cross-Chain Principal Tokens
Cross-chain PTs allow Principal Tokens to be bridged and used on networks where Pendle may not have a full deployment, while concentrating deep trading liquidity on mainnet.
- **Standard:** Uses [LayerZero's Omnichain Fungible Token (OFT)](https://docs.layerzero.network/v2/home/token-standards/oft-standard) standard.
- **Mechanism:** Users can "zap in" to a PT position on a mainnet pool, then bridge the PT to a destination chain (e.g., Avalanche, HyperEVM) for use as collateral in local money markets.
- **Liquidation:** The system handles liquidations without relying on DEX liquidity on the destination chain — the underlying asset is converted and bridged back from mainnet.
- **Initial Pilot:** sUSDe/USDe PTs, with the goal of collateral support on money markets like Morpho.
---
# Glossary
#### Yield-Bearing Token
Yield-bearing Token is an umbrella term that refers to any token that generates yield. Examples include stETH, GLP, gDAI or even liquidity tokens such as Aura rETH-WETH.
#### Accounting Asset
The asset yield bearing token appreciates in value against. It appears in brackets at the end of each market name.
#### SY = Standardized Yield
SY is a token standard written by the Pendle team that wraps any yield-bearing token and provides a standardized interface for interacting with any yield-bearing token’s yield generating mechanism. SY is a purely technical component, the user does not interact directly with SY.
#### PT = Principal Token
PT entitles you to the principal of the underlying yield-bearing token, redeemable after maturity. If you own 1 PT-wstETH (stETH) with 1 year maturity, you will be able to redeem 1 stETH after 1 year.
PT is tradeable anytime, even before maturity.
#### YT = Yield Token
YT entitles you to all the yield generated by the underlying yield-bearing token in real-time, and the yield accrued can be manually claimed *at any time* from the Pendle Dashboard.
If you own 1 YT-wstETH (stETH) and stETH has an average yield of 5% through the year, you will have accrued 0.05 stETH by the end of the year.
YT is tradeable anytime, even before maturity.
#### Maturity
Maturity is the date at which PT becomes fully redeemable for the underlying asset and YT stops accruing yield. One asset can have multiple maturity dates, with an independent market for each maturity date. As such, the implied yield of an asset can also differ across different maturities.
#### Underlying APY
Underlying APY represents the 7-day moving average yield rate of the underlying asset. This approach allows a more accurate indication of the underlying yield over a period of time, which can help traders to better estimate the Future Average Underlying APY.
#### Implied APY
Implied APY is the market consensus of the future APY of an asset. This value is calculated based on the ratio of the price of YT to PT and the formula is shown below.
When used in conjunction with the Underlying APY, Implied APY can be used to establish the relative valuation of an asset such as YT and PT at their current price, and help traders determine their trading strategies.
The value of Implied Yield is numerically equivalent to the to Fixed Yield APY.
$$
\text{Implied APY} = \left[\left(1 + \frac{\text{YT Price}}{\text{PT Price}}\right)^{\frac{365}{\text{Days to expiry}}}\right] - 1
$$
#### Fixed APY
Fixed APY is the guaranteed yield you will receive by holding PT. This value is numerically equivalent to the Implied APY.
#### Long Yield APY
Long Yield APY is the approximated return (annualized) from buying YT at the current price, assuming underlying APY remains constant at its current value.
This value can be negative, meaning that the total value of all the future yield based on the Underlying APY will be less than the cost of buying YT.
#### Exchange Rate
Refers to the exchange rate between the interest-bearing token and its accounting asset
#### LP = Liquidity Provider Token
LP tokens represent a user's share of a Pendle liquidity pool, which is composed of PT and SY. LPs earn returns from multiple sources simultaneously: swap fees, PENDLE incentives, underlying yield from the SY portion, and an implicit fixed yield from the PT portion.
#### LP Wrapper
An ERC-20 token that wraps the underlying LP position on a 1:1 basis, enabling LP tokens to be used as collateral in external money markets while still accruing PENDLE rewards and off-chain points. The wrapper ensures that the original depositor continues to receive all associated rewards.
#### Watermark Rate
The highest recorded exchange rate between the IBT and its accounting asset. When the exchange rate falls below this level, PT will redeem below its actual value at maturity, and YT will stop earning yield.
---
# SY

SY is a token standard that implements a standardized API for wrapped yield-bearing tokens within smart contracts. All yield-bearing tokens can be wrapped into SY, giving them a common interface that can be built upon. SY opens up Pendle’s yield-tokenization mechanism to all yield-bearing tokens in DeFi, creating a permissionless ecosystem.
> For example, stETH, cDAI and yvUSDC can be wrapped into SY-stETH, SY-cDAI and SY-yvUSDC, standardizing their yield-generating mechanics to be supported on Pendle.
As all SYs have the same mechanism, Pendle interacts with SY as the main interface to all yield-bearing tokens. PT and YT are minted from SY and Pendle AMM pools trade PT against SY.
While this might seem daunting, Pendle automatically converts yield-bearing tokens into SY and vice versa. This process happens automatically behind the scenes, making users feel as if they’re interacting directly with their yield-bearing tokens instead of having to manually deal with SY ↔ yield-bearing token conversion.
### Key Characteristics
- **1:1 Wrapping (Typically):** In most cases, 1 SY token represents 1 unit of the underlying yield-bearing asset. For instance, 1 SY-rsETH is equivalent to 1 rsETH. However, there are exceptions (e.g., mPendle, aUSDC) where the ratio is not strictly 1:1. Integrators should verify the specific wrapping mechanism for each SY token.
- **No Maturity Date:** Unlike PT and YT, the SY token does not have an expiry date. It acts as a perpetual wrapper for the underlying asset as long as it is held within the Pendle ecosystem.
- **Source of Yield and Points:** The SY contract holds the deposited underlying asset and is the direct recipient of all accrued yield and points from that asset. All rewards distributed within a Pendle market originate from the SY tokens held within it.
- **Upgradability:** Most newer SY contracts are deployed as upgradable proxies. This allows for future enhancements — such as adding support for new deposit assets or adjusting mechanisms — without requiring a full market migration.
While this standard benefits Pendle, our vision for SY extends beyond just our own protocol. SY aims to create unprecedented composability across all of DeFi, enabling developers to seamlessly build on top of existing contracts without the need for manual integration.
## SY Converter

The SY Converter can be found in the trade form for any of the associated market. For example *SY-sUSDe* wrapper/unwrapper is accessible from sUSDe market of any maturity.
**To use the SY Converter:**

Step 1: Select between “Unwrap” or “Wrap” mode
Step 2: Select the token to wrap from or unwrap to
Step 3: Check the rate and output.
Step 4: Confirm and approve the transaction.
---
# PT
<iframe width="860" height="615" src="https://www.youtube.com/embed/kOErP_ZUncs" title="Chapter 4: What is Principle Token (PT)" frameBorder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowFullScreen></iframe>
Principal Token (PT) represents the principal portion of an underlying yield-bearing asset — essentially a zero-coupon bond on the underlying asset. Upon maturity, PT can be redeemed at 1:1 for the accounting asset, which appears in brackets at the end of each PT name. This is the base, principal asset deployed in the underlying protocol such as Lido, Renzo, and Aave (e.g. stETH in stETH, ETH in ezETH, USDC in aUSDC).

Since the collective value of its yield component has been separated, PT can be acquired at a discount relative to its accounting asset. Assuming no swaps, the value of PT will approach and ultimately match the value of accounting asset on maturity when redemption is enabled.
This appreciation in value is what establishes its Fixed Yield APY.
:::info Key Properties
- **No Variable Yield or Points:** PT holders forgo all variable yield and points generated by the underlying asset — these are redirected entirely to YT holders.
- **Use as Collateral:** PTs are increasingly used as collateral in money markets (e.g., Morpho, Silo, Euler) due to their predictable value at maturity, which minimizes liquidation risk from market price volatility. See [PT as Collateral](../../Developers/Oracles/PTAsCollateral) for integration details.
:::
# Redemption Value
In general, yield bearing assets can be broadly categorized as:
1. Rebasing assets - tokens that increase in count/number overtime as yield is accrued
*Examples: stETH, aUSDC*
2. Interest-bearing assets - tokens that increase in value overtime as yield is accrued
*Examples: ezETH, wstETH*

In the case of reward-bearing assets, it’s particularly important to note that PT is redeemable 1:1 for the accounting asset, *NOT* the **underlying asset.
For example, the value of Renzo ezETH increases overtime relative to ETH as staking and restaking rewards are accrued. For every 1 PT-ezETH you own, you’ll be able to redeem 1 ETH worth of ezETH upon maturity, *NOT* 1 ezETH which has a higher value**.**
You can refer to the asset in brackets in the market name to identify the accounting asset (e.g. PT-ezETH (ETH) means 1 PT redeems to 1 ETH worth of ezETH).
You can also double-check the redemption value of PT on [Pendle App](https://app.pendle.finance/trade/markets)'s individual asset pages.
# How to Redeem PT
To redeem your PT on maturity:
1. Visit [Pendle Markets](https://app.pendle.finance/trade/markets) and navigate to dashboard
2. Select the position you want to redeem.
3. Select an output asset. Pendle will automatically perform Redemption > Swap (if needed) for you
---
# YT
<iframe width="860" height="615" src="https://www.youtube.com/embed/RHuqNScvrnw" title="Chapter 5: What is Yield Token (YT)" frameBorder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowFullScreen></iframe>
Yield Token (YT) represents the yield component of an underlying yield-bearing asset.
By holding YT, yield from the underlying asset will be streamed to the users, up until maturity. This rate of yield production is represented as “[Underlying APY](https://docs.pendle.finance/ProtocolMechanics/Glossary)” in the Pendle app.
For example, buying 10 YT-wstETH (stETH) and holding them for 5 days lets you receive all of the yield equivalent to a 10 stETH within the same period of time.
### Leveraged Yield Exposure
Because YTs are purchased for a fraction of the underlying asset's price, they offer **leveraged exposure** to its yield. A small change in the underlying APY can result in a significant percentage change in the YT's return. This makes YT a powerful instrument for yield speculation and points farming.
### Value Decay
The value of YT trends towards $0 as it approaches maturity (*ceteris paribus*), becoming $0 upon maturity. If the implied yield remains constant, the YT's price decreases linearly with the time remaining — a YT with 15 days left to maturity will be worth roughly half the price it was when it had 30 days left. Users profit when the total yield collected up to that point ends up being higher than the cost of YT acquisition.
You can think of [Implied APY](https://docs.pendle.finance/ProtocolMechanics/Glossary) as the “rate” at which YT is priced by the market. If the average Underlying APY ends up being higher than the “rate” or Implied APY that you paid for, you will profit.
As such, buying YT can be treated as “longing the yield” of an asset.
### Points Farming
YTs are a popular instrument for farming points from airdrop campaigns, as they capture all points from the underlying asset, often with significant leverage. Since 1 YT earns the same points as 1 unit of the underlying asset, and YTs cost only a fraction of the underlying, users can achieve multiplied points exposure.
You can learn more about yield trading on Pendle [here](https://app.pendle.finance/trade/education/learn).
Note: YT yields are distributed as SY, which can be unwrapped back into the underlying asset using [SY Unwrapper](https://docs.pendle.finance/ProtocolMechanics/YieldTokenization/SY).
# Claiming YT Yield

You can claim any earned YT (and LP) yield and rewards from the [Pendle Dashboard](https://app.pendle.finance/trade/dashboard/overview?timeframe=allTime&inUsd=false) anytime, even before maturity.
Since YT = $0 upon maturity, no further action (aside from claiming yield) is required.
---
# Minting
<iframe width="860" height="615" src="https://www.youtube.com/embed/oDZ3JAkcFeM" title="Chapter 3: What is Yield Tokenization" frameBorder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowFullScreen></iframe>
Users receive yield-bearing assets when they deposit funds into a yield-source. For example, DAI staked in Compound is represented as *cDAI*. ETH staked in Lido is represented as *stETH*.
*cDAI* and *stETH* are examples of **yield-bearing assets**.
In Pendle, yield-bearing assets are split into two components: Principal Tokens (**PT**) and Yield Tokens (**YT**). PT represents the principal of the underlying yield-bearing token, while YT represents entitlement to all the yield of the asset. YT and PT can be traded on Pendle.

What Pendle does is similar to bond stripping in traditional finance, where the principal and interest of bonds are separated. In this, PTs are equivalent to [zero-coupon bonds](https://www.investopedia.com/terms/z/zero-couponbond.asp), while YTs are the detached [coupon](https://www.investopedia.com/terms/c/coupon.asp) payments.
Users can mint PT and YT by depositing the yield-bearing asset (e.g. stETH) into Pendle. Base assets (e.g. ETH) will be auto-converted into the yield-bearing asset before PT and YT are minted.
e.g. ETH → stETH → SY-stETH → PT-stETH + YT-stETH. This function can be found in the Pendle App after selecting one of the assets.

---
# AMM
Pendle’s V2 AMM is designed specifically for trading yield, and takes advantage of the behaviors of PT and YT. Unlike standard AMMs that concentrate liquidity within a **price range**, Pendle’s AMM concentrates liquidity within a pre-configured **yield range** (or Implied APY range). This makes trading within the expected yield boundaries highly efficient, with lower slippage for larger trades.
The AMM model was adapted from Notional Finance’s AMM. The AMM curve changes to account for yield accrued over time and narrows PT’s price range as it approaches maturity (**dynamic curve tightening**). By concentrating liquidity into a narrow, meaningful range, the capital efficiency to trade yield is increased as PT approaches maturity. This automatic tightening reflects the decreasing uncertainty of future yield and is a key factor in minimizing impermanent loss.
Furthermore, we managed to create a pseudo-AMM that allows us to both facilitate PT and YT swaps using just a single pool of liquidity. With a PT/SY pool, PT can be directly traded with SY, while YT trades are also possible via flash swaps.
### Fee Calculation
Unlike traditional AMMs that charge fees on the swap principal, Pendle’s AMM fee is calculated relative to the **yield** being traded. This means the fee is influenced by the time to maturity — a trade made one year before maturity will incur a significantly higher fee than the same size trade made one month before maturity. See [Fees](../Mechanisms/Fees) for the full formula.
## Liquidity Providers (LP)
<iframe width="860" height="615" src="https://www.youtube.com/embed/AWceGmkv2pc" title="Chapter 6: Liquidity Provision on Pendle" frameBorder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowFullScreen></iframe>
Liquidity on Pendle V2 comprises of PT/SY (where SY is simply a wrapped version of the underlying yield bearing asset). This means that LPs earn yields from:
1. PT fixed yield
2. Underlying yield (SY yield)
3. Swap fees (from PT and YT swaps)
4. $PENDLE incentives
## Swaps
Both PT and YT are tradeable anytime on Pendle through a single pool of liquidity. This is made possible by implementing a pseudo-AMM with flash swaps.
Liquidity pools in Pendle V2 are set up as PT/SY, e.g. PT-aUSDC / SY-aUSDC. Swapping PT is a straightforward process of swapping between the 2 assets in the pool, while swapping YT is enabled via flash swaps in the same pool.
> Auto-routing is built in, allowing anyone to trade PTs and YTs with any major asset.
### Flash Swaps
Flash swaps are possible due to the relationship between PT and YT. As PT and YT can be minted from and redeemed to its underlying SY, we can express the price relationship:
$$
P(PT) + P(YT) = P(\text{Underlying})
$$
Knowing that YT price has an inverted correlation against PT price, we use this price relationship to utilise the PT/SY pool for YT swaps.
Buying YT:
1. Buyer sends SY into the swap contract (auto-routed from any major token)
2. Contract withdraws more SY from the pool
3. Mint PTs and YTs from all of the SY
4. Send the YTs to the buyer
5. The PTs are sold for SY to return the amount from step 2

Selling YT:
1. Seller sends YT into the swap contract
2. Contract borrows an equivalent amount of PT from the pool
3. The YTs and PTs are used to redeem SY
4. SY is sent to the seller (or routed to any major tokens, e.g. ETH, USDC, wBTC, etc)
5. A portion of the SY is sold to the pool for PT to return the amount from step 2

## Matured LP
Upon maturity, LPs are able to Zap Out + Redeem PT for Underlying + Claim Rewards in a single transaction:
1. Visit [Pendle Trade](https://app.pendle.finance/trade/pools) and toggle to the “Inactive” pool list
2. Select a pool
3. Toggle “Claim All Pool Rewards”
4. Select an output asset. Pendle will automatically Redeem PT for Underlying > Unwrap SY > Perform Swaps (if needed) here
## Key Features
### Minimal Impermanent Loss (IL)
Pendle V2 design ensures that IL is a negligible concern. Pendle’s AMM accounts for PT’s natural price appreciation by shifting the AMM curve to push PT price towards its underlying value as time passes, mitigating time-dependent IL (No IL at maturity).
On top of that, IL from swaps is also mitigated as both assets LP’ed are very highly correlated against one another (e.g. PT-stETH / SY-stETH). If liquidity is provided until maturity, an LP’s position will be equivalent to fully holding the underlying asset since PT essentially appreciates towards the underlying asset.
In most cases prior to maturity, PT trades within a yield range and does not fluctuate as much as an asset’s spot price. For example, it’s rational to assume that Aave’s USDC lending rate fluctuates between 0%-15% for a reasonable timeframe (and PT accordingly trades within that yield range). This premise ensures a low IL at any given time as PT price will not deviate too far from the time of liquidity provision.
### Customizable AMM

Pendle’s AMM curve can be customised to cater to tokens with varying yield volatilities. Yields are often cyclical in nature and typically swing between highs and lows. Typically, the floor and ceiling for the yield of a liquid asset are much easier to predict than its price.
For example, the annual yield of staked ETH is likely to fluctuate in a band of 0.5-7%. Knowing the rough yield range of an asset enables us to concentrate liquidity within that range, enabling much larger trade sizes at a lower slippage.
However, if the implied yield of the pool trades out of its set range, liquidity will be too thin to further push it in said direction. Using the above example, if the implied yield of the stETH pool goes beyond 7%, buying YT (or selling PT) might no longer be possible.
To check the set yield range of the pool, click on the sign as shown in the screenshot below.

### Greater Capital Efficiency
_For Liquidity Providers_
Since YT trades are routed through the same PT/SY pool, LPs earn fees from both PT and YT swaps from a single liquidity provision, doubling the yield from LPing.
_For Traders_
Rather than having separate pools for YT and PT, concentrating all tokens in a PT/SY pool will result in greater liquidity. This will allow traders to make trades of greater volume without having to worry about much slippage, granting traders greater price certainty.
---
# Fees
Pendle protocol has 2 revenue sources:
- **YT Fees**
Pendle collects a 5% fee from all yield accrued (including points) by all YT in existence, and all yields (including all points negotiated) from the SYs of matured unredeemed PTs.
- **YT Fees on Points**
Fees on points are applied similarly as Pendle treats points as a form of yield. Since points are tracked off-chain, partner protocols deduct the 5% fee when allocating points to user wallets. The deducted points from fees are then re-allocated to the following Pendle-controlled wallets:
:::info
Fee wallets for pools launched BEFORE 8th October 2024
:::
| Chain | Fee Wallet Address |
| :-------: | :------------------------------------------: |
| Ethereum | `0x8270400d528c34e1596EF367eeDEc99080A1b592` |
| Arbitrum | `0xCbcb48e22622a3778b6F14C2f5d258Ba026b05e6` |
| Mantle | `0x5C30d3578A4D07a340650a76B9Ae5dF20D5bdF55` |
| BNB Chain | `0xd77E9062c6DF3F2d1CB5Bf45855fa1E7712A059e` |
:::info
Fee wallet for pools launched AFTER 8th October 2024
:::
All chains: `0xC328dFcD2C8450e2487a91daa9B75629075b7A43`
- **Swap Fees**
Pendle collects a percentage-based swap fee, scaled with maturity, from all PT swaps. Each fee tier will be displayed in the dApp and is decided by the pool deployer (currently only the Pendle team deploys pools on Pendle).
Pendle taxes the yield-receivables of PT when swaps occur. This creates a fair fee for all pools and maturities as it is scaled to a pool’s maturity (less time to maturity -> less yield-receivables -> lower fees in $ terms). Since YT swaps are also routed through the PT AMM, its fees are calculated based on the PT swapped.
- **Fee Distribution**
Pendle has 2 sources of fees **YT fees** and **Swap fees**. 20% of all swap fees are given to LP providers of the pool as yield.
The remaining swap fees and all YT fees are split between PENDLE buyback fund and Pendle protocol in the following ratio
- 80% for PENDLE buyback
- 10% to Protocol Treasury
- 10% to Protocol Operations
- **Trading Fee Calculation**
Trading fees are dynamically adjusted based on time remaining until maturity:
`Trading Fee = (Fee Tier / 365) * Days to Maturity`
The **Fee Tier** is specific to each market and can be found by clicking the "specs" button on the market's trading interface. Redeeming PT for the underlying asset *after* maturity incurs no protocol fee, only standard network gas fees.
- **Post-Maturity Yield Redirection**
If a user does not redeem their PT or LP position after maturity, the underlying asset remains in the SY contract and **continues to accrue yield and points**. However, all yield and points generated by these unredeemed, matured positions are automatically redirected to the **Pendle treasury fee wallet**. This incentivizes users to promptly redeem their matured assets and roll them over into new pools.
---
# Pendle API Overview
Pendle provides a comprehensive API system that enables developers to integrate with the Pendle protocol for trading, analytics, and portfolio management.
## Understanding Pendle's API System
**API Base URL**: [https://api-v2.pendle.finance/core/docs](https://api-v2.pendle.finance/core/docs)
Pendle's API consists of two complementary components:
### 1. Hosted SDK (Transaction Generation)
**Purpose**: Generate transaction payloads to interact with Pendle smart contracts
**Use this when you need to**:
- Swap tokens (buy/sell PT, YT)
- Add or remove liquidity
- Mint or redeem PT/YT tokens
- Transfer liquidity between pools
- Roll over PT positions
- ... or any other transactions that interact with Pendle smart contracts
📖 [View Hosted SDK Documentation](./HostedSdk.mdx)
### 2. Backend API (Data Queries)
**Purpose**: Retrieve offchain data for markets, assets, pricing, user positions, and governance
**Use this when you need to**:
- Get offchain data for analytics
- Get supported markets list with latest data (TVL, volume, underlying APY, swap fee, ...)
- Get PT/YT/LP/SY asset prices
- Get sPENDLE and governance data (staking, rewards, ...)
📖 [View Backend API Documentation](https://api-v2.pendle.finance/core/docs)
## API Entry Points
All public endpoints are served under `https://api-v2.pendle.finance/core` and follow one of two routing patterns:
### Cross-chain endpoints (recommended)
These endpoints return data across all chains in a single request. Preferred for new integrations:
| Endpoint | Description |
|---------|-------------|
| `GET /v2/markets/all` | All markets across all chains — includes pagination, points, and external protocol data |
| `GET /v1/assets/all` | All assets across all chains |
| `GET /v1/prices/assets` | Asset prices across all chains |
:::note Deprecated
`GET /v1/markets/all` and `GET /v1/markets/points-market` are deprecated. Use `GET /v2/markets/all` instead — it returns the same markets with pagination support and points data included in each market object.
:::
#### Markets — Pagination
`GET /v2/markets/all` supports `skip` and `limit` query parameters for pagination:
| Parameter | Default | Maximum | Description |
|-----------|---------|---------|-------------|
| `skip` | `0` | — | Number of records to skip |
| `limit` | `10` | `100` | Maximum number of records to return |
#### Prices — Error Handling
The price response now includes an `errors` array alongside the price map:
```
{ priceMap: Record<string, PriceDto>, errors: Error[] }
```
Non-fatal pricing errors (e.g., assets not found for a given timestamp) are returned in `errors` rather than thrown. Callers should check and handle this field, as a partial result may be returned even when some assets could not be priced.
### Chain-scoped endpoints — `/{version}/{chainId}/...`
Some endpoints are scoped to a specific chain:
| Endpoint | Description |
|---------|-------------|
| `GET /v3/{chainId}/markets/{address}/historical-data` | **Market time-series data** with optional APY breakdown — [see Market Data Endpoints](#market-data-endpoints) |
| ~~`GET /v2/{chainId}/markets/{address}/historical-data`~~ | *(Deprecated)* Use v3 instead for APY breakdown support |
| ~~`GET /v2/{chainId}/markets/{address}/data`~~ | *(Deprecated)* Market data for a specific address |
| ~~`GET /v2/sdk/{chainId}/convert`~~ | *(Deprecated)* Generate transaction payload — use `POST /v3/sdk/{chainId}/convert` instead |
| `GET /v5/{chainId}/transactions/{address}` | Transaction history for an address |
:::note Deprecated
- `GET /v2/{chainId}/markets/{address}/historical-data` is deprecated. Use [`GET /v3/{chainId}/markets/{address}/historical-data`](#market-data-endpoints) instead, which supports `includeApyBreakdown` for detailed APY composition.
- `GET /v2/{chainId}/markets/{address}/data` is deprecated.
- `GET /v2/sdk/{chainId}/convert` (GET) is deprecated. Use `POST /v3/sdk/{chainId}/convert` instead, which accepts a JSON body and supports typed inputs.
:::
For new integrations, prefer cross-chain endpoints where available — they reduce the number of calls needed when working with multiple chains.
### BFF API — `https://api-v2.pendle.finance/bff`
The BFF (Backend for Frontend) API powers the official Pendle web app. It is **not intended for third-party integrations**: endpoints may change or be removed without notice. For third-party use, always use the `/core` API documented here.
## Rate Limiting
All Pendle API endpoints are rate-limited to ensure service stability and fair usage.
### How Rate Limiting Works
Pendle uses a **Computing Unit (CU)** based system. Every endpoint has a CU cost, which may be fixed or dynamic depending on the endpoint.
The rate limit is calculated based on the total CU cost of all endpoints.
Each user (IP) has a rate limit of 100 CU per minute, and 200,000 CU per week.
Both limits apply simultaneously. You must stay within both the per-minute AND weekly limits to avoid rate limiting.
**Example**: If an endpoint costs 5 CU, you can call it:
- 20 times per minute (100 ÷ 5 = 20)
- 40,000 times per week (200,000 ÷ 5 = 40,000)
#### Computing Unit Costs
Most RESTful API endpoints have fixed costs (typically 1-5 CU), whereas the Hosted SDK has dynamic costs depending on the number of aggregators used. Check the [API documentation](https://api-v2.pendle.finance/core/docs) for specific costs — they're displayed in the "CU" box before each endpoint description.
More on computing unit costs for HostedSdk can be found in [HostedSdk.mdx](./HostedSdk.mdx#select-aggregators).
#### Rate Limit Headers
Our endpoints return the following headers to help you monitor your usage:
| Header | Description |
|--------|-------------|
| `X-Computing-Unit` | CU cost of this request |
| `X-RateLimit-Limit` | Maximum CU per minute (e.g., 100 for free tier) |
| `X-RateLimit-Remaining` | CU remaining in current minute window |
| `X-RateLimit-Reset` | Unix timestamp when minute limit resets |
| `X-RateLimit-Weekly-Limit` | Maximum CU per week (e.g., 200,000 for free tier) |
| `X-RateLimit-Weekly-Remaining` | CU remaining in current week window |
| `X-RateLimit-Weekly-Reset` | Unix timestamp when week limit resets |
Example response:
```
x-computing-unit: 25
x-ratelimit-limit: 100
x-ratelimit-remaining: 75
x-ratelimit-reset: 1724206817
x-ratelimit-weekly-limit: 200000
x-ratelimit-weekly-remaining: 175000
x-ratelimit-weekly-reset: 1724206817
```
### Best Practices for Rate Limiting
- **Never hardcode rate limits.** Rate limits have evolved over time and may change in the future. Always handle `429` responses gracefully.
- **Implement exponential backoff.** When you receive a `429 Too Many Requests` response, wait and retry with increasing delays.
- **Use the right endpoint for the job.** For general price monitoring, use `getAllAssetPricesByAddresses` (updates every ~30 seconds). For pre-swap price checks, use `getMarketSpotSwappingPrice` (updates every block).
- **Set generous timeouts.** Some API endpoints, particularly those querying complex data, can be slow. Set a client-side HTTP timeout of at least **120 seconds**.
- **Watch out for RPC rate limits.** A `429` error is most often caused by your **RPC provider**, not the Pendle API — especially when backfilling historical data. Use a private or paid archival RPC (e.g., QuickNode) for intensive operations.
- **Use pagination correctly.** For endpoints returning large lists, include the `resumeToken` from a response in your next request to fetch subsequent pages.
### I get rate limited, what should I do?
Our rate limit was designed so that most users can use the API without facing any rate limiting issues, unless you are calling the API unreasonably fast.
So before requesting increased rate limits, please make sure you are not calling the API at an unreasonable rate. Follow our best practices and examples.
If after all that, you are still getting rate limited, you can consider upgrading your plan, details below.
### API Pricing Plans
If you need higher rate limits, we offer flexible paid plans that scale with your needs.
#### Pricing Structure
Our pricing is simple and scalable: **$10/week = 500 CU/min + 1,000,000 CU/week**
You can purchase multiple units to scale your rate limits based on your application's requirements:
| Weekly Cost | CU per Minute | Weekly CU Limit |
|-------------|---------------|-----------------|
| **$0** (Free) | 100 | 200,000 |
| **$10** | 500 | 1,000,000 |
| **$20** | 1,000 | 2,000,000 |
| **$30** | 1,500 | 3,000,000 |
| **$40** | 2,000 | 4,000,000 |
**Pricing Model:**
- Each **$10/week** adds **+500 CU/min** and **+1,000,000 CU/week** to your limits
- Scale up to **$40/week** (2,000 CU/min, 4M CU/week) through our standard plans
**Example:**
If you want to use 1,000,000 CU per week and you want to use the API for 4 weeks, it would be $10 * 4 = $40.
If you want to use 2,000,000 CU per week and you want to use the API for 8 weeks (about 2 months), it would be $20 * 8 = $160.
### How to get an API key
To get an API key and upgrade your plan:
1. Go to the API dashboard at: [https://api-v2.pendle.finance/dashboard](https://api-v2.pendle.finance/dashboard)
2. Login with your wallet (you will be asked to sign a message to verify your identity)
3. Top-up your account with USDC/USDT/DAI on Arbitrum
4. Choose your plan and create a new API key
Your API key will be generated. Make sure to save it securely as you'll need it to authenticate your requests.
#### How to use your API key
Include the `Bearer <API_KEY>` in the `Authorization` header in your requests:
```
Authorization: Bearer <API_KEY>
```
**Example:**
```bash
curl -i -H "Authorization: Bearer your_api_key_here" \
https://api-v2.pendle.finance/core/v1/chains
```
The response will have rate limit headers as described in [Rate Limit Headers](#rate-limit-headers).
:::note
You may occasionally notice `X-Ratelimit-Limit: 100` in responses even when you have a higher rate limit plan.
This happens when the response is served from **Cloudflare's cache** (indicated by the `CF-Cache-Status: HIT` header).
When a cache hit occurs, the request never reaches our backend, so **it does not count against your rate limit quota**.
The `X-Ratelimit-Limit: 100` value in this case is simply a default header from the cached response and does not reflect your actual rate limit.
:::
## API Updates and Deprecation
- **Deprecation Notice**: Breaking changes are announced at least 30 days in advance. Follow the [Telegram Developer Channel](https://t.me/pendledevelopers) for announcements.
### vePENDLE Deprecation
vePENDLE has been deprecated and replaced by **sPENDLE**. All endpoints listed under the **Ve Pendle** tag in the [API documentation](https://api-v2.pendle.finance/core/docs) are deprecated — they remain accessible but will not be updated to reflect the new sPENDLE staking system.
The following endpoints are specifically deprecated:
- `GET /v1/ve-pendle/data` — use [`GET /v1/spendle/data`](#get-v1spendledata) instead
- `GET /v1/ve-pendle/market-fees-chart` — no replacement; fees data is now included in the sPENDLE historical data response
## Market Data Endpoints
### GET /v3/\{chainId\}/markets/\{address\}/historical-data
Returns time-series data for a specific market, with optional detailed APY composition breakdown.
| Property | Value |
|----------|-------|
| Path parameters | `chainId` (number), `address` (string) |
| Query parameters | `time_frame`, `timestamp_start`, `timestamp_end`, `fields`, `includeFeeBreakdown`, `includeApyBreakdown` |
| Cache TTL | Varies by time_frame |
| CU cost | Dynamic: `max(1, ceil(total / 300))` base, `* 1.5 + 1` if `includeApyBreakdown=true`, `* 2 + 1` if `includeFeeBreakdown=true` |
**Key features:**
- **APY Breakdown**: Set `includeApyBreakdown=true` to get detailed yield composition for YT and LP positions, categorized by protocol yield, rewards, fixed yield, and incentives
- **Flexible fields**: Select specific data fields or use `fields=all` for complete data (not recommended for large time ranges)
- **Fee breakdown**: Include swap fee details with `includeFeeBreakdown=true` (daily/weekly timeframes only)
**Response includes:**
- Standard time-series fields: `timestamp`, `impliedApy`, `maxApy`, `tvl`, prices, liquidity metrics
- Optional `ytApyBreakdown`: Structured APY breakdown for YT holders (categories: Protocol Yield, YT Bonus Rewards, YT Extra Rewards)
- Optional `lpApyBreakdown`: Structured APY breakdown for LP providers (categories: Underlying Yield, External Rewards, PT Fixed Yield, LP Rewards)
- Optional fee breakdown: `explicitSwapFee`, `implicitSwapFee`, `limitOrderFee`
For detailed schemas, parameters, examples, and migration guide, see the [API Reference](https://api-v2.pendle.finance/core/docs#/Markets/MarketsController_marketHistoricalData_v3).
:::tip New in v3
The v3 endpoint adds support for detailed APY breakdowns while maintaining full backward compatibility with v2. All existing v2 functionality works identically in v3.
:::
## sPENDLE API Endpoints
These endpoints provide sPENDLE staking statistics and per-user reward data.
### GET /v1/spendle/data
Returns aggregate sPENDLE staking statistics, including total PENDLE staked, historical APRs, revenues, fees, and airdrop breakdowns. Historical data covers the last 12 epochs.
| Property | Value |
|----------|-------|
| Query parameters | None |
| Cache TTL | 5 minutes |
| CU cost | 1 |
**Response fields:**
| Field | Description |
|-------|-------------|
| `totalPendleStaked` | Total PENDLE currently staked |
| `totalStakedInSpendle` | Total staked in the sPENDLE contract |
| `virtualSpendleFromVependle` | Virtual sPENDLE balance derived from vePENDLE positions |
| `sPendleHistoricalData` | Per-epoch historical data: `timestamps`, `revenues`, `aprs`, `fees`, `airdrops`, `buybackAmounts`, `airdropInUSDs`, `airdropBreakdowns`, `allTimeRevenues` |
| `vependleHistoricalData` | Historical data for the legacy vePENDLE system |
### GET /v1/spendle/:address
Returns claimable and historical rewards for a specific sPENDLE holder, including ETH fee rewards, multi-token merkle proofs, and all-time reward totals.