Optimizing Investment in Two-Sided Platforms