Concepts

How a batch works

A batch is one sealed auction. It has three phases with deadlines fixed when the batch opens; the batch clock on the market page reads them from the batch account and counts down on the chain's clock.

Commitsealed hashes and bondsRevealorders open, funds lockClear windowcrank with a Pyth priceClaimby the workercommit endreveal endclear deadline
Commit phases never overlap: the next batch opens once this one's commit phase ends, so its commits run while this batch reveals and clears.

Commit

You post a commitment, a sha256 hash of your order, together with a bond in SOL. The bond is the same for every buy and sell, and a commit moves no tokens, so nothing in it says which side you are on or how large the order is.

domain14 Bside1 Bdiscount2 Bsize8 Bsalt32 Bowner32 Bbatch32 Bsha256 → 32-byte commitment
Outlined in heat: the fields that stay in your browser until reveal. Owner and batch are public; the salt makes the hash impossible to guess.

The salt is 32 random bytes made in your browser. It never goes to Thaw's API. Without it, nobody can open the hash or test guesses against it.

Reveal

After the commit phase ends you reveal: the transaction carries your side, discount, size and salt. The program recomputes the hash and checks it matches, then checks your free balance covers the order and locks it:

  • a sell locks the shares it offers;
  • a buy locks enough USDC to pay for its size at the worst price its discount allows. That price uses a cap fixed when the batch opened, a set buffer above the opening Pyth price. You pay the clearing price; the rest unlocks when the order settles.

The revealed size is added to the batch's histogram at your discount.

Clear

After the reveal phase, anyone can crank the clear with a fresh, verified Pyth SPCXx price. The program finds the clearing discount d* in one pass over the histogram. See Clearing and d*.

If no valid price arrives before the clear deadline (the price is stale, too uncertain, or above the batch's cap), the batch is cancelled and every revealed order unlocks unfilled.

Settle

Each revealed order then settles against the batch's result in constant time. Filled amounts move between balances inside Thaw; no tokens leave the vault. Your bond comes back with the order account's rent.

A commit that was never revealed forfeits its bond to the market treasury.

One batch after another

A new batch opens once the previous commit phase has ended. Commit phases never overlap, so the commits of one batch run while the previous batch reveals and clears.