Skip to content

Commit

Permalink
feat: add manta cedefi
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielZhangReal committed May 23, 2024
1 parent 4db3aff commit a345182
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions projects/manta-cedefi/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
const tokens = [
{
name: "mBTC",
address: "0x1468177DbCb2a772F3d182d2F1358d442B553089",
decimals: 18,
coinGeckoId: "bitcoin",
},
{
name: "mETH",
address: "0xACCBC418a994a27a75644d8d591afC22FaBA594e",
decimals: 18,
coinGeckoId: "ethereum",
},
{
name: "mUSD",
address: "0x649d4524897cE85A864DC2a2D5A11Adb3044f44a",
decimals: 18,
coinGeckoId: "tether",
},
];

async function tvl(api) {
const balances = await api.multiCall({
abi: "erc20:totalSupply",
calls: tokens.map((item) => item.address),
});
return tokens.reduce((total, item, index) => {
total[item.coinGeckoId] = balances[index] / 10 ** tokens[index].decimals;
return total;
}, {});
}

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

0 comments on commit a345182

Please sign in to comment.