ARCH / System Topology

[EDGE MESH]

Ten specialized Cloudflare® Workers and two storage surfaces, private Service Bindings, and a single public waist. Hover a node for bindings. Click for detail.

10
Workers
21
Service Bindings
2
Public Surfaces
<1ms
Hot-path hops
01 / Interactive topology
CORE
AI
INFRA
STORE
Operational
pubPublic surface
21 directed bindings
02 / Design principles

Constraints that keep the mesh small, fast, and hard to misuse — the same rules that shape ingress, execution, and storage.

01

Narrow waist

Untrusted input enters through one gateway. Internal workers never parse raw webhooks — only attested HooxSignal intents.

02

Private by default

Service Bindings keep the mesh off the public internet. No TLS hop, no DNS, no accidental exposure of execution paths.

03

Idempotent execution

Durable Objects lock every signal key before exchange calls. TradingView® retries become no-ops, not double fills.

04

Edge-native storage

D1, KV, R2, Vectorize, and Analytics Engine sit next to compute. Logs and state travel with the isolate, not a central region.

03 / Worker catalog
04 / SERVICE BINDINGS

[SERVICE BINDINGS]

Direct V8-to-V8 calls — no public endpoints, no TLS hop between workers. The runtime spawns the target isolate and passes memory pointers; microservice hops complete in under a microsecond.

<1µs

Binding latency

V8-to-V8 invoke — same thread, no network stack

Gateway + Dashboard

Public routes

Everything else is isolate-private

INTERNAL_KEY

Internal auth

Shared bearer on every service-to-service hop

05 / FIVE-LAYER SECURITY

[FIVE-LAYER SECURITY]

Concentric corridors from the Cloudflare® edge to the Durable Object mutex. Every layer can independently reject a signal.

  1. 01

    WAF & edge firewall

    Cloudflare® WAF drops non-TradingView® IP ranges and rate-limit breaches before application code runs.

  2. 02

    Webhook passkey

    Gateway matches apiKey / HMAC against CONFIG_KV secrets. Mismatch → 401, no downstream fan-out.

  3. 03

    Service Binding isolation

    Internal workers expose zero public HTTP. Reachable only as V8 Fetcher targets from other isolates.

  4. 04

    Internal bearer auth

    requireInternalAuth on every binding hop. Same INTERNAL_KEY secret family across the mesh.

  5. 05

    Durable Object mutex

    IdempotencyStore locks the signal key before exchange APIs. Retries return success without re-ordering.

WAF → passkey → Service Bindings → INTERNAL_KEY → Durable Object lock. See Ingress for the gateway path in detail.

06 / SIGNAL FLOW

[SIGNAL FLOW]

A TradingView® webhook signal traverses the mesh in under 50ms on the happy path — validate, execute, persist, notify.

01InternetTradingView® / Email / Bot
02hooxValidate · Normalize · Lock
03trade-workerSize · Route · Fill
04ExchangeMEXC · Binance · Bybit
05d1-workerPersist · Audit
06telegram-workerConfirm · Alert
07 / DURABLE OBJECTS — IDEMPOTENCY

[DURABLE OBJECTS — IDEMPOTENCY]

Every trade signal carries a unique idempotency key. Before executing, trade-worker (via the gateway handshake) checks the IdempotencyStore Durable Object. If the key exists, the order already ran — the duplicate is dropped. TradingView® webhook retries cannot double-fill.

Without idempotency store
×Webhook retry → Duplicate order
×Webhook retry → Duplicate order
×Same signal executed 3× on the exchange
With IdempotencyStore
First execution → Order placed
·Webhook retry → Key exists → Dropped
·Webhook retry → Key exists → Dropped
08 / RAG TELEGRAM BOT

[RAG TELEGRAM BOT]

telegram-worker embeds a retrieval-augmented assistant on Cloudflare® Vectorize — docs and trade history as the corpus, three commands as the surface.

/search

Semantic search over docs via Vectorize

/ask

LLM answer with source citations

/latest

Recent market intelligence digest

09 / PDF REPORT GENERATION

[PDF REPORT GENERATION]

report-worker runs on a configurable cron (default 06:00 & 18:00 UTC), aggregates performance from D1 / Analytics Engine, renders A4 PDFs with Cloudflare® Browser Rendering, stores them in R2, and notifies operators.

01Cron Trigger
02D1 / Analytics query
03Browser Rendering
04PDF → R2
05Telegram / Email
10 / SELF-HOSTED RUNTIME

[SELF-HOSTED RUNTIME]

Prefer bare metal over Cloudflare®? HOOX ships a Bun-based self-hosted runtime. A single server entrypoint mirrors worker endpoints and runs on any VPS — same CLI, same signal contract, different substrate.

server.jsBun runtime
// server.js — Self-hosted HOOX runtime (Bun)
import { serve } from "bun"
import { trade, risk, notify } from "./lib"

serve({
  port: 3000,
  async fetch(req) {
    const signal = await req.json()
    const order = await trade.execute(signal)
    await risk.assess(order)
    await notify.telegram(order)
    return Response.json({ status: "executed", order })
  },
})

console.log("HOOX self-hosted → :3000")
Workers10
Storage surfaces2
Public endpoints2
CLI tests381+