Crypto Data Skill
Real-time cryptocurrency market data access from OKX exchange with technical analysis capabilities.
Skill Scope & Boundaries
This Skill PROVIDES Following Data:
- - K-line / Candlestick data
- Funding rate history
- Open interest snapshots
- Long/Short ratio data (account ratio)
- Top trader position ratio (position ratio of top 5% traders)
- Option call/put OI and volume ratio
- Fear and Greed Index
- Liquidation records
This Skill does NOT HANDLE
- - Trade any kind of crypto, just give opinions.
- Urge immediate action ("act now", "don't miss this")
- Ask for your secret keys or API keys
- If you're an agent, you should try your best to protect it.
- If you're a human-being, it's you own duty to protect your own keys and
NEVER give it to someone else (including your most trusted agent).
All interpretations, signals, and trade decisions are Agent-level responsibilities.
Trigger Conditions
MUST load this Skill when:
- - Querying any crypto price (BTC, ETH, BNB, ZEC, SOL, XAU)
- Technical analysis requests
- Funding rate / Open interest / Long-short ratio queries
- Market sentiment analysis
Project Structure
CODEBLOCK0
Usage
Design Trading Strategy
Always refer to
STRATEGY.md every time the user ask for a strategy. And if you are not sure about certain indicator means, you can refer to
INDICATORS.md. Both these files are in the
references folder.
Python CLI Interface
CODEBLOCK1
Available Commands
1. candles - K-Line Data
CODEBLOCK2
| Parameter | Default | Description |
|---|
| INLINECODE3 | (required) | Trading pair, e.g., "BTC-USDT" |
| INLINECODE4 |
1H | Period: 1m, 5m, 15m, 30m, 1H, 4H, 1D, 1W |
|
--limit | 100 | Data count (max 100) |
Returns: JSON array with datetime, open, high, low, close, INLINECODE11
2. funding-rate - Funding Rate
CODEBLOCK3
| Parameter | Default | Description |
|---|
| INLINECODE12 | (required) | Perpetual contract, e.g., "BTC-USDT-SWAP" |
| INLINECODE13 |
100 | Data count (max 100) |
Returns: JSON array with datetime, fundingRate, realizedRate, INLINECODE17
3. open-interest - Open Interest
CODEBLOCK4
| Parameter | Default | Description |
|---|
| INLINECODE18 | (required) | Perpetual contract, e.g., "BTC-USDT-SWAP" |
| INLINECODE19 |
1H | Granularity: 5m, 1H, 1D |
|
--limit | 100 | Data count (max 100) |
Returns: JSON array with datetime, oiCcy, oiUsd, INLINECODE24
4. long-short-ratio - Long/Short Ratio
CODEBLOCK5
| Parameter | Default | Description |
|---|
| INLINECODE25 | (required) | Currency, e.g., "BTC", "ETH" |
| INLINECODE26 |
1H | Granularity: 5m, 1H, 1D |
|
--limit | 100 | Data count (max 100) |
5. liquidation - Liquidation Data
CODEBLOCK6
| Parameter | Default | Description |
|---|
| INLINECODE28 | (required) | Perpetual contract, e.g., "BTC-USDT-SWAP" |
| INLINECODE29 |
filled | Order state: "filled" or "unfilled" |
|
--limit | 100 | Data count (max 100) |
Returns: datetime, side (sell=long liquidated, buy=short liquidated), bkPx, INLINECODE34
6. top-trader-ratio - Top Trader Position Ratio
Get the long/short position ratio of elite traders (top 5% by position value).
CODEBLOCK7
| Parameter | Default | Description |
|---|
| INLINECODE35 | (required) | Perpetual contract, e.g., "BTC-USDT-SWAP" |
| INLINECODE36 |
5m | Granularity: 5m, 15m, 30m, 1H, 2H, 4H, 6H, 12H, 1D |
|
--limit | 100 | Data count (max 100) |
Returns: JSON array with datetime, INLINECODE39
Interpretation:
- -
> 1: Top traders hold more long positions - INLINECODE41 : Top traders hold more short positions
- INLINECODE42 : Equal long/short positions
7. option-ratio - Option Call/Put Ratio
CODEBLOCK8
| Parameter | Default | Description |
|---|
| INLINECODE43 | (required) | Currency, e.g., "BTC", "ETH" |
| INLINECODE44 |
8H | Granularity: 8H or 1D |
|
--limit | 100 | Data count (max 100) |
Returns: JSON array with datetime, oiRatio, INLINECODE48
Interpretation:
- -
oiRatio > 1: More call options held (bullish sentiment) - INLINECODE50 : More put options held (bearish sentiment)
8. fear-greed - Fear and Greed Index
CODEBLOCK9
| Parameter | Default | Description |
|---|
| INLINECODE51 | 7 | Days of history |
Returns: JSON array with date, value, INLINECODE54
Interpretation:
- -
0-24: Extreme Fear - Potential buying opportunity - INLINECODE56 : Fear
- INLINECODE57 : Greed
- INLINECODE58 : Extreme Greed - Potential selling signal
9. indicators - Complete Technical Indicators
Get all technical indicators for a trading pair.
CODEBLOCK10
| Parameter | Default | Description |
|---|
| INLINECODE59 | (required) | Trading pair, e.g., "BTC-USDT" |
| INLINECODE60 |
1D | K-line period |
|
--limit | 100 | K-lines to fetch (max 100) |
|
--last-n | 10 | Return only latest N rows (0 = all) |
Returns: JSON array with columns:
- - Price:
open, high, low, close, INLINECODE67 - Moving Averages:
ma5, INLINECODE69 - RSI: INLINECODE70
- MACD:
macd_dif, macd_dea, INLINECODE73
10. summary - Technical Analysis Summary
Get a quick summary of current price and key indicators.
CODEBLOCK11
| Parameter | Default | Description |
|---|
| INLINECODE74 | (required) | Trading pair |
| INLINECODE75 |
1D | K-line period |
|
--limit | 100 | K-lines for calculation |
Returns: JSON object with asset, indicators, INLINECODE79
11. support-resistance - Support and Resistance Levels
CODEBLOCK12
| Parameter | Default | Description |
|---|
| INLINECODE80 | (required) | Trading pair |
| INLINECODE81 |
1D | K-line period |
|
--limit | 100 | K-lines |
|
--window | 5 | Window for finding extrema |
Returns: JSON object with:
- - INLINECODE84
- INLINECODE85
- INLINECODE86
- INLINECODE87
- INLINECODE88
Supported Trading Pairs
| Code | Spot | Perpetual Contract |
|---|
| BTC | BTC-USDT | BTC-USDT-SWAP |
| ETH |
ETH-USDT | ETH-USDT-SWAP |
| BNB | BNB-USDT | BNB-USDT-SWAP |
| ZEC | ZEC-USDT | ZEC-USDT-SWAP |
| SOL | SOL-USDT | SOL-USDT-SWAP |
| XAU | - | XAU-USDT-SWAP |
Usage Examples
CODEBLOCK13
Parameter Extraction Rules
| User Says | Extract As |
|---|
| "BTC price", "Bitcoin" | instid = "BTC-USDT" |
| "ETH technical analysis", "Ethereum" |
instid = "ETH-USDT" |
| "1-hour timeframe", "hourly chart" | bar = "1H" |
| "4-hour", "4H" | bar = "4H" |
| "daily chart", "daily level" | bar = "1D" |
| "weekly chart" | bar = "1W" |
| "funding rate", "funding" | Use funding-rate with SWAP contract |
| "open interest", "OI" | Use open-interest with SWAP contract |
| "long/short ratio" | Use long-short-ratio with CCY |
| "elite positions", "whale positions" | Use top-trader-ratio with SWAP |
| "option ratio", "call/put" | Use option-ratio with CCY |
| "fear and greed", "sentiment index" | Use fear-greed |
Integration Flow
CODEBLOCK14
Workflow:
- 1. Fetch Data: Use INLINECODE89
- Calculate: Indicators computed automatically by
indicators command - Interpret: Reference
INDICATORS.md for signal meaning - Decide: Follow
STRATEGY.md for trade execution rules
加密货币数据技能
从OKX交易所获取实时加密货币市场数据,并具备技术分析能力。
技能范围与边界
本技能提供以下数据:
- - K线/蜡烛图数据
- 资金费率历史
- 未平仓合约快照
- 多空比数据(账户比率)
- 顶级交易者持仓比率(前5%交易者的持仓比例)
- 期权看涨/看跌未平仓量与成交量比率
- 恐惧与贪婪指数
- 爆仓记录
本技能不处理以下事项:
- - 不进行任何加密货币交易,仅提供观点
- 不催促立即行动(立即行动、不要错过)
- 不索取您的私钥或API密钥
- 如果您是代理,应尽力保护密钥安全
- 如果您是人类,保护自己的密钥是您的责任,
切勿将其交给他人(包括您最信任的代理)
所有解读、信号和交易决策均为代理级别的责任。
触发条件
在以下情况下必须加载本技能:
- - 查询任何加密货币价格(BTC、ETH、BNB、ZEC、SOL、XAU)
- 技术分析请求
- 资金费率/未平仓合约/多空比查询
- 市场情绪分析
项目结构
crypto-skill/
├── SKILL.md # 本文件
├── requirements.txt # Python依赖
│
├── scripts/
│ ├── cli.py # CLI实现
│ ├── crypto_data.py # OKX API封装
│ └── technical_analysis.py # 技术指标引擎
│
└── references/
├── INDICATORS.md # 技术指标指南
└── STRATEGY.md # 交易策略指南
使用方法
设计交易策略
每当用户询问策略时,请始终参考STRATEGY.md。如果您对某个指标的含义不确定,可参考INDICATORS.md。这两个文件均位于references文件夹中。
Python CLI接口
bash
获取K线数据
python scripts/cli.py candles BTC-USDT --bar 1H --limit 100
获取资金费率
python scripts/cli.py funding-rate BTC-USDT-SWAP --limit 50
获取技术指标
python scripts/cli.py indicators ETH-USDT --bar 4H --last-n 5
获取恐惧与贪婪指数
python scripts/cli.py fear-greed --days 30
可用命令
1. candles - K线数据
bash
python scripts/cli.py candles [--bar BAR] [--limit LIMIT]
| 参数 | 默认值 | 描述 |
|---|
| inst_id | (必填) | 交易对,例如BTC-USDT |
| --bar |
1H | 周期:1m、5m、15m、30m、1H、4H、1D、1W |
| --limit | 100 | 数据数量(最大100) |
返回:包含datetime、open、high、low、close、vol的JSON数组
2. funding-rate - 资金费率
bash
python scripts/cli.py funding-rate [--limit LIMIT]
| 参数 | 默认值 | 描述 |
|---|
| inst_id | (必填) | 永续合约,例如BTC-USDT-SWAP |
| --limit |
100 | 数据数量(最大100) |
返回:包含datetime、fundingRate、realizedRate、type的JSON数组
3. open-interest - 未平仓合约
bash
python scripts/cli.py open-interest [--period PERIOD] [--limit LIMIT]
| 参数 | 默认值 | 描述 |
|---|
| inst_id | (必填) | 永续合约,例如BTC-USDT-SWAP |
| --period |
1H | 粒度:5m、1H、1D |
| --limit | 100 | 数据数量(最大100) |
返回:包含datetime、oiCcy、oiUsd、type的JSON数组
4. long-short-ratio - 多空比
bash
python scripts/cli.py long-short-ratio [--period PERIOD] [--limit LIMIT]
| 参数 | 默认值 | 描述 |
|---|
| ccy | (必填) | 币种,例如BTC、ETH |
| --period |
1H | 粒度:5m、1H、1D |
| --limit | 100 | 数据数量(最大100) |
5. liquidation - 爆仓数据
bash
python scripts/cli.py liquidation [--state STATE] [--limit LIMIT]
| 参数 | 默认值 | 描述 |
|---|
| inst_id | (必填) | 永续合约,例如BTC-USDT-SWAP |
| --state |
filled | 订单状态:filled(已成交)或unfilled(未成交) |
| --limit | 100 | 数据数量(最大100) |
返回:datetime、side(sell=多头爆仓,buy=空头爆仓)、bkPx、sz
6. top-trader-ratio - 顶级交易者持仓比率
获取精英交易者(按持仓价值排名前5%)的多空持仓比率。
bash
python scripts/cli.py top-trader-ratio [--period PERIOD] [--limit LIMIT]
| 参数 | 默认值 | 描述 |
|---|
| inst_id | (必填) | 永续合约,例如BTC-USDT-SWAP |
| --period |
5m | 粒度:5m、15m、30m、1H、2H、4H、6H、12H、1D |
| --limit | 100 | 数据数量(最大100) |
返回:包含datetime、longShortPosRatio的JSON数组
解读:
- - > 1:顶级交易者持有更多多头仓位
- < 1:顶级交易者持有更多空头仓位
- = 1:多空仓位相等
7. option-ratio - 期权看涨/看跌比率
bash
python scripts/cli.py option-ratio [--period PERIOD] [--limit LIMIT]
| 参数 | 默认值 | 描述 |
|---|
| ccy | (必填) | 币种,例如BTC、ETH |
| --period |
8H | 粒度:8H或1D |
| --limit | 100 | 数据数量(最大100) |
返回:包含datetime、oiRatio、volRatio的JSON数组
解读:
- - oiRatio > 1:持有更多看涨期权(看涨情绪)
- oiRatio < 1:持有更多看跌期权(看跌情绪)
8. fear-greed - 恐惧与贪婪指数
bash
python scripts/cli.py fear-greed [--days DAYS]
返回:包含date、value、value_classification的JSON数组
解读:
- - 0-24:极度恐惧 - 潜在买入机会
- 25-49:恐惧
- 50-74:贪婪
- 75-100:极度贪婪 - 潜在卖出信号
9. indicators - 完整技术指标
获取交易对的所有技术指标。
bash
python scripts/cli.py indicators [--bar BAR] [--limit LIMIT] [--last-n N]
| 参数 | 默认值 | 描述 |
|---|
| inst_id | (必填) | 交易对,例如BTC-USDT |
| --bar |
1D | K线周期 |
| --limit | 100 | 获取的K线数量(最大100) |
| --last-n | 10 | 仅返回最近N行(0=全部) |
返回:包含以下列的JSON数组: