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.
- package/.claude/settings.json +14 -0
- package/.mcp.json +11 -0
- package/dist/mcp-server.js +0 -2
- package/dist/position-monitor.js +6 -9
- package/package.json +4 -1
- package/service.log +2908 -0
- package/src/mcp-server.ts +0 -2
- package/src/position-monitor.ts +6 -9
|
@@ -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
package/dist/mcp-server.js
CHANGED
|
@@ -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)');
|
package/dist/position-monitor.js
CHANGED
|
@@ -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
|
|
45
|
+
// Deduplicate market fetches
|
|
46
46
|
const marketPriceCache = new Map();
|
|
47
|
-
const
|
|
48
|
-
await Promise.all(
|
|
49
|
-
const
|
|
50
|
-
|
|
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 =
|
|
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.
|
|
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",
|