Polyfun Protocol

Technical specification — internal bonding curve launcher and twin-sided YES/NO AMM on Base (Chain ID 8453).

Contract Addresses

Base mainnet (Chain ID 8453) — active protocol contracts. Internal market duration: 48 hours.

ContractAddress
Launcher

createLaunch entrypoint

0xAAEDa2D27e94469389Ae28bF0e09C4E81a771A5f
Registry

Official market registry

0x7A15B7FB06BbBCDC304EE0752Aeab9e1D62eE423
Migration Adapter
0xb5CB3E255246932Cc79B97e54267fcddfbc575a9
Token Implementation
0x17Dc6109404c1058026b0C8a056Ef0f764F3Aabe
Market Implementation
0x89bFb15488eb2D1D7B72347CfbC2B79495489e15
Platform Token ($poly)

Official platform token · …ba5e suffix

0x2413276aeAaF37FECc5E61F157Ea590615CFba5e
Create2 Factory
0xE832E090E85a9A1ae84bb549D50c846FD6284cDC
WETH (Base)
0x4200000000000000000000000000000000000006
Uniswap V3 Factory
0x33128a8fC17869897dcE68Ed026d694621f6FDfD
Uniswap V3 NFPM
0x03a520b32C04BF3bEEf7BEb72E919cf822Ed34f1
LP Burn Address

Migration LP destination

0x000000000000000000000000000000000000dEaD
Fee Receiver (Treasury)

Protocol revenue destination

0xFDC18444eca2FEfd44fA7516Ff994aAfC17C4fD5

Polyfun is an internal bonding curve launcher and twin-sided AMM (YES/NO prediction market) natively deployed on Base (Chain ID: 8453). Upon successful migration gating, the protocol provisions liquidity to Uniswap V3 and permanently burns the Liquidity Provider (LP) position via the Nonfungible Position Manager (NFPM).

1. Core State & Lifecycle

Every token deployment instantiates a paired architectural coupling: PolyfunToken (ERC20) and PolyfunMarket (Escrow/AMM). Asset velocity and price discovery remain encapsulated within the market contract until a terminal lifecycle event triggers:

                  ┌─────────────── [ Deploy ] ───────────────┐
                  │                                          │
                  ▼                                          ▼
     ┌────────────────────────┐                 ┌────────────────────────┐
     │  internal (Bonding)    │                 │     settle (Expiry)    │
     │  - Dual-sided AMM      │                 │  - Threshold NOT met   │
     │  - 1% protocol fee     │                 │  - YES = 0 | NO = Claim│
     └────────────────────────┘                 └────────────────────────┘
                  │
                  ▼ (Threshold + Floor Met)
     ┌────────────────────────┐
     │   migrate (Terminal)   │
     │  - Atomic UniV3 LP     │
     │  - NFPM NFT -> Burn    │
     └────────────────────────┘
internal
Active trading phase (48-hour countdown from deploy). Executes YES/NO asset minting, global pool accounting, and chronological epoch countdown.
migrate
Terminal optimistic execution path. Triggered atomically when YES side satisfies both the saturation threshold and the ETH floor.
settle
Terminal pessimistic execution path. Triggered post-expiry if the migration gate criteria are not met. NO positions claim pro-rata collateral; YES positions are hard-coded to zero value.

Migration Gate Predicate

Migration conditions are evaluated on-chain via the following logic:

Gate = (PoolYES ≥ 0.90 × (PoolYES + PoolNO)) ∧ ( ETHYES4 ETH)

Reference state at exact gate saturation: ≈ 4.44 ETH cumulative gross TVL (4 ETH assigned to YES / remainder residual NO skew).

2. Deployment Topology & Vanity Suffix Gating

Initiated via Base mainnet. Target gas budget requires native ETH coverage alongside a flat execution premium.

  • Route: /launch — POST payload contains metadata, initializes a decentralized vanity worker to compute a CREATE2 salt.
  • Address Verification: The protocol enforces an on-chain suffix constraint. The low 4 bytes of the deployed token address must resolve to 0xba5e (ba5e).
  • Access Control: The generated salt is strictly cryptographically bound to the msg.sender wallet. The deployment factory rejects foreign or front-run salt injection.
  • Data Availability: UI states synchronize via polling /api/markets triggered by custom indexer subgraphs tracking factory deploy blocks.
// On-chain validation snippet
require(
  address(deployedToken) & 0xFFFFFFFF == 0x0000ba5e,
  "Err: Invalid Suffix"
);

3. Internal Market Mechanics

Direct capital routing utilizes buyYes / buyNo entry points using raw msg.value (ETH). A hard-coded 1% protocol fee is sliced directly to the FEE_RECEIVER prior to calculating pool invariant adjustments and crediting user position weights.

Execution Paths

YES (Long Migration)
The transaction that fulfills the bonding curve criteria executes migrate() atomically inline. Post-migration, YES holders pull their proportional share of the 800M token allocation pool relative to their internal deposit weight.
NO (Short Settlement)
If expiration is reached, NO holders claim a pro-rata share of the contract's aggregate ETH balance based on relative pool weight. YES positions forfeit all deposited capital.

4. Terminal State Resolution

Path A: migrate (YES Victory)

  • State Lock: Mutates internal AMM functions to disabled states.
  • Fee Extraction: Deducts a fixed 0.1000 ETH protocol migration fee (immutable wei constant in production bytecode).
  • Liquidity Provisioning: Automatically routes 200M tokens paired with all residual pool ETH to a fresh Uniswap V3 pool. Tick ranges are hard-coded into the factory adapter architecture (zero user-side slippage or range configuration).
  • Distribution: Unlocks the 800M token tranche for internal YES claims; sets transfersEnabled = true.
  • Anti-Rug Enforcement: Transposes the Uniswap V3 NFPM ownership directly to address(0) (Burn). Liquidity pull vectors via decreaseLiquidity are permanently neutralized.

Path B: settle (NO Victory)

  • Trigger: Permissionless execution vector available to any EOA once block timestamp surpasses expiration and migration predicates evaluate to false. Caller pays gas; no MEV bounties.
  • Fee Capture: Deducts a flat 2% platform fee (settleNoWin path).
  • Liquidation: Disburses the remaining 98% of total contract ETH to NO depositors. No external AMM pool is initialized.

5. Tokenomics & Fee Structure

Token Allocation

  • Total Supply Max Cap: 1 × 10⁹ × 10¹⁸ (1B tokens, 18 decimals)
  • Internal Distribution (Bonding / Claims): 80% (800M)
  • External Liquidity (Uniswap V3 LP): 20% (200M)

Protocol Matrix

OperationTypeRate / CostHook / Target
DeployFlat Fee0.0005 ETHcreateLaunch()
TradePercentage1%buyYes() / buyNo()
MigrationFixed Slice0.1000 ETHmigrate() (YES Win)
SettlementPercentage2%settleNoWin() (NO Win)

6. Security Guards & System Constraints

  • Deterministic LP Lock: The NFPM token destination is strictly assigned to the burn address inside the migration transaction payload.
  • Launch Anti-Whale / Anti-Bot Window: The first 60 blocks post-deployment enforce strict tx.origin == msg.sender (EOA-only validation). Individual swap volume is hard-capped at 0.5% of total supply per transaction.
  • Factory Isolation: Only tokens carrying the validated ba5e suffix minted via the verified factory can initialize markets. Direct manual injections are rejected at the edge.