How a batch works
The clock
Batches are counted in blocks from the block the contract was deployed in. With Elysium's 100 ms blocks, 250 blocks of commits take about 25 seconds and 50 blocks of reveals about 5 seconds. The board shows the countdown it extrapolates from the latest block.
Commit
commit(market, hash) where the hash is keccak256(trader, market, batchId, buy, size, limit, remainderToPool, salt). The market is public; nothing else is. Each commit also adds a sample of the pool price to the batch.
Reveal
In the reveal window you send the same fields and the salt. The contract checks the hash, returns your bond, and locks the funds the order needs. An order whose limit is worse than the cross price is left out and nothing is locked.
Settle
Once the batch has ended, settle(market, batchId) crosses buys against sells at the cross price. The smaller side fills completely; the larger side fills pro-rata to size. The order of transactions inside the batch has no effect on price or fills.
