Foreign exchange intervention for commodity booms and busts