Start

What Una is

An exchange on Solana that clears its whole market as one computation each batch, at one price per token.

Una is an exchange, its liquidity, the stake behind it and the public record of every batch, as one Solana program. Orders collect in the open batch for one batch window, 10 slots, which is 2 seconds. When the window ends, every order and every liquidity position clears together at one price per token. A batch with no orders stays open until one arrives.

A batch

Everything in Una happens to a batch. It opens, collects orders, seals, clears and is proven.

A dot is an order. A line is the cleared price. The band behind the line is the solver's bond, and the line alone is a proven batch.
StepWhat happensWho does it
OpenOrders are placed and cancelled. Each one is folded into the batch's input hash.Traders
SealThe window has ended and the batch has orders. The input is fixed and the next batch opens.Anyone; the keeper by default
ClearA solver posts one price per token. The program locks bond equal to the value the batch moves. Orders settle from this moment.A solver
ProveThe solver's zkVM guest proves the clearing. The program verifies the proof, records each token's price as its last proven price, releases the bond and pays the clearing fee.The solver, or anyone holding the proof

The proof window is 300 slots, about 60 seconds, counted from the clearing.

Once a batch is proven and its orders are settled, its account on chain is closed. Its record stays in the API and on its page at /batches/[id].

One price per token

A batch's result is a price vector: one price for each token in the batch, in SOL. An order selling token A for token B trades at the ratio of the two prices. Every order in the batch that sells A for B gets that same ratio, whichever arrived first.

Because the price is per token, an order from A to C fills when the batch balances in A and in C. It needs no counterparty selling C for A. The tokens other orders and positions bring carry it across.

How fills are decided follows one order through the arithmetic.

Bonded, then proven

Between Clear and Prove a batch stands on its solver's bond.

The bond is stake: SOL and liquid staking tokens that stakers place behind a solver. When the proof verifies, the same stake is free to back the next batch.

If no proof verifies before the deadline, anyone can slash the batch. The locked bond moves to the batch's cover, and the owners of the batch's orders and positions claim it.

A batch whose proof never lands ends slashed, and its bond becomes cover.

Four ways in

YouYou doYou getStart at
TraderPlace an order: sell this much of one token for another, at this limit or betterThe cleared price, the same as every other order in the batchQuickstart
Liquidity providerPlace liquidity on a pair over a price rangeThe pair's liquidity fee, and liquidity that trades only at the cleared priceAdd and remove liquidity
StakerStake SOL or a liquid staking token behind a solverA share of that solver's clearing feesStake behind a solver
SolverRun the node that clears and proves batchesThe clearing fee of every batch you proveRegister and bond

A developer reaches all of it through the SDK, where one call, una.swap, places an order. See the SDK quickstart.

The parts

PartWhat it is
The programOne Solana program, una. It holds the vaults, the orders, the positions, the stake and every batch. Program reference
The guestA Rust program for the SP1 zkVM that checks a clearing against the four conditions. The guest program
The solver nodeThe software a solver runs. It reads each sealed batch, solves it, posts the clearing and proves it. Run the node
The APIBatches, orders, positions, pairs, prices, solvers and stake, and transactions built for a wallet to sign. API reference
The SDK@una/sdk, the API as typed calls. SDK reference

Where next