Notebooks
The notebooks contain the Python code for the topics in the notes. Each one can be downloaded as a Jupyter notebook. Notebooks that use WRDS data need a WRDS account; the others use free public data.
Building with AI
Python, Data and WRDS Loading data from WRDS and public APIs, returns, plots and a first regression.
Neural Networks and Language Models
A First Neural Network Fitting a linear model and a neural network to the same data, and comparing them on data they were not trained on.
Pricing Options with Neural Networks Training a network on option prices from OptionMetrics and comparing it with Black-Scholes.
Text as Data Turning FOMC statements into numbers with word counts and embeddings, mapping a decade of Fed communication, and searching statements by meaning.
Blockchain
Proof of Work Example A minimal blockchain: hashing, mining, verifying blocks, and what happens when a block is changed.
Mining Economics Miner revenue, hash rate and difficulty around the Bitcoin halvings.
A Market Index for Cryptocurrencies A value-weighted crypto index, coin betas, and how crypto moves with the stock market.
Decentralized Finance
Trading Against an Automated Market Maker Simulating a constant-product pool, arbitrage, and liquidity providers’ fees against their losses.
Liquidation Cascades How falling collateral prices trigger liquidations, and how liquidations can push prices further.
The USDC Depeg Hourly USDC prices around the Silicon Valley Bank failure in March 2023.