The 76ers just got their perimeter defender.

The Sixers will acquire James Ennis from the Houston Rockets in exchange for the right to swap second-round picks in the 2021 draft, according to a league source. The Sixers waived Malachi Richardson one day after acquiring him to make room for the 6-foot-7, 210-pounder.

Ennis averaged 7.4 points, 2.8 rebounds and 23 minutes in 39 games with 25 starts this season for the Rockets. The 28-year-old, who can small forward and shooting guard, is a solid defender and will bolster the Sixers struggling perimeter defense. The reserve will also provide much-needed depth.

The Ventura, Calif., native is shooting 50 percent from the field and 37 percent on three-pointers. Ennis is making $1.6 million this season and has a player option for $1.8 million next season.

He was the 50th overall pick by the Atlanta Hawks in the 2013 NBA draft. The Hawks traded him the Miami Heat on draft night. He’s also had stops with the New Orleans Pelicans, Memphis Grizzlies and Detroit Pistons.

On Wednesday, the Sixers acquired Tobias Harris, Boban Marjanovic and Mike Scott from the Los Angeles Clippers in exchange for rookie guard Landry Shamet, veterans Wilson Chandler and Mike Muscala, and four draft picks: a protected 2020 first-rounder, the Miami Heat’s 2021 first-rounder, a Detroit Pistons 2021 second-rounder, and the Pistons’ 2023 second-rounder. (The 2020 pick is lottery protected for three years. Afterward, it will turn into two second-round picks – one in 2023 and one in 2024.)

In a separate deal, Philly picked up Richardson from the Toronto Raptors along with their 2022 second-round pick and the draft rights to swingman Emir Preldzic for cash considerations. The shooting guard was aware that he could be traded or waived depending on who the team would be able to acquire.