Orlando Magic forward Franz Wagner has agreed to a five-year, $224 million rookie contract extension — a deal that could go as high as $269 million, sources told ESPN on Friday.

Sources said Wagner is eligible to earn 30% of the team’s salary cap if selected to the All-NBA team. Wagner’s agent, Jason Glushon, completed work on the deal over the July 4 holiday, sources said.

Wagner averaged 19.7 points, 5.3 rebounds and 3.7 assists last season as Orlando returned to Eastern Conference play and won 47-35, becoming the cornerstone of the Magic’s revival.

He joined Shaquille O’Neal, Dwight Howard and Tracy McGrady in scoring at least 4,000 points before his 23rd birthday, making a historic start to his Magic career, according to ESPN Stats & Information.

Wagner, the No. 8 pick out of Michigan in 2021, had seven 30-point games last season and ranked in the top 10 in rebounds and dunks, according to Second Spectrum.

Wagner, whose brother Moe, agreed to a two-year, $22 million deal with Orlando on Tuesday and is considered the best player to come out of Germany since Hall of Famer Dirk Nowitzki.