New Jersey has terminated all of its interest rate swap agreements under Governor Chris Christie, paying banks $720 million to unravel $4.2 billion of swaps and wiping from its books a potentially big, unpredictable liquidity risk.

The derivative deals, which states and cities use to lower financing costs by hedging interest rate changes, have caused financial turmoil for some, most recently Detroit and Chicago. The deals either soured when rates did not move as expected or led to big termination fees triggered by credit rating downgrades.

In New Jersey, another credit cut would likely have left some of its debt just one notch above the level that would trigger swap termination payments. The state has suffered nine downgrades during Christie's tenure and is at risk of another because of its underfunded public pensions and financial weakness.

The full cost of terminating all the swaps has not previously been reported. New Jersey Treasury spokesman Christopher Santarelli provided the figure when asked about the state's exit from swaps as of June 30, which was included in a bond document this week.

Swaps "have been considered to be toxic by market participants and the administration. The state saw an opportunity to clean up its balance sheet and did so," Santarelli said in an e-mail.

New Jersey and its state bonding entities had $4.2 billion of outstanding swaps when Christie, a 2016 Republican presidential candidate, took office in 2010.

Over time, the agreements were whittled down, leaving the New Jersey Economic Development Authority (NJEDA), one of the state's biggest public debt issuers, with $1.15 billion of remaining swaps.

The NJEDA has now unwound those swaps with eight different counterparties as of June 30, it said this week in a document for investors ahead of a $2.2 billion bond sale on Aug. 31.

Swaps helped push Detroit into the largest U.S. municipal bankruptcy in 2013. Detroit entered swaps on pension debt it sold in 2005 and 2006, but the city's bet that interest rates would rise proved wrong. Instead they fell, and so did the city's bond ratings.

In February, Moody's Investors Service cut Chicago's credit rating to Baa2, a level that allowed banks to cancel certain swaps. The city then had to renegotiate the deals to avoid $60 million of termination fees. Moody's again downgraded Chicago in May, this time to junk status.

Detroit and Chicago "are recent reminders for municipalities to make sure they... completely understand their swap agreements," said Dan Heckman, senior fixed income strategist at U.S. Bank Wealth Management, which has a small amount of New Jersey debt.

"New Jersey and others are looking at this to make sure that there's nothing that could come up and bite them," he said.

In NJEDA's case, a downgrade to Baa2 would have allowed counterparties to terminate the swaps. They could then either force NJEDA to make termination payments or allow it to make collateral payments to keep the deals alive, according to bond documents.

About $54 million of the proceeds of the $2.2 billion Aug. 31 bond sale will be used to pay part of NJEDA's swap terminations, Moody's said. The rest will fund school construction projects and refund outstanding debt.

Borrowing to pay off a portion of the swaps means the state added to its long term costs to get out of its position, said Lisa Washburn, a managing director at Municipal Market Analytics.

"They're trading a potential short-term liquidity risk for a long-term obligation," she said.

Still, by ending swaps, New Jersey "put itself in the driver's seat," she said. "It eliminates the potential liquidity call if the swap should be terminated at a time when New Jersey doesn't have the cash to do so."

Fitch Ratings on Tuesday revised its outlook to stable from negative on New Jersey, saying "near-term budget risks have abated."