Whether positions are being opened or closed faster than usual, and whether price alone explains it.
Whether positions are building or unwinding beyond what price explains, how large open interest is against daily trading, and the funding paid on new positions.
The day of 5m bars up to the bar from 14:00 to 14:05 UTC on 14 May 2025, Binance BTC-USDT perpetual, from the free preview.
Step 1
Open interest is counted in contracts, so a price move alone doesn't change it. The mean is over the bars before this one.
Step 2
The build is the gap in units of its 7-day RMS, so one threshold reads on BTC and on a thin listing; the price build is the same score on the log mark price. β is a 7-day time-decayed fit of one on the other, both clipped at ±3, so a crash doesn't set it for the week after. What is left is positions moving beyond what price explains.
open_interest_divergence on each bar: above 0 positions are being added beyond what price explains, below 0 closed.
Step 3
The typical day is a 7-day time-decayed mean of daily taker notional, over the days before this bar's; the plain mean of the last seven days was $19.46B. Open positions came to 0.49 of a typical day's trading.
Step 4
The growth is 100 × (ln OI − its 3.5-day mean). Open interest was shrinking on this bar, so crowding is 0 however high funding is: no one is paying to pile in. Positive means longs pay to add, negative that shorts do.
Step 5
BTC-USDT perpetual on Binance, 5m bars, 1 to 31 May 2025, from the free preview.
Bars by the size of open_interest_divergence, in five equal groups. Basis points.
Sorted into five equal groups by the size of open_interest_divergence, the largest fifth was followed by a median 21.4 bps move over the next hour, against 18.6 bps for the rest. The divergence itself carries no direction: it correlates -0.07 with the bar's return.
The most extreme reading was -4.50 at 2025-05-08 21:20 UTC, as BTC rose 230.0 bps in an hour while positions closed: a short squeeze. Crowding was 0 on 51% of bars, the ones where positions weren't being added, and the leverage index ranged from 0.38 to 0.59.
open_interest_divergence starts from the build: log open interest, counted in contracts so price moves don't enter it, against its 12-hour time-decayed mean, in units of how far it usually strays. It removes from that what the same build on mark price explains, using a 7-day beta. What is left is positions being added (above 0) or closed (below 0) beyond what price explains, scaled to about one in normal times. Large readings come with liquidations and squeezes; NULL while open interest or price is flat.
leverage_index is open interest notional divided by a week's time-decayed mean of daily traded notional, over the days before the bar's: how many days of trading the open positions add up to. It rises as leverage builds and drops sharply after a flush.
crowding multiplies the day's time-decayed funding rate by how much open interest grew over 3.5 days, and is 0 while it shrank. Positive means longs are paying to pile in, negative that shorts are. It is in basis points per venue funding period, so compare it within a venue.
# Install the Aperiodic CLI into ~/.local/bin
mkdir -p "$HOME/.local/bin"
curl -fsSL https://raw.githubusercontent.com/aperiodic-io/cli/main/install.sh | INSTALL_DIR="$HOME/.local/bin" bash
export PATH="$HOME/.local/bin:$PATH"
# Free preview — no API key required
aperiodic positioning --preview \
--exchange binance-futures \
--symbol perpetual-BTC-USDT:USDT \
--interval 5m \
--timestamp exchange \
--start-date 2025-05-01 \
--end-date 2025-05-31 \
--output-dir ./data && echo "Saved to $PWD/data"Every venue and perp, from 1-minute to daily bars, comes with Prime.
Positioning in the API docs: its endpoint and parameters →