File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -4,14 +4,19 @@ const {
4
4
getBigMapById,
5
5
sumTokens2,
6
6
} = require ( "../helper/chain/tezos" ) ;
7
+
7
8
const YUPANA_CORE = "KT1Rk86CX85DjBKmuyBhrCyNsHyudHVtASec" ;
9
+ const YUPANA_CORE_V2 = "KT1CojtgtVHVarS135fnV3y4z8TiKXrsRHJr" ; // https://twitter.com/YupanaFinance/status/1739216683728797802
8
10
9
11
async function tvl ( ) {
10
- return sumTokens2 ( { owners : [ YUPANA_CORE ] , includeTezos : true , } )
12
+ return sumTokens2 ( { owners : [ YUPANA_CORE , YUPANA_CORE_V2 ] , includeTezos : true , } )
11
13
}
12
14
13
15
async function borrowed ( ) {
14
16
const balances = { } ;
17
+ await Promise . all ( [ YUPANA_CORE , YUPANA_CORE_V2 ] . map ( addBorrowed ) ) ;
18
+
19
+ async function addBorrowed ( YUPANA_CORE ) {
15
20
const storage = await getStorage ( YUPANA_CORE ) ;
16
21
const tokens_map = await getBigMapById ( storage . storage . tokens ) ;
17
22
for ( const id in tokens_map ) {
@@ -26,6 +31,7 @@ async function borrowed() {
26
31
token_address = `${ token . mainToken . fA12 } ` ;
27
32
sdk . util . sumSingleBalance ( balances , token_address , token_borrows , 'tezos' ) ;
28
33
}
34
+ }
29
35
return balances
30
36
}
31
37
You can’t perform that action at this time.
0 commit comments