forked from pendle-finance/documentation
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdev-knowledge-base.txt
More file actions
145 lines (75 loc) · 11.8 KB
/
dev-knowledge-base.txt
File metadata and controls
145 lines (75 loc) · 11.8 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
Business Context:
- Pool is interchangeable with market
- Maturity in Pendle refers to the end date of a financial product (pool). Upon maturity, user can claim rewards and either redeem or roll over to a new pool.
- IY refers to Implied Yield
- Roll over PT means swap PTs between markets.
Q: Is there an API to swap PT from different pools?
A: It’s the roll over PT API
Q: how can i get pending LP/markets rewards, YT rewards
A: You can call redeemRewards function in the market contract, redeemDueInterestAndRewards in Yt contracts
Q: How can I retrieve market data, such as TVL and APR, for a specific Pendle pool using the API?
A: You can obtain market-related information for a specific Pendle pool by calling the Pendle API. For instance, to get data for the sUSDe Sep 2025 pool, you can use the following API endpoint: "https://api-v2.pendle.finance/core/v2/1/markets/<MARKET_ID>/data". This endpoint provides relevant details for the specified market.
Q: Where should the latest Merkle root and proofs for claiming be located?
A: The proofs should still be updated in the `https://github.com/pendle-finance/merkle-distributions` repository. The Pendle Dev team will check if there are any issues.
Q: How is the projected vePendle computed?
A: The projected vePendle is computed by multiplying the total vePendle supply by the pool projected vote.
Q: What is the process for community listing a new asset on Pendle and how do I write its Standardized Yield (SY)?
A: To list a new asset on Pendle via the Community Listing portal, you need to fill out a security checklist to ensure compatibility with the Pendle protocol. For new vaults, some development work is required for integration. A high-level guide on the listing process is available, and you can find detailed instructions on how to write a Standardized Yield (SY) at https://pendle.notion.site/How-to-write-a-SY-A-guide-207567a21d378069aecbf20176591d93. You can join the Community Listing portal and start filling the Non-ERC4626 checklist at https://listing.pendle.finance/invite/[INVITE_CODE]. For reference, previous SY implementations for iBGT/iBERA can be found at https://github.com/pendle-finance/Pendle-SY-Public/tree/main/contracts/core/StandardizedYield/implementations/Infrared.
Q: What information is needed to get assistance with Pendle v2 API rate limit issues?
A: If you are experiencing rate limiting on the Pendle v2 API, please provide details about your specific use case, which API you are currently using, and your expected calling rate to assist the Pendle Dev team in resolving the issue.
Q: Is the contract address used for the `pendleSwap` parameter in `swapExactTokenForPt` immutable?
A: The contract address for the `pendleSwap` parameter is not guaranteed to be immutable and might change. Any changes will be announced publicly.
Q: What is the recommended way to get support or information regarding the Pendle router integration?
A: The Pendle router is designed to be straightforward to call and use, with exhaustive documentation available. Due to limited bandwidth, the team cannot do calls, so users should ask specific questions.
Q: How do Pendle limit orders interact with market swaps, and how can I see the routing?
A: When a user performs a swap, the router automatically determines the optimal swap route for the best token output. This route can involve limit orders, the AMM LP, or a combination of both. The transaction emulation allows users to see the exact split between limit orders and AMM routing for any given swap in the current market environment. If a market order (Party B) is placed, it will directly swap into a combination of the AMM and any existing limit orders (Party A).
Q: How can I calculate the implied APY for a transaction?
A: The implied APY can be calculated using the `ptExchangeRate`. For a detailed explanation of the calculation, refer to the official documentation on Pendle Market APY Calculation: https://docs.pendle.finance/ProtocolMechanics/PendleMarketAPYCalculation
Q: Which Pendle API endpoint is recommended for retrieving market spot prices, and does it offer a higher rate limit?
A: If you are using the `v2/sdk/<chain_id>/markets/<market>/swap` endpoint to get the spot price, the `https://api-v2.pendle.finance/core/docs#/SDK/SdkController_getMarketSpotSwappingPrice` endpoint is a more suitable alternative. This endpoint is designed for retrieving market spot swapping prices and offers a higher rate limit.
Q: How can I obtain an API key for Pendle, and what information is required to get one?
A: To obtain an [API Key] for Pendle, you need to share your specific use cases and the desired API limit. This information is requested to ensure that the appropriate endpoint is being used, as many partners have historically used incorrect endpoints. Once this information is provided, a [Key] will be shared.
Q: Does Pendle provide a script for tracking user points or balances?
A: Yes, Pendle provides a script for tracking points/balances. It can be found at `https://github.com/Pendle-Finance-Periphery/pendle-generic-balance-fetcher/tree/main`.
Q: How can I retrieve the monthly revenue data for Ve Pendle using the API, and what does the response contain?
A: The API endpoint for retrieving Ve Pendle monthly revenue is `https://api-v2.pendle.finance/core/docs#/Ve%20Pendle/VePendleController_getMonthlyRevenue`. The response from this API contains three key fields: `revenues`, which is an array of monthly revenues in USD; `timestamps`, which are the corresponding month timestamps (the first epoch's start timestamp of the month formatted in seconds) for the revenues; and `accumulatedRevenue`, which is the sum of all the revenues.
Q: Which third-party protocols are supported by the pendle-generic-balance-fetcher for deposits?
A: The pendle-generic-balance-fetcher supports deposits from a limited set of external protocols, specifically: Morpho, Euler, and Silo.
Q: When is an API key necessary for Pendle API calls?
A: If the Pendle API is called from the user's browser (UI), an API key is not required because rate limiting is handled via the user's IP address.
Q: What are the considerations for selecting aggregators when using Pendle's API, and which aggregator is recommended for specific use cases?
A: The choice of aggregators depends on your use case, as using more aggregators increases cost. For previewing results, Kyber is recommended due to its speed, extensive route support, and low CU cost. For sending transactions, it is advisable to enable more aggregators to ensure the best possible routing.
Q: How can I increase the API call rate limit when interacting with Pendle?
A: Pendle supports high-rate API calls, but there is a rate limit imposed by the aggregators it uses. To achieve a higher API call rate limit, you can obtain an [API KEY] directly from one of Pendle's aggregator partners, such as Kyberswap (which offers the highest rate limit), Odos, Paraswap, or OKX. This [API KEY] can then be used when making calls to Pendle.
Q: Is it sufficient to send API requests directly from a browser for IP-based access?
A: Yes, sending API requests directly from the browser should be sufficient for IP-based access.
Q: Are there any fees associated with using the Pendle API?
A: No, there are no fees required to use the Pendle API.
Q: How can I request a higher API rate limit for Pendle?
A: To request a higher API rate limit, you need to share your use cases and the desired limit. This information helps ensure the appropriate endpoint is used, as some partners have been observed using incorrect ones.
Q: Are PT to PT swaps supported for all asset pairs on the same chain?
A: No, PT to PT swaps are only available selectively and not across all assets.
Q: How can I determine which assets support direct swaps?
A: A direct list of available assets for direct swaps is not yet supported. However, you can call the API to see whether a specific asset can be swapped.
Q: What are the API rate limits for Pendle, and how can partners achieve higher request volumes?
A: Pendle is supportive of partners calling its API at a high rate, provided they are willing to cover RPC and processing server costs. However, there are rate limits imposed by the underlying aggregators. To achieve higher or 'unrestricted' API call limits, partners should obtain [API Key] directly from Pendle's aggregator partners. These keys can then be used when interacting with Pendle. Recommended aggregators include Kyberswap (which offers the highest rate limit), Odos, Paraswap, and OKX.
Q: How can I obtain an unrestricted API call limit?
A: To achieve an unrestricted API call limit, you can be connected with aggregator partners such as Kyberswap (which offers the highest rate limit), Odos, Paraswap, and OKX. You can obtain an [API KEY] directly from these partners, which can then be used with our API.
Q: How do I use the new aggregator feature in the Pendle API?
A: To use the new aggregator feature, you must use version 2 of the supported API and set the `aggregators` parameter to `kyberswap`. More detailed documentation for this feature is available at https://docs.pendle.finance/Developers/Backend/BackendAndHostedSDK#select-aggregators.
Q: Where can I find a list of API endpoints that support the aggregator feature?
A: A list of endpoints that support the aggregator feature can be found in the Pendle API swagger documentation, specifically within the SDK section, at https://api-v2.pendle.finance/core/docs#/SDK.
Q: How can I retrieve the pending reward amount directly from the contract?
A: You can get the pending reward amount directly from the contract by calling the claim reward function of the LP.
Q: What is the format for 'expectedCap' and 'currentCap'?
A: The 'expectedCap' and 'currentCap' values are provided in base18 format.
Q: How can I retrieve a list of market categories using the Pendle API?
A: You can find the API documentation for retrieving market categories at https://api-v2.pendle.finance/core/docs#/Market%20Categories/MarketCategoriesController_findAllMarketCategories. This endpoint allows you to get the categories list.
Q: Does the Pendle API provide a breakdown of ve-Pendle votes per user?
A: No, the Pendle API currently does not provide a vote breakdown per user. To obtain this information, you would need to listen for voting events on-chain.
Q: Why do quoted amounts from Pendle's quoter contract rate functions (e.g., getPtToSyRate, getYtToSyRate) differ from actual amounts returned by router functions, and what is the most accurate method for obtaining swap amounts?
A: The rate functions in Pendle's quoter contract provide a spot price, which does not account for price impact. To obtain the most accurate swap amounts, it is recommended to call Pendle's router functions directly.
Q: How can I determine the number of SY tokens received from PT tokens without replicating the swapExactPtForSy function offchain?
A: To determine the number of SY tokens received from PT tokens without replicating the swapExactPtForSy function offchain, you can utilize the Pendle hosted SDK. Further details and usage instructions are available in the documentation at https://docs.pendle.finance/Developers/Backend/BackendAndHostedSDK.
Q: How can I select specific aggregators, such as KyberSwap, when using the Pendle API?
A: To select specific aggregators like KyberSwap and ignore others, you should use version 2 of the supported API. Set the 'aggregators' parameter to specify the aggregators you wish to use. Detailed documentation for this feature can be found at https://docs.pendle.finance/Developers/Backend/BackendAndHostedSDK#select-aggregators. A list of endpoints that support this feature is available in the API swagger, specifically in the SDK section, at https://api-v2.pendle.finance/core/docs#/SDK.