New Ethereum talks, every Monday. The week's conference uploads by event, in your inbox.

Loading player…

Michael K, Curve Finance | FXSwap: From Market Design to Onchain Deployment

Stable SummitThu, Apr 9, 2026, 12:00 AM

FX swaps are a foundational instrument in global finance. What happens when they move onchain? In this session, Michael K (Curve Finance) explores how FX swap mechanisms can be designed and deployed within DeFi, and what it takes to translate these markets into onchain systems. — Stable Summit IV Cannes · 27-28 March ➣ Follow Stable Summit on X Link: https://x.com/stable_summit ➣ Follow Stable Summit on Linkedin Link: https://www.linkedin.com/company/stable-summit/ ➣ Listen to the Stable School Podcast Link: https://stableschool.org/podcast

Transcript

My name is Michael. I work at Curve Finance and today I'll tell you how we at Curve approach Forex markets on chain. Um So, let's start from afar. What's Curve? Uh some sophisticated people may say it's just some squiggle.

Some more crypto-oriented users will immediately think of some bonding curves of I don't know, Uniswap maybe. And me, because I work at Curve, for me Curve means it's like a pioneer decentralized finance protocol that relentlessly shipping for the past 7 years, starting from stable swap, the primitives in Dow, and all the way through lending and stablecoin, and now we're shipping the Forex markets. Uh to talk about Forex markets, we need some proper background on automated market making. And I hope you all had sufficient coffee amounts because I will start from math. Well, a simple one though.

I hope everyone is familiar with constant product invariant. This is stuff that's moving billions of dollars on chain daily on dozens of EVM forks. And the way it works is it's a passive pool that has some tokens, uh say one token and another, and it has some law, x * y = k, that governs what is the price uh based on the reserves. So, if you perform a swap, you give some amount of token x and AMM gives you some amount of token y. Uh this is good for price discovery on chain, but this is not very good for Forex markets.

In Forex market, you have some price that AMM should respect. So, if FX price remains at one and your pool was just imbalanced with some swap here, now the fair price is this, but your pool gives you some other relationship. If you give the same amount of token X, it now gives you less token Y. This is called slippage. And that just shows that this kind of invariant is not suitable for forex markets on chain.

What would be the perfect forex market invariant? This would be constant sum. This invariant is so perfect, and yet nobody uses it. Why? Because it fixes some price.

Let's say we have price of two assets, and it's one. And then everyone can come and swap. I give token X, I get token Y. And then I repeat this. I have exactly the same situation.

However, what happens when someone trades a lot of token X to token Y? Pool gets imbalanced. It doesn't have any more reserves, and it's unusable on chain. Uh now, what did Curve do to facilitate swaps where you know the price, but you also need to respect the reserves of the protocol? It combined these two invariants into something that's called stable swap.

Cool. You see. It has a constant product part. It has a constant sum part. It also has some parameter A that regulates the slope.

The idea is to combine uh positive sides of these two previous invariants. So, we have a good slippage region in the center, and then towards the tails we have something that protects pool reserves as uh large swaps happen on chain. Uh so, indeed, as we do the first swap, we can see we behave almost as the constant sum. So, we respect exactly the price that's coded into the invariant. But then, as the reserves deplete, we start acting with slippage so that the pool is remains functional.

Uh now, from abstract AMMs, let's go directly to the example of uh a real forex pair, Swiss francs to USD. Uh this is how the plot looks like for the past uh 8 years or so. We started from around one. So, one Swiss franc was worth $1 and now thanks to politics, we are at 1.3 US dollars for one franc.

So, what would happen if we create an on-chain pool in 2019 with our stable swap invariant? Uh we see that we are perfectly reserved. We have the best slippage. So, if people swap back and forth, we respect the price of one. Now, fast forward 7 years and the price is 1.

3. Our pool has less Swiss francs, more dollars, and here we're far from the center where we initially were. That means that we give worse slippage. So, whenever people swap, they get less token than they could if the pool would be perfectly centered. So, what can be done here?

We can say, "Okay, now we want to recenter our pool. We want to act so that 1.3 is in the center of the pool." We can do that. Mathematically, we actually just shift uh rescale the reserve variable and then we recalculate the invariant.

But, what happened here is that the new position yields lesser invariant than it was. We actually fixated the impermanent loss. We rebalance the pool. We now are in the center and we give the best possible slippage, but we lost some value. So, here is the animation of what happens in the pool.

People trade back and forth and when they trade, they leave some reserves in the pool, meaning that invariant goes up. Uh however, when pool decides to recenter, it loses some value and invariant will go down. So, the source of loss in on-chain AMM is this rebalancing. When you say the new fair price is now this and I want pool to work around this price, and this means you you lose value doing so. And pool earns when people swap inside it.

So, they come, they leave the fees. And it can be arbitrageur who comes from external market and brings you information of the fair price, and at the same time moves your pool. And it can be organic users who just want to unwrap all from sell some stable coins. Uh another source of AMM income could be the referral. It's something that we do at Curve that facilitates this rebalancing from side of asset issuer.

So, literally asset issuer will pay so that the pool now provides best slippage, and this way rebalances. Uh sometimes this is justified, cuz if you rebalance the pool, it gives you better slippage, more users come, more fees, and it's kind of offsetting the costs. Now, what do we want from our own chain AMM applied to Forex? We want it to perfectly track external price with its center, because this is where we get the best slippage. And uh we want it to be automatically.

