Tier model
Summary
Section titled “Summary”The same set of binaries (api, worker, data-provider,
frontend-app) runs three ways. You decide by setting two
environment variables — there are no per-tier feature flags and no
per-tier code paths.
The full design rationale is in Why the three-tier deployment model.
Choosing your tier
Section titled “Choosing your tier”Tier 2 is not a way to skip managing provider API keys.
COINGECKO_API_KEY, FINNHUB_API_KEY, ETHERSCAN_API_KEY,
HELIUS_API_KEY and OPENAI_API_KEY are read by your api and worker
on every tier — see
What changes.
The two env vars
Section titled “The two env vars”# Tier 1 — defaults from .env.exampleSCANI_CLOUD_URL=http://localhost:8082SCANI_CLOUD_API_KEY=dev_data_provider_key_change_me_not_prod_safeDATA_PROVIDER_API_KEY=dev_data_provider_key_change_me_not_prod_safe
# Tier 2 — point api + worker at a hosted endpointSCANI_CLOUD_URL=https://data-provider.your-host.example.comSCANI_CLOUD_API_KEY=<issued by the operator># DATA_PROVIDER_API_KEY is not used on the user side in Tier 2 — it# lives on the hosted data-provider.The data-provider validates incoming bearers against its own
DATA_PROVIDER_API_KEY. In Tier 1, single-tenant mode, it’s the
same string as SCANI_CLOUD_API_KEY. In Tier 2+, the hosted
data-provider mints per-user / per-deployment keys via its
cloud-management surface (gated behind CLOUD_MANAGEMENT_ENABLED=true).
A minted key reaches pricing, AI, chain reads, OG metadata and token
search. It does not reach object storage or email: those are internal
facades over the operator’s own bucket and mail account, and a minted key
gets 403 FORBIDDEN (SC-585). See
Tier 2 wiring for the two ways to handle
that — the row above claiming Tier 2 means not running an S3 bucket holds
only where the operator has granted your key.
What does NOT change between tiers
Section titled “What does NOT change between tiers”- User integration credentials (exchange API keys, brokerage
tokens) always live on your
api. Tier-2 operators do not see them. - The schema. Same Postgres tables, same indexes, same
migrations. Applied explicitly by you on every Tier 1 deploy
(Apply migrations);
the same
scani/migrateimage works against a managed Postgres too. - The wire contract. tRPC routes, payload shapes, return types are identical across tiers.
- The product behaviour. No feature is gated by tier.
What changes
Section titled “What changes”Where to go next
Section titled “Where to go next”- Tier 1 — Local dev stack — the one-command path.
- Tier 1 — Production with docker-compose — the production-shaped compose file.
- Tier 1 — Required environment variables — the must-set list.
- Tier 2 — Overview — what a hosted data-provider does and does not take off your hands.
- Tier 3 — Fully managed — the pointer page.