When given the chance, zebrafish willingly dose themselves with opioids — even putting themselves at risk in order to get their fix.

Scientists tested the drug-seeking behavior in a tank that allows the fish to trigger the release of the opioid hydrocodone in the water. The new tool, described in a study published online today in Behavioral Brain Research, can be used to study the underlying biological pathways that push zebrafish to seek drugs. And because zebrafish and humans are surprisingly similar, that could tells us more about biological pathways in people. Eventually, this could lead to new treatments for addiction.

Zebrafish share more than 80 percent of their genes with people, says study co-author Randall Peterson, a chemical biologist at the University of Utah Health. They also have the same opioid receptors and neurotransmitters, like dopamine, that we know play a role in addiction in people. “They are similar to us in many ways,” Peterson tells The Verge. Zebrafish are also inexpensive to keep in a lab and incredibly prolific — one female fish can produce about 200 eggs a day. That allows researchers to easily study thousands of zebrafish to find significant genetic mutations and test new drugs.

Peterson and Gabriel Bossé, a postdoctoral researcher in his lab, were looking for a way to allow zebrafish to dose themselves with drugs. This is important because it’s thought that the effects of opioids are different if you’re administering them to yourself vs. passively receiving the drugs, Peterson says. So they created an automated system made of a plastic tank and two underwater platforms, a white one and a yellow one. When the fish swam over the white platform, nothing happened. But when they swam over the yellow one, a small dose of the opioid hydrocodone was released in the water. (The water in the tank was continuously flushed out and replenished, so that the fish had to keep triggering the system in order to receive a dose.)

The zebrafish were allowed to swim in the tank for 50 minutes a day for five days. The researchers found that on the first day, the fish swam over the white platform just as much as they swam over the yellow one. But by the fifth day, they essentially ignored the white platform, swimming over the yellow one instead in order to get a dose of opioids. After this first week of dosing, the fish were even willing to engage in risky behavior, swimming in shallow waters, in order to get their fix. (Undosed zebrafish avoided the shallow waters, possibly because if fish are swimming near the surface, they are easier targets for birds and other predators, Peterson says.)

Peterson is already using the tank to test existing treatment drugs in zebrafish, and see if any of the meds can interrupt or reduce this drug-seeking behavior. If a drug works in the fish, it could work in people too. “The hope is that those drugs, when we find them, would also be useful in reducing the impulse to seek opioids in humans,” Peterson says.

Scientists could also run genetic tests to see if they can zero in on any particular mutations that influence drug seeking in zebrafish. Those same mutations could play a role in people too, and drugs could be develop to inhibit those mutations in order to treat addiction, Peterson says. Zebrafish also have transparent brains, allowing researchers to easily study in real time which cells and circuits are activated while the fish are seeking their fix of hydrocodone. Better understanding the underlying biological pathways of addiction is key to find new treatments.

And with more than 52,000 people dying of drug overdoses in 2015, most of them due to opioids, new treatments are needed fast.