Curve Finance – The Stablecoin Exchange Protocol
Curve is an Automated Market Maker (AMM) that lets users and other decentralized protocols exchange stablecoins (DAI to USDC for example) with low fees and low slippage. Unlike exchanges that match a buyer and a seller, users transact with the smart contract itself. By providing a flatter curve targeted for relatively stable pairs, Curve has established the lead position for these markets. Curve is also leveraging its own token CRV to incentivize long-term adoption of the protocol and decentralize control of governance.
We were joined by Curve Finance Founder, Michael Egorov, to chat about why he created the protocol and his long term vision for the project.
Topics discussed in the episode
- Michael’s background and how he got into crypto
- How Curve works from the perspective of a trader and as a liquidity provider
- How they came up with the stableswap design
- How Curve compares to Uniswap v3
- Michael’s take on forks, fork threat, and Curve’s moat
- Curve’s thesis on good governance
- How they keep the protocol secure
- An overview of the Curve community and ecosystem
- The long term vision for Curve
Brian: Michael, it’s such a pleasure to have you, thanks for coming on. Maybe just share a little bit of background about yourself. Like what’s been your journey and especially like your journey to becoming involved in the crypto space.
Michael: Yeah, basically my crypto journey started in late 2013 with buying a little bit of Bitcoin at the time I was doing post-doc and physics after receiving PhD in physics. Shortly after I actually went to the United States to work in the tech industry, LinkedIn at the time. I learned a lot about crypto at that time as well, and actually started the company, which was not doing crypto called a zero DB, which is now called new cipher and it’s operating in crypto.
Anyway, that’s how it started and what I am doing right now is quite, and that is because I actually become quite a heavy DeFi user starting from late 2018, I guess, with Maker DAO. I always had this problem of swapping between stable coins. It was all the time because I was doing that on Coinbase and that was not quite effective.
At the same time I was doing some trading bots and this created the idea how to swap between stable coins effectively. That’s what started Curve finance and in the beginning of 2020, I’ve finished implementation of my algorithm in Viper and the basic UI and started curves at five. Basically what we have today is a continuation of that.
Brian: Let’s start by diving into Curve directly here. Do you mind for people who are not familiar with Curve, can you explain how Curve works? First of all, from the perspective of somebody who wants to trade and let’s say your example of swapping different stable coins.
Michael: Right. Yeah. Currently the primary purpose of Curve is exchanging between two coins of the same denomination. Most notably is DAOar stable coins like USDC and DAI, for example, but also in BTC denominated coins. You can swap between BTC and BTC. and ETH denominated coins, for example real Ethereum and staked Ethereum, for example. That’s also a popular use case.
You could swap for a reason of, let’s say if you want to interact with MakerDAO, you probably want DAI. If you have USDC, it’s probably a coin which is easy to redeem to your bank account. That could be one reason to swap. Or for example, if you want to go from your Ethereum to staked to Ethereum, you could also do it that way, or maybe the other way around. That’s from the trader perspective.
On the other hand, there are users who deposit into Curve pools and they earn trading fees and also CRV tokens and maybe some subsidies by the protocols who sponsor the pools. That’s the yield you have as a depository in the pools. That’s how the liquidity gets there in the first place.
Brian: Yeah. I should actually also add this disclaimer here, which I meant to say that I do use that with my company. Very involved in lighter. I’m you, I’m doing exactly that at the moment. I put a lot of my Ether into lighter and then got the Staked Ether out and then put that into the Curve pool and stake Ether. Having that process also in some CRV. Have also some of those tokens at this point. Michael, I guess, one of the essential things around Curve, you have basically this function where you’re trading, not with a counterparty, the counterparty is a smart contract. Then there is a function that determines the price. Can you talk a bit about how that works with Curve and what’s special in this regard for Curve?
Michael: Yes. Basically, what is common for many of the automatic market makers is that you have some liquidity in all the coins and bolt. Let’s say when you swap from coin A to coin B as you, the user buys a little bit of coin B from the pool and the pool gets also more of a, the price shifts a little bit. That coin B, which gets bought, becomes a little bit more expensive. Then the so-called bonding curves. They describe how these pricing changes. Different protocols have different bonding curves.
For example, Uniswap Two has constant product bonding curve, which is where the pool basically rebalances the whole holdings. What we did, we concentrated liquidity around the price. 1.0, that’s where the liquidity is most needed, but then it’s a small Slee and goes down as you get away from the price 1.0.
When you’re close to 1.0, you get the highest depth of our liquidity. But let’s say if the price changes a little bit, let’s say becomes 1.01, you have the depth a little bit less, and the rock pool parameters, which define how tightly are you concentrated around this 1.0 price, different assets may need different concentration of this. It depends on the asset volatility.
For example, stable coins like USDC and USDT are very stable. You can be very dense around one price, 1.0 and something like staked Ether is expected to be much more volatile. You need to be, to have liquidity a little bit more spread out, but still much tighter than the universal relationship, which Uniswap to Sushi Swap and Balancer has.
Zubin: How did you come up with this design in the early days, the stable swap paper? It seems like a very elegant solution to specifically like low volatility pairs. What was the process like ideation? How did you realize this was a problem in the beginning because you were working on NewCypher, at the time. How did you go towards the design you have now?
Michael: Yeah, as I said, the problem itself is easy for me to figure out because I was a heavy DeFi user and I always had this problem of swapping between DAI and USDC pretty much. That was one thing. But the question of how to come up with this mathematical relationship was interesting as well, because firstly, it started from a graph like bonding curves can be represented by graphs. For the simple, constant product idea, which was already out, the graph is basically a hyperbolic.
I first thought that part, which is close to price 1.0, should be flat. And, but not necessarily like completely flat because if it’s completely flooded, then you have infinite depth. I firstly started graphing it on paper and then I started thinking, what would be the formula, which corresponds to this graph. Also this formula shouldn’t be very complex because if it’s too complex, then I wouldn’t be able to solve it in a smart contract and not eat all the gas. That’s basically how I came up with the design and the formula for this.
Brian: From what I understand of Uniswap V3 is that it allows you to recreate any graph in price space, including the stable swap graph.
Michael: In principle, correct. Yes. It does allow you to create such graphs piece by piece, something like a spline where you basically users can create their pieces of this plan and deposit liquidity into those pieces. In principle that’s actually good. I actually had the same idea in early 20 as well for volatile pairs until I had some other idea which I’m currently implementing, which I think is fully automated. It’s better.
Even if we talk about stable coins, a long key difference is that we are able to quickly change these parameters without users are really positive on anything. For example, imagine that you have one graph. Well, just an example from maybe a week ago, we had liquidity for staked teeth with leaders being spread approximately within like plus minus 10% from the price 1.0.
It turns out that staked ETH is actually very stable. We are able to provide liquidity much better for it by concentrating it tighter. We didn’t have to ask users to redeposit liquidity, into whatever ranges we just made a DAO proposal to increase this amplification, coefficient parameter by factor of five. Over one week, this liquidity becomes tighter by a factor of five, basically as we speak it does so very gradually and if I remember correctly, 5,000 steps, that’s absolutely transparent to the user.
Basically as we speak in this episode, the liquidity in that pool becomes tighter and tighter without transactions becoming more expensive without anyone redepositing in anything anywhere. In principle, these analytical solutions allow us to do that quite cheaply. They are superior in that regard to Uniswap v3 approach, although definitely can see that Uniswap vThree approaches allow for very high levels of customers’ ability, maybe at the expense of being a bit less convenient for liquidity providers. They should be quite professional. Sounds like.
Brian: Yeah, that explanation was really good. I think it’s not easy to wrap your head around automated market makers and exactly how it works. I think it’s interesting to conceptualize why automated market-makers are interesting. If you take an exchange, a traditional order book exchange like Binance, then of course there are market makers are professional firms, right? Putting bid orders in and ask or saying, and they’re watching other exchanges updating them and they’re providing liquidity that way.
They’re also earning money that way. But you know, I can’t do that because I don’t have the knowledge infrastructure, you know? Then with Curve, you’re basically saying, okay, we have a program that does it, and anyone can give money to the program. Now you can be a market maker. Anyone can be a market maker. Then actually with the Uniswap thing, you’re almost going into with the V3 thing, it almost goes into a little bit of this hybrid thing where, well, anyone can provide money to the market maker, but there’s a lot of parameters to choose and maybe to change and update so that you can do it better, versus Curve is still sort of in the…
Michael: Yeah. If you explain Uniswap Three in these terms, it’s almost like a traditional exchange, but instead of having discrete orders, you have a continuous order book. Instead of orders, which probably dates back to ancient times where you had to write orders in an actual paper order book, you can actually have them continuously. That’s how it should have been when computers appeared. But that wasn’t the case until Uniswap three, I guess.
I think this is an improvement over traditional order books, but I think the level of skill required to provide liquidity in general for volatile players over there is the same. You in traditional order books, you’ve just had to put either no other orders, right? Two sometimes. On Uniswap Three, you just have to spread liquidity from price to price before that’s certainly an improvement, but to figure out where to provide like that there is a considerable skill required.
To give you an example, imagine that I am providing liquidity for Ethereum, right? Let’s say Ethereum price is at, I don’t know, 3000. I’ve provided liquidity from, I don’t know, 3000 to 3,100 and which works well while Ethereum was there. But then when the price went up, I’m left with dollars. So, okay. I take dollars and provide liquidity at a new price. But if I do that, I’m losing on Ethereum going up and the same with whether it goes down.
Imagine I provided liquidity at no 4,000 and then it dropped to 3000. I’m left with ethers, which were at around 4,000, maybe a little bit less. I was back holding those while the price drops to 3000. I’m losing again. That’s what happens if you do everything negatively? So it’s a powerful tool, but naive liquidity provision probably doesn’t apply to you make money over there.
That’s a problem with that, but that’s also a problem with centralized exchanges, but yeah, market making firms are probably making money. They are probably skillful enough to do that. I think they are the users that would be the best liquidity providers for Uniswap Three.
Brian: I would love to expand a little bit on more generally, I listened to another podcast with you where you said that you think automated market makers are just like fundamental improvement, fundamentally superior to traditional order book exchanges. You said a similar thing here. Can you explain why you think that’s the case?
Michael: Basically they are pretty transparent in what’s happening. You pretty much know that they will do the right thing, what they’re programmed to do. But also from my observations, automated market makers can be probably not worse than what traditional market makers can do while being not custodial. They can amass much more liquidity and maybe traditional markets makers would argue that their markets are more effective than Uniswap Two or Balancer, which is true, but for crypto, but also I think it’s possible to do much better for cryptos. At least we will try to prove it.
Zubin: In that vein. What do you see as the long term vision for Curve whereas Curve and five years, 10 years. What use cases is it?
Michael: I think we are currently started with stable pairs, but I think if we go a little bit beyond that, we probably would allow for the automatic creation of very effective crypto markets or foreign exchange markets and like who knows how much we can replace traditional order book approaches, but I think that a lot can happen to a certain degree.
Zubin: Got it. Do you see it like going into Uniswap territory a little bit of allowing arbitrary exchange between any pair of tokens or?
Michael: Yeah, I think that’s of course a sensible thought, but because you’re talking about five and 10 years, we may talk about, I don’t know about stock markets, about foreign exchanges, about like all sorts of exchanges, which are known traditionally, because I think the story here is bigger than one DeFi project versus the other it’s about whole DeFi space capturing the traditional finance market.
Zubin: This is probably a good time to mention that I’m a disclaimer, also a Curve user and token holder as well and have been participating in and following along with this journey,
Brian: One of the things that I also wandered about, because we’ve automated market makers like Curve and Uniswap like getting enormous volumes and when you’ve seen how they have taken really substantial market share at this point from centralized crypto exchanges. I know centralized crypto exchanges are still good products, right? Like they work well, are user-friendly, you can make an account easily to deposit money easily.
So much better than a traditional financial institution in many regards. But still you see on chain, you have these automated market makers take a substantial market share from that. I have also wondered with like, is that at this point, this breakthrough success of crypto and blockchain, that it has better market mechanisms and better that is going to be the thing that will be the sort of drive on the inroads towards taking more market share from traditional financial systems. Like you think that’s the case. Do you think there are going to be other drivers that will be critical for this transition?
Michael: One thing I would say that it’s not necessarily, I mean, indeed like the blockchain activity takes quite a bit of centralized exchange market share, but also we’ve seen Binance successfully solving this problem with Binance smart chain, which yes, it is centralized, but it is centralized with the central authority being Binance and not the services which have built over there.
If you do it on a centralized exchange and you couldn’t give some trading for money to treat non-custodial and, but on something like on an exchange chain, you actually can do that. You can do money to trade to some decentralized service. That makes a big difference. Even if the chain is controlled by the exchange and yep Ethereum is better in my view, but as we can see, it’s still quite successful, the exchange chain can get some bit of market share. That’s the evolution of that model.
Zubin: Awesome. Wanted to shift gears a little bit to maybe a little bit of a different direction, but seeing a Uniswap and sushi swap. How do you think about your modes? What do you think about fork threats, forks in general or projects that are very similar, like, saddle, when you think about curves long-term success.
Michael: Yeah, there are many ways to establish this mode. One is if you look at how quickly forks were created, it took some time to understand the mechanism, how the market making works on Curve. It was a little bit harder to understand that non-constant product. This gives a little bit of time to like before forks start appearing. I think probably Uniswap Three, because it’s quite a bit less understood by people who may be on my fork.
Maybe it has some of these small decibels at the moment. Another way is probably good tokenomics. I think tokenomics is probably good for keeping the competition away as much as possible. Another thing is it’s probably good to allow the forks, but in such a way that they benefit the protocol.
We tried to do that with a few forks and we’ll see how it goes. But yeah, that’s another way. Yeah, but it’s still in the experimentation phase. We are looking at different ways to either preserve the dominance of the protocol or to get a dance so that if forks appear that the same people pretty much on parts of the forks and stuff like that. Then we’ll see what works out.
Brian: You mentioned token economics as a mode for Curve. Like what is it about the Curve token economics that you think gauge that mode?
Michael: I think it’s probably quite easy to understand. A naive way, you can have pools earning all the fees for themselves. Let’s say you deposit into the pool and all the exchange fees go to you as a liquidity provider, but you know, the market is not very stable. Sometimes these fees can go up by a factor of 10, then drop down that we’ve seen that. It’s good to introduce some sort of inertia there. We introduced that by doing token emissions.
Some of the token emissions go to the pool of liquidity providers about some of the fees go to the DAO, which means basically they’re token holders. Oh, well talking to lockers if Two, to be more exact. We have this will the sloop where CRV gets fees and those who would have, who basically paid parts of those fees, they get CRV.
If the volume trading volume goes down temporarily, well, users still get CRV, but span, it goes up and CRV gets more fees. This allows the protocol to operate with a higher long-term stability. But we still would need to see how it goes over. I don’t know, over a bear market. We still haven’t seen that.
Brian: Yeah. Cause you basically, you have to ETH that is volatile and then you have the curve rewards are based on the volume in the pool and not the trading volume.
Michael: No, actually not that Curve rewards are split proportionally between liquidity providers. The amount of covered awards is determined by the DAO with so-called weight voting. But anyway, there’s their speed of Curve rewards coming in. Doesn’t depend on the volume, which happens in the pool, but really it’s a vaulting over the DAO, which indirectly is inspired by how much volume the pool is making.
Basically imagine that some pool is very popular and it gets a lot of trading volume. Then let’s say, DAO participants say, Oh, it looks like this pool is earning quite good money for the DAO. We probably should vote for this pool to get more CRV.
If it gets more CRV, more users we’ll put money into that pool. You know, it will get even more volume because there is a high demand and we get more fees. That’s how it works. It’s not a very fast feedback, but that’s actually good because this makes basically returns for liquidity providers a little bit more stable,
Zubin: Going back to a little bit of an early discussion that we had earlier was about the future of Curve. What’s the next step? Like when do you think that you’ll have a response to Uniswap V3 or Curve V2, or do you have any plans currently? And can you give us a sneak peek of what might be in that as well?
Michael: Well, I guess it’s not changing anything for stable coin pools. The stable coin pools are probably good as they are, but we probably would need to expand into different asset classes. Actually the work over there is very close to launch. That’s basically expanding into volatile pairs and we want to do it in a fully automated way. Not requiring liquidity providers to do that much of the manual work. It’s a challenging thing.
We’ll see how it works. It’s challenging because you probably may find a lot of research where people tried to do automatic market-making in like Nandi five world and it’s hard, it’s hard to do effectively and wait what that research tells you is that it’s almost impossible to do it to much more effectively than what we’ve seen with Uniswap Two or balancer. Right. That’s what we want to DeFi this common wisdom, which existed before and show that it’s actually possible to do it much more effectively than before.
Zubin: Oh, that’s so interesting you saying that. I was under the impression that all the market makers have only really been used in crypto and in DeFi but so have there been significant usage of research into AMM outside of those areas?
Michael: Of course. I mean, they’re called trading bots and trading bots are quite there, but you don’t really want those trading bots who, I dunno, who look at some crocodile figure on the graph and decide that it’s time to buy. You actually, you’re more thinking about trading bots who create markets and there was, I’m sure market-making firms use those.
That’s just, I guess that’s the way. But also there was a lot of public research about that. If you read that, you probably may get an impression that it’s super hard to create anything useful. Yeah, we’ll see if we can do better than all of that research. If what we created is better.
Zubin: Another question that I had was what is your thesis on good governance? So the Curve token is both a way to incentivize good behavior in the protocol, but also fundamentally a governance token and different projects have taken different views of what good governance is. Like. I think Uniswap is like trying to minimize governance and make sure that any governance improvements are really vital and key and important. Other protocols, maybe Yearn, are much more move fast and break things. It seems. What do you see for Curve specifically as like ideal governance and the ideal DAO structure in the long run?
Michael: Well, I mean the current DAO is specifically designed to be a good DAO in the long run. One of the ideas is that you probably want the voice of long term token holders rather than those who can buy a token vote for something. Then they immediately exit. That’s why we have a so-called vote block mechanism where you vote lock CR-V and you get the higher governance power, the longer you look. You can look for up to four years. That’s what most people actually do.
We think that participants in the governance, they actually aligned with the future of that platform. Long-term another thing is that our system is quite modular. You can replace certain modules based on the governance vote, but at the same time, you cannot change the code. You just EIP governance, even if governance wanted it, wouldn’t be able to take users funds. User funds are sacred. Even the governance cannot even plausibly get to those.
Governance can make decisions about, I don’t know, including future plans and some modular functionality, which we allow lots of everything we even used. Some things are programmed to be used in the future. It’s a mix of immutability and flexibility. Like ultimate flexibility would be replacing any code, but we think it’s unsafe to do even for the governance. We are taking that approach where the code is immutable and you just governance votes for new things and users can signal whether they want to ape into new things or not.
Brian: What about Curve community and ecosystem today? What does it look like? Is there a lot of participation or people are there places to make governance proposals as well? What’s your vision for how you want the Curve ecosystem to evolve?
Michael: You mean governance wise?
Brian: Governance wise, or just sort of in the way you want the community to organize and to evolve the protocol as well.
Michael: Well, for evolving the product call, it would be of course, good to expand to other chains. What question, if governance can expand there, but Bottineau having different pools on other chains and having all the money flows going across chains, that’s definitely possible. That’s definitely something about what governance votes for. Yeah. I think that’s one thing.
Brian: Would you see CRV having the same function even if Curve was deployed on stable?
Michael: Yes. Yes. But I think there still should be one place where all things concentrate currently, it’s only Ethereum, right? Let’s say we have pools on, well, we actually do have already pools on Polygon, right. Also a couple of pools on Fontan and we just got admin fees from Polygon back to the Curve DAO and it worked and we can get CR-V from Ethereum to Polygon. That can be controlled by the DAO, like how much that pool gets DAO can leave on Ethereum, but the pool is still over there on Polygon. That’s an example and this sort of scheme work with multiple chains, multiple layer twos, or like whatever will be used for scaling Ethereum,
Zubin: Shifting gears a little bit wanted to talk to you about your thoughts on the security of Curve. This is a long term project with billions of dollars, I think like more than $7 billion of TVL. How do you think about security? And especially in a decentralized context where code is being written by many different people, how do you think about security and ensuring that the code is always extremely high quality, readable and secure.
Michael: Yeah. That’s a good question. We probably took the approach different from what some projects have. From our observation, most of the errors in the code are coming from the developer, right? So it’s really up to the developer to get the good code quality. Yes. You can say that auditors can help to get code quality better.
That’s true to some degree, but also auditor’s, don’t see absolutely everything and they can miss things. How to prevent that, I think the best way is to have all the code very well readable so that like it’s the focus should be on readability. For that we use Viper language because like Viper is much more readable than solidity by humans, at least. That ensures that we ourselves can see things in our code. Still. Sometimes we don’t see them immediately, but we can notice them much faster than if everything was in solidity.
That’s one of the things, and of course, solidity is a much more mature language, with more tools. In that regard, one could argue that, as a language, it could be safer, but given that most errors, they don’t actually come from the compiler, but most errors come from humans. The fork use shouldn’t be on the readability. Of course, which is true for all projects, there should be very good test coverage.
Automatic testing is the must for smart contracts. In fact, I think smart contract code takes maybe 5% of all the lines of code, maybe less and everything else is automated tests. For those, we actually do quite advanced things with brownie. For example, you could basically, all the actions with a smart contract, or maybe external contracts can do.
Then you can let this tool to select different actions at random, with random parameters and explore this parameter space, trying to find some violations or basically some errors, something which you don’t want in your behavior. If that happens, it’s raises a flag and you say, Oh, there is something in the code, which we need to fix. Right. I think that this way actually is able to come up with flash loan attacks, for example, like this sandwich attacks are actually simple. I think proper automated tooling can find them automatically.
Zubin: One last question I wanted to ask was legal and regulatory. You know, how do you think about the legal and regulatory questions around Curve? Whether it comes to securities laws for Curve token, itself allowing people in different jurisdictions to use the protocol and also what are the biggest risks you see to the general DeFi regulatory landscape?
Michael: Yeah. That’s a very good question as well. There are different themes which are going in the regulatory space in the past. It was mostly activity by sec and security tokens. I think with CR-V, well, at least in my opinion, it’s quite simple. You, so the CRB token itself is not doing any functions, which is looking like a security, but if you lock it, you get something called V CRV, which is, which allows you to vote in the DAO.
It receives profits from the DAOs. It’s kind of, well, it feels like a security, but we CRV is not movable. You cannot move it. You cannot trade it. It’s like only sitting in your wallet. When it’s unlocks, when it becomes CRV again, then it doesn’t have that functionality. So in my opinion, vCRV is a security, but because it’s not movable, it automatically satisfies all the security laws and CRV itself has just, I think, a utility token.
The SEC, I think is quite friendly to crypto projects these days, there is also a question about international monitor transmission initiatives, like fight that could be tricky for DeFi because they are trying to regulate what or what is not very much possible to regulate probably as some common ground will be found it’s over time. For example, if they see that all projects should filter users or whatever, it’s just not possible to do with everything deployed.
Everything deployed just continues to exist and nothing can change that they could as well call Vitalik and ask him to do that. He couldn’t do anything. Right. If we think from the basics of what are the goals of that, the goals are to protect users and to prevent criminal activity when it comes to protecting users.
I think the biggest threat in DeFi is very different from the traditional financial world. In the traditional financial world, the biggest risk is counterparty risk. Let’s say basically if you put money in a bank, how can you make sure that this bank doesn’t turn away with your money? Of course, very heavy finals, financial regulations are there to ensure that with DeFi, if well, it’s of course a risk.
If it’s a custodial protocol, if the team has admin keys, which allows them to take the money, but if it’s not the case, the biggest risk is actually the code quality. I think eventually we will see a lot of regulations around the code quality and how the projects can ensure that users are safe in that, on that front and with criminal activity.
That’s actually also interesting because blockchains are very transparent and it’s fairly easy to see where everything goes and that probably doesn’t make cryptocurrencies the best tool of criminals. They do try to use that. Many of them fail at that. I think at the moment, at the moment, cryptocurrencies involve less of a fraction of criminal related transactions than traditional financial, or at least I’ve seen that information published.
Zubin: Anything else that you want to add here? Or you want users to know about Curve or before we sort of wrap up?
Michael: Well, I think we’ve covered everything and yeah, I think it will be a pretty exciting time. Now we have a bunch of new stuff to publish and yeah. If the listeners can follow that, they probably will hear quite a lot of interesting things.
ExodusDownload the app today at exodus.com/epicenter and iOS users can buy up to $500 in Bitcoin for just $1 for a limited time.
SolanaThe Solana ecosystem is growing at a rapid pace and it’s a great place to build your project or get involved with the community. Go to solana.com/epicenter to learn more.