Skip to content

Repository files navigation

ADAplug

An all-in-one Cardano analytics & portfolio terminal — built on a data spine you own, not a data bill that scales with your users.

ADAplug is a self-hostable platform for the Cardano ecosystem: live token prices and charts, DEX analytics, NFT analytics, multi-wallet portfolio tracking, a wallet profiler, watchlists, price alerts, and a first-class public REST API — all derived from on-chain data read directly off a Cardano node, with third-party APIs as optional, flag-gated, spend-capped fallbacks.

Independent, clean-room project. Not affiliated with any prior platform. Nothing here is financial advice.


Why this exists

In mid-2026 the dominant Cardano analytics platform (TapTools) wound down within ~two weeks of announcing it. It didn't die from lack of demand — it served ~1M users and powered backend data for hundreds of Cardano token protocols. It died from leadership collapse plus operating costs that scaled linearly with users in a bear market.

That left two gaps:

  1. Orphaned demand. Power traders lost their portfolio/P&L surface; hundreds of protocols lost the data/API feed they were built on, overnight.
  2. A hard lesson. A million-user platform still couldn't cover its costs.

ADAplug is designed around that lesson. The core architectural decision is owning the data spine so the marginal data cost per user trends toward zero — which makes the platform self-sustaining at a small subscriber count instead of needing a million users to survive.


The core idea: own your data, don't rent it

Most analytics platforms lean on per-request third-party APIs (Blockfrost/Maestro paid tiers). Those bills scale linearly with traffic. ADAplug inverts that:

  • Primary source = a Cardano node + chain-followers you run. Prices, liquidity, holders, and token metadata are read from the chain itself. Fixed cost, unlimited internal queries.
  • Third-party APIs are optional accelerants — behind feature flags and a hard monthly spend cap that disables paid providers when exceeded, so a traffic spike can never produce a runaway vendor bill.

The provider layer (ProviderRouter) is env-driven: self-hosted first, free public fallbacks next, paid providers last (flag-gated + capped), with automatic failover.

How live DEX pricing actually works

This is the technically interesting part, and it runs with zero vendor cost:

Cardano node (relay/follower)
        │  node-to-client socket (read-only)
        ▼
      Kupo  ──── indexes ONLY the DEX pool script addresses (not the whole chain)
        │        /matches/{poolAddress}?unspent  → live pool UTxOs + inline datums
        ▼
ADAplug dex-indexer
   1. decode each pool's inline datum (a self-contained CBOR→Plutus decoder, no deps)
   2. read reserves:
        • Minswap V2  → reserve_a / reserve_b from the datum
        • SundaeSwap V3 → from the UTxO value, ADA = lovelace − protocol_fees
   3. price every ADA-paired token = (adaReserve/1e6) ÷ (tokenReserve/10^decimals)
   4. derive ADA/USD from the stablecoin pools themselves (1 stable ≈ $1 → ADA/USD = 1/price)
        ▼
   Timescale (ticks → 1m candles → continuous aggregates → 1h/1d)
        ▼
   REST API  →  Web terminal

Because Kupo matches only the pool addresses, the index is tiny and fast — the platform prices the whole ecosystem's liquid tokens in a few seconds per cycle, entirely from the node.


What it does

Area Capability
Markets Trending tokens, gainers/losers, sortable top-tokens table (price ADA + USD, liquidity, holders), live ticker, ecosystem stats
Token detail TradingView candlestick charts (built from our own OHLCV), DEX selector, info panel (price, liquidity, FDV, pooled ADA, holders, age, supply), trades, top holders, liquidity/pools, borrowing
DEX analytics Per-DEX liquidity dominance across Minswap V2 / SundaeSwap V3 (extensible to more)
NFT analytics Marketplace overview + collection detail (structured; NFT indexer is on the roadmap)
Portfolio Track any address / stake key / $handle; holdings valued live in ADA + USD; net worth, positions, P&L
Wallet profiler Net worth, top positions, activity — Pro feature
Watchlists & alerts Per-user token/wallet watchlists; price-cross alert engine that fires on threshold crossings (in-app + email + Telegram)
Public API Key-authed, per-plan metered REST API over the same data spine — the wedge for re-onboarding protocols stranded by the TapTools shutdown
Auth CIP-30 wallet connect + CIP-8 signed-nonce login bound to your stake key. No passwords, no custody
Billing Stripe-hosted Checkout/Billing/webhooks; optional ADA/stablecoin annual prepay verified on-chain

Architecture

A pnpm + Turborepo monorepo.

apps/
  web           Next.js 15 (App Router) frontend — the terminal
  api           Fastify REST API + websockets, OpenAPI 3.1
  ingestor      BullMQ workers: bulk price refresh, backfills, alert evaluation
  dex-indexer   derives prices/liquidity from on-chain DEX pools

packages/
  core          shared types, money (lovelace as bigint), tiers, error envelope, typed API client
  db            Drizzle schema + Timescale migrations
  providers     provider interfaces + ProviderRouter + spend cap + Koios/Blockfrost/Kupo adapters + DEX math
  billing       Stripe helpers + webhook → tier mapping
  ui            design tokens + shared helpers

infra/          chain-follower config + node/Kupo request docs

Data flow

Cardano node (external, already synced)
   ├── Koios (self-hosted REST)  → token info, holders, wallet portfolios, tip/health
   └── Kupo (pool-address index) → live DEX pool reserves → prices

   ↓ providers (self-hosted first; paid fallbacks flag-gated + spend-capped)

ingestor  → writes ticks + 1m candles + per-DEX liquidity + ADA/USD → Timescale
dex-indexer → decodes pool datums → reserves → prices
api       → serves it all, key-metered, OpenAPI 3.1
web       → server-rendered terminal (BFF pattern; keys stay server-side)

