The Marlins have announced a multi-player trade with the Astros that will bring starter Jarred Cosart, shortstop Enrique Hernandez, and outfielder Austin Wates to Miami in exchange for third baseman Colin Moran, outfielder Jake Marisnick, pitcher Francis Martes, and the Marlins’ 2015 compensation pick.

In short, both of baseball’s worst teams from 2013 have shuffled a series of young players in a deal that could have wide-ranging repercussions for both franchises. Miami was said to be chasing a young arm, and that’s exactly what they got. But it came at a fairly steep price.

In Cosart, the Marlins are getting a pitcher who came to Houston in the 2011 Hunter Pence deal and has blossomed somewhat in the last two seasons. The 24-year-old has a 4.41 ERA through 116 1/3 frames with 5.8 K/9 against 3.9 BB/9 and a sterling 56.5% groundball rate. That has been good for a 4.02 FIP, 4.28 xFIP, and 4.42 SIERA — hardly ace-level numbers, to be sure, but useful and promising enough given his age. Of course, much of Cosart’s value lies in the fact that he will not even be eligible for arbitration until 2017.

Miami also added some other useful pieces in the trade. Hernandez reached the big leagues this year at just 22 years of age, and owns an impressive .284/.348/.420 slash line through 89 plate appearances. He had slashed .336/.379/.503 in the upper minors, which itself represented a major step up in his results for the youngster. Wates, 25, is something of an on-base machine: he owns a .303/.381/.415 career triple-slash in the minors. Though he does not bring much power to the table, he does have 31 stolen bases this year in his first extended action at Triple-A.

For Houston, the deal brought a variety of goodies in return. Moran was the 6th overall pick in last year’s draft, and numerous reports suggest that he was seriously under consideration with the Astros’ first overall selection. Though he has not exactly dominated at High-A at age 21 (.294/.342/.393), he is not far removed from the amateur ranks and has plenty of time to develop.

Marisnick, meanwhile, is expected to slot right into the club’s lineup. A perennial top-100 prospect who was somewhat blocked in Miami, he has struggled in limited MLB exposure (.183/.231/.248 line in 169 total plate appearances). But the right-handed hitting outfielder, still only 23, has a .277/.326/.434 line in his 377 Triple-A plate appearances.

And then there is the compensation pick, which will come in the first available slot and carries a good bit of value (delivering immense flexibility to a Houston club that will have two high first-round choices next year). The final piece, Martes, is just 18 years old. The Dominican native has worked at the Rookie level this year, tossing 29 innings of 4.97 ERA ball and working both in relief and as a starter.

Brian McTaggart (via Twitter) first reported the deal. Clark Spencer of the Miami Herald (via Twitter), Evan Drellich of the Houston Chronicle (via Twitter), and Jon Heyman of CBSSports.com (via Twitter) all reported details of the players involved.