Skip to content

Commit ab2c057

Browse files
alsk1992claude
andcommitted
Major update: 9 prediction markets, 5 trading platforms, x402 payments, arbitrage
## Prediction Markets (9 platforms) - Polymarket: Full trading + WebSocket - Kalshi: Full trading + WebSocket - Betfair: NEW - Full sports exchange with back/lay orders - Smarkets: NEW - Full exchange with 2% fees - Drift: NEW - Complete Solana trading - Manifold: Data feed - Metaculus: Data feed - PredictIt: Data feed ## Trading & Execution - Native TypeScript order execution - Limit, market, maker orders - Back/lay for betting exchanges - Portfolio tracking with PnL - Trade history ## Cross-Platform Arbitrage - Real-time price comparison - Automatic opportunity detection - Question similarity matching - Alert notifications ## x402 Payments - HTTP 402 machine-to-machine payments - Base (EVM) + Solana support - Client: Auto-pay for APIs - Server: Paywall middleware - Fee-free via Coinbase facilitator ## Crypto Price Feeds - 10 assets: BTC, ETH, SOL, XRP, DOGE, ADA, AVAX, MATIC, DOT, LINK - Binance WebSocket real-time - 24h stats (change, high, low, volume) - Fallbacks: Coinbase, CoinGecko ## AI & Agents - 6 LLM providers (Claude, GPT-4, Gemini, Groq, Together, Fireworks) - 4 specialized agents (Main, Trading, Research, Alerts) - 19+ tools (browser, SQL, git, docker, etc.) - Multi-agent routing - Semantic memory with embeddings ## Channels (14+) - Telegram, Discord, Slack, WhatsApp, Teams, Matrix, Signal - Google Chat, Line, iMessage, Mattermost, Nostr, Twitch Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 3372223 commit ab2c057

171 files changed

Lines changed: 54362 additions & 7955 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
node_modules
2+
dist
3+
.git
4+
.env
5+
.env.*
6+
npm-debug.log
7+
logs
8+
*.log
9+
*.sqlite
10+
*.db
11+
coverage
12+
tmp

.env.example

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,110 @@ METACULUS_TOKEN=
3737

3838
# Discord Bot
3939
DISCORD_BOT_TOKEN=
40+
DISCORD_APP_ID=
41+
WEBCHAT_TOKEN=
42+
POSITIONS_PRICE_UPDATE_INTERVAL_MS=300000
43+
POSITIONS_PRICE_UPDATE_ENABLED=true
44+
POSITIONS_PNL_SNAPSHOTS_ENABLED=true
45+
POSITIONS_PNL_HISTORY_DAYS=90
46+
SESSION_CLEANUP_ENABLED=true
47+
SESSION_CLEANUP_MAX_AGE_DAYS=30
48+
SESSION_CLEANUP_IDLE_DAYS=14
49+
MARKET_CACHE_ENABLED=true
50+
MARKET_CACHE_TTL_MS=1800000
51+
MARKET_CACHE_CLEANUP_INTERVAL_MS=900000
52+
MARKET_INDEX_ENABLED=true
53+
MARKET_INDEX_SYNC_INTERVAL_MS=21600000
54+
MARKET_INDEX_STALE_AFTER_MS=604800000
55+
MARKET_INDEX_LIMIT_PER_PLATFORM=300
56+
MARKET_INDEX_STATUS=open
57+
MARKET_INDEX_EXCLUDE_SPORTS=true
58+
MARKET_INDEX_PLATFORMS=polymarket,kalshi,manifold,metaculus
59+
MARKET_INDEX_MIN_VOLUME_24H=0
60+
MARKET_INDEX_MIN_LIQUIDITY=0
61+
MARKET_INDEX_MIN_OPEN_INTEREST=0
62+
MARKET_INDEX_MIN_PREDICTIONS=0
63+
MARKET_INDEX_EXCLUDE_RESOLVED=false
64+
MARKET_INDEX_PLATFORM_WEIGHTS={"polymarket":1,"kalshi":1,"manifold":1,"metaculus":1}
65+
66+
# Memory auto-capture/recall
67+
MEMORY_AUTO_ENABLED=true
68+
MEMORY_AUTO_SCOPE=user
69+
MEMORY_AUTO_MIN_INTERVAL_MS=120000
70+
MEMORY_AUTO_MAX_ITEMS_PER_TYPE=5
71+
MEMORY_AUTO_PROFILE_UPDATE_EVERY=6
72+
MEMORY_AUTO_SEMANTIC_TOPK=5
73+
MEMORY_AUTO_INCLUDE_CONTEXT=true
74+
MEMORY_AUTO_EXCLUDE_SENSITIVE=true
75+
76+
# Matrix
77+
MATRIX_HOMESERVER_URL=https://matrix.org
78+
MATRIX_ACCESS_TOKEN=
79+
MATRIX_USER_ID=@bot:matrix.org
80+
81+
# Signal (requires signal-cli linked to phone)
82+
SIGNAL_PHONE_NUMBER=+15551234567
83+
SIGNAL_CLI_PATH=signal-cli
84+
SIGNAL_CONFIG_DIR=
85+
86+
# iMessage (macOS only)
87+
IMESSAGE_ENABLED=0
88+
IMESSAGE_POLL_INTERVAL=2000
89+
90+
# LINE
91+
LINE_CHANNEL_ACCESS_TOKEN=
92+
LINE_CHANNEL_SECRET=
93+
LINE_WEBHOOK_PORT=0
94+
LINE_WEBHOOK_PATH=
95+
96+
# Google Chat
97+
GOOGLECHAT_CREDENTIALS_PATH=
98+
GOOGLECHAT_CLIENT_EMAIL=
99+
GOOGLECHAT_PRIVATE_KEY=
100+
GOOGLECHAT_PROJECT_ID=
40101

