5.5 Finalizing and Liquidity Flow
5.5 Finalizing and Liquidity Flow
Scenario: The token’s sale reaches the threshold and is finalized (this happens on the home chain primarily, but affects all).
-
Threshold Reached: When a buy causes the total market cap or supply to hit the predefined threshold (e.g. $69k market cap or equivalent), the TokenFactory will block further buys. Typically the transaction that exceeds the threshold triggers the closure. The contract might allow it to go slightly over or exactly stop at the threshold.
-
Notify Other Chains: The home chain TokenFactory might send a message to all other chain factories indicating the sale is closed (so they can also stop allowing buys). Alternatively, this state could be inferred if a cross-chain buy is attempted and gets rejected by home.
-
Liquidity Provision: The TokenFactory on home chain now uses the collected base currency and remaining tokens to add liquidity to the Uniswap V2 pair:
-
It ensures a Uniswap pair (token <> base currency) exists (creating it via Uniswap Factory if not).
-
It calls the Uniswap Router’s
addLiquidityfunction with parameters: token amount and base currency amount. The token amount is usually the entire supply (or a large portion) and the base amount is all the funds, to maximize liquidity. However, they might retain a small portion of base or tokens to handle cross-chain differences.
-
This call results in LP tokens being minted to the TokenFactory.
-
-
Burn LP Tokens: The TokenFactory then sends the received LP tokens to a burn address (e.g.
0x0000...dead) or a timelock that is unaccessible. This locks the liquidity in the pool permanentlyboostylabs.com. From now on, holders can trade on the DEX; the initial liquidity cannot be rug-pulled.
-
Cross-Chain Liquidity: For each other chain where tokens were sold, a similar liquidity addition happens:
-
The TokenFactory on that chain will take the base currency it accumulated and the tokens in circulation on that chain and create a liquidity pool on the local DEX (PancakeSwap on BSC, Pangolin on Avalanche, etc.). It mints LP tokens and burns them.
-
If a token had no sales on a particular chain, it might skip creating a pool there (since no liquidity is there). But for any chain where users contributed, there will be funds to seed a pool. Thus the token could end up with pools on multiple chains.
-
These pools collectively allow arbitrage to eventually equalize the token’s price across chains (through cross-chain arbitrage via bridges or directly if someone uses the LayerZero capability to move tokens).
-
-
Trading Phase: Once liquidity is added, the bonding curve phase is officially over. Users trade on the open market. The TokenFactory might emit a
TokenReleased(token)event to indicate transition.
-
Post-Launch Bridging: If the system supports it, users might be able to bridge tokens between chains after launch using the TokenFactory (or a separate bridge module). Since liquidity exists on each chain, arbitrageurs will trade to keep prices aligned.
The above flows cover the lifecycle: initial buys and sells, cross-chain interactions, and final launch. The flowcharts ensure that at each step, the correct actions are taken either on one chain or via messages to others, maintaining a single unified economic system for the token.
6. Deployment and Configuration Guide (Foundry)Link to a page in the guide