Skip to content

Commit

Permalink
Phoenix DeFi Hub TVL Adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
msteiner96 committed Jul 19, 2024
1 parent c6087e2 commit 689c820
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions projects/phoenix-hub/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const utils = require("../helper/utils");
const {toUSDTBalances} = require("../helper/balances");

async function tvl() {
// Fetch all tickers
const tickers = await utils.fetchURL("https://api-phoenix.decentrio.ventures/tickers");

// Sum up the tvl
const totalTVL = tickers.data.reduce((acc, t) => acc + t.liquidity_in_usd, 0);
return toUSDTBalances(totalTVL);
}

module.exports = {
methodology: 'counts the liquidity on all Phoenix Hub AMM Pools.',
stellar: {
tvl,
}
};

0 comments on commit 689c820

Please sign in to comment.