In this article we provide the optimal timing and equilibrium terms of a vertical merger with two sources of uncertainty in the production chain, namely, marginal cost of raw material and price level of final product. By eliminating monopoly power and transaction cost in the production process between upstream and downstream firms, a vertical merger can increase social welfare, which is consistent with the literature. The optimal threshold of a vertical merger is negatively correlated with transaction cost in the intermediate product market. Vertical mergers also accelerate when merging provides natural hedging for the postmerger firm, that is, when the correlation between the two uncertainties increases.