The Toronto Raptors reached an agreement on a contract extension with forward DeMar DeRozan ahead of Wednesday's midnight deadline, sources told ESPN.com.

DeRozan has agreed to the structure of a deal that would pay him $40 million over the next four years, plus incentives. It is expected the contract will be finalized after the Raptors play the Indiana Pacers in their season opener.

A league source told ESPN The Magazine's Chris Broussard the incentive bonuses could push the overall value of the deal to $46 million.

The athletic DeRozan averaged 16.7 points and 3.3 rebounds for the Raptors last season and has been one of the cornerstones of the franchise's rebuilding project over the past two years.