Simple stable coin market making bot

A while ago I created a simple market-making bot for stable coins.
It would simply place orders for stable coins at a price slightly above 1:1. I had it running on Mainnet and on Gnosis Chain.

On GC it turned $3000 into $6,965.321
blockscout .com/xdai/mainnet/address/0x89145F922BB420453bCd8a7Be87dA830C0941f22/token-transfers

explorer.cow. fi/gc/address/0x89145F922BB420453bCd8a7Be87dA830C0941f22

On mainnet it turned $200k into $214k
https://etherscan . io/address/0xe63A13Eedd01B624958AcFe32145298788a7a7BA#tokentxns

The script is really quick and dirty - there are many improvements possible.

E.g.
a) stability - it gets stuck once in a while, so as you can see from the addresses - most of the times the bot has not been running.
b) use partially fillable orders - that was not available when I made the script roughly half a year ago - now it is and it should allow the COW protocol to use those orders much more often and prefer using them over e.g. Curve or UniV3

If you decide to give it a try to run a market making bot I very much recommend reaching out to the COW-protocol team. Likely there are many things possible to increase the usage of market makers vs. onchain liquidity.
Strategically it needs to be a goal of COW-protocol to use external liquidity as little as possible and internal liquidity as much as possible.

The dirty python script is here:
gist. github .com/koeppelmann/819313de804a6705b90fb4f330d0a845
And here the general docs about how to create orders via the API:
docs.cow. fi/tutorials/how-to-submit-orders-via-the-api

(P.S: had to break the links - as a new user I was only allowed to do 2 links)

9 Likes

What I like of this proposal, is that, because in CowSwap sending an order is free, and because you never pay for reverted transactions, and you know the fee upfront, and this fee is not in Ether but is in the sell token, you can actually market make risk free!

1 Like

Could you elaborate more on why and how to reach out to the team if you want to market make on CowProtocol?

I think the why is clear, if you feel you can efficiently run a market-making strategy. The how, i would recommend CowSwap

Would it be possible to elaborate on what internal vs. external liquidity means in the context of CowSwap?