Skip to content

Commit 2a4f431

Browse files
authored
AO bridge (#17950)
1 parent cd3c988 commit 2a4f431

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

projects/ao-bridge/index.js

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,27 @@
11
const ADDRESSES = require('../helper/coreAssets.json')
2-
const { sumTokensExport } = require("../helper/unwrapLPs");
2+
const { sumTokens2 } = require("../helper/unwrapLPs");
33

44
const bridgeAddresses = {
5-
'stETH': { tokenAddress: ADDRESSES.ethereum.STETH, ownerContractAddress: '0xfE08D40Eee53d64936D3128838867c867602665c' }
5+
stETH: { tokenAddress: ADDRESSES.ethereum.STETH, ownerContractAddress: '0xfE08D40Eee53d64936D3128838867c867602665c' },
6+
sUSDS: { tokenAddress: ADDRESSES.ethereum.sUSDS, ownerContractAddress: '0x7cd01d5cad4ba0caeba02583a5c61d35b23e08eb' },
67
}
78

89
// Convert the object to an array of [tokenAddress, ownerContractAddress] pairs
910
const tokensAndOwners = Object.values(bridgeAddresses).map(({ tokenAddress, ownerContractAddress }) =>
10-
[tokenAddress, ownerContractAddress]
11+
[tokenAddress, ownerContractAddress]
1112
);
1213

1314
module.exports = {
14-
methodology: "TVL is calculated by getting all tokens in the AO bridge and adding up the USD values provided by CoinGecko.",
15-
ethereum: {
16-
tvl: sumTokensExport({
17-
tokensAndOwners
18-
}),
19-
}
20-
};
15+
methodology: "TVL is calculated by getting all tokens in the AO bridge and adding up the USD values provided by CoinGecko.",
16+
ethereum: {
17+
tvl: async (api) => {
18+
await sumTokens2({ api, tokensAndOwners })
19+
// DAI bridge TVL is tracked via the manager's totalDepositedInPublicPools.
20+
const daiDeposited = await api.call({
21+
target: '0x6A1B588B0684dACE1f53C5820111F400B3dbfeBf',
22+
abi: 'uint256:totalDepositedInPublicPools',
23+
})
24+
api.add(ADDRESSES.ethereum.DAI, daiDeposited)
25+
},
26+
}
27+
};

0 commit comments

Comments
 (0)