</>longpham.tech
All case studies
Crypto / Web3 AnalyticsConfidential

Crypto Analytics & Token Transparency Platform

Institutional-grade token rating and on-chain analytics aggregating 8+ market-data providers behind a dual-database Laravel core.

Client
Confidential · Crypto / Web3 SaaS
Role
{{TODO: e.g. Solution Architect / Lead Backend Engineer}}
Period
{{TODO: e.g. 2023–2024}}
Dual persistence: MongoDB (documents) + PostgreSQL (transactions)
8+ external data providers with per-provider rate-limit resilience
Modular Laravel core (32 modules) + OAuth2 public API
MFA-backed AWS access + automated PII sanitization pipeline

Summary

Overview

The platform rates, ranks and transparently tracks digital assets for institutional users. It ingests market and on-chain data from many providers, computes a schema-driven transparency score, and serves dashboards, alerts and PDF/Excel reports through a public and authenticated API.

The core challenge was reconciling heterogeneous, rate-limited data sources into a consistent rating while keeping transactional workloads (auth, exports, API audit logs) isolated from high-churn document data.

Context

The Problem

Crypto data is fragmented across dozens of providers, each with different schemas, freshness and rate limits. Institutions need a defensible, auditable transparency score — not just aggregated prices.

Constraints

  • Multi-provider ingestion without letting a slow/failing provider block the platform.
  • Strong separation between document-shaped token data and ACID transactional data.
  • Auditability: every rating must be reproducible and every external call accounted for.
  • Security posture fit for institutional customers (no static cloud keys, no raw PII in CI).

Scope

Requirements

Functional

  • Token rating + transparency scoring (schema + AI-assisted)
  • Multi-source market data aggregation (CoinGecko, CoinMarketCap, DeFiLlama, EVM scanners, BitQuery)
  • On-chain analytics: holder distribution, supply metrics, tx patterns
  • Watchlists, alerts and user preference management
  • PDF/Excel export of reports
  • Public + authenticated API (OAuth2 / Laravel Passport)
  • Telegram notifications and admin CRUD for tokens/companies

Non-functional

  • Provider isolation — a degraded source must not cascade
  • Reproducible ratings with full external-call audit trail
  • Tiered caching (Redis primary, file fallback) for cold-start resilience
  • MFA-enforced cloud access; PII-sanitized database snapshots
  • CI/CD quality gates: PHPStan L6, Composer audit (deny HIGH/CRITICAL), coverage
137 controllers across 32 domain modules8+ external data providers polled on schedulesRedis + file cache tiers; queue workers under SupervisorStaging + production environments on AWS EC2 behind Traefik/nginx

System Design

Architecture

100% · drag to pan · scroll to zoom
Rendering diagram…

External Data Module

Centralized, rate-limit-aware API clients for 8+ providers writing to an isolated dataset so a slow source never blocks the main workload.

Rating Engine

Schema-driven (SchemaProperty) weighted-criteria scoring with AI-assisted evaluation, producing reproducible transparency scores.

Dual Persistence

MongoDB for document-shaped token/blockchain data; PostgreSQL for auth, documents and external-call audit logs.

Async Workers

Redis/DB-backed queues under Supervisor handle ingestion, exports and notifications off the request path.

Caching Tiers

Redis primary with a file-cache fallback and cache pre-warming to survive Redis outages.

Stack

Technology Stack

Backend

PHP 8.2Laravel 11Passport (OAuth2)

Data

MongoDB 7.0PostgreSQL 16Redis 5

Frontend

Nuxt 3 (legacy)Nuxt 4 + Turborepo (nova)Vue 3PrimeVueChart.js

Infra / CI

Docker ComposeAWS EC2 + S3TraefikSupervisorGitHub Actions (OIDC)Sentry

Persistence

Data Model

  • Token (MongoDB): symbol, supply, price, blockchain data, schema properties, rating, transparency_progress
  • Rating (MongoDB): weighted criteria + AI evaluation results
  • User (PostgreSQL): auth, role, preferences, API logs
  • ExternalDataLog (PostgreSQL): per-provider call audit + rate-limit accounting
  • Document (PostgreSQL): generated PDFs/exports
  • Blockchain (MongoDB): chains, holders, transaction patterns

Reasoning

Key Decisions & Trade-offs

Dual database (MongoDB + PostgreSQL)

trade-off

No cross-store joins, but clean isolation of high-churn document data from ACID transactional/audit data.

Isolated external-data store + centralized clients

trade-off

Extra sync complexity, but a failing provider can't degrade core reads and rate limits are managed in one place.

Legacy Nuxt 3 + Nova Nuxt 4 monorepo running in parallel

trade-off

Temporary feature-parity cost, but enables strict-TS migration and gradual cutover without a big-bang rewrite.

MFA-backed AWS access via aws-vault; sanitized DB snapshots

trade-off

More operational friction, but no static cloud keys and no raw PII ever reaching CI.

Operations

Scaling & Reliability

Horizontal: stateless Laravel containers behind the gateway; MongoDB replica set (rs0) and Redis for shared state.

Ingestion: scheduled queue workers under Supervisor decouple provider polling from user traffic; the isolated external dataset absorbs write churn.

Resilience: Redis-primary caching with file fallback and pre-warmed caches; quality gates (PHPStan L6, Composer audit, coverage) prevent regressions from shipping.

What made this hard

Architect's Challenges

  • Reconciling 8+ rate-limited, schema-divergent data providers into one consistent rating
  • Keeping ratings reproducible and fully auditable for institutional trust
  • Institutional-grade security: MFA cloud access, zero static keys, PII-safe pipelines
  • Running two front-ends in parallel to de-risk a framework migration

Results

Outcome

  • Enforced quality gates: PHPStan L6, Composer audit (deny HIGH/CRITICAL), coverage badges
  • Concurrency-guarded CI/CD with a manual production gate
  • {{TODO: add real metrics — tokens tracked, providers, uptime, users}}

More in Crypto / Web3 Analytics