Skip to content

Commit 1b1a09b

Browse files
authored
Add v2 support for Dusa Protocol (#17012)
1 parent 7b3d465 commit 1b1a09b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

projects/dusa/index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
const { queryKey, u8ArrayToString, getTokenBalances, } = require('../helper/chain/massa.js');
22
const { sumTokens2 } = require('../helper/unwrapLPs')
33

4-
const factoryAddress = 'AS1rahehbQkvtynTomfoeLmwRgymJYgktGv5xd1jybRtiJMdu8XX'
4+
const factory1Address = 'AS1rahehbQkvtynTomfoeLmwRgymJYgktGv5xd1jybRtiJMdu8XX'
5+
const factory2Address = "AS127Lxdux4HCUkZL89SrRYR5kq2u8t64Jt3aYj786t6fBF1cZGcu"
56

67
const getPairAddress = async (factoryAddress) => {
78
const transform = val => {
@@ -16,7 +17,9 @@ const getPairAddress = async (factoryAddress) => {
1617
}
1718

1819
async function tvl(api) {
19-
const pools = await getPairAddress(factoryAddress)
20+
const pools1 = await getPairAddress(factory1Address)
21+
const pools2 = await getPairAddress(factory2Address)
22+
const pools = pools1.concat(pools2)
2023
const tokenXs = await queryKey(pools, "TOKEN_X")
2124
const tokenYs = await queryKey(pools, "TOKEN_Y")
2225
const tokenXBalances = await getTokenBalances(tokenXs, pools)

0 commit comments

Comments
 (0)