CustomSwap™ by Boot Finance
Medium Article written for Boot Finance
Steel or Silver sword?
We’re great fans of the Witcher series by Andrzej Sapkowski. It is an epic fantasy tale of monsters and magic, set in the medieval-ish world full of adventures and intrigue. The series traces the story of a monster hunter, or a witcher, named Geralt of Rivia. You’ll find that Geralt always straps two swords behind his back — one made of silver and the other made of steel. The silver one is meant to slay monsters but what about the steel? It’s for anything else.
Geralt’s choice of swords to wield in different situations intrigues us. In the crypto world, constant product AMMs like Uniswap and Sushiswap dominate the DEX market today. To us, this is like fighting monsters and men with just one sword.
Does it work? Certainly.
But is it the most effective? Not necessarily.
The success of protocols with a constant product AMM, like Uniswap, makes people think that this is the default swap curve to go to. It had been tried and tested, so why fix something that is not broken?
Look at this article here. It clearly lays out the evidence that when the swap curve changes for the same underlying asset pairs, the volatility changes visibly. What if there is a way to strap two swords on your back, like Geralt of Rivia, using a steel sword to slay bandits but switching to the silver one for killing monsters?
The Two Common Swap Curves
Currently, there are 2 swap curves that are widely used throughout DeFi:
Constant product swap curve — used for almost all assets e.g. Uniswap
Stable swap curve — used for assets pegged to one another e.g. Curve
To be like Geralt of Rivia, we not only have to know how to use the two specialised swords, but more importantly, we must know precisely when to use them. To do that, we have to first know the strengths of each sword.
A constant product swap curve allows prices to move faster than a stable swap curve. This is good for allowing the price of a token to go up only. Imagine a horse with free rein of where it wants to gallop — that’s the constant product swap curve for you.
A stable swap curve results in a very small deviation from a peg, so it is good at dampening price movement. This is good at preventing the price from moving too far up or down a certain price. Imagine tying a horse to a pole with an…. elastic cord. As the horse moves too far away from the pole, the cord pulls it back a little, slowing it down.
Introducing Custom Swap Curve
With Boot Finance protocol, it is possible to add in two or more swap curves instead of just relying on one, like most AMMs. The pool can be customized so that it uses a specific swap curve at a particular price range. It can even be adjusted on the fly with no adverse effects on existing liquidity providers in the pool. With this level of customisation, we can encourage the pool to behave differently according to the price objectives set by the project.
Let’s say we have a token that ICO at $1. We want a token to go up only (who wouldn’t?). A constant product swap curve is set above $1. This allows the demand of the token to drive the price action upwards. For any price below $1, we can set a stable swap curve to provide a dampener to the price in the event of huge selling.
However, like a silver sword that can slay monsters easily, it is also brittle and may break at the most inopportune time. For the most part, perhaps 95% of the time, a custom swap curve in the example above will be able to absorb and dampen the selling pressure. If the selling pressure intensifies, like what we saw in May 2021, the price of the token will experience a fall steeper than the gradual decrease if a constant product swap curve is used instead. That is the cost for the price floor dampening effect offered by a custom swap curve.
We still think it’s worth it because very rarely do the market crash with that level of intensity.
We don’t build a bridge that can withstand all types of load scenarios at all times; we build one that can withstand the most likely load scenario and live with the risk.