[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6GT3E6H453XVWXMV8TPBQ39":3,"skill-same:01M6GT3E6H453XVWXMV8TPBQ39":97},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":42,"linkOnly":43,"markdownContent":44,"markdownBody":45,"frontMatter":46,"refName":60,"commitSha":61,"skillDirectory":62,"forksCount":63,"repositoryHtmlUrl":64,"repositoryHomepageUrl":6,"ownerHtmlUrl":65,"ownerBlogUrl":66,"ownerDescription":67,"updatedAt":68,"install":69,"resources":82},"01M6GT3E6H453XVWXMV8TPBQ39","okx-cex-trade",null,"This skill should be used when the user asks to 'buy BTC', 'sell ETH', 'place a limit order', 'place a market order', 'cancel my order', 'amend my order', 'long BTC perp', 'short ETH swap', 'open a position', 'close a position', 'set take profit', 'set stop loss', 'add a trailing stop', 'set leverage', 'check my orders', 'order status', 'fill history', 'trade history', 'buy a call', 'sell a put', 'buy call option', 'sell put option', 'option chain', 'implied volatility', 'IV', 'option Greeks', 'delta', 'gamma', 'theta', 'vega', 'delta hedge', 'option order', 'option position', 'option fills', or any request to place\u002Fcancel\u002Famend spot, perpetual swap, delivery futures, or options orders on OKX CEX. Covers spot trading, swap\u002Fperpetual contracts, delivery futures, options (calls\u002Fputs, Greeks, IV), and conditional (TP\u002FSL\u002Ftrailing) algo orders. Requires API credentials. Do NOT use for market data (use okx-cex-market), account balance\u002Fpositions (use okx-cex-portfolio), or grid\u002FDCA bots (use okx-cex-bot).","jiayaoqijia\u002Fcryptoskill","jiayaoqijia","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F1453879?v=4","01M6GMYTX7Q7S504VC6E756ENR","YQ","01M6GMYV1QKJ1CC75MTTGT9PR0",81,"MIT","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fokx-cex-trade\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41],"okx cex trade","cex","trade","okx","when","bot","order status","market data","profit","chain","leverage","dca","bots","portfolio","short","option","open","api","credentials","SET","Volatility","futures","cli","2026-11-10 10:12:30",false,"---\nname: okx-cex-trade\ndescription: \"This skill should be used when the user asks to 'buy BTC', 'sell ETH', 'place a limit order', 'place a market order', 'cancel my order', 'amend my order', 'long BTC perp', 'short ETH swap', 'open a position', 'close a position', 'set take profit', 'set stop loss', 'add a trailing stop', 'set leverage', 'check my orders', 'order status', 'fill history', 'trade history', 'buy a call', 'sell a put', 'buy call option', 'sell put option', 'option chain', 'implied volatility', 'IV', 'option Greeks', 'delta', 'gamma', 'theta', 'vega', 'delta hedge', 'option order', 'option position', 'option fills', or any request to place\u002Fcancel\u002Famend spot, perpetual swap, delivery futures, or options orders on OKX CEX. Covers spot trading, swap\u002Fperpetual contracts, delivery futures, options (calls\u002Fputs, Greeks, IV), and conditional (TP\u002FSL\u002Ftrailing) algo orders. Requires API credentials. Do NOT use for market data (use okx-cex-market), account balance\u002Fpositions (use okx-cex-portfolio), or grid\u002FDCA bots (use okx-cex-bot).\"\nlicense: MIT\nmetadata:\n  author: okx\n  version: \"1.0.0\"\n  homepage: \"https:\u002F\u002Fwww.okx.com\"\n  agent:\n    requires:\n      bins: [\"okx\"]\n    install:\n      - id: npm\n        kind: node\n        package: \"@okx_ai\u002Fokx-trade-cli\"\n        bins: [\"okx\"]\n        label: \"Install okx CLI (npm)\"\n---\n\n# OKX CEX Trading CLI\n\nSpot, perpetual swap, delivery futures, and **options** order management on OKX exchange. Place, cancel, amend, and monitor orders; query option chains and Greeks; set take-profit\u002Fstop-loss and trailing stops; manage leverage and positions. **Requires API credentials.**\n\n## Prerequisites\n\n1. Install `okx` CLI:\n   ```bash\n   npm install -g @okx_ai\u002Fokx-trade-cli\n   ```\n2. Configure credentials:\n   ```bash\n   okx config init\n   ```\n   Or set environment variables:\n   ```bash\n   export OKX_API_KEY=your_key\n   export OKX_SECRET_KEY=your_secret\n   export OKX_PASSPHRASE=your_passphrase\n   ```\n3. Test with demo mode (simulated trading, no real funds):\n   ```bash\n   okx --profile demo spot orders\n   ```\n\n## Credential & Profile Check\n\n**Run this check before any authenticated command.**\n\n### Step A — Verify credentials\n\n```bash\nokx config show       # verify configuration status (output is masked)\n```\n\n- If the command returns an error or shows no configuration: **stop all operations**, guide the user to run `okx config init`, and wait for setup to complete before retrying.\n- If credentials are configured: proceed to Step B.\n\n### Step B — Confirm profile (required)\n\n`--profile` is **required** for all authenticated commands. Never add a profile implicitly.\n\n| Value | Mode | Funds |\n|---|---|---|\n| `live` | 实盘 | Real funds |\n| `demo` | 模拟盘 | Simulated funds |\n\n**Resolution rules:**\n1. Current message intent is clear (e.g. \"real\" \u002F \"实盘\" \u002F \"live\" → `live`; \"test\" \u002F \"模拟\" \u002F \"demo\" → `demo`) → use it and inform the user: `\"Using --profile live (实盘)\"` or `\"Using --profile demo (模拟盘)\"`\n2. Current message has no explicit declaration → check conversation context for a previous profile:\n   - Found → use it, inform user: `\"Continuing with --profile live (实盘) from earlier\"`\n   - Not found → ask: `\"Live (实盘) or Demo (模拟盘)?\"` — wait for answer before proceeding\n\n### Handling 401 Authentication Errors\n\nIf any command returns a 401 \u002F authentication error:\n1. **Stop immediately** — do not retry the same command\n2. Inform the user: \"Authentication failed (401). Your API credentials may be invalid or expired.\"\n3. Guide the user to update credentials by editing the file directly with their local editor:\n   ```\n   ~\u002F.okx\u002Fconfig.toml\n   ```\n   Update the fields `api_key`, `secret_key`, `passphrase` under the relevant profile.\n   Do NOT paste the new credentials into chat.\n4. After the user confirms the file is updated, run `okx config show` to verify (output is masked)\n5. Only then retry the original operation\n\n## Demo vs Live Mode\n\nProfile is the single control for 实盘\u002F模拟盘 switching — exactly two options:\n\n| `--profile` | Mode | Funds |\n|---|---|---|\n| `live` | 实盘 | Real money — irreversible |\n| `demo` | 模拟盘 | Simulated — no real funds |\n\n```bash\nokx --profile live  spot place ...    # 实盘 — real funds\nokx --profile demo  spot place ...    # 模拟盘 — simulated funds\n```\n\n**Rules:**\n1. `--profile` is **required** on every authenticated command — determined in \"Credential & Profile Check\" Step B\n2. Every response after a command must append: `[profile: live]` or `[profile: demo]`\n3. Do **not** use the `--demo` flag for mode switching — use `--profile` instead\n\n### Example\n\n```\nUser: \"Buy 0.01 BTC\"\nAgent: \"Live (实盘) or Demo (模拟盘)?\"\nUser: \"Demo\"\nAgent runs: okx --profile demo spot place --instId BTC-USDT --side buy --ordType market --sz 0.01\nAgent replies: \"Order placed: 7890123456 (OK) — simulated, no real funds used. [profile: demo]\"\n```\n\n## Skill Routing\n\n- For market data (prices, charts, depth, funding rates) → use `okx-cex-market`\n- For account balance, P&L, positions, fees, transfers → use `okx-cex-portfolio`\n- For regular spot\u002Fswap\u002Ffutures\u002Foptions\u002Falgo orders → use `okx-cex-trade` (this skill)\n- For grid and DCA trading bots → use `okx-cex-bot`\n\n## Quickstart\n\n```bash\n# Market buy 0.01 BTC (spot)\nokx spot place --instId BTC-USDT --side buy --ordType market --sz 0.01\n\n# Limit sell 0.01 BTC at $100,000 (spot)\nokx spot place --instId BTC-USDT --side sell --ordType limit --sz 0.01 --px 100000\n\n# Long 1 contract BTC perp (cross margin)\nokx swap place --instId BTC-USDT-SWAP --side buy --ordType market --sz 1 \\\n  --tdMode cross --posSide long\n\n# Close BTC perp long position entirely at market\nokx swap close --instId BTC-USDT-SWAP --mgnMode cross --posSide long\n\n# Set 10x leverage on BTC perp (cross)\nokx swap leverage --instId BTC-USDT-SWAP --lever 10 --mgnMode cross\n\n# Set TP\u002FSL on a spot BTC position (sell when price hits $105k, SL at $88k)\nokx spot algo place --instId BTC-USDT --side sell --ordType oco --sz 0.01 \\\n  --tpTriggerPx 105000 --tpOrdPx -1 \\\n  --slTriggerPx 88000 --slOrdPx -1\n\n# Place trailing stop on BTC perp long (callback 2%)\nokx swap algo trail --instId BTC-USDT-SWAP --side sell --sz 1 \\\n  --tdMode cross --posSide long --callbackRatio 0.02\n\n# View open spot orders\nokx spot orders\n\n# View open swap positions\nokx swap positions\n\n# Cancel a spot order\nokx spot cancel --instId BTC-USDT --ordId \u003CordId>\n```\n\n## Command Index\n\n### Spot Orders\n\n| # | Command | Type | Description |\n|---|---|---|---|\n| 1 | `okx spot place` | WRITE | Place spot order (market\u002Flimit\u002Fpost_only\u002Ffok\u002Fioc) |\n| 2 | `okx spot cancel` | WRITE | Cancel spot order |\n| 3 | `okx spot amend` | WRITE | Amend spot order price or size |\n| 4 | `okx spot algo place` | WRITE | Place spot TP\u002FSL algo order |\n| 5 | `okx spot algo amend` | WRITE | Amend spot TP\u002FSL levels |\n| 6 | `okx spot algo cancel` | WRITE | Cancel spot algo order |\n| 7 | `okx spot orders` | READ | List open or historical spot orders |\n| 8 | `okx spot get` | READ | Single spot order details |\n| 9 | `okx spot fills` | READ | Spot trade fill history |\n| 10 | `okx spot algo orders` | READ | List spot TP\u002FSL algo orders |\n\n### Swap \u002F Perpetual Orders\n\n| # | Command | Type | Description |\n|---|---|---|---|\n| 11 | `okx swap place` | WRITE | Place perpetual swap order |\n| 12 | `okx swap cancel` | WRITE | Cancel swap order |\n| 13 | `okx swap amend` | WRITE | Amend swap order price or size |\n| 14 | `okx swap close` | WRITE | Close entire position at market |\n| 15 | `okx swap leverage` | WRITE | Set leverage for an instrument |\n| 16 | `okx swap algo place` | WRITE | Place swap TP\u002FSL algo order |\n| 17 | `okx swap algo trail` | WRITE | Place swap trailing stop order |\n| 18 | `okx swap algo amend` | WRITE | Amend swap algo order |\n| 19 | `okx swap algo cancel` | WRITE | Cancel swap algo order |\n| 20 | `okx swap positions` | READ | Open perpetual swap positions |\n| 21 | `okx swap orders` | READ | List open or historical swap orders |\n| 22 | `okx swap get` | READ | Single swap order details |\n| 23 | `okx swap fills` | READ | Swap trade fill history |\n| 24 | `okx swap get-leverage` | READ | Current leverage settings |\n| 25 | `okx swap algo orders` | READ | List swap algo orders |\n\n### Futures \u002F Delivery Orders\n\n| # | Command | Type | Description |\n|---|---|---|---|\n| 26 | `okx futures place` | WRITE | Place delivery futures order |\n| 27 | `okx futures cancel` | WRITE | Cancel delivery futures order |\n| 28 | `okx futures orders` | READ | List delivery futures orders |\n| 29 | `okx futures positions` | READ | Open delivery futures positions |\n| 30 | `okx futures fills` | READ | Delivery futures fill history |\n| 31 | `okx futures get` | READ | Single delivery futures order details |\n\n### Options Orders\n\n| # | Command | Type | Description |\n|---|---|---|---|\n| 32 | `okx option instruments` | READ | Option chain: list available contracts for an underlying |\n| 33 | `okx option greeks` | READ | Implied volatility + Greeks (delta\u002Fgamma\u002Ftheta\u002Fvega) by underlying |\n| 34 | `okx option place` | WRITE | Place option order (call or put, buyer or seller) |\n| 35 | `okx option cancel` | WRITE | Cancel unfilled option order |\n| 36 | `okx option amend` | WRITE | Amend option order price or size |\n| 37 | `okx option batch-cancel` | WRITE | Batch cancel up to 20 option orders |\n| 38 | `okx option orders` | READ | List option orders (live \u002F history \u002F archive) |\n| 39 | `okx option get` | READ | Single option order details |\n| 40 | `okx option positions` | READ | Open option positions with live Greeks |\n| 41 | `okx option fills` | READ | Option trade fill history |\n\n## Cross-Skill Workflows\n\n### Spot market buy\n> User: \"Buy $500 worth of ETH at market\"\n\n```\n1. okx-cex-market    okx market ticker ETH-USDT             → get current price to estimate sz\n2. okx-cex-portfolio okx account balance USDT               → confirm available funds ≥ $500\n        ↓ user approves\n3. okx-cex-trade     okx spot place --instId ETH-USDT --side buy --ordType market --sz \u003Csz>\n4. okx-cex-trade     okx spot fills --instId ETH-USDT        → confirm fill price and size\n```\n\n### Open long BTC perp with TP\u002FSL\n> User: \"Long 5 contracts BTC perp at market, TP at $105k, SL at $88k\"\n\n```\n1. okx-cex-portfolio okx account balance USDT               → confirm margin available\n2. okx-cex-portfolio okx account max-size --instId BTC-USDT-SWAP --tdMode cross → confirm size ok\n        ↓ user approves\n3. okx-cex-trade     okx swap place --instId BTC-USDT-SWAP --side buy \\\n                       --ordType market --sz 5 --tdMode cross --posSide long\n4. okx-cex-trade     okx swap algo place --instId BTC-USDT-SWAP --side sell \\\n                       --ordType oco --sz 5 --tdMode cross --posSide long \\\n                       --tpTriggerPx 105000 --tpOrdPx -1 \\\n                       --slTriggerPx 88000 --slOrdPx -1\n5. okx-cex-trade     okx swap positions                     → confirm position opened\n```\n\n### Adjust leverage then place order\n> User: \"Set BTC perp to 5x leverage then go long 10 contracts\"\n\n```\n1. okx-cex-trade     okx swap get-leverage --instId BTC-USDT-SWAP --mgnMode cross → check current lever\n        ↓ user approves change\n2. okx-cex-trade     okx swap leverage --instId BTC-USDT-SWAP --lever 5 --mgnMode cross\n3. okx-cex-trade     okx swap place --instId BTC-USDT-SWAP --side buy \\\n                       --ordType market --sz 10 --tdMode cross --posSide long\n4. okx-cex-trade     okx swap positions                     → confirm position + leverage\n```\n\n### Place trailing stop on open position\n> User: \"Set a 3% trailing stop on my BTC perp long\"\n\n```\n1. okx-cex-trade     okx swap positions                     → confirm size of open long\n2. okx-cex-market    okx market ticker BTC-USDT-SWAP        → current price reference\n        ↓ user approves\n3. okx-cex-trade     okx swap algo trail --instId BTC-USDT-SWAP --side sell \\\n                       --sz \u003Cpos_size> --tdMode cross --posSide long --callbackRatio 0.03\n4. okx-cex-trade     okx swap algo orders --instId BTC-USDT-SWAP → confirm trail order placed\n```\n\n### Cancel all open spot orders\n> User: \"Cancel all my open BTC spot orders\"\n\n```\n1. okx-cex-trade     okx spot orders                        → list open orders\n2. okx-cex-trade     (for each ordId) okx spot cancel --instId BTC-USDT --ordId \u003Cid>\n3. okx-cex-trade     okx spot orders                        → confirm all cancelled\n```\n\n### Buy a BTC call option\n> User: \"Buy 2 BTC call options at strike 95000 expiring end of March\"\n\n```\n1. okx-cex-trade     okx option instruments --uly BTC-USD --expTime 250328\n                     → find exact instId (e.g. BTC-USD-250328-95000-C)\n2. okx-cex-trade     okx option greeks --uly BTC-USD --expTime 250328\n                     → check IV, delta, and markPx to assess fair value\n3. okx-cex-portfolio okx account balance                    → confirm enough USDT\u002FBTC for premium\n        ↓ user approves\n4. okx-cex-trade     okx option place --instId BTC-USD-250328-95000-C \\\n                       --side buy --ordType limit --tdMode cash --sz 2 --px 0.005\n5. okx-cex-trade     okx option orders                      → confirm order is live\n```\n\n### Check option portfolio Greeks\n> User: \"What's my total delta exposure from options?\"\n\n```\n1. okx-cex-trade     okx option positions                   → live positions with per-contract Greeks\n2. okx-cex-market    okx market ticker BTC-USD              → current spot price for context\n```\n\n## Operation Flow\n\n### Step 0 — Credential & Profile Check\n\nBefore any authenticated command:\n\n**Determine profile (required):**\n- Options: `live` (实盘) or `demo` (模拟盘) — exactly these two values\n1. Current message intent clear (e.g. \"real\"\u002F\"实盘\"\u002F\"live\" → live; \"test\"\u002F\"模拟\"\u002F\"demo\" → demo) → use it, inform user: `\"Using --profile live (实盘)\"`\n2. Current message has no explicit declaration → check conversation context for previous profile:\n   - Found → use it, inform user: `\"Continuing with --profile live (实盘) from earlier\"`\n   - Not found → ask: `\"Live (实盘) or Demo (模拟盘)?\"` — wait for answer\n\n**If no credentials configured:** guide user to run `okx config init`, stop all trading actions\n\n**After every command result:** append `[profile: live]` or `[profile: demo]` to the response\n\n### Step 1: Identify instrument type and action\n\n**Spot** (instId format: `BTC-USDT`):\n- Place\u002Fcancel\u002Famend order → `okx spot place\u002Fcancel\u002Famend`\n- TP\u002FSL conditional → `okx spot algo place\u002Famend\u002Fcancel`\n- Query → `okx spot orders\u002Fget\u002Ffills\u002Falgo orders`\n\n**Swap\u002FPerpetual** (instId format: `BTC-USDT-SWAP`):\n- Place\u002Fcancel\u002Famend order → `okx swap place\u002Fcancel\u002Famend`\n- Close position → `okx swap close`\n- Leverage → `okx swap leverage` \u002F `okx swap get-leverage`\n- TP\u002FSL conditional → `okx swap algo place\u002Famend\u002Fcancel`\n- Trailing stop → `okx swap algo trail`\n- Query → `okx swap positions\u002Forders\u002Fget\u002Ffills\u002Fget-leverage\u002Falgo orders`\n\n**Futures\u002FDelivery** (instId format: `BTC-USDT-250328`):\n- Place\u002Fcancel order → `okx futures place\u002Fcancel`\n- Query → `okx futures orders\u002Fpositions\u002Ffills\u002Fget`\n\n**Options** (instId format: `BTC-USD-250328-95000-C` or `...-P`):\n- Step 1 (required): find valid instId → `okx option instruments --uly BTC-USD`\n- Step 2 (recommended): check IV and Greeks → `okx option greeks --uly BTC-USD`\n- Place\u002Fcancel\u002Famend order → `okx option place\u002Fcancel\u002Famend`\n- Batch cancel → `okx option batch-cancel --orders '[...]'`\n- Query → `okx option orders\u002Fget\u002Fpositions\u002Ffills`\n- **tdMode**: `cash` for buyers (full premium upfront, no liquidation risk); `cross` or `isolated` for sellers (margin required)\n\n### Step 2: Confirm profile (determined in Step 0), then confirm write parameters\n\n**Read commands** (orders, positions, fills, get, get-leverage, algo orders): run immediately; note the profile used.\n\n- `--history` flag: defaults to active\u002Fopen; use `--history` only if user explicitly asks for history\n- `--ordType` for algo: `conditional` = single TP or SL; `oco` = both TP and SL together\n- `--tdMode` for swap\u002Ffutures: `cross` or `isolated`; spot always uses `cash` (set automatically)\n- `--posSide` for hedge mode: `long` or `short`; omit in net mode\n\n**Write commands** (place, cancel, amend, close, leverage, algo): two confirmations required:\n\n1. **Profile** — determined in Step 0; use `--profile live` (实盘) or `--profile demo` (模拟盘)\n2. **Confirm parameters** — confirm the key order details once before executing:\n   - Spot place: confirm `--instId`, `--side`, `--ordType`, `--sz`; price (`--px`) required for limit orders\n   - Swap place: confirm `--instId`, `--side`, `--sz`, `--tdMode`; confirm `--posSide` if in hedge mode\n   - Swap close: confirm `--instId`, `--mgnMode`, `--posSide`; closes the entire position at market\n   - Swap leverage: confirm new leverage and impact on existing positions; cannot exceed exchange max\n   - Algo place (TP\u002FSL): confirm trigger prices; use `--tpOrdPx -1` for market execution at trigger\n   - Algo trail: confirm `--callbackRatio` (e.g., `0.02` = 2%) or `--callbackSpread` (fixed price spread)\n\n### Step 3: Verify after writes\n\n- After `spot place`: run `okx spot orders` to confirm order is live or `okx spot fills` if market order\n- After `swap place`: run `okx swap orders` or `okx swap positions` to confirm\n- After `swap close`: run `okx swap positions` to confirm position size is 0\n- After algo place: run `okx spot algo orders` or `okx swap algo orders` to confirm algo is active\n- After cancel: run `okx spot orders` \u002F `okx swap orders` to confirm order is gone\n\n## CLI Command Reference\n\n### Order Type Reference\n\n| `--ordType` | Description | Requires `--px` |\n|---|---|---|\n| `market` | Fill immediately at best price | No |\n| `limit` | Fill at specified price or better | Yes |\n| `post_only` | Limit order; cancelled if it would be a taker | Yes |\n| `fok` | Fill entire order immediately or cancel | Yes |\n| `ioc` | Fill what's available immediately, cancel rest | Yes |\n| `conditional` | Algo: single TP or SL trigger | No (set trigger px) |\n| `oco` | Algo: TP + SL together (one cancels other) | No (set both trigger px) |\n| `move_order_stop` | Trailing stop (swap only) | No (set callback) |\n\n---\n\n### Spot — Place Order\n\n```bash\nokx spot place --instId \u003Cid> --side \u003Cbuy|sell> --ordType \u003Ctype> --sz \u003Cn> \\\n  [--px \u003Cprice>] [--json]\n```\n\n| Param | Required | Default | Description |\n|---|---|---|---|\n| `--instId` | Yes | - | Spot instrument (e.g., `BTC-USDT`) |\n| `--side` | Yes | - | `buy` or `sell` |\n| `--ordType` | Yes | - | `market`, `limit`, `post_only`, `fok`, `ioc` |\n| `--sz` | Yes | - | Order size in base currency (e.g., BTC amount) |\n| `--px` | Cond. | - | Price — required for `limit`, `post_only`, `fok`, `ioc` |\n\n---\n\n### Spot — Cancel Order\n\n```bash\nokx spot cancel --instId \u003Cid> --ordId \u003Cid> [--json]\n```\n\n---\n\n### Spot — Amend Order\n\n```bash\nokx spot amend --instId \u003Cid> [--ordId \u003Cid>] [--clOrdId \u003Cid>] \\\n  [--newSz \u003Cn>] [--newPx \u003Cp>] [--json]\n```\n\nMust provide at least one of `--newSz` or `--newPx`.\n\n---\n\n### Spot — Place Algo (TP\u002FSL)\n\n```bash\nokx spot algo place --instId \u003Cid> --side \u003Cbuy|sell> --ordType \u003Coco|conditional> --sz \u003Cn> \\\n  [--tpTriggerPx \u003Cp>] [--tpOrdPx \u003Cp|-1>] \\\n  [--slTriggerPx \u003Cp>] [--slOrdPx \u003Cp|-1>] \\\n  [--json]\n```\n\n| Param | Required | Default | Description |\n|---|---|---|---|\n| `--tpTriggerPx` | Cond. | - | Take-profit trigger price |\n| `--tpOrdPx` | Cond. | - | TP order price; use `-1` for market execution |\n| `--slTriggerPx` | Cond. | - | Stop-loss trigger price |\n| `--slOrdPx` | Cond. | - | SL order price; use `-1` for market execution |\n\nFor `oco`: provide both TP and SL params. For `conditional`: provide only TP or only SL.\n\n---\n\n### Spot — Amend Algo\n\n```bash\nokx spot algo amend --instId \u003Cid> --algoId \u003Cid> \\\n  [--newSz \u003Cn>] [--newTpTriggerPx \u003Cp>] [--newTpOrdPx \u003Cp>] \\\n  [--newSlTriggerPx \u003Cp>] [--newSlOrdPx \u003Cp>] [--json]\n```\n\n---\n\n### Spot — Cancel Algo\n\n```bash\nokx spot algo cancel --instId \u003Cid> --algoId \u003Cid> [--json]\n```\n\n---\n\n### Spot — List Orders\n\n```bash\nokx spot orders [--instId \u003Cid>] [--history] [--json]\n```\n\n| Flag | Effect |\n|---|---|\n| *(default)* | Open\u002Fpending orders |\n| `--history` | Historical (filled, cancelled) orders |\n\n---\n\n### Spot — Get Order\n\n```bash\nokx spot get --instId \u003Cid> [--ordId \u003Cid>] [--clOrdId \u003Cid>] [--json]\n```\n\nReturns: `ordId`, `instId`, `side`, `ordType`, `px`, `sz`, `fillSz`, `avgPx`, `state`, `cTime`.\n\n---\n\n### Spot — Fills\n\n```bash\nokx spot fills [--instId \u003Cid>] [--ordId \u003Cid>] [--json]\n```\n\nReturns: `instId`, `side`, `fillPx`, `fillSz`, `fee`, `ts`.\n\n---\n\n### Spot — Algo Orders\n\n```bash\nokx spot algo orders [--instId \u003Cid>] [--history] [--ordType \u003Ctype>] [--json]\n```\n\nReturns: `algoId`, `instId`, type, `side`, `sz`, `tpTrigger`, `slTrigger`, `state`.\n\n---\n\n### Swap — Place Order\n\n```bash\nokx swap place --instId \u003Cid> --side \u003Cbuy|sell> --ordType \u003Ctype> --sz \u003Cn> \\\n  --tdMode \u003Ccross|isolated> \\\n  [--posSide \u003Clong|short>] [--px \u003Cprice>] [--json]\n```\n\n| Param | Required | Default | Description |\n|---|---|---|---|\n| `--instId` | Yes | - | Swap instrument (e.g., `BTC-USDT-SWAP`) |\n| `--side` | Yes | - | `buy` or `sell` |\n| `--ordType` | Yes | - | `market`, `limit`, `post_only`, `fok`, `ioc` |\n| `--sz` | Yes | - | Number of contracts |\n| `--tdMode` | Yes | - | `cross` or `isolated` |\n| `--posSide` | Cond. | - | `long` or `short` — required in hedge mode |\n| `--px` | Cond. | - | Price — required for limit orders |\n\n---\n\n### Swap — Cancel Order\n\n```bash\nokx swap cancel --instId \u003Cid> --ordId \u003Cid> [--json]\n```\n\n---\n\n### Swap — Amend Order\n\n```bash\nokx swap amend --instId \u003Cid> [--ordId \u003Cid>] [--clOrdId \u003Cid>] \\\n  [--newSz \u003Cn>] [--newPx \u003Cp>] [--json]\n```\n\n---\n\n### Swap — Close Position\n\n```bash\nokx swap close --instId \u003Cid> --mgnMode \u003Ccross|isolated> \\\n  [--posSide \u003Clong|short>] [--autoCxl] [--json]\n```\n\n| Param | Required | Default | Description |\n|---|---|---|---|\n| `--instId` | Yes | - | Swap instrument |\n| `--mgnMode` | Yes | - | `cross` or `isolated` |\n| `--posSide` | Cond. | - | `long` or `short` — required in hedge mode |\n| `--autoCxl` | No | false | Auto-cancel pending orders before closing |\n\nCloses the **entire** position at market price.\n\n---\n\n### Swap — Set Leverage\n\n```bash\nokx swap leverage --instId \u003Cid> --lever \u003Cn> --mgnMode \u003Ccross|isolated> \\\n  [--posSide \u003Clong|short>] [--json]\n```\n\n| Param | Required | Default | Description |\n|---|---|---|---|\n| `--instId` | Yes | - | Swap instrument |\n| `--lever` | Yes | - | Leverage multiplier (e.g., `10`) |\n| `--mgnMode` | Yes | - | `cross` or `isolated` |\n| `--posSide` | Cond. | - | `long` or `short` — required for isolated mode in hedge mode |\n\n---\n\n### Swap — Get Leverage\n\n```bash\nokx swap get-leverage --instId \u003Cid> --mgnMode \u003Ccross|isolated> [--json]\n```\n\nReturns table: `instId`, `mgnMode`, `posSide`, `lever`.\n\n---\n\n### Swap — Place Algo (TP\u002FSL)\n\n```bash\nokx swap algo place --instId \u003Cid> --side \u003Cbuy|sell> --ordType \u003Coco|conditional> --sz \u003Cn> \\\n  --tdMode \u003Ccross|isolated> \\\n  [--posSide \u003Clong|short>] [--reduceOnly] \\\n  [--tpTriggerPx \u003Cp>] [--tpOrdPx \u003Cp|-1>] \\\n  [--slTriggerPx \u003Cp>] [--slOrdPx \u003Cp|-1>] \\\n  [--json]\n```\n\n`--reduceOnly`: close-only; will not open a new position if one doesn't exist.\n\n---\n\n### Swap — Place Trailing Stop\n\n```bash\nokx swap algo trail --instId \u003Cid> --side \u003Cbuy|sell> --sz \u003Cn> \\\n  --tdMode \u003Ccross|isolated> \\\n  [--posSide \u003Clong|short>] [--reduceOnly] \\\n  [--callbackRatio \u003Cratio>] [--callbackSpread \u003Cspread>] \\\n  [--activePx \u003Cprice>] \\\n  [--json]\n```\n\n| Param | Required | Default | Description |\n|---|---|---|---|\n| `--callbackRatio` | Cond. | - | Trailing callback as a ratio (e.g., `0.02` = 2%); use this or `--callbackSpread` |\n| `--callbackSpread` | Cond. | - | Trailing callback as fixed price distance |\n| `--activePx` | No | - | Price at which trailing stop becomes active |\n\n---\n\n### Swap — Amend Algo\n\n```bash\nokx swap algo amend --instId \u003Cid> --algoId \u003Cid> \\\n  [--newSz \u003Cn>] [--newTpTriggerPx \u003Cp>] [--newTpOrdPx \u003Cp>] \\\n  [--newSlTriggerPx \u003Cp>] [--newSlOrdPx \u003Cp>] [--json]\n```\n\n---\n\n### Swap — Cancel Algo\n\n```bash\nokx swap algo cancel --instId \u003Cid> --algoId \u003Cid> [--json]\n```\n\n---\n\n### Swap — List Orders\n\n```bash\nokx swap orders [--instId \u003Cid>] [--history] [--json]\n```\n\n---\n\n### Swap — Get Order\n\n```bash\nokx swap get --instId \u003Cid> [--ordId \u003Cid>] [--clOrdId \u003Cid>] [--json]\n```\n\nReturns: `ordId`, `instId`, `side`, `posSide`, `ordType`, `px`, `sz`, `fillSz`, `avgPx`, `state`, `cTime`.\n\n---\n\n### Swap — Positions\n\n```bash\nokx swap positions [\u003CinstId>] [--json]\n```\n\nReturns: `instId`, `side`, `size`, `avgPx`, `upl`, `uplRatio`, `lever`. Only non-zero positions.\n\n---\n\n### Swap — Fills\n\n```bash\nokx swap fills [--instId \u003Cid>] [--ordId \u003Cid>] [--archive] [--json]\n```\n\n`--archive`: access older fills beyond the default window.\n\n---\n\n### Swap — Algo Orders\n\n```bash\nokx swap algo orders [--instId \u003Cid>] [--history] [--ordType \u003Ctype>] [--json]\n```\n\n---\n\n### Futures — Place Order\n\n```bash\nokx futures place --instId \u003Cid> --side \u003Cbuy|sell> --ordType \u003Ctype> --sz \u003Cn> \\\n  --tdMode \u003Ccross|isolated> \\\n  [--posSide \u003Clong|short>] [--px \u003Cprice>] [--reduceOnly] [--json]\n```\n\n`--instId` format: `BTC-USDT-250328` (delivery date suffix).\n\n---\n\n### Futures — Cancel Order\n\n```bash\nokx futures cancel --instId \u003Cid> --ordId \u003Cid> [--json]\n```\n\n---\n\n### Futures — List Orders\n\n```bash\nokx futures orders [--instId \u003Cid>] [--status \u003Copen|history|archive>] [--json]\n```\n\n| `--status` | Effect |\n|---|---|\n| `open` | Active\u002Fpending orders (default) |\n| `history` | Recent completed\u002Fcancelled |\n| `archive` | Older history |\n\n---\n\n### Futures — Positions\n\n```bash\nokx futures positions [\u003CinstId>] [--json]\n```\n\nReturns: `instId`, `side`, `pos`, `avgPx`, `upl`, `lever`.\n\n---\n\n### Futures — Fills\n\n```bash\nokx futures fills [--instId \u003Cid>] [--ordId \u003Cid>] [--archive] [--json]\n```\n\n---\n\n### Futures — Get Order\n\n```bash\nokx futures get --instId \u003Cid> [--ordId \u003Cid>] [--json]\n```\n\n---\n\n### Option — Get Instruments (Option Chain)\n\n```bash\nokx option instruments --uly \u003Cunderlying> [--expTime \u003CYYMMDD>] [--json]\n```\n\n| Param | Required | Description |\n|---|---|---|\n| `--uly` | Yes | Underlying, e.g. `BTC-USD` or `ETH-USD` |\n| `--expTime` | No | Filter by expiry date, e.g. `250328` |\n\nReturns: `instId`, `uly`, `expTime`, `stk` (strike), `optType` (C\u002FP), `state`.\n\nRun this **before placing any option order** to get the exact `instId`.\n\n---\n\n### Option — Get Greeks\n\n```bash\nokx option greeks --uly \u003Cunderlying> [--expTime \u003CYYMMDD>] [--json]\n```\n\nReturns IV (`markVol`) and BS Greeks (`deltaBS`, `gammaBS`, `thetaBS`, `vegaBS`) plus `markPx` for each contract.\n\n---\n\n### Option — Place Order\n\n```bash\nokx option place --instId \u003Cid> --side \u003Cbuy|sell> --ordType \u003Ctype> \\\n  --tdMode \u003Ccash|cross|isolated> --sz \u003Cn> \\\n  [--px \u003Cprice>] [--reduceOnly] [--clOrdId \u003Cid>] [--json]\n```\n\n| Param | Required | Default | Description |\n|---|---|---|---|\n| `--instId` | Yes | - | e.g. `BTC-USD-250328-95000-C` (call) or `...-P` (put) |\n| `--side` | Yes | - | `buy` or `sell` |\n| `--ordType` | Yes | - | `market`, `limit`, `post_only`, `fok`, `ioc` |\n| `--tdMode` | Yes | - | `cash` = buyer (full premium); `cross`\u002F`isolated` = seller (margin) |\n| `--sz` | Yes | - | Number of contracts |\n| `--px` | Cond. | - | Required for `limit`, `post_only`, `fok`, `ioc` |\n| `--reduceOnly` | No | false | Close-only; do not open a new position |\n\n**tdMode rules:**\n- Buyer (`side=buy`): always use `cash` — pay full premium, no margin call risk\n- Seller (`side=sell`): use `cross` or `isolated` — margin required, liquidation risk\n\n---\n\n### Option — Cancel Order\n\n```bash\nokx option cancel --instId \u003Cid> [--ordId \u003Cid>] [--clOrdId \u003Cid>] [--json]\n```\n\n---\n\n### Option — Amend Order\n\n```bash\nokx option amend --instId \u003Cid> [--ordId \u003Cid>] [--clOrdId \u003Cid>] \\\n  [--newSz \u003Cn>] [--newPx \u003Cp>] [--json]\n```\n\nMust provide at least one of `--newSz` or `--newPx`.\n\n---\n\n### Option — Batch Cancel\n\n```bash\nokx option batch-cancel --orders '\u003CJSON>' [--json]\n```\n\n`--orders` is a JSON array of up to 20 objects, each `{\"instId\":\"...\",\"ordId\":\"...\"}`:\n\n```bash\nokx option batch-cancel --orders '[{\"instId\":\"BTC-USD-250328-95000-C\",\"ordId\":\"123\"},{\"instId\":\"BTC-USD-250328-90000-P\",\"ordId\":\"456\"}]'\n```\n\n---\n\n### Option — List Orders\n\n```bash\nokx option orders [--instId \u003Cid>] [--uly \u003Cunderlying>] [--history] [--archive] [--json]\n```\n\n| Flag | Effect |\n|---|---|\n| *(default)* | Live\u002Fpending orders |\n| `--history` | Historical (7d) |\n| `--archive` | Older archive (3mo) |\n\n---\n\n### Option — Get Order\n\n```bash\nokx option get --instId \u003Cid> [--ordId \u003Cid>] [--clOrdId \u003Cid>] [--json]\n```\n\nReturns: `ordId`, `instId`, `side`, `ordType`, `px`, `sz`, `fillSz`, `avgPx`, `state`, `cTime`.\n\n---\n\n### Option — Positions\n\n```bash\nokx option positions [--instId \u003Cid>] [--uly \u003Cunderlying>] [--json]\n```\n\nReturns: `instId`, `posSide`, `pos`, `avgPx`, `upl`, `deltaPA`, `gammaPA`, `thetaPA`, `vegaPA`. Only non-zero positions shown.\n\n---\n\n### Option — Fills\n\n```bash\nokx option fills [--instId \u003Cid>] [--ordId \u003Cid>] [--archive] [--json]\n```\n\n`--archive`: access fills beyond the default 3-day window (up to 3 months).\n\n---\n\n## MCP Tool Reference\n\n| Tool | Description |\n|---|---|\n| `spot_place_order` | Place spot order |\n| `spot_cancel_order` | Cancel spot order |\n| `spot_amend_order` | Amend spot order |\n| `spot_place_algo_order` | Place spot TP\u002FSL algo |\n| `spot_amend_algo_order` | Amend spot algo |\n| `spot_cancel_algo_order` | Cancel spot algo |\n| `spot_get_orders` | List spot orders |\n| `spot_get_order` | Get single spot order |\n| `spot_get_fills` | Spot fill history |\n| `spot_get_algo_orders` | List spot algo orders |\n| `swap_place_order` | Place swap order |\n| `swap_cancel_order` | Cancel swap order |\n| `swap_amend_order` | Amend swap order |\n| `swap_close_position` | Close swap position |\n| `swap_set_leverage` | Set swap leverage |\n| `swap_place_algo_order` | Place swap TP\u002FSL algo |\n| `swap_place_move_stop_order` | Place swap trailing stop |\n| `swap_amend_algo_order` | Amend swap algo |\n| `swap_cancel_algo_orders` | Cancel swap algo |\n| `swap_get_positions` | Swap positions |\n| `swap_get_orders` | List swap orders |\n| `swap_get_order` | Get single swap order |\n| `swap_get_fills` | Swap fill history |\n| `swap_get_leverage` | Get swap leverage |\n| `swap_get_algo_orders` | List swap algo orders |\n| `futures_place_order` | Place futures order |\n| `futures_cancel_order` | Cancel futures order |\n| `futures_get_orders` | List futures orders |\n| `futures_get_positions` | Futures positions |\n| `futures_get_fills` | Futures fill history |\n| `futures_get_order` | Get single futures order |\n| `option_get_instruments` | Option chain (list available contracts) |\n| `option_get_greeks` | IV and Greeks by underlying |\n| `option_place_order` | Place option order |\n| `option_cancel_order` | Cancel option order |\n| `option_amend_order` | Amend option order |\n| `option_batch_cancel` | Batch cancel up to 20 option orders |\n| `option_get_orders` | List option orders |\n| `option_get_order` | Get single option order |\n| `option_get_positions` | Option positions with live Greeks |\n| `option_get_fills` | Option fill history |\n\n---\n\n## Input \u002F Output Examples\n\n**\"Buy 0.05 BTC at market\"**\n```bash\nokx spot place --instId BTC-USDT --side buy --ordType market --sz 0.05\n# → Order placed: 7890123456 (OK)\n```\n\n**\"Set a limit sell for 0.1 ETH at $3500\"**\n```bash\nokx spot place --instId ETH-USDT --side sell --ordType limit --sz 0.1 --px 3500\n# → Order placed: 7890123457 (OK)\n```\n\n**\"Show my open spot orders\"**\n```bash\nokx spot orders\n# → table: ordId, instId, side, type, price, size, filled, state\n```\n\n**\"Long 10 contracts BTC perp at market (cross margin)\"**\n```bash\nokx swap place --instId BTC-USDT-SWAP --side buy --ordType market --sz 10 \\\n  --tdMode cross --posSide long\n# → Order placed: 7890123458 (OK)\n```\n\n**\"Set take profit at $105k and stop loss at $88k on BTC perp long\"**\n```bash\nokx swap algo place --instId BTC-USDT-SWAP --side sell --ordType oco --sz 10 \\\n  --tdMode cross --posSide long \\\n  --tpTriggerPx 105000 --tpOrdPx -1 \\\n  --slTriggerPx 88000 --slOrdPx -1\n# → Algo order placed: ALGO456789 (OK)\n```\n\n**\"Close my ETH perp position\"**\n```bash\nokx swap close --instId ETH-USDT-SWAP --mgnMode cross --posSide long\n# → Position closed: ETH-USDT-SWAP long\n```\n\n**\"Set BTC perp leverage to 5x (cross)\"**\n```bash\nokx swap leverage --instId BTC-USDT-SWAP --lever 5 --mgnMode cross\n# → Leverage set: 5x BTC-USDT-SWAP\n```\n\n**\"Place a 2% trailing stop on my BTC perp long\"**\n```bash\nokx swap algo trail --instId BTC-USDT-SWAP --side sell --sz 10 \\\n  --tdMode cross --posSide long --callbackRatio 0.02\n# → Trailing stop placed: TRAIL123 (OK)\n```\n\n**\"Show my open swap positions\"**\n```bash\nokx swap positions\n# → table: instId, side, size, avgPx, upl, uplRatio, lever\n```\n\n**\"What are my recent fill trades for BTC spot?\"**\n```bash\nokx spot fills --instId BTC-USDT\n# → table: instId, side, fillPx, fillSz, fee, ts\n```\n\n**\"Show me the BTC option chain expiring March 28\"**\n```bash\nokx option instruments --uly BTC-USD --expTime 250328\n# → table: instId, expTime, stk, optType (C\u002FP), state\n```\n\n**\"What's the IV and delta for BTC options expiring March 28?\"**\n```bash\nokx option greeks --uly BTC-USD --expTime 250328\n# → table: instId, delta, gamma, theta, vega, iv (markVol), markPx\n```\n\n**\"Buy 1 BTC call at strike 95000 expiring March 28, limit at 0.005 BTC\"**\n```bash\nokx option place --instId BTC-USD-250328-95000-C \\\n  --side buy --ordType limit --tdMode cash --sz 1 --px 0.005\n# → Order placed: 7890123460 (OK)\n```\n\n**\"Show my open option positions\"**\n```bash\nokx option positions\n# → table: instId, posSide, pos, avgPx, upl, delta, gamma, theta, vega\n```\n\n## Edge Cases\n\n### Spot\n- **Market order size**: `--sz` is in base currency (e.g., BTC amount), not USDT\n- **Insufficient balance**: check `okx-cex-portfolio account balance` before placing\n- **Price not required**: `market` orders don't need `--px`; `limit` \u002F `post_only` \u002F `fok` \u002F `ioc` do\n- **Algo oco**: provide both `tpTriggerPx` and `slTriggerPx`; price `-1` means market execution at trigger\n- **Fills vs orders**: `fills` shows executed trades; `orders --history` shows all orders including cancelled\n\n### Swap \u002F Perpetual\n- **posSide**: required in hedge mode (`long_short_mode`); omit in net mode. Check `okx account config` for `posMode`\n- **tdMode**: use `cross` for cross-margin, `isolated` for isolated margin\n- **Close position**: `swap close` closes the **entire** position; to partial close, use `swap place` with a reduce-only algo\n- **Leverage**: max leverage varies by instrument and account level; exchange rejects if exceeded\n- **Trailing stop**: use either `--callbackRatio` (relative, e.g., `0.02`) or `--callbackSpread` (absolute price), not both\n- **Algo on close side**: always set `--side` opposite to position (e.g., long position → sell algo)\n\n### Futures \u002F Delivery\n- **instId format**: delivery futures use date suffix: `BTC-USDT-250328` for March 28, 2025 expiry\n- **Expiry**: futures expire on the delivery date — all positions auto-settle; do not hold through expiry unless intended\n- **No swap-specific features**: futures don't have trailing stops or `swap close` — use `futures cancel` + `futures place` for adjustments\n\n### Options\n- **instId format**: `{uly}-{YYMMDD}-{strike}-{C|P}` — e.g. `BTC-USD-250328-95000-C`; always run `okx option instruments --uly BTC-USD` first to confirm the exact contract exists\n- **tdMode**: buyers always use `cash` (full premium paid upfront, no liquidation); sellers use `cross` or `isolated` (margin required, liquidation risk)\n- **sz unit**: number of contracts (1 BTC option contract = 0.1 BTC on OKX); `--px` is quoted in BTC (e.g. `0.005` = 0.005 BTC premium per contract)\n- **Expiry**: options expire at 08:00 UTC on the expiry date; in-the-money options are auto-exercised; do not hold through expiry unless intended\n- **No TP\u002FSL algo on options**: the `swap algo` \u002F `spot algo` commands do not apply to option positions; manage risk by cancelling\u002Famending option orders directly\n- **Greeks in positions**: `okx option positions` returns live portfolio Greeks (`deltaPA`, `gammaPA`, etc.) from the account's position-level calculation, while `okx option greeks` returns BS model Greeks per contract\n\n## Global Notes\n\n- All write commands require valid credentials in `~\u002F.okx\u002Fconfig.toml` or env vars\n- `--profile \u003Cname>` is required for all authenticated commands; see \"Credential & Profile Check\" section\n- Every command result includes a `[profile: \u003Cname>]` tag for audit reference\n- `--json` returns raw OKX API v5 response\n- Rate limit: 60 order operations per 2 seconds per UID\n- Batch operations (batch cancel, batch amend) are available via MCP tools directly if needed\n- Position mode (`net` vs `long_short_mode`) affects whether `--posSide` is required\n- Spot `--sz` is base currency; swap\u002Ffutures `--sz` is number of contracts\n","# OKX CEX Trading CLI\n\nSpot, perpetual swap, delivery futures, and **options** order management on OKX exchange. Place, cancel, amend, and monitor orders; query option chains and Greeks; set take-profit\u002Fstop-loss and trailing stops; manage leverage and positions. **Requires API credentials.**\n\n## Prerequisites\n\n1. Install `okx` CLI:\n   ```bash\n   npm install -g @okx_ai\u002Fokx-trade-cli\n   ```\n2. Configure credentials:\n   ```bash\n   okx config init\n   ```\n   Or set environment variables:\n   ```bash\n   export OKX_API_KEY=your_key\n   export OKX_SECRET_KEY=your_secret\n   export OKX_PASSPHRASE=your_passphrase\n   ```\n3. Test with demo mode (simulated trading, no real funds):\n   ```bash\n   okx --profile demo spot orders\n   ```\n\n## Credential & Profile Check\n\n**Run this check before any authenticated command.**\n\n### Step A — Verify credentials\n\n```bash\nokx config show       # verify configuration status (output is masked)\n```\n\n- If the command returns an error or shows no configuration: **stop all operations**, guide the user to run `okx config init`, and wait for setup to complete before retrying.\n- If credentials are configured: proceed to Step B.\n\n### Step B — Confirm profile (required)\n\n`--profile` is **required** for all authenticated commands. Never add a profile implicitly.\n\n| Value | Mode | Funds |\n|---|---|---|\n| `live` | 实盘 | Real funds |\n| `demo` | 模拟盘 | Simulated funds |\n\n**Resolution rules:**\n1. Current message intent is clear (e.g. \"real\" \u002F \"实盘\" \u002F \"live\" → `live`; \"test\" \u002F \"模拟\" \u002F \"demo\" → `demo`) → use it and inform the user: `\"Using --profile live (实盘)\"` or `\"Using --profile demo (模拟盘)\"`\n2. Current message has no explicit declaration → check conversation context for a previous profile:\n   - Found → use it, inform user: `\"Continuing with --profile live (实盘) from earlier\"`\n   - Not found → ask: `\"Live (实盘) or Demo (模拟盘)?\"` — wait for answer before proceeding\n\n### Handling 401 Authentication Errors\n\nIf any command returns a 401 \u002F authentication error:\n1. **Stop immediately** — do not retry the same command\n2. Inform the user: \"Authentication failed (401). Your API credentials may be invalid or expired.\"\n3. Guide the user to update credentials by editing the file directly with their local editor:\n   ```\n   ~\u002F.okx\u002Fconfig.toml\n   ```\n   Update the fields `api_key`, `secret_key`, `passphrase` under the relevant profile.\n   Do NOT paste the new credentials into chat.\n4. After the user confirms the file is updated, run `okx config show` to verify (output is masked)\n5. Only then retry the original operation\n\n## Demo vs Live Mode\n\nProfile is the single control for 实盘\u002F模拟盘 switching — exactly two options:\n\n| `--profile` | Mode | Funds |\n|---|---|---|\n| `live` | 实盘 | Real money — irreversible |\n| `demo` | 模拟盘 | Simulated — no real funds |\n\n```bash\nokx --profile live  spot place ...    # 实盘 — real funds\nokx --profile demo  spot place ...    # 模拟盘 — simulated funds\n```\n\n**Rules:**\n1. `--profile` is **required** on every authenticated command — determined in \"Credential & Profile Check\" Step B\n2. Every response after a command must append: `[profile: live]` or `[profile: demo]`\n3. Do **not** use the `--demo` flag for mode switching — use `--profile` instead\n\n### Example\n\n```\nUser: \"Buy 0.01 BTC\"\nAgent: \"Live (实盘) or Demo (模拟盘)?\"\nUser: \"Demo\"\nAgent runs: okx --profile demo spot place --instId BTC-USDT --side buy --ordType market --sz 0.01\nAgent replies: \"Order placed: 7890123456 (OK) — simulated, no real funds used. [profile: demo]\"\n```\n\n## Skill Routing\n\n- For market data (prices, charts, depth, funding rates) → use `okx-cex-market`\n- For account balance, P&L, positions, fees, transfers → use `okx-cex-portfolio`\n- For regular spot\u002Fswap\u002Ffutures\u002Foptions\u002Falgo orders → use `okx-cex-trade` (this skill)\n- For grid and DCA trading bots → use `okx-cex-bot`\n\n## Quickstart\n\n```bash\n# Market buy 0.01 BTC (spot)\nokx spot place --instId BTC-USDT --side buy --ordType market --sz 0.01\n\n# Limit sell 0.01 BTC at $100,000 (spot)\nokx spot place --instId BTC-USDT --side sell --ordType limit --sz 0.01 --px 100000\n\n# Long 1 contract BTC perp (cross margin)\nokx swap place --instId BTC-USDT-SWAP --side buy --ordType market --sz 1 \\\n  --tdMode cross --posSide long\n\n# Close BTC perp long position entirely at market\nokx swap close --instId BTC-USDT-SWAP --mgnMode cross --posSide long\n\n# Set 10x leverage on BTC perp (cross)\nokx swap leverage --instId BTC-USDT-SWAP --lever 10 --mgnMode cross\n\n# Set TP\u002FSL on a spot BTC position (sell when price hits $105k, SL at $88k)\nokx spot algo place --instId BTC-USDT --side sell --ordType oco --sz 0.01 \\\n  --tpTriggerPx 105000 --tpOrdPx -1 \\\n  --slTriggerPx 88000 --slOrdPx -1\n\n# Place trailing stop on BTC perp long (callback 2%)\nokx swap algo trail --instId BTC-USDT-SWAP --side sell --sz 1 \\\n  --tdMode cross --posSide long --callbackRatio 0.02\n\n# View open spot orders\nokx spot orders\n\n# View open swap positions\nokx swap positions\n\n# Cancel a spot order\nokx spot cancel --instId BTC-USDT --ordId \u003CordId>\n```\n\n## Command Index\n\n### Spot Orders\n\n| # | Command | Type | Description |\n|---|---|---|---|\n| 1 | `okx spot place` | WRITE | Place spot order (market\u002Flimit\u002Fpost_only\u002Ffok\u002Fioc) |\n| 2 | `okx spot cancel` | WRITE | Cancel spot order |\n| 3 | `okx spot amend` | WRITE | Amend spot order price or size |\n| 4 | `okx spot algo place` | WRITE | Place spot TP\u002FSL algo order |\n| 5 | `okx spot algo amend` | WRITE | Amend spot TP\u002FSL levels |\n| 6 | `okx spot algo cancel` | WRITE | Cancel spot algo order |\n| 7 | `okx spot orders` | READ | List open or historical spot orders |\n| 8 | `okx spot get` | READ | Single spot order details |\n| 9 | `okx spot fills` | READ | Spot trade fill history |\n| 10 | `okx spot algo orders` | READ | List spot TP\u002FSL algo orders |\n\n### Swap \u002F Perpetual Orders\n\n| # | Command | Type | Description |\n|---|---|---|---|\n| 11 | `okx swap place` | WRITE | Place perpetual swap order |\n| 12 | `okx swap cancel` | WRITE | Cancel swap order |\n| 13 | `okx swap amend` | WRITE | Amend swap order price or size |\n| 14 | `okx swap close` | WRITE | Close entire position at market |\n| 15 | `okx swap leverage` | WRITE | Set leverage for an instrument |\n| 16 | `okx swap algo place` | WRITE | Place swap TP\u002FSL algo order |\n| 17 | `okx swap algo trail` | WRITE | Place swap trailing stop order |\n| 18 | `okx swap algo amend` | WRITE | Amend swap algo order |\n| 19 | `okx swap algo cancel` | WRITE | Cancel swap algo order |\n| 20 | `okx swap positions` | READ | Open perpetual swap positions |\n| 21 | `okx swap orders` | READ | List open or historical swap orders |\n| 22 | `okx swap get` | READ | Single swap order details |\n| 23 | `okx swap fills` | READ | Swap trade fill history |\n| 24 | `okx swap get-leverage` | READ | Current leverage settings |\n| 25 | `okx swap algo orders` | READ | List swap algo orders |\n\n### Futures \u002F Delivery Orders\n\n| # | Command | Type | Description |\n|---|---|---|---|\n| 26 | `okx futures place` | WRITE | Place delivery futures order |\n| 27 | `okx futures cancel` | WRITE | Cancel delivery futures order |\n| 28 | `okx futures orders` | READ | List delivery futures orders |\n| 29 | `okx futures positions` | READ | Open delivery futures positions |\n| 30 | `okx futures fills` | READ | Delivery futures fill history |\n| 31 | `okx futures get` | READ | Single delivery futures order details |\n\n### Options Orders\n\n| # | Command | Type | Description |\n|---|---|---|---|\n| 32 | `okx option instruments` | READ | Option chain: list available contracts for an underlying |\n| 33 | `okx option greeks` | READ | Implied volatility + Greeks (delta\u002Fgamma\u002Ftheta\u002Fvega) by underlying |\n| 34 | `okx option place` | WRITE | Place option order (call or put, buyer or seller) |\n| 35 | `okx option cancel` | WRITE | Cancel unfilled option order |\n| 36 | `okx option amend` | WRITE | Amend option order price or size |\n| 37 | `okx option batch-cancel` | WRITE | Batch cancel up to 20 option orders |\n| 38 | `okx option orders` | READ | List option orders (live \u002F history \u002F archive) |\n| 39 | `okx option get` | READ | Single option order details |\n| 40 | `okx option positions` | READ | Open option positions with live Greeks |\n| 41 | `okx option fills` | READ | Option trade fill history |\n\n## Cross-Skill Workflows\n\n### Spot market buy\n> User: \"Buy $500 worth of ETH at market\"\n\n```\n1. okx-cex-market    okx market ticker ETH-USDT             → get current price to estimate sz\n2. okx-cex-portfolio okx account balance USDT               → confirm available funds ≥ $500\n        ↓ user approves\n3. okx-cex-trade     okx spot place --instId ETH-USDT --side buy --ordType market --sz \u003Csz>\n4. okx-cex-trade     okx spot fills --instId ETH-USDT        → confirm fill price and size\n```\n\n### Open long BTC perp with TP\u002FSL\n> User: \"Long 5 contracts BTC perp at market, TP at $105k, SL at $88k\"\n\n```\n1. okx-cex-portfolio okx account balance USDT               → confirm margin available\n2. okx-cex-portfolio okx account max-size --instId BTC-USDT-SWAP --tdMode cross → confirm size ok\n        ↓ user approves\n3. okx-cex-trade     okx swap place --instId BTC-USDT-SWAP --side buy \\\n                       --ordType market --sz 5 --tdMode cross --posSide long\n4. okx-cex-trade     okx swap algo place --instId BTC-USDT-SWAP --side sell \\\n                       --ordType oco --sz 5 --tdMode cross --posSide long \\\n                       --tpTriggerPx 105000 --tpOrdPx -1 \\\n                       --slTriggerPx 88000 --slOrdPx -1\n5. okx-cex-trade     okx swap positions                     → confirm position opened\n```\n\n### Adjust leverage then place order\n> User: \"Set BTC perp to 5x leverage then go long 10 contracts\"\n\n```\n1. okx-cex-trade     okx swap get-leverage --instId BTC-USDT-SWAP --mgnMode cross → check current lever\n        ↓ user approves change\n2. okx-cex-trade     okx swap leverage --instId BTC-USDT-SWAP --lever 5 --mgnMode cross\n3. okx-cex-trade     okx swap place --instId BTC-USDT-SWAP --side buy \\\n                       --ordType market --sz 10 --tdMode cross --posSide long\n4. okx-cex-trade     okx swap positions                     → confirm position + leverage\n```\n\n### Place trailing stop on open position\n> User: \"Set a 3% trailing stop on my BTC perp long\"\n\n```\n1. okx-cex-trade     okx swap positions                     → confirm size of open long\n2. okx-cex-market    okx market ticker BTC-USDT-SWAP        → current price reference\n        ↓ user approves\n3. okx-cex-trade     okx swap algo trail --instId BTC-USDT-SWAP --side sell \\\n                       --sz \u003Cpos_size> --tdMode cross --posSide long --callbackRatio 0.03\n4. okx-cex-trade     okx swap algo orders --instId BTC-USDT-SWAP → confirm trail order placed\n```\n\n### Cancel all open spot orders\n> User: \"Cancel all my open BTC spot orders\"\n\n```\n1. okx-cex-trade     okx spot orders                        → list open orders\n2. okx-cex-trade     (for each ordId) okx spot cancel --instId BTC-USDT --ordId \u003Cid>\n3. okx-cex-trade     okx spot orders                        → confirm all cancelled\n```\n\n### Buy a BTC call option\n> User: \"Buy 2 BTC call options at strike 95000 expiring end of March\"\n\n```\n1. okx-cex-trade     okx option instruments --uly BTC-USD --expTime 250328\n                     → find exact instId (e.g. BTC-USD-250328-95000-C)\n2. okx-cex-trade     okx option greeks --uly BTC-USD --expTime 250328\n                     → check IV, delta, and markPx to assess fair value\n3. okx-cex-portfolio okx account balance                    → confirm enough USDT\u002FBTC for premium\n        ↓ user approves\n4. okx-cex-trade     okx option place --instId BTC-USD-250328-95000-C \\\n                       --side buy --ordType limit --tdMode cash --sz 2 --px 0.005\n5. okx-cex-trade     okx option orders                      → confirm order is live\n```\n\n### Check option portfolio Greeks\n> User: \"What's my total delta exposure from options?\"\n\n```\n1. okx-cex-trade     okx option positions                   → live positions with per-contract Greeks\n2. okx-cex-market    okx market ticker BTC-USD              → current spot price for context\n```\n\n## Operation Flow\n\n### Step 0 — Credential & Profile Check\n\nBefore any authenticated command:\n\n**Determine profile (required):**\n- Options: `live` (实盘) or `demo` (模拟盘) — exactly these two values\n1. Current message intent clear (e.g. \"real\"\u002F\"实盘\"\u002F\"live\" → live; \"test\"\u002F\"模拟\"\u002F\"demo\" → demo) → use it, inform user: `\"Using --profile live (实盘)\"`\n2. Current message has no explicit declaration → check conversation context for previous profile:\n   - Found → use it, inform user: `\"Continuing with --profile live (实盘) from earlier\"`\n   - Not found → ask: `\"Live (实盘) or Demo (模拟盘)?\"` — wait for answer\n\n**If no credentials configured:** guide user to run `okx config init`, stop all trading actions\n\n**After every command result:** append `[profile: live]` or `[profile: demo]` to the response\n\n### Step 1: Identify instrument type and action\n\n**Spot** (instId format: `BTC-USDT`):\n- Place\u002Fcancel\u002Famend order → `okx spot place\u002Fcancel\u002Famend`\n- TP\u002FSL conditional → `okx spot algo place\u002Famend\u002Fcancel`\n- Query → `okx spot orders\u002Fget\u002Ffills\u002Falgo orders`\n\n**Swap\u002FPerpetual** (instId format: `BTC-USDT-SWAP`):\n- Place\u002Fcancel\u002Famend order → `okx swap place\u002Fcancel\u002Famend`\n- Close position → `okx swap close`\n- Leverage → `okx swap leverage` \u002F `okx swap get-leverage`\n- TP\u002FSL conditional → `okx swap algo place\u002Famend\u002Fcancel`\n- Trailing stop → `okx swap algo trail`\n- Query → `okx swap positions\u002Forders\u002Fget\u002Ffills\u002Fget-leverage\u002Falgo orders`\n\n**Futures\u002FDelivery** (instId format: `BTC-USDT-250328`):\n- Place\u002Fcancel order → `okx futures place\u002Fcancel`\n- Query → `okx futures orders\u002Fpositions\u002Ffills\u002Fget`\n\n**Options** (instId format: `BTC-USD-250328-95000-C` or `...-P`):\n- Step 1 (required): find valid instId → `okx option instruments --uly BTC-USD`\n- Step 2 (recommended): check IV and Greeks → `okx option greeks --uly BTC-USD`\n- Place\u002Fcancel\u002Famend order → `okx option place\u002Fcancel\u002Famend`\n- Batch cancel → `okx option batch-cancel --orders '[...]'`\n- Query → `okx option orders\u002Fget\u002Fpositions\u002Ffills`\n- **tdMode**: `cash` for buyers (full premium upfront, no liquidation risk); `cross` or `isolated` for sellers (margin required)\n\n### Step 2: Confirm profile (determined in Step 0), then confirm write parameters\n\n**Read commands** (orders, positions, fills, get, get-leverage, algo orders): run immediately; note the profile used.\n\n- `--history` flag: defaults to active\u002Fopen; use `--history` only if user explicitly asks for history\n- `--ordType` for algo: `conditional` = single TP or SL; `oco` = both TP and SL together\n- `--tdMode` for swap\u002Ffutures: `cross` or `isolated`; spot always uses `cash` (set automatically)\n- `--posSide` for hedge mode: `long` or `short`; omit in net mode\n\n**Write commands** (place, cancel, amend, close, leverage, algo): two confirmations required:\n\n1. **Profile** — determined in Step 0; use `--profile live` (实盘) or `--profile demo` (模拟盘)\n2. **Confirm parameters** — confirm the key order details once before executing:\n   - Spot place: confirm `--instId`, `--side`, `--ordType`, `--sz`; price (`--px`) required for limit orders\n   - Swap place: confirm `--instId`, `--side`, `--sz`, `--tdMode`; confirm `--posSide` if in hedge mode\n   - Swap close: confirm `--instId`, `--mgnMode`, `--posSide`; closes the entire position at market\n   - Swap leverage: confirm new leverage and impact on existing positions; cannot exceed exchange max\n   - Algo place (TP\u002FSL): confirm trigger prices; use `--tpOrdPx -1` for market execution at trigger\n   - Algo trail: confirm `--callbackRatio` (e.g., `0.02` = 2%) or `--callbackSpread` (fixed price spread)\n\n### Step 3: Verify after writes\n\n- After `spot place`: run `okx spot orders` to confirm order is live or `okx spot fills` if market order\n- After `swap place`: run `okx swap orders` or `okx swap positions` to confirm\n- After `swap close`: run `okx swap positions` to confirm position size is 0\n- After algo place: run `okx spot algo orders` or `okx swap algo orders` to confirm algo is active\n- After cancel: run `okx spot orders` \u002F `okx swap orders` to confirm order is gone\n\n## CLI Command Reference\n\n### Order Type Reference\n\n| `--ordType` | Description | Requires `--px` |\n|---|---|---|\n| `market` | Fill immediately at best price | No |\n| `limit` | Fill at specified price or better | Yes |\n| `post_only` | Limit order; cancelled if it would be a taker | Yes |\n| `fok` | Fill entire order immediately or cancel | Yes |\n| `ioc` | Fill what's available immediately, cancel rest | Yes |\n| `conditional` | Algo: single TP or SL trigger | No (set trigger px) |\n| `oco` | Algo: TP + SL together (one cancels other) | No (set both trigger px) |\n| `move_order_stop` | Trailing stop (swap only) | No (set callback) |\n\n---\n\n### Spot — Place Order\n\n```bash\nokx spot place --instId \u003Cid> --side \u003Cbuy|sell> --ordType \u003Ctype> --sz \u003Cn> \\\n  [--px \u003Cprice>] [--json]\n```\n\n| Param | Required | Default | Description |\n|---|---|---|---|\n| `--instId` | Yes | - | Spot instrument (e.g., `BTC-USDT`) |\n| `--side` | Yes | - | `buy` or `sell` |\n| `--ordType` | Yes | - | `market`, `limit`, `post_only`, `fok`, `ioc` |\n| `--sz` | Yes | - | Order size in base currency (e.g., BTC amount) |\n| `--px` | Cond. | - | Price — required for `limit`, `post_only`, `fok`, `ioc` |\n\n---\n\n### Spot — Cancel Order\n\n```bash\nokx spot cancel --instId \u003Cid> --ordId \u003Cid> [--json]\n```\n\n---\n\n### Spot — Amend Order\n\n```bash\nokx spot amend --instId \u003Cid> [--ordId \u003Cid>] [--clOrdId \u003Cid>] \\\n  [--newSz \u003Cn>] [--newPx \u003Cp>] [--json]\n```\n\nMust provide at least one of `--newSz` or `--newPx`.\n\n---\n\n### Spot — Place Algo (TP\u002FSL)\n\n```bash\nokx spot algo place --instId \u003Cid> --side \u003Cbuy|sell> --ordType \u003Coco|conditional> --sz \u003Cn> \\\n  [--tpTriggerPx \u003Cp>] [--tpOrdPx \u003Cp|-1>] \\\n  [--slTriggerPx \u003Cp>] [--slOrdPx \u003Cp|-1>] \\\n  [--json]\n```\n\n| Param | Required | Default | Description |\n|---|---|---|---|\n| `--tpTriggerPx` | Cond. | - | Take-profit trigger price |\n| `--tpOrdPx` | Cond. | - | TP order price; use `-1` for market execution |\n| `--slTriggerPx` | Cond. | - | Stop-loss trigger price |\n| `--slOrdPx` | Cond. | - | SL order price; use `-1` for market execution |\n\nFor `oco`: provide both TP and SL params. For `conditional`: provide only TP or only SL.\n\n---\n\n### Spot — Amend Algo\n\n```bash\nokx spot algo amend --instId \u003Cid> --algoId \u003Cid> \\\n  [--newSz \u003Cn>] [--newTpTriggerPx \u003Cp>] [--newTpOrdPx \u003Cp>] \\\n  [--newSlTriggerPx \u003Cp>] [--newSlOrdPx \u003Cp>] [--json]\n```\n\n---\n\n### Spot — Cancel Algo\n\n```bash\nokx spot algo cancel --instId \u003Cid> --algoId \u003Cid> [--json]\n```\n\n---\n\n### Spot — List Orders\n\n```bash\nokx spot orders [--instId \u003Cid>] [--history] [--json]\n```\n\n| Flag | Effect |\n|---|---|\n| *(default)* | Open\u002Fpending orders |\n| `--history` | Historical (filled, cancelled) orders |\n\n---\n\n### Spot — Get Order\n\n```bash\nokx spot get --instId \u003Cid> [--ordId \u003Cid>] [--clOrdId \u003Cid>] [--json]\n```\n\nReturns: `ordId`, `instId`, `side`, `ordType`, `px`, `sz`, `fillSz`, `avgPx`, `state`, `cTime`.\n\n---\n\n### Spot — Fills\n\n```bash\nokx spot fills [--instId \u003Cid>] [--ordId \u003Cid>] [--json]\n```\n\nReturns: `instId`, `side`, `fillPx`, `fillSz`, `fee`, `ts`.\n\n---\n\n### Spot — Algo Orders\n\n```bash\nokx spot algo orders [--instId \u003Cid>] [--history] [--ordType \u003Ctype>] [--json]\n```\n\nReturns: `algoId`, `instId`, type, `side`, `sz`, `tpTrigger`, `slTrigger`, `state`.\n\n---\n\n### Swap — Place Order\n\n```bash\nokx swap place --instId \u003Cid> --side \u003Cbuy|sell> --ordType \u003Ctype> --sz \u003Cn> \\\n  --tdMode \u003Ccross|isolated> \\\n  [--posSide \u003Clong|short>] [--px \u003Cprice>] [--json]\n```\n\n| Param | Required | Default | Description |\n|---|---|---|---|\n| `--instId` | Yes | - | Swap instrument (e.g., `BTC-USDT-SWAP`) |\n| `--side` | Yes | - | `buy` or `sell` |\n| `--ordType` | Yes | - | `market`, `limit`, `post_only`, `fok`, `ioc` |\n| `--sz` | Yes | - | Number of contracts |\n| `--tdMode` | Yes | - | `cross` or `isolated` |\n| `--posSide` | Cond. | - | `long` or `short` — required in hedge mode |\n| `--px` | Cond. | - | Price — required for limit orders |\n\n---\n\n### Swap — Cancel Order\n\n```bash\nokx swap cancel --instId \u003Cid> --ordId \u003Cid> [--json]\n```\n\n---\n\n### Swap — Amend Order\n\n```bash\nokx swap amend --instId \u003Cid> [--ordId \u003Cid>] [--clOrdId \u003Cid>] \\\n  [--newSz \u003Cn>] [--newPx \u003Cp>] [--json]\n```\n\n---\n\n### Swap — Close Position\n\n```bash\nokx swap close --instId \u003Cid> --mgnMode \u003Ccross|isolated> \\\n  [--posSide \u003Clong|short>] [--autoCxl] [--json]\n```\n\n| Param | Required | Default | Description |\n|---|---|---|---|\n| `--instId` | Yes | - | Swap instrument |\n| `--mgnMode` | Yes | - | `cross` or `isolated` |\n| `--posSide` | Cond. | - | `long` or `short` — required in hedge mode |\n| `--autoCxl` | No | false | Auto-cancel pending orders before closing |\n\nCloses the **entire** position at market price.\n\n---\n\n### Swap — Set Leverage\n\n```bash\nokx swap leverage --instId \u003Cid> --lever \u003Cn> --mgnMode \u003Ccross|isolated> \\\n  [--posSide \u003Clong|short>] [--json]\n```\n\n| Param | Required | Default | Description |\n|---|---|---|---|\n| `--instId` | Yes | - | Swap instrument |\n| `--lever` | Yes | - | Leverage multiplier (e.g., `10`) |\n| `--mgnMode` | Yes | - | `cross` or `isolated` |\n| `--posSide` | Cond. | - | `long` or `short` — required for isolated mode in hedge mode |\n\n---\n\n### Swap — Get Leverage\n\n```bash\nokx swap get-leverage --instId \u003Cid> --mgnMode \u003Ccross|isolated> [--json]\n```\n\nReturns table: `instId`, `mgnMode`, `posSide`, `lever`.\n\n---\n\n### Swap — Place Algo (TP\u002FSL)\n\n```bash\nokx swap algo place --instId \u003Cid> --side \u003Cbuy|sell> --ordType \u003Coco|conditional> --sz \u003Cn> \\\n  --tdMode \u003Ccross|isolated> \\\n  [--posSide \u003Clong|short>] [--reduceOnly] \\\n  [--tpTriggerPx \u003Cp>] [--tpOrdPx \u003Cp|-1>] \\\n  [--slTriggerPx \u003Cp>] [--slOrdPx \u003Cp|-1>] \\\n  [--json]\n```\n\n`--reduceOnly`: close-only; will not open a new position if one doesn't exist.\n\n---\n\n### Swap — Place Trailing Stop\n\n```bash\nokx swap algo trail --instId \u003Cid> --side \u003Cbuy|sell> --sz \u003Cn> \\\n  --tdMode \u003Ccross|isolated> \\\n  [--posSide \u003Clong|short>] [--reduceOnly] \\\n  [--callbackRatio \u003Cratio>] [--callbackSpread \u003Cspread>] \\\n  [--activePx \u003Cprice>] \\\n  [--json]\n```\n\n| Param | Required | Default | Description |\n|---|---|---|---|\n| `--callbackRatio` | Cond. | - | Trailing callback as a ratio (e.g., `0.02` = 2%); use this or `--callbackSpread` |\n| `--callbackSpread` | Cond. | - | Trailing callback as fixed price distance |\n| `--activePx` | No | - | Price at which trailing stop becomes active |\n\n---\n\n### Swap — Amend Algo\n\n```bash\nokx swap algo amend --instId \u003Cid> --algoId \u003Cid> \\\n  [--newSz \u003Cn>] [--newTpTriggerPx \u003Cp>] [--newTpOrdPx \u003Cp>] \\\n  [--newSlTriggerPx \u003Cp>] [--newSlOrdPx \u003Cp>] [--json]\n```\n\n---\n\n### Swap — Cancel Algo\n\n```bash\nokx swap algo cancel --instId \u003Cid> --algoId \u003Cid> [--json]\n```\n\n---\n\n### Swap — List Orders\n\n```bash\nokx swap orders [--instId \u003Cid>] [--history] [--json]\n```\n\n---\n\n### Swap — Get Order\n\n```bash\nokx swap get --instId \u003Cid> [--ordId \u003Cid>] [--clOrdId \u003Cid>] [--json]\n```\n\nReturns: `ordId`, `instId`, `side`, `posSide`, `ordType`, `px`, `sz`, `fillSz`, `avgPx`, `state`, `cTime`.\n\n---\n\n### Swap — Positions\n\n```bash\nokx swap positions [\u003CinstId>] [--json]\n```\n\nReturns: `instId`, `side`, `size`, `avgPx`, `upl`, `uplRatio`, `lever`. Only non-zero positions.\n\n---\n\n### Swap — Fills\n\n```bash\nokx swap fills [--instId \u003Cid>] [--ordId \u003Cid>] [--archive] [--json]\n```\n\n`--archive`: access older fills beyond the default window.\n\n---\n\n### Swap — Algo Orders\n\n```bash\nokx swap algo orders [--instId \u003Cid>] [--history] [--ordType \u003Ctype>] [--json]\n```\n\n---\n\n### Futures — Place Order\n\n```bash\nokx futures place --instId \u003Cid> --side \u003Cbuy|sell> --ordType \u003Ctype> --sz \u003Cn> \\\n  --tdMode \u003Ccross|isolated> \\\n  [--posSide \u003Clong|short>] [--px \u003Cprice>] [--reduceOnly] [--json]\n```\n\n`--instId` format: `BTC-USDT-250328` (delivery date suffix).\n\n---\n\n### Futures — Cancel Order\n\n```bash\nokx futures cancel --instId \u003Cid> --ordId \u003Cid> [--json]\n```\n\n---\n\n### Futures — List Orders\n\n```bash\nokx futures orders [--instId \u003Cid>] [--status \u003Copen|history|archive>] [--json]\n```\n\n| `--status` | Effect |\n|---|---|\n| `open` | Active\u002Fpending orders (default) |\n| `history` | Recent completed\u002Fcancelled |\n| `archive` | Older history |\n\n---\n\n### Futures — Positions\n\n```bash\nokx futures positions [\u003CinstId>] [--json]\n```\n\nReturns: `instId`, `side`, `pos`, `avgPx`, `upl`, `lever`.\n\n---\n\n### Futures — Fills\n\n```bash\nokx futures fills [--instId \u003Cid>] [--ordId \u003Cid>] [--archive] [--json]\n```\n\n---\n\n### Futures — Get Order\n\n```bash\nokx futures get --instId \u003Cid> [--ordId \u003Cid>] [--json]\n```\n\n---\n\n### Option — Get Instruments (Option Chain)\n\n```bash\nokx option instruments --uly \u003Cunderlying> [--expTime \u003CYYMMDD>] [--json]\n```\n\n| Param | Required | Description |\n|---|---|---|\n| `--uly` | Yes | Underlying, e.g. `BTC-USD` or `ETH-USD` |\n| `--expTime` | No | Filter by expiry date, e.g. `250328` |\n\nReturns: `instId`, `uly`, `expTime`, `stk` (strike), `optType` (C\u002FP), `state`.\n\nRun this **before placing any option order** to get the exact `instId`.\n\n---\n\n### Option — Get Greeks\n\n```bash\nokx option greeks --uly \u003Cunderlying> [--expTime \u003CYYMMDD>] [--json]\n```\n\nReturns IV (`markVol`) and BS Greeks (`deltaBS`, `gammaBS`, `thetaBS`, `vegaBS`) plus `markPx` for each contract.\n\n---\n\n### Option — Place Order\n\n```bash\nokx option place --instId \u003Cid> --side \u003Cbuy|sell> --ordType \u003Ctype> \\\n  --tdMode \u003Ccash|cross|isolated> --sz \u003Cn> \\\n  [--px \u003Cprice>] [--reduceOnly] [--clOrdId \u003Cid>] [--json]\n```\n\n| Param | Required | Default | Description |\n|---|---|---|---|\n| `--instId` | Yes | - | e.g. `BTC-USD-250328-95000-C` (call) or `...-P` (put) |\n| `--side` | Yes | - | `buy` or `sell` |\n| `--ordType` | Yes | - | `market`, `limit`, `post_only`, `fok`, `ioc` |\n| `--tdMode` | Yes | - | `cash` = buyer (full premium); `cross`\u002F`isolated` = seller (margin) |\n| `--sz` | Yes | - | Number of contracts |\n| `--px` | Cond. | - | Required for `limit`, `post_only`, `fok`, `ioc` |\n| `--reduceOnly` | No | false | Close-only; do not open a new position |\n\n**tdMode rules:**\n- Buyer (`side=buy`): always use `cash` — pay full premium, no margin call risk\n- Seller (`side=sell`): use `cross` or `isolated` — margin required, liquidation risk\n\n---\n\n### Option — Cancel Order\n\n```bash\nokx option cancel --instId \u003Cid> [--ordId \u003Cid>] [--clOrdId \u003Cid>] [--json]\n```\n\n---\n\n### Option — Amend Order\n\n```bash\nokx option amend --instId \u003Cid> [--ordId \u003Cid>] [--clOrdId \u003Cid>] \\\n  [--newSz \u003Cn>] [--newPx \u003Cp>] [--json]\n```\n\nMust provide at least one of `--newSz` or `--newPx`.\n\n---\n\n### Option — Batch Cancel\n\n```bash\nokx option batch-cancel --orders '\u003CJSON>' [--json]\n```\n\n`--orders` is a JSON array of up to 20 objects, each `{\"instId\":\"...\",\"ordId\":\"...\"}`:\n\n```bash\nokx option batch-cancel --orders '[{\"instId\":\"BTC-USD-250328-95000-C\",\"ordId\":\"123\"},{\"instId\":\"BTC-USD-250328-90000-P\",\"ordId\":\"456\"}]'\n```\n\n---\n\n### Option — List Orders\n\n```bash\nokx option orders [--instId \u003Cid>] [--uly \u003Cunderlying>] [--history] [--archive] [--json]\n```\n\n| Flag | Effect |\n|---|---|\n| *(default)* | Live\u002Fpending orders |\n| `--history` | Historical (7d) |\n| `--archive` | Older archive (3mo) |\n\n---\n\n### Option — Get Order\n\n```bash\nokx option get --instId \u003Cid> [--ordId \u003Cid>] [--clOrdId \u003Cid>] [--json]\n```\n\nReturns: `ordId`, `instId`, `side`, `ordType`, `px`, `sz`, `fillSz`, `avgPx`, `state`, `cTime`.\n\n---\n\n### Option — Positions\n\n```bash\nokx option positions [--instId \u003Cid>] [--uly \u003Cunderlying>] [--json]\n```\n\nReturns: `instId`, `posSide`, `pos`, `avgPx`, `upl`, `deltaPA`, `gammaPA`, `thetaPA`, `vegaPA`. Only non-zero positions shown.\n\n---\n\n### Option — Fills\n\n```bash\nokx option fills [--instId \u003Cid>] [--ordId \u003Cid>] [--archive] [--json]\n```\n\n`--archive`: access fills beyond the default 3-day window (up to 3 months).\n\n---\n\n## MCP Tool Reference\n\n| Tool | Description |\n|---|---|\n| `spot_place_order` | Place spot order |\n| `spot_cancel_order` | Cancel spot order |\n| `spot_amend_order` | Amend spot order |\n| `spot_place_algo_order` | Place spot TP\u002FSL algo |\n| `spot_amend_algo_order` | Amend spot algo |\n| `spot_cancel_algo_order` | Cancel spot algo |\n| `spot_get_orders` | List spot orders |\n| `spot_get_order` | Get single spot order |\n| `spot_get_fills` | Spot fill history |\n| `spot_get_algo_orders` | List spot algo orders |\n| `swap_place_order` | Place swap order |\n| `swap_cancel_order` | Cancel swap order |\n| `swap_amend_order` | Amend swap order |\n| `swap_close_position` | Close swap position |\n| `swap_set_leverage` | Set swap leverage |\n| `swap_place_algo_order` | Place swap TP\u002FSL algo |\n| `swap_place_move_stop_order` | Place swap trailing stop |\n| `swap_amend_algo_order` | Amend swap algo |\n| `swap_cancel_algo_orders` | Cancel swap algo |\n| `swap_get_positions` | Swap positions |\n| `swap_get_orders` | List swap orders |\n| `swap_get_order` | Get single swap order |\n| `swap_get_fills` | Swap fill history |\n| `swap_get_leverage` | Get swap leverage |\n| `swap_get_algo_orders` | List swap algo orders |\n| `futures_place_order` | Place futures order |\n| `futures_cancel_order` | Cancel futures order |\n| `futures_get_orders` | List futures orders |\n| `futures_get_positions` | Futures positions |\n| `futures_get_fills` | Futures fill history |\n| `futures_get_order` | Get single futures order |\n| `option_get_instruments` | Option chain (list available contracts) |\n| `option_get_greeks` | IV and Greeks by underlying |\n| `option_place_order` | Place option order |\n| `option_cancel_order` | Cancel option order |\n| `option_amend_order` | Amend option order |\n| `option_batch_cancel` | Batch cancel up to 20 option orders |\n| `option_get_orders` | List option orders |\n| `option_get_order` | Get single option order |\n| `option_get_positions` | Option positions with live Greeks |\n| `option_get_fills` | Option fill history |\n\n---\n\n## Input \u002F Output Examples\n\n**\"Buy 0.05 BTC at market\"**\n```bash\nokx spot place --instId BTC-USDT --side buy --ordType market --sz 0.05\n# → Order placed: 7890123456 (OK)\n```\n\n**\"Set a limit sell for 0.1 ETH at $3500\"**\n```bash\nokx spot place --instId ETH-USDT --side sell --ordType limit --sz 0.1 --px 3500\n# → Order placed: 7890123457 (OK)\n```\n\n**\"Show my open spot orders\"**\n```bash\nokx spot orders\n# → table: ordId, instId, side, type, price, size, filled, state\n```\n\n**\"Long 10 contracts BTC perp at market (cross margin)\"**\n```bash\nokx swap place --instId BTC-USDT-SWAP --side buy --ordType market --sz 10 \\\n  --tdMode cross --posSide long\n# → Order placed: 7890123458 (OK)\n```\n\n**\"Set take profit at $105k and stop loss at $88k on BTC perp long\"**\n```bash\nokx swap algo place --instId BTC-USDT-SWAP --side sell --ordType oco --sz 10 \\\n  --tdMode cross --posSide long \\\n  --tpTriggerPx 105000 --tpOrdPx -1 \\\n  --slTriggerPx 88000 --slOrdPx -1\n# → Algo order placed: ALGO456789 (OK)\n```\n\n**\"Close my ETH perp position\"**\n```bash\nokx swap close --instId ETH-USDT-SWAP --mgnMode cross --posSide long\n# → Position closed: ETH-USDT-SWAP long\n```\n\n**\"Set BTC perp leverage to 5x (cross)\"**\n```bash\nokx swap leverage --instId BTC-USDT-SWAP --lever 5 --mgnMode cross\n# → Leverage set: 5x BTC-USDT-SWAP\n```\n\n**\"Place a 2% trailing stop on my BTC perp long\"**\n```bash\nokx swap algo trail --instId BTC-USDT-SWAP --side sell --sz 10 \\\n  --tdMode cross --posSide long --callbackRatio 0.02\n# → Trailing stop placed: TRAIL123 (OK)\n```\n\n**\"Show my open swap positions\"**\n```bash\nokx swap positions\n# → table: instId, side, size, avgPx, upl, uplRatio, lever\n```\n\n**\"What are my recent fill trades for BTC spot?\"**\n```bash\nokx spot fills --instId BTC-USDT\n# → table: instId, side, fillPx, fillSz, fee, ts\n```\n\n**\"Show me the BTC option chain expiring March 28\"**\n```bash\nokx option instruments --uly BTC-USD --expTime 250328\n# → table: instId, expTime, stk, optType (C\u002FP), state\n```\n\n**\"What's the IV and delta for BTC options expiring March 28?\"**\n```bash\nokx option greeks --uly BTC-USD --expTime 250328\n# → table: instId, delta, gamma, theta, vega, iv (markVol), markPx\n```\n\n**\"Buy 1 BTC call at strike 95000 expiring March 28, limit at 0.005 BTC\"**\n```bash\nokx option place --instId BTC-USD-250328-95000-C \\\n  --side buy --ordType limit --tdMode cash --sz 1 --px 0.005\n# → Order placed: 7890123460 (OK)\n```\n\n**\"Show my open option positions\"**\n```bash\nokx option positions\n# → table: instId, posSide, pos, avgPx, upl, delta, gamma, theta, vega\n```\n\n## Edge Cases\n\n### Spot\n- **Market order size**: `--sz` is in base currency (e.g., BTC amount), not USDT\n- **Insufficient balance**: check `okx-cex-portfolio account balance` before placing\n- **Price not required**: `market` orders don't need `--px`; `limit` \u002F `post_only` \u002F `fok` \u002F `ioc` do\n- **Algo oco**: provide both `tpTriggerPx` and `slTriggerPx`; price `-1` means market execution at trigger\n- **Fills vs orders**: `fills` shows executed trades; `orders --history` shows all orders including cancelled\n\n### Swap \u002F Perpetual\n- **posSide**: required in hedge mode (`long_short_mode`); omit in net mode. Check `okx account config` for `posMode`\n- **tdMode**: use `cross` for cross-margin, `isolated` for isolated margin\n- **Close position**: `swap close` closes the **entire** position; to partial close, use `swap place` with a reduce-only algo\n- **Leverage**: max leverage varies by instrument and account level; exchange rejects if exceeded\n- **Trailing stop**: use either `--callbackRatio` (relative, e.g., `0.02`) or `--callbackSpread` (absolute price), not both\n- **Algo on close side**: always set `--side` opposite to position (e.g., long position → sell algo)\n\n### Futures \u002F Delivery\n- **instId format**: delivery futures use date suffix: `BTC-USDT-250328` for March 28, 2025 expiry\n- **Expiry**: futures expire on the delivery date — all positions auto-settle; do not hold through expiry unless intended\n- **No swap-specific features**: futures don't have trailing stops or `swap close` — use `futures cancel` + `futures place` for adjustments\n\n### Options\n- **instId format**: `{uly}-{YYMMDD}-{strike}-{C|P}` — e.g. `BTC-USD-250328-95000-C`; always run `okx option instruments --uly BTC-USD` first to confirm the exact contract exists\n- **tdMode**: buyers always use `cash` (full premium paid upfront, no liquidation); sellers use `cross` or `isolated` (margin required, liquidation risk)\n- **sz unit**: number of contracts (1 BTC option contract = 0.1 BTC on OKX); `--px` is quoted in BTC (e.g. `0.005` = 0.005 BTC premium per contract)\n- **Expiry**: options expire at 08:00 UTC on the expiry date; in-the-money options are auto-exercised; do not hold through expiry unless intended\n- **No TP\u002FSL algo on options**: the `swap algo` \u002F `spot algo` commands do not apply to option positions; manage risk by cancelling\u002Famending option orders directly\n- **Greeks in positions**: `okx option positions` returns live portfolio Greeks (`deltaPA`, `gammaPA`, etc.) from the account's position-level calculation, while `okx option greeks` returns BS model Greeks per contract\n\n## Global Notes\n\n- All write commands require valid credentials in `~\u002F.okx\u002Fconfig.toml` or env vars\n- `--profile \u003Cname>` is required for all authenticated commands; see \"Credential & Profile Check\" section\n- Every command result includes a `[profile: \u003Cname>]` tag for audit reference\n- `--json` returns raw OKX API v5 response\n- Rate limit: 60 order operations per 2 seconds per UID\n- Batch operations (batch cancel, batch amend) are available via MCP tools directly if needed\n- Position mode (`net` vs `long_short_mode`) affects whether `--posSide` is required\n- Spot `--sz` is base currency; swap\u002Ffutures `--sz` is number of contracts\n",{"name":5,"license":15,"metadata":47,"description":7},{"agent":48,"author":22,"version":58,"homepage":59},{"install":49,"requires":56},[50],{"id":51,"bins":52,"kind":53,"label":54,"package":55},"npm",[22],"node","Install okx CLI (npm)","@okx_ai\u002Fokx-trade-cli",{"bins":57},[22],"1.0.0","https:\u002F\u002Fwww.okx.com","main","3df1d0d67b30ff15236561f8c0f9f06d33f42dfd","skills\u002Fexchanges\u002Fokx-cex-trade",17,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia","https:\u002F\u002Feth2030.com","Hardcore infra. Building @alt-research and applied cryptography.","2026-11-15 02:28:10",{"source":8,"skillName":5,"commands":70,"prompt":80,"zipAvailable":81},[71,74,77],{"tool":72,"command":73},"npx","npx skills add jiayaoqijia\u002Fcryptoskill --skill okx-cex-trade",{"tool":75,"command":76},"bunx","bunx skills add jiayaoqijia\u002Fcryptoskill --skill okx-cex-trade",{"tool":78,"command":79},"pnpm","pnpm dlx skills add jiayaoqijia\u002Fcryptoskill --skill okx-cex-trade","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fokx-cex-trade\u002FSKILL.md",true,[83,89,93],{"path":84,"resourceType":85,"resourceTypeDesc":86,"sizeBytes":87,"sourceHtmlUrl":88},"_meta.json","REFERENCE","参考文档",281,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fokx-cex-trade\u002F_meta.json",{"path":90,"resourceType":85,"resourceTypeDesc":86,"sizeBytes":91,"sourceHtmlUrl":92},"SOURCE.md",273,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fokx-cex-trade\u002FSOURCE.md",{"path":94,"resourceType":85,"resourceTypeDesc":86,"sizeBytes":95,"sourceHtmlUrl":96},"TRUST.auto.yaml",2266,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fokx-cex-trade\u002FTRUST.auto.yaml",[98,107,114,122,130,137],{"skillNo":99,"name":100,"nameZh":6,"description":101,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":102,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":106},"01M7DTKCERMV0RNX3HZJP4CZ26","troves","Deposit and withdraw from Troves DeFi yield vault strategies on Starknet. View available strategies, check positions, and manage vault deposits. Use this skill when the user mentions Troves, vault, yield vault, DeFi vault, strategy, yield farming, vault deposit, vault withdraw, earning yield through vaults, passive yield strategies, or wants to deposit into or withdraw from a yield strategy — even if they don't say \"Troves\" explicitly.","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-troves\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-troves\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":108,"name":21,"nameZh":6,"description":109,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":110,"sourceHtmlUrl":111,"categories":112,"keywords":113,"publishedAt":106},"01M7DTK6CJSMGC8KCQHGNYFZBD","Swap tokens on Starknet via Fibrous DEX aggregator. Supports per-provider selection (avnu, ekubo, or auto to race all). Use this skill when the user wants to swap, exchange, trade, convert, buy, or sell one token for another on Starknet. Also use when the user asks about token prices, exchange rates, DEX routing, best swap route, or wants to check how much they would receive for a given amount — even if they don't explicitly say \"swap\".","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-trade\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-trade\u002FSKILL.md",[],[],{"skillNo":115,"name":116,"nameZh":6,"description":117,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":118,"sourceHtmlUrl":119,"categories":120,"keywords":121,"publishedAt":106},"01M7DTJZ6A0X4PAW3Y8W4J9K64","staking","Stake, unstake, claim, and compound rewards for STRK, WBTC, tBTC, SolvBTC, and LBTC on Starknet. View validators, pools, and staking positions. Use this skill when the user mentions staking, delegating, validators, staking pools, rewards, compounding, unstaking, earning yield, passive income on crypto, or wants to earn on their STRK or BTC tokens — even if they don't say \"stake\" explicitly.","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-staking\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-staking\u002FSKILL.md",[],[],{"skillNo":123,"name":124,"nameZh":6,"description":125,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":126,"sourceHtmlUrl":127,"categories":128,"keywords":129,"publishedAt":106},"01M7DTJSDZJKCDMW7GHRF4BRH5","send","Send STRK, ETH, or any ERC-20 token to a Starknet address. Supports simulation (dry-run) before execution. Use this skill when the user wants to send, transfer, pay, tip, or move tokens to another wallet address on Starknet. Also trigger when the user mentions sending funds to someone, making a payment, transferring assets, or moving crypto to a specific address — even if they just say \"pay 10 STRK to 0x...\".","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-send\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-send\u002FSKILL.md",[],[],{"skillNo":131,"name":32,"nameZh":6,"description":132,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":133,"sourceHtmlUrl":134,"categories":135,"keywords":136,"publishedAt":106},"01M7DTJG1E480D51ZQ7WKDQ26K","View a comprehensive DeFi portfolio dashboard and optimize portfolio allocation via automated rebalancing. Use this skill when the user wants an overview, summary, dashboard, total value, net worth, portfolio rebalancing, target allocation, or wants to see all their DeFi positions across Starknet at once. Also trigger when the user asks \"what do I have\", \"show me everything\", \"how much am I worth\", \"my positions\", \"my investments\", \"rebalance my portfolio\", \"I want 50% ETH\", \"optimize my holdings\", or any request for a holistic view of their Starknet holdings — even if they don't explicitly say \"portfolio\".","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-portfolio\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-portfolio\u002FSKILL.md",[],[],{"skillNo":138,"name":139,"nameZh":6,"description":140,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":141,"sourceHtmlUrl":142,"categories":143,"keywords":144,"publishedAt":106},"01M7DTJ7M8TE9R2N36HFBZDGVD","multi-swap","Execute multiple token swaps in a single Starknet transaction via Fibrous (default). Supports per-provider selection (avnu, ekubo, or auto to race all). Supports 2-3 swap pairs bundled into one multicall. Use this skill when the user wants to swap multiple token pairs at once, do batch swaps, execute several trades simultaneously, perform parallel swaps, or do bulk trading in one transaction. Also trigger when the user mentions \"two swaps\", \"three swaps\", \"swap X and Y at the same time\", or wants to convert multiple tokens in a single call.","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-multi-swap\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-multi-swap\u002FSKILL.md",[],[]]