From 7c74665cdb369cea21a20549e3a67d6fcf185dd6 Mon Sep 17 00:00:00 2001 From: noah-wasd3r Date: Thu, 24 Oct 2024 01:43:03 +0000 Subject: [PATCH 1/3] add astar --- projects/synstation/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/projects/synstation/index.js b/projects/synstation/index.js index 666e1c35bc1a..d7c9dac062ae 100644 --- a/projects/synstation/index.js +++ b/projects/synstation/index.js @@ -1,7 +1,8 @@ const { sumUnknownTokens } = require("../helper/unknownTokens") const config = { - ethereum: "0x3BaC111A6F5ED6A554616373d5c7D858d7c10d88" + ethereum: "0x3BaC111A6F5ED6A554616373d5c7D858d7c10d88", + astar: "0xe9B85D6A1727d4B22595bab40018bf9B7407c677" } Object.keys(config).forEach(chain => { From 8ef3c544375ef9a57accfad842dda966d7aa7c9e Mon Sep 17 00:00:00 2001 From: noah-wasd3r Date: Wed, 15 Jan 2025 05:42:14 +0000 Subject: [PATCH 2/3] feat: update soneium erc4626, univ3 --- projects/synstation/index.js | 54 ++++++++++++++++++++++++++++++------ 1 file changed, 45 insertions(+), 9 deletions(-) diff --git a/projects/synstation/index.js b/projects/synstation/index.js index d7c9dac062ae..8ab7dcf48df6 100644 --- a/projects/synstation/index.js +++ b/projects/synstation/index.js @@ -1,20 +1,56 @@ const { sumUnknownTokens } = require("../helper/unknownTokens") + +const { uniV3Export } = require('../helper/uniswapV3') +const { mergeExports } = require("../helper/utils") + const config = { - ethereum: "0x3BaC111A6F5ED6A554616373d5c7D858d7c10d88", - astar: "0xe9B85D6A1727d4B22595bab40018bf9B7407c677" + ethereum: {preStaking:"0x3BaC111A6F5ED6A554616373d5c7D858d7c10d88"}, + astar: {preStaking:"0xe9B85D6A1727d4B22595bab40018bf9B7407c677"}, + soneium: { + vaults: [ + "0x3BaC111A6F5ED6A554616373d5c7D858d7c10d88", // astar, + "0x2C7f58d2AfaCae1199c7e1E00FB629CCCEA5Bbd5", // usdc.e + "0x6A31048E5123859cf50F865d5a3050c18E77fFAe", // usdt + "0xefb3Cc73a5517c9825aE260468259476e7965c5E", // weth + "0x74dFFE1e68f41ec364517f1F2951047246c5DD4e", // nsASTR + "0x467b43ede72543FC0FD79c7085435A484a87e0D7", // nrETH + ], + v3Factory: "0x81B4029bfCb5302317fe5d35D54544EA3328e30f" +} } -Object.keys(config).forEach(chain => { - const prestakingAddress = config[chain] - module.exports[chain] = { - tvl: async (api) => { - const data = await api.fetchList({ lengthAbi: 'uint256:poolLength', itemAbi: 'function poolInfo(uint256) view returns (address want, uint256 totalDeposited,uint256,uint256)', target: prestakingAddress, }) +const exportsData = Object.keys(config).map((chain) => { + return {[chain] : { + tvl: async (api) => { + const results = []; + + const vaults = config[chain].vaults; + if(vaults) { + const data =await api.multiCall({ abi: 'address:asset', calls: vaults, permitFailure: true, }) + const tokens = data; + const bals = await api.multiCall({ abi: 'uint256:totalAssets', calls: vaults, permitFailure: true, }) + bals.forEach((v, i) => v && api.add(tokens[i], v)) + } + + const prestakingAddress = config[chain].preStaking; + if(prestakingAddress) { + + const data = await api.fetchList({ lengthAbi: 'uint256:poolLength', itemAbi: 'function poolInfo(uint256) view returns (address want, uint256 totalDeposited,uint256,uint256)', target: prestakingAddress, }) const tokens = data.map(i => i.want) const bals = data.map(i => i.totalDeposited) bals.forEach((v, i) => v && api.add(tokens[i], v)) - return sumUnknownTokens({ api, resolveLP: true, useDefaultCoreAssets: true, }) } + return (sumUnknownTokens({ api, resolveLP: false, useDefaultCoreAssets: true, })) + } - }) \ No newline at end of file + } +} +}) +exportsData.push(uniV3Export({ + soneium: { factory: soneium.v3Factory, fromBlock: 1812231 }, +})) + + +module.exports = mergeExports(exportsData); \ No newline at end of file From ab58f3baf50f74b894a4f8341ae066b437367490 Mon Sep 17 00:00:00 2001 From: noah-wasd3r Date: Wed, 15 Jan 2025 05:44:20 +0000 Subject: [PATCH 3/3] fix typo --- projects/synstation/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/synstation/index.js b/projects/synstation/index.js index 8ab7dcf48df6..e741ea8e9677 100644 --- a/projects/synstation/index.js +++ b/projects/synstation/index.js @@ -49,7 +49,7 @@ const exportsData = Object.keys(config).map((chain) => { } }) exportsData.push(uniV3Export({ - soneium: { factory: soneium.v3Factory, fromBlock: 1812231 }, + soneium: { factory: config.soneium.v3Factory, fromBlock: 1812231 }, }))