Dayton Moore, the general manager of the Kansas City Royals, has been far from perfect at his job. He has made bad trades (Melky Cabrera for Jonathan Sanchez), he has made terrible free-agent signings ($36 million for Jose Guillen), and he has signed Jeff Francoeur not once, but twice.

But two years ago, he was able to deliver something to Royals fans that they hadn’t felt for a quarter-century: hope. After the 2010 season, the Royals had fashioned the greatest farm system in baseball, the greatest anyone had seen in years. People were talking about the Royals, and not as a punchline. After 25 years without so much as a pennant race, fans of the team could realistically dream about the playoffs — not just a fluky, 2012-Orioles-style appearance, but a legitimate mini-dynasty atop the weak AL Central.

Last night, that dream was ripped apart like a cheap piñata. Frustrated by the inability to develop a starting rotation to pair with the team’s young, talented offense, Moore traded Baseball America‘s Minor League Player of the Year, right fielder Wil Myers, and three other solid prospects to the Tampa Bay Rays for James Shields and Wade Davis.

The Royals got a terrific starting pitcher in Shields, and Davis was a solid back-end starter for the Rays in 2010 and 2011 before they moved him to the bullpen in 2012, where he excelled. But Kansas City gave up an astonishing amount of talent, rivaling the Atlanta Braves’ regrettable payment for Mark Teixeira in 2007 as the largest collection of prospects traded in the past decade.

This is a terrible trade for the Royals, deeply flawed in both its theory and execution, and while it might make the Royals marginally more likely to make the playoffs in 2013, it does irreparable damage to their chances of building a perennial winner.

Let’s start here: Wil Myers is not a good prospect. He is not a very good prospect. He is one of the best prospects in baseball, almost certain to be among the top five of every prospect list that is published this offseason. Good prospects fail all the time. Very good prospects fail more often than not. But the very best prospects — especially hitting prospects, whose risk of injury is dramatically lower than their counterparts on the mound — turn into above-average regulars, if not stars, well over 50 percent of the time.

Myers, as mentioned, was named Minor League Player of the Year. In the past 20 years, 14 position players won the same award. Here are their names:

1992: Tim Salmon

1993: Manny Ramirez

1994: Derek Jeter

1995: Andruw Jones

1996: Andruw Jones

1997: Paul Konerko

1998: Eric Chavez

2002: Rocco Baldelli

2003: Joe Mauer

2005: Delmon Young

2006: Alex Gordon

2007: Jay Bruce

2008: Matt Wieters

2009: Jason Heyward

2011: Mike Trout

Yes, Delmon Young was once the Minor League Player of the Year, and if you want to spin this trade for the Royals, you can bring up Young’s name as a cautionary tale. And after a promising start to his career, Rocco Baldelli was ravaged by injuries and his career ended at age 28. But every other player on that list has gone on to become a well-above-average player at his position. Most of them became stars. At least a few will go into the Hall of Fame.

Based on the list above, Wil Myers has about an 86 percent chance of becoming a true impact player in the major leagues. Yes, that’s based on a small sample size, but that’s just the point: Myers is a special player, and there are precious few players that you can compare him to. In 2012, he hit .314/.387/.600 between Double-A and Triple-A while playing the entire season at age 21. He hit 37 home runs, the most by any 21-year-old in the high minors (Double-A and Triple-A) since 1963.

Myers wasn’t just one of the best prospects in baseball. He also perfectly fit the one glaring hole in the Royals lineup. The fantastic farm system from two years ago has already supplied the Royals with young talent at first base (Eric Hosmer), third base (Mike Moustakas), and catcher (Salvador Perez) to go along with earlier farm system products in left field (Alex Gordon) and at DH (Billy Butler). The Zack Greinke trade brought in starters at shortstop (Alcides Escobar) and center field (Lorenzo Cain).

But in right field, the Royals committed to Jeff Francoeur, who in 2012 was arguably the worst everyday player in the major leagues. (This continues a long tradition of a Commitment to Execrableness in Kansas City. Yuniesky Betancourt would have once again contended for the worst everyday player honor had he played more.) Francoeur hit .235/.287/.378, which would be atrocious for a shortstop, and despite his cannon arm in right field, he had such poor range that defensive metrics estimate he cost the Royals about 10 runs on defense.

