Shares of Tesla have doubled in price over the past three months, paving the way for a massive payday for CEO Elon Musk.

In 2018, Tesla's board and shareholders authorized an unparalleled compensation plan for Musk, allowing him to earn options worth potentially more than $55 billion over the next decade. Musk currently draws no salary, although he owns around 20% of the company.

Musk would earn the first tranche if Tesla's market capitalization hits and stays at $100 billion. Given the current number of shares outstanding, that means Tesla's stock would have to hit $554.81, based on FactSet. At that price, the options would be worth around $346 million.

Tesla stock closed Tuesday up 2.5% to $537.92.

Musk doesn't suddenly get paid when Tesla's stock hits $554.81, though.

According to a regulatory filing, Tesla's market cap must stay high enough to be worth $100 billion on both a 30-day and six-month trailing average. The company must also hit annual revenue or EBITDA milestones at the same time in order for Musk to get that first tranche. The company would need to report either trailing-four-quarter revenue of $20 billion or EBITDA (minus stock-based compensation) of $1.5 billion.

The compensation plan is facing a court challenge.

Tesla stockholder Richard Tornetta sued Musk and members of Tesla's board of directors in a Delaware Chancery Court, alleging that the award is excessive, and the board's vote to give it to him amounts to a breach of fiduciary duty.