Loading...

DeFi: What Can the Case of YAM Teach Us About Yield Farming?

Raphaël Tressieres
Raphaël Tressieres 18 September 2020

DeFi is the hottest newcomer to the burgeoning digital assets economy. With enormous growth in assets tied up in the system, it offers a tantalizing glimpse of high-reward investment.

But does the “rise of the degenerates” (as they call themselves) mean new opportunities, or a repeat of the ICO bubble? To answer that question, this post will explain what DeFi is and examine it through two of its most storied participants: Compound and YAM.

We’ll start with what DeFi is.

DeFi Defined: decentralized finance

DeFi is Decentralized Finance: defiprime.com defines it as: “the movement that leverages decentralized networks to transform old financial products into trustless and transparent protocols that run without intermediaries”.

Binance says it’s “an ecosystem of financial applications that are built on top of blockchain networks”.

So DeFi is about transferring financial products to blockchains. However, it goes a little further than just moving traditional financial services and tools onto the blockchain.

DeFi’s aim is to create a financial ecosystem without intermediaries or oversight of any kind. The intention is to rely on the self-enforcing mechanisms built into the supporting blockchain structure itself. Self-executing smart contracts, conditional and time-limited, are self-enforcing. Blockchain encryption is functionally inviolable.

Most DeFi protocols are built on Ethereum, utilizing interlocking smart contracts and tokens based on ERC 20 standards to create apps like Compound, which allows users to lend digital assets at interest in liquidity pools and currently accounts for $800 million in digital assets.

DeFi does deliver easier access to financial services, reduced transaction costs, solid on-chain security (assuming proper smart contract audits) and a much-reduced risk of bad actors scamming or defrauding users — all the inherent advantages of blockchain. DeFi is still in its experimental phase.

However, one of the most popular uses to which DeFi is put raises some problems of its own. It’s time to talk about yield farming.

What is yield farming?

Yield farming accounts for over $7.5 billion in digital assets, and it’s due for an ICO moment — watch out for TV discussions of it any day now.

It’s a simple concept: you provide liquidity to DeFi protocols by depositing some of your digital assets, making those protocols suitable for a use case like decentralized exchange trading or lending, and you generate some earnings in return.

This differs from simply investing in a profitable company and earning dividends and potential share price appreciation in two ways. First, one of the key forms of pay-off is new, emerging digital assets often described as governance tokens; second, the process by which returns are earned relies on new protocols whose security is not guaranteed. Most of the time, there is no company backing those protocols, and no way to retrieve tokens in case of a security breach or bug.

A standard investment might go like this: I buy 100 shares of BizCo stock at $100 a share; two years later, BizCo stock is worth $120 a share and I have made $2,000 return on my investment.

Basic yield farming would look more like this: I provide liquidity to Biz.io protocol by depositing $10,000 worth of ETH; three months later, I decide to withdraw my tokens and net a profit in ETH from the transaction fees/spreads used by that protocol, plus a quantity of BIZ, Biz.io’s proprietary governance token.

This is where we encounter two of the main issues with yield farming, which make it both tempting and unstable. First, most of the digital assets lent this way are used by third parties for speculation in digital assets, as many borrowers use those assets for margin trading; this is the Compound business model. For every day you lend digital assets through Compound, you receive COMP governance tokens, and they form a significant part of the reward for your participation.

Second, there’s the instability in the price of COMP. COMP doesn’t have a long history, and a lot of the COMP tokens in existence aren’t yet in circulation; many are in the accounts of Compound yield farmers. COMP has doubled in value since the middle of June this year, but what happens if three or four big players sell? A flooded market could drive down the price of COMP to the point that yield farming through Compound was no longer profitable, driving down the yield and the value of the COMP token simultaneously.

If Compound can serve as an example of what can go right, at least so far, what happens when yield farming doesn’t work out?

Yam: What was supposed to happen?

Yam Finance is a yield farming service, a little like Compound. Despite its demise it remains the seventh-largest DeFi project, and $400 million TVL (Total Value Locked) in digital assets, up from $200 million at its August 13th collapse — though down from just under $500 million a few days previously.

So what was supposed to happen, what went wrong, and why is a project that has by most measures collapsed still sucking in ETH?

Here’s how YAM described the project, in a blog post on August 11 on the company’s Medium channel:

Yam is an experimental protocol mashing up some of the most exciting innovations in programmable money and governance. Built by a team of DeFi natives, it features: an elastic supply to seek eventual price stability; a governable treasury to further support stability; fully on-chain governance to enable decentralized control and evolution from Day 1 a fair distribution mechanism that incentivizes key community members to actively take the reins of governance

