Add Spark Savings v2 (#16761)

This commit is contained in:
Bartlomiej Tarczynski
2025-10-22 10:54:40 +02:00
committed by GitHub
parent f060551a01
commit 31b2c73756

View File

@@ -1,6 +1,9 @@
const CONFIG = {
ethereum: {
susdc: '0xBc65ad17c5C0a2A4D159fa5a503f4992c7B545FE',
sparkVaultUsdc: '0x28B3a8fb53B741A8Fd78c0fb9A6B2393d896a43d',
sparkVaultUsdt: '0xe2e7a17dFf93280dec073C995595155283e3C372',
sparkVaultEth: '0xfE6eb3b609a7C8352A241f7F3A21CEA4e9209B8f',
},
base: {
susdc: '0x3128a0F7f0ea68E7B7c9B00AFa7E41045828e858',
@@ -14,16 +17,23 @@ const CONFIG = {
unichain: {
susdc: '0x14d9143BEcC348920b68D123687045db49a016C6',
},
avax: {
sparkVaultUsdc: '0x28B3a8fb53B741A8Fd78c0fb9A6B2393d896a43d'
}
}
async function tvl(api) {
const savings = CONFIG[api.chain]
const savings = Object.values(CONFIG[api.chain])
const supplyCalls = savings.map((target) => ({
target
}))
const response = await api.call({
const totalSupplies = await api.multiCall({
abi: 'erc20:totalSupply',
target: savings.susdc,
calls: supplyCalls,
})
api.add(savings.susdc, response)
api.add(savings, totalSupplies)
}
module.exports = {