@@ -2,7 +2,11 @@ const sui = require("../helper/chain/sui");
2
2
3
3
const UNI_HOUSE_OBJ_ID = "0x75c63644536b1a7155d20d62d9f88bf794dc847ea296288ddaf306aa320168ab"
4
4
5
+ const UPUSD = "0x5de877a152233bdd59c7269e2b710376ca271671e9dd11076b1ff261b2fd113c::up_usd::UP_USD"
6
+ const UPUSD_FACTORY = "0x35507cec814a779e23393aa8e17746c51e38fb5efa18afdc8434a670da4d3338"
7
+
5
8
async function tvl ( api ) {
9
+ //Unihouse
6
10
const unihouseDynamicFields = await sui . getDynamicFieldObjects ( {
7
11
parent : UNI_HOUSE_OBJ_ID ,
8
12
} ) ;
@@ -23,13 +27,31 @@ async function tvl(api) {
23
27
const housePool = house ?. fields ?. house_pool ;
24
28
const houseTvl = Number ( housePipeDebt ) + Number ( housePool ) ;
25
29
26
- api . add ( coinType , houseTvl ) ;
30
+ // api.add(coinType, houseTvl);
27
31
28
32
const pipeDebt = house ?. fields ?. pipe_debt ?. fields ?. value ;
29
33
const _tvl = Number ( pipeDebt ) + Number ( house ?. fields ?. pool ) ;
30
34
31
- api . add ( coinType , _tvl ) ;
35
+
36
+ if ( coinType === UPUSD || coinType === "0x49f123d62df1db5a735463f3817dcd53aa084173cbe4593db6b30647b9801cb8::unihouse::FeeTag, 0x49f123d62df1db5a735463f3817dcd53aa084173cbe4593db6b30647b9801cb8::unihouse::HouseFeeConfig" ) {
37
+ continue ;
38
+ } else {
39
+ console . log ( `${ coinType } ` , houseTvl + _tvl ) ;
40
+
41
+ api . add ( coinType , houseTvl + _tvl ) ;
42
+ }
43
+
32
44
}
45
+
46
+ // UPUSD
47
+ const upusd_factory = await sui . getObject ( UPUSD_FACTORY )
48
+
49
+ const upusd_tvl = upusd_factory ?. fields ?. basic_supply ?. fields ?. supply ;
50
+
51
+ console . log ( `${ UPUSD } ` , upusd_tvl ) ;
52
+
53
+ api . add ( "0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC" , upusd_tvl ) ;
54
+
33
55
}
34
56
35
57
module . exports = {
0 commit comments