We cannot just say, "Okay, now we rebalance." Well, we can if we use other protocols, but at Curve we want the full autopilot. We want the AMM to just itself automatically follow external markets. And it should not leak value to arbitrageurs. It For this, it should protect itself with the fees.

It should have a good rebalancing strategy. And uh now I will show you the live example of the Swiss franc pool, the franc in coin, on the Curve. Uh here we can see that uh fair price around 1.3. The red line is external true price of the Forex market, and we can see the liquidity concentration in the half percent bins.

That means that, for example, at this image, if you swap $40,000, you move price half percent. So, this is exactly this liquidity concentration you can see here. I know the model access. No video. Uh no worries.

I have it in the very end of the GIF animation that doesn't need any access. Uh so, we can see here that the liquidity follows the true price because arbitragers come, they can always buy in the pool cheaper than the market. So, they move the pool center. Uh Uh we can see that there is this refueling budget where fronting coin team added some funds so that the pool tracks better. And uh we also saw that the liquidity rose because this was the pool that had adjusted a parameter somewhere in between.

But, the idea is that the pool there tracks very nicely the the external price. So, how do we design a pool that tracks with its liquidity center the external price perfectly? Well, if we just deploy any random pool, we say, "Okay, here is our A parameter. Here is now no refuels, and we fix some fee." And then we just play it around, and we simulate it against the arbitragers that kind of trade into the pool if they have profits doing so.

We can have this picture. What we see here is the true price of Swiss franc, and this yellow line is this pool center position, the mathematical one that gives you the best slippage. And if we just pick any random pool with any parameters, we might have a result like this where our pool kind of exists, but it does not provide the best possible slippage all the time. And we can see that parameters yield so that over 8 years arbitragers just do thousand swaps, so the pool isn't really active. And the if you swap like if this pool has $1 million, and you swap 5% of this size 50,000, your slippage will be 3% on this.

So, pool works, it's automated market making, but it does not behave optimally. Now, if you select other parameters, let's say we want a bit lower A, this concentration value of the stable swap invariant. Uh the pool is a bit more active, arbitrageurs brought uh 8,000 swaps, but the slippage actually got worse because you re- reduced the A, that means that you're now in slippage situation. Now then, if we do some magic called optimization, we find that with A equal 50 and some re-fuel, your pool center mathematically will follow the Forex market precisely, meaning that at every moment of time the pool guarantees that the center is exactly the price and you get the best possible slippage. So, you see that with these parameters, if I swap the 5% of pool TVL inside, what I will pay is exactly equal to the fee.

So, it's you're you're in no slippage situation, you're at the stable swap uh that behaves exactly as constant sum. And whenever price shifts a bit, you re-center it smartly. So, how do you do that? Well, you can just brute force all parameters or you use some numerical optimization, but what we do, uh we just do the grid searches. And here is the grid search where for context, to simulate such pool, it's I don't know, second or two on a some MacBook, so it's not very extensive.

Now, here is grid of 60 32 by 32 pools, which is like 1,000 pools. On Y axis, we have this A parameter, the pool concentration, and on X axis is the fee of the pool. And we see that in such grid, if we fix that there is no refill in the pool, so the asset issuer doesn't sponsor the rebalancings, we see that the price difference is around 5%, which actually is like it's somewhere around this. So, whatever we do, if we don't refill the pool, it doesn't behave nicely. Now, we say that the refill is 3% means that asset issuer have to refill the pool with some assets to facilitate the rebalancings.

3% means it's a 3% of TVL annually. And we see that now in this in this grid of the A versus the fee, we have some patterns emerging. We see that if we pick A around 50, it will yield the best profitability for the LPs in the pool. So, when people come and add money into the pool, uh you don't overspend on the donations on the refills. Also, we can see that here the price difference has a um front where you see that it's below 1%, meaning your pool has centered uh around the price at all times.

So, we are free to pick some parameters. If asset issuer says we want the pool that takes 10 basis point fees on every swap, we tell them, "All right, then you take a pool with your liquidity centered with A equal 40." Uh so, the grid there was just A against out fee. These are two parameters, and if you do a grid density of 32, and you have thousand pools. The thing is, when you design an AMM, it's very hard to have a code that relies on two parameters.

In fact, we have around 15 of those, and if you run some quick pass, 15-dimensional grid of whatever density is a lot of compute. So, you will not handle it with purely a MacBook. And uh what we do is a multi-dimensional uh computation sweeps across variety of parameters and here you can see the interface where I just sweep through various rebalances rebalancing and I can see many metrics that we track when we deploy on chain pools there's at least 10 metrics that I have to analyze very carefully we see them changing and it's our job to actually do the proper back testing for each FX pair and to figure out the optimal parameters to deploy the pool. So what does this procedure give us? We have an AMM that is entirely passive that doesn't need to be actively market made that just behaves perfectly for this pair and from asset issue what is needed is to just provide their fuels on time.

So this can be programmatically set that they deposit the whatever percentage is optimal to streamer smart contract and they have a on chain venue that provides low slippage that respects external price that automatically manages your liquidity around the center of the price. And this can be used of course for Forex pairs I showed you the example of the frankencoin where some Euro Indian rupee Brazilian real interestingly I think lately someone deployed some uranium RWAs on curve we have some real estate tokens as well and we have sophisticated device strategies that use it for leveraging for example yield bases. I think I covered the entirety of it in 15 minutes. Yeah. Thank you for your attention.

I hope you liked it.

Automatic transcript — names and jargon may be misspelled.