A lawyer for large U.S. hedge funds owning Argentine bonds said his clients have nearly settled on a $5 billion deal with Argentina to end a 15-year-old dispute that has interfered with the South American nation’s efforts to end a debt crisis and gain a healthier footing in the world’s financial markets.

Attorney Matthew McGill revealed the status of the negotiations as he told the U.S. Court of Appeals for the Second Circuit in New York Wednesday that he fears the courts will spoil the deal by too quickly removing orders protecting the bondholders.