Design of a multilateral market for heterogeneous goods