gnosis / prediction-market-agent-tooling

Tools to benchmark, deploy and monitor prediction market agents.
GNU Lesser General Public License v3.0
18 stars 4 forks source link

Check for liquidity in verify_market function #480

Closed kongzii closed 1 month ago

kongzii commented 1 month ago

In the verify_market of DeployableTraderAgent we check for many things (is predictable, not recently traded, etc.), but we don't check for liquidity.

I just created a market with 0.01 xDai in liquidity https://presagio.pages.dev/markets?id=0x2db2fc2e77d1a8e5fb6b72fc5875c837cbfc0511.

If I try to buy shares worth more than 0.5 xDai, the agent is immediately in loss.

In theory, someone can bulk-create tons of markets cheaply (only transaction costs + tiny liquidity) and steal money from our agents thanks to fees.

I didn't try if Kelly takes correctly this into account, but we still support MaxAccuracyBettingStrategy with fixed bet size, where this would be a problem for sure.

As a quick fix, we can add a threshold check for liquidity (maybe based on maximal allowed bet amount?)

Screenshot by Dropbox Capture

kongzii commented 1 month ago

As discussed on Slack, fixed by checking for liquidity in MaxAccuracy betting strategy: https://github.com/gnosis/prediction-market-agent-tooling/pull/488/files

Other strategies don't have this problem, because they are taking market's liquidity into the equation.

Otherwise, this will be fixed as part of https://github.com/gnosis/prediction-market-agent-tooling/issues/411, where we will be able to pick specific markets according to any criteria.