Solana-based Decentralized exchange (SOL) OptiFi mistakenly shut down its program on August 29 causing permanent losses of $661,000.
OptiFi's program has been closed by mistakes we made.
1. We accidentally closed the OptiFi mainnet program and it's not recoverable
2. 661k USDC is locked in the PDAs, luckily 95% of the fund is from our team member
3. We will compensate for all users’ funds
— OptiFi (@OptifiLabs) August 29, 2022
According to the exchange’s announcement, the error occurred at around 06:00 UTC when its implementer tried to upgrade his program on the Solana mainnet.
How OptiFi closes its program
The team explained that the implementer was trying to upgrade the OptiFi program using the anchor protocol. However, this process takes longer than usual, possibly due to network congestion.
The implementer canceled this anchor protocol upgrade before receiving a response. Meanwhile, the process created an unused buffer account with a balance of 17.2023808 SOL.
Therefore, the deployer tried to close this buffer account to regain its balance before continuing to upgrade the main network.
However, the implementer inadvertently permanently closed the main program instead of closing the buffer account.
According to the team, this person used the “Solana closure program” without fully understanding the impact of this action.
Feedback from a Solana core developer indicates that they will not be able to redeploy their program with the previous program ID.
OptiFi revealed that it has permanently lost access to the $661,000 locked in the contract.
OptiFi says 95% of the funds belong to team members.
However, all margin accounts of USDC token users, options tokens, and USDC AMM that are tied to the program have been lost.
The unit plans to make up for all lost user funds while adding more stringent measures to avoid a repeat in the future.
The OptiFi team also advised Solana to add a description to the Solana document to warn about the results of the program closure and suggested adding two-step validation to run the “Solana closed program” command.