Despite his jersey not even being on sale for the first several weeks of the 2011-2012 NBA season, Jeremy Lin ranked just behind the Chicago Bulls point guard Derrick Rose in terms of replica sales by the close of the regular season. Products from marijuana to milkshakes were named after Lin as he became a full-blown media sensation during the winter months.

Oh, he was also pretty good at basketball until a knee injury prematurely ended his season, leading the Knicks on a mid-season resurgence and posting all sorts of impressive numbers over the first several starts of his career.

For all of the reasons above, the Houston Rockets have reportedly offered the 23-year-old point guard out of Harvard a four-year contract worth nearly $30 million.

As was initially reported by Jonathan Feigen of the Houston Chronicle and Adrian Wojnarowski of Yahoo! Sports, Lin and the Rockets agreed to these terms. Due to Lin's status as a restricted free agent, the Knicks will have three days from the signing of the offer sheet -- which cannot be done until July 11th -- to match the offer.

While the consensus seems to be that the Knicks will indeed match the offer to keep Lin there are certainly lingering questions about his ability to sustain his performance -- and Linsanity -- over an entire season.

Before Lin and the Rockets settled on those terms, the Knicks reportedly agreed to a free agent contract with veteran point guard Jason Kidd. Of course, that deal only came about after the Knicks' bid for Steve Nash came up empty.

On Wednesday, the Los Angeles Lakers swooped in for Nash, one of four prized point guards on the free agent market, along with Kidd, Lin and Deron Williams. After Williams agreed to re-sign with the Brooklyn Nets, the suitors for the remaining high-end lead guards have moved quickly.

More From The Associated Press:

HOUSTON - A person with knowledge of the deal said Thursday that New York Knicks restricted free-agent guard Jeremy Lin and the Houston Rockets have agreed to terms on a four-year contract offer.

The person told The Associated Press on Thursday on condition of anonymity because the team hadn't officially announced the deal.

Lin can sign the offer sheet with Houston on July 11, and the Knicks will then have three days to match the offer.

The Knicks have repeatedly said that they plan to keep Lin.

The contract is worth $10.2 million over the first two seasons and $9.3 million in each of the last two years. The fourth season is a team option.

The person also told the AP that the Rockets traded Kyle Lowry to Toronto on Thursday for a future first-round draft pick with lottery protection and forward Gary Forbes. Lowry averaged 14.3 points and 6.6 assists in 47 games for Houston last season.

The Rockets had Lin in training camp, but waived him because they had already had Lowry and Goran Dragic on their roster. Now that they've traded Lowry, and with Dragic headed to Phoenix, Houston is trying to get Lin back.

Lin was claimed by the Knicks after the Rockets let him go and soon became New York's starting point guard and "Linsanity" ensued.

He averaged 14.6 points, 6.2 assists and 3.1 rebounds in 35 games with 25 starts before his season was cut short because of surgery to repair torn cartilage in his knee.

Lin, who went undrafted out of Harvard, became a sensation with a remarkable stretch in February where he scored at least 20 points in nine of 10 games. A high point of that span came when he scored 38 points with seven assists in a 92-85 win over the Lakers on Feb. 10.

The Rockets are already popular in Asia because of the career of former star Yao Ming, who retired in 2011. With Yao's retirement, Lin could add to their appeal there as the first American-born player of Chinese or Taiwanese decent.

____

AP Sports Writer Chris Duncan contributed to this report.