How Darkhood works
Overview
Darkhood runs sealed batch auctions for Robinhood Chain tokens, priced in ETH. Traders seal their orders as hashes, so the side, the size and the limit stay private while a batch is open. When the sealing window closes, the batch takes its price from the token's own Uniswap pool. Then the orders open, and the buys and sells that meet are filled at that single price.
Everything runs onchain in one contract. Settlement needs no operator and anyone can trigger it; our keeper runs it for each batch that has orders.
A batch, second by second
- 0 to 25 s, seal.
commit(market, batch, hash)stores only the hash. A trader can seal as many orders as they like, in any market. - At 25 s, price. The first reveal fixes the batch price and depth from the pool. From that moment the price is final for the batch.
- 25 to 30 s, reveal. The order's fields and salt are sent and checked against the hash. The funds the order needs are locked.
- From 30 s, cross.
settle(market, batch)matches buys with sells at the batch price. When one side is larger, the smaller side fills in full and the larger one shares what is left by size.
Batches are counted in seconds from the contract's deployment, 30 seconds each. The order of transactions inside a batch has no effect on the price or on who fills.
The batch price
Each market reads one Uniswap pool that pairs the token with ETH or WETH.
- Uniswap v3: the mean tick of the pool's own oracle over the 25 sealed seconds. The oracle stores the price as each second closes, so a swap and a swap back inside one transaction leave it unchanged.
- Uniswap v2: the pair's cumulative price from the first seal of the batch to the moment the price is fixed, at least eight seconds apart.
- Uniswap v4: the median of the keeper's readings during the sealed seconds. The batch crosses with three readings or more; with fewer, every order returns to its owner with its bond.
The depth of a batch is the ETH it takes to move the pool's price by 2%, measured both ways across the pool's liquidity ranges, taking the smaller side. One order can be up to five times that depth.
Orders, reveals and bonds
A buy states the ETH to spend and the highest price accepted. A sell states the tokens to sell and the lowest price accepted. An order whose limit does not reach the batch price stays out of the batch and locks nothing.
The taker bond
Every taker seal carries a bond of 0.0002 ETH from the dark balance. It comes back with the reveal. A seal that is not opened by 30 seconds keeps its bond, and the bond goes to the $DHOOD buy and burn. The rule exists so that sealing both sides and opening only one costs something.
Revealing
Anyone holding an order's fields and salt can send its reveal, and the funds always stay with the trader named in the hash. The site keeps the salt in your browser and opens the order for you at 25 seconds. A reveal helper key in the same browser can send that transaction, so no wallet prompt is needed inside the window. The helper only pays gas.
The rest of an order
With routing on, whatever is left of an order after the cross is swapped on the market's pool after settlement, inside your limit, for up to two minutes. Without routing, or if you return it yourself, it goes back to your dark balance.
What is visible
- Dark balances, readable per address onchain.
- That an address sealed an order, and in which market.
- Side, size and limit only from the reveal, when the price is already fixed and the batch takes no new orders.
- Fills, after the batch settles.
Markets and listing
Anyone can list a market: a token, a venue and the pool. The pool must pair the token with ETH or WETH on the Uniswap v2 or v3 factory or the v4 PoolManager on Robinhood Chain, and take at least 0.05 ETH to move 2%. Coins and stock tokens both list the same way.
Makers and $DHOOD
$DHOOD is the maker stake. A maker with at least the minimum stake seals without a taker bond and shares 40% of each week's fees by the ETH notional it filled. An order a maker seals and does not open costs 2% of its stake, burned. Unstaking takes seven days. Takers trade with ETH and the token alone.
Fees
Each side pays 0.05% of what it filled, 0.10% for a matched pair, in ETH at settlement. 40% goes to staked makers, 50% buys $DHOOD on its pool and burns it, and 10% goes to the protocol. Bonds kept from unopened seals join the burn. Routed remainders trade on the pool and pay its LP fee only.