okx-defi

作者: okx

OKX聚合DeFi(未指定具体DApp)——产品发现、存款/提现/领取执行以及持仓查看。**如果用户提及任何第三方协议/DApp(Aave、Lido、PancakeSwap、Uniswap、Curve、Compound、Morpho、Pendle、Kamino、Raydium、Hyperliquid、Polymarket等),请路由至okx-dapp-discovery——即使涉及'查看我的Aave持仓',也不在此处处理。** 触发投资意图的指令包括:'投资DeFi'、'赚取收益'、'寻找最佳APY'、'存款/质押获取收益'、'搜索DeFi产品'等。

npx skills add https://github.com/okx/onchainos-skills --skill okx-defi

OKX DeFi (experimental merge of okx-defi-invest + okx-defi-portfolio)

Multi-chain, OKX-aggregated DeFi in two capabilities behind one skill. Both wrap the same onchainos defi CLI command group.

Pre-flight Checks

Read ../okx-agentic-wallet/_shared/preflight.md. If that file does not exist, read _shared/preflight.md instead.

Intent Routing

User IntentReference
Discover / search DeFi products, find best APYinvest.md
Product detail (APY, TVL, accepted tokens)invest.md
Deposit / stake / provide liquidityinvest.md
Withdraw / redeem a position (full or partial)invest.md
Claim rewards (platform / investment / V3 fee / bonus / unlocked principal)invest.md
APY history, TVL history, V3 depth / price chartsinvest.md
View DeFi positions / holdings overview (持仓)portfolio.md
Per-protocol position detail (持仓详情)portfolio.md
Exact parameters / return schemas — invest & charts commandsinvest-cli-reference.md
Exact parameters / return schemas — positions commandsportfolio-cli-reference.md
Errors / failed deposits / expired calldatainvest-troubleshooting.md
Errors / empty positions / address-format issuesportfolio-troubleshooting.md

Typical flow spans both: view positions (Portfolio) → redeem or claim (Invest). Read both reference files when the request chains them.

Skill Routing

  • For DApp-named investing/lending/staking/positions ("on Aave", "my Hyperliquid balance") → use okx-dapp-discovery
  • For token price/chart or token search by name/contract → use okx-dex-market
  • For DEX spot swap execution → use okx-agentic-wallet
  • For wallet token balances → use okx-agentic-wallet
  • For broadcasting signed transactions → use okx-agentic-wallet
  • For Agentic Wallet login, balance, contract-call → use okx-agentic-wallet

Chain Support

CLI resolves chain names automatically (e.g. ethereum1, bsc56, solana501). Full alias table: references/portfolio.md §Chain Support.

Step 0: Address Resolution (shared by both capabilities)

When the user does NOT provide a wallet address, resolve it automatically from the Agentic Wallet before running any defi command:

1. onchainos wallet status          → check if logged in, get active account
2. onchainos wallet addresses       → get addresses grouped by chain category:
                                       - XLayer addresses
                                       - EVM addresses (Ethereum, BSC, Polygon, etc.)
                                       - Solana addresses
3. Match address to target chain:
   - EVM chains → use EVM address
   - Solana     → use Solana address
   - XLayer     → use XLayer address

Rules:

  • If the user provides an explicit address, use it directly — skip this step
  • If wallet is not logged in, ask the user to log in first (→ okx-agentic-wallet) or provide an address manually
  • If the user says "check all accounts" or "all wallets", use wallet balance --all to get all account IDs, then wallet switch <id> + wallet addresses for each account
  • Always confirm the resolved address with the user before proceeding if the account has multiple addresses of the same type

Address-Chain Compatibility (shared — CRITICAL)

The --address and chain parameters must be compatible. EVM addresses (0x…) can only query EVM chains; Solana addresses (base58) can only query solana. Never mix them — the API will return error 84019 (Address format error).

  • 0x… address → only pass EVM chains: ethereum,bsc,polygon,arbitrum,base,xlayer,avalanche,optimism,fantom,linea,scroll,zksync
  • base58 address → only pass solana
  • Sui address → only pass sui; Tron address (T…) → only pass tron; TON address → only pass ton
  • If the user wants positions across both EVM and Solana, make two separate calls with the respective addresses

Global Notes

  • The wallet address parameter for ALL defi commands is --address
  • defi positions uses --chains (plural, comma-separated); defi position-detail uses --chain (singular)
  • For CLI parameter details, see references/invest-cli-reference.md (invest & charts) and references/portfolio-cli-reference.md (positions)

来自 okx 的更多技能

