From 0c1faa96b8fa7af7b4f69eab3eb50484e09d1f0e Mon Sep 17 00:00:00 2001 From: g1nt0ki <99907941+g1nt0ki@users.noreply.github.com> Date: Mon, 13 May 2024 12:08:51 +0530 Subject: [PATCH] Add equation v3 and refactor code (#10187) * add equation v3 * code refactor --------- Co-authored-by: waldo --- projects/equation-v3/index.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 projects/equation-v3/index.js diff --git a/projects/equation-v3/index.js b/projects/equation-v3/index.js new file mode 100644 index 000000000000..c9ec82b16a8f --- /dev/null +++ b/projects/equation-v3/index.js @@ -0,0 +1,13 @@ +const config = { + arbitrum: { marketManager: "0xDe2b77bcbAEf4C5ECE3b827B21fbD8556e8Fa5a4", } +} + +Object.keys(config).forEach(chain => { + const { marketManager, } = config[chain] + module.exports[chain] = { + tvl: async (api) => { + const token = await api.call({ abi: 'address:USD', target: marketManager }) + return api.sumTokens({ owner: marketManager, tokens: [token] }) + } + } +}) \ No newline at end of file