Airdrop

Developers

Copy as text for an AI

Keeper jobs

A few public calls move fees out of pools to holders, splits and the fee vault. Exactly one of them pays the caller: pushing holder rewards, which earns 0.25% of every payout. The others are unpaid upkeep that anyone may run. Kairo operates its own keeper; independent keepers make the system more resilient.

The paid job: pushing holder rewards#

When a token pays its holders, each deposit into its reward stream is released evenly over one hour. A holder can withdraw with claimRewards(to), or anyone can call pushRewards(holders) to deliver what each listed holder has earned directly to their wallet. For that, the caller receives PUSH_TIP_BPS = 25, i.e. 0.25% of each payout, settled once per batch in the token's quote asset (HYPE on HYPE pairs).

  • Building a batch. Collect addresses from the token's Transfer logs, read earned(holder) for each, and push the biggest balances first. streaming() shows what remains to be released and at what rate. The PoolManager and the hook never accrue rewards.
  • Contracts are skipped. Any listed address with code (a contract, or an EIP-7702 delegated account) is left alone and logged as RewardsPushSkipped(holder, 1); it keeps its balance and must claim for itself.
  • Zero balances don't revert. Holders with nothing to withdraw are passed over silently. A batch of only empty holders succeeds and simply wastes your gas.
  • Events. Each payout logs RewardsClaimed(holder, holder, amount, tip); amount is what the holder received after the tip.

Gas

In our test suite's gas table a single-holder push costs about 107,000 gas and distribute() about 180,000. Paying a holder for the first time adds roughly 20,000 because it writes a fresh storage slot. Benchmark your own batches on Elysium and only send when the batch's 0.25% exceeds the batch's gas cost.

Rough earnings

Arithmetic only; nothing is guaranteed. Income depends on trading in holder-paying tokens, and Kairo's keeper competes for the same pushes. Example: a holders-route token on the 2% tier, before its LP line, passes 1.7% of volume to holders. If such tokens trade $250,000 a day, holders receive $4,250 a day, and a keeper that pushed all of it would collect $10.63.

Tips by volume pushed
Pushed per dayYour 0.25%Smallest single payout that covers its gas*
$500$1.25≈ $0.28
$5,000$12.50≈ $0.28
$50,000$125≈ $0.28

* Assumes 107,000 gas at 0.1 gwei with HYPE at about $70, so about $0.0007 per push; 0.25% of $0.28 covers that. Check the live gas price before relying on it.

Unpaid upkeep#

Trades don't move money out of a pool. The launch hook records each fee as a claim held in Uniswap's PoolManager: the creator side goes to the pool's tab, Kairo's share to pendingProtocol(poolId). sweep(poolId) shifts the protocol share into the hook's per-currency tab, and collectProtocol(currency) pays that tab to the vault the factory points at. Native HYPE arrives via receiveProtocol() and is split between the buyback and treasury lanes immediately; an ERC-20 is transferred and then attributed with sync(asset). For holders-route tokens, fees sit in the hook until someone calls the token's distribute(), which starts a one-hour stream.

