Scripts run in the 0xArchive Terminal, on every market it charts. Beside the chart’s bars, a script reads everything 0xArchive records: every trade with its change in open interest, liquidations with the wallet liquidated, where open positions would be liquidated, the full-depth order book, funding, open interest and market breadth.
This script splits out the trades that opened positions, using each trade’s own change in open interest, and plots new longs less new shorts in USD on every bar.
What a script is
A script is one TypeScript file with no imports. The top level runs once and declares everything: the script’s name, its settings, the data it reads, its plots and its state. Handlers then run on every bar of history, oldest first, and on every live update, with the values of that moment. There is no lookahead: history only sees what was known at the time, so a script draws the same values live as it does on history.
Scripts run in the browser, in a worker of their own with no network access, and give the same result on every machine.
Where scripts live
The scripts you write are kept in your browser, under the names you give them, and any chart can add them from the Indicators dialog. A script runs on whatever market and interval its chart shows, so one script works on BTC, a HIP-3 stock or a Lighter market alike. Its alerts fire in the browser while the chart is open. The terminal’s own studies, from RSI to Supertrend, are scripts too, and so is every example on these pages: open one, copy it into the editor, and change it.
Start here
Next step
Write your first script. Last modified on October 16, 2026