# Check Rust
rustc --version # Should be 1.75+
# Check Python
python3 --version # Should be 3.8+
# Check PostgreSQL client
psql --version# Run setup script
./scripts/setup.sh
# This will:
# - Create .env file
# - Install Python dependencies
# - Build Rust binaries# Edit .env file
nano .env
# Add your Neon PostgreSQL URL:
# DATABASE_URL=postgresql://user:pass@neon.tech/dbname?sslmode=require./scripts/migrate.shTerminal 1 - API:
cargo run --release --bin pm-apiTerminal 2 - Worker:
# For testing (collects every minute)
COLLECTION_INTERVAL_SECONDS=60 cargo run --release --bin pm-workerWait 1-2 minutes for the worker to collect initial data.
Terminal 3:
# List markets
./target/release/pm-cli list
# Search
./target/release/pm-cli search "election"
# Get first market ID from list, then:
./target/release/pm-cli detail <market-id>
./target/release/pm-cli history <market-id># Get a market ID from the list command, then:
python3 viz/terminal_viz.py --market-id <uuid># Start everything with Docker
docker-compose up
# API will be at http://localhost:3000
# Check with: curl http://localhost:3000/health- API Health:
curl http://localhost:3000/health→ "OK" - Markets Exist:
curl http://localhost:3000/api/markets→ JSON array - Worker Logs: Should see "Collected X markets" messages
- CLI Works:
./target/release/pm-cli list→ Shows markets - Viz Works: Python script shows tables and charts
- Check DATABASE_URL in .env
- Verify Neon database is accessible
- Test with:
psql $DATABASE_URL -c "SELECT 1;"
- Worker needs 1-2 minutes to collect initial data
- Check worker logs for errors
- Verify APIs are accessible:
curl https://gamma-api.polymarket.com/markets?limit=1
- Change API_PORT in .env
- Or kill existing process:
lsof -ti:3000 | xargs kill
- Install Rust:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
See README.md section "Deployment" for detailed instructions on deploying to Render + Neon.
- Read full README.md for detailed documentation
- Explore API endpoints: http://localhost:3000/api/*
- Customize collection interval in .env
- Add more markets by increasing TRACKED_MARKETS
Check logs:
# Detailed API logs
RUST_LOG=debug cargo run --bin pm-api
# Detailed worker logs
RUST_LOG=debug cargo run --bin pm-workerView database:
# Check tables
psql $DATABASE_URL -c "\dt"
# Check market count
psql $DATABASE_URL -c "SELECT COUNT(*) FROM markets;"
# Check price history count
psql $DATABASE_URL -c "SELECT COUNT(*) FROM price_history;"