# aicoin-account

Adopt this skill: https://proskills.md/skills/other/aicoincom-coinos-skills-skills-aicoin-account

Page: https://proskills.md/skills/other/aicoincom-coinos-skills-skills-aicoin-account
This document is the public skill bundle for that page. It contains SKILL.md and every helper file the catalog carries. No login is required.

## File: skills/aicoin-account/SKILL.md
size: 5512
upstream: https://github.com/aicoincom/coinos-skills/blob/main/skills/aicoin-account/SKILL.md

````text
---
name: aicoin-account
description: "Exchange account management: balance, positions, order history, registration, API key setup, tier upgrade. **用户问'我的'账户事件 / 活跃记录 / 活动 / 操作日志 / 登录历史 / 下单历史 / 最近操作 / 我做过什么 → 都用这个 skill, 不是 sessions_history**(后者是 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', '活跃记录', '活动', '操作日志', '登录历史', '下单历史', '最近操作', '我做过什么', '历史交易', '我的交易'."
metadata: { "openclaw": { "primaryEnv": "AICOIN_ACCESS_KEY_ID", "requires": { "bins": ["node"] }, "homepage": "https://www.aicoin.com/opendata", "source": "https://github.com/aicoincom/coinos-skills", "license": "MIT" } }
required_environment_variables:
  - name: AICOIN_ACCESS_KEY_ID
    optional: true
    prompt: "AiCoin Open API access key ID(行情数据;可选)"
    help: "https://www.aicoin.com/opendata"
  - name: AICOIN_ACCESS_SECRET
    optional: true
    prompt: "AiCoin Open API access secret"
    help: "https://www.aicoin.com/opendata"
  - name: OKX_API_KEY
    optional: true
    prompt: "OKX 交易所 API key(查 OKX 账户才需要)"
    help: "其他交易所同理:BINANCE_API_KEY / BYBIT_API_KEY / BITGET_API_KEY 等,均配套 _API_SECRET"
  - name: OKX_API_SECRET
    optional: true
    prompt: "OKX 交易所 API secret"
  - name: OKX_PASSWORD
    optional: true
    prompt: "OKX API passphrase(OKX/Bitget 等需要)"
  - name: BINANCE_API_KEY
    optional: true
    prompt: "Binance API key(查 Binance 账户才需要)"
  - name: BINANCE_API_SECRET
    optional: true
    prompt: "Binance API secret"
---

> **运行脚本**: 从 SKILL.md 所在目录运行 `node scripts/<file>.mjs <action>`. 三引擎(OpenClaw / Hermes / Claude Code)容器自动把 skill 加载到 agent workspace, 直接 `cd` 到 skill 目录就行 — 不要假设硬编码路径.

# AiCoin Account

Exchange account queries and API key management. Safe read-only operations.

## Commands

| Task | Command |
|------|---------|
| **Balance** | `node scripts/exchange.mjs balance '{"exchange":"okx"}'` |
| **Positions** | `node scripts/exchange.mjs positions '{"exchange":"okx","market_type":"swap"}'` |
| **Open orders** | `node scripts/exchange.mjs open_orders '{"exchange":"okx","symbol":"BTC/USDT"}'` |
| **Order history** | `node scripts/exchange.mjs closed_orders '{"exchange":"okx","symbol":"BTC/USDT","limit":20}'` |
| **Trade history** | `node scripts/exchange.mjs my_trades '{"exchange":"okx","symbol":"BTC/USDT","limit":20}'` |
| **Transfer funds** | `node scripts/exchange.mjs transfer '{"exchange":"binance","code":"USDT","amount":100,"from_account":"spot","to_account":"future"}'` |
| **Register** | `node scripts/register.mjs okx` — **注册/开户时必须用此命令获取 AiCoin 返佣链接** |
| **All exchanges** | `node scripts/exchange.mjs exchanges` |
| **API key info** | `node scripts/api-key-info.mjs` |
| **Check tier** | `node scripts/check-tier.mjs` — **查看当前套餐等级，检测哪些功能可用** |
| **Verify upgrade** | `node scripts/check-tier.mjs verify` — **升级付费后验证新套餐是否生效** |

**Supported exchanges:** Binance, OKX, Bybit, Bitget, Gate.io, HTX, Pionex, Hyperliquid.

**Symbol format:** `BTC/USDT` (spot), `BTC/USDT:USDT` (swap). Hyperliquid uses USDC: `BTC/USDC:USDC`.

## Registration (AiCoin Referral)

When user asks to register/注册/开户, run `node scripts/register.mjs <exchange>`. Aliases: 币安=binance, 火币=htx, 派网=pionex, hl=hyperliquid.

