Nobody saw it coming when the Oklahoma City Thunder selected Stanford forward Josh Huestis with the 29th overall pick in last month's draft.

Except, apparently, Josh Huestis.

As noted by Zach Lowe, Huestis and his agent, Mitchell Butler, had a prearranged agreement with the Thunder before the draft. The Thunder would take him with the No. 29 pick in the 2014 draft, but Huestis wouldn't sign his guaranteed rookie contract.

Darnell Mayberry of The Oklahoman laid out the parameters of the innovative agreement last week. Projected by all accounts to be a second-round pick, Huestis elected to become a bit of a draft pioneer, the NBA's first domestic draft-and-stash player. He would leave his rookie contract unsigned, a deal that would pay him somewhere between $750,000 and $900,000, to sign with the Thunder's D-League affiliate instead. Then in a year or two Huestis would, presumably, sign his rookie deal.

It was a clever idea by one of the most forward-thinking front offices in the league. Huestis isn't exactly NBA-ready, but he could potentially be a future replacement for Thabo Sefolosha, who signed with the Atlanta Hawks this offseason. By not signing him immediately, the Thunder aren't clogging a roster spot with a player they won't use and aren't eating up almost a million bucks of cap space on him. And better yet, it stops the clock on Huestis' rookie deal, which would have been only a year behind the one signed by Andre Roberson, a player with similar skills, last season.

Smart, right? The real question is this: Was all this legal, or is Sam Presti the NBA's Wolf of Wall Street?

A pre-draft arrangement like this isn't against the rules, as there are ample amounts of gray area within which to operate. But it's certainly against the spirit of the draft, as Tom Ziller of SB Nation notes. And because of it, one would think the National Basketball Players Association has some interest in this situation. On the surface of this is a first-round pick willingly giving up his guaranteed first-round rookie-scale deal, which locks him into roughly almost $2 million over the next two years and up to $5 million over the next five, for a $25,000 D-League contract.

Why would Huestis agree to this? Because of the potential guarantee of an NBA contract, and thereby bigger overall earnings. By all accounts, it was extremely unlikely that Huestis would be picked in the first round and find himself with a guaranteed deal. He was headed for the second round and was probably going to the D-League regardless. So instead of having to work himself into a future NBA deal, he's simply delaying it. In a roundabout way, it gave him control to pick the team he wanted, and presents him with something he likely wouldn't have otherwise had -- an actual NBA deal. Per his agent, Huestis had interest in doing this only with either the Thunder or Spurs. So think of it like a college grad who really wants to work at Google deciding to take an unpaid internship out of college, turning down a more lucrative offer with a company he didn't think he'd fit as well with.

Now, there are ample amounts of risk in this move for Huestis. What if he blows out his knee or has some kind of medical issue that derails his career? But there was also risk going the other way, getting picked by the wrong team in the second round and watching his career slip away for a shot at a $500,000 nonguaranteed contract.

Josh Huestis suited up for OKC in the Orlando Summer League. Is the D-League his next stop? Fernando Medina/NBAE via Getty

It's a complicated situation that might be a win-win for both the Thunder and Huestis, but there should be concern with the precedent it could set. Front offices are prone to deception. They promise players they'll select them in the first round if they leave college early. They tell them not to work out for other teams. They tell them they're going to take them no matter what, and then don't. With the way the Thunder operate, regardless of what happens, they're likely to uphold the agreement with Huestis. But would all 29 other teams? At some point, some prospect is sure to get burned.

This isn't the first time Presti persuaded a late first-round pick to work with him. Roberson, the 26th overall pick, signed his rookie deal at 80 percent of its worth last season, reducing the cap hit by a couple hundred thousand dollars. Again, savvy stuff from the Thunder, who are pinching every penny possible in order to avoid the luxury tax for as long as possible. But there's also the unseemly aspect of an organization pulling in almost $30 million in profit strong-arming prospects to take less money.

The obvious question: Why not just take Huestis in the second round if this was the plan? The Thunder didn't have a second-round pick until they bought No. 55 and selected Semaj Christon. Huestis was a surprise pick at 29 to start with, so unless there was a major concern of the Spurs snatching him at 30, why not trade that 29th pick to drop to 31 or 32 and snag Huestis at a spot where his contract wasn't guaranteed? That's what the Thunder did with Grant Jerrett last season and now he has a multiyear deal signed with the team. Problem is, the Thunder would've been rolling the dice on losing a player they liked to someone else. Second-round picks have their own value because the contracts aren't guaranteed. We can assume a team at 31-35 would've bit to move up to 29, but those teams may not have wanted a guaranteed rookie deal on their books either.

Plenty of first-round picks have opted not to sign their first-round deals. In all of those cases, though, they were international draft-and-stash moves, like Serge Ibaka, who stayed an extra season in Spain after being taken 24th overall. The difference between those type of moves and Huestis is that an international player is still making a hefty salary, certainly more than a D-Leaguer's $25,000 a year.

The real issue here isn't with the Thunder or Huestis, it's with the D-League-NBA relationship. The league desperately wants to grow its developmental ground, but with a lot of teams not owning their own affiliates outright and having a one-to-one relationship, there's not enough synergy or continuity. The Thunder have been on the forefront of utilizing their D-League team, but with backward roster restrictions in place, it creates the need to get creative.

The fixes are obvious. One, as Ziller pointed out, is to make a provisional 16th roster spot, one that doesn't count against your cap. Another is more complicated, but probably necessary anyway: Raise D-League wages. If the NBA wants the D-League to become more of a true minor league system, with teams utilizing it as an actual developmental tool, players would need to be able to earn legitimate money there. Probably never to the extent international guys do for CSKA Moscow or Besiktas or whoever, but at least provide a decent financial alternative.

The arrangement between the Thunder and Huestis is not breaking the rules, per se, and it's certainly an advantageous move for the Thunder to pull, and really, good for Huestis. Potentially.

But it could set a poor precedent and open a slippery slope as front offices try to manipulate the cap as much as possible, thereby hurting impressionable players desperate for an NBA contract. Remember: Chandler Parsons was a second-round pick, and after making a couple million dollars, just signed with the Mavericks for $46 million over three years. What the Thunder and Huestis have engineered all works in theory, so long as owners and front offices follow through. But nothing is guaranteed when it comes to this stuff. Well, except for first-round contracts. Or at least they were supposed to be.