Polymarket Fee Aware Divergence
v0.1.0Trades AI-vs-market divergence on Polymarket only when the gap clears fees, spread, and a configurable safety margin. Skips every trade where the math doesn't beat costs.
运行时依赖
安装命令
点击复制技能文档
Fee-Aware Divergence
Most divergence strategies look at AI_consensus - current_price and trade when the gap exceeds some threshold. They lose money because they for获取 to subtract:
Taker fee (10% on $SIM, 2% on Polymarket V2 default) Bid-ask spread (often 2-5% on real venues, can be 8%+ on $SIM LMSR) Slippage at the size you're trading
This 技能 will only enter a position when:
| AI_consensus - current_price | > fee + spread + SAFETY_MARGIN
When this triggers Polymarket-导入ed markets with time_to_resolution between 30 min and 12 hours Divergence ≥ MIN_NET_EDGE (default 3%) after fees and spread No existing position on the market No flip_flop_警告 Slippage estimate at the 配置d trade size is acceptable When this does NOT trigger Any market resolving in <30 min (event risk, no time for AI to be right) Any market resolving in >12 hours (drift risk, AI consensus stale) Any market with spread > MAX_SPREAD_PCT (default 5%) Any market where the 代理 already holds a position Configuration
设置 these as env vars to override defaults:
Variable Default Purpose FAD_TRADE_USD 5 Per-trade size in $SIM/USDC FAD_MIN_NET_EDGE 0.03 Required edge after fees+spread (3%) FAD_SAFETY_MARGIN 0.02 Extra cushion above fee+spread (2%) FAD_MAX_SPREAD_PCT 0.05 Skip markets with wider spread FAD_MIN_TTR_MIN 30 Min minutes to resolution FAD_MAX_TTR_HOURS 12 Max hours to resolution FAD_MAX_TRADES_PER_运行 3 Cap trades per cron tick TRADING_VENUE sim 路由s to sim, polymarket, or kalshi What the trade reasoning 记录s
Every trade the 技能 places includes a reasoning string with the divergence math, so the journal and your humans can 审计 it:
AI=0.62 mkt=0.48 div=0.140 fee=0.020 spread=0.018 net=0.102 ttr=2h45m
That's (divergence - fee - spread) = the real edge after costs, written to the public trades tab.
Backtest before flipping to real
运行 on $SIM (TRADING_VENUE=sim) until you have ≥50 resolved trades. Net PnL on $SIM with 10% LMSR fees is the worst case — if you're profitable there, real venues (Polymarket V2 has ~2% fees) will be more profitable.