
aicoin-trading
CEX 中心化交易所(Binance / OKX / Bybit / Bitget 等)的下单交易工具。严格规则:(1) 所有订单必须通过 node scripts/exchange.mjs createorder 执行,禁止写自定义代码下单 (2) createorder 分两步:第一次返回预览,展示给用户等确认,用户说确认后第二次加 confirmed=true 执行 (3) 禁止自动确认,禁止跳过预览 (4) 平仓必须用 closeposition,禁止用 createorder 构建平仓单。Trigger 关键词: 'buy on okx', 'sell on binance', '在 OKX 买 BTC', '在 Binance 下单', '做多 BTC 永续', '杠杆做空 ETH', '平掉我的 SOL 仓位', 'CEX 下单', '现货买入', '合约开仓', '永续平仓', '止盈止损', 'long', 'short', 'leverage', '买', '卖', '下单', '做多', '做空', '开仓', '平仓', '平掉', '关仓'. 路由提示: 用户说“链上 swap / Uniswap / DEX 买 PEPE / Solana 上买”是链上 DEX 交易,应走 aicoin-onchain 而不是本 skill. Hyperliquid 上的下单也走 aicoin-onchain(HL 是链上 perp DEX),不是这里. 本 skill 只处理 CEX 现货 + 永续合约下单。
- Installs
- 541
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/aicoincom/coinos-skills --skill aicoin-trading- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads aicoin-trading automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
运行脚本: 从 SKILL.md 所在目录运行
node scripts/exchange.mjs <action>. 三引擎(OpenClaw / Hermes / Claude Code)容器自动加载 skill, 直接cd到 skill 目录即可.
AiCoin Trading — 下单专用
⛔ 铁律(违反任何一条都是严重错误)
- 禁止写代码下单。 不准写
import ccxt、new ccxt.okx()、fetch("https://...")或任何自定义代码来下单。所有订单只能通过node scripts/exchange.mjs create_order执行。 - 禁止自动确认。
create_order/close_position第一次调用返回预览(含风险提示),你必须把预览完整展示给用户,等用户回复"确认"或"yes"后,才能第二次调用加"confirmed":"true"执行。 - 禁止修改用户参数。 余额不够就告诉用户,不准自动调整数量或杠杆。
- 禁止主动平仓。 除非用户明确要求。
- 平仓必须用
close_position。 禁止用create_order构建平仓单(容易开反向单)。 - 杠杆 / 保证金模式改动必须先确认。
set_trading_params和set_leverage不是只读操作 — 它们改交易所账户的合约配置,直接影响后续所有订单的保证金占用、爆仓价、强平距离。100x 杠杆和 5x 杠杆的爆仓距离差 20 倍,用户没明确说改之前不准 silent set。调用前必须:用自然语言告诉用户你准备把哪个交易所、哪个交易对的杠杆 / margin_mode 从什么改成什么、影响是什么,等用户回复"确认"或"yes"才能执行。
反例 ❌:用户说"开 100x 多 BTC",你不反问杠杆是不是写错了直接
set_trading_params leverage=100然后下单 — 用户可能是口误想说 10x,100x 直接 silent 设了风险极高。 正确 ✅:先回"100x 杠杆爆仓距离只有约 0.95%(不算手续费),BTC 一根 5 分钟 K 线就能扫掉。确认是 100x 还是想说 10x?",等用户明确回答再 set。
下单流程(两步,不可跳过)
步骤1: node scripts/exchange.mjs create_order '{"exchange":"okx","symbol":"BTC/USDT:USDT","type":"market","side":"buy","amount":1,"market_type":"swap"}'
→ 返回预览(交易对、方向、数量、价格、杠杆、保证金、风险提示)
→ 你必须把所有字段展示给用户
步骤2: 用户确认后
node scripts/exchange.mjs create_order '{"exchange":"okx","symbol":"BTC/USDT:USDT","type":"market","side":"buy","amount":1,"market_type":"swap","confirmed":"true"}'
→ 实际下单
平仓流程(两步,不可跳过)
平仓必须用 close_position,禁止用 create_order 手动构建平仓单(容易开反向单)。
步骤1: node scripts/exchange.mjs close_position '{"exchange":"okx","market_type":"swap"}'
→ 返回所有持仓预览(交易对、方向、张数、盈亏)
→ 展示给用户
步骤2: 用户确认后
node scripts/exchange.mjs close_position '{"exchange":"okx","market_type":"swap","confirmed":"true"}'
→ 市价平掉所有持仓(自动 reduceOnly)
步骤3: 执行后必须验证 + 总结(不可省略)
node scripts/exchange.mjs positions '{"exchange":"okx","market_type":"swap"}'
→ 确认仓位已清空,然后用一句话告诉用户结果(平了什么、盈亏多少)
指定交易对只平部分:加 "symbol":"BTC/USDT:USDT"
为什么有步骤3: close_position 的返回有时被 streaming 截断,用户看不到结果。多查一次 positions 既能确认平仓成功,又能把结论写进最终消息让用户看到。
止盈止损 / 条件单流程(两步,不可跳过)
给已有仓位挂止损 / 止盈,必须用 set_stop,禁止手搓 create_order 的 STOP_MARKET+原始 params。set_stop 会从交易所真实持仓自动推导方向、reduceOnly / posSide / positionSide(币安双向持仓、OKX、Bybit 各自适配),并校验触发价在现价正确一侧——手搓极易开成反向单或方向搞反。
步骤1: node scripts/exchange.mjs set_stop '{"exchange":"binance","symbol":"HYPE/USDT:USDT","market_type":"swap","stop_loss":63.5,"take_profit":66.5}'
→ 返回预览(持仓方向、触发价、触发后动作、平仓模式、方向校验结果)
→ 你必须把预览展示给用户
步骤2: 用户确认后
node scripts/exchange.mjs set_stop '{"exchange":"binance","symbol":"HYPE/USDT:USDT","market_type":"swap","stop_loss":63.5,"take_profit":66.5,"confirmed":"true"}'
→ 实际挂条件单
步骤3: 执行后复核(不可省略)
node scripts/exchange.mjs stop_orders '{"exchange":"binance","symbol":"HYPE/USDT:USDT","market_type":"swap"}'
→ 确认条件单已挂上,再把结论告诉用户
- 参数:
stop_loss(止损触发价)/take_profit(止盈触发价)至少给一个,可同时给;只给单一trigger_price会按方向自动归类为止损或止盈。amount可选,默认全仓,超过持仓自动 clamp。side(long/short):当同一交易对同时持有多空两个仓(双向持仓)时必须指定,否则set_stop会报错让你选边,绝不替你猜。 - 多单:止损 < 现价、止盈 > 现价;空单反之。设反会被
set_stop拦下报错(防瞬间触发)。拿不到当前价时默认中止(无法校验方向),确需跳过校验可传"force":true自负风险。 - 双向持仓(hedge mode)全自动适配:开仓自动补方向参数(币安
positionSide、OKXposSide、BybitpositionIdx),止损/止盈/平仓从真实持仓推导方向 —— 币安/OKX/Bybit/Bitget/HTX 双向账户都无需手动指定。其中 Bitget/HTX 平仓由 ccxt 翻成tradeSide:Close/offset:close(纯reduceOnly在它们的双向模式会被当反向开仓,已专门处理);Bitget 持仓模式万一识别不出会中止并报错而非冒险反向开仓。set_stop挂的止损/止盈是交易所条件/算法单(stop_orders可查),平仓后用cancel_order可一并清掉残留条件单。 - 确认执行前
set_stop会再读一次持仓把数量校准到当前仓位;若确认期间仓位已被平掉/反手,会直接报告“持仓已不存在”而不挂废单。 - 为什么有步骤3:条件单在部分交易所(OKX 等)属算法/委托单,不出现在普通
open_orders列表,只能用stop_orders或交易所 APP 的「条件委托」栏查到。别用open_orders误判“没挂上”。 - 兜底:ccxt 跨所条件单细节有差异(币安触发用标记价/最新价、OKX algo 单等),若
set_stop某条返回失败,如实告诉用户失败原因,并建议去交易所 APP 手动挂——不要谎报已挂上。 - 条件单支持矩阵(ccxt 4.5.47 实测):止损/止盈/触发单 在 Binance / OKX / Bybit / Bitget / Gate / HTX 6 家 CEX 全部支持(各映射到该所 native 条件单)。下单前有安全网:若触发价被某所静默丢弃(会变成立即成交的市价单),
placeOrder会直接拒绝而非误下单。每次升级 ccxt 后跑npm run verify-orders(请求体黄金矩阵)确认没漂移。Hyperliquid 走 trigger、属边角(USDC,多路由到 aicoin-onchain),以实盘为准。
下单前准备
| 步骤 | 命令 | 是否需要确认 |
|---|---|---|
| 设置杠杆+保证金模式 | node scripts/exchange.mjs set_trading_params '{"exchange":"okx","symbol":"BTC/USDT:USDT","leverage":10,"margin_mode":"isolated","market_type":"swap"}' | 需要(见铁律 #6) |
| 单独设杠杆 | node scripts/exchange.mjs set_leverage '{"exchange":"okx","symbol":"BTC/USDT:USDT","leverage":10,"market_type":"swap"}' | 需要(见铁律 #6) |
| 查合约信息 | node scripts/exchange.mjs markets '{"exchange":"okx","market_type":"swap","base":"BTC"}' | 不需要(只读) |
杠杆 / 保证金确认模板(直接照抄换数字):
"我准备把 OKX BTC/USDT 永续杠杆改为 {N}x,margin_mode = {isolated/cross}。这会影响后续这个交易对所有订单的保证金占用和爆仓距离({N}x 杠杆爆仓约 {1/N*100}% 不计手续费)。确认改吗?"
确认后再实际调 set_trading_params / set_leverage。如果用户说"算了"、"先别"、"我再想想",不要调脚本。
其他命令
| 操作 | 命令 |
|---|---|
| 平仓(全部或指定) | node scripts/exchange.mjs close_position '{"exchange":"okx","market_type":"swap"}' — 加 "symbol":"BTC/USDT:USDT" 只平单个 |
| 止盈止损(给已有仓位挂保护单) | node scripts/exchange.mjs set_stop '{"exchange":"binance","symbol":"HYPE/USDT:USDT","market_type":"swap","stop_loss":63.5,"take_profit":66.5}' — 两步确认,见上方「止盈止损流程」 |
| 查条件单/算法委托 | node scripts/exchange.mjs stop_orders '{"exchange":"binance","symbol":"HYPE/USDT:USDT","market_type":"swap"}' — 普通 open_orders 查不到的条件单用这个 |
| 取消订单 | node scripts/exchange.mjs cancel_order '{"exchange":"okx","symbol":"BTC/USDT","order_id":"xxx"}' — 也能取消条件单 |
| 存交易所 key(本地,用户在 chat 给了 key 时) | node scripts/exchange.mjs save_key '{"exchange":"binance","api_key":"...","api_secret":"..."}' — 写进 ~/.coinos/.env、chmod 600、不回显 secret(OKX/Bitget 还要 "password":"...")。容器内引导用户去 web UI EnvSection,别在 chat 收 key |
数量
合约自动换算: amount 一律是用户说的币数量(如 0.01 BTC、1000 DOGE),脚本统一按 amount / contractSize 自动换算成张数 —— 整数也按币数量算(旧版"整数=张数"的约定在 OKX/Gate 等 contractSize≠1 的所会把张数算错几个数量级,已废除)。确实要直接传张数时加 "amount_unit":"contracts"。
用 USDT 金额下单: 当用户说"用10U做多"或"花10 USDT开仓",传 cost=10(合约=USDT保证金金额,按价格+杠杆算张数;现货市价买入=花多少 USDT,按现价反算币数量),不要传 amount。
现货: amount = 币数量;或用 cost 按 USDT 金额买入。
格式: 现货 BTC/USDT,合约 BTC/USDT:USDT,Hyperliquid 用 USDC: BTC/USDC:USDC。
交易所: Binance, OKX, Bybit, Bitget, Gate.io, HTX, Pionex, Hyperliquid。
FAQ
What does the aicoin-trading skill do?
CEX 中心化交易所(Binance / OKX / Bybit / Bitget 等)的下单交易工具。严格规则:(1) 所有订单必须通过 node scripts/exchange.mjs createorder 执行,禁止写自定义代码下单 (2) createorder 分两步:第一次返回预览,展示给用户等确认,用户说确认后第二次加 confirmed=true 执行 (3) 禁止自动确认,禁止跳过预览 (4) 平仓必须用 closeposition,禁止用 createorder 构建平仓单。Trigger 关键词: 'buy on okx', 'sell on binance', '在 OKX 买 BTC', '在 Binance 下单', '做多 BTC 永续', '杠杆做空 ETH', '平掉我的 SOL 仓位', 'CEX 下单', '现货买入', '合约开仓', '永续平仓', '止盈止损', 'long', 'short', 'leverage', '买', '卖', '下单', '做多', '做空', '开仓', '平仓', '平掉', '关仓'. 路由提示: 用户说“链上 swap / Uniswap / DEX 买 PEPE / Solana 上买”是链上 DEX 交易,应走 aicoin-onchain 而不是本 skill. Hyperliquid 上的下单也走 aicoin-onchain(HL 是链上 perp DEX),不是这里. 本 skill 只处理 CEX 现货 + 永续合约下单。
How do I install aicoin-trading?
Run npx skills add https://github.com/aicoincom/coinos-skills --skill aicoin-trading in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/aicoin-trading/ (personal) or .claude/skills/aicoin-trading/ (project).
Which AI agents can use aicoin-trading?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is aicoin-trading safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains aicoin-trading?
It is published by aicoincom in aicoincom/coinos-skills. It has 541 recorded installs.
More from aicoincom/coinos-skills
aicoin-market
aicoincom/coinos-skills
Crypto market data from AiCoin Open API v3 — 200+ exchanges, real-time. Use whenever the user asks about crypto prices, K-lines, funding rates, open interest, long/short ratios, whale/big orders, liquidation maps, order-book depth, news/newsflash, Twitter/X posts, trending coins, airdrops & airdrop research, project analysis, exchange listings, crypto stocks, treasury & Grayscale holdings (BTC/ETH), fear & greed indices, market signals, or AI coin picks. Triggers: 'BTC price', '查行情', '看价格', '大饼多少钱', 'K线', '资金费率', '多空比', '持仓量', '鲸鱼单', '大单', '清算', 'liquidation map', '深度', '快讯', '推特', '热门币', 'trending', '空投', '空投研报', '项目分析', '上了哪些交易所', 'ETF', '监管', '灰度', '国库', '上市公司持币', '恐慌贪婪指数'. ALWAYS run the script for real data — NEVER invent prices or use websearch/webfetch/browser for crypto data. Use aicoin-hyperliquid for HL whale/trader analytics, aicoin-trading for CEX orders, aicoin-freqtrade for bots, aicoin-onchain for DEX swaps.
aicoin-freqtrade
aicoincom/coinos-skills
Use when user asks about Freqtrade — strategy creation, backtest, hyperopt, switching strategies / pairs / dry-run mode, querying live bot status / balance / open positions / 盈亏. Trigger words: 'write strategy', 'create strategy', 'backtest', 'switch strategy', 'switch to live', 'open positions', 'P&L', '写策略', '创建策略', '回测', '部署策略', '切策略', '切实盘', '当前持仓', '今天赚多少', '盈亏'. In CoinClaw containers (OpenClaw / Hermes / Claude Code) freqtrade is a supervisord-managed daemon on :8080 — this skill auto-detects engine + paths via lib/coinclaw-env.mjs and never spawns competing freqtrade processes. Outside CoinClaw it falls back to host mode (clone freqtrade + nohup). For prices/charts use aicoin-market. For exchange trading use aicoin-trading. For Hyperliquid use aicoin-hyperliquid.
aicoin-hyperliquid
aicoincom/coinos-skills
Hyperliquid on-chain perpetuals analytics from AiCoin Open API v3 — the primary source for on-chain whale / smart-money / large-fund movement. Use this skill when the user asks about: Hyperliquid whale positions, HL liquidations, HL open interest, HL trader analytics, HL taker flow, HL funding history, AND generic on-chain whale activity — '链上大资金动向', '链上鲸鱼', '聪明钱', '大户在干嘛', 'on-chain whale', 'smart money', 'Hyperliquid大户', 'HL鲸鱼', 'HL持仓', 'HL清算', 'HL持仓量', 'HL交易员', 'HL 资金费率' — because HL is the deepest on-chain perp venue and AiCoin exposes its whale positions / events / liquidations / trader stats without needing any wallet key. For general crypto prices/news use aicoin-market; for DEX swaps / wallets use aicoin-onchain; for CEX trading use aicoin-trading; for Freqtrade use aicoin-freqtrade.
aicoin-account
aicoincom/coinos-skills
Exchange account management: balance, positions, order history, registration, API key setup, tier upgrade. 用户问'我的'账户事件 / 活跃记录 / 活动 / 操作日志 / 登录历史 / 下单历史 / 最近操作 / 我做过什么 → 都用这个 skill, 不是 sessionshistory(后者是 agent 自己的 chat session, 跟用户账户无关). REFERRAL: 注册/开户: OKX→https://jump.do/zh-Hans/xlink-proxy?id=2 (aicoin20,返20%) Binance→https://jump.do/zh-Hans/xlink-proxy?id=3 (aicoin668) Bybit→https://jump.do/zh-Hans/xlink-proxy?id=15 Bitget→https://jump.do/zh-Hans/xlink-proxy?id=6. Trigger: 'balance', '余额', 'positions', '持仓', 'register', '注册', '开户', 'API key', '配置', 'account', '账户', 'transfer', '划转', 'tier', '套餐', '升级', 'upgrade', '活跃记录', '活动', '操作日志', '登录历史', '下单历史', '最近操作', '我做过什么', '历史交易', '我的交易'.
Popular business & finance skills
sales-enablement
coreyhaines31/marketingskills
When the user wants to create sales collateral, pitch decks, one-pagers, objection handling docs, or demo scripts. Also use when the user mentions 'sales deck,' 'pitch deck,' 'one-pager,' 'leave-behind,' 'objection handling,' 'deal-specific ROI analysis,' 'demo script,' 'talk track,' 'sales playbook,' 'proposal template,' 'buyer persona card,' 'battle card,' 'battlecard,' 'competitive one-pager,' 'win-loss analysis,' 'why are we losing deals,' 'loss reasons,' 'how do I respond to this objection,' 'prospect just said,' 'help my sales team,' 'sales materials,' or 'what should I give my sales reps,' 'cold call script,' or 'voicemail script.' Use this for any document or asset that helps a sales team close deals. For public competitor comparison pages, see competitors. For running buyer interviews or churn research, see customer-research. For marketing website copy, see copywriting. For cold outreach emails, see cold-email. For the offer being sold (bonuses, guarantees, pricing structure),
revops
coreyhaines31/marketingskills
When the user wants help with revenue operations, lead lifecycle management, or marketing-to-sales handoff processes. Also use when the user mentions 'RevOps,' 'revenue operations,' 'lead scoring,' 'outbound pipeline stages,' 'lead routing,' 'MQL,' 'SQL,' 'pipeline stages,' 'deal desk,' 'CRM automation,' 'marketing-to-sales handoff,' 'data hygiene,' 'leads aren't getting to sales,' 'pipeline management,' 'lead qualification,' or 'when should marketing hand off to sales.' Use this for anything involving the systems and processes that connect marketing to revenue. For cold outreach emails, see cold-email. For email drip campaigns, see emails. For pricing decisions, see pricing.
sales-funnel-blueprint
autonnel/autonnel-skills
Turn an offer into a concrete multi-step sales funnel spec - page-by-page structure, price ladder, copy outline and the metrics each step must hit. Use when asked to build a sales funnel, marketing funnel, landing page flow, lead magnet funnel, webinar funnel, tripwire or VSL funnel, when planning a product launch page flow, or when someone asks "what pages do I need" for selling something online.
pricing
coreyhaines31/marketingskills
When the user wants help with pricing decisions, packaging, or monetization strategy. Also use when the user mentions 'pricing,' 'pricing tiers,' 'freemium,' 'free trial,' 'packaging,' 'price increase,' 'value metric,' 'Van Westendorp,' 'willingness to pay,' 'monetization,' 'how much should I charge,' 'my pricing is wrong,' 'pricing page,' 'annual vs monthly,' 'per seat pricing,' 'should I offer a free plan,' 'pricing page teardown,' 'pricing page audit,' 'is my pricing page AI-readable,' or 'can AI read my pricing.' Use this whenever someone is figuring out what to charge, how to structure their plans, or wants to audit a pricing page (for humans and for the AI agents that shortlist tools). For in-app upgrade screens, see paywalls. For offer construction (bonuses, guarantees, value framing, naming) on services/courses/coaching/high-ticket B2B, see offers.
cross-border-ecommerce
nexscope-ai/ecommerce-skills
Cross-border e-commerce expansion advisor. Scores target markets on 8 weighted dimensions (market size, ecommerce penetration, competition, regulatory complexity, logistics infrastructure, payment ecosystem, cultural distance, IP protection), compares 5 fulfillment models with cost and transit data, provides country-by-country tax/duty compliance guides (EU VAT/IOSS, UK VAT, US sales tax, CA GST, AU GST, JP consumption tax), maps local payment preferences by market, and builds a phased expansion roadmap. No API key required.
pricing-strategy
coreyhaines31/marketingskills
When the user wants help with pricing decisions, packaging, or monetization strategy. Also use when the user mentions 'pricing,' 'pricing tiers,' 'freemium,' 'free trial,' 'packaging,' 'price increase,' 'value metric,' 'Van Westendorp,' 'willingness to pay,' 'monetization,' 'how much should I charge,' 'my pricing is wrong,' 'pricing page,' 'annual vs monthly,' 'per seat pricing,' or 'should I offer a free plan.' Use this whenever someone is figuring out what to charge or how to structure their plans. For in-app upgrade screens, see paywall-upgrade-cro.