diff --git a/modules/network/arbitrum.ts b/modules/network/arbitrum.ts index 2cc40b63c..3ab8838c6 100644 --- a/modules/network/arbitrum.ts +++ b/modules/network/arbitrum.ts @@ -68,12 +68,16 @@ export const arbitrumNetworkData: NetworkData = { delegationProxy: '0x81cfae226343b24ba12ec6521db2c79e7aeeb310', }, balancer: { - vaultV2Address: '0xba12222222228d8ba445958a75a0704d566bf2c8', - v2DefaultSwapFeePercentage: '0.5', - v2DefaultYieldFeePercentage: '0.5', - vaultV3Address: '0xba12222222228d8ba445958a75a0704d566bf2c8', - v3DefaultSwapFeePercentage: '0.5', - v3DefaultYieldFeePercentage: '0.5', + v2: { + vaultAddress: '0xba12222222228d8ba445958a75a0704d566bf2c8', + defaultSwapFeePercentage: '0.5', + defaultYieldFeePercentage: '0.5', + }, + v3: { + vaultAddress: '0xba12222222228d8ba445958a75a0704d566bf2c8', + defaultSwapFeePercentage: '0.5', + defaultYieldFeePercentage: '0.5', + }, }, multicall: '0x80c7dd17b01855a6d2347444a0fcc36136a314de', multicall3: '0xca11bde05977b3631167028862be2a173976ca11', diff --git a/modules/network/avalanche.ts b/modules/network/avalanche.ts index e8907b37f..472bb26d6 100644 --- a/modules/network/avalanche.ts +++ b/modules/network/avalanche.ts @@ -66,12 +66,16 @@ const avalancheNetworkData: NetworkData = { delegationProxy: '0x0c6052254551eae3ecac77b01dfcf1025418828f', }, balancer: { - vaultV2Address: '0xba12222222228d8ba445958a75a0704d566bf2c8', - v2DefaultSwapFeePercentage: '0.5', - v2DefaultYieldFeePercentage: '0.5', - vaultV3Address: '0xba12222222228d8ba445958a75a0704d566bf2c8', - v3DefaultSwapFeePercentage: '0.5', - v3DefaultYieldFeePercentage: '0.5', + v2: { + vaultAddress: '0xba12222222228d8ba445958a75a0704d566bf2c8', + defaultSwapFeePercentage: '0.5', + defaultYieldFeePercentage: '0.5', + }, + v3: { + vaultAddress: '0xba12222222228d8ba445958a75a0704d566bf2c8', + defaultSwapFeePercentage: '0.5', + defaultYieldFeePercentage: '0.5', + }, }, multicall: '0xca11bde05977b3631167028862be2a173976ca11', multicall3: '0xca11bde05977b3631167028862be2a173976ca11', diff --git a/modules/network/base.ts b/modules/network/base.ts index efe5a1250..166a9f48c 100644 --- a/modules/network/base.ts +++ b/modules/network/base.ts @@ -62,12 +62,16 @@ const baseNetworkData: NetworkData = { delegationProxy: '0xd87f44df0159dc78029ab9ca7d7e57e7249f5acd', }, balancer: { - vaultV2Address: '0xba12222222228d8ba445958a75a0704d566bf2c8', - v2DefaultSwapFeePercentage: '0.5', - v2DefaultYieldFeePercentage: '0.5', - vaultV3Address: '0xba12222222228d8ba445958a75a0704d566bf2c8', - v3DefaultSwapFeePercentage: '0.5', - v3DefaultYieldFeePercentage: '0.5', + v2: { + vaultAddress: '0xba12222222228d8ba445958a75a0704d566bf2c8', + defaultSwapFeePercentage: '0.5', + defaultYieldFeePercentage: '0.5', + }, + v3: { + vaultAddress: '0xba12222222228d8ba445958a75a0704d566bf2c8', + defaultSwapFeePercentage: '0.5', + defaultYieldFeePercentage: '0.5', + }, }, ybAprConfig: { defaultHandlers: { diff --git a/modules/network/fantom.ts b/modules/network/fantom.ts index 718bd50b1..a7e504462 100644 --- a/modules/network/fantom.ts +++ b/modules/network/fantom.ts @@ -114,12 +114,16 @@ const fantomNetworkData: NetworkData = { poolAddress: '0xcde5a11a4acb4ee4c805352cec57e236bdbc3837', }, balancer: { - vaultV2Address: '0x20dd72ed959b6147912c2e529f0a0c651c33c9ce', - v2DefaultSwapFeePercentage: '0.25', - v2DefaultYieldFeePercentage: '0.25', - vaultV3Address: '0x20dd72ed959b6147912c2e529f0a0c651c33c9ce', - v3DefaultSwapFeePercentage: '0.25', - v3DefaultYieldFeePercentage: '0.25', + v2: { + vaultAddress: '0x20dd72ed959b6147912c2e529f0a0c651c33c9ce', + defaultSwapFeePercentage: '0.5', + defaultYieldFeePercentage: '0.5', + }, + v3: { + vaultAddress: '0x20dd72ed959b6147912c2e529f0a0c651c33c9ce', + defaultSwapFeePercentage: '0.5', + defaultYieldFeePercentage: '0.5', + }, }, multicall: '0x66335d7ad8011f6aa3f48aadcb523b62b38ed961', multicall3: '0xca11bde05977b3631167028862be2a173976ca11', diff --git a/modules/network/gnosis.ts b/modules/network/gnosis.ts index e0f7a6f16..2aeb92d9e 100644 --- a/modules/network/gnosis.ts +++ b/modules/network/gnosis.ts @@ -64,12 +64,16 @@ const gnosisNetworkData: NetworkData = { delegationProxy: '0x7a2535f5fb47b8e44c02ef5d9990588313fe8f05', }, balancer: { - vaultV2Address: '0xba12222222228d8ba445958a75a0704d566bf2c8', - v2DefaultSwapFeePercentage: '0.5', - v2DefaultYieldFeePercentage: '0.5', - vaultV3Address: '0xba12222222228d8ba445958a75a0704d566bf2c8', - v3DefaultSwapFeePercentage: '0.5', - v3DefaultYieldFeePercentage: '0.5', + v2: { + vaultAddress: '0xba12222222228d8ba445958a75a0704d566bf2c8', + defaultSwapFeePercentage: '0.5', + defaultYieldFeePercentage: '0.5', + }, + v3: { + vaultAddress: '0xba12222222228d8ba445958a75a0704d566bf2c8', + defaultSwapFeePercentage: '0.5', + defaultYieldFeePercentage: '0.5', + }, }, multicall: '0xbb6fab6b627947dae0a75808250d8b2652952cb5', multicall3: '0xca11bde05977b3631167028862be2a173976ca11', diff --git a/modules/network/mainnet.ts b/modules/network/mainnet.ts index dbd2a0578..b977001df 100644 --- a/modules/network/mainnet.ts +++ b/modules/network/mainnet.ts @@ -82,13 +82,18 @@ const data: NetworkData = { config: '0xac89cc9d78bbad7eb3a02601b4d65daa1f908aa6', }, balancer: { - tokenAdmin: '0xf302f9f50958c5593770fdf4d4812309ff77414f', - vaultV2Address: '0xba12222222228d8ba445958a75a0704d566bf2c8', - v2DefaultSwapFeePercentage: '0.5', - v2DefaultYieldFeePercentage: '0.5', - vaultV3Address: '0xba12222222228d8ba445958a75a0704d566bf2c8', - v3DefaultSwapFeePercentage: '0.5', - v3DefaultYieldFeePercentage: '0.5', + v2: { + vaultAddress: '0xba12222222228d8ba445958a75a0704d566bf2c8', + defaultSwapFeePercentage: '0.5', + defaultYieldFeePercentage: '0.5', + tokenAdmin: '0xf302f9f50958c5593770fdf4d4812309ff77414f', + }, + v3: { + vaultAddress: '0xba12222222228d8ba445958a75a0704d566bf2c8', + defaultSwapFeePercentage: '0.5', + defaultYieldFeePercentage: '0.5', + tokenAdmin: '0xf302f9f50958c5593770fdf4d4812309ff77414f', + }, }, multicall: '0x5ba1e12693dc8f9c48aad8770482f4739beed696', multicall3: '0xca11bde05977b3631167028862be2a173976ca11', diff --git a/modules/network/network-config-types.ts b/modules/network/network-config-types.ts index fac23e02d..d8d7506d7 100644 --- a/modules/network/network-config-types.ts +++ b/modules/network/network-config-types.ts @@ -102,13 +102,18 @@ export interface NetworkData { config: string; }; balancer: { - vaultV2Address: string; - v2DefaultSwapFeePercentage: string; - v2DefaultYieldFeePercentage: string; - vaultV3Address: string; - v3DefaultSwapFeePercentage: string; - v3DefaultYieldFeePercentage: string; - tokenAdmin?: string; + v2: { + vaultAddress: string; + defaultSwapFeePercentage: string; + defaultYieldFeePercentage: string; + tokenAdmin?: string; + }; + v3: { + vaultAddress: string; + defaultSwapFeePercentage: string; + defaultYieldFeePercentage: string; + tokenAdmin?: string; + }; }; multicall: string; multicall3: string; diff --git a/modules/network/optimism.ts b/modules/network/optimism.ts index 68c567cc2..184b83a87 100644 --- a/modules/network/optimism.ts +++ b/modules/network/optimism.ts @@ -73,12 +73,16 @@ const optimismNetworkData: NetworkData = { config: '0x32acb44fc929339b9f16f0449525cc590d2a23f3', }, balancer: { - vaultV2Address: '0xba12222222228d8ba445958a75a0704d566bf2c8', - v2DefaultSwapFeePercentage: '0.5', - v2DefaultYieldFeePercentage: '0.5', - vaultV3Address: '0xba12222222228d8ba445958a75a0704d566bf2c8', - v3DefaultSwapFeePercentage: '0.5', - v3DefaultYieldFeePercentage: '0.5', + v2: { + vaultAddress: '0xba12222222228d8ba445958a75a0704d566bf2c8', + defaultSwapFeePercentage: '0.5', + defaultYieldFeePercentage: '0.5', + }, + v3: { + vaultAddress: '0xba12222222228d8ba445958a75a0704d566bf2c8', + defaultSwapFeePercentage: '0.5', + defaultYieldFeePercentage: '0.5', + }, }, multicall: '0x2dc0e2aa608532da689e89e237df582b783e552c', multicall3: '0xca11bde05977b3631167028862be2a173976ca11', diff --git a/modules/network/polygon.ts b/modules/network/polygon.ts index 9f97bb7e6..a15be06fb 100644 --- a/modules/network/polygon.ts +++ b/modules/network/polygon.ts @@ -68,12 +68,16 @@ const polygonNetworkData: NetworkData = { config: '0xfdc2e9e03f515804744a40d0f8d25c16e93fbe67', }, balancer: { - vaultV2Address: '0xba12222222228d8ba445958a75a0704d566bf2c8', - v2DefaultSwapFeePercentage: '0.5', - v2DefaultYieldFeePercentage: '0.5', - vaultV3Address: '0xba12222222228d8ba445958a75a0704d566bf2c8', - v3DefaultSwapFeePercentage: '0.5', - v3DefaultYieldFeePercentage: '0.5', + v2: { + vaultAddress: '0xba12222222228d8ba445958a75a0704d566bf2c8', + defaultSwapFeePercentage: '0.5', + defaultYieldFeePercentage: '0.5', + }, + v3: { + vaultAddress: '0xba12222222228d8ba445958a75a0704d566bf2c8', + defaultSwapFeePercentage: '0.5', + defaultYieldFeePercentage: '0.5', + }, }, multicall: '0x275617327c958bd06b5d6b871e7f491d76113dd8', multicall3: '0xca11bde05977b3631167028862be2a173976ca11', diff --git a/modules/network/sepolia.ts b/modules/network/sepolia.ts index 6ed5b07ad..2f36679aa 100644 --- a/modules/network/sepolia.ts +++ b/modules/network/sepolia.ts @@ -65,12 +65,16 @@ export const sepoliaNetworkData: NetworkData = { // delegationProxy: '0x81cfae226343b24ba12ec6521db2c79e7aeeb310', // }, balancer: { - vaultV2Address: '0xba12222222228d8ba445958a75a0704d566bf2c8', - v2DefaultSwapFeePercentage: '0.5', - v2DefaultYieldFeePercentage: '0.5', - vaultV3Address: '0xba12222222228d8ba445958a75a0704d566bf2c8', - v3DefaultSwapFeePercentage: '0.5', - v3DefaultYieldFeePercentage: '0.5', + v2: { + vaultAddress: '0xba12222222228d8ba445958a75a0704d566bf2c8', + defaultSwapFeePercentage: '0.5', + defaultYieldFeePercentage: '0.5', + }, + v3: { + vaultAddress: '0xba12222222228d8ba445958a75a0704d566bf2c8', + defaultSwapFeePercentage: '0.5', + defaultYieldFeePercentage: '0.5', + }, }, multicall: '0x80c7dd17b01855a6d2347444a0fcc36136a314de', multicall3: '0xca11bde05977b3631167028862be2a173976ca11', diff --git a/modules/network/zkevm.ts b/modules/network/zkevm.ts index 2732e83f2..8c82e27e9 100644 --- a/modules/network/zkevm.ts +++ b/modules/network/zkevm.ts @@ -66,12 +66,16 @@ const zkevmNetworkData: NetworkData = { delegationProxy: '0xc7e5ed1054a24ef31d827e6f86caa58b3bc168d7', }, balancer: { - vaultV2Address: '0xba12222222228d8ba445958a75a0704d566bf2c8', - v2DefaultSwapFeePercentage: '0.5', - v2DefaultYieldFeePercentage: '0.5', - vaultV3Address: '0xba12222222228d8ba445958a75a0704d566bf2c8', - v3DefaultSwapFeePercentage: '0.5', - v3DefaultYieldFeePercentage: '0.5', + v2: { + vaultAddress: '0xba12222222228d8ba445958a75a0704d566bf2c8', + defaultSwapFeePercentage: '0.5', + defaultYieldFeePercentage: '0.5', + }, + v3: { + vaultAddress: '0xba12222222228d8ba445958a75a0704d566bf2c8', + defaultSwapFeePercentage: '0.5', + defaultYieldFeePercentage: '0.5', + }, }, multicall: '0xca11bde05977b3631167028862be2a173976ca11', multicall3: '0xca11bde05977b3631167028862be2a173976ca11', diff --git a/modules/pool/lib/pool-on-chain-data.service.ts b/modules/pool/lib/pool-on-chain-data.service.ts index 11e43a46d..4371ffbd5 100644 --- a/modules/pool/lib/pool-on-chain-data.service.ts +++ b/modules/pool/lib/pool-on-chain-data.service.ts @@ -31,9 +31,9 @@ export class PoolOnChainDataService { private get options() { return { chain: networkContext.chain, - vaultAddress: networkContext.data.balancer.vaultV2Address, - yieldProtocolFeePercentage: networkContext.data.balancer.v2DefaultYieldFeePercentage, - swapProtocolFeePercentage: networkContext.data.balancer.v2DefaultSwapFeePercentage, + vaultAddress: networkContext.data.balancer.v2.vaultAddress, + yieldProtocolFeePercentage: networkContext.data.balancer.v2.defaultSwapFeePercentage, + swapProtocolFeePercentage: networkContext.data.balancer.v2.defaultSwapFeePercentage, gyroConfig: networkContext.data.gyro?.config, }; } diff --git a/modules/pool/lib/pool-sync.service.ts b/modules/pool/lib/pool-sync.service.ts index 31615575a..43e94c5d7 100644 --- a/modules/pool/lib/pool-sync.service.ts +++ b/modules/pool/lib/pool-sync.service.ts @@ -20,7 +20,7 @@ export class PoolSyncService { } get vaultAddress() { - return networkContext.data.balancer.vaultV2Address; + return networkContext.data.balancer.v2.vaultAddress; } get rpcUrl() { diff --git a/modules/sor/balancer-sor.test.ts b/modules/sor/balancer-sor.test.ts index 0a7261f9e..3154ac27d 100644 --- a/modules/sor/balancer-sor.test.ts +++ b/modules/sor/balancer-sor.test.ts @@ -1,4 +1,4 @@ -import { BalancerSorService } from './balancer-sor.service'; +import { BalancerSorService } from './sorV1Beets/balancer-sor.service'; import { tokenService } from '../token/token.service'; import { poolService } from '../pool/pool.service'; diff --git a/modules/sor/sorV1Beets/balancer-sor.service.ts b/modules/sor/sorV1Beets/balancer-sor.service.ts index 7c2960993..8388cf743 100644 --- a/modules/sor/sorV1Beets/balancer-sor.service.ts +++ b/modules/sor/sorV1Beets/balancer-sor.service.ts @@ -320,7 +320,7 @@ export class BalancerSorService { private queryBatchSwap(swapType: SwapTypes, swaps: SwapV2[], assets: string[]): Promise { const vaultContract = new Contract( - networkContext.data.balancer.vaultV2Address, + networkContext.data.balancer.v2.vaultAddress, VaultAbi, networkContext.provider, ); diff --git a/modules/user/lib/user-sync-wallet-balance.service.ts b/modules/user/lib/user-sync-wallet-balance.service.ts index 1a5ec9fd0..9dfb59284 100644 --- a/modules/user/lib/user-sync-wallet-balance.service.ts +++ b/modules/user/lib/user-sync-wallet-balance.service.ts @@ -42,7 +42,7 @@ export class UserSyncWalletBalanceService { } get vaultAddress() { - return AllNetworkConfigs[this.chainId].data.balancer.vaultV2Address; + return AllNetworkConfigs[this.chainId].data.balancer.v2.vaultAddress; } get fbeetsAddress() { diff --git a/modules/vebal/balancer-token-admin.service.ts b/modules/vebal/balancer-token-admin.service.ts index 9fb51ad96..b058f2842 100644 --- a/modules/vebal/balancer-token-admin.service.ts +++ b/modules/vebal/balancer-token-admin.service.ts @@ -5,7 +5,7 @@ import { networkContext } from '../network/network-context.service'; export async function getInflationRate(): Promise { if (networkContext.isMainnet) { - const tokenAdmin = new Contract(networkContext.data.balancer.tokenAdmin!, abi, networkContext.provider); + const tokenAdmin = new Contract(networkContext.data.balancer.v2.tokenAdmin!, abi, networkContext.provider); const inflationRate = await tokenAdmin.getInflationRate(); return inflationRate; } else {