Launched in September 2021, Beanstalk uses a dynamic peg mechanism that incentivizes users to maintain the price peg of one dollar. Until recently, Beanstalk appeared to be making waves in the decentralized finance (DeFi) space. However, the recent exploit to the tune of over $180 million has sparked concern throughout the DeFi community and caused the price of BEAN to fall significantly.

If you're one of the many people asking, "what is Beanstalk and how does the BEAN token work?", read on! In this article, we're going to dive deep into the Beanstalk Farms ecosystem. We'll explore common questions about the project, such as "what is Beanstalk?". Plus, we'll take a look at the BEAN stablecoin and the mechanics designed to maintain its dollar price peg. Also, we'll discuss algorithmic stablecoins, how they work, and how they differ from collateralized stablecoins. In addition, we'll explore the recent Beanstalk exploit and why some stablecoins struggle to maintain a consistent price peg.

Moralis Academy is the ultimate Web3 and blockchain education platform online. Check out the Blockchain & Bitcoin 101 course to gain a firm understanding of the foundations of Web3. Join our community of over 30,000 students and start your blockchain journey today with Moralis Academy!

Algorithmic Stablecoins

Before we consider the "what is Beanstalk?" question, let's examine algorithmic stablecoins more closely. An algorithm is a set of rules and instructions that a computer program or application can execute autonomously when specific conditions meet. A stablecoin is a crypto asset with a price pegged to a fiat currency or other assets. Stablecoins are intended to maintain this relationship with the asset it's pegged to. Some stablecoins such as Tether (USDT) and USDC are backed by physical assets like US dollars, gold, and securities.

The world of Stablecoins - Beanstalk uses its native BEAN token as a stablecoin.

Theoretically, these projects should have reserves equal to or greater than the value of the stablecoins they issue. However, this backing is somewhat dubious. Plus, it makes these projects more centralized than algorithmic stablecoins.

Most algorithmic stablecoins maintain their peg using a decentralized self-sustaining protocol rather than collateral. Although there are various ways to achieve peg maintenance, most algorithmic stablecoins use some sort of supply manipulation coupled with economic incentives. It’s also common for algorithmic stablecoin projects to implement a token burning and minting function to automate the expansion and contraction of the token supply.

Algorithmic stablecoins are more challenging to censor or ban. Unlike collateralized stablecoins, algorithmic stablecoins are generally free of fiat backing and, therefore, remain outside of the jurisdiction of most regulators. Moreover, the idea of a truly decentralized stablecoin echoes the broader ethos of the crypto community. However, a significant number of algorithmic stablecoins have struggled to maintain their price pegs in recent months, sparking doubt among the DeFi community about the sustainability of these uncollateralized assets that are price pegged.

What is Beanstalk?

So, what is Beanstalk? Beanstalk is a decentralized credit-based algorithmic stablecoin protocol on Ethereum. The native ERC-20 stablecoin called BEAN uses a dynamic peg mechanism to maintain the value of one US dollar without a central authority or collateral. The frequent crossing of the dollar peg aims to minimize arbitrage opportunities and increase user confidence in price stability. The Beanstalk ecosystem comprises three interconnected decentralized elements: a price oracle, a governance mechanism, and a credit facility. Together, these elements create a censorship-resistant stablecoin.

What is Beanstalk?

Most collateralized, convertible stablecoins rely on some type of centralized custodian. However, the Beanstalk team believes that a low concentration of ownership, strong credit, low friction, and an incentive structure that financially incentivize honest actors is paramount to the success of a project. Also, the team expects the liquidity and stability of the stablecoin protocol to increase over time as the project matures.

Decentralized Price Oracle

Decentralized stablecoin protocols need to access price feeds without having to trust intermediaries. This is where oracles come into play. Decentralized price oracles achieve this by bringing real-world data on-chain via smart contracts in a way that nobody can alter or manipulate. High-quality oracles can be expensive to maintain and are often inaccurate. Beanstalk aims to remedy this by leveraging data from the Uniswap exchange. 

