Kirk Cousins surprised the league last year, performing well above expectations and guiding the Washington Redskins to the NFC East title. He failed, however, to convince the team he was worth a long-term deal, instead settling for a one-year salary of $19.953 million after the Redskins designated him as a nonexclusive franchise free agent in February.

Franchising Cousins posed risks for both sides. If Cousins played well in 2016, Washington would have to open its checkbook. If Cousins struggled, the franchise would be left with no viable solution at quarterback. If Cousins performed somewhere in the middle, the cost to keep him in 2017 would run $23.94 million via the franchise tag, and he’d certainly have interest on the free agent market that features Ryan Fitzpatrick, Case Keenum and Blaine Gabbert as the best options at the position — if the team let him get there.

The risk appears to have paid off for Cousins, who is performing like an above-average NFL quarterback this season and is about to get paid like one.

In the book “Crunching Numbers: An Inside Look At The Salary Cap And Negotiating Player Contracts,” authors Jason Fitzgerald and Vijay Natarajan highlight average per year, or APY, as one of the first things teams and agents look at when they wish to place a value on a player. Average per year is calculated by taking the contract value and dividing it by the number of years on the deal. A player’s APY doesn’t take into account actual cash payouts, but, according to Fitzgerald and Natarajan, it is important for agents to rank a player contract “as high as possible on the APY ranking scale.”

There are 11 players in the NFL on contracts with an APY in excess of $20 million. All are quarterbacks. The NFL’s 13 highest-paid players (by APY) are quarterbacks, as are 20 of the top 25. One of those is Brock Osweiler, who has to be public enemy No. 1 for the Redskins front office right now. His APY is $18 million, and, if you are Cousins’s representatives, has to represent the absolute floor for any contract negotiations.

Osweiler signed a four-year, $72 million contract with the Houston Texans as a free agent this past offseason after starting seven games for the Super Bowl champion Denver Broncos in 2015. He’s been anything but super this season. Heading into Week 11, Osweiler completed 58.6 percent of his passes for 1,818 yards and an 11-to-nine touchdown-to-interception ratio, resulting in a 74.1 passer rating. His passer rating drops to 38.8 under pressure, worse than an incomplete pass (39.6).

Cousins, on the other hand, has completed 67.2 percent of his passes for 3,091 yards and a 17-to-seven touchdown-to-interception ratio, producing a 98.8 passer rating in 2016, which drops to just 74.6 under pressure.

The advanced metrics show the same trend.

According to ESPN’s Total Quarterback Rating, Cousins (71 QBR) is the sixth best passer in the NFL this season. Osweiler (49.4 QBR) is No. 30 of 33 qualified passers. Football Outsiders has Cousins ranked No. 6 in Defense-adjusted Yards Above Replacement (plus-671). Osweiler ranks last (minus-438). The game charters at Pro Football Focus have Cousins ranked 16th of 29 passers playing at least half their team’s snaps. Osweiler is last at No. 29.

The disparity between Cousins and Osweiler is large enough to justify an $18 million per year floor, but Cousins and his representatives could also argue their passer deserves something closer to what Ryan Tannehill ($19.3 APY) is making.

Tannehill has completed 65.9 percent of his passes for 2,289 yards and a 12-to-eight touchdown-to-interception ratio, producing a 91.1 passer rating. ESPN’s QBR is less impressed, ranking Tannehill 27th overall. Football Outsiders also has him No. 27 and PFF is the most bullish at No. 16.

The ceiling for Cousins, meanwhile, is almost certainly the total money committed to Cam Newton. Newton, a three-time Pro Bowler and 2015 AP offensive player of the year, narrowly lost to the Broncos in Super Bowl 50 and carries an APY of $20.76 million. It would be near impossible for Cousins to convince any franchise he deserves a contract that exceeds the five-year, $103.8 million contract extension Newton signed with the Carolina Panthers.

With the overall average contract value pegged between $19 and $20 million per year — let’s call it $19.5 million for simplicity’s sake — we can now estimate the contract length.

Cousins is 28 years old, and, according to research done by FiveThirtyEight contributor Chase Stuart, could be considered to be in the prime of his career. ESPN’s Brian Burke found that franchise quarterbacks “see rapid improvement until a plateau beginning around age 26, and then a shallow decline beginning at age 29,” which supports this notion.

Signing Cousins to a four- or five-year deal would likely keep him in burgundy and gold for the most productive part of his NFL tenure, and would be in line with the deal signed by Osweiler. It would also be close to the five-year contracts inked by Andrew Luck and Tyrod Taylor this past offseason. The length of the contract sometimes has less to do with how long a quarterback is with the team, and more to do with getting guaranteed money prorated to lower the overall cap number. But giving a 28-year-old starting quarterback a four- or five-year deal wouldn’t raise an eyebrow. The final valuation, $78 million over four years or $97.5 million over five, might. Heck, it wasn’t too long ago experts were asking if Cousins was even worth a second-round pick in trade.

The remaining details, the deal’s structure and guaranteed money, are perhaps the least complicated of the whole process.

If the Redskins put another franchise tag on Cousins, he would make close to $24 million in cash in Year 1 of the contract. So my guess is any negotiations, at least from Cousins’s standpoint, would have to have at least that much guaranteed at signing. The total guaranteed money should equal around half the contract’s total value — which is not unreasonable considering Osweiller got 51.4 percent of his deal guaranteed. That equates to between $39 and $49 million guaranteed for Cousins, depending on term length.

The most likely scenario is the team goes with a five-year deal which has most, if not all, of the money guaranteed in the first three years of the contract. Three years would also coincide with how long Coach Jay Gruden has left on his deal with the Redskins. Handcuffing the coach to the quarterback isn’t unheard of, and it is exactly what the Patriots did with quarterback Tom Brady, Coach Bill Belichcik and Nick Caserio, the team’s director of player personnel. It also wouldn’t be the worst idea.

According to Football Outsiders’ Defense-adjusted Value Over Average, which measures a team’s efficiency by comparing success on every play to a league average based on situation and opponent, the Redskins offense has ranked in the top 10 three times since 2012, the year Robert Griffin III and Cousins were drafted. The first time they cracked the top 10 for DVOA was in their rookie season, a year in which Griffin was named offensive rookie of the year. The other two are 2015 and 2016, the years in which Cousins has been the full-time starter under Gruden.

Some experts, like the NFL’s Bucky Brooks, continue to argue that Cousins “is playing in the perfect scheme and surrounded by a supporting cast that makes it easy for him to shine as a trigger man.” Maybe, but perhaps this is just a good marriage between quarterback, coach and team — one the Redskins will have to pay to keep together.