Docs

An order book you sleep on.

Pillowbook is a weekly batch for Robinhood stock tokens on Robinhood Chain. During the weekend you leave a buy or a sell order. When the book closes, every order fills at one price: the first Chainlink price after the market wakes up.

How it works

Pillowbook flow Weekend orders go under the pillow until Sunday 23:45 UTC. The first Chainlink round after the close sets one price. Orders fill pro rata and everyone claims. Weekend buy with USDG sell stock tokens Book closes Sun 23:45 UTC First Chainlink round after close settle(stock, batch, round) One price P pro rata · claim Cancel any time before the close. Orders never touch the pool. No provable round within 3 days, or a scheduled corporate action near the close → void, full refund.
  1. Place. Pick a stock (NVDA, TSLA, SPY, AAPL, SPCX, MSTR). Buy by depositing USDG, or sell by depositing the stock token. You can add a limit: “won't pay more than” for a buy, “won't sell below” for a sell. Every order goes into the batch that closes next Sunday at 23:45 UTC.
  2. Wait. Until the close you can cancel and get your full deposit back. Nothing is swapped in a pool; your deposit sits in the contract.
  3. Settle. After the close, anyone can call settle with the first Chainlink round published after the close. The site shows a Settle button and our keeper calls it too.
  4. Claim. Everyone fills at that price. The smaller side fills in full, the bigger side pro rata. You claim your fill plus any refund in one transaction.

The price, and how it is proven

The price is not chosen by anyone. It is the first round of the stock's Chainlink feed with a timestamp after the batch close. The Robinhood Chain stock feeds go quiet on the weekend and wake up with the overnight session, so today that first round usually lands on Monday around 01:00 UTC. It is an overnight price: it can differ from where the regular session later opens.

The contract checks the round you pass to settle(stock, batch, roundId):

  • the round belongs to the feed's current phase, has an answer above zero, and its updatedAt is after the close;
  • the round right before it (roundId − 1, same phase) exists and its updatedAt is at or before the close, so it really is the first one after;
  • it is not the first round of a phase (then no proof is possible and the batch waits for void);
  • it is no later than close + 3 days, the stock token and feed are not paused, and no corporate action (a scheduled share-multiplier change) falls within a day of the close or the round;
  • it does not move more than 40% from the round before it. A bigger jump blocks the settle, and the batch voids after 3 days with full refunds.

Settle is possible only until close + 3 days. After that, only void is possible.

Anyone can check it: the round id is shown on every result card, and Blockscout shows the Settled event with the price.

Pro-rata example

Batch for NVDA. The first round after the close says P = $180.00.

OrderDepositLimitEligible?
Ana buys$3,000 USDGnoneyes
Ben buys$1,000 USDG≤ $185yes
Cy buys$500 USDG≤ $175no, refunded
Dee sells10 NVDAnoneyes
  • Eligible buys: $4,000. Eligible sells: 10 NVDA × $180 = $1,800. Matched: $1,800.
  • Sell side is smaller, so it fills in full. Dee gets $1,800 minus the 0.25% fee ($4.50) = $1,795.50 USDG.
  • Buy side fills 1,800 / 4,000 = 45%. Ana uses $1,350 → 7.5 NVDA (minus 0.25%: 7.48125), refund $1,650. Ben uses $450 → 2.5 NVDA (2.49375), refund $550.
  • Cy's limit was below P: full refund of $500.

Outputs round down in the contract's favour; dust stays in the batch and is swept after every order is claimed.

Limits & refunds

  • Per order: $10 minimum, $5,000 maximum. A sell is valued with the latest feed price when you place it.
  • A limit is optional. If you set one, it must be within 65% to 135% of the latest Chainlink price when you place the order. The order form shows the allowed range.
  • At most 20 live orders per wallet per stock per batch, and at most 1,000 live orders per stock per batch, so a settle always fits in one transaction.
  • Unmatched size is refunded: the part of the bigger side that did not fill, any order outside its limit, and every order in an empty or one-sided book.
  • Cancel any time before the close for a full refund. After the close, orders wait for the settle.

Void after 3 days

Settle works only until close + 3 days. If a batch is not settled by then (no provable round, a paused token or feed, a corporate action near the close, or a first price that jumped more than 40% from the one before), anyone can call void(stock, batch). Every order in that batch is then refunded in full when claimed. The site shows it as Voided · full refund.

Fees

  • 0.25% of what fills, taken from the side you receive (stock tokens for a buy, USDG for a sell). Refunds have no fee.
  • Free for holders of ≥ 1,000,000 $PILLOW, checked when the order is placed. Holder discount starts at launch.
  • Fees collect in the contract and anyone can send them to the fixed fee address with collectFees(token).

Not audited

The Pillowbook contract and this server have not been audited by a third party. The contract was tested with unit, fuzz and mainnet-fork tests, and it has no owner that can move deposits, no proxy and no upgrade path. Use amounts you are fine losing.

Risks

  • Empty or one-sided book. If nobody is on the other side, nothing fills and everything is refunded.
  • Overnight price ≠ regular-session open. The settle price is the first Chainlink round after the close. It can be far from Friday's close and from where the regular session opens later.
  • Stock tokens are not shares. They are tokens issued on Robinhood Chain that track a stock. The issuer can pause or freeze them, and that can delay a settle or force a void.
  • Price jump guard. If the first round after the close moves more than 40% from the round before it, the settle is blocked. Nothing fills that week, and the batch voids after 3 days with full refunds. Your money stays locked until then.
  • Oracle risk. The price comes from Chainlink feeds. A wrong round would settle at a wrong price; the proof only checks timing.
  • Smart-contract risk. Not audited (see above).
  • The pool comparison is an estimate. It uses the current pool liquidity in one tick range and ignores the rest.

Contract

Pillowbook on Robinhood Chain (4663)

posted here when the contract is live

Stocks, feeds and USDG are fixed in the constructor. Prices are in feed units (8 decimals), USDG has 6 decimals, stock tokens 18.

For agents

Machine-readable state: /api/book.json (refreshed every minute). Instructions and a short ABI: /llms.txt.