Swapping
Shielded swaps execute Uniswap V2 token swaps within the privacy pool. Your trading activity is hidden from on-chain observers.
Steps
Navigate to the Swap screen
Select the input token (From)
Select the output token (To)
The app checks if a valid Uniswap pair exists
Enter the input amount
The app fetches a quote showing the expected output
Optionally adjust slippage and deadline settings
Confirm the swap transaction in your wallet
What Happens
The wallet signs a Uniswap V2 swap transaction
The proxy intercepts and generates a ZK proof
The contract verifies the proof
The contract executes the actual swap on Uniswap V2
The swap output is captured as a new note in the Merkle tree
Swap Types
ETH
ERC-20
swapExactETHForTokens
ERC-20
ETH
swapExactTokensForETH
ERC-20
ERC-20
swapExactTokensForTokens
Output Notes
Each swap creates 3 notes:
Swap output note
The tokens received from the swap
Change note
Leftover input token balance
Fee change note
Leftover fee-asset balance
Fee Handling
If the fee token matches the swap input token, fees are deducted from the input pool
If they differ (e.g., paying ETH fees for an ERC-20→ERC-20 swap), separate fee notes are required
ERC-20 → ERC-20 Swaps
These generate 3 transaction entries in history:
One outgoing ERC-20 (input)
One incoming ERC-20 (output)
One outgoing ETH (fee)
Slippage and Deadline
Slippage: Minimum acceptable output (set via
amountOutMin)Deadline: Maximum block timestamp for the swap to execute
Both are enforced by the Uniswap V2 router on-chain.
Last updated