Grocery delivery startup Instacart has bagged a fresh $400 million from investors.

Instacart, which is based in San Francisco, is an on-demand service that has workers shop for groceries on behalf of customers and deliver them to their doorstep.

With the new round of financing, led by Sequoia Capital, the company is valued at $3.4 billion. It currently operates in 35 markets, and in the announcement Wednesday, said it expects to double that this year.

Instacart has 135 partnerships with grocery retailers around the country, including chains like Whole Foods (WFM), Costco (COST) and Supervalu (SVU). The company gets a revenue share from retailers based on the size of each basket. According to Instacart's chief finance officer and chief operating officer Ravi Gupta, it's a "very meaningful part of our revenue." It also charges delivery fees from customers.

Gupta told CNNTech that its fastest growing source of revenue, however, comes from companies that pay to reach out Instacart customers as they're shopping digitally.

If a customer searches for cereal, for instance, Instacart can surface ads for a particular company and then provide the company with analytics based on how those ads performed. It has 160 such partners, Gupta said.

Related: Amazon opens a grocery store with no checkout line

The on-demand business model is a tough one to make work. Companies like Homejoy and WunWun are just a few that have shuttered due to difficulties staying afloat.

The company is, however, toeing a fine line with its workers.

In October, it tweaked its pay structure, removing the tipping option in the app and adding a service fee (a default 10% but customers could choose to give more). It said this would "smooth out variations in pay"; the service fee is pooled and distributed evenly to all workers.

But this angered workers, and Instacart responded by adding a tipping option back in. That optional fee goes directly to the individual delivery worker, but the fact that there are now two fees instead of one can be confusing for customers, workers say.

Related: The grocery shopping app for the 99%

In December, Instacart was slapped with a lawsuit. Some of its contract workers allege that they were treated as full-time workers but weren't compensated properly with wages and benefits. The complaint mentions the tip as proof of how the workers are treated as employees, because the company controls what happens to their tips.

Instacart said it does not comment on any pending litigation. Gupta said 80% of the company's workers are contractors. The remaining 20% are part-time shoppers, an option the company introduced in June 2015.