Skip to content

Commit

Permalink
helix markets tvl adapter (#10050)
Browse files Browse the repository at this point in the history
  • Loading branch information
BitGonzi authored May 1, 2024
1 parent d40a4ff commit 6c76d31
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions projects/helix-markets/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
const { get } = require('../helper/http')
const { toUSDTBalances } = require('../helper/balances')

module.exports = {
misrepresentedTokens: true,
icp: { tvl },
}

async function tvl() {
const url = 'https://dgw.helixic.io/api/v1/tvl';
try {
const data = await get(url);
let totalVolumeNotional = 0;
data.forEach(asset => {
totalVolumeNotional += parseFloat(asset.volumeNotional);
});
return toUSDTBalances(totalVolumeNotional);
} catch (error) {
console.error('Error fetching TVL:', error);
return toUSDTBalances(0);
}
}

0 comments on commit 6c76d31

Please sign in to comment.