Engineering Notes
How I actually build things across three domains that keep converging: blockchain protocols, AI systems, and financial infrastructure. These are working notes from real builds — the architecture decisions, the failure modes, and the details that only show up in production. Written by Harsh Mittal, full stack blockchain and AI developer.
Research
Screening 1,353 NSE Stocks Every Week
An engineering case study: constructing a full NSE universe from free data sources, scoring it on seven factor groups, fixing the normalization that outliers break, shrinking scores by data coverage, and automating the whole refresh with a week-over-week diff digest.
12 min readData as of 2026-07-22Python · pandas · yfinance · nselibSieving 5,600 US Stocks for 50-Year Moats Trading 30% Below Their High
An engineering case study on screening the full US common-stock universe for long-lived businesses at deep discounts — and on the three classes of false positive that make a naive drawdown screen almost entirely wrong.
11 min readData as of 2026-07-19Python · Yahoo Finance API · NASDAQ symbol directories · CSVMeasuring Realized Funding-Capture APY Across 201 Perp Markets
An on-chain data case study: pulling 2,157 hours of funding history for every market on a perp DEX, computing realized funding-capture APY, and finding that the highest yields cluster precisely where the hedge is hardest to construct.
9 min readData as of 2026-07-18Python · REST APIs · CSV · statisticsMapping the AI Supply Chain as a Six-Layer Screen
An analytical framework for the AI infrastructure supply chain — decomposing it into six chokepoint layers, scoring quality against cheapness, and handling the two places the standard metrics actively mislead: provider-derived PEG and peak-cycle memory earnings.
10 min readData as of 2026-07-02Python · Yahoo Finance · IBKR · CSV
Web3
AI Agents That Transact On-Chain: Architecture and Guardrails
Where AI agents and blockchain genuinely intersect — automated treasury operations, portfolio rebalancing, and monitoring — plus the custody model, simulation layer, and policy engine that make an autonomous signer safe.
9 min readTypeScript · Solidity · Viem · Claude APIThe Smart Contract Security Checklist I Run Before Every Audit
The concrete review passes that catch most Solidity vulnerabilities before an auditor sees them: access control, reentrancy beyond the obvious cases, oracle assumptions, upgrade safety, and invariant testing with Foundry.
10 min readSolidity · Foundry · Slither · EchidnaDesigning an ERC-4626 Yield Vault That Does Not Leak Value
How tokenized yield vaults are actually built: the share-price invariant, inflation attacks, strategy adapter interfaces, loss socialization, and why withdrawal queues exist.
9 min readSolidity · Foundry · OpenZeppelin · ViemHow to Architect a DeFi Lending Protocol
A working engineer's breakdown of how overcollateralized lending protocols like Aave and Compound are built: interest rate curves, health factors, liquidation incentives, oracle dependencies, and the failure modes that drain them.
11 min readSolidity · Foundry · Chainlink · ViemPrice Oracle Design for On-Chain Protocols
How to source, validate, and fail safe on price data in smart contracts — comparing push oracles, pull oracles, and AMM TWAPs, with the exact validation code and risk parameters that bound your downside.
8 min readSolidity · Chainlink · Pyth · Uniswap V3
AI
Building LLM Agents That Survive Contact With Production
How to build agentic systems that do real work: designing tools an LLM can actually use, bounding the control loop, managing context over long runs, handling partial failure, and deciding where a human belongs.
10 min readTypeScript · Claude API · MCP · Node.jsWhat a Production RAG Pipeline Actually Requires
The engineering behind retrieval-augmented generation that survives real users: chunking strategy, hybrid search, reranking, citation grounding, caching, and the eval loop that tells you whether any change helped.
11 min readTypeScript · Next.js · Claude API · pgvectorExtracting Structured Data From Financial Documents With LLMs
A pipeline for turning PDFs — 10-Ks, bank statements, invoices, term sheets — into validated structured data, with the confidence scoring and reconciliation checks that make the output trustworthy enough to post to a ledger.
9 min readPython · TypeScript · Claude API · Postgres
Finance
Markets
Building a Real-Time Trading Dashboard That Stays Smooth
How to build a browser dashboard that renders live prices, order books, and portfolio P&L at high update rates without dropping frames — transport choice, update batching, canvas rendering, and consistent state under reconnects.
8 min readNext.js · TypeScript · React · ZustandHow to Build a Backtesting Engine That Tells the Truth
The architecture of a trustworthy backtester — event-driven rather than vectorized, realistic fill and cost modelling, look-ahead bias elimination, and why the same code should run in simulation and live.
11 min readPython · TypeScript · Postgres · PandasBuilding a Market Data Pipeline That Does Not Lie to You
How to build market data infrastructure for equities and crypto: websocket ingestion with gap recovery, tick versus bar storage, adjusting for splits and dividends, and the data quality problems that silently invalidate every downstream model.
10 min readTypeScript · Python · Postgres · TimescaleDB
Work with me
I build across the whole stack — Solidity contracts and DeFi mechanism design, LLM pipelines and agent systems, market data infrastructure, and the production interfaces on top. If you have a problem in any of these areas, get in touch.
Start a conversation