polly-gamba 1.0.12 → 1.0.13

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.
@@ -0,0 +1,14 @@
1
+ {
2
+ "mcpServers": {
3
+ "polly-paper": {
4
+ "command": "npx",
5
+ "args": ["ts-node", "/Users/feral/polly-gamba/src/mcp-server.ts"],
6
+ "env": {
7
+ "REDIS_URL": "redis://localhost:6379"
8
+ }
9
+ }
10
+ },
11
+ "permissions": {
12
+ "allow": ["mcp__polly-paper__place_order", "mcp__polly-paper__skip_market"]
13
+ }
14
+ }
package/.mcp.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "mcpServers": {
3
+ "polly-paper": {
4
+ "command": "node",
5
+ "args": ["/Users/feral/polly-gamba/dist/mcp-server.js"],
6
+ "env": {
7
+ "REDIS_URL": "redis://localhost:6379"
8
+ }
9
+ }
10
+ }
11
+ }
@@ -348,8 +348,6 @@ server.setRequestHandler(types_js_1.CallToolRequestSchema, async (req) => {
348
348
  throw new Error(`Unknown tool: ${name}`);
349
349
  });
350
350
  async function main() {
351
- // Initialize budget key (NX = don't overwrite if already set)
352
- await redis.set(`${REDIS_PREFIX}:budget`, '500', 'NX');
353
351
  const transport = new stdio_js_1.StdioServerTransport();
354
352
  await server.connect(transport);
355
353
  console.error('[mcp] polly-gamba-paper MCP server started (stdio)');
@@ -42,20 +42,17 @@ class PositionMonitor {
42
42
  console.log(`[position-monitor] 0 open positions to check`);
43
43
  return;
44
44
  }
45
- // Deduplicate market fetches keyed by marketId_outcome
45
+ // Deduplicate market fetches
46
46
  const marketPriceCache = new Map();
47
- const uniqueKeys = [...new Set(toCheck.map(p => `${p.market_id}|${p.outcome}`))];
48
- await Promise.all(uniqueKeys.map(async (key) => {
49
- const sep = key.indexOf('|');
50
- const marketId = key.slice(0, sep);
51
- const outcome = key.slice(sep + 1);
52
- const result = await this.fetchCurrentPrice(marketId, outcome).catch(() => null);
53
- marketPriceCache.set(key, result);
47
+ const uniqueMarkets = [...new Set(toCheck.map(p => p.market_id))];
48
+ await Promise.all(uniqueMarkets.map(async (marketId) => {
49
+ const result = await this.fetchCurrentPrice(marketId, 'Yes').catch(() => null);
50
+ marketPriceCache.set(marketId, result);
54
51
  }));
55
52
  // Build review candidates with current price data for Claude
56
53
  const reviewCandidates = [];
57
54
  for (const pos of toCheck) {
58
- const currentPrice = marketPriceCache.get(`${pos.market_id}|${pos.outcome}`) ?? null;
55
+ const currentPrice = await this.fetchCurrentPrice(pos.market_id, pos.outcome);
59
56
  if (!currentPrice)
60
57
  continue;
61
58
  const entryPrice = pos.price;
package/package.json CHANGED
@@ -1,8 +1,11 @@
1
1
  {
2
2
  "name": "polly-gamba",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
4
4
  "description": "Coinbase price signal → Claude brain → Polymarket CLOB execution",
5
5
  "main": "dist/index.js",
6
+ "bin": {
7
+ "polly-gamba": "dist/index.js"
8
+ },
6
9
  "scripts": {
7
10
  "start": "ts-node src/index.ts",
8
11
  "mcp": "ts-node src/mcp/server.ts",