Barclays has been ordered to return an estimated 297m dollars to a Black Diamond Capital Management unit after being found liable of breaching a derivatives agreement with the hedge fund.The fund's BDC Finance LLC filed a lawsuit against Barclays in 2008, alleging the bank had defaulted on a $40m collateral call.Barclays, however, insisted that it only owed $5m after which Black Diamond declared the lender in default. A New York state appeals court ruled in favour of the hedge fund on Thursday, saying that Barclays breached the contract by failing to make the $5m payment on time or follow the contract's procedures for disputing the collateral call which required the bank to pay the full $40m."The evidence in the record undeniably shows that Barclays failed to pay the undisputed amount by the deadline, and establishes as a matter of law that Barclays did not comply with the (contract's) dispute resolution process," the three-judge majority wrote.The court said Black Diamond had the right to terminate the contract and demand a return of its entire collateral, which the fund has estimated at $297m.Barclays said it was considering an appeal against the ruling, which would go to New York's highest court, the Court of Appeals.The British lender has been trying to repair its reputation in the wake of a number of scandals including a fine for LIBOR rigging and a controversial fundraising from Qatari investors in 2008.RD