# Keepers and bots

A revenue token's income reaches its holders when someone calls `sync()`. Anyone can, at any time, and the caller is paid the token's tip. A token works without a keeper, since a holder or the token's page can sync too; a keeper is whoever syncs first when the doors hold enough to pay the tip.

## The tip

- `tipBps()` of the ETH the pulled doors deliver after Hookr's leg, fixed at the mint and at most 1%. The app mints every token with 1%.
- Paid only when the doors deliver at least `MIN_TIP_PULL()`, 0.001 ETH.
- Never paid on a bonus or on ETH that was already in the token: a plain send, or what an outside door pushed between syncs.
- Paid to the caller, `msg.sender`, in ETH. A keeper that syncs through a contract of its own must be able to take ETH there.
- `sync()` gives back the tip, so an `eth_call` of it says what a sync would pay now; make it from an address that can take ETH, since a caller that refuses it (Multicall3 does) makes any sync with a tip due revert. `Synced(by, pulledEth, tip, bridged)` records what it paid.

## Fee NFT doors

A pools.trade fee NFT's income sits in its pool's fee splitter until `collectFees` runs on it. The fee NFT door does that itself: before it claims from its vault, it has the splitter collect the position, so a sync needs nothing sent first.

## Gas

- Before each door the sync needs that door's stipend, `doors(start, count)[i].gas`, plus `SYNC_RESERVE_GAS()`, 8,000,000, left. Short of it, the sync reverts with `SyncStarved(door, needed)` rather than skip the door.
- The stipends are fixed when each door is added, by kind of door: 250,000 for a core door, 1,700,000 for a fee NFT door, 12,000,000 for the launch door and for a revenue token door, 10,500,000 for a Pons door, 6,800,000 for a Long door, and for a position door 150,000 plus 1,643,809 per position plus 2,340,000 per currency up to two, at most 12,000,000 (a v3 door adds 160,000). Any other outside door asks its own, 100,000 to 12,000,000.
- A token with more doors than one transaction carries is synced in pages: `syncRange(start, count)` pulls doors `start` to `start + count - 1` with the same tip and the same recognition. The state view's `syncPlan(token, gasBudget, start, count)` groups the doors into pages that each fit `gasBudget`, and marks a door that is past the budget on its own.

## A door that fails

- Each door is pulled on its own. One that reverts or runs out of its stipend fails alone, `DoorPulled(i, false)`, and the sync goes on.
- A door that burns its whole stipend every time makes every sync pay for it. `syncSome(doors)` pulls only the doors listed, in that order, with the same tip and the same recognition.
- Nobody can pull a door ahead of a sync: the tokenizer's doors take `pull()` from their token alone (`OnlyRevenueToken`). `pullSome(ids)` on a position door collects into the door, and what it collected reaches the token at the next sync, with Hookr's leg where the door carries one.
- No sync runs while the Uniswap v4 PoolManager is unlocked: one sent from inside an unlock reverts with `PoolManagerUnlocked`.

## Other upkeep

Income reaches a token's time shares when someone rolls them, from the token's page or a direct call, and a roll that books at least 0.001 ETH pays its caller a small part of it. Arbitrage recapture a pool takes in a currency other than its two sides waits in the pool's Rules until someone calls `addRulesCredits(i, member)` on the token's launch door, which anyone may; the next sync then claims it. A token minted with a Fee Bridge also has drips to run: [Fee Bridge](/docs/revenue-tokenizer/fee-bridge).

[Run a sync keeper](/docs/revenue-tokenizer/walkthrough-keeper) puts all of this in a script.

---

This page: https://hookr.fun/docs/revenue-tokenizer/integrate-keepers. Every docs page as Markdown: https://hookr.fun/docs.md.
