How Bookend works
Bookend is one contract on Robinhood Chain, the BookendBook. You park a Stock Token in it with a take-profit above today's price, a stop-loss below it, or both. The first one Chainlink reaches sells the whole position to USDG; the other side goes with it.
The bookend
- Token and amount: any of the 27 listed Stock Tokens, at least $5 worth.
- Take profit: a USD price above today's Chainlink price, or none.
- Stop loss: a USD price below today's Chainlink price, or none. At least one side is required.
- Opening a bookend carries 0.0001 ETH, forwarded at once to the keeper for gas.
The exit
Once Chainlink is at or past either side, anyone may call exit(id). The book sells the whole position on Uniswap, receiving at least 97% of its Chainlink value, pays the caller 0.10 USDG and the treasury 0.1%, and sends the rest of the USDG to you. The record of the exit (side, price, amount) stays on chain.
If the pool would fill worse than 3% under Chainlink, the call reverts and the bookend stays open, to be tried again.
The keeper
A keeper checks the book every two minutes with the due() view and runs what is due. It pays its gas from the 0.10 USDG fees, swapped to ETH when it runs low. Anyone else may run a due exit and earn the same fee.
Your control
move(id, takeProfit, stopLoss): new prices, still on the right sides of today's price.cancel(ids): the parked tokens come back, any time.- The owner can list tokens, set routes and tune fees within hard limits (fee at most 1 USDG, cut at most 1%, slippage at most 8%). There is no function that moves parked tokens.
Prices and gaps
The Chainlink adapter already used on Robinhood Chain by other order books: tokenized-equity feeds, 8 decimals, rejected when stale or while the token's own oracle is paused. Feeds stop between sessions: a gap through your stop sells at the first price after it.
Risks
- A stop is not a guaranteed price: it sells at the Chainlink price when it runs, within 3%.
- Thin pools can keep an exit waiting.
- The contract is unaudited. It is tested on a fork of Robinhood Chain mainnet against the live pools and feeds.
Contracts
| BookendBook | deploys at launch |
| Chainlink price adapter |