You’re probably familiar with the concept of first-mover advantage. That is, whoever can bring an idea to market first will reap outsized rewards. One such example is Uniswap - the constant product market maker innovation and the ability for anyone to create their own liquidity pools made Uniswap the biggest DEX. But it’s also easier to take a slice of an existing market than to develop a new one, and the advantage here is in a potentially more refined, attractive execution of an idea.
One of the most anticipated projects in DeFi market-making, CrocSwap is poised to become a liquidity provider’s favorite DEX. Founder Doug Colkitt started his career at Citadel as a high-frequency trader and has recently been working on MEV searching. There are very few people who know as much about electronic markets, but don’t take my word for it. If you like betting on teams, I’d bet on one led by Doug.
You can read the CrocSwap whitepaper if you want a more technical, comprehensive explanation of all the features, but I’m going to focus on a few reasons I’m excited for CrocSwap.
#1: Overall architecture
The protocol architecture is designed, at every stage, with gas optimization in mind. CrocSwap and all of its liquidity pools reside on one smart contract, as opposed to other DEX protocols that deploy a new contract for each pool created. This unique single contract architecture sidesteps numerous gas-intensive transactions. For instance, contract deployment (e.g. for an LP position on a different DEX) requires a lot of gas (32,000 gas for the create operation and 21,000 gas for the transaction on the block = 53,000 gas before you even do anything), so eliminating unnecessary transactions, especially gas intensive ones, is definitely appreciated.
The single contract architecture also means that all capital for all pools resides in one location. This could provide a welcome innovation in DeFi - margin trading functionality. Margin trading is possible on centralized exchanges because the exchange has access to the capital that’s deposited as collateral. On a traditional decentralized exchange, the capital distributed across the different pools lives on different contracts, making this much more difficult. So with single contract architecture, it’s possible that balances stored internally could be used as collateral for margin.
Additionally, most DEX protocols, whether they accrue fees as the LP token (e.g. Uniswap v3) or a native governance token (e.g. most Uniswap forks, like Sushiswap), do not automatically reinvest those rewards into the pool (side note: Uniswap v1/v2 does because all liquidity is in one pool, but Uniswap v3 can’t). So yield farming requires active management - harvesting yield (costs gas) and reinvesting that yield (costs gas). On a protocol like Sushiswap, where rewards are accumulated in the protocol’s native governance token, it’s even worse, because you’ll also need to swap (costs gas) some or all of your accrued $SUSHI for the tokens that comprise your LP.
Instead, CrocSwap fee rewards are automatically reinvested, which is much more capital efficient and brings me to my next point.
#2: Relationship between concentrated and ambient liquidity
CrocSwap employs what they call a hybrid liquidity model, combining ye olde unbounded constant-product “ambient” liquidity a la Uniswap v2 with that new new concentrated liquidity pioneered by Uniswap v3. The main impact of this model is to enable compounding rewards - rewards from fees from concentrated liquidity are automatically reinvested into the ambient liquidity pool. Additionally, external contracts that interact with CrocSwap pools will be able to easily determine the composition of the liquidity in the pool - that is, how much is active, or concentrated, and how much is passive, or ambient. This could give people an idea of who is providing liquidity and help gauge risk.
#3: Permissioned pools
CrocSwap will allow for the creation of permit oracles, which provide a way for external contracts to control certain pool settings, such as who can access the pool. You can easily enforce allowlists stored outside CrocSwap, allowing only certain users to swap or certain users to LP. This gives CrocSwap a lot of novel utility, and it’s not difficult to imagine some interesting use cases - making private markets, managing capital raises, etc.
#4: Protocol gating for just-in-time (JIT) liquidity
This can get technical, but you should be able to follow along as long as you have a basic understanding of DEX mechanics. Like other MEV topics, JIT liquidity is complex and affects different market participants in different ways. The basic idea for someone trying to initiate a JIT liquidity attack is this:
Identify large upcoming swap transaction in mempool
Deposit significant amount of liquidity into the LP pool, paying higher gas to ensure the liquidity deposit transaction will be processed before the large swap transaction
After swap transaction processed, remove liquidity from pool
All in the same block
To illustrate the impact, let’s take a simple example. Suppose a large $1m swap transaction for a given pair is in the mempool. The given pair has $20m of liquidity. So in the Uniswap model, LPers stand to gain $3000 for this transaction (0.3% fee x $1m transaction), proportional to their ownership of the pool.
But if I’m a JIT liquidity bot, maybe I want to grab some of that $3000 for myself. So I’ll deposit $20m, crank up the gas, and now there is $40m of liquidity in the pool by the time the $1m transaction hits. When the $1m transaction hits, $3000 is distributed evenly to LPers, only now, 50%, or $1500, of that is going to me, the JIT bot, because I provided half the liquidity to the pool. Now, as a JIT enjoyoor, I don’t want to stick around providing liquidity to that pool. Too much risk, as I don’t want to expose myself to potential losses or tie up my capital. So I leave the pool, having effectively siphoned 50% of the fees from the passive LPers on a huge transaction. And as long as my share of the fees is larger than my gas costs to perform the JIT attack, it’s worth it:
Again, this is a simple example that ignores slippage and perhaps other non-trivial nuances, but that’s the gist of it, and it’s pretty sustainable. Here’s a graph showing profits from two of the earliest JIT liquidity bots:
So the JIT liquidity bot is eating the lunch of anyone who was LPing that pool. Naturally, that would piss off the passive LPers - those who establish an LP position and just collect fees without active management. But the consensus is that JIT liquidity generally provides better execution for the trader executing the swap, and it’s not something the average market participant executing the swap would usually notice anyway. But taken to its logical extension, in the worst case scenario, nobody would passively LP, because their fees are simply being taken by JIT bots that risk less than they do. So what does this have to do with CrocSwap?
To take advantage of JIT liquidity and make CrocSwap attractive to JIT liquidity enjoyoors and passive LPers alike, CrocSwap introduces dynamic timing thresholds (aka a cooldown period) for concentrated liquidity pools that control the ability to perform JIT attacks (functionally, this is a timer from 0 to 255 seconds, where higher numbers make it so that the LP position cannot be withdrawn until the next block). This opens the door for the protocol to treat market participants differently, from which the CrocSwap governance tokens will derive value. For example, holders of more CrocSwap tokens could be entitled to lower timing thresholds, while nocoiners or bad actors may be technically prohibited from withdrawing their LP position until the next block.
It’s important to point out that protocol gating isn’t a bulletproof solution to JIT liquidity attacks, because it’s something that can only be tested in practice. For instance, how many profitable JIT attacks rely on the exit liquidity transaction occurring in the same block as the swap for them to be profitable? How many would actually be nerfed by having to wait until the next block? Playing this out further, we could see some sophisticated actors try to take advantage of such a delay, targeting the stalled JIT liquidity as an attack vector. Still, it’s an interesting idea that may offer a new battleground for MEV.
The CrocSwap team is pretty heads-down right now, preferring to build rather than engage heavily in marketing, but they’re planning to launch on multiple chains simultaneously, so whether you’re a maxi or not, it’s coming to you. Between the technical and architectural innovations developed by CrocSwap, it has the potential to bring some centralized exchange volume on-chain, which would be great for DeFi and great for decentralization in general. I think CrocSwap will establish a new standard for decentralized exchanges, and I’m excited to see how everything comes together in the next few months.
Special thanks to @0xfbifemboy for their input