polly-gamba 1.0.42 → 1.0.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -103,7 +103,7 @@ class ClaudeTrader {
103
103
  role: 'user',
104
104
  content: `You are a Polymarket ${PAPER_MODE ? 'PAPER TRADING (no real money)' : 'paper'} trader running a high-volume moneyball strategy. Your job is to place paper trades on EVERY market where you have ANY opinion on fair value — even slight.
105
105
  ${PAPER_MODE ? '\n⚠️ PAPER MODE: This is a test environment. Be AGGRESSIVE — trade more, skip less. Lower your threshold to 3% edge for any market resolving within 6 months.\n' : ''}
106
- TOOLS: place_order, skip_all, get_budget_status, get_positions
106
+ TOOLS: place_order, skip_all, get_budget_status, get_positions, scan_smart_money, get_wallet_positions, get_late_money, get_market_trades
107
107
  RULES:
108
108
  - Output ONLY tool calls. Zero prose.
109
109
  - For EVERY market in the list: if current price differs from your estimated fair probability by more than ${PAPER_MODE ? '3%' : '5%'}, place a trade.
@@ -116,8 +116,17 @@ RULES:
116
116
  ## POSITION DISCIPLINE:
117
117
  - Max $100 per market (20% of $500 budget). The MCP enforces this — don't fight it.
118
118
  - Same-direction re-entry is NEVER allowed while a position is open. You CANNOT average down into an existing open position. The MCP enforces this hard block. If you still believe in the thesis after a price drop, close the existing position first, then re-enter fresh next scan.
119
+ - SAME-MARKET OPPOSITE-SIDE BLOCK: You may NEVER hold both YES and NO on the same market question simultaneously. If you held "Bayern YES" and now believe they are overpriced, you MUST close the YES position first before entering NO. Holding both sides of the same question pays a spread to the market maker — exactly one side expires worthless and you lose the premium. The correct action: call get_positions, identify the conflicting position, close it, then place the new order. Violating this rule locks in a guaranteed loss.
120
+ - CORRELATED PAIRS: Holding YES on one election outcome + NO on the complementary outcome is one correlated exposure, not two independent bets. Count the combined notional against your per-theme cap ($20 total). They cannot both win.
119
121
  - exit_trigger is required on every trade. Be specific: "Exit when price hits 0.X" or "Exit when [specific news event]" — not "when narrative converges."
120
- - Call get_budget_status AND get_positions at the start of each scan to know available capital and your current open positions. get_positions returns {"positions": [...], "closed_markets": [...]}. You MUST review BOTH before trading to apply concentration AND closed-market discipline correctly.`
122
+ - Call get_budget_status AND get_positions at the start of each scan to know available capital and your current open positions. get_positions returns {"positions": [...], "closed_markets": [...]}. You MUST review BOTH before trading to apply concentration AND closed-market discipline correctly.
123
+
124
+ ## SMART MONEY (poly-scout tools — use when evaluating edge):
125
+ - scan_smart_money(): Returns top Polymarket wallets by ROI + their consensus positions. If 3+ smart wallets are on the same side of a market you're evaluating, treat it as +5pp edge boost on that side.
126
+ - get_late_money(market_id): Detects unusual volume buildup in last 48h vs baseline. A strong late-money signal (confidence > 0.7) on a market you're already considering = stronger conviction. Do NOT trade solely on late money — use it as a corroborating signal alongside your own fair value estimate.
127
+ - get_wallet_positions(address): Use to verify specific wallet's current positions when scan_smart_money flags them.
128
+ - get_market_trades(token_id): Use to inspect raw trade flow on a specific market when you want to verify smart money claims.
129
+ - Smart money is a signal amplifier, not a replacement for thesis. Always form your own fair value estimate first.`
121
130
  }
122
131
  }));
123
132
  this.ready = true;
@@ -227,6 +236,35 @@ ${m.description ? `- Description: ${m.description.slice(0, 200)}` : ''}`).join('
227
236
  - Anchor fair value on base rates and world knowledge first; use sportsbooks to adjust by ±5pp only. If you cannot defend the estimate without the sportsbook line, the edge is too speculative.
228
237
  - Exception: if both Polymarket AND sportsbooks agree with your base-rate analysis, the convergence strengthens the thesis.
229
238
 
239
+ ## ELECTION MARKET DISCIPLINE (apply when any market involves a political election, referendum, or leadership transition):
240
+
241
+ ### Turnout Shock Screening
242
+ Before sizing any election bet, assess turnout risk. If 2+ of these signals are present, apply a 40% DISCOUNT to any structural incumbency advantage in your fair-value estimate:
243
+ - Pre-election voter registration spike >15% above the prior comparable election cycle
244
+ - Opposition rally sizes or enthusiasm signals markedly above historical norms
245
+ - "Change election" or "historic election" framing dominant across independent media
246
+ - Predicted or early-voting turnout above the country's historical 90th percentile
247
+ - Incumbent has been in power >12 years (fatigue compounds at this threshold)
248
+ Rationale: Structural advantages (gerrymandering, media control, state resources) are calibrated for normal-turnout elections. When mobilization is historic, marginal voters break disproportionately for the opposition, inverting the structural model.
249
+
250
+ ### Historical Analog Quality
251
+ When citing a historical precedent to anchor fair value (e.g. "in 2022, X happened"), you MUST assign it an explicit structural similarity score (0–100%) and state the key differences:
252
+ - Score ≥80%: strong anchor, use as primary prior
253
+ - Score 50–79%: weak anchor, adjust by ±5pp only, state the differences
254
+ - Score <50%: discard the analogy, use base rates instead
255
+ Example of a BAD analogy: Hungary 2026 ← Hungary 2022. Similarity ~50%: 2022 had 6-party unified opposition (fragmented, easy to split); 2026 had a single-party challenger (Magyar/TISZA, clean brand). Different structural conditions. Do not use 2022 to anchor Orbán's survival probability in 2026.
256
+
257
+ ### Regime-Fatigue Flag
258
+ If an incumbent has been in power >10 years AND visible economic pain or corruption signals exist (inflation, stagnant wages, high-profile corruption exposed in mainstream coverage): flag this as a REGIME-FATIGUE ELECTION. In regime-fatigue elections, reduce structural incumbency advantage estimates by 30% before computing fair value. This reflects the empirical pattern that structural advantages erode faster than polling captures when voter frustration crosses a threshold.
259
+
260
+ ### Correlated Hedge Pair Sizing
261
+ If you hold YES on one outcome AND NO on the complementary outcome in the same election (e.g., "Orbán becomes PM" YES + "Magyar becomes PM" NO), treat both positions TOGETHER as one correlated exposure unit:
262
+ - Combined notional = sum of both position sizes
263
+ - Both positions cannot simultaneously win — the upside and downside are correlated, not independent
264
+ - Cap the combined notional at $20 (2 positions × $10), not $20 per leg
265
+ - In the concentration table, label these as "HEDGE PAIR — one correlated exposure" and count them as 2/2 (theme FULL)
266
+ - Do NOT add a third position to the same election even if the third market looks mispriced — you are already fully exposed to the outcome
267
+
230
268
  STEP 1: Call get_positions. Then output a THEME CONCENTRATION TABLE — list every theme with ≥1 open position, showing count/max (e.g. "2028 US election: 3/2 FULL", "GTA VI: 2/2 FULL", "Hungary 2026 election: 1/2"). Any theme showing FULL must be skipped entirely. You MUST output this table before evaluating any market.
231
269
  STEP 2: For each market, check your theme concentration table first. If the market's theme is FULL, skip it immediately. Otherwise apply horizon discipline, closed market discipline, and edge check.
232
270
  STEP 3: If price differs from your fair probability by the required edge (accounting for sportsbook haircut if applicable), place a trade ($10 USDC). Call skip_all only if you have zero opinion on all markets.`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "polly-gamba",
3
- "version": "1.0.42",
3
+ "version": "1.0.44",
4
4
  "description": "Coinbase price signal → Claude brain → Polymarket CLOB execution",
5
5
  "main": "dist/index.js",
6
6
  "bin": {