stbl.meme

Integration guide

Overview

This guide is for trading terminals, aggregators, and bots that want to list, trade, or launch stbl.meme bonding-curve tokens from their own product.

The integration is fully on-chain — there is no partner API. You interact directly with the BondingCurve singleton contract: quote via its viewfunctions, trade and create by sending transactions from your users' wallets, and discover tokens by indexing its events from your own RPC node. No API keys, no auth, no off-chain dependencies.

Chain state is shared: tokens created or traded through your terminal appear on stbl.meme automatically (our indexer consumes the same events), and vice versa.

Chain & contracts

stbl.meme runs on Stable Mainnet (chain id 988, native currency USDT0, ~700 ms blocks).

Public RPChttps://rpc.stable.xyz
Explorerhttps://stablescan.xyz
Bonding curveTBD — published after deployment to Stable Mainnet
Token lockTBD — published after deployment to Stable Mainnet
Quote token (USDT0)0x779Ded0c9e1022225f8E0630b35a9b54bE713736
TreasuryTBD — published after deployment to Stable Mainnet
Platform fee recipientTBD — published after deployment to Stable Mainnet
Uniswap V3 factory0x88F0a512eF09175D456bc9547f914f48C013E4aA
Uniswap V3 position manager0x3BdC3437405f7D801b6036532713fc1F179136a6
Uniswap SwapRouter020x32eaf9B5d5F2CD7361c5012890C943D7de84C22a
Permit20x000000000022D473030F116dDEE9F6B43aC78BA3

Live launchpad parameters:

Trade fee1% per buy/sell (before and after graduation)
Creator / platform fee split50% / 50% of the trade fee
Creation fee1 USDT0 (charged from msg.value, excess refunded)
Graduation threshold (default)4200 USDT0
Graduation threshold (custom range)1000 – 10000 USDT0, set per token at creation
Allowed quote tokensUSDT0 only today
Token supply1,000,000,000 (18 decimals); 800,000,000 sellable on the curve
These values are owner-adjustable on-chain — read them live from the curve rather than hardcoding: creationFee(), quoteGraduationThreshold(USDT0) (+ …Min/…Max), creatorFeePercent(), allowedQuoteTokens(token), treasury(), tokenLock().

Creating tokens

Create a launch by calling the curve directly:

// simple create (USDT0 pool; msg.value = creationFee)
createPool(CreateParams params) payable returns (address token)

// create + creator first-buy, locked in the TokenLock vault
// msg.value = creationFee + first-buy amount
createAndLockFirstBuy(CreateParams params, uint256 lockDuration,
                      uint256 deadline) payable returns (address token)

struct CreateParams {
  string  name;
  string  symbol;
  string  uri;                  // token metadata URI (you host it)
  address quoteToken;           // USDT0 (the only whitelisted quote today)
  DexTarget dexTarget;          // 0 = UniswapV3 (only value; immutable)
  uint256 graduationThreshold;  // 0 = default (4200 USDT0), else 1000-10000 USDT0 (raw units)
}
  • msg.value must cover the 1 USDT0 creation fee (plus the first buy when using createAndLockFirstBuy); any excess is refunded in the same transaction.
  • uriis the token's metadata pointer (logo, description, socials) — host the JSON yourself, e.g. on IPFS or your CDN.
  • lockDurationlocks the creator's first buy in the TokenLock vault (up to 10 years) — a visible rug-safety signal shown on token pages.
  • The new token address is returned by the call and emitted in the TokenCreated event. Total supply is fixed at 1B (18 decimals), fully minted to the curve — 800M sellable on the curve, the rest reserved for the graduation LP.

Quoting & trading

The curve is a constant-product AMM on virtual reserves. Quote with the view functions (they match execution exactly, fee included), then trade:

// quotes (view)
estimateBuyExactInTokens(address token, uint256 quoteAmountIn)
  returns (uint256 tokenOut)
estimateSellTokens(address token, uint256 tokenAmountIn)
  returns (uint256 quoteOut)
getPool(address token) returns (Pool)   // reserves, threshold,
                                        // creatorFeePercent, isCompleted, ...

