Companies that solve real problems make for compelling investment opportunities on Shark Tank--particularly when the problem is a health crisis.

On Sunday's episode of the ABC show, founder Eric Roy pitched Hydroviv, a line of personalized water filters he developed in response to the water crisis in Flint, Michigan. Hydroviv makes consumer filters based on the water quality in customers' cities--which they identify before purchasing--and removes harmful substances like lead and arsenic. Roy, who worked as a chemist at the Department of Defense in Washington, D.C., told the Sharks he expects to generate $325,000 in sales this year and reach $1.7 million next year. He came to Shark Tank seeking $400,000 for 10 percent equity and made a strong impression on Mark Cuban, who immediately saw promise in a product that could help address a serious health issue.

"Your product is not a water filter; your product is trust," Cuban told Roy during his pitch. "I'm interested because I love products that do well by doing good."

While other filter companies like Brita promise to deliver cleaner water, they aren't developed specifically for water in certain areas and therefore cannot remove all the necessary toxins, Roy told the Sharks. "If you're trying to do everything all at once you don't really do anything very well," he added.

Roy came up with the idea after learning about the water crisis in Flint, which in 2014 switched its drinking water source from Lake Huron to the Flint River, leading to dangerously high levels of lead. Roy created filters that catered to Flint's specific purification needs in his studio apartment and donated them to the city. Eventually, he developed a business plan wherein he would assess a city's drinking water based on local water quality data, then build a custom-made filter. Customers install the filters under their sinks and receive replacement filter cartridges through Hyrdoviv's subscription service every six months. The company sells the filters for $249 and replacement filters for $55 for subscribers and $65 for non-subscribers. 

The Sharks liked Roy's business but were nervous about his plans for growing the company. When guest Shark and marketing expert Rohan Oza asked how he would spend the $400,000, for example, Roy said he wanted to hire senior-level marketing people to boost the company's profile. The Sharks disagreed with the strategy, adding that they would rather see Roy focus on raising awareness about the company's mission.

"What I've heard is that your customers have come from an authentic belief; they believe in your product and that you will protect them," Cuban said. "We want to get you out there scaring the hell out of people and getting onto shows and saying, 'I'm here to answer all your questions.'"  

Cuban offered $400,000 for 20 percent of the company, which Roy accepted without negotiating. 

"Now that we have [Cuban] on our team, I'm just speechless," he said.

Correction: An earlier version of this story incorrectly stated the price of Hydroviv's products. The company sells its filters for $249 and replacement filters for $55 for subscribers and $65 for non-subscribers.