San Francisco 49ers quarterback Jimmy Garoppolo signed a five-year, $137.5 million contract this week, and naturally there are plenty of people questioning the sanity of giving that much money to a player with seven career starts.

We broke down the terms of the contract, first revealed by Adam Schefter. Garoppolo gets $42.6 million this coming season, and $61.2 million over the first two years of the contract. He has $48.7 million of this deal fully guaranteed, and an additional $25.4 million guaranteed for injury.

The 49ers had to commit a lot up front, but after the first two years, it effectively becomes a year-to-year contract. If the 49ers release Garoppolo after the 2019 season, they would carry $4.2 million in dead money, and save $22.4 million in cap space. If they release him after the 2020 season, they would carry $2.8 million in dead money, and save $24.1 million in cap space. If they release him after the 2021 season, they would carry $1.4 million in dead money, and save $25.6 million in cap space.

We talked the other day about how this deal is a gamble for the 49ers, but one that makes sense. Kyle Shanahan, John Lynch, and Jed York all talked about the importance of locking down a potential franchise quarterback. They all agreed on the fact that if you think you have that guy, you are going to have to pay the piper.

$61.2 million is a whole lot of cheddar for two years of potentially mediocre play, but that’s the economics of betting on a franchise quarterback works. If Garoppolo doesn’t work out, the 49ers will be back to square one at the position, but they will not have created a future hole for themselves like we see other teams do.

It’s a pricey first two years, but if it pans out, the 49ers will be in good shape. If Garoppolo continues to prove to be the team’s answer at quarterback, we’ll see this deal restructured multiple times. But the 49ers and Paraag Marathe have already proven their adeptness at properly structuring the deal.