Hybrid curve blending constant-product (xy=k) and constant-sum (x+y=k) via amplification coefficient A. Newton-Raphson solving converges in 6–10 iterations. A=1 behaves like Uniswap, A=100K near-zero slippage for pegged assets. N-token generalization supports 2–8 token pools.
First production reinforcement learning on a blockchain. 27 states × 9 actions = 243 Q-values stored on-chain. V2: Volatility-aware states — volatile pools track volatility trend (not price) as primary dimension, so the brain raises fees in turbulent markets and lowers them when calm. Explicit action tracking eliminates misattribution. Delegated architecture: swaps record observations at ~200 CU; bot triggers batch training at ~100K CU. Users never pay for ML compute.
Five reward components, each configurable per pool. Stable pools penalize price deviation;
volatile pools maximize fee×volume product. V2 adds fee efficiency as an explicit objective
and lets pool operators tune weights via cfgml. ε-greedy exploration (10%, decaying) prevents local optima.
Circular buffer candles updated every swap. TWAP oracle with confidence scores based on sample count, trade frequency, and price variance. Composable by other programs — no off-chain indexer dependency. Circuit breakers auto-pause on 10% price deviation or 10x volume spike.
| Feature | aeX402 | Raydium | Orca | Curve (EVM) |
|---|---|---|---|---|
| On-chain ML | Q-Learning V2 brain | — | — | — |
| Adaptive fees | ML-optimized 1–100 bps | Fixed | Dynamic tiers | Fixed per pool |
| StableSwap | A=1..100K | Stable pools | — | 3pool, metapools |
| Concentrated liq. | Tick ranges + CL | CLMM | Whirlpool | — |
| Token launches | Virtual pool grad. | AcceleRaytor | — | — |
| LP governance | On-chain voting | — | — | veCRV |
| On-chain candles | 24h + 7d OHLCV | — | — | — |
| Flash loans | Dynamic fees | — | — | Fixed fee |
| Limit orderbook | Hybrid AMM+LOB | OpenBook | — | — |
| Binary size | 189 KB (C) | ~400 KB (Rust) | ~300 KB (Rust) | N/A (EVM) |
| N-token pools | 2–8 tokens | 2 tokens | 2 tokens | 2–4 tokens |
Full terminal DEX at /dex/ — 12 live panels, pool picker, swap execution, wallet management, Nostr-backed community discussions. 375KB WASM, 30 color themes, mouse + keyboard navigation. No extensions, no installs.
Reliable click-to-select on pools, tabs, and panels. Direct WASM handle_mouse export bypasses xterm.js escape sequence issues. Scroll wheel support for pool lists and panel content.
Pool picker overlay (press p), quick-select amounts (1=25%, 2=50%, 3=75%, 4=MAX), flip direction (f), adjustable slippage (t). On-chain quote with price impact display.
32-byte settings format: panel order, custom layout weights, visible panel mask, and theme selection all persist to localStorage. Panel drag-reorder and custom column weights.
Inline migration documentation with 13 migration types, scrollable viewer (press ? in migration sub-tab). Farm CLI commands for create/close operations.
GitHub Dark, Dracula, Monokai, Nord, Solarized, Gruvbox, Tokyo Night, Catppuccin, One Dark, Ayu, Everforest, Kanagawa, Rose Pine, Material, Palenight, Nightfox, Synthwave 84, Horizon, Vesper, Poimandres, plus 4 light themes (Solarized Light, GitHub Light, E-Ink, Paper), High Contrast, Cyberpunk, and DOS.
Capacitor/Android wrapper for native mobile builds. Cross-compiled release binaries for Linux (amd64/arm64), macOS (amd64/arm64), and Windows (amd64). One-line install: curl -sSf https://aex402.com/install.sh | sh