The Beanstalk oracle measures the price of two Uniswap pools that are highly liquid as sources for price data. First, the oracle measures the USD price of the USDC-ETH pool. Second, it measures the price of a new BEAN-ETH pool. The arbitrage opportunities available in the USDC-ETH pool maintain an accurate USD price source. Furthermore, the price of one BEAN token is equal to one USD when the ratios of both of these pools are equal.

Almost every decentralized finance (DeFi) protocol relies on oracles for price feeds and bringing real-world data on-chain. If you're a developer and want to learn how to integrate Chainlink oracles into your project, check out the Chainlink 101 course at Moralis Academy.

Beanstalk Farms

Beanstalk uses a two-pronged approach for protocol governance. The bean farm combines protocol-native financial incentives with yield opportunities for participating in protocol maintenance to encourage loyal and reliable governance. All Beanstalk governance and upgrade proposals occur on Beanstalk Farms. Below, we'll look at the key components of the Beanstalk stablecoin protocol.

The Silo

The silo is Beanstalk's DAO (decentralized autonomous organization). It's open to anyone who wants to participate in Beanstalk protocol governance. To vote on proposals to make changes to the protocol, participants must deposit BEAN tokens or other whitelisted assets into the silo. In return, participants earn the STALK governance token. The STALK token enables holders to cast votes and earn passive BEAN token staking rewards for their contributions to the network when the BEAN token supply increases.

The Field

The field is the Beanstalk credit facility. Any BEAN token holder who is not participating using the silo can lend idle assets to the field to participate in peg maintenance. Creditors receive loan repayments with interest each time the BEAN token supply increases.

Exploring the answer to "what is Beanstalk?".

Seasons

Time is kept in seasons on the farm. Seasons is a protocol-native timekeeping mechanism that facilitates frequent, cost-efficient code execution on the Ethereum blockchain. The first season began when the Beanstalk contract was first deployed. Each subsequent season begins when someone calls the "sunrise()" function. Further, network participants earn BEAN token rewards for successfully calling the function. This acts as an incentive for maintaining a “cost-efficient protocol-native timekeeping mechanism” and “cost-efficient code execution on the Ethereum blockchain at regular intervals”.

Soil, Pods, and Weather

Soil refers to the current number of BEAN tokens that participants can sow in exchange for pods. When users sow BEANS, the Beanstalk protocol removes them from the token supply. One BEAN token can be planted (sown) into one "soil" anytime it is available. Furthermore, pods are a debt asset that automatically grows from sown BEAN tokens and never expires. Also, weather refers to the interest rates available for sowing.

Moralis Money
Stay ahead of the markets with real-time, on-chain data insights. Inform your trades with true market alpha!

BEAN Token Peg Maintenance

The Beanstalk protocol requires network participants to engage in regular price-peg maintenance. However, the platform also uses four additional peg maintenance tools. These are changing the BEAN token and soil supply, changing the weather, and selling BEAN tokens on Uniswap. At the beginning of each season, the protocol evaluates token prices, debt levels, token balances, and acceleration relating to an ideal equilibrium. 

Beanstalk logo in white with green background for our "what is the BEAN token?" article.

Ideal Equilibrium

Because Beanstalk is a credit-based stablecoin, it fails if it cannot attract creditors. The Beanstalk peg maintenance system also considers debt levels. To be in ideal equilibrium, protocol debt levels and the price of the BEAN token must be optimal. Practically speaking, an ideal equilibrium is impossible. However, the team expects deviations to decrease as the platform grows. 

BEAN token price and Beanstalk debt are optimal when the price of one BEAN token regularly oscillates around its price peg, and soil demand is steady. To regulate this, the protocol manipulates the supply of BEAN, soil, and weather after closely monitoring the relevant markets.

Whitelisted Assets

Whitelisted assets are those that the Beanstalk community agrees can enter the "stalk system" to generate stalk and seed. At the time of writing, whitelisted assets include the BEAN token, Uniswap BEAN-ETH LP token, Curve BEAN3CRV-f LP token, and Curve BEAN3LUSD-f LP token. Network participants can vote on proposals to add and remove assets from the whitelist.

The Beanstalk exploit explained in our "what is Beanstalk and the BEAN token?" article.

