Existence and Optimality of Competitive Equilibria