Skip to content

Latest commit

Β 

History

30 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

WindTunnel πŸŒͺ️

Stress-test flight simulator and config tuner for Meteora Dynamic Bonding Curves (DBC), validated bit-for-bit on Solana mainnet and devnet.

Live Demo Solana Mainnet Meteora DBC License: MIT


What is WindTunnel?

WindTunnel is a discrete-event market simulator and parameter optimization engine for Meteora Dynamic Bonding Curve (DBC) token launches. It allows founders, liquidity engineers, and token creators to simulate bonding curve launches under adversarial conditionsβ€”modeling snipers, MEV bundlers, retail momentum traders, and whalesβ€”before committing funds on-chain. Every mathematical model in WindTunnel has been validated against live Meteora DBC program state transitions on Solana Devnet and Mainnet-Beta.


The Problem

Launching a bonding curve token blind is dangerous. Founders typically choose bonding curve parametersβ€”such as initial market cap, migration targets, and fee decay schedulesβ€”without empirical data on how those choices behave under adversarial pressure.

Our empirical benchmarks revealed two structural failure modes common to blind launches:

  1. Unprotected sniper extraction: Across benchmark scenarios, slot-0 Jito snipers extract 18.3% to 18.5% of token supply under whale-heavy order flow (generating up to 96.6 SOL net profit in scripts/compare-demo.ts), and 38.2% to 42.8% under coordinated sniper bundles on flat and low-fee curves (scripts/tune-demo.ts), capturing early tokens before organic buyers can execute.
  2. Severe migration liquidity drop: Moving from a discrete DBC curve into Meteora DAMM v2 (CP-AMM) full-range liquidity causes an immediate 67x to 79x surge in price impact, exposing graduating tokens to violent post-migration dump volatility.

What We Built

WindTunnel provides a full-stack flight simulator across four core capabilities:

  1. Adversarial Trader Simulator: A deterministic, multi-agent simulation engine running 5 distinct trader archetypes:
    • JitoSniperAgent: Slot-0 bundle extractors targeting early supply.
    • RetailMomentumAgent: Trend-following retail buyers with slippage thresholds.
    • WhaleDumpAgent: High-capital market orders designed to test pool resilience.
    • NoiseTraderAgent: Stochastic background liquidity.
    • ArbitrageurAgent: Cross-pool price reconcilers.
  2. DBC β†’ DAMM v2 Migration-Gap Analyzer: Measures price continuity, migration fees (protocol & creator splits), and the order book liquidity cliff across pool graduation.
  3. Evolutionary Auto-Tuner: A two-stage evolutionary optimization search (core/src/tuner/tuner.ts). Generation 0 samples random candidate configurations across the continuous DBC parameter space (core/src/tuner/space.ts), evaluates them against adversarial scenarios, and selects the top-scoring elite candidates. Generation 1 mutates the parameters of those top performers within bounded perturbation ranges to converge on optimal fee barriers, decay rates, and curve dimensions for user-specified objectives (e.g. protect-organic, creator-yield).
  4. Interactive Web Flight Simulator: A Next.js web application (windtunnel-six.vercel.app) featuring side-by-side curve comparison, real-time adversarial playback, and interactive parameter tuning.

Key Findings

Through millions of simulated ticks and on-chain benchmarks, WindTunnel uncovered critical economic insights:

  • 67x – 79x Post-Graduation Slippage Jump: In migration gap benchmarks across steep, flat, and multi-segment curves (scripts/compare-demo.ts), a standard $1,000 buy order incurs 67x to 79x higher price impact immediately after migration onto DAMM v2 compared to immediately before migration on the bonding curve (67.8x on flat, 70.6x on steep, 79.4x on multi-segment). This occurs because migrated liquidity is deployed across the full range (MIN_SQRT_PRICE to MAX_SQRT_PRICE), substantially diluting active depth near spot.
  • Auto-Tuner Outperforms Hand-Picked Baseline (+6.28 pts, +225% Creator Fees): In a 40-iteration two-stage parameter search against the coordinated snipers scenario (seed: 4242), the tuner refined a 16.0% starting fee barrier with a 1,000-slot linear decay (to 1.5% floor) and 2.6x curve expansion (15 to 39 SOL). Comparing this tuned preset against the hand-picked baseline (5% decaying to 1%, 20 to 40 SOL), the tuned config improved the objective score by +6.28 points and drove a +225% increase in creator fee revenue (from 0.126 SOL to 0.410 SOL) by taxing early sniper bundles at 16%, with sniper token share changing only slightly (38.2% to 37.2%) while organic buyer returns rose from +88.8% to +93.6%.
  • Exact-Match Devnet Validation (0 Lamport Delta): Across 4 consecutive devnet swaps, WindTunnel's discrete mathematical engine predicted on-chain sqrtPrice, base reserves, quote reserves, and 3-way fee splits with exact 0-lamport delta against the live Meteora DBC program.

Verified on Real Infrastructure

WindTunnel is tested and verified on live Solana networks:

1. Mainnet-Beta Live Traction (Phase 8)

2. Devnet Mathematical Parity (Phase 5)


Architecture

