Skip to main content
Opening and closing flow on a BTC chart

BTC on 5-minute bars in the 0xArchive Terminal, 2026-10-15.

Open on a chart

Load it on BTC 5m in the terminal, then change its settings or open it in the script editor.
Every trade on Hyperliquid, HIP-3 and Lighter changes open interest by a known amount, and 0xArchive records it on the print as oiDelta. Its sign says what the trade did: The bars are opening flow: new longs less new shorts, in USD. The line is closing flow: shorts bought back less longs sold out. A rally on closing flow is shorts running for the exit; a rally on opening flow is new money taking a side.

How it works

Two tallies collect the bar’s trades as they arrive, one for each kind. A trade with an oiDelta of 0 moved no open interest (one side opened while the other closed), so it counts in neither. tape.available is false on bars older than the trade history, which reaches back to the start of the UTC day before yesterday, so those bars stay empty.

Try changing

  • Raise Smallest trade to see only the larger players’ flow.
  • Plot opening.value + closing.value as well: that is the bar’s ordinary taker delta, which mixes both.

The script

opening-closing-flow.ts

Next step

See the next example, Squeeze or new positions.
Last modified on October 16, 2026