All projects/ MarketLab03 / 05
MarketLab logoPortfolio research platform

MarketLab.

Every historical result has inspectable inputs and accounting.

Portfolio planning and historical research with validated prices, exact accounting, immutable inputs, and independent calculation checks.

MARKETLAB / HISTORICAL PRICES
MarketLab saved IBM stock-price history with date coverage and on-demand data controls
3,000 verified jobsLOCAL WORKLOAD
THE IDEA

What MarketLab does.

MarketLab combines portfolio planning with saved historical experiments. A person can aggregate manually entered accounts and debts, validate stock-price history, compare a next-close trend rule with buying and holding, inspect costs and assumptions, and save an experiment that can be independently replayed.

01

Planning before complexity

A fictional first-run example shows how trading costs change the same investment. Private workspaces support goals, fee projections and contribution or stress scenarios.

02

Historical stock pipelines

Server Alpha Vantage, browser Alpha Vantage and CSV imports converge on validation and immutable owner-scoped snapshots with explicit provenance.

03

Saved, exact backtests

BigInt money and share arithmetic, declared events and causal next-close execution preserve the inputs behind each report.

04

Verification and reviewed sharing

An owner may request C++ checks or independent Python replay. Separate reviewed sharing publishes an allowlisted, expiring, revocable summary.

BUILT WITH

The technology.

FROM INPUT TO OUTCOME

How it works.

A chart is not enough to trust a backtest. Imported prices, cash arithmetic, timing assumptions and saved inputs need to remain inspectable. In a background service, a crashed or stale worker must not overwrite the authoritative result.

01 / 04

Import

Fetch daily closes on demand or import one symbol's historical CSV with source, currency and adjustment declarations.

MarketLab stock-data pipeline: Alpha Vantage and CSV imports validate into owner-scoped price snapshots; saved backtests can branch into verification or reviewed sharing.
Stock imports and verification paths from the repository architecture diagram.
ENGINEERING DECISIONS

Why it’s built this way.

01

Exact money, explicit execution

Cash uses BigInt cents and holdings use millionths of shares. Signals execute at the next supplied close, with defined fees, slippage, splits and dividends.

02

Separate runtime responsibilities

The hosted React/TypeScript application stores authoritative workspaces and reports in Workers/D1. A separate Node/MongoDB service owns copied research inputs and background jobs.

03

Fence stale workers

MongoDB-clock leases and tokens govern heartbeats and finalization. A crashed calculation can be retried without allowing an older worker to replace the current durable result.

RECORDED CHECKPOINTS

What the evidence shows.

Three local service-workload runs completed 3,000 verified jobs with zero failures, combined throughput 39.96 jobs/s and client-observed p99 319.77 ms. The workload used two calculation workers, eight closed-loop clients and 500 observations per instrument.

3,000Verified jobs in three local runs
39.96 /sCombined local throughput
319.77 msClient-observed local p99
SCOPE & LIMITS

These are local workload measurements, not production capacity or live-site latency. Data imports are user-triggered historical paths, not a streaming feed. Browser-imported provider data retains distinct provenance. Backtests are research comparisons, not forecasts.

Read the engineering brief PDF
OPEN THE WORK

Code, documents & proof.

A concise engineering brief and direct links to the implementation and supporting evidence.

ENGINEERING BRIEFMarketLabMichael Baffour Awuah · 2026

Inside the engineering

A two-page project brief covering the purpose, workflow, design decisions, recorded checks, and limits.