perpwatch

v0.1.0
io.github.CloudCorpRecords/perpwatch Checked 1 day ago Published 1 month ago

Cross-exchange crypto perps microstructure feed: funding, liquidations, footprint, big trades.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

get_market_state

Single normalized perpetual-futures microstructure snapshot for one crypto symbol, aggregated across Binance, Bybit, OKX and Hyperliquid. Answers: "What's the market state for BTC?", "Is ETH positioning stretched?". Covers BTC, ETH, SOL, BNB, XRP, DOGE, HYPE, ZEC, ENA. Returns funding+2y-percentile, OI, volume, CVD aggression, order-book imbalance, recent liquidation pressure, basis, and key drivers. Scales: *_ratio fields are 0..1, percentiles are 0-100, rel.* are multipliers of the trailing median (1.4 = 140%), obi.skew is -1..+1 (positive = bid-heavy), cvd.delta_usd positive = net taker buy…

ParameterTypeDescription
symbol *stringAsset symbol: BTC, ETH, SOL, BNB, XRP, DOGE, HYPE, ZEC or ENA (case-insensitive; a `USDT` suffix is accepted, e.g. `BTCUSDT`).

get_funding_percentile

Current perpetual funding rate for a symbol, ranked vs its own multi-year history as a percentile (0-100). Answers: "Is BTC funding unusually high?", "What percentile is ETH funding at?". Returns rate_bps (basis points, 8h-normalized, cross-venue; positive = longs pay shorts), percentile (0-100), streak_h (hours the rate has kept its sign), and the coverage (venues + history depth backing the rank). Read-only.

ParameterTypeDescription
symbol *stringAsset symbol: BTC, ETH, SOL, BNB, XRP, DOGE, HYPE, ZEC or ENA (case-insensitive; a `USDT` suffix is accepted, e.g. `BTCUSDT`).

get_liquidations_recent

Recent cross-exchange liquidation notional estimates for a symbol. Answers: "How much got liquidated on ETH in the last hour?", "Mostly longs or shorts?". Covers Binance, Bybit, OKX (not Hyperliquid). USD values are base quantity multiplied by each venue's source reference price; Bybit/OKX expose bankruptcy price, so these are estimates rather than execution notionals. Returns whole-dollar estimates, long_ratio (0..1 share of LONGS liquidated), notional_semantics, and event count for the window (window_s, default 3600, max 86400). Read-only.

ParameterTypeDescription
symbol *stringAsset symbol: BTC, ETH, SOL, BNB, XRP, DOGE, HYPE, ZEC or ENA (case-insensitive; a `USDT` suffix is accepted).
window_sinteger | nullLook-back window in seconds, 1..=86400 (default 3600). Values beyond 24 h are rejected, not clamped.

get_ohlcv

