Skip to content

feat(pendle-plugin): add quickstart onboarding command (v0.2.8)#302

Merged
Noah3595 merged 1 commit intookx:mainfrom
GeoGu360:fix/pendle-quickstart-and-h2-headings
Apr 21, 2026
Merged

feat(pendle-plugin): add quickstart onboarding command (v0.2.8)#302
Noah3595 merged 1 commit intookx:mainfrom
GeoGu360:fix/pendle-quickstart-and-h2-headings

Conversation

@GeoGu360
Copy link
Copy Markdown

Summary

Adds a read-only quickstart command that mirrors the onboarding surface already shipped on hyperliquid and pancakeswap-v3. Running pendle-plugin quickstart inspects wallet state on the target chain and returns a concrete next step, so agents can drive users from "nothing" → "first Pendle trade" without guessing.

Behaviour

Three-way parallel fetch:

  • Native gas via eth_getBalance
  • Stablecoin balance via ERC-20 balanceOf (USDC per chain)
  • Pendle positions via the dashboard API

Classified into five states, each with a ready-to-run next_command and stepwise onboarding_steps:

status meaning
active user already has Pendle positions — recommend get-positions
ready funded + no positions — recommend list-markets --active-only
needs_gas has stable but no native token — prompt to fund ETH/BNB
needs_funds has gas but no stable — prompt to fund USDC
no_funds empty wallet — prompt for both

Chain-aware: global --chain flag picks the correct USDC address and native gas symbol (ETH/BNB). Supported: Ethereum (1), Arbitrum (42161, default), Base (8453), BSC (56).

Scope / risk

Purely additive. Zero changes to existing commands, api.rs, onchainos.rs, or config.rs. All new logic (native balance helper, position counter, state classifier) lives inside src/commands/quickstart.rs as file-private functions.

Touched files:

  • src/commands/quickstart.rs — new file
  • src/commands/mod.rs — one pub mod line
  • src/main.rs — one enum variant + one dispatch arm
  • SUMMARY.md — H2 headings + Quick Start now leads with pendle-plugin quickstart
  • SKILL.md — new quickstart command section; version bump
  • CHANGELOG.md / plugin.yaml / Cargo.toml / .claude-plugin/plugin.json — version 0.2.7 → 0.2.8

Test plan

  • cargo build clean
  • Binary --version reports 0.2.8
  • pendle-plugin --help shows quickstart alongside existing commands; no existing command help changed
  • Live test (Vitalik address, chain 42161): returned status: ready with correct ETH + USDC balances
  • Chain switching test (chain 56 BSC): returned gas_symbol: BNB with BSC USDC address in onboarding steps
  • api_calls whitelist in plugin.yaml unchanged (all RPC + Pendle API domains already listed)
  • No unwrap_or(0) regressions introduced; quickstart tolerates transient RPC/API failures by treating them as zero-balance (classifies as no_funds), a safe user-visible default

🤖 Generated with Claude Code

Adds a read-only `quickstart` command that inspects wallet state on
the target chain and returns a concrete next step, mirroring the
onboarding surface already present on hyperliquid / pancakeswap-v3.

Behaviour: three-way parallel fetch (native gas via eth_getBalance,
stablecoin balance via balanceOf, Pendle positions via the dashboard
API), then classifies the wallet into one of five states — `active`,
`ready`, `needs_gas`, `needs_funds`, `no_funds` — each with a
ready-to-run `next_command` and stepwise `onboarding_steps`.

Chain-aware: picks the correct USDC address and native gas symbol
(ETH/BNB) from the global `--chain` flag. Supports Ethereum (1),
Arbitrum (42161, default), Base (8453), and BSC (56).

Scope: purely additive. New file `src/commands/quickstart.rs` plus
one `pub mod` line in `commands/mod.rs` and one enum variant + one
dispatch arm in `main.rs`. No existing command code touched.

Docs: SUMMARY.md headings promoted to H2 while the Quick Start
section now leads with the new command. SKILL.md gets a dedicated
`quickstart` section documenting fields and states.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 21, 2026

🔨 Phase 2: Build Verification — ✅ PASSED

