Skip to content

Trading blotter: a live trade blotter example

A trade blotter, the broker example after six orders: a still of the example running

Runs in this page, with an empty blotter to fill. Full screen shows every column.

Open full page

A trade blotter is the running record of an account’s or a desk’s orders and trades: the time, instrument, side, quantity, price and status of each, kept current while the market moves. The picture above is one, and it runs: an order placed in the ticket fills against the quotes and joins the list. Every price is simulated and no order leaves the page.

  • Alt+B or Alt+S sets the ticket to buy or to sell the selected instrument, and Alt+Enter submits it. A market order fills at once, a buy at the ask and a sell at the bid; a limit order stays Working until a quote reaches its price.
  • Ctrl+2 shows the orders, newest first. Ctrl+1 shows the positions with their market value and profit and loss at the live prices.

Both lists are gpui-kit-grid grids: a data grid written in Rust for GPUI applications, here compiled to WebAssembly and drawn with WebGPU.

The desk example, a trading terminal with a trades tape and positions: a still of the example running
Open the full page (≈7 MB)

Keyboard-first: it runs on its own page, where its keys are its own.

Open full page

The desk shows the same simulated market as a keyboard-first terminal: a tape of every trade, positions as a tree with their totals, an order book and a watchlist.

Two of the repository’s examples are blotters in a native window: blotter, with grouping, a totals row and pinned columns, and orders, edited in place while the market streams in.

Terminal window
cargo run --release -p gpui-kit-grid --example blotter
cargo run --release -p gpui-kit-grid --example orders

Two lines show the broker on any page; Embedding has the element’s attributes.

<script type="module" src="https://gkg.giglabo.com/embed/v1/live-grid.js"></script>
<live-grid app="broker" autoload></live-grid>
Open in MDN Playground

Apache-2.0, built on gpui-kit. Repository Sponsor More from GigLabo Privacy Licenses