polymarket-mert-sniper

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Mert Sniper

Mert Sniper

Near-expiry conviction trading on Polymarket. Snipe markets about to resolve when the odds are heavily skewed.
Strategy by @mert — filter by topic, cap your bets, wait until near expiry, and only trade strong splits.
This is a template. The default logic (expiry + split filter) gets you started — remix it with your own filters, timing rules, or market selection criteria. The skill handles all the plumbing (market discovery, trade execution, safeguards). Your agent provides the alpha.
基于Polymarket的临到期信念交易工具,当赔率严重倾斜时狙击即将结算的市场。
策略由@mert提出——按主题筛选、设置投注上限、等待临近到期时间,仅交易赔率差大的标的。
这是一个模板。 默认逻辑(到期时间+赔率差筛选)可以帮你快速上手——你可以自定义添加筛选条件、时间规则或市场选择标准。该skill会处理所有底层流程(市场发现、交易执行、风险保障),你的Agent负责提供超额收益策略。

When to Use This Skill

何时使用该Skill

Polymarket only. All trades execute on Polymarket with real USDC. Use
--live
for real trades, dry-run is the default.
Use this skill when the user wants to:
  • Trade markets that are about to resolve (last-minute conviction bets)
  • Filter by topic (e.g. only SOL/crypto markets)
  • Cap bet size (e.g. never more than $10)
  • Only trade when odds are strongly skewed (e.g. 60/40 or better)
  • Run an automated expiry-sniping strategy
仅支持Polymarket。 所有交易都使用真实USDC在Polymarket执行。使用
--live
参数执行真实交易,默认是试运行模式。
当用户想要实现以下需求时可使用该skill:
  • 交易即将结算的市场(最后一分钟信念投注)
  • 按主题筛选(例如仅SOL/crypto相关市场)
  • 设置投注金额上限(例如单笔不超过10美元)
  • 仅在赔率严重倾斜时交易(例如60/40或更高的赔率差)
  • 运行自动临到期狙击策略

Setup Flow

设置流程

  1. Ask for Simmer API key
    • Get it from simmer.markets/dashboard -> SDK tab
    • Store in environment as
      SIMMER_API_KEY
  2. Ask for wallet private key (required for live trading)
    • This is the private key for their Polymarket wallet (the wallet that holds USDC)
    • Store in environment as
      WALLET_PRIVATE_KEY
    • The SDK uses this to sign orders client-side automatically — no manual signing needed
  3. Ask about settings (or confirm defaults)
    • Market filter: Which markets to scan (default: all)
    • Max bet: Maximum per trade (default $10)
    • Expiry window: How close to resolution (default 2 minutes)
    • Min split: Minimum odds skew (default 60/40)
  4. Save settings to config.json or environment variables
  1. 索要Simmer API密钥
    • 从simmer.markets/dashboard -> SDK标签页获取
    • 存储在环境变量中,变量名为
      SIMMER_API_KEY
  2. 索要钱包私钥(实盘交易必需)
    • 这是你Polymarket钱包的私钥(持有USDC的钱包)
    • 存储在环境变量中,变量名为
      WALLET_PRIVATE_KEY
    • SDK会用这个私钥在客户端自动签名订单——无需手动签名
  3. 询问设置项(或确认默认值)
    • 市场筛选:要扫描哪些市场(默认:全部)
    • 最高投注额:单笔交易最高金额(默认10美元)
    • 到期窗口:距离结算的最长时间(默认2分钟)
    • 最小赔率差:最低赔率倾斜阈值(默认60/40)
  4. 将设置保存到config.json或环境变量中

Configuration

配置项

