Skip to main content
At its core, Hoox functions as a highly resilient, low-latency pipeline that intercepts trading signals from external sources, validates and decodes the payloads, and converts them into cryptographically signed order placements on global exchanges in milliseconds. Here is the exact lifecycle of an edge trade execution, from alert trigger to brokerage fill.

🗺️ The Execution Pipeline


🔍 Detailed Pipeline Phase Analysis

1. Signal Arrival & Ingestion

Signals represent specific instructions to buy, sell, or close positions. Hoox ingests these instructions through three primary channels:
  • TradingView Webhooks: High-integrity trade alerts configured via Pine Script that issue JSON POST payloads to your gateway’s public /webhook route.
  • Telegram Commands: Direct user commands sent to your private Telegram Bot (e.g. /trade buy btc quantity=0.01 exchange=bybit), parsed via your webhook router.
  • Email Signals: Secure email triggers forwarded from specialized alerts (e.g. TradingView email alerts), parsed natively by email-worker.

2. Edge Firewall & Gateway Validation

When a signal hits your public endpoint, the hoox gateway interceptor immediately evaluates the request inside a sandboxed V8 isolate:
  1. API Key Authorization: Authenticates the payload’s apiKey property against your secure manifest stored in Cloudflare KV.
  2. IP Allow-listing: Verifies that the client IP matches a authorized IP range in KV (essential for restricting access solely to TradingView’s known webhook IPs).
  3. Global Kill Switch check: Ensures trade:kill_switch is false. If true, the pipeline aborts immediately to protect your capital.
  4. Rate Limiting: Verifies that signal frequency does not exceed safe execution thresholds (default: 10 orders/minute).
  5. Idempotency Check: Locks a unique transaction trace ID using a SQLite-backed Durable Object. If the DO detects that the exact same signal hash was already processed, it drops the request to prevent double-ordering.

3. Service Binding Order Routing

Once validated, the gateway bypasses public internet routing and calls the internal trade-worker directly via Service Bindings:
  • Low Latency: Communication occurs within a microsecond inside the V8 engine, with zero TCP handshakes or TLS decryption overhead.
  • Private Isolation: The trade-worker does not expose any public URL, remaining completely isolated from external attacks.
  • Dynamic Exchange Routing: The worker parses the symbol (e.g. BTCUSDT) and evaluates your KV config. If Bybit is undergoing maintenance, you can instantly redirect trades to MEXC or Binance with one command.

4. Exchange Execution & Cryptographic Signing

The trade-worker loads your encrypted API credentials from Cloudflare Secrets, computes the HMAC-SHA256 signature for the order parameters, and pushes the signed request to the exchange’s nearest API gateway:
  • Smart Placement: Because Smart Placement is enabled, Cloudflare automatically runs your worker on the physical edge node located geographically closest to the exchange’s servers (e.g. Frankfurt for Bybit, Tokyo for Binance), cutting network transit time by up to 60%.

5. Persistent D1 Logging & Telemetry

Upon receipt of the order response (e.g. Filled, Partial, or Rejected), Hoox updates your ledger:
  • D1 SQLite Database: Writes transaction logs, filled prices, execution fees, and order IDs to your D1 database.
  • R2 Log Offloading: Offloads full JSON request-response packets to your secure R2 storage bucket to keep D1 database footprints compact.

6. User Notifications & Alerts

Finally, the trade-worker pings telegram-worker via an internal binding:
  • You receive an immediate Telegram notification on your phone detailing the symbol, filled price, order status, and transaction ID.
  • Twice-daily, report-worker uses Browser Rendering to compile beautiful HTML reports of your trading metrics, generating PDFs and dropping the link directly in your chat.

If the exchange API experiences transient network dropouts or severe rate limits, the Hoox Gateway automatically transfers the payload to Cloudflare Queues with an exponential retry schedule (30s1m5m15m), keeping your strategy fully reliable even during periods of heavy market volatility.

🔗 Next Steps

Last modified on July 16, 2026