Methodology
Complete workflow for reproducible portfolio tracking
What this site shows
I'm contributing to a TFSA every week with a linear ramp (week 1 = $10, then +$1 per week). I run a simple weekly process to shortlist candidates, ask an LLM for a plan, place trades on Wealthsimple, and record executed fills only. This page documents that process so anyone can reproduce it.
Streamlined Web Interface
Phase 1: LLM Planning (“LLM Workflow”)
When: Sunday evenings before market close
Purpose: Get AI-powered trading recommendations
- • Shows candidate stocks/crypto from screener results
- • Provides structured LLM prompts and JSON payloads
- • Validates LLM responses for constraint compliance
- • Seamlessly transfers recommendations to trade recording
- • Visual workflow with step-by-step guidance
Access: Main navigation → “LLM Workflow”
Phase 2: Execution (“Record Trades”)
When: After executing trades on Wealthsimple
Purpose: Record actual execution details
- • Auto-populates with LLM recommendations
- • Enter actual fill prices and adjust quantities
- • Record weekly deposit contributions
- • Preview portfolio impact before submitting
- • Updates holdings and creates timeline entries
Access: From LLM Workflow or Main navigation → “Record Trades”
Streamlined workflow: LLM Workflow gets AI recommendations → seamlessly transfers to Record Trades → fill in actual execution details → submit to update your portfolio. No more copy/paste between tools!
Data sources (local JSON/CSV)
data/entries.json— weekly deposits and executed trades (for the public timeline)holdings.csv— stocks/ETFs (ticker, shares, avg_cost, currency)crypto_holdings.csv— crypto (symbol, amount, avg_cost_cad)benchmarks.json— S&P 500 closes & HISA rate for comparisondata/candidates/latest.json— pointer to current week's fresh candidatesdata/candidates/YYYY-MM-DD/— dated folders with weekly screener output (stocks.json, crypto.json)
Weekly process (high level)
1. Generate fresh candidates (Sunday)
- Run weekly screeners: Fresh top-40 movers change every week. Using stale candidates defeats the whole point.
- Stocks: TSX-60 + S&P 500 universe → compute 1-week movers → take top 20 up + top 20 down (volume-screened).
- Crypto: CoinGecko markets (CAD), Wealthsimple-supported only → top 20 up + top 20 down (volume-screened).
- Holdings are always appended to the candidate list so the LLM can rebalance/trim even if something isn't a weekly mover.
- Crypto fee baked in: all buy/sell math uses
FEE_RATE = 2%spread via effective prices. - File structure: Candidates saved to
data/candidates/YYYY-MM-DD/withlatest.jsonpointer.
2. Planning Phase: Use “LLM Workflow” Page
- Access: Go to “LLM Workflow” in the main navigation.
- View candidates: See latest screener results with candidate summaries.
- Copy prompts & payloads: Get structured JSON for stocks and/or crypto.
- Ask LLM: Paste JSON into your LLM and get trading recommendations.
- Validate: Paste LLM response back to verify it follows constraints.
- Auto-transfer: Click “Proceed to Trade Recording” to automatically load recommendations.
3. Execute trades on Wealthsimple
- Place orders based on LLM recommendations.
- If a ticker/coin isn't available or fractional is blocked, skip it (or choose CAD equivalent) and re-ask LLM.
- Wait for fills: Only record what actually executes.
4. Recording Phase: Use “Record Trades” Page
- Auto-populate: If coming from LLM Workflow, trades are pre-filled with recommended actions and quantities.
- Fill execution details: Enter actual fill prices and adjust quantities based on Wealthsimple results.
- Add deposit: Record weekly contribution amount.
- Preview impact: See how trades affect your portfolio before submitting.
- Submit: Updates
holdings*.csv(weighted average cost) and appends entry todata/entries.json.
5. Complete the week
- Check workflow status: Use “Complete Week” component (localhost only) to review weekly progress.
- Create snapshot: Click “Complete Week” button to capture portfolio state and create permanent record.
- Automatic updates: Site renders portfolio value, contributions, and benchmarks from updated files.
Linear contribution schedule
Starting deposit a = $10, weekly increment d = $1, week index t = 1,2,...
This week's deposit
Example: week 52 deposit c₅₂=61
Total contributed after N weeks
Example: S₅₂ = 1846
Benchmarks
HISA (3% APY, daily comp)
Daily rate rd = (1+0.03)1/365-1. Each weekly deposit compounds daily from its date: V = Σ depositi · (1+rd)days_since_i.
S&P 500 DCA
Each week's deposit buys index units at that week's close; units are valued at the latest close.
Limitations
- Prices are end-of-day snapshots; intraday fills may differ.
- CAD/USD mixing is simplified (CAD-listed preferred; crypto priced in CAD).
- Dividends/distributions are not modeled yet.
- No background automation; only filled orders are recorded.
- Candidates must be refreshed weekly; LLM Workflow warns if data is >36h old.
Reproducibility
All calculations live in /lib/math.ts and scripts in this repo. Anyone can replicate outcomes by:
- running the screeners,
- placing the same trades,
- logging fills via the TUI,
- rebuilding the site from the same JSON/CSV.