In other words: “YFI…YAM…and other YFI forks are essentially automating yield farming which itself is essentially arbitrage of prices and yields based on borrow and lending rates… These are market inefficiencies that will get flattened out in time. Taking it a step further, this automation will evolve to target other market inefficiencies in the future to return yield to holders of said coins and/or offer governance/voting input on the next steps for each dapp (e.g. YFI vaults, YAM deposits, etc)”, as DeFi enthusiast Alan Hena said on Twitter.

The long-term sustainability of this business model is another question: it’s not what eventually brought YAM down.

What went wrong?

YAM uses rebasing, which dynamically updates the supply of a digital asset for all its users in order to prevent inflation by growing and shrinking the money supply within the digital economy in question.

YAM’s rebase function was managed by smart contract, and that smart contract contained a fatal bug that essentially jammed the YAM printer on “print”, with no way to turn it off.

The faulty line of code ran:

totalSupply = initSupply.mul(yamsScalingFactor)

According to CoinTelegraph’s Michael Kapilkov, this should have been followed by “div(BASE)”, which would have divided the new supply by a large number prior to actually minting any new YAM. Without this crucial piece of code, runaway inflation inside the YAM economy was inevitable.

YAM Finance announced on Twitter:

The initial rebase has occurred adding approximately $500k worth of yCRV to the YAM treasury.

If governance is unable to submit a bug-fix proposal prior to the second rebase, no further governance actions will be possible.

There will be so much YAM printed that quorum will be impossible.

If this happens, the YAM treasury will become ungovernable and these funds will be lost

This will happen on the next rebase at 8AM UTC, unless a proposal is submitted prior. If a proposal is successful submitted prior to rebase, and the community has harvested their YAMs into their wallet, we will be able to modify the protocol to fix the issue.

YAM followed up these tweets with information on how YAM users could best weather the worst-case scenario, and they seem to have informed their users as quickly and fully as possible.

From an all-time high of $167.66 per token, YAM fell quickly to a new low: 97¢.

The issue that felled YAM wasn’t an unsustainable business model, then, but an unaudited codebase assembled in ten days.

What next for DeFi?

YAM still has investors because they liked the business, and expect the project to be reassembled, this time with an audited codebase and after a phased migration to the new codebase. Its investors are betting on YAM 2.0, essentially, and they may be right.

However, the business model exemplified by YAM and other automated DeFi tools is both potentially very profitable and inherently unstable because it involves performing fast, complex trades in multiple highly-volatile digital assets.

Bloomberg’s Olga Kharif and Ryan Williams explain that:

To maximize returns, many users are adapting complex strategies. For example, some investors have been depositing DAI tokens into Compound, then borrowing DAI using initial tokens as collateral, then lending out the borrowed funds. The idea is to get a greater portion of the allocated rewards: COMP tokens. A move in the wrong direction in a token’s value could wipe out all gains and trigger liquidations.

Sudden drops in the value of any token in this chain of loans, collateralization and speculation could snowball, crushing even ecosystems with only peripheral involvement.

What about the value of DeFi tokens?

The entire business model of automated DeFi has been criticized by some. Chainstone Labs CEO Bruce Fenton said on Twitter that “DeFi tokens are junk”, explaining that they do not confer ownership or rights to revenue, and went on to add that “there is no real revenue” from such projects anyway. This is not always true, however; Compound generates revenue, and YAM, remember, was felled by hasty code, not a vaporware business model. And as TrustSwap and UpTrennd CEO Jeff Kirdeikis responded to Fenton, “No ownership of enterprise is how it goes for ANY utility token or ‘currency coin’” — including Bitcoin.

Where next for DeFi?

It’s tempting to draw comparisons with ICOs: like ICOs, DeFi is drawing in risk-tolerant investors (or investors who perhaps do not adequately understand the risks), and is fuelled by high hopes and a spirit of experimentation.

It’s worth remembering that while many ICOs were scams, they were usually unsophisticated failures as criminal enterprises and reaped little financial reward for their perpetrators; most of the ICOs that attracted significant investment were legitimate, and it’s probable that a legitimate role for automated DeFi will emerge within the broader financial world, which now includes the major digital assets.

However, we expect some degree of regulation to emerge, again as occurred with ICOs. Probably this will emerge within the next one to two years and help to restructure the DeFi industry, and it’s likely that significant reorganization will be undertaken on a purely voluntary basis to align the best practices of the industry with the optimal risk/reward tradeoff in the meantime.

Disclaimer:

Disclaimer: This publication is general in nature and is not intended to constitute any professional advice or an offer or solicitation to buy or sell any financial or investment products. You should seek separate professional advice before taking any action in relation to the matters dealt with in this publication. Please note our full disclaimer here.

Next Article