StainFun

04 — Docs

How StainFun
works

What launching a coin against another coin means, what decides what you can pair with, and where every fee goes.

Launching a coin

One transaction. It deploys the coin, opens its pool, seeds it with the whole float, and records the launch. If any part fails, none of it happened.

What you choose

what it isbounds
name / symbolthe usual1–64 and 1–16 characters
pair assetwhat your coin trades againstanything that clears the gate — see Pair assets
supplyfixed forever, no mint function exists1,000,000,000 on this site; 1 to 1,000,000,000,000 through the contract
opening valuationwhere the price starts, denominated in the pair assetfixed at a $4,000 market cap on this site; any value through the contract
trading feecharged on every tradeUniswap V3's 1% tier (spacing 200) or 0.3% tier (spacing 60)
creator premineshare of supply you keep0 on this site; up to 20% through the contract
first buypair-asset amount you spend buying your own coin as the pool's opening trade0 by default
fee routingwhat happens to your share — see Feeskeep, or buy back and burn
saltpicks your coin's addressmined off-chain

The launch fee is 0.0006 ETH, roughly a dollar and a half, and it is capped at 1 ETH in the contract so it can never quietly become a tax. Gas on Ink is a few cents: creating the pool deploys a contract, which is the bulk of a launch's roughly six million gas.

The one that trips people up

The opening valuation is denominated in the pair asset, not in dollars. Typing 1000 means a thousand USDT0 against USDT0 — $1,000 — and a thousand WETH against WETH, about $2.5 million. Three orders of magnitude apart for the same number in the same box.

This site takes the choice away rather than asking you to get it right: every coin launched from it opens at the same $4,000 market cap, converted into the pair asset at its live price. You do not set it, and nobody gets a different starting line. The contract only ever sees ticks.

Integrating directly? The SDK exists so you never have to think about this either: startFdvInQuote takes a figure in pair-asset units and sdk/src/range.ts converts it into ticks, including the correction for pair assets that do not have 18 decimals — USDT0 has 6, kBTC has 8. Get that correction wrong by hand and the launch opens twelve orders of magnitude off.

A Foundry test pins the SDK's arithmetic against the price a real pool actually opens at, so the two cannot drift apart.

Buying first, inside the launch

devBuyQuote spends pair-asset tokens on your own coin as the pool's very first trade, in the same transaction that opens it. You have to approve the launchpad for that amount beforehand, and the coin lands in the launching wallet.

Doing it here rather than through a router afterwards is not about speed. The launchpad records msg.sender as the creator, so a router that bought on your behalf would have been recorded as the creator instead — and taken the fee stream with it.

Paying for it in ETH works too: the interface swaps your ETH into the pair asset first, through whichever Ink venue has the best route, then approves and launches — in one signature when your wallet supports batched calls.

devBuyMinOut is the least you will accept. It is not protection from other traders: nobody can trade before this, because the pool does not exist until this transaction. It guards against you and the pool disagreeing about the opening price, which is a real risk when the valuation is denominated in a pair asset with unusual decimals.

Why you mine a salt

PairToken takes no constructor arguments, so its init code hash is constant and its address is a pure function of the salt. That matters because a concentrated-liquidity pool prices token1 in terms of token0, and which of those your coin becomes is decided purely by whether its address sorts above or below the pair asset's.

your coin isprice reads asbuying moves the tick
token0pair asset per coinup
token1coin per pair assetdown

Both work, and the contract handles both. But charts, screeners and human intuition all expect the first, so the SDK mines a salt that lands you there. It costs nothing but a few eth_calls.

What can go wrong

revertwhat happened
QuoteNotEligiblethe pair asset does not clear the depth bar — the error carries the reason code
QuoteDeniedthe pair asset is on the deny list
PoolAlreadyInitializedsomebody created and priced your coin's pool first
FeeOutOfRange / FeeTierNotEnabledthe fee is not one of the tiers on offer
TickSpacingMismatchthe spacing does not match the fee tier
TicksNotAlignedyour range is not a multiple of the tick spacing
DevBuyBelowMinimumyour first buy would have returned less than the floor you set
InsufficientLaunchFeeyou sent less than the launch fee
CreatorShareTooHighpremine above 20%

PoolAlreadyInitialized is the interesting one. Your coin's address is predictable from your salt, so a griefer can create its pool first. Merely creating it achieves nothing — the launch adopts an empty pool as if it had made it. Creating and pricing it makes the launch revert cleanly; you pick another salt and have lost nothing but a few cents of gas. Cheap to attack, cheaper to defend, never a loss of funds.