Instead of replacing Francoeur with Myers in 2013, a switch that would be worth around four wins, they’re stuck with the game’s worst right fielder for another season. The downgrade from Myers to Francoeur is almost enough to cancel out the benefit from acquiring Shields.

Shields is an excellent pitcher who has thrown more innings over the past two seasons than anyone except Justin Verlander. But he’s not an ace, and if you’re going to give up a prospect as good as Wil Myers, you need to get an ace.

Shields has a 3.89 career ERA, and a 3.15 ERA over the past two years. (Mind you, three years ago he had a 5.18 ERA and led the AL in hits, earned runs, and home runs allowed.) But here’s the thing: In Tampa Bay, he played in one of the best pitchers’ parks in baseball, in front of one of the best defenses in baseball, for one of the best managers in baseball. He brings none of those things with him to Kansas City.

Ballpark? For his career, Shields has a 3.33 ERA when pitching at Tropicana Field. When pitching anywhere else, he has a 4.54 ERA.

Defense? By defensive efficiency — a measure of what percentage of the time a defense turns a ball in play into an out — the Rays have had the best or second-best defense in the major leagues for each of the past three years. By comparison, over the past three seasons the Royals have ranked 28th, 24th, and 26th in defensive efficiency.

Manager? Joe Maddon’s record speaks for itself.

These factors are intertwined to some extent; one thing that makes Maddon great is that he’s so aggressive about using defensive shifts, which improves the team’s defensive efficiency, as does the ballpark. Overall, it’s fair to say that Shields is a good pitcher who was put in position to look like a very good pitcher.

In terms of pure baseball value, Shields has the edge in 2013. But of course, the Royals and Rays didn’t trade players — they traded contracts, and the difference between the two is staggering. The Rays have control of Myers for at least the next six years — and given their knack for signing star players to long-term deals as soon as they reach the majors (Evan Longoria, Matt Moore), it wouldn’t be a surprise if they soon have Myers under club control into the next decade. The Royals have control of James Shields for two years.

Myers will be making the major league minimum, more or less, for the next three years. Shields will get paid $10.5 million in 2013, and the Royals have an option for him at $12 million in 2014.

That’s the most inexplicable part of this trade — that a team that plays in a tiny market, whose owner has a history of (to be kind) penuriousness, and who has already indicated that they’ve reached their payroll cap, would trade a potential star making minimum wage for a pitcher who earns eight figures in each of the next two seasons. You can’t simply evaluate this trade by comparing Myers to Shields — you have to compare what the Royals could have done with Myers and all that money they’re going to spend on Shields. For $22 million over the next two seasons, the Royals could sign Shaun Marcum. They could come close to signing Edwin Jackson. Hell, Brandon McCarthy, who can’t stay healthy but who has a 3.29 ERA over the past two years, just signed with the Diamondbacks for two years and $15.5 million.

James Shields makes the Royals’ rotation much better in 2013. But so would a lot of pitchers who would have signed for the money Kansas City is committing to him. The difference between Shields and any of those pitchers amounts to one more win in 2013, two at the most. And all they would have cost is money — not one of the best prospects in baseball.

Wade Davis, the other pitcher the Royals acquired, may also help their rotation in 2013, which says more about the state of their rotation than about him. Davis was a marginal starter for Tampa Bay in 2010 and 2011, primarily because he couldn’t put batters away. He struck out only 5.6 batters per nine innings, well below average. The Rays had the depth in their rotation to move Davis to the bullpen for 2012, and there he improved dramatically — his fastball velocity jumped from 91.8 mph to 93.7 mph, his slider was sharper, and his strikeout rate literally doubled to 11.1 per nine innings.

Davis can be a dominant reliever, but the Royals have a stacked bullpen, and they have announced that Davis will go into spring training with a chance to reestablish himself in the rotation. Given that their bullpen is stacked, this is a rare glimpse of wisdom in the insanity that is this deal. If Davis can maintain his extra juice, he would be a very valuable no. 3 starter — particularly since Davis is signed to a contract that gives the Royals club options to keep him at a reasonable salary through 2017.

It’s unlikely that this trade will work out for the Royals, but if it does, Davis — not Shields — will be the key to the trade. And if the Royals traded six-plus years of Wil Myers for seven combined years of control of Shields and Davis, this would almost be a fair deal. It would still favor the Rays, given that Myers is years away from making serious money, while Shields and Davis are already making it. But at least it wouldn’t be Grand Theft Farm System.