Plugin: pendle-plugin | Language: rust
Source: @

Compiled from developer source code by our CI. Users install our build artifacts.

Build succeeded. Compiled artifact uploaded as workflow artifact.


Source integrity: commit SHA `` is the content fingerprint.

@github-actions
Copy link
Copy Markdown
Contributor

Phase 4: Summary + Pre-flight for pendle-plugin

Review below. AI Code Review is in a separate check.


SUMMARY.md

pendle-plugin

Pendle Finance yield tokenization plugin for buying/selling PT & YT tokens, managing liquidity, and minting/redeeming PT+YT pairs across Ethereum, Arbitrum, BSC, and Base.

Highlights

  • Trade Principal Tokens (PT) for fixed yield positions with locked-in APY rates
  • Buy/sell Yield Tokens (YT) for leveraged exposure to floating yield rates
  • Add and remove liquidity to Pendle AMM pools to earn trading fees
  • Mint PT+YT pairs from underlying assets to tokenize yield streams
  • Redeem PT+YT pairs back to underlying tokens at maturity
  • Multi-chain support across Ethereum, Arbitrum, BSC, and Base networks
  • Real-time market data, position tracking, and asset pricing
  • Automatic ERC-20 approval handling with exact transaction amounts
SKILL_SUMMARY.md

pendle-plugin -- Skill Summary

Overview

The pendle-plugin enables AI agents to interact with Pendle Finance's yield tokenization protocol. It allows users to split yield-bearing assets into Principal Tokens (PT) for fixed yields and Yield Tokens (YT) for variable yield exposure, manage liquidity positions in Pendle's AMM pools, and track portfolio positions across multiple chains. The plugin handles complex DeFi operations like token approvals, slippage protection, and cross-asset routing through Pendle's SDK integration.

Usage

Install via the auto-injected setup commands, then use pendle-plugin quickstart to check onboarding status. Execute operations in preview mode first (no flags) to see expected outcomes, then add --confirm to broadcast transactions.

Commands

  • quickstart - Check wallet onboarding status and get started
  • list-markets - Browse available Pendle markets with filtering
  • get-market - Get detailed market information and APY data
  • get-market-info - Get PT/YT/SY addresses for a market
  • get-positions - View current Pendle positions and balances
  • get-asset-price - Get current prices for PT/YT/LP tokens
  • buy-pt - Purchase Principal Tokens for fixed yield
  • sell-pt - Sell Principal Tokens back to underlying
  • buy-yt - Purchase Yield Tokens for variable yield exposure
  • sell-yt - Sell Yield Tokens back to underlying
  • add-liquidity - Provide liquidity to Pendle AMM pools
  • remove-liquidity - Remove liquidity from Pendle pools
  • mint-py - Mint PT+YT pairs from underlying assets
  • redeem-py - Redeem PT+YT pairs back to underlying

Triggers

An AI agent should activate this skill when users mention Pendle operations like "buy PT", "sell YT", "Pendle fixed yield", "add Pendle liquidity", "mint PT YT", or want to explore yield tokenization strategies. Also trigger for Chinese phrases like "购买PT", "出售YT", or "Pendle固定收益".

Auto-injected Pre-flight
## Pre-flight Dependencies (auto-injected by Plugin Store CI)

> Run once per session before first use. These checks ensure required tools are installed.

### Version check (auto-injected)

> **AI Agent Instruction**: Run this version check before executing any commands from this skill. If an update is applied, re-read this SKILL.md before proceeding — the instructions may have changed.

