Motivation
dex/v3.zig and dex/router.zig are stubs while V2 math is complete and benchmarked (24ns getAmountOut). V3 concentrated-liquidity math is what searchers actually need in 2026, and a limb-native Zig implementation would extend the existing 'beats Rust on DEX math' story. Complements #15 (router ABI decoding).
Scope
- Tick <-> sqrtPriceX96 conversions (getSqrtRatioAtTick / getTickAtSqrtRatio, Q64.96 fixed point)
- swap-within-tick amount math (SwapMath.computeSwapStep equivalent)
- liquidity math helpers (getAmount0/1Delta)
- Bench entries comparing against the uniswap-v3 reference vectors
Pointers
u256 limb arithmetic in uint256.zig (mulDiv already exists and is benchmarked at 18ns); validate against the canonical TickMath test vectors from the Uniswap v3-core repo.
Motivation
dex/v3.ziganddex/router.zigare stubs while V2 math is complete and benchmarked (24ns getAmountOut). V3 concentrated-liquidity math is what searchers actually need in 2026, and a limb-native Zig implementation would extend the existing 'beats Rust on DEX math' story. Complements #15 (router ABI decoding).Scope
Pointers
u256 limb arithmetic in
uint256.zig(mulDiv already exists and is benchmarked at 18ns); validate against the canonical TickMath test vectors from the Uniswap v3-core repo.