clodds 1.6.26 → 1.7.0

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/README.md CHANGED
@@ -29,9 +29,9 @@
29
29
 
30
30
  ---
31
31
 
32
- **Clodds** is a personal AI trading terminal for prediction markets, crypto spot, and **perpetual futures with leverage**. Run it on your own machine, chat via any of **21 messaging platforms**, trade across **10 prediction markets + 7 futures exchanges** (including on-chain Solana perps via Percolator), and manage your portfolio — all through natural conversation.
32
+ **Clodds** is a personal AI trading terminal for prediction markets, crypto spot, perpetual futures with leverage, and **Bittensor subnet mining**. Run it on your own machine, chat via any of **21 messaging platforms**, trade across **10 prediction markets + 7 futures exchanges** (including on-chain Solana perps via Percolator), mine TAO on Bittensor, and manage your portfolio — all through natural conversation.
33
33
 
34
- Built on Claude with arbitrage detection algorithms based on [arXiv:2508.03474](https://arxiv.org/abs/2508.03474), which documented arbitrage patterns on Polymarket. See [Arbitrage Limitations](#arbitrage-limitations) for practical considerations.
34
+ Powered by Claude with 118+ trading strategies, whale tracking, arbitrage detection, copy trading, and DCA bots.
35
35
 
36
36
  ---
37
37
 
@@ -55,6 +55,22 @@ npm run build && npm start
55
55
  ```
56
56
  </details>
57
57
 
58
+ ## Demo
59
+
60
+ **30-second terminal onboarding** — See Clodds in action:
61
+
62
+ [![Watch the demo video](https://img.shields.io/badge/▶-Watch%20Demo-blue?style=for-the-badge)](https://cloddsbot.com/onboard.mp4)
63
+
64
+ The demo shows:
65
+ - `npm install -g clodds` → `clodds onboard`
66
+ - Onboarding wizard walks through credentials setup
67
+ - Fetches live 15-minute BTC prediction markets from Polymarket (in real-time)
68
+ - One command away from trading
69
+
70
+ After the demo: Set your env vars or input credentials, then you're ready to trade.
71
+
72
+ ---
73
+
58
74
  ## WebChat
59
75
 
60
76
  Built-in browser interface at `http://localhost:18789/webchat` -- no setup, no third-party dependencies.
@@ -111,22 +127,31 @@ See [docs/USER_GUIDE.md](./docs/USER_GUIDE.md) for all commands.
111
127
  |----------|-----------------|
112
128
  | **Messaging** | 21 platforms (Telegram, Discord, WhatsApp, Slack, Teams, Signal, Matrix, iMessage, LINE, Nostr, and more) + built-in WebChat with sidebar, unlimited history, context compacting |
113
129
  | **Prediction Markets** | 10 platforms (Polymarket, Kalshi, Betfair, Smarkets, Drift, Manifold, Metaculus, PredictIt, Opinion.xyz, Predict.fun) |
130
+ | **Polymarket Crypto Markets** | Deep expertise in BTC/ETH/SOL/XRP binary markets — 5-minute (BTC only), 15-minute, 1-hour, 4-hour, and daily rounds with round-based discovery, timing gates, and 4 automated strategies |
114
131
  | **Perpetual Futures** | 7 exchanges (Binance, Bybit, Hyperliquid, MEXC, Drift, Percolator, Lighter) with up to 200x leverage, database tracking, A/B testing |
115
132
  | **On-Chain Perps** | Percolator protocol — Solana-native perpetual futures with pluggable matchers, keeper cranking, real-time slab polling |
133
+ | **Trading Strategies** | 118+ strategies including momentum, mean reversion, penny clipper, expiry fade, DCA bots, smart routing, whale tracking, copy trading |
134
+ | **Risk Management** | Unified risk engine with circuit breaker, VaR/CVaR, volatility regime detection, stress testing, Kelly sizing, daily loss limits, kill switch |
135
+ | **Backtesting** | Configurable strategy backtesting with historical data, SL/TP validation, P&L analysis |
136
+ | **Skills System** | 119 bundled skills + lazy-loaded extensions (no missing dependencies crash) — chat-driven automation |
116
137
  | **Token Security** | GoPlus-powered audits — honeypot detection, rug-pull analysis, holder concentration, risk scoring |
117
138
  | **Security Shield** | Code scanning (75 rules), scam DB (70+ addresses), multi-chain address checking, pre-trade tx validation |
118
139
  | **Trading** | Order execution on 16+ platforms (prediction markets, futures, Solana DEXs, EVM DEXs), portfolio tracking, P&L, DCA |
140
+ | **Market Data** | Real-time orderbooks, candles, liquidity tracking, depth analysis, price feeds across all platforms |
119
141
  | **MCP Server** | Expose all 119 skills as MCP tools for Claude Desktop and Claude Code |
120
142
  | **Arbitrage** | Cross-platform detection, combinatorial analysis, semantic matching, real-time scanning |
121
143
  | **AI** | 8 LLM providers, 4 specialized agents, semantic memory, 18 tools |
144
+ | **Data Persistence** | SQLite (local), LanceDB (semantic memory + embeddings), PostgreSQL (analytics) — unlimited WebChat history, trade database, context compacting, hybrid search, user profiles |
122
145
  | **i18n** | 10 languages (EN, ZH, ES, JA, KO, DE, FR, PT, RU, AR) |
123
- | **Solana DeFi** | Jupiter, Raydium, Orca, Meteora, Kamino, MarginFi, Solend, Pump.fun, Bags.fm, AgentBets |
146
+ | **Solana DeFi** | Jupiter, Raydium, Orca, Meteora, Kamino, MarginFi, Solend, Pump.fun, Bags.fm |
124
147
  | **EVM DeFi** | Uniswap V3, 1inch, PancakeSwap, Virtuals Protocol, Clanker, Veil, ENS (ETH, ARB, OP, Base, Polygon) |
125
- | **Smart Trading** | Whale tracking, copy trading, smart routing, MEV protection |
126
148
  | **Trade Ledger** | Decision audit trail with confidence calibration, SHA-256 integrity hashing, statistics |
127
149
  | **Crypto Whale Tracking** | Multi-chain whale monitoring (Solana, ETH, Polygon, ARB, Base, OP) |
128
150
  | **Payments** | x402 protocol for machine-to-machine USDC payments (Base + Solana) |
129
151
  | **Bridging** | Wormhole cross-chain token transfers |
152
+ | **Agent Forum** | Agent-only discussion platform for market insights, strategy sharing, and voting (cloddsbot.com/forum) |
153
+ | **Agent Marketplace** | Peer-to-peer marketplace for AI agents to buy/sell strategies, APIs, datasets with USDC escrow on Solana |
154
+ | **Compute API** | Pay-per-use compute (LLM, code execution, web scraping, data, storage, trade execution) with USDC micropayments |
130
155
  | **Bittensor Mining** | Subnet mining with wallet management, earnings tracking, Chutes SN64 support |
131
156
  | **Automation** | Trading bots, cron jobs, webhooks, skills system |
132
157
 
@@ -321,60 +346,73 @@ Enable: `clodds config set ledger.enabled true`
321
346
  ## Architecture
322
347
 
323
348
  ```
324
- ┌─────────────────────────────────────────────────────────────────────┐
325
- GATEWAY
326
- HTTP • WebSocket • Auth • Rate Limiting • 1000 connections
327
- └─────────────────────────────────┬───────────────────────────────────┘
328
-
329
- ┌─────────────────────────┼─────────────────────────┐
330
- ▼ ▼ ▼
331
- ┌───────────────┐ ┌───────────────┐ ┌───────────────┐
332
- CHANNELS │ AGENTS │ │ FEEDS │
333
- (21) │ │ (4) │ │ (12+)
334
- ├───────────────┤ ├───────────────┤ ├───────────────┤
335
- Telegram │ │ Main │ │ Polymarket │
336
- │ Discord │ │ Trading │ │ Kalshi │
337
- WhatsApp │ │ Research │ │ Betfair
338
- Slack │ │ Alerts │ │ Manifold
339
- Teams │ │ │ │ Crypto (10)
340
- Matrix │ │ Tools (18) │ │
341
- │ Signal │ │ Skills (118) │ │ Arbitrage │
342
- +14 more │ │ Memory │ │ Detector │
343
- └───────────────┘ └───────────────┘ └───────────────┘
344
- │ │ │
345
- └─────────────────────────┼─────────────────────────┘
346
-
347
- ┌─────────────────────────┼─────────────────────────┐
348
- ▼ ▼ ▼
349
- ┌───────────────┐ ┌───────────────┐ ┌───────────────┐
350
- TRADING SOLANA PAYMENTS
351
- │ │ DeFi (x402)
352
- ├───────────────┤ ├───────────────┤ ├───────────────┤
353
- Execution Jupiter Base USDC
354
- Portfolio │ │ Raydium Solana USDC
355
- Trade Logger Orca Auto-approve
356
- Bots Meteora
357
- Risk Manager Pump.fun Wormhole
358
- Backtesting Bridge
359
- └───────────────┘ └───────────────┘ └───────────────┘
360
-
361
- ┌───────────────┐
362
- BITTENSOR
363
- ├───────────────┤
364
- Wallet
365
- Subnet Mining
366
- Earnings
367
- Chutes (SN64)
368
- └───────────────┘
369
-
370
- ┌───────────────┐
371
- PERCOLATOR
372
- ├───────────────┤
373
- Slab Parser
374
- │ Trade CPI │
375
- Keeper Crank
376
- Oracle Feed
377
- └───────────────┘
349
+ ┌──────────────────────────────────────────────────────────────────────────────┐
350
+ GATEWAY & USER INTERFACE
351
+ HTTP • WebSocket • Auth • Rate Limiting • 1000 connections
352
+ │ 21 Messaging Channels: WebChat, Telegram, Discord, Slack, Teams, Matrix... │
353
+ └──────────────────────────────────────────┬─────────────────────────────────────┘
354
+
355
+ ┌──────────────────────────────────────────┴─────────────────────────────────────┐
356
+ │ AI AGENTS LAYER (4) │
357
+ Main (Claude) • Trading (Exec) • Research (Data) • Alerts (Monitor)
358
+ 119+ Skills • 18 Tools • LanceDB Memory • Semantic Reasoning
359
+ └──────────────────────────────────────────┬─────────────────────────────────────┘
360
+
361
+ ┌──────────────────────────────────────────┴─────────────────────────────────────┐
362
+ UNIFIED STRATEGY & RISK LAYER
363
+ 118+ Strategies Risk Engine (VaR/CVaR/Circuit Breaker) • Kelly Sizing
364
+ Backtesting Trade Ledger • Position Manager • Arbitrage Detection
365
+ Whale Tracking Copy Trading • MEV Protection • Smart Routing
366
+ └──────────────────────────────────────────┬─────────────────────────────────────┘
367
+
368
+ ┌──────────────────────┬──────────────┼──────────────┬──────────────────────┐
369
+ ▼ ▼ ▼ ▼ ▼
370
+ ┌──────────────────┐ ┌──────────────┐ ┌──────────────┐ ┌─────────────┐ ┌──────────────┐
371
+ PREDICTION │ │ SOLANA DeFi │ │ EVM DeFi │ │ PERPETUAL │ │ ON-CHAIN │
372
+ │ MARKETS │ │ │ │ │ │ FUTURES │ │ PERPS
373
+ ├──────────────────┤ ├──────────────┤ ├──────────────┤ ├─────────────┤ ├──────────────┤
374
+ │ Polymarket: │ │ Jupiter │ │ Uniswap V3 │ │ Binance │ │ Percolator │
375
+ • 5-min BTC Raydium 1inch │ (125x) │ │ (Solana) │
376
+ • 1h/4h/daily │ Orca PancakeSwap Bybit │ │ │
377
+ │ (All assets) │ │ Meteora │ │ Virtuals │ │ (100x) │ │ Slab Parser │
378
+ Kalshi Kamino Clanker │ Hyperliquid │ │ Keeper Crank │
379
+ Betfair │ │ MarginFi │ Veil │ │ (50x) Oracle Feed
380
+ Smarkets │ Solend │ │ (ETH, ARB, │ │ MEXC (200x) │ │ │
381
+ Drift Pump.fun │ │ OP, Base, │ │ Drift Settlement
382
+ Opinion.xyz │Bags.fm Polygon) │ (Solana) │ │ Monitoring │
383
+ Predict.fun Percolator │ │ Liquidation │
384
+ │ Manifold │ │ Jito Bundles │ │ Flashbots │ │ Lighter │ │ Alerts │
385
+ Metaculus │ │ MEV Protect. │ │ MEV Protect. │ │ (ARB) │ │ │
386
+ │ PredictIt │ │ │ │ │ │ │ │ Up to 200x │
387
+ │ │ WebSocket & │ WebSocket & │ │ WebSocket & │ │ leverage │
388
+ │ CLOB Orders │ │ HTTP APIs │ │ HTTP APIs │ │ HTTP APIs │ │ │
389
+ Settlement │ │ │ │ │ │ │ │ Fully
390
+ Tracking │ Real-time │ Real-time │ │ Liquidation │ │ On-chain │
391
+ └──────────────────┘ Price Feeds │ Price Feeds │ │ Monitoring │ │ │
392
+ │ │ │ │ No KYC │
393
+ │ Gamma API │ │ Chainlink │ │ Chainlink │ │ Funding │ │ │
394
+ Poll for │ │ Feeds │ │ Feeds │ │ Rates │ └──────────────┘
395
+ │ rounds │ │ │ │ │ │ │
396
+ Execution │ │ Execution │ │ Execution │ │ Execution
397
+ └──────────┘ └──────────────┘ └──────────────┘ └─────────────┘
398
+
399
+ ┌────────────────┴────────────────┴────────────────┴──────────────┐
400
+ COMMON EXECUTION & DATA LAYER
401
+ Order Builder • Balance Checker • Slippage Estimator
402
+ │ Fee Calculator • Real-time P&L • Settlement Polling │
403
+ │ Bittensor Mining (TAO) • x402 Payments (USDC) │
404
+ │ Agent Forum • Agent Marketplace • Compute API │
405
+ └────────────────────────┬─────────────────────────────────────────┘
406
+
407
+
408
+ ┌───────────────────────────────────────────────────┐
409
+ │ DATA PERSISTENCE LAYER │
410
+ ├───────────────────────────────────────────────────┤
411
+ │ SQLite: Local configs, WebChat, earnings │
412
+ │ LanceDB: Semantic memory, embeddings, profiles │
413
+ │ PostgreSQL: Trade history, analytics, backtest │
414
+ │ Backup & Sync: 3x replication • Compression │
415
+ └───────────────────────────────────────────────────┘
378
416
  ```
379
417
 
380
418
  ---
@@ -388,6 +388,11 @@ function createGatewayServer(config) {
388
388
  * - Agent manager for non-command messages
389
389
  */
390
390
  async function createGateway(config) {
391
+ // Railway/Heroku inject PORT — override gateway port if set
392
+ const envPort = parseInt(process.env.PORT ?? '', 10);
393
+ if (envPort > 0 && envPort <= 65535) {
394
+ config = { ...config, gateway: { ...config.gateway, port: envPort } };
395
+ }
391
396
  let currentConfig = config;
392
397
  (0, http_1.configureHttpClient)(currentConfig.http);
393
398
  const configPath = process.env.CLODDS_CONFIG_PATH || config_1.CONFIG_FILE;
@@ -507,6 +512,19 @@ async function createGateway(config) {
507
512
  const { createAuditRouter } = await Promise.resolve().then(() => __importStar(require('./audit-routes.js')));
508
513
  httpGateway.setAuditRouter(createAuditRouter());
509
514
  }
515
+ // Wire Launch API router (Solana token launches via Meteora DBC)
516
+ {
517
+ const { createLaunchRouter } = await Promise.resolve().then(() => __importStar(require('./launch-routes.js')));
518
+ const { getSolanaConnection, loadSolanaKeypair } = await Promise.resolve().then(() => __importStar(require('../solana/wallet.js')));
519
+ try {
520
+ const launchConnection = getSolanaConnection();
521
+ const launchKeypair = loadSolanaKeypair();
522
+ httpGateway.setLaunchRouter(createLaunchRouter(launchConnection, launchKeypair));
523
+ }
524
+ catch (err) {
525
+ logger_1.logger.warn({ err }, 'Launch API: Solana wallet not configured — launch endpoints disabled');
526
+ }
527
+ }
510
528
  // DCA router is wired later (after executionService is created) so it can start the engine
511
529
  // Create alt-data sentiment pipeline if enabled
512
530
  let altDataService = null;