Learning to Maximize Gains From Trade in Small Markets