Essays on market structure and trade