The Miami Heat pulled a shocker in 2017 NBA free agency by agreeing to terms with big man Kelly Olynyk, formerly of the Boston Celtics. We grade the move.

While everyone awaited news on a potential James Johnson re-signing, the Miami Heat pulled a fast one by agreeing to terms with power forward Kelly Olynyk, acquiring him from unrestricted free agency.

The news was first reported by none other than Adrian Wojnarowski of ESPN.

Prior to Thursday, there had been literally zero scuttle pairing Miami with its newest player. In fact, it almost felt like people forgot Olynyk was even on the market.

The Gonzaga product was originally a restricted free agent, but that changed on Tuesday after the Boston Celtics got a verbal commitment from Gordon Hayward — thus forcing them to renounce his rights. Pat Riley and co. took the opportunity to pounce on a player who is barely 26 years old and is coming off his best year, efficiency-wise.

What’s more, the fit between Olynyk and Miami is perfect. He can space the floor from the 4-spot next to Hassan Whiteside and play small-ball center with reserve units as Bam Adebayo comes along.

In 2016-17, the seven-footer averaged 9.0 points, 4.8 rebounds, 2.0 assists and 0.9 threes per game on .512/.354/.732 shooting splits. His effective field goal percentage was a career-high 57.9 percent.

Another factor that makes Miami and Olynyk compatible is the fact that the Heat are second in the NBA in threes attempted from the corners — one of the most efficient shots in basketball. Olynyk’s percentage from that area?

Kelly Olynyk is a career 51% 3-point shooter from the corners — Rillie Weed (@cch1125) July 7, 2017

It also probably didn’t hurt that the long-haired big man made a solid impression in the 2017 NBA Playoffs. In a pivotal Game 7 against the Washington Wizards, Olynyk dropped 26 points on 10-of-14 shooting, along with two threes and four dimes.

His ball-handling and perimeter abilities couldn’t be stymied by Washington’s big men, and his 14-point fourth quarter put the nail in the coffin for the series.

Olynyk’s offensive versatility makes him the exact type of big Erik Spoelstra covets. Imagine a small-ball lineup featuring Justise Winslow (a very underrated distributor), James Johnson and Olynyk in the frontcourt. Almost every single opposing team will have problems slowing them down with traditional bigs on the floor.

The one main talking point that came up once the deal was reported regarded its gargantuan size. After all, four years and $50 million (with a player option after the third year) is a huge commitment.

Nevertheless, his age, fit within Spoelstra’s system and upside (the Heat do have a tendency of getting the most out of their signings) make the deal well worth it — especially as the Heat prepare to dump Josh McRoberts on the Dallas Mavericks to clear more cap space for re-signing James Johnson.

Heat plan to send McRoberts and a future second round pick to Dallas for A.J. Hammons, league sources tell The Vertical. https://t.co/OJY3sDiB4q — Shams Charania (@ShamsCharania) July 7, 2017

Think of it this way: Miami will soon turn Chris Bosh into two versatile power forwards in Olynyk and Johnson. (Now if they could only morph into one and become a player as good as Bosh, the Heat would be set.)

All jokes aside, it’s a big investment, but a better one for Miami than Rudy Gay — who came to terms with the San Antonio Spurs on a two-year, $17 million deal as soon as word of Olynyk’s agreement went out — would’ve been.

Do I wish Miami’s deal with the former Celtic was for two years instead of four? Sure. But I also understand the reality of today’s market — versatile, young bigs like Olynynk get paid. The Heat needed a stretch-4 and they got one.

Grade: B-