41102
# Twitter (for news)
42103
TWITTER_BEARER_TOKEN=
43104

44105
# Gateway auth
45106
CLODDS_TOKEN=
46107

108+
# MCP
109+
CLODDS_MCP_RESOURCE_CHUNK_BYTES=65536
110+
111+
# Streaming responses (edit-in-place where supported)
112+
CLODDS_STREAM_RESPONSES=true
113+
CLODDS_STREAM_RESPONSE_INTERVAL_MS=500
114+
115+
# Public webhook base (for Teams/Google Chat/etc.)
116+
CLODDS_PUBLIC_HOST=localhost
117+
CLODDS_PUBLIC_SCHEME=http
118+
119+
# Group policies (JSON string, optional)
120+
# Example:
121+
# CLODDS_GROUP_POLICIES='{"slack":{"C01234567":{"requireMention":true}},"telegram":{"-1001234567890":{"requireMention":true}}}'
122+
CLODDS_GROUP_POLICIES=
123+
47124
# Logging
48125
LOG_LEVEL=info
126+
127+
# SMTP (optional, for email alerts)
128+
SMTP_HOST=
129+
SMTP_PORT=587
130+
SMTP_USER=
131+
SMTP_PASS=
132+
SMTP_SECURE=false
133+
134+
# Database backups
135+
# Backup interval in minutes (0 disables)
136+
CLODDS_DB_BACKUP_INTERVAL_MINUTES=60
137+
# Max backup files to retain
138+
CLODDS_DB_BACKUP_MAX=10
139+
140+
# Hook tracing (debugging)
141+
# Set to 1 to enable hook trace logging
142+
CLODDS_HOOK_TRACE=0
143+
# Max in-memory trace entries
144+
CLODDS_HOOK_TRACE_LIMIT=200
145+
# Optional trace file path
146+
# CLODDS_HOOK_TRACE_FILE=~/.clodds/hooks/trace.log

.github/workflows/ci.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
- name: Setup Node
15+
uses: actions/setup-node@v4
16+
with:
17+
node-version: 20
18+
cache: npm
19+
- name: Install
20+
run: npm ci
21+
- name: Typecheck, test, build
22+
run: npm run ci

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,4 @@ coverage/
3535

3636
# Local config (user's personal settings)
3737
# Note: clodds.json is the main config, don't commit with secrets
38+
workspace/pm-indexer

Dockerfile

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
FROM node:20-bookworm-slim AS builder
2+
3+
WORKDIR /app
4+
5+
COPY package.json package-lock.json tsconfig.json ./
6+
COPY src ./src
7+
COPY trading ./trading
8+
9+
RUN npm ci
10+
RUN npm run build
11+
12+
FROM node:20-bookworm-slim AS runner
13+
14+
WORKDIR /app
15+
16+
ENV NODE_ENV=production
17+
ENV CLODDS_STATE_DIR=/data
18+
ENV CLODDS_WORKSPACE=/data/workspace
19+
20+
COPY package.json package-lock.json ./
21+
RUN npm ci --omit=dev
22+
23+
COPY --from=builder /app/dist ./dist
24+
COPY --from=builder /app/trading ./trading
25+
26+
RUN apt-get update \
27+
&& apt-get install -y --no-install-recommends python3 python3-pip \
28+
&& pip3 install --no-cache-dir -r /app/trading/requirements.txt \
29+
&& rm -rf /var/lib/apt/lists/*
30+
31+
RUN mkdir -p /data /data/workspace \
32+
&& chown -R node:node /data
33+
34+
USER node
35+
36+
EXPOSE 18789
37+
38+
CMD ["node", "dist/index.js"]

0 commit comments

Comments
 (0)