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