What: Shares of e-commerce company Wayfair (NYSE:W) soared on Wednesday after the company reported its second-quarter results, with both revenue and earnings coming in well above analyst expectations. At noon Wednesday, the stock was up about 20%.

So what: Wayfair reported quarterly revenue of $491.8 million, up 66.4% year-over-year and about $53 million higher than the average analyst estimate. The number of active customers rose to 4 million during the quarter, up 53.5% year-over-year, and the number of orders delivered increased 80.7% year-over-year to 2 million. Direct retail revenue, generated through the websites of Wayfair's brands, rose 80.8% year-over-year to $440.3 million.

The company also beat analyst expectations for earnings, reporting a non-GAAP net loss of $0.15 per share. Analysts were expecting a non-GAAP loss of $0.29 per share. Gross margin rose to 24.6%, up from 23.2% during the same quarter last year, while operating expenses rose by 53%, substantially slower than revenue growth.

Now what: Wayfair is still unprofitable, reporting a GAAP net loss of $19.3 million during the second quarter. But this is an improvement compared to the second quarter of 2014, when the company lost $23.4 million, and losses are shrinking as a percentage of revenue. All of Wayfair's numbers are moving in the right direction.

Wayfair is a heavily shorted stock, so the big move today may partly be driven by shorts closing out their positions. Overall, it was a great quarter for Wayfair, with revenue growing at a rapid pace and profitability improving, so it's no surprise that investors are bidding up the stock.