Longshot Bias Trader
This is a template.
The default signal is purely price-based — no external API required. The skill discovers liquid markets across all categories, identifies extreme probabilities where behavioral mispricing is strongest, and trades against the crowd.
The skill handles all the plumbing (market discovery, trade execution, safeguards). Your agent provides the alpha.
Strategy Overview
Longshot bias is the single most replicated anomaly in betting market research. First documented by Griffith (1949) in horse racing, it has since been confirmed across sports betting, financial options (the volatility smile is its cousin), and prediction markets.
The core finding: Participants systematically overweight the excitement of low-probability outcomes and underweight the boring reliability of near-certainties.
- - A market priced at 6% is more likely to have a true probability of 2–3% — retail bets the dream.
- A market priced at 91% is more likely to have a true probability of 95–97% — retail finds it too boring to back fully.
This creates two exploitable edges in opposite directions:
- 1. Fade the longshot (buy NO when p is very low): The crowd overprices rare events. Buying NO when p ≤ 10% gives you the opposite side of that overpriced bet.
- Back the near-certainty (buy YES when p is very high): The crowd underprices likely outcomes. Buying YES when p ≥ 88% gives you the underpriced side.
These are not directional bets on events — they are structural bets against a known behavioral bias that regenerates in every market, every day.
The Core Insight: Why Longshot Bias Exists
Three behavioral mechanisms drive the bias simultaneously:
1. Probability distortion (Kahneman & Tversky)
Humans do not perceive probabilities linearly. We treat 5% as "might happen" and 95% as "probably won't fail." This distorts prices in predictable ways: low probabilities are overweighted, high probabilities are underweighted.
2. Narrative salience
A 5% longshot has a compelling story. "Imagine if it happened." Retail pays a premium for the story. A 95% near-certainty is boring — retail won't pay full price for something "obviously going to happen anyway."
3. Skewness preference
Small chance of a large gain is psychologically attractive even at negative expected value. This is the same reason people buy lottery tickets. In prediction markets, the NO side of a longshot offers a small chance of a large gain in the other direction — but retail doesn't frame it that way.
Signal Logic
Default Signal: Conviction-Based Extreme Probability Fading
This skill uses inverted thresholds compared to standard prediction market traders:
| Standard trader | Longshot bias trader |
|---|
| Buy YES when p is low (you think it'll happen) | Buy NO when p is low (market overprices the longshot) |
| Buy NO when p is high (you think it won't happen) |
Buy YES when p is high (market underprices the certainty) |
Step 1 — Market discovery:
Broad keyword sweep across all high-liquidity categories (politics, crypto, sports, macro, tech, geopolitics). Longshot bias is category-agnostic — it exists wherever retail trades.
Step 2 — Signal gates:
- - Spread ≤ MAXSPREAD (wide spreads eat the edge)
- Days to resolution ≥ MINDAYS (avoid near-resolution noise where convergence may have already started)
Step 3 — Signal direction:
- -
p ≤ LONGSHOT_THRESHOLD → buy NO (fade the overpriced longshot) - INLINECODE1 → buy YES (back the underpriced near-certainty)
- Between thresholds → skip
Step 4 — Conviction sizing:
For NO (fading longshot):
conviction = (LONGSHOT_THRESHOLD - p) / LONGSHOT_THRESHOLD
At p=0%: conviction=1.0 → MAX
POSITION. At p=LONGSHOTTHRESHOLD: conviction=0.0 → MIN_TRADE floor.
For YES (backing near-certainty):
conviction = (p - CERTAINTY_THRESHOLD) / (1 - CERTAINTY_THRESHOLD)
At p=100%: conviction=1.0 → MAX
POSITION. At p=CERTAINTYTHRESHOLD: conviction=0.0 → MIN_TRADE floor.
Step 5 — Quality multiplier (_longshot_quality_mult):
Three factors adjust conviction up or down:
| Factor | What it captures | Range |
|---|
| Depth of mispricing | Deeper longshots / higher certainties are more mispriced | 1.00 → 1.25x |
| Narrative salience |
Emotionally charged framing inflates longshot prices further | 1.00 → 1.15x |
| Resolution clarity | Objective criteria → cleaner edge; vague criteria → noise | 0.90 → 1.05x |
Combined and capped at 1.30x.
How Sizing Works
With defaults (LONGSHOTTHRESHOLD=10%, CERTAINTYTHRESHOLD=88%, MINTRADE=$5, MAXPOSITION=$30):
Fading longshots (buy NO):
| Market price p | Conviction | Size |
|---|
| 10% (at threshold) | 0% | $5 (floor) |
| 7% |
30% | $9 |
| 4% | 60% | $18 |
| 1% | 90% | $27 |
| 0% | 100% | $30 |
Backing near-certainties (buy YES):
| Market price p | Conviction | Size |
|---|
| 88% (at threshold) | 0% | $5 (floor) |
| 92% |
33% | $10 |
| 96% | 67% | $20 |
| 99% | 92% | $28 |
Keywords Monitored
CODEBLOCK2
Remix Signal Ideas
- - Calibration data from historical Polymarket markets: If resolved markets show that markets priced at 5% resolved YES only 1.5% of the time, you have a precise expected-value edge to trade against — replace keyword thresholds with a calibration curve
- Cross-category calibration: The bias is stronger in some categories (sports, celebrity) than others (macro, crypto) — weight conviction by category-specific historical overpricing rates
- Volume filter on longshots: Very low-volume longshots may be mispriced for liquidity reasons rather than behavioral reasons — add a minimum volume gate specifically for sub-10% markets to separate behavioral edge from illiquidity risk
- Resolution source quality: Markets resolving via a single authoritative source (official election results, exchange close price) have cleaner edge than markets resolving via "admin discretion" — apply a resolution clarity multiplier to the conviction
- Temporal decay toward resolution: As a market approaches resolution, the bias should compress (less time for narrative to accumulate). Wire in a decay function:
mult *= max(0.7, days_to_resolution / 30) to reduce size as markets near their end date
Safety & Execution Mode
The skill defaults to paper trading (venue="sim"). Real trades only with --live flag.
| Scenario | Mode | Financial risk |
|---|
| INLINECODE6 | Paper (sim) | None |
| Cron / automaton |
Paper (sim) | None |
|
python trader.py --live | Live (polymarket) | Real USDC |
INLINECODE8 and cron: null — nothing runs automatically until you configure it in Simmer UI.
Required Credentials
| Variable | Required | Notes |
|---|
| INLINECODE10 | Yes | Trading authority. Treat as high-value credential. |
Tunables (Risk Parameters)
All declared as tunables in clawhub.json and adjustable from the Simmer UI.
| Variable | Default | Purpose |
|---|
| INLINECODE13 | INLINECODE14 | Max USDC per trade (reached at 100% conviction) |
| INLINECODE15 |
10000 | Min market volume filter — higher bar to ensure genuine behavioral pricing, not illiquidity |
|
SIMMER_MAX_SPREAD |
0.06 | Max bid-ask spread (6%) — tight to preserve statistical edge |
|
SIMMER_MIN_DAYS |
3 | Min days until resolution — avoid markets where convergence has already started |
|
SIMMER_MAX_POSITIONS |
10 | Max concurrent open positions |
|
SIMMER_MIN_TRADE |
5 | Floor for any trade (min USDC regardless of conviction) |
|
SIMMER_LONGSHOT_THRESHOLD |
0.10 | Buy NO when market probability ≤ this value |
|
SIMMER_CERTAINTY_THRESHOLD |
0.88 | Buy YES when market probability ≥ this value |
Dependency
INLINECODE29 by Simmer Markets (SpartanLabsXyz)
- - PyPI: https://pypi.org/project/simmer-sdk/
- GitHub: https://github.com/SpartanLabsXyz/simmer-sdk
冷门偏差交易者
这是一个模板。
默认信号纯粹基于价格——无需外部API。该技能可发现所有类别中的流动性市场,识别行为错误定价最严重的极端概率,并逆势交易。
该技能处理所有底层工作(市场发现、交易执行、安全防护)。您的智能体提供阿尔法收益。
策略概述
冷门偏差是博彩市场研究中被复制次数最多的异常现象。最早由Griffith(1949年)在赛马中发现,此后在体育博彩、金融期权(波动率微笑是其近亲)和预测市场中均得到证实。
核心发现: 参与者系统性地高估低概率结果的兴奋感,同时低估近乎确定结果的枯燥可靠性。
- - 定价为6%的市场,其真实概率更可能在2-3%——散户在押注梦想。
- 定价为91%的市场,其真实概率更可能在95-97%——散户觉得完全押注它太无聊。
这创造了两个方向相反的可行优势:
- 1. 逆势冷门(当p极低时买入NO): 人群高估了罕见事件。当p≤10%时买入NO,你获得的是该高估赌注的反向仓位。
- 押注近乎确定(当p极高时买入YES): 人群低估了可能发生的结果。当p≥88%时买入YES,你获得的是被低估的仓位。
这些不是对事件的定向押注——它们是针对已知行为偏差的结构性押注,这种偏差在每个市场、每一天都会重新产生。
核心洞察:冷门偏差为何存在
三种行为机制同时驱动着这种偏差:
1. 概率扭曲(Kahneman & Tversky)
人类并非线性感知概率。我们将5%视为可能会发生,将95%视为可能不会失败。这以可预测的方式扭曲了价格:低概率被高估,高概率被低估。
2. 叙事显著性
一个5%的冷门有一个引人入胜的故事。想象一下如果它发生了。散户为这个故事支付溢价。一个95%的近乎确定性很无聊——散户不会为显然无论如何都会发生的事情支付全价。
3. 偏度偏好
小概率获得大收益在心理上具有吸引力,即使期望值为负。这与人们购买彩票的原因相同。在预测市场中,冷门的NO方提供了在相反方向小概率获得大收益的机会——但散户不会这样理解。
信号逻辑
默认信号:基于置信度的极端概率逆势
该技能使用与标准预测市场交易者相反的阈值:
| 标准交易者 | 冷门偏差交易者 |
|---|
| 当p低时买入YES(你认为会发生) | 当p低时买入NO(市场高估了冷门) |
| 当p高时买入NO(你认为不会发生) |
当p高时买入YES(市场低估了确定性) |
步骤1 — 市场发现:
在所有高流动性类别(政治、加密货币、体育、宏观、科技、地缘政治)中进行广泛关键词扫描。冷门偏差与类别无关——它存在于任何散户交易的地方。
步骤2 — 信号门控:
- - 价差 ≤ MAXSPREAD(宽价差会侵蚀优势)
- 距结算天数 ≥ MINDAYS(避免临近结算的噪音,此时收敛可能已经开始)
步骤3 — 信号方向:
- - p ≤ LONGSHOTTHRESHOLD → 买入NO(逆势高估的冷门)
- p ≥ CERTAINTYTHRESHOLD → 买入YES(押注被低估的近乎确定性)
- 介于阈值之间 → 跳过
步骤4 — 置信度仓位计算:
对于NO(逆势冷门):
置信度 = (LONGSHOTTHRESHOLD - p) / LONGSHOTTHRESHOLD
当p=0%时:置信度=1.0 → MAXPOSITION。当p=LONGSHOTTHRESHOLD时:置信度=0.0 → MIN_TRADE下限。
对于YES(押注近乎确定性):
置信度 = (p - CERTAINTYTHRESHOLD) / (1 - CERTAINTYTHRESHOLD)
当p=100%时:置信度=1.0 → MAXPOSITION。当p=CERTAINTYTHRESHOLD时:置信度=0.0 → MIN_TRADE下限。
步骤5 — 质量乘数(longshotquality_mult):
三个因素调整置信度上下浮动:
| 因素 | 捕捉内容 | 范围 |
|---|
| 错误定价深度 | 更深的冷门/更高的确定性被错误定价更严重 | 1.00 → 1.25倍 |
| 叙事显著性 |
情绪化框架进一步推高冷门价格 | 1.00 → 1.15倍 |
| 结算清晰度 | 客观标准 → 更清晰的优势;模糊标准 → 噪音 | 0.90 → 1.05倍 |
合并后上限为1.30倍。
仓位计算方式
使用默认值(LONGSHOTTHRESHOLD=10%,CERTAINTYTHRESHOLD=88%,MINTRADE=$5,MAXPOSITION=$30):
逆势冷门(买入NO):
| 市场价格p | 置信度 | 仓位大小 |
|---|
| 10%(阈值处) | 0% | $5(下限) |
| 7% |
30% | $9 |
| 4% | 60% | $18 |
| 1% | 90% | $27 |
| 0% | 100% | $30 |
押注近乎确定性(买入YES):
| 市场价格p | 置信度 | 仓位大小 |
|---|
| 88%(阈值处) | 0% | $5(下限) |
| 92% |
33% | $10 |
| 96% | 67% | $20 |
| 99% | 92% | $28 |
监控关键词
总统,选举,国会,参议院,美联储,降息,加息,
通胀,衰退,GDP,失业,
比特币,以太坊,加密货币,BTC,ETH,
锦标赛,世界杯,超级碗,NBA总决赛,世界大赛,
英超,欧冠,
IPO,收购,合并,破产,财报,
AGI,人工智能,GPT,临床试验,FDA,
停火,制裁,入侵,条约,北约
混音信号创意
- - 来自Polymarket历史市场的校准数据:如果已结算市场显示定价为5%的市场只有1.5%的时间结算为YES,你就有了一个精确的期望值优势来交易——用校准曲线替换关键词阈值
- 跨类别校准:某些类别(体育、名人)的偏差比其他类别(宏观、加密货币)更强——按类别特定的历史高估率加权置信度
- 冷门的成交量过滤器:成交量极低的冷门可能是由于流动性原因而非行为原因被错误定价——为低于10%的市场添加最低成交量门控,以区分行为优势与流动性风险
- 结算来源质量:通过单一权威来源(官方选举结果、交易所收盘价)结算的市场比通过管理员自由裁量结算的市场具有更清晰的优势——对置信度应用结算清晰度乘数
- 临近结算的时间衰减:随着市场接近结算,偏差应该压缩(叙事积累的时间减少)。引入衰减函数:mult *= max(0.7, daystoresolution / 30),在市场接近到期日时减少仓位
安全与执行模式
该技能默认为模拟交易(venue=sim)。仅使用--live标志进行真实交易。
| 场景 | 模式 | 财务风险 |
|---|
| python trader.py | 模拟(sim) | 无 |
| Cron/自动化 |
模拟(sim) | 无 |
| python trader.py --live | 实盘(polymarket) | 真实USDC |
autostart: false和cron: null——在Simmer UI中配置之前,不会自动运行任何内容。
所需凭证
| 变量 | 必需 | 备注 |
|---|
| SIMMERAPIKEY | 是 | 交易授权。视为高价值凭证。 |
可调参数(风险参数)
所有参数均在clawhub.json中声明为tunables,可从Simmer UI调整。
| 变量 | 默认值 | 用途 |
|---|
| SIMMERMAXPOSITION | 30 | 每笔交易最大USDC(100%置信度时达到) |
| SIMMERMINVOLUME |
10000 | 最低市场成交量过滤器——更高门槛以确保真正的行为定价,而非流动性不足 |
| SIMMER
MAXSPREAD | 0.06 | 最大买卖价差(6%)——收紧以保持统计优势 |
| SIMMER
MINDAYS | 3 | 距结算最少天数