windtunnel/
β”œβ”€β”€ core/                           # Pure simulation & optimization engine
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ agents/                 # 5 adversarial trader archetypes
β”‚   β”‚   β”‚   β”œβ”€β”€ sniper.ts           # Slot-0 sniper extractor
β”‚   β”‚   β”‚   β”œβ”€β”€ bundler.ts          # Coordinated Jito MEV bundles
β”‚   β”‚   β”‚   β”œβ”€β”€ momentum.ts         # Retail trend-following buyers
β”‚   β”‚   β”‚   β”œβ”€β”€ whale.ts            # High-capital market orders
β”‚   β”‚   β”‚   └── arbitrageur.ts      # Cross-pool price reconciler
β”‚   β”‚   β”œβ”€β”€ scenario/               # Discrete-event simulation runner
β”‚   β”‚   β”‚   β”œβ”€β”€ runner.ts           # Event loop, clock & step execution
β”‚   β”‚   β”‚   β”œβ”€β”€ agentMix.ts         # Pre-configured trader compositions
β”‚   β”‚   β”‚   └── compare.ts          # Multi-configuration comparison harness
β”‚   β”‚   β”œβ”€β”€ sim/                    # Mathematical models & AMM mechanics
β”‚   β”‚   β”‚   β”œβ”€β”€ pool.ts             # In-memory Meteora DBC virtual curve
β”‚   β”‚   β”‚   β”œβ”€β”€ damm.ts             # Post-graduation DAMM v2 CP-AMM & migration gap
β”‚   β”‚   β”‚   β”œβ”€β”€ rng.ts              # Seeded Mulberry32 deterministic PRNG
β”‚   β”‚   β”‚   └── volatility.ts       # Stochastic price volatility models
β”‚   β”‚   β”œβ”€β”€ scorecard/              # Multi-dimensional evaluation metrics
β”‚   β”‚   β”‚   └── compute.ts          # Sniper extraction, organic returns & fees
β”‚   β”‚   β”œβ”€β”€ tuner/                  # Two-stage evolutionary parameter optimizer
β”‚   β”‚   β”‚   β”œβ”€β”€ space.ts            # Parameter search space & random sampling
β”‚   β”‚   β”‚   β”œβ”€β”€ objectives.ts       # Multi-objective fitness scoring functions
β”‚   β”‚   β”‚   └── tuner.ts            # Gen 0 sampling + Gen 1 elite mutation
β”‚   β”‚   └── index.ts                # Public library exports
β”‚   β”œβ”€β”€ scripts/                    # CLI demos & on-chain deployment scripts
β”‚   β”‚   β”œβ”€β”€ devnet-deploy.ts        # Devnet DBC config & pool creation
β”‚   β”‚   β”œβ”€β”€ devnet-trade.ts         # Devnet swap observation harness
β”‚   β”‚   β”œβ”€β”€ devnet-migrate.ts       # Devnet liquidity migration execution
β”‚   β”‚   β”œβ”€β”€ stage1-create-config.cjs# Mainnet partner config creation
β”‚   β”‚   β”œβ”€β”€ stage2-create-pool.cjs  # Mainnet DBC pool & mint initialization
β”‚   β”‚   β”œβ”€β”€ stage3-swap1.cjs        # Mainnet real swap 1 (buy)
β”‚   β”‚   β”œβ”€β”€ stage4-swap2.cjs        # Mainnet real swap 2 (buy)
β”‚   β”‚   β”œβ”€β”€ tune-demo.ts            # CLI auto-tuner demonstration
β”‚   β”‚   └── compare-demo.ts         # CLI 3-way launch comparison demo
β”‚   └── tests/                      # 37 hardened invariant & parity tests
β”‚
β”œβ”€β”€ web/                            # Interactive Next.js web dashboard
β”‚   β”œβ”€β”€ src/app/                    # Next.js App Router & server simulation APIs
β”‚   β”‚   β”œβ”€β”€ api/simulate/route.ts   # Server-side simulation API endpoint
β”‚   β”‚   └── api/compare/route.ts    # Server-side comparison API endpoint
β”‚   β”œβ”€β”€ src/components/             # Dark-theme dashboard & charts
β”‚   β”‚   β”œβ”€β”€ Simulator.tsx           # Interactive curve flight simulator
β”‚   β”‚   β”œβ”€β”€ CompareView.tsx         # Side-by-side launch comparison
β”‚   β”‚   β”œβ”€β”€ DevnetVerified.tsx      # Mainnet traction & devnet parity proof
β”‚   β”‚   └── Findings.tsx            # Empirical research findings cards
β”‚   └── src/lib/core.ts             # Server-side bindings to windtunnel-core
β”‚
└── docs/                           # Empirical research papers & on-chain proof
    β”œβ”€β”€ mainnet-launch.md           # Mainnet-beta ledger & real swap proof
    β”œβ”€β”€ devnet-validation.md        # Devnet 0-delta mathematical parity proof
    β”œβ”€β”€ migration-gap-findings.md   # Research paper on 67-79x liquidity jump
    └── sdk-notes.md                # Meteora DBC SDK deep dive & bit math

The Next.js frontend calls the simulation engine through server-side API routes (/api/simulate, /api/compare), guaranteeing 100% mathematical fidelity between the CLI and the web interface without duplicating code.


Running Locally

Prerequisites

  • Node.js v20+ (tested on Node v24)
  • npm v10+

1. Test the Simulation Engine

# Clone the repository
git clone https://github.com/jotel-dev/windtunnel.git
cd windtunnel

# Install dependencies and run tests in core
cd core
npm install
npm test

2. Run Benchmarks & Genetic Tuner

# Run 3-way launch comparison harness
npm run compare

# Run the evolutionary auto-tuner
npx tsx scripts/tune-demo.ts

3. Launch the Interactive Web Dashboard

cd ../web
npm install
npm run dev

Open http://localhost:3000 in your browser.


Documentation


Built For

Built with precision for the Meteora Dynamic Bonding Curve Bounty on Superteam Earn.


License

MIT License. See LICENSE for details.

Releases

Packages

Contributors

Languages