feat: full project overhaul — market maker, sniper, WebSocket watcher, terminal UI
- Rename project to polymarket-terminal - Add Market Maker bot (src/mm.js) with on-chain CTF split/merge/redeem via Gnosis Safe - Add Orderbook Sniper bot (src/sniper.js) with multi-asset GTC low-price orders - Add WebSocket watcher (src/services/wsWatcher.js) for real-time RTDS trade events - Add terminal dashboard UI (src/ui/dashboard.js) using blessed - Add CTF contract helpers (src/services/ctf.js) for splitPosition, mergePositions, redeemPositions - Add mmDetector, mmExecutor, sniperDetector, sniperExecutor services - Add simStats utility for dry-run P&L tracking - Translate all Indonesian-language strings to professional English across all files - Rewrite README.md in English with full setup guide, configuration reference, and architecture overview - Rewrite AGENT.MD in English as comprehensive AI agent and developer reference - Update package.json name, description, scripts, and keywords Co-Authored-By: direkturcrypto <direkturcrypto.x@mail3.me>
This commit is contained in:
+110
-16
@@ -1,32 +1,126 @@
|
||||
# Wallet
|
||||
PRIVATE_KEY=0xYOUR_PRIVATE_KEY_HERE
|
||||
WALLET_ADDRESS=0xYOUR_WALLET_ADDRESS_HERE
|
||||
# ─────────────────────────────────────────────
|
||||
# WALLET SETUP
|
||||
# ─────────────────────────────────────────────
|
||||
# EOA private key — used for SIGNING only, does NOT hold USDC
|
||||
PRIVATE_KEY=0xYOUR_EOA_PRIVATE_KEY_HERE
|
||||
|
||||
# Polymarket API Credentials (optional, auto-derived if not set)
|
||||
# Polymarket Proxy Wallet — the address shown when you click "Deposit" on Polymarket
|
||||
# This is where you deposit USDC.e, and where trades are funded from
|
||||
# How to find: Login to polymarket.com → Profile → Deposit → copy the address
|
||||
PROXY_WALLET_ADDRESS=0xYOUR_PROXY_WALLET_ADDRESS_HERE
|
||||
|
||||
# ─────────────────────────────────────────────
|
||||
# POLYGON RPC
|
||||
# ─────────────────────────────────────────────
|
||||
POLYGON_RPC_URL=https://polygon.lava.build
|
||||
|
||||
# ─────────────────────────────────────────────
|
||||
# POLYMARKET API CREDENTIALS (optional)
|
||||
# Leave blank to auto-derive from your private key
|
||||
# ─────────────────────────────────────────────
|
||||
CLOB_API_KEY=
|
||||
CLOB_API_SECRET=
|
||||
CLOB_API_PASSPHRASE=
|
||||
|
||||
# Trader to Copy
|
||||
TRADER_ADDRESS=0xTRADER_ADDRESS_TO_COPY
|
||||
# ─────────────────────────────────────────────
|
||||
# TRADER TO COPY
|
||||
# Use the proxy wallet address of the trader (visible on their Polymarket profile)
|
||||
# ─────────────────────────────────────────────
|
||||
TRADER_ADDRESS=0xTRADER_PROXY_WALLET_ADDRESS
|
||||
|
||||
# Trade Sizing
|
||||
# "percentage" = % of trader's trade size, "balance" = % of own balance
|
||||
SIZE_MODE=percentage
|
||||
SIZE_PERCENT=50
|
||||
# ─────────────────────────────────────────────
|
||||
# TRADE SIZING
|
||||
# ─────────────────────────────────────────────
|
||||
# SIZE_MODE:
|
||||
# "percentage" = SIZE_PERCENT% of MAX_POSITION_SIZE per market entry
|
||||
# (e.g. MAX_POSITION_SIZE=$10, SIZE_PERCENT=50 → buy $5 per entry)
|
||||
# "balance" = SIZE_PERCENT% of your current USDC.e balance per entry
|
||||
# (e.g. balance=$100, SIZE_PERCENT=10 → buy $10 per entry)
|
||||
# Note: sizing is independent of the trader's individual fill size.
|
||||
# Limit orders can fill in many small chunks — we always use our own sizing.
|
||||
SIZE_MODE=balance
|
||||
SIZE_PERCENT=10
|
||||
|
||||
# Minimum trade size in USDC (skip if calculated size is below this)
|
||||
MIN_TRADE_SIZE=1
|
||||
|
||||
# Auto Sell
|
||||
# Maximum total position per market in USDC (won't buy more once this is reached)
|
||||
MAX_POSITION_SIZE=10
|
||||
|
||||
# ─────────────────────────────────────────────
|
||||
# AUTO SELL
|
||||
# ─────────────────────────────────────────────
|
||||
AUTO_SELL_ENABLED=true
|
||||
AUTO_SELL_PROFIT_PERCENT=10
|
||||
|
||||
# Sell Mode when copying trader's sell
|
||||
# "market" = sell at market price, "limit" = sell at trader's avg sell price
|
||||
# Sell mode when copying trader's sell
|
||||
# "market" = sell at market price immediately
|
||||
# "limit" = place limit order at trader's sell price
|
||||
SELL_MODE=market
|
||||
|
||||
# Polling Intervals (in seconds)
|
||||
POLL_INTERVAL=15
|
||||
# ─────────────────────────────────────────────
|
||||
# INTERVALS
|
||||
# ─────────────────────────────────────────────
|
||||
# How often (seconds) to check for resolved markets to redeem
|
||||
REDEEM_INTERVAL=60
|
||||
|
||||
# Dry Run (set to true to simulate without executing trades)
|
||||
# ─────────────────────────────────────────────
|
||||
# DRY RUN (set true to simulate without real trades)
|
||||
# ─────────────────────────────────────────────
|
||||
DRY_RUN=true
|
||||
|
||||
# ─────────────────────────────────────────────
|
||||
# MARKET MAKER (mm.js / npm run mm-sim)
|
||||
# ─────────────────────────────────────────────
|
||||
# Comma-separated assets to market-make (same slug format as sniper)
|
||||
MM_ASSETS=btc
|
||||
|
||||
# Market duration: "5m" (5-minute) or "15m" (15-minute)
|
||||
MM_DURATION=5m
|
||||
|
||||
# USDC amount per side (total exposure = 2x this)
|
||||
MM_TRADE_SIZE=5
|
||||
|
||||
# Limit sell price target (e.g. 0.60 = sell at $0.60)
|
||||
MM_SELL_PRICE=0.60
|
||||
|
||||
# Seconds before market close to trigger cut-loss
|
||||
MM_CUT_LOSS_TIME=60
|
||||
|
||||
# Keyword to match market question (case-insensitive)
|
||||
MM_MARKET_KEYWORD=Bitcoin Up or Down
|
||||
|
||||
# Max seconds after market open to enter (0 = at open only)
|
||||
MM_ENTRY_WINDOW=45
|
||||
|
||||
# How often to poll for new markets (seconds)
|
||||
MM_POLL_INTERVAL=10
|
||||
|
||||
# ── Recovery Buy (after cut-loss) ───────────────────────────
|
||||
# After cut-loss triggers, monitor prices for 10s and market-buy
|
||||
# the dominant side if criteria are met. Does not affect the main
|
||||
# MM flow — purely an opt-in add-on.
|
||||
#
|
||||
# Enable recovery buy
|
||||
MM_RECOVERY_BUY=false
|
||||
|
||||
# Minimum price the dominant side must be at (and rising/stable) to qualify
|
||||
MM_RECOVERY_THRESHOLD=0.70
|
||||
|
||||
# USDC size for the recovery buy (0 = use MM_TRADE_SIZE)
|
||||
MM_RECOVERY_SIZE=0
|
||||
|
||||
# ─────────────────────────────────────────────
|
||||
# ORDERBOOK SNIPER (sniper.js / npm run sniper-sim)
|
||||
# Places tiny GTC BUY orders at a low price on both sides of
|
||||
# ETH/SOL/XRP 5-minute markets — catches panic dumps near $0.
|
||||
# ─────────────────────────────────────────────
|
||||
# Comma-separated assets to snipe
|
||||
SNIPER_ASSETS=eth,sol,xrp
|
||||
|
||||
# Buy price per share (1 cent = $0.01)
|
||||
SNIPER_PRICE=0.01
|
||||
|
||||
# Shares per side — minimum Polymarket order size is 5 shares
|
||||
# At $0.01/share: 5 shares = $0.05 per side, $0.10 per market
|
||||
SNIPER_SHARES=5
|
||||
|
||||
Reference in New Issue
Block a user