File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 1
1
const sui = require ( "../helper/chain/sui" ) ;
2
2
3
3
const SAFU_REGISTRY = "0xdc970d638d1489385e49ddb76889748011bac4616b95a51aa63633972b841706" ;
4
+ const FUNDING_VAULT_REGISTRY = "0xeb9e1c94b72cd3e1a4ca2e4d6e9dd61547c0c45c654843e0db03c50ba3c21138" ;
4
5
5
6
async function tvl ( api ) {
7
+ // Safu Vaults
6
8
const fields = await sui . getDynamicFieldObjects ( {
7
9
parent : SAFU_REGISTRY ,
8
10
} ) ;
@@ -12,6 +14,17 @@ async function tvl(api) {
12
14
const deposit_token = "0x" + fields . deposit_token . fields . name ;
13
15
api . add ( deposit_token , fields . share_supply . slice ( 0 , 4 ) ) ;
14
16
} ) ;
17
+
18
+ // Safu Funding Vults
19
+ const fields2 = await sui . getDynamicFieldObjects ( {
20
+ parent : FUNDING_VAULT_REGISTRY ,
21
+ } ) ;
22
+ const safuFundingVaults = fields2 . filter ( ( item ) => item . type . includes ( "Vault" ) ) ;
23
+
24
+ safuFundingVaults . forEach ( ( { fields } ) => {
25
+ const deposit_token = "0x" + fields . token . fields . name ;
26
+ api . add ( deposit_token , fields . info [ 1 ] ) ;
27
+ } ) ;
15
28
}
16
29
17
30
module . exports = {
You can’t perform that action at this time.
0 commit comments