polly-gamba 1.0.38 → 1.0.41

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.
@@ -211,6 +211,7 @@ ${m.description ? `- Description: ${m.description.slice(0, 200)}` : ''}`).join('
211
211
  - MAX 2 open positions per underlying theme. If you already have 2+ open positions in the same theme, SKIP all new markets in that theme regardless of apparent edge.
212
212
  - Correlation examples: "Will Jesus return before GTA VI", "Will BTC hit $1M before GTA VI", "Will China invade Taiwan before GTA VI" — all three resolve based on GTA VI's release date. They are the SAME theme.
213
213
  - Similarly: "Will Orbán be PM" and "Will Magyar be PM" are both the Hungary 2026 election — treat as same theme (you may hold both as a hedge pair, but do not add a third Hungary position).
214
+ - IMPORTANT: All 2028 US election markets share one theme — "2028 US election". This includes: Dem primary nominees (Newsom, Harris, etc.), Rep primary nominees (Vance, Rubio, etc.), and the general election winner. Do NOT hold more than 2 positions across this entire cycle.
214
215
  - If you're uncertain whether a market correlates to an existing theme, assume it does and skip.
215
216
 
216
217
  ## CLOSED MARKET DISCIPLINE (absolute rule — never override):
@@ -225,8 +226,8 @@ ${m.description ? `- Description: ${m.description.slice(0, 200)}` : ''}`).join('
225
226
  - 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.
226
227
  - Exception: if both Polymarket AND sportsbooks agree with your base-rate analysis, the convergence strengthens the thesis.
227
228
 
228
- STEP 1: Call get_positions to see your current open positions AND closed_markets required before evaluating any market.
229
- STEP 2: For each market, apply horizon discipline, concentration discipline, AND closed market discipline (using the data from step 1).
229
+ 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.
230
+ 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.
230
231
  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.`;
231
232
  const msg = JSON.stringify({
232
233
  type: 'user',
@@ -298,7 +299,12 @@ For EVERY market above: if price differs from fair probability by >8%, place a t
298
299
  }).join('\n\n');
299
300
  const prompt = `## Position Review — ${new Date().toISOString()}
300
301
 
301
- Review each open position. For each position: check whether the exit trigger condition has been met AND use your world knowledge (recent news, current standings, sportsbook odds) to assess whether the original thesis still holds.
302
+ ## STEP 0 CONCENTRATION AUDIT (do this BEFORE reviewing individual positions):
303
+ Call get_positions to get the FULL list of all open positions. Count positions by underlying theme (see Rule 8 definition below). If ANY theme has 3+ open positions, immediately close the excess ones (starting with the one whose current price is closest to 50/50) until the theme has ≤2 positions. Do NOT wait — close them now before proceeding. If you have 4 positions in a theme, you must close 2.
304
+
305
+ ## Review Candidates (${positionLines.split('###').length - 1} positions that moved >5% or expire within 72h):
306
+
307
+ Review each candidate below. For each: check whether the exit trigger has been met AND use world knowledge to assess thesis.
302
308
 
303
309
  ${positionLines}
304
310
 
@@ -310,8 +316,8 @@ CLOSE RULES — apply ALL that match, no thesis override allowed:
310
316
  5. You have 2+ open positions in the SAME market with the SAME outcome — close the NEWER entry (higher ts value) regardless of P&L. Duplicate same-outcome positions double exposure without incremental edge. Keep the original entry.
311
317
  6. Position is UP >25% from entry AND has been held >48h — CLOSE to lock in profits. The market has moved significantly in your favor; gains are now vulnerable to reversion. Use take_profit reason. Exception: if the resolution event is within 7 days AND the position is still clearly on the right side, you may hold until resolution.
312
318
  7. STALE POSITION: Position held >7 days AND price has moved <5% from entry AND resolution event is >30 days away — CLOSE to redeploy capital. A position that doesn't move over 7 days means the mispricing wasn't as large as estimated. Cut it, accept the small loss/gain, and redeploy to markets with active price movement.
313
- 8. CONCENTRATION VIOLATION: Count open positions by underlying theme (the single real-world event that resolves all of them). Examples: "Will Jesus return before GTA VI", "Will BTC hit $1M before GTA VI", "Will China invade Taiwan before GTA VI" all share the theme "GTA VI release date". Similarly "Will Spurs win NBA Finals", "Will OKC win NBA Finals", "Will Celtics win NBA Finals" all share the theme "2026 NBA Finals". If you have 3+ positions in the same theme, close the one with the smallest current edge (current price closest to 50/50 or furthest from your target) to reduce to 2 positions. Apply this BEFORE checking other rules.
314
- 9. SPORTSBOOK THESIS DECAY: If the original reasoning cited a sportsbook cross-reference (e.g. "sportsbooks imply X%, Polymarket shows Y%") AND the position is currently down >20%: estimate current sportsbook consensus from your world knowledge. If the original sportsbook-Polymarket gap has narrowed by >60% (e.g. original 15pp gap is now ≤6pp), the arbitrage thesis is exhausted CLOSE with reason "thesis_decayed". Do not continue holding through hard stops when the original edge is structurally gone.
319
+ 8. CONCENTRATION VIOLATION: Count open positions by underlying theme (the single real-world event that resolves all of them). Examples: "Will Jesus return before GTA VI", "Will BTC hit $1M before GTA VI", "Will China invade Taiwan before GTA VI" all share the theme "GTA VI release date". Similarly "Will Spurs win NBA Finals", "Will OKC win NBA Finals", "Will Celtics win NBA Finals" all share the theme "2026 NBA Finals". IMPORTANT: All positions tied to the 2028 US election cycle share one theme — "2028 US election". This includes: 2028 Dem primary nominees (Newsom, etc.), 2028 Rep primary nominees (Vance, Rubio, etc.), and the 2028 general election winner — regardless of which stage of the race resolves each market. If you have 3+ positions in the same theme: close positions one by one (starting with the one whose current price is closest to 50/50) until you have ≤2 in that theme. If you have 4, you must close 2. If you have 5, close 3. Do NOT stop after closing just one if the theme still has 3+ positions. Apply this BEFORE checking other rules. This check requires the FULL position list — which is why Step 0 mandates calling get_positions first.
320
+ 9. SPORTSBOOK THESIS DECAY: If the original reasoning cited a sportsbook cross-reference (e.g. "sportsbooks imply X%, Polymarket shows Y%") AND the position is currently down >20%: CLOSE immediately with reason "thesis_decayed". This is a mechanical rule a -20% drawdown on a sportsbook arb trade is itself the signal that the cross-market gap has closed or the thesis was wrong. Do NOT attempt to re-estimate current sportsbook consensus or override based on "the sportsbook line is still there." The drawdown is the verdict. No exceptions.
315
321
 
316
322
  HOLD RULES: If NONE of the close rules apply and exit trigger NOT triggered, do nothing (no output needed).
317
323
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "polly-gamba",
3
- "version": "1.0.38",
3
+ "version": "1.0.41",
4
4
  "description": "Coinbase price signal → Claude brain → Polymarket CLOB execution",
5
5
  "main": "dist/index.js",
6
6
  "bin": {