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

# private swaps

*Trading without announcing your intentions.*

Trading is where privacy leaks most. A public swap announces exactly what you bought, how much, and when.

## The problem with public swaps

On a public exchange, every trade is visible: the pair, the size, the direction, and the address behind it. That exposure invites front-running and copy-trading, and it hands competitors a live view of any strategy. For a fund or an active trader, public swaps are public intentions.

## How private swaps work in Lacuna

Lacuna lets you swap one shielded asset for another without leaving the privacy of the pool. You prove, in zero knowledge, that you hold the input asset; the swap executes against available liquidity; and you receive the output as a new shielded note. From the chain's perspective, a valid swap occurred and balances were conserved — but the trader, the amounts, and even the direction of the trade stay hidden. Settlement and liquidity are handled by the protocol, so to an outside observer one private balance simply becomes another.

*Fig. 6 — A swap moves value between assets inside the pool. Validity is proven; the trader, size, and direction are not revealed.*

## What stays hidden

The trader, the size, and the direction stay private; only the validity of the swap is established on-chain. Privacy is preserved end to end — from the asset you start with to the one you hold afterward.


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.lacunalabs.io/private-swaps.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
