Skip to content

Commit

Permalink
Phoenix DeFi Hub TVL Adapter (DefiLlama#11047)
Browse files Browse the repository at this point in the history
* Phoenix DeFi Hub TVL Adapter

* Add newline to end of file
  • Loading branch information
msteiner96 authored Jul 19, 2024
1 parent fe5409d commit 05cd12a
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 05cd12a

Please sign in to comment.