Skip to content

Commit 78b43fb

Browse files
nuhbyeg1nt0ki
andauthored
Include Evaa staked balance via USDT pool in TVL (DefiLlama#12425)
Co-authored-by: g1nt0ki <[email protected]>
1 parent 1f632fb commit 78b43fb

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

projects/tonpools/index.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
1-
const { sumTokensExport } = require("../helper/chain/ton");
1+
const { call } = require('../helper/chain/ton')
2+
const { sumTokens } = require("../helper/chain/ton");
23
const ADDRESSES = require("../helper/coreAssets.json");
34

4-
const tonpoolsContractAddress =
5-
"EQA7y9QkiP4xtX_BhOpY4xgVlLM7LPcYUA4QhBHhFZeL4fTa";
5+
const tonpoolsContractAddress = "EQA7y9QkiP4xtX_BhOpY4xgVlLM7LPcYUA4QhBHhFZeL4fTa";
66

7-
const tonpoolUSDTContractAddress =
8-
"EQDrSz9W4tjwnqy1F4z-O4Vkdp8g2YP94cmh12X5RbYpejCw";
7+
const tonpoolUSDTContractAddress = "EQDrSz9W4tjwnqy1F4z-O4Vkdp8g2YP94cmh12X5RbYpejCw";
8+
9+
async function tvl(api) {
10+
const result = await call({ target: tonpoolUSDTContractAddress, abi: 'poolBalances' })
11+
api.add(ADDRESSES.ton.USDT, result[1])
12+
await sumTokens({ api, owners: [tonpoolsContractAddress], tokens: [ADDRESSES.null], })
13+
}
914

1015
module.exports = {
1116
methodology: "Ton Pools's TVL includes all deposited supported assets",
1217
ton: {
13-
tvl: sumTokensExport({
14-
owners: [tonpoolsContractAddress, tonpoolUSDTContractAddress],
15-
tokens: [ADDRESSES.null],
16-
}),
18+
tvl,
1719
},
1820
};
1921

0 commit comments

Comments
 (0)