After more than a year of speculation, the Phillies traded Cole Hamels (and reliever Jake Diekman) to the Rangers on Wednesday. In exchange for an ace, the Rangers sent a collection of varyingly regarded prospects — catcher Jorge Alfaro; right-handers Jake Thompson, Jerad Eickhoff, and Alec Asher; and outfielder Nick Williams — the other way, along with veteran lefty starter Matt Harrison. The Phillies flipping Hamels has been a long time coming and we’ve had a while to prepare, but given where Texas lies in the standings, it still looks surreal.

Riddled by pitching injuries for the second straight year, the Rangers sit in third place in the AL West, four games under .500 and eight games behind the front-running Astros. The team’s top two projected starters coming into this season, Yu Darvish and Derek Holland, have thrown just one combined inning in 2015. So while a cast of Band-Aid options fared well for a short stretch, Texas’s lack of reliable options behind that big two has ultimately doomed it to run-prevention hell: Only the lowly Red Sox have allowed more runs per game in the AL this year.

More 2015 MLB Trade Deadline Trade deadline winners and losers

Proof that this deadline was historic

Deadline day wrap: Yo to the Mets!

GM Anthopoulos on the Jays' moves

Toronto goes all in to acquire Price

Texas wins the Hamels sweepstakes

Parsing the Tulowitzki blockbuster

Houston takes big step with Gomez

Ben Zobrist: The perfect Royals add

Title-hungry Royals acquire Cueto

L.A. bolsters its rotation with Latos

The Nats fix their biggest weakness

The Kazmir deal is great for all sides

All of our trade deadline coverage! Given his combination of skill, health, and contract status, Hamels was the most valuable pitcher on the trade market, and we rarely see teams on the fringes of a playoff race land such a big fish before the trade deadline. Yet the Rangers had been linked to Hamels for weeks, precisely because of his favorable contract, which made him an attractive keeper for any team with playoff aspirations — even if those aspirations were more focused on 2016 and beyond. The contract itself is a bit complicated, but in a nutshell, this is what it looks like: If the 31-year-old lefty throws 400 or more innings in 2017 and 2018 combined (including 200-plus in 2018) and is not on the disabled list at the end of the 2018 season with a shoulder or elbow injury, the Rangers will owe him a hair less than $100 million through 2019. If Hamels doesn’t meet those thresholds but Texas chooses to pick up his option anyway, that’ll run a smidge under $96 million through 2019. And if the Rangers decline that option, put them down for nearly $82 million through 2018.

Now, for the caveats: When Hamels signed the six-year, $144 million deal with that club option back in July 2012, it was the second-largest contract ever given to a pitcher. He’s now three years older and has since added more than 600 innings to his odometer. Lucrative, long-term deals for pitchers are inherently risky, and they’re especially so when you’re getting the returns from only the second half of one.

Joe Robbins/Getty Images

If that paragraph seemed short, it’s because the positives for the Rangers far outweigh the negatives. First, Hamels is a metronome of consistent health. He’s on pace to log his eighth straight season with 30 or more regular-season starts, and he’s pitched more regular-season innings over that span than all but three pitchers. If we lengthen or compress the parameters, Hamels still sits among the most voracious innings eaters. He’s topped 200 innings pitched in five straight seasons (and six out of seven), so for all the baked-in risk that comes with repeatedly throwing a baseball year after year, Hamels is as close to a reliable commodity as there is.

He’s also pretty good at this pitching thing. In 2015, Hamels ranks 11th among qualified National League starters in Wins Above Replacement, according to FanGraphs. And since 2011, he ranks second only to Clayton Kershaw. Unlike most veteran pitchers, Hamels hasn’t lost any velocity off his fastball as he’s aged, either. In fact, per Brooks Baseball, he’s actually throwing harder than he has in at least eight years. He’s a legitimate five-pitch pitcher who uses multiple different offerings to put hitters away, and this year he’s generating more swinging strikes than in any other season except his 2007 campaign. In short: Hamels was good, he is good, and given his combination of stuff, results, and durability, he projects to keep being good.

