Skip to content

Instantly share code, notes, and snippets.

@al-maisan
Last active December 25, 2025 08:19
Show Gist options
  • Select an option

  • Save al-maisan/78cb98989c6b0816842a6dfb231ee267 to your computer and use it in GitHub Desktop.

Select an option

Save al-maisan/78cb98989c6b0816842a6dfb231ee267 to your computer and use it in GitHub Desktop.
shodown estimates

Assumptions: DAU (Daily Active Users) = 20% and WebSockets

Based on the design overview, the backend scope is basically:

  • onboarding/linking: masterAddress, subAccountAddress, tradingWalletAddress, startEquity
  • order relay: verify signature.vaultAddress + signer, apply competition/risk rules, forward to Hyperliquid
  • state + leaderboard: ingest Hyperliquid subaccount state (poll or stream), compute PnL/PnL%/volume, persist + serve leaderboard

1) Effort estimate (build + AWS deploy w/ Terraform)

MVP (competition usable, safe-ish, but not "enterprise hardened")

~8-12 person-weeks (40-60 person-days)

Main work:

  • REST + WS gateway (auth, sessions, websocket fanout)
  • account linking + startEquity snapshot
  • signed-order relay verification + rule engine v1
  • ingestion worker(s) + leaderboard calc/store
  • AWS Terraform: VPC, ECS/Fargate, ALB (WebSockets), RDS, Redis, secrets, CI/CD, logs/alerts

Production-grade (abuse-resistant + ops-ready)

~14-22 person-weeks (70-110 person-days)

Adds:

  • stronger abuse controls (rate limits, quotas, replay/nonce policy, edge cases)
  • correctness/reconciliation jobs + idempotency
  • multi-AZ posture, backups/restore drills, dashboards/SLOs, on-call readiness
  • WS scaling concerns (backpressure, per-user throttles, drop policies)

2) AWS monthly operating cost for N 10,000 users (N < 9), DAU=20%, WebSockets

Assumptions (so the numbers are meaningful)

Per 10k registered (so multiply by N):

  • DAU = 2,000
  • Avg "connected session time" 30 min/day per DAU user
  • Avg WS payload from backend ~1 KB/s per connected user (account/positions/orders/leaderboard deltas; not full market data)
  • WebSockets served via ALB ECS/Fargate (avoids per-message fees that API Gateway WS has)

Typical components:

  • ECS/Fargate for API + workers
  • ALB for HTTP+WS
  • RDS Postgres (example: db.t4g.medium ballpark)
  • Redis (example: cache.t4g.small/medium ballpark)
  • CloudWatch logs
  • Data Transfer Out ~$0.09/GB after free tier

Sensitivity: if your WS payload is 10 KB/s instead of 1 KB/s, your egress and ALB LCUs rise ~10. (That's the biggest cost swing with WebSockets.)


Estimated monthly cost (USD) by N

Two tiers:

  • Lean: single-AZ-ish DB/cache, minimal NAT (or public subnets + endpoints)
  • Prod HA: multi-AZ RDS, Redis replica, and 2 NAT gateways (common "boring but safe" default)
N (10k users) Lean ($/mo) Prod HA ($/mo)
1 (10k) ~$214 ~$366
2 (20k) ~$232 ~$387
3 (30k) ~$279 ~$436
4 (40k) ~$350 ~$534
5 (50k) ~$369 ~$554
6 (60k) ~$416 ~$603
7 (70k) ~$463 ~$653
8 (80k) ~$481 ~$673

What's driving cost here:

  • Fargate always-on API + worker footprint
  • ALB hourly + LCU (active connections + bytes/hour)
  • RDS + Redis baseline
  • NAT (if you go private subnets) can be a chunky fixed line item
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment