πŸ‰Creating a new trader agent

In order to create a new trader agent, follow the steps below :

Clone the prediction-market-agent repository

git clone https://github.com/gnosis/prediction-market-agent.git

Copy .env.example as .env and fill in the variables

Step-by-Step Guide to Creating and Registering a New Agent

Step 1: Import necessary modules:

# From https://github.com/gnosis/prediction-market-agent/blob/main/prediction_market_agent/agents/coinflip_agent/deploy.py
import random
import typing as t
from prediction_market_agent_tooling.deploy.agent import (
    Answer,
    DeployableTraderAgent,
    Probability,
)
from prediction_market_agent_tooling.markets.agent_market import AgentMarket

Step 2 : Create a new class DeployableCoinFlipAgent that inherits from DeployableTraderAgent:

Step - 3 : Register your class in the file run_agent by editing the variables RUNNABLE_AGENTS and RunnableAgent

Step - 4 : Run the agent with the following command

You can replace trader_agent with the new agent's name and omen with the desired market type.

New Research Options or Betting Strategies

This can be done if you want to investigate new research options or betting strategies (by updating the function answer_binary_market) or try out new frameworks (refer to the Think Thoroughly agent, for an integration with CrewAI).

Last updated