cowprotocol / services

Off-chain services for CoW Protocol
https://cow.fi/
Other
198 stars 78 forks source link

chore: Filter out "empty" liquidity sources #2349

Open MartinquaXD opened 9 months ago

MartinquaXD commented 9 months ago

Background

Some solvers report Ignoring ill-defined AMM "3": Attempt to create an AMM with non-positive token balance. indicating that we are sending "empty" AMMs.

There are definitely some constant product AMMs that have either 0 or very little liquidity. It probably makes sense to filter out any pool that has < X$ worth of tokens in them.

Examples:

instance.json

Acceptance criteria

If an AMM does not actually have any liquidity we should not send it to the solver. Additionally we should not attempt to fetch its state again on the next block if it's empty.

blackbera commented 6 months ago

I will take a shot at this if the last PR wont be merged! @fleupold @MartinquaXD