Skip to content

feat: add Pendle Finance action provider#1056

Open
Kubudak90 wants to merge 1 commit intocoinbase:mainfrom
Kubudak90:feat/pendle-action-provider
Open

feat: add Pendle Finance action provider#1056
Kubudak90 wants to merge 1 commit intocoinbase:mainfrom
Kubudak90:feat/pendle-action-provider

Conversation

@Kubudak90
Copy link
Copy Markdown

Summary

Adds a new action provider for Pendle Finance on Base, enabling AI agents to interact with Pendle's yield tokenization protocol.

Addresses WISHLIST.md item: "Pendle interactions (LP, PT, YT)"

Actions

Action Description
buy_pt Buy Principal Tokens to lock in fixed yield
sell_pt Sell PT back to underlying tokens
buy_yt Buy Yield Tokens to speculate on yield
sell_yt Sell YT back to underlying tokens
add_liquidity Provide liquidity to earn fees + PENDLE rewards
remove_liquidity Remove liquidity back to a single token
claim_rewards Claim accrued interest, yield, and rewards
list_markets List active markets with APYs, TVL, maturity

Implementation Details

  • Uses Pendle Hosted SDK API (api-v2.pendle.finance) for optimal execution — aggregator routing, limit order matching, gas-efficient offchain params
  • Direct Router V4 (0x888...946) call for claim_rewards via redeemDueInterestAndRewards
  • Supports Base mainnet (chain ID 8453)
  • Follows existing action provider patterns (Morpho, Moonwell)

Files

File Description
pendle/pendleActionProvider.ts Main provider with 8 actions
pendle/schemas.ts Zod input schemas for all actions
pendle/constants.ts Router V4 address, ABI, API base URL
pendle/pendleActionProvider.test.ts 10 unit tests (all passing)
pendle/index.ts Re-exports

Test plan

  • pnpm run build passes
  • 10/10 unit tests pass (supportsNetwork, buyPt, sellPt, addLiquidity, claimRewards, listMarkets)
  • Manual: configure agentkit with Base wallet, call list_markets, then buy_pt on an active market

Add a new action provider for Pendle Finance, enabling AI agents to
interact with Pendle's yield tokenization protocol on Base.

Actions:
- buy_pt: Buy Principal Tokens to lock in fixed yield
- sell_pt: Sell PT back to underlying tokens
- buy_yt: Buy Yield Tokens to speculate on yield
- sell_yt: Sell YT back to underlying tokens
- add_liquidity: Provide liquidity to Pendle markets
- remove_liquidity: Remove liquidity from markets
- claim_rewards: Claim accrued interest, yield, and PENDLE rewards
- list_markets: List active Pendle markets with APYs and TVL

Uses Pendle Hosted SDK API for optimal execution (aggregator routing,
limit order matching, gas-efficient offchain params). Falls back to
direct Router V4 calls for claim_rewards.

Addresses WISHLIST.md item: "Pendle interactions (LP, PT, YT)"
@Kubudak90 Kubudak90 requested a review from murrlincoln as a code owner March 29, 2026 21:00
@cb-heimdall
Copy link
Copy Markdown

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 1
Sum 2

@github-actions github-actions bot added action provider New action provider typescript labels Mar 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants