This paper presents a stochastic optimization model for marketmaking in security markets with a single dealer. Buy and sell orders are assumed to arrive at rates that are functions of the ask and bid prices. The dealer incurs both proportional and fixed transaction costs as well as portfolio costs. Methods of dynamic programming and semi-Markov Decision Processes are used to characterize optimal pricing policies and to perform sensitivity analysis. Both bid and ask prices are nonincreasing functions of the dealer's inventory. Spread is unrelated to inventory position but positively related to order size. Computational examples demonstrate various results.