Skip to content

Commit

Permalink
Add Nucleus adapter (#12663)
Browse files Browse the repository at this point in the history
  • Loading branch information
DashanMcCain authored Dec 11, 2024
1 parent 08a6e11 commit ebfcf6e
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions projects/nucleus/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
const { getConfig } = require("../helper/cache");

async function getMarkets() {
return getConfig('nucleus-vaults', "https://backend.nucleusearn.io/v1/protocol/markets");
}

async function getTokens() {
return getConfig('nucleus-tokens', "https://backend.nucleusearn.io/v1/protocol/tokens");
}


const tvl = async (api) => {

const vaultMap = await getMarkets();
const owners = Object.keys(vaultMap);
const tokens = await getTokens();

return api.sumTokens({ owners, tokens })
};

module.exports = {
ethereum: {
tvl,
},
};

0 comments on commit ebfcf6e

Please sign in to comment.