Skip to main content
Glama

MarketTrace agent-feed

get_stacked_imbalances

Read-only

Stacked imbalances in the footprint of a symbol, computed on the consolidated trade tape of Binance, Bybit, OKX and Hyperliquid. Answers: "Any stacked buying imbalance on BTC in the last hour?", "Where did aggressive selling stack up this morning?", "Which price bands saw one-sided market orders?". Rule (diagonal, the same as the MarketTrace footprint chart): each candle is split into price rows bucket wide; rows with no trades are skipped, so a row's neighbour is the nearest traded row above or below. A row is a buy imbalance when its taker-buy volume is at least ratio × the taker-sell volume of the nearest traded row below it, and a sell imbalance when its taker-sell volume is at least ratio × the taker-buy volume of the nearest traded row above it; a zero opposite side counts, zero against zero does not. A row counts only if its total volume is at least 10% of the candle's largest row. A stacked imbalance = 3 or more consecutive traded rows flagged on the same side within one candle; a row can sit in a buy run and a sell run at once. ratio = 2, 3 or 4 (default 3). interval = 1m, 5m, 15m or 1h candles (default 1m). Per event: t = candle open, epoch ms; kind = buy (aggressive buying) or sell (aggressive selling); low/high = USD band from the lower edge of the run's lowest row to the upper edge of its highest row (it may include untraded rows); rows = flagged rows in the run; usd = dominant-side volume of the run × row price, whole dollars; partial = true while the candle is still forming or closed less than 3 minutes ago (the tape may still add trades). candles = candles with trades in the window. counts = runs per kind in the whole window; events lists at most limit of them (1..=150, default 50): when there are more, the LARGEST by usd are kept and truncated=true; the list is ordered by time. kinds = buy and/or sell (default both). On BTC at ratio 3 a typical hour has about 38 runs on 1m candles, 13 on 5m, 4 on 15m and 1 on 1h. Window: from/to as RFC3339, YYYY-MM-DD or epoch ms; default the last hour; a candle is included when its open lies in [from, to); at most 12 h per call and from no older than 31 days, beyond either is an error, not a clamp. Rows are never merged: when zoomed out the chart merges rows and outlines fewer, wider runs, so it matches this output only at a zoom where each row is one bucket. coverage.venues lists the venues with tape in the window; an empty list means no tape there (ZEC and ENA keep a 14-day tape). Descriptive: an imbalance states where aggressive volume was one-sided, not what price will do. Read-only.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toNoWindow end (exclusive), same formats. Default: now. At most 12 h after `from`.
fromNoWindow start: RFC3339, `YYYY-MM-DD` (UTC midnight) or epoch ms. Default: `to` minus one hour. No older than 31 days.
kindsNoSides to return: `buy` and/or `sell` (default both).
limitNoRuns listed, 1..=150 (default 50); the largest by usd are kept.
ratioNoDominance ratio: 2, 3 or 4 (default 3). Read as any JSON value and checked in [`stacked_imbalances_query`], so 2.5 or "3" is an invalid_params NAMING the parameter (a typed `u32` would fail inside rmcp's deserializer with no field name). The schema says integer.
symbolYesAsset symbol: BTC, ETH, SOL, BNB, XRP, DOGE, HYPE, ZEC or ENA (case-insensitive; a `USDT` suffix is accepted).
intervalNoCandle interval: 1m, 5m, 15m or 1h (default 1m).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
toYesWindow end as given (exclusive), RFC3339 UTC.
fromYesWindow start as given (inclusive), RFC3339 UTC.
ratioYesDominance ratio used: 2, 3 or 4.
bucketYesPrice-row width of the symbol, USD (rows are never merged).
countsYes
eventsYesAt most `limit` runs — the largest by `usd` — ordered by `t`, then `kind` (buy first), then `low`.
symbolYesUppercase asset symbol, e.g. `BTC`.
candlesYesCandles of the window with trades.
coverageYes`venues` = venues with at least one footprint cell in the window (empty = no tape there).
intervalYesCandle length: `1m`, `5m`, `15m` or `1h`.
truncatedYes`true` when the window held more runs than `limit`.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.