gnosis / prediction-market-agent

GNU Lesser General Public License v3.0
22 stars 4 forks source link

Allow submitting of jobs for general agent(s) #314

Open kongzii opened 2 months ago

kongzii commented 2 months ago

Let's say we have deployed 50 agents, and they are just doing their stuff. Would be cool if people could submit (paid) tasks for them. This way, general agents can be useful and earn money in many ways.

There could be a smart contract functioning as a priority queue -- higher the collateral token reward (wxDai) for the agent, the higher the priority.

Such task would consist of

  1. Title
  2. Detailed description
  3. A reward for completing it

In the ideal world, the agent would have all the tools and knowledge to execute the tasks. In the real world, people would probably need to publish some tool to the marketplace (or PR to PMA repository until the marketplace is live).

In the end, I see two benefits why this could be useful:

  1. In the optimistic future, the agent would need only the description to execute the task. So this would be like a no-code no-server-needed cronjob for people.
  2. Even now, if someone implements a tool and publishes it, he/she can ask the agent to execute it (even repeatedly, let's say, every day). So developers don't need to provision their own servers to run their cronjobs.

All should be developable locally, and once it works locally with our Streamlit demos, they can publish the tasks openly.


Agents could also accept Circles as a way of payment to execute tasks. Providing a "free" way to debug and start with this.


This would need more thinking and polishing details, but generally, I think it could work and give us a not-so-hard-to-achieve product goal. Also, if everyone likes the idea, it would be cool to present it on DevConflict.


Later, these agents can be deployed to Olas. People can easily run them, earn their tokens, other people can submit jobs to them, and earn from that as well!

kongzii commented 1 month ago

For distributing rewards for completing tasks we can use reality.eth, a quick thought but probably would work:

At the same time the job is submitted, an question like "Job X was completed by date Y" on reality.eth is created as well, with the challenging window set to amount of days until Y from the given moment, and the job creator will answer it with NO and bond the reward for the agent for completing the job.

Once the job is completed, the agent challenges the answer to YES.

If the agent wins the question, it gets his reward.

kongzii commented 1 month ago

Possible use cases for jobs that come to mind right now:

  1. Buy and send me X GNO if the price drops below Y.
  2. Send me a research report to a@b.com about topic X.
  3. Implement and open PR for issue X on repository Y.
  4. Invest my 100 xDai on the Omen platform and send me the profit.
  5. Run the function X from my library Y once a day.
  6. ???

This isn't the reproducibility this issue had in mind, but such jobs could benefit from agents being able to spawn {short, medium}-living children https://github.com/gnosis/prediction-market-agent/issues/213.

evangriffiths commented 1 month ago

I think this is a great idea! It would be a nice front-end/web app to demo the functionality our agents already have. And we could keep the queue busy by offloading some of our cron jobs/mech calls to it (e.g. "create me a market on Omen with the title ...")

Invest my 100 xDai on the Omen platform and send me the profit.

Although these tasks that require moving funds from the user's wallet... not sure how that would work.

At the same time the job is submitted, an question like "Job X was completed by date Y" on reality.eth is created as well

I like this approach

kongzii commented 1 month ago

Created sub issues for this so we can divide the work in the future.

This is the one we agreed to do if we have time before Martin comes: https://github.com/gnosis/prediction-market-agent/issues/375

And these will be needed if we want to implement this completely:

kongzii commented 3 weeks ago

Adding here this from the Gnosis' white paper:

image

So, instead of creating a new contract for holding the tasks, they can be created as prediction markets. We can create a new category for it and agent can query them etc. just as we wanted. At the same time, it boosts prediction markets.

I think this would be the way to go.

kongzii commented 4 days ago

I added comments to the other issues related to this milestone. But to wrap it up here:

gabrielfior commented 4 days ago

Finishing the task == Buying all the YES tokens (thus moving probability to 100% YES)

I think this already avoids having multiple agents working on the same task, since a 2nd agent would not be financially incentivized to complete the task.

kongzii commented 4 days ago

I think this already avoids having multiple agents working on the same task, since a 2nd agent would not be financially incentivized to complete the task.

I'm not sure if you mean this as a good thing or a bad thing?

For me, it's a good thing.

gabrielfior commented 4 days ago

Good thing!