CryptoPulse.xyz

Real-time perpetual market microstructure monitor for Perpl — orderbook pressure heatmap + multi-coin momentum comparison

Orderbook Pressure Heatmap (Perpl)

--
15m candles · 0 barsBid depth ■Ask depth ■Y: price (0 bps span)
Cells: avg resting bid × ask (USD) per price rowcanvas2D
About this heatmap— data source & how it is calculated

Data source

  • Perpl orderbook snapshots. A separate collector service (perpl_snapshot_collector.py) samples the Perpl BTC perpetual L2 book once per second and stores the top 3 price levels per side as [price, size] pairs, plus the mid price. Rows land in the Postgres table BookSnapshot.
  • Latency. The collector flushes to Postgres in hourly batches, so the newest snapshot can lag the exchange by up to 60 minutes. This chart is a microstructure replay, not a live tape.
  • Serving. The Node server preloads the last 30 minutes into memory at boot and back-fills 24 hours in the background; the page polls /api/ticks every 5 s from that cache, never hitting the database per request.
  • Live ladder overlay (BTC only). The server holds its own subscription to Perpl's market-data WebSocket (order-book@1) and re-broadcasts the top 20 levels per side every 500 ms over /ws/orderbook. This is the only truly real-time layer on the chart.
  • 24h reference price. The mid of the newest snapshot at or before 24 hours ago (/api/price-ref); the headline change is (current mid − reference mid) / reference mid.

How it is calculated

  • Axes. X is absolute time aligned to 15-minute bucket boundaries (data gaps stay blank). Y is absolute price on one shared scale: min/max of every mid and every quoted level in the window, padded 4%.
  • Glow points. Every quoted level in every 1-second snapshot is one point: bids in the bull colour, asks in the bear colour. Brightness = log10(price × size + 1) / log10(max + 1) × 0.3. Points are drawn with additive blending (WebGPU, canvas2D fallback), so overlapping resting liquidity sums into brighter bands.
  • Candles. Open/high/low/close of the Perpl mid price inside each 15-minute bucket.
  • Footprint cells (bid × ask). The price axis is cut into rows (~14 px each). For each bucket and row, the USD resting on bids and on asks is summed across all snapshots and divided by the number of snapshots in that bucket, giving the average resting liquidity at that price. Sides under $1 are hidden; numbers are omitted when the cell is too small to fit them.
  • Δ book (bottom strip). Per bucket: average resting bid USD − average resting ask USD. Positive means the book leans to the bid side. It is an orderbook imbalance, not a traded-volume delta.
  • Ladder overlay. Classic depth-chart shape: bids fill the left half, asks the right, best price toward the centre. Height is cumulative size from the best level outward, normalised by that side's total.
  • Caveat. The collector stores orderbook state only, no individual trades, so every number here is resting order pressure rather than executed volume. A NinjaTrader-style volume footprint would require changing the collector.

Momentum Comparison (live order-flow)

Connecting to live Binance data…
About these indicators— data source & how it is calculated

Data source

  • Binance spot, not Perpl. Each coin runs its own connection to Binance: one combined WebSocket with the @trade stream (aggressor side = the inverse of Binance's isBuyerMaker flag) and the @kline_1m stream, plus a REST poll of the top-20 /depth book every 2 s.
  • Windows kept in memory. Trades: last 600 s. Candles: 200 one-minute klines bootstrapped at start, up to 500 retained (~8 h). Nothing from this panel is written to the database.
  • Coins. BTCUSDT, ETHUSDT, SOLUSDT, ZECUSDT. HYPE and MON have no Binance spot pair and are omitted.
  • Delivery. The server recomputes every indicator in-process and pushes a snapshot to the browser once per second over /ws/momentum. The sparkline is the bias score sampled every 5 s over the last hour.
  • Readiness. A card shows values only after at least 26 one-minute candles exist (the MACD slow period).

How it is calculated

  • Active Buy/Sell 5m. Σ price × qty of trades in the last 300 s, split by aggressor side, with trade counts. CVD 5m = buy USD − sell USD.
  • EMA(5/20). Exponential moving averages of 1-minute closes; "Bullish cross" when EMA5 > EMA20.
  • OBI. (bid qty − ask qty) / (bid qty + ask qty) using only levels within ±0.5% of mid. Coloured beyond ±0.05.
  • MACD Hist. EMA12 − EMA26 of closes, signal = EMA9 of that line, histogram = MACD − signal.
  • RSI(14). Wilder-smoothed RSI on 1-minute closes; ≥70 flagged overbought (bearish), ≤30 oversold (bullish).
  • vs VWAP. Σ(typical price × volume) / Σ volume across the retained candles, compared with the current mid.
  • vs POC. Volume profile over the retained candles in 24 price bins (each candle's volume spread evenly across the bins its high–low range covers); POC is the centre of the densest bin.
  • Walls. Count of levels per side whose size is ≥ 3× the average size across all 40 polled levels.
  • Heikin-Ashi streak. Number of consecutive same-colour Heikin-Ashi candles among the last three (+ green, − red).
  • Bias Score (−100…+100). Nine components, equal weight 1: EMA cross ±1, raw OBI, MACD histogram sign ±1, CVD sign ±1, HA streak / 3 (clamped ±1), above/below VWAP ±1, RSI (+1 at ≤30, −1 at ≥70, linear (50 − RSI) / 20 in between), above/below POC ±1, walls (min(bid,2) − min(ask,2)) × 2 clamped ±1. Score = sum / 9 × 100. BULLISH above +10, BEARISH below −10.
  • Vote trend. Integer votes: OBI ±1 beyond ±0.2, CVD sign, RSI (−1 >70, +1 <30), MACD sign, VWAP side, EMA cross, up to ±2 per side for walls, ±1 when the last three HA candles agree. |score| ≥ 3 sets the label.