Skip to content

Swap privately ​

A private swap trades a note for another asset without leaving the pool. You spend a SOL note and get a new VEILIX note, or the other way round. On devnet, SOL and VEILIX are the only pair.

Before you start ​

  • Connect your wallet. The app seals the new note for it, so a later scan finds it again.
  • You need an unspent SOL or VEILIX note. If you have none, deposit first.

Steps ​

  1. Open the Swap tab.
  2. Under From note, pick a note. Notes are listed by amount and number, never by their place in the tree. To use a note you saved yourself, choose Paste a note… and paste the full vx2- string.
  3. Check the Amount. It starts as the whole note, and the app warns you: The whole note. Swapping part of a note hides better, because a whole note’s amount can be matched to the deposit that made it.
  4. If a SOL note has earned mining rewards, the app offers Collect first. Collect, then swap the renewed note. A spent note loses its reward.
  5. To shows the asset you will get.
  6. Pick the Max slippage: 0.5%, 1%, or 2%. It is 1% unless you change it.
  7. Read the quote: Expected, Minimum received, Relayer + protocol fee, Network fee, Price impact, and DEX fee. The quote refreshes every 15 seconds.
  8. Press Swap privately. Your device makes the proof, which takes a few seconds. Keep the tab open.
  9. When Swap complete appears, save the Swapped note. If you swapped part of a note, also save the Remaining note. Both appear in Secret Notes once the indexer catches up.

What it costs ​

The fee comes out of the note you spend, in its asset: the 0.15% protocol fee, the relayer’s rate of at most 0.1%, and a network fee for the relayer’s SOL costs. The exchange pool’s own trading fee, shown as DEX fee, is inside the price. Your wallet pays nothing and signs no transaction.

What can stop a swap ​

  • This pool is too small for that amount. The app refuses a swap whose price impact is above 10%: you would get more than 10% less than the pool’s current price. It offers a smaller amount instead, with a Swap … instead button. A price impact above 3% is marked high.
  • The price moved past your limit. The whole swap undoes itself on chain, and nothing is spent.
  • That amount is too small to cover the fees.
  • No swap pool yet. USDC notes are listed but cannot be picked: on devnet, swaps cover SOL and VEILIX only.
  • Connect your wallet so the swapped note can be backed up. The swap needs your wallet connected, to seal the new note.

What the chain shows ​

Everyone can see that a swap happened, when, both amounts, the pool, and the fee. Nobody can see which note paid, or who holds the new note.

The new note’s amount is public, because the swap shows how much came out. Leave it in the pool for a while. When you withdraw it later, take a different, round amount.

In Veilix Wallet ​

Open Vault, then Swap. The wallet’s Price limit offers 0.5%, 1%, 2%, or 5%, and starts at 1%.

The full explanation is on Private swap.