Skip to content

Commit d60009d

Browse files
aguillong1nt0ki
andauthored
Fix Yupana contract address (DefiLlama#9151)
* Fix Yupana contract address * retain old config for tvl --------- Co-authored-by: g1nt0ki <[email protected]>
1 parent 0154729 commit d60009d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

projects/yupana/index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,19 @@ const {
44
getBigMapById,
55
sumTokens2,
66
} = require("../helper/chain/tezos");
7+
78
const YUPANA_CORE = "KT1Rk86CX85DjBKmuyBhrCyNsHyudHVtASec";
9+
const YUPANA_CORE_V2 = "KT1CojtgtVHVarS135fnV3y4z8TiKXrsRHJr"; // https://twitter.com/YupanaFinance/status/1739216683728797802
810

911
async function tvl() {
10-
return sumTokens2({ owners: [YUPANA_CORE], includeTezos: true, })
12+
return sumTokens2({ owners: [YUPANA_CORE, YUPANA_CORE_V2], includeTezos: true, })
1113
}
1214

1315
async function borrowed() {
1416
const balances = {};
17+
await Promise.all([YUPANA_CORE, YUPANA_CORE_V2].map(addBorrowed));
18+
19+
async function addBorrowed(YUPANA_CORE) {
1520
const storage = await getStorage(YUPANA_CORE);
1621
const tokens_map = await getBigMapById(storage.storage.tokens);
1722
for (const id in tokens_map) {
@@ -26,6 +31,7 @@ async function borrowed() {
2631
token_address = `${token.mainToken.fA12}`;
2732
sdk.util.sumSingleBalance(balances, token_address, token_borrows, 'tezos');
2833
}
34+
}
2935
return balances
3036
}
3137

0 commit comments

Comments
 (0)