Consolidated cross-exchange OHLCV candles for a symbol (all four venues' trades merged onto one timeline). Answers: "Show me BTC 1h candles", "What's the 24h range?". Use for stop placement, position sizing (ATR), R:R and realized-volatility math — the exact-candle complement to get_market_state's approximate price block. Intervals: 5m, 15m, 1h, 4h, 1d (default 1h); limit 1..=200 candles (default 100), oldest first. The consolidated tape holds 31 days, so limit × interval must fit inside it: 1d ≤ 31, 4h ≤ 186, 1h and finer reach the full 200 — beyond that is an error, not a clamp. ZEC…

ParameterTypeDescription
symbol *stringAsset symbol: BTC, ETH, SOL, BNB, XRP, DOGE, HYPE, ZEC or ENA (case-insensitive; a `USDT` suffix is accepted).
intervalstring | nullCandle interval: 5m, 15m, 1h, 4h or 1d (default 1h).
limitinteger | nullNumber of candles, newest last: 1..=200 (default 100).

get_conditional_outcomes

Measured HISTORY of forward returns after a stated condition — the base rate from this feed's own data, replacing folklore like "high funding = squeeze". Answers: "What happened historically after funding above the 90th percentile?", "When OBI stayed bid-heavy while funding was positive, what did the next 24h look like?". Condition fields AND together (state at least one). Funding (multi-year series): funding_pct_gte/lte (AS-OF percentile 0..100 — the rank the live endpoint showed at that moment, no look-ahead), streak_h_gte (hours funding kept its sign), funding_sign (positive|negative).…

ParameterTypeDescription
symbol *stringAsset symbol: BTC, ETH, SOL, BNB, XRP, DOGE, HYPE, ZEC or ENA (case-insensitive; a `USDT` suffix is accepted).
archive_featurestring | nullv2: condition on ONE archived state feature (15-min archive): `obi_skew` (−1..+1), `oi_chg_1h_pct` (%), `taker_buy_ratio` (0..1), `basis_bps`. ANDs with the funding fields; the match window becomes…
archive_gtenumber | nullMatch hours where the archive feature's RAW value ≥ this (raw thresholds have no sample floor — they exist from the first point).
archive_ltenumber | nullMatch hours where the archive feature's RAW value ≤ this.
archive_pct_gtenumber | nullMatch hours where the feature's AS-OF percentile ≥ this (0..=100; the rank exists only once its series has warmup_samples points).
archive_pct_ltenumber | nullMatch hours where the feature's as-of percentile ≤ this (0..=100).
funding_pct_gtenumber | nullMatch hours where the AS-OF funding percentile was ≥ this (0..=100). "As-of" = the rank the live endpoint reported at that moment — computed only from data available then, no look-ahead.
funding_pct_ltenumber | nullMatch hours where the as-of funding percentile was ≤ this (0..=100).
funding_signstring | nullFunding sign filter: `positive` (longs pay shorts) or `negative`.
horizonsarray | nullForward horizons as `<hours>h` labels, each 1h..=168h (default `["4h","24h","72h"]`).
streak_h_gteinteger | nullMatch hours where funding had kept its sign for at least this many hours.

get_state_history

Time series of any numeric market-state fields from the 15-minute full-state archive — the derivative/trend view get_market_state cannot give. Answers: "How did OI build over the last 3 days?", "Is funding percentile rising or falling this week?", "When did the book skew flip?". fields = dotted numeric paths of get_market_state (1..=16), e.g. funding.percentile, oi.usd, obi.skew, cvd.delta_usd, basis_bps, price.last, depth.bid_usd.10bps, venues.binance.oi_usd. Returns parallel arrays: t (epoch ms, ascending) + series[field] aligned with t; null = that field was not populated in the archived…

ParameterTypeDescription
fields *arrayDotted numeric paths of the market state, 1..=16 per request — e.g. `funding.percentile`, `oi.usd`, `obi.skew`, `cvd.delta_usd`, `basis_bps`, `price.last`, `depth.bid_usd.10bps`, `venues.binance.oi_…
symbol *stringAsset symbol: BTC, ETH, SOL, BNB, XRP, DOGE, HYPE, ZEC or ENA (case-insensitive; a `USDT` suffix is accepted).
fromstring | nullRange start: RFC3339 (`2026-07-03T08:00:00Z`), `YYYY-MM-DD` (UTC midnight), or epoch milliseconds. Default: the whole archive.
max_pointsinteger | nullPoints returned after downsampling, 1..=1000 (default 200). The response's `stride` says how many archived rows each point skips.
tostring | nullRange end, same formats. Default: the whole archive.

get_volume_profile

Volume-profile reference levels for a symbol, from the consolidated trade tape of Binance, Bybit, OKX and Hyperliquid. Answers: "Where are the key volume levels on BTC?", "Is price inside yesterday's value area?", "Any untested POCs nearby?". Sessions are UTC days. poc = price row with the most traded volume; vah/val = top and bottom of the value area, the band around the POC that holds 70% of the session's volume. Returns today (the session still forming, developing:true, its levels still move), days (the last N complete days, days 1..=30, default 7, oldest first), composite (one profile over…

ParameterTypeDescription
symbol *stringAsset symbol: BTC, ETH, SOL, BNB, XRP, DOGE, HYPE, ZEC or ENA (case-insensitive; a `USDT` suffix is accepted).
daysinteger | nullComplete UTC days to return, 1..=30 (default 7). Out of range is an error, not a clamp.

get_big_trades

Large aggressive orders ("big trades") from the trade tape of Binance, Bybit, OKX and Hyperliquid for a symbol. Answers: "Any whale market orders on BTC in the last hour?", "Were the big prints buying or selling?", "Which venue took the largest hit?". One big trade = all fills that share venue, taker side and exchange timestamp: a market order sweeping several price levels prints as many fills at one instant, and they are summed back into one trade. aggressor: buy = the taker bought, sell = the taker sold. Per trade: t = exchange timestamp, epoch ms; venue; price = volume-weighted fill price,…

ParameterTypeDescription
symbol *stringAsset symbol: BTC, ETH, SOL, BNB, XRP, DOGE, HYPE, ZEC or ENA (case-insensitive; a `USDT` suffix is accepted).
fromstring | nullWindow start: RFC3339, `YYYY-MM-DD` (UTC midnight) or epoch ms. Default: `to` minus one hour. No older than 31 days.
limitinteger | nullTrades listed, 1..=150 (default 50); the largest are kept.
min_usdinteger | nullSmallest notional that counts, whole USD, at least 50000. Default: the asset's chart threshold (echoed in the response). Read as any JSON value and checked in [`big_trades_query`], so a fractional, n…
tostring | nullWindow end (exclusive), same formats. Default: now. At most 12 h after `from`.

get_footprint_events

Order-book wall events from the 1-minute footprint of a symbol, built on the consolidated book and trade tape of Binance, Bybit, OKX and Hyperliquid. Answers: "Did a large resting order get absorbed on BTC in the last hour?", "Were bid walls pulled before this drop?", "How thin was the book this hour?". A wall = a resting price row far larger than the book's typical row (above median + 5 MAD of row sizes). kind=absorbed: trades hit the wall for at least 5% of its peak size, it still held at least 85% of that peak at the minute's close, and price did not break through it. kind=pulled: the wall…

ParameterTypeDescription
symbol *stringAsset symbol: BTC, ETH, SOL, BNB, XRP, DOGE, HYPE, ZEC or ENA (case-insensitive; a `USDT` suffix is accepted).
fromstring | nullWindow start: RFC3339 (`2026-10-12T09:10:00Z`), `YYYY-MM-DD` (UTC midnight) or epoch milliseconds. Default: `to` minus one hour.
kindsarray | nullEvent kinds to return: `absorbed` and/or `pulled` (default both).
limitinteger | nullEvents returned, 1..=150 (default 50). When the window holds more, the NEWEST are kept and `truncated` is true; `counts` still cover the window.
min_usdnumber | nullSmallest `peak_usd` that counts, USD, >= 0 (default 0 = every event).
tostring | nullWindow end (exclusive), same formats. Default: now. At most 24 h after `from` — longer is an error, not a clamp.

get_stacked_imbalances

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 vol…

ParameterTypeDescription
symbol *stringAsset symbol: BTC, ETH, SOL, BNB, XRP, DOGE, HYPE, ZEC or ENA (case-insensitive; a `USDT` suffix is accepted).
fromstring | nullWindow start: RFC3339, `YYYY-MM-DD` (UTC midnight) or epoch ms. Default: `to` minus one hour. No older than 31 days.
intervalstring | nullCandle interval: 1m, 5m, 15m or 1h (default 1m).
kindsarray | nullSides to return: `buy` and/or `sell` (default both).
limitinteger | nullRuns listed, 1..=150 (default 50); the largest by usd are kept.
ratiointeger | nullDominance 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 rm…
tostring | nullWindow end (exclusive), same formats. Default: now. At most 12 h after `from`.

help

Guide to this server: every tool grouped by the question it answers, with a working example call for each, the supported symbols, how to read the scales, request limits, and where to find data that is not a tool of its own here (open interest, CVD, funding rate). Call it whenever you are unsure which tool to use. Takes no arguments. Read-only.