About This Project
Annie's Gold Tracker started from a simple question: if a feasibility study assumed gold at US$1,800/oz and gold is now US$4,200/oz, how much is the project actually worth? That question turned into a pipeline that scrapes ASX announcements, extracts economics from PDFs with AI, and revalues every project at today's gold price. Built using Claude Code (Anthropic's AI coding assistant). Still early, lots to improve.
AI and tools used in this project:
- Claude Code (Opus 4.6): AI pair-programming assistant that wrote the application code, designed the architecture, and built the data pipeline. Every file in this repo was authored through conversation with Claude Code.
- Claude Haiku 4.5 API: Reads feasibility study PDFs and extracts structured financial data (NPV, IRR, AISC, reserves, production, mine life, gold price assumption) via the Anthropic Messages API. Cost is about $0.01 per study.
- Claude Sonnet 4.6 API: Fallback model for PDFs that exceed Haiku's 200K token context window.
- Custom MCP Server (
mcp-asx-gold): A Model Context Protocol server that gives Claude Code access to live ASX data. Provides 9 tools: stock quotes, batch quotes, historical prices, company financials, announcements, gold price, gold-vs-stock comparison, stock returns, and a pre-built developer list. - Yahoo Finance API: Stock prices for all 30 tracked companies, gold futures (GC=F), and AUD/USD exchange rates. No API key required.
- ASX MarkitDigital API: Company announcements, feasibility study PDF downloads, and market cap data (via the /header endpoint) from asx.com.au. No API key required. Market cap was originally sourced from Yahoo Finance but it returned null for all ASX stocks, so this was switched to the ASX API after a data audit.
The Investment Thesis
Before a gold mine gets built, the company publishes a feasibility study. This study models the project's economics (how much it will cost, how much gold it will produce, and how profitable it will be) all based on a specific gold price assumption. For example, a study might assume gold at US$1,800/oz.
The key insight:these studies are snapshots in time. The gold price used in the study is whatever gold was trading at when the study was written. But gold prices change. If gold has risen from US$1,800/oz to US$4,200/oz since the study was published, then the project's actual economics are much better than what the study says. The NPV (Net Present Value, basically what the project is worth) could be double or triple the published number.
Why this matters: the stock market is slow to reprice small companies. Big miners with analyst coverage get repriced quickly, but a small ASX developer with a $50M market cap might still be valued based on a study that assumed gold at US$1,800/oz, even though gold is now US$4,200/oz. That gap between what the study says and what current gold prices imply is the opportunity this tool looks for.
The tool automates this process: it scrapes ASX announcements for new feasibility studies, extracts the key numbers (including what gold price the study assumed and when it was published), and recalculates the NPV at today's gold price.
What We Look For
GOLD PRICE DELTA > 30%
Stale Gold Assumptions
Studies published with gold price assumptions significantly below current spot. A DFS assuming US$1,800/oz when gold is at US$4,200/oz means the project economics are dramatically understated.
NPV > 2X MARKET CAP
Valuation Gap
The gap between estimated NPV (at current gold) and market capitalisation. A company with a $2B revalued NPV trading at a $200M market cap has a 10x gap. Requires market cap data, which is not always available for small-cap ASX developers via free data sources.
VS GOLD GAP > -20%
Lagging Stock Price
Companies whose share price hasn't tracked gold's move. If gold is up 40% over 12 months but the stock is flat, the market may not have repriced the project economics.
The Automated Pipeline
The pipeline runs twice daily at 7am and 7pm AEST (Australian market hours). It executes four stages in sequence, each building on the last.
AGENT 01
Price Update
YAHOO FINANCE API
EVERY PIPELINE RUN
Fetches live share prices for all 30 tracked companies (21 developers + 9 producer benchmarks) from Yahoo Finance. Calculates 1-month, 3-month, 6-month, and 1-year returns using calendar-date lookback matching Google Finance methodology. Also fetches the current gold spot price (XAU/USD) and AUD/USD exchange rate.
INPUTS
- · Yahoo Finance v8 chart API
- · ASX tickers with .AX suffix
- · Gold futures (GC=F)
- · FX rate (AUDUSD=X)
OUTPUTS
- · Share prices for 30 companies
- · Return calculations (1m, 6m, 1y)
- · Gold price snapshot (USD + AUD)
- · Stored to SQLite companies + gold_prices tables
AGENT 02
Announcement Scanner
ASX MARKITDIGITAL API
EVERY PIPELINE RUN
Scans recent ASX announcements for all 21 gold developers using the ASX MarkitDigital public API (https://www2.asx.com.au/). Uses keyword matching to identify feasibility studies, looking for terms like 'DFS', 'PFS', 'scoping study', 'definitive feasibility', 'pre-feasibility', 'PEA', and 'bankable feasibility'. Compares against existing studies in the database to avoid reprocessing. Downloads new study PDFs directly from the ASX document server.
INPUTS
- · ASX MarkitDigital announcements API
- · Document keys for PDF download
- · Existing study titles for deduplication
OUTPUTS
- · New feasibility study PDFs saved to data/pdfs/
- · Study metadata (title, type, date) stored to studies table
- · Journal entry logging the discovery
AGENT 03
PDF Extraction
CLAUDE HAIKU 4.5 (SONNET 4.6 FALLBACK)
WHEN NEW STUDY FOUND
Sends each feasibility study PDF to Claude Haiku 4.5 via the Anthropic Messages API for structured data extraction. The AI reads the full document and extracts 8 key economic metrics with page numbers for auditability. Uses Haiku for speed and cost (about $0.01 per PDF). Falls back to Sonnet 4.6 for PDFs exceeding Haiku's 200K token context window.
INPUTS
- · Feasibility study PDF (base64 encoded)
- · Structured extraction prompt with JSON schema
- · System prompt: expert mining analyst mode
OUTPUTS
- · Gold price assumption (USD and/or AUD per oz)
- · NPV: Net Present Value at study discount rate, in millions
- · IRR: Internal Rate of Return (%)
- · AISC: All-In Sustaining Cost per ounce
- · Pre-production capex (millions)
- · Total reserves: Proven + Probable ounces
- · Annual production: average ounces per year
- · Mine life: years of production
- · Source page numbers for auditability
AGENT 04
Revaluation Engine
DETERMINISTIC (NO AI)
AFTER EXTRACTION + DAILY REFRESH
Reprices every extracted project at the current gold price using a revenue-sensitivity approach (no AI involved, purely deterministic math). Calculates how much additional revenue the project would generate from the gold price delta, discounts it over the mine life at the study's discount rate, and adjusts for Australian corporate tax (30%). See the Revaluation Mathematics section below for the exact formulas.
INPUTS
- · Extraction data (gold assumption, NPV, production, mine life)
- · Current gold price (USD)
- · Company market cap and enterprise value
OUTPUTS
- · Estimated NPV at current gold price
- · NPV uplift: percentage change from study NPV
- · Full methodology description for each calculation
Revaluation Mathematics
The engine uses a revenue-sensitivity approach rather than rebuilding the full DCF model. This is deliberately conservative: it captures the marginal impact of gold price changes without speculating on operating leverage, currency effects, or development risk.
NPV RECALCULATION
Price Delta = Current Gold Price - Study Gold Assumption
Annual Revenue Uplift = Price Delta × Annual Production (oz)
PV of Uplift = PV_Annuity(Annual Uplift, Discount Rate, Mine Life)
After-Tax Uplift = PV Uplift × (1 - 30% tax)
Estimated NPV = Original NPV + After-Tax Uplift
KNOWN DATA GAPS
Market cap / enterprise value data is not always available from Yahoo Finance for small-cap ASX developers.
When EV is missing, valuation gap and mispricing comparisons cannot be calculated.
This is a limitation of free data sources. Bloomberg or Refinitiv would fill these gaps.
Data Architecture
All data flows through a SQLite database with full audit trail. Every extraction and revaluation is logged with the model used, prompt sent, response received, and timestamp. This makes every number on the dashboard traceable back to a specific page in a specific PDF.
companies
30
Tracked ASX gold developers and producer benchmarks with live prices and market cap
studies
Per company
Feasibility study metadata: type, title, date, PDF path
extractions
Per study
AI-extracted economics with source page numbers for auditability
revaluations
Daily per extraction
NPV recalculated at current gold price using revenue-sensitivity model
gold_prices
Daily
Gold price snapshots in USD and AUD with FX rate
journal
Ongoing
Research notes + AI agent run logs
audit_log
Every action
Full audit trail: every extraction, revaluation, and data change
Known Limitations
- Linear approximation. The revenue-sensitivity approach assumes NPV scales linearly with gold price for marginal changes. This breaks down for very large price moves where operating leverage, grade cutoff optimisation, and mine plan changes would materially alter the economics.
- No operating leverage.Higher gold prices can justify mining lower-grade ore, extending mine life and increasing total production. The engine doesn't capture this upside.
- Currency effects. Many ASX studies report in AUD. Gold trades in USD. The FX conversion uses the current AUD/USD rate, which may differ from the rate assumed in the study.
- Development risk.A developer's market cap rightly trades at a discount to NPV. Construction risk, permitting risk, financing risk, and execution risk all justify a gap between NPV and market cap. A large NPV uplift does not mean the stock should trade at NPV.
- ASX API coverage. The MarkitDigital API only returns recent announcements (~20-50). Older feasibility studies require manual upload or company website scraping.
- AI extraction accuracy. Claude Haiku performs well on well-structured feasibility study PDFs, but investor presentations with charts-only data or non-standard layouts may produce null values. All extractions include source page numbers so results can be manually verified against the original PDF.
- Removed metrics.Earlier versions displayed a "confidence score" (AI self-assessment, always ~95%), a "mispricing score" (broken when market cap data was missing), and a "gold leverage score" (non-standard metric). These were removed for transparency.
Technology
AI
- · Claude Haiku 4.5: PDF data extraction (~$0.01/study)
- · Claude Sonnet 4.6: large PDF fallback
- · Claude Code (Opus 4.6): AI coding assistant used to build this project
- · MCP Server: custom Model Context Protocol server for ASX data
DATA
- · Yahoo Finance: stock prices (no auth needed)
- · ASX MarkitDigital: announcements + PDFs
- · GoldAPI.io: gold prices (optional)
- · SQLite: portable database with WAL
PLATFORM
- · Next.js 16: static export
- · Firebase Hosting: CDN deployment
- · GitHub Actions: CI/CD with WIF auth
- · Drizzle ORM: type-safe database
AUTOMATION
- · Scheduled trigger: 7am + 7pm AEST
- · Claude Code remote agent: Haiku model
- · Full audit trail: every action logged
MCP Server: Source Code
The mcp-asx-gold server is a standalone Node.js package in the mcp-asx-gold/ directory. It uses the official @modelcontextprotocol/sdk and communicates over stdio transport. Claude Code calls these tools during development to get live data.
9 REGISTERED TOOLS
| asx_stock_quote | Live price, volume, day range, 52-week range for any ASX ticker |
| asx_stock_returns | 1d/1w/1m/3m/6m/1y return calculations from historical close prices |
| asx_historical_prices | Daily OHLCV history for charting and analysis |
| asx_company_financials | Market cap (ASX API), EV, PE, debt, cash, revenue, EBITDA |
| asx_announcements | Recent announcements with automatic feasibility study flagging |
| asx_gold_price | Live XAU/USD + XAU/AUD with 24h change |
| asx_gold_vs_stock | Compare stock returns vs gold returns to find laggards |
| asx_batch_quotes | Bulk quote fetch for multiple tickers in one call |
| asx_gold_developers | Pre-built list of 21 developers + 9 producers with stages and jurisdictions |
DATA SOURCES
Yahoo Finance v8 chart API (prices, returns, gold futures GC=F, FX AUDUSD=X)
ASX MarkitDigital API (announcements, PDF download, market cap via /header)
GoldAPI.io (optional premium gold price, not currently active)
EXAMPLE TOOL REGISTRATION (index.ts)
server.tool(
"asx_stock_quote",
"Get live stock price for any ASX-listed company",
{ ticker: z.string().describe("ASX ticker symbol") },
async ({ ticker }) => {
const quote = await getStockQuote(ticker);
return { content: [{ type: "text", text: JSON.stringify(quote) }] };
}
);EXAMPLE RESPONSE (asx_stock_quote TCG)
{
"ticker": "TCG",
"name": "TURACOGOLD FPO",
"price": 0.545,
"currency": "AUD",
"marketCap": 574.7, // A$M, from ASX /header endpoint
"volume": 2143188,
"fiftyTwoWeekHigh": 0.89,
"fiftyTwoWeekLow": 0.40,
"exchange": "ASX",
"fetchedAt": "2026-06-19T06:02:52Z"
}Audit Trail & Observability
Every action in the system is logged. The goal is that any number on the dashboard can be traced back to its source: which PDF, which page, which model, what prompt was sent, what came back, and when.
AUDIT LOG SCHEMA
audit_log {
id INTEGER PRIMARY KEY
action TEXT -- "extraction_created", "revaluation_created", "price_updated"
entity_type TEXT -- "extraction", "revaluation", "company"
entity_id INTEGER -- FK to the entity that changed
previous_value TEXT -- JSON snapshot before change
new_value TEXT -- JSON snapshot after change (full extraction JSON)
source TEXT -- "ai", "system", "user"
created_at TEXT -- ISO timestamp
}WHAT GETS LOGGED
Every PDF extraction: model used, full prompt sent, full JSON response, page numbers
Every revaluation: input gold price, calculation methodology, output NPV
Every price update: which API, which ticker, what price, when
Every study discovery: announcement title, document key, PDF download path
Every journal entry: whether AI-generated, which model, what prompt
EXTRACTION TRACEABILITY
extractions {
extraction_model TEXT -- "claude-haiku-4-5-20251001"
source_pages TEXT -- "[4, 4, 3]" (which pages the numbers came from)
raw_extracted_text TEXT -- full JSON response from Claude
extracted_at TEXT -- when the extraction ran
}
-- Every extraction links to:
-- study (which PDF) → company (which ticker)
-- audit_log (full before/after snapshot)
-- journal (human-readable log entry)JOURNAL AS OBSERVABILITY
The research journal serves as a human-readable audit trail.
AI agent runs are logged with type "agent_run" including model name.
Human decisions (like removing fake metrics) are logged with type "decision".
Data quality findings are logged with type "observation".
Every entry is timestamped and tagged for filtering.
What Would Make This Better
Current state: 2 extractions out of 21 developers. Here is what would move this from prototype to useful research tool, roughly ordered by impact.
Coverage: 2/21 developers extracted
HIGH IMPACTThe ASX API only returns ~5 recent announcements per company. Most feasibility studies were published months or years ago. A scraper that crawls company investor relations pages would backfill the full history. Target: 21/21 developers with at least one extracted study. This is the single biggest improvement because every other feature (peer comparison, sector-wide P/NAV analysis, signal generation) depends on having data for more than 2 companies.
Extraction validation: no evals framework yet
HIGH IMPACTCurrently no way to measure extraction accuracy. Need: a set of manually verified extractions (ground truth) to eval against, plausibility checks (flag if AISC > gold price, or NPV is negative, or reserves differ from the resource statement by >50%), and cross-referencing against company presentations that often summarise the same numbers in a different format. Target: <5% error rate on key fields, measured against a manually labelled test set of 10+ studies.
Revaluation model: linear approximation only
MEDIUM IMPACTCurrent approach uses revenue sensitivity (gold price delta times production). This is a first-order approximation. A proper DCF would model yearly production schedules, capex phasing, tax depreciation, working capital, royalties, and closure costs. The linear model overstates NPV uplift for very large gold price moves because it ignores operating leverage and grade cutoff optimisation. Quantify the error: compare linear estimate vs full DCF for the 2 extracted studies and report the divergence.
Gold returns: all periods show same value
BUGOnly a few days of gold price history in the DB, so 1m/3m/6m/1y lookbacks all hit the same data point. Fix: backfill 1 year of daily gold prices from Yahoo Finance historical data in a single API call, or wait for the daily pipeline to accumulate enough history (~3 months of runs).
Risk adjustment: no jurisdiction or stage weighting
MEDIUM IMPACTTwo companies with the same NPV/MCAP ratio can have very different risk profiles. A DFS-stage project in Western Australia is fundamentally lower risk than a scoping study in Mali. Need: jurisdiction risk scores, stage discount factors, and balance sheet analysis (can they fund development without dilution?). These would turn the raw NPV/MCAP ratio into a risk-adjusted signal.
Data enrichment: free sources only
CONSTRAINTBloomberg or Refinitiv would add: enterprise value (not just market cap), shares outstanding, analyst consensus estimates, institutional ownership, insider transactions, debt maturity schedules. Cost: ~A$24,000/year for Bloomberg. The free data (Yahoo + ASX) covers price, returns, market cap, and announcements, which is enough for the current prototype but limits the depth of valuation analysis.
Signal generation: no systematic screening yet
NEXT STEPThe dashboard shows findings but doesn't rank or score them systematically. Next step: define a composite signal from gold price delta, P/NAV vs stage benchmark, stock-vs-gold lag, and study recency. Backtest against historical gold price moves to see if the signal has predictive value. This is the bridge from 'interesting data' to 'investable insight'.
How I Iterate With AI
This project was built through conversation with Claude Code. Here is what that process actually looks like:
- Start with the thesis, not the code. I explained what gold feasibility studies are, why stale gold price assumptions create a valuation gap, and what data I'd need. Claude Code designed the architecture from that.
- Build the MCP server first. Before building the dashboard, I had Claude Code build the MCP server so it could access live ASX data while writing the rest of the code. This means the code was informed by real data shapes, not guesses.
- Audit ruthlessly. After the first version was built, I went through every number on the dashboard and asked "is this real or fake?" That audit found the confidence scores (AI flattering itself), the mispricing scores (broken math), and the market cap bug (Yahoo returning null). I told Claude to fix or remove everything that wasn't honest.
- Document everything. Every time we found a bug or made a decision, it went into the research journal. This creates a trail that shows the thinking, not just the output.
- Iterate on data quality before UI polish. No point making charts pretty if the underlying data is wrong. Fix the pipeline first, then the presentation.
To keep improving this dashboard, I'd continue the same loop: run the pipeline, look at what the data actually shows, ask whether each number is real or misleading, fix what's broken, and document the decisions. AI is a tool for writing the code faster, but the human judgment about what to build and what to cut is what makes the output trustworthy.
THIS IS A RESEARCH TOOL, NOT FINANCIAL ADVICE. ALL DATA IS PROVIDED AS-IS. INVESTMENT DECISIONS SHOULD BE MADE WITH PROFESSIONAL ADVICE AND INDEPENDENT RESEARCH.