A down payment in the stock market can lose 10% right as you bid on a house. Don't risk it, and use a certificate of deposit instead.
You might be surprised when I suggest a 5 year CD for a need only 3 years away... but look:
online savings, 1% rates
3 year CDs, 1.5% - 1.6% rates (look for 6 month penalty or less)
5 year CDs, 2.2% rate (look for 6 month penalty or less)
What happens after 3 years, with a 3-year CD versus a 5-year CD?
(5 year) 2.2% ^^ 3 - 1.1% = roughly 5.6% return
(3 year) 1.6% ^^ 3 = roughly 4.9% return
Even with the -1.1% penalty, the 5 year CD is earning more. So there's a flexible answer to where to keep the money: in a 5 year CD that features a 6 month withdrawal penalty.
Ally is really good at having reasonable withdrawal penalties, and Capital One 360 has better rates and a reasonable withdrawal penalty. Overall I'd suggest a CD and taking the withdrawal penalty because you plan to keep the money at least 2 years, and maybe longer than 3 years.