polly-gamba 1.0.18 → 1.0.19

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.
@@ -254,7 +254,7 @@ For EVERY market above: if price differs from fair probability by >8%, place a t
254
254
  await this.redis.ltrim(`${prefix}:reviews`, 0, 9999);
255
255
  const positionLines = positions.map(p => {
256
256
  const gainPct = (p.gain_pct * 100).toFixed(1);
257
- const stopLossWarning = p.gain_pct <= -0.35 ? ' ⚠️ HARD STOP ZONE (-35%)' : '';
257
+ const stopLossWarning = p.gain_pct <= -0.35 ? ' ⚠️ HARD STOP (-35%+ loss — Rule 2/4 MUST apply)' : '';
258
258
  return `### ${p.market_id} ${p.market_question}
259
259
  - Outcome: ${p.outcome} | Entry: ${p.entry_price} | Now: ${p.current_price} | Gain: ${gainPct}%${stopLossWarning}
260
260
  - Size: $${p.size_usdc} | Hours to expiry: ${p.hours_to_expiry.toFixed(1)}h
@@ -267,12 +267,14 @@ Review each open position. For each position: check whether the exit trigger con
267
267
 
268
268
  ${positionLines}
269
269
 
270
- CLOSE RULES (call close_position for any that apply):
271
- 1. Exit trigger condition has been met (e.g. specific price level hit, event occurred)
272
- 2. Position is down >35% AND the fundamental thesis has materially weakened or been disproven
273
- 3. Market has moved to extreme (>90% or <10%) suggesting resolution is near and against us
270
+ CLOSE RULES apply ALL that match, no thesis override allowed:
271
+ 1. Exit trigger condition has been met (e.g. specific price level hit, event occurred). Apply literally.
272
+ 2. Position is down >35% AND the fundamental thesis has materially weakened or been disproven (market structure changed, key assumption invalidated).
273
+ 3. Your side of the position is priced below 10% HARD CLOSE. The market has strongly repriced against you. Do NOT override this with "thesis not disproven yet." At <10%, expected value of holding is near zero.
274
+ 4. Position is down >50% — HARD CLOSE regardless of thesis. Cut losses. No exceptions.
275
+ 5. You have 2+ open positions in the SAME market and both are losing — close the one with the higher percentage loss to reduce duplicate exposure.
274
276
 
275
- HOLD RULES: If thesis still valid and exit trigger NOT triggered, do nothing (no output needed).`;
277
+ HOLD RULES: If NONE of the close rules apply and exit trigger NOT triggered, do nothing (no output needed).`;
276
278
  const msg = JSON.stringify({
277
279
  type: 'user',
278
280
  message: { role: 'user', content: prompt }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "polly-gamba",
3
- "version": "1.0.18",
3
+ "version": "1.0.19",
4
4
  "description": "Coinbase price signal → Claude brain → Polymarket CLOB execution",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
package/service.log CHANGED
@@ -71,3 +71,54 @@ npm warn deprecated prebuild-install@7.1.3: No longer maintained. Please contact
71
71
  /Users/feral/.npm/_npx/fe561c72834ff84d/node_modules/.bin/polly-gamba: line 1: use strict: command not found
72
72
  /Users/feral/.npm/_npx/fe561c72834ff84d/node_modules/.bin/polly-gamba: line 2: syntax error near unexpected token `('
73
73
  /Users/feral/.npm/_npx/fe561c72834ff84d/node_modules/.bin/polly-gamba: line 2: `var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {'
74
+ /Users/feral/.npm/_npx/fe561c72834ff84d/node_modules/.bin/polly-gamba: line 1: use strict: command not found
75
+ /Users/feral/.npm/_npx/fe561c72834ff84d/node_modules/.bin/polly-gamba: line 2: syntax error near unexpected token `('
76
+ /Users/feral/.npm/_npx/fe561c72834ff84d/node_modules/.bin/polly-gamba: line 2: `var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {'
77
+ npm warn deprecated prebuild-install@7.1.3: No longer maintained. Please contact the author of the relevant native addon; alternatives are available.
78
+ [polly-gamba] Starting paper trading service
79
+ [polly-gamba] Claude cwd: /Users/feral/polly-gamba
80
+ [polly-gamba] Expiring trader cwd: /Users/feral/polly-gamba-expiring
81
+ [coinbase-ws] Connecting to wss://ws-feed.exchange.coinbase.com
82
+ [polly-gamba] Listening for BTC/ETH price signals (threshold: 0.5% in 60s)...
83
+ [scan] fetching high-quality markets (vol24h>$50k, liq>$50k, price 0.10-0.90)
84
+ [gamma] Fetching active markets from https://gamma-api.polymarket.com/markets?active=true&closed=false&limit=500
85
+ [expiring] fetching expiring markets (closing within 72h, vol24h>$10k, liq>$10k, price 0.05-0.95)
86
+ [gamma] Fetching active markets from https://gamma-api.polymarket.com/markets?active=true&closed=false&limit=500
87
+ [gamma] Loaded 496 markets (filtered from 500)
88
+ [expiring] 0 expiring markets for review
89
+ [expiring] no expiring markets found this cycle
90
+ [coinbase-ws] Connected
91
+ [gamma] Loaded 496 markets (filtered from 500)
92
+ [scan] 16 high-quality markets for autonomous review
93
+ [claude-trader:anthropic] ready
94
+ [claude-trader:ollama] ready
95
+ [claude-trader:expiring] ready
96
+ [position-monitor] checked=25 review_candidates=8 (moved>5% or <72h expiry)
97
+ [scan] fetching high-quality markets (vol24h>$50k, liq>$50k, price 0.10-0.90)
98
+ [gamma] Fetching active markets from https://gamma-api.polymarket.com/markets?active=true&closed=false&limit=500
99
+ [expiring] fetching expiring markets (closing within 72h, vol24h>$10k, liq>$10k, price 0.05-0.95)
100
+ [gamma] Fetching active markets from https://gamma-api.polymarket.com/markets?active=true&closed=false&limit=500
101
+ [position-monitor] checked=25 review_candidates=8 (moved>5% or <72h expiry)
102
+ [gamma] Loaded 496 markets (filtered from 500)
103
+ [expiring] 0 expiring markets for review
104
+ [expiring] no expiring markets found this cycle
105
+ [gamma] Loaded 496 markets (filtered from 500)
106
+ [scan] 16 high-quality markets for autonomous review
107
+ [scan] fetching high-quality markets (vol24h>$50k, liq>$50k, price 0.10-0.90)
108
+ [gamma] Fetching active markets from https://gamma-api.polymarket.com/markets?active=true&closed=false&limit=500
109
+ [expiring] fetching expiring markets (closing within 72h, vol24h>$10k, liq>$10k, price 0.05-0.95)
110
+ [gamma] Fetching active markets from https://gamma-api.polymarket.com/markets?active=true&closed=false&limit=500
111
+ [position-monitor] checked=25 review_candidates=7 (moved>5% or <72h expiry)
112
+ [gamma] Loaded 496 markets (filtered from 500)
113
+ [expiring] 0 expiring markets for review
114
+ [expiring] no expiring markets found this cycle
115
+ [gamma] Loaded 496 markets (filtered from 500)
116
+ [scan] 16 high-quality markets for autonomous review
117
+ [scan] fetching high-quality markets (vol24h>$50k, liq>$50k, price 0.10-0.90)
118
+ [gamma] Fetching active markets from https://gamma-api.polymarket.com/markets?active=true&closed=false&limit=500
119
+ [position-monitor] checked=25 review_candidates=8 (moved>5% or <72h expiry)
120
+ [gamma] Loaded 496 markets (filtered from 500)
121
+ [scan] 16 high-quality markets for autonomous review
122
+ [expiring] fetching expiring markets (closing within 72h, vol24h>$10k, liq>$10k, price 0.05-0.95)
123
+ [expiring] 0 expiring markets for review
124
+ [expiring] no expiring markets found this cycle
@@ -304,7 +304,7 @@ For EVERY market above: if price differs from fair probability by >8%, place a t
304
304
 
305
305
  const positionLines = positions.map(p => {
306
306
  const gainPct = (p.gain_pct * 100).toFixed(1)
307
- const stopLossWarning = p.gain_pct <= -0.35 ? ' ⚠️ HARD STOP ZONE (-35%)' : ''
307
+ const stopLossWarning = p.gain_pct <= -0.35 ? ' ⚠️ HARD STOP (-35%+ loss — Rule 2/4 MUST apply)' : ''
308
308
  return `### ${p.market_id} ${p.market_question}
309
309
  - Outcome: ${p.outcome} | Entry: ${p.entry_price} | Now: ${p.current_price} | Gain: ${gainPct}%${stopLossWarning}
310
310
  - Size: $${p.size_usdc} | Hours to expiry: ${p.hours_to_expiry.toFixed(1)}h
@@ -318,12 +318,14 @@ Review each open position. For each position: check whether the exit trigger con
318
318
 
319
319
  ${positionLines}
320
320
 
321
- CLOSE RULES (call close_position for any that apply):
322
- 1. Exit trigger condition has been met (e.g. specific price level hit, event occurred)
323
- 2. Position is down >35% AND the fundamental thesis has materially weakened or been disproven
324
- 3. Market has moved to extreme (>90% or <10%) suggesting resolution is near and against us
321
+ CLOSE RULES apply ALL that match, no thesis override allowed:
322
+ 1. Exit trigger condition has been met (e.g. specific price level hit, event occurred). Apply literally.
323
+ 2. Position is down >35% AND the fundamental thesis has materially weakened or been disproven (market structure changed, key assumption invalidated).
324
+ 3. Your side of the position is priced below 10% HARD CLOSE. The market has strongly repriced against you. Do NOT override this with "thesis not disproven yet." At <10%, expected value of holding is near zero.
325
+ 4. Position is down >50% — HARD CLOSE regardless of thesis. Cut losses. No exceptions.
326
+ 5. You have 2+ open positions in the SAME market and both are losing — close the one with the higher percentage loss to reduce duplicate exposure.
325
327
 
326
- HOLD RULES: If thesis still valid and exit trigger NOT triggered, do nothing (no output needed).`
328
+ HOLD RULES: If NONE of the close rules apply and exit trigger NOT triggered, do nothing (no output needed).`
327
329
 
328
330
  const msg = JSON.stringify({
329
331
  type: 'user',