MEXICO CITY (Reuters) - Market volatility ahead of the U.S. election has given Mexico the chance to model how the Nov. 8 vote could affect banks and corporations, Finance Minister Jose Antonio Meade said on Friday, adding that the government was ready to act if needed.

The peso currency has been whiplashed by fears of victory for Republican candidate Donald Trump, who has vowed to build a massive southern border wall and threatened to ditch a trade deal with Mexico and Canada if he cannot recast it in the United States' favor.

"This (volatility) has given us the chance to not only model how banks, corporations and different economic variables are reacting, but to see it in real time with scenarios of great volatility," Meade told local radio.

Central Bank Governor Agustin Carstens said this week that Mexico was preparing a contingency plan for an "adverse" outcome in the U.S. presidential election.

Meade said it was important to have mechanisms in place to enable Mexico to cope with a "surprise" outcome.

In September, Mexico ordered its banks to carry out stress tests to evaluate the macroeconomic impact of a potential Trump victory. Mexico said its banks had performed well in the tests.

A win for Trump over Democratic opponent Hillary Clinton is expected to further pummel the peso and Mexico's stock market. In recent weeks, Clinton's lead over Trump has narrowed in public opinion polls.

Meade said the government had passed its 2017 budget and unveiled a business plan for state oil company Pemex before the election to build confidence in Mexico's economic stability.

He said the government was ready to act if Trump wins the election on Tuesday, but would not take measures in hurry.

"We are alert and we have instruments to act, depending on what we see," he said, without giving details on what type of measures Mexico could take.

Economists at 4Cast said possible actions by Carstens could include raising interest rates, supporting the peso with reserves and drawing down on a special International Monetary Fund flexible credit line.

(Reporting by Joanna Zuckerman Bernstein and Frank Jack Daniel; Editing by Jonathan Oatis)