Trading blotter: a live trade blotter example

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.
Fill it yourself
Section titled “Fill it yourself”- 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.
What makes it a live blotter
Section titled “What makes it a live blotter”Both lists are gpui-kit-grid grids: a data grid written in Rust for GPUI applications, here compiled to WebAssembly and drawn with WebGPU.
- Rows are addressed by key, so a fill updates its order in place, and the selection stays on that order when the list re-sorts.
- A cell that changes flashes, up or down.
- Sorting, filtering and grouping with totals run in the background, at thousands of updates a second.
A terminal with a trades tape
Section titled “A terminal with a trades tape”
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.
On the desktop
Section titled “On the desktop”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.
cargo run --release -p gpui-kit-grid --example blottercargo run --release -p gpui-kit-grid --example ordersEmbed it
Section titled “Embed it”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>Apache-2.0, built on gpui-kit. Repository Sponsor More from GigLabo Privacy Licenses