From 8706afa99d076e7dd4db5fbb84fc9d9381faf61b Mon Sep 17 00:00:00 2001 From: Rishabh Shukla <38362547+0xrishabh@users.noreply.github.com> Date: Wed, 1 May 2024 16:23:33 +0530 Subject: [PATCH] Update Lila Provider (#10066) * Update Lila Provider * minor fix --------- Co-authored-by: g1nt0ki <99907941+g1nt0ki@users.noreply.github.com> --- projects/lila-finance/index.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/projects/lila-finance/index.js b/projects/lila-finance/index.js index d9063eaffe42..5a0817457045 100644 --- a/projects/lila-finance/index.js +++ b/projects/lila-finance/index.js @@ -1,8 +1,12 @@ const ADDRESSES = require('../helper/coreAssets.json') -const pools_provider = "0xE4534d76Cc512a14F288453F06F8961740Ae2a1E" +const pools_providers = ["0xE4534d76Cc512a14F288453F06F8961740Ae2a1E", '0x993e06adeb3050a1Df385E05a2deb4b15a0DBCBF'] async function tvl(api) { - let data = await api.fetchList({ lengthAbi: 'poolLength', itemAbi: 'function poolList(uint256) view returns (uint256 maxAmount, address strategy, address asset, uint64 payoutFrequency, uint32 totalPayments, uint32 rateIndex)', target: pools_provider}) + let data = [] + for(const pools_provider of pools_providers){ + const _data = await api.fetchList({ lengthAbi: 'poolLength', itemAbi: 'function poolList(uint256) view returns (uint256 maxAmount, address strategy, address asset, uint64 payoutFrequency, uint32 totalPayments, uint32 rateIndex)', target: pools_provider}) + data = data.concat(_data) + } data = data.filter(i => i.strategy !== ADDRESSES.null) const aTokens = await api.multiCall({ abi: 'address:aToken', calls: data.map(i => i.strategy)}) const ownerTokens = data.map((i, idx) => [[i.asset, aTokens[idx]], i.strategy])