Skip to content

A quickstart for the trader agent for AI prediction markets on Gnosis

License

Notifications You must be signed in to change notification settings

jhehemann/trader-quickstart

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

trader-quickstart

A quickstart for the trader agent for AI prediction markets on Gnosis at https://github.com/valory-xyz/trader

System Requirements

Ensure your machine satisfies the requirements:

Resource Requirements

  • You need xDAI on Gnosis Chain in one of your wallets.
  • You need an RPC for your agent instance. We recommend https://getblock.io/.

Run the script

Clone this repository locally and execute:

chmod +x run_service.sh
./run_service.sh

Once the command has completed, i.e. the service is running, you can see the live logs with:

docker logs trader_abci_0 --follow

To stop your agent, use:

cd trader; poetry run autonomy deploy stop --build-dir trader_service/abci_build; cd .. 

Observe your agents

  1. Check out this handy app: https://predictions.oaksprout.repl.co/

  2. Use the trades command to display information about placed trades by a given address:

    cd trader; poetry run python ../trades.py YOUR_SAFE_ADDRESS; cd ..

    Or restrict the search to specific dates by defining the "from" and "to" dates:

    cd trader; poetry run python ../trades.py YOUR_SAFE_ADDRESS --from-date 2023-08-15:03:50:00 --to-date 2023-08-20:13:45:00; cd ..
  3. Use this command to investigate your agent's logs:

    cd trader; poetry run autonomy analyse logs --from-dir trader_service/abci_build/persistent_data/logs/ --agent aea_0 --reset-db; cd ..

    For example, inspect the state transitions using this command:

    cd trader; poetry run autonomy analyse logs --from-dir trader_service/abci_build/persistent_data/logs/ --agent aea_0 --fsm --reset-db; cd ..

    This will output the different state transitions of your agent per period, for example:

    Trader FSM transitions

    For more options on the above command run:

    cd trader; poetry run autonomy analyse logs --help; cd ..

    or take a look at the command documentation.

Update between versions

Simply pull the latest script:

git pull origin

Remove the existing trader folder:

rm -rf trader

Then continue above with "Run the script".

Advice for Mac users

In Docker Desktop make sure that in Settings -> Advanced the following boxes are ticked

Docker Desktop settings

Advice for Windows users

We provide some hints to have your Windows system ready to run the agent. The instructions below have been tested in Windows 11.

Execute the following steps in a PowerShell terminal:

  1. Install Git and Git Bash:

    winget install --id Git.Git -e --source winget
  2. Install Python 3.10:

    winget install Python.Python.3.10
  3. Close and re-open the PowerShell terminal.

  4. Install Poetry:

    curl.exe -sSL https://install.python-poetry.org | python -
  5. Add Poetry to your user's path:

    $existingUserPath = (Get-Item -Path HKCU:\Environment).GetValue("PATH", $null, "DoNotExpandEnvironmentNames")
    
    $newUserPath = "$existingUserPath;$Env:APPDATA\Python\Scripts"
    
    [System.Environment]::SetEnvironmentVariable("Path", $newUserPath, "User")
  6. Install Docker Desktop:

    winget install -e --id Docker.DockerDesktop
  7. Log out of your Windows session and then log back in.

  8. Open Docker Desktop and leave it opened in the background.

Now, open a Git Bash terminal and follow the instructions in the "Run the script" section as well as the subsequent sections. You might need to install Microsoft Visual C++ 14.0 or greater.

About

A quickstart for the trader agent for AI prediction markets on Gnosis

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 57.7%
  • Python 42.3%