Consider a *two-stage matching* problem, where edges of an input graph are revealed in two stages (batches) and in each stage we have to immediately and irrevocably extend our matching using the edges from that stage. The natural greedy algorithm is half competitive. Even though there is a huge literature on online matching in adversarial *vertex arrival model*, no previous results were known in the adversarial *edge arrival model*.

For two-stage bipartite matching problem, we show that the optimal competitive ratio is exactly 2/3 in both the fractional and the randomized-integral models. Furthermore, our algorithm for fractional bipartite matching is *instance optimal* -- achieves the best competitive ratio for any *given* first stage graph. We also study natural natural extensions of this problem to general graphs and to *s* stages, and present randomized-integral algorithms with competitive ratio 1/2 + 2^{-O(s)}.

Our algorithms use a novel LP and combine graph-decomposition techniques with online primal-dual analysis.

Based on joint work with Euiwoong Lee.