Airdrop

Developers

Copy as text for an AI

Integration guide

A Kairo token is an ordinary Uniswap v4 pool on Elysium with Kairo's hook attached. Your bot, wallet or app can read it, quote it, trade it and launch new ones with plain contract calls. No SDK, no API key, no sign-up.

Start here: addresses and ABIs#

Store one address, the v4 factory, and ask it for the rest. Nothing else in the system acts as a registry.

Reading addresses from the factory
CallReturnsChanges
factory.hook() · poolManager()KairoLaunchHook and Uniswap's PoolManagerFixed at deployment
factory.quoteRegistry()KairoQuoteRegistry, the list of assets a token can be paired withFixed at deployment
factory.tokenImplementation() · splitterImplementation()The two masters that launches and fee splits are cloned fromFixed at deployment
factory.protocolFeeVault()Where the hook sends Kairo's share of each feeOwner can change
factory.guardian()The one address allowed to pause new launches (it can do nothing else)Owner can change
factory.poolIdOf(address token) · tokenOf(bytes32)Token → pool id and back; zero for anything Kairo didn't launchWritten once, at launch
factory.allTokens(uint256 i)Launches by index, oldest first; allTokensLength() gives the countGrows with each launch
hook.poolKey(bytes32 poolId)The complete v4 PoolKey to hand any routerWritten once, at launch
vault.platformPool() · platformToken()KAIRO and the KairoV4BuybackPool adapter for its poolOwner can change

Two addresses aren't stored in the factory: the router and the lens. Take them from Contract addresses or web/src/contracts/addresses.ts, then check each with factory.isProtocolContract(addr). Uniswap's PoolManager on Elysium lives at 0xE2e105d3F7209A9DA11f83cCf3E7398a753823F1.

ABIs come out of the contracts build: run npm run abis inside contracts/ and they land in web/src/contracts/abis.ts.

ABI exports in abis.ts
ExportUse it for
kairoV4FactoryAbiKairoV4Factory: launching, fee rows, line settings, address getters
kairoLaunchHookAbiKairoLaunchHook: per-pool terms, fees, stages and claims
kairoV4RouterAbiKairoV4Router: buy, sell and multi-pool routes
kairoV4LensAbiKairoV4Lens: read-only views and exact quotes
kairoV4TokenAbiKairoV4Token: the launch token, holder rewards included
kairoFeeSplitterAbiKairoFeeSplitter: fee splits between 2–4 recipients
kairoV4BuybackPoolAbiKairoV4BuybackPool: the vault's view of KAIRO's pool
kairoQuoteRegistryAbi · protocolFeeVaultAbi · kairoAirdropAbi · erc20AbiPair assets, Kairo's fee share, the airdrop, and a generic ERC-20

Trading a pool#

Examples below use viem. client is a public client, wallet a wallet client signing as account, and the ABIs come from abis.ts. All lens functions are view, so they cost nothing to call.

Step 1 · Load the pool

TypeScript
import { kairoV4FactoryAbi, kairoV4LensAbi, kairoV4RouterAbi, erc20Abi } from "./abis";

const known = await client.readContract({ address: factory, abi: kairoV4FactoryAbi, functionName: "isKnownToken", args: [token] });
const v = await client.readContract({ address: lens, abi: kairoV4LensAbi, functionName: "tokenView", args: [token] });
v.poolId;                    // bytes32
v.config.stage;              // 0 Below · 1 Crossed · 2 Graduated · 3 past the LP line · 4 LP fee on
v.totalFee; v.buyFee;        // pips right now; buyFee includes any anti-snipe surcharge
v.effectiveTotalFee;         // all-in, LP fee compounded
v.graduationProgressBps;     // 0..10,000
v.marketCap;                 // quote units, 18-decimal fixed point
const quote = v.config.quoteIsCurrency0 ? v.currency0 : v.currency1; // 0x0 = native HYPE

Step 2 · Price the trade

lens.quoteBuy(token, amountIn) and lens.quoteSell(token, tokensIn) give the exact output in this block, with price impact and every fee already applied, plus the hook's fee on its own. Uniswap's V4Quoter and the router's quoteExactIn return the same figure to the last wei.

