Innovation and experimentation is the main theme of 2020 within the DeFi ecosystem. We are at the bleeding edge of the new technology, therefore new mechanisms and ways of optimizing yield are coming out every day. One needs to be proactively diligent in all the main channels to keep up to date day to day.
Although this is a great thing for the speed we are forward through the technology (r)evolution, it also does not leave time for proper audits and analysis of the code before new projects get tested by keen yield farmers.
Although, giving credit to the full transparency of the projects, they do state that we are in the experimental stage so to not expect everything to be in full working order, it was to be expected that a bug would arise sooner rather than later that halts an ecosystem.
YAM was an overnight success, with over $500k of stablecoins within its treasury in one day, and $400 million worth of DeFi tokens utilized for YAM farming; an unprecedented record start for any DeFi project.
Luckily, because the SNX staking contract had already been audited, those staking did not lose any money, where the vast majority of the money was. The only people affected were whales providing liquidity, which is highly risky for an experiment like this.
As you were able to stake DeFi tokens via the YAM Protocol such as $ETH, $YFI, $LINK, $LEND, $COMP, $MKR, $SNX & $AMPL, we saw price spikes for many of these coins over the day as people were jumping in to take advantage of yields.
Although the YAM token was only useful for governance, it reached up to $167 dollars somehow, before the bug appeared that broke the system.
So what happened?
YAM used a combination of well-audited contracts, from SNX for staking, COMP for governance, and AMP for rebasing (automatically changing the price, based on supply).
The issue came from changing the debasement formula in the AMP contract for the YAM token.
A maths error occurred, due to the frequency of the rebasement differences between YAM and AMP, whereby YAM rebased twice a day (and twice as often as AMP), leading to an over-creation of YAM.
This had a direct impact on the governance contract in COMP whereby it would not allow the establishment of a quorum, making governance of YAM now impossible. The utility and usability for the YAM token was lost as they had lost full control of the on-chain governance features, therefore breaking the system.