Skip to content

Build Story

FatTail Markets was built by a single developer using Claude Code as the core building partner. Every phase — from architecture to deployment — was AI-assisted.

The Builder

Suhong Sung — Solo builder + DeFi YouTube creator (Corini, 21K subscribers).

Years of analyzing DeFi protocols, AMM mechanics, and yield structures on YouTube led to the core insight: 90:10 extreme probability markets can create a natural two-sided market — stable carry for the 90% side and explosive convexity for the tail. FatTail is the product of that domain expertise combined with AI-assisted full-stack development.

By the Numbers

MetricValue
Phases completed15+
Unit tests99
API routes45+
Chains supported5
Time to MVPWeeks, not months

Phase Timeline

Phase 1: Foundation

  • LS-LMSR math engine in pure TypeScript (packages/ls-lmsr)
  • Cost function, pricing, liquidity, vigorish, safety guard, Kelly criterion
  • 69 unit tests passing from day one
  • Log-sum-exp trick for numerical stability with large values

Phase 2: DB & Auth

  • Supabase (PostgreSQL) with Row-Level Security
  • Profiles with auto-creation trigger + 10,000 K-Point welcome bonus
  • Email/password auth via Supabase Auth

Phase 3–4: Trading & Markets

  • LS-LMSR automated market maker with buy/sell
  • Dynamic vigorish: probability-weighted fees (0.3% for 90/10, 3% for 50/50)
  • Market creation with admin + optimistic oracle resolution
  • Safety guard with 4-tier health system (informational only, never blocks trades)

Phase 5–8: Oracle & Resolution

  • Three oracle types: Admin, Price Feed (CoinGecko), Optimistic (UMA-style)
  • Optimistic oracle flow: propose → challenge → vote → resolve
  • Bond system (500 KP), KP-weighted voting for Sybil resistance
  • Resolution criteria with yes/no conditions, evidence rules, void conditions

Phase 9–11: UX & Wallet

  • Dual persona UI: Tail mode (speculator) vs Yield mode (market maker)
  • Mobile responsive optimization
  • Solana wallet integration (Phantom, Solflare)
  • K-Point ↔ on-chain bridge

Phase 12: Multi-Chain Expansion

  • 5 chains: Solana, Base, Arbitrum, Optimism, Polygon
  • wagmi v3 + viem v2 for EVM chains
  • Chain-agnostic deposit/withdraw with per-chain verification
  • MoonPay fiat on-ramp across all chains

Phase 13: Telegram Bot

  • grammY framework with Vercel webhook
  • Commands: /balance, /positions, /markets, /alert
  • Push notifications on trades, settlements, vig earnings
  • Price alert cron with 1-hour cooldown

Phase 14: Bot API

  • REST API with API key authentication (HMAC-SHA256)
  • Endpoints: markets, trade, portfolio, positions
  • Python and TypeScript SDK stubs
  • Rate limiting and usage tracking

Phase 15: Landing & Docs

  • Astro 5 landing page (0KB JS, i18n EN/KO, SEO)
  • Starlight documentation site (14 pages, Pagefind search)
  • Multi-subdomain deployment (app/www/docs on Vercel + Cloudflare)

AI Development Philosophy

Claude Code was not used as a simple autocomplete tool. It served as:

  • Architect: Designed the LS-LMSR engine, oracle state machine, and multi-chain abstraction layer
  • Implementer: Wrote production code across Next.js, Supabase RPC, Solana programs, and EVM integrations
  • Debugger: Diagnosed issues like anchor.Wallet ESM export failures, Supabase generic type limitations, and Turbopack polyfill conflicts
  • Reviewer: Caught security issues (RLS gaps, missing input validation) and suggested improvements
  • Documenter: Generated migration files, API docs, i18n keys, and this documentation site

Every phase was planned as a structured session with clear goals, implemented incrementally, tested, and documented before moving to the next phase. The result: a production-grade prediction market platform built at startup speed by one person.

Why Extreme-Only? The Structural Moat

The technology is replicable — the moat is in the network and positioning:

  1. Creator-Builder Fusion: A DeFi YouTuber with 21K subscribers building the product directly. The trust and distribution channel are not replicable by adding a feature.
  2. Two-sided Liquidity Network: Once yield seeker ↔ tail hunter liquidity forms, late entrants face a cold start problem on both sides simultaneously.
  3. Bot API Ecosystem: Traders who build strategies on FatTail’s SDK have switching costs.
  4. Category Ownership: “Extreme probability = FatTail” — category creators have first-mover advantage.

Yield Seeker APR

Yield seekers (90% side) earn from vig distribution. Mathematical example at TVL $10M, 10% daily turnover:

Daily Volume: $1M
Daily Vig Pool: $1M × 0.6% = $6,000
Yield Seeker Share (50%): $3,000/day
90% Side Pool (~70% of TVL): $7M
$10K Position → 0.143% share → $4.29/day → ~$1,566/year → APR ~15.7%
Turnover RateAPR
5% (early stage)~7.8%
10% (growth)~15.7%
20% (with bot traders)~31.4%

Real APR is ~70-80% of above after accounting for market expiry and reinvestment cycles. Auto-compound feature is already implemented to minimize reinvestment friction.

Tech Stack Decisions

ChoiceReason
Next.js 16 (App Router)Server components + API routes in one framework
SupabasePostgreSQL + Auth + RLS + RPC in one service
LS-LMSR (custom)No existing library for liquidity-sensitive LMSR
pnpm workspaceMonorepo for shared math library
Astro 5 (landing)Zero-JS static site for maximum performance
Starlight (docs)Built-in i18n + search + Astro ecosystem
wagmi + viemType-safe EVM interactions
grammYLightweight Telegram bot framework