01 · Status
What exists, honestly.
- Landing, simulator, rule builder, math labImplemented — runs in the browser
- Economic math library + unit testsImplemented — 24 tests, every example on this page is computed from it
- Token onboarding UIPrototype — address format check only; chain reads need RPC
- Quantum-inspired optimizerResearch — classical CPU only
- Wallet, indexer, contracts, AI providerNot implemented — to be integrated
- Quantum hardware / QAOARoadmap
02 · Architecture
Authorized in. Verified rules. Bounded out.
Funds flow left to right. Policy and risk sit above and below the vault and must both agree before the router moves anything. Click a node.
01
AI proposes
Off-chain analysis produces a typed policy proposal. It never signs and never emits executable code.
02
Code validates
Deterministic checks (limits, freshness, slippage, reserve) accept or reject. Same logic off-chain and on-chain.
03
Contracts execute
Only allow-listed adapters, only bounded recipients, only within caps. Everything else reverts.
03 · Revenue & budgets
From volume to a budget you can spend.
Three steps: estimate captured revenue, subtract real costs, split the remainder by weights that must sum to exactly 100%.
Gross captured revenue
| Symbol | Meaning | Unit |
|---|---|---|
| Eligible daily trading volume | USD/day | |
| Applicable fee rate | fraction | |
| Fraction captured by the platform, 0 ≤ c ≤ 1 | fraction | |
| Gross captured revenue | USD/day |
Net distributable budget
Allocation
- R_gross = 1,000,000 × 0.02 × 0.75 = $15,000.00/day
- R_net = $15,000.00 − $120 gas − $60 platform = $14,820.00
- Buyback 30% = $4,446.00 · Liquidity 25% = $3,705.00
- Treasury 35% = $5,187.00 · Rewards 10% = $1,482.00
- Σ = $14,820.00 · residual = 0 µUSD
04 · Reserve floor
Spending is bounded by what stays behind.
Basic reserve constraint
- T = $120,000 · T_min = $50,000
- S_max = 120,000 − 50,000 = $70,000
- Proposed buyback $4,446 + rewards $1,482 + liquidity $3,705 = $9,633 → allowed
05 · AMM swaps
Derive it once, trust it forever.
For a constant-product pool the swap output follows from one invariant. The fee is taken off the input first and stays in the pool.
Invariant
Derivation
| Symbol | Meaning | Unit |
|---|---|---|
| Quote-asset reserve | ETH | |
| Token reserve | tokens | |
| Quote amount paid in | ETH | |
| Effective LP fee | fraction | |
| Tokens received | tokens |
x = 100 ETH, y = 1,000,000 tokens, Δx = 50 ETH, f = 0.3% (a large trade, so the gap is visible). The dashed tangent is the starting spot price; the solid chord is what the trade actually paid on average. The gap between them is price impact.
Spot vs execution price
Two different numbers, kept apart
- Δx_eff = 0.997 ETH
- Δy = 1,000,000 × 0.997 / 100.997 = 9,871.58
- impact ex-fee = 0.997%
- impact total = 1.301%
- Δx_eff = 19.94 ETH
- Δy = 166,249.79 tokens
- impact ex-fee = 19.940% (= 19.94/100)
- impact total = 20.301%
06 · V3 / V4 limits
Why V2 math is not V3 math.
Concentrated liquidity uses ticks and a liquidity value L. The x·y = k formulas above are not an approximation of it.
V3 price and virtual reserves (token0 = x, token1 = y, price P = y/x)
Swap inside one tick range
V3 oracle: time-weighted tick, then geometric-mean price
07 · Volatility & TWAP
Measure the past. Never promise the future.
Log returns
Sample volatility, annualised
Time-weighted average price (arithmetic)
- P = 100, 102, 101, 105, 103, 108, 104
- r = 1.98%, -0.99%, 3.88%, -1.92%, 4.74%, -3.77%
- s_r = 3.401% per day
- σ_ann = 3.401% × √365 = 65.0%
- P = 10 for 1h, then 20 for 3h
- TWAP = (10·1 + 20·3) / 4 = 17.5
- Plain average would be 15
08 · Monte Carlo
Not one future. Eight hundred.
The twin simulates the treasury path many times under stated assumptions and reports the spread, including the bad tail.
Volume model (mean-corrected log-normal)
Treasury recursion
Outputs
V̄ = $400k/day, σ = 80%, τ = 2%, c = 70%, costs $1,000/day, T₀ = $80k, floor $50k, ρ = 50%, 60 days, shock p = 4%/day (−70% volume), seed 5. Re-runs are bit-identical for the same seed.
09 · Optimization & QUBO
From allocation to a binary problem.
Start with a trustworthy classical baseline. Then encode the same problem as a QUBO to study annealing — and validate every answer.
Risk-adjusted objective
Binary encoding
Energy with penalties
The budget penalty as a QUBO matrix (z² = z)
Computed Q for 2 variables × 2 bits (K = 2, M = 3, P = 1) · constant = 1
| bit | z0 | z1 | z2 | z3 |
|---|---|---|---|---|
| z0 · c = 0.333 | -0.556 | 0.444 | 0.222 | 0.444 |
| z1 · c = 0.667 | · | -0.889 | 0.444 | 0.889 |
| z2 · c = 0.333 | · | · | -0.556 | 0.444 |
| z3 · c = 0.667 | · | · | · | -0.889 |
Verified in unit tests: the matrix reproduces P(Σa − 1)² for all 16 bit patterns, and gives exactly 0 on budget-feasible ones (e.g. z = 1001 → 1/3 + 2/3 = 1).
Try it — grid search vs annealing
Coefficients g, d, ρ, κ are illustrative and chosen by the user. They are not empirically validated.
10 · Rewards
Split fairly. Lose nothing.
Rewards are distributed by snapshot weights. Integer division leaves a few base units; they are accounted for explicitly.
Proportional share
- R = 100 units, weights 1 : 1 : 1
- shares = [33, 33, 33] · residual = 1
- The residual stays in the distributor and is carried to the next epoch
Claim-based distribution (why not loop over holders)
11 · Gas
Wei, exactly.
Gas costs are computed with arbitrary-precision integers. A floating-point number must never touch token accounting.
Execution cost (EIP-1559 style)
Conversion
- GasUsed = 185,000 · price = 0.08 gwei = 80,000,000 wei
- cost = 14800000000000 wei = 0.0000148 ETH
- At $3,000/ETH ≈ $0.0444
Layer-2 chains
12 · Guardrails
Every limit, as an inequality.
Reserve floor
Daily cap
Slippage bound
Oracle deviation
Oracle freshness
Observation window
13 · AI & quantum honesty
What the models may and may not do.
- Summarise measured signals (returns, volatility, depth)
- Propose a policy in a typed schema
- Explain a warning in plain language
- Run what-if scenarios in the twin
- Sign transactions or hold keys
- Emit and deploy executable Solidity
- Claim to predict price or identify bot owners
- Override a deterministic validator
14 · Chains & DEXs
Same EVM, different realities.
| Type | Math | Caveat | Status |
|---|---|---|---|
| Uniswap V2-type | x·y = k reserves | Fee-on-transfer tokens need a router and token tested together | Planned first adapter |
| Uniswap V3-type | Ticks and liquidity L | Fee-on-transfer tokens are not generally compatible with standard routers | Not implemented |
| Uniswap V4 | Hooks, custom accounting, dynamic LP fees | Hook is bound at pool initialization; LP fee ≠ token tax; hook fees are not automatically platform revenue | Research |
| Chain | ID | Native | Type | Notes |
|---|---|---|---|---|
| Ethereum | 1 | ETH | L1 | Highest gas cost; deepest liquidity. EIP-1559 fee market. |
| Base | 8453 | ETH | L2 | L2: total fee = L2 execution + L1 data fee. |
| BNB Smart Chain | 56 | BNB | L1 | Native asset is BNB. Different finality and infrastructure from Ethereum. |
| Arbitrum One | 42161 | ETH | L2 | L2 with its own gas accounting that includes an L1 component. |
No protocol contract addresses are listed: none have been verified against official sources yet.
15 · Limits & checklist
Known limits. Required before production.
- No on-chain reads, wallet or contracts yet; every on-chain panel shows an honest unavailable state.
- Prices, gas and volatility inputs are manual or synthetic; no live feed is connected.
- Simulations are only as good as their assumptions and do not predict returns.
- The optimizer uses illustrative coefficients; it is not empirically validated and uses no quantum hardware.
- USD figures in the UI model are floating point for display; token accounting in contracts must use integers.
Production readiness
- Independent smart-contract audit published
- Contracts verified on every target chain
- Timelock and role tables reviewed
- Invariant and fork tests green
- Chain-specific fee accounting (L1 data fee) implemented
- Oracle/TWAP sources documented per pool type
- Incident and pause runbook written
- Legal and regulatory review
Environment template
NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID= RPC_URL_1= RPC_URL_8453= RPC_URL_56= RPC_URL_42161= ANTHROPIC_API_KEY= # server-side only, for the policy composer DATABASE_URL= # indexed data (server-side)