The Beanstalk Exploit

On Sunday, April 17th, 2022, the Beanstalk stablecoin project suffered an exploit resulting in more than $180 million in missing funds. Following a carefully orchestrated heist, the attacker was reportedly able to get away with $76 million from the flash loan attack. Reports suggest that the stolen funds were used to vote on a Beanstalk governance proposal that enabled the attacker to drain the protocol of funds. Following the Beanstalk exploit, the BEAN token lost its peg and fell to an all-time low of $0.0289. At the time of writing, the BEAN token is trading at around $0.07, according to CoinGecko.

Furthermore, the attacker donated $250,000 worth of funds to a crypto donation wallet address for Ukraine before repaying the initial flash loan. The remaining funds were converted into 24,800 wrapped ETH (wETH) to the tune of around $76 million. Part of this sum was withdrawn via the Synapse cross-chain bridge, while the rest was sent to the Tornado Cash privacy protocol. Tornado Cash is under increasing scrutiny after a series of hacks on prominent DeFi protocols and fraud allegations. This includes the $625 million Ronin exploit and the $10.6 million Crypto.com attack. After Beanstalk suffered this exploit, Beanstalk stated they are "preparing a strategy to safely re-launch a more secure Beanstalk with a path forward".

Methodology

After creating a blank improvement proposal, the exploiter took out a flash loan of $1 billion to obtain DAI, USDC, and USDT on the Aave platform, BEAN from Uniswap v2, and LUSD from SushiSwap. This was quickly converted into 3CRV and used to supply single-sided liquidity to the BEAN-3CRV and BEAN-3LUSD liquidity pools on Curve. After this, the attacker took these whitelisted assets and deposited them in Beanstalk's silo. As a result, the attacker immediately received a significant amount of voting power to claim a 2/3 supermajority vote and execute the "emergencyCommit()" function on the improvement proposal. 

Beanstalk improvement proposals have a seven-day voting period. However, this exploit took advantage of the fact that the "emergencyCommit()" function allows Beanstalk improvement proposals to be completed in a day, providing that the caller has at least 67% of all outstanding stalk, equalling a 2/3 supermajority vote.

Why Algorithmic Stablecoins Loose Their Pegs

Despite the benefits of decentralization, algorithmic stablecoins often struggle to maintain their peg. In fact, around half of all algorithmic stablecoins have found it difficult to establish a robust and sustainable peg maintenance mechanism. However, those that survive tend to have a positive feedback loop and broad utility for secondary tokens. 

The positive feedback loop can thrive so long as the community maintains trust in the protocol. When users' trust in a stablecoin project decreases during times of market volatility, this positive feedback loop can fail, as the inherent value of a stablecoin drops below a given peg.

Another common issue that algorithmic stablecoin projects face is the ability to balance risk and reward for secondary tokens. A significant amount of secondary tokens have little to no utility beyond maintaining the price stability of a stablecoin.

What is Beanstalk and the BEAN Token? - Summary 

Hacks and exploits are nothing new to the DeFi space. Until the time of the exploit, Beanstalk Farms appeared to be on track according to the milestones on its roadmap. On May 2nd, 2022, Beanstalk will host a public ten-day fundraising ("The Barn Raise") event to restore the liquidity stolen from the silo. This will include a seven-day bidding period and a three-day sowing period. The Barn Raise aims to provide supporters of the platform with new opportunities to get in at the ground level.

There has never been a better time to become a blockchain developer. If you want to learn Web3 development but have no coding experience, check out the JavaScript Programming for Blockchain Developers course at Moralis Academy. This course teaches students how to create a decentralized exchange (DEX) from scratch. Kickstart your Web3 career today with Moralis Academy! 

After reading this article, you should be able to confidently answer questions such as “what is Beanstalk?” and “what is the BEAN token?”. Don’t forget to follow us on Twitter @MoralisAcademy! Let us know your thoughts on the matter! What is Beanstalk going to do next? In addition, check out our “Exploring ApeCoin (APE)” and “Crypto Backed by Gold” articles to expand your Web3 knowledge further!