A Market Terminal, Built Backwards on Purpose

Most financial software starts with a dashboard. I started with the seams, then built the spreadsheet that makes every number explain itself.

Tweet by Benjamin De Cock showing the TUI portfolio tracker that inspired Market Terminal
The image that started the project: Benjamin De Cock's TUI portfolio tracker.

Every ambitious software project reaches a point where it has enough rectangles to impersonate a product. Market Terminal reached that point quickly. There were prices, charts, tiny arrows, and the faint glow of monetary authority. It was tempting to declare victory. This is exactly when software begins lying to you.

So I built the boring parts. Then I built a spreadsheet, which is the least boring thing in finance because it lets the user disagree with the software. Stages 0 and 1 are now closed: the floor is solid, the research loop works, and the numbers have learned to show their papers.

Market Terminal is a clean-room, Bloomberg-inspired workstation written in Rust and rendered with Ratatui. It does not reproduce Bloomberg's code, commands, data, visual assets, or protocols. I am interested in the deeper trick: how a keyboard and a dense screen become an instrument for thinking.

The whole research day

A financial terminal is unusually easy to fake. Put twelve numbers in a grid, color three of them green, add a line chart, and the eye supplies the missing institution. The real product begins when those surfaces cooperate: a market move becomes a security, the security becomes a question, and the answer can be carried into a workbook without losing its identity.

The overview is the shortest tour of that loop. It combines market context, portfolio returns, composition, movers, and headlines in one dense frame. The density is deliberate. This is a place to work, not a dashboard waiting to be admired from across the room.

These are terminal recordings, not videos disguised as terminal windows. Each one replays the real Ratatui application at 100 × 30 with its exact RGB palette. The values are deterministic fixtures and say so plainly; no credentials, network connection, or theatrical loading spinner is required.

The roadmap therefore defines a stage as a contract, not a screenshot count. Stage 0 asks whether more features can arrive without turning the application into a switch statement with a logo. Stage 1 asks whether those boundaries can carry an actual research day. The spreadsheet is where the answers meet.

Monitor the market; account for yourself

A watchlist is not merely a small table of prices. It has to sort and scan, preserve selection while values move, expose stale quotes, and make a useful transition from “something happened” to “show me the security.” Portfolio adds the personal consequence: positions, exposure, return, and the uncomfortable knowledge that the red number belongs to you.

These workspaces sit on the Stage 0 foundation: a modular monolith, a phrase that sounds like a zoning dispute but describes a useful bargain. Every feature owns its model and the ports it needs. The kernel knows about workspaces, not finance. Shared UI knows about rectangles, not securities. bootstrap.rsintroduces everyone at the party and then gets out of the conversation.

Duplicate workspace IDs, commands, and hotkeys fail at registration. Events travel through bounded queues with cancellation and lag metrics, because an infinite queue is just a memory leak with a product manager. A slow provider may disappoint a cell; it may not freeze the keyboard or destroy yesterday.

The spreadsheet is the honesty machine

Dashboards are confident. They answer the questions their authors remembered to ask. A spreadsheet is more democratic and more dangerous: it hands the question back to the user. Quotes can meet fundamentals, history can meet an assumption typed at 11:48 p.m., and the software cannot pretend the join was somebody else's problem.

Building Spreadsheet first forced the whole system to grow up. Instruments needed canonical identities. External values needed provenance and entitlement states. Recalculation needed to be deterministic. Persistence needed to survive interruption. Fan-out needed a budget. These are platform decisions wearing the humble costume of a cell.

The engine has 27 pure functions and four financial ones:PX_LAST, PX_CHANGE, HISTORY, and FUNDAMENTAL. Workbooks have cross-sheet references, mixed absolute axes, cycle detection, incremental recalculation, translated copy and fill, atomic undo/redo, CSV round trips, and durable save/load/autosave. Five sheets and 10,000 populated cells remain a performance test, not an aspirational sentence in a README.

Every external cell also carries its provider, instrument, field, observation time, receive time, and quality. In financial software, a number is a claim made by somebody at a particular time under a particular license. Every number needs a passport.

From a line on a chart to the company beneath it

Charting supplies the familiar grammar of price, volume, periods, and relative performance. Security research supplies the nouns: financials, estimates, ownership, filings, and peers. They share a canonical instrument, so changing the question does not require retyping the subject.

Composition goes both ways. A spreadsheet cell can open SEC or CHART, and a selected instrument can return to the active cell. The user experiences one workstation; the code retains the right to be several well-behaved things.

Find the thing, learn what happened, remember to care

Discovery turns a company name into a canonical instrument rather than a hopeful ticker string. News connects headlines and scheduled events back to the instruments they may move. Alerts convert that context into a durable rule: debounced, acknowledged, restart-safe, and recorded for the morning after.

Loading, stale, unavailable, and permission-denied remain first-class values throughout the chain. A failed lookup stains its dependents, not the entire workstation. A terminal should be able to tell you that it does not know.

Markets are also people yelling about numbers

Chat is not decoration pasted onto the edge of the terminal. The IRC workspace participates in the same keyboard model, workspace lifecycle, and bounded event system as every analytical feature. It proves that the platform can admit a very different kind of activity without teaching the kernel what a chat room is.

Beneath these ten workflows are 279 deterministic tests, 27 pure spreadsheet functions, four financial functions, and semantic frame goldens at 80 × 24, 120 × 36, and 160 × 48. The 10,000-cell workbook records a common-edit p95 of 0.335 ms against a 50 ms budget. The margin is deliberate. A benchmark that barely passes before real adapters arrive is a future incident with a percentile attached.

Stage 2 moves into deeper portfolio analysis, risk, screening, and production data adapters. This is where the architecture either compounds or reveals itself as expensive stationery. The real milestone is that the next honest feature should be cheaper to build than the last one.

The source, roadmap, spreadsheet contract, and recordings are in the Market Terminal repository.