Optimal market thickness and market design