Outside Fill
A pool fills part of a swap from an outside venue when the venue beats it, and keeps its own liquidity: what it does, what was measured and what it costs.
On this page
Outside Fill lets a pool fill part of a swap from an outside venue when the venue gives the trader more than the pool does, and keep its own liquidity. It is a Hook Block coming with the next core, so no pool can place it yet.
What it does
On a swap where the trader sets how much to pay in, the hook asks the pool's venue module first. When the venue beats the pool, part of the swap fills there and the pool fills the rest from its own liquidity. A swap that sets the amount to receive fills from the pool alone.
The pool keeps its liquidity and its other Hook Blocks. The take and Wallet Cap count the outside part (measured on a fork of Robinhood Chain); King of the Pool and Auto Burn are built to count it too and are in the next test gate. LP fees apply to the pool's part only.
The take is the creator fee, the royalty and the Hookr minimum. Arb recapture is on by default for these pools, as for every new pool.
Measured against a zero-liquidity wrapper
A wrapper is a pool with no liquidity of its own that only trades the outside venue. These figures were measured on a fork of Robinhood Chain at block 95,533,000: a 1,000 USDG buy on the live Ramses V3 WETH/USDG pool, with steady swaps after a warm-up.
| Route | WETH out |
|---|---|
| Uniswap's wrapper of the venue | 0.418133 |
| Outside Fill | 0.418552 |
| Outside Fill with a 1% take and Wallet Cap | 0.414367 |
Outside Fill returned 0.10% more than the wrapper, before the pool's take. A take on the pool lowers what the trader receives, which is why the gap is stated before it. Outside Fill uses more gas than the wrapper for the same buy.
What it costs a swap
On a fork of Robinhood Chain, on the next core's root with a 1% take, a swap the venue does not beat costs about 21,400 gas more than the same swap with no outside fill (180,831 against 159,429). A swap the venue fills costs 292,126 gas against 159,429, which includes the swap on the venue. Neither is measured on a live root yet.
Venues
- The first venue is Ramses V3, with native ETH.
- Any other venue comes in through one module interface. A venue module is a small contract that quotes the venue and fills from it.
- A hook takes one venue module, picked when the hook is built. Hookr admits each module by its code hash, and a module has no owner.
- Revoking a module stops new hooks and new pools from taking it. Pools that are open keep it.
What you take on
- A fault in the module itself, not the venue, would stop exact-input swaps on that hook's pools until a new hook, since the module is fixed with the hook and nobody can pause it.
- The venue's price can move between a quote and the swap, and the pool's price check bounds how far.
- A pool that uses dynamic fees prices its fee on the whole swap as if the pool filled it, which overcharges the pool's part.
Fee
Outside Fill charges no fee on top of the pool's own. The outside part pays the pool's take at the same rates as the pool's part, and the venue's own fee is already inside its price. LP fees apply to the pool's part only, so the outside part pays them nothing.