(Adds detail on settlement from Genesis and Gemini, adds background about Genesis bankruptcy filing and SEC investigation)

Feb 6 (Reuters) - Bankrupt crypto lender Genesis has reached an agreement in principle on a restructuring plan supported by its parent company, Digital Currency Group, and its primary creditors, including Gemini, an attorney for the company said on Monday.

Genesis attorney Sean O'Neal told a U.S. bankruptcy judge during a Monday court hearing that the company is finalizing a restructuring agreement that would either result in a sale of Genesis or turn over its equity to creditors.

The agreement was supported by Gemini, which worked with Genesis on a program called Gemini Earn that attracted $900 million in deposits from 340,000 users. Genesis froze withdrawals from the program in November 2022, sparking a conflict between Genesis' parent company Digital Currency Group and Gemini co-founders Cameron and Tyler Winklevoss.

Under the new restructuring agreement, Gemini will contribute up to $100 million to compensate Earn users with frozen assets.

Gemini attorney Anson Frelinghuysen said in court the agreement will ensure a "substantial recovery" for Gemini Earn users.

"Gemini views this as a critical step toward undoing the harm that Gemini users have suffered over the past few months," Frelinghuysen said.

Genesis filed for bankruptcy on Jan. 20, owing least $3.4 billion to creditors.

Several crypto companies have been under pressure while navigating unprecedented industry-wide turmoil as investor appetite for digital assets has waned after major exchange FTX blew up late last year.

Last month, Genesis – which brokers digital assets for financial institutions such as hedge funds and asset managers – cut 30% of its workforce in a second round of layoffs in less than six months, according to a person familiar with the matter.

DCG, owned by Barry Silbert, owns a portfolio of crypto companies in addition to Genesis, including crypto news and events site CoinDesk and New York-based Grayscale, a major digital asset manager. Those companies are not bankrupt.

The week before Genesis filed for bankruptcy, the U.S. Securities and Exchange Commission charged Genesis and Gemini with illegally selling unregistered securities through their Gemini Earn lending product.

(Reporting by Jaiveer Shekhawat in Bengaluru and Dietrich Knauth in New York; Editing by Krishna Chandra Eluri, Lisa Shumaker and Josie Kao)