We propose and estimate a structural model of daily stock market activity to test competing theories of trading volume. The model features informed rational speculators and uninformed agents who trade either to hedge endowment shocks or to speculate on perceived information. To identify the model parameters, we exploit enormous empirical variation in trading volume, market liquidity, and return volatility associated with regular and extended-hours markets as well as news arrival. We find that the model matches market activity well when we allow for overconfidence. At plausible values of overconfidence and risk aversion, overconfidence—not hedging—explains nearly all uninformed trading, while rational informed speculation accounts for most overall trading. Without overconfident investors, over 99% of trading volume disappears even when informed rational traders disagree maximally. These findings illustrate that modest overconfidence can help explain stark patterns in stock market activity.