diff --git a/projects/nucleus/index.js b/projects/nucleus/index.js new file mode 100644 index 000000000000..83a30e462c38 --- /dev/null +++ b/projects/nucleus/index.js @@ -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, + }, + }; \ No newline at end of file