diff --git a/projects/phoenix-hub/index.js b/projects/phoenix-hub/index.js new file mode 100644 index 0000000000..772a0bb729 --- /dev/null +++ b/projects/phoenix-hub/index.js @@ -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, + } +};