Sources said that the Mavericks and Ellis have agreed to terms on a three-year deal that — depending on where Dallas’ ends up in terms of salary-cap space as it works on a number of deals — could rise to as high as $30 million.

The deal, at the minimum, will be in the $25 million range, sources said. Ellis joins point guard Jose Calderon and former Mavericks guard Devin Harris as free-agent signees in Dallas’ overhauled backcourt.

Dallas whiffed on Dwight Howard, their biggest target this summer, and shied away from Andrew Bynum (who ended up in Cleveland.) They turned their focus instead on guard play. Monta Ellis was the biggest name left on the free agent board.

After opting out of his deal with the Milwaukee Bucks, Ellis brings career averages of 19.4 points and 4.7 assists to Texas.