Trading terminal for Polymarket 15-minute crypto markets (BTC, ETH, SOL, XRP).
- Live Trading — Trade UP/DOWN positions in real-time
- Multi-cryptocurrency — Support for BTC, ETH, SOL, XRP
- WebSocket Subscriptions — Real-time price data from Polymarket
- Telegram Notifications — Instant trade alerts
- Auto-redeem — Automatic winnings collection after market close
- Session P/L — Track profit/loss per session
- CLI Interface — Convenient terminal-based control
- Python 3.10 or higher
- Polygon (MATIC) wallet with USDC
- Small amount of POL/MATIC for gas fees
- VPN (if needed to bypass geo-restrictions)
git clone https://github.com/txbabaxyz/polyterminal.git
cd polymarket-botIMPORTANT: You must use a virtual environment (venv)!
# Create venv
python3 -m venv venv
# Activate venv
# Linux/macOS:
source venv/bin/activate
# Windows:
.\venv\Scripts\activatepip install -r requirements.txt# Copy the configuration file
cp .env.example .env
# Open .env and fill in your data
nano .env # or any text editor# ===========================================
# REQUIRED PARAMETERS
# ===========================================
# Your Polygon wallet private key (with 0x prefix)
PRIVATE_KEY=0xyourprivatekey
# Signature type:
# 0 = EOA (standard wallet created by you)
# 1 = POLY_PROXY (registered via Magic Link / Email on Polymarket)
# 2 = POLY_GNOSIS_SAFE (registered via MetaMask / Phantom on Polymarket)
SIGNATURE_TYPE=0
# Proxy wallet address (only for SIGNATURE_TYPE 1 or 2)
# Leave empty for type 0
FUNDER_ADDRESS=
# ===========================================
# API CREDENTIALS (optional)
# ===========================================
# Auto-generated, but can be specified for reuse
POLY_API_KEY=
POLY_API_SECRET=
POLY_API_PASSPHRASE=
# ===========================================
# TRADING SETTINGS
# ===========================================
# Position size in contracts (default 10)
CONTRACTS_SIZE=10
# ===========================================
# TELEGRAM NOTIFICATIONS (optional)
# ===========================================
# Bot token (get from @BotFather)
TELEGRAM_BOT_TOKEN=
# Your Chat ID (get from @userinfobot)
TELEGRAM_CHAT_ID=
# ===========================================
# POLYGON RPC (recommended)
# ===========================================
# Private RPC for stable operation
# Free options:
# - Alchemy: https://polygon-mainnet.g.alchemy.com/v2/YOUR_API_KEY
# - Ankr: https://rpc.ankr.com/polygon
# - Public: https://polygon-rpc.com
RPC_URL=https://polygon-rpc.com| Type | When to Use |
|---|---|
| 0 | You created the wallet yourself (MetaMask, Ledger, etc.) without registering on Polymarket |
| 1 | You registered on Polymarket via Magic Link / Email |
| 2 | You registered on Polymarket via MetaMask / Phantom / Browser Wallet |
For types 1 and 2, you need FUNDER_ADDRESS — find it at https://polymarket.com/settings
# Activate venv (if not already activated)
source venv/bin/activate
# Run the main menu
python3 launcher.py [1] Live Trading — Start trading
[2] Redeem All — Collect all winnings
[3] Redeem Market — Redeem from specific market
[4] Check Balance — Check USDC balance
[5] Generate Keys — Generate API keys
[6] Set Allowances — Set permissions (first time only)
[Q] Quit
source venv/bin/activate
python3 trade.py| Key | Action |
|---|---|
| 1 | BUY UP (bet on price increase) |
| 2 | BUY DOWN (bet on price decrease) |
| S | Increase position size |
| D | Decrease position size |
| F | Toggle FOK/FAK mode |
| R | Refresh balance |
| M | Open menu (Redeem/Settings) |
| C | Switch cryptocurrency |
| Q | Quit |
| File | Description |
|---|---|
launcher.py |
Main menu |
trade.py |
Main trading script |
redeem.py |
Manual redeem for specific market |
redeemall.py |
Automatic redeem for all positions |
check_balance.py |
Check USDC balance and allowances |
set_allowances.py |
Set contract permissions |
generate_keys.py |
Generate API keys |
telegram_bot.py |
Telegram bot for remote control |
logger.py |
Logging module |
redeem_lock.py |
File lock for redeem operations |
Before your first trade, you must allow Polymarket contracts to use your USDC:
source venv/bin/activate
python3 set_allowances.pyRequired: Small amount of POL (MATIC) for gas fees.
For remote control, you can run the Telegram bot:
source venv/bin/activate
python3 telegram_bot.py/status— System status/balance— Wallet balance/redeemall— Collect all winnings/stop— Stop trading/restart— Restart trading/help— Help
- Check that
SIGNATURE_TYPEmatches your registration method - For types 1/2, ensure
FUNDER_ADDRESSis correct - Try changing the
negRiskflag
python3 set_allowances.py- Use a private RPC (Alchemy, Ankr)
- Add to .env:
RPC_URL=https://rpc.ankr.com/polygon- Use a VPN
- Change DNS to 1.1.1.1 or 8.8.8.8
Check logs:
tail -50 logs/trade_*.log | grep -i balanceLogs are saved in the logs/ folder with 3-hour rotation:
logs/
├── trade_2024-01-15_09h.log
├── trade_2024-01-15_12h.log
├── redeem_2024-01-15_09h.log
└── ...
-
USDC Type: Polymarket uses USDC (Bridged), not USDC.e (Native). If you have USDC.e — swap it on QuickSwap or 1inch.
-
Rate limits: Public RPCs have limitations. For stable operation, use private RPCs (Alchemy, Ankr).
-
Gas fees: Keep a small POL/MATIC balance for transaction fees.
-
Risks: Cryptocurrency trading involves risks. Only use funds you can afford to lose.
cd polymarket-bot
git pull
source venv/bin/activate
pip install -r requirements.txt --upgradeMIT License
If you encounter issues, create an Issue in the repository.