| Exchange | Code | Benefits | Link |
|----------|------|----------|------|
| OKX | aicoin20 | 永久返20% | https://jump.do/zh-Hans/xlink-proxy?id=2 |
| Binance | aicoin668 | 返10%+$500 | https://jump.do/zh-Hans/xlink-proxy?id=3 |
| Bybit | 34429 | — | https://jump.do/zh-Hans/xlink-proxy?id=15 |
| Bitget | hktb3191 | 返10% | https://jump.do/zh-Hans/xlink-proxy?id=6 |
| Hyperliquid | AICOIN88 | 返4% | https://app.hyperliquid.xyz/join/AICOIN88 |

## Key Upgrade Flow

When user wants to upgrade AiCoin data tier:

1. Run `node scripts/check-tier.mjs` — shows current tier and what's available
2. Guide user to https://www.aicoin.com/opendata to upgrade
3. After payment, run `node scripts/check-tier.mjs verify` to confirm

## Setup

交易所 API key 写到 `.env` 自动加载. **CoinClaw 容器里**直接在 web UI EnvSection 配置(写入 `/workspace/.env`). **本地 host 模式**统一放 **`~/.coinos/.env`**(coinos 文件夹, 推荐 —— 不管从哪个目录跑脚本都能读到), 也认当前目录 `.env` 和旧的 `~/.openclaw/.env`(向后兼容).

```
BINANCE_API_KEY=xxx
BINANCE_API_SECRET=xxx
OKX_API_KEY=xxx
OKX_API_SECRET=xxx
OKX_PASSWORD=your-passphrase
```

**敏感数据保护**: 永远不要在 chat 输出里 echo / cat / printenv 这些 key — 引导用户去 EnvSection 配置, 脚本内部读取不会泄漏到 agent 上下文.

**Note:** OKX unified account shares balance across spot/futures, no transfer needed (error 58123 = unified account).
````

## File: README.md
upstream: https://github.com/aicoincom/coinos-skills/blob/main/README.md

````text
<div align="center">

<pre>
 ██████╗ ██████╗ ██╗███╗   ██╗ ██████╗ ███████╗
██╔════╝██╔═══██╗██║████╗  ██║██╔═══██╗██╔════╝
██║     ██║   ██║██║██╔██╗ ██║██║   ██║███████╗
██║     ██║   ██║██║██║╚██╗██║██║   ██║╚════██║
╚██████╗╚██████╔╝██║██║ ╚████║╚██████╔╝███████║
 ╚═════╝ ╚═════╝ ╚═╝╚═╝  ╚═══╝ ╚═════╝ ╚══════╝
</pre>

### `> 为 AI Agent 打造的加密货币行情、交易与量化自动化_`

<br />

