Loading...
Loading...
Safe deployment of Polymarket trading bot with regression tests and active trade protection
npx skill4agent add unarmedpuppy/polyjuiced deploy-bot# From the polyjuiced repo root
./.agents/skills/deploy-bot/deploy.sh
# Skip tests only (still checks active trades)
./.agents/skills/deploy-bot/deploy.sh --skip-tests
# Force deploy (DANGEROUS - skips ALL safety checks)
./.agents/skills/deploy-bot/deploy.sh --forcepytest tests/ -vscripts/check_active_trades.py# Run regression tests locally
docker compose run --rm --build polymarket-bot python3 -m pytest tests/ -v
# Check active trades (requires running container)
docker exec polymarket-bot python3 /app/scripts/check_active_trades.py
# Exit codes:
# 0 = Safe to deploy
# 1 = Active trades exist (don't deploy)
# 2 = Error checking
# 3 = Tests failed--skip-tests--forceTrade Executed → status='pending' → Market Resolves → status='won'/'lost'
↑ ↓
⚠️ DANGER ZONE Safe to deploydocker compose run --rm --build polymarket-bot python3 -m pytest tests/ -v --tb=long# Check database state
docker exec polymarket-bot python3 -c "
import asyncio
import aiosqlite
async def check():
async with aiosqlite.connect('/app/data/gabagool.db') as db:
db.row_factory = aiosqlite.Row
async with db.execute('SELECT id, asset, status, market_end_time FROM trades WHERE dry_run=0 ORDER BY created_at DESC LIMIT 5') as cur:
for row in await cur.fetchall():
print(dict(row))
asyncio.run(check())
"tests/scripts/check_active_trades.pysrc/persistence.pysrc/strategies/gabagool.py