The pay-as-bid (or discriminatory) auction is a prominent format for selling homogenous goods such as treasury securities and commodities. We prove the uniqueness of its pure-strategy Bayesian Nash equilibrium and establish a tractable representation of equilibrium bids. Building on these results we analyse the optimal design of pay-as- bid auctions, as well as uniform-price auctions (the main alternative auction format) allowing for asymmetric information. We show that supply transparency and full dis- closure are optimal in pay-as-bid, though not necessarily in uniform-price; pay-as-bid is revenue dominant and might be welfare dominant; and, under assumptions commonly imposed in empirical work, the two formats are revenue and welfare equivalent.