One order, ten minutes, 4,380 blocks.
$1,000,000 of HYPE to sell. Sold in one go, it would sink an $8M pool by 36%.
Simulation of an $8M pool with a 0.05% fee, about 60 times faster than real time.


Stream is a Uniswap v4 hook on Elysium. It pours a large order into the pool one slice per block, every 0.137 seconds, and lets arbitrageurs refill the pool from Hyperliquid in between.
$1,000,000 of HYPE to sell. Sold in one go, it would sink an $8M pool by 36%.
Simulation of an $8M pool with a 0.05% fee, about 60 times faster than real time.
The same order three ways, on the same pool, against the same arbitrageurs and the same Hyperliquid price. Each line shows how far under Hyperliquid the pool trades while the order runs.
With slices this small, the cost stops depending on the size of the order. It settles near the pool's fee plus what an arbitrageur pays on Hyperliquid: about 15 bps, whatever you sell.
When one order sells HYPE while another buys it, Stream runs both against the pool at the same time. Most of them trade with each other at the pool's price, and only the difference moves it.
Over the minute the pool moves 231 bps. Had the sellers streamed alone, it would have moved 1,347 bps. The hook gets there in one step, with the closed-form TWAMM formula.
Everything the hook does, and how a contract or a wallet talks to it. This is the design: nothing is deployed yet.
An order is an amount, a side and an end block. From the next block on, it sells amount ÷ blocks left in every block until it ends.
Stream counts Elysium blocks through ArbSys. On Elysium block.timestamp moves once a second and block.number is the parent chain's, so neither can count 0.137-second blocks.
Nothing executes by itself. The first transaction that touches the pool settles every block owed since the last touch, then runs. Anyone may also call settle.
Opposite orders trade with each other first, at the pool's price, through the TWAMM closed form. Only the difference moves the curve.
End blocks snap to a grid of 8 blocks, about 1.1 seconds. A settlement takes one step, plus one per grid line where an order ended. A bitmap skips the empty ones, so an idle hour costs no more than an idle block.
Claim what an order has earned at any time. Cancel at any time: what hasn't sold and what has been earned come back in the same transaction.
One block risks one slice. Pushing the price against a stream for a block wins at most that slice, and the next arbitrage takes the price back. The smaller the block, the smaller the prize.
The pool's own fee on every slice, as for any swap, plus 1 basis point of each order's output to Stream.
The exponential and the square roots are written in Rust for Stylus, where they cost a fraction of the EVM version. Elysium has Stylus activations paused today, so the first release runs the same math in Solidity and switches when they open.
// Stream — a Uniswap v4 hook for Elysium (interface draft)interface IStream { struct Order { address owner; uint64 endBlock; // Elysium block (ArbSys), on the 8-block grid bool zeroForOne; // true: sell currency0 for currency1 } /// Start streaming amountIn from the next block until order.endBlock. function submit(PoolKey calldata key, Order calldata order, uint256 amountIn) external returns (bytes32 id); /// delta < 0 sells less (cancel = everything left), delta = 0 only claims. function update(PoolKey calldata key, Order calldata order, int256 delta) external returns (uint256 earned, uint256 returned); /// Settle every owed block up to now. Swaps and liquidity changes call it first. function settle(PoolKey calldata key) external; function status(PoolKey calldata key, bytes32 id) external view returns (uint256 sold, uint256 earned, uint256 left, uint64 endBlock);}

For a fund leaving a position, a protocol buying back its token every day, a team selling an unlock over a month, a vault that buys HYPE every block.