OpaqueApp

Docs/Protocol

Cross

The midpoint batch venue.

Cross settles trades between Opaque accounts without an order book and without moving a token.

Design

  • Sealed orders. An order is a commitment to (market, batch, side, size, funding note, limit) sent through the relayer. Nothing about it is visible until the batch has closed, and nothing links it to a wallet.
  • External price. Each batch takes its price from the open market at the moment it closes: the market's keeper quotes the pair both ways through Jupiter, in raw units, and posts the midpoint. Participants cannot influence the price, and there is nothing to sandwich.
  • Batches. A five-minute commit window, then a one-minute reveal window, then settlement. Only the market's price authority closes a batch, and only with a price; a pair that cannot be quoted leaves the batch open.
  • Settlement inside the pool. Fills are paid out as new notes. Tokens never leave the vault, so the pool's public balance does not change and the fill is not visible as a transfer.

Lifecycle

  1. commit(hash) during the window, relayed. The commitment is an account; its rent goes back to the relayer on reveal.
  2. close(price) after the window, by the price authority: fixes the price, opens the next batch.
  3. reveal(order, proof) during the reveal window, relayed: proves the funding note exists and belongs to the revealer, that it holds enough for the order, and that the order's limit admits the batch price. The limit itself stays private. The note is spent here and the order is sealed to the audit key.
  4. settle(): matches revealed orders, pro rata on the heavier side.
  5. claim(order) by anyone: computes the two payout notes (what the order received, and what was not used) for the order's one-time owner and inserts them into the tree. Opaque's keeper claims every settled order.

An unrevealed commit is a free cancel: nothing was spent. Because the price is external, this gives no more optionality than the limit price already does.

What is public

A revealed order shows its side, its size and the amount of the note that funded it, under a one-time owner key that is never used again. It does not show the limit, and it does not show who placed it: the reveal is sent by the relayer, and the one-time key does not link to the account or to any other order. Per batch, the tape shows the asset, the price and the quantity that crossed.