Stability and Competitive Equilibrium in Trading Networks