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.
| Step | What happens | Who does it |
|---|---|---|
| Open | Orders are placed and cancelled. Each one is folded into the batch's input hash. | Traders |
| Seal | The window has ended and the batch has orders. The input is fixed and the next batch opens. | Anyone; the keeper by default |
| Clear | A solver posts one price per token. The program locks bond equal to the value the batch moves. Orders settle from this moment. | A solver |
| Prove | The 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.
Four ways in
| You | You do | You get | Start at |
|---|---|---|---|
| Trader | Place an order: sell this much of one token for another, at this limit or better | The cleared price, the same as every other order in the batch | Quickstart |
| Liquidity provider | Place liquidity on a pair over a price range | The pair's liquidity fee, and liquidity that trades only at the cleared price | Add and remove liquidity |
| Staker | Stake SOL or a liquid staking token behind a solver | A share of that solver's clearing fees | Stake behind a solver |
| Solver | Run the node that clears and proves batches | The clearing fee of every batch you prove | Register 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
| Part | What it is |
|---|---|
| The program | One Solana program, una. It holds the vaults, the orders, the positions, the stake and every batch. Program reference |
| The guest | A Rust program for the SP1 zkVM that checks a clearing against the four conditions. The guest program |
| The solver node | The software a solver runs. It reads each sealed batch, solves it, posts the clearing and proves it. Run the node |
| The API | Batches, 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 |