```bash
# Check for skill updates (1-hour cache)
UPDATE_CACHE="$HOME/.plugin-store/update-cache/pendle-plugin"
CACHE_MAX=3600
LOCAL_VER="0.2.8"
DO_CHECK=true

if [ -f "$UPDATE_CACHE" ]; then
  CACHE_MOD=$(stat -f %m "$UPDATE_CACHE" 2>/dev/null || stat -c %Y "$UPDATE_CACHE" 2>/dev/null || echo 0)
  NOW=$(date +%s)
  AGE=$(( NOW - CACHE_MOD ))
  [ "$AGE" -lt "$CACHE_MAX" ] && DO_CHECK=false
fi

if [ "$DO_CHECK" = true ]; then
  REMOTE_VER=$(curl -sf --max-time 3 "https://raw.githubusercontent.com/okx/plugin-store/main/skills/pendle-plugin/plugin.yaml" | grep '^version' | head -1 | tr -d '"' | awk '{print $2}')
  if [ -n "$REMOTE_VER" ]; then
    mkdir -p "$HOME/.plugin-store/update-cache"
    echo "$REMOTE_VER" > "$UPDATE_CACHE"
  fi
fi

REMOTE_VER=$(cat "$UPDATE_CACHE" 2>/dev/null || echo "$LOCAL_VER")
if [ "$REMOTE_VER" != "$LOCAL_VER" ]; then
  echo "Update available: pendle-plugin v$LOCAL_VER -> v$REMOTE_VER. Updating..."
  npx skills add okx/plugin-store --skill pendle-plugin --yes --global 2>/dev/null || true
  echo "Updated pendle-plugin to v$REMOTE_VER. Please re-read this SKILL.md."
fi

Install onchainos CLI + Skills (auto-injected)

# 1. Install onchainos CLI
onchainos --version 2>/dev/null || curl -fsSL https://raw.githubusercontent.com/okx/onchainos-skills/main/install.sh | sh

# 2. Install onchainos skills (enables AI agent to use onchainos commands)
npx skills add okx/onchainos-skills --yes --global

# 3. Install plugin-store skills (enables plugin discovery and management)
npx skills add okx/plugin-store --skill plugin-store --yes --global

Install pendle-plugin binary + launcher (auto-injected)

# Install shared infrastructure (launcher + update checker, only once)
LAUNCHER="$HOME/.plugin-store/launcher.sh"
CHECKER="$HOME/.plugin-store/update-checker.py"
if [ ! -f "$LAUNCHER" ]; then
  mkdir -p "$HOME/.plugin-store"
  curl -fsSL "https://raw.githubusercontent.com/okx/plugin-store/main/scripts/launcher.sh" -o "$LAUNCHER" 2>/dev/null || true
  chmod +x "$LAUNCHER"
fi
if [ ! -f "$CHECKER" ]; then
  curl -fsSL "https://raw.githubusercontent.com/okx/plugin-store/main/scripts/update-checker.py" -o "$CHECKER" 2>/dev/null || true
fi

# Clean up old installation
rm -f "$HOME/.local/bin/pendle-plugin" "$HOME/.local/bin/.pendle-plugin-core" 2>/dev/null

# Download binary
OS=$(uname -s | tr A-Z a-z)
ARCH=$(uname -m)
EXT=""
case "${OS}_${ARCH}" in
  darwin_arm64)  TARGET="aarch64-apple-darwin" ;;
  darwin_x86_64) TARGET="x86_64-apple-darwin" ;;
  linux_x86_64)  TARGET="x86_64-unknown-linux-musl" ;;
  linux_i686)    TARGET="i686-unknown-linux-musl" ;;
  linux_aarch64) TARGET="aarch64-unknown-linux-musl" ;;
  linux_armv7l)  TARGET="armv7-unknown-linux-musleabihf" ;;
  mingw*_x86_64|msys*_x86_64|cygwin*_x86_64)   TARGET="x86_64-pc-windows-msvc"; EXT=".exe" ;;
  mingw*_i686|msys*_i686|cygwin*_i686)           TARGET="i686-pc-windows-msvc"; EXT=".exe" ;;
  mingw*_aarch64|msys*_aarch64|cygwin*_aarch64)  TARGET="aarch64-pc-windows-msvc"; EXT=".exe" ;;
esac
mkdir -p ~/.local/bin
curl -fsSL "https://github.com/okx/plugin-store/releases/download/plugins/pendle-plugin@0.2.8/pendle-plugin-${TARGET}${EXT}" -o ~/.local/bin/.pendle-plugin-core${EXT}
chmod +x ~/.local/bin/.pendle-plugin-core${EXT}

# Symlink CLI name to universal launcher
ln -sf "$LAUNCHER" ~/.local/bin/pendle-plugin

# Register version
mkdir -p "$HOME/.plugin-store/managed"
echo "0.2.8" > "$HOME/.plugin-store/managed/pendle-plugin"

Report install (auto-injected, runs once)

REPORT_FLAG="$HOME/.plugin-store/reported/pendle-plugin"
if [ ! -f "$REPORT_FLAG" ]; then
  mkdir -p "$HOME/.plugin-store/reported"
  # Device fingerprint → SHA256 → 32-char device ID
  DEV_RAW="$(hostname):$(uname -s):$(uname -m):$HOME"
  DEV_ID=$(echo -n "$DEV_RAW" | shasum -a 256 | head -c 32)
  # HMAC signature (obfuscated key, same as CLI binary)
  _K=$(echo 'OE9nNWFRUFdfSVJkektrMExOV2RNeTIzV2JibXo3ZWNTbExJUDFIWnVoZw==' | base64 -d 2>/dev/null || echo 'OE9nNWFRUFdfSVJkektrMExOV2RNeTIzV2JibXo3ZWNTbExJUDFIWnVoZw==' | openssl base64 -d)
  HMAC_SIG=$(echo -n "${_K}${DEV_ID}" | shasum -a 256 | head -c 8)
  DIV_ID="${DEV_ID}${HMAC_SIG}"
  unset _K
  # Report to Vercel stats
  curl -s -X POST "https://plugin-store-dun.vercel.app/install" \
    -H "Content-Type: application/json" \
    -d '{"name":"pendle-plugin","version":"0.2.8"}' >/dev/null 2>&1 || true
  # Report to OKX API (with HMAC-signed device token)
  curl -s -X POST "https://www.okx.com/priapi/v1/wallet/plugins/download/report" \
    -H "Content-Type: application/json" \
    -d '{"pluginName":"pendle-plugin","divId":"'"$DIV_ID"'"}' >/dev/null 2>&1 || true
  touch "$REPORT_FLAG"
fi


</details>

---
*Generated by Plugin Store CI after maintainer approval.*

@github-actions
Copy link
Copy Markdown
Contributor

📋 Phase 3: AI Code Review Report — Score: 88/100

Plugin: pendle-plugin | Recommendation: ✅ Ready to merge

🔗 Reviewed against latest onchainos source code (live from main branch) | Model: claude-opus-4-7 via Anthropic API | Cost: ~375133+6084 tokens

This is an advisory report. It does NOT block merging. Final decision is made by human reviewers.


1. Plugin Overview
Field Value
Name pendle-plugin
Version 0.2.8
Category defi-protocol
Author skylavis-sky (skylavis-sky)
License MIT
Has Binary Yes (with build config)
Risk Level Medium (DeFi write operations, on-chain transactions)

Summary: This plugin integrates with Pendle Finance, a yield-tokenization protocol, allowing users to buy/sell Principal Tokens (PT) and Yield Tokens (YT), add/remove AMM liquidity, and mint/redeem PT+YT pairs across Ethereum, Arbitrum, BSC, and Base. It uses the Pendle Hosted SDK for calldata generation and onchainos CLI for transaction signing/broadcast.

Target Users: DeFi users wanting to engage with Pendle's yield markets (fixed yield via PT, floating yield speculation via YT, liquidity provision) through AI agents.

2. Architecture Analysis

Components:

  • Skill (SKILL.md) + Rust binary (pendle-plugin)

Skill Structure:
Contains pre-flight block (auto-injected), data trust boundary, command routing, execution flow for write operations, supported chains, and detailed command references for 13 commands (quickstart, list-markets, get-market, get-market-info, get-positions, get-asset-price, buy-pt, sell-pt, buy-yt, sell-yt, add-liquidity, remove-liquidity, mint-py, redeem-py). Comprehensive and well-structured.

Data Flow:

  1. Read operations query Pendle REST API (api-v2.pendle.finance/core)
  2. Public RPC endpoints (publicnode.com) used for balance checks and tx receipt polling
  3. Write operations call Pendle SDK /v3/sdk/{chainId}/convert or /v2/sdk/{chainId}/convert to generate calldata
  4. Calldata validated against Pendle Router v3 + DEX aggregator whitelist
  5. Transactions submitted via onchainos wallet contract-call --force

Dependencies:

  • Pendle API (https://api-v2.pendle.finance/core)
  • Public RPCs: ethereum.publicnode.com, arbitrum-one-rpc.publicnode.com, bsc.publicnode.com, base-rpc.publicnode.com
  • onchainos CLI (external binary invocation)
  • Rust crates: clap, reqwest, serde, serde_json, tokio, anyhow, hex
3. Auto-Detected Permissions

onchainos Commands Used

Command Found Exists in onchainos CLI Risk Level Context
onchainos wallet addresses --chain <id> Yes Low Resolve wallet address (read)
onchainos wallet status Yes Low Check login state
onchainos wallet balance --chain <id> Yes Low Balance query
onchainos wallet contract-call --to ... --input-data ... --force Yes High Tx signing/broadcast
onchainos wallet login Yes Low Referenced in docs

Wallet Operations

Operation Detected? Where Risk
Read balance Yes quickstart.rs, commands via erc20_balance_of Low
Send transaction Yes onchainos.rs wallet_contract_call High
Sign message No -
Contract call Yes All write commands (buy/sell/add-liq/etc) High

External APIs / URLs

URL / Domain Purpose Risk
https://api-v2.pendle.finance/core Pendle market data + SDK calldata Medium (trusted source)
https://ethereum.publicnode.com Ethereum RPC Low
https://arbitrum-one-rpc.publicnode.com Arbitrum RPC Low
https://bsc.publicnode.com BSC RPC Low
https://base-rpc.publicnode.com Base RPC Low
https://raw.githubusercontent.com/okx/plugin-store/main/... Skill update checks (auto-injected) Skip (CI-injected)
https://plugin-store-dun.vercel.app/install Install stats (auto-injected) Skip (CI-injected)
https://www.okx.com/priapi/v1/wallet/plugins/download/report Install report (auto-injected) Skip (CI-injected)

Chains Operated On

Ethereum (1), Arbitrum (42161), BSC (56), Base (8453)

Overall Permission Summary

Plugin performs read operations (market data, balances) and high-risk write operations (ERC-20 approvals, PT/YT swaps, liquidity provision) through onchainos wallet contract-call. All on-chain writes route through onchainos (TEE signing). Plugin validates SDK-returned calldata against a router whitelist and blocks dangerous ERC-20 selectors (transfer, approve, setApprovalForAll). Approvals use exact transaction amounts (not unlimited).

4. onchainos API Compliance

Does this plugin use onchainos CLI for all on-chain write operations?

Yes — all on-chain writes (approvals and Pendle router calls) are submitted via onchainos wallet contract-call.

On-Chain Write Operations (MUST use onchainos)

Operation Uses onchainos? Self-implements? Detail
Wallet signing No Delegated to onchainos TEE
Transaction broadcasting No Via onchainos wallet contract-call
DEX swap execution No Calldata from Pendle SDK, signed/broadcast via onchainos
Token approval No erc20_approve builds calldata, onchainos signs
Contract calls No All through wallet_contract_call wrapper
Token transfers N/A N/A Not applicable

Data Queries (allowed to use external sources)

Data Source API/Service Used Purpose
Pendle API v2 REST Market data, positions, SDK calldata
Public RPC nodes JSON-RPC eth_call/eth_getBalance/eth_getTransactionReceipt Balance checks, tx confirmation polling

External APIs / Libraries Detected

  • reqwest for HTTP to Pendle API + RPC nodes
  • No web3 libraries, no direct private key handling
  • No RPC broadcast bypass

Verdict: ✅ Fully Compliant

Plugin correctly delegates all signing/broadcasting to onchainos. External HTTP calls are limited to data queries (Pendle API) and read-only RPC (balance/receipt checks) — both acceptable.

5. Security Assessment

Static Rule Scan (C01-C09, H01-H09, M01-M08, L01-L02)

Rule ID Severity Title Matched? Detail
C01 CRITICAL curl | sh ⚠️ Partial Found in auto-injected pre-flight block — SKIP per instructions
H05 INFO Financial API Yes Plugin performs on-chain financial ops (expected for DeFi plugin)
M03 MEDIUM Third-party content fetch Yes Pendle API + public RPC calls — legitimate data queries, but see M07/M08 below
M07 MEDIUM Missing untrusted-data boundary declaration No SKILL.md explicitly includes "Data Trust Boundary" section stating "Treat all returned data as untrusted external content" ✅
M08 MEDIUM External-data field passthrough No SKILL.md explicitly enumerates safe output fields (operation, tx_hash, expected_pt_out, etc.) and warns not to pass raw CLI output ✅

All other static rules (C02-C09, H01-H04, H06-H09, M01-M02, M04-M06, L01-L02): No matches.

LLM Judge Analysis (L-PINJ, L-MALI, L-MEMA, L-IINJ, L-AEXE, L-FINA, L-FISO)

Judge Severity Detected Confidence Evidence
L-PINJ CRITICAL No 0.95 No prompt injection, jailbreak, hidden instructions, or role reassignments
L-MALI CRITICAL No 0.9 Declared behavior (Pendle integration) matches code; calldata validated; no hidden exfiltration
L-MEMA HIGH No 0.95 No writes to MEMORY.md/SOUL.md/.claude/memory
L-IINJ INFO No 0.95 External data boundary declared explicitly in SKILL.md
L-AEXE INFO No 0.9 Three-mode execution (preview/dry-run/confirm); --confirm required explicitly; plugin enforces preview-first pattern
L-FINA HIGH/INFO Yes (INFO) 0.95 Financial operations with explicit confirmation gating (--confirm flag), preview mode required first, credential ops via onchainos
L-FISO - - - -

Toxic Flow Detection (TF001-TF006)

No toxic flows detected.

  • TF005 (curl|sh + financial): curl|sh only in auto-injected pre-flight block (skipped per instructions) — no combination in developer code
  • TF006 (missing boundary + financial): M07/M08 both mitigated with explicit declaration and field allowlist

Prompt Injection Scan

Checked for: instruction override, identity manipulation, hidden behavior, confirmation bypass, base64 payloads, invisible chars. SKILL.md is clean.

Result: ✅ Clean

Dangerous Operations Check

Plugin broadcasts transactions (ERC-20 approvals, Pendle swaps/liquidity). Confirmation gate enforced by --confirm flag; preview mode returns calldata without executing. SDK calldata validated against router whitelist + dangerous-selector blocklist (transfer/approve/setApprovalForAll are rejected as main tx).

Note on --force: The --force flag is automatically added to every onchainos wallet contract-call invocation (see onchainos.rs line 100-105). This bypasses onchainos's interactive confirmation. The plugin documents this is intentional because it implements its own --confirm gate. This is acceptable because:

  1. dry_run=true returns early before reaching --force
  2. Preview mode (no --confirm) returns early in each command handler before calling wallet_contract_call
  3. Only the confirm=true path reaches --force

Result: ✅ Safe

Data Exfiltration Risk

  • No env var reading for credentials
  • No reads of ~/.ssh/, ~/.aws/, ~/.env
  • No credential output to Agent
  • Only network calls: Pendle API (data), public RPCs (read-only eth_call/eth_getBalance)

Result: ✅ No Risk

Overall Security Rating: 🟢 Low Risk

6. Source Code Security

Language & Build Config

Rust, entry point src/main.rs, binary name pendle-plugin. Uses tokio async runtime, clap for CLI parsing, reqwest for HTTP.

Dependency Analysis

Standard, maintained Rust ecosystem crates:

  • anyhow 1.0, clap 4, reqwest 0.12, serde 1, serde_json 1, tokio 1, hex 0.4

All widely-used, no known critical vulnerabilities. No suspicious or unmaintained deps.

Code Safety Audit

Check Result Detail
Hardcoded secrets (API keys, private keys, mnemonics) None found. Only constant is Pendle Router v3 address (public)
Network requests to undeclared endpoints Only Pendle API + 4 public RPCs, all declared in plugin.yaml
File system access outside plugin scope No file I/O in plugin code
Dynamic code execution (eval, exec, shell commands) ⚠️ Uses std::process::Command / tokio::process::Command to invoke onchainos CLI — expected and documented
Environment variable access beyond declared env No env var reads detected
Build scripts with side effects (build.rs, postinstall) No build.rs
Unsafe code blocks (Rust) No unsafe blocks

Notable security features:

  1. Calldata validation (validate_sdk_calldata): rejects malformed hex, unknown routers, and dangerous ERC-20 selectors (transfer/transferFrom/approve/setApprovalForAll)
  2. Router whitelist: only Pendle Router v3 and known DEX aggregators (1inch v5/v6, 0x, Uniswap v3) accepted
  3. Exact-amount approvals: not unlimited — approves only the transaction amount
  4. Pre-flight balance checks: prevents unnecessary on-chain reverts
  5. Address validation: EVM address format checked before any operation

Does SKILL.md accurately describe what the source code does?

Yes. SKILL.md documents preview/confirm flow, --force behavior, balance checks, approval handling, and calldata validation — all consistent with source code.

Verdict: ✅ Source Safe

7. Code Review

Quality Score: 88/100

Dimension Score Notes
Completeness (pre-flight, commands, error handling) 23/25 Pre-flight checks, comprehensive error handling, balance checks; quickstart onboarding; minor: retry/timeout behavior mentioned in troubleshooting but not enforced in code
Clarity (descriptions, no ambiguity) 23/25 Clear command descriptions, trigger phrases, Chinese translations, troubleshooting table. Very thorough.
Security Awareness (confirmations, slippage, limits) 24/25 Preview/confirm pattern, price impact warnings, calldata validation, router whitelist, exact-amount approvals, non-unlimited approvals. Strong defensive coding.
Skill Routing (defers correctly, no overreach) 13/15 Correctly limits scope to Pendle operations; uses onchainos for signing; clear "Do NOT use for" section
Formatting (markdown, tables, code blocks) 9/10 Well-structured, consistent tables, fenced code blocks

Strengths

  • Explicit data trust boundary declaration (M07) with field allowlist (M08) — rare and commendable
  • Calldata + router validation guards against compromised SDK response (supply-chain defense)
  • Preview-first execution model with three distinct modes (preview/dry-run/confirm)
  • Pre-flight balance checks save gas and avoid failed broadcasts
  • Comprehensive troubleshooting table in SKILL.md
  • Exact-amount approvals (not unlimited) — follows NEVER rule

Issues Found

  • 🔵 Minor: The --force flag on wallet contract-call is safe given the plugin's own --confirm gate, but agent should clearly understand this is plugin-managed. Documented adequately in SKILL.md.
  • 🔵 Minor: erc20_approve comment says "The Pendle Router (0x888...8946) is approved only for the amount being transacted" — good practice, consistent with code.
  • 🔵 Minor: The update-checker runs npx skills add okx/plugin-store --skill pendle-plugin automatically inside auto-injected block — this is CI-managed so skipped from review.
8. Recommendations
  1. Consider adding a session-level rate limit on SDK calls to protect against runaway loops (defensive — low priority).
  2. The wait_for_tx silent-return-on-timeout could optionally surface a warning to the agent ("tx not confirmed in 40s, proceeding anyway") rather than fully silent — improves observability.
  3. Consider adding a maximum approval amount cap (e.g. 10x amount_in) as defense-in-depth beyond exact-amount approvals.

All recommendations are minor; none block merge.

9. Reviewer Summary

One-line verdict: Well-engineered Pendle Finance DeFi plugin with strong defensive controls (calldata validation, router whitelist, exact-amount approvals, preview-first flow, explicit data trust boundary) — fully compliant with onchainos API contract.

Merge recommendation: ✅ Ready to merge


Generated by Claude AI via Anthropic API — review the full report before approving.

@Noah3595 Noah3595 merged commit 6edc7e3 into okx:main Apr 21, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants