Endogenous Market-making and Formation of Trading Links