Edge-Native Trading
Ten specialized V8 isolates deployed across Cloudflare's 330+ points of presence. Smart Placement collocates workers with the nearest exchange PoP, yielding 30–60% reduction in geographic round-trip time at zero marginal cost.
- ~22 ms median signal-to-ack
- 330+ points of presence
- 10 cooperating isolates
- Smart Placement optimization
Microsecond Inter-Worker Calls
Workers call each other via Cloudflare Service Bindings — direct V8 isolate invocations with no public internet routing, no TLS handshakes, and no DNS resolution. Internal calls complete in under 1ms.
- <1ms internal latency
- No TLS overhead
- No DNS resolution
- Zero public endpoints
AI Risk Manager
The agent-worker executes on a fixed 5-minute cron. It maintains portfolio state, applies trailing-stop logic, enforces drawdown limits via the Global Kill Switch, and invokes a multi-provider LLM gateway (5 endpoints) with automatic failover and Vectorize-backed retrieval over historical trades.
- 5-minute cron execution
- 5-provider LLM gateway
- Autonomous risk controls
- Vectorize RAG (384-d)
Durable Object Dedup
Every trade signal is assigned a unique trace ID. The IdempotencyStore Durable Object — backed by SQLite with TTL-based cleanup — checks if that ID was already processed. Duplicate webhooks are silently dropped even across cold starts.
- SQLite-backed DO
- TTL auto-cleanup
- Trace IDs end-to-end
- Cold-start safe
Async Delivery & Retry
Cloudflare Queues provide guaranteed-delivery fallback when the fast-path Service Binding is unavailable. Failed messages retry with exponential backoff — 30 seconds to 15 minutes — ensuring no signal is lost during exchange downtime.
- Guaranteed delivery
- 30s → 15min backoff
- Exchange downtime safe
- Rate-limit resilient
KV-Backed Rate Limiter
A 10-trades-per-minute rate limiter persisted in CONFIG_KV, surviving worker cold starts. When KV is unreachable the limiter falls back to in-memory state without dropping requests. Prevents API bans from misconfigured strategies.
- 10 trades/min limit
- KV-persisted across restarts
- In-memory fallback
- API ban prevention
Zero Trust Architecture
trade-worker and d1-worker have zero public HTTP endpoints — accessible only via Service Bindings from the hoox gateway. API keys are injected directly into the V8 isolate at runtime, never stored in plaintext or logs.
- No public endpoints
- V8 isolate secrets
- WAF IP allowlist
- CSP + HSTS headers
Multi-Exchange Routing
Execute across Binance, Bybit, and MEXC through a unified ExchangeRouter abstraction. Routing is stored in CONFIG_KV — redirect any symbol to a different exchange instantly without code deployment or downtime.
- Binance · Bybit · MEXC
- KV-based live routing
- No redeploy required
- Typed IExchangeProvider
Zero Infrastructure Cost
Built entirely on Cloudflare's free tier: 100K Worker requests/day, 1GB D1 global SQLite, 1GB R2 object storage, 1M KV reads/day, 10 min/day Browser Rendering, and unlimited Analytics Engine writes. $0/month.
- $0/month possible
- 100K requests/day free
- 1GB D1 + 1GB R2 free
- Analytics Engine free
Telegram AI Copilot
The telegram-worker embeds a RAG-powered assistant backed by Cloudflare Vectorize (384-dimensional embeddings). /search queries documentation semantically, /ask provides answers with citations, /latest retrieves market intelligence summaries.
- /search semantic docs
- /ask with citations
- /latest intel
- 384-d Vectorize
Web3 Wallet Agent
Manage an ethers.js v6 wallet for on-chain operations directly from the edge. Execute DEX swaps, call smart contracts, and interact with DApps via Cloudflare Browser Rendering — all through the same Service Binding mesh as CEX trading.
- ethers.js v6 on-chain
- DEX swaps + contract calls
- Browser Rendering DApps
- Secrets Store keys
Real-Time Observability
Every API call, trade execution, and worker health event is tracked as a time-series event via Cloudflare Analytics Engine — free on all plans. R2 offloads verbose logs to preserve D1 write limits for critical financial data.
- Analytics Engine free
- Latency + error tracking
- R2 log offloading
- Dashboard-powered
Developer Experience
Bun monorepo with 28 CLI command groups and 100+ subcommands covering onboard, dev, deploy, infra, config, secrets, check, repair, test, db, monitor, trace, perf, waf, and more. Interactive TUI hot-reloads all 10 workers simultaneously. 58 CLI test files, 1,000+ assertions.
- 28 CLI command groups
- 100+ subcommands
- 58 CLI test files
- 1,000+ assertions