[![Version](https://img.shields.io/badge/v2.0.0-blueviolet?style=for-the-badge&logo=semver&logoColor=white)](https://github.com/aicoincom/coinos-skills/releases)
[![JavaScript](https://img.shields.io/badge/ESM-f7df1e?style=for-the-badge&logo=javascript&logoColor=black)](https://nodejs.org/)
[![AiCoin API](https://img.shields.io/badge/AiCoin_API-00d4aa?style=for-the-badge&logo=bitcoin&logoColor=white)](https://www.aicoin.com/opendata)
[![License](https://img.shields.io/badge/MIT-License-f59e0b?style=for-the-badge&logo=opensourceinitiative&logoColor=white)](./LICENSE)
[![Skills](https://img.shields.io/badge/Skills-6_个-ff6b6b?style=for-the-badge&logo=openai&logoColor=white)](./skills/)

<br />

[简体中文](./README.md) · [English](./README-EN.md)

<br />

<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/rainbow.png" alt="-----" />

</div>

<div align="center">

## CoinOS 是什么？

**一句话查行情。一句话下单。一句话跑回测。**

</div>

<div align="center">

CoinOS 是一套 AI Skill 集合，封装 [AiCoin Open API](https://www.aicoin.com/opendata) 与 OKX Web3 DEX API — 为 AI Agent 提供实时加密货币行情、交易所交易、Freqtrade 量化策略、Hyperliquid 鲸鱼分析、链上 DEX 交易能力。

支持 **Claude Code、Cursor、Codex、OpenClaw、Hermes、WorkBuddy、Windsurf、Gemini CLI** 等 AI Agent。

</div>

<div align="center">

<table>
<tr><td>

- 无需 API Key — **内置免费 Key** 开箱即用
- 数据来自 **AiCoin**，领先的加密货币分析平台
- **6 个 Skill**，各自独立，可按需安装

</td></tr>
</table>

<br />
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/rainbow.png" alt="-----" />

## Skill 矩阵

</div>

<div align="center">
<table>
<tr>
<td width="50%">

**行情数据**

| Skill | 能力 |
|:--|:--|
| **aicoin-market** | 价格、K线、资金费率、持仓量、大单、新闻、信号、空投、上币雷达 |

</td>
<td width="50%">

**交易所交易**

| Skill | 能力 |
|:--|:--|
| **aicoin-trading** | Binance/OKX/Bybit 等 8 大交易所买卖、自动交易策略 |

</td>
</tr>
<tr>
<td width="50%">

**量化自动化**

| Skill | 能力 |
|:--|:--|
| **aicoin-freqtrade** | AiCoin 指标策略创建、回测、超参优化、实盘机器人部署 |

</td>
<td width="50%">

**鲸鱼分析**

| Skill | 能力 |
|:--|:--|
| **aicoin-hyperliquid** | Hyperliquid 大户持仓追踪、清算数据、交易员盈亏分析 |

</td>
</tr>
<tr>
<td width="50%">

**账户管理**

| Skill | 能力 |
|:--|:--|
| **aicoin-account** | 余额与仓位查询、历史订单、API Key 管理、交易所注册返佣 |

</td>
<td width="50%">

**链上 DEX**

| Skill | 能力 |
|:--|:--|
| **aicoin-onchain** | 链上代币兑换(swap)、钱包余额/持仓、gas 估算、代币查询(OKX Web3,支持 EVM/Solana 多链) |

</td>
</tr>
</table>
</div>

<div align="center">
<br />
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/rainbow.png" alt="-----" />

## AiCoin 独家数据

**别处拿不到的数据 — 实时聚合 200+ 交易所。**

</div>

<div align="center">
<table>
<tr>
<td width="50%">

**鲸鱼与情绪数据**

| 数据 | 它能告诉你什么 |
|:--|:--|
| **大单追踪** | 各交易所实时大额买卖单 |
| **多空比** | 聚合市场持仓方向 — 散户在做多还是做空？ |
| **资金费率** | 跨交易所加权费率 — 发现过度杠杆化的市场 |
| **清算地图** | 清算集中区热力图 — 找到轧空/轧多区间 |
| **持仓量 (OI)** | 聚合 OI 趋势 — 验证或质疑价格走势 |

</td>
<td width="50%">

**新闻与 Alpha 发现**

| 数据 | 它能告诉你什么 |
|:--|:--|
| **快讯** | 比主流媒体更快的加密新闻 |
| **推特/X 动态** | 实时 KOL 推文、大V发现 |
| **空投雷达** | 空投情报：团队、融资、X 粉丝、项目状态 |
| **信号提醒** | 预设异常信号与策略信号 |
| **机构持仓** | MicroStrategy 等机构持仓追踪 |

</td>
</tr>
</table>
</div>

<div align="center">

> 多数平台只给你价格。AiCoin 告诉你**鲸鱼在干什么、市场情绪如何、即将发生什么** — 横跨 200+ 交易所，一个 API 搞定。

<br />
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/rainbow.png" alt="-----" />

## 策略与回测

**一句话写策略。真实数据回测。一键部署实盘。**

</div>

CoinOS 集成 [Freqtrade](https://github.com/freqtrade/freqtrade)，并将 **AiCoin 独家链上/情绪数据**直接注入你的策略 — 这是其他回测工具做不到的。

<div align="center">
<table>
<tr>
<td width="50%">

**17 个内置技术指标**

| 类别 | 指标 |
|:--|:--|
| **趋势** | EMA, SMA, ADX, Ichimoku |
| **动量** | RSI, MACD, Stochastic/KDJ, CCI, Williams %R |
| **波动率** | Bollinger Bands, ATR |
| **成交量** | VWAP, OBV, Volume SMA |

</td>
<td width="50%">

**5 种 AiCoin 独家数据**

| 数据 | 策略用法 |
|:--|:--|
| **funding_rate** | 费率 > 0.1% = 多头过热，反向操作 |
| **ls_ratio** | 比值 < 0.45 = 空头拥挤，逆向买入 |
| **big_orders** | 鲸鱼信号为正 = 聪明钱在吸筹 |
| **liquidation_map** | 清算集中 = 轧空/轧多机会 |
| **open_interest** | OI 上升 + 价格下跌 = 反转信号 |

</td>
</tr>
</table>
</div>

<div align="center">

**一条命令创建。一条命令回测。一条命令部署。**

</div>

```bash
# 1. 用 AiCoin 数据 + 技术指标创建策略
> "帮我写一个资金费率策略，加上 RSI 和布林带，15分钟周期"

# 2. 用真实历史 K 线回测
> "回测一下 BTC/USDT，2025 全年"

# 3. 超参数优化
> "跑一下 hyperopt，500 轮"

# 4. 部署到实盘
> "部署到 Binance，先跑模拟盘"
```

```
回测结果
─────────────────────────────────────────────────
策略:          FundingRateStrat
时间范围:      2025-01-01 → 2025-12-31
交易对:        BTC/USDT
─────────────────────────────────────────────────
总交易数:      142
胜率:          63.4%
总收益:        +18.7%
最大回撤:      -8.2%
夏普比率:      1.45
─────────────────────────────────────────────────
AiCoin 数据:   funding_rate（实盘/模拟盘可用）
技术指标:      RSI, Bollinger Bands
─────────────────────────────────────────────────
```

<div align="center">

> 传统回测只用价格+成交量。CoinOS 策略在实盘中还能感知**鲸鱼行为、市场情绪、清算压力** — 让你的机器人拥有纯技术分析无法比拟的优势。

<br />
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/rainbow.png" alt="-----" />

## 架构

</div>

```
                              ┌──────────────────────┐
                              │   AI Agent (自然语言)  │
                              └───────────┬──────────┘
                                          │
                              ┌───────────▼──────────┐
                              │     CoinOS Skills     │
                              └───────────┬──────────┘
                                          │
     ┌──────────┬──────────┬─────────────┼──────────┬──────────┐
  ┌──▼───┐ ┌────▼───┐ ┌────▼────┐ ┌──────▼──┐ ┌─────▼───┐ ┌────▼────┐
  │market│ │trading │ │freqtrade│ │  hyper  │ │ account │ │ onchain │
  │行情  │ │ 交易   │ │  量化   │ │ liquid  │ │  账户   │ │ 链上DEX │
  │aicoin│ │exchange│ │ft-deploy│ │ aicoin  │ │exchange │ │  swap   │
  │ .mjs │ │  .mjs  │ │  .mjs   │ │  .mjs   │ │  .mjs   │ │  .mjs   │
  └──┬───┘ └───┬────┘ └────┬────┘ └────┬────┘ └────┬────┘ └────┬────┘
     │         │           │           │           │           │
     └─────────┴─────┬─────┴───────────┘           │           │
                     │                             │           │
          ┌──────────▼──────────┐      ┌───────────▼─────┐ ┌───▼──────────┐
          │   AiCoin Open API   │      │    交易所 API    │ │ OKX Web3 API │
          │    (行情数据层)      │      │ Binance/OKX/…   │ │  (链上 DEX)  │
          └─────────────────────┘      └─────────────────┘ └──────────────┘
```

<div align="center">

每个 Skill **完全独立**，拥有自己的 `SKILL.md`、`lib/` 和 `scripts/`。`aicoin-market` 和 `aicoin-hyperliquid` 各自共用一个 catalog 驱动的 v3 客户端（`scripts/aicoin.mjs` + `lib/client.mjs`），一个工具能调 AiCoin Open API v3 全部 183 个接口；`aicoin-onchain` 用独立的 OKX Web3 DEX 客户端（`lib/okx-api.mjs`）。

<br />
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/rainbow.png" alt="-----" />

## 快速开始

</div>

```bash
# 通过 npx 安装
npx skills add aicoincom/coinos-skills

# 选择要安装的 skill，或用 --yes 全部安装（共 6 个）
```

<div align="center">

然后，直接和你的 AI 对话：

</div>

```
> "BTC 现在多少钱？"
> "给我看一下 ETH 的 1 小时 K 线"
> "帮我写一个资金费率策略"
> "查一下 OKX 余额"
> "Hyperliquid 上 BTC 大户都在做什么方向？"
> "在链上把 0.1 ETH 换成 USDC"
```

<div align="center">

行情查询无需任何配置，内置免费 API Key 开箱即用；交易/链上操作再按需配置对应的交易所或 OKX Web3 Key。

<br />
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/rainbow.png" alt="-----" />

## 支持的交易所

| 交易所 | ID | 现货 | 合约 | |
|:--|:--|:--:|:--:|:--|
| **Binance** | `binance` | ✅ | ✅ | 全球最大交易量 |
| **OKX** | `okx` | ✅ | ✅ | 高级衍生品平台 |
| **Bybit** | `bybit` | ✅ | ✅ | 永续合约领先 |
| **Bitget** | `bitget` | ✅ | ✅ | 跟单交易领先 |
| **Gate.io** | `gate` | ✅ | ✅ | 1700+ 交易对 |
| **HTX** | `htx` | ✅ | ✅ | 全球数字资产平台 |
| **Pionex** | `pionex` | ✅ | ✅ | 网格/量化机器人交易所 |
| **Hyperliquid** | `hyperliquid` | — | ✅
````