Upkeep calls (anyone, no reward)
CallWhat it does
KairoV4Token.distribute()Moves a holders-route token's fees from the hook into its reward stream.
KairoFeeSplitter.distribute()Pulls a split pool's creator side and books each slot's share.
KairoLaunchHook.sweep(poolId)Books a pool's pending protocol fees into the hook's tab.
KairoLaunchHook.collectProtocol(currency)Pays the booked protocol fees in one currency to the vault.
KairoLaunchHook.harvestSeed(poolId)Collects the locked seed's LP fee: quote side to the creator tab, token side burned.
KairoLaunchHook.poke(poolId)Writes a price observation (needed for KAIRO's pool; see below).
KairoV4Factory.sweepLaunchFees()Sends collected launch fees to the vault.
ProtocolFeeVault.sync(address asset)Assigns ERC-20s that reached the vault to its lanes.
ProtocolFeeVault.releasePlatformLane()Releases KAIRO received as fees: burned by default, or into the buyback wallets.
KairoAirdrop.claim(seasonId, account, amount, proof)Claims an airdrop on an account's behalf; the money goes to the account.

Keeping KAIRO's TWAP fresh#

For every pool the hook keeps a cumulative price and a ring of 24 observations, written no more than once per 300 seconds (OBS_INTERVAL) by trades or by poke(poolId). Poking is open to anyone and moves no funds. Only KAIRO's pool depends on it, because the vault checks a 30-minute average before each buyback.

  1. Locate the pool: vault.platformPool() returns a KairoV4BuybackPool, whose poolId() and hook() identify the pool and hook.
  2. Call hook.observation(poolId, 0). The last two fields give the number of observations and the index of the newest; read that slot's timestamp.
  3. If there is no observation yet, or the newest is 300 seconds old or more, send poke(poolId). Earlier pokes write nothing.

Kairo's keeper pokes on every run, buyback on or off, so a valid average exists the moment the buyback is enabled. Graduation and the LP line need no keeper on v4: swaps advance a pool's stage, and the first swap after 600 seconds held past the LP line turns the LP fee on and pays it in the same swap.

Restricted calls#

  • Running the buyback. executeBuyback(minTokensOut) accepts only the vault's keeper address or its owner; other callers revert with NotKeeper. Kairo runs it with gas paid from the treasury, and there is no tip. Kairo's keeper follows the vault's switch: while the buyback is off it only keeps KAIRO's price history current, and it resumes buying once the owner wallet turns it back on.
  • Creator fees. hook.claim(poolId, to) and claimTab only work for the wallet being paid or a claim operator it approved via setClaimOperator. Anyone else hits NotRecipient; no third party can claim a creator's fees.
  • Settings. Fee rows, both lines, buyback share and limits, the keeper address, buyback wallets and their cap, and treasury withdrawals are controlled by the Kairo Owner wallet. It is a single wallet, with no multisig or timelock, and it is also the guardian: it can pause new launches, disable a quote for new launches, and turn the buyback off or on. Trading cannot be paused by anyone. Full list: Who controls what.

How a buyback is sized#

Outsiders can't trigger it, but all its limits live on chain, so you can predict the next buyback and audit the last. Each call spends HYPE from the buyback lane on KAIRO in KAIRO's own Uniswap v4 pool, via the vault's KairoV4BuybackPool adapter, and distributes the KAIRO in the same transaction. By default it goes to 0x…dEaD (burned). If the owner has set buyback wallets, they are filled in order up to 2% of KAIRO's supply each (recipientCapBps, the owner's setting; 2% today), with buybackRecipient() naming the next. The call logs BuybackExecuted, then one BuybackDelivered(to, amount) per wallet filled. If the wallets can't absorb the full amount, the call reverts with RecipientsFull and nothing is bought; recipientRoom() shows the remaining capacity.

Buyback guards
GuardRuleRevert
EnabledSwitched on by the Kairo Owner wallet, which can turn it off or on at any timeBuybackDisabled
Cool-down10 minutes minimum between calls (owner can raise it to 1 day)CoolingDown(readyAt)
Price vs. averageSpot within 2% of a TWAP spanning at least 30 minutesPriceOffTwap(spot, twap); TwapUnavailable if no observation is old enough
Per callUp to 0.5% of the locked seed's depthAmount reduced, no revert
Per UTC dayUp to 5% of the locked seed's depthNothingToBuyBack
Minimum outWhichever is larger: the keeper's minTokensOut or 99% of the pool's own quote in the same callInsufficientOutput
Funds availableHYPE in the buyback lane, after a syncNothingToBuyBack
Wallet capacityOnly with buyback wallets set: combined, they must absorb the whole buy at up to the cap each (2% of supply today)RecipientsFull(undelivered)

Depth means the HYPE in the locked seed, measured on the seed's own curve, using the lower of its current holdings and what the TWAP price implies, so pumping the spot price can't enlarge the cap. Outside liquidity is deliberately ignored so that nobody can inflate the caps by adding some just before a buy. The daily cap also considers depth at the day's first buyback. If KAIRO's pool has had no trade or poke for a while, there is no 30-minute-old observation and the call fails until one exists.

Failure modes#

  • Racing other keepers. All keepers see the same balances. The first push to land drains a holder's balance; a later push for the same holder gets zero but still pays gas.
  • Transaction ordering. Elysium runs a single sequencer with its own ordering policy. No keeper, Kairo's included, is guaranteed a better position than another.
  • ERC-20 tips. Tokens quoted in an ERC-20 pay tips in that ERC-20. Value it before counting it; a thinly traded quote may be worth less than it seems.
  • Calls with nothing to do. sweep and collectProtocol succeed and just burn gas when there's nothing to move. sweepLaunchFees() reverts with ZeroAmount; releasePlatformLane() and executeBuyback() with NothingToBuyBack. Check pendingProtocol and protocolTab and simulate first: reverted transactions still cost gas.

Spec and sample keeper#

The whole page condensed into plain text, ready to paste into an editor or an AI assistant.

Kairo keeper spec · plain text
KAIRO KEEPER SPEC (Uniswap v4)
Chain: Elysium (chain id 99901), gas in HYPE. RPC: https://rpc.elysium.kinetiq.xyz
Addresses: GET /api/v1/config (contracts) or /docs/contracts: KairoV4Factory, KairoLaunchHook, KairoV4Lens, ProtocolFeeVault
Every token and pool: KairoV4Factory TokenLaunched(token, creator, poolId, record) events.
Every pool trades in Uniswap's PoolManager 0xE2e105d3F7209A9DA11f83cCf3E7398a753823F1 with KairoLaunchHook as its hook.

PAID JOB
Holder-reward pushes (each KairoV4Token whose rewardsEnabled() is true)
   earned(address holder) view returns (uint256)
   streaming() view returns (uint256 remaining, uint256 perSecond, uint256 periodFinish)
   pushRewards(address[] holders) returns (uint256 paid, uint256 tip)
   tip = floor(payout * PUSH_TIP_BPS / 10000) per holder, PUSH_TIP_BPS = 25 (0.25%), paid to msg.sender once per batch,
   in the pool's quote (HYPE for native pools, else the quote ERC-20)
   holders with code are skipped: RewardsPushSkipped(holder, 1); empty holders are skipped silently
   events: RewardsClaimed(holder, to = holder, amount = payout - tip, tip)

UPKEEP (anyone may call; no reward)
   KairoV4Token.distribute()                   pull what the hook owes a holders-route token into its 60-min stream
   KairoFeeSplitter.distribute()               pull a split pool's creator side and pay every slot (holders slot -> token)
   KairoLaunchHook.sweep(poolId)               pendingProtocol(poolId) -> protocolTab[quote]
   KairoLaunchHook.collectProtocol(currency)   protocolTab[currency] -> the vault the factory names
   KairoLaunchHook.harvestSeed(poolId)         the locked seed's LP fee: quote side to the creator tab, token side burned
   KairoLaunchHook.poke(poolId)                write a price observation (at most one per OBS_INTERVAL = 300 s, 24 kept)
   KairoV4Factory.sweepLaunchFees()            launch fees -> the vault
   ProtocolFeeVault.sync(address asset)        attribute ERC-20 arrivals and donations to the lanes
   ProtocolFeeVault.releasePlatformLane()      KAIRO's lane -> 0x...dEaD, or the buyback wallets in order
   KairoAirdrop.claim(seasonId, account, amount, proof)   pays account, never the caller

RESTRICTED
   ProtocolFeeVault.executeBuyback(minTokensOut)    the vault's keeper or owner only (NotKeeper); BuybackDisabled while off
   ProtocolFeeVault.enableBuyback() / disableBuyback()   the Kairo Owner wallet (owner and guardian)
   KairoLaunchHook.claim(poolId, to) / claimTab     the pool's recipient or its claim operator only
   every setter: the Kairo Owner wallet

STAGES (lens.tokenView(token).config.stage; hook StageChanged events)
   0 Below · 1 Crossed · 2 Graduated · 3 past the LP line (clock running) · 4 LP fee on
   The stage machine moves on swaps only; nothing to confirm by hand.

LOOP (every block or two)
   for each token with rewardsEnabled(): distribute() when the hook owes it; then push the largest earned() first
     while 0.25% * sum(batch) > gas(batch) * gasPrice * margin
   for each pool: if pendingProtocol(poolId) is worth it to you (unpaid): sweep(poolId); then collectProtocol(quote)
   KAIRO's pool (vault.platformPool() is a KairoV4BuybackPool; its poolId()): poke(poolId) whenever the newest
     observation is >= 300 s old, so the buyback always has a 30-minute TWAP

Sample loop

A small TypeScript keeper using viem. It starts holder-token streams, pushes rewards when tips exceed twice the gas, and, if you enable it, sweeps and collects protocol fees. Get the factory address from /api/v1/config (see HTTP API). In production you would index Transfer logs incrementally rather than re-reading them every round.

keeper.ts
import { createPublicClient, createWalletClient, defineChain, http, parseAbi, parseAbiItem } from "viem";
import { privateKeyToAccount } from "viem/accounts";

const elysium = defineChain({
  id: 99901,
  name: "Elysium",
  nativeCurrency: { name: "HYPE", symbol: "HYPE", decimals: 18 },
  rpcUrls: { default: { http: ["https://rpc.elysium.kinetiq.xyz"] } },
});

const FACTORY = process.env.KAIRO_V4_FACTORY as `0x${string}`; // from GET /api/v1/config
const HOOK = process.env.KAIRO_HOOK as `0x${string}`;
const FROM_BLOCK = BigInt(process.env.KAIRO_FROM_BLOCK ?? 0); // the factory's deploy block
const account = privateKeyToAccount(process.env.KEEPER_KEY as `0x${string}`);
const pub = createPublicClient({ chain: elysium, transport: http(undefined, { batch: true }) });
const wallet = createWalletClient({ chain: elysium, transport: http(), account });

const launched = parseAbiItem("event TokenLaunched(address indexed token, address indexed creator, bytes32 indexed poolId, (uint256 rowId, address quote, bool quoteIsCurrency0, uint256 supply, int24 startTick, address feeRecipient, bool feeLocked, uint24 totalPips, uint24 floorPips, uint24 protocolPips, uint24 lpPips, uint24 earlyBuyFeeStartPips, uint32 earlyBuyFeeWindow, uint24 graduationTicks, uint24 lpLineTicks, uint32 lpLineHold, uint256 firstBuyIn, uint256 firstBuyOut, address firstBuyRecipient, bytes32 builderCode, bytes32 salt) record)");
const transfer = parseAbiItem("event Transfer(address indexed from, address indexed to, uint256 value)");
const tokenAbi = parseAbi([
  "function rewardsEnabled() view returns (bool)",
  "function earned(address) view returns (uint256)",
  "function distribute() returns (uint256)",
  "function pushRewards(address[] holders) returns (uint256 paid, uint256 tip)",
]);
const hookAbi = parseAbi([
  "function pendingProtocol(bytes32 poolId) view returns (uint256)",
  "function sweep(bytes32 poolId) returns (uint256, uint256)",
  "function collectProtocol(address currency) returns (uint256)",
]);

const FIRST_HOLDER_GAS = 110_000n; // from our gas table; measure your own on Elysium
const PER_HOLDER_GAS = 30_000n; // a rough guess for each extra holder in a batch

async function round() {
  const gasPrice = await pub.getGasPrice();
  const launches = await pub.getLogs({ address: FACTORY, event: launched, fromBlock: FROM_BLOCK });
  const quotes = new Set<`0x${string}`>();

  for (const { args } of launches) {
    const token = args.token!;
    const poolId = args.poolId!;
    quotes.add(args.record!.quote);

    // 1. Holder rewards: paid 0.25% of what you push.
    if (await pub.readContract({ address: token, abi: tokenAbi, functionName: "rewardsEnabled" })) {
      await pub.simulateContract({ account, address: token, abi: tokenAbi, functionName: "distribute" })
        .then(({ request }) => wallet.writeContract(request))
        .catch(() => {}); // nothing owed right now
      const logs = await pub.getLogs({ address: token, event: transfer, fromBlock: FROM_BLOCK });
      const holders = [...new Set(logs.map((l) => l.args.to!))];
      const owed = await Promise.all(
        holders.map(async (h) => ({ h, amt: await pub.readContract({ address: token, abi: tokenAbi, functionName: "earned", args: [h] }) })),
      );
      owed.sort((a, b) => (b.amt > a.amt ? 1 : -1));
      const batch: `0x${string}`[] = [];
      let sum = 0n;
      for (const { h, amt } of owed) {
        if (amt === 0n) break;
        const tip = ((sum + amt) * 25n) / 10_000n;
        const gas = FIRST_HOLDER_GAS + PER_HOLDER_GAS * BigInt(batch.length);
        if (tip <= gas * gasPrice * 2n) break; // keep a 2x margin over gas (native-quote pools; price ERC-20 tips yourself)
        batch.push(h);
        sum += amt;
      }
      if (batch.length) {
        const { request } = await pub.simulateContract({ account, address: token, abi: tokenAbi, functionName: "pushRewards", args: [batch] });
        await wallet.writeContract(request);
      }
    }

    // 2. Unpaid: book the protocol's share for the vault when it is worth your gas to you.
    const pending = await pub.readContract({ address: HOOK, abi: hookAbi, functionName: "pendingProtocol", args: [poolId] });
    if (pending > 0n && process.env.SWEEP === "1") {
      await wallet.writeContract({ address: HOOK, abi: hookAbi, functionName: "sweep", args: [poolId] });
    }
  }
  if (process.env.SWEEP === "1") {
    for (const q of quotes) await wallet.writeContract({ address: HOOK, abi: hookAbi, functionName: "collectProtocol", args: [q] }).catch(() => {});
  }
}

for (;;) {
  await round().catch((e) => console.error(e.shortMessage ?? e));
  await new Promise((r) => setTimeout(r, 5_000));
}