I'm sure McAvoy could probably get $10-11 on the open market, but $9M would put him at an 11% cap hit %, which is around top 5 for defensemen. The guys getting that much had all been Norris finalists when they signed their deals, which McAvoy hasn't yet.
I think you could comp him to Hedman, who was a #1 defenseman when he signed his extension, but hadn't yet broken out into the perennial Norris finalist/end of season all star that he is now. Hedman got 8 years at a 10.8% cap hit %. The same deal at an $81.5M cap would be $8.8M.
There is zero reason McAvoy shouldn't be signed to a deal like that on July 28th when free agency starts and he's eligible for a 2022 extension.