From 8ac9d551e92d78a35ec678e5ca7b5e54cebc3289 Mon Sep 17 00:00:00 2001 From: Dylan Melotik <60583747+melotik@users.noreply.github.com> Date: Tue, 9 Jul 2024 07:35:46 -0600 Subject: [PATCH] [SCR-76] Borrow Decimals Issue Layerbank (#15) fix borrow decimals --- adapters/layerbank/src/sdk/marketDetails.ts | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/adapters/layerbank/src/sdk/marketDetails.ts b/adapters/layerbank/src/sdk/marketDetails.ts index 4029408..8b8d22a 100644 --- a/adapters/layerbank/src/sdk/marketDetails.ts +++ b/adapters/layerbank/src/sdk/marketDetails.ts @@ -130,13 +130,7 @@ export const updateBorrowBalances = async ( ); const marketsByUnderlying: any = {}; for (let marketInfo of marketInfos) { - marketsByUnderlying[marketInfo.underlyingAddress] = { - address: marketInfo.address, - exchangeRate: marketInfo.exchangeRateStored, - decimals: marketInfo.decimals, - tokenAddress: marketInfo.underlyingAddress, - tokenSymbol: marketInfo.underlyingSymbol, - }; + marketsByUnderlying[marketInfo.underlyingAddress] = marketInfo; } const publicClient = createPublicClient({ @@ -147,9 +141,9 @@ export const updateBorrowBalances = async ( states = states.filter((x) => x.borrowAmount > 0); console.log(`Will update all borrow balances for ${states.length} states`); - for (var i = 0; i < states.length; i += 500) { + for (var i = 0; i < states.length; i += 1000) { const start = i; - const end = i + 500; + const end = i + 1000; var subStates = states.slice(start, end); console.log(`Updating borrow balances for ${start} - ${end}`);