Okx defi

From internet-court/internet-court-skill · View interactive version

Okx defi is an AI agent skill from the GitHub repository internet-court/internet-court-skill. 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-

How to use this skill

Skill file

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 Intent | Reference |

|---|---|

| Discover / search DeFi products, find best APY | invest.md |

| Product detail (APY, TVL, accepted tokens) | invest.md |

| Deposit / stake / provide liquidity | invest.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 charts | invest.md |

| View DeFi positions / holdings overview (持仓) | portfolio.md |

| Per-protocol position detail (持仓详情) | portfolio.md |

| Exact parameters / return schemas — invest & charts commands | invest-cli-reference.md |

| Exact parameters / return schemas — positions commands | portfolio-cli-reference.md |

| Errors / failed deposits / expired calldata | invest-troubleshooting.md |

| Errors / empty positions / address-format issues | portfolio-troubleshooting.md |

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

Skill Routing

Chain Support

CLI resolves chain names automatically (e.g. ethereum → 1, bsc → 56, solana → 501). 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:

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).

Global Notes

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.