diff --git a/src/constants/chains.ts b/src/constants/chains.ts index f4328f05..13f46f9e 100644 --- a/src/constants/chains.ts +++ b/src/constants/chains.ts @@ -96,8 +96,8 @@ export const CHAIN_AVAILABLES: IChain[] = [ nativeSymbol: 'ARB', logo: '/assets/icons/arb.svg', rpcUrl: [ - {primary: true, url: 'https://arbitrum.llamarpc.com'}, - {primary: false, url: "https://rpc.ankr.com/arbitrum_one"} + {primary: false, url: 'https://arbitrum.llamarpc.com'}, + {primary: true, url: "https://rpc.ankr.com/arbitrum_one"} ].find( (rpc) => rpc.primary )?.url||'', diff --git a/src/context/AaveContext.tsx b/src/context/AaveContext.tsx index 3490b9ad..39b87209 100644 --- a/src/context/AaveContext.tsx +++ b/src/context/AaveContext.tsx @@ -103,16 +103,18 @@ export const AaveProvider = ({ children }: { children: React.ReactNode }) => { return; } console.log("[INFO] {{AaveProvider}} fetchPools... "); - const reserves = await Promise.all( - markets.map((market) => getPools({ market, currentTimestamp })) - ) - .then((r) => r.flat()) - .catch((error) => { - console.error("[ERROR] {{AaveProvider}} fetchPools: ", error); - return []; - }); + const reserves = []; + for (let i = 0; i < markets.length; i++) { + const market = markets[i]; + const pools = await getPools({ market, currentTimestamp }) + .then((r) => r.flat()) + .catch((error) => { + console.error("[ERROR] {{AaveProvider}} fetchPools: ", error); + return []; + }); + reserves.push(...pools); + } console.log("[INFO] {{AaveProvider}} fetchPools done: ", { reserves }); - // groups poolReserves by symbol (e.g. DAI, USDC, USDT, ...) const poolGroups: IPoolGroup[] = reserves .filter(reserve =>