Liquidation Heatmap logo

Liquidation Heatmap

OrganizationPopular
HKUDS
liquidation-heatmap

Liquidation level analysis and heatmap interpretation — identify leveraged position concentration, liquidation cascades, stop-hunt zones, and use liquidation data as support/resistance signals.

Overview

PublisherHKUDS
RepositoryVibe-Trading
Skill nameliquidation-heatmap
Stars
33.6K
Forks
5.5K
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by HKUDS on GitHub. Read the source before you install it.

Installation

Install the Liquidation Heatmap AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/HKUDS/Vibe-Trading.git /tmp/Vibe-Trading
mkdir -p .claude/skills
cp -r /tmp/Vibe-Trading/agent/src/skills/liquidation-heatmap .claude/skills/liquidation-heatmap
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Liquidation Heatmap in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Liquidation Heatmap on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Liquidation Heatmap is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Liquidation Heatmap & Level Analysis

Overview

Analyze the distribution of leveraged positions and their liquidation price levels to identify zones where forced selling/buying will accelerate price moves. Liquidation clusters act as "magnets" — price tends to be attracted toward large liquidation concentrations because market makers and whales profit from triggering cascading liquidations.

Core Concepts

1. Liquidation Mechanics

How liquidation works:

python
# Long position liquidation
long_liquidation_price = entry_price * (1 - 1/leverage + maintenance_margin)

# Short position liquidation
short_liquidation_price = entry_price * (1 + 1/leverage - maintenance_margin)

# Example: BTC long at $65,000, 10x leverage, 0.5% maintenance margin
# Liquidation: $65,000 * (1 - 1/10 + 0.005) = $58,825
# A 9.5% move against the position triggers liquidation

Leverage and liquidation distance:

LeverageLiquidation Distance (Long)Liquidation Distance (Short)
2x~50% drop~50% rise
5x~20% drop~20% rise
10x~10% drop~10% rise
20x~5% drop~5% rise
50x~2% drop~2% rise
100x~1% drop~1% rise

2. Liquidation Heatmap Interpretation

A liquidation heatmap shows where liquidation orders are concentrated across different price levels, typically color-coded by density.

Reading the heatmap:

Price Level    Long Liquidations    Short Liquidations    Interpretation
$70,000        ░░░░░░░░░░          ████████████████      Heavy short liquidation zone
$68,000        ░░░░                ██████████            Moderate short liquidation
$66,000        ███████             ███████               Balanced (current price area)
$64,000        ██████████          ░░░░                  Moderate long liquidation
$62,000        ████████████████    ░░░░░░░░░░            Heavy long liquidation zone

Key principles:

  1. Liquidation clusters are magnets: price tends to gravitate toward large liquidation pools because the forced orders provide liquidity for whales to fill their positions
  2. Liquidation cascades: when a cluster gets hit, the forced selling/buying pushes price further, potentially triggering the next cluster → cascade effect
  3. After liquidation wipe: once a large cluster is liquidated, that price level often becomes support/resistance (overleveraged positions are gone)

3. Liquidation Level Identification

python
def identify_liquidation_clusters(open_interest_by_price, leverage_distribution):
    """
    Estimate where liquidation clusters exist based on
    open interest and leverage distribution.
    """
    clusters = []

    for price_level in price_range:
        # Long liquidations: positions opened above this level with high leverage
        long_liq_volume = estimate_long_liq_at_price(
            open_interest_by_price, leverage_distribution, price_level
        )

        # Short liquidations: positions opened below this level with high leverage
        short_liq_volume = estimate_short_liq_at_price(
            open_interest_by_price, leverage_distribution, price_level
        )

        total = long_liq_volume + short_liq_volume

        if total > significance_threshold:
            clusters.append({
                "price": price_level,
                "long_liq": long_liq_volume,
                "short_liq": short_liq_volume,
                "type": "long" if long_liq_volume > short_liq_volume else "short",
                "magnitude": total,
            })

    return sorted(clusters, key=lambda x: x["magnitude"], reverse=True)

4. Liquidation-Based Trading Signals

