> For the complete documentation index, see [llms.txt](https://docs.rome.builders/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rome.builders/apps-on-rome/privacy-dex/swaps.md).

# Swaps and the private balance

Swap with Rome's market maker and manage your private balance.

A market swap on the swap card exchanges USDC for SOL on Solana devnet. Its [**Limit price** option](https://docs.rome.builders/apps-on-rome/privacy-dex/limit-orders.md) places orders in either direction.

Your **private balance** holds encrypted records called **notes**, each containing a token and an amount. Before swapping, connect Solflare and [set up or unlock your private account](#unlock-and-back-up). Select **Market** on the swap card and enter the USDC amount you want to pay. The **From** switch chooses whether the USDC comes from your wallet or your private balance. The SOL you receive goes into your private balance in either case. Settings lets you choose a default payment source.

## Quotes and approval

The displayed market price is an estimate. Rome's **market maker** supplies the tokens you trade for. Select **Swap** to request a **firm quote**: signed terms for your swap, including the amounts, fee, and expiry. The maker reserves funds for that quote. The browser checks those terms against the trade shown to you. Review the quote, then select **Swap** again to approve the trade in Solflare.

A firm quote lasts **180 slots**, about **43 seconds on Solana devnet**. Slots are Solana's units of time. The countdown uses the quote's expiry slot and the measured slot time. It ends a few seconds before the quote expires so the app does not ask you to sign a price that is about to run out. If the quote expires, select **Get new price** before trying again.

Solflare asks you to sign the transaction that pays for and settles the swap. Larger trades can require the maker's final approval. The **Price** row then says **Checked again when you swap**. For those quotes, you sign first, and the maker re-checks the price. It then co-signs and submits the transaction or declines it.

Rome's escrow program checks the quote and a proof that the trade follows its terms. Helius Privacy checks a separate proof that the private transaction is valid and updates the notes. The app confirms the transaction and decrypts the received note before showing the swap as filled.

## Pay from your wallet

An **entry swap** pays USDC directly from your connected wallet. You do not need to add that USDC to your private balance first. The payment and the private SOL receipt settle together in one transaction.

Your wallet address, the USDC, and the payment amount are public on Solana. The received note is encrypted, but the available pair identifies SOL as the receive token, and the public payment helps observers estimate its amount.

## Pay from your private balance

A **private swap** spends private USDC and receives private SOL. Neither amount is published as a public payment or withdrawal. Your address and the maker's address remain visible.

The swap needs a private note containing exactly the amount you pay. If necessary, the app first prepares that note with a private transfer to your own account, before requesting the firm quote. That preparation can require a separate wallet approval.

If settlement fails, the swap's token transfers are reversed. The network fee can still be charged. If confirmation is uncertain, check your balances and the transaction before trying again.

## Add, move, and send

**Add to private balance** deposits a token from your wallet without exchanging it. Your address, the token, and the amount are public at this step.

**Move to wallet** withdraws to a public wallet address. The destination defaults to your connected wallet. The destination, token, and withdrawn amount are public.

**Send** transfers privately to a recipient with a registered private account. The sender and recipient addresses are visible, while the token and amount are encrypted. Sending to an unregistered recipient requires separate confirmation of a public withdrawal that reveals the token and amount.

These actions use Helius Privacy directly and do not need a maker quote. Your wallet signs each transaction. Each confirmation links to the transaction in the Solana explorer.

## Activity

Activity combines your decrypted transaction history with your swap attempts. It labels added funds, swaps, vault put-ins and take-outs, limit orders placed, filled and cancelled, sends, receipts, withdrawals, and unsuccessful attempts. Use the transaction link to check the result on Solana.

## Unlock and back up

Connect Solflare and set up or unlock your private account. Signing the unlock message derives your private account's keys in your browser. The viewing key lets you read your private balance and activity. The nullifier key lets you recognise when your notes have been spent. Signing this message spends no funds, but anyone with the signature can read your private balance and activity. Only sign it on the Privacy DEX site. First-time setup also asks you to publish your private account's public keys in a registration transaction, which costs a network fee. Unlocking returns you to the page you were using.

The app's sign-in message is separate from the key-derivation message. It establishes a session and does not authorize a payment. Settings includes **Lock** and controls to show or restore a backup.

The optional **48-word backup** restores your viewing and nullifier keys. Anyone with these words can see your private balance and activity. Keep them as private as your wallet's recovery phrase. It does not replace your wallet or authorize spending without it. The same wallet can derive the private keys again when you unlock. Keep your wallet's recovery phrase safe: losing access to that wallet means losing access to the funds, and Rome cannot recover them for you.

See [What is private](https://docs.rome.builders/apps-on-rome/privacy-dex/what-is-private.md) for what Rome and Helius learn during these actions.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.rome.builders/apps-on-rome/privacy-dex/swaps.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
