"It's a very convenient agreement for both parties," said the source Friday night on condition of anonymity. "Hanley secures his financial future and the Marlins secure one of the most complete players in baseball for a relatively good price."
The contract will be finalized after Ramirez passes the customary physical.
An official announcement is expected to come as early as next week, according to Florida media reports.
The Marlins have a $21 million payroll this season. Ramirez's extension is the biggest contract in franchise history.
"We have something, but we're working out the details," Ramirez told ESPNdeportes.com on Friday. "We'll have good news very soon."
When reporters approached Ramirez before Saturday's game against Washington, he smiled, laughed and waved.
"No comment, no comment," he said.
Ramirez would have been eligible for arbitration after this season and would likely have earned a significant pay raise. He was National League Rookie of the Year in 2006 and hit .332 last season with 52 stolen bases and 212 hits last season -- second only to NL MVP runner-up Matt Holliday.
As of Saturday morning, he was hitting .336 with eight home runs and 21 RBIs in 35 games.
The Marlins, known as much for dealing away star players as they are for a pair of World Series championships, currently lead the National League East. The team is off to its best start in franchise history (21-14) despite its meager payroll. In fact, the Marlins' $22 million payroll is by far the smallest in the major leagues.
"As we get closer to the stadium, those things will change," owner Jeffrey Loria said in March.
The Marlins plan to build a new stadium on the site of the Orange Bowl in Miami's Little Havana district and locking up Ramirez long-term would give the team a bankable star with whom to open the new stadium in 2011 if all goes according to plan.
"When that happens, I think it's a good message to send for the organization, for the team, for the community," manager Fredi Gonzalez said before Saturday's game at Washington. "But nothing is set right now. It's all rumors."
Several other Marlins will become eligible for arbitration and substantial raises after this season, including second baseman Dan Uggla, left fielder Josh Willingham, first baseman Mike Jacobs and left-hander Scott Olsen.
"With the new stadium, we kind of figured they're going to make an effort to lock a few guys up," Uggla said. "They're starting with Hanley, and everybody's happy for Hanley. He's set for the rest of his life. Who knows what they're going to do now?
"I think it's a great move. He's going to be one of the best players in the game for a long time. He's a winner. It's really smart on their part."
The deal would be the team's first multiyear deal since 2005, when they signed Carlos Delgado to a four-year free-agent contract and Paul Lo Duca to a three-year extension. Both were later traded to the New York Mets. The team's previous richest contract was the six-year, $61 million deal signed by Gary Sheffield in April 1997.
Ramirez's contract would average $11.7 million a year. The Marlins' highest-paid player this season is closer Kevin Gregg at $2.5 million.
"He's going to be a superstar in this league for a lot of years," Nationals manager Manny Acta said after Ramirez scored twice and drove in a run Friday at Washington. "He can hit a home run. He can bunt and steal second and third and score on anything. He'll take a walk. He'll hit over .320, almost guaranteed. He can do everything he wants in the game."
Making such a commitment to Ramirez could give the Marlins a much-needed attendance boost, Willingham said.
"Fans want to be familiar with their players," Willingham said. "Somebody like him, to know he's going to be around to watch for that many years, will maybe get some more people in the stands."
The Associated Press contributed to this report.