Ah, but the Royals also threw in three other prospects!

Jake Odorizzi, whom the Royals acquired when they traded Zack Greinke two years ago, is a major league–ready starter with four average to above-average pitches. In 145 innings between Double-A and Triple-A, he struck out 135, walked 50, and had a 3.03 ERA. He’s probably not more than a no. 3 starter in the end, but he’s already a finished prospect — you don’t have to dream on him. He was ranked the no. 69 prospect by Baseball America two years ago, the no. 68 prospect last year, and will probably be in that range again. Basically, he’s Wade Davis, only four years younger and with three years’ less service time.

Mike Montgomery was one of the best left-handed pitchers in the minors two years ago, back when everything was coming up 7’s for the Royals. Even a year ago, he was ranked above Myers as the Royals’ best prospect, thanks to a fastball in the mid-90s and an excellent changeup. He has mysteriously lost the ability to get hitters out, however, with an ERA over 5 in the minors in each of the past two seasons. He’s a lottery ticket for Tampa Bay, but one that could pay off very, very big.

Patrick Leonard just turned 20 years old, and he hit 14 homers in 62 games in rookie ball this year. He could be just about anything. He’s not a top prospect, and probably never will be, but he’s just the safety-deposit box the Rays snatched up on their way out of the bank vault.

So if you want to read this trade as charitably as possible from the Royals’ perspective, you can say that they almost got fair value for Wil Myers … and then flushed Odorizzi, Montgomery, and Leonard down the toilet.

It’s a terrible trade, and for it to work out at all for the Royals, they have to go to the playoffs next season. If they do, then the tradeoff might be worth it, the way it was for the Milwaukee Brewers two years ago when they traded Brett Lawrie for Shaun Marcum, and four young players for Zack Greinke.

But as they’re presently constructed, the Royals still aren’t good enough to win the AL Central. Their top four starters, none of whom were with the team as recently as July, are Shields, Jeremy Guthrie, Ervin Santana, and Davis. Aside from Shields, that’s a lot of league-average talent. If they’re going to the playoffs, their offense will have to carry them there.

Only here’s the thing: The Royals’ offense was worse than their pitching staff last season. Thanks to their fine bullpen, the Royals ranked 10th in the AL in runs allowed in 2012. They ranked 12th in runs scored.

If the Royals do make the playoffs in 2013, it will be because their offense took a huge step forward. It will be because Eric Hosmer, who struggled to hit .232/.304/.359 as a sophomore, returns to being the Will Clark clone that everyone expects him to be. It will be because Salvador Perez doesn’t get hurt and miss half the season, and because Mike Moustakas improves his batting average, and — most of all — because the Royals get production out of right field.

By making this trade, the Royals gave away the most obvious source of an offensive upgrade. There is no better example of robbing Peter to pay Paul.

There is also no better example of moral hazard, the term that applies to the dangers of having a decision maker (like, say, a GM) whose self-interests are not aligned with those he’s making decisions for (like, say, a baseball team). Prior to this trade, the Royals were well set up to win 85-90 games in 2014, when a wave of pitching talent in their farm system was expected to catch up with the hitters who have already arrived. They seemed poised to be competitive through the rest of the decade. Wil Myers would have been in the middle of their lineup the entire time.

But winning 90 games in 2014 does Dayton Moore no good if the Royals struggle again in 2013, because after six consecutive losing seasons to start Moore’s tenure, a seventh in 2013 would probably mean he’d be out of a job. This trade hurts the Royals significantly in the long term, but it might help Moore keep his job in the short term.

If the Royals reach the postseason in 2013, ending the longest playoff drought in American sports, Moore will keep his job, and he might even deserve to. It was the work of his front office that led the Royals to draft players like Myers in the first place. Even if Moore gutted his farm system for a playoff appearance, by Kansas City standards that qualifies as an unbridled success.

And if they don’t win, well, at least there won’t be any doubt about whom to blame. It’s not owner David Glass, not with the Royals poised to have a payroll north of $80 million. Moore didn’t just push all his chips into the pot — he pushed in his job security as well. If his gamble fails, and if it turns out that Moore sacrificed the Royals’ future for an illusory present, Royals fans can only hope that someone else will be able to pick up the pieces.