Signal 1: Liquidation Magnet

python
def liquidation_magnet_signal(current_price, clusters):
    """
    Price is likely to move toward the nearest large liquidation cluster.
    """
    # Find nearest cluster above and below
    above = [c for c in clusters if c["price"] > current_price]
    below = [c for c in clusters if c["price"] < current_price]

    nearest_above = min(above, key=lambda c: c["price"] - current_price) if above else None
    nearest_below = min(below, key=lambda c: current_price - c["price"]) if below else None

    if nearest_above and nearest_below:
        above_magnitude = nearest_above["magnitude"]
        below_magnitude = nearest_below["magnitude"]

        if above_magnitude > below_magnitude * 2:
            return "upward_magnet"      # Larger cluster above → price likely moves up
        elif below_magnitude > above_magnitude * 2:
            return "downward_magnet"    # Larger cluster below → price likely moves down
        else:
            return "balanced"           # Both sides have similar clusters

Signal 2: Cascade Risk

python
def cascade_risk(current_price, clusters, direction="down"):
    """
    Assess risk of liquidation cascade — multiple clusters stacked close together.
    """
    if direction == "down":
        relevant = sorted([c for c in clusters if c["price"] < current_price and c["type"] == "long"],
                         key=lambda c: c["price"], reverse=True)
    else:
        relevant = sorted([c for c in clusters if c["price"] > current_price and c["type"] == "short"],
                         key=lambda c: c["price"])

    if len(relevant) < 2:
        return "low_cascade_risk"

    # Check if clusters are stacked within 5% of each other
    gaps = []
    for i in range(len(relevant) - 1):
        gap = abs(relevant[i]["price"] - relevant[i+1]["price"]) / current_price * 100
        gaps.append(gap)

    if min(gaps) < 2:
        return "high_cascade_risk"      # Clusters stacked tightly → cascade likely
    elif min(gaps) < 5:
        return "moderate_cascade_risk"
    else:
        return "low_cascade_risk"

Signal 3: Post-Liquidation Support/Resistance

python
def post_liquidation_sr(price_history, liquidation_events):
    """
    After a large liquidation event, that price level often becomes S/R.
    """
    sr_levels = []
    for event in liquidation_events:
        if event.total_liquidated > 100_000_000:  # >$100M liquidated
            sr_levels.append({
                "price": event.price_level,
                "type": "support" if event.liquidation_type == "long" else "resistance",
                "strength": event.total_liquidated,
                "date": event.date,
            })
    return sr_levels

5. Liquidation Data Metrics

Key metrics to track:

MetricDescriptionSignal
24h total liquidationsTotal USD liquidated across all exchanges> $500M = extreme, volatility spike
Long/Short liquidation ratioLongs liquidated / Shorts liquidated> 2 = longs squeezed, < 0.5 = shorts squeezed
Largest single liquidationBiggest individual position liquidated> $10M = whale liquidation
OI change post-liquidationOpen interest change after eventLarge OI drop = leverage washed out (healthy)
Exchange-specific liquidationWhich exchange had most liquidationsIndicates where leverage is concentrated

Liquidation volume interpretation:

24h LiquidationsMarket StateImplication
> $1BExtreme eventMajor leverage wipeout, potential V-reversal
$500M - $1BHigh volatilitySignificant positioning reset
$200M - $500MElevatedModerate leverage reduction
$50M - $200MNormalBackground noise
< $50MCalmLow volatility, leverage building

6. Liquidation Cascade Anatomy

Typical cascade sequence:

1. Initial trigger (macro event, whale selling, technical breakdown)
2. Price hits first liquidation cluster ($65,000)
   → $200M in long liquidations forced to sell
3. Forced selling pushes price to next cluster ($63,000)
   → $300M more in long liquidations
4. Cascade accelerates → high-leverage positions ($62,000-$60,000)
   → $500M in rapid succession
5. Eventually: open interest drops 20-30%, funding rate flips negative
   → Leverage is "washed out" → bottom forms
6. Recovery begins (short-term) as no more forced sellers remain

