Contract reference
Solidity 0.8.28, no proxy, no external dependencies beyond a 512-bit mulDiv. Source in contracts/src/Blackpool.sol.
Traders
| Function | Phase | Notes |
|---|---|---|
deposit(token, amount) |
any | USDG or a listed stock |
withdraw(token, amount) |
any | free balance only |
commit(hash) → (batch, index) |
commit | takes the 1 USDG bond |
commitSealed(hash, ciphertext) → (batch, index) |
commit | same, plus the order timelock-encrypted (v2) |
reveal(index, market, side, amount, limitPx, salt) |
reveal | locks the size, returns the bond |
stake(amount), unstake(amount) |
any | once the stake token is set |
claimRewards() |
any | credits USDG to your vault balance |
Anyone
| Function | When |
|---|---|
settleWithReveals(batch, market, reveals) |
after the reveal window: keeper for the first 13 blocks, anyone after (v2) |
settle(batch, market) |
same window, no encrypted orders to open |
poke(market) |
any time, once per L1 block per market |
collectForfeits(batch) |
after the settle window (26 blocks), once per batch |
applyFee() |
48 hours after queueFee |
Views
| Function | Returns |
|---|---|
currentBatch() |
batch id and phase (0 commit, 1 reveal) |
windows(id) |
commit start, reveal start, reveal end |
commitmentOf(...) |
the hash to commit |
midPrice(market) |
USDG raw per 1e18 share raw |
markets(id), marketsLength() |
market config |
orders(batch, market) |
the revealed book |
tape(batch, market) |
samples, status, settlement price, matched USDG |
refPx(market), refBatch(market) |
reference price and the batch that last refreshed it (v2) |
keeper(), PRIORITY_BLOCKS() |
settlement priority holder and its window (v2) |
balanceOf(trader, token) |
free vault balance |
pendingReward(who) |
unclaimed USDG |
Events
Committed, Revealed, Sampled, Settled, Voided, Fill, Deposit, Withdraw, FeesDistributed, plus the admin events.
