This guide gets you from a blank console to a fully active, edge-deployed algorithmic trading ecosystem on the Cloudflare network, processing simulated signals in under 5 minutes.
v0.8.0: The recommended entry point is now hoox onboard (one-shot bootstrap) instead of running hoox init and hoox setup separately.
🏁 Step-by-Step Deployment Path
Step 1: Onboard Your Workspace
Run the one-shot bootstrap to collect your Cloudflare credentials, write wrangler.jsonc, and provision all infrastructure end-to-end:
Interactive prompts will ask for your Cloudflare Account ID, API Token, and your unique SUBDOMAIN_PREFIX (e.g., alpha-trading). For non-interactive use, pass --token and --account flags.
If you want fine-grained control over each step, run them separately:
Step 2: Inject Encrypted Exchange API Keys
For your safety, exchange credentials (API keys and private signatures) are never stored in plain text. Inject them as encrypted Cloudflare Workers Secrets bound securely to your compute instances:
Cloudflare Secrets are encrypted at rest using hardware-level keys and are
injected straight into your V8 execution isolates at runtime. They can never
be decrypted or read back via the API, ensuring top-tier security for your
capital.
Step 3: Deploy All Workers in Sequence
Hoox microservices communicate internally via Service Bindings. The CLI automatically manages the deployment sequence, ensuring databases, queues, and configuration stores compile first, followed by gateway routers and background compute tasks:
This command automatically provisions:
- D1 Edge Database (
hoox-db) - CONFIG_KV configuration namespace
- Internal Workers (
trade-worker,
d1-worker, telegram-worker) - Public Gateway (
hoox gateway router) - Next.js Dashboard Command Center (
workers/dashboard)
Once completed, the CLI will output your public Gateway endpoint URL: https://hoox.alpha-trading.workers.dev
Step 4: Verify the Deployment
Run the health check to confirm everything is online:
You should see all enabled workers reporting healthy status. To fix any issues automatically:
Step 5: Fire a Simulated Trade Webhook
Now, fire a test webhook trade signal to your live gateway using curl.
Step 6 (Optional): Measure Fast-Path Latency
Once live, you can probe the deployed system to measure end-to-end latency:
This reports per-hop latency for hoox, trade-worker, and analytics-worker so you can identify bottlenecks.
📥 Webhook Payload Parameters Spec
Every webhook payload fired to your Gateway must match the following JSON Schema:
📤 Expected Success Response
When a signal arrives, the Hoox Gateway authorizes the request, locks execution via Durable Objects, routes order calculations to the edge node nearest to Bybit’s servers, executes the order, and registers the transaction in your D1 SQLite table.
You will receive an instantaneous, low-latency JSON response:
If the exchange is temporarily undergoing system maintenance or experiences
high network congestion, Hoox will automatically intercept the failure,
enqueue the trade in Cloudflare Queues with exponential backoff retry
policies, and return a "status": "Enqueued" response to guarantee delivery!
🔗 Next Steps