Closed MartinquaXD closed 4 months ago
Pre-requisite for https://github.com/cowprotocol/services/issues/2755
I wouldn't suggest doing that for the soon legacy CoW AMM pools (that are created via the factory) but instead focus on the Balancer created CoW AMM. At least the code should allow to easily add new types of creating CoW AMMs that get indexed.
Absolutely. But overall I don't expect the infra to be built to change in any meaningful way when we have to switch over to balancer developed cow amms. This issue is intended to make us ready from day one to include these pools instead of scrambling to add support after they get launched officially and until then we might as well index the current version of cow amms.
Background
Currently we have to maintain a list of existing CoW AMMs. This is error prone and also just annoying. Instead we should add have a single
CLI
argument to pass the CoW AMM factory contract and "listen" for Deployed events. That way we automatically know about any new pool that gets deployed.As the first step I would simply refetch all such events since contract deployment on every restart (to get the ball rolling). If this takes too much time we can consider persisting these events in our DB like we do with other events. For related code check the
EventHandler
andEventUpdater
.