Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
37-tool crypto derivatives data suite: funding rates, open interest, liquidations, Hyperliquid whale tracking, and ETF flows.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
SKILL.md
1---2name: coinglass3version: 3.0.44description: |5Crypto derivatives data: funding rates, open interest, liquidations, long/short ratios.67Use when researching perp markets, tracking Hyperliquid whale positions, or comparing ETF flows (e.g. BTC funding, ETH OI, liquidation heatmap).8delivery: script9metadata:10starchild:11emoji: 📈12skillKey: coinglass13plan: professional14api_version: v415version: 3.0.316total_tools: 3717requires:18env:19- COINGLASS_API_KEY20user-invocable: false21disable-model-invocation: false2223---2425## Liquidation Heatmap(真正的价格区间清算压力)2627`cg_liquidation_analysis` 返回全0,不可用。正确做法是直接调 API:2829```python30from tools._api import cg_request3132# 全市场聚合热力图(推荐,无需指定交易所)33# range 支持: 12h, 24h, 3d, 7d, 30d, 90d, 180d, 1y34data = cg_request("api/futures/liquidation/aggregated-heatmap/model1",35params={"symbol": "BTC", "range": "24h"})3637# 返回结构:38# data["y_axis"] → 价格档位列表(从低到高)39# data["liquidation_leverage_data"] → [[y_idx, leverage, usd_value], ...]40# data["price_candlesticks"] → OHLCV K线,最后一根收盘价 = 当前价41# data["update_time"] → 更新时间戳4243# 解析方法:44from collections import defaultdict45y_axis = data["y_axis"]46current_price = float(data["price_candlesticks"][-1][4])47price_liq = defaultdict(float)48for y_idx, leverage, usd_val in data["liquidation_leverage_data"]:49if 0 <= y_idx < len(y_axis):50price_liq[y_axis[y_idx]] += usd_val5152longs = {p: v for p, v in price_liq.items() if p < current_price} # 多头清算(↓触发)53shorts = {p: v for p, v in price_liq.items() if p > current_price} # 空头清算(↑触发)54```5556注意:单交易所版本(`heatmap/model1` 带 exchange 参数)当前会报 400 错误,改用 aggregated 版本。5758## Script Usage5960Script-mode skill — read this file, then invoke from a `bash` block:6162```bash63python3 - <<'EOF'64import sys, json65sys.path.insert(0, "/data/workspace/skills/coinglass")66from exports import funding_rate, cg_open_interest, cg_liquidations6768print(funding_rate(symbol="BTC"))69print(cg_open_interest(symbol="BTC"))70EOF71```7273Read `exports.py` for the full list of available functions and exact74signatures. Common ones: `funding_rate`, `long_short_ratio`,75`cg_open_interest`, `cg_liquidations`, `cg_liquidation_analysis`,76`cg_global_account_ratio`, `cg_top_account_ratio`, `cg_top_position_ratio`,77`cg_taker_exchanges`, `cg_net_position`, `cg_supported_coins`,78`cg_supported_exchanges`, `cg_coins_market_data`, `cg_pair_market_data`,79`cg_ohlc_history`, `cg_hyperliquid_whale_alerts`,80`cg_hyperliquid_whale_positions`, `cg_taker_volume_history`,81`cg_aggregated_taker_volume`, `cg_cumulative_volume_delta`,82`cg_coin_netflow`, `cg_whale_transfers`, `cg_btc_etf_flows`,83`cg_eth_etf_flows`, `cg_sol_etf_flows`.848586# Coinglass8788Coinglass provides the most comprehensive crypto derivatives and institutional data available. 37 tools covering futures positioning, whale tracking, volume analysis, liquidations, and ETF flows.8990**API Plan**: Professional ($699/month)91**Rate Limit**: 6000 requests/minute92**API Version**: V4 (with V2 backward compatibility)93**Total Tools**: 37 across 8 categories949596## Function Reference (full signatures + return shapes)9798All functions live in `exports.py`. Most return `Optional[List[Dict]]` or99`Optional[Dict]`. None means the upstream call failed or returned empty —100always check before indexing.101102### ⚠️ Field naming convention (READ THIS FIRST)103104CoinGlass v4 API uses **camelCase** for almost all data fields, with a few105legacy snake_case exceptions in liquidation endpoints. Don't assume106snake_case — `inspect` the dict before scripting.107108- camelCase: `openInterest`, `volUsd`, `longRate`, `shortVolUsd`,109`exchangeName`, `nextFundingTime`, `fundingIntervalHours`,110`oichangePercent`, `h4OIChangePercent`, `avgFundingRateBySymbol`,111`tokenAmount`, `liquidationUsd` (in some endpoints)112- snake_case (legacy, only in `cg_liquidations`): `liquidation_usd`,113`longLiquidation_usd`, `shortLiquidation_usd`114- `rate` fields (funding) are STRINGS with "+" / "-" / "%" — parse with115`float(r.rstrip('%').lstrip('+'))` to compare numerically116- timestamps are millisecond unix epoch (e.g. `1777881600000`)117118### Funding & Open Interest119120| Function | Signature |121|---|---|122| `funding_rate(symbol, exchange=None)` | dict — keys: `symbol`, `exchange`, `rate` (str), `num_exchanges`, `exchanges_data` (list of {`exchangeName`, `rate`, `nextFundingTime`, `fundingIntervalHours`, `status`}) |123| `cg_open_interest(symbol='BTC', interval='0')` | LIST of dicts (one per exchange) — keys: `symbol`, `openInterest`, `volUsd`, `oichangePercent`, `h4OIChangePercent`, `h24VolChangePercent`, `volChangePercent7d`, `avgFundingRateBySymbol`, `exchangeName`, `exchangeLogo` |124125### Long/Short Ratios126127| Function | Signature |128|---|---|129| `long_short_ratio(symbol='BTC', interval='h4')` | LIST — top item is aggregated; `list` field inside has per-exchange breakdown. Keys: `longRate`, `shortRate`, `longVolUsd`, `shortVolUsd`, `totalVolUsd`, `list` |130| `cg_global_account_ratio(symbol='BTC', exchange='Binance', interval='1h')` | list of historical bars |131| `cg_top_account_ratio(symbol='BTC', exchange='Binance', interval='1h')` | list — top trader account-count ratio |132| `cg_top_position_ratio(symbol='BTC', exchange='Binance', interval='1h')` | list — top trader position-size ratio |133| `cg_taker_exchanges(symbol='BTC', range_type='4h')` | list — taker buy/sell across exchanges |134| `cg_net_position(symbol='BTC', exchange='Binance', interval='1h')` | list — net long-short USD over time |135136### Liquidations137138| Function | Signature |139|---|---|140| `cg_liquidations(symbol='BTC', time_type='h24')` | LIST of dicts (one per exchange + an `'All'` row first). Keys: `exchange`, `liquidation_usd`, `longLiquidation_usd`, `shortLiquidation_usd` (NOTE: snake_case legacy fields) |141| `cg_liquidation_analysis(symbol='BTC', time_type='h24')` | dict — aggregated network-wide stats |142| `cg_coin_liquidation_history(symbol='BTC', interval='h4')` | list — historical liq bars |143| `cg_pair_liquidation_history(symbol='BTC', exchange='Binance', interval='h4')` | list — historical liq for one pair on one exchange |144| `cg_liquidation_coin_list(symbol=None)` | list of all coins with liq summary |145| `cg_liquidation_orders(symbol='BTC', exchange=None)` | list — recent individual liq orders |146147### Futures Market Data148149| Function | Signature |150|---|---|151| `cg_supported_coins()` | List[str] — symbols supported by CoinGlass |152| `cg_supported_exchanges()` | list of exchange info dicts |153| `cg_coins_market_data(symbol=None)` | list — current snapshot for all coins (or one if symbol given) |154| `cg_pair_market_data(symbol='BTC', exchange=None)` | list — pair-level snapshot |155| `cg_ohlc_history(symbol='BTC', interval='h4', exchange=None)` | list of OHLCV bars |156157### Hyperliquid Whale Tracking158159| Function | Signature |160|---|---|161| `cg_hyperliquid_whale_alerts()` | list — recent large-position alerts |162| `cg_hyperliquid_whale_positions()` | list — current open whale positions |163| `cg_hyperliquid_positions_by_coin(symbol='BTC')` | list — whales holding a specific coin |164| `cg_hyperliquid_position_distribution(symbol='BTC')` | dict — long/short position-size distribution |165166### Volume / Flow167168| Function | Signature |169|---|---|170| `cg_taker_volume_history(symbol='BTC', exchange='Binance', interval='1h', limit=1000, start_time=None, end_time=None)` | list — taker buy/sell volume bars |171| `cg_aggregated_taker_volume(symbol='BTC', interval='h4')` | list — aggregated across all exchanges |172| `cg_cumulative_volume_delta(symbol='BTC', exchange='Binance', interval='1h', limit=1000, start_time=None, end_time=None)` | list — CVD bars |173| `cg_coin_netflow(symbol=None)` | list — net inflow/outflow per coin |174| `cg_whale_transfers()` | dict — recent on-chain large transfers |175176### ETF Flows177178| Function | Signature |179|---|---|180| `cg_btc_etf_flows()` | list — daily flows per US BTC ETF |181| `cg_btc_etf_history(etf_ticker=None)` | list — historical AUM/flows |182| `cg_btc_etf_list()` | list of BTC ETF tickers + AUM |183| `cg_btc_etf_premium_discount()` | list — premium/discount % vs NAV |184| `cg_hk_btc_etf_flows()` | list — Hong Kong BTC ETF flows |185| `cg_eth_etf_flows()` / `cg_eth_etf_list()` / `cg_eth_etf_premium_discount()` / `cg_hk_eth_etf_flows()` | ETH ETF equivalents |186| `cg_sol_etf_flows()` / `cg_sol_etf_list()` | SOL ETF data |187| `cg_xrp_etf_flows()` / `cg_xrp_etf_list()` | XRP ETF data |188189### Sample responses (most-used functions)190191`funding_rate(symbol="BTC")`:192```json193{194"symbol": "BTC",195"exchange": "average",196"rate": "-0.0016%",197"num_exchanges": 21,198"exchanges_data": [199{"exchangeName": "Binance", "rate": "+0.0050%",200"nextFundingTime": 1777881600000, "fundingIntervalHours": 8, "status": 1}201]202}203```204205`cg_liquidations(symbol="BTC", time_type="h24")`:206```json207[208{"exchange": "All", "liquidation_usd": 170497688.16,209"longLiquidation_usd": 8179073.80, "shortLiquidation_usd": 162318614.36},210{"exchange": "Bybit", "liquidation_usd": 40454694.98, ...}211]212```213214`cg_open_interest(symbol="BTC")`:215```json216[217{"symbol": "BTC", "openInterest": 61395303653.62, "volUsd": 56349328748.42,218"oichangePercent": 7.17, "h4OIChangePercent": 5.33,219"avgFundingRateBySymbol": -0.001874, "exchangeName": "Binance"}220]221```222223`long_short_ratio(symbol="BTC", interval="h4")`:224```json225[{226"symbol": "BTC", "longRate": 53.65, "shortRate": 46.35,227"longVolUsd": 12558668895.91, "shortVolUsd": 10848776476.99,228"totalVolUsd": 23407445372.91,229"list": [230{"exchangeName": "Binance", "longRate": 55.75, "shortRate": 44.25, ...}231]232}]233```234235236## Tool Selection Guide237238### Decision Tree239240**Step 1: Is this about LIQUIDATIONS?**241242```243Liquidation query?244├─ YES → How many coins?245│ ├─ ALL coins / ranking / 排行 / 汇总246│ │ └─ → cg_liquidation_coin_list ✅ (most liquidation queries land here)247│ ├─ ONE coin, need history over time248│ │ └─ → cg_coin_liquidation_history249│ ├─ ONE coin, specific orders (price/side/USD)250│ │ └─ → cg_liquidation_orders251│ └─ ONE coin, just a quick total + sentiment label252│ └─ → cg_liquidation_analysis (rarely needed; only if explicitly "simple summary")253```254255**Step 2: Is this about LONG/SHORT RATIO?**256257```258Long/short query?259├─ Historical time-series, trend over time, 多空比变化260│ └─ → cg_global_account_ratio (ALL accounts)261│ or cg_top_account_ratio (top traders only)262│ or cg_top_position_ratio (by position size)263└─ Current snapshot only (no history needed)264└─ → long_short_ratio265```266267**Step 3: Is this about OPEN INTEREST?**268269```270OI query?271└─ → cg_open_interest (always — do NOT use cg_coins_market_data for OI)272```273274**Step 4: Is this a MARKET OVERVIEW / SENTIMENT query?**275276```277Sentiment / 市场情绪 / pre-trade check?278└─ Use: funding_rate + long_short_ratio + cg_open_interest279DO NOT use cg_coins_market_data as a substitute for any of the above280```281282---283284### Keyword → Tool Lookup285286| Keyword / Pattern | Correct Tool | ❌ Do NOT use |287|---|---|---|288| 爆仓排行 / 今日爆仓 / all coins liquidation | `cg_liquidation_coin_list` | `cg_liquidations` |289| 24h爆仓汇总 / liquidation summary | `cg_liquidation_coin_list` | `cg_liquidation_analysis` |290| 全网账户多空比 / account L/S ratio | `cg_global_account_ratio` | `long_short_ratio` |291| 头部交易者多空 / top trader ratio | `cg_top_account_ratio` | `long_short_ratio` |292| 未平仓合约 / open interest | `cg_open_interest` | `cg_coins_market_data` |293| 市场情绪多空分析 | `funding_rate` + `long_short_ratio` + `cg_open_interest` | `cg_coins_market_data` |294| BTC做多检查 / pre-trade checklist | `funding_rate` + `cg_global_account_ratio` + `cg_liquidation_coin_list` | — |295296---297298### Common Mistakes299300**Mistake 1 (most common — 8x failure): Using `cg_liquidations` when you need `cg_liquidation_coin_list`**301- `cg_liquidations` → one coin, one timeframe, basic total only302- `cg_liquidation_coin_list(exchange)` → ALL coins, multi-timeframe (1h/4h/12h/24h), per-exchange breakdown303- **Rule:** If the question asks for a ranking, overview, or doesn't specify a single coin → use `cg_liquidation_coin_list`304305**Mistake 2 (5x failure): Using `cg_liquidation_analysis` for liquidation rankings**306- `cg_liquidation_analysis` adds a sentiment label to a single-coin total — it is NOT a ranking tool307- **Rule:** "今日爆仓排行" / "各币种爆仓" → always `cg_liquidation_coin_list`308309**Mistake 3 (3x failure): Using `long_short_ratio` for historical L/S analysis**310- `long_short_ratio` is a current snapshot (no time-series)311- `cg_global_account_ratio` returns history — use it when the user wants trends or comparison over time312- **Rule:** If the question compares 全网 (global) vs 头部 (top traders) → call BOTH `cg_global_account_ratio` AND `cg_top_account_ratio`313314**Mistake 4 (2x failure): Using `cg_coins_market_data` for open interest**315- `cg_coins_market_data` is a bulk snapshot of many coins — not a replacement for dedicated OI or L/S tools316- **Rule:** OI question → `cg_open_interest`. L/S question → `long_short_ratio` or `cg_global_account_ratio`. Never route either to `cg_coins_market_data`.317318## Rules319320### Tool Call Guidance321322**❌ FORBIDDEN TOOLS — NEVER USE:**323- `bash` — Do NOT write scripts to process/format data. Use natural language.324- `write_file` / `read_file` / `edit_file` — Do NOT save intermediate data. Answer directly.325- `learning_log` — ONLY for genuine skill bugs or persistent API errors. NOT for empty responses.326- `echo` — Do NOT use for debugging or output.327328**✅ CORRECT PATTERN:**329- Tool returns data → Summarize in natural language → Done330- Tool returns empty/null → Report "no data available" → Done331- Need calculation (%, change, ratio) → Do mental math in reply332333**Match tool count to question scope:**334- 单一指标问题("BTC 资金费率"、"ETH 多空比")→ 1 个工具,直接返回335- 多维度分析("做多是否合适"、"衍生品体检")→ 3-5 个工具,综合分析336- 对比问题("ETH vs SOL")→ 每个币种调相同工具,并列对比337- **避免重复调用同一工具。** 除非用户明确要求不同币种/交易所的对比。338339### Learning Log Usage (CRITICAL)340341**`learning_log` is FORBIDDEN for:**342- ❌ Empty API responses — just report "no data available"343- ❌ Tool returning None/null — handle gracefully344- ❌ Uncertainty about tool selection — check decision tree first345- ❌ Normal tool errors — retry once, then report failure346347**`learning_log` is ONLY for:**348- ✅ Genuine bugs in skill code (wrong data format returned)349- ✅ Persistent API rate limit errors after 2+ retries350- ✅ Missing tools that should exist per skill definition351352### ETF Tool Selection353| Query | Primary Tool | Secondary Tool |354|-------|--------------|----------------|355| BTC ETF 资金流入/流出 | `cg_btc_etf_flows()` | `cg_btc_etf_history()` for detailed history |356| ETH ETF 资金流入/流出 | `cg_eth_etf_flows()` | — |357| SOL/XRP ETF flows | `cg_sol_etf_flows()` / `cg_xrp_etf_flows()` | — |358| HK ETF flows | `cg_hk_btc_etf_flows()` / `cg_hk_eth_etf_flows()` | — |359| ETF 列表/代码 | `cg_btc_etf_list()` / `cg_eth_etf_list()` | — |360| ETF 溢价/折价 | `cg_btc_etf_premium_discount()` | — |361362**ETF 对比问题 workflow:**363```364# BTC vs ETH ETF 对比365btc = cg_btc_etf_flows()366eth = cg_eth_etf_flows()367# Compare the latest day's net flows, summarize in 2-3 sentences368```369370## Quick Routing (use this first)371372| Query type | Tool |373|---|---|374| 爆仓/liquidation summary (24h, by coin) | `cg_liquidation_coin_list` |375| Individual liquidation orders | `cg_liquidation_orders` |376| Liquidation history for a coin | `cg_coin_liquidation_history` |377| Funding rate | `funding_rate` |378| Long/short ratio (global) | `cg_global_account_ratio` |379| Open interest | `cg_open_interest` |380| Whale activity on Hyperliquid | `cg_hyperliquid_whale_alerts` |381| ETF flows (BTC) | `cg_btc_etf_flows` |382383## When to Use Coinglass384385Use Coinglass for:386- **Derivatives positioning** - What are leveraged traders doing?387- **Whale tracking** - Track large positions on Hyperliquid DEX388- **Funding rates** - Cost of holding perpetual futures389- **Open interest** - Total notional value of open positions390- **Long/Short ratios** - Sentiment among leveraged traders (global, top accounts, top positions)391- **Liquidations** - Forced position closures with heatmaps and individual orders392- **Volume analysis** - Taker volume, CVD, netflow patterns393- **ETF flows** - Institutional adoption (Bitcoin, Ethereum, Solana, XRP, Hong Kong)394- **Whale transfers** - Large on-chain movements (>$10M)395- **Futures market data** - Supported coins, exchanges, pairs, and OHLC price history396397## Tool Categories398399### 1. Basic Derivatives Analytics (7 tools)400401Core derivatives data for market analysis:402403- `funding_rate(symbol, exchange?)` - Current funding rates404- `long_short_ratio(symbol, exchange?, interval?)` - Basic L/S ratios405- `cg_open_interest(symbol)` - Current OI across exchanges406- `cg_liquidations(symbol, time?)` - Recent liquidations407- `cg_liquidation_analysis(symbol)` - Liquidation heatmap analysis408- `cg_supported_coins()` - All supported coins409- `cg_supported_exchanges()` - All exchanges with pairs410411### 2. Advanced Long/Short Ratios (6 tools)412413Deep positioning analysis with multiple metrics:414415- `cg_global_account_ratio(symbol, interval?)` - Global account-based L/S ratio416- `cg_top_account_ratio(symbol, exchange, interval?)` - Top trader accounts ratio417- `cg_top_position_ratio(symbol, exchange, interval?)` - Top positions by size418- `cg_taker_exchanges(symbol)` - Taker buy/sell by exchange419- `cg_net_position(symbol, exchange)` - Net long/short positions420- `cg_net_position_v2(symbol)` - Enhanced net position data421422**Use cases**:423- Smart money tracking (top accounts vs retail)424- Exchange-specific sentiment425- Position size distribution analysis426427### 3. Advanced Liquidations (4 tools)428429Granular liquidation tracking for cascade prediction:430431- `cg_coin_liquidation_history(symbol, interval?, limit?, start_time?, end_time?)` - Aggregated across all exchanges432- `cg_pair_liquidation_history(symbol, exchange, interval?, limit?, start_time?, end_time?)` - Exchange-specific pair433- `cg_liquidation_coin_list(exchange)` - All coins on an exchange434- `cg_liquidation_orders(symbol, exchange, min_liquidation_amount, start_time?, end_time?)` - Individual orders (past 7 days, max 200)435436**Use cases**:437- Identifying liquidation clusters438- Tracking liquidation patterns over time439- Finding large liquidation events440441### 4. Hyperliquid Whale Tracking (4 tools)442443Track large traders on Hyperliquid DEX (~200 recent alerts):444445- `cg_hyperliquid_whale_alerts()` - Recent large position opens/closes (>$1M)446- `cg_hyperliquid_whale_positions()` - Current whale positions with PnL447- `cg_hyperliquid_positions_by_coin()` - All positions grouped by coin448- `cg_hyperliquid_position_distribution()` - Distribution by size with sentiment449450**Use cases**:451- Following smart money on Hyperliquid452- Detecting large position changes453- Tracking whale PnL and sentiment454455### 5. Futures Market Data (5 tools)456457Market overview and price data:458459- `cg_coins_market_data()` - ALL coins data in one call (100+ coins)460- `cg_pair_market_data(symbol, exchange)` - Specific pair metrics461- `cg_ohlc_history(symbol, exchange, interval, limit?)` - OHLC candlesticks462- `cg_taker_volume_history(symbol, exchange, interval, limit?, start_time?, end_time?)` - Pair-specific taker volume463- `cg_aggregated_taker_volume(symbol, interval, limit?, start_time?, end_time?)` - Aggregated across exchanges464465**Use cases**:466- Market screening (scan all coins at once)467- Price action analysis468- Volume pattern recognition469470### 6. Volume & Flow Analysis (4 tools)471472Order flow and capital movement tracking:473474- `cg_cumulative_volume_delta(symbol, exchange, interval, limit?, start_time?, end_time?)` - CVD = Running total of (buy - sell)475- `cg_coin_netflow()` - Capital flowing into/out of coins476- `cg_whale_transfers()` - Large on-chain transfers (>$10M, past 6 months)477478**Use cases**:479- Order flow divergence detection480- Smart money tracking481- Institutional movement monitoring482483### 7. Bitcoin ETF Data (5 tools)484485Track institutional Bitcoin adoption:486487- `cg_btc_etf_flows()` - Daily net inflows/outflows488- `cg_btc_etf_premium_discount()` - ETF price vs NAV489- `cg_btc_etf_history()` - Comprehensive history (price, NAV, premium%, shares, assets)490- `cg_btc_etf_list()` - List of Bitcoin ETFs491- `cg_hk_btc_etf_flows()` - Hong Kong Bitcoin ETF flows492493**Use cases**:494- Institutional demand tracking495- Premium/discount arbitrage496- Regional flow comparison (US vs Hong Kong)497498### 8. Other ETF Data (8 tools)499500Ethereum, Solana, XRP, and Hong Kong ETFs:501502- `cg_eth_etf_flows()` - Ethereum ETF flows503- `cg_eth_etf_list()` - Ethereum ETF list504- `cg_eth_etf_premium_discount()` - ETH ETF premium/discount505- `cg_sol_etf_flows()` - Solana ETF flows506- `cg_sol_etf_list()` - Solana ETF list507- `cg_xrp_etf_flows()` - XRP ETF flows508- `cg_xrp_etf_list()` - XRP ETF list509- `cg_hk_eth_etf_flows()` - Hong Kong Ethereum ETF flows510511**Use cases**:512- Multi-asset institutional tracking513- Comparative flow analysis514- Regional preference analysis515516## Common Workflows517518### Quick Market Scan519```520# Get everything in 3 calls521all_coins = cg_coins_market_data() # 100+ coins with full metrics522btc_liquidations = cg_liquidations("BTC")523whale_alerts = cg_hyperliquid_whale_alerts()524```525526### Deep Position Analysis527```528# BTC positioning across metrics529cg_global_account_ratio("BTC") # Retail sentiment530cg_top_account_ratio("BTC", "Binance") # Smart money531cg_net_position_v2("BTC") # Net positioning532cg_liquidation_heatmap("BTC", "Binance") # Cascade levels533```534535### ETF Flow Monitoring536```537# Institutional demand538btc_flows = cg_btc_etf_flows()539eth_flows = cg_eth_etf_flows()540sol_flows = cg_sol_etf_flows()541```542543### Whale Tracking544```545# Follow the whales546hyperliquid_whales = cg_hyperliquid_whale_alerts()547whale_positions = cg_hyperliquid_whale_positions()548onchain_whales = cg_whale_transfers() # >$10M on-chain549```550551### Volume Analysis552```553# Order flow554cvd = cg_cumulative_volume_delta("BTC", "Binance", "1h", 100)555netflow = cg_coin_netflow() # All coins556taker_vol = cg_aggregated_taker_volume("BTC", "1h", 100)557```558559## Interpretation Guides560561### Funding Rates562563| Rate (8h) | Read |564|------------|------|565| > +0.05% | Extreme greed — crowded long, squeeze risk |566| +0.01% to +0.05% | Bullish bias, normal |567| -0.005% to +0.01% | Neutral |568| -0.05% to -0.005% | Bearish bias, normal |569| < -0.05% | Extreme fear — crowded short, bounce risk |570571Extreme funding often precedes reversals. The crowd is usually wrong at extremes.572573### Open Interest + Price Matrix574575| OI | Price | Read |576|----|-------|------|577| Up | Up | New longs entering — bullish conviction |578| Up | Down | New shorts entering — bearish conviction |579| Down | Up | Short covering — weaker rally, less conviction |580| Down | Down | Long liquidation — weaker selloff, capitulation |581582### Long/Short Ratio583584| Ratio | Read |585|-------|------|586| > 1.5 | Crowded long — contrarian bearish |587| 1.1–1.5 | Moderately bullish |588| 0.9–1.1 | Balanced |589| 0.7–0.9 | Moderately bearish |590| < 0.7 | Crowded short — contrarian bullish |591592### CVD (Cumulative Volume Delta)593594| Pattern | Read |595|---------|------|596| CVD rising, price rising | Strong buy pressure, healthy uptrend |597| CVD falling, price rising | Weak rally, distribution |598| CVD rising, price falling | Accumulation, potential bottom |599| CVD falling, price falling | Strong sell pressure, healthy downtrend |600601### ETF Flows602603| Flow | Read |604|------|------|605| Large inflows | Institutional buying, bullish |606| Consistent inflows | Sustained demand |607| Large outflows | Institutional selling, bearish |608| Premium to NAV | High demand, bullish sentiment |609| Discount to NAV | Weak demand, bearish sentiment |610611## Analysis Patterns612613**Multi-metric confirmation**: Combine tools across categories for high-confidence signals:614- Funding + L/S ratio + liquidations = positioning extremes615- CVD + taker volume + whale alerts = smart money direction616- ETF flows + whale transfers + open interest = institutional conviction617618**Smart money vs retail**: Compare metrics to identify divergence:619- `cg_top_account_ratio` (smart money) vs `cg_global_account_ratio` (retail)620- Hyperliquid whale positions vs overall long/short ratios621622**Cascade prediction**: Use liquidation tools to predict volatility:623- `cg_coin_liquidation_history` shows liquidation patterns over time624- `cg_liquidation_orders` reveals recent forced closures625- Large liquidation events = cascade risk zones626627**Flow divergence**: Track capital movements:628- `cg_coin_netflow` shows where money is flowing629- `cg_whale_transfers` reveals large movements630- ETF flows show institutional demand631632## Performance Optimization633634### Batch vs Individual Calls635636**✅ OPTIMAL**: Use batch endpoints637```638# One call gets 100+ coins639all_coins = cg_coins_market_data()640641# One call gets all whale alerts642whales = cg_hyperliquid_whale_alerts()643644# One call gets all ETF flows645btc_etf = cg_btc_etf_flows()646```647648**❌ INEFFICIENT**: Multiple individual calls649```650# Don't do this - wastes API quota651btc = cg_pair_market_data("BTC", "Binance")652eth = cg_pair_market_data("ETH", "Binance")653sol = cg_pair_market_data("SOL", "Binance")654```655656### Query Parameters657658Most history endpoints support:659- `interval`: Time granularity (1h, 4h, 12h, 24h, etc.)660- `limit`: Number of records (default varies, max 1000)661- `start_time`: Unix timestamp (milliseconds)662- `end_time`: Unix timestamp (milliseconds)663664Example:665```666cg_coin_liquidation_history(667symbol="BTC",668interval="1h",669limit=100,670start_time=1704067200000, # 2024-01-01671end_time=1704153600000 # 2024-01-02672)673```674675## Supported Exchanges676677Major exchanges with futures data:678- **Tier 1**: Binance, OKX, Bybit, Gate, KuCoin, MEXC679- **Traditional**: CME (Bitcoin and Ethereum futures), Coinbase680- **DEX**: Hyperliquid, dYdX, ApeX681- **Others**: Bitfinex, Kraken, HTX, BingX, Crypto.com, CoinEx, Bitget682683Use `cg_supported_exchanges()` for complete list with pair details.684685## Important Notes686687- **API Key**: Requires COINGLASS_API_KEY environment variable688- **Symbols**: Use standard symbols (BTC, ETH, SOL, etc.) - check with `cg_supported_coins()`689- **Exchanges**: Check `cg_supported_exchanges()` for full list with pairs690- **Update Frequency**:691- Market data: ≤ 1 minute692- Funding rates: Every 8 hours (or 1 hour for some exchanges)693- OHLC: Real-time to 1 minute depending on interval694- ETF data: Daily (after market close)695- Whale transfers: Real-time (within minutes)696- **API Versions**:697- V4 endpoints use `CG-API-KEY` header (most tools)698- V2 endpoints use `coinglassSecret` header (some legacy tools)699- Both work with the same COINGLASS_API_KEY environment variable700- **Rate Limits**: Professional plan allows 6000 requests/minute701- **Historical Data Limits**:702- Liquidation orders: Past 7 days, max 200 records703- Whale transfers: Past 6 months, minimum $10M704- Hyperliquid alerts: ~200 most recent large positions705- Other endpoints: Typically months to years of history706707## Data Quality Notes708709- **Hyperliquid**: Data is exchange-specific, doesn't include other DEXs710- **Whale Transfers**: Covers Bitcoin, Ethereum, Tron, Ripple, Dogecoin, Litecoin, Polygon, Algorand, Bitcoin Cash, Solana711- **ETF Data**: US ETFs updated after market close (4 PM ET), Hong Kong ETFs updated after Hong Kong market close712- **Liquidation Orders**: Limited to 200 most recent, use heatmap for broader view713- **CVD**: Cumulative metric - resets are not automatic, track changes not absolute values714715## Version History716717- **v3.0.0** (2025-03): Added 36 new tools718- Advanced liquidations (5 tools)719- Hyperliquid whale tracking (5 tools)720- Volume & flow analysis (5 tools)721- Whale transfers (1 tool)722- Bitcoin ETF (6 tools)723- Other ETFs (8 tools)724- Advanced L/S ratios (6 tools)725- **v2.2.0** (2024): V4 API migration with futures market data726- **v1.0.0** (2024): Initial release with basic derivatives data727