skills/okx-defi-portfolio/SKILL.md
Use this skill to 'check my DeFi positions', 'view DeFi holdings', 'show my DeFi portfolio', 'what DeFi am I invested in', 'show my staking positions', 'show my lending positions', 'DeFi balance', 'DeFi 持仓', '查看DeFi持仓', '我的DeFi资产', '持仓详情', '持仓列表', or mentions viewing DeFi holdings, positions, portfolio across protocols — when the user does NOT name a specific DApp. Covers positions overview and per-protocol position detail. Do NOT use for deposit/redeem/claim operations — use okx-defi-invest. Do NOT use for wallet token balances — use okx-agentic-wallet. Do NOT use for DEX spot swaps — use okx-agentic-wallet. Do NOT use when the user names a specific third-party DApp by name (e.g. 'show my Aave positions', 'my Hyperliquid balance', 'check my Polymarket holdings') — route to okx-dapp-discovery instead, which loads the DApp's plugin for protocol-native position views.
npx skillsauth add okx/onchainos-skills okx-defi-portfolioInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
2 commands for viewing DeFi positions and holdings across protocols and chains.
okx-defi-investokx-dex-marketokx-agentic-walletokx-agentic-wallet# Get DeFi holdings overview across chains
onchainos defi positions \
--address 0xYourWallet \
--chains ethereum,bsc,solana
# Get detailed holdings for a specific protocol (analysisPlatformId from positions output)
onchainos defi position-detail \
--address 0xYourWallet \
--chain ethereum \
--platform-id 67890
| # | Command | Description |
|---|---------|-------------|
| 1 | onchainos defi support-chains | Get supported chains for DeFi |
| 2 | onchainos defi support-platforms | Get supported platforms for DeFi |
| 3 | onchainos defi positions --address <addr> --chains <chains> | Get user DeFi holdings overview |
| 4 | onchainos defi position-detail --address <addr> --chain <chain> --platform-id <id> | Get detailed holdings for a protocol |
| Chain | Name / Aliases | chainIndex |
|-------|----------------|-----------|
| Ethereum | ethereum, eth | 1 |
| BSC | bsc, bnb | 56 |
| Polygon | polygon, matic | 137 |
| Arbitrum | arbitrum, arb | 42161 |
| Base | base | 8453 |
| X Layer | xlayer, okb | 196 |
| Avalanche | avalanche, avax | 43114 |
| Optimism | optimism, op | 10 |
| Fantom | fantom, ftm | 250 |
| Sui | sui | 784 |
| Tron | tron, trx | 195 |
| TON | ton | 607 |
| Linea | linea | 59144 |
| Scroll | scroll | 534352 |
| zkSync | zksync | 324 |
| Solana | solana, sol | 501 |
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:
okx-agentic-wallet) or provide an address manuallywallet balance --all to get all account IDs, then wallet switch <id> + wallet addresses for each account, and query positions for each| User says | Action |
|-----------|--------|
| View positions / portfolio / holdings | onchainos defi positions |
| View detail for a protocol | onchainos defi position-detail |
| Redeem / claim after viewing | Suggest → use okx-defi-invest |
defi positions first to get analysisPlatformIdWhen displaying defi positions output, you MUST use exactly these columns in this order — no substitutions, no omissions:
| # | Platform | analysisPlatformId | Chains | Positions | Value(USD) | |---|---------|--------------------|----|--------|-----------| | 1 | Aave V3 | 12345 | ETH,BSC | 2 | $120.00 |
Rules:
analysisPlatformId is MANDATORY in every row — users must copy this value to run position-detailanalysisPlatformId with any other fieldwalletIdPlatformList[*].platformList[*] — each element is one platform row
platformName → PlatformanalysisPlatformId → analysisPlatformIdnetworkBalanceList[*].network → Chains (join with comma)investmentCount → PositionscurrencyAmount → Value(USD)Output shape: { "ok": true, "data": [ { "walletIdPlatformDetailList": [...] }, ... ] } — data is an array. Never call .get() on data directly; iterate over it as a list.
When displaying defi position-detail output, render all tokens in a single flat table with these exact columns:
| Type | Asset | Amount | Value(USD) | investmentId | aggregateProductId | Token Contract | Rewards | |------|------|------|-----------|--------------|--------------------|-----------|------| | Supply | USDT | 1.002285 | $1.0025 | 127 | 71931 | 0x970223...7 | 0.000080 AVAX | | Pending | sAVAX | 0.00000091 | $0.000012 | – | – | – | Platform reward |
Rules:
investmentId and aggregateProductId from its parent investment entryinvestmentId is MANDATORY in every row — users need it for redeem/claim (via okx-defi-invest)aggregateProductId — show if present, otherwise –– if native/empty– if none; for platform rewards show Platform rewardPendinghealthRate < 1.5For V3 Pool positions (positionList present), show an additional section per position:
| tokenId | Status | Range | tickLower | tickUpper | |---------|--------|-------|-----------|-----------| | 93828 | ACTIVE | 0.892 – 0.992 USDC/DAI | -33500 | -30450 |
tokenId: from positionList[].tokenIdpositionStatus: ACTIVE or INACTIVErange: from positionList[].rangetickLower / tickUpper: from positionList[].rangeInfo.tickLower / rangeInfo.tickUpper| investType | Description | |------------|-------------| | 1 | Save (savings/yield) | | 2 | Pool (liquidity pool) | | 3 | Farm (yield farming) | | 4 | Vaults | | 5 | Stake | | 6 | Borrow | | 7 | Staking | | 8 | Locked | | 9 | Deposit | | 10 | Vesting |
| Just completed | Suggest |
|----------------|---------|
| defi positions | 1. View detail → defi position-detail 2. Redeem → okx-defi-invest 3. Claim rewards → okx-defi-invest |
| defi position-detail | 1. Redeem position → use okx-defi-invest with investmentId from table 2. Claim rewards → use okx-defi-invest 3. Add more → use okx-defi-invest |
| defi position-detail (V3 Pool) | 1. View depth chart → defi depth-price-chart --investment-id <id> (via okx-defi-invest) 2. View price history → defi depth-price-chart --investment-id <id> --chart-type PRICE |
--address and --chains parameters must be compatible. EVM addresses (0x…) can only query EVM chains; Solana addresses (base58) can only query solana. Never mix them in a single call — 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,zksyncsolanasuiT…) → only pass trontondefi positions uses --chains (plural, comma-separated, e.g. --chains ethereum,bsc) — do NOT use --chaindefi position-detail uses --chain (singular) — do NOT use --chains--address for both commandsposition-detail requires analysisPlatformId from positions output as --platform-idethereum → 1, bsc → 56, solana → 501)testing
OKX-aggregated DeFi (no specific DApp named) — product discovery, deposit/withdraw/claim execution, AND positions viewing. **If the user names ANY third-party protocol/DApp (Aave, Lido, PancakeSwap, Uniswap, Curve, Compound, Morpho, Pendle, Kamino, Raydium, Hyperliquid, Polymarket, …), route to okx-dapp-discovery — NOT here, even for 'show my Aave positions'.** INVEST triggers: 'invest in DeFi', 'earn yield', 'find best APY', 'deposit/stake for yield', 'search DeFi products', 'redeem/withdraw position', 'claim DeFi rewards', 'borrow against asset', 'repay loan', 'add/remove CLMM liquidity', 'APY/TVL history', 'depth chart', yield farming, lending, staking, liquidity pools. PORTFOLIO triggers: 'check my DeFi positions', 'view DeFi holdings/portfolio', 'my staking/lending positions', 'DeFi balance', 'DeFi 持仓', '我的DeFi资产'. Do NOT use for: DEX swaps (okx-agentic-wallet), token prices (okx-dex-market), wallet token balances (okx-agentic-wallet).
testing
ERC-8004 Agent identity: 注册/更新/上架/下架/搜索agent, register/update/activate/deactivate/search — User/ASP/Evaluator(买家/卖家/仲裁者); 我的agent/ASP, 找做X的ASP/agent有什么服务/endpoint怎么填/查口碑/传头像. + Task Marketplace: 发布/创建任务/接单/协商/验收/deliver/dispute/仲裁/拒绝/stake/unstake/change provider/change budget/修改卖家/修改预算/我的任务/my tasks/what am I working on/我的订阅/订阅列表/订阅详情/my subscriptions/what am I subscribed to/AI服务订阅(view AI-service subscriptions, buyer & ASP)/关闭/取消任务/决策列表/decision list/指定服务商/browse marketplace. + task watch: 监听任务进展/历史消息/未读消息/未决策/outstanding decisions. + okx-a2a missing/uninitialized. Match by meaning. MUST ACTIVATE on inbound envelopes: (1) {agentId, message:{source:"system", event, jobId,...}} system event; (2) {msgType:"a2a-agent-chat", jobId, sender:{role},...} agent-to-agent task chat (sender.role = COUNTERPARTY, not you); (3) literal "Read the okx-ai skill" (or legacy "Read the okx-agent-task skill") in the envelope.
testing
Onchain OS onboarding & guide hub — the single entry for first-time, 'what is this / how do I use it', OKX.AI, and customer-support intents; classifies the intent and routes to the right sub-flow via its Intent Routing table. Covers: (1) Onchain OS onboarding + welcome banner — 'what is onchainos', 'what is onchain os', 'what can it do', 'what can onchainos do', 'what does onchainos do', 'how do I use this', 'how do I play', 'how to use onchainos', 'how to play onchainos', 'how does onchainos work', 'how do I start', 'getting started', 'tutorial', 'onboarding', 'first time', 'I just installed', 'now what', 'what do I do now', 'where do I start', 'who are you', 'what are you', 'introduce onchainos', 'tell me about onchainos', 'I'm new'; (2) OKX.AI intro & role-registration routing (the Agent economic system — roles User / ASP / Evaluator) — 'what is OKX.AI', 'OKX.AI 是什么', 'how to use OKX.AI', 'OKX.AI 快速开始', and any spelling / spacing / casing / typo variant (OKXAI, okx ai, okx-ai, lowercase okx.ai, 啥是okxai); (3) customer support / Help Center — 'contact support', 'talk to a human', 'customer service', 'file a complaint', 'give feedback', 'report a bug / system error', 'help center', 'FAQ', 'user guide', 'something is broken'. NOT for: direct on-chain actions (swap / wallet / balance / token) or Agent task lifecycle (publish / accept / deliver / dispute) — those have their own skills.
testing
List OKX Agentic Wallet exclusive trading competitions, register users for contests, track participation and leaderboard rankings, and claim won rewards. Use when users want to list available trading competitions or trading cups, view competition rules / prize pool / total prizes, register or sign up or enroll or join a contest, check the leaderboard (who is winning) or their own rank (am I in the prize zone, what is my place), ask did I win or query participation / claim status, claim won rewards or prizes from completed competitions, see which wallet account they registered with, or submit Telegram / WeChat / Email / Twitter contact for prize delivery to top-tier winners.