Trading around cascades:

  • Before cascade: reduce leverage, set wider stops, avoid high-leverage longs near heavy liquidation zones
  • During cascade: do NOT try to catch the knife; wait for OI to stabilize
  • After cascade: when funding rate flips deeply negative + OI has dropped 20%+, contrarian long entry with tight risk

7. Exchange-Level Liquidation Differences

ExchangeLiquidation EngineKey Feature
OKXTiered auto-deleveragingPartial liquidation (reduce position size, not full close)
BinanceInsurance fund + ADLLargest insurance fund (~$1B+) reduces cascade severity
BybitADL (Auto-Deleveraging)ADL triggers when insurance fund depleted
dYdXOn-chain liquidationTransparent, anyone can liquidate (MEV opportunity)

Data Sources

SourceAccessData Available
CoinGlassFree (limited)Liquidation heatmap, 24h liquidations, OI
LaevitasFree/PaidOptions + futures liquidation levels
Kingfisher (Coinalyze)PaidReal-time liquidation level estimates
Hyblock CapitalPaidProfessional liquidation heatmaps
OKX APIFreeHistorical liquidation data
DeFi LlamaFreeDeFi protocol liquidation data

Output Format

## Liquidation Analysis — [Asset] — [Date]

### Liquidation Overview (24h)
- **Total liquidated**: $XXX M
- **Long liquidated**: $XXX M (XX%)
- **Short liquidated**: $XXX M (XX%)
- **Largest single**: $XX M [exchange]
- **Market state**: [extreme / elevated / normal / calm]

### Key Liquidation Levels
| Price Level | Type | Est. Volume | Distance from Current | Priority |
|------------|------|-------------|----------------------|----------|
| $XX,XXX | Short liq cluster | $XXX M | +X.X% | High |
| $XX,XXX | Long liq cluster | $XXX M | -X.X% | High |
| $XX,XXX | Long liq cluster | $XXX M | -X.X% | Medium |

### Heatmap Summary
- **Strongest upside magnet**: $XX,XXX (short liquidation cluster, $XXX M)
- **Strongest downside magnet**: $XX,XXX (long liquidation cluster, $XXX M)
- **Asymmetry**: [upside magnet stronger / downside stronger / balanced]

### Cascade Risk
- **Downside cascade risk**: [high / moderate / low]
  - [X clusters stacked within X% below current price]
- **Upside cascade risk**: [high / moderate / low]

### Post-Liquidation S/R Levels
- **Recent support formed**: $XX,XXX (long liquidation wipeout on DATE)
- **Recent resistance formed**: $XX,XXX (short liquidation wipeout on DATE)

### Trading Implications
- **Bias**: [upward magnet stronger → mild bullish / downward → bearish]
- **Risk**: [high leverage zone within X% → reduce position size]
- **Key level**: [$XX,XXX — if broken, cascade risk activates]

Notes

  • Liquidation data is estimated, not exact — exchanges do not publish real-time liquidation level details for all users
  • Heatmap providers use statistical models based on OI and leverage distribution to estimate liquidation prices
  • Liquidation levels shift constantly as traders open/close positions — treat as dynamic zones, not fixed prices
  • "Stop hunts" (price briefly touching a liquidation cluster then reversing) are common — market makers deliberately trigger clusters
  • DeFi liquidations are fully transparent (on-chain) but CEX liquidations are opaque
  • This framework is for research purposes only and does not constitute investment advice

Frequently asked questions

What does the Liquidation Heatmap AI skill do?

Liquidation level analysis and heatmap interpretation — identify leveraged position concentration, liquidation cascades, stop-hunt zones, and use liquidation data as support/resistance signals.

Why use Liquidation Heatmap on TypingMind?

Because you install it once and use it with any model. Liquidation Heatmap is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Liquidation Heatmap in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/HKUDS/Vibe-Trading/tree/main/agent/src/skills/liquidation-heatmap. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Liquidation Heatmap?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Liquidation Heatmap?

As many as you like. As long as a model supports skills, you can use Liquidation Heatmap with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Liquidation Heatmap AI skill free?

Yes. It is published on GitHub by HKUDS under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