Launch app

Docs / Start here

The life of a batch

Batches run back to back from the block the contract was deployed in. Each one has a commit window and a reveal window; settlement happens after the reveal window, while the next batch is already taking orders.

The clock

On Robinhood Chain, an Arbitrum Orbit chain, block.number inside a contract returns the Ethereum L1 block number, which advances roughly every 11.4 seconds. The rollup's own blocks are much faster, but Blackpool counts in L1 blocks on purpose: a window of 16 blocks is about three minutes whatever the rollup does.

Window Blocks About
Commit 16 3 min
Reveal 5 57 s
Batch 21 4 min
Settlement deadline 26 after reveal ends 5 min

The batch number is (block.number - GENESIS) / 21. The phase is commit while (block.number - GENESIS) % 21 < 16, reveal otherwise. Both are exposed by currentBatch(), and windows(id) returns the three block boundaries of any batch.

Commit

You call commit(hash). The contract takes 1 USDG from your free vault balance as a bond and stores the hash under the current batch. You can place up to 8 commitments per batch.

Reveal

In the reveal window of the same batch, you call reveal(index, market, side, amount, limitPx, salt). If the preimage matches, the bond comes back and the order size is locked from your balance. A reveal also records a price sample for that market.

Settle

Once the reveal window has ended, anyone can call settle(batch, market). It reads the pool midpoint in that block, checks it against the batch's price samples, and either crosses the book or voids it. See Settlement.

If nobody settles

Settlement is open to anyone, and a keeper will be run for every market. If nobody settles within 26 blocks, the next call to settle voids the batch and returns every order in full. A stale batch never fills at a stale price.