Installation & Setup

Complete setup guide for pdr-backend and Prediction Submitter Manager

Step 1: Install pdr-backend Repository

1.1 Clone the repository

git clone https://github.com/oceanprotocol/pdr-backend
cd pdr-backend

1.2 Create virtual environment

python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

1.3 Install dependencies

pip install -r requirements.txt
export PATH=$PATH:.

1.4 Get Ocean contract addresses

mkdir -p ~/.ocean/ocean-contracts/artifacts/
curl https://raw.githubusercontent.com/oceanprotocol/contracts/main/addresses/address.json -o ~/.ocean/ocean-contracts/artifacts/address.json

1.5 MacOS only: Fix dependencies

# Fix sapphire.py
codesign --force --deep --sign - venv/sapphirepy_bin/sapphirewrapper-arm64.dylib

# Install xgboost dependency
brew install libomp

Step 2: Run Simulation (Highly Recommended)

2.1 Copy config template

cp ppss.yaml my_ppss.yaml

2.2 Run simulation

pdr sim my_ppss.yaml

The simulation will download historical data and run through many epochs, showing you predicted accuracy and estimated profits.

2.3 Visualize results (optional)

# In a separate terminal
pdr sim_plots

Opens a dashboard at http://127.0.0.1:8050 with real-time plots.

Step 3: Deploy Prediction Submitter Manager (Predictoor Only)

3.1 Export your private key

export PRIVATE_KEY=0xYOUR_PRIVATE_KEY_HERE

3.2 Deploy the contract (Testnet)

pdr deploy_pred_submitter_mgr my_ppss.yaml sapphire-testnet

This will deploy a smart contract and output its address. Save this address!

3.3 Deploy the contract (Mainnet)

pdr deploy_pred_submitter_mgr my_ppss.yaml sapphire-mainnet

You'll need a separate deployment for mainnet.

3.4 Copy the contract address

The command will output something like:

Deployed Prediction Submitter Manager at: 0x1234...abcd

⚠️ Copy this address! You'll need it when configuring your bot.

Troubleshooting Installation

Python version error

Make sure you're using Python 3.12. Check with: python --version

address.json not found

Verify the file exists: ls ~/.ocean/ocean-contracts/artifacts/address.json

Contract deployment fails

Check you have enough ROSE for gas. Get testnet ROSE from the Oasis faucet