forked from vladmeer/polymarket-copy-trading-bot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.env.example
More file actions
188 lines (158 loc) · 8.34 KB
/
Copy path.env.example
File metadata and controls
188 lines (158 loc) · 8.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
# ==============================================================================
# POLYMARKET COPY TRADING BOT - CONFIGURATION
# ==============================================================================
# ------------------------------------------------------------------------------
# TRADERS TO COPY (Multiple addresses supported)
# ------------------------------------------------------------------------------
# Option 1: Single trader
# USER_ADDRESSES = '0xd62531bc536bff72394fc5ef715525575787e809'
# Option 2: Multiple traders (comma-separated)
# USER_ADDRESSES = '0xTrader1..., 0xTrader2..., 0xTrader3...'
# Option 3: Multiple traders (JSON array format)
# USER_ADDRESSES = '["0xTrader1...", "0xTrader2...", "0xTrader3..."]'
USER_ADDRESSES = ''
# ------------------------------------------------------------------------------
# YOUR WALLET CONFIGURATION
# ------------------------------------------------------------------------------
# Your Polymarket wallet address
PROXY_WALLET = ''
# Private key of the wallet you logged into the Polymarket with
# ⚠️ NEVER share this key or commit it to git!
PRIVATE_KEY = 'your_private_key_here_without_0x_prefix'
# ------------------------------------------------------------------------------
# POLYMARKET API ENDPOINTS
# ------------------------------------------------------------------------------
CLOB_HTTP_URL = 'https://clob.polymarket.com/'
CLOB_WS_URL = 'wss://ws-subscriptions-clob.polymarket.com/ws'
# ------------------------------------------------------------------------------
# BOT SETTINGS
# ------------------------------------------------------------------------------
# How often to check for new trades (in seconds)
FETCH_INTERVAL = 1
# Ignore trades older than X hours
TOO_OLD_TIMESTAMP = 1
# Maximum retry attempts for failed orders
RETRY_LIMIT = 3
# Network request timeout in milliseconds (default: 10000 = 10 seconds)
# Increase if you experience frequent timeout errors
REQUEST_TIMEOUT_MS = 10000
# Maximum retry attempts for network errors (default: 3)
# Helps handle temporary connection issues to Polymarket API
NETWORK_RETRY_LIMIT = 3
# ==============================================================================
# COPY STRATEGY CONFIGURATION (NEW SYSTEM!)
# ==============================================================================
# Choose your copy strategy: PERCENTAGE, FIXED, or ADAPTIVE
# - PERCENTAGE: Copy a fixed % of trader's order (recommended for beginners)
# - FIXED: Copy a fixed dollar amount per trade (predictable spending)
# - ADAPTIVE: Dynamically adjust % based on trade size (advanced)
COPY_STRATEGY = 'PERCENTAGE'
# Main parameter - meaning depends on strategy:
# - PERCENTAGE: Percentage of trader's order (e.g., 10.0 = 10%)
# - FIXED: Fixed dollar amount per trade (e.g., 50.0 = $50)
# - ADAPTIVE: Base percentage for adaptive scaling (e.g., 10.0 = 10%)
COPY_SIZE = 10.0
# ------------------------------------------------------------------------------
# SAFETY LIMITS (Protect your account!)
# ------------------------------------------------------------------------------
# Maximum size for a single order in USD (default: 100.0)
# This prevents oversized trades even if trader makes huge orders
MAX_ORDER_SIZE_USD = 100.0
# Minimum size for a single order in USD (default: 1.0)
# Orders below this will be skipped (Polymarket requirement)
MIN_ORDER_SIZE_USD = 1.0
# Optional: Maximum total position size in USD (per market)
# Prevents accumulating too large position in one market
# MAX_POSITION_SIZE_USD = 500.0
# Optional: Maximum total trading volume per day in USD
# Prevents overtrading in a single day
# MAX_DAILY_VOLUME_USD = 1000.0
# ------------------------------------------------------------------------------
# ADAPTIVE STRATEGY PARAMETERS (Only used if COPY_STRATEGY = 'ADAPTIVE')
# ------------------------------------------------------------------------------
# Minimum percentage for large orders (default: 5.0)
ADAPTIVE_MIN_PERCENT = 5.0
# Maximum percentage for small orders (default: 20.0)
ADAPTIVE_MAX_PERCENT = 20.0
# Threshold in USD to trigger adaptation (default: 500.0)
# Orders above this use lower %, orders below use higher %
ADAPTIVE_THRESHOLD_USD = 500.0
# ==============================================================================
# TIERED MULTIPLIERS (NEW FEATURE!)
# ==============================================================================
# Apply different multipliers based on trader's position size
# Solves the problem of copying traders with varying position sizes:
# - Small trades get higher multipliers (don't miss opportunities)
# - Large trades get lower multipliers (prevent over-allocation)
#
# Format: "min-max:multiplier,min-max:multiplier,min+:multiplier"
# - Use "min-max" for bounded ranges
# - Use "min+" for infinite upper bound (must be last)
# - Ranges are in USD based on trader's order size
#
# Example for $2k account copying a $500k-$1M trader:
# TIERED_MULTIPLIERS = 1-10:2.0,10-100:1.0,100-500:0.2,500-1000:0.1,1000-5000:0.02,5000-10000:0.01,10000-50000:0.002,50000-100000:0.001,100000-500000:0.0005,500000+:0.0002
#
# What this does:
# - $5 trader order × 2.0x = $10 copy (capture small trades)
# - $50 trader order × 1.0x = $50 copy
# - $500 trader order × 0.1x = $50 copy
# - $10,000 trader order × 0.002x = $20 copy
# - $250,000 trader order × 0.0002x = $50 copy (manage large trades)
#
# Simpler example for $1k account:
# TIERED_MULTIPLIERS = 1-100:2.0,100-1000:0.5,1000-10000:0.1,10000+:0.01
#
# Leave unset to use single TRADE_MULTIPLIER or no multiplier (1.0x)
# ==============================================================================
# LEGACY CONFIGURATION (For backward compatibility)
# ==============================================================================
# These are kept for compatibility with old .env files
# If you don't set COPY_STRATEGY, the bot will use these:
# - COPY_PERCENTAGE: Percentage of trader's order size (default: 10.0)
# - TRADE_MULTIPLIER: Single multiplier applied to copy percentage (default: 1.0)
# ⚠️ DEPRECATED: Please migrate to new COPY_STRATEGY system above!
# ⚠️ NOTE: If TIERED_MULTIPLIERS is set, it overrides TRADE_MULTIPLIER
# COPY_PERCENTAGE = 10.0
# TRADE_MULTIPLIER = 1.0
# ------------------------------------------------------------------------------
# TRADE AGGREGATION SETTINGS (NEW!)
# ------------------------------------------------------------------------------
# Enable trade aggregation for small trades (default: false)
# - true = Combine multiple small trades from the same trader into one larger trade
# - false = Execute each trade individually (original behavior)
# 💡 Useful when traders make many small trades that individually fall below
# Polymarket's $1 minimum but together would be worth copying!
TRADE_AGGREGATION_ENABLED = false
# Time window to wait for more trades before executing (in seconds)
# Default: 300 (5 minutes)
# - 60 = 1 minute
# - 300 = 5 minutes (recommended)
# - 600 = 10 minutes
# ⏱️ Longer windows allow more trades to combine but delay execution
TRADE_AGGREGATION_WINDOW_SECONDS = 300
# Preview/Dry-Run Mode (default: false)
# - true = Monitor trades but DO NOT execute them (safe testing)
# - false = Execute trades normally (live trading)
# 🔍 Use preview mode to test the bot without risking funds!
PREVIEW_MODE = false
# ------------------------------------------------------------------------------
# DATABASE CONFIGURATION
# ------------------------------------------------------------------------------
# MongoDB connection string
# ⚠️ Keep this private! Never share or commit to git!
MONGO_URI = 'mongodb+srv://username:password@cluster.mongodb.net/database'
# ------------------------------------------------------------------------------
# BLOCKCHAIN CONFIGURATION (Polygon Mainnet)
# ------------------------------------------------------------------------------
# Polygon RPC endpoint (you can use Infura, Alchemy, or QuickNode)
RPC_URL = 'RPC_URL = 'https://polygon-rpc.com'
# USDC Contract Address on Polygon (DO NOT CHANGE)
USDC_CONTRACT_ADDRESS = '0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174'
# ==============================================================================
# SECURITY NOTES:
# - Never commit .env file to git (it's in .gitignore)
# - Use a dedicated wallet with limited funds for the bot
# - Regularly monitor bot activity
# - Change MongoDB password if exposed
# ==============================================================================