Skip to content

Commit

Permalink
fix: bril-finance (outdated) (#11660)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xpeluche authored Sep 17, 2024
1 parent 763a6a5 commit 5b15a25
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions projects/bril-finance/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@ Object.keys(config).forEach(chain => {
const areStrategiesEnabled = await api.multiCall({ abi: factory_abi.isStrategyEnabled, calls: strategies, target: factory });
const enabledStrategies = strategies.filter((s, index) => areStrategiesEnabled[index]);

const balances = await api.multiCall({ abi: abi.vaultAmounts, calls: enabledStrategies, });
const balances = await api.multiCall({ abi: abi.vaultAmounts, calls: enabledStrategies, permitFailure: true });
const summaries = await api.multiCall({ abi: abi.vaultSummary, calls: enabledStrategies, permitFailure: true, });

for (let i = 0; i < balances.length; i++) {
if (!summaries[i]) continue;
api.add(summaries[i].baseToken_, balances[i].baseTotal_);
api.add(summaries[i].scarceToken_, balances[i].scarceTotal_);
const balance = balances[i]
const summary = summaries[i]
if (!balance || !summary) continue;
api.add(summary.baseToken_, balance.baseTotal_);
api.add(summary.scarceToken_, balance.scarceTotal_);
}
}
}
Expand Down

0 comments on commit 5b15a25

Please sign in to comment.