Skip to content

Commit

Permalink
rm pool2, move dex to tvl
Browse files Browse the repository at this point in the history
  • Loading branch information
codehans committed Jul 19, 2022
1 parent 042cf12 commit 18d6e66
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions projects/kujira/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ async function staking() {
return { [COINGECKO_ID]: parseInt(pool.bonded_tokens) / 10 ** 6 };
}

async function pool2() {
async function tvl() {
const { pairs } = await get("https://api.kujira.app/api/coingecko/pairs");
const balances = {};
await Promise.all(
Expand All @@ -67,20 +67,9 @@ async function pool2() {
return balances;
}

async function tvl(...args) {
const s = await staking(...args);
const p = await pool2(...args);

return [...Object.entries(s), ...Object.entries(p)].reduce((a, [k, v]) => {
sdk.util.sumSingleBalance(a, k, v);
return a;
}, {});
}

module.exports = {
kujira: {
tvl,
pool2,
staking,
},
};

0 comments on commit 18d6e66

Please sign in to comment.