The Raptors and Pacers are swapping free-agent small forward C.J. Miles and point guard Cory Joseph, with Miles going to Toronto via a sign-and-trade and Joseph on his way to Indiana, ESPN.com reports.

Miles will ink a three-year, $25 million contract.

The deal is contingent upon the finalization of the previously-reported trade that will send DeMarre Carroll from Toronto to the Nets.

The Raptors’ hole at small forward opened by the Carroll trade will be filled by a combination of Miles and Norman Powell, according to the ESPN report. A 12-year NBA veteran, Miles averaged 23.4 minutes and 10.7 points per game last season, shooting 41.3 percent from 3-point range.

Replacing Carroll, whose due to make $30 million over the next two seasons, with Miles’ more economical contract should keep the Raps out of luxury-tax territory.

READ MORE: JUSTIN GAETHJE TKOS MICHAEL JOHNSON IN POTENTIAL FIGHT OF THE YEAR AT THE ULTIMATE FIGHTER 25 FINALE

For the Pacers, the consistent and defensively-solid Joseph fits with their plan to rebuild after trading Paul George to Oklahoma City, ESPN notes.