okx-agent-identity
okx
ERC-8004 在XLayer上的链上Agent身份:注册/创建/更新/激活/停用/搜索agent;查看评分;列出agent服务;设置头像。角色:user(User / User Agent / Buyer / Client / 用户 / 买家 / 买方),asp(ASP / Provider / Provider Agent / Seller / Merchant / 提供者 / 商家 / 服务提供商 / 卖家 / 卖方),evaluator(Evaluator / Evaluator Agent / 仲裁者 / 评估者)。用于:注册agent / 注册ASP / 注册User / 注册用户 / 注册买家 / 注册卖家 / 注册服务提供商 / 注册仲裁者 / 创建用户 / 创建买家 / 创建卖家 / 我的agent / 我的ASP / 改agent / 更新agent...
developmentapi
okx-ai-guide
okx
OKX.AI(Agent经济系统)简介与入门指引。当用户询问OKX.AI是什么、能做什么、如何使用或开始使用、需要OKX.AI教程/快速入门/帮助,或输入该产品名称的任何拼写/空格/大小写/错别字变体(如OKXAI、okx ai、okx-ai、小写okx.ai、中文误拼如啥是okxai)时使用——例如what is OKX.AI / OKX.AI是什么 / 怎么用OKX.AI / OKX.AI快速开始,以及任何语言的同义表述。检测运行时平台,介绍...
researchapidocument
okx-agentic-wallet
okx
OKX Agentic Wallet 及其 Gas Station 功能的权威来源。Gas Station = OKX 在 Solana 上通过第三方 Relayer 实现的稳定币 Gas 功能;仅限 Solana,不支持 EIP-7702。必须调用以回答 Gas Station 相关问题(什么是 Gas Station / 如何运作 / 支持的代币 / 费用 / 启用或禁用 Gas Station / 更改默认 Gas 代币 / Jito Bundler 兼容性
apiweb-scrapingdevelopment
okx-agent-chat
okx
Routing stub — any a2a-agent-chat envelope / agent-task system message is handled by `okx-agent-task`. For missing or uninitialized OKX A2A communication runtime/plugin, read `skills/okx-agent-chat/ensure-okx-a2a-communication-ready.md`.
developmentapicommunication
okx-agent-task
okx
我们要求翻译一段文本,目标语言是简体中文。需要保留产品名、协议名、URL、数字、技术术语。不要添加声明、解释、Markdown、项目符号、链接、标签、前缀或额外评论。只翻译<text>内的内容,不包括名称除非在源文本中出现。不要添加"description"等标签。 源文本是英文,包含一些中文词汇(如"发布任务"等)。需要整体翻译成简体中文,但保留技术术语和产品名如"okx-agent-task"、"agentId"、"msgType"等。注意保持格式和括号等。 翻译时注意:MUST ACTIVATE on inbound envelopes: 应该翻译为"必须在入站信封上激活:"。后面的列表用分号分隔。注意保留大括号、引号等。最后的关键词列表也要翻译,但保留英文关键词如"publish task"等,因为它们是技术术语?但指令说保留技术术语,但中文关键词如"发布任务"已经是中文,不需要翻译。英文关键词如"publish task
developmentapicommunication
okx-agent-payments-protocol
okx
当代理遇到HTTP 402 / 需要支付,或用户提及x402、x402Version、X-PAYMENT、PAYMENT-REQUIRED、PAYMENT-SIGNATURE、WWW-Authenticate: Payment、permit2、upto、计量计费、支付通道/凭证/会话、channelId/channel_id、开通/关闭/充值/结算/退款通道、paymentId或a2a_链接、创建/检查支付链接、A2MCP/A2MCP端点,或向代理端点发送请求/调用代理端点时使用...
okx-security
okx
使用此技能进行安全扫描:检查交易安全性、此交易是否安全、预执行检查、安全扫描、代币风险扫描、蜜罐检测、DApp/URL钓鱼检测、消息签名安全性、恶意交易检测、授权安全检查、代币授权管理。触发词:'此代币是否安全'、'检查代币安全性'、'蜜罐检测'、'扫描此交易'、'扫描此兑换交易'、'交易风险检查'、'此URL是否为诈骗'、'检查此dapp是否安全'、'钓鱼...
okx-task-watch
okx
监听任务进展 / 帮我盯着任务 / 任务有动静告诉我 / 历史消息 / 未读消息 / 未决策 / 待决策 / 继续监听 / task watch / user watch / 监控任务进度 / 向我汇报任务情况 / 待处理决策 —
developmentapiproductivity