This paper extends the framework derived by Jeanne and Rancière (2006) by explicitly incorporating the dollarization of bank deposits into the analysis of the optimal level of foreign reserves for prudential purposes. In the extended model, a sudden stop in capital flows occurs in tandem with a run on dollar deposits. Reserves can smooth consumption in a crisis but are costly to carry. The resulting expression for the optimal level of reserves is calibrated for Uruguay, a country with high dollarization of bank deposits. The baseline calibration indicates that the gap between actual and optimal reserves has declined sharply since the 2002 crisis due to a substantial reduction in vulnerabilities. While the results suggest that reserves are now near optimal levels, further accumulation may be desirable going forward, partly because banks' currently high liquidity levels are likely to decline as the credit recovery matures.