coinglass
Crypto derivatives data: funding rates, open interest, liquidations, long/short ratios. Use when researching perp markets, tracking Hyperliquid whale positions, or comparing ETF flows (e.g. BTC funding, ETH OI, liquidation heatmap).
By starchild-ai-agent · 11,432 installs
npx skills add starchild-ai-agent/official-skills --skill coinglass
Source repository · Upstream listing
Liquidation Heatmap(真正的价格区间清算压力)
cg liquidation analysis 返回全0,不可用。正确做法是直接调 API:
注意:单交易所版本( heatmap/model1 带 exchange 参数)当前会报 400 错误,改用 aggregated 版本。
Script Usage
Script mode skill — read this file, then invoke from a bash block:
Read exports.py for the full list of available functions and exact
signatures. Common ones: funding rate , long short ratio ,
cg open interest , cg liquidations , cg liquidation analysis ,
cg global account ratio , cg top account ratio , cg top position ratio ,
cg taker exchanges , cg net position , cg supported coins ,
cg supported exchanges , cg coins market data , cg pair market data ,
cg ohlc history , cg hyperliquid whale alerts ,
cg hyperliquid whale positions , cg taker volume history ,
cg aggregated taker volume , cg cumulative volume delta ,
cg coin netflow , cg whale transfers , cg btc etf flows ,
cg eth etf flows , cg sol etf flows .
Coinglass
Coinglass provides the most comprehensive crypto derivatives and institutional data available. 37 tools covering futures positioning, whale tracking, volume analysis, liquidations, and ETF flows.
API Plan : Professional ($699/month)
Rate Limit : 6000 requests/minute
API Version : V4 (with V2 backward compatibility)
Total Tools : 37 across 8 categories
Function Reference (full signatures + return shapes)
All functions live in exports.py . Most return Optional[List[Dict]] or
Optional[Dict] . None means the upstream call failed or returned empty —
always check before indexing.
⚠️ Field naming convention (READ THIS FIRST)
CoinGlass v4 API uses camelCase for almost all data fields, with a few
legacy snake case exceptions in liquidation endpoints. Don't assume
snake case — inspect the dict before scripting.
camelCase: openInterest , volUsd , longRate , shortVolUsd ,
exchangeName , nextFundingTime , fundingIntervalHours ,
oichangePercent , h4OIChangePercent , avgFundingRateBySymbol ,
tokenAmount , liquidationUsd (in some endpoints)
snake case (legacy, only in cg liquidations ): liquidation usd ,
longLiquidation usd , shortLiquidation usd
rate fields (funding) are STRINGS with "+" / " " / "%" — parse with
float(r.rstrip('%').lstrip('+')) to compare numerically
timestamps are millisecond unix epoch (e.g. 1777881600000 )
Funding & Open Interest
Function Signature
funding rate(symbol, exchange=None) dict — keys: symbol , exchange , rate (str), num exchanges , exchanges data (list of { exchangeName , rate , nextFundingTime , fundingIntervalHours , status })
cg open interest(symbol='BTC', interval='0') LIST of dicts (one per exchange) — keys: symbol , openInterest , volUsd , oichangePercent , h4OIChangePercent , h24VolChangePercent , volChangePercent7d , avgFundingRateBySymbol , exchangeName , exchangeLogo
Long/Short Ratios
Function Signature
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
cg global account ratio(symbol='BTC', exchange='Binance', interval='1h') list of historical bars
cg top account ratio(symbol='BTC', exchange='Binance', interval='1h') list — top trader account count ratio
cg top position ratio(symbol='BTC', exchange='Binance', interval='1h') list — top trader position size ratio
cg taker exchanges(symbol='BTC', range type='4h') list — taker buy/sell across exchanges
cg net position(symbol='BTC', exchange='Binance', interval='1h') list — net long short USD over time
Liquidations
Function Signature
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)
cg liquidation analysis(symbol='BTC', time type='h24') dict — aggregated network wide stats
cg coin liquidation history(symbol='BTC', interval='h4') list — historical liq bars
cg pair liquidation history(symbol='BTC', exchange='Binance', interval='h4') list — historical liq for one pair on one exchange
cg liquidation coin list(symbol=None) list of all coins with liq summary
cg liquidation orders(symbol='BTC', exchange=None) list — recent individual liq orders
Futures Market Data
Function Signature
cg supported coins() List[str] — symbols supported by CoinGlass
cg supported exchanges() list of exchange info dicts
cg coins market data(symbol=None) list — current snapshot for all coins (or one if symbol given)
cg pair market data(symbol='BTC', exchange=None) list — pair level snapshot
cg ohlc history(symbol='BTC', interval='h4', exchange=None) list of OHLCV bars
Hyperliquid Whale Tracking
Function Signature
cg hyperliquid whale alerts() list — recent large position alerts
cg hyperliquid whale positions() list — current open whale positions
cg hyperliquid positions by coin(symbol='BTC') list — whales holding a specific coin
cg hyperliquid position distribution(symbol='BTC') dict — long/short position size distribution
Volume / Flow
Function Signature
cg taker volume history(symbol='BTC', exchange='Binance', interval='1h', limit=1000, start time=None, end time=None) list — taker buy/sell volume bars
cg aggregated taker volume(symbol='BTC', interval='h4') list — aggregated across all exchanges
cg cumulative volume delta(symbol='BTC', exchange='Binance', interval='1h', limit=1000, start time=None, end time=None) list — CVD bars
cg coin netflow(symbol=None) list — net inflow/outflow per coin
cg whale transfers() dict — recent on chain large transfers
ETF Flows
Function Signature
cg btc etf flows() list — daily flows per US BTC ETF
cg btc etf history(etf ticker=None) list — historical AUM/flows
cg btc etf list() list of BTC ETF tickers + AUM
cg btc etf premium discount() list — premium/discount % vs NAV
cg hk btc etf flows() list — Hong Kong BTC ETF flows
cg eth etf flows() / cg eth etf list() / cg eth etf premium discount() / cg hk eth etf flows() ETH ETF equivalents
cg sol etf flows() / cg sol etf list() SOL ETF data
cg xrp etf flows() / cg xrp etf list() XRP ETF data
Sample responses (most used functions)
funding rate(symbol="BTC") :
cg liquidations(symbol="BTC", time type="h24") :
cg open interest(symbol="BTC") :
long short ratio(symbol="BTC", interval="h4") :
Tool Selection Guide
Decision Tree
Step 1: Is this about LIQUIDATIONS?
Step 2: Is this about LONG/SHORT RATIO?
Step 3: Is this about OPEN INTEREST?
Step 4: Is this a MARKET OVERVIEW / SENTIMENT query?
Keyword → Tool Lookup
Keyword / Pattern Correct Tool ❌ Do NOT use
爆仓排行 / 今日爆仓 / all coins liquidation cg liquidation coin list cg liquidations
24h爆仓汇总 / liquidation summary cg liquidation coin list cg liquidation analysis
全网账户多空比 / account L/S ratio cg global account ratio long short ratio
头部交易者多空 / top trader ratio cg top account ratio long short ratio
未平仓合约 / open interest cg open interest cg coins market data
市场情绪多空分析 funding rate + long short ratio + cg open interest cg coins market data
BTC做多检查 / pre trade checklist funding rate + cg global account ratio + cg liquidation coin list —
Common Mistakes
Mistake 1 (most common — 8x failure): Using cg liquidations when you need cg liquidation coin list
cg liquidations → one coin, one timeframe, basic total only
cg liquidation coin list(exchange) → ALL coins, multi timeframe (1h/4h/12h/24h), per exchange breakdown
Rule: If the question asks for a ranking, overview, or doesn't specify a single coin → use cg liquidation coin list
Mistake 2 (5x failure): Using cg liquidation analysis for liquidation rankings
cg liquidation analysis adds a sentiment label to a single coin total — it is NOT a ranking tool
Rule: "今日爆仓排行" / "各币种爆仓" → always cg liquidation coin list
Mistake 3 (3x failure): Using long short ratio for historical L/S analysis
long short ratio is a current snapshot (no time series)
cg global account ratio returns history — use it when the user wants trends or comparison over time
Rule: If the question compares 全网 (global) vs 头部 (top traders) → call BOTH cg global account ratio AND cg top account ratio
Mistake 4 (2x failure): Using cg coins market data for open interest
cg coins market data is a bulk snapshot of many coins — not a replacement for dedicated OI or L/S tools
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 .
Rules
Tool Call Guidance
❌ FORBIDDEN TOOLS — NEVER USE:
bash — Do NOT write scripts to process/format data. Use natural language.
write file / read file / edit file — Do NOT save intermediate data. Answer directly.
learning log — ONLY for genuine skill bugs or persistent API errors. NOT for empty responses.
echo — Do NOT use for debugging or output.
✅ CORRECT PATTERN:
Tool returns data → Summarize in natural language → Done
Tool returns empty/null → Report "no data available" → Done
Need calculation (%, change, ratio) → Do mental math in reply
Match tool count to question scope:
单一指标问题("BTC 资金费率"、"ETH 多空比")→ 1 个工具,直接返回
多维度分析("做多是否合适"、"衍生品体检")→ 3 5 个工具,综合分析
对比问题("ETH vs SOL")→ 每个币种调相同工具,并列对比
避免重复调用同一工具。 除非用户明确要求不同币种/交易所的对比。
Learning Log Usage (CRITICAL)
learning log is FORBIDDEN for:
❌ Empty API responses — just report "no data available"
❌ Tool returning None/null — handle gracefully
❌ Uncertainty about tool selection — check decision tree first
❌ Normal tool errors — retry once, then report failure
learning log is ONLY for:
✅ Genuine bugs in skill code (wrong data format returned)
✅ Persistent API rate limit errors after 2+ retries
✅ Missing tools that should exist per skill definition
ETF Tool Selection
Query Primary Tool Secondary Tool
BTC ETF 资金流入/流出 cg btc etf flows() cg btc etf history() for detailed history
ETH ETF 资金流入/流出 cg eth etf flows() —
SOL/XRP ETF flows cg sol etf flows() / cg xrp etf flows() —
HK ETF flows cg hk btc etf flows() / cg hk eth etf flows() —
ETF 列表/代码 cg btc etf list() / cg eth etf list() —
ETF 溢价/折价 cg btc etf premium discount() —
ETF 对比问题 workflow:
Quick Routing (use this first)
Query type Tool
爆仓/liquidation summary (24h, by coin) cg liquidation coin list
Individual liquidation orders cg liquidation orders
Liquidation history for a coin cg coin liquidation history
Funding rate funding rate
Long/short ratio (global) cg global account ratio
Open interest cg open interest
Whale activity on Hyperliquid cg hyperliquid whale alerts
ETF flows (BTC) cg btc etf flows
When to Use Coinglass
Use Coinglass for:
Derivatives positioning What are leveraged traders doing?
Whale tracking Track large positions on Hyperliquid DEX
Funding rates Cost of holding perpetual futures
Open interest Total notional value of open positions
Long/Short ratios Sentiment among leveraged traders (global, top accounts, top positions)
Liquidations Forced position closures with heatmaps and individual orders
Volume analysis Taker volume, CVD, netflow patterns
ETF flows Institutional adoption (Bitcoin, Ethereum, Solana, XRP, Hong Kong)
Whale transfers Large on chain movements ( $10M)