Start

First private swap

This page takes you from a public wallet to a swap on Jupiter that your wallet is not part of. You enter with USDC, run jupiter.swap, and end with SOL in your private balance. It takes a few minutes in the app, or about ten lines with the SDK.

What you need

  • A Solana wallet holding the asset you want to swap. The examples use USDC.
  • A little SOL in that wallet for the network fee of the one transaction it signs.

Your wallet signs twice in total: one message to unlock, and one transaction to enter. The swap itself is submitted by a relayer.

The steps

  1. Connect and unlock

    Open Balance and press Connect wallet. Then press Unlock. Your wallet signs one message, and the keys to your notes are made from it in the browser.

  2. Enter

    Press Enter. Leave From on Your wallet, pick USDC under Asset, and type an amount. The panel on the right shows what will go into your private balance and what the chain will show. Press Enter and approve the transaction in your wallet.

    The screen follows it: Build the transaction, Sign in your wallet, Submitted, In your private balance. When it reads You are in, the USDC is a note in your balance.

  3. Open the swap

    Back on Balance, under Run a hook, press Swap. It opens the run screen for jupiter.swap.

  4. Read the quote

    Pick USDC as the asset in, type an amount, and pick SOL as the asset out. Slippage starts at 0.5%.

    The quote shows what you receive into your private balance, with the expected out, the minimum out, the run fee, the relayer's fee and the route. Under What the chain will show it lists the hook, the address that submits the run, and that your wallet is not in it.

  5. Run

    Press Run. Your wallet is not asked for anything. The screen follows three stages: Making the proofs, Relayed, Confirmed.

    At Done, the SOL is a new note. Balance shows it, and Activity lists the enter and the run with their transactions.

What just happened

The swap was one transaction. Inside it the Pook program verified your proof, spent your USDC note, called Jupiter with exactly the route the quote resolved, checked that at least the minimum out came back, took the fees and deposited the rest as a new note that only you can spend. Had any of those steps failed, the whole transaction would have failed and your USDC note would be as it was.

Open the run in the run feed to see what the chain recorded: the hook, the amounts, the relayer. Your wallet appears in the enter, and nowhere after it.

Where to go from here