SuperAPI AI 工具集

grimoire-pendle

编程与开发

查看项目

更新于 10-16 07:20

技能介绍

用途:该技能用于检视 Pendle 元数据,并在运行 spell 前预检 Pendle 路由配置。核心命令为 grimoire venue pendle ...,也可用 npx -y @grimoirelabs/cli venue pendle ...、bun run packages/cli/src/index.ts venue pendle ... 或直接二进制 grimoire-pendle ...。

主要能力:提供 info、chains、supported-aggregators、markets、assets、market-tokens 等子命令,支持 --chain、--active、--type(PT/YT/LP/SY)、--market、--base-url、--format(auto|json|table)等参数。推荐预检命令为 grimoire venue doctor --adapter pendle --chain 1 --rpc-url <rpc> --json。

使用方式:编写 Pendle spell 须先查询市场。先运行 markets 查询目标链市场并记下地址与到期时间,再用 market-tokens 获取精确代币地址,最后在 spell 中使用这些地址。支持的动作有 swap、add_liquidity、remove_liquidity、mint_py、redeem_py、mint_sy、redeem_sy。spell 中通过 with 子句设置 max_slippage、min_output、require_quote、max_gas 等约束。也可用 metric("quote_out", pendle, ...) 比较路由输出。

限制:Pendle swap 目前仅支持 exact_in,不支持 exact_out;聚合器默认关闭,需显式启用;代币输出须用裸地址字面量而非带引号字符串,否则触发 QUOTED_ADDRESS_LITERAL;PT/YT/SY 符号会自动解析,多个到期时选最近的一个,如需指定请用完整地址;API 默认基址为 https://api-v2.pendle.finance/core,可用 --base-url 或 PENDLE_API_BASE_URL 覆盖。