# Liquify Protocol - Full Architecture & Technical Specification ## 1. Executive Summary & Core Mission - **Protocol Name**: Liquify (https://liquify.finance) - **Tagline**: The First Synchronized Bonding Curve Engine for Omnichain Token Deployments. - **Core Mission**: Solve cross-chain liquidity fragmentation by enabling tokens to launch across Ethereum (Sepolia), BNB Smart Chain (Testnet), Base (Sepolia), and Solana (Devnet) while synchronizing market dynamics and automated DEX graduation into Uniswap V2, PancakeSwap, and Raydium. --- ## 2. On-Chain Smart Contract Architecture (Live Deployments) Liquify operates non-custodial, open-source smart contracts deployed across 4 networks. ### Mathematical Model & Explicit 18-Decimal Normalization Each bonding curve follows a linear pricing formula: \[ P(S) = P_0 + (k \times S) \] Where: - \( P_0 \): Base starting price in wei (default: \( 10^{15} \) wei = 0.001 native currency). - \( k \): Slope parameter scaling with tokens sold in wei. - \( S \): Circulating supply sold in **18-decimal base units** (`uint256` wei). In the deployed `BondingCurve.sol` contract, cost is evaluated with explicit `1e18` fixed-point normalization: ```solidity function getCurrentPrice() public view returns (uint256) { return basePrice + (slope * totalSold); } function buy(uint256 tokenAmount) external payable nonReentrant { uint256 currentPrice = getCurrentPrice(); uint256 totalCost = (currentPrice * tokenAmount) / 1e18; uint256 fee = (totalCost * buyFeePercent) / 10000; uint256 costWithFee = totalCost + fee; require(msg.value >= costWithFee, "Insufficient payment"); // ... } ``` --- ## 3. Cross-Chain Synchronization & Bounded Price Dislocation ### Current Operating Model: Coordinated Relayer Engine - **Active State Coordination**: A decentralized relayer service continuously monitors on-chain swap events across Ethereum, BSC, Base, and Solana. - **Oracle Collateral Aggregation**: Real-time native collateral reserves (ETH, tBNB, SOL) are priced in USD using live Pyth / Chainlink price oracles: \[ C_{\text{global\_USD}} = \sum_{i \in \{\text{ETH}, \text{BNB}, \text{BASE}, \text{SOL}\}} \left( \text{Reserve}_i \times \text{Price}_{\text{NativeUSD}, i} \right) \] - **Bounded Cross-Chain Price Dislocation**: When a swap executes on one chain, the updated global parameter is broadcast across the network. User transactions specify slippage limits and deadline timestamps; transactions that attempt to execute against stale state beyond the user's slippage limit safely revert on-chain. ### Synchronization Latency Breakdown (Observed Metrics) | Metric | Description | Target | p50 | p95 | | :--- | :--- | :--- | :--- | :--- | | **Message Ingestion & Processing** | Node event listener detection | < 100ms | 45ms | 120ms | | **Oracle Valuation & Price Update** | Cross-chain reserve aggregation | < 250ms | 110ms | 280ms | | **End-to-End State Broadcast** | Cross-network sync propagation | < 500ms | 380ms | 620ms | | *Note*: On-chain block inclusion depends on underlying chain block times (e.g. 12s on Ethereum, 3s on BSC, 2s on Base, 400ms on Solana). | --- ## 4. Transparent Fee Economics & Reserve Management 1. **One-Off Creator Launch Fee**: ~0.001–0.015 ETH (~$30 USD) paid once by the token creator on their connected network to cover multi-chain bytecode deployment gas. 2. **1.0% Dynamic Swap Fee**: - **0.3% Relayer Gas Reserve**: Compensates relayer nodes for multi-chain RPC queries and state updates. Any surplus gas funds accumulate in a decentralized treasury buffer to subsidize cross-chain gas spikes during volatile market periods. - **0.7% Protocol Treasury Revenue**: Directly funds platform ecosystem development and continuous security auditing. 3. **1.5% DEX Graduation Milestone Fee**: Automatically collected upon achieving the $69,000 USD graduation milestone. --- ## 5. DEX Graduation & Irrevocable 100% LP Burn When aggregate multi-chain collateral reaches **$69,000 USD**: 1. **Bonding Curve Freezes**: Further minting/selling on bonding curves is permanently locked on all 4 chains. 2. **Automated Migration (`MigrationContract.sol`)**: - The contract calls the Uniswap V2 / PancakeSwap / Raydium Router to create the trading pair and deposit 100% of accumulated native collateral + allocated token supply. 3. **Irrevocable 100% LP Burn to `0xdead`**: - In `MigrationContract.sol`, 100% of generated LP liquidity tokens are routed directly to the standard dead burn address (`0x000000000000000000000000000000000000dEaD`), permanently locking liquidity with zero possibility of developer rug pulls. 4. **Deterministic Initial Pool Pricing**: Each local DEX pool opens with an initial price matching the final bonding curve valuation: \[ \text{Pool Price}_i = \frac{\text{Reserve Native}_i \times \text{Price}_{\text{NativeUSD}, i}}{\text{Allocated Reserved Token Supply}_i} = P_{\text{final\_USD}} \] --- ## 6. Trust Model & Administrative Control Disclosures Liquify is built on non-custodial primitives with minimized administrative surface area: - **`TokenFactory`**: Completely permissionless. Contains zero admin keys, zero mint backdoors, and cannot pause or modify deployed tokens. - **`LiquifyToken`**: Creator holds `onlyOwner` solely to update cosmetic metadata (logo, description, social links) and invoke standard emergency `pause()`. Token supply is fixed at creation and cannot be inflated. - **`BondingCurve`**: Creator can pause curve trading in emergency before graduation; after graduation, curve trading is irrevocably disabled. - **`MigrationContract`**: Contains zero withdrawal functions for deposited funds; can only execute `addLiquidityETH` with LP tokens sent directly to `0xdead`. --- ## 7. Smart Contract Registry & Verification Details | Network | Contract | Address | Verification Link | Compiler / Proxy | | :--- | :--- | :--- | :--- | :--- | | **Ethereum Sepolia** | `TokenFactory` | `0xF38CFA1d2b6B90c791b0F2246557Fc33a6F6e6C1` | [Etherscan Source](https://sepolia.etherscan.io/address/0xF38CFA1d2b6B90c791b0F2246557Fc33a6F6e6C1#code) ✅ | Solidity v0.8.20 (No Proxy) | | **Ethereum Sepolia** | `BondingCurveFactory` | `0xe84baC79354F0486d4B90DbD69A444687C53323c` | [Etherscan Source](https://sepolia.etherscan.io/address/0xe84baC79354F0486d4B90DbD69A444687C53323c#code) ✅ | Solidity v0.8.20 (No Proxy) | | **Ethereum Sepolia** | `MigrationContract` | `0x3c823c7789C55e79Fba2f37780cB9D28bf809a3F` | [Etherscan Source](https://sepolia.etherscan.io/address/0x3c823c7789C55e79Fba2f37780cB9D28bf809a3F#code) ✅ | Solidity v0.8.20 (No Proxy) | | **BNB Smart Chain Testnet** | `TokenFactory` | `0x602a5842A251dB239Dd49197921D8919877e502D` | [BSCScan Source](https://testnet.bscscan.com/address/0x602a5842A251dB239Dd49197921D8919877e502D#code) ✅ | Solidity v0.8.20 (CREATE2) | | **BNB Smart Chain Testnet** | `BondingCurveFactory` | `0x9EFaF54c443d365bcc3d9eeAfFfc3515E5F0B674` | [BSCScan Source](https://testnet.bscscan.com/address/0x9EFaF54c443d365bcc3d9eeAfFfc3515E5F0B674#code) ✅ | Solidity v0.8.20 (CREATE2) | | **Base Sepolia** | `TokenFactory` | `0x602a5842A251dB239Dd49197921D8919877e502D` | [BaseScan Source](https://sepolia.basescan.org/address/0x602a5842A251dB239Dd49197921D8919877e502D#code) ✅ | Solidity v0.8.20 (CREATE2) | | **Base Sepolia** | `BondingCurveFactory` | `0x9EFaF54c443d365bcc3d9eeAfFfc3515E5F0B674` | [BaseScan Source](https://sepolia.basescan.org/address/0x9EFaF54c443d365bcc3d9eeAfFfc3515E5F0B674#code) ✅ | Solidity v0.8.20 (CREATE2) | | **Solana Devnet** | SPL Program | `TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA` | [Solana Explorer](https://explorer.solana.com/?cluster=devnet) ✅ | SPL Token-2022 Native | > **CREATE2 Deterministic Deployment Note**: TokenFactory (`0x602a...502D`) and BondingCurveFactory (`0x9EFa...B674`) share identical contract addresses on BNB Smart Chain Testnet and Base Sepolia due to intentional deterministic salt deployments via CREATE2 bytecode factories. --- ## 8. Mainnet Decentralization Roadmap For the upcoming mainnet production rollout, the relayer synchronization transitions to a fully decentralized on-chain state machine: - **5-of-7 BFT Threshold Signatures (BLS12-381)**: Cross-chain trade receipts verified via cryptographic multi-signatures. - **LayerZero v2 / Wormhole Messaging**: Trust-minimized transport layer verifying state root transitions directly on-chain. - **On-Chain Slashing & Timelock DAO**: 48-hour timelock controller for validator rotation and governance updates.