Skip to main content
Opening sweeps on a BTC chart

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

Open on a chart

Load it on BTC 5m in the terminal, then change its settings or open it in the script editor.
A sweep is one market order big enough to eat through several prices of the book. On a chart of trades it is a burst of separate prints; joined back into its order, it is one decision by one taker. This script keeps the orders of $250k or more that filled at three prices or more and asks what each did to open interest, from the sum of its fills’ oiDelta: The bars are opening sweeps: buys less sells, in USD. The line is closing sweeps. Aggression that opens is a taker committing to a side; aggression that closes is a taker leaving one.

How it works

takerOrders() joins the fills into orders and calls onOrder once per order, once all its fills are in, so a forming bar never sees half a sweep. minNotional counts the whole order, and levels is how many prices it filled at. Two tallies collect the bar’s sweeps, one for each kind. An order whose fills moved no open interest on net counts in neither, and neither does one with a fill the venue did not report.

Try changing

  • Raise Prices walked to keep only the orders that moved the price the furthest.
  • Lower Smallest order on a smaller market: $250k sweeps are common on BTC and rare on most others.

The script

opening-sweeps.ts

Next step

See the next example, Liquidations.
Last modified on October 16, 2026