Vauban Docs
Guides

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-running

Key Advantages

FeatureVaubanSwapTraditional AMM
MEV ProtectionBatch settlement, no front-runningVulnerable to sandwich attacks
Price ImprovementCoW matching captures surplusLP spread always paid
Gas CostOff-chain signing (free), batched settlementPer-swap gas
SlippageZero for CoW matches, bounded for AVNU fallbackVariable

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

ParameterTypeDescription
inputTokenAddressToken you're selling
outputTokenAddressToken you're buying
inputAmountu256Amount to sell (in wei)
minOutputAmountu256Minimum acceptable output (slippage protection)
deadlineu64Unix timestamp — intent expires after this
noncefelt252Unique per intent (replay protection)

Signing Flow

  1. Connect your Starknet wallet
  2. Select tokens and amount
  3. Review the quote (shows estimated output and price impact)
  4. Sign the SNIP-12 typed data — your wallet prompts for signature
  5. 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 minOutputAmount is 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:

FeatureDescription
Idle YieldFunds waiting for DCA execution earn lending yield
10% BufferLiquid buffer ensures execution reliability
Auto-UnstakeAutomatically withdraws from lending when execution needed
Per-User Cap100K STRK maximum deposit per user
Min Stake10 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:

  1. Collection Phase: Accumulate intents over a configurable window
  2. Matching Phase: CoW bipartite matching finds optimal pairs
  3. Settlement Phase: Matched pairs settle on-chain via VaubanSettlement
  4. 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:

PairType
STRK / ETHHigh liquidity
STRK / USDCStablecoin
wBTC / STRKBTC exposure
ETH / USDCStablecoin

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: minOutputAmount guarantees minimum return
  • Batch transparency: All settlements are on-chain and verifiable

Contracts

ContractNetworkPurpose
VaubanSettlementSepolia + MainnetBatch intent settlement
IntentVaultSepolia + MainnetOptional token deposit for instant execution
YieldIntentVaultSepolia (pending)Yield-bearing intent deposits

See Architecture > Contracts for addresses and implementation details.