Skip to content

Commit 64b4270

Browse files
committed
update apexdefi
1 parent 58377a7 commit 64b4270

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

projects/apexdefi/index.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,16 @@ async function _staking(api) {
1515
}
1616

1717
module.exports.methodology = "The Apex DeFi factory contract address is used to obtain the balances held in each token contract as liquidity and the staking contract is used to get the staked APEX balance.";
18-
module.exports.misrepresentedTokens = true
1918

2019
Object.keys(config).forEach(chain => {
21-
const { factory,wrapperFactory, } = config[chain]
20+
const { factory, wrapperFactory, } = config[chain]
2221
module.exports[chain] = {
2322
tvl: async (api) => {
2423
// count the value of erc20 wrapped and deposited in the pools
2524
if (wrapperFactory) {
26-
const wrapperPools = await api.fetchList({ lengthAbi: 'allWrappersLength', itemAbi: 'allWrappers', target: wrapperFactory })
27-
const erc314Tokens = await api.multiCall({ abi: 'address:wrappedToken', calls: wrapperPools})
28-
// this is a hack, summing value of gas tokens in the contract and assuming it matches the value of wrapped tokens in the pools
29-
await api.sumTokens({ owners:erc314Tokens, tokens: [ADDRESSES.null] })
25+
const wrapperPools = await api.fetchList({ lengthAbi: 'allWrappersLength', itemAbi: 'allWrappers', target: wrapperFactory })
26+
const tokens = await api.multiCall({ abi: 'address:originalToken', calls: wrapperPools })
27+
await api.sumTokens({ tokensAndOwners2: [tokens, wrapperPools]})
3028
}
3129

3230
const tokens = await api.call({ abi: 'address[]:getAllTokens', target: factory })

0 commit comments

Comments
 (0)