Skip to content

Commit

Permalink
Merge pull request #1052 from kayisgood/master
Browse files Browse the repository at this point in the history
add navi-protocol adaptor
  • Loading branch information
waynebruce0x authored Oct 26, 2023
2 parents e172fc6 + 1428118 commit d72fb6d
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/adaptors/navi-protocol/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
const axios = require('axios');

const poolsFunction = async () => {
let pools = await axios.get('https://api-defi.naviprotocol.io/getIndexAssetData');

const arr = [];
Object.entries(pools.data).forEach(([key, val]) => {
arr.push({
chain: 'Sui',
project: 'navi-protocol',
pool: val.pool, // `${ReceivedTokenAddress}-${chain}`
symbol: val.symbol, // symbol of the tokens in pool
tvlUsd: parseFloat(val.total_supply) * parseFloat(val.price),
apyBase: parseFloat(val.supply_rate),
apyReward: parseFloat(val.boosted) > 0 ? parseFloat(val.boosted) : null,
rewardTokens: val.rewardTokens,
poolMeta: null
});
})

return arr;
};

module.exports = {
timetravel: false,
apy: poolsFunction,
url: 'https://app.naviprotocol.io/',
};

0 comments on commit d72fb6d

Please sign in to comment.