VaubanSwap
VaubanSwap — Intent-Based DEX
VaubanSwap is Starknet's only CoW (Coincidence of Wants) solver. Users sign intents off-chain; the solver matches opposing swaps for zero-slippage execution and routes unmatched volume through AVNU as fallback.
How It Works
1. User signs SNIP-12 intent off-chain (no gas cost)
2. Solver collects intents in a batch window
3. CoW matcher finds opposing pairs (e.g., STRK→ETH matched with ETH→STRK)
4. Matched pairs settle on-chain via VaubanSettlement (surplus captured)
5. Unmatched intents route through AVNU aggregator (price floor guaranteed)
6. User receives tokens — no MEV, no front-runningKey Advantages
| Feature | VaubanSwap | Traditional AMM |
|---|---|---|
| MEV Protection | Batch settlement, no front-running | Vulnerable to sandwich attacks |
| Price Improvement | CoW matching captures surplus | LP spread always paid |
| Gas Cost | Off-chain signing (free), batched settlement | Per-swap gas |
| Slippage | Zero for CoW matches, bounded for AVNU fallback | Variable |
Signing an Intent
Intents are signed off-chain using the SNIP-12 typed data standard. No on-chain transaction is required to submit an intent.
Intent Parameters
| Parameter | Type | Description |
|---|---|---|
inputToken | Address | Token you're selling |
outputToken | Address | Token you're buying |
inputAmount | u256 | Amount to sell (in wei) |
minOutputAmount | u256 | Minimum acceptable output (slippage protection) |
deadline | u64 | Unix timestamp — intent expires after this |
nonce | felt252 | Unique per intent (replay protection) |
Signing Flow
- Connect your Starknet wallet
- Select tokens and amount
- Review the quote (shows estimated output and price impact)
- Sign the SNIP-12 typed data — your wallet prompts for signature
- Intent is submitted to the VaubanSwap backend
No gas is spent until the solver executes the batch.
Settlement Architecture
VaubanSettlement Contract
The on-chain settlement contract (VaubanSettlement.cairo) processes matched intent batches:
- Batch Settlement: Multiple intent pairs settled in a single transaction
- Nonce Tracking: Each intent nonce is marked as used (replay protection)
- Surplus Distribution: Price improvement beyond
minOutputAmountis captured - Access Control: Only the authorized executor can submit batches
IntentVault
Users can optionally deposit tokens into the IntentVault for instant execution:
- Deposits earn auto-staking into VaubanVault when output token is supported
- Withdrawal is instant (no unbonding for vault deposits)
- The executor can pull tokens directly from the vault for faster settlement
YieldIntentVault
An advanced variant that puts idle DCA funds to work via Nostra lending:
| Feature | Description |
|---|---|
| Idle Yield | Funds waiting for DCA execution earn lending yield |
| 10% Buffer | Liquid buffer ensures execution reliability |
| Auto-Unstake | Automatically withdraws from lending when execution needed |
| Per-User Cap | 100K STRK maximum deposit per user |
| Min Stake | 10 STRK minimum for gas efficiency |
Monitoring Your Swaps
After signing an intent:
- Pending: Intent submitted, waiting for next batch window
- Matched: CoW match found with an opposing intent
- Settled: On-chain settlement complete, tokens delivered
- Fallback: No CoW match, routed through AVNU
- Expired: Deadline passed without execution
- Cancelled: User cancelled the intent
Real-time status updates are delivered via WebSocket.
Solver Mechanics
The solver runs adaptive batch windows:
- Collection Phase: Accumulate intents over a configurable window
- Matching Phase: CoW bipartite matching finds optimal pairs
- Settlement Phase: Matched pairs settle on-chain via
VaubanSettlement - Fallback Phase: Unmatched intents route through AVNU aggregator
The batch window adapts based on volume — higher volume triggers more frequent settlements.
Supported Tokens
VaubanSwap supports any ERC20 token on Starknet. Common pairs:
| Pair | Type |
|---|---|
| STRK / ETH | High liquidity |
| STRK / USDC | Stablecoin |
| wBTC / STRK | BTC exposure |
| ETH / USDC | Stablecoin |
Security
- No custody: Tokens stay in your wallet until settlement
- SNIP-12 signatures: Standard Starknet typed data signing
- Nonce replay protection: Each intent can only execute once
- Deadline enforcement: Expired intents are never executed
- Price floor:
minOutputAmountguarantees minimum return - Batch transparency: All settlements are on-chain and verifiable
Contracts
| Contract | Network | Purpose |
|---|---|---|
| VaubanSettlement | Sepolia + Mainnet | Batch intent settlement |
| IntentVault | Sepolia + Mainnet | Optional token deposit for instant execution |
| YieldIntentVault | Sepolia (pending) | Yield-bearing intent deposits |
See Architecture > Contracts for addresses and implementation details.