Don Mattrick, the Microsoft exec in charge of Xbox who will be taking over as Zynga’s CEO on July 8, is getting a compensation package from the social-games company worth at least $50 million.

Mattrick will receive a one-time signing bonus of $5 million plus an annual base salary of $1 million, Zynga disclosed in a filing with the Securities and Exchange Commission.

In 2014, he’ll also be eligible for a bonus of up to 400 percent of his base salary.

In addition, he will receive $25 million in restricted stock, vesting over three years, designed to compensate Mattrick “for his forfeiture of compensation from his previous employer,” according to the SEC filing.

Also, he will receive $15 million in restricted stock and options vesting over five years.

Also, beginning in 2014, he will be eligible to receive even more restricted stock, largely based on his performance, worth about $7 million. Grants in subsequent years will be determined by a compensation committee, though Zynga notes in the filing that the target value of such awards will be about $7 million per year.

Microsoft, for whom Mattrick served as president of its Interactive Entertainment Business, has not disclosed how much Mattrick is receiving upon his departure.

Mattrick faces the challenge of turning around Zynga, which is suffering amid rising competition from upstarts such as King.com as well as a shift toward gaming on handheld devices.

He’s taking over as CEO from Mark Pincus, Zynga’s founder, who will remain chairman of the board and chief product officer.

Pincus lowered his 2013 salary to $1 in April.

His base pay was $300,000 in each of the two previous years, though his total compensation in 2011 reached $1.68 million after accounting for a $3,750 bonus and $1.37 million in life-insurance premiums.