How should developing countries spend an unexpected surge in foreign assistance or natural resource revenues? This column makes the case for establishing a sovereign wealth fund and examines the market imperfections that may constrain such a policy