6 Commits
Author SHA1 Message Date
alsk1992 ee7df0c10b fix: Lighter trading was calling nonexistent bearer-token REST endpoints
placeOrder/cancelOrder/cancelAllOrders/getBalance/getPositions/getOpenOrders
all called a plain X-API-Key REST API that doesn't match how Lighter (a
zk-rollup) actually works: every order/cancel is an L2 transaction, signed
by a native binary the official SDK loads via ctypes (compiled from
github.com/elliottech/lighter-go) — there's no published algorithm spec to
reimplement in TypeScript, and Lighter's own official AI-agent integration
(elliottech/lighter-agent-kit) works the same way: Python calling the real
SDK, not a from-scratch reimplementation in the host language.

New scripts/lighter-bridge/bridge.py wraps the official lighter-sdk (pinned
to a specific commit, matching elliottech/lighter-agent-kit's own lockfile),
invoked as a subprocess from src/exchanges/lighter/index.ts — one JSON
request in on stdin, one JSON result out on stdout, mirroring the existing
Rust fast-broadcast subprocess pattern (src/evm/fast-broadcast.ts) so both
"shell out to a real, verified implementation" paths in this codebase look
and behave the same way. Lazily pip-installs into a local .vendor/ dir on
first use, so nothing needs a pre-existing venv.

Verified live against mainnet: the bridge reaches Lighter's real API,
correctly loads the native signer, and gets back a genuine server response
("invalid account index" for a made-up test account) — proving the full
chain (bootstrap -> native signer load -> key validation -> live network
call) works end to end.

Also rewrote LighterOrder/LighterPosition/LighterBalance to match the real
API response shapes (verified against elliottech/lighter-agent-kit's
schemas-read.md) instead of the old guessed shape, and fixed several stale
"Lighter orderbook DEX on Arbitrum" doc/description strings — Lighter is its
own standalone zk-rollup, unrelated to Arbitrum.
2026-08-30 23:17:18 +01:00
alsk1992 1e18a7b370 feat: Rust hot-path broadcast racer, multi-RPC fallback + sequencer racing
- New Rust binary (rust/fast-broadcast) races eth_sendRawTransaction across
  multiple RPC/sequencer endpoints via a TS wrapper (src/evm/fast-broadcast.ts);
  proven byte-identical to ethers' native signing path.
- multichain.ts: adds rpcFallbacks/getRaceUrls per chain, plus official
  write-only sequencer endpoints for Arbitrum and Base (Optimism's public
  sequencer is excluded per its own docs — rate-limited, not for default use).
- odos.ts: races broadcast across configured endpoints when more than one is
  set; bumps the retired /sor/quote/v2 endpoint to /sor/quote/v3 and adds the
  pathViz request flag (route was previously always empty) and mandatory
  pre-broadcast simulation (Odos's own hard rule — refuse to broadcast a
  transaction their simulator predicts will revert).
- postinstall self-heals two real environment bugs: bigint-buffer's native
  binary SIGILLs on this platform, and @coral-xyz/anchor's CJS build exposes
  BN via a getter that breaks native ESM named-export synthesis for
  dependents like @meteora-ag/dlmm.
- tsconfig: incremental builds (measured ~22% faster warm typecheck).
2026-08-30 22:00:56 +01:00
alsk1992andClaude Opus 4.5 bd48a192ec Clean repo for production release
- Remove apps/ (docs website → separate repo)
- Remove trading/ (Python reference scripts)
- Remove ui/, vendor/, workspace/ (dev placeholders)
- Remove assets/, demo.gif, demo.tape (use hosted images)
- Remove internal planning docs (PLAN.md, TODO.md, etc.)
- Update .gitignore to exclude dev files
- Update README to use cloddsbot.com hosted images
- Update all URLs from clodds.vercel.app → cloddsbot.com
- Fix Polymarket fee claims (0% on most markets)
- Fix order types (postOnly boolean, not POST_ONLY)
- Add startup validation for ANTHROPIC_API_KEY
- Add fee-adjusted arbitrage calculations

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 20:27:58 +00:00
alsk1992andClaude Opus 4.5 978c92a405 Fix TypeScript errors and add unit tests
## Fixes
- Remove duplicate exports in execution/index.ts
- Add 'protected' order type to trading logger
- Forward protectedBuy/protectedSell in trading wrapper

## Tests
- Add trading-safety.test.ts with tests for:
  - Kelly criterion calculations
  - Circuit breaker logic
  - Rate limiter
  - Semantic match verification
  - Portfolio correlation

All 34 tests pass.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 15:59:53 +00:00
alsk1992andClaude Opus 4.5 d845e7bb35 Add real screenshots and demo GIF for README
- Create Puppeteer script to capture professional screenshots
- Add demo.gif (slideshow of all interfaces)
- Add telegram.png, webchat.png, arbitrage.png, portfolio.png
- Fix combinatorial.ts imports for Database and FeedManager
- Add puppeteer dev dependency for screenshot generation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 15:58:31 +00:00
alsk1992andClaude Opus 4.5 ab2c057853 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>
2026-01-29 14:26:26 +00:00