> 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/limit-orders.md).

# Limit orders

Place private limit orders, understand matching and fees, and cancel unfilled funds.

A limit order waits for another order that can trade within its price limit. Rome's **matcher** is the service that keeps the private list of waiting orders, called the **order book**, and pairs orders that can trade with each other. There is no public list of the orders' tokens, amounts, and prices. The matcher can read those terms.

Your **private balance** holds encrypted records called **notes**, each containing a token and an amount.

## Place an order

Connect Solflare and [set up or unlock your private account](https://docs.rome.builders/apps-on-rome/privacy-dex/swaps.md#unlock-and-back-up). Select **Limit price** on the swap card. Choose the pair's direction, the token amount to pay, and **Wallet** or **Private balance** as the payment source. You can place an order in either direction of a pair.

The limit price starts at the current market price for the chosen direction. You can edit it or select **Use market price** to reset it. Changing direction resets the limit to the market price for that direction. The price field shows how much of the payment token one receive token costs.

Set **Order lasts**, review the terms, and select **Place order**. Your wallet signs the placement. Paying from **Private balance** takes one approval. Paying from **Wallet** takes two: the first adds the exact amount to your private balance as a public deposit, and the second places the order from there. If you refuse the second approval or it fails, no order is placed. Your funds stay in your private balance. You can place the order from there. If the app cannot confirm whether the order was placed, check **Your orders** before trying again.

Placing an order moves its funds into a note owned by an address dedicated to that order. The terms you sign set the limits for trading those funds.

Paying from **Private balance** keeps the placed token and amount encrypted. Paying from **Wallet** makes a public deposit, exposing its token and amount. The price is hidden from the chain in both cases. Your address, the order's address, and the fact that you placed an order are visible.

## How matching works

The matcher considers the **best price first**, then the **oldest order** at that price. A partly filled order keeps its original place in the queue. Its unfilled funds remain at the same order address.

The **resting order** is the one already waiting in the book. The matcher uses its limit as the trade price, with rounding in its favour. A match must satisfy both orders' limits, minimum fills, and expiry. The app sets each order's minimum fill to a tenth of its amount. No single fill can be smaller, unless it takes everything left in the order. An expired order cannot match, and its funds are not returned automatically. They stay at the order's address until you cancel it.

Each match includes a proof checked by Rome's escrow program. The proof checks that each order gets at least its own limit and meets its minimum fill. It also checks the fee's published rate and destination. It does not enforce queue priority, the trade price within the two limits, or which order counts as resting and which pays the fee. Those are Rome's matcher rules. You rely on Rome to apply them and keep matching available.

## The book fee

The **incoming order** is the one matched against an order already waiting in the book. The matcher identifies which order is incoming. The book charges **0.1%**, taken from that order's proceeds in the token it receives.

The paying order's limit is checked **after the fee**. The amount it receives must still meet the minimum promised by its limit. A match that would fall below that limit after the fee cannot settle.

## Cancel an order

Find the order under **Your orders** below the swap card. Select **Cancel** and approve the cancellation in Solflare.

Only the order's owner can cancel it. Cancellation returns the remaining funds to the owner's private balance. It requires the owner's wallet signature, not permission from the matcher. A trading pause does not stop cancellation.

You can cancel an open, partly filled, or expired order to get its remaining funds back in your private balance. The order address links the cancellation to its original placement on chain. It also shows that the order still held unfilled funds when cancelled.

## What a match shows on chain

A match links both order addresses to their placements and shows the traders, the fee recipient, both expiry slots, and Rome's matcher as the fee payer. Each trader receives private proceeds.

The transaction also creates a remainder note at one order's address. Observers can tell that the other order was completely filled. The remainder note can contain zero, so its presence does not reveal whether its order is still open.

When both orders were paid from private balances, their amounts and trade price stay encrypted. A wallet-funded placement exposes information that can carry through to the match: if that order is completely filled, observers can work out what its counterparty received, allowing for the fee. If both wallet-funded orders are completely filled, their public amounts also reveal the trade price.

[What is private](https://docs.rome.builders/apps-on-rome/privacy-dex/what-is-private.md) explains what Rome and Helius can see and what you rely on them to do.


---

# 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/limit-orders.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.
