The Giants have agreed to a four-year, $62 million contract with free-agent closer Mark Melancon, sources told ESPN's Buster Olney.

The agreement is pending a physical, which the right-hander is currently going through for the Giants, the sources said.