Documentation

How Whale.fun works, its fees, and how developers integrate their own factory.

Overview

Whale.fun is a fair-launch token protocol on BNB Chain. Every token is minted at one equal price for everyone, sells out into auto-created PancakeSwap liquidity, and runs configurable tax / vault mechanisms. No presale, no insider allocation.

This deployment is the TESTNET sandbox (BSC chainId 97). Tokens here have no real value — use it to test mechanisms freely.

How fair mint works

A launch is split into N mint slots at a fixed unit price. Each wallet mints exactly one slot, at the same price as everyone else (anti-snipe). Each mint adds liquidity at a fixed ratio, so the on-chain price stays constant during minting. When all slots are sold, the pool is finalized, LP is burned, and trading opens automatically.

Emergency refund: after minting and before launch, a minter can refund their share at cost (subject to a timelock — 24h on mainnet, 0 on this testnet). The slot is then released for others.

Fees & tax

• Creation fee: a small BNB fee to create a launch (set per network). • Mint fee: +1% on top of the unit price, to the platform treasury. • Trading tax: configurable buy/sell tax (max 10%). Of the collected tax, the platform takes 20% (10% treasury + 10% $WHALE buyback-burn); the remaining 80% goes to the creator's buckets: marketing / liquidity / dividends / burn.

Holder-growth airdrop: every trade scatters a few 1-wei dust transfers to random addresses (Coral-style), growing the on-explorer holder count. These addresses are excluded from the dividend register, so it never bloats dividend processing.

$WHALE platform token

$WHALE is the platform token. It is exempt from the 20% platform cut and pays 100% of its trading tax as dividends to holders. The 10% buyback-burn slice from every other token continuously buys back and burns $WHALE, creating a deflationary loop.

Vault templates

A vault template defines how a token's tax is routed (dividends, buyback-burn, LP staking, AI buyback, leaderboard burn, etc.). Standard Mint is live; more are in development, prioritized by the community wishlist in the Vault Template Store. You can also use an unlisted template by entering a custom factory address.

Developer integration

Anyone can write their own launch-factory contract and use it through Whale.fun's create page (Vault Store → Unlisted template). To be compatible, your factory must implement the interface below and emit LaunchCreated so the UI can locate the new token.

struct LaunchConfig {
    string  name;
    string  symbol;
    uint256 totalSupply;
    uint256 mintCount;
    uint256 unitPriceBNB;
    uint16  buyTaxBps;
    uint16  sellTaxBps;
    uint16  bucketMarketingBps;
    uint16  bucketLiquidityBps;
    uint16  bucketDividendBps;
    uint16  bucketBurnBps;
    address marketingWallet;
    address quoteToken;      // v1: address(0) = BNB
    bool    airdropEnabled;
    uint8   airdropCount;
}

interface ILaunchFactory {
    function config() external view returns (address);
    function createLaunch(LaunchConfig calldata cfg)
        external payable returns (address token, address vault);

    event LaunchCreated(
        uint256 indexed id, address indexed creator,
        address token, address vault, address pair,
        string name, string symbol
    );
}

Your factory's config() should expose creationFee() (the create page reads it to know how much BNB to send). The token your factory deploys should follow the ProjectToken surface (receive() to mint during minting, refundMint(), claim(), mintProgress(), requiredPayment(), startTradeBlock(), standard ERC-20) so the token detail page works out of the box.

Usage: deploy your factory → open Vault Template Store → Unlisted template → paste the factory address → it opens /create?factory=0x… and deploys through your factory.

Unlisted templates are NOT reviewed or audited by Whale.fun. To get listed in the official store (with the audited badge), submit your template for review.

Vault template standard

Vault templates that ACCUMULATE funds (LP-staking dividends, AI buyback, lending, etc.) follow a shared security model via the VaultBase base contract. The token creator can configure mechanism parameters but can NEVER touch the vault's funds; only the platform multisig (guardian) can emergency-withdraw as a safety backstop.

abstract contract VaultBase is IVaultSchema {
    IPlatformConfig public config;
    address public creator;            // 只配参数,无权动资金 / config-only, no fund access

    // guardian = 平台多签,统一来自 PlatformConfig / platform multisig, single source
    function guardian() public view returns (address) { return config.guardian(); }
    modifier onlyGuardian() { require(msg.sender == guardian(), "only guardian"); _; }

    // 紧急提取:仅平台多签(creator 无权)/ emergency withdraw: guardian only
    function emergencyWithdraw(address payable to) external onlyGuardian { ... }
    function emergencyWithdrawToken(address token, address to) external onlyGuardian { ... }

    // creator 或 guardian 可轮换 creator(私钥丢失恢复)
    function transferCreator(address newCreator) external onlyCreatorOrGuardian { ... }
}

Auto-generated UI: each vault implements vaultUISchema() describing its methods/inputs on-chain. The platform reads it to auto-render the interaction form — so a developer can ship a new vault (even an unlisted one) without writing any frontend. Recommended hardening for accumulating vaults: hard reserve floor, two-layer price oracle (Portal + TWAP, no spot — anti-flashloan), bounded queues with a minimum-borrow (anti-grief), and ReentrancyGuard / SafeERC20.

Standard Mint does NOT accumulate funds (tax distributed immediately, LP burned), so it is fully trustless and needs no withdraw. The guardian model only applies to accumulating-fee vault templates.

Security & disclaimer

Contracts are unaudited and provided as-is. Digital assets are highly speculative; you may lose your entire investment. Whale.fun is a permissionless protocol — the presence of any token (especially unlisted-template ones) is not an endorsement. Always do your own research and verify contracts.