How to Run a Trader Bot
Step-by-step guide to launch your trading bot
⚠️ Prerequisites
- trader-ppss.yaml file downloaded from the creation page
- Ethereum/Ocean private key (starting with 0x...)
- Docker installed (Option A) OR Python 3.11+ (Option B)
- Sufficient funds on the chosen network (testnet/mainnet)
Option A: Run with Docker (Recommended)
Simplest and most isolated method
1. Create a working directory
mkdir trader-run && cd trader-run2. Place your trader-ppss.yaml file
Copy the downloaded trader-ppss.yaml file into this folder.
3. Export your private key
export PRIVATE_KEY=0xYOUR_PRIVATE_KEY_HERENEVER commit your private key to Git. Do not store it in a file.
4a. Run with docker run
docker run --rm -it \
-e PRIVATE_KEY=${PRIVATE_KEY} \
-v $(pwd):/work \
ghcr.io/oceanprotocol/pdr-backend:latest \
pdr trader /work/trader-ppss.yaml testnet4b. OR run with docker-compose
If you downloaded the docker-compose.yml:
docker compose up -dView logs: docker compose logs -f
Stop: docker compose down
Option B: Run with Python CLI
For developers familiar with Python
1. Create a virtual environment
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate2. Install pdr-backend
pip install pdr-backend3. Export your private key
export PRIVATE_KEY=0xYOUR_PRIVATE_KEY_HERE4. Run the bot
pdr trader trader-ppss.yaml testnetLogs & Troubleshooting
View logs (Docker)
docker compose logs -f traderCheck outputs
Results are saved in the specified directory (out_dir in trader-ppss.yaml).
Common errors
- PRIVATE_KEY not defined: Check the variable export
- Insufficient funds: Fund your wallet on the network
- Strategy error: Check that the strategy is supported
- Cron error: Check the cron schedule format
- Permission denied (Docker): Add your user to docker group
Monitor Performance
Monitor regularly:
- Logs to detect errors
- Output files (executed trades, performance)
- Wallet balance (gas consumed, profits/losses)
- Strategy metrics (win rate, drawdown, etc.)
💡 Tip
Always start with a low stake and increase gradually after validating the strategy over several days/weeks.
Update the bot
Docker
docker pull ghcr.io/oceanprotocol/pdr-backend:latest
docker compose restartPython CLI
pip install --upgrade pdr-backendSwitch to Mainnet
⚠️ Warning
Before switching to mainnet:
- Test your bot thoroughly on testnet for several days
- Analyze real performance (win rate, drawdown, Sharpe ratio)
- Check your funds and gas fees on mainnet
- Start with a low stake
- Monitor 24/7 for the first 48 hours
- Set up alerts (low balance, repeated errors)
To switch to mainnet, recreate your trader-ppss.yaml with network: mainnet, and run withmainnet instead oftestnet in the commands.