Protocol Details
Technical architecture, contract addresses, and security details for developers and researchers.
Architecture
SmartSplitRouter
Core router contract. Handles quoting, split optimization, and swap execution across multiple DEX pools.
V3Adapter
Uniswap V3-compatible adapter. Executes individual pool swaps with callback verification.
DEXRegistry
On-chain registry of supported DEXes (Uniswap V3, SushiSwap V3, PancakeSwap V3). Owner-managed.
OptimizerLib
Library for computing marginal output curves and optimal split allocations across pools.
V3MathLib
Tick math, sqrt price calculations, and swap step computations for concentrated liquidity pools.
PoolAddress
Deterministic pool address computation using CREATE2 for each registered DEX factory.
Security
- 107 unit, fuzz, integration, and security tests
- 18 mainnet fork tests against real pool state
- Callback address verification (prevents fake pool attacks)
- Deadline enforcement on all swaps
- Maximum input cap (owner-configurable)
- Slippage protection via minAmountOut
- Permit2 support for gasless approvals
- Reentrancy guards on all external functions
Developer Integration
Integrate Cleave routing into your smart contract with a single call. No API keys, no off-chain dependencies.
ICleaveRouter router = ICleaveRouter(ROUTER_ADDRESS);
// Get a quote (view function, no gas cost)
(uint256 amountOut, , , , , ) = router.quoteSwap(
tokenIn, tokenOut, amountIn
);
// Execute the swap
uint256 received = router.swap(SwapParams({
tokenIn: tokenIn,
tokenOut: tokenOut,
amountIn: amountIn,
minAmountOut: amountOut * 995 / 1000, // 0.5% slippage
deadline: block.timestamp + 1200,
recipient: msg.sender
}));