The San Francisco Giants and slugger Jorge Soler have agreed to a three-year contract worth $42 million, a source confirmed to ESPN.

The Giants have not officially announced the deal, which was first reported early Tuesday by the San Francisco Chronicle.

Soler could have stayed with the Miami Marlins under his previous contract, but he declined a $9 million player option — an easy choice after he hit 36 home runs and posted an Adjusted OPS+ of 128 last season while making his first career All-Star Game appearance.

As always with Soler, who will turn 32 later this month, there is a lot of swing-and-miss to go along with his power. In 870 games played over 10 seasons in the majors, he has 170 homers and 927 strikeouts.