Also, for as historically expensive as the deal was when Hamels signed it back in 2013, the financials here actually look pretty good for Texas. To start, the Phillies are sending $9.5 million to the Rangers. Shedding the roughly $33 million left on Matt Harrison’s contract (including the remainder of his 2015 freight, plus the $2 million buyout to get out of paying him in 2018) also cancels out a good chunk of what Hamels will be owed, even in the spendiest of scenarios. Plus, Hamels is owed tens of millions less than, say, Jon Lester, a lefty with similar fielding-independent numbers over the past few seasons who’s exactly 11 days younger than Hamels is. The Rangers’ lucrative local TV deal also makes the expense of a top-flight pitcher far easier to support.

We also need to consider how few elite starting pitchers make it to free agency with the wave of TV revenue washing over the league. Superstars like Felix Hernandez get locked up into their mid-thirties. Even pitchers with far less impressive résumés end up committing for many years, which is how you get a case like Chris Archer, the rising star who the Rays can control through 2021 after signing him a year before his big breakout. That lack of supply in turn creates off-the-charts demand and sky-high prices: Would you rather have Hamels for the next four-plus seasons at $96 million–$100 million, or David Price, who’s a free agent after this season, for what could easily become seven or eight years at a price north of Max Scherzer’s $210 million?

With the notable exception of Darvish, the Rangers rarely attract those top free-agent starters. And with a lack of top starting pitching prospects close to the big leagues and the injury issues for both Darvish and Holland, the pressure was heightened for Texas to find a front-of-the-rotation arm via trade. And here’s one final kicker: Per ESPN.com’s Keith Law, the Rangers didn’t give up any of their top three prospects. Other sites have Alfaro, Thompson, and Williams ranked higher, and the general consensus is that they were all at least among the franchise’s top six. But the point is: Texas didn’t completely clean off its top shelf to get Hamels. As fun as it can be to dream of all your prospects coming up and becoming stars, the Rangers saw an opportunity to cash in a bunch of “maybes” for something close to a sure thing, while still hanging on to a few of their “most likelies.”

Hamels does give Texas a better opportunity to win now, but more importantly he also gives them a chance to win soon and much later. With a promising offense that could further improve once top prospect Joey Gallo settles into the major league lineup and sticks there, plus a 2016 rotation headed by Hamels that also hopefully includes a healthy Darvish and Martin Perez, in addition to Chi Chi Gonzalez and either Holland or some combination of other options, the Rangers could be a dangerous team next season.

The deal being a potential big win for the Rangers doesn’t mean the Phillies got fleeced, though. Here’s what they’re getting:

• Alfaro is a 22-year-old catcher with big power and a big arm, but he also flashed a 61-to-9 strikeout-to-walk rate this year playing at Double-A Frisco. He suffered a severe ankle injury that’ll cost him the rest of the regular season, and needs to work on his non-throwing defensive skills, but he’s the big get here and scouts say that he had been improving prior to the ankle knock. Law ranks him at no. 49 overall, and he hovered around 50 in most preseason lists. Expect him to be even higher ahead of next season.

• Thompson, 21, has been hit hard at times in Frisco, but the Texas League can be challenging for pitchers, and he’s got two potential plus pitches with his fastball and slider. His 6-foot-4, 235-pound build is also scout catnip. Baseball America had him ranked behind only Joey Gallo among Rangers prospects prior to the season, FanGraphs had him as its 29th-best prospect coming into the season, and MLB.com still ranks him ahead of Alfaro.

• The 21-year-old Williams gets high marks for his bat speed, raw power, and athleticism, though he, too, has often struggled to control the strike zone. Still, he’s batting .299/.357/.479 at Frisco, and while Law has significant reservations about Williams’s future, Baseball Prospectus had him as its no. 71 prospect heading into this season.

• Eickhoff and Asher are longer shots, with Law projecting Eickhoff as a best-case back-end starter, and Asher as a reliever, if he makes The Show at all.

If you’re a Phillies fan wondering if that haul is enough for a pitcher of Hamels’s caliber, keep in mind that teams have become zealots about protecting their top prospects; a Kris Bryant type on the cusp of the majors simply isn’t going to change teams, unless a general manager suddenly decides to trade a star in his mid-twenties who’s locked up for many years to come. Getting this array of prospects with different pedigrees and different positions thus offers the Phillies a combination of upside and organizational depth that’s a reasonable return for today’s trade environment.

Hamels will almost certainly be the best player in this trade for the next four years, and he might even retain that status for longer. But the Phillies needed to stockpile assets in their farm system to improve their chances of successfully rebuilding, as they’re not going to contend at the major league level for a while. This trade does that, even if finding a true star within this group of imported young talent might still be a long shot.