Skip to content

Commit

Permalink
Update Lila Provider (#10066)
Browse files Browse the repository at this point in the history
* Update Lila Provider

* minor fix

---------

Co-authored-by: g1nt0ki <[email protected]>
  • Loading branch information
0xrishabh and g1nt0ki authored May 1, 2024
1 parent f10f30e commit 8706afa
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions projects/lila-finance/index.js
Original file line number Diff line number Diff line change
@@ -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])
Expand Down

0 comments on commit 8706afa

Please sign in to comment.