No, stock markets do not perform the same function as grocery stores.  Grocery stores take on inventory risk by purchasing (in bulk) the goods that they think they can sell.  If their inventory goes unsold or spoils, they lose.  Stock markets provide a _venue_ for trading, but it is the market maker which takes on the inventory risk.  An appropriate analogy would be that the grocery store is renting from a separate property owner.  The property owner collects rent from the grocery store, just as stock markets collect &quot;rent&quot; (trading fees, colocation fees, system access fees) from market makers.  In both cases, the inventory risk is managed by the middleman (grocery store, market maker).