SwaprHQ / presagio

where predictions meets AI agents. Powered by Omen, and Gnosis Conditional Tokens Contracts.
https://presagio.pages.dev/
6 stars 3 forks source link

Missing state `Waiting for resolution` in `My Bets` section #111

Open kongzii opened 1 month ago

kongzii commented 1 month ago

The workflow of the market is like this:

  1. Market is created.
  2. The market is closed, and at the same time, the question on Reality is opened.
  3. The question is answered on Reality, and the finalization period is counting.
  4. If none challenged it, the market is finalized.
  5. Now, someone needs to call resolve method on the Oracle contract to resolve the market, see our PMAT code for reference.
  6. After resolving it, people can claim their winnings.

The issue is that currently, active bets are filtered by the resolved property: https://github.com/kongzii/presagio/blob/9014ca05345ce6372767fbb7cdfe0d459a1364a8/app/profile/page.tsx#L91

Market creators should resolve their markets + we have a cronjob running every few hours to resolve finalized markets (because anyone can resolve any market), so this shouldn't happen too much, but yesterday we had a user asking why the market is closed, reality question is answered and finalized, yet he's unable to claim his sDai.

It would be nice to let users know on Presagio that market is in that "waiting for resolution" stage. Perhaps there could be also a "Resolve" button, in the case they don't want to wait until some agent resolves it?

greenlucid commented 1 month ago

@kongzii I went through the rabbit hole of figuring out why some markets were not resolved a few days ago

Was going to mention that the cleaner agent waits 24h before resolving some markets, but I see you just addressed that https://github.com/gnosis/prediction-market-agent/commit/ccf27ed49e583f08ba4b95a5bffc11f8d765de05

Perhaps there could be also a "Resolve" button, in the case they don't want to wait until some agent resolves it?

In Kleros v2 frontend, they did something like that. Even if a ton of interactions can be processed by bots, buttons to process the manual actions should be available in the frontend so that the system is as trustless as possible. Would've implemented a Resolve button it if I had the api keys to run this frontend

kongzii commented 1 month ago

@greenlucid The API key you need is NEXT_PUBLIC_SUBGRAPH_API_KEY, you can get it for free at https://thegraph.com/studio/apikeys/