Skip to content

Commit 8ac9d55

Browse files
authored
[SCR-76] Borrow Decimals Issue Layerbank (#15)
fix borrow decimals
1 parent 0753a99 commit 8ac9d55

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

adapters/layerbank/src/sdk/marketDetails.ts

+3-9
Original file line numberDiff line numberDiff line change
@@ -130,13 +130,7 @@ export const updateBorrowBalances = async (
130130
);
131131
const marketsByUnderlying: any = {};
132132
for (let marketInfo of marketInfos) {
133-
marketsByUnderlying[marketInfo.underlyingAddress] = {
134-
address: marketInfo.address,
135-
exchangeRate: marketInfo.exchangeRateStored,
136-
decimals: marketInfo.decimals,
137-
tokenAddress: marketInfo.underlyingAddress,
138-
tokenSymbol: marketInfo.underlyingSymbol,
139-
};
133+
marketsByUnderlying[marketInfo.underlyingAddress] = marketInfo;
140134
}
141135

142136
const publicClient = createPublicClient({
@@ -147,9 +141,9 @@ export const updateBorrowBalances = async (
147141
states = states.filter((x) => x.borrowAmount > 0);
148142

149143
console.log(`Will update all borrow balances for ${states.length} states`);
150-
for (var i = 0; i < states.length; i += 500) {
144+
for (var i = 0; i < states.length; i += 1000) {
151145
const start = i;
152-
const end = i + 500;
146+
const end = i + 1000;
153147
var subStates = states.slice(start, end);
154148
console.log(`Updating borrow balances for ${start} - ${end}`);
155149

0 commit comments

Comments
 (0)