TypeScript
const [tokensOut, fee] = await client.readContract({ address: lens, abi: kairoV4LensAbi, functionName: "quoteBuy", args: [token, parseEther("0.4")] });
const minOut = (tokensOut * 995n) / 1000n;             // allow 0.5% slippage
const { timestamp } = await client.getBlock();         // use the chain's clock for the deadline
const deadline = timestamp + 90n;

Step 3 · Send it

ERC-20 inputs are pulled by the router with transferFrom, so approve the router itself (Permit2 isn't used here): the quote asset before buying on an ERC-20 pair, the token before selling. For a native HYPE buy, attach the amount as value.

TypeScript
// buy, paying native HYPE
await wallet.writeContract({ address: router, abi: kairoV4RouterAbi, functionName: "buy",
  args: [token, amountIn, minOut, account.address, deadline], value: amountIn });

// sell: the router needs an allowance on the token
await wallet.writeContract({ address: token, abi: erc20Abi, functionName: "approve", args: [router, tokensIn] });
const [quoteOut] = await client.readContract({ address: lens, abi: kairoV4LensAbi, functionName: "quoteSell", args: [token, tokensIn] });
await wallet.writeContract({ address: router, abi: kairoV4RouterAbi, functionName: "sell",
  args: [token, tokensIn, (quoteOut * 995n) / 1000n, account.address, deadline] });

Prefer Uniswap's Universal Router 2.2.0 (0x1B341FDD55d56F8E08409A2C25DDFad93Eb03C1a)? Encode a V4_SWAP with the key from hook.poolKey(poolId) and approve through Permit2. A swap that can't fill completely reverts, so leave the price limit wide open and protect yourself with the minimum output instead.

Launching from your product#

factory.launch(params) takes a struct of sixteen fields, all listed in the Function reference. Before signing you can work out the token's address from your salt and get an exact preview of the first buy. Kairo's own form sets firstBuyMinOut to 99% of that preview; do the same or tighter.

TypeScript
const salt = keccak256(toHex(crypto.randomUUID()));
const token = await client.readContract({ address: factory, abi: kairoV4FactoryAbi, functionName: "predictTokenAddress", args: [account.address, salt] });
const firstBuy = parseEther("2.5");
const [preview] = await client.readContract({ address: lens, abi: kairoV4LensAbi, functionName: "previewFirstBuy",
  args: [account.address, salt, zeroAddress, 1n /* row 1 = 2% tier */, 0n /* default 1B supply */, firstBuy] });
const creationFee = await client.readContract({ address: factory, abi: kairoV4FactoryAbi, functionName: "launchFee" }); // 0 today
const params = {
  name: "Night Heron", symbol: "HERON", metadataURI: "ipfs://…/heron.json", rowId: 1n, quote: zeroAddress, supply: 0n, salt,
  feeRecipients: [], feeShares: [],                 // [] = the sender; [HOLDERS]/[10000] = holders; 2–4 entries = a split
  earlyBuyFeeWindow: 0, earlyBuyFeeStartPips: 0,    // no anti-snipe fee
  firstBuyAmount: firstBuy, firstBuyMinOut: (preview * 99n) / 100n, firstBuyRecipient: zeroAddress,
  builderCode: zeroHash, acknowledgeRisk: false,
};
const txHash = await wallet.writeContract({ address: factory, abi: kairoV4FactoryAbi, functionName: "launch", args: [params], value: creationFee + firstBuy });
const receipt = await client.waitForTransactionReceipt({ hash: txHash });
const [ev] = parseEventLogs({ abi: kairoV4FactoryAbi, eventName: "TokenLaunched", logs: receipt.logs });
ev.args.poolId; ev.args.record.firstBuyOut;

Is it a Kairo token?#

You'll see new launches as TokenLaunched events from the factory, or through the HTTP API. Before trusting one, check factory.isKnownToken(token), and get its pool only from factory.poolIdOf(token). Anyone can open a v4 pool for the same pair; if its hook, fee or tick spacing differs, it isn't Kairo's. Every Kairo PoolKey has fee = 0x800000 (the dynamic-fee flag), tickSpacing = 200 and hooks = factory.hook(), and the hook rejects pools the factory never registered.

Checking bytecode as well? A launch token is an EIP-1167 clone of factory.tokenImplementation(). Clones can only be initialized by the factory, so isKnownToken already settles it. The one real KAIRO is whatever ProtocolFeeVault.platformToken() returns.

EIP-1167 clone runtime code
0x363d3d373d3d3d363d73 <implementation, 20 bytes> 5af43d82803e903d91602b57fd5bf3

Stages, graduation and the LP line#

The pool created at launch is the token's only pool, permanently. There is no bonding-curve phase and no migration, so the pool id you index on day one stays valid. At launch the full supply goes into a single position that begins at the opening price; Kairo's launch hook owns that position and has no code path to withdraw it.

Graduation is a label at 16.77× the opening price (roughly $58.7k market cap, starting from $3.5k). The swap that pushes the price over it sets the stage to Crossed; a swap in any later transaction makes it final, and the hook emits Graduated(poolId, timestamp) exactly once. Fees and liquidity don't change; the label exists so boards can split launches into columns.

Board columns
ColumnPools in itAPI stageOn-chain test
NewUnder 50% of the way to graduationnewstage 0 or 1 and lens.graduationProgress below 5,000 bps
Near graduation50% of the way or further, not graduated yetgraduatingstage 0 or 1 and progress at 5,000 bps or above
GraduatedGraduated (permanent), or launched without a linegraduatedhook.poolConfig(poolId).stage is 2, 3 or 4
  • Progress bar. Use graduation.progressBps from the API (0–10,000), or lens.graduationProgress(poolId) on chain; they match. It measures how much of the quote needed to reach the line the seed has already taken in, and reads 10,000 from the moment the line is crossed.
  • Building the column. GET /api/v1/tokens?stage=graduating&sort=progress returns pools ordered by how close they are to graduating; sort=graduated puts the newest graduates first. Details in the HTTP API.
  • Catching the moment. Listen for the hook's Graduated event (or any StageChanged), or poll graduation.graduatedAt. It happens inside an ordinary swap; nobody needs to trigger it.
  • The LP line. Set at 142.56× the opening price. When the price has been above it for 600 seconds in total (not necessarily in one stretch), the pool's Uniswap LP fee turns on permanently (LpFeeActivated) and the pool accepts outside liquidity. lens.lpLineHeld(poolId) returns seconds held and seconds required.

Which fee numbers to display#

Fee reads
CallUse
lens.feeBreakdown(poolId)Pips for total, lp, protocol and creator, plus the effective all-in. Display total as the pool's fee; it never goes up.
hook.currentBuyFeeRate(poolId)The rate a buy pays at this moment: the total, or higher during an anti-snipe window. lens.buyFeeSchedule returns the whole decay curve.
poolConfig(poolId).totalFeeMinPips · feeLockedThe lowest total the recipient is still allowed to set, and whether the fee is frozen.
token.buyTaxRate() · sellTaxRate()For scanners that only look at the token contract: buy rate now (anti-snipe included) and sell rate, in bps, rounded up.
token.taxBps()Same value as sellTaxRate. Not a transfer tax: sending tokens between wallets is free; the fee is charged in the quote asset inside the swap.
lens.quoteBuy · quoteSellExact output for a given input, net of fee and price impact.

Invariants you can rely on#

Pool invariants
TopicBehaviour
FillsAll or nothing: a swap that can't fill reverts with PartialFillRejected. Router buys either return at least the minimum or revert with TooLittleReceived.
Launch liquidityDeposited once at launch, held by the hook, never withdrawn. Its LP fee is paid to the creator side in the quote asset; the token half is burned.
Outside liquidityClosed until the LP line: beforeAddLiquidity reverts PoolNotReady while the stage is below LpActive (4). Withdrawing is never blocked. After the line, LPs earn the pool's LP fee.
Current feeAlways read it from feeBreakdown / poolConfig; never hard-code tiers. A pool's fee row is fixed at launch and can only be cut later, by its recipient or by the owner.
Anti-snipeOptional per pool. Buys pay a surcharge that declines linearly to the normal total over the window; sales never pay it. See Anti-snipe window.
Third-party routersThe fee is settled inside the swap deltas, so every v4 router and quoter sees identical numbers.
GasRoughly 167k for a router buy, 173k for a sale, 186k when the pool pays holders, and 0.83–1.16M for a launch.

Token page: /token/<address>. Builder page: /builders/<code>. The connected wallet's holdings: /portfolio.