Skip to content

Commit 39156d4

Browse files
docs: add API overview and Convert API migration guide (#224)
- ApiOverview.mdx: add "API Entry Points" section explaining chain-scoped vs cross-chain endpoints and BFF API (frontend-only, not for third-party integrations); add vePENDLE deprecation notice pointing to sPENDLE - HostedSdk.mdx: add "Migrating from individual endpoints to Convert" section with a full mapping table (old endpoint path → equivalent Convert tokensIn/tokensOut), plus a "Which version should I use?" callout recommending v3 (POST) for new integrations Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 26799ae commit 39156d4

2 files changed

Lines changed: 64 additions & 2 deletions

File tree

docs/pendle-v2/Developers/Backend/ApiOverview.mdx

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,36 @@ Pendle's API consists of two complementary components:
3737

3838
📖 [View Backend API Documentation](https://api-v2.pendle.finance/core/docs)
3939

40+
## API Entry Points
41+
42+
All public endpoints are served under `https://api-v2.pendle.finance/core` and follow one of two routing patterns:
43+
44+
### Chain-scoped endpoints — `/v1/{chainId}/...`
45+
46+
These are the original per-chain routes. They remain fully functional and are a safe choice for chain-specific integrations:
47+
48+
| Example | Description |
49+
|---------|-------------|
50+
| `GET /v1/{chainId}/markets` | Markets on a specific chain |
51+
| `GET /v1/{chainId}/prices/assets/all` | Asset prices on a specific chain |
52+
| `GET /v1/{chainId}/sdk/swap` | Swap transaction payload for a specific chain |
53+
54+
### Cross-chain endpoints — `/v1/...`
55+
56+
Newer endpoints that return data across all chains in a single request. Preferred for new integrations:
57+
58+
| Example | Description |
59+
|---------|-------------|
60+
| `GET /v1/markets/all` | All markets across all chains |
61+
| `GET /v1/assets/all` | All assets across all chains |
62+
| `GET /v1/prices/assets` | Asset prices across all chains |
63+
64+
For new integrations, prefer cross-chain endpoints where available — they reduce the number of calls needed when working with multiple chains.
65+
66+
### BFF API — `https://api-v2.pendle.finance/bff`
67+
68+
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.
69+
4070
## Rate Limiting
4171

4272
All Pendle API endpoints are rate-limited to ensure service stability and fair usage.
@@ -166,8 +196,13 @@ The `X-Ratelimit-Limit: 100` value in this case is simply a default header from
166196

167197
:::
168198

169-
## API Updates and deprecation notice
170-
- **Deprecation Notice**: Breaking changes announced at least 30 days in advance, follow [Telegram Developer Channel](https://t.me/pendledevelopers) for announcements
199+
## API Updates and Deprecation
200+
201+
- **Deprecation Notice**: Breaking changes are announced at least 30 days in advance. Follow the [Telegram Developer Channel](https://t.me/pendledevelopers) for announcements.
202+
203+
### vePENDLE Deprecation
204+
205+
vePENDLE has been deprecated and replaced by **sPENDLE**. All endpoints listed under the **Ve Pendle** tag in the [Swagger 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.
171206

172207
## Code Examples and Resources
173208

docs/pendle-v2/Developers/Backend/HostedSdk.mdx

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,3 +469,30 @@ When an endpoint has an `additionalData` field, users can pass in some fields to
469469
For example, the **swap** action has `additionalData` with two available fields: `impliedApy` and `effectiveApy`. If the query parameters have `additionalData=impliedApy`, the response will have the implied APY before and after the swap action.
470470

471471
For additional usage, please refer to our external swagger to explore more.
472+
473+
## Migrating from individual endpoints to Convert
474+
475+
The Convert API replaces all of the individual SDK endpoints (`/swap`, `/add-liquidity`, `/mint`, `/redeem`, etc.). The table below maps each old endpoint to the equivalent Convert call.
476+
477+
| Old endpoint | Convert equivalent |
478+
|---|---|
479+
| `GET /v2/sdk/{chainId}/markets/{market}/swap` | `tokensIn=[token/PT/YT]`, `tokensOut=[token/PT/YT]` |
480+
| `GET /v2/sdk/{chainId}/markets/{market}/add-liquidity` | `tokensIn=[token]`, `tokensOut=[LP]` (standard) or `tokensOut=[LP,YT]` (ZPI) |
481+
| `GET /v2/sdk/{chainId}/markets/{market}/add-liquidity-dual` | `tokensIn=[token,PT]`, `tokensOut=[LP]` |
482+
| `GET /v2/sdk/{chainId}/markets/{market}/remove-liquidity` | `tokensIn=[LP]`, `tokensOut=[token]` |
483+
| `GET /v2/sdk/{chainId}/markets/{market}/remove-liquidity-dual` | `tokensIn=[LP]`, `tokensOut=[token,PT]` |
484+
| `GET /v2/sdk/{chainId}/mint` | `tokensIn=[token]`, `tokensOut=[PT,YT]` |
485+
| `GET /v2/sdk/{chainId}/redeem` | `tokensIn=[PT,YT]` (or just `[PT]` after expiry), `tokensOut=[token]` |
486+
| `GET /v2/sdk/{chainId}/mint-sy` | `tokensIn=[token]`, `tokensOut=[SY]` |
487+
| `GET /v2/sdk/{chainId}/redeem-sy` | `tokensIn=[SY]`, `tokensOut=[token]` |
488+
| `GET /v2/sdk/{chainId}/markets/{market}/transfer-liquidity` | `tokensIn=[LP,PT,YT]` (any subset), `tokensOut=[destination LP]` |
489+
| `GET /v2/sdk/{chainId}/markets/{market}/roll-over-pt` | `tokensIn=[source PT]`, `tokensOut=[destination PT]` |
490+
| `GET /v2/sdk/{chainId}/markets/{market}/exit-positions` | `tokensIn=[LP,PT,YT]` (any subset), `tokensOut=[token]` |
491+
492+
### Which version should I use?
493+
494+
Use **v3 (POST `/v3/sdk/{chainId}/convert`)** for new integrations. It accepts a JSON body with a typed `inputs` array instead of comma-separated query strings, which is easier to construct programmatically.
495+
496+
Use **v2 (GET `/v2/sdk/{chainId}/convert`)** if you need a fully query-parameter-based URL (e.g. for simple curl testing or when an HTTP client doesn't support request bodies on GET).
497+
498+
Both variants execute the same logic and return the same response.

0 commit comments

Comments
 (0)