Edmonton, Alberta — The Oilers paid a huge price to lock up star captain Connor McDavid. It could have been even higher.

The Oilers and McDavid agreed to an eight-year, $100-million extension.

That makes McDavid, a 20-year-old league MVP, the highest-paid player in the NHL on an annual basis ($12.5 million per season), but it’s about $750,000 a year less than what reports last week figured he would be getting.

“It easily could have been a lot higher in value and shorter in term,” Oilers general manager Peter Chiarelli said.

McDavid’s extension kicks in after he finishes the final year of his entry-level deal next season. If the NHL’s salary cap stays at $75 million, McDavid’s salary alone would take up 16.6 percent of the Oilers’ cap.

But any cap relief would be welcome to Edmonton. The Oilers are also working to re-sign Leon Draisaitl, who is a restricted free agent after finishing his entry-level deal and due a big raise.

“Part of this partnership was talking about building a team, and Connor was emphatic as was I about keeping this team competitive,” Chiarelli said.

“There are challenges at every juncture when you are building a winning team in the salary cap era. Connor recognizes that, Jeff Jackson (McDavid’s agent) recognizes that and we’re confident we’ll be able to ice a winning team, one that can contend and win the Cup.”

McDavid led the NHL in scoring with 100 points last season, en route to winning the Hart Trophy as league MVP. In just his second season he helped the Oilers transition from league doormat to a potential contender in the Western Conference.

Edmonton made the playoffs for the first time in a decade.

“I’m so excited to be able to wear the Oilers jersey for the next nine years of my life and play with some of the greatest guys that I know,” said McDavid, the No. 1 overall pick in 2015. “I can’t wait to get back at it.

“I wanted to show that I’m in it for the long haul, and I want to win here.”

Ice chips

The Rangers re-signed restricted free-agent forward Jesper Fast (three years, $5.5M) and signed free-agent center David Desharnais (one year, $1M).

... The Ducks signed goalie Reto Berra to a one-year contract.

... The Wild re-signed restricted free agent defenseman Zach Palmquist to a two-way contract worth $726,000 in the NHL.