We develop a theory of financial innovation in which both market structure and the payoffs of the claims being traded are determined endogenously. Intermediaries use the cash flows of an underlying asset to design securities for investors. Demand for securities arises as investors choose markets then trade using strategies represented by quantity-price schedules. We show that intermediaries create increasingly riskier asset-backed securities when facing deeper markets in which investors trade more competitively. In turn, investors elicit less risky securities when they choose thinner markets, revealing a novel role for market fragmentation in the creation of safer securities.