Spencer Dinwiddie is coming off a stressful few days.

He agreed to a three-year contract with the Wizards last week, mere hours after NBA free agency began, but that was only the beginning of a process that lingered until mid-week. Washington had to work out a complicated sign-and-trade, which took two days, meaning 48 hours of tension for Dinwiddie. And he struggled to sleep through all of them.

“They were terrible. They were terrible,” Dinwiddie said in a recent conversation with The Athletic.

But after one of the most complex trades in NBA history, a five-team bonanza filled with salary cap eccentricities, Dinwiddie is finally a Wizard.

The trade, which was finalized Aug. 4, is a historic one for the salary cap geeks, a demographic that emphatically includes Dinwiddie. It’s the league’s first five-teamer since 2005. The Wizards were above the cap, so they couldn’t sign their future point guard outright. They would have to negotiate a sign-and-trade with his incumbent team, the Nets. But Brooklyn didn’t want to take back money, which only added more obstacles.

“The whole first day, I definitely followed it. I was pacing back and forth in the hotel that we were negotiating at,” Dinwiddie said. “Second day, a little bit more and then by the third day, it was like, ‘Bruh, I need to just take a nap.’ I gotta just get some sleep.”

His team negotiated an incentives-laden, three-year, $62 million contract and, to top it off, tossed in a $1 bonus if the Wizards win a championship. He says if they win a title, he wants his payout in pennies. Hopefully, he doesn’t spend them all on one thing. At first, Washington’s front office thought the title bonus was a joke. Once they realized it wasn’t, general manager Tommy Sheppard & Co. etched what must be the smallest incentive in NBA history into Dinwiddie’s deal.

None of this process was easy. The perfect ending was something idiosyncratically historic.

“I enjoyed the fact that I went from trying to securitize my contract and the NBA not liking it to them then embracing technology and me being an ambassador of NBA Top Shot to now being part of the most complicated trade in NBA history, where a bunch of people changed hands and all this stuff and now having the most unique bonus in my contract,” said Dinwiddie, who tried to tokenize his previous contract with the Nets.