This commit is contained in:
0xpeluche
2025-05-12 13:57:53 +02:00
committed by GitHub
parent ecf9359b9b
commit fc1d27a082

View File

@@ -3,11 +3,18 @@ const ADDRESSES = require('../helper/coreAssets.json')
const { call, sumTokens } = require("../helper/chain/ton");
const evaaPoolAssets = require("./evaaPoolAssets");
const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms))
async function borrowed(api) {
for (const poolAssets of Object.values(evaaPoolAssets)) {
for (const { assetId, address } of poolAssets.assets) {
const [_totalSupply, totalBorrow] = await call({ target: poolAssets.poolAddress, abi: 'getAssetTotals', params: [["int", assetId]] });
const [_totalSupply, totalBorrow] = await call({
target: poolAssets.poolAddress,
abi: 'getAssetTotals',
params: [["int", assetId]]
});
api.add(address, totalBorrow)
await sleep(3000)
}
}
}
@@ -19,7 +26,5 @@ async function tvl(api) {
module.exports = {
methodology: 'Counts the supply of EVAA\'s asset pools as TVL.',
ton: {
tvl, borrowed,
}
ton: { tvl, borrowed }
}