Online game developer Zynga extended newly hired CEO Don Mattrick, previously head of Microsoft’s Xbox biz, a compensation package potentially worth more than $50 million in cash and stock over the next three years.

Zynga, best known for the FarmVille games on Facebook, has faced a steep decline in users and revenue. Last month, it laid off 520 employees, or 18% of its workforce, which it said would result in pretax savings of up to $80 million per year.

The social games company is counting on Mattrick to turn things around. Zynga disclosed details of Mattrick’s pay package in a filing Wednesday with the Securities and Exchange Commission.

SEE ALSO: Don Mattrick Leaves Microsoft’s Xbox for Zynga

Mattrick, 49, had run Microsoft’s Interactive Entertainment Business Group — overseeing Xbox game consoles and related businesses — since October 2010. Before joining Microsoft in July 2007, he spent 15 years at game developer Electronic Arts, which acquired Mattrick’s Distinctive Software in 1991.

According to Zynga’s filing, Mattrick will receive an annual base salary of $1 million plus a guaranteed minimum bonus of $2 million in his first year of employment. In addition, the company is granting him a one-time signing bonus of $5 million as well as $11.3 million in vested Zynga stock to compensate Mattrick for the Microsoft shares he is losing.

In his second year at Zynga, Mattrick will receive $14 million in cash and stock if he hits performance targets, and $9 million in year three. He’s also eligible for additional performance-based stock grants worth $7 million.

The value of the stock grants are based on Zynga’s June 26 closing stock price of $2.80 per share. Following company’s announcement of Mattrick’s hire, stock price has increased more than 20% from last week to close at $3.42 Wednesday — making Mattrick’s comp package worth even more for the time being.

Mattrick, who officially starts at Zynga on July 8, also will join the executive committee of the board. His employment agreement has no specified term. Former Zynga CEO Mark Pincus will become chief product officer and will continue to serve as chairman.

Zynga also disclosed that Owen Van Natta, formerly exec VP of business, resigned from the board. Van Natta will receive acceleration of vesting of 375,000 unvested restricted shares under his previous award.

For Microsoft, Mattrick’s departure comes as it gears up to ship the next-generation Xbox One in November. Yusuf Mehdi, senior VP of Xbox marketing and strategy, is expected to play a larger role in running the game division.