SettingEnvironment VariableDefaultDescription
Market filter
SIMMER_MERT_FILTER
(all)Tag or keyword filter (e.g.
solana
,
crypto
)
Max bet
SIMMER_MERT_MAX_BET
10.00Maximum USD per trade
Expiry window
SIMMER_MERT_EXPIRY_MINS
2Only trade markets resolving within N minutes
Min split
SIMMER_MERT_MIN_SPLIT
0.60Only trade when YES or NO >= this (e.g. 0.60 = 60/40)
Max trades/run
SIMMER_MERT_MAX_TRADES
5Maximum trades per scan cycle
Smart sizing %
SIMMER_MERT_SIZING_PCT
0.05% of balance per trade
设置项环境变量默认值描述
市场筛选
SIMMER_MERT_FILTER
全部标签或关键词筛选(例如
solana
crypto
最高投注额
SIMMER_MERT_MAX_BET
10.00单笔交易最高美元金额
到期窗口(分钟)
SIMMER_MERT_EXPIRY_MINS
2仅交易N分钟内即将结算的市场
最小赔率差
SIMMER_MERT_MIN_SPLIT
0.60仅当YES或NO的赔率>=该值时交易(例如0.60对应60/40)
每次运行最大交易数
SIMMER_MERT_MAX_TRADES
5每个扫描周期最多执行的交易数
智能仓位占比
SIMMER_MERT_SIZING_PCT
0.05单笔交易占账户余额的百分比

Quick Commands

快速命令

bash
undefined
bash
undefined

Check account balance and positions

查看账户余额和持仓

python scripts/status.py
python scripts/status.py

Detailed position list

查看详细持仓列表

python scripts/status.py --positions

**API Reference:**
- Base URL: `https://api.simmer.markets`
- Auth: `Authorization: Bearer $SIMMER_API_KEY`
- Portfolio: `GET /api/sdk/portfolio`
- Positions: `GET /api/sdk/positions`
python scripts/status.py --positions

**API参考:**
- 基础URL: `https://api.simmer.markets`
- 鉴权: `Authorization: Bearer $SIMMER_API_KEY`
- 资产组合: `GET /api/sdk/portfolio`
- 持仓: `GET /api/sdk/positions`

Running the Skill

运行该Skill

bash
undefined
bash
undefined

Dry run (default -- shows opportunities, no trades)

试运行(默认模式——仅展示机会,不执行交易)

python mert_sniper.py
python mert_sniper.py

Execute real trades

执行真实交易

python mert_sniper.py --live
python mert_sniper.py --live

Filter to specific markets

筛选特定市场

python mert_sniper.py --filter solana
python mert_sniper.py --filter solana

Custom expiry window (5 minutes)

自定义到期窗口(5分钟)

python mert_sniper.py --expiry 5
python mert_sniper.py --expiry 5

With smart position sizing (uses portfolio balance)

开启智能仓位计算(基于账户余额)

python mert_sniper.py --live --smart-sizing
python mert_sniper.py --live --smart-sizing

Check positions only

仅查看持仓

python mert_sniper.py --positions
python mert_sniper.py --positions

View config

查看配置

python mert_sniper.py --config
python mert_sniper.py --config

Disable safeguards (not recommended)

关闭风险保障(不推荐)

python mert_sniper.py --no-safeguards
undefined
python mert_sniper.py --no-safeguards
undefined

How It Works

工作原理

Each cycle the script:
  1. Fetches active markets from Simmer API (optionally filtered by tag/keyword)
  2. Filters to markets resolving within the expiry window (default 2 minutes)
  3. Checks the price split -- only trades when one side >= min_split (default 60%)
  4. Determines direction: backs the favored side (higher probability)
  5. Safeguards: Checks context for flip-flop warnings, slippage, market status
  6. Execution: Places trade on the favored side, capped at max bet
  7. Reports summary of scanned, filtered, and traded markets
每个运行周期脚本会执行以下操作:
  1. 从Simmer API获取活跃市场(可按标签/关键词筛选)
  2. 筛选出在到期窗口内即将结算的市场(默认2分钟)
  3. 检查价格差——仅当某一方赔率>=min_split(默认60%)时交易
  4. 确定交易方向:押注赔率占优的一方(概率更高)
  5. 风险保障:检查上下文的反转预警、滑点、市场状态
  6. 执行交易:在占优方下订单,金额不超过最高投注额
  7. 输出已扫描、筛选、交易的市场汇总信息

Example Output

输出示例

🎯 Mert Sniper - Near-Expiry Conviction Trading
==================================================

  [DRY RUN] No trades will be executed. Use --live to enable trading.

  Configuration:
  Filter:        solana
  Max bet:       $10.00
  Expiry window: 2 minutes
  Min split:     60/40
  Max trades:    5
  Smart sizing:  Disabled
  Safeguards:    Enabled

  Fetching markets (filter: solana)...
  Found 12 active markets

  Markets expiring within 2 minutes: 2

  SOL highest price on Feb 10?
     Resolves in: 1m 34s
     Split: YES 72% / NO 28%
     Side: YES (72% >= 60%)
     [DRY RUN] Would buy $10.00 on YES

  Summary:
  Markets scanned: 12
  Near expiry:     2
  Strong split:    1
  Trades executed: 0

  [DRY RUN MODE - no real trades executed]
🎯 Mert Sniper - Near-Expiry Conviction Trading
==================================================

  [DRY RUN] No trades will be executed. Use --live to enable trading.

  Configuration:
  Filter:        solana
  Max bet:       $10.00
  Expiry window: 2 minutes
  Min split:     60/40
  Max trades:    5
  Smart sizing:  Disabled
  Safeguards:    Enabled

  Fetching markets (filter: solana)...
  Found 12 active markets

  Markets expiring within 2 minutes: 2

  SOL highest price on Feb 10?
     Resolves in: 1m 34s
     Split: YES 72% / NO 28%
     Side: YES (72% >= 60%)
     [DRY RUN] Would buy $10.00 on YES

  Summary:
  Markets scanned: 12
  Near expiry:     2
  Strong split:    1
  Trades executed: 0

  [DRY RUN MODE - no real trades executed]

Troubleshooting

故障排查

"No markets found"
  • Check your filter -- try without a filter first
  • Markets may not be available (check simmer.markets)
"No markets expiring within window"
  • Increase expiry window:
    --expiry 10
    (10 minutes)
  • Or run more frequently (cron every minute)
"Split too narrow"
  • Lower the min split:
    --set min_split=0.55
  • This trades more often but with less conviction
"Resolves in: 17h" on 15-min markets
  • Polymarket's
    endDate
    is the event-level end-of-day, not the individual market close time
  • For 15-min crypto markets (e.g. "BTC Up or Down - Feb 8, 11PM ET"), the actual close time is in the question text but not in the API
  • This is a Polymarket data limitation — widen the expiry window (
    --expiry 1080
    ) as a workaround, or use the split filter to find conviction opportunities regardless of timing
"External wallet requires a pre-signed order"
  • WALLET_PRIVATE_KEY
    is not set in the environment
  • The SDK signs orders automatically when this env var is present — no manual signing code needed
  • Fix:
    export WALLET_PRIVATE_KEY=0x<your-polymarket-wallet-private-key>
  • Do NOT attempt to sign orders manually or modify the skill code — the SDK handles it
"Balance shows $0 but I have USDC on Polygon"
  • Polymarket uses USDC.e (bridged USDC, contract
    0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174
    ) — not native USDC
  • If you bridged USDC to Polygon recently, you likely received native USDC
  • Swap native USDC to USDC.e, then retry
"API key invalid"
  • Get new key from simmer.markets/dashboard -> SDK tab
"未找到市场"
  • 检查你的筛选条件——先尝试不带筛选条件运行
  • 可能暂无可用市场(可查看simmer.markets确认)
"窗口内无即将到期的市场"
  • 增大到期窗口:
    --expiry 10
    (10分钟)
  • 或者提高运行频率(每分钟定时执行)
"赔率差过小"
  • 降低最小赔率差:
    --set min_split=0.55
  • 该设置会增加交易频率但交易的信念度更低
"15分钟的市场显示'17小时后结算'"
  • Polymarket的
    endDate
    是事件级别的单日结束时间,不是单个市场的关闭时间
  • 对于15分钟加密货币市场(例如"BTC Up or Down - Feb 8, 11PM ET"),实际关闭时间在问题文本中,API未返回该字段
  • 这是Polymarket的数据限制——可以通过增大到期窗口(
    --expiry 1080
    )作为临时解决方案,或者直接使用赔率差筛选来寻找高信念交易机会,不受时间限制
"外部钱包需要预签名订单"
  • 环境变量中未设置
    WALLET_PRIVATE_KEY
  • 当存在该环境变量时SDK会自动签名订单——无需编写手动签名代码
  • 解决方法:
    export WALLET_PRIVATE_KEY=0x<你的-polymarket-钱包私钥>
  • 不要尝试手动签名订单或修改skill代码——SDK会自动处理
"余额显示为0但我Polygon上有USDC"
  • Polymarket使用USDC.e(跨链桥USDC,合约地址
    0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174
    )——不是原生USDC
  • 如果你最近将USDC跨链到Polygon,你收到的大概率是原生USDC
  • 将原生USDC兑换为USDC.e后重试即可
"API密钥无效"
  • 从simmer.markets/dashboard -> SDK标签页获取新的密钥