This document explains how to configure the environment variables required for the Betting Bots feature in PredictOS.
The Betting Bots feature includes the Polymarket 15 Minute Up/Down Arbitrage Bot, which automatically places limit orders on Polymarket's 15-minute up/down markets to capture arbitrage opportunities.
Two modes available:
- Vanilla Mode — Single price straddle at a fixed probability level
- Ladder Mode — Multi-level orders across a price range with exponentially tapered allocation
🚀 More bots coming soon!
📖 Reference: x.com/hanakoxbt/status/1999149407955308699
This strategy exploits a simple arbitrage opportunity in binary prediction markets:
- Find a 15m crypto market with high liquidity
- Place limit orders: buy YES at 48 cents and NO at 48 cents
- Wait until both orders are filled
- Total cost: $0.96 for shares on both sides
Regardless of the outcome, one side always pays out $1.00 — guaranteeing a ~4% profit per trade when both orders fill.
| Scenario | Cost | Payout | Profit |
|---|---|---|---|
| "Yes" wins | $0.48 (Yes) + $0.48 (No) = $0.96 | $1.00 | +$0.04 (~4.2%) |
| "No" wins | $0.48 (Yes) + $0.48 (No) = $0.96 | $1.00 | +$0.04 (~4.2%) |
The bot automates this process every 15 minutes, placing straddle limit orders on both sides of the market to capture this arbitrage when both orders fill.
📖 Reference: x.com/hanakoxbt/status/1999149407955308699
🎬 Demo by community contributor: x.com/mininghelium1/status/2002399561520656424
Ladder Mode improves on the vanilla strategy by spreading your bankroll across multiple probability levels with exponentially tapered allocation — heavy at the top, light at the bottom. This approach maximizes fill rates and captures more arbitrage opportunities.
Instead of placing a single straddle at one price (e.g., 48%), Ladder Mode places orders at every probability level from your configured Top Price (e.g., 49%) down to your Bottom Price (e.g., 35%):
| Price Level | Allocation | Fill Likelihood | Profit if Filled |
|---|---|---|---|
| 49% | ~25% of bankroll | Most likely | ~2% profit |
| 48% | ~18% of bankroll | Very likely | ~4% profit |
| 47% | ~14% of bankroll | Likely | ~6% profit |
| ... | Tapers down | ... | ... |
| 35% | ~1% of bankroll | Rare | ~86% profit |
- Higher fill rates — Top rungs (49%, 48%) fill frequently for steady, consistent gains
- Larger upside — Lower rungs occasionally fill for much higher profit margins
- Better capital efficiency — Exponential taper concentrates most capital where fills are likely
- Automatic rung adjustment — If your bankroll is too small, the bot automatically reduces the number of rungs to ensure each order meets Polymarket's minimum 5-share requirement
| Parameter | Description | Default |
|---|---|---|
| Top Price | Highest probability level (receives most allocation) | 49% |
| Bottom Price | Lowest probability level (receives least allocation) | 35% |
| Taper Factor | Controls allocation curve steepness (1.0 = gentle, 2.5 = aggressive) | 1.5 |
| Total Bankroll | USD amount distributed across all ladder rungs per market | $50 |
The taper factor controls how aggressively allocation decreases from top to bottom:
- 1.0 (Gentle) — More even distribution across all price levels
- 1.5 (Moderate) — Balanced approach (recommended)
- 2.0 (Aggressive) — Heavy concentration at top prices
- 2.5 (Very Heavy Top) — Most conservative, majority at highest fill probability
Ladder Mode was contributed by the community:
| Contributor | Links |
|---|---|
| Mining helium | 𝕏 @mininghelium1 · GitHub @fciaf420 · Demo |
Add these to your supabase/.env.local file:
POLYMARKET_WALLET_PRIVATE_KEY=your_wallet_private_keyWhat it's for: This is the private key of your Ethereum wallet that will be used to sign transactions on Polymarket.
How to get it:
- Create an account on P https://polymarket.com
profile drop-down->settings->Export Private Key⚠️ IMPORTANT: Never share your private key or commit it to version control
🔒 Security Best Practice: Create a dedicated wallet for bot trading with only the funds you're willing to risk. Never use your main wallet's private key.
POLYMARKET_PROXY_WALLET_ADDRESS=your_proxy_wallet_addressWhat it's for: This is your Polymarket proxy wallet address, which is used for placing orders on Polymarket's CLOB (Central Limit Order Book).
How to get it:
- Create an account on https://polymarket.com
- Your proxy wallet will be created automatically
profile drop-down-->under username-->click copy
💡 Note: The proxy wallet is different from your main wallet. It's a smart contract wallet that Polymarket creates for you to interact with their order book.
Your supabase/.env.local file should include these for betting bots:
# Polymarket Bot Configuration - Required for Betting Bots
POLYMARKET_WALLET_PRIVATE_KEY=0x...your_private_key_here
POLYMARKET_PROXY_WALLET_ADDRESS=0x...your_proxy_wallet_address_hereIn addition to the backend variables above, you need to configure the frontend (terminal/.env):
SUPABASE_URL=<API URL from supabase status>
SUPABASE_ANON_KEY=<anon key from supabase status>
# Edge Function URL (for local development)
SUPABASE_EDGE_FUNCTION_BETTING_BOT=http://127.0.0.1:54321/functions/v1/polymarket-up-down-15-marketsIf you're using both Market Analysis and Betting Bots, your complete supabase/.env.local should look like:
# ============================================
# Market Analysis Configuration
# ============================================
# Dome API - Required for market data
DOME_API_KEY=your_dome_api_key
# AI Provider - At least one is required
XAI_API_KEY=your_xai_api_key
OPENAI_API_KEY=your_openai_api_key
# ============================================
# Betting Bots Configuration
# ============================================
# Polymarket Bot - Required for Betting Bots
POLYMARKET_WALLET_PRIVATE_KEY=0x...your_private_key
POLYMARKET_PROXY_WALLET_ADDRESS=0x...your_proxy_walletAfter setting up your environment variables:
-
Start the Supabase services:
cd supabase supabase start supabase functions serve --env-file .env.local -
Start the frontend:
cd terminal npm run dev -
Navigate to http://localhost:3000/betting-bots
-
Configure your bot parameters and start the bot to test
| Parameter | Description | Default |
|---|---|---|
| Asset Symbol | The cryptocurrency to trade (BTC, ETH, SOL, XRP) | BTC |
| Order Price | Probability level for straddle orders | 48% |
| Order Size | Amount in USDC per bet on each side | $25 |
| Parameter | Description | Default |
|---|---|---|
| Asset Symbol | The cryptocurrency to trade (BTC, ETH, SOL, XRP) | BTC |
| Top Price | Highest probability level (heavy allocation) | 49% |
| Bottom Price | Lowest probability level (light allocation) | 35% |
| Taper Factor | Allocation curve steepness (1.0-2.5) | 1.5 |
| Total Bankroll | Total USD distributed across all rungs | $50 |
| Error | Solution |
|---|---|
| "Private key not configured" | Add POLYMARKET_WALLET_PRIVATE_KEY to .env.local |
| "Proxy wallet not configured" | Add POLYMARKET_PROXY_WALLET_ADDRESS to .env.local |
| "Invalid private key" | Ensure your private key is correctly formatted (with or without 0x prefix) |
| "Insufficient balance" | Fund your Polymarket wallet with USDC |
| "Order failed" | Check that your proxy wallet is properly set up on Polymarket |
- Never commit your private key to version control
- Use a dedicated trading wallet with limited funds
- Keep your
.env.localfile in.gitignore - Monitor your bot regularly for unexpected behavior
- Start with small amounts until you're confident in the bot's behavior