{"id":6629,"date":"2022-08-30T20:54:44","date_gmt":"2022-08-31T00:54:44","guid":{"rendered":"http:\/\/cryptocornercafe.com\/cafe\/?p=6629"},"modified":"2022-08-30T20:54:44","modified_gmt":"2022-08-31T00:54:44","slug":"how-a-solana-based-dex-bricked-itself-locking-500k-in-funds","status":"publish","type":"post","link":"http:\/\/cryptocornercafe.com\/cafe\/2022\/08\/30\/how-a-solana-based-dex-bricked-itself-locking-500k-in-funds\/","title":{"rendered":"How A Solana-Based DEX Bricked Itself, Locking $500K+ In Funds"},"content":{"rendered":"<p>It\u2019s not easy being a dev. In recent days, a young Solana-based DEX, OptiFi, faced an unexpected downfall after a simple coding error. The platform <a href=\"https:\/\/twitter.com\/OptifiLabs\/status\/1564367455220219904?s=20&amp;t=5jBBKmYWteCYn5quAPB3FA\">released an announcement<\/a> that their mainnet program is now unrecoverable yesterday. The move has resulted in an unexpected shutdown for the DEX.<\/p>\n<p>Let\u2019s review what we know from the announcement and how something like this could be avoided in the future.<\/p>\n<p>OptiFi\u2019s Unexpected Shutdown<\/p>\n<p>OptiFi was an options and derivatives focused decentralized exchange (DEX) built on Solana that was less than a year in the making. The platform touted Solana\u2019s low latency transactions, portfolio margining and partial liquidation mechanisms. The platform also brought the \u201cfirst-ever delta-neutral options AMM vault\u201d on Solana that provided yield to depositors. So how did we get here? According to OptiFi\u2019s <a href=\"https:\/\/medium.com\/@OptiFi\/optifi-program-incident-report-08-29-22-d8fe6d229bad\">full debrief<\/a>, a code update that was moving to Solana mainnet saw a user error that resulted in the use of a \u2018solana program close\u2019 command, locking roughly $660K worth of USDC in OptiFi-stored funds in their AMM vault.<\/p>\n<p>OptiFi has assured that user funds will be compensated (while noting that a large majority of the funds are from an internal team member), and a proposal on the <a href=\"https:\/\/github.com\/solana-labs\/solana\/pull\/27108\">Solana github<\/a> is currently active to address the matter. OptiFi notes in their debrief of a \u201clesson we learned harshly:\u201d<\/p>\n<p>EVERY DEPLOYMENT NEEDS A RIGOROUS PROCESS AND SINGLE POINT FAILURE CAN BE AVOIDED. PLEASE\u00a0DON\u2019T RUSH LIKE WHAT WE DID, ESPECIALLY FOR DEFI PROJECTS.<\/p>\n\n<p>Solana (SOL) has been an emerging player in NFTs and DeFi, despite occasional setbacks like this recent OptiFi debacle. | Source: <a href=\"https:\/\/www.tradingview.com\/chart\/?symbol=COINBASE%3ASOLUSD\" target=\"_blank\" rel=\"noopener\">SOL-USD on TradingView.com<\/a><\/p>\n<p>Is It Still Solana Season?<\/p>\n<p>Despite small network setbacks, Solana has still seen strong strides this year in both DeFi and NFT marketplaces. Across NFTs, Solana-based projects like DeGods and Okay Bears, among others, have helped spurred the network to a strangehold of the #2 spot (behind only top dog Ethereum). In the more relevant DeFi, Solana has largely outperformed last year to date metrics, according to <a href=\"https:\/\/defillama.com\/chain\/Solana?currency=SOL\">DeFiLlama.<\/a> This has been spurred by growing products like Solend, Serum and more. DeFiLlama has Solana listed as the #6 chain in order of total value locked (TVL), at just over $1B worth of funds.<\/p>\n<p>Building and shipping products is rarely a small task, and this is no exception. It hurts to see ecosystem products, regardless of chain, fall to seemingly small errors, but it unfortunately is a byproduct of this world. Our team extends best wishes to the OptiFi builders as they move forward.<\/p>\n<p>Featured image from Pexels, Charts from TradingView.com<br \/>\nThe writer of this content is not associated or affiliated with any of the parties mentioned in this article. This is not financial advice.<\/p>","protected":false},"excerpt":{"rendered":"<p><!-- wp:html --><\/p>\n<p>It\u2019s not easy being a dev. In recent days, a young Solana-based DEX, OptiFi, faced an unexpected downfall after a simple coding error. The platform <a href=\"https:\/\/twitter.com\/OptifiLabs\/status\/1564367455220219904?s=20&amp;t=5jBBKmYWteCYn5quAPB3FA\">released an announcement<\/a> that their mainnet program is now unrecoverable yesterday. The move has resulted in an unexpected shutdown for the DEX.<\/p>\n<p>Let\u2019s review what we know from the announcement and how something like this could be avoided in the future.<\/p>\n<p>OptiFi\u2019s Unexpected Shutdown<\/p>\n<p>OptiFi was an options and derivatives focused decentralized exchange (DEX) built on Solana that was less than a year in the making. The platform touted Solana\u2019s low latency transactions, portfolio margining and partial liquidation mechanisms. The platform also brought the \u201cfirst-ever delta-neutral options AMM vault\u201d on Solana that provided yield to depositors. So how did we get here? According to OptiFi\u2019s <a href=\"https:\/\/medium.com\/@OptiFi\/optifi-program-incident-report-08-29-22-d8fe6d229bad\">full debrief<\/a>, a code update that was moving to Solana mainnet saw a user error that resulted in the use of a \u2018solana program close\u2019 command, locking roughly $660K worth of USDC in OptiFi-stored funds in their AMM vault.<\/p>\n<p>OptiFi has assured that user funds will be compensated (while noting that a large majority of the funds are from an internal team member), and a proposal on the <a href=\"https:\/\/github.com\/solana-labs\/solana\/pull\/27108\">Solana github<\/a> is currently active to address the matter. OptiFi notes in their debrief of a \u201clesson we learned harshly:\u201d<\/p>\n<p>EVERY DEPLOYMENT NEEDS A RIGOROUS PROCESS AND SINGLE POINT FAILURE CAN BE AVOIDED. PLEASE\u00a0DON\u2019T RUSH LIKE WHAT WE DID, ESPECIALLY FOR DEFI PROJECTS.<\/p>\n<p>Solana (SOL) has been an emerging player in NFTs and DeFi, despite occasional setbacks like this recent OptiFi debacle. | Source: <a href=\"https:\/\/www.tradingview.com\/chart\/?symbol=COINBASE%3ASOLUSD\" target=\"_blank\" rel=\"noopener\">SOL-USD on TradingView.com<\/a><\/p>\n<p>Is It Still Solana Season?<\/p>\n<p>Despite small network setbacks, Solana has still seen strong strides this year in both DeFi and NFT marketplaces. Across NFTs, Solana-based projects like DeGods and Okay Bears, among others, have helped spurred the network to a strangehold of the #2 spot (behind only top dog Ethereum). In the more relevant DeFi, Solana has largely outperformed last year to date metrics, according to <a href=\"https:\/\/defillama.com\/chain\/Solana?currency=SOL\">DeFiLlama.<\/a> This has been spurred by growing products like Solend, Serum and more. DeFiLlama has Solana listed as the #6 chain in order of total value locked (TVL), at just over $1B worth of funds.<\/p>\n<p>Building and shipping products is rarely a small task, and this is no exception. It hurts to see ecosystem products, regardless of chain, fall to seemingly small errors, but it unfortunately is a byproduct of this world. Our team extends best wishes to the OptiFi builders as they move forward.<\/p>\n<p>Featured image from Pexels, Charts from TradingView.com<br \/>\nThe writer of this content is not associated or affiliated with any of the parties mentioned in this article. This is not financial advice.<\/p>\n<p><!-- \/wp:html --><\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"colormag_page_layout":"default_layout","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[82],"tags":[],"class_list":["post-6629","post","type-post","status-publish","format-standard","hentry","category-blockchain"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"http:\/\/cryptocornercafe.com\/cafe\/wp-json\/wp\/v2\/posts\/6629","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/cryptocornercafe.com\/cafe\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/cryptocornercafe.com\/cafe\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"http:\/\/cryptocornercafe.com\/cafe\/wp-json\/wp\/v2\/comments?post=6629"}],"version-history":[{"count":0,"href":"http:\/\/cryptocornercafe.com\/cafe\/wp-json\/wp\/v2\/posts\/6629\/revisions"}],"wp:attachment":[{"href":"http:\/\/cryptocornercafe.com\/cafe\/wp-json\/wp\/v2\/media?parent=6629"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/cryptocornercafe.com\/cafe\/wp-json\/wp\/v2\/categories?post=6629"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/cryptocornercafe.com\/cafe\/wp-json\/wp\/v2\/tags?post=6629"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}