Private Swapping
Anon supports private token swaps — you can exchange one token for another using shielded inputs and outputs. The DEX interaction and public swap data are still visible on-chain. This is powered by a combination of the Umbra aggregator and 0x Protocol.
How Private Swapping Works
A private swap is executed as a "cross-contract call" from within the Railgun pool:
- Your tokens are unshielded transiently (inside a single atomic transaction)
- The swap executes on a DEX (via Umbra or 0x)
- The output tokens are immediately re-shielded into the pool
From an external observer's perspective, the Railgun contract interacted with a DEX — the private notes are protected, but public swap amounts, timing, and other activity can still create correlations.
How to Swap
- Tap Swap on the home screen
- Select the From token (from your private balance)
- Select the To token
- Enter the amount, or use the slider to select a percentage of your balance
- Review the quote — price, output amount, fees, and route
- Adjust slippage tolerance if needed (default: 1%)
- Tap Swap and authenticate
Anon fetches a quote, generates a zk-SNARK proof for the cross-contract call, and submits using the selected delivery method.
Swap Providers
| Provider | Notes |
|---|---|
| Umbra (default) | Aggregator — finds best price across multiple DEXs |
| 0x Protocol | Direct routing via 0x smart order routing |
Anon automatically selects the provider with the best quote. You can see which provider is being used in the swap details panel.
Private Swap Restrictions
When swapping privately, a subset of liquidity sources is excluded (specifically 0x_RFQ and Uniswap_V3 in some configurations) because those sources require the taker address to be an EOA rather than a smart contract. Umbra's aggregator works around this by using compatible sources.
Public Swap
If you prefer to swap from your public balance, select Public mode. This works like any standard DEX aggregator — your swap is on-chain from your public address.
Slippage & Price Impact
- Slippage tolerance — the maximum acceptable difference between the quoted price and execution price. If the price moves beyond this tolerance, the transaction reverts.
- Price impact — for large swaps relative to pool liquidity, Anon shows an estimated price impact warning.
The current default slippage is 1%. Check the value in the quote; increasing tolerance permits a worse execution price and does not guarantee that the transaction succeeds.
Fees
Private swap fees include:
- Railgun protocol fee — 0.25% on the input amount (taken during the transient unshield)
- Broadcaster fee — paid to the relayer
- DEX fee — built into the swap rate (shown in the quote)