diff --git a/scripts/create_pool_from_prices.js b/scripts/create_pool_from_prices.js index 0fd978b..e968f08 100644 --- a/scripts/create_pool_from_prices.js +++ b/scripts/create_pool_from_prices.js @@ -15,8 +15,12 @@ config({ path: new URL('../.env-secret', import.meta.url).pathname }); // CONFIGURATION // ============================================================================ -// Network flag: 'mockchain' or 'mainnet' -const NETWORK = process.env.NETWORK || 'mainnet'; +// Default pool parameters +const POOL_NAME = 'Original Genesis of Liquidity Party'; +const POOL_SYMBOL = 'OG.LP'; +const KAPPA = ethers.BigNumber.from('184467440737095520'); +const FLASH_FEE_PPM = 5; +const INPUT_USD_AMOUNT = 75; // Size of initial mint in USD // Network-specific configuration const NETWORK_CONFIG = { @@ -51,66 +55,69 @@ const NETWORK_CONFIG = { address: '0xdAC17F958D2ee523a2206206994597C13D831ec7', coingeckoId: 'tether', decimals: 6, - feePpm: 40 // 0.0004% + feePpm: 40 // 0.4 bps }, USDC: { address: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', coingeckoId: 'usd-coin', decimals: 6, - feePpm: 40 // 0.0004% + feePpm: 40 // 0.4 bps }, WBTC: { address: '0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599', coingeckoId: 'wrapped-bitcoin', decimals: 8, - feePpm: 300 // 0.00030% + feePpm: 2_00 // 2 bps }, WETH: { address: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', coingeckoId: 'weth', decimals: 18, - feePpm: 350 // 0.0035% + feePpm: 2_50 // 2.5 bps }, UNI: { address: '0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984', coingeckoId: 'uniswap', decimals: 18, - feePpm: 1450 // 0.00145% + feePpm: 9_50 // 9.5 bps }, WSOL: { address: '0xD31a59c85aE9D8edEFeC411D448f90841571b89c', // Wormhole Wrapped SOL coingeckoId: 'solana', decimals: 9, - feePpm: 950 // 0.00095% + feePpm: 9_50 // 9.5 bps }, TRX: { address: '0x50327c6c5a14DCaDE707ABad2E27eB517df87AB5', coingeckoId: 'tron', decimals: 6, - feePpm: 950 // 0.00095% + feePpm: 9_50 // 9.5 bps }, AAVE: { address: '0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9', coingeckoId: 'aave', decimals: 18, - feePpm: 1450 // 0.00145% + feePpm: 12_50 // 12.5 bps }, PEPE: { address: '0x6982508145454Ce325dDbE47a25d4ec3d2311933', coingeckoId: 'pepe', decimals: 18, - feePpm: 2150 // 0.00215% + feePpm: 18_50 // 18.5 bps }, SHIB: { address: '0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE', coingeckoId: 'shiba-inu', decimals: 18, - feePpm: 2150 // 0.00215% + feePpm: 18_50 // 18.5 bps } } } }; +// Network flag: 'mockchain' or 'mainnet' +const NETWORK = process.env.NETWORK || 'mainnet'; + // Get current network config const currentConfig = NETWORK_CONFIG[NETWORK]; if (!currentConfig) { @@ -137,20 +144,16 @@ if (!RECEIVER_ADDRESS) { // Use network-specific tokens const TEST_TOKENS = currentConfig.tokens; -// Default pool parameters const DEFAULT_POOL_PARAMS = { - name: 'Original Genesis of Liquidity Party', - symbol: 'OG.LP', - kappa: ethers.BigNumber.from('184467440737095520'), //0.01 * 2^64 + name: POOL_NAME, + symbol: POOL_SYMBOL, + kappa: KAPPA, //0.01 * 2^64 swapFeesPpm: Object.values(TEST_TOKENS).map(t => t.feePpm), - flashFeePpm: 5, // 0.0005% + flashFeePpm: FLASH_FEE_PPM, // 0.0005% stable: false, - initialLpAmount: ethers.utils.parseUnits('100', 18) + initialLpAmount: ethers.utils.parseUnits(INPUT_USD_AMOUNT.toString(), 18) }; -// Input amount in USD -const INPUT_USD_AMOUNT = 100; - // ============================================================================ // LOAD ABIs AND CONFIG diff --git a/src/contracts/IPartyPoolABI.ts b/src/contracts/IPartyPoolABI.ts index 3b52665..d7c9ac5 100644 --- a/src/contracts/IPartyPoolABI.ts +++ b/src/contracts/IPartyPoolABI.ts @@ -100,6 +100,25 @@ const IPartyPoolABI = [ ], "stateMutability": "nonpayable" }, + { + "type": "function", + "name": "balance", + "inputs": [ + { + "name": "index", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, { "type": "function", "name": "balanceOf", @@ -119,6 +138,19 @@ const IPartyPoolABI = [ ], "stateMutability": "view" }, + { + "type": "function", + "name": "balances", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256[]", + "internalType": "uint256[]" + } + ], + "stateMutability": "view" + }, { "type": "function", "name": "burn",