Skip to content

Commit fe28133

Browse files
committed
chore: update move tvl function
1 parent ead9f78 commit fe28133

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

projects/avalon-finance-usda/index.js

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const ADDRESSES = require('../helper/coreAssets.json')
22
const { sumTokensExport } = require("../helper/unwrapLPs");
3+
const { function_view } = require("../helper/chain/aptos")
34

45
const v2Config = {
56
ethereum: {
@@ -45,13 +46,24 @@ const v3Config = {
4546
}
4647
}
4748

48-
const move = {
49+
const v3MoveConfig = {
4950
move: {
5051
treasuryAddress: '0xb79ef25caca96b35a45d58d771f162bd4c2e87984a2776a1cb029d7941cc9af8',
5152
fbtcAddress: '0x16e733c5c943d78dbbaf1fc5beebbcc8db4ed647d2bdfcab74c2a527184a16aa'
5253
},
5354
}
5455

56+
57+
const getMovementTvl = async (api) => {
58+
const primary_fungible_asset_balance = "0x1::primary_fungible_store::balance"
59+
const tvl = await function_view({
60+
"functionStr": primary_fungible_asset_balance,
61+
"type_arguments": ["0x1::fungible_asset::Metadata"],
62+
"args": [v3MoveConfig.move.treasuryAddress, v3MoveConfig.move.fbtcAddress]
63+
})
64+
return tvl
65+
}
66+
5567
module.exports = {
5668
methodology: `FBTC, LFBTC and WFBTC as collateral`,
5769
}
@@ -75,9 +87,8 @@ Object.keys(v3Config).forEach(chain => {
7587
})
7688

7789
// Movement
78-
Object.keys(move).forEach(chain => {
79-
const { treasuryAddress, fbtcAddress } = move[chain]
90+
Object.keys(v3MoveConfig).forEach(chain => {
8091
module.exports[chain] = {
81-
tvl: sumTokensExport({ owners: [treasuryAddress], tokens: [fbtcAddress] }),
92+
tvl: getMovementTvl,
8293
}
8394
})

0 commit comments

Comments
 (0)