PerpFun
Connect wallet

Integrations

A coin here is an ordinary ERC-20 in an ordinary Uniswap V3 pool. If your tooling speaks Uniswap V3, it already speaks PerpFun.


Trading

Route through the canonical SwapRouter02 at 0xCaf681a66D020601342297493863E78C959E5cb2 with exactInputSingle, fee tier 10000 (1%).

  • Before the bond: COIN / USDG
  • After: COIN / TRACKER

The coin is always token0 — it is CREATE2-mined to sort below its quote — so the side of a swap is known without reading the pool, and price is quoted the right way up by default.

Quote with QuoterV2. Note that it is not a view function: it reverts with the answer encoded in the revert data, and a naive eth_call treated as a failure will silently drop your quote.

One warning from our own mistakes: chaining a multi-leg quote by calling the quoter twice gives nonsense, because each leg quotes against the current state rather than the state the previous leg would have left. If you need a chained figure, simulate on a fork.

Discovering coins

The launcher is the registry. No indexer required:

MemeLauncherV3.allCoinsLength() → uint256
MemeLauncherV3.allCoins(uint256) → address
MemeLauncherV3.coinOf(address)  → (quote, lt, oracle, creator, pool,
                                   positionTokenId, tickLower, tickUpper,
                                   graduationTargetUsdX18, graduated)

quote tells you the stage: USDG means pre-bond, anything else means the coin is paired to its tracker.

Events

EventMeaning
Launched(coin, lt, pool, oracle, creator, positionTokenId, coinPriceUsdX18, graduationTargetUsdX18)a coin and its pool exist
Bonded(coin, lt, pool, positionTokenId, backingUsdg)the coin re-paired to its tracker; the market moved to a new address
FeesCollected(coin, caller, amount0, amount1)swap fees swept out of the position
CreatorFeesClaimed(coin, creator, amount0, amount1)a creator withdrew their share

Bonded is the one to handle carefully: the pool address changes, so a tape built on the old pool ends there and a new one begins. The coin is the stable identifier across both.

Indexing the tape

The pool is the tape. Watch its own Swap events and a trade placed by a bot you have never heard of, through a router you do not know, is indexed exactly like one placed on our own front. There is no proprietary event to decode and no zap to special-case.

Permissions

Everything a trader, a creator or an integrator needs is permissionless: swap, quote, launch, read, bond, collect fees, claim protocol fees. The only restricted calls are claimCreatorFees (the creator of that coin) and the locker's lock/migrateToLt (the launcher).