Matt Barnes has agreed to a two-year deal to join the Raptors.

The deal, which is scheduled to be finalized on Tuesday, will pay Barnes nearly $10 million over the next two seasons, according to sources close to the process.

A sign-and-trade will be necessary because Toronto recently spent the bulk of its $5.8 million mid-level exception to sign Linas Kleiza.