The world's largest banks are racing to meet a U.S. and Japanese deadline next month when billions of dollars in new collateral requirements will begin to hit the over-the-counter derivatives market.

Firms are testing systems for exchanging collateral for the trades, signing new legal documents and pursuing regulatory approval for models that could help blunt the cost of compliance, according to lawyers, executives and consultants helping firms meet one of the biggest changes in decades to the swaps market. In the U.S. and Japan, swap-dealing divisions of banks including JPMorgan Chase & Co., Morgan Stanley and Citigroup will have to start complying with the rules Sept. 1. The European Union, Singapore, Hong Kong and Australia have announced delays.

The hundreds of pages of restrictions are the result of years of deliberation by regulators around the world after the financial crisis when risk built up directly between traders. Global regulators estimate that the rules could eventually require more than $790 billion in cash, government bonds and other forms of collateral to protect against the threat that the default of one trader spreads risk to others and potentially throughout the financial system.

“This has been on the horizon for a while,” said Deepak Sitlani, a London-based partner at Linklaters LLP law firm.

The Bank for International Settlements puts the size of the over-the-counter derivatives market at $493 trillion as of the end of last year. U.S. regulators said firms would eventually need about $315 billion in initial margin to meet the requirements.

The actual cost of financing collateral would be smaller, though the U.S. Federal Reserve has said it could still cost banks billions of dollars.