Pravex is a charting platform for traders that runs in the browser. Every feature in it is free: 129 indicators, 21 chart types, layouts with up to 16 charts, bar replay. This post is about how the chart itself is put together.
The DOM never touches the chart
The page has two halves. Buttons, menus, the legend and dialogs are plain DOM. The chart lives in a web worker. The DOM side never calls the engine directly. It posts typed messages to the worker and listens for messages coming back, and every message type is defined in one place, so both sides fail to compile if they drift apart.
Inside the worker, the chart engine is Rust compiled to WebAssembly. The worker calls setters on it (symbol, interval, options) and getters when the DOM needs an answer, such as the price under the cursor.
Drawing through a buffer of numbers
The engine doesn't draw anything. Each frame it writes a flat buffer of f64 values: an opcode, then its arguments. A small TypeScript renderer walks that buffer and paints it onto an OffscreenCanvas, still inside the worker.
That split pays off in two ways. The Rust side has no idea a browser exists, so we test it like any other Rust library. And the renderer is the only code that knows about canvas, so how an op gets painted can change without touching the engine.
Indicators load after the first candles
The indicator code is its own module. It loads lazily, after the chart has drawn its first candles, so someone who only wants to check a price never downloads it. When you add an RSI or a moving average, the worker asks that module for the catalog and the numbers.
Prices straight from the exchange
Live prices don't pass through our servers. The browser opens the public feeds of the exchanges itself. Crypto streams from the big spot and futures exchanges, and gold, oil and the US indices come from perpetual futures markets that trade them. If one source doesn't answer, the client moves on to the next.
This is a big part of why Pravex can stay free. Our bill doesn't grow with every chart someone leaves open.
Try it
The chart is at https://pravex.app/chart. Pick any market and stack as many indicators as you like. If something feels off, or you've built a canvas engine yourself and see a better way to do any of this, the comments are open.
Top comments (0)