Funding & Positioning
How the funding rate percentile, streak counter, and term-structure widgets are computed: sources, formulas, edge cases, limits.
See the live widgets at /perpetuals/funding.
Data sources
MarketTrace funding analytics combine three inputs: Binance's public funding-rate history, the per-asset snapshot service, and the tracked-asset roster.
- Historical funding rates. Binance USDT-margined perpetuals, public funding-rate endpoint. Pulled per asset, paginated 1000 rows at a time. Most symbols settle every 8 hours; Binance settles HYPE every 4. Local ingest keeps a trailing 730 days per asset and stores every row as an 8-hour equivalent,
rate = rate_raw × 8 / interval_hours, with the raw rate and the interval kept beside it for audit. That is up to 2,190 rows for an 8-hour symbol and around 2,760 for HYPE, roughly 16k rows across the seven. - Current funding rate. Read from the per-asset snapshot, refreshed every ~5 minutes. The widget surfaces the value as percent (the raw API field is a fraction; we multiply by 100 at the boundary).
- Hyperliquid perpetuals. Public funding endpoint, hourly settlement (24 cycles/day, against the 8-hour cycles on the CEX feeds). Local ingest holds the same trailing 730 days at 8× the density: around 17,500 rows per asset.
- Tracked assets.BTC, ETH, SOL, BNB, XRP, DOGE, HYPE, read across Binance, Bybit, OKX and Hyperliquid. Each venue's percentile is ranked against that venue's own history, so cross-exchange basis stress shows up directly in the table.
Percentile rank: how it's computed
A funding rate percentile of N means N% of the settlements in that venue's trailing 730 days printed at or below the current rate. Cadences differ across venues and symbols, so every row is stored as an 8-hour equivalent before it is ranked: an hourly Hyperliquid print sits on the same scale as an 8-hour Binance print. Sampling is one row per settlement with no resampling, so an 8-hour symbol contributes about 2,190 rows over the window, Binance's 4-hour HYPE contract about 2,760, and hourly Hyperliquid about 17,500. We split ties evenly so identical observations rank between strict-less-than and less-or-equal counts.
Concretely, given a sorted list of historical percent values S:
left = count of elements in S strictly less than current right = count of elements in S less than or equal to current rank = (left + right) / 2 percentile = (rank / |S|) × 100
The result is bounded [0, 100]. A 0th percentile means the current rate is the most negative reading in the window; 100th means it is the most positive.
Percentile rank: edge cases
- Insufficient history. When the on-disk window spans fewer than
90 days, the API returnspartial: trueand a null percentile. The FE renders an “insufficient history” cell rather than a misleading number from a thin sample. - Missing current rate.When the snapshot has no funding-rate field (cold start, daemon down), the percentile is null and the FE shows —.
- Sample size disclosure. The actual number of contributing cycles is shown alongside every percentile so the reader can judge how robust the rank is.
Streak: how it's computed
A funding streak is the run of consecutive settlements that share the same sign as the latest one, walked back at that venue's own settlement interval. A gap wider than 1.5× that interval breaks the run, so a missed settlement ends a streak instead of being walked through. Streak length, in days, is the elapsed time between the first settlement in the run and the latest. A neutral settlement (rate exactly 0) ends any streak.
direction = sign(latest.rate) // "neg" | "pos" | "neutral" walk back through history while sign matches and gap to previous <= 1.5 × that row's settlement interval streak.days = (latest.ts - first_in_streak.ts) / 86_400_000
Direction labels: "neg" (shorts pay longs), "pos" (longs pay shorts), "neutral" (latest cycle is zero or no history).
Streak: rarity flag
The rare flag fires when the current streak length is in the top 10% of historical same-direction streak lengths for that asset. We also require at least 10 prior completed streaks before publishing a rarity claim. Without that floor the threshold can come from a tiny sample and overfire.
Term structure
Funding term structure is a table that shows the current funding rate, 2-year percentile, and active streak length for all seven tracked perpetual pairs at once. The endpoint returns one row per asset; embeds can override the asset list via ?assets=btc&assets=eth.
Distribution histogram
The funding rate distribution histogram is a 30-bucket frequency chart of every settlement in the asset’s trailing 730-day history, at whatever cadence that venue settles. Bin width is dynamic per asset across the observed [min, max] range; a fixed [-0.1 %, +0.1 %] would clip DOGE/SOL outlier tails and waste resolution on the BTC body. Each bin reports the timestamp of the most recent cycle that fell in it, so the tooltip can show “last seen YYYY-MM-DD”.
Caching
- Percentile. 1-hour cache. The 2-year rank shifts negligibly within an hour.
- Streak. 1-minute cache. Streak length ticks once per settlement, every 8 h on most symbols, every 4 h on Binance HYPE and hourly on Hyperliquid, but the FE may want a tighter heartbeat for nearby flips.
- Term structure. 1-minute cache, matching the streak component (its freshest dependency).
- Distribution. 24-hour cache. A day adds 3 rows on an 8-hour venue, 6 on Binance HYPE and 24 on Hyperliquid, against a window holding 2,190 to 17,500 rows; the shape barely shifts between daily refreshes.
Limitations
- Per-venue history depth varies.Binance, Bybit and Hyperliquid go back the full 730 days on assets that have traded that long. OKX's public funding endpoint still exposes only ~3 months, so the OKX window is whatever the local archive has accrued since February 2026. That already clears the
90-dayfloor for the per-venue percentile, but the cross-exchange percentile is stricter: a venue joins that set only when its own history spans at least365 days, and a venue below the floor is dropped from both the current rate and the distribution. OKX sits below it today, so the cross-exchange percentile currently runs on Binance, Bybit and Hyperliquid. - Settlement granularity. Most symbols settle at 00:00 / 08:00 / 16:00 UTC; Hyperliquid settles hourly and Binance settles HYPE every 4 hours. Direction shifts inside one settlement interval are invisible to this widget.
- Account composition is opaque. Funding rate is a market-clearing price between long and short open interest; it does not decompose into who is positioned where.
- History depth is rolling 2 years. Comparisons to older regimes (e.g. 2020 spikes) are not represented in the percentile.
Versioning
Methodology version v1.3.0 · updated 2026-09-02. Material changes (new sources, formula tweaks, threshold changes) bump the version and update dateModified in the structured data above.
v1.3.0 (2026-09-02): HYPE joined the tracked roster on 2026-07-20, taking it to seven perps. The percentile now ranks a trailing 730-day window of interval-normalized funding (2026-08-04), with interval-aware staleness and gap gates on every read. OKX wording corrected: the local archive has been accruing since February 2026, past the roughly three months the public endpoint exposes, but still short of the 365-day span the cross-exchange percentile requires.
v1.2.0 (2026-05-21): added Hyperliquid to the data-sources list (hourly settlement, 24 cycles/day) and removed the L/S ratio section. The L/S widget runs live on /perpetuals/positioning, so its methodology now sits on the market-positioning page instead.