Skip to content

codenimar/polymarket

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

Polymarket Trading Bot

An automated trading bot for Polymarket's 5-minute BTC prediction markets.

Configuration

The bot requires the following environment variables:

Required Variables

  • PRIVATE_KEY: Your Ethereum private key (with 0x prefix)
  • FUNDER_ADDRESS: Your wallet address that holds funds

Optional Variables

  • SIGNATURE_TYPE: Signature type for order signing (default: 0)
    • 0: EOA (Externally Owned Account) - Standard Ethereum wallet
    • 1: POLY_PROXY - Polymarket proxy wallet
    • 2: POLY_GNOSIS_SAFE - Gnosis Safe wallet

Fixing Signature Errors

If you encounter PolyApiException[status_code=400, error_message={'error': 'invalid signature'}], this typically means:

  1. Using a Polymarket Proxy Wallet: Set SIGNATURE_TYPE=1

    export SIGNATURE_TYPE=1
  2. Using a Gnosis Safe: Set SIGNATURE_TYPE=2

    export SIGNATURE_TYPE=2
  3. Address Mismatch: Ensure your FUNDER_ADDRESS matches the address associated with your PRIVATE_KEY

Usage

# 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.py

How It Works

The bot:

  1. Monitors 5-minute BTC prediction markets on Polymarket
  2. Compares current BTC price with the market start price
  3. Places trades when price change exceeds the threshold (±0.02%)
  4. Uses Martingale strategy for position sizing after losses

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages