OptiFi Accidental Shutdown Command: Difference between revisions
No edit summary |
No edit summary |
||
| Line 5: | Line 5: | ||
This is a global/international case not involving a specific country. | This is a global/international case not involving a specific country. | ||
Unattributed | Unattributed sources: <ref name="reddit-10622" /><ref name="futurism-10623" /><ref name="coindesk-10624" /><ref name="solanaexplorer-10625" /><ref name="solanaexplorer-10626" /><ref name="optifilabstwitter-10627" /><ref name="optifilabstwitter-10628" /><ref name="defillama-10629" /><ref name="youtube-10630" /><ref name="optifiapparchive-10631" /><ref name="halborn-10632" /><ref name="solana-10633" /> | ||
== About OptiFi == | == About OptiFi == | ||
Revision as of 14:27, 27 March 2023
Notice: This page is a freshly imported case study from the original repository. The original content was in a different format, and may not have relevant information for all sections. Please help restructure the content by moving information from the 'About' and 'General Prevention' sections to other sections, and add any missing information or sources you can find. If you are new here, please read General Tutorial on Wikis or Anatomy of a Case Study for help getting started.
Notice: This page contains sources which are not attributed to any text. The unattributed sources follow the initial description. Please assist by visiting each source, reviewing the content, and placing that reference next to any text it can be used to support. Feel free to add any information that you come across which isn't present already. Sources which don't contain any relevant information can be removed. Broken links can be replaced with versions from the Internet Archive. See General Tutorial on Wikis, Anatomy of a Case Study, and/or Citing Your Sources Guide for additional information. Thanks for your help!
OptiFi was a DEX service which sought to process more transactions, optimize the liquidation process, and enable more liquidity in markets. On August 29th, the developers made a mistake and permanently closed down their smart contract, with the entire market coming to an end and a reported $661k worth of funds being locked in the smart contract.
This is a global/international case not involving a specific country. Unattributed sources: [1][2][3][4][5][6][7][8][9][10][11][12]
About OptiFi
"OptiFi is the first derivative DEX utilizing "Portfolio Margin" across all financial instruments with the same underlying asset.
We see there are three main problems with derivative DEXes: Lack of high performance blockchain infrastructure; Inefficient margining and collateral system designs; Not enough liquidity on the order book.
To combat these problems, OptiFi is built on Solana and Serum to offer low cost and high-speed execution.
Utilizes portfolio margin and partial liquidation to enhance capital efficiency, and offers the first ever on-chain options AMM with delta-neutral strategy to ensure continuous liquidity across all financial instruments on OptiFi.
Unlike typical margin requirements that set margins independent from each instrument, Portfolio Margin takes all instruments with the same underlying asset into account, and nets them against one another, creating lower margin requirements and offsets risks for the user."
"Derivatives-focused decentralized finance (DeFi) platform OptiFi accidentally closed its mainnet platform in a programming blunder, locking away $661,000 in USDC."
"On August 29, the company says one of its developers was trying to update the program on the Solana blockchain and accidentally used a command that shutting the whole thing down in one fell swoop."
"On 29th August around 06:00 UTC, we had an update to our Solana program code, so our deployer tried to upgrade the OptiFi program on Solana mainnet." "At 06:07 UTC - The command line was executed successfully and the OptiFi program was closed."
That means over half a million dollars worth of USDC are now "not recoverable at the moment of writing," according to the blog post.
"We sincerely apologize for a program incident leading to the sudden closure of the OptiFi mainnet program and we could not recover it," the company's blog post on the blunder reads. "We will compensate all users’ funds and prevent it from happening again."
"We promise that we will return all users’ deposits and settle all user positions manually according to Pyth oracle at 8 AM Sep 2nd UTC. All transactions and deposits will be based on Solscan. The estimated process time will be two weeks."
"In a tweet, OptiFi said that 95% of total value locked is from one of its team members, meaning that customer asset may equate to only $33,000."
"We didn’t realize that the program was closed permanently until the error above showed up. It’s basically saying that our deployed program has been closed and cannot be re-deployed, unless a new program id is used."
"Here it turned out that we didn’t really understand the impact and risk of this closing program command line. ‘solana program close’ is actually for closing the program permanently and sending the SOL tokens in the buffer account used by the program back to the recipient wallet."
"ALL the users’ margin accounts USDC tokens, option tokens, and AMMs USDC vaults are locked in where they are, because they are using PDAs, which are bound to optFiKjQpoQ3PvacwnFWaPUAqXCETMJSz2sz8HwPe9B."
"We suggest Solana officials add the warning regarding the irrecoverable result of closing a program in Solana Docs and Command-Line Interface (CLI) to help Solana devs understand the function."
This is a global/international case not involving a specific country.
The background of the exchange platform, service, or individuals involved, as it would have been seen or understood at the time of the events.
Include:
- Known history of when and how the service was started.
- What problems does the company or service claim to solve?
- What marketing materials were used by the firm or business?
- Audits performed, and excerpts that may have been included.
- Business registration documents shown (fake or legitimate).
- How were people recruited to participate?
- Public warnings and announcements prior to the event.
Don't Include:
- Any wording which directly states or implies that the business is/was illegitimate, or that a vulnerability existed.
- Anything that wasn't reasonably knowable at the time of the event.
There could be more than one section here. If the same platform is involved with multiple incidents, then it can be linked to a main article page.
The Reality
This sections is included if a case involved deception or information that was unknown at the time. Examples include:
- When the service was actually started (if different than the "official story").
- Who actually ran a service and their own personal history.
- How the service was structured behind the scenes. (For example, there was no "trading bot".)
- Details of what audits reported and how vulnerabilities were missed during auditing.
What Happened
The specific events of the loss and how it came about. What actually happened to cause the loss and some of the events leading up to it.
| Date | Event | Description |
|---|---|---|
| August 29th, 2022 12:07:00 AM MDT | Smart Contract Shut Down | The transaction is performed which shut down the OptiFi smart contract. |
Total Amount Lost
The total amount lost has been estimated at $661,000 USD.
How much was lost and how was it calculated? If there are conflicting reports, which are accurate and where does the discrepancy lie?
Immediate Reactions
How did the various parties involved (firm, platform, management, and/or affected individual(s)) deal with the events? Were services shut down? Were announcements made? Were groups formed?
Ultimate Outcome
What was the end result? Was any investigation done? Were any individuals prosecuted? Was there a lawsuit? Was any tracing done?
Total Amount Recovered
There do not appear to have been any funds recovered in this case.
What funds were recovered? What funds were reimbursed for those affected users?
Ongoing Developments
What parts of this case are still remaining to be concluded?
General Prevention Policies
The best prevention strategy surrounds the usage of multi-signature on all key decision points.
In addition, having a greater review of the smart contract would likely have identified that funds could be locked up permanently in the event of the protocol closing down.
Individual Prevention Policies
No specific policies for individual prevention have yet been identified in this case.
For the full list of how to protect your funds as an individual, check our Prevention Policies for Individuals guide.
Platform Prevention Policies
Policies for platforms to take to prevent this situation have not yet been selected in this case.
For the full list of how to protect your funds as a financial service, check our Prevention Policies for Platforms guide.
Regulatory Prevention Policies
No specific regulatory policies have yet been identified in this case.
For the full list of regulatory policies that can prevent loss, check our Prevention Policies for Regulators guide.
References
- ↑ Reddit - Dive into anything (Sep 2, 2022)
- ↑ Crypto Dev Enters Wrong Command, Destroys Entire Company (Mar 27, 2023)
- ↑ Solana-Based DeFi Protocol OptiFi Loses $661K in Programming Blunder (Mar 27, 2023)
- ↑ Explorer | Solana (Mar 27, 2023)
- ↑ Explorer | Solana (Mar 27, 2023)
- ↑ @OptifiLabs Twitter (Mar 27, 2023)
- ↑ @OptifiLabs Twitter (Mar 27, 2023)
- ↑ OptiFi: TVL and Stats - DefiLlama (Mar 27, 2023)
- ↑ OptiFi - a BIG leap forward in DeFi - YouTube (Mar 27, 2023)
- ↑ https://web.archive.org/web/20220830225235/https://www.optifi.app/ (Mar 27, 2023)
- ↑ Explained: The OptiFi Glitch (August 2022) (Mar 27, 2023)
- ↑ Solana | OptiFi (Mar 27, 2023)