From $160 to $0.7. How did the control token of a brand new DeFi protocol explode in value before completely collapsing just 2 days later? An error in one line of code in a smart contract determined the fate of the launch of Yam Finance. Let’s start at the beginning.
Setting the stage
Yam Finance is a decentralized finance (DeFi) project that combined various features of other DeFi projects, including an elastic supply inspired by Ampleforth, a distribution system similar to Yearn Finance, and a Compound Finance-based management protocol. Essentially, Yam Finance is a protocol where people can borrow and lend crypto-assets without having to go through a middleman.
The attractiveness of DeFi projects mainly resides in what has now become popular as yield farming. Getting 2% interest on your USDC deposits is lucrative enough by itself, but adding what is essentially free money to every transaction makes DeFi irresistible. This free money comes in the form of management tokens, i.e. tokens used to send the project through voting. The more popular a DeFi project is, the more the value of its management tokens becomes, especially when they are scarce in circulation. And that’s what yield farming is – traders earn on interest rates and management tokens using their digital asset holdings. This is passive income at its best. But, and this is a big but, DeFi is quite risky.
Now, in the case of Yam Finance, the driving license is aptly named YAM. With a total supply set at 5 million tokens, scheduled to be released in two waves, and no percentage pre-mined, the yield farming potential of the protocol was understandably FOMO-inducing. In less than 24 hours after launch, the protocol already managed almost $600 million in assets. But it didn’t last long.
A 48-hour DeFi frenzy
YAM starts
The protocol starts with a total supply of 5,000,000 YAM and a rebase period of 12 hours (08:00 and 20:00 UTC). A major selling point was the fact that no tokens were minted for founders, team or investors.
The protocol launched with 8 supported pools: COMP, LEND, LINK, MKR, SNX, WETH, YFI and ETH/AMPL Uniswap v2 liquidity pool, with 250,000 YAM initially allocated to each pool.
In the launch announcement, the founders noted that no formal audits had been performed on the protocol and that it was a “10-day project from inception to launch,” leading to criticism from people immune to hype.
Almost $600 million deposited in the protocol
In less than 24 hours after launch, YAM Finance already manages about $580 million in crypto assets.
YAM price skyrockets
The protocol’s proof-of-governance is skyrocketing in valuation as the DeFi ecosystem explodes in popularity. Major crypto publications spread the success of the project, further fueling the price period. At its peak, YAM reportedly reached $167.
The bug
A bug is discovered which ultimately leads to the downfall of the project. The error itself was just a simple error and was found in the rebase function of the contract.
What should have been totalSupply = initSupply.mul(yamsScalingFactor).div(BASE);wastotalSupply = initSupply.mul(yamsScalingFactor);.
Unfortunately, this was enough to render the protocol’s management function unusable. The problem was that too many YAM tokens were held in reserve compared to the portion controlled by people. So any proposal will never pass as the required majority vote could not possibly be achieved. A DeFi project that cannot be managed is as good as dead.
YAM crashes
In response to the discovered error, it took only 6 hours for the price of YAM to fall from its $160 peak to the now-new $14 all-time low.
Troubleshooting
Founders of the project indicate a possible solution, if it can be implemented before the second rebasing. Hope is kept alive for about 10 hours as the price of YAM stabilizes around the $14 mark.
The Fix failed
A management proposal is submitted by founding members in an attempt to resolve the issue. It is soon discovered that “the rebaser error would interact with the management module”, preventing the proposal from succeeding.
YAM collapses
Brock Elmore, co-founder of Yam Finance, announces the failure to resolve the issue, resulting in YAM’s market cap collapsing completely. From $14 it drops to less than $1 in 2 hours.
A New Hope
As Yam Finance collapsed, it became apparent that there was something special about the project. People were still working and trying to figure out a way to save it from its impending doom, while YAM was on its way to ground zero. A plan was presented to the community, where the migration to the new version would take place in two consecutive steps, this time with audited code:
Phase 1 – YAM holders burn their tokens via a smart contract and receive YAMv2 tokens in return. The contract used for this process was by Peckshield Inc. audited. At this point, the protocol will not have chain management. Instead, off-chain signature voting will be used. Phase 2 – YAMv3 is deployed, allowing YAMv2 holders to exchange their obsolete tokens for the new YAMv3 tokens via a new contract, which will again be audited. On-chain management is restored.
Almost $115,000 was raised from 28 contributors on Gitcoin Grants, resulting in a substantial budget for auditing. At 16:20 UTC on August 19, Phase 1 of the migration plan was executed. The old YAM token has become worthless, while the new YAMv2 token has regained a lot of value – currently trading at around $17.
At this point, the plan is to wait until Phase 2 of the migration plan is fully audited and then proceed with deployment. No date has yet been set for the launch of YAMv3, but judging by the short history of the project, it probably won’t take long.
Disclaimer for Uncirculars, with a Touch of Personality:
While we love diving into the exciting world of crypto here at Uncirculars, remember that this post, and all our content, is purely for your information and exploration. Think of it as your crypto compass, pointing you in the right direction to do your own research and make informed decisions.
No legal, tax, investment, or financial advice should be inferred from these pixels. We’re not fortune tellers or stockbrokers, just passionate crypto enthusiasts sharing our knowledge.
And just like that rollercoaster ride in your favorite DeFi protocol, past performance isn’t a guarantee of future thrills. The value of crypto assets can be as unpredictable as a moon landing, so buckle up and do your due diligence before taking the plunge.
Ultimately, any crypto adventure you embark on is yours alone. We’re just happy to be your crypto companion, cheering you on from the sidelines (and maybe sharing some snacks along the way). So research, explore, and remember, with a little knowledge and a lot of curiosity, you can navigate the crypto cosmos like a pro!
UnCirculars – Cutting through the noise, delivering unbiased crypto news