A quickstart for the trader agent for AI prediction markets on Gnosis at https://github.com/valory-xyz/trader
Ensure your machine satisfies the requirements:
- Python
== 3.10
- Poetry
>=1.4.0
- Docker Engine
- Docker Compose
- You need xDAI on Gnosis Chain in one of your wallets.
- You need an RPC for your agent instance. We recommend https://getblock.io/.
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 ..
-
Check out this handy app: https://predictions.oaksprout.repl.co/
-
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 ..
-
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:
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.
Simply pull the latest script:
git pull origin
Remove the existing trader folder:
rm -rf trader
Then continue above with "Run the script".
In Docker Desktop make sure that in Settings -> Advanced
the following boxes are ticked
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:
-
Install Git and Git Bash:
winget install --id Git.Git -e --source winget
-
Install Python 3.10:
winget install Python.Python.3.10
-
Close and re-open the PowerShell terminal.
-
Install Poetry:
curl.exe -sSL https://install.python-poetry.org | python -
-
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")
-
Install Docker Desktop:
winget install -e --id Docker.DockerDesktop
-
Log out of your Windows session and then log back in.
-
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.