Skip to main content
Z Trade is a private trading venue where users can swap assets without revealing their identity, the trade amounts, or the asset pair to outside observers. The venue is implemented as a set of contracts on Z, with the RelayAdapter pattern providing the privacy bridge between the ShieldedPool and the public AMM execution. This page describes how Z Trade works for users, how liquidity provision works, and the privacy properties the venue achieves.

How privacy-preserving trading works

A standard Z Trade swap follows this path:
  1. User constructs a swap intent. The intent specifies the input asset, the input amount, the output asset, and minimum acceptable output (slippage protection). The intent is encoded as parameters to a RelayAdapter call, and the user generates a zero-knowledge proof binding the intent to a shielded input note.
  2. Transaction submission. The user (or a Broadcaster on their behalf) submits the transaction. The transaction calls the Z Trade RelayAdapter with the intent and the user’s proof.
  3. Unshield. The RelayAdapter unshields the input asset from the ShieldedPool into the adapter’s transient public balance.
  4. Execute swap. The adapter calls the Z Trade execution contract, which performs the swap against available liquidity. The execution contract sees a normal-looking swap from the adapter; it does not see the user.
  5. Reshield output. The adapter takes the output asset and reshields it back into the ShieldedPool as a new note belonging to the user.
  6. Atomicity. Steps 3 through 5 are atomic. A failure at any step reverts the entire transaction, leaving the user’s shielded balance unchanged.
From the outside, an observer sees: a transaction calling the Z Trade adapter, the adapter touching the swap execution contract, and a new ShieldedPool commitment being created. They cannot determine which asset was swapped, the amount, or the user. The user’s wallet (the on-chain transaction originator) is also private when the transaction is submitted through a Broadcaster. The Broadcaster’s wallet appears as the originator on-chain; the actual user is hidden inside the proof.

Asset support

Z Trade supports the asset set of the ShieldedPool. This includes USDC and other ERC-20 stablecoins and tokens bridged to Z. The complete supported-asset list is maintained on the Z Trade dashboard.

Liquidity provision

Liquidity for Z Trade execution comes from two sources:
  • Native liquidity pools. Standard AMM pools deployed alongside Z Trade. Liquidity providers can supply assets to earn fees from swaps.
  • (In future) Routed external liquidity. Where direct pools are not deep enough, Z Trade can route through external AMMs on the same chain. The routing will happen inside the adapter; the user will not be able to see the path.
Liquidity provision is not itself private. LPs supply assets to public pools and earn fees in the open. Privacy is on the swap side, not the provision side. Future work targets adding private LP positions.

Pricing and slippage

Swap pricing follows the underlying AMM mechanics. Slippage protection is enforced inside the user’s zero-knowledge proof: the swap can only execute if the output meets the user’s minimum, otherwise the transaction reverts and the user’s input note is preserved. This is a hard guarantee, not a best-effort one. The cryptography enforces it. Fees: Z Trade charges a standard swap fee that is paid out of the user’s input. The fee is included in the proof and is paid to the protocol; a portion goes to liquidity providers as is standard for AMM markets.

Composing Z Trade with inference

An agent can issue a Tier 3 or Tier 4 inference against a market analysis prompt, act on the model’s output, and use the Z Trade RelayAdapter to execute privately. The ShieldedPool makes the agent’s positions private; the trust tier on the inference makes the agent’s reasoning auditable in its operational logs; the RelayAdapter makes the execution unlinkable. See Agent Patterns → Automated Finance for worked examples.