// trades (USDT0 pools take native USDT0 on buys)
buyExactIn(address token, uint256 amountOutMin, uint256 deadline)
  payable returns (uint256 tokenOut)
sellExactIn(address token, uint256 tokenAmountIn, uint256 amountOutMin,
  uint256 deadline) returns (uint256 quoteOut)
  • Slippage & deadline are yours to set: compute amountOutMinfrom the estimate functions and your user's tolerance; the curve reverts with SlippageExceeded past it.
  • Approvals: buys attach native USDT0 — no approval. Sells require a one-time ERC20.approve(curve, amount) on the token.
  • The 1% trade fee is taken inside the curve on every buy and sell — no extra fee for integrators to add or skim.
  • Spot price = virtualQuoteReserves / virtualTokenReserves (from getPool or the reserves on each TradeEvent).
  • After graduationthe curve rejects trades — route to the token's V3 pool (Uniswap V3, per its dexTarget, 1% fee tier) with standard routers. The pool address is in the V3PoolCreated event.

Discovering tokens (indexing events)

Watch the bonding-curve contract from your own node — these four events are the same stream our indexer consumes:

TokenCreated(token, creator, quoteToken, name, symbol, uri,
  virtualQuoteReserves, virtualTokenReserves, quoteDecimals,
  timestamp, dexTarget, graduationThreshold)   // new launch

TradeEvent(token, trader, quoteToken, isBuy, amountIn, amountOut, fee,
  virtualQuoteReserves, virtualTokenReserves,
  realQuoteReserves, realTokenReserves, timestamp)
  // every curve trade - carries post-trade reserves, so you can
  // derive price, volume, and graduation progress without extra reads

PoolCompleted(token, realQuoteReserves, timestamp)   // threshold hit

V3PoolCreated(token, v3Pool, quoteToken, tokenId, amountToken,
  amountQuote, sqrtPriceX96, timestamp, dexTarget)   // graduated -
  // v3Pool is where trading continues
  • Graduation progress = realQuoteReserves vs the pool's graduationThreshold (both on every TradeEvent / getPool read).
  • Useful public mappings for state reads: pools(token), positionIds(token) (V3 LP NFT id; 0 = not graduated), creatorClaimable(token), pendingQuoteFees(token).
  • Fee-related events: FeesDistributed, CreatorClaimed, PlatformWithdrawn, CreationFeeCharged; config changes emit ConfigUpdated / QuoteGraduationThresholdsUpdated.
Before graduation the token contract restricts transfers to system contracts — tokens can be bought and sold on the curve but not transferred between wallets until enableTrading()fires during migration. Don't list curve-phase tokens as transferable ERC20s.

Graduation, fees & locks

  • A token graduateswhen its 800M sellable supply is fully bought — exactly when net quote raised equals the pool's threshold (default 4200 USDT0).
  • Migration is atomic inside the completing buy: a full-range V3 position is seeded at the final curve price on the token's dexTarget (Uniswap V3, 1% fee tier) and the LP NFT is locked in the curve contract forever — liquidity can never be pulled. If a migration ever fails mid-buy, migrateToUniswapV3(token, deadline) is permissionless after a 5-minute grace period.
  • The 1% trade fee applies in both phases (curve fee before, 1% V3 fee tier after). Per token it splits 50% to the creator and 50% to the platform.
  • Fee plumbing is permissionless: anyone may call distributeFees(token) to fold pending curve + LP fees into escrow; creators pull with claim(token); check balances via creatorClaimable(token) / pendingQuoteFees(token).
  • Token locks — the TokenLock vault holds creator first-buys:
lockTokens(address token, address owner, uint256 amount,
  uint256 duration) returns (uint256 lockId)   // max 3650 days
extendLock(uint256 lockId, uint256 newUnlockTime)   // owner only
unlock(uint256 lockId)                              // owner, after unlockTime
getLock(uint256 lockId) returns (Lock)  // { token, owner, amount, unlockTime }

// events: TokensLocked(lockId, token, owner, amount, unlockTime),
//         LockExtended(lockId, newUnlockTime),
//         TokensUnlocked(lockId, owner, amount)

Need more help? Support