Crypto Market Intelligence
Real-time market data pipeline for crypto, stocks, and macro indicators. Zero API keys required. All data fetched from free public APIs.
When to Use
Trigger this skill when you need:
- - Current cryptocurrency prices and market caps
- Bitcoin/Ethereum dominance
- Fear & Greed Index
- Trending coins
- DeFi Total Value Locked (TVL)
- Stock market indices (S&P 500, Nasdaq, Dow, VIX)
- AI stock prices (NVDA, AMD, MSFT, etc.)
- Macro indicators (DXY dollar index, 10Y Treasury yield)
- Pre-fetched data for trading analysis
- Market intelligence for portfolio decisions
Quick Start
Fetch all market data:
CODEBLOCK0
Analyze market conditions:
CODEBLOCK1
Core Features
✅ 6 Free APIs, Zero Keys
- - CoinGecko (coins, global metrics, trending)
- Alternative.me (Fear & Greed Index)
- DeFi Llama (DeFi TVL)
- Yahoo Finance (stocks, indices, bonds)
✅ Crypto Coverage
- - Top 30 coins by market cap
- Global market metrics (total mcap, volume, dominance)
- Fear & Greed Index (current + 7-day history)
- Trending coins
- DeFi Total Value Locked
✅ Stocks & Macro
- - Major indices (S&P 500, Nasdaq, Dow, VIX)
- AI stocks (NVDA, AMD, AVGO, MRVL, TSM, ASML, ARM, MSFT, AMZN, GOOG, META, ORCL)
- AI energy (VST, CEG, OKLO, SMR, TLN)
- AI infrastructure (VRT, ANET, CRDO)
- Dollar Index (DXY)
- 10-Year Treasury Yield
✅ Agent-Ready Output
- - JSON format for easy parsing
- Structured data with timestamps
- Works as cron job or on-demand
- No hallucinated prices — real market data
Usage
Fetch Crypto Data Only
CODEBLOCK2
Output: INLINECODE0
Fetch Stocks/Macro Only
CODEBLOCK3
Output: INLINECODE1
Fetch Everything
CODEBLOCK4
Automated Analysis
Run the analyzer wrapper to fetch data and generate a market summary prompt:
CODEBLOCK5
This fetches fresh data and outputs a structured prompt for the agent to analyze:
- - Market sentiment (Fear & Greed)
- Top movers (biggest gains/losses)
- Macro environment (DXY, yields, VIX)
- Notable signals
Cron Integration
Schedule hourly market data fetches:
CODEBLOCK6
The agent can then read pre-fetched data for instant analysis without waiting for API calls.
Data Schema
Crypto Output (crypto-latest.json)
CODEBLOCK7
Stocks Output (stocks-latest.json)
CODEBLOCK8
Rate Limits & Fair Use
| API | Rate Limit | Notes |
|---|
| CoinGecko | 10-50 calls/min | Free tier, no key required |
| Alternative.me |
Unlimited | Public endpoint |
| DeFi Llama | Unlimited | Public endpoint |
| Yahoo Finance | ~2000 calls/hour | Unofficial API, use responsibly |
Recommendation: Run fetcher hourly, not more frequently. APIs are free but fair use matters.
Troubleshooting
Problem: Fetch fails with timeout
Solution: Check network connection, try again in a few minutes. Some APIs have temporary outages.
Problem: Yahoo Finance returns no data for a stock
Solution: Symbol may be delisted or unavailable. Check symbol accuracy (use ^ prefix for indices, e.g., ^GSPC).
Problem: DeFi TVL is null
Solution: DeFi Llama API may be updating. Historical data endpoint occasionally has lag. Try again later.
Problem: Fear & Greed returns empty
Solution: Alternative.me may be down. Check https://alternative.me/crypto/fear-and-greed-index/ directly.
Architecture Notes
- - No authentication — all APIs are public, no keys to manage
- HTTP requests only — uses Python's built-in
urllib (no external deps) - Error tolerant — if one API fails, others still succeed
- Portable — works on any system with Python 3.7+
- Configurable output — use
--output flag to set data directory
Integration Examples
Discord Bot Alert
CODEBLOCK9
Trading Bot Pre-Analysis
CODEBLOCK10
References
See references/api-sources.md for detailed API documentation, endpoints, response schemas, and rate limit specifics.
Last Updated: 2026-03-13
加密货币市场情报
面向加密货币、股票和宏观指标的实时市场数据管道。无需任何API密钥。所有数据均从免费公共API获取。
使用场景
当您需要以下信息时触发此技能:
- - 当前加密货币价格和市值
- 比特币/以太坊市场主导率
- 恐惧与贪婪指数
- 热门币种
- DeFi总锁仓价值(TVL)
- 股票市场指数(标普500、纳斯达克、道琼斯、VIX)
- AI股票价格(英伟达、超威半导体、微软等)
- 宏观指标(DXY美元指数、10年期国债收益率)
- 用于交易分析的预获取数据
- 投资组合决策所需的市场情报
快速开始
获取所有市场数据:
bash
cd ~/.openclaw/skills/crypto-market-intel/scripts
python3 market-data-fetcher.py all --output ~/market-data
分析市场状况:
bash
./analyze-market.sh
核心功能
✅ 6个免费API,零密钥
- - CoinGecko(币种、全球指标、热门趋势)
- Alternative.me(恐惧与贪婪指数)
- DeFi Llama(DeFi总锁仓价值)
- Yahoo Finance(股票、指数、债券)
✅ 加密货币覆盖范围
- - 市值排名前30的币种
- 全球市场指标(总市值、交易量、主导率)
- 恐惧与贪婪指数(当前值+7天历史)
- 热门币种
- DeFi总锁仓价值
✅ 股票与宏观指标
- - 主要指数(标普500、纳斯达克、道琼斯、VIX)
- AI股票(英伟达、超威半导体、博通、迈威尔科技、台积电、阿斯麦、安谋、微软、亚马逊、谷歌、Meta、甲骨文)
- AI能源(维斯塔斯、星座能源、奥克洛、纽斯凯尔电力、泰莱恩)
- AI基础设施(维谛技术、Arista网络、Credo科技)
- 美元指数(DXY)
- 10年期国债收益率
✅ 智能体就绪输出
- - JSON格式,易于解析
- 带时间戳的结构化数据
- 支持定时任务或按需运行
- 真实市场数据,无虚假价格
使用方法
仅获取加密货币数据
bash
python3 scripts/market-data-fetcher.py crypto --output ./data
输出:data/crypto-latest.json
仅获取股票/宏观数据
bash
python3 scripts/market-data-fetcher.py stocks --output ./data
输出:data/stocks-latest.json
获取全部数据
bash
python3 scripts/market-data-fetcher.py all --output ./data
自动化分析
运行分析器封装脚本以获取数据并生成市场摘要提示:
bash
./scripts/analyze-market.sh ~/market-data
这将获取最新数据并输出供智能体分析的结构化提示:
- - 市场情绪(恐惧与贪婪)
- 最大波动币种(涨幅/跌幅最大)
- 宏观环境(DXY、收益率、VIX)
- 值得关注的信号
定时任务集成
设置每小时市场数据获取:
bash
crontab -e
每小时获取市场数据
0
cd ~/.openclaw/skills/crypto-market-intel/scripts && python3 market-data-fetcher.py all --output ~/market-data
智能体可读取预获取的数据进行即时分析,无需等待API调用。
数据模式
加密货币输出(crypto-latest.json)
json
{
fetched_at: 2026-03-13T15:45:00Z,
source: coingecko+alternative.me,
top_coins: [
{
symbol: BTC,
name: Bitcoin,
price: 68500.0,
market_cap: 1340000000000,
volume_24h: 28000000000,
change24hpct: 2.5,
change7dpct: -1.2,
change1hpct: 0.3,
ath: 69000.0,
athchangepct: -0.7,
rank: 1
}
],
global: {
totalmarketcap_usd: 2400000000000,
totalvolume24h_usd: 85000000000,
btc_dominance: 55.8,
eth_dominance: 17.2,
active_cryptocurrencies: 13245,
marketcapchange24hpct: 1.8
},
fear_greed: [
{
value: 62,
label: Greed,
date: 1710346800
}
],
trending: [
{
name: Solana,
symbol: SOL,
rank: 5,
score: 0
}
],
defi_tvl: {
total_tvl: 95800000000,
date: 1710288000,
change_1d: 2.1
}
}
股票输出(stocks-latest.json)
json
{
fetched_at: 2026-03-13T15:45:00Z,
stocks: {
indices: [
{
symbol: ^GSPC,
price: 5200.5,
prev_close: 5180.0,
change_pct: 0.4
}
],
ai_chips: [
{
symbol: NVDA,
price: 890.25,
prev_close: 885.0,
change_pct: 0.59
}
]
},
dxy: {
price: 103.45,
prev_close: 103.2
},
treasury_10y: {
yield: 4.25,
prev_close: 4.22
}
}
速率限制与合理使用
| API | 速率限制 | 备注 |
|---|
| CoinGecko | 10-50次/分钟 | 免费版,无需密钥 |
| Alternative.me |
无限制 | 公共端点 |
| DeFi Llama | 无限制 | 公共端点 |
| Yahoo Finance | 约2000次/小时 | 非官方API,请合理使用 |
建议: 每小时运行一次获取器,不要过于频繁。API免费但需合理使用。
故障排除
问题: 获取超时失败
解决方案: 检查网络连接,几分钟后重试。部分API可能出现临时故障。
问题: Yahoo Finance返回某只股票无数据
解决方案: 该股票代码可能已退市或不可用。检查代码准确性(指数使用^前缀,例如^GSPC)。
问题: DeFi TVL为空
解决方案: DeFi Llama API可能正在更新。历史数据端点偶尔会有延迟。请稍后重试。
问题: 恐惧与贪婪指数返回空
解决方案: Alternative.me可能宕机。直接访问https://alternative.me/crypto/fear-and-greed-index/ 检查。
架构说明
- - 无需认证 — 所有API均为公共接口,无需管理密钥
- 仅HTTP请求 — 使用Python内置的urllib(无外部依赖)
- 容错性强 — 单个API失败不影响其他API
- 可移植性 — 可在任何Python 3.7+系统上运行
- 可配置输出 — 使用--output参数设置数据目录
集成示例
Discord机器人警报
bash
#!/bin/bash
python3 scripts/market-data-fetcher.py crypto --output /tmp
FEAR=$(jq .fear_greed[0].value /tmp/crypto-latest.json)
if [ $FEAR -lt 25 ]; then
echo 🚨 检测到极度恐惧:$FEAR — 潜在买入机会
fi
交易机器人预分析
python
import json
加载预获取数据
with open(~/market-data/crypto-latest.json) as f:
data = json.load(f)
提取最大波动币种
top
coins = data[topcoins]
gainers = sorted(top
coins, key=lambda x: x[change24h_pct], reverse=True)[:5]
print(24小时涨幅前5名:)
for coin in gainers:
print(f{coin[symbol]}: +{coin[change24hpct]:.2f}%)