An automated trading bot for Polymarket's 5-minute BTC prediction markets.
The bot requires the following environment variables:
PRIVATE_KEY: Your Ethereum private key (with 0x prefix)FUNDER_ADDRESS: Your wallet address that holds funds
SIGNATURE_TYPE: Signature type for order signing (default:0)0: EOA (Externally Owned Account) - Standard Ethereum wallet1: POLY_PROXY - Polymarket proxy wallet2: POLY_GNOSIS_SAFE - Gnosis Safe wallet
If you encounter PolyApiException[status_code=400, error_message={'error': 'invalid signature'}], this typically means:
-
Using a Polymarket Proxy Wallet: Set
SIGNATURE_TYPE=1export SIGNATURE_TYPE=1 -
Using a Gnosis Safe: Set
SIGNATURE_TYPE=2export SIGNATURE_TYPE=2 -
Address Mismatch: Ensure your
FUNDER_ADDRESSmatches the address associated with yourPRIVATE_KEY
# Set environment variables
export PRIVATE_KEY="0x..."
export FUNDER_ADDRESS="0x..."
export SIGNATURE_TYPE=1 # If using Polymarket proxy wallet
# Run the bot
python3 polytrader.pyThe bot:
- Monitors 5-minute BTC prediction markets on Polymarket
- Compares current BTC price with the market start price
- Places trades when price change exceeds the threshold (±0.02%)
- Uses Martingale strategy for position sizing after losses