Summary
Led production platform and AI/API infrastructure work for a crypto analytics company serving 100K+ monthly sessions. My work covered performance redesign, developer-facing AI tools, multi-channel workflow automation, subscription reliability, and low-friction API monetization.
My Role
Tech Lead responsible for architecture, implementation, technical direction, deployment, quality gates, and team execution across a 6-engineer team.
Key Outcomes
- Reduced page load and navigation times by 70%.
- Reduced subscription-related complaints by 90%.
- Shipped a production MCP server exposing 20+ crypto analytics tools.
- Built alerting and workflow infrastructure across email, SMS, Slack, Discord, and Telegram.
- Integrated Coinbase X402 micropayments for low-friction API monetization.
Stack
TypeScript, Node.js, Express, PostgreSQL, Prisma, Docker, Kubernetes, Trigger.dev, Knock, Stripe, Cloudflare, AWS, Azure, Redis, Coinbase X402, MCP SDK.
Links
Problem
Token Metrics needed a faster production platform, more reliable subscription operations, stronger developer-facing API surfaces, and automation that could turn market signals into timely user engagement. The work had to support a real customer base, production traffic, crypto market volatility, and teams moving across product, data, AI, and billing concerns.
Constraints
- Existing analytics workflows depended on multiple data stores, APIs, and internal services.
- AI-facing integrations needed typed, predictable interfaces instead of loosely documented REST calls.
- Alerting had to respect user preferences, channel-specific credentials, retries, and unsubscribe/compliance requirements.
- API monetization had to be low-friction for developers while remaining secure and observable.
- Production changes needed to fit active engineering processes and avoid disrupting subscription or analytics workflows.
Architecture
The work split into three major systems:
- An MCP server that converts REST crypto analytics into typed AI tools over local stdio and hosted HTTP transports.
- A workflow orchestrator that schedules market alerts, operational automations, and multi-channel notifications.
- An X402 middleware layer that prices, verifies, settles, and records payment-required API requests.
Key Technical Decisions
- Centralized API tooling behind a shared base tool class so every MCP tool had consistent authentication, timeout, error, and response behavior.
- Used a compact search DSL to help agents discover the right Token Metrics endpoint before composing follow-up calls.
- Isolated long-running workflows and scheduled jobs in Trigger.dev with explicit retry and concurrency controls.
- Kept notification composition channel-aware, with EJS templates and payload fanout through Knock plus native Telegram handling.
- Treated unknown X402 API endpoints defensively by assigning the highest pricing tier instead of accidentally allowing unpaid access.
Security And Reliability
- Required API keys for protected MCP and workflow endpoints.
- Added CORS, host/origin checks, TLS ingress, and non-root Docker runtime for the hosted MCP server.
- Used schema validation for X402 payment payloads, EVM addresses, signatures, and payment amounts.
- Added task-level retries, queue limits, and lifecycle handling for long-running alert services.
- Avoided sensitive logs while preserving enough operational detail for support and debugging.
Results
- Faster product navigation for a high-traffic crypto analytics platform.
- More reliable subscription operations and fewer customer complaints.
- AI clients could integrate Token Metrics data in minutes rather than weeks.
- Alerts and workflows helped bring timely market intelligence into the channels customers already used.
- X402 created a self-serve path for developers to test premium API endpoints with small crypto payments.
What I Would Improve Next
- Add public architecture diagrams and request examples to make API onboarding easier.
- Expand observability around alert delivery, MCP tool latency, and X402 settlement outcomes.
- Build a consolidated internal dashboard for workflow health, payment failures, and API usage trends.
Deep Dives
MCP Server: AI-Native Crypto Analytics Gateway
I built a production MCP server that exposes Token Metrics crypto data, analytics, and research as first-class AI tools. It gives AI apps, agents, and LLM clients access to real-time market data, signals, grades, indices, and AI reports without requiring every integration team to manually wire dozens of bespoke endpoints.
MCP Architecture
Claude, Cursor, OpenAI client
stdio, HTTP, SSE
20+ analytics actions
prices, grades, signals, reports
Problems It Solves
- Consolidates 20+ analytics endpoints into typed tools that LLMs can discover and call.
- Provides hosted HTTP access with simple
x-api-keyauthentication. - Supports local
npxstdio usage for desktop LLM clients. - Includes a search DSL so agents can select the right endpoint and parameters reliably.
- Adds production hardening through session management, CORS and DNS-rebinding protections, TLS ingress, non-root containers, and GitOps deployment.
Tool Catalog
- Token and pricing:
get_tokens_data,get_tokens_price,get_tokens_hourly_ohlcv,get_tokens_daily_ohlcv - Signals and grades:
get_tokens_trading_signal,get_tokens_hourly_trading_signals,get_token_tm_grade,get_tokens_investor_grade,get_token_technology_grade - Market intelligence:
get_market_metrics,get_sentiment,get_tokens_quant_metrics,get_tokens_scenario_analysis,get_tokens_correlation - Research and indices:
get_tokens_ai_report,get_crypto_investors,get_top_tokens_by_market_cap,get_indices,get_indices_performance,get_indices_holdings - Agent utilities:
searchfor endpoint discovery andfetchfor raw endpoint access
Notable Files
src/http.ts: streamable HTTP JSON-RPC server, sessions, CORS, and DNS-rebinding checks.src/index.tsandsrc/cli.ts: stdio server and CLI entrypoint.src/tools/base-api-tool.ts: shared HTTP client, error handling, and response shaping.src/tools/*: concrete tools for prices, signals, grades, indices, and research.src/utils/search.ts: endpoint catalog and examples for the LLM search DSL.k8s-manifests/*andargocd/argocd-application.yaml: Kubernetes and ArgoCD deployment.
Multi-Channel Crypto Alerts And Workflow Orchestrator
I built a production-grade Node.js/TypeScript service that orchestrates data-driven alerting and scheduled workflows. It turns Token Metrics signals, grades, and operational events into timely notifications across customer-preferred channels.
Alert Orchestration
signals, grades, indices
schedules, retries, queues
EJS templates, payloads
Knock, SES, SMS, Telegram
email, SMS, Slack, Discord
Core Features
- Token alerts for price changes, TM Trader/Investor grades, and technical indicator signals.
- Indices alerts with configurable trader and investor frequencies.
- Market indicator alerts with automated charting, screenshots, and S3/R2 uploads.
- Daily digests and moonshot-style curated signal delivery.
- Knock fanout across email, SMS, Slack, and Discord, plus native Telegram bot delivery.
- Operational automations for Stripe syncs, usage resets, bounced/expiry email handling, WebSocket health checks, NFT/Stripe sync, and alert-limit verification.
Reliability And Scale
- Task-level retry policies for transient failures.
- Queue-level concurrency limits to protect downstream services.
- Persistent bot lifecycle management for long-running services.
- API-key middleware for manual-trigger endpoints.
- Environment-backed secrets for DB, Knock, Stripe, AWS, Azure, Supabase, Redis, and notification services.
Coinbase X402 Micropayments Integration For API
I integrated Coinbase X402 so developers could access premium API endpoints through 402 Payment Required flows instead of long trials, contracts, or upfront account setup.
X402 Payment Flow
premium API route
price and requirements
USDC or TMAI
verify and settle
paid access granted
Key Features
- Middleware detects X402 requests, bypasses free endpoints, and enforces payment on premium routes.
- Dynamic pricing supports endpoint tiers and safe defaults for unknown paths.
- USDC and TMAI support gives developers a crypto-native checkout path, including token-aware discounts.
- Zod validation checks authorization payloads, signatures, EVM addresses, and integer amounts.
- Standardized
402responses includeacceptspayloads so clients know how to pay. - Settlement responses return
X-PAYMENT-RESPONSEheaders for client bookkeeping.
Business Impact
- Lowered developer evaluation friction by allowing small payments for paid endpoint testing.
- Created usage-based revenue alignment for API consumers.
- Improved trial-to-paid conversion by making premium analytics accessible without sales-led onboarding.