Tech stack

  • Frontend: Next.js 15 (App Router, RSC), TypeScript (strict), Tailwind, TradingView Lightweight Charts, TanStack Query, Zustand
  • Backend API: Fastify 5, zod, OpenAPI 3.1 (Scalar), @fastify/websocket
  • Data: Cardano node + Koios + Kupo (chain-followers) → PostgreSQL 16 + TimescaleDB for time-series; Redis for cache, rate limits, metering
  • Jobs: BullMQ workers
  • Auth: CIP-30 (MeshJS/Lucid-style) + CIP-8 signed-nonce (verified server-side with @cardano-foundation/cardano-verify-datasignature), JWT sessions via jose
  • Billing: Stripe (hosted Checkout/Portal/webhooks) — card data never touches our servers
  • Monorepo: pnpm + Turborepo; Docker Compose for the datastores + optional app/spine profiles

Engineering conventions worth calling out: lovelace is bigint end-to-end (never floats); every external fetch has timeout + retry/backoff + circuit-breaker and counts against the spend cap; token/NFT metadata is treated as hostile and sanitized; the CBOR→Plutus datum decoder is dependency-free.


Public API

/api/v1, key-authed (x-api-key) or consumer session (Authorization: Bearer), Redis-metered per plan (over-quota → 429 with X-RateLimit-* + Retry-After), documented with OpenAPI 3.1 (served via Scalar at /api-docs). A typed TypeScript client ships in @adaplug/core.

Groups: token/ (price, ohlcv, info, holders, top) · market/ (stats, dex) · wallet/ (resolve, portfolio, profiler) · onchain/ (asset facts) · watchlist/ · alerts/ · auth/.

curl -H "x-api-key: YOUR_KEY" \
  "https://api.example/api/v1/token/price?unit=<policyId+hexName>"

Pricing model (self-funding by design)

Because data cost is fixed, not per-user, the platform breaks even at a low subscriber count:

  • Free — funnel/SEO: delayed data, 1 tracked wallet, basic charts, limited alerts.
  • Pro — $10/mo (or $100/yr) — everything: real-time data, unlimited wallets, full P&L, wallet profiler, heatmaps, unlimited watchlists/alerts, CSV export.
  • Developer/API plans — Free dev / Builder ($29) / Business ($149) / Enterprise — the higher-margin line that re-onboards stranded protocols.

An internal /admin/economics dashboard answers "does it pay for itself?" live: MRR, active subs, editable infra cost, break-even count, and paid-provider spend vs cap.


Status

The data spine is live and proven end-to-end. Against a real Cardano node, the pipeline prices ~140 ADA-paired tokens per cycle in a few seconds (Minswap V2 + SundaeSwap V3), writes ticks/candles/ADA-USD/DEX-liquidity to Timescale, and serves them through the API into the web terminal.

  • ✅ Data spine (node → Koios + Kupo → prices), self-hosted, zero vendor cost
  • ✅ Public API: key auth, Redis metering, OpenAPI 3.1, typed client
  • ✅ Stripe billing + server-side tier gating + /admin/economics
  • ✅ Alert engine (price-cross firing), watchlists, per-user CRUD
  • ✅ Web terminal: markets, token detail (charts), portfolio (live valuation), DEX, wallet profiler, pricing, API docs, account
  • ✅ CIP-30/CIP-8 wallet login
  • 🔜 NFT + news indexers; % change columns / sparklines / live trades (accrue as history builds); watchlist/alert management UI; hosted deployment

Quick start (local)

Requires Node 20+, pnpm 10+, Docker.

cp .env.example .env        # fill in secrets; point KOIOS_URL / KUPO_URL at your node
pnpm install
docker compose up -d        # Postgres + TimescaleDB + Redis (default profile)
pnpm db:migrate             # schema + Timescale hypertables + continuous aggregates
pnpm build
bash scripts/dev-local.sh   # runs api + ingestor + web  → http://localhost:3010

Without a node URL configured, the app still runs — it just shows empty states instead of live data. Point KOIOS_URL at a (self-hosted or public) Koios endpoint and KUPO_URL at a Kupo instance matching the DEX pool addresses (see infra/KUPO_REQUEST.md) to light up live prices.

Compose profiles

Command Brings up
docker compose up default — Timescale + Redis
docker compose --profile spine up + db-sync / Ogmios / Kupo (attach to your node)
docker compose --profile app up + api / ingestor / dex-indexer / web containers

Compose never boots a cardano-node — it attaches to an existing node over its socket. See infra/CROW_NODE_REQUEST.md and infra/KUPO_REQUEST.md for the node-admin hand-off.


Repository layout of note

  • packages/providers/src/dex/ — the verified DEX math: Minswap V2 + SundaeSwap V3 pool-datum parsers, the CBOR→Plutus decoder, and the Kupo bulk price service.
  • apps/ingestor/src/kupo-refresh.ts — the bulk pricing loop (prices every pooled token per cycle, derives ADA/USD, snapshots per-DEX liquidity).
  • apps/api/src/routes/ — the public API surface.
  • infra/ — how to stand up the chain-followers against a node.

License

© 2026 Jason Appleton. All rights reserved. This repository is source-available for transparency and reference — it is not open source and is not licensed for redistribution, hosting, or commercial use. If you'd like to use or build on it, get in touch.


ADAplug is an independent Cardano analytics tool. It does not provide financial advice. On-chain data is derived from a Cardano node and open/first-party sources under their respective terms.

About

All-in-one Cardano analytics & portfolio terminal built on a self-hosted data spine (node → Kupo/Koios → live DEX prices). Token charts, DEX/NFT analytics, portfolios, alerts, and a public API.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages