Cross Chain CoWs - CoW^3
Introduction
This post opens the initial discussion for an ambitious project to make CowSwap cross-chain. On-chain trading is rapidly becoming multi-chain. Currently, tokens are traded on many different networks in silos. CowSwap has up till now made the multi-chain efforts isolated as well, where the Ethereum and Gnosis Chain deployments are not connecting liquidity. As people are constantly bridging between various networks, there is an opportunity to find and service many more CoWs.
ChatGPT prompt: create a picture with the caption: Cross chain cows
Cross Chain Cow examples
Perfect 1-1 CoW without swaps
The simplest example of a cross-chain coincidence of wants is the following:
User A: Has 100 Dai on Ethereum Mainnet, and wants to use that on Gnosis chain
User B: Has 100 Dai on Gnosis Chain, and wants to use that on Ethereum Mainnet
Currently this means both users need to bridge from their respective networks to the other. When both of these users use Cross Chain CowSwap, these would both just be routed to transfer their Dai on their chain to the other user.
As can be seen in the above example, this would save 2 transactions, meaning ±50% of the gas cost. CoW DAO could decide to take a part of the savings in comparison to the bridging as revenue.
Perfect triangle without swaps
A slightly more advanced version of this is where there are three users, that can be combined into a coincidence of wants too:
User A: Has 100 Dai on Ethereum Mainnet, and wants to use that on Gnosis chain
User B: Has 100 Dai on Gnosis Chain, and wants to use that on Optimism
User C: Has 100 Dai on Optimism, and wants to use that on Ethereum Mainnet
This would again save 50% in transactions (6 → 3), so potentially up to 50% gas savings too!
Perfect 1-1 with swaps
Cross Chain Cows can also work to take advantage of users that would like to swap & bridge at the same time.
For example:
User A: Has 100 Dai on Ethereum Mainnet, and wants to get 0.05 ETH on Gnosis chain
User B: Has 0.5 ETH on Gnosis Chain, and wants to get 100 Dai on Ethereum Mainnet
The swapping transactions can be seen as additional order flow into the Cowswap deployments on those respective chains.
What if no perfect CoW can be found?
Just like regular CoWSwap, if no perfect CoW can be found, then that order will be done through a regular bridge, and users will just not get the additional benefit of the CoW, but they will still get same price execution as they would have if they would have used a bridge directly.
Cross-Chain Security Options
This all may sound great, but it has to be secure in order to be usable. If the Cross chain cow protocol has made a transaction on Mainnet to move funds from User A to User B, then the opposite transaction MUST be included in the other chain, and be final.
Luckily, many projects have already made solutions for this. Here are a couple of options (this would need a lot more research before implementation):
1: Insure in-transit tokens, with liquidity provision
Let Liquidity providers take the risk of cross chain failures, and let them put up collateral that would be used throughout the protocol. The advantage of this form of liquidity provision is that users would be able to always get a CoW.
2: Use Maker style fast confirmations
MakerDAO’s teleport (on halt at the moment) project allowed fast withdrawals of Dai. They were able to do this, as they are the minting facility of DAI. A similar token set-up could be created to enable the cross chain security of the CoW^3
3: Use Chain link’s CCIP
Chainlink has a cross chain interoperability protocol. Not sure if this would suit that protocol exactly, but it should be looked into.
Discussion
In general I think that some project will try to accomplish something like this, I personally just think CoW Protocol is well suited to fullfill this role, as it would fit its mission well. So I ask the community:
- Does this interest the CoW DAO?
- What would the community like to see before moving something like this into implementation?