Market making on Gnosis Protocol (Cowswap)

So far we have put the communication focus of GP on “COWs” - (coincidence of wants) between users. However - active market making becomes more and more relevant in crypto. After the initial break trough success of simple AMMs (Uniswap v1 + v2), Uniswap v3 is already much closer to active market making.

With some “flash bot searchers” adding concentrated liquidity just targeted for a specific trade one can argue that this is simply an inefficient implementation of an order book. On the other hand liquidity in AMMs remains massive - so GP offers a very smooth way to combine order books and on-chain AMM liquidity.

While one can place limit orders (“standing orders”) into the GP orderbook it is actually possible to simply listen to the order book and only place orders as needed after a user already placed an order.

I wrote an experimental script that will listen to the xDAI order book and it will create “counter-orders” for any “stable coin-stablecoin” trade that accepts a rate of worse than 1:1.

All you need is to give GP upfront allowance and insert your private key into the python script.

Happy arbitrage!

4 Likes

2 updates:

Improved the script a bit with more exception handling.
Also - changed the strategy to posting limit orders even if only one of the tokens of the order in the system is a stable coin. So if e.g. a user is selling random token x for e.g. Tether my script anticipates that the settlement route might be: x -> wxDAI -> Tether or x-> USDC -> Tether and thus places sell Tether orders against other stable coins.

You can track the “success” of this script here:
https://blockscout.com/xdai/mainnet/address/0x89145F922BB420453bCd8a7Be87dA830C0941f22/token-transfers
I deposited $1000 wxDAI $1000 Tether and $1000 USDC initially - after one weekend of trading it did already >400 trades and >$100 in profit :slight_smile:

Still hoping someone will outcompete me soon :money_mouth_face:

2 Likes