diff --git a/apps/web/src/state/farmsV4/state/poolApr/fetcher.ts b/apps/web/src/state/farmsV4/state/poolApr/fetcher.ts index ac66c902ca759..fb61178e8ae3f 100644 --- a/apps/web/src/state/farmsV4/state/poolApr/fetcher.ts +++ b/apps/web/src/state/farmsV4/state/poolApr/fetcher.ts @@ -241,7 +241,6 @@ const getV3PoolsCakeAprByChainId = async (pools: V3PoolInfo[], chainId: number, const [totalAllocPoint, latestPeriodCakePerSecond] = await Promise.all([ masterChefV3Cache ? masterChefV3Cache.totalAllocPoint : masterChefV3.read.totalAllocPoint(), masterChefV3Cache ? masterChefV3Cache.latestPeriodCakePerSecond : masterChefV3.read.latestPeriodCakePerSecond(), - getCakePriceFromOracle(), ]) const poolInfoCalls = validPools.map( diff --git a/apps/web/src/state/farmsV4/state/poolApr/hooks.ts b/apps/web/src/state/farmsV4/state/poolApr/hooks.ts index da5a5b12bb0fe..587cb09af3875 100644 --- a/apps/web/src/state/farmsV4/state/poolApr/hooks.ts +++ b/apps/web/src/state/farmsV4/state/poolApr/hooks.ts @@ -97,10 +97,9 @@ export const usePoolAprUpdater = () => { const fetchCakeApr = useCallback( async (newPools: PoolInfo[]) => { if (newPools && newPools.length) { - newPools.forEach((pool) => { - getCakeApr(pool).then((apr) => { - updateCakeApr(apr) - }) + const aprPromises = newPools.map((pool) => getCakeApr(pool)) + Promise.all(aprPromises).then((aprList) => { + updateCakeApr(aprList.reduce((acc, apr) => Object.assign(acc, apr), {} as CakeApr)) }) } },