Danny Ainge finally made a trade, and now he’s getting killed. The guy can’t win.

The Boston Celtics are sending Isaiah Thomas, Jae Crowder, Ante Zizic and the Brooklyn Nets’ unprotected 2018 first-round pick to the Cleveland Cavaliers. The Cavs are sending back Kyrie Irving.

For Boston, the trade means giving up the the last year of Isaiah’s bargain deal, plus the four seasons of additional surplus value (or cheap labor) created by the Brooklyn draft pick’s rookie deal. To put another way, the Celtics are paying to supercharge that draft pick, essentially turning it from an unknown quantity — in terms of both pick range and player quality — into a proven star. This comes with some downside: Getting an All-Star or All-NBA player on a below-market rookie deal is how modern superteams are made — just ask the Warriors. But given the team’s larger context, the trade doesn’t mortgage Boston’s future, it insures it.

At the star level, a Thomas-for-Irving deal is close to an even swap. The two players share skill sets (scoring off the dribble, creating separation for pull-ups, historically bad defense) and both are likely to earn max deals when their deals are up. But Thomas, 28, is three years older and (at least) 6 inches shorter than Irving, 25. Thomas is also on the final year of his deal, which pays him about $6 million this season. Irving has two seasons remaining on his deal before he can opt out, and he’ll make about $19 million this season and $20 million the next.

The Celtics’ ceiling for the 2017-18 season isn’t necessarily higher today than it was Tuesday morning, and their ceiling four or five seasons out, once the player drafted with the Brooklyn pick has matured, is undeniably diminished.

But the worst-case scenarios are now off the table. The Celtics have done away with the risk of losing Thomas (leaving his crucial bucket-making role vacant) for nothing in free agency or close to nothing in a last-minute trade. Maxing out a 29-year-old 5-foot-9 scoring guard would have been a massive risk, and it would have been difficult to find a trade partner other than Cleveland. Contending teams that need a guard with Thomas’s skill set and can offer something in return are rare — practically nonexistent, actually, until Irving requested a trade. And while the Celtics do lose the surplus value they would have gotten from adding a future star on a rookie deal, here’s the crucial thing to remember: Irving is likely better than the player they’d draft with Brooklyn’s pick.

We’d expect a player picked first overall to produce almost 35 win shares over his first five seasons, and a player selected between second and fifth overall will probably produce between 20 and 25:

Irving produced 31.4 in those seasons — a bit less than the average No. 1 overall pick (though his rookie season was shortened by the 2011-12 lockout), but better than the average second through fifth pick. He also did it while missing 85 games over those 5 seasons. That’s concerning in its own way, but it shows you Irving’s ability to fill it up when he’s on the floor. It’s far from certain that the Brooklyn pick will turn out to be No. 1 overall now that the team is no longer openly tanking, and even if the Nets do turn out to be the worst team in the league, their pick would only have a 25 percent chance of being No. 1. So the Celtics lose out on the early, below-market years of an uncertain draft pick, but they get a player entering his prime whose early seasons were better than those of most top draft picks. Irving’s $136 million projected value over the next five years, according to CARMELO, isn’t All-NBA-level, but it’s a solid baseline for a team that needed a new point guard.

Boston was ridiculed earlier this summer for passing on Markelle Fultz, who was taken with the No. 1 overall pick that the Celtics traded to the Philadelphia 76ers. But Fultz’s strengths mirror Irving’s — pull-up jump shooting, pick-and-roll scoring — and remain hypothetical in an NBA setting. The Sixers would be thrilled if Fultz turns out to be as good as Irving. And while Fultz projects to produce like a superstar, there’s almost no chance he plays at Irving’s level this season, which happens to be Al Horford’s age-31 season and Gordon Hayward’s age-27 one. If the Celtics lost Thomas in free agency after next season, leaving them with no ready replacement for his star-level perimeter shot-making while they waited for Jaylen Brown and draftee Jayson Tatum to turn into star performers, they risked taking a step backward during what should be a prime year for their two big free-agent acquisitions.

The argument for holding onto assets is that there’s a better chance to “keep the window open.” But that cuts both ways. A season lost at the front end or in the middle of the contention window is just as damaging as one lost at the end.

Besides, Ainge’s Assets — a stockpile that he’s been building since the infamous Kevin Garnett trade with Brooklyn in 2013 — have been a running joke going back to the days when Kevin Love was a rumored Boston target. He spent the last year targeting All-NBA wings Jimmy Butler and Paul George but declined to include premium assets such as the exact draft pick he just sent to Cleveland. Seeing him now pull the trigger on Irving, a very good player who isn’t quite Butler or George, makes for good meme fodder, sure. Butler and George both went for cheap, but both also went for packages that catered specifically to the teams dealing them (the Bulls really like Kris Dunn, and new Pacer Victor Oladipo played his college ball at Indiana). It’s not really clear what kind of offer it would have taken to move Chicago or Indiana off those deals and keep their stars in the East.

It was important for Ainge to find a deal sooner rather than later. Butler, George and Irving all signed their contracts before the salary cap spiked thanks to the influx of money from a new TV deal. This makes them far easier to trade than star players typically are because their salaries are easier to fit onto their new team’s roster and their original teams have to take back less money that’s tied to inferior players. If the Celtics hadn’t found a suitable place to spend their assets by the time the pre-TV deals had expired, they would have had a difficult time fitting a new star under the cap without also dealing away a star already on their payroll.

Questions remain, including how good the Celtics’ defense can be after they shipped out Avery Bradley this offseason and are now sending Crowder to the Cavs, but these are mundane tactical concerns. Boston’s big, existential unrest finally seems to have come to an end. The Celtics’ core is more or less set. Now they have to actually play the games.