okx-defi
What it does
This skill lets the agent search for DeFi yield products and manage deposits, withdrawals, and rewards through the onchainos defi commands. It is for crypto users who want a single entry point for DeFi that is not tied to one protocol.
When to use it
- βWhen you want to find DeFi products with the best yield for a token.
- βWhen you want to deposit, stake, withdraw, or claim rewards without naming a specific protocol.
- βWhen you want an overview of your DeFi holdings and positions.
Skill link
https://github.com/internet-court/internet-court-skill/blob/main/vendored/okx/okx-defi/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βCan you find the best-yielding DeFi product for my USDC and show me my current DeFi positions?β
5 new skills a week. 1 minute to read.
How it works
The agent searches the aggregated product list, reads details such as APY and accepted tokens, and runs deposits or withdrawals with the defi commands. It also shows your positions and their details.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
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.mdinstead.
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
- 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. 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:
- 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 --allto get all account IDs, thenwallet switch <id>+wallet addressesfor 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 passtron; TON address β only passton - 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 positionsuses--chains(plural, comma-separated);defi position-detailuses--chain(singular)- For CLI parameter details, se
FAQ
What if I name a specific protocol?
The skill says to route named protocols such as Aave to the dApp discovery skill instead.
Does it show past yield history?
Yes. It covers APY history, TVL history, and price charts.
Where are errors and failed deposits explained?
The skill has a troubleshooting reference for errors and failed deposits.
Details
Original description by the author
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', 'A
Popularity
- GitHub stars
- 7.0k
- Ranking position
- #13663
- License
- β
- Updated
- 10/26/2026
Comments
- β¦
More skills from this repository
internet-court
7.0kHelps your agent pay, hire, or deal safely with another AI agent or paid service, and points it to the right specialized guide.
genlayer-erc7710-connector
7.0kHelps your agent connect an AI review result to a permission system, so a bad review can limit or cancel an agent's permissions.
genlayer-intelligent-contracts
7.0kHelps your agent define the rules, evidence and outputs of an AI judge that checks whether another agent followed its mandate.
x402-erc7710
7.0kHelps your agent pay for web services one request at a time, and set up ongoing spending that stays within a permission budget.
Similar skills
blucli
394kHelps your agent find, play, pause, group, and adjust the volume of Bluesound and NAD speakers through the blu command.
camsnap
394kHelps your agent grab snapshots, short clips, or motion events from network cameras and local webcams that you have set up.
eightctl
394kHelps your agent check and control an Eight Sleep pod, including its temperature, alarms, and sleep schedules.