File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed
projects/avalon-finance-usda Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change 1
1
const ADDRESSES = require ( '../helper/coreAssets.json' )
2
2
const { sumTokensExport } = require ( "../helper/unwrapLPs" ) ;
3
+ const { function_view } = require ( "../helper/chain/aptos" )
3
4
4
5
const v2Config = {
5
6
ethereum : {
@@ -45,13 +46,24 @@ const v3Config = {
45
46
}
46
47
}
47
48
48
- const move = {
49
+ const v3MoveConfig = {
49
50
move : {
50
51
treasuryAddress : '0xb79ef25caca96b35a45d58d771f162bd4c2e87984a2776a1cb029d7941cc9af8' ,
51
52
fbtcAddress : '0x16e733c5c943d78dbbaf1fc5beebbcc8db4ed647d2bdfcab74c2a527184a16aa'
52
53
} ,
53
54
}
54
55
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
+
55
67
module . exports = {
56
68
methodology : `FBTC, LFBTC and WFBTC as collateral` ,
57
69
}
@@ -75,9 +87,8 @@ Object.keys(v3Config).forEach(chain => {
75
87
} )
76
88
77
89
// Movement
78
- Object . keys ( move ) . forEach ( chain => {
79
- const { treasuryAddress, fbtcAddress } = move [ chain ]
90
+ Object . keys ( v3MoveConfig ) . forEach ( chain => {
80
91
module . exports [ chain ] = {
81
- tvl : sumTokensExport ( { owners : [ treasuryAddress ] , tokens : [ fbtcAddress ] } ) ,
92
+ tvl : getMovementTvl ,
82
93
}
83
94
} )
You can’t perform that action at this time.
0 commit comments