Coder Social home page Coder Social logo

0xardi / trader-quickstart Goto Github PK

View Code? Open in Web Editor NEW

This project forked from valory-xyz/trader-quickstart

0.0 0.0 0.0 305 KB

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

License: Apache License 2.0

Shell 49.30% Python 50.70%

trader-quickstart's Introduction

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

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 ..
  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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.