Curve Finance Demystified: A Smooth Ride in DeFi’s Stablecoin Universe

Vridhi Puri
Coinmonks
7 min readAug 1, 2023

--

Curve Finance is one of the technologies that make the crypto world work. This article aims to walk you through this technology, but before that we need to get an insight into the realm of cryptocurrency.

In simple terms, cryptocurrency can be thought of as digital money that exists online which uses a technique called cryptography to secure transactions. It doesn’t rely on any central authority or banks to verify these transactions. Rather, it uses a technology called Blockchain to keep a track of its transactions. There are copies of the blockchain saved on numerous computers all around the world. This makes it incredibly safe because no single person or entity can take control of or alter the entire chain. Some of the examples of cryptocurrency are Bitcoin and Ethereum.

Now, that we’ve some basic level knowledge about cryptocurrency and blockchain, let’s delve deeper into our topic of interest that is Curve Finance.

Technically speaking, “Curve Finance is a decentralised finance (DeFi) protocol that enables the decentralised exchange (DEX) of stablecoins within Ethereum.

Well, that’s a lot of terms! So, let’s backtrack the sentence and acquire a basic understanding of each term one-by-one.

First off, let’s see what stablecoins are. Similar to the actual money we use everyday, stablecoins are a sort of virtual currency that are intended to have a stable value. Stablecoins strive to maintain a fixed value, frequently tied to a real-world asset like the US dollar or another stable currency. While cryptocurrencies like Bitcoin can experience price fluctuations, stablecoins aim to maintain a fixed value.

This enables a very cheap and global payment system. Many current stablecoins are built on the Ethereum network. Sending money abroad is made easier by Ethereum and stablecoins. When compared to the many business days or even weeks that it could take your typical bank, it frequently just takes a few minutes to move money across the world, and it costs a fraction of the price. Furthermore, there is no additional charge for high value transactions, and there are no limitations on where or why you can send money.

Now, let’s say we want to lend or borrow money from someone. Traditionally, we would go to a bank, and the bank would handle all the transactions. To make such financial services efficient, accessible and decentralized, DeFi or Decentralized Finance Protocols come into the picture. In DeFi, there are special programs called smart contracts that automatically handle these financial activities without needing a bank. The protocol’s main purpose is to facilitate the decentralized exchange (DEX) of stablecoins.

Since we have now deciphered all the terms, we can simply define Curve Finance as a decentralised finance (DeFi) protocol, which is a financial system that runs without a central authority, such as a bank. Transaction management is instead handled by smart contracts and the Ethereum blockchain.

So far, we have learnt that Curve Finance is like a special place on the internet where you can exchange stablecoins which are digital currencies with stable values easily, without paying high fees and in a secure manner.

The following segment of the article will cover the serviceable features of Curve Finance.

Liquidity pools, which are smart contracts that store stablecoin reserves, allow Curve Finance to function. Liquidity basically measures how quickly and easily an asset can be turned into cash or exchanged for other assets without causing significant price changes. The stablecoins are deposited by users who become liquidity providers. The most common stablecoins supported on Curve Finance are USDT, USDC, DAI, and TUSD, among others. Curve Finance uses the AMM or Automated Market Makers protocol to facilitate transactions. AMMs utilise mathematical algorithms to modify prices as the liquidity in the pool changes rather than depending on buyers and sellers to establish the pricing like in conventional exchanges.

Stablecoin trading on Curve Finance is designed to have as little slippage as possible. Slippage is the discrepancy between the anticipated price of a trade and the price at which it is actually done. Stablecoins’ values do not move significantly because they are intended to have a constant value, and Curve’s AMM algorithm makes sure that trades may be completed with very little price impact.

Stablecoin trading is optimised by Curve Finance using a unique algorithm called “StableSwap”. By taking into account the stability of these coins, the StableSwap algorithm aims to reduce price slippage even more. It is especially helpful when exchanging stablecoins that are comparable to one another, such as different renditions of the US dollar (such as USDT, USDC, and DAI).

CRV is the native governance token of Curve Finance. By receiving CRV tokens as payment for their services, liquidity providers have the right to vote and take part in the governance of the system.

Because Curve Finance lacks a central organisation or middleman, it is decentralised. Smart contracts on the Ethereum blockchain control the protocol’s rules and procedures, guaranteeing security and transparency.

By now, we know that Curve Finance is a decentralized finance (DeFi) protocol which aims at giving users more control over their money without relying on traditional intermediaries. However, as with any new technology, users should be aware of the risks and conduct thorough research before participating in DeFi activities. This brings us to the last part of the article which will talk about the recent Curve Finance Hack and its aftermath.

Before talking about this recent setback in the DeFi industry, we should have a basic idea on “Reentrancy Attacks”. Reentrancy is a form of attack that can happen to smart contracts that let the execution of untrusted external code inside the contract. This may occur when a smart contract calls an external contract, which then calls back into the first contract, potentially creating an infinite loop. Reentrancy attacks are a way of taking advantage of a flaw in smart contracts that enables an attacker to continually run a function, creating an endless loop and perhaps stealing money.

The Curve Finance Hack which came to light on July 30, 2023 was a consequence of a reentrancy vulnerability in certain stable pools on Curve Finance’s Vyper versions 0.2.15, 0.2.16, and 0.3.0. Vyper is a contract-oriented, pythonic programming language that targets the Ethereum Virtual Machine (EVM). The targeted Vyper compiler versions did not implement the reentrancy guard correctly and hence, were exposed to the attack.

This vulnerability had an impact on several DeFi projects and caused substantial outflows. A $13.6 million outflow occurred in Alchemix’s alETH-ETH. Metronome’s sETH-ETH pool lost $1.6 million, and JPEGd’s pETH-ETH pool received $11.4 million in profit through exploits. Michael Egorov, the CEO of Curve Finance, acknowledged after these attacks that more than 32 million CRV tokens worth more than $22 million had been taken from the swap pool. An ecosystem-wide panic that resulted in a number of transactions across pools and a white hat rescue operation followed the announcement of this confirmation.

The attack dealt a severe blow to the DeFi ecosystem, particularly to the tokens that were directly impacted. For instance, the CRV hack caused the value of some tokens to drop by almost 30%.

The ironic twist of the hacker losing the stolen cash, the rapid action by the founder of Curve to reimburse some of the lost monies, and the unexpected return of funds by a third party have all helped to somewhat ameliorate the situation. The event nevertheless serves as a reminder of the possible weaknesses in smart contracts and the larger DeFi ecosystem.

In conclusion, Curve Finance has shown to be a game-changer in the decentralised financial industry by providing a simple and affordable method for stablecoin trading. It has attracted a growing community of liquidity providers and traders alike due to its user-friendly interface and effective swapping mechanism. On the other hand, it is crucial to be aware of potential risks and take the necessary safety measures, just as with any cutting-edge platform. When working with smart contracts, users should use caution, make sure their wallets are secure, and keep up with any upgrades or security improvements from the Curve Finance team. By being aware of both the advantages and the dangers, we can fully utilise Curve Finance while protecting our assets and advancing the DeFi ecosystem.

References:

--

--