Whale sharks are neither whales nor typical sharks but the world’s largest fish, sometimes exceeding 40 feet in length. While finding and studying such a massive animal might sound easy, it’s not. Researchers know that the massive filter feeders migrate long distances throughout the tropics looking for dense clouds of krill to slurp up. But figuring out what routes the big fish take and why they follow them has proved difficult. One recent study, however, has unraveled the secrets of whale sharks in the eastern tropical Pacific, finding that they follow the ever-changing boundary between cold water south of the equator and warm water to the north called the North Pacific Equatorial Upwelling Front. In essence, it serves as a whale shark highway.

Figuring out the route of that highway, however, was no easy task. In 2011 and 2012, researchers from the University of Quito in Ecuador and the Galapagos National Park Directorate attached satellite-tracking tags to 27 whale sharks at a site north of the Galapagos Islands known as Darwin’s Arch—the first time the animals had been tagged in the eastern tropical Pacific. What the researchers found was that the animals traveled east and west across the ocean, staying in a narrow band between the equator and five degrees north latitude.

The researchers wondered whether the whale sharks might be following the North Pacific Equatorial Upwelling Front. So they brought aboard John Ryan‚ a biological oceanographer at the Monterey Bay Aquarium Research Institute who studies plankton and the ocean conditions that support them. One major problem with satellite tracking of ocean-going animals is clouds, which can block data collection for days or weeks, giving an imprecise picture of their movements. “If you piece together observations taken at various times, they average into a picture that doesn’t look like what the animal encountered,” explains Ryan.

He used infrared and microwave sensing data, which can penetrate through the clouds, to create a detailed, day-to-day map of ocean temperatures in the area during the time the whale sharks were tracked. He found that the whale sharks stuck very close to the upwelling as it meandered north and south of the equator, sometimes moving hundreds of miles. The research appears in the journal PLOS One.

Following the boundary is a strategy that makes sense for the whale sharks. The fish hang out on the north side of the boundary to avoid the cooler water, waiting for the upwelling to bring nutrients that cause explosions of plankton and krill closer to the surface, allowing the whale sharks to cruise the boundary, filter feeding all the while. “North of the equator the food explodes, and physical processes condense it,” Ryan says. “The whale sharks get a lot of food for little effort.”

The study also found some intriguing anomalies. Almost all of the sharks tagged were pregnant females. The one adult male in the group also followed the boundary, but two juveniles that were tagged kept a little farther away from the front.

The fish also didn’t always stay in the North Pacific Equatorial Upwelling Front. In January and February, when the equatorial front weakens, they traveled to a connected upwelling off the coast of South America known as Humboldt Current. They also spent time in a wind-jet system that blows through a gap in the coastal Andean mountains, creating another oceanfront. The whale sharks, Ryan says, seem to be very good at finding fronts.

Which is great information for scientists, who have had trouble finding the giant fish. Whale sharks, which comprise a single species found around the world’s tropics, were declared endangered by the International Union for the Conservation of Nature in 2016, after losing half their population over the last 75 years due to illegal fishing, tangling in fishing gear, and boat collisions. While researchers know the species likely numbers in the tens of thousands, getting a good estimate has been difficult. Knowing they prefer to hang out in ocean boundaries could help lead to better population estimates and improved conservation plans.