Transaction costs are omnipresent in markets yet are often omitted in economic models. We show that their presence can fundamentally alter incentives and welfare in markets in which the price equates supply and demand. We categorize transaction costs into two types. Asymptotically uninfluenceable transaction costs—such as fixed and price fees—preserve the key asymptotic properties of markets without transaction costs, namely strategyproofness, efficiency, and robustness to misspecified beliefs and to aggregate uncertainty. In contrast, influenceable transaction costs—such as spread fees—lead to complex strategic behavior (which we call price guessing) and may result in severe market failure. In our analysis of optimal design we focus on transaction costs that are fees collected by a platform as revenue. We show how optimal design depends on the traders’ beliefs. In particular, with common prior beliefs, any asymptotically uninfluenceable fee schedule can be scaled to be optimal, while purely influenceable fee schedules lead to zero revenue. Our insights extend beyond markets equalizing demand and supply.