
Okx Defi Invest
Wire OKX OnChainOS DeFi CLI commands into agents or scripts when researching yields, platforms, and chain support for crypto products.
Overview
OKX DeFi Invest is an agent skill for the Build phase that documents OKX OnChainOS CLI DeFi commands so solo builders can query chains, platforms, and invest actions from the terminal.
Install
npx skills add https://github.com/okx/onchainos-skills --skill okx-defi-investWhat is this skill?
- Reference for 15 OnChainOS DeFi CLI commands with parameter tables and return schemas
- Discover supported chains (`chainIndex`, `network`) across ETH, BSC, Polygon, Arbitrum, Base, and more
- List DeFi platforms with `analysisPlatformId`, `platformName`, and `investmentCount` for filtering products
- Structured JSON examples for piping command output into agent workflows or backend jobs
- Platform IDs feed `--platform-id` on downstream invest and analytics commands
- 15 DeFi CLI commands documented in the skill reference
Adoption & trust: 3.7k installs on skills.sh; 284 GitHub stars; 1/3 security scanners passed (skills.sh audits).
What problem does it solve?
You want to script or agent-drive OKX DeFi flows but lack a single, field-accurate map of CLI commands and response schemas.
Who is it for?
Indie builders adding OKX OnChainOS DeFi discovery or invest steps to CLI tools, cron jobs, or coding agents already comfortable with on-chain products.
Skip if: Builders who need non-OKX DEX aggregation, automated trade execution without reviewing OKX docs, or DeFi strategy advice with no custom integration code.
When should I use this skill?
You are implementing or debugging OKX OnChainOS `defi` subcommands and need parameter tables and example JSON output.
What do I get? / Deliverables
After using the skill, your agent or script calls the correct `onchainos defi` commands with the right flags and parses documented return fields into your product.
- Correct `onchainos defi` invocations with documented flags
- Parsed chain and platform metadata for downstream app logic
Recommended Skills
Journey fit
DeFi invest commands are integration surface area you add while building wallets, dashboards, or trading automations—not a launch or growth tactic on their own. The skill documents 15 `onchainos defi` subcommands (chains, platforms, products, invest flows) meant to be called from your build-time tooling.
How it compares
Use as a CLI command cheat sheet for OKX DeFi, not as a generic MCP server or portfolio analytics SaaS.
Common Questions / FAQ
Who is okx-defi-invest for?
Solo and indie developers building Web3 or fintech side projects who standardize on OKX OnChainOS and need DeFi CLI semantics inside Claude Code, Cursor, or similar agents.
When should I use okx-defi-invest?
During Build when wiring integrations: listing supported chains and platforms, fetching product metadata, and drafting invest-related shell steps before you ship a bot or dashboard.
Is okx-defi-invest safe to install?
Treat it as documentation for commands that can move real funds; review the Security Audits panel on this Prism page and never paste private keys into agent chats.
SKILL.md
READMESKILL.md - Okx Defi Invest
# OKX DeFi — CLI Command Reference Detailed parameter tables, return field schemas, and usage examples for all 15 DeFi commands. ## 1. onchainos defi support-chains Get all chains currently supported by DeFi products. ```bash onchainos defi support-chains ``` No parameters. **Return fields** (array): | Field | Type | Description | |---|---|---| | `chainIndex` | String | Chain ID (e.g. `"1"` = Ethereum, `"56"` = BSC) | | `network` | String | Network identifier (e.g. `"ETH"`, `"BSC"`, `"POLYGON"`) | **Example output:** ```json [ {"chainIndex": "1", "network": "ETH"}, {"chainIndex": "56", "network": "BSC"}, {"chainIndex": "137", "network": "POLYGON"}, {"chainIndex": "42161", "network": "ARBITRUM"}, {"chainIndex": "8453", "network": "BASE"} ] ``` --- ## 2. onchainos defi support-platforms Get all DeFi platforms and their product counts. ```bash onchainos defi support-platforms ``` No parameters. **Return fields** (array): | Field | Type | Description | |---|---|---| | `analysisPlatformId` | String | Platform ID (used in `--platform-id` for other commands) | | `platformName` | String | Platform display name (e.g. `"Aave V3"`, `"Lido"`) | | `investmentCount` | Integer | Number of products on this platform | **Example output:** ```json [ {"analysisPlatformId": "10", "platformName": "Aave V3", "investmentCount": 68}, {"analysisPlatformId": "20", "platformName": "Lido", "investmentCount": 1}, {"analysisPlatformId": "30", "platformName": "PancakeSwap V3", "investmentCount": 120} ] ``` --- ## 3. onchainos defi list List all DeFi products by APY (no filters, paginated). ```bash onchainos defi list [--page-num <n>] ``` | Param | Required | Default | Description | |---|---|---|---| | `--page-num` | No | 1 | Page number (page size fixed at 20) | > Internally calls the same API as `defi search` with no filters. Returns products sorted by APY descending. **Return fields**: Same as `defi search` (see below). --- ## 4. onchainos defi search Search DeFi products across chains (earn, pools, lending). ```bash onchainos defi search --token <tokens> [--platform <names>] [--chain <chain>] [--product-group <group>] [--page-num <n>] ``` | Param | Required | Default | Description | |---|---|---|---| | `--token` | No* | — | Comma-separated token keywords (e.g. `"USDC,ETH"`) | | `--platform` | No* | — | Comma-separated platform keywords (e.g. `"Aave,Compound"`) | | `--chain` | No | — | Chain name (e.g. `ethereum`, `bsc`, `solana`) | | `--product-group` | No | `SINGLE_EARN` | Product group filter (see table below) | | `--page-num` | No | 1 | Page number (page size fixed at 20) | **`--product-group` values**: | Value | Description | |---|---| | `SINGLE_EARN` | Single token earn (savings, staking, vaults) | | `DEX_POOL` | DEX liquidity pools (V2/V3 LP) | | `LENDING` | Lending protocols (supply & borrow) | > \* At least one of `--token` or `--platform` is **required**. CLI will error if both are omitted. **Return fields** (`data` object): | Field | Type | Description | |---|---|---| | `total` | Integer | Total number of matching products | | `list[].investmentId` | Long | Product ID — used in `detail`, `prepare`, `deposit` | | `list[].name` | String | Product name | | `list[].platformName` | String | Protocol name (e.g. `"Aave V3"`, `"Compound V3"`) | | `list[].rate` | String | APY as decimal (e.g. `"0.01820"` = 1.82%) | | `list[].tvl` | String | Total Value Locked in USD | | `list[].chainIndex` | String | Chain identifier | | `list[].feeRate` | String | Protocol fee rate (nullable) | | `list[].detailPath` | String | Detail page path (nullable) | --- ## 5. onchainos defi detail Get full product details and live APY. ```bash onchainos defi detail --investment-id <id> ``` | Param | Required | Default | Description | |---|---|---|---| | `--investment-id` | Yes | — | Investment ID from `defi search` results | **Return fields** (per API doc): | Field | Type | Description | |---|---|---| | `investmentId` | Lo