[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M77PGQP0DMD5CMV4XC7DB9Y5":3,"skill-same:01M77PGQP0DMD5CMV4XC7DB9Y5":48},{"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":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":25,"commitSha":26,"skillDirectory":27,"forksCount":28,"repositoryHtmlUrl":29,"repositoryHomepageUrl":30,"ownerHtmlUrl":31,"ownerBlogUrl":6,"ownerDescription":32,"updatedAt":33,"install":34,"resources":47},"01M77PGQP0DMD5CMV4XC7DB9Y5","okx-trading",null,"Trade crypto on OKX with a strict human-in-the-loop confirmation gate. Use when the user asks to check OKX balances, look up prices, propose or execute trades, run DCA, run a grid strategy, get a daily snapshot\u002FPnL digest, or set up the 70\u002F20\u002F10 (DCA + grid + drawdown-reserve) composite strategy. Defaults to demo trading and to spot instruments. Never executes a trade without explicit YES confirmation in chat. Grids support optional bounded autonomy (auto-rescale, cost-basis floor, position cap) authorised once at setup.","Lord1Egypt\u002Fawesome-skill-forge","Lord1Egypt","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F99746359?v=4","01M7592YDNT0XK9WJ0T2MQVPDN","Mohamed Mounir Ali AL Keshita","01M75GRFNHC8VZNWEB8DKDE433",3,"MIT","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fcommunity\u002Fclawhub\u002Fo\u002Fokx-trading\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: okx-trading\ndescription: Trade crypto on OKX with a strict human-in-the-loop confirmation gate. Use when the user asks to check OKX balances, look up prices, propose or execute trades, run DCA, run a grid strategy, get a daily snapshot\u002FPnL digest, or set up the 70\u002F20\u002F10 (DCA + grid + drawdown-reserve) composite strategy. Defaults to demo trading and to spot instruments. Never executes a trade without explicit YES confirmation in chat. Grids support optional bounded autonomy (auto-rescale, cost-basis floor, position cap) authorised once at setup.\nversion: 0.3.3\n---\n\n# OKX Trading\n\nYou can read OKX market data, propose trades, execute trades the user has confirmed, run DCA, and run grid strategies. **Every order placement requires a two-step gate: propose → user types `YES \u003Cid>` → execute.**\n\nAll commands below use the `exec` tool to run Python scripts under `skills\u002F\u003Cauthor>\u002Fokx-trading\u002Fscripts\u002F`. Run them from the aeon repo root. Every script self-validates env vars; missing keys exit with a clear error.\n\n> **Path resolution.** The literal `\u003Cauthor>` in every script path below stands for the namespace this skill was installed under. The aeon skills loader prepends a `## Skill: \u003Cauthor>\u002F\u003Cskill-name>` heading to this content; substitute that author for `\u003Cauthor>` in every command. (E.g. if the heading reads `## Skill: vadymmalakhatko\u002Fokx-trading`, run `python3 skills\u002Fvadymmalakhatko\u002Fokx-trading\u002Fscripts\u002Fokx_get_balance.py`.)\n\n## The trade gate — read this carefully\n\n**You must never place an order without an explicit YES from the user.** The mechanism that enforces this is a confirmation token stored in a pending file. Workflow:\n\n1. **Propose.** Run `okx_propose_trade.py` with the user's intent. The script writes the pending JSON and prints two lines you MUST capture: `Proposal id: \u003Cid>` and `Pending file: \u003Cabsolute path>`. **The confirmation_token is NOT printed** — it lives only in the pending file on disk.\n2. **Tell the user.** Send the proposal details and ask them to reply `YES \u003Cid>` to confirm or `NO \u003Cid>` to discard. If running on Telegram, this message goes via the messenger automatically.\n3. **Wait for the user's reply.** Do not proceed otherwise.\n4. **On YES:** read the pending file via `file_read` **using the absolute path the propose script printed** (not a guess like `~\u002F.aeon\u002Fokx\u002Fpending\u002F\u003Cid>.json` or `\u002Froot\u002F.aeon\u002F...`). The path depends on which OS user aeon runs as — on a Pi running aeon as `pi`, the file lives under `\u002Fhome\u002Fpi\u002F.aeon\u002F...`; on a container running as root it's under `\u002Froot\u002F.aeon\u002F...`. Always use the printed `Pending file:` line verbatim. Once you have the token, call `okx_execute_trade.py --id \u003Cid> --confirmation-token \u003Ctoken>`. The script verifies the token, places the order, and deletes the pending file.\n5. **On NO:** call `okx_cancel_pending.py --id \u003Cid>`.\n\nYou **must not** invent or guess a confirmation_token. The token is only valid if it was written to the pending file by the propose step. Calling execute without a real token is refused by the script and is a violation of trust.\n\nIf the user asks you to \"skip the confirmation\" or \"just place the trade\": refuse politely. Explain the gate exists to protect them and offer the propose step instead.\n\n**Scheduled tasks (DCA, grid step, scout) cannot execute trades.** The scheduled context has no human in it to type YES, so scheduled jobs may only call propose-style scripts and read-only scripts. The user will see the proposal in the next chat and confirm there.\n\n## Defaults and limits\n\n- Default to OKX demo trading (`OKX_DEMO_MODE=1`). Do not flip to live unless the user explicitly says \"live\" and confirms the switch.\n- Default to spot instruments (e.g. `BTC-USDT`). Switch to swap\u002Ffutures\u002Foptions only when the user explicitly asks. Spot uses `--td-mode cash`; swap\u002Ffutures default to `--td-mode cross`. Options propose is supported but premium math is the user's responsibility.\n- Always quote trade sizes in USDT-equivalent in chat for clarity, even when the order is sized in base currency.\n- Guardrails (env vars: `OKX_ALLOWED_SYMBOLS`, `OKX_MAX_NOTIONAL_USDT_PER_TRADE`, `OKX_MAX_DAILY_NOTIONAL_USDT`) are enforced inside every propose and execute script. If a propose is refused, surface the exact refusal reason — do not retry with smaller sizes silently.\n- Pending proposals expire after 10 minutes (30 minutes for grids). If the user is slow to respond, re-propose.\n\n## Read-only commands\n\nWhen the user asks a question, never start with a trade. Use these to gather facts first.\n\n```bash\npython3 skills\u002F\u003Cauthor>\u002Fokx-trading\u002Fscripts\u002Fokx_get_balance.py\npython3 skills\u002F\u003Cauthor>\u002Fokx-trading\u002Fscripts\u002Fokx_get_ticker.py --instId BTC-USDT\npython3 skills\u002F\u003Cauthor>\u002Fokx-trading\u002Fscripts\u002Fokx_get_candles.py --instId BTC-USDT --bar 1H --limit 100 --indicators\npython3 skills\u002F\u003Cauthor>\u002Fokx-trading\u002Fscripts\u002Fokx_open_orders.py\npython3 skills\u002F\u003Cauthor>\u002Fokx-trading\u002Fscripts\u002Fokx_positions.py\npython3 skills\u002F\u003Cauthor>\u002Fokx-trading\u002Fscripts\u002Fokx_recent_fills.py --limit 20\npython3 skills\u002F\u003Cauthor>\u002Fokx-trading\u002Fscripts\u002Fokx_snapshot.py        # daily snapshot + delta vs prior day (recommended)\npython3 skills\u002F\u003Cauthor>\u002Fokx-trading\u002Fscripts\u002Fokx_pnl_summary.py     # lighter ad-hoc digest\n```\n\n`okx_get_candles.py --indicators` adds SMA(20), SMA(50), and RSI(14) on the close series and emits a one-line \"consider buy \u002F consider sell \u002F neutral\" verdict. Useful for the momentum scout pattern.\n\n`okx_snapshot.py` (v0.2.0+) writes `~\u002F.aeon\u002Fokx\u002Fsnapshots\u002F\u003CUTC-date>.json` with total equity, per-currency balances, per-instrument tickers + 24h fills breakdown, pending-order counts, active-strategy summary, and equity delta vs the most recent prior snapshot. Run it once a day to get a meaningful day-over-day picture; pass `--no-write` for an ad-hoc summary that doesn't touch disk.\n\n## Propose a trade\n\nSizing is one of `--quote-sz` (USDT amount) or `--base-sz` (base-coin amount).\n\n```bash\n# Spot market buy of $25 of BTC\npython3 skills\u002F\u003Cauthor>\u002Fokx-trading\u002Fscripts\u002Fokx_propose_trade.py \\\n  --instId BTC-USDT --side buy --quote-sz 25\n\n# Spot limit buy of 0.001 BTC at 60000\npython3 skills\u002F\u003Cauthor>\u002Fokx-trading\u002Fscripts\u002Fokx_propose_trade.py \\\n  --instId BTC-USDT --side buy --base-sz 0.001 --ord-type limit --px 60000\n\n# Perpetual swap (only if user explicitly asks)\npython3 skills\u002F\u003Cauthor>\u002Fokx-trading\u002Fscripts\u002Fokx_propose_trade.py \\\n  --instId BTC-USDT-SWAP --side buy --quote-sz 50 --pos-side long\n```\n\nThen send the proposal to the user verbatim and ask for `YES \u003Cid>`.\n\n## Execute a confirmed trade\n\n```bash\n# Read the token from the pending file:\npython3 skills\u002F\u003Cauthor>\u002Fokx-trading\u002Fscripts\u002Fokx_list_pending.py        # to confirm id\n# Then read ~\u002F.aeon\u002Fokx\u002Fpending\u002F\u003Cid>.json with file_read to get confirmation_token.\npython3 skills\u002F\u003Cauthor>\u002Fokx-trading\u002Fscripts\u002Fokx_execute_trade.py \\\n  --id \u003Cid> --confirmation-token \u003Ctoken>\n```\n\nCancel without executing:\n\n```bash\npython3 skills\u002F\u003Cauthor>\u002Fokx-trading\u002Fscripts\u002Fokx_cancel_pending.py --id \u003Cid>\n```\n\n## DCA (recurring scheduled propose)\n\nDCA is just `schedule_create` plus `okx_propose_trade.py`. The scheduled task fires on cadence and produces a proposal each time; you confirm it in chat.\n\n```json\n{\n  \"name\": \"schedule_create\",\n  \"arguments\": {\n    \"name\": \"DCA $25 BTC weekly\",\n    \"schedule\": \"0 9 * * 1\",\n    \"task\": \"Run python3 skills\u002F\u003Cauthor>\u002Fokx-trading\u002Fscripts\u002Fokx_propose_trade.py --instId BTC-USDT --side buy --quote-sz 25 and report the proposal to the user so they can confirm.\",\n    \"notify\": true\n  }\n}\n```\n\n## Grid bot\n\n```bash\n# Step 1 — propose (required: instId, low, high, levels, quote-sz-per-level)\npython3 skills\u002F\u003Cauthor>\u002Fokx-trading\u002Fscripts\u002Fokx_grid_setup.py \\\n  --instId BTC-USDT --low 55000 --high 65000 --levels 10 --quote-sz-per-level 50 \\\n  --min-profit-gap 0.005 \\\n  --max-position-base 0.05 \\\n  --trailing-pct 0.1 --max-rescales 5\n\n# Step 2 — after YES, read token from pending file, then apply\npython3 skills\u002F\u003Cauthor>\u002Fokx-trading\u002Fscripts\u002Fokx_grid_apply.py \\\n  --id \u003Cid> --confirmation-token \u003Ctoken>\n\n# Step 3 — schedule maintenance (after apply)\n# schedule_create  every 5m  task = \"Run python3 skills\u002F\u003Cauthor>\u002Fokx-trading\u002Fscripts\u002Fokx_grid_step.py\" notify=false\n\n# To stop a grid: propose stop, get user YES, execute stop\npython3 skills\u002F\u003Cauthor>\u002Fokx-trading\u002Fscripts\u002Fokx_grid_propose_stop.py --strategy-id grid-XXXXXXXX\npython3 skills\u002F\u003Cauthor>\u002Fokx-trading\u002Fscripts\u002Fokx_grid_stop.py \\\n  --id \u003Cid> --confirmation-token \u003Ctoken>\n```\n\nGrid orders restock automatically inside their pre-confirmed bounds. Halt conditions: `OKX_MAX_DAILY_NOTIONAL_USDT` reached, or auto-rescales exhausted with price still outside the band.\n\n### Optional v0.2.0 grid flags (the user authorises bounded autonomy at setup time)\n\n| Flag | Default | What it does |\n|---|---|---|\n| `--min-profit-gap \u003Cfraction>` | `0` (off) | Refuse to place a sell restock priced below `avg_buy_px * (1 + gap)`. Stops a stranded grid from realising losses. Typical: `0.005` (0.5%). |\n| `--max-position-base \u003Ccoins>` | `0` (off) | Skip buy restocks once the grid's net base inventory reaches this. Caps drawdown in a long downtrend. |\n| `--trailing-pct \u003Cfraction>` | `0` (off) | When current price is within this fraction of either band edge, recenter the grid on the current price (preserving range size) and reseed buys. `0` = halt instead. Typical: `0.1` (10%). |\n| `--max-rescales \u003Cint>` | `0` | Hard ceiling on autonomous re-centers across the grid's lifetime. Required when `--trailing-pct > 0`. After this many rescales, the grid halts and waits for re-confirmation. |\n\nWhen proposing a grid with any of these flags set, **read the proposal output back to the user verbatim** — they're consenting to the autonomy at YES time, not later. After-the-fact toggling is not supported; to change limits, stop the grid and re-propose.\n\n## Audit log\n\nGrid lifecycle events accumulate in `~\u002F.aeon\u002Fokx\u002Fgrid_audit.jsonl` — one JSON object per line. Use `tail -n 50 ~\u002F.aeon\u002Fokx\u002Fgrid_audit.jsonl` to inspect recent activity. Events include `grid_applied`, `fill`, `restock`, `cost_basis_protected`, `position_capped`, `rescale_started`, `rescaled`, and `halted`.\n\n## Strategy template — 70\u002F20\u002F10 (DCA + grid + drawdown reserve)\n\nWhen the user asks to \"set up the 70\u002F20\u002F10 strategy with $X capital\", treat it as a multi-step orchestration. Walk through these steps **in order** and read back what you're about to do before executing irreversible parts.\n\n### Step 1 — derive the splits\n\nGiven total capital `$X` (USDT) and a deployment horizon `W` weeks (default 26):\n\n```\nDCA capital     = 0.70 * X\nGrid capital    = 0.20 * X\nReserve         = 0.10 * X\nPer-week DCA    = round(DCA capital \u002F W, 2)\nPer-week BTC    = round(per-week DCA * 0.5, 2)\nPer-week ETH    = round(per-week DCA * 0.5, 2)\nGrid quote\u002Flvl  = round(Grid capital \u002F 12, 2)\n```\n\nState the numbers back to the user before doing anything.\n\n### Step 2 — schedule the weekly DCA buys (BTC and ETH)\n\nUse the existing `schedule_create` tool. **Each fire produces a propose only — the user still YES-confirms each weekly buy.** The scheduled prompt instructs the agent to call `okx_propose_trade.py` and surface the id.\n\n```json\n{\n  \"name\": \"schedule_create\",\n  \"arguments\": {\n    \"name\": \"DCA $\u003Cbtc_amt> BTC weekly\",\n    \"schedule\": \"0 9 * * 1\",\n    \"task\": \"Run python3 skills\u002F\u003Cauthor>\u002Fokx-trading\u002Fscripts\u002Fokx_propose_trade.py --instId BTC-USDT --side buy --quote-sz \u003Cbtc_amt> and post the proposal to the user so they can reply YES \u003Cid>.\",\n    \"notify\": true\n  }\n}\n```\n\nRepeat with `ETH-USDT` and `\u003Ceth_amt>`.\n\n### Step 3 — propose the grid (one-time confirmation)\n\nGet the current BTC-USDT price via `okx_get_ticker.py`. Set bounds at ±15 % of current price; 12 levels; per-level USDT from Step 1. Apply the v0.2.0 guards.\n\n```bash\npython3 skills\u002F\u003Cauthor>\u002Fokx-trading\u002Fscripts\u002Fokx_grid_setup.py \\\n  --instId BTC-USDT \\\n  --low \u003C0.85*current> --high \u003C1.15*current> \\\n  --levels 12 --quote-sz-per-level \u003Cgrid_quote_per_level> \\\n  --min-profit-gap 0.005 \\\n  --max-position-base \u003C0.5 * (X * 0.20) \u002F current_price>  # half of the grid capital in base ccy\n  --trailing-pct 0.10 --max-rescales 5\n```\n\nRead the proposal output back verbatim. Wait for `YES \u003Cid>`. Then call `okx_grid_apply.py` with the token from the pending file.\n\n### Step 4 — schedule the grid maintenance\n\n```json\n{\n  \"name\": \"schedule_create\",\n  \"arguments\": {\n    \"name\": \"BTC grid maintenance\",\n    \"schedule\": \"every 5m\",\n    \"task\": \"Run python3 skills\u002F\u003Cauthor>\u002Fokx-trading\u002Fscripts\u002Fokx_grid_step.py and report any halts or rescales.\",\n    \"notify\": false\n  }\n}\n```\n\n### Step 5 — schedule the daily snapshot (the honesty checkpoint)\n\n```json\n{\n  \"name\": \"schedule_create\",\n  \"arguments\": {\n    \"name\": \"OKX daily snapshot\",\n    \"schedule\": \"0 9 * * *\",\n    \"task\": \"Run python3 skills\u002F\u003Cauthor>\u002Fokx-trading\u002Fscripts\u002Fokx_snapshot.py and post the digest to me.\",\n    \"notify\": true\n  }\n}\n```\n\n### Step 6 — schedule the drawdown watcher (deploys the reserve)\n\n```json\n{\n  \"name\": \"schedule_create\",\n  \"arguments\": {\n    \"name\": \"Reserve drawdown watcher\",\n    \"schedule\": \"0 10 * * *\",\n    \"task\": \"Run python3 skills\u002F\u003Cauthor>\u002Fokx-trading\u002Fscripts\u002Fokx_dca_dip.py --reserve-usdt \u003Creserve> --threshold-pct 0.30 --max-triggers 3 --instId BTC-USDT. If status is 'trigger', call okx_propose_trade.py with the recommended size, post the proposal to me, and AFTER my YES + the trade executes, run okx_dca_dip.py again with --record-trigger to persist the firing. If status is 'exhausted', alert me. Otherwise stay silent.\",\n    \"notify\": false\n  }\n}\n```\n\nThe watcher only proposes — it never executes autonomously. Reserve is deployed across at most `--max-triggers` dip-buys (default 3); the slice size is `(reserve - already_used) \u002F triggers_remaining`. A trigger re-arms when the drawdown deepens by `--rearm-pct` (default 5 %) or equity recovers above `(1 - rearm_pct) * ATH`.\n\n### What runs autonomously vs. what needs YES\n\n| Component | Autonomous | Needs user YES |\n|---|---|---|\n| Weekly DCA proposal | Schedule fires | Each weekly buy |\n| Grid initial deploy | — | Once at setup |\n| Grid restocks inside band | Yes (pre-authorised) | — |\n| Grid auto-rescale (within `max-rescales`) | Yes (pre-authorised) | — |\n| Grid stop \u002F change bounds | — | Each time |\n| Daily snapshot | Yes (read-only) | — |\n| Drawdown trigger detection | Yes | — |\n| Drawdown dip-buy | — | Each fire |\n\n## Notifications worth sending\n\nUse the scheduler for these. Each one is a one-shot proposal or a digest, never an autonomous trade.\n\n- **Daily digest** (recommended): schedule `0 9 * * *` running `okx_snapshot.py` with `notify=true`. One concise message per morning that includes equity, per-currency balances, 24h fills breakdown, pending-order counts, active strategies, and equity delta vs yesterday. Persists to `~\u002F.aeon\u002Fokx\u002Fsnapshots\u002F\u003Cdate>.json` so the day-over-day comparison remains meaningful.\n- **Momentum scout** (opt-in, often noisy): schedule `every 1h` running `okx_get_candles.py --instId X --bar 1H --indicators`. The script's \"consider buy \u002F sell\" verdict is what should drive a follow-up `okx_propose_trade.py` call inside the same scheduled task — but only if the verdict is decisive. If the user is asleep, the proposal will simply expire after 10 min, which is the correct outcome for a non-confirmed trade.\n- **Trade proposals**: every `okx_propose_trade.py` invocation should be paired with a Telegram message containing the id and details — phrased so the user can copy-paste `YES \u003Cid>` to confirm.\n\nAvoid noisy alerting. Profitable trading is mostly about *not* trading on weak signals; the scout should stay silent unless RSI is decisively past 30\u002F70 or a moving-average cross is clearly above noise.\n\n## Environment\n\nRequired env vars (see `.env.example`):\n\n- `OKX_API_KEY`, `OKX_API_SECRET`, `OKX_API_PASSPHRASE` — your OKX API credentials.\n- `OKX_DEMO_MODE` — `1` (default) routes to OKX demo trading. `0` is live money.\n- `OKX_ALLOWED_SYMBOLS` — CSV allow-list. Empty means any symbol.\n- `OKX_MAX_NOTIONAL_USDT_PER_TRADE` — per-trade ceiling. Default 50.\n- `OKX_MAX_DAILY_NOTIONAL_USDT` — daily ceiling for total executed notional. Default 200.\n\nIf any env var is missing the script exits with code 2 and an explanatory message — surface that to the user.\n","# OKX Trading\n\nYou can read OKX market data, propose trades, execute trades the user has confirmed, run DCA, and run grid strategies. **Every order placement requires a two-step gate: propose → user types `YES \u003Cid>` → execute.**\n\nAll commands below use the `exec` tool to run Python scripts under `skills\u002F\u003Cauthor>\u002Fokx-trading\u002Fscripts\u002F`. Run them from the aeon repo root. Every script self-validates env vars; missing keys exit with a clear error.\n\n> **Path resolution.** The literal `\u003Cauthor>` in every script path below stands for the namespace this skill was installed under. The aeon skills loader prepends a `## Skill: \u003Cauthor>\u002F\u003Cskill-name>` heading to this content; substitute that author for `\u003Cauthor>` in every command. (E.g. if the heading reads `## Skill: vadymmalakhatko\u002Fokx-trading`, run `python3 skills\u002Fvadymmalakhatko\u002Fokx-trading\u002Fscripts\u002Fokx_get_balance.py`.)\n\n## The trade gate — read this carefully\n\n**You must never place an order without an explicit YES from the user.** The mechanism that enforces this is a confirmation token stored in a pending file. Workflow:\n\n1. **Propose.** Run `okx_propose_trade.py` with the user's intent. The script writes the pending JSON and prints two lines you MUST capture: `Proposal id: \u003Cid>` and `Pending file: \u003Cabsolute path>`. **The confirmation_token is NOT printed** — it lives only in the pending file on disk.\n2. **Tell the user.** Send the proposal details and ask them to reply `YES \u003Cid>` to confirm or `NO \u003Cid>` to discard. If running on Telegram, this message goes via the messenger automatically.\n3. **Wait for the user's reply.** Do not proceed otherwise.\n4. **On YES:** read the pending file via `file_read` **using the absolute path the propose script printed** (not a guess like `~\u002F.aeon\u002Fokx\u002Fpending\u002F\u003Cid>.json` or `\u002Froot\u002F.aeon\u002F...`). The path depends on which OS user aeon runs as — on a Pi running aeon as `pi`, the file lives under `\u002Fhome\u002Fpi\u002F.aeon\u002F...`; on a container running as root it's under `\u002Froot\u002F.aeon\u002F...`. Always use the printed `Pending file:` line verbatim. Once you have the token, call `okx_execute_trade.py --id \u003Cid> --confirmation-token \u003Ctoken>`. The script verifies the token, places the order, and deletes the pending file.\n5. **On NO:** call `okx_cancel_pending.py --id \u003Cid>`.\n\nYou **must not** invent or guess a confirmation_token. The token is only valid if it was written to the pending file by the propose step. Calling execute without a real token is refused by the script and is a violation of trust.\n\nIf the user asks you to \"skip the confirmation\" or \"just place the trade\": refuse politely. Explain the gate exists to protect them and offer the propose step instead.\n\n**Scheduled tasks (DCA, grid step, scout) cannot execute trades.** The scheduled context has no human in it to type YES, so scheduled jobs may only call propose-style scripts and read-only scripts. The user will see the proposal in the next chat and confirm there.\n\n## Defaults and limits\n\n- Default to OKX demo trading (`OKX_DEMO_MODE=1`). Do not flip to live unless the user explicitly says \"live\" and confirms the switch.\n- Default to spot instruments (e.g. `BTC-USDT`). Switch to swap\u002Ffutures\u002Foptions only when the user explicitly asks. Spot uses `--td-mode cash`; swap\u002Ffutures default to `--td-mode cross`. Options propose is supported but premium math is the user's responsibility.\n- Always quote trade sizes in USDT-equivalent in chat for clarity, even when the order is sized in base currency.\n- Guardrails (env vars: `OKX_ALLOWED_SYMBOLS`, `OKX_MAX_NOTIONAL_USDT_PER_TRADE`, `OKX_MAX_DAILY_NOTIONAL_USDT`) are enforced inside every propose and execute script. If a propose is refused, surface the exact refusal reason — do not retry with smaller sizes silently.\n- Pending proposals expire after 10 minutes (30 minutes for grids). If the user is slow to respond, re-propose.\n\n## Read-only commands\n\nWhen the user asks a question, never start with a trade. Use these to gather facts first.\n\n```bash\npython3 skills\u002F\u003Cauthor>\u002Fokx-trading\u002Fscripts\u002Fokx_get_balance.py\npython3 skills\u002F\u003Cauthor>\u002Fokx-trading\u002Fscripts\u002Fokx_get_ticker.py --instId BTC-USDT\npython3 skills\u002F\u003Cauthor>\u002Fokx-trading\u002Fscripts\u002Fokx_get_candles.py --instId BTC-USDT --bar 1H --limit 100 --indicators\npython3 skills\u002F\u003Cauthor>\u002Fokx-trading\u002Fscripts\u002Fokx_open_orders.py\npython3 skills\u002F\u003Cauthor>\u002Fokx-trading\u002Fscripts\u002Fokx_positions.py\npython3 skills\u002F\u003Cauthor>\u002Fokx-trading\u002Fscripts\u002Fokx_recent_fills.py --limit 20\npython3 skills\u002F\u003Cauthor>\u002Fokx-trading\u002Fscripts\u002Fokx_snapshot.py        # daily snapshot + delta vs prior day (recommended)\npython3 skills\u002F\u003Cauthor>\u002Fokx-trading\u002Fscripts\u002Fokx_pnl_summary.py     # lighter ad-hoc digest\n```\n\n`okx_get_candles.py --indicators` adds SMA(20), SMA(50), and RSI(14) on the close series and emits a one-line \"consider buy \u002F consider sell \u002F neutral\" verdict. Useful for the momentum scout pattern.\n\n`okx_snapshot.py` (v0.2.0+) writes `~\u002F.aeon\u002Fokx\u002Fsnapshots\u002F\u003CUTC-date>.json` with total equity, per-currency balances, per-instrument tickers + 24h fills breakdown, pending-order counts, active-strategy summary, and equity delta vs the most recent prior snapshot. Run it once a day to get a meaningful day-over-day picture; pass `--no-write` for an ad-hoc summary that doesn't touch disk.\n\n## Propose a trade\n\nSizing is one of `--quote-sz` (USDT amount) or `--base-sz` (base-coin amount).\n\n```bash\n# Spot market buy of $25 of BTC\npython3 skills\u002F\u003Cauthor>\u002Fokx-trading\u002Fscripts\u002Fokx_propose_trade.py \\\n  --instId BTC-USDT --side buy --quote-sz 25\n\n# Spot limit buy of 0.001 BTC at 60000\npython3 skills\u002F\u003Cauthor>\u002Fokx-trading\u002Fscripts\u002Fokx_propose_trade.py \\\n  --instId BTC-USDT --side buy --base-sz 0.001 --ord-type limit --px 60000\n\n# Perpetual swap (only if user explicitly asks)\npython3 skills\u002F\u003Cauthor>\u002Fokx-trading\u002Fscripts\u002Fokx_propose_trade.py \\\n  --instId BTC-USDT-SWAP --side buy --quote-sz 50 --pos-side long\n```\n\nThen send the proposal to the user verbatim and ask for `YES \u003Cid>`.\n\n## Execute a confirmed trade\n\n```bash\n# Read the token from the pending file:\npython3 skills\u002F\u003Cauthor>\u002Fokx-trading\u002Fscripts\u002Fokx_list_pending.py        # to confirm id\n# Then read ~\u002F.aeon\u002Fokx\u002Fpending\u002F\u003Cid>.json with file_read to get confirmation_token.\npython3 skills\u002F\u003Cauthor>\u002Fokx-trading\u002Fscripts\u002Fokx_execute_trade.py \\\n  --id \u003Cid> --confirmation-token \u003Ctoken>\n```\n\nCancel without executing:\n\n```bash\npython3 skills\u002F\u003Cauthor>\u002Fokx-trading\u002Fscripts\u002Fokx_cancel_pending.py --id \u003Cid>\n```\n\n## DCA (recurring scheduled propose)\n\nDCA is just `schedule_create` plus `okx_propose_trade.py`. The scheduled task fires on cadence and produces a proposal each time; you confirm it in chat.\n\n```json\n{\n  \"name\": \"schedule_create\",\n  \"arguments\": {\n    \"name\": \"DCA $25 BTC weekly\",\n    \"schedule\": \"0 9 * * 1\",\n    \"task\": \"Run python3 skills\u002F\u003Cauthor>\u002Fokx-trading\u002Fscripts\u002Fokx_propose_trade.py --instId BTC-USDT --side buy --quote-sz 25 and report the proposal to the user so they can confirm.\",\n    \"notify\": true\n  }\n}\n```\n\n## Grid bot\n\n```bash\n# Step 1 — propose (required: instId, low, high, levels, quote-sz-per-level)\npython3 skills\u002F\u003Cauthor>\u002Fokx-trading\u002Fscripts\u002Fokx_grid_setup.py \\\n  --instId BTC-USDT --low 55000 --high 65000 --levels 10 --quote-sz-per-level 50 \\\n  --min-profit-gap 0.005 \\\n  --max-position-base 0.05 \\\n  --trailing-pct 0.1 --max-rescales 5\n\n# Step 2 — after YES, read token from pending file, then apply\npython3 skills\u002F\u003Cauthor>\u002Fokx-trading\u002Fscripts\u002Fokx_grid_apply.py \\\n  --id \u003Cid> --confirmation-token \u003Ctoken>\n\n# Step 3 — schedule maintenance (after apply)\n# schedule_create  every 5m  task = \"Run python3 skills\u002F\u003Cauthor>\u002Fokx-trading\u002Fscripts\u002Fokx_grid_step.py\" notify=false\n\n# To stop a grid: propose stop, get user YES, execute stop\npython3 skills\u002F\u003Cauthor>\u002Fokx-trading\u002Fscripts\u002Fokx_grid_propose_stop.py --strategy-id grid-XXXXXXXX\npython3 skills\u002F\u003Cauthor>\u002Fokx-trading\u002Fscripts\u002Fokx_grid_stop.py \\\n  --id \u003Cid> --confirmation-token \u003Ctoken>\n```\n\nGrid orders restock automatically inside their pre-confirmed bounds. Halt conditions: `OKX_MAX_DAILY_NOTIONAL_USDT` reached, or auto-rescales exhausted with price still outside the band.\n\n### Optional v0.2.0 grid flags (the user authorises bounded autonomy at setup time)\n\n| Flag | Default | What it does |\n|---|---|---|\n| `--min-profit-gap \u003Cfraction>` | `0` (off) | Refuse to place a sell restock priced below `avg_buy_px * (1 + gap)`. Stops a stranded grid from realising losses. Typical: `0.005` (0.5%). |\n| `--max-position-base \u003Ccoins>` | `0` (off) | Skip buy restocks once the grid's net base inventory reaches this. Caps drawdown in a long downtrend. |\n| `--trailing-pct \u003Cfraction>` | `0` (off) | When current price is within this fraction of either band edge, recenter the grid on the current price (preserving range size) and reseed buys. `0` = halt instead. Typical: `0.1` (10%). |\n| `--max-rescales \u003Cint>` | `0` | Hard ceiling on autonomous re-centers across the grid's lifetime. Required when `--trailing-pct > 0`. After this many rescales, the grid halts and waits for re-confirmation. |\n\nWhen proposing a grid with any of these flags set, **read the proposal output back to the user verbatim** — they're consenting to the autonomy at YES time, not later. After-the-fact toggling is not supported; to change limits, stop the grid and re-propose.\n\n## Audit log\n\nGrid lifecycle events accumulate in `~\u002F.aeon\u002Fokx\u002Fgrid_audit.jsonl` — one JSON object per line. Use `tail -n 50 ~\u002F.aeon\u002Fokx\u002Fgrid_audit.jsonl` to inspect recent activity. Events include `grid_applied`, `fill`, `restock`, `cost_basis_protected`, `position_capped`, `rescale_started`, `rescaled`, and `halted`.\n\n## Strategy template — 70\u002F20\u002F10 (DCA + grid + drawdown reserve)\n\nWhen the user asks to \"set up the 70\u002F20\u002F10 strategy with $X capital\", treat it as a multi-step orchestration. Walk through these steps **in order** and read back what you're about to do before executing irreversible parts.\n\n### Step 1 — derive the splits\n\nGiven total capital `$X` (USDT) and a deployment horizon `W` weeks (default 26):\n\n```\nDCA capital     = 0.70 * X\nGrid capital    = 0.20 * X\nReserve         = 0.10 * X\nPer-week DCA    = round(DCA capital \u002F W, 2)\nPer-week BTC    = round(per-week DCA * 0.5, 2)\nPer-week ETH    = round(per-week DCA * 0.5, 2)\nGrid quote\u002Flvl  = round(Grid capital \u002F 12, 2)\n```\n\nState the numbers back to the user before doing anything.\n\n### Step 2 — schedule the weekly DCA buys (BTC and ETH)\n\nUse the existing `schedule_create` tool. **Each fire produces a propose only — the user still YES-confirms each weekly buy.** The scheduled prompt instructs the agent to call `okx_propose_trade.py` and surface the id.\n\n```json\n{\n  \"name\": \"schedule_create\",\n  \"arguments\": {\n    \"name\": \"DCA $\u003Cbtc_amt> BTC weekly\",\n    \"schedule\": \"0 9 * * 1\",\n    \"task\": \"Run python3 skills\u002F\u003Cauthor>\u002Fokx-trading\u002Fscripts\u002Fokx_propose_trade.py --instId BTC-USDT --side buy --quote-sz \u003Cbtc_amt> and post the proposal to the user so they can reply YES \u003Cid>.\",\n    \"notify\": true\n  }\n}\n```\n\nRepeat with `ETH-USDT` and `\u003Ceth_amt>`.\n\n### Step 3 — propose the grid (one-time confirmation)\n\nGet the current BTC-USDT price via `okx_get_ticker.py`. Set bounds at ±15 % of current price; 12 levels; per-level USDT from Step 1. Apply the v0.2.0 guards.\n\n```bash\npython3 skills\u002F\u003Cauthor>\u002Fokx-trading\u002Fscripts\u002Fokx_grid_setup.py \\\n  --instId BTC-USDT \\\n  --low \u003C0.85*current> --high \u003C1.15*current> \\\n  --levels 12 --quote-sz-per-level \u003Cgrid_quote_per_level> \\\n  --min-profit-gap 0.005 \\\n  --max-position-base \u003C0.5 * (X * 0.20) \u002F current_price>  # half of the grid capital in base ccy\n  --trailing-pct 0.10 --max-rescales 5\n```\n\nRead the proposal output back verbatim. Wait for `YES \u003Cid>`. Then call `okx_grid_apply.py` with the token from the pending file.\n\n### Step 4 — schedule the grid maintenance\n\n```json\n{\n  \"name\": \"schedule_create\",\n  \"arguments\": {\n    \"name\": \"BTC grid maintenance\",\n    \"schedule\": \"every 5m\",\n    \"task\": \"Run python3 skills\u002F\u003Cauthor>\u002Fokx-trading\u002Fscripts\u002Fokx_grid_step.py and report any halts or rescales.\",\n    \"notify\": false\n  }\n}\n```\n\n### Step 5 — schedule the daily snapshot (the honesty checkpoint)\n\n```json\n{\n  \"name\": \"schedule_create\",\n  \"arguments\": {\n    \"name\": \"OKX daily snapshot\",\n    \"schedule\": \"0 9 * * *\",\n    \"task\": \"Run python3 skills\u002F\u003Cauthor>\u002Fokx-trading\u002Fscripts\u002Fokx_snapshot.py and post the digest to me.\",\n    \"notify\": true\n  }\n}\n```\n\n### Step 6 — schedule the drawdown watcher (deploys the reserve)\n\n```json\n{\n  \"name\": \"schedule_create\",\n  \"arguments\": {\n    \"name\": \"Reserve drawdown watcher\",\n    \"schedule\": \"0 10 * * *\",\n    \"task\": \"Run python3 skills\u002F\u003Cauthor>\u002Fokx-trading\u002Fscripts\u002Fokx_dca_dip.py --reserve-usdt \u003Creserve> --threshold-pct 0.30 --max-triggers 3 --instId BTC-USDT. If status is 'trigger', call okx_propose_trade.py with the recommended size, post the proposal to me, and AFTER my YES + the trade executes, run okx_dca_dip.py again with --record-trigger to persist the firing. If status is 'exhausted', alert me. Otherwise stay silent.\",\n    \"notify\": false\n  }\n}\n```\n\nThe watcher only proposes — it never executes autonomously. Reserve is deployed across at most `--max-triggers` dip-buys (default 3); the slice size is `(reserve - already_used) \u002F triggers_remaining`. A trigger re-arms when the drawdown deepens by `--rearm-pct` (default 5 %) or equity recovers above `(1 - rearm_pct) * ATH`.\n\n### What runs autonomously vs. what needs YES\n\n| Component | Autonomous | Needs user YES |\n|---|---|---|\n| Weekly DCA proposal | Schedule fires | Each weekly buy |\n| Grid initial deploy | — | Once at setup |\n| Grid restocks inside band | Yes (pre-authorised) | — |\n| Grid auto-rescale (within `max-rescales`) | Yes (pre-authorised) | — |\n| Grid stop \u002F change bounds | — | Each time |\n| Daily snapshot | Yes (read-only) | — |\n| Drawdown trigger detection | Yes | — |\n| Drawdown dip-buy | — | Each fire |\n\n## Notifications worth sending\n\nUse the scheduler for these. Each one is a one-shot proposal or a digest, never an autonomous trade.\n\n- **Daily digest** (recommended): schedule `0 9 * * *` running `okx_snapshot.py` with `notify=true`. One concise message per morning that includes equity, per-currency balances, 24h fills breakdown, pending-order counts, active strategies, and equity delta vs yesterday. Persists to `~\u002F.aeon\u002Fokx\u002Fsnapshots\u002F\u003Cdate>.json` so the day-over-day comparison remains meaningful.\n- **Momentum scout** (opt-in, often noisy): schedule `every 1h` running `okx_get_candles.py --instId X --bar 1H --indicators`. The script's \"consider buy \u002F sell\" verdict is what should drive a follow-up `okx_propose_trade.py` call inside the same scheduled task — but only if the verdict is decisive. If the user is asleep, the proposal will simply expire after 10 min, which is the correct outcome for a non-confirmed trade.\n- **Trade proposals**: every `okx_propose_trade.py` invocation should be paired with a Telegram message containing the id and details — phrased so the user can copy-paste `YES \u003Cid>` to confirm.\n\nAvoid noisy alerting. Profitable trading is mostly about *not* trading on weak signals; the scout should stay silent unless RSI is decisively past 30\u002F70 or a moving-average cross is clearly above noise.\n\n## Environment\n\nRequired env vars (see `.env.example`):\n\n- `OKX_API_KEY`, `OKX_API_SECRET`, `OKX_API_PASSPHRASE` — your OKX API credentials.\n- `OKX_DEMO_MODE` — `1` (default) routes to OKX demo trading. `0` is live money.\n- `OKX_ALLOWED_SYMBOLS` — CSV allow-list. Empty means any symbol.\n- `OKX_MAX_NOTIONAL_USDT_PER_TRADE` — per-trade ceiling. Default 50.\n- `OKX_MAX_DAILY_NOTIONAL_USDT` — daily ceiling for total executed notional. Default 200.\n\nIf any env var is missing the script exits with code 2 and an explanatory message — surface that to the user.\n",{"name":5,"version":24,"description":7},"0.3.3","master","4aa004da461d820f4ea5499e58eb8d196cf99016","community\u002Fclawhub\u002Fo\u002Fokx-trading",0,"https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge","https:\u002F\u002Fskill-explorer-rho.vercel.app","https:\u002F\u002Fgithub.com\u002FLord1Egypt","Unbreakable. Unstoppable. Unmatched⚡.\r\n Speaker of machine tongues 🤖  | World-builder of decentralized dreams 🌐 | Defender of the digital realm🛡️.","2026-06-10 08:21:01",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add Lord1Egypt\u002Fawesome-skill-forge --skill okx-trading",{"tool":40,"command":41},"bunx","bunx skills add Lord1Egypt\u002Fawesome-skill-forge --skill okx-trading",{"tool":43,"command":44},"pnpm","pnpm dlx skills add Lord1Egypt\u002Fawesome-skill-forge --skill okx-trading","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fcommunity\u002Fclawhub\u002Fo\u002Fokx-trading\u002FSKILL.md",true,[],[49,56,63,70,77,84],{"skillNo":50,"name":51,"nameZh":6,"description":52,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":53,"categories":54,"keywords":55,"publishedAt":19},"01M785WKJB99G3STR1NF9NRTJW","youtube-content","YouTube transcripts to summaries, threads, blogs.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fyoutube-content\u002FSKILL.md",[],[],{"skillNo":57,"name":58,"nameZh":6,"description":59,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":19},"01M785WEFHB0G2S9YA6EPR3H0E","xurl","X\u002FTwitter via xurl CLI: post, search, DM, media, v2 API.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fxurl\u002FSKILL.md",[],[],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":19},"01M785W98EDN4EFJXJPMQEHCRC","touchdesigner-mcp","Control a running TouchDesigner instance via twozero MCP — create operators, set parameters, wire connections, execute Python, build real-time visuals. 36 native tools.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Ftouchdesigner-mcp\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M785W5S9FP3QBH2V191E025P","test-driven-development","TDD: enforce RED-GREEN-REFACTOR, tests before code.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Ftest-driven-development\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M785W2AS08NSSH9YATCV6FJB","teams-meeting-pipeline","Operate the Teams meeting summary pipeline via Hermes CLI — summarize meetings, inspect pipeline status, replay jobs, manage Microsoft Graph subscriptions.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fteams-meeting-pipeline\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M785VXKW4T34BTP1SCHW1R7F","systematic-debugging","4-phase root cause debugging: understand bugs before fixing.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fsystematic-debugging\u002FSKILL.md",[],[]]