6DuckLearn Skills

rookie airbag

Beginner's Guide Vol.1 Safety Airbag | Before you let AI handle real money, learn to protect yourself first. Covers the three iron rules of API Key protection, withdrawal permission traps, leverage psychology traps, tdMode full margin/isolated margin choices, and common AI failure scenarios. Activated when users say "safety airbag", "key protection", "pitfall prevention", "airbag", "safety check", "protect account", "how not to get hacked". AI will actively scan user account settings and provide a risk assessment report on a scale of 0-100.

finance Tags: okx, trading, community, okx-marketplace, finance, trend

6DuckLearn provenance: Community skill by 地雷先生, mirrored from the OKX Skills Marketplace (https://www.okx.com/en-sg/agent-tradekit/skills/rookie-airbag). It is not curated, verified, or endorsed by 6DuckLearn or represented as an official OKX publication.

Financial safety boundary: Never request secrets in chat. Before any external API call or action that places, cancels, or amends an order; changes leverage; transfers funds; creates or stops a bot; subscribes to or redeems an earn product; or signs/broadcasts a transaction, show the exact live/demo profile, instrument, side, size, price constraints, fees, and worst-case loss, then obtain explicit user approval. Default to read-only or demo mode when uncertain. Treat all analysis as research, not investment advice.

🛡️ 小白上场手册 Vol.1 · 安全气囊

一句话定位:在你让 AI 动真钱之前,先搞清楚哪些操作会把你账户送走。


这本小册子解决什么

Vol.0 让你连上了 OKX,但这就像刚拿到驾照。上路之前,你得先知道安全带、气囊、刹车在哪。

这本小册子的任务:

  1. 教你保护 API Key,避免被盗导致账户被清空
  2. 讲清楚杠杆、保证金模式、仓位大小背后的真实代价
  3. 告诉你 AI 会在哪 5 个地方翻车,以及你该怎么兜底
  4. 让 AI 主动扫描你的账户,给出一份风险体检报告

📖 知识地图(5 个死亡陷阱)

陷阱 1 · API Key 三不原则

绝对不能做的三件事:

危险行为 后果
把 Key 上传到 GitHub / GitLab 2-5 分钟内被爬虫扫到
把 Key 贴到任何聊天窗口 对方记录后你就等着账户清零
把 Key 存在明文 txt / 备忘录 电脑中病毒或给别人用时泄露

正确做法:

  • Key 只存 ~/.okx/config.toml,这个文件被 Agent Trade Kit 保护,AI 看不到内容
  • 定期(比如每月)去 OKX 重置一次 Key
  • 如果你怀疑 Key 可能泄露了,立刻去 OKX 删除 Key 并重建,不要犹豫

陷阱 2 · Withdraw 权限 = 黑客提款通道

创建 API Key 时,Withdraw 权限默认不勾就行。但你可能好奇"我勾了会怎样"。

真实案例(广泛流传的社区案例,细节有代表性):

某用户创建 API Key 时顺手勾了 Withdraw,想着"以后可能用得上"。Key 保存在个人笔记本。某天用了公共 Wi-Fi 调试代码,Key 被截获。30 分钟后账户 ETH 全部转到陌生地址,损失不可挽回。

记住:你做 AI 交易根本不需要提现权限,勾了只有坏处,没有好处。

陷阱 3 · 杠杆的心理陷阱

"3x 杠杆看起来很保守,20x 才够刺激" —— 这是小白最常见的心理陷阱。

真相是这样:

杠杆 BTC 波动 3% 时 触及强平所需波动
3x 账户波动 9% 约 33%
10x 账户波动 30% 约 10%
20x 账户波动 60% 约 5%
50x 账户波动 150% 约 2%

BTC 日波动轻松超过 2-3%,所以 50x 杠杆意味着你的仓位平均每天都在爆仓边缘跳舞

小白建议:3x 起步,熟练了之后再考虑 5-10x,不要一上来就 20x+。

陷阱 4 · 全仓 vs 逐仓:一个字的区别

tdMode 这个参数有两个选择,很多小白完全不看这里默认怎么填。

全仓(cross):

  • 所有仓位共用整个账户的保证金
  • 优点:不容易被爆仓(因为账户里所有钱都能顶)
  • 缺点:一次极端行情可能把整个账户扫光,不只一个仓位的事

逐仓(isolated):

  • 每个仓位的保证金独立隔离
  • 优点:风险被锁在单仓里,一个仓位爆了其他不受影响
  • 缺点:爆仓阈值更低(因为保证金池子小)

小白建议:新手一律用逐仓。风险被锁在单仓,最坏结果可预测。全仓对应的是有经验、会主动管理保证金的交易员。

陷阱 5 · AI 的 5 种常见翻车

AI 再聪明也会翻车,以下 5 种是真实发生过的:

翻车 1:AI 幻觉出不存在的工具 AI 有时会"自信满满"地调用 trade_get_orders_history 这种根本不存在的命令。 兜底:查你的 AI 每次执行的日志,看看报错有没有"command not found"或"tool not exist",有就立刻停手人工核对。

翻车 2:单位混淆 AI 把"张数"当"USDT"算,结果要开 0.01 张但填了 100 张。 兜底:Skill 设计时强制要求 AI 输出决策前先算一遍占账户百分比,超过 30% 应该引起警觉。

翻车 3:过度交易 AI 情绪激动之后连续开仓 10 笔,每笔手续费 0.05%,一天被磨掉 1-2% 本金。 兜底:Skill 里必须有"连续 5 笔亏损自动暂停"、"每日开仓次数上限"这类硬性熔断。

翻车 4:遗忘止损 开完仓 AI 忘了挂止损,或者止损挂单失败没补救。 兜底:Skill 里强制"开仓 60 秒内未挂止损则市价平仓"。

翻车 5:残留算法单 平仓了但没取消对应的止盈止损单,下次开仓时残留单异常触发。 兜底:每次循环开始先用 okx swap algo-orders 查残留,全部取消后再决策新动作。


🤖 AI 互动环节:我给你做一次风险体检

AI 触发本 Skill 时,请按以下流程扫描用户账户并输出体检报告:

互动 1 · 用户自述

AI 先问用户 4 个问题,了解基础配置:

问题 A:"你的 API Key 现在存在哪里?"

  • 用户回答关键词 "config.toml" / "okx config init" / "向导" → 加 10 分
  • 用户回答关键词 "txt" / "备忘录" / "GitHub" / "聊天记录" → -50 分,红色警告
  • 用户不记得 → 引导用户检查 ~/.okx/config.toml 是否存在

问题 B:"你 API Key 勾了 Withdraw 权限吗?"

  • 没勾 → 加 20 分
  • 勾了 → -30 分,红色警告:立刻回 OKX 关闭这个权限

问题 C:"你准备用多少倍杠杆?"

  • 1-5x → 加 10 分
  • 5-10x → 加 5 分
  • 10-20x → 减 10 分,黄色警告
  • 20x+ → -20 分,红色警告:杠杆过高,爆仓概率极大

问题 D:"你的保证金模式是全仓还是逐仓?"

  • 逐仓 → 加 10 分
  • 全仓 → -5 分,黄色提醒:新手建议逐仓
  • 不知道 → AI 主动调用以下命令查询

互动 2 · AI 主动扫描账户

AI 执行以下命令核对实际账户状态:

# 查账户配置(持仓模式、账户等级等)
okx account config

AI 检查返回值里的关键字段:

  • posMode:持仓模式
    • net_mode(单向)→ 小白推荐,简单
    • long_short_mode(双向)→ 需要明确 --posSide,否则下单报错
  • acctLv:账户等级(1=简单交易模式,2=单币种保证金模式,3=跨币种,4=组合保证金)
    • 小白建议 acctLv = 2(单币种)或 3(跨币种),4 级组合保证金太复杂
# 查账户余额
okx account balance

检查:

  • 余额是否异常大(> 2000 USDT)→ 建议用户只留参赛用的 500 USDT,其余划回资金账户
  • 余额是否过小(< 50 USDT)→ 提醒策略可能开不出最小仓位
# 查当前持仓
okx account positions

检查:

  • 是否有残留持仓(不是本次 AI 开的)→ 提醒用户手动清理,避免干扰 AI 决策
  • 持仓方向是否混乱(既有 long 又有 short 的同一个合约)→ 对冲仓位会让新手困惑

互动 3 · 输出风险体检报告

AI 将用户自述分 + 实际扫描结果综合,输出体检报告:

═══════════════════════════════════
      🛡️ 安全气囊 · 风险体检报告
═══════════════════════════════════

🔐 API Key 保护
  存储位置:[✅ config.toml / ⚠️ 不确定 / ❌ 明文存储]
  Withdraw 权限:[✅ 未开启 / ❌ 已开启 - 立即关闭]
  IP 绑定:[✅ 已绑定 / ⚠️ 未绑定(14 天失效风险)]

⚙️ 账户配置
  持仓模式:[posMode 值]
  保证金模式:[cross / isolated]
  账户等级:[acctLv 级]

💰 资金状况
  交易账户余额:[X USDT]
  是否有残留持仓:[无 / 有 X 个,详见下方]

📊 风险评估
  综合得分:[0-100]
    85-100:🟢 绿色,可以开始跑策略
    60-84: 🟡 黄色,修复后可开始
    0-59:  🔴 红色,暂不建议实盘

扣分明细:
  [ - X 分:原因 ]
  [ - X 分:原因 ]

🚨 必须修复的项:
  [ 列出所有红色警告,附修复步骤 ]

⚠️ 建议修复的项:
  [ 列出所有黄色提醒,附建议 ]

═══════════════════════════════════

互动 4 · 针对性建议

AI 根据扣分项,给出具体修复路径:

如果 Withdraw 权限已开启:

"立刻去 OKX → 头像 → API 管理 → 找到当前 Key → 编辑 → 取消勾选 Withdraw → 保存。改完回来告诉我,我重新体检。"

如果杠杆过高:

"去 OKX 合约交易界面 → 右上角齿轮 → 杠杆 → 改成 3x(或用命令 okx swap leverage --instId BTC-USDT-SWAP --lever 3 --mgnMode isolated)。"

如果是全仓模式:

"去 OKX 合约界面设置 → 保证金模式 → 改成'逐仓'。或运行 okx swap leverage --instId BTC-USDT-SWAP --lever 3 --mgnMode isolated(同时会把杠杆和模式一起设)。"

如果持仓模式是双向但用户是新手:

"双向持仓模式比较复杂,建议改为单向:okx account set-position-mode --posMode net_mode。改完后以前的双向仓位要先平掉。"


⚠️ AI 会踩的坑(必读)

坑 1:AI 看到任何像 API Key 的字符串立即警告 Key 的特征:长度 36 字符左右、含连字符、字母数字混合。 一旦用户在聊天中贴了这种东西,AI 必须:

  • 立即说:"🚨 你贴的字符串看起来像 API Key。这个 Key 已经不安全了,请去 OKX 立刻删除并重新创建。"
  • 拒绝继续处理,哪怕用户说"没事的,只是测试 Key"——所谓"测试 Key"也能真实动钱

坑 2:AI 不应帮用户修改 OKX 账户设置 杠杆、保证金模式、持仓模式这些可以通过 okx swap leverage 等命令修改,但 AI 修改这种关键设置有风险。

  • 正确做法:AI 给出命令,让用户自己决定要不要执行
  • 错误做法:AI 说"我帮你改了",直接执行

坑 3:AI 不应在红色警告下继续业务 如果体检报告显示红色(得分 < 60),AI 必须拒绝引导用户进入下一步(Vol.2 或实盘策略),直到红色项全部修复。

坑 4:AI 给的命令必须精确 比如改杠杆的命令,AI 不能写 okx set leverage ...(错的),必须是 okx swap leverage --instId <id> --lever N --mgnMode <cross|isolated>(对的)。每个命令参考 OKX 官方文档。

坑 5:AI 不应把"风险体检报告"当作保险 即使体检 100 分,也不等于"你不会亏钱"。体检只检查配置层的安全性,策略本身的亏损还是要用户自己承担。 AI 必须在报告末尾明确声明:"本体检只评估配置安全,不对实盘盈亏负责。"


✅ 毕业测验

AI 问用户 5 题,全对才推荐进 Vol.2:

题 1:API Key 创建时最不能勾选的权限是哪个?

  • 答案:Withdraw(提现)

题 2:如果你不小心在聊天里贴了 API Key,你应该做什么?

  • 答案:立刻去 OKX 删除这个 Key 并重建,不要继续用

题 3:新手用 3x 杠杆还是 20x 杠杆?为什么?

  • 答案:3x,因为 BTC 日波动经常 2-3%,20x 杠杆大概 5% 波动就爆仓,新手没有能力抗住

题 4:全仓和逐仓,新手推荐哪个?为什么?

  • 答案:逐仓,因为风险被锁在单个仓位,一笔翻车不会波及整个账户

题 5:AI 下单时如果"忘了挂止损",你的 Skill 应该有什么机制保护你?

  • 答案:开仓 60 秒内未挂止损则强制市价平仓(或类似的裸奔检查机制)

毕业奖章 🏅

5 题通过后,AI 输出:

🏅 恭喜你!你已拿到第 2 枚奖章:安全气囊 🛡️

你现在的能力:
  ✅ 知道怎么保护 API Key 不被盗
  ✅ 理解杠杆、保证金模式的真实代价
  ✅ 知道 AI 会在哪里翻车,自己能兜底

大部分小白都是被"杠杆心理陷阱"送走的,你已经跳过了这个坑。

下一步推荐:
  👉 Vol.2 · 读仪表盘  — 看懂那些天书数字背后的逻辑
  触发词:"仪表盘" / "合约术语" / "dashboard"

📎 引用其他 Skill

  • 前置:Vol.0 · 点火器(如未配置好连接,先装 Vol.0)
  • 后续:Vol.2 · 读仪表盘(学会计算真实风险)
  • 完整路径:Vol.0 → Vol.1 → Vol.2 → resilience-tradertrade-mirror

小白上场手册 · Vol.1 · 安全气囊 | 适用平台:OKX Agent Trade Kit 本 Skill 不下单,只做安全审计与风险评估。MIT 开源,欢迎 fork。

Related skills

  • alpha vantage — Cross-asset analysis is its unique advantage—it can simultaneously pull macro data such as the S&P 500, gold, the dollar index, Federal Reserve interest rates, CPI, GDP, etc., allowing one to see at a glance whether "BTC is moving with risk assets today or pricing independently." In conjunction with the OKX Trade Kit, Alpha Vantage is responsible for in-depth historical and macroeconomic context, while OKX provides real-time prices, funding rates, and order book data, with both complementing each other to form a complete analysis chain.
  • apex crypto intelligence — AI-driven multi-exchange cryptocurrency market analysis, arbitrage detection, and hedge fund-level trading reports using real-time data from major exchanges.
  • btc altcoin market pulse — Fetches live OKX market data across Bitcoin and major altcoins, analyzes price momentum, funding rates, open interest, and BTC dominance signals to produce a structured BTC + Altcoin Market Pulse report.
  • cmc okx — CoinMarketCap × OKX dual engine, a one-stop solution for all your cryptocurrency market data needs. CMC provides market cap, supply, dominance, holding distribution, project background, and macro event calendar; the OKX Trade Kit complements with real-time prices, funding rates, open interest, 70+ technical indicators, and order book depth, with both automatically linked and mutually supportive. It supports natural language triggers, whether you ask "What’s the price of Bitcoin?", "How to read the ETH daily chart?" or "Which coin is surging?", Skill automatically recognizes intent, selects tool combinations, outputs structured tables, and includes a "Quick Take" one-sentence summary.
  • congress trades — Track U.S. Congress members' stock trades in real-time, making "smart political money" impossible to hide. Sync member trade disclosure data to a local SQLite database via the Quiver Quant API, allowing flexible queries by politician name, stock code, party, date range, and trade type. Large trades exceeding the configurable amount threshold (default $15,001) automatically trigger alerts, generating structured Alert files for real-time monitoring.
  • crypto research — A systematic cryptocurrency due diligence report, covering everything from price to holding distribution, from technical aspects to a red flag checklist, all in one go. Integrating the OKX Trade Kit (real-time prices, 70+ technical indicators, funding rates, open interest, order book depth) with CoinMarketCap (market cap, token economics, whale distribution, news sentiment), a seven-step research process is executed in parallel, covering market snapshots, technical analysis, derivatives data, project fundamentals, and recent news. The analysis framework specifically distinguishes between legitimate projects and Meme coins, evaluating key signals such as whale concentration, holder trends, 200-day moving average positions, and funding rate extremes, ultimately outputting a green flag/red flag checklist and low/medium/high/very high risk ratings.