By game time Wednesday, Cole Hamels should still be a Phillie -- and a fabulously wealthy one at that. (US Presswire)

The guys the Phillies want to keep, they find a way to keep.

They wanted to keep Cole Hamels.

Sure enough, Hamels is close to signing a new contract that will keep him off the trade market, and off this winter's free-agent market. John Boggs, Hamels' agent, was on a late-night flight from San Diego to Philadelphia to finalize and announce the new deal, sources told CBSSports.com's Scott Miller late Tuesday.

Foxsports.com's Ken Rosenthal, who first reported that a deal was close, said the new contract will be for more than $137.5 million over six years, making it the second-largest deal ever given to a starting pitcher. CBSSports.com's Jon Heyman had reported earlier Tuesday that the Phillies had come up from their original offer to Hamels, which was believed to be for $127.5 million over six years, and that there was progress in the talks.

The news of Hamels' signing shouldn't have a huge impact on the trade market, because in recent days there had already been a feeling that Hamels was more likely than not to re-sign. It could leave the Brewers' Zack Greinke as the unquestioned gem of the July pitching market, but with the possibility that the Marlins could deal Josh Johnson and the Rays could deal James Shields, even that isn't as clear.

For Hamels, who grew up in San Diego but was originally drafted and signed by the Phillies, the deal gives him a chance to play his entire career with the organization. Hamels has said that matters to him, and cited growing up as a Padre fan following Tony Gwynn (who never played for another team).

Hamels had always said he preferred to remain in Philadelphia, but he also said that the prospect of free agency was intriguing, because it allowed a player to find out how the market valued his skills. While Hamels' contract will be seen as a very fair deal for him (it's for more money than Matt Cain signed for earlier this season), we'll never know (and he'll never know) if a team like the Dodgers would have offered him even more than that on the free-agent market.

For the Phillies, signing Hamels was seen as crucial, because at 28 he's by far the youngest member of a top-of-the rotation trio that also includes 35-year-old Roy Halladay and 33-year-old Cliff Lee.

The Phillies could look to trade Lee (the Rangers have some interest), but some in the organization believe they're more likely to simply keep their strong rotation together as they try to win next year. Also, after back-to-back comeback wins over the Brewers, the Phillies may once again begin thinking that they can make a miracle comeback into this year's pennant race.

It's still possible that the Phillies could trade other players, such as center fielder Shane Victorino or left fielder Juan Pierre. Victorino isn't expected to be back next season, in any case, as the Phillies have made little or no effort to sign him and keep him away from free agency.

And with the Phillies, it's usually quite clear who they really want to keep. They didn't really want to keep Jayson Werth, and he left. They really did want to keep Ryan Howard, and despite predictions that he would never sign, he did, when they offered him a huge contract ($125 million for five years).

The Phillies wanted to keep Jimmy Rollins, too. Rollins did get to free agency, but eventually the Phillies gave him $33 million over three years, and he stayed.

There were dire predictions in some circles that they would never sign Hamels, and that they would have no choice but to trade him. But as Heyman wrote all the way back when Hamels reported for spring training this year, the smart money was always on the Phillies finding a way to keep him.

And they have.