Skip to content

Commit

Permalink
[SCR-76] Borrow Decimals Issue Layerbank (#15)
Browse files Browse the repository at this point in the history
fix borrow decimals
  • Loading branch information
melotik authored Jul 9, 2024
1 parent 0753a99 commit 8ac9d55
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions adapters/layerbank/src/sdk/marketDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -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}`);

Expand Down

0 comments on commit 8ac9d55

Please sign in to comment.