diff --git a/package-lock.json b/package-lock.json index e780464a8e57..c73c96410055 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1009,9 +1009,9 @@ } }, "node_modules/@defillama/sdk": { - "version": "5.0.102", - "resolved": "https://registry.npmjs.org/@defillama/sdk/-/sdk-5.0.102.tgz", - "integrity": "sha512-S+MX9SL02E2IwgpviKIbxEtYjlUkGu8m57e7CjTbRtdyBrGbu1JhsvRCtuKm9Wz+bylX4I7jYbTC2fFdz/vvLg==", + "version": "5.0.107", + "resolved": "https://registry.npmjs.org/@defillama/sdk/-/sdk-5.0.107.tgz", + "integrity": "sha512-dP6la1NUjl8Cgq9f5EjMAJ5xkzQqJfROJgTYvyktVpYjVbPln9QYrFSSfT4ZGycwXq74wuv3yo/Nt/fZv8AEPw==", "dependencies": { "@aws-sdk/client-s3": "^3.400.0", "@elastic/elasticsearch": "^8.13.1", diff --git a/projects/1155Tech/index.js b/projects/1155Tech/index.js index 9fdf80684d0a..f893c7dcf648 100644 --- a/projects/1155Tech/index.js +++ b/projects/1155Tech/index.js @@ -5,6 +5,6 @@ const MARKET_1155TECH_CONTRACT = '0x33b77fAf955Ed3eDAf939ae66C4D7a2D78bc30C6'; module.exports = { methodology: 'Value of all Keys across all art markets is TVL in the protocol', canto: { - tvl: sumTokensExport({ owner: MARKET_1155TECH_CONTRACT, tokens: [ADDRESSES.canto.NOTE] }) + tvl: sumTokensExport({ owner: MARKET_1155TECH_CONTRACT, tokens: ['0x4e71a2e537b7f9d9413d3991d37958c0b5e1e503'] }) } }; \ No newline at end of file diff --git a/projects/9mm-v2/index.js b/projects/9mm-v2/index.js new file mode 100644 index 000000000000..c6d31097e986 --- /dev/null +++ b/projects/9mm-v2/index.js @@ -0,0 +1,12 @@ +const { getUniTVL } = require('../helper/unknownTokens') + +module.exports = { + misrepresentedTokens: true, + methodology: "Factory addresses (0x3a0Fa7884dD93f3cd234bBE2A0958Ef04b05E13b for PulseChain) is used to find the LP pairs. TVL is equal to the liquidity on the AMM.", + pulse: { + tvl: getUniTVL({ + factory: '0x3a0Fa7884dD93f3cd234bBE2A0958Ef04b05E13b', + useDefaultCoreAssets: true, + }), + }, +} \ No newline at end of file diff --git a/projects/9mm-v3/index.js b/projects/9mm-v3/index.js new file mode 100644 index 000000000000..ad02c07b3f23 --- /dev/null +++ b/projects/9mm-v3/index.js @@ -0,0 +1,6 @@ +const { uniV3Export } = require('../helper/uniswapV3') + +module.exports = uniV3Export({ + pulse: { factory: '0xe50dbdc88e87a2c92984d794bcf3d1d76f619c68', fromBlock: 18942139, } , + base: { factory: '0x7b72C4002EA7c276dd717B96b20f4956c5C904E7', fromBlock: 15754625, } +}) \ No newline at end of file diff --git a/projects/Delea/index.js b/projects/Delea/index.js index b285666eac27..bed1da0e6b48 100644 --- a/projects/Delea/index.js +++ b/projects/Delea/index.js @@ -12,6 +12,7 @@ const ownersList = [ module.exports = { methodology: 'Counts Delea smartcontract balance as TVL.', + misrepresentedTokens: true, ton: { tvl: sumTokensExport({ owners: ownersList, tokens: [ADDRESSES.null]}), } diff --git a/projects/FeeFree/index.js b/projects/FeeFree/index.js index 1d46901ddc55..b77357c47170 100644 --- a/projects/FeeFree/index.js +++ b/projects/FeeFree/index.js @@ -1,9 +1,9 @@ const { getLogs2 } = require('../helper/cache/getLogs') const { sumTokens2 } = require('../helper/unwrapLPs') -const EVENT_ABI = 'event Initialize(bytes32 id, address indexed currency0, address indexed currency1, uint24 fee, int24 tickSpacing, address hooks)' +const EVENT_ABI_OLD = 'event Initialize(bytes32 id, address indexed currency0, address indexed currency1, uint24 fee, int24 tickSpacing, address hooks)' -const config = { +const configOLD = { zora: { pool: "0xB43287b2106BC044F07aE674794f5492E851d3dC", router: "0x0Fee97363deEFBE4De038D437D805A98dbEbA400", @@ -16,6 +16,24 @@ const config = { } } +const EVENT_ABI = 'event Initialize(bytes32 indexed id, address indexed currency0, address indexed currency1, uint24 fee, int24 tickSpacing, address hooks, uint160 sqrtPriceX96, int24 tick)' + +const config = { + zora: { + pool: "0x2BB2DeAeF5D4E62D3798Ce67C3D623da09188AB9", + fromBlock: 23864003, + }, + base: { + pool: "0x60B393a76cEa4a3AFff00e1Fb08d0F63A8F4A314", + fromBlock: 23809396, + }, + scroll: { + pool: "0xA407e0637b22e1F64395D177C8EAD26C03dC3294", + fromBlock: 11975196, + } +} + + module.exports = { start: '2024-04-25', // Apr 26 2024 } @@ -24,6 +42,14 @@ Object.keys(config).forEach(chain => { const { pool, fromBlock, } = config[chain] module.exports[chain] = { tvl: async (api) => { + + if (configOLD[chain]) { + const { pool, fromBlock, } = configOLD[chain] + const logs = await getLogs2({ api, factory: pool, eventAbi: EVENT_ABI_OLD, fromBlock, }) + const tokens = logs.map(i => [i.currency0, i.currency1]).flat() + await sumTokens2({ api, owner: pool, tokens, }) + } + const logs = await getLogs2({ api, factory: pool, eventAbi: EVENT_ABI, fromBlock, }) const tokens = logs.map(i => [i.currency0, i.currency1]).flat() return sumTokens2({ api, owner: pool, tokens, }) diff --git a/projects/abracadabra/market.json b/projects/abracadabra/market.json index f9957bf82f64..dd0f5d0a2791 100644 --- a/projects/abracadabra/market.json +++ b/projects/abracadabra/market.json @@ -11,7 +11,9 @@ "0x49De724D7125641F56312EBBcbf48Ef107c8FA57": "0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f", "0x780db9770dDc236fd659A39430A8a7cC07D0C320": "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1", "0x6B04C535C852AD19345571247ee12B5BF23dAcB6": "0x6985884C4392D348587B19cb9eAAf157F13271cd", - "0xFCE0b2fe7d7d5057C82A896e4D8EC0e4b813f71f": "0x58538e6A46E07434d7E7375Bc268D3cb839C0133" + "0xFCE0b2fe7d7d5057C82A896e4D8EC0e4b813f71f": "0x58538e6A46E07434d7E7375Bc268D3cb839C0133", + "0x9fF8b4C842e4a95dAB5089781427c836DAE94831": "0x7C11F78Ce78768518D743E81Fdfa2F860C6b9A77", + "0x625Fe79547828b1B54467E5Ed822a9A8a074bD61": "0x450bb6774Dd8a756274E0ab4107953259d2ac541" }, "avax": { "0x35fA7A723B3B39f15623Ff1Eb26D8701E7D6bB21": "0x0da67235dD5787D67955420C84ca1cEcd4E5Bb3b", diff --git a/projects/agoric/index.js b/projects/agoric/index.js new file mode 100644 index 000000000000..dad9523b7564 --- /dev/null +++ b/projects/agoric/index.js @@ -0,0 +1,58 @@ +const { post } = require('../helper/http') + +const query = ` +query { + vaultManagerMetrics { + nodes { + liquidatingCollateralBrand + totalCollateral + } + } + oraclePrices { + nodes { + typeInAmount + typeOutAmount + typeInName + } + } + boardAuxes { + nodes { + allegedName + decimalPlaces + } + } +} +` + +const coingeckoMapping = { + 'stATOM': 'stride-staked-atom', + 'stkATOM': 'stkatom', + 'ATOM': 'cosmos', + 'stOSMO': 'stride-staked-osmo', + 'stTIA': 'stride-staked-tia', +} +const decimals = {} + +const tvl = async (api) => { + const { data: { vaultManagerMetrics, boardAuxes } } = await post('https://api.subquery.network/sq/agoric-labs/agoric-mainnet-v2', { query }) + + boardAuxes.nodes.forEach(board => { + decimals[board.allegedName] = 10 ** board.decimalPlaces + }) + + vaultManagerMetrics.nodes.forEach(vault => { + const key = vault.liquidatingCollateralBrand + if (!coingeckoMapping[key]) { + throw new Error(`Unknown coin ${key} (coingecko mapping is missing)`) + } + const decimal = decimals[key] ?? 1e6 + const balance = vault.totalCollateral / decimal + api.addCGToken(coingeckoMapping[key], balance) + }) +} + +module.exports = { + agoric: { + tvl, + }, +} diff --git a/projects/ainn-layer2/index.js b/projects/ainn-layer2/index.js index e14235bbff3f..34e9eec3750b 100644 --- a/projects/ainn-layer2/index.js +++ b/projects/ainn-layer2/index.js @@ -1,4 +1,3 @@ -const sdk = require('@defillama/sdk'); const { sumTokensExport } = require('../helper/sumTokens'); const bitcoinAddressBook = require('../helper/bitcoin-book/index.js') @@ -6,9 +5,7 @@ const bitcoinAddressBook = require('../helper/bitcoin-book/index.js') module.exports = { methodology: "Staking tokens via AINN Layer2 Dataset counts as TVL.", bitcoin: { - tvl: sdk.util.sumChainTvls([ - sumTokensExport({ owners: bitcoinAddressBook.ainn }), - ]), + tvl: sumTokensExport({ owners: bitcoinAddressBook.ainn }), }, zklink: { tvl: sumTokensExport({ diff --git a/projects/aixcb/index.js b/projects/aixcb/index.js new file mode 100644 index 000000000000..6a81da4a4c1f --- /dev/null +++ b/projects/aixcb/index.js @@ -0,0 +1,25 @@ +const ADDRESSES = require('../helper/coreAssets.json'); +const { staking } = require("../helper/staking"); + +// Token addresses +const AIXCB_TOKEN = "0x76C71F1703Fbf19FFdcF3051E1e684Cb9934510f"; +const WETH = ADDRESSES.base.WETH; + +// LP and staking addresses +const AERODROME_LP_TOKEN = "0x19C3c7EEfb070EE00ddE367A9768De1DF52cbE5d"; +const LP_STAKING = "0xEE5C223aD4055beE465244d8Cb344fb22DaDa570"; +const AIXCB_STAKING = "0xF5acA5c3a0B70f847dE4652AC77BD601ccFE8339"; + +async function stakingTvl(api) { + const totalStaked = await api.call({ abi: 'uint256:getTotalStaked', target: AIXCB_STAKING, }); + api.add(AIXCB_TOKEN, totalStaked); +} + +module.exports = { + methodology: 'TVL consists of aixCB tokens staked in the AIXCBStaking contract (getTotalStaked) and Aerodrome vAMM-aixCB/WETH LP tokens staked in the AIXCBLPStaking contract (totalStakedAmount).', + base: { + tvl: () => ({}), + staking: stakingTvl, + pool2: staking(LP_STAKING, AERODROME_LP_TOKEN), + }, +}; \ No newline at end of file diff --git a/projects/alphafi/index.js b/projects/alphafi/index.js index b59a51e9e602..6d3d10120082 100644 --- a/projects/alphafi/index.js +++ b/projects/alphafi/index.js @@ -159,6 +159,76 @@ const ALPHAFI_BLUEFIN_TVL_IDS = [ token0Type: "0x2053d08c1e2bd02791056171aab0fd12bd7cd7efad2ab8f6b9c8902f14df2ff2::ausd::AUSD", token1Type: ADDRESSES.sui.USDC_CIRCLE }, + { //sui ausd + poolID: "0x89793208211927a4d1458a59d34b775aaec17af8c98a59a1ba97f7b005c0e587", + parentPoolID: "0xb30df44907da6e9f3c531563f19e6f4a203d70f26f8a33ad57881cd7781e592d", + investorID: "0x275e4df83f6f7b9dc75504d02e5d32f21ca03a5a8b017c622a8b42d3671e2888", + token0Type: ADDRESSES.sui.SUI, + token1Type: "0x2053d08c1e2bd02791056171aab0fd12bd7cd7efad2ab8f6b9c8902f14df2ff2::ausd::AUSD" + }, + { //alpha usdc + poolID: "0x4540c5e7de64088c0c2c30abc51f7e6bbe6bc48703667c108aa1de23f6aa40e6", + parentPoolID: "0x6595edf6d8c8b6894a5c6760843ae2fde81cb37d8586984dd1345b0f00bfecd8", + investorID: "0x187ca6f373d20465a730125c93e62a96c6a73354a1a8b35cbdd2b39278b7b141", + token0Type: "0xfe3afec26c59e874f3c1d60b8203cb3852d2bb2aa415df9548b8d688e6683f93::alpha::ALPHA", + token1Type: ADDRESSES.sui.USDC_CIRCLE + }, + { //wbtc usdc + poolID: "0xbc0de037958d7988710c40f4e7317f8f3ffca4fa3cc9e1c18bc1ebd7ec65cd6e", + parentPoolID: "0x38282481e3a024c50254c31ebfc4710e003fe1b219c0aa31482a860bd58c4ab0", + investorID: "0x9d14a391953d5b853fb22c4135657da341f4db3b341dd4d5f603cfb008e91745", + token0Type: ADDRESSES.sui.WBTC, + token1Type: ADDRESSES.sui.USDC_CIRCLE + }, + { //navx vsui + poolID: "0xf495b997ae10b8bb0996c1ee56a1cc7832daec36a9380e0932e41256d97cabad", + parentPoolID: "0xa0b4fef70ccef039b94512d6384806979d4c201c5e12af9a4b0458454b80da35", + investorID: "0x3672719d64416d0f04575b500e853d9101dfca6488f705856c59ace1999e99d1", + token0Type: "0xa99b8952d4f7d947ea77fe0ecdcc9e5fc0bcab2841d6e2a5aa00c3044e5544b5::navx::NAVX", + token1Type: "0x549e8b69270defbfafd4f94e17ec44cdbdd99820b33bda2278dea3b9a32d3f55::cert::CERT" + }, + { //blue sui + poolID: "0xddecab961380225c95e6a6089660de2e6028170fbc2cd07ab79b8bf45e3c2645", + parentPoolID: "0xde705d4f3ded922b729d9b923be08e1391dd4caeff8496326123934d0fb1c312", + investorID: "0x56f05fc7b81cf45b8b223de9daba1ba82bf4ce32ba0bfa46c2780d78216b2b92", + token0Type: "0xe1b45a0e641b9955a20aa0ad1c1f4ad86aad8afb07296d4085e349a50e90bdca::blue::BLUE", + token1Type: ADDRESSES.sui.SUI + }, + { //blue usdc + poolID: "0x4b28663453af487a81d4fb2ba7c96cccd63978b83f950d3dcf60dd88116e3e91", + parentPoolID: "0x3717c637003c4274f20cde8c4eeadbffa2bbf16d995a0fe0f7bf99c03cf52e61", + investorID: "0xb1a991064c4cbf1d7fb64a01ce8b2e3aa2f7d25b3ff8de7cabc1cb9ccc0fc12f", + token0Type: "0xe1b45a0e641b9955a20aa0ad1c1f4ad86aad8afb07296d4085e349a50e90bdca::blue::BLUE", + token1Type: ADDRESSES.sui.USDC_CIRCLE + }, + { //send usdc + poolID: "0xd5757d9f00db3f21a0fa38a86a5c1d52ae44828cc59f1798550e2ccf260b2a34", + parentPoolID: "0xbd5b29a952040ccd47ce2822bddd4aba3affaae9d6ccdaf65aded5528e39b837", + investorID: "0xa57b9da796a2848853de7478ec64db63213cb409bfdf182c8b20c7a64896cbcc", + token0Type: "0xb45fcfcc2cc07ce0702cc2d229621e046c906ef14d9b25e8e4d25f6e8763fef7::send::SEND", + token1Type: ADDRESSES.sui.USDC_CIRCLE + }, + { //wbtc sui + poolID: "0x31cc72ec8a332d5e0ecd65c8d5d778333e1c8432a8826a88a8c51eb4e7dc6fac", + parentPoolID: "0xe71aa89df60e737f1b687f8dfbd51e2a9b35706e9e5540ce9b053bd53fcb9ec3", + investorID: "0x68d23ee66a167e39513747a75dd4af3fd2b5728a4653566bf3e813f684cf748b", + token0Type: ADDRESSES.sui.WBTC, + token1Type: ADDRESSES.sui.SUI + }, + { //deep sui + poolID: "0x46de57bfaa096c674492c3892caa261cf34cc46a2e539ece91f0db3e46e3f6c3", + parentPoolID: "0x1b06371d74082856a1be71760cf49f6a377d050eb57afd017f203e89b09c89a2", + investorID: "0x92454fe9c315328efb29607c30f6fb7b5ec55c0a8d9944285075386e381bbca0", + token0Type: "0xdeeb7a4662eec9f2f3def03fb937a663dddaa2e215b8078a284d026b7946c270::deep::DEEP", + token1Type: ADDRESSES.sui.SUI + }, + { //stsui sui + poolID: "0xf5e643282e76af102aada38c67aae7eaec1ba2fe3301871f9fcca482893f96f2", + parentPoolID: "0x73549e0918d10727e324ebeed11ab81ab46f8fadb11078a0641f117d9097b725", + investorID: "0xe348b843a54463afe5438fa76df127b2b78bc89caa9018ba70b3c2ba043f6a1e", + token0Type: "0xd1b72982e40348d069bb1ff701e634c117bb5f741f44dff91e472d3b01461e55::stsui::STSUI", + token1Type: ADDRESSES.sui.SUI + }, ] @@ -208,6 +278,16 @@ const ALPHAFI_NAVI_TVL_IDS = [ tokenType: ADDRESSES.sui.ETH, expo: 8 }, + { + poolID: "0x55b7ae7eb570d3d2ee89a92dd8d958794f1e39c4ee067b28655359c0a152b3aa", + tokenType: "0x5145494a5f5100e645e4b0aa950fa6b68f614e8c59e17bc5ded3495123a79178::ns::NS", + expo: 6 + }, + { + poolID: "0x35f7260fefe3dde7fa5b4bf1319f15554934a94c74acd4ba54161f99470c348f", + tokenType: "0xa99b8952d4f7d947ea77fe0ecdcc9e5fc0bcab2841d6e2a5aa00c3044e5544b5::navx::NAVX", + expo: 9 + }, ] const ALPHAFI_NAVI_LOOP_TVL_IDS = [ { //sui vsui diff --git a/projects/ambient-finance/index.js b/projects/ambient-finance/index.js index 4739b3da09ce..c7f61e7190ea 100644 --- a/projects/ambient-finance/index.js +++ b/projects/ambient-finance/index.js @@ -7,16 +7,19 @@ const vault = { scroll: "0xaaaaAAAACB71BF2C8CaE522EA5fa455571A74106", blast: "0xaAaaaAAAFfe404EE9433EEf0094b6382D81fb958", ethereum: "0xAaAaAAAaA24eEeb8d57D431224f73832bC34f688", - canto: "0x9290c893ce949fe13ef3355660d07de0fb793618" + canto: "0x9290c893ce949fe13ef3355660d07de0fb793618", + swellchain: "0xaAAaAaaa82812F0a1f274016514ba2cA933bF24D", } const subgraphs = { scroll: 'https://ambindexer.net/scroll-gcgo/pool_list?chainId=0x82750', blast: 'https://ambindexer.net/blast-gcgo/pool_list?chainId=0x13e31', canto: "https://ambient-graphcache.fly.dev/gcgo/pool_list?chainId=0x1e14", - ethereum: sdk.graph.modifyEndpoint('DyHaLYK1keqcv3YD3VczKGYvxQGfGgV6bGTbZLMj5xME') + ethereum: sdk.graph.modifyEndpoint('DyHaLYK1keqcv3YD3VczKGYvxQGfGgV6bGTbZLMj5xME'), + swellchain: 'https://ambindexer.net/swell-gcgo/pool_list?chainId=0x783', } + async function tvl(api) { let pools if (subgraphs[api.chain].includes("gcgo")) { diff --git a/projects/amphor/index.js b/projects/amphor/index.js index 878b3c59686e..df15db22ae42 100644 --- a/projects/amphor/index.js +++ b/projects/amphor/index.js @@ -48,4 +48,5 @@ module.exports.hallmarks = [ [1710115200, 'Beta test closing'], [1712361600, 'ETH Boosted Vault Release'], [1718927999, 'Symbiotic LRT Vault Release'], + [1734454404, 'Migration to InceptionLRT'], ]; diff --git a/projects/avalon-finance/index.js b/projects/avalon-finance/index.js index 457adca3f782..de30b159c4ae 100644 --- a/projects/avalon-finance/index.js +++ b/projects/avalon-finance/index.js @@ -3,6 +3,8 @@ const { aaveExports } = require('../helper/aave') const methodologies = require('../helper/methodologies') const { mergeExports } = require('../helper/utils') + + //@note Main & Innovative Markets const mainMarket = { merlin: aaveExports('', '0x6aB5d5E96aC59f66baB57450275cc16961219796', undefined, ['0x5F314b36412765f3E1016632fD1Ad528929536CA'], {v3: true}), @@ -14,6 +16,8 @@ const mainMarket = { mode: aaveExports('', '', undefined, ['0xC5b05b7092257Ee3eEAf013198d30F1E8179B6C9'], { v3: true }), klaytn: aaveExports('', '', undefined, ['0xddD3D480521bc027596e078BCd1b838d50Daa076'], { v3: true }), // Kaia V3 Main zeta: aaveExports('', '', undefined, ['0xA34F1a928024E3609C8968fEA90C747e8D1fA20f'], { v3: true }), // Zetachain V3 Main + corn: aaveExports('', '', undefined, ['0x56552f4407113894Bfce34b5b88C57b941AFc519'], { v3: true }), // Corn V3 Main + duckchain: aaveExports('', '', undefined, ['0x100AC26ad2c253B18375f1dC4BC0EeeB66DEBc88'], { v3: true }), // Duckchain V3 Main } const innovativeMarket = { @@ -34,6 +38,8 @@ const pumpBTCMarkets = { ethereum: aaveExports('', '0xE00A3FE97714765A1a2054E850724Fd1320FaCc0', undefined, ['0x2eE0438BCC1876cEA2c6fc43dD21417cF3D1c2eF'], { v3: true }), bsc: aaveExports('', '0xb1C93Ba1286b6CCA1496C266f0eBfCe94b0C0cc0', undefined, ['0x58c937fa2D147117dB43d187f9411151edfFf03c'], { v3: true }), zeta: aaveExports('', '', undefined, ['0xC5b05b7092257Ee3eEAf013198d30F1E8179B6C9'], { v3: true }), + arbitrum: aaveExports('', '', undefined, ['0x2c4aEB7C9f0D196a51136B3c7bec49cB2DBD1966'], { v3: true }), + corn: aaveExports('', '', undefined, ['0x867885c1dB3020E25A86Db7e20E35dC7b81d76A2'], { v3: true }), } const unibtcMarkets = { @@ -41,6 +47,7 @@ const unibtcMarkets = { btr: aaveExports('', '', undefined, ['0x898D0EF6E20B7597728AEB41169c22608Fe4b234'], { v3: true }), bsc: aaveExports('', '', undefined, ['0xF828A73cB00072843241C6294ed778F26854fe5C'], { v3: true }), mode: aaveExports('', '', undefined, ['0x8F016F5dac399F20B34E35CBaF1dFf12eeE2dE74'], { v3: true }), + iotex: aaveExports('', '', undefined, ['0x28292e1ca36e400FB7d0B66AaA99EB808E3Cb8cB'], { v3: true }), } const stbtcMarkets = { @@ -53,6 +60,12 @@ const otherProtocolTokenMarkets = { ethereum: aaveExports('', '0x3975BE5E668b189b8Ac9049B96A9D9561c4F5273', undefined, ['0x87Ed94868f6fbaA834Db81a1C5854c445caCaB67'], { v3: true }), // BSC - WBTC bsc: aaveExports('', '', undefined, ['0xA34F1a928024E3609C8968fEA90C747e8D1fA20f'], { v3: true }), + // Kaia - stKaia + klaytn: aaveExports('', '', undefined, ['0x276c5119f63119921667842dA3B71EE10Ac486eA'], { v3: true }), + // Sonic - beetSonic + sonic: aaveExports('', '', undefined, ['0x28350E38f241d7F24106CE5eaB1684D6ebEB4700'], { v3: true }), + // Duckchain - MBTC + duckchain: aaveExports('', '', undefined, ['0x912b425D867a09608A884C83b3D5075E9037Aa6a'], { v3: true }), } const obtcMarkets = { @@ -69,13 +82,18 @@ const xaumMarkets = { const lbtcMarkets = { bsc: aaveExports('', '', undefined, ['0x5b9b3C211B81627Cc6b46824CB26829F31A587dc'], { v3: true }), + corn: aaveExports('', '', undefined, ['0x5EcDC2432ED77cD8E2cE6183712c5cc712c40ec0'], { v3: true }), } const listaMarkets = { bsc: aaveExports('', '', undefined, ['0x5157f63bE7808DEB090Eee7762e917745896A09E'], { v3: true }), // BSC - ListaDAO } +const uniIotxMarkets = { + iotex: aaveExports('', '', undefined, ['0x2c4aEB7C9f0D196a51136B3c7bec49cB2DBD1966'], { v3: true }), +} + module.exports = mergeExports( - mainMarket, innovativeMarket, solvMarkets, pumpBTCMarkets, unibtcMarkets, stbtcMarkets, otherProtocolTokenMarkets, obtcMarkets, ubtcMarkets, xaumMarkets, lbtcMarkets, listaMarkets, + mainMarket, innovativeMarket, solvMarkets, pumpBTCMarkets, unibtcMarkets, stbtcMarkets, otherProtocolTokenMarkets, obtcMarkets, ubtcMarkets, xaumMarkets, lbtcMarkets, listaMarkets, uniIotxMarkets ) module.exports.methodology = methodologies.lendingMarket diff --git a/projects/b14g/index.js b/projects/b14g/index.js new file mode 100644 index 000000000000..eee96df07df7 --- /dev/null +++ b/projects/b14g/index.js @@ -0,0 +1,27 @@ +const { getLogs2 } = require("../helper/cache/getLogs"); +const { sumTokens } = require("../helper/chain/bitcoin"); +const bitcoinAddressBook = require('../helper/bitcoin-book/index.js') + +module.exports = { + core: { + tvl: async function tvl(api) { + const logs = await getLogs2({ + api, + target: "0x04EA61C431F7934d51fEd2aCb2c5F942213f8967", + eventAbi: 'event CreateRewardReceiver(address indexed from, address indexed rewardReceiver, uint256 portion, uint256 time)', + fromBlock: 19942300, + }) + const receiverRewards = logs.map(i => i.rewardReceiver) + const coreStakeAmounts = await api.multiCall({ abi: 'uint256:totalCoreStake', calls: receiverRewards }) + api.addGasToken(coreStakeAmounts) + } + }, + bitcoin: { + tvl: async () => { + let owners = await bitcoinAddressBook.b14g() + return sumTokens({ owners }) + } + } +} + + diff --git a/projects/beefstake/index.js b/projects/beefstake/index.js index d96ff8d4d480..0aae034382ff 100644 --- a/projects/beefstake/index.js +++ b/projects/beefstake/index.js @@ -11,6 +11,7 @@ async function fetch() { } module.exports = { + deadFrom: "2024-06-01", timetravel: false, misrepresentedTokens: true, vite:{ diff --git a/projects/betfolio/index.js b/projects/betfolio/index.js index e321d4922496..be944728a76e 100644 --- a/projects/betfolio/index.js +++ b/projects/betfolio/index.js @@ -1,23 +1,23 @@ const { getConfig } = require('../helper/cache') const ADDRESSES = require('../helper/coreAssets.json') -const config = { - polygon: ADDRESSES.polygon.USDC_CIRCLE, -} +const USDC = ADDRESSES.polygon.USDC_CIRCLE -async function getContracts() { - const [list0Res, list1Res] = await Promise.all([ +const tvl = async (api) => { + const [list0Res,list1Res] = await Promise.all([ getConfig('betfolio', 'https://api.betfolio.co/api/v1/user/predictionList?limit=1000&duration=&type='), getConfig('betfolioSoloPrediction', 'https://api.betfolio.co/api/v1/user/getSoloPredictions?limit=1000&type=All&theme=All&solo_type=All') - ]); - return [...list0Res.data.list, ...list1Res.data.list].map(i => i.contract_address) + ]) + + const owners = [...list0Res.data.list, ...list1Res.data.list].map( + (i) => i.contract_address + .includes('_') ? i.contract_address + .split('_')[0] : i.contract_address + ); + + return api.sumTokens({ owners, tokens: [USDC] }) } -Object.keys(config).forEach(chain => { - module.exports[chain] = { - tvl: async (api) => { - const owners = await getContracts(api) - return api.sumTokens({ owners, tokens: [config[chain]] }) - } - } -}) \ No newline at end of file +module.exports = { + polygon: { tvl } +} \ No newline at end of file diff --git a/projects/bitget/index.js b/projects/bitget/index.js index 8cc714db9efa..d91d15a08044 100644 --- a/projects/bitget/index.js +++ b/projects/bitget/index.js @@ -1,128 +1,262 @@ -const { cexExports } = require('../helper/cex') -const bitcoinAddressBook = require('../helper/bitcoin-book/index.js') +const { cexExports } = require("../helper/cex"); +const bitcoinAddressBook = require("../helper/bitcoin-book/index.js"); const config = { bsc: { owners: [ - '0x0639556F03714A74a5fEEaF5736a4A64fF70D206', - '0x149ded7438caf5e5bfdc507a6c25436214d445e1', - '0x3a7d1a8c3a8dc9d48a68e628432198a2ead4917c', - '0x97b9d2102a9a65a26e1ee82d59e42d1b73b68689' + "0x0639556F03714A74a5fEEaF5736a4A64fF70D206", + "0x149ded7438caf5e5bfdc507a6c25436214d445e1", + "0x3a7d1a8c3a8dc9d48a68e628432198a2ead4917c", + "0x97b9d2102a9a65a26e1ee82d59e42d1b73b68689", + "0xa316c725bc8401c97d6d96f283c14b827541744e", + "0xc43999113f8fe724d91356c26105def1449ebdfd", + "0x8911b8f5127eec40c14e1ad0500dc4dbd279d7a7", + "0x1ff33329a8f8c1927131cbb72362b00abeea02d3", + "0x5bdf85216ec1e38d6458c870992a69e38e03f7ef", + "0x80097a87a7dcde470e34c10b5cceb85abf83b531", + "0xe4786cfe980ef5a6428a2fffafabf24f1fc79b64", + "0x4c1d7de286d7c20df5f2ba44b3bc706c1e03bf13", + "0xac65bdf867103ae2c3a75cdd4b68f9d7178c604f", + "0x14b5f559c27bc00c39f668a88471498d68d18768", + "0xe7b3b0a59b026ec1fef16561daf93672a61bafec", + "0x1ab4973a48dc892cd9971ece8e01dcc7688f8f23", + "0x1084203d70950bd7a93aef75eb32a51df2422a07", + "0xbcf6011192399df75a96b0a4ce47c4820853e9e5", + "0x864a7fa57e0f8902a2de4892e925f1272edbe3fa", ], }, ethereum: { owners: [ - '0x0639556F03714A74a5fEEaF5736a4A64fF70D206', - '0x1Ae3739E17d8500F2b2D80086ed092596A116E0b', - '0x2bf7494111a59bD51f731DCd4873D7d71F8feEEC', - '0x31a36512d4903635b7dd6828a934c3915a5809be', - '0x461f6dCdd5Be42D41FE71611154279d87c06B406', - '0x5bdf85216ec1e38d6458c870992a69e38e03f7ef', - '0x97b9d2102a9a65a26e1ee82d59e42d1b73b68689', - '0x9E00816F61a709fa124D36664Cd7b6f14c13eE05', - '0xdFE4B89cf009BFfa33D9BCA1f19694FC2d4d943d', - '0xe2b406ec9227143a8830229eeb3eb6e24b5c60be', - '0xe6a421f24d330967a3af2f4cdb5c34067e7e4d75', - '0xe80623a9d41f2f05780d9cd9cea0f797fd53062a', - '0xf646d9B7d20BABE204a89235774248BA18086dae', - '0x1d5ba5414f2983212e03bf7725add9eb4cdb00dc', //add on 12/01/2024 - '0x51971c86b04516062c1e708cdc048cb04fbe959f', //add on 12/01/2024 - '0x5051e9860c1889eb1bfa394365364b3dd61787f1', //add on 12/01/2024 - '0x731309e453972598ea05d706c6ee6c3c21ab4d2a', //add on 12/01/2024 - '0x842ea89f73add9e4fe963ae7929fdc1e80acdb52', //add on 12/01/2024 - '0x1a96e5da1315efcf9b75100f5757d5e8b76abb0c', //add on 12/01/2024 - '0x4dfc15890972ecea7a213bda2b478dabc382e7a1', //add on 12/01/2024 - '0x70213959a644baa94840bbfb4129550bceceb3c2', // add on 27/05/2024 - '0x54a679e853281a440911f72eae0e24107e9413dc', // add on 27/05/2024 - '0x1ab4973a48dc892cd9971ece8e01dcc7688f8f23', // add on 27/05/2024 - '0x0edd5b0de0fe748be331186bf0aa878f47f601db', // add on 27/05/2024 - '0x4121217c238db06e942f3d87371106d30d0f8c84', // add on 27/05/2024 - '0xed470553f61f23cd30ccf51ab066dc1598ed0c4f', // add on 27/05/2024 - '0x59708733fbbf64378d9293ec56b977c011a08fd2', // add on 27/05/2024 - '0xaab0039de2a8dba8696ee4d42c0d1aa30d7e1059', // add on 27/05/2024 - '0xf207b2f9f9417fc73cad069f7aa5ae1c6a5b428d', // add on 27/05/2024 - '0x4d216d2682f3997f6c19420beee4530d08d0ea5f', // add on 27/05/2024 - '0xdbe46a02322e636b92296954637e1d7db9d5ed26', // add on 27/05/2024 - ] + "0x0639556F03714A74a5fEEaF5736a4A64fF70D206", + "0x1Ae3739E17d8500F2b2D80086ed092596A116E0b", + "0x2bf7494111a59bD51f731DCd4873D7d71F8feEEC", + "0x31a36512d4903635b7dd6828a934c3915a5809be", + "0x461f6dCdd5Be42D41FE71611154279d87c06B406", + "0x5bdf85216ec1e38d6458c870992a69e38e03f7ef", + "0x97b9d2102a9a65a26e1ee82d59e42d1b73b68689", + "0x9E00816F61a709fa124D36664Cd7b6f14c13eE05", + "0xdFE4B89cf009BFfa33D9BCA1f19694FC2d4d943d", + "0xe2b406ec9227143a8830229eeb3eb6e24b5c60be", + "0xe6a421f24d330967a3af2f4cdb5c34067e7e4d75", + "0xe80623a9d41f2f05780d9cd9cea0f797fd53062a", + "0xf646d9B7d20BABE204a89235774248BA18086dae", + "0x1d5ba5414f2983212e03bf7725add9eb4cdb00dc", //add on 12/01/2024 + "0x51971c86b04516062c1e708cdc048cb04fbe959f", //add on 12/01/2024 + "0x5051e9860c1889eb1bfa394365364b3dd61787f1", //add on 12/01/2024 + "0x731309e453972598ea05d706c6ee6c3c21ab4d2a", //add on 12/01/2024 + "0x842ea89f73add9e4fe963ae7929fdc1e80acdb52", //add on 12/01/2024 + "0x1a96e5da1315efcf9b75100f5757d5e8b76abb0c", //add on 12/01/2024 + "0x4dfc15890972ecea7a213bda2b478dabc382e7a1", //add on 12/01/2024 + "0x70213959a644baa94840bbfb4129550bceceb3c2", // add on 27/05/2024 + "0x54a679e853281a440911f72eae0e24107e9413dc", // add on 27/05/2024 + "0x1ab4973a48dc892cd9971ece8e01dcc7688f8f23", // add on 27/05/2024 + "0x0edd5b0de0fe748be331186bf0aa878f47f601db", // add on 27/05/2024 + "0x4121217c238db06e942f3d87371106d30d0f8c84", // add on 27/05/2024 + "0xed470553f61f23cd30ccf51ab066dc1598ed0c4f", // add on 27/05/2024 + "0x59708733fbbf64378d9293ec56b977c011a08fd2", // add on 27/05/2024 + "0xaab0039de2a8dba8696ee4d42c0d1aa30d7e1059", // add on 27/05/2024 + "0xf207b2f9f9417fc73cad069f7aa5ae1c6a5b428d", // add on 27/05/2024 + "0x4d216d2682f3997f6c19420beee4530d08d0ea5f", // add on 27/05/2024 + "0xdbe46a02322e636b92296954637e1d7db9d5ed26", // add on 27/05/2024 + "0xbff5092f83bd810e0926068b89633bf66eaa037b", + "0x4e3fbd56cd56c3e72c1403e103b45db9da5b9d2b", + "0x80097a87a7dcde470e34c10b5cceb85abf83b531", + "0xe4786cfe980ef5a6428a2fffafabf24f1fc79b64", + "0x4c1d7de286d7c20df5f2ba44b3bc706c1e03bf13", + "0xac65bdf867103ae2c3a75cdd4b68f9d7178c604f", + "0x14b5f559c27bc00c39f668a88471498d68d18768", + "0xe7b3b0a59b026ec1fef16561daf93672a61bafec", + "0x3c2a309d9005433c1bc2c92ef1be06489e5bf258", + "0xa7fc83c0cdf12cdccb8e7e5350994aa8ae881c9a", + "0xe368759445438b8ec4e50bf4094e939341174e62", + "0x2dd64ee5ea8706097a5674154288989e3dbe3a05", + "0x85cf18558263505e1152c0e478763aa68b4e8f31", + "0x72049af618eba3a50e9e4eb85bf4476bff0a76ca", + "0xa700c091687afbfada6b84b5e02a5e672ee35597", + "0xd509ff5d6e530401b53cc7d3b80607824d85ff60", + "0x255e91ab794da40d39a5aceff20d98841df873af", + "0x9756b4eedc434ca23dffd209c8ea01d4c95ff881", + "0x9a449ef3665f60af503ea5b8ef5191aeb315b809", + "0x58751ce78f174b58b8f5e345244984a78524a899", + "0x9f199b93ae33c330880bdb31422fca37c6d3fb14", + "0x9c9c8f4f33679ce7f2c46cbf8ab4feb4cf45fe46", + "0x8028270e06fca18e212306a7c93bfee52b440fc5", + "0x0635ac6675e05c7f58383493bb7d1a513cd65688", + ], }, tron: { owners: [ - 'TAa8e7U7seCy7NcZ52xYVQXXybFfwvsUxz', - 'TBXEdr2pD1tszUNAkVX18K7nie1MptkZ1y', - 'TBytnmJqL47n8bAP2NgPWfboXCwEUfEayv', - 'TFrRVZFoHty7scd2a1q6BDxPU5fyqiB4iR', - 'TGJagVsVg9QSePG5GreotgdefgaXPRo8SH', - 'TGZ959FTLRk8droUqDNgLxML1X9mEVej8q', - 'TYiQTHtgLo6KX6hYgbKLJsTbWK5hu9X5MG', - 'TZHW3PJe6VoyV8NWAaeukqWNRe3bVU7u8n', - 'TBM2FK4KBEEsMVYjm4WAW2Q8Es2NKdmUB8', //add on 12/01/2024 - 'TCvfZC9h6fFXnF7KbHPgY4jgfen93VkfVW', //add on 12/01/2024 - 'TGp7SNzjrctsWNwaFFN2PNTh3b1Kgxdtib', //add on 12/01/2024 - 'TBpo1Sh7vKCLrfxocZHd8CA5wc2R75kSJM', // add on 27/05/2024 - 'TMauqkA78pfysSTn8jD1dvEUkjme2gEEdn', // add on 27/05/2024 - 'TKPqvBMU2v23RyjjViKvp16kiHPx7FnrHQ', // add on 27/05/2024 - 'TVSdtELybCCa9DPDH15CMAPjeRcENAmDJZ', // add on 27/05/2024 - ] + "TAa8e7U7seCy7NcZ52xYVQXXybFfwvsUxz", + "TBXEdr2pD1tszUNAkVX18K7nie1MptkZ1y", + "TBytnmJqL47n8bAP2NgPWfboXCwEUfEayv", + "TFrRVZFoHty7scd2a1q6BDxPU5fyqiB4iR", + "TGJagVsVg9QSePG5GreotgdefgaXPRo8SH", + "TGZ959FTLRk8droUqDNgLxML1X9mEVej8q", + "TYiQTHtgLo6KX6hYgbKLJsTbWK5hu9X5MG", + "TZHW3PJe6VoyV8NWAaeukqWNRe3bVU7u8n", + "TBM2FK4KBEEsMVYjm4WAW2Q8Es2NKdmUB8", //add on 12/01/2024 + "TCvfZC9h6fFXnF7KbHPgY4jgfen93VkfVW", //add on 12/01/2024 + "TGp7SNzjrctsWNwaFFN2PNTh3b1Kgxdtib", //add on 12/01/2024 + "TBpo1Sh7vKCLrfxocZHd8CA5wc2R75kSJM", // add on 27/05/2024 + "TMauqkA78pfysSTn8jD1dvEUkjme2gEEdn", // add on 27/05/2024 + "TKPqvBMU2v23RyjjViKvp16kiHPx7FnrHQ", // add on 27/05/2024 + "TVSdtELybCCa9DPDH15CMAPjeRcENAmDJZ", // add on 27/05/2024 + "TYPUgo9ZtYk34XgBHbCHJCaoYZ5RejhhVD", + "TKurFA1LqaLU6cYa7QKbYqFceT3Xf22pNT", + "TN9DMsWq8CwE9GZV4akjxUzwG93PPceuiV", + "TYAdiDkvjsSPMQt8AvA8jWJrXKcjyKb5rs", + "TTky11V7Q3ng6hkYjLs3R3YkeDB8suQ7dC", + "TJ8kFqncqv3GP15DTcbzufX5HFgFMCK3kC", + "TEk5sAuuk6URqvT5tL7hrUB65NGEgq895X", + "TJ7hhYhVhaxNx6BPyq7yFpqZrQULL3JSdb", + "TWpNmnuq6EFMRnxWQTGGf47gjkkbtYJdbm", + "TKfMrRSwhuLoTHcziSeNEAdSjaTe2677md", + "TQQ29P8gw2Tp8XeYKC8vasQmJ7rvHGFhiG", + "TUktrKwLLGGjks6DoN1zGta8muskbd9tnk", + "TFfNrnZzHVMQ7DsHLvcTyvZheqabG4KW4W", + "TKCFasXqJw3ezQiF1qYWYd78Edfb2NvpBV", + ], }, bitcoin: { - owners: bitcoinAddressBook.bitget + owners: bitcoinAddressBook.bitget, }, arbitrum: { owners: [ - '0x0639556F03714A74a5fEEaF5736a4A64fF70D206', - '0x97b9d2102a9a65a26e1ee82d59e42d1b73b68689', - '0x5bdf85216ec1e38d6458c870992a69e38e03f7ef', //add on 12/01/2024 - ] + "0x0639556F03714A74a5fEEaF5736a4A64fF70D206", + "0x97b9d2102a9a65a26e1ee82d59e42d1b73b68689", + "0x5bdf85216ec1e38d6458c870992a69e38e03f7ef", //add on 12/01/2024 + "0x14b5f559c27bc00c39f668a88471498d68d18768", + "0x81fb786799ebacc67abc0abaf5589aa0d7773fa0", + "0xf2c1a45ec2013c686c9568a4f250158c425e4373", + "0xe7b3b0a59b026ec1fef16561daf93672a61bafec", + "0x0c4681e6c0235179ec3d4f4fc4df3d14fdd96017", + "0x1ab4973a48dc892cd9971ece8e01dcc7688f8f23", + ], }, optimism: { owners: [ - '0x0639556F03714A74a5fEEaF5736a4A64fF70D206', - '0x5bdf85216ec1e38d6458c870992a69e38e03f7ef', - '0x97b9d2102a9a65a26e1ee82d59e42d1b73b68689' - ] + "0x0639556F03714A74a5fEEaF5736a4A64fF70D206", + "0x5bdf85216ec1e38d6458c870992a69e38e03f7ef", + "0x97b9d2102a9a65a26e1ee82d59e42d1b73b68689", + "0x14b5f559c27bc00c39f668a88471498d68d18768", + "0xe7b3b0a59b026ec1fef16561daf93672a61bafec", + "0x1ab4973a48dc892cd9971ece8e01dcc7688f8f23", + ], }, era: { - owners: [ - '0x97b9d2102a9a65a26e1ee82d59e42d1b73b68689' - ] + owners: ["0x97b9d2102a9a65a26e1ee82d59e42d1b73b68689"], }, - fantom :{ - owners: ['0x5bdf85216ec1e38d6458c870992a69e38e03f7ef'] + fantom: { + owners: ["0x5bdf85216ec1e38d6458c870992a69e38e03f7ef"], }, cronos: { - owners: ['0x0639556F03714A74a5fEEaF5736a4A64fF70D206'] + owners: ["0x0639556F03714A74a5fEEaF5736a4A64fF70D206"], }, avax: { owners: [ - '0x0639556F03714A74a5fEEaF5736a4A64fF70D206', - '0x5bdf85216ec1e38d6458c870992a69e38e03f7ef' - ] + "0x0639556F03714A74a5fEEaF5736a4A64fF70D206", + "0x5bdf85216ec1e38d6458c870992a69e38e03f7ef", + "0xe7b3b0a59b026ec1fef16561daf93672a61bafec", + "0x1ab4973a48dc892cd9971ece8e01dcc7688f8f23", + ], }, polygon: { owners: [ - '0x0639556F03714A74a5fEEaF5736a4A64fF70D206', - '0x5bdf85216ec1e38d6458c870992a69e38e03f7ef', - '0x97b9d2102a9a65a26e1ee82d59e42d1b73b68689' - ] + "0x0639556F03714A74a5fEEaF5736a4A64fF70D206", + "0x5bdf85216ec1e38d6458c870992a69e38e03f7ef", + "0x97b9d2102a9a65a26e1ee82d59e42d1b73b68689", + "0x14b5f559c27bc00c39f668a88471498d68d18768", + "0xe7b3b0a59b026ec1fef16561daf93672a61bafec", + "0x1ab4973a48dc892cd9971ece8e01dcc7688f8f23", + "0x9b0cb31f3e9232196aeaa7cac03ea95c5a4f0e35", + ], }, ripple: { owners: [ - 'r3AEihLNr81VYUf5PdfH5wLPqtJJyJs6yY', - 'rGDreBvnHrX1get7na3J4oowN19ny4GzFn' - ] + "r3AEihLNr81VYUf5PdfH5wLPqtJJyJs6yY", + "rGDreBvnHrX1get7na3J4oowN19ny4GzFn", + ], }, solana: { - owners: ['A77HErqtfN1hLLpvZ9pCtu66FEtM8BveoaKbbMoZ4RiR'] + owners: [ + "A77HErqtfN1hLLpvZ9pCtu66FEtM8BveoaKbbMoZ4RiR", + "3bLkLrRvkwHMrqyoCaDSCn6bZnpfJCVsHxcmznUwB1p5", + "42zAGwv37eZFwwcExfCAV9oSw2kNQX3aBxsbM6zvQECM", + "YiZeibU6zzEHyKiSTjygXUPkMktKj9a3DCAcWmZ4XjF", + "AvLGED7RBzYv4AuvkgFSCFMqyB2WjUff7TVKVEv5MjMs", + "48Zo7g9SReCWmNtCvr2es4H9CLCRQHrSND2Wzi61sCsQ", + "57WSBnNTC2MaqpY6NWLdNjhrELced4jSGV2hLSpjzct9", + "DP1FqoBnE23QNNz4LpT9FCQvETdJN4nph5c11NiinrGg", + "AyhsmFptkM251V1AoH2gf8d4QUnxUkkmaDqFfFwBwGni", + ], }, metis: { - owners: ['0x5bdf85216ec1e38d6458c870992a69e38e03f7ef'] + owners: ["0x5bdf85216ec1e38d6458c870992a69e38e03f7ef"], }, kava: { - owners: ['0x97b9d2102a9a65a26e1ee82d59e42d1b73b68689'] + owners: ["0x97b9d2102a9a65a26e1ee82d59e42d1b73b68689"], }, starknet: { - owners: ['0x0299b9008e2d3fa88de6d06781fc9f32f601b2626cb0efa8e8c19f2b17837ed1'] + owners: [ + "0x0299b9008e2d3fa88de6d06781fc9f32f601b2626cb0efa8e8c19f2b17837ed1", + ], + }, + ton: { + owners: [ //only wallets with more than 50k + "UQDJlZqZfh1OQ4PY2ze4bSEBznjc8fGzkE2YiP5XLvDv1JNr", + "EQCnRoi95R9jLVrPONxTWEMMCuIlHBsYZjYZW5JwtoecbRl6", + // "EQC5Jj1PfKD8PmwxdBDi47mtbLahHV0Qkrs39lVl2A4nPlPC", + "EQAkKBTk1NuRH9wuy5qJFesfCoZMvZXa2NV9mCet3t3ndwkH", + "EQDN9_DXwJA28GQnLjxCntVwvknvKes6c1tku8F5FQc3MkZo", + // "EQAGQcXOz5QWPXW_faObcN7HfSx8ihstAzoQTV9ckqmrDfcQ", + // "EQCUlDMK5NDVOmpbLAzGVkXfCXpmEJgKWHL4J7oHmuNkPxaH", + // "EQAWLm0Xut7koqsFxI2j3YBvjI1M_tVHXFrgTysXvF4NQWu5", + "EQAGR25YDiUNCr7Fw2WnEYM0g8WB1XuQi-N9Vr2w4zjDEhg5", + // "EQDpwKJP-qaqTyKIkOca6VUL_FOmxX5kO8McJA4YcnrBzlwi", + // "EQAzZQL6-D71tTLTFbpxRQtmHJDoP85k2Lwf0r9kLzVV2VRy", + // "EQCzCMf5tPWW9iUBdYhZclSYcbBccO02Gf1ak5QB7qly5Gsl", + // "EQDi0d8gazctsfO4kOYNGFtnqgyfG2tv9goFCRyMAbQKxMA3", + // "EQB6DclNqfSLlo37h7441Pq3KGKI23oE0wgf7uF3N22QicZ7", + // "EQCHhe9euw_STGkR0Q9DwAlh6XSPpUKXoaxRfjxf52uwvmGB", + // "EQAhO2gEwgghNaSoA9qOOzDP7VGu6a8q0hADNLf0cR07zMQr", + // "EQBXPf6ZSQoEFwPpd-RyQTXFuL6gvqZ4OWEiR0UcqdXEywxy", + // "EQDeJRmlJ95-HUwQKL23TgIrKKbjcOT-w_wn2NlxMI-Zu6i2", + // "EQAPGaGPsc-vwzQB04IyW63UkbS08btCmfD51vvHm3FQFYbg", + // "EQA182-9Kw_8YCugScsCS03ln3WVvp5gZpLU7lbS3xst3GiN", + // "EQDqltnjUhoZxMd022XDb8egHj2IQOlegwXD0rfJL1d8eyOZ", + // "EQDY6SAYmiZ2dc3qWZkqSB1JxPgyluCBNJe5DCeUBXKVvpC8", + // "EQB5AOHMT1UHXa4WBh_LL3HWqPeYMSoCNfDarrUOSSiI-2LE", + // "EQBi8zmTQRJNfGhdpG2RoHqhSWhN05fH5f6YaCCom4dsAnrT", + // "EQBcPW3DG9p9UG-FiOVbq6BiXAxTWRYSgwkeSHK9vAHJauTe", + // "EQAMReXSXKXMgNJsiQbeUYqG_BoETp6V11p2AQ0hBalCPUvU", + // "EQD7T5jBR_4NTYpyQTsbE6UTcSgM31GM-tUQsxzwWAW8XyuS", + // "EQB8Nfcr7iJARqpnwHI_dowkRu9k43b8AMj-p4RJTXosLWWv", + "EQDAflHltpSTd1j0X0ADBxyE9MSmi9sWiiLD1si4nNYYb7Kq", + // "EQBAdstQfrjD8XODZjA6OL3sE64rEjDFSPSjgXdllH4EYbL_", + // "EQCJCWcpv6SSYKI9XpCOM8wazXTay7Y9eJa1DjvqLrBj0DA4", + // "EQBczmMu9joi0XxD36P0UDZqCmCVZ6lXkQ8EnX73Dz8bFxtS", + // "EQDrU5ouMx-D_RBtqKuqPGpGvS-O4B-kUnXW-q7RulrPmAfa", + // "EQCkEpUgZvV1vD4n1Zs3SSdxInEQh1QkxubbrmHonEywvJ5a", + // "EQDHy0OTba2_affHgdhHNtC8DW0CjAYdM6np6HX8yjqFo1hL", + // "EQA5O1iYS2jpYbP2_z0WCbWRmyiaDQ-thu-x_Jkhzu-DsnEc", + // "EQCYL0iLg5WpiX2G8IBeFIGNVCy7LQ_hyf5iZ9A3ezFg5Atl", + // "EQClK4F-Kyfg7-h7CFMedd4NOMQN3Q_GUXd8b1i863SAdeR3", + // "EQC9yQc4ukdiARwzowoBnlQSI_t_WrW4vM3PZAJtlzmxkRGj", + // "EQBCDb94YxZuR4CsuOu4G9N0pm1U6ezgOhHEBiEX2LWD2YJi", + // "EQDKubNbxKBrbng_VL6CiPWG43crC3zogxRi-kSzxxPjw35F", + // "EQBtm4dCmA6ee0TdGB7OM_ugptfPSJQnZ9t8lEn3333sNE0u", + // "EQB9FPf68No-lbXCKDRKdswuMr1tAFdXKb5wb04CAtkTgPu7", + // "EQDRb6dbCI6kvhE5Mdnp60wc7fNEU7bpTyZkvGnmOLMqv5tr", + // "EQBABRMAjj3FdNo6KkeSP3wLrSL1oBPgogH_vojzNnI0ZI9l", + // "EQAhwpa_TxKq4vPppejylixsCucMNrOJUUHOsEk6TP2ExnOS", + // "EQDQPzhpD1ygMNgnPiD6k6d2S0FWMdJasy3Z3eOQTujARKDD", + // "EQA8Q5etDAwMseoEFLPfN8xUL9wQhi3hNzs4eFlXNIuB81Tj", + // "EQA70IHk3sI76igys6-kLC0TLxXo54s0qAwdbSRUOpqgneV3", + "EQDJlZqZfh1OQ4PY2ze4bSEBznjc8fGzkE2YiP5XLvDv1M6u", + "EQAXl6XExQorMSzpkn_28S79OwtY_zEURRGMLS5kMStdeQng", + "EQBggwBbNUqxxHhaqM6Ck-5cnBgukkjyfpyQdPNcFjQggwrJ", + ], }, -} +}; -module.exports = cexExports(config) \ No newline at end of file +module.exports = cexExports(config); diff --git a/projects/bitkub-cex/index.js b/projects/bitkub-cex/index.js new file mode 100644 index 000000000000..96871b4c1dd6 --- /dev/null +++ b/projects/bitkub-cex/index.js @@ -0,0 +1,238 @@ +const { cexExports } = require("../helper/cex"); +const bitcoinAddressBook = require("../helper/bitcoin-book/index.js"); + +const config = { + bitcoin: { owners: bitcoinAddressBook.bitkub }, + ethereum: { + owners: [ + "0x1579B5f6582C7a04f5fFEec683C13008C4b0A520", + "0xaD0703a267f97e19034FD564d731C4e6d888f9ef", + "0x831e8C86197C3993eb1238b3Ac22E42e3B7f2Fd9", + "0x7A1CF8CE543F4838c964FB14D403Cc6ED0bDbaCC", + "0xE35bb4845149eCC6799C98ceEeF7ff7c85440e6f", + "0x59E0cDA5922eFbA00a57794faF09BF6252d64126", + "0x326d9f47ba49bbaac279172634827483af70a601", + "0x4A3b441962BB481cdffF2650D84EBEC0f119CbB7", + "0x6B130820c449A27b35256A3c99942adbD53AAC18", + "0xFBA420CdAEE2df4e38a622d36616c3547AB6aaB4", + ], + }, + cardano: { + owners: [ + "addr1q8080hxmacdlnhrjllmurq35uj8jnj4ak0egxyl0zx6y9hns6jxls0ngn2qadghy4h7dterk0gzm3y7czmh8zlsfvmesug72j9", + "addr1q9lnc0jsh3f76hmapmsf8m7d6a32gm993gyhjspfvjgpdatl8sl9p0zna40h6rhqj0hum4mz53k2tzsf09qzjeyszm6s6n08gw", + "addr1vx7vlgvuupzvvls99penvatpm2c4j9ljscevzsnn3awk8ys6xynxk", + "addr1q8rgxa3edn03lywl8c9hk6p3c6rpyf9frhqe6a97qtrjktkxsdmrjmxlr7ga70st0d5rr35xzgj2j8wpn46tuqk89vhqaglq5q", + "addr1qyswadm6cz8u2lt8eh752d8434dgtjuvkmp3yv00klcuqm50s7wwjnhjjrt6h206nlzavqmsaqfllzslny5zyhfhemgslhpqe5", + "addr1q9pag8w4fhlfntk53te5ggjcxfv3a47pjs3kp79espx0xa3ry9xxlmzqcs8t8xj28xmw5l34pcdshnm80hjlsl0rlgwst42fps", + "addr1q8w6ydejn4v89cxmvmltzg4g0y4xkg84p3sqf3gmdst032pef9780gqwzm4c5q3m4juvp5q08e37yx9rvhfxahv7kywqn7h8jp", + "addr1q93njnfcfeky7ygfg5wjk3pms74qnxtashr7xmwnzykxpgp4yjdypphupnvrnskz8uj55cuzydmnmmnjvy70hytezjssux9ahu", + "addr1qxdsu34cmfw7er4zmd4702szx7yhc9gayrnyv6lsm89k6mafmzzku8yt4xqu7tqh3qctas87ukfswf0h3ytq9c92razqph7vpw", + "addr1qylmz3tepjdum5alfegjw80xawkqxrqy0lzl9ndhrcmr0dg34hvrr6m7qg538lpd6ppvxe7gp47rm36vyjw9cckuc0qsg26ngm", + "addr1q8j70zld3p2dhpgkxksprpsmzm4qhfhm2l6w9wk44gqs6264x2gg8f3gacy3x74ew8felyagrtq3lztx4cnx90cs09fsp87nrj", + "addr1q94vgjd7zfesgq06vgtrqe9q9g2rjtl6yn35gepwta9eqz25ts95j7frk9yh479d2fqln76xj4gldjflczkqwq003q3s39lprc", + "addr1q9vp536dm7jz05h8qfux247yl4c2cnzrz6kj9p3wh6u98gxuef7ar9t9kpnwpnnksgz8x4tuqtup6jch7yg55kns3p5s4vhaqa", + "addr1qxt89e3xnepa336w0t6td4as2awn0e57nk6f025r26rwug8q8t28pdfqtkt90eeafdf4axmzrh46cg65u47z59tscj3qfpxyxx", + "addr1q9fe0wv28yd6pse9hrwqn8rhcudj42e4z3a5vveqyqww6uys8ta3zga2drsxq42e003wxm7lvxt9skmrnst8f6z7sytqke4up9", + "addr1q8km36sd4wgt6f5e3n557nk454tqwxzg670fxylsztsccq5yy7w9y0uz4hlc3j2veln52xu3ktrrrzkr4p9ays0uhu5q6vukqh", + "addr1qx26c2mdztwk02fyn43692lzqcxscf0ujye06vv3jadhsazwram6xhx09z4yka4q6uexkelc92df9dysnjf5nhajvmnq2e4qwf", + "addr1qxxm602az76en6rjyvurmdpv7sj8jwxxfxv9jvjrttvrxt5l8pzavzkxpxuha8ra90t0h3s2zs5dhv2jmaq3mm6snfkqdmj5vl", + "addr1qxrs00m9qntkxhru8vdmd4xz562rv3ajck36l9yvcs06nwzcx8u53x99sahetdtaascmug9363m5sjjx8aullxgswvesy5td9l", + "addr1q9czs903atc9hmz9vf8sdrqgk33dz9hnwdgpgx98q4fsnj9t3n4wl5p8j9uqg4ewj740uupwjsv4c8p0eckuh3p0tjasl8v77f", + "addr1q9xfm9pxac0vhxym802eagwmtc0aus5w5uhc0tg9rslzzhfcj99akd57ewpta8ww9wf3vp9af3psmyw62vy00tvk3yaq9c3yw6", + "addr1q98xhywsa3xgu79ftrjyrfg6e2wrxfgqvepnudusw58ee6vmw0j8gzw6hmyuefah02purkfvqj6x2pz2wpjr26mr8r7qv6v2qa", + "addr1qxpah9ck505d7dvxvkvh33v5awrxv89vvjcduhfu29fr7dns6jxls0ngn2qadghy4h7dterk0gzm3y7czmh8zlsfvmesxrkkg7", + ], + }, + base: { + owners: [ + "0x7b7B40D0FfC52005AdE856D4F65008BFf7d4D4a6", + "0x7A1CF8CE543F4838c964FB14D403Cc6ED0bDbaCC", + "0x4EBBb4DeEd5dA01B1F882F237BA3a19e83Baaeea", + ], + }, + algorand: { + owners: [ + "CT7HPFSYMKHPJES4GEEA5VE6ML7PF4JUOKNSJNDK7MXYNYLMMTFJ7XDETY", + "Q3GDAVXJLVHL2YNTIP35LMXEIZRGLLANSUGXGG4O2O44RZYYFNAU32OBNU", + "6CBNVPFCWAPEA2C2Y34JP7JDDNZI6YXG5JMPNCSYZOLB24IF3CALRRUSUQ", + "B6PJYYQSVT7F3NNJMGTR7MGS6AA5RLHY5LUGSWJSRXUQQQJZEFZ3QQ2BPE", + ], + }, + bsc: { + owners: [ + "0xC68C8d9d435c1C8a04909A7D8eA588d1031ae1E9", + "0xAdf4c208d546E7F1Ec24cab1CcDA9B47B90B8540", + "0x7A1CF8CE543F4838c964FB14D403Cc6ED0bDbaCC", + "0x2B8A2A03883E790fd8731823fcaC3E7af0a6dab3", + "0xe8FbDA2Ac282a0EBb73d3f4089AD130312eDb8DA", + "0xa2FF973Bf5A7c33cE4591226b03cf0afc5F16D37", + "0xd8A184BBEB7098E45a7bDCe1f88BFb5785Cb22bA", + "0x427E2cb82551D247daA712ebECf5FaC7F1d955Ad", + "0x1ecCd85c9E21f247FadB70F6cFf94B14cb737d03", + "0x3A67638883EfF7856b286ccd373d36476C45407a", + "0x45De26036ebe8a611FD361324872E887B5839564", + "0x85f44C42bAA806047f1d9aAea362333200FC5d10", + "0x8F19c19Fd4B6b3363fd1f214FF7781FBceBdba6d", + "0x165c97f4a371e69A747678bA1893Be023b284f4a", + "0x034bda447330D010554A5a93A22fF45a2505f494", + "0x42b3cd5676FFD76D29A587Fe8aAdE7e35BF7D1B5", + "0xBf36D6540c310996a21537c0193ACA1756884C40", + "0x6Fc29dFF13345574FaD530a8DBCC7Bb4A43Ad045", + "0x56152e13828f78cDCC90A6b016dF0aeC0985e2f3", + "0xc686D5a4A1017BC1B751F25eF882A16AB1A81B63", + "0x074b08B84E7400E9E5446CcE14d446b36B6351B5", + ], + }, + aptos: { + owners: [ + "0x73f6a587b4bc245bf3eeaa31b7ffe490d4c297a4960023b9548c1a4187bbe826", + ], + }, + arbitrum: { + owners: [ + "0x3ad60935c48f59cad57794eea41c60574735b4c9", + "0x799cb7688637824025F2Ae0BE78baA4854EB10f9", + "0x77aB048B5A14385450DfE21a676930E391B0c50C", + "0x0573AdF35a54475CBe10992Ba7C7dC11a80f39Ab", + "0x3040028E91D2a5D1E780c8E1a771A1A243f8921A", + "0xb8a63Da460063aB54aE52c73693Fc554E38E7794", + "0x7836c2eaD68809CEB6168E70558E46eB454209B9", + "0xc49839a2eDd1A2c4B23b080734a72CA9ff8DF666", + "0xCacb823a3D0C5a8490B1d3E60d1f33AB1eEB0387", + "0xFa87f3ae8Bf869d4f6138F47a5682dD9E4458EE3", + "0x7A1CF8CE543F4838c964FB14D403Cc6ED0bDbaCC", + ], + }, + avax: { + owners: [ + "0xCee64C0fD6E455B629ee82404094Bb0FD7a015d3", + "0xf521f4f06253a2c9db5732c6838b82cf472ccb6b", + "0xed450b3a875eaab5366cdc6746b1aa95c1f87009", + "0x16eCE576723AE9640053C2a5e100E21Ae6879915", + "0xaE0B49663C51C8e00795e935186e7C8D425Aa4Fd", + "0x134282ea729a0a129f331d9950d399f22545e8b8", + "0x376AD7FB3842475725D276D77b85883474B9050C", + "0x91013c9c7c2a856B26dF52A8A117Afeb9FC90379", + "0x7A1CF8CE543F4838c964FB14D403Cc6ED0bDbaCC", + ], + }, + litecoin: { + owners: [ + "ltc1qdjslxvcf0sdp7glpm7uyj97dnc8ml32c820jjr", + "MV6PFbiFu9hAzav77zvArKnVbepqzgLai6", + "LX3BfLPmTpNAqemj9QZKu4SLTMrU9M4W4a", + ], + }, + mantle: { + owners: [ + "0x93593B52373775B6387Bb136fb662a1B2B95D28C", + "0x7A1CF8CE543F4838c964FB14D403Cc6ED0bDbaCC", + ], + }, + optimism: { + owners: [ + "0xda4231EF1768176536EEE3ec187315E60572BBD4", + "0x7A1CF8CE543F4838c964FB14D403Cc6ED0bDbaCC", + "0x18f59d6945C3847d837bC7bF2E402C2F91FdBF04", + "0xE24568D364A170B9D768AF5AaB2E9bFfFE628fAA", + "0xB2a4bE10ff7599e748a59EF66DF574EA14FdD28e", + "0x4BB9326ac2721cECc34737FCCE2FeA5fe78Ec88F", + "0x87F05730C7fC9D20EE8f2776b6E12675e344d323", + "0xfE7Ad27596CA67A134Cc227FCCEEe02fD7BaCC46", + "0x4da9F5048B530EC1B0A415d3d4D82f1C0A0F3d77", + "0x34d68b60F2BB5983a85dCE33A9Fbc74135EA05d6", + ], + }, + polygon: { + owners: [ + "0xCa7404EED62a6976Afc335fe08044B04dBB7e97D", + "0x98a81ce4e94249beb329f04b9595e10735ae6ab0", + "0xac72565ccf186f10e6a7a3964492c62be5757e31", + "0x9573A11d939753737E8F09f80f07f6462C093a1c", + "0x7A1CF8CE543F4838c964FB14D403Cc6ED0bDbaCC", + ], + }, + solana: { + owners: [ + "CqLu65KkFvGi3DUrR9o9aUC4LP2yUywFHZn8WoNLNVgy", + "99GQKbo1m2dU2ETGtEB1of9F6QHne5o9HHjAc7MyiVSn", + "FEpW539FYXJLpuKxPEuFZhtBHqv3o3V5qKtQa8wxN6qQ", + "7Z4YASPhNRbebWGx4GuzEWFAETZyRdN1GQTFTnM8t5c2", + "9ZxAqUEP5aYBCHakuVt9ojL15jfy9oMiaeQv5ewk2c7J", + "EwA9sKvmKwTpKr9BqYmsYi2UjKEMm3aPsihmFfT7Q9DM", + ], + }, + tron: { + owners: [ + "TUokA66synv9BN4T2VPSRZivNedcbkhfJF", + "TN6yULseUiJF7WZUruRQqMTUb1VTDBdsqG", + "TRHQmybCizoiMCA3ev4pNTb5PLJmgpSztQ", + "TLpzN1ztwi47kK8Wip2VvmDMFwnMyWnHwj", + ], + }, + ripple: { + owners: [ + "rnrqyM7kS6wmC5demJm9vrfdN2vLgS8LfY", + "rE3Cc3i6163Qzo7oc6avFQAxQE4gyCWhGP", + "rsgwNP2cyRHAcEbuRmboDQ4pmgemMNVZR3", + "rN2AVDJj927YbdAvTXoDtq8uswbQvFU42t", + "rfZCcK6EMCYeAX3y86X281xwgRLcH82SAw", + "rwa1MPnDwpRsgJ4jmZHuBo42xK9YVpp45P", + ], + }, + era: { + owners: [ + "0xe65eE83E7B466CB3836f666BaAeB4ed6d29B5723", + "0x7A1CF8CE543F4838c964FB14D403Cc6ED0bDbaCC", + ], + }, + core: { + owners: [ + "0x1CA1817eD440b26Fb005748f3CE9f8db160A5C0a", + "0x7A1CF8CE543F4838c964FB14D403Cc6ED0bDbaCC", + ], + }, + fantom: { + owners: [ + "0xE9BB729A7eA588c2ad10acaF647124503Dbb08d1", + "0x7A1CF8CE543F4838c964FB14D403Cc6ED0bDbaCC", + "0xDD374d8202D43a18BE95C8B64C41a87a9898889f", + ], + }, + ton: { + owners: [ + "UQC99FRwIlV2iLvDwFDyIfSVFQms5fUKtVZKidKuFTKItH2h", + "UQDByM-88YEJtGq4UTZx3FOgZFZ6URHPYD11wf9AcBrajchg", + ], + }, + doge: { + owners: [ + "A3UdEKpx5HR1hJvKKw7iVbwp6MRn3yZAiK", + "ACkC8PjakegrmPFaL12FVDPCn8HwdKzSCY", + "AAuxfoiADXxMgbZPZ42xE6TCnFnz2FK33e", + "A5XHmCEG2TbaUnCiZnganw29EsDDnUQXjj", + "A59WR7LTBiBbSx3QZbf7SwQ6q3PHnP33wK", + "A4RZ3WfKxyWDPvMkFGM2Uzo8rDd6wwBqK5", + "9tAKQbiRPJxosnuUFGivL2kP3UEEeqdnd1", + "AD7E3QXB5go9AtE2uueMr3Dw767eWi5ruy", + 'DTqm2UCi6AS1nSCo9jZ8AejZ3k1ZcF8qix', + 'A2is3pqH2jz8jcRNV2QEFnLF3FAP5hBEoB', + 'DBrNiTbgpHHeveemLNnKwNDEJwXRGGRb1L', + 'D788kYSZYsVWSoLVejipE1Q4cN8Spom5eU', + 'DNvZftCnAsfrzzfe6R3dF6Sugz7W4Qgs6b', + 'DPYV66VirzChkotHXPryAhcfvyQmeArV2y', + 'DHBERwF4LVLVwQzDtfPz9zEtKPnWW9NSDH', + 'DTWmAfdTkrtqv7GmN2vE74VTkXkgQUFRSn', + 'DDm2XmWXhq3fxHd9fUaqnbmxanaFuKSG1s', + 'DHt3teN3iNSG7rJ8GaGz5EeHYFieCf8Qin', + 'D5GmmrSZ1xDut5Nj1s4C4ncA1v3EGfbk15', + 'DNpbFixXn611Qd9SZDBDjS4NhFPAXG8t1X', + 'D7pEtDnFU3ZgTykZt54SXvGeF1YSt2PVbe', + 'DCWvgKHcs1KUDqYe55rTX8m6uaJ67gaAp5', + 'DBdkivVhGhmbBRSsbt2s55MtZ38ngs86nS', + ], + }, +}; + +module.exports = cexExports(config); diff --git a/projects/bitzap/index.js b/projects/bitzap/index.js new file mode 100644 index 000000000000..7813e057381f --- /dev/null +++ b/projects/bitzap/index.js @@ -0,0 +1,16 @@ + +const config = { + btr: { factory: '0xe4fb0d76c7ba28dd4d115ff63c0b14d8d7f9838a', }, +} + +Object.keys(config).forEach(chain => { + const { factory, } = config[chain] + module.exports[chain] = { + tvl: async (api) => { + const pools = await api.fetchList({ lengthAbi: 'pool_count', itemAbi: 'pool_list', target: factory }) + const tokens = await api.multiCall({ abi: 'function get_coins(address) view returns (address[])', calls: pools, target: factory }) + const ownerTokens = pools.map((p, i) => [tokens[i], p]) + return api.sumTokens({ ownerTokens, blacklistedTokens: pools }) + } + } +}) \ No newline at end of file diff --git a/projects/bob-fusion/index.js b/projects/bob-fusion/index.js index f663c7552d4b..6e6d8336a39c 100644 --- a/projects/bob-fusion/index.js +++ b/projects/bob-fusion/index.js @@ -16,6 +16,7 @@ const enabledAddresses = [ "0xbdBb63F938c8961AF31eaD3deBa5C96e6A323DD1", // eDLLR "0xbdab72602e9AD40FC6a6852CAf43258113B8F7a5", // eSOV "0xe7c3755482d0dA522678Af05945062d4427e0923", // ALEX + "0x8236a87084f8B84306f72007F36F2618A5634494", // LBTC ] module.exports = { diff --git a/projects/bob-gateway/index.js b/projects/bob-gateway/index.js index 954e389fcd34..e51903ef41d4 100644 --- a/projects/bob-gateway/index.js +++ b/projects/bob-gateway/index.js @@ -38,6 +38,7 @@ module.exports = { ADDRESSES.bob.FBTC, ADDRESSES.bob.uniBTC, ADDRESSES.bob.pumpBTC, + "0xA45d4121b3D47719FF57a947A9d961539Ba33204", // LBTC ], owners: gateways, }); diff --git a/projects/bob/index.js b/projects/bob/index.js index 07184113b5e9..371413167cad 100644 --- a/projects/bob/index.js +++ b/projects/bob/index.js @@ -15,6 +15,7 @@ const tokens = [ "0xbdBb63F938c8961AF31eaD3deBa5C96e6A323DD1", // eDLLR "0xbdab72602e9AD40FC6a6852CAf43258113B8F7a5", // eSOV "0xe7c3755482d0dA522678Af05945062d4427e0923", // ALEX + "0x8236a87084f8B84306f72007F36F2618A5634494", // LBTC ]; diff --git a/projects/bucket-farm/index.js b/projects/bucket-farm/index.js new file mode 100644 index 000000000000..0ca121dd4034 --- /dev/null +++ b/projects/bucket-farm/index.js @@ -0,0 +1,29 @@ +const ADDRESSES = require('../helper/coreAssets.json') +const sui = require("../helper/chain/sui"); + +const POINT_CENTER_ID = '0xc60fb4131a47aa52ac27fe5b6f9613ffe27832c5f52d27755511039d53908217' + +async function tvl(api) { + const pointCenter = await sui.getObject(POINT_CENTER_ID) + const poolStates = pointCenter.fields.pool_states.fields.contents.map((state)=>{ + const value = state.fields.value.fields + return{ + assetType: "0x" + value.asset_type, + totalStake: value.total_stake + } + }) + + for(const poolState of poolStates){ + let assetType = poolState.assetType + if(assetType == "0x922d15d7f55c13fd790f6e54397470ec592caa2b508df292a2e8553f3d3b274f::msui::MSUI" || assetType == "0x41ff228bfd566f0c707173ee6413962a77e3929588d010250e4e76f0d1cc0ad4::ksui::KSUI" || assetType == "0xd1b72982e40348d069bb1ff701e634c117bb5f741f44dff91e472d3b01461e55::stsui::STSUI" || assetType == "0xfbdd50dd7bc7af482d308f8c5d8c66c23e3b59494ff92f2947b150f20b5f43fd::af_lp::AF_LP") { + assetType = ADDRESSES.sui.SUI + } + api.add(assetType, poolState.totalStake) + } +} + +module.exports = { + sui: { + tvl + } +} \ No newline at end of file diff --git a/projects/bucket-protocol/index.js b/projects/bucket-protocol/index.js index 444f203a04bb..b3c0a841e1e0 100644 --- a/projects/bucket-protocol/index.js +++ b/projects/bucket-protocol/index.js @@ -9,6 +9,7 @@ const BUCK = ADDRESSES.sui.BUCK; const USDC = ADDRESSES.sui.USDC; const USDT = ADDRESSES.sui.USDT; const USDC_CIRCLE= ADDRESSES.sui.USDC_CIRCLE +const FDUSD= "0xf16e6b723f242ec745dfd7634ad072c42d5c1d9ac9d62a39c381303eaa57693a::fdusd::FDUSD" const SCALLOP_swUSDC = "0xad4d71551d31092230db1fd482008ea42867dbf27b286e9c70a79d2a6191d58d::scallop_wormhole_usdc::SCALLOP_WORMHOLE_USDC" const SCALLOP_sUSDC = "0x854950aa624b1df59fe64e630b2ba7c550642e9342267a33061d59fb31582da5::scallop_usdc::SCALLOP_USDC" const SCALLOP_sUSDT = "0xe6e5a012ec20a49a3d1d57bd2b67140b96cd4d3400b9d79e541f7bdbab661f95::scallop_wormhole_usdt::SCALLOP_WORMHOLE_USDT" @@ -54,6 +55,8 @@ const USDC_PSM = const USDT_PSM = "0x607e7d386e29066b964934e0eb1daa084538a79b5707c34f38e190d64e24923e"; +const FDUSD_PSM = "0xb23092f74b7bbea45056d8564a7325be993cc2926b89f384367b9ad309dd92c5" + const BUCKETUS_PSM = "0xba86a0f37377844f38060a9f62b5c5cd3f8ba13901fa6c4ee5777c1cc535306b"; @@ -108,7 +111,7 @@ function convertUnderlyingAssets(coin){ if(coin === SCALLOP_sSUI) return ADDRESSES.sui.SUI // sbETH if(coin === SCALLOP_sSB_ETH) return ADDRESSES.sui.ETH - // sSCA + // sSCAUSDT_PSM if(coin === SCALLOP_sSCA) return SCA_ADDRESS return coin @@ -141,6 +144,9 @@ async function tvl(api) { const usdcCirclePSMObj = await sui.getObject(USDC_CIRCLE_PSM); const usdcCirclePSMAmount = usdcCirclePSMObj.fields.pool; + const fdusdPSMObj = await sui.getObject(FDUSD_PSM); + const fdusdPSMAmount = fdusdPSMObj.fields.pool; + const usdcPSMObj = await sui.getObject(USDC_PSM); const usdcPSMAmount = usdcPSMObj.fields.pool; @@ -224,6 +230,7 @@ async function tvl(api) { api.add(USDC_CIRCLE, Math.floor(usdcCirclePSMAmount)); api.add(USDC, Math.floor(usdcPSMAmount)); api.add(USDT, Math.floor(usdtPSMAmount)); + api.add(FDUSD, Math.floor(fdusdPSMAmount)); // 1 Cetable = 0.5 USDC + 0.5 USDT const halfCetableAmount = Math.floor(cetablePSMAmount / 2); diff --git a/projects/camelot-v2/index.js b/projects/camelot-v2/index.js index ec282cb3732b..cc9f9e5631d2 100644 --- a/projects/camelot-v2/index.js +++ b/projects/camelot-v2/index.js @@ -13,6 +13,7 @@ const export2 = uniV3Export({ reya: { factory: '0x10aA510d94E094Bd643677bd2964c3EE085Daffc', fromBlock: 2932166, isAlgebra: true, }, gravity: { factory: '0x10aA510d94E094Bd643677bd2964c3EE085Daffc', fromBlock: 11988, isAlgebra: true, }, apechain: { factory: '0x10aA510d94E094Bd643677bd2964c3EE085Daffc', fromBlock: 60224, isAlgebra: true, }, + duckchain: { factory: '0xCf4062Ee235BbeB4C7c0336ada689ed1c17547b6', fromBlock: 1530060, isAlgebra: true, }, }) module.exports = mergeExports([export1, export2 ]) \ No newline at end of file diff --git a/projects/camelot/index.js b/projects/camelot/index.js index 82ea9cba7e46..bf8159e28f95 100644 --- a/projects/camelot/index.js +++ b/projects/camelot/index.js @@ -23,5 +23,8 @@ module.exports = { }, apechain: { tvl: getUniTVL({factory: '0x7d8c6B58BA2d40FC6E34C25f9A488067Fe0D2dB4', useDefaultCoreAssets: true}) + }, + duckchain: { + tvl: getUniTVL({factory: '0x7d8c6B58BA2d40FC6E34C25f9A488067Fe0D2dB4', useDefaultCoreAssets: true}) } }; \ No newline at end of file diff --git a/projects/canto-lending/index.js b/projects/canto-lending/index.js index a8f26b9abb46..ccd3c82344cd 100644 --- a/projects/canto-lending/index.js +++ b/projects/canto-lending/index.js @@ -9,7 +9,7 @@ const addresses = { NoteUSDCLP: '0x9571997a66D63958e1B3De9647C22bD6b9e7228c', CantoETHLP: '0x216400ba362d8FCE640085755e47075109718C8B', Comptroller: '0x5E23dC409Fc2F832f83CEc191E245A191a4bCc5C', - Note: ADDRESSES.canto.NOTE, + Note: '0x4e71a2e537b7f9d9413d3991d37958c0b5e1e503', USDC: ADDRESSES.functionx.WFX, USDT: ADDRESSES.functionx.PUNDIX, ATOM: ADDRESSES.functionx.USDT, diff --git a/projects/cantohm/index.js b/projects/cantohm/index.js index ffedffea9228..8921ba6596a0 100644 --- a/projects/cantohm/index.js +++ b/projects/cantohm/index.js @@ -12,7 +12,7 @@ module.exports = { tvl: sumTokensExport({ owner: '0xB8Ce90A08bdAdd3e6e6cD3173c0661FA94Aa81c5', tokens: [ - ADDRESSES.canto.NOTE, + '0x4e71a2e537b7f9d9413d3991d37958c0b5e1e503', ADDRESSES.canto.WCANTO, ...lps, ], diff --git a/projects/chi-protocol/index.js b/projects/chi-protocol/index.js index 117d14ce928b..b2da5f975e92 100644 --- a/projects/chi-protocol/index.js +++ b/projects/chi-protocol/index.js @@ -2,14 +2,13 @@ const ADDRESSES = require('../helper/coreAssets.json') const { sumTokens2 } = require('../helper/unwrapLPs'); const { pool2s } = require("../helper/pool2"); -const RESERVE_HOLDER = '0x037528457Cf5b0b9DAb641Fd7F0Ce8Fc9690318d'; -const USC_STAKING = '0x60aBb55c8488698153dB0AF2af362EdB25A505e3'; +const RESERVE_HOLDER = '0xc36303ef9c780292755B5a9593Bfa8c1a7817E2a'; const CHI_STAKING = '0xaB1dCa1C0f948c268652eedC676966002Ae241c6'; const CHI_LOCKING = '0xE3dD17ff009bAC84e32130fcA5f01C908e956603'; const CHI_VESTING = '0x426DBAa2B33cE1B833C13b72503F5128AFef79fC'; const STETH = ADDRESSES.ethereum.STETH; const WETH = ADDRESSES.ethereum.WETH -const USC = '0x38547D918b9645F2D94336B6b61AEB08053E142c'; +const WEETH = ADDRESSES.ethereum.WEETH; const CHI = '0x3b21418081528845a6DF4e970bD2185545b712ba'; const stakingPool2Contracts = [ @@ -25,14 +24,14 @@ async function tvl(api) { const owner = RESERVE_HOLDER; const tokens = [ STETH, - WETH + WETH, + WEETH, ]; return sumTokens2({ owner, tokens, api }) } async function staking(api) { const tokensAndOwners = [ - // [USC, USC_STAKING], [CHI, CHI_STAKING], [CHI, CHI_LOCKING] ]; diff --git a/projects/clober-v2/index.js b/projects/clober-v2/index.js index d704c67ef2ff..65c6b40aa124 100644 --- a/projects/clober-v2/index.js +++ b/projects/clober-v2/index.js @@ -1,4 +1,6 @@ const { getLogs2 } = require('../helper/cache/getLogs') +const { sumTokens2 } = require('../helper/unwrapLPs') +const { getUniqueAddresses } = require('../helper/utils') const abi = { openEvent: 'event Open(uint192 indexed id, address indexed base, address indexed quote, uint64 unitSize, uint24 makerPolicy, uint24 takerPolicy, address hooks)', @@ -9,11 +11,18 @@ const config = { era: { factory: '0xAaA0e933e1EcC812fc075A81c116Aa0a82A5bbb8', fromBlock: 34448160, }, } +function customCacheFunction({ cache, logs }) { + if (!cache.logs) cache.logs = [] + const tokens = logs.map(({ base, quote }) => [base, quote]).flat() + cache.logs.push(...tokens) + cache.logs = getUniqueAddresses(cache.logs) + return cache +} + async function tvl(api) { const { factory, fromBlock } = config[api.chain] - const logs = await getLogs2({ api, factory, eventAbi: abi.openEvent, fromBlock, extraKey: 'open-address', }) - const tokens = logs.map(({ base, quote }) => [base, quote]).flat() - return api.sumTokens({ owner: factory, tokens, }) + const tokens = await getLogs2({ api, factory, eventAbi: abi.openEvent, fromBlock, extraKey: 'open-address', customCacheFunction, skipCacheRead: true }) + return sumTokens2({ api, owner: factory, tokens, permitFailure: true }) } module.exports = { diff --git a/projects/cronos-zk/index.js b/projects/cronos-zk/index.js new file mode 100644 index 000000000000..8de3a066146f --- /dev/null +++ b/projects/cronos-zk/index.js @@ -0,0 +1,31 @@ +const { sumTokens2 } = require("../helper/unwrapLPs"); + +const target = "0xD7f9f54194C633F36CCD5F3da84ad4a1c38cB2cB" +const gasQuery = '0x0000000000000000000000000000000000000001' +const gasAddress = '0x0000000000000000000000000000000000000000' +const chainId = 388 + +module.exports = { + ethereum: { + tvl: async (api) => { + const totalBalances = await sumTokens2({ + api, + owner: target, + fetchCoValentTokens: true, + }) + const balances = await api.multiCall({ + calls: [gasQuery, ...Object.keys(totalBalances)].map(token => ({ + target, params: [chainId, token.substring(token.indexOf(':') + 1)] + })), + abi: { "inputs": [{ "internalType": "uint256", "name": "chainId", "type": "uint256" }, { "internalType": "address", "name": "l1Token", "type": "address" }], "name": "chainBalance", "outputs": [{ "internalType": "uint256", "name": "balance", "type": "uint256" }], "stateMutability": "view", "type": "function" }, + permitFailure: true, + withMetadata: true + }) + api._balances._balances = {} + balances.map(call => { + const token = call.input.params[1] + api.add(token == gasQuery ? gasAddress : token, call.output) + }) + } + }, +}; diff --git a/projects/cybro/index.js b/projects/cybro/index.js index 0e9c8b243c51..eed091e92a4f 100644 --- a/projects/cybro/index.js +++ b/projects/cybro/index.js @@ -1,4 +1,4 @@ -const vaults = [ +const vaultsBlast = [ '0xe922bccf90d74f02a9d4203b377399314e008e41', '0xdccde9c6800bea86e2e91cf54a870ba3ff6faf9f', '0x0667ac28015ed7146f19b2d218f81218abf32951', @@ -22,12 +22,46 @@ const vaults = [ '0x24e72c2c7be9b07942f6f8d3cdce995df699514d', ] -async function tvl(api) { - return api.erc4626Sum2({ calls: vaults }) +const vaultsArbitrum = [ + '0x320cd9d00961fb45857a043efea77dc6b9db5d95', + '0x6f0acbaac51f3c72ddaa4edc6e20fc388d20adbc', + '0x951c846aa10cc3da45defed784c3802605f71769', +] + +const dexes = [ + '0xe9041d3483a760c7d5f8762ad407ac526fbe144f', + '0xbfb18eda8961ee33e38678caf2bceb2d23aedfea', + '0xe472ccb182a51c589034957cd6291d0b64eaaab2', + '0x370498c028564de4491b8aa2df437fb772a39ec5', + '0xc95317e48451a97602e3ae09c237d1dd8ee83cd0', + '0x66e1bea0a5a934b96e2d7d54eddd6580c485521b', +] + +async function tvlBlast(api) { + const token0s = await api.multiCall({ abi: 'address:token0', calls: dexes}) + const token1s = await api.multiCall({ abi: 'address:token1', calls: dexes}) + const positionData = await api.multiCall({ abi: 'function getPositionAmounts() view returns (uint256 amount0, uint256 amount1)', calls: dexes}) + const ownerTokens = [] + dexes.forEach((dex, idx) => { + const token0 = token0s[idx] + const token1 = token1s[idx] + const { amount0, amount1 } = positionData[idx] + api.add(token0, amount0) + api.add(token1, amount1) + ownerTokens.push([[token0, token1], dex]) + }) + + await api.sumTokens({ ownerTokens }) + return api.erc4626Sum2({ calls: vaultsBlast }); +} + +async function tvlArbitrum(api) { + return api.erc4626Sum2({ calls: vaultsArbitrum }); } module.exports = { doublecounted: true, methodology: "We calculate TVL based on the Total Supply of our proxy contracts through which users interact with vault's contracts", - blast: { tvl }, + blast: { tvl: tvlBlast }, + arbitrum: { tvl: tvlArbitrum }, }; diff --git a/projects/d8x/index.js b/projects/d8x/index.js index 87622b002f22..d59cde674ccf 100644 --- a/projects/d8x/index.js +++ b/projects/d8x/index.js @@ -5,6 +5,7 @@ const config = { polygon_zkevm: { factory: "0x900DfC161C34656a9D9c43307F92255C2aa06162" }, xlayer: { factory: "0xb24dB543749277E8625a59C061aE7574C8235475" }, arbitrum: { factory: "0x8f8BccE4c180B699F81499005281fA89440D1e95" }, + base : {factory: "0x7F3A4A9e5BB469F0F4977AA390760aF9EFCCd406"} }; async function tvl(api) { diff --git a/projects/datadex/index.js b/projects/datadex/index.js new file mode 100644 index 000000000000..e62fd4939d0b --- /dev/null +++ b/projects/datadex/index.js @@ -0,0 +1,4 @@ +const { uniV3Export } = require('../helper/uniswapV3') +module.exports = uniV3Export({ + vana: { factory: '0xc2a0d530e57B1275fbce908031DA636f95EA1E38', fromBlock: 763744, blacklistedTokens: ['0xbd2d7c728b224961fdb25ccf2a67eb3c25f5ec52'] }, +}) \ No newline at end of file diff --git a/projects/defiedge/index.js b/projects/defiedge/index.js index b6fa4ce46e85..593ca05004ed 100644 --- a/projects/defiedge/index.js +++ b/projects/defiedge/index.js @@ -20,6 +20,8 @@ async function getTvl(api) { } module.exports = { + hallmarks: [[1730332800, "Definitive Sunset of DefiEdge"]], + deadFrom: '2024-10-31', doublecounted: true, misrepresentedTokens: true, timetravel: false, diff --git a/projects/desyn-basisTrading/index.js b/projects/desyn-basisTrading/index.js index 7cc8e8a537a3..f8b91bca80c0 100644 --- a/projects/desyn-basisTrading/index.js +++ b/projects/desyn-basisTrading/index.js @@ -7,6 +7,7 @@ module.exports = { chains.forEach(chain => { module.exports[chain] = { - tvl: getTvlFunction('strategy3', true) + // rest api type:: StrategyType3 + tvl: getTvlFunction('StrategyType3', true) } }) \ No newline at end of file diff --git a/projects/desyn-farm/helper.js b/projects/desyn-farm/helper.js index b123d9ce590e..f6c67a4da3a4 100644 --- a/projects/desyn-farm/helper.js +++ b/projects/desyn-farm/helper.js @@ -6,10 +6,10 @@ const abi = { getBalance: "function getBalance(address) view returns (uint256)" } - +// The desyn asset arrangement needs to be requested via the rest api form async function getInfoListPool(strategy_type, chain) { - const data = await getConfig('desyn/' + strategy_type, `https://raw.githubusercontent.com/Meta-DesynLab/strategy-asset/refs/heads/main/main/${strategy_type}.json`) - return data.config[chain]?.safePools + const data = await getConfig('desyn/' + strategy_type, `https://api.desyn.io/etf/defillama/get_pool_list?strategy_type=${strategy_type}`) + return data.data.config[chain]?.safePools } // This is aSTETH, @@ -48,7 +48,8 @@ function getTvlFunction(strategy_type, isDoubleCounted) { const allBals = await api.multiCall({ abi: abi.getBalance, calls }) api.add(allTokens, allBals) - if (strategy_type === 'strategy2') + // rest api type:: StrategyType2 + if (strategy_type === 'StrategyType2') api.removeTokenBalance(leverageStaking) } } diff --git a/projects/desyn-farm/index.js b/projects/desyn-farm/index.js index 749fad3489b6..d296a2322cdb 100644 --- a/projects/desyn-farm/index.js +++ b/projects/desyn-farm/index.js @@ -11,6 +11,7 @@ module.exports = { chains.forEach(chain => { module.exports[chain] = { - tvl: getTvlFunction('strategy1', false) + // rest api type:: StrategyType1 + tvl: getTvlFunction('StrategyType1', false) } }) \ No newline at end of file diff --git a/projects/desyn-yieldAggregator/index.js b/projects/desyn-yieldAggregator/index.js index 32d14b79cc60..660a09369180 100644 --- a/projects/desyn-yieldAggregator/index.js +++ b/projects/desyn-yieldAggregator/index.js @@ -7,6 +7,7 @@ module.exports = { chains.forEach(chain => { module.exports[chain] = { - tvl: getTvlFunction('strategy2', true) + // rest api type:: StrategyType2 + tvl: getTvlFunction('StrategyType2', true) } }) \ No newline at end of file diff --git a/projects/devve/index.js b/projects/devve/index.js new file mode 100644 index 000000000000..5b15135dd964 --- /dev/null +++ b/projects/devve/index.js @@ -0,0 +1,12 @@ +const { staking } = require('../helper/staking'); + +module.exports = { + methodology: "DEVVE can be staked in the protocol", + ethereum: { + tvl: () => ({}), + staking: staking( + "0xa0dab5d6907a9CFFD023e0160210eAB464322b70", + "0x8248270620Aa532E4d64316017bE5E873E37cc09" + ), + }, +}; diff --git a/projects/diamondswap/index.js b/projects/diamondswap/index.js new file mode 100644 index 000000000000..cb6a9fcdaf6e --- /dev/null +++ b/projects/diamondswap/index.js @@ -0,0 +1,43 @@ +const { uniTvlExports } = require('../helper/unknownTokens') +const { getLogs, getAddress } = require('../helper/cache/getLogs') +const { sumTokens2 } = require('../helper/unwrapLPs') + +module.exports = uniTvlExports({ + odyssey: '0x7d57C45dC107497C5c5c0F544a84691D2b06BC83', + base: '0xdc93aca9bf72ceb35d1f2cd305bd8335b5b88757', + avax: '0x7ab5ac142799b0a3b6f95c27a1f2149ebcf5287d', +}) + + +async function tvl(api) { + const { factories } = config[api.chain] + const ownerTokens = [] + + for (const { factory, fromBlock } of factories) { + const logs = await getLogs({ + api, + target: factory, + topics: ['0x0d3648bd0f6ba80134a33ba9275ac585d9d315f0ad8355cddefde31afa28d0e9'], + fromBlock, + }) + const pools = logs.map(i => getAddress(i.data.slice(0, 64 + 2))) + const token0s = await api.multiCall({ abi: 'address:token0', calls: pools }) + const token1s = await api.multiCall({ abi: 'address:token1', calls: pools }) + pools.map((pool, i) => ownerTokens.push([[token0s[i], token1s[i]], pool])) + } + return sumTokens2({ api, ownerTokens }) +} + +const config = { + ethereum: { factories: [{ factory: '0xE1046fcB1057ef82B68f3A6B8eBb0e411Cf334E0', fromBlock: 18024947, },], }, + bsc: { + factories: [{ + factory: '0x81a1417cbec636e631fa62b81f970a5ec23b39ca', fromBlock: + 32062831, + },], + }, +} + +Object.keys(config).forEach(chain => { + module.exports[chain] = { tvl } +}) \ No newline at end of file diff --git a/projects/duckchain-new-era/index.js b/projects/duckchain-new-era/index.js new file mode 100644 index 000000000000..42ab996d3309 --- /dev/null +++ b/projects/duckchain-new-era/index.js @@ -0,0 +1,85 @@ +const ADDRESSES = require('../helper/coreAssets.json'); +const { sumTokensExport } = require('../helper/sumTokens'); +const { sumTokens2 } = require('../helper/unwrapLPs'); +const { getConfig } = require('../helper/cache'); + +const defaultOwner = '0x6b0e12Cb3D78a931b74F51D09F3D34E3047c0E49'; // meson + +const config = { + merlin: { + tokens: [ + '0xB880fd278198bd590252621d4CD071b1842E9Bcd', // M-BTC + '0x93919784C523f39CACaa98Ee0a9d96c3F32b593e' // uniBTC + ], + }, +}; + +async function addCoinfg(id, ownerTokens) { + const { result } = await getConfig('meson', 'https://relayer.meson.fi/api/v1/list'); + const { address, tokens } = result.find(c => c.id === id) ?? {}; + if (!address) return; + ownerTokens.push([tokens.map(i => i.addr ?? ADDRESSES.null).filter(i => i), address]); + return ownerTokens; +} + +Object.keys(config).forEach(chain => { + const { id = chain, owner = defaultOwner, tokens } = config[chain]; + module.exports[chain] = { + tvl: async (api) => { + const ownerTokens = []; + if (tokens) ownerTokens.push([tokens, owner]); + await addCoinfg(id, ownerTokens); + return sumTokens2({ api, ownerTokens }); + } + }; +}); + +module.exports = { + methodology: "Summary of Dukchain staking assets", + ton: { + tvl: sumTokensExport({ + tokens: [ + ADDRESSES.null, // 用于追踪原生 TON + "EQCuPm01HldiduQ55xaBF_1kaW_WAUy5DHey8suqzU_MAJOR", + "EQAvlWFDxGF2lXm67y4yzC17wYKD9A0guwPkMs1gOsM__NOT", + "EQCvxJy4eG8hyHBFsZ7eePxrRsUQSFE_jpptRAYBmcG_DOGS", + "EQB4zZusHsbU2vVTPqjhlokIOoiZhEdCMT703CWEzhTOo__X", + "EQAJ8uWd7EBqsmpSWaRdf_I-8R8-XHwh3gsNKhy-UrdrPcUo", + "EQC98_qAmNEptUtPc7W6xdHh_ZHrBUFpw5Ft_IzNU20QAJav", + "EQD-cvR0Nz6XAyRBvbhz-abTrRC6sI5tvHvvpeQraV9UAAD7", + "EQAfF5j3JMIpZlLmACv7Ub7RH7WmiVMuV4ivcgNYHvNnqHTz" + ], + owners: [ + "UQABbkaGs-mjWe6ifQ2h11GOEdGRyAPNrZi41-MK1uX92ulc", // UTONIC Ton生态所有代币 + "EQCVarr_Agtk4A8_Sn5RO2M8QH9j5WQjdoN984P-b6TBZB8Z" // UTONIC 多签 + ], + onlyWhitelistedTokens: false + }) + }, + ethereum: { + tvl: sumTokensExport({ + ownerTokens: [ + [[ADDRESSES.null], "0xb4eE432B0fbb64CC5C4bbA74427436b5347E88A4"] // meson eth + ], + }), + }, + arbitrum: { + tvl: sumTokensExport({ + owners: ["0x5E8c3F0eA1d4004F32dFaE54bca88C78D065d869"], + tokens: [ADDRESSES.arbitrum.WETH, ADDRESSES.arbitrum.USDT, ADDRESSES.arbitrum.USDC_CIRCLE,ADDRESSES.null,] // meson eth usdc and usdt + }), + }, + merlin: { //meson merlin + tvl: async (api) => { + const ownerTokens = []; + const { tokens } = config.merlin; + if (tokens) ownerTokens.push([tokens, defaultOwner]); + //await addCoinfg('merlin', ownerTokens); + return sumTokens2({ api, ownerTokens }); + } + }, +}; + + +// Excluding merlin tvl as it feels inorganic +delete module.exports.merlin \ No newline at end of file diff --git a/projects/dyorswap/index.js b/projects/dyorswap/index.js index 4f8b31d9f772..e4d27a2d890b 100644 --- a/projects/dyorswap/index.js +++ b/projects/dyorswap/index.js @@ -8,6 +8,7 @@ const config = { degen: '0x2CcaDb1e437AA9cDc741574bDa154686B1F04C09', xlayer: '0x2ccadb1e437aa9cdc741574bda154686b1f04c09', bob: '0x2CcaDb1e437AA9cDc741574bDa154686B1F04C09', + ink: '0x6c86ab200661512fDBd27Da4Bb87dF15609A2806', } module.exports = { diff --git a/projects/elys-dex/index.js b/projects/elys-dex/index.js new file mode 100644 index 000000000000..e8ede9cab086 --- /dev/null +++ b/projects/elys-dex/index.js @@ -0,0 +1,22 @@ +const { get } = require('../helper/http') +const { sumTokens2 } = require('../helper/unwrapLPs') + +async function tvl(api) { + let key = '' + const pools = [] + do { + const { pagination: { next_key }, pool } = await get('https://api.elys.network/elys-network/elys/amm/pool?pagination.count_total=true&pagination.per_page=1000&pagination.key=' + key) + key = next_key + pools.push(...pool) + } while (key) + pools.forEach(pool => { + pool.pool_assets.forEach(({ token: { denom, amount } }) => api.add(denom, amount)) + }) + + return sumTokens2({ api }) +} + + +module.exports = { + elys: { tvl, } +} \ No newline at end of file diff --git a/projects/emojicoin/index.js b/projects/emojicoin/index.js index 75a7f7872e67..4d7c572da134 100644 --- a/projects/emojicoin/index.js +++ b/projects/emojicoin/index.js @@ -1,28 +1,42 @@ const ADDRESSES = require('../helper/coreAssets.json') const { function_view, timestampToVersion } = require("../helper/chain/aptos"); +// This function will get all markets and the associated TVL in APT async function getAllMarkets(ledgerVersion) { - // This function will get all markets and the associated TVL in APT - const registry = await function_view({ - functionStr: "0xface729284ae5729100b3a9ad7f7cc025ea09739cd6e7252aff0beb53619cafe::emojicoin_dot_fun::registry_view", - args: [], - type_arguments: [], - ledgerVersion, - }) - return registry.total_quote_locked.value + // If called with a ledger version too early, an error will be thrown by function_view. + // If that is the case, return 0 as it means the package wasn't deployed yet and the + // TVL is then 0. + try { + const registry = await function_view({ + functionStr: "0xface729284ae5729100b3a9ad7f7cc025ea09739cd6e7252aff0beb53619cafe::emojicoin_dot_fun::registry_view", + args: [], + type_arguments: [], + ledgerVersion, + }) + return registry.total_quote_locked.value; + } catch { + return 0; + } } +// Date at which the contract was deployed. +const DEPLOYED_AT_DATE = '2024-11-20'; + +// Block close to the start date but before it. +const DEPLOYED_AT_BLOCK = 254000000; + async function tvl(api) { - // const version = await timestampToVersion(api.timestamp, 1962588495); // this query is not working - const tvl_amount = await getAllMarkets(); + const version = await timestampToVersion(new Date(api.timestamp * 1000), DEPLOYED_AT_BLOCK); + const tvl_amount = await getAllMarkets(version); api.add(ADDRESSES.aptos.APT, tvl_amount); } module.exports = { - timetravel: false, + timetravel: true, methodology: "Aggregates TVL in all pools in Emojicoin.fun", aptos: { tvl, }, -}; \ No newline at end of file + start: DEPLOYED_AT_DATE, +}; diff --git a/projects/evaa/index.js b/projects/evaa/index.js index 2616a62cc1b0..045a507bbda6 100644 --- a/projects/evaa/index.js +++ b/projects/evaa/index.js @@ -3,10 +3,11 @@ const ADDRESSES = require("../helper/coreAssets.json"); const evaaMainPool = "EQC8rUZqR_pWV1BylWUlPNBzyiTYVoBEmQkMIQDZXICfnuRr" const evaaLpPool = "EQBIlZX2URWkXCSg3QF2MJZU-wC5XkBoLww-hdWk2G37Jc6N" +const evaaAltsPool = "EQANURVS3fhBO9bivig34iyJQi97FhMbpivo1aUEAS2GYSu-"; module.exports = { methodology: 'Counts EVAA smartcontract balance as TVL.', ton: { - tvl: sumTokensExport({ owners: [evaaMainPool, evaaLpPool], tokens: [ADDRESSES.null]}), + tvl: sumTokensExport({ owners: [evaaMainPool, evaaLpPool, evaaAltsPool], tokens: [ADDRESSES.null]}), } } diff --git a/projects/extra-xlend/index.js b/projects/extra-xlend/index.js new file mode 100644 index 000000000000..033f5d7c166d --- /dev/null +++ b/projects/extra-xlend/index.js @@ -0,0 +1,11 @@ +const { aaveExports } = require("../helper/aave"); + +const config = { + optimism: { + dataProvider: '0xCC61E9470B5f0CE21a3F6255c73032B47AaeA9C0', + }, +} + +Object.keys(config).forEach((chain) => { + module.exports[chain] = aaveExports(chain, undefined, undefined, [config[chain].dataProvider], { v3: true }); +}); \ No newline at end of file diff --git a/projects/fisclend/index.js b/projects/fisclend/index.js index 4730fc90a45f..da3d724db566 100644 --- a/projects/fisclend/index.js +++ b/projects/fisclend/index.js @@ -3,4 +3,5 @@ const { compoundExports2 } = require('../helper/compound') module.exports = { apechain: compoundExports2({comptroller: '0xd11443B079D62700061F7311fC48C40B30BCEA91', cether: '0xB1974B31b60C7134978e5574F5f1fC8A16535b5D'}), wc: compoundExports2({comptroller: '0xE3de48DCF4968B419BB55421D6B5bF2c049DaFB2', cether: '0xCD04992D1D8d42BB432AD794103c3B498016Da88'}), + sonic: compoundExports2({comptroller: '0x65E8768B86350875DDE19A791f06FfB7a4ADA71b', cether: '0x0B19823EF1F4a6B1f7c52336F428F1a92e9f645E'}), } diff --git a/projects/folks-galgo/index.js b/projects/folks-galgo/index.js index c4da6cdf714a..3591023d4b28 100644 --- a/projects/folks-galgo/index.js +++ b/projects/folks-galgo/index.js @@ -17,13 +17,13 @@ module.exports = { }; module.exports.hallmarks = [ - [1665158400, "Governance 5 Recommitment"], - [1673114400, "Governance 6 Recommitment"], - [1680879600, "Governance 7 Recommitment"], - [1688745600, "Governance 8 Recommitment"], - [1696694400, "Governance 9 Recommitment"], - [1704643200, "Governance 10 Recommitment"], - [1712505600, "Governance 11 Recommitment"], - [1720368000, "Governance 12 Recommitment"], - [1728316800, "Governance 13 Recommitment"], + [1664553600, "Algorand Governance Recommitment"], //5 + [1672502400, "Algo Gov"], //6 + [1680278400, "Algo Gov"], //7 + [1688140800, "Algo Gov"], //8 + [1696089600, "Algo Gov"], //9 + [1704038400, "Algo Gov"], //10 + [1711900800, "Algo Gov"], //11 + [1719763200, "Algo Gov"], //12 + [1727712000, "Algo Gov"], //13 ] \ No newline at end of file diff --git a/projects/folks-xchain/constants.js b/projects/folks-xchain/constants.js index efaf73e65d5e..583eaf367d0e 100644 --- a/projects/folks-xchain/constants.js +++ b/projects/folks-xchain/constants.js @@ -34,6 +34,10 @@ const HubPools = { poolAddress: "0x307bCEC89624660Ed06C97033EDb7eF49Ab0EB2D", tokenAddress: '0xbc78D84Ba0c46dFe32cf2895a19939c86b81a777', }, + { // JOE + poolAddress: "0x5e5a2007a8D613C4C98F425097166095C875e6eE", + tokenAddress: '0x6e84a6216ea6dacc71ee8e6b0a5b7322eebc0fdd', + }, ], 'ethereum': [ // excluding USDC cause bridged diff --git a/projects/fomogame/index.js b/projects/fomogame/index.js new file mode 100644 index 000000000000..2f60bd52dfb3 --- /dev/null +++ b/projects/fomogame/index.js @@ -0,0 +1,12 @@ +const { sumTokensExport } = require("../helper/unwrapLPs"); +const coreAssets = require("../helper/coreAssets.json"); +const Fomo3D = [ + "0xba8be5277A06D2635553b331eAa0BCB6f4bDB809" +]; + +module.exports = { + methodology: "TVL includes a Fomo3D farm contracts", + matchain: { + tvl: sumTokensExport({ owners: Fomo3D, tokens: [coreAssets.null] }), + }, +}; diff --git a/projects/gasp-xyz/index.js b/projects/gasp-xyz/index.js new file mode 100644 index 000000000000..68a7c6e4302e --- /dev/null +++ b/projects/gasp-xyz/index.js @@ -0,0 +1,15 @@ +const { sumTokensExport } = require('../helper/unwrapLPs') + +// taken from https://gasp-stash-prod-dot-direct-pixel-353917.oa.r.appspot.com/affirmed-network/list +const config = { + ethereum: '0x79d968d9017B96f202aD4673A2c1BBbdc905A4ca', + arbitrum: '0x3aDdEb54ddd43Eb40235eC32DfA7928F28A44bb5', + base: '0x308e483afDD225D6cb7bF4d44B8e4a03DFD9c0De', +} + +Object.keys(config).forEach(chain => { + const owner = config[chain] + module.exports[chain] = { + tvl: sumTokensExport({ owner, fetchCoValentTokens: true }) + } +}) \ No newline at end of file diff --git a/projects/gearbox/index.js b/projects/gearbox/index.js index 44405b03bf3b..e9cecaeaf5a0 100644 --- a/projects/gearbox/index.js +++ b/projects/gearbox/index.js @@ -3,7 +3,7 @@ ** ** ** This file has been generated from source code in https://github.com/Gearbox-protocol/defillama repo - ** Binary release: https://github.com/Gearbox-protocol/defillama/releases/tag/v1.4.1 + ** Binary release: https://github.com/Gearbox-protocol/defillama/releases/tag/v1.4.3 ** ** ** @@ -484,7 +484,7 @@ var adapter_default = { optimism: { tvl, }, - methodology: `Retrieves the tokens in each Gearbox pool (WETH/DAI/WBTC/USDC/wstETH) & value of all Credit Accounts (V1/V2/V3) denominated in the underlying token.`, + methodology: `Retrieves the tokens in each Gearbox pool & value of all Credit Accounts (V1/V2/V3) denominated in the underlying token.`, misrepresentedTokens: true, }; diff --git a/projects/genesis-lrt/index.js b/projects/genesis-lrt/index.js index 9f7799cc3976..b7ab940d5b2f 100644 --- a/projects/genesis-lrt/index.js +++ b/projects/genesis-lrt/index.js @@ -7,7 +7,7 @@ async function tvl(api) { module.exports = { hallmarks: [ - [1714953600,"Genesis Merges with InceptionLRT"] + [1714953600, "Genesis Merges with InceptionLRT"] ], doublecounted: true, ethereum: { tvl: tvl, } diff --git a/projects/goblin-dex/index.js b/projects/goblin-dex/index.js new file mode 100644 index 000000000000..2fa08a931fe3 --- /dev/null +++ b/projects/goblin-dex/index.js @@ -0,0 +1,12 @@ +const { uniV3Export } = require('../helper/uniswapV3') +const { staking } = require('../helper/staking') + +module.exports = uniV3Export({ + smartbch: { factory: '0x08153648C209644a68ED4DC0aC06795F6563D17b', fromBlock: 14169895 }, + base: { factory: '0xE82Fa4d4Ff25bad8B07c4d1ebd50e83180DD5eB8', fromBlock: 21481309 }, + bsc: { factory: '0x30D9e1f894FBc7d2227Dd2a017F955d5586b1e14', fromBlock: 42363117 }, +}) + +module.exports.smartbch.staking = staking('0xfA3D02c971F6D97076b8405500c2210476C6A5E8','0x56381cb87c8990971f3e9d948939e1a95ea113a3') +module.exports.bsc.staking = staking('0xb4d117f9c404652030f3d12f6de58172317a2eda','0x701aca29ae0f5d24555f1e8a6cf007541291d110') +module.exports.base.staking = staking('0x866932399DEBdc1694Da094027137Ebb85D97206','0xcdba3e4c5c505f37cfbbb7accf20d57e793568e3') diff --git a/projects/goldsand/index.js b/projects/goldsand/index.js new file mode 100644 index 000000000000..eaa498d55553 --- /dev/null +++ b/projects/goldsand/index.js @@ -0,0 +1,55 @@ +const { getLogs2 } = require("../helper/cache/getLogs"); +const { nullAddress } = require("../helper/tokenMapping"); + +function customCacheFunction({ cache, logs }) { + if (!cache.logs) cache.logs = [] + let sum = cache.logs[0] ?? 0 + sum = logs.reduce((acc, curr) => acc + Number(curr.amount), sum) + cache.logs = [sum] + return cache +} + +module.exports = { + methodology: 'TVL is the sum of deposits minus the sum of withdrawals. Since there is no liquid staking token (yet) and deposited ETH greater than 32 is automatically staked in the beacon chain, the contract balance itself is not the TVL.', + hallmarks: [ + [1732231247, "Privately staked funds deposited to contract."], + ], + timetravel: false, + ethereum: { + tvl: async (api) => { + // Get Funded events + const [fundedLogs] = await getLogs2({ + api, + target: "0x6659423929E1a00119fc3F79C8e4F443cc6fd36f", + extraKey: 'Funded', + eventAbi: "event Funded (address indexed funder, uint256 indexed amount)", + fromBlock: 20966151, + customCacheFunction, + }) + + // Get FundedOnBehalf events + const [fundedOnBehalfLogs] = await getLogs2({ + api, + target: '0x6659423929E1a00119fc3F79C8e4F443cc6fd36f', + extraKey: 'FundedOnBehalf', + eventAbi: 'event FundedOnBehalf(address funder, address funderAccountAddress, uint256 amount)', + fromBlock: 20966151, + customCacheFunction, + }) + + // Get ETHWithdrawnForUser events + const [withdrawnForUserLogs] = await getLogs2({ + api, + target: '0x6659423929E1a00119fc3F79C8e4F443cc6fd36f', + extraKey: 'ETHWithdrawnForUser', + eventAbi: 'event ETHWithdrawnForUser(address recipient, address requestedBy, uint256 amount)', + fromBlock: 20966151, + customCacheFunction, + }) + api.addGasToken((fundedLogs + fundedOnBehalfLogs - withdrawnForUserLogs).toString()) + + // The withdrawl vault holds validator rewards until withdrawn. + return api.sumTokens({ owner: '0x22B35d437b3999F5C357C176adEeC1b8b0F35C13', tokens: [nullAddress] }) + }, + }, +} diff --git a/projects/hackenai/index.js b/projects/hackenai/index.js new file mode 100644 index 000000000000..86e2b6fde475 --- /dev/null +++ b/projects/hackenai/index.js @@ -0,0 +1,16 @@ +const { getConfig } = require('../helper/cache') + +const HAI_base = '0x73e2a6320314883ff8cc08b53f1460a5f4c47f2c'.toLowerCase() + +const staking = async (api) => { + const pools = await getConfig('hackenAI', 'https://api.atomica.org/srm-production-v2/v2/pool/list') + const owners = pools.filter(pool => pool.chainId === api.chainId && pool.capitalToken?.address.toLowerCase() === HAI_base).map(pool => pool.id) + return api.sumTokens({ owners, token: HAI_base }) +} + +module.exports = { + base: { + tvl: () => ({}), staking, + }, + methodology: 'We count the HAI staked in the Flash Pools contracts' +} \ No newline at end of file diff --git a/projects/harmonix/index.js b/projects/harmonix/index.js index aff77b0e0e59..74ab9da984db 100644 --- a/projects/harmonix/index.js +++ b/projects/harmonix/index.js @@ -5,7 +5,7 @@ module.exports = { } const config = { - arbitrum: "0x7274463BF93E0058481042Cbd6e0cc73042E6285", + arbitrum: "0x3363A85c31cf13a96802e2935724232767420135", ethereum: "0xC7C8Cdd1E9817Fc98AD1b05cD3633c6471A9473b", base: "0x45dC73fB760f2382Cfd11e28C0Dd0a3A8d3E4C31", } @@ -18,4 +18,4 @@ Object.keys(config).forEach(chain => { api.addCGToken("tether", bal/1e6) } } -}) \ No newline at end of file +}) diff --git a/projects/helio-money/index.js b/projects/helio-money/index.js index a3f27e05cfa0..e5e7ec45b93d 100644 --- a/projects/helio-money/index.js +++ b/projects/helio-money/index.js @@ -106,7 +106,13 @@ module.exports = { // vUSDT, PSM - LSR // [ADDRESSES.bsc.USDT, "0x5763DDeB60c82684F3D0098aEa5076C0Da972ec7"], - ["0xfd5840cd36d94d7229439859c0112a4185bc0255","0xf76D9cFD08dF91491680313B1A5b44307129CDa9"] + ["0xfd5840cd36d94d7229439859c0112a4185bc0255","0xf76D9cFD08dF91491680313B1A5b44307129CDa9"], + + // pumpBTC + [ + "0xf9C4FF105803A77eCB5DAE300871Ad76c2794fa4", + "0xEA44dDC58eC6b4902E19A353c554B6A4F32b9e6E", + ], ], }), pool2, diff --git a/projects/helper/bitcoin-book/bitget.js b/projects/helper/bitcoin-book/bitget.js index 0b7284235f63..2a3484157321 100644 --- a/projects/helper/bitcoin-book/bitget.js +++ b/projects/helper/bitcoin-book/bitget.js @@ -11,4 +11,8 @@ module.exports = [ '3DSST4myyyRbiGzgCBE1RVHY7GRjDCh4n9', // add on 27/05/2024 '3Nu84pbqfcfaFztQ74qc9ni2PH5HGM1bzS', // add on 27/05/2024 '34hatYbZ27CLLoZWhuJHzBgoTCwXEv8GwT', // add on 27/05/2024 + '3Gm1h16ov9cH4o4mChapGUai61K1bAXL3c', + '1PX5L73e5325fdrSwDHNTuq8RMM9JKR34q', + '1PPyiSbdQeo83ezje6Yv8L3UWpDcx4NtSB', + '1NZc5p5YQ21tGjVrurzczq56SVq2tiH6dt' ] \ No newline at end of file diff --git a/projects/helper/bitcoin-book/bitkub-cex.js b/projects/helper/bitcoin-book/bitkub-cex.js new file mode 100644 index 000000000000..860ee4efe5da --- /dev/null +++ b/projects/helper/bitcoin-book/bitkub-cex.js @@ -0,0 +1,37 @@ +module.exports = [ + "15ZAumgvBkRBpBkvuB699FszE8KW7sUqof", + "3JgjA1xMGhjfwuS2RK7zomuesTbCt4bLyE", + "3Q4Yt1QPe3hfyHok78PCowKd5rJG1hUvjH", + "36u1EMxV4NGMwEoS6WLSHHqww7kM2AGfVR", + "bc1qnh70mytjrnykrlufhz4tsgc3dfphrgsefwm0zx", + "1VHhZ3vZ2rhrT8a5QCt5Sd23Y5APBk9QU", + "bc1qlsg4ph439lemctx2vx6ydpc5sx8d2trv8ry25u", + "1iqw8qwMDcwkkw7AiEXqsxwQQ4qgmRpoP", + "bc1qxj30n45488xf7jc8lrx0val5d36ty7dql495j8", + "12ken5PwHeA6YnD3272S1beaSdGN46cEBh", + "bc1q85sqvgccu9d26mfw8j50y6evmyund0d7sg7rc89csyu3uh0c7f6s5g30nw", + "3AavzRkkbhtQjFJ3CLwA3FPoazxsFZM5go", + "bc1que2ellarxvz4f9pa88f6etejvj9mtsmlse22k8nzygnht6h4tlvqtpk9lf", + "33PkD3DjT6YYao2NbAS7bqFRy6nCTdGXBf", + "18DDXRwzkWvjg87P4fk9CB5k3AC25kxBsU", + "bc1qx8mpvyhk098tnvxe67nj6tc5tf89vurxe6zluf", + "bc1q6tzshzl2f70xmrppxt565prggw897l2nx83ddpts8uqr0m3f2u4q0md0ul", + "32tgDscLHVDZ8xXjnC3QF85qYqat7SXRVN", + "bc1qmclnshk905yfhdfdnzvvzvcpdtxp88dk0mh4vw406dvcq8wjf99qazjm7n", + "bc1q5czmcet3mmkrqy3kmjl90w7dsh284gz9w2pyuzk4lhdzgf0y668sdwcyes", + "bc1q0yqgck69v4d0qf6zzrz49s8ndg9svwdjxua90afe93hkfaud3y4sqeae3c", + "bc1ql55wwe27lgus6yhjkjnuc3dapyzd0vl9349qew3kv4ngl3ne2gvq04td8x", + "3KVbHg9kPNnxrpTJ1CZkfqFsKQM5MWTTyM", + "bc1qc4q0xpeyc6fn77y4nk9hvgg5ulu8akgrswkdpa677vttl4mrrj6sv7qznw", + "bc1q8k3gnwzmplcdhhph2lxg94d8f3ny9fzdwu9ng8qfzplz4q06pg3sysqd3s", + "bc1qgyuw6rmhx6zykg3hnexgzuvkjy0lkwqjmx8m3vwrwql6v7qarpaqsxefkt", + "bc1q3923w0z09hw0kj5nnreu53ckx8jwm09kjd7uz2uqrggrhne54l0su7tml6", + "bc1ql2p9u59z2latfrf50uf33s2zh4xyp088pe4phf5p2ha0mtanxkrsl0xtae", + "bc1qzvuccq7d7z48y5990ecvxwnkwfwvdwxwjx7lg2", + "bc1q809j4zgpppx906gyk5mx7n499u7dsx3q7hmaydx4ze8pjxed0jyq32ehqj", + "bc1q8j67stj9mfse4rxmmjcy2tg44qkayqjkwwyx2yk05va5eradtftqqj4pex", + "bc1q275ytzvet94dc8szxh3pqhrnmcyn9mdsyhx93me3mxfpapwjqu4q9tl9fn", + "bc1qgdy96rwdv4x8t0plptv7756x4hlxgmra6g9nl38k2yk4k6dd766q9kc9lf", + "bc1qjpt89yyna4w9pu0l2zyv7zl0fzv7ghx6u7u2mchmg6wtyq8vdsmqdjdlu2", + "bc1q3uemzcassz2jxswh37wd0jw2l38v7yuq60cj46ftgmkpcs38xh0svv4gq9" +]; diff --git a/projects/helper/bitcoin-book/chakra.js b/projects/helper/bitcoin-book/chakra.js index 00ca490b99f0..cb266e59e8f3 100644 --- a/projects/helper/bitcoin-book/chakra.js +++ b/projects/helper/bitcoin-book/chakra.js @@ -82,7 +82,6 @@ module.exports = [ 'bc1pgs95cjhpq5uedepr6ghvhx9upwdmrq3c67xt2drhkv2etjjlqnsqvxsu69', 'bc1p8r84f5a6vvtl0gedshjzp4rv5mx88ra3etqch9du65fmqwglu0zst80e44', 'bc1p348nh5crmn6zj66a9k4cjmrlrkszj4vaq33sgr6jzhtpyh2qcezspgep7h', - 'bc1pane2m0z8ymreh67xkathhrst8jm4ljw53nkq3da23fmmf6gm522sf03t55', 'bc1pdhc4g25eysun4st2rhhfsusnk4ekhxp85xr2x4uq859tyxnap94sua2k4h', 'bc1phzxznmd5yqp7x07kkes6q7sjcalnyd9pjddrfhywwv23ca7994jquww9fx', 'bc1p7ekf7lt6f3alzzh8gkyjrv0xthp8r9gz28qa4wpam4lv432wn8nquwpuan', @@ -94,7 +93,6 @@ module.exports = [ 'bc1pu5wre7gar0d8tgslaeu5epj62yvx667wuaun2n589nx55xzf42csg34qsq', 'bc1plpjxvkkhj9qfuqnrjtnyvwxfm9j4rdq4jtwhu34anm8etzkyfc2s94vzw3', 'bc1p0tnltsu0qz29xluwntvvcr29aw230tdhqygwg5mru8qqhdvw580sqlznpx', - 'bc1pswxs924q5t24yvvemauja7dvwlduz0nutkq6eu0ug9ptm74kcyys4hrwpe', 'bc1pdcgcjztkqgnrhnm9xqdv87qtqhtr7vxdvpmpux8xzefeypqw39vs9a5z9j', 'bc1pkkn0trywnslz5datc3lz087rgzd8z9644svwykpl2983lzkw9xyqspd2d5', 'bc1pl30rp47rlxrfrtlplzz94kt7g2cr9lhjcygwfjp3tqqt0td7arwq5e25wg', @@ -1927,7 +1925,6 @@ module.exports = [ 'bc1pqgexvgnln9g3jv9cdk5gfuwk94qx0cazx55fndzks0gjpd0hjctsuqc3al', 'bc1p2yxq7kzue2nmlu92gezng4z32x6g5ka7k6trftj8a42zl9c64jgshkqm58', 'bc1pkd9arump85yy9nyjng3lgm0272y8ne44z3j65v3k3r8pyzv37zmqp4apgk', - 'bc1p5ls64xdx47r20ygvewucs05q003cttwuwj7t2uvauypf0aeny0fsu7kwum', 'bc1ppw9czgjcmk3t38xezc4me90dq6e7yyf2gt00mnn5q4c5esv6l9csh563qn', 'bc1p3fc28a90j6ayx0snpfwkc98447xdvqv6euv6rswt4dd22yxmx32s38yzk3', 'bc1psen0kgkez4n0jpekukflet2yqmjm8gq5vqcdxdv69lm6szld8q0sz0a5t6', diff --git a/projects/helper/bitcoin-book/fetchers.js b/projects/helper/bitcoin-book/fetchers.js index 185aa5990819..4ec6e415ea40 100644 --- a/projects/helper/bitcoin-book/fetchers.js +++ b/projects/helper/bitcoin-book/fetchers.js @@ -1,4 +1,4 @@ -const { getConfig } = require('../cache') +const { getConfig, getCache, setCache, } = require('../cache') const axios = require('axios'); const { getEnv } = require('../env') const { get } = require('../http') @@ -10,7 +10,7 @@ module.exports = { btcfi_cdp: async () => { const target = "0x0000000000000000000000000000000000000100"; const api = new sdk.ChainApi({ chain: 'bfc' }) - const round = await api.call({ abi: 'uint32:current_round', target}) + const round = await api.call({ abi: 'uint32:current_round', target }) return api.call({ abi: 'function vault_addresses(uint32 pool_round) view returns (string[])', target, params: round }) }, bedrock: async () => { @@ -48,6 +48,45 @@ module.exports = { userInfos.forEach(i => staticAddresses.push(i.depositAddress)) return staticAddresses }, + + b14g: async () => { + + return getConfig('b14g/bit-addresses', undefined, { + fetcher: async () => { + const btcTxHashLockApi = 'https://api.b14g.xyz/restake/marketplace/defillama/btc-tx-hash' + const { data: { result } } = await get(btcTxHashLockApi) + const hashes = result.map(r => r.txHash) + const hashMap = await getCache('b14g/hash-map', 'core',) ?? {} + for (const hash of hashes) { + if (hashMap[hash]) continue; + const addresses = [] + const tx = await get(`https://mempool.space/api/tx/${reserveBytes(hash.slice(2))}`) + let vinAddress = tx.vin.map(el => el.prevout.scriptpubkey_address); + tx.vout.forEach(el => { + if (el.scriptpubkey_type !== "op_return" && !vinAddress.includes(el.scriptpubkey_address)) { + addresses.push(el.scriptpubkey_address) + } + }) + hashMap[hash] = addresses + } + await setCache('b14g/hash-map', 'core', hashMap) + return [...new Set(Object.values(hashMap).flat())] + } + }) + + function reserveBytes(txHashTemp) { + let txHash = '' + if (txHashTemp.length % 2 === 1) { + txHashTemp = '0' + txHashTemp + } + txHashTemp = txHashTemp.split('').reverse().join('') + for (let i = 0; i < txHashTemp.length - 1; i += 2) { + txHash += txHashTemp[i + 1] + txHashTemp[i] + } + return txHash + } + }, + lombard: async () => { const API_URL = 'https://mainnet.prod.lombard.finance/api/v1/addresses' const BATCH_SIZE = 1000 diff --git a/projects/helper/bitcoin-book/index.js b/projects/helper/bitcoin-book/index.js index 7393a677860d..bd4c9be54b8d 100644 --- a/projects/helper/bitcoin-book/index.js +++ b/projects/helper/bitcoin-book/index.js @@ -90,6 +90,7 @@ const nerveNetworkBridge = require('./nervenetworkbridge.js') const nexusbtc = require('./nexusbtc') const tapbit = require('./tapbit-cex.js') const jbtc = require('./jbtc') +const bitkub = require('./bitkub-cex.js') const p2pb2b = ['39BFtTzZjj6o2s7eewefFQxqM4617VmhEK'] const teleswap = [ @@ -103,8 +104,14 @@ const bitomato = [ 'bc1qgmtx3caf8rlxmzw703ga2sljv3rkkj39e4ysk9', ] +const stacksSBTC = [ + // https://docs.stacks.co/concepts/sbtc/clarity-contracts/sbtc-deposit + 'bc1pl033nz4lj7u7wz3l2k2ew3f7af4sdja8r25ernl00thflwempayswr5hvc' +] + module.exports = { ...fetchers, + stacksSBTC, bitomato, bitlayerBridge, teleswap, @@ -198,5 +205,6 @@ module.exports = { nerveNetworkBridge, nexusbtc, tapbit, - jbtc + jbtc, + bitkub } diff --git a/projects/helper/bitcoin-book/pionex-cex.js b/projects/helper/bitcoin-book/pionex-cex.js index ef591d3c194f..b6f49b158764 100644 --- a/projects/helper/bitcoin-book/pionex-cex.js +++ b/projects/helper/bitcoin-book/pionex-cex.js @@ -1,5 +1,4 @@ module.exports = [ - "1D2Pds2XyiDe7CknDumKkdSECuepGsBCSR", "bc1qs0jdyydyd4kv7fwqre4suhz33mcuy3838xdsla", "1JkmFSbqijbrv6JdyVx2hNwyE8nzEy3Cs5", "bc1qctq0v0vecjxp4de66znkh0dcczkvuqjwwt0za4", @@ -15,5 +14,9 @@ module.exports = [ "bc1q0jkkjr2qr4wl3v399algvsjuk8g7vlm3yaqufu", "17UcdCaVWpmgpuZsKfKdWRUUViAzoQFY3H", "bc1qguymjgurnywqac3rrplr2nmkl26cf5jyyq3vkv", - "1D9YPYQevtEsk26exBjCY2pKfhDsXTxJEE" + "1D9YPYQevtEsk26exBjCY2pKfhDsXTxJEE", + "bc1qs5lsnltqwdvledqvgrf82prja04ej4xk2z7ktu", + "bc1qcc2h0dw6t79y4czk8newhazwgzlygyfawu7k30", + "bc1q7d9lknwmc7tnwcemapkymggne2sv0hxkg84vg6", + "bc1q9a67xl67smtue0ajutxttsla25a45x6fdpwccp" ] \ No newline at end of file diff --git a/projects/helper/cache/vestingHelper.js b/projects/helper/cache/vestingHelper.js index f64477caf7d2..27412767433e 100644 --- a/projects/helper/cache/vestingHelper.js +++ b/projects/helper/cache/vestingHelper.js @@ -16,7 +16,7 @@ async function vestingHelper({ tokens = getUniqueAddresses(tokens) blacklist = getUniqueAddresses(blacklist) tokens = tokens.filter(t => !blacklist.includes(t)) - const chunkSize = chain === 'polygon' ? 250 : 500 // polygon has a lower gas limit + const chunkSize = chain === 'polygon' ? 250 : 2000 // polygon has a lower gas limit const chunks = sliceIntoChunks(tokens, chunkSize) const finalBalances = {} for (let i = 0; i < chunks.length; i++) { diff --git a/projects/helper/cex.js b/projects/helper/cex.js index 279a3ca7fbcf..3aba02bc49be 100644 --- a/projects/helper/cex.js +++ b/projects/helper/cex.js @@ -256,6 +256,8 @@ const defaultTokens = { ADDRESSES.ton.TON_2, ADDRESSES.ton.TON_3, ], + sui: [], + aptos: [], } function cexExports(config) { diff --git a/projects/helper/chain/aptos.js b/projects/helper/chain/aptos.js index b3fe6f453e3c..01e416955a89 100644 --- a/projects/helper/chain/aptos.js +++ b/projects/helper/chain/aptos.js @@ -124,46 +124,59 @@ function sumTokensExport(options) { return async (api) => sumTokens({ ...api, api, ...options }) } -const VERSION_GROUPING = 1000000 - -// If I can get this timestampQuery to work... everything will work seamlessly -async function timestampToVersion(timestamp, start_version = 1962588495, end_version = 1962588495 + VERSION_GROUPING) { - // eslint-disable-next-line no-constant-condition - while (true) { - let closestTransactions = await findClosestTransaction(timestamp, start_version, end_version) - if (closestTransactions.length < 1) { - start_version += VERSION_GROUPING - end_version += VERSION_GROUPING - } else { - return closestTransactions[0].version - } +const graphQLClient = new GraphQLClient("https://api.mainnet.aptoslabs.com/v1/graphql"); + +// Query to get the latest block. +const latestBlockQuery = `query LatestBlock { + block_metadata_transactions(order_by: {version: desc}, limit: 1) { + block_height } -} +}`; -const graphQLClient = new GraphQLClient("https://api.mainnet.aptoslabs.com/v1/graphql") -const timestampQuery = `query TimestampToVersion($timestamp: timestamp, $start_version: bigint, $end_version: bigint) { -block_metadata_transactions( - where: {timestamp: {_gte: $timestamp }, version: {_gte: $start_version, _lte: $end_version}} - limit: 1 - order_by: {version: asc} -) { +// Query to get a block. +const blockQuery = `query Block($block: bigint) { + block_metadata_transactions(limit: 1, where: {block_height: {_eq: $block}}) { timestamp version } }`; -async function findClosestTransaction(timestamp, start_version, end_version) { - let date = new Date(timestamp * 1000).toISOString() - - const results = await graphQLClient.request( - timestampQuery, - { - timestamp: date, - start_version, - end_version, - } - ) - return results.block_metadata_transactions +// Query to get a block range. +const blockRangeQuery = `query Block($firstBlock: bigint, $limit: Int) { + block_metadata_transactions(limit: $limit, where: {block_height: {_gte: $firstBlock}}, order_by: {block_height: asc}) { + timestamp + version + } +}`; + +// Given a timestamp, returns the transaction version that is closest to that timestamp. +const timestampToVersion = async (timestamp, minBlock = 0) => { + let left = minBlock; + let right = await graphQLClient.request(latestBlockQuery).then(r => Number(r.block_metadata_transactions[0].block_height)); + let middle; + while (left + 100 < right) { + middle = Math.round((left + right) / 2); + const middleBlock = await graphQLClient.request(blockQuery, { block: middle }).then(r => r.block_metadata_transactions[0]); + const middleBlockDate = new Date(middleBlock.timestamp); + if (middleBlockDate.getTime() === timestamp.getTime()) { + return Number(middleBlock.version); + } + if (timestamp.getTime() < middleBlockDate.getTime()) { + right = middle; + } else { + left = middle + 1; + } + } + const blocks = await graphQLClient.request( + blockRangeQuery, + { firstBlock: left, limit: right - left } + ).then(r => r.block_metadata_transactions); + const mappedBlocks = blocks.map((e) => ({ + version: Number(e.version), + delta: Math.abs(timestamp.getTime() - new Date(e.timestamp).getTime()) + })); + mappedBlocks.sort((a, b) => a.delta - b.delta); + return mappedBlocks[0].version; } module.exports = { diff --git a/projects/helper/chain/cosmos.js b/projects/helper/chain/cosmos.js index 70ca3bc69ba8..50b4ad6e8160 100644 --- a/projects/helper/chain/cosmos.js +++ b/projects/helper/chain/cosmos.js @@ -43,7 +43,9 @@ const endPoints = { nibiru: "https://lcd.nibiru.fi", bostrom: "https://lcd.bostrom.cybernode.ai", joltify: "https://lcd.joltify.io", + kopi: "https://rest.kopi.money", noble: "https://noble-api.polkachu.com", + elys: "https://api.elys.network", // https://api.elys.network/#/Query/ElysAmmPoolAll pryzm: "https://api.pryzm.zone" }; diff --git a/projects/helper/chain/litecoin.js b/projects/helper/chain/litecoin.js index 400d6f6d20b7..b8c42f51c1da 100644 --- a/projects/helper/chain/litecoin.js +++ b/projects/helper/chain/litecoin.js @@ -4,7 +4,7 @@ const { PromisePool } = require('@supercharge/promise-pool') // const url = addr => 'https://chainz.cryptoid.info/ltc/api.dws?q=getbalance&a=' + addr const url1 = addr => 'https://ltc.tokenview.io/api/address/balancetrend/ltc/' + addr -const url = addr => 'https://explorer.litecoin.net/api/address/' + addr +const url = addr => 'https://litecoinspace.org/api/address/' + addr async function getBalance(addr) { try { diff --git a/projects/helper/chain/rpcProxy.js b/projects/helper/chain/rpcProxy.js index a1dd3ce6e690..ee05f6104b8f 100644 --- a/projects/helper/chain/rpcProxy.js +++ b/projects/helper/chain/rpcProxy.js @@ -20,6 +20,12 @@ module.exports = { return data } }, + drift: { + vaultTvl: async (vault, version) => { + const { data } = await client.get('/drift/vault_tvl', { params: { vault, version } }) + return data + } + }, injective: { mitoVaultQuery: async ({ address }) => { const { data } = await client.get('/injective/mito-vault/' + address) diff --git a/projects/helper/chain/tezos.js b/projects/helper/chain/tezos.js index 5bc17101dc55..a0c60de4434a 100644 --- a/projects/helper/chain/tezos.js +++ b/projects/helper/chain/tezos.js @@ -3,7 +3,7 @@ const http = require('../http') const sdk = require('@defillama/sdk') const { PromisePool } = require('@supercharge/promise-pool') -const RPC_ENDPOINT = 'https://api.tzkt.io' +const RPC_ENDPOINT = 'https://api.mainnet.tzkt.io' const usdtAddressTezos = ADDRESSES.tezos.USDt const transformAddressDefault = t => t == "tezos" ? "coingecko:tezos" : 'tezos:' + t @@ -86,7 +86,7 @@ async function resolveLPPosition({ balances = {}, owner, lpToken, transformAddre } async function sumTokens({ owners = [], balances = {}, includeTezos = false }) { - const { errors } = await PromisePool.withConcurrency(10) + const { errors } = await PromisePool.withConcurrency(5) .for(owners) .process(async item => { await getTokenBalances(item, includeTezos, { balances }) diff --git a/projects/helper/chain/utils/ton-address.js b/projects/helper/chain/utils/ton-address.js index 62720d6da491..d704c7d43694 100644 --- a/projects/helper/chain/utils/ton-address.js +++ b/projects/helper/chain/utils/ton-address.js @@ -126,7 +126,7 @@ class Address { address: new Address(r.workchain, r.hashPart), }; } else { - let addr = source.replace(/\-/g, "+").replace(/_/g, "/"); // Convert from url-friendly to true base64 + let addr = source.replace(/-/g, "+").replace(/_/g, "/"); // Convert from url-friendly to true base64 let r = parseFriendlyAddress(addr); return { isBounceable: r.isBounceable, diff --git a/projects/helper/chains.json b/projects/helper/chains.json index 11846b417192..8ded60ebd330 100644 --- a/projects/helper/chains.json +++ b/projects/helper/chains.json @@ -3,6 +3,7 @@ "ace", "aelf", "aeternity", + "agoric", "ailayer", "airdao", "alephium", @@ -93,6 +94,7 @@ "doge", "dogechain", "dsc", + "duckchain", "dydx", "dymension", "echelon", @@ -101,6 +103,7 @@ "elastos", "elrond", "elsm", + "elys", "empire", "energi", "energyweb", @@ -159,6 +162,7 @@ "imx", "inevm", "injective", + "ink", "interlay", "iotaevm", "iotex", @@ -176,6 +180,7 @@ "kinto", "kintsugi", "klaytn", + "kopi", "kroma", "kujira", "kusama", @@ -234,6 +239,7 @@ "oas", "oasis", "obyte", + "odyssey", "okexchain", "omax", "ontology", @@ -266,6 +272,7 @@ "pryzm", "pulse", "q", + "qom", "quasar", "quicksilver", "radixdlt", @@ -302,7 +309,9 @@ "sommelier", "songbird", "sonic", + "sophon", "sora", + "swellchain", "stacks", "stafi", "staking", @@ -336,6 +345,7 @@ "ultron", "umee", "unit0", + "vana", "vechain", "velas", "venom", diff --git a/projects/helper/coreAssets.json b/projects/helper/coreAssets.json index be3f826f7e3f..58df64f120a2 100644 --- a/projects/helper/coreAssets.json +++ b/projects/helper/coreAssets.json @@ -4,6 +4,7 @@ "WETH": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "WSTETH": "0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0", "STETH": "0xae7ab96520de3a18e5e111b5eaab095312d7fe84", + "WEETH": "0xCd5fE23C85820F7B72D0926FC9b05b43E359b7ee", "sfrxETH": "0xac3e018457b222d93114458476f3e3416abbe38f", "USDC": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", "LINK": "0x514910771af9ca656af840dff83e8264ecf986ca", @@ -2079,12 +2080,36 @@ }, "sonic": { "wS": "0x039e2fb66102314ce7b64ce5ce3e5183bc94ad38", - "WS_1": "0x832497895f05100e53f42dfa8fc758b4866b183a" + "WS_1": "0x832497895f05100e53f42dfa8fc758b4866b183a", + "USDC.e": "0x29219dd400f2Bf60E5a23d13Be72B486D4038894", + "WETH": "0x309C92261178fA0CF748A855e90Ae73FDb79EBc7" }, "vinu": { "USDT": "0xC0264277fcCa5FCfabd41a8bC01c1FcAF8383E41", "ETH": "0xDd4b9b3Ce03faAbA4a3839c8B5023b7792be6e2C", "VINU": "0x00c1E515EA9579856304198EFb15f525A0bb50f6", "WVC": "0xEd8c5530a0A086a12f57275728128a60DFf04230" + }, + "sophon": { + "ETH": "0x72af9f169b619d85a47dfa8fefbcd39de55c567d", + "USDT": "0x6386da73545ae4e2b2e0393688fa8b65bb9a7169", + "USDC": "0x9aa0f72392b5784ad86c6f3e899bcc053d00db4f", + "WSTETH": "0x60d02f185f80644e1a5ae35497736dd31d1b078b", + "WEETH": "0x5e9fc50b44988b66ba84500f8bc32c0493fe8f8d", + "DAI": "0x88171a5bbacd92ca5e25575c5904581c80b025dd", + "SDAI": "0xeccbb9360d235548473cb8c752735f68e652439b" + }, + "ink": { + "WETH": "0x4200000000000000000000000000000000000006" + }, + "duckchain": { + "WTON": "0x7F9308E8d724e724EC31395f3af52e0593BB2e3f" + }, + "qom": { + "WQOM": "0xa26dfBF98Dd1A32FAe56A3D2B2D60A8a41b0bDF0" + }, + "vana": { + "WVANA": "0x00eddd9621fb08436d0331c149d1690909a5906d", + "USDC.e": "0xf1815bd50389c46847f0bda824ec8da914045d14" } } \ No newline at end of file diff --git a/projects/helper/env.js b/projects/helper/env.js index 23c7da1cb961..bf52b2432175 100644 --- a/projects/helper/env.js +++ b/projects/helper/env.js @@ -19,6 +19,11 @@ const DEFAULTS = { ANKR_API_KEY: '79258ce7f7ee046decc3b5292a24eb4bf7c910d7e39b691384c7ce0cfb839a01', RENEC_RPC: "https://api-mainnet-beta.renec.foundation:8899/", RPC_PROXY_URL: "https://rpc-proxy.llama.fi", + DUCKCHAIN_RPC: "https://rpc.duckchain.io,https://rpc-hk.duckchain.io", + SOPHON_RPC_MULTICALL: "0x5f4867441d2416cA88B1b3fd38f21811680CD2C8", + VANA_RPC_MULTICALL: "0xFe92b91F3326e58557478c28EeAe1936E0c7148a", + FILECOIN_RPC_MULTICALL: "0xcA11bde05977b3631167028862bE2a173976CA11", + ODYSSEY_RPC_MULTICALL: "0xD5F04861e1249F488ef8898607cF7ad0F334d823", } const ENV_KEYS = [ diff --git a/projects/helper/tokenMapping.js b/projects/helper/tokenMapping.js index ad06490f1181..f1f7caf85b0e 100644 --- a/projects/helper/tokenMapping.js +++ b/projects/helper/tokenMapping.js @@ -18,7 +18,10 @@ coreAssets = JSON.parse(JSON.stringify(coreAssets)) // orbit brige: https://bridge.orbitchain.io/open/v1/api/monitor/rawTokenList -const ibcChains = ['ibc', 'terra', 'terra2', 'crescent', 'osmosis', 'kujira', 'stargaze', 'juno', 'injective', 'cosmos', 'comdex', 'umee', 'orai', 'persistence', 'fxcore', 'neutron', 'quasar', 'chihuahua', 'sei', 'archway', 'migaloo', 'secret', 'aura', 'xpla', 'bostrom', 'joltify', 'nibiru', "pryzm"] +const ibcChains = ['ibc', 'terra', 'terra2', 'crescent', 'osmosis', 'kujira', 'stargaze', 'juno', 'injective', 'cosmos', 'comdex', 'umee', 'orai', 'persistence', 'fxcore', 'neutron', 'quasar', 'chihuahua', 'sei', 'archway', 'migaloo', 'secret', 'aura', 'xpla', 'bostrom', 'joltify', 'nibiru', + 'kopi', 'elys', "pryzm" + +] const caseSensitiveChains = [...ibcChains, 'solana', 'tezos', 'ton', 'algorand', 'aptos', 'near', 'bitcoin', 'waves', 'tron', 'litecoin', 'polkadot', 'ripple', 'elrond', 'cardano', 'stacks', 'sui', 'ergo', 'mvc', 'renec', 'doge', 'stellar', 'massa', 'eclipse', ] @@ -35,16 +38,54 @@ const ibcMappings = { // Sample Code // 'ibc/CA1261224952DF089EFD363D8DBB30A8AB6D8CD181E60EE9E68E432F8DE14FE3': { coingeckoId: 'inter-stable-token', decimals: 6, }, // 'ibc/5A76568E079A31FA12165E4559BA9F1E9D4C97F9C2060B538C84DCD503815E30': { coingeckoId: 'injective-protocol', decimals: 18, }, + 'ibc:DE63D8AC34B752FB7D4CAA7594145EDE1C9FC256AC6D4043D0F12310EB8FC255': { coingeckoId: 'injective-protocol', decimals: 18, }, + 'ibc:25418646C017D377ADF3202FF1E43590D0DAE3346E594E8D78176A139A928F88': { coingeckoId: 'cosmos', decimals: 6, }, + 'ibc:D8A36AE90F20FE4843A8D249B1BCF0CCDDE35C4B605C8DED57BED20C639162D0': { coingeckoId: 'tether', decimals: 6, }, + 'ibc:45D6B52CAD911A15BD9C2F5FFDA80E26AFCB05C7CD520070790ABC86D2B24229': { coingeckoId: 'celestia', decimals: 6, }, } const fixBalancesTokens = { + // Sample Code ozone: { // '0x83048f0bf34feed8ced419455a4320a735a92e9d': { coingeckoId: "ozonechain", decimals: 18 }, // was mapped to wrong chain }, - apechain: { - [ADDRESSES.null]: { coingeckoId: "apecoin", decimals: 18 }, + kopi: { + 'uasusdc': { coingeckoId: 'usd-coin', decimals: 6 }, + 'ucusdc': { coingeckoId: 'usd-coin', decimals: 6 }, + 'uasusdtinj': { coingeckoId: 'tether', decimals: 6 }, + 'ucusdtinj': { coingeckoId: 'tether', decimals: 6 }, + }, + swellchain: { + [ADDRESSES.null]: { coingeckoId: 'ethereum', decimals: 18 }, + [ADDRESSES.base.WETH]: { coingeckoId: 'ethereum', decimals: 18 }, + "0xb5668713E9BA8bC96f97D691663E70b54CE90b0A": { "coingeckoId": "wrapped-bitcoin-universal", "decimals": 18 }, + "0xf6718b2701D4a6498eF77D7c152b2137Ab28b8A3": { "coingeckoId": "lorenzo-stbtc", "decimals": 18 }, + "0x2826D136F5630adA89C1678b64A61620Aab77Aea": { "coingeckoId": "swell-network", "decimals": 18 }, + "0x1cf7b5f266A0F39d6f9408B90340E3E71dF8BF7B": { "coingeckoId": "swell-restaked-btc", "decimals": 8 }, + "0xb89c6ED617f5F46175E41551350725A09110bbCE": { "coingeckoId": "tether", "decimals": 6 }, + "0x99a38322cAF878Ef55AE4d0Eda535535eF8C7960": { "coingeckoId": "usd-coin", "decimals": 6 }, + "0xA6cB988942610f6731e664379D15fFcfBf282b44": { "coingeckoId": "wrapped-eeth", "decimals": 18 }, + "0x18d33689AE5d02649a859A1CF16c9f0563975258": { "coingeckoId": "restaked-swell-eth", "decimals": 18 }, + "0x09341022ea237a4DB1644DE7CCf8FA0e489D85B7": { "coingeckoId": "sweth", "decimals": 18 }, + "0x9cb41CD74D01ae4b4f640EC40f7A60cA1bCF83E7": { "coingeckoId": "renzo-restaked-lst", "decimals": 18 }, + "0x2416092f143378750bb29b79eD961ab195CcEea5": { "coingeckoId": "renzo-restaked-eth", "decimals": 18 }, + "0xc3eACf0612346366Db554C991D7858716db09f58": { "coingeckoId": "kelp-dao-restaked-eth", "decimals": 18 }, + "0x7c98E0779EB5924b3ba8cE3B17648539ed5b0Ecc": { "coingeckoId": "wrapped-steth", "decimals": 18 }, + "0x5d3a1Ff2b6BAb83b63cd9AD0787074081a52ef34": { "coingeckoId": "ethena-usde", "decimals": 18 }, + "0x211Cc4DD073734dA055fbF44a2b4667d5E5fE5d2": { "coingeckoId": "ethena-staked-usde", "decimals": 18 }, + "0x58538e6A46E07434d7E7375Bc268D3cb839C0133": { "coingeckoId": "ethena", "decimals": 18 }, + }, + elys: { + 'uelys': { coingeckoId: 'elys-network', decimals: 6 }, + }, + wc: { + [ADDRESSES.null]: { coingeckoId: 'ethereum', decimals: 18 }, }, + odyssey: { + [ADDRESSES.null]: { coingeckoId: 'dione', decimals: 18 }, + '0xf21cbaf7bd040d686bd390957770d2ea652e4013': { coingeckoId: 'dione', decimals: 18 }, + } } ibcChains.forEach(chain => fixBalancesTokens[chain] = { ...ibcMappings, ...(fixBalancesTokens[chain] || {}) }) diff --git a/projects/helper/utils.js b/projects/helper/utils.js index 86edb86dbb7c..2102c3d0931f 100644 --- a/projects/helper/utils.js +++ b/projects/helper/utils.js @@ -101,6 +101,7 @@ function isLP(symbol, token, chain) { if (['fantom', 'nova',].includes(chain) && ['NLT'].includes(symbol)) return true if (chain === 'ethereumclassic' && symbol === 'ETCMC-V2') return true if (chain === 'shibarium' && ['SSLP', 'ChewyLP'].includes(symbol)) return true + if (chain === 'omax' && ['OSWAP-V2'].includes(symbol)) return true let label if (symbol.startsWith('ZLK-LP') || symbol.includes('DMM-LP') || (chain === 'avax' && 'DLP' === symbol) || symbol === 'fChe-LP') diff --git a/projects/inception-lrt/index.js b/projects/inception-lrt/index.js index 3731811b65e8..0fa72a37e415 100644 --- a/projects/inception-lrt/index.js +++ b/projects/inception-lrt/index.js @@ -1,18 +1,19 @@ const ADDRESSES = require('../helper/coreAssets.json') async function tvl_eth(api) { - const vaults = ['0x36B429439AB227fAB170A4dFb3321741c8815e55', '0xfE715358368416E01d3A961D3a037b7359735d5e', '0x90E80E25ABDB6205B08DeBa29a87f7eb039023C2', '0x4878F636A9Aa314B776Ac51A25021C44CAF86bEd', '0xA9F8c770661BeE8DF2D026edB1Cb6FF763C780FF', '0x1Aa53BC4Beb82aDf7f5EDEE9e3bBF3434aD59F12', '0x814CC6B8fd2555845541FB843f37418b05977d8d', '0xc4181dC7BB31453C4A48689ce0CBe975e495321c', '0xC0660932C5dCaD4A1409b7975d147203B1e9A2B6', '0x6E17a8b5D33e6DBdB9fC61d758BF554b6AD93322', '0x295234B7E370a5Db2D2447aCA83bc7448f151161', '0xd0ee89d82183D7Ddaef14C6b4fC0AA742F426355'] + const vaults = ['0x36B429439AB227fAB170A4dFb3321741c8815e55', '0xfE715358368416E01d3A961D3a037b7359735d5e', '0x90E80E25ABDB6205B08DeBa29a87f7eb039023C2', '0x4878F636A9Aa314B776Ac51A25021C44CAF86bEd', '0xA9F8c770661BeE8DF2D026edB1Cb6FF763C780FF', '0x1Aa53BC4Beb82aDf7f5EDEE9e3bBF3434aD59F12', '0x814CC6B8fd2555845541FB843f37418b05977d8d', '0xc4181dC7BB31453C4A48689ce0CBe975e495321c', '0xC0660932C5dCaD4A1409b7975d147203B1e9A2B6', '0x6E17a8b5D33e6DBdB9fC61d758BF554b6AD93322', '0x295234B7E370a5Db2D2447aCA83bc7448f151161', '0xd0ee89d82183D7Ddaef14C6b4fC0AA742F426355', '0xf9D9F828989A624423C48b95BC04E9Ae0ef5Ec97'] const total_deposited = await api.multiCall({ abi: 'uint256:getTotalDeposited', calls: vaults, permitFailure: true}) // const total_withdraw = await api.multiCall({ abi: 'uint256:totalAmountToWithdraw', calls: vaults, permitFailure: true}) - const strategies = await api.multiCall({ abi: 'address:strategy', calls: vaults}) - const tokens = await api.multiCall({ abi: 'address:underlyingToken', calls: strategies}) + // const strategies = await api.multiCall({ abi: 'address:strategy', calls: vaults}) + const tokens = await api.multiCall({ abi: 'address:asset', calls: vaults}) // const result = total_deposited.map((deposited, index) => deposited - total_withdraw[index]); api.add(tokens, total_deposited) } module.exports = { hallmarks: [ - [1714953600,"Genesis Merges with InceptionLRT"] + [1714953600, "Genesis Merges with InceptionLRT"], + [1734530420, "Amphor Labs Merges with InceptionLRT"] ], doublecounted: true, ethereum: { tvl: tvl_eth, } , diff --git a/projects/ink/index.js b/projects/ink/index.js new file mode 100644 index 000000000000..960c3f159906 --- /dev/null +++ b/projects/ink/index.js @@ -0,0 +1,15 @@ +const { sumTokens2 } = require("../helper/unwrapLPs"); + +module.exports = { + ethereum: { + tvl: (api) => + sumTokens2({ + api, + owners: [ + "0x88FF1e5b602916615391F55854588EFcBB7663f0", + "0x5d66C1782664115999C47c9fA5cd031f495D3e4F", + ], + fetchCoValentTokens: true, + }), + }, +}; diff --git a/projects/inkswap/index.js b/projects/inkswap/index.js new file mode 100644 index 000000000000..4e3cead06b80 --- /dev/null +++ b/projects/inkswap/index.js @@ -0,0 +1,4 @@ +const { uniTvlExports } = require('../helper/unknownTokens') +module.exports = uniTvlExports({ + ink: '0xBD5B41358A6601924F1Fd708aF1535a671f530A9' +}) \ No newline at end of file diff --git a/projects/javsphere/index.js b/projects/javsphere/index.js index 597cbb508849..076b8815ee62 100644 --- a/projects/javsphere/index.js +++ b/projects/javsphere/index.js @@ -5,15 +5,16 @@ const FREEZER_BASE = '0x03e225D2bd32F5ecE539005B57F9B94A743ADBFB' const VESTING_BASE = '0x42a40321843220e9811A1385D74d9798436f7002' const JAV_BASE = '0xEdC68c4c54228D273ed50Fc450E253F685a2c6b9' const LEVERAGEX_BASE_EARN = '0xfd916d70eb2d0e0e1c17a6a68a7fbede3106b852' +const LEVERAGEX_BASE_DIAMOND = '0xBF35e4273db5692777EA475728fDbBa092FFa1B3' async function tvl(api) { const config = await api.fetchList({ lengthAbi: 'tokensCount', itemAbi: "function tokens(uint256) view returns (address asset, bytes32 priceFeed, uint256 targetWeightage, bool isActive)", target: LEVERAGEX_BASE_EARN }) const tokens = config.map(i => i.asset) - return api.sumTokens({ owner: LEVERAGEX_BASE_EARN, tokens, }) + return api.sumTokens({ owners: [LEVERAGEX_BASE_EARN, LEVERAGEX_BASE_DIAMOND], tokens, }) } module.exports = { - methodology: `We count the total value locked from staking and freezer of javsphers native token JAV). `, + methodology: `We count the TVL of LeverageX Trading platform leveragex.trade (LPs and Traders). And TVL from staking and freezer of javsphers native token JAV.`, hallmarks: [ [1733837635, "Migration to BASE"], ], diff --git a/projects/jbtc/index.js b/projects/jbtc/index.js index bc1d995856c1..9b66d22e76e2 100644 --- a/projects/jbtc/index.js +++ b/projects/jbtc/index.js @@ -1,9 +1,12 @@ -const { sumTokensExport } = require('../helper/sumTokens') +const { sumTokensExport, nullAddress, } = require('../helper/sumTokens') const bitcoinAddressBook = require('../helper/bitcoin-book/index.js') module.exports = { methodology: 'Total amount of BTC locked in Bitcoin network on wallet bc1qmukuv7j57umsd5tgg9fw88eqap57rzphkfckyp', bitcoin: { tvl: sumTokensExport({ owner: bitcoinAddressBook.jbtc }), - } + }, + ethereum: { + tvl: sumTokensExport({ owners: ['0x7e90Ef7D172843dB68e42FC5fAA8CB7C1803Dcfa'], tokens: [nullAddress] }), + }, } diff --git a/projects/kernel-dao/index.js b/projects/kernel-dao/index.js new file mode 100644 index 000000000000..43ca55a11844 --- /dev/null +++ b/projects/kernel-dao/index.js @@ -0,0 +1,21 @@ +/** + * Kernel DAO contracts + * + * @see https://github.com/Kelp-DAO/kernel-smart-contracts-private/blob/develop/doc/contract-address/Mainnet.md + */ +const ASSET_REGISTRY = '0xd0B91Fc0a323bbb726faAF8867CdB1cA98c44ABB'; + + +async function tvl(api) { + const tokens = await api.call({ abi: 'address[]:getAssets', target: ASSET_REGISTRY}) + const vaults = await api.multiCall({ abi: 'function getVault(address) view returns (address)', calls: tokens, target: ASSET_REGISTRY}) + return api.sumTokens({ tokensAndOwners2: [tokens, vaults]}) +} + +module.exports = { + methodology: 'Calculates total TVL.', + start: 1733817000, + bsc: { + tvl, + } +}; diff --git a/projects/kongswap/index.js b/projects/kongswap/index.js new file mode 100644 index 000000000000..41e8df6946ef --- /dev/null +++ b/projects/kongswap/index.js @@ -0,0 +1,11 @@ +const { get } = require('../helper/http') + +module.exports = { + misrepresentedTokens: true, + icp: { tvl }, +} + +async function tvl(api) { + let { tvlUSD } = await get('https://api.kongswap.io/api/defillama/tvl') + api.addCGToken('tether', Math.round(tvlUSD)) +} diff --git a/projects/kopi/index.js b/projects/kopi/index.js new file mode 100644 index 000000000000..dc7e08916af7 --- /dev/null +++ b/projects/kopi/index.js @@ -0,0 +1,16 @@ +const { sumTokens } = require('../helper/chain/cosmos'); + +async function tvl(api) { + return sumTokens({ api, owner: 'kopi14t4jnhmjejj08x5w8f4t0r3lv820gvh85xw8np', blacklistedTokens: [ + // excluding projects own tokens + 'ukopi', + 'ukusd', + ]}) +} + +module.exports = { + kopi: { + tvl + } +}; + diff --git a/projects/lagoon/index.js b/projects/lagoon/index.js new file mode 100644 index 000000000000..b358e56f0bb1 --- /dev/null +++ b/projects/lagoon/index.js @@ -0,0 +1,26 @@ +const { sumERC4626VaultsExport } = require('../helper/erc4626'); +const sdk = require('@defillama/sdk'); + +const config = { + ethereum: { + lvTokens: { + totalAssets: [ + "0x07ed467acD4ffd13023046968b0859781cb90D9B", // 9Summits Flagship ETH + "0x03D1eC0D01b659b89a87eAbb56e4AF5Cb6e14BFc", + ], + }, + }, +}; + + + +const totalAssetsVaults = config.ethereum.lvTokens.totalAssets; + +const tvl = sdk.util.sumChainTvls([ + sumERC4626VaultsExport({ + vaults: totalAssetsVaults, + tokenAbi: 'asset', + balanceAbi: 'totalAssets', + }), +]); +module.exports['ethereum'] = { tvl }; diff --git a/projects/lander/index.js b/projects/lander/index.js new file mode 100644 index 000000000000..f51e96289bbd --- /dev/null +++ b/projects/lander/index.js @@ -0,0 +1,5 @@ +const { compoundExports2 } = require("../helper/compound"); + +module.exports = { + bsc: compoundExports2({ comptroller: '0x344655CB08a25A7b2501CafB47CdF9490cE7fad3' }) +} diff --git a/projects/limitless-exchange/index.js b/projects/limitless-exchange/index.js index 265a506c3354..c4eb1608ecc6 100644 --- a/projects/limitless-exchange/index.js +++ b/projects/limitless-exchange/index.js @@ -1,14 +1,18 @@ const { getLogs2 } = require('../helper/cache/getLogs') + const eventAbi = "event FixedProductMarketMakerCreation(address indexed creator, address fixedProductMarketMaker, address indexed conditionalTokens, address indexed collateralToken, bytes32[] conditionIds, uint256 fee)"; + const config = [ { factory: "0x8E50578ACa3C5E2Ef5ed2aA4bd66429B5e44C16E", resolver: "0x15A61459d65D89A25a9e91e0dc9FC69598791505", fromBlock: 13547870 }, { factory: "0xc397D5d70cb3B56B26dd5C2824d49a96c4dabF50", resolver: "0xc9c98965297bc527861c898329ee280632b76e18", fromBlock: 13547845 }, ]; +const blacklistedTokens = ['0xd7788ffc73c9ae39ce24dfc1098b375792dd42ac'] + const getMarkets = async ({ factory, resolver, fromBlock }, api) => { const logs = await getLogs2({ api, target: factory, eventAbi, fromBlock }); const tokens = logs.map(i => i.collateralToken) - return api.sumTokens({ owner: resolver, tokens }); + return api.sumTokens({ owner: resolver, tokens, blacklistedTokens }); }; const tvl = async (api) => { diff --git a/projects/lineabank/index.js b/projects/lineabank/index.js index 39cb80e2b081..3b8100dcc0c5 100644 --- a/projects/lineabank/index.js +++ b/projects/lineabank/index.js @@ -8,7 +8,8 @@ const config = { zklink: '0x4Ac518DbF0CC730A1c880739CFa98fe0bB284959', bsquared: '0x72f7a8eb9F83dE366AE166DC50F16074076C3Ea6', bob: '0x77cabFd057Bd7C81c011059F1bf74eC1fBeDa971', - btr: '0xf1E25704e75dA0496B46Bf4E3856c5480A3c247F' + btr: '0xf1E25704e75dA0496B46Bf4E3856c5480A3c247F', + mint: '0x0f225d10dd29D4703D42C5E93440F828bf04D150' } const abis = { diff --git a/projects/manifesto/index.js b/projects/manifesto/index.js index a5817ea1986f..081aa1b6f0b9 100644 --- a/projects/manifesto/index.js +++ b/projects/manifesto/index.js @@ -15,7 +15,7 @@ module.exports = { tvl: sumTokensExport({ owner: '0x20636bd0E15be0e1faADE1b27f568e642f59814E', tokens: [ - ADDRESSES.canto.NOTE, + '0x4e71a2e537b7f9d9413d3991d37958c0b5e1e503', ADDRESSES.canto.WCANTO, ADDRESSES.functionx.PURSE, ADDRESSES.functionx.WFX, diff --git a/projects/mars/index.js b/projects/mars/index.js index 6894881fe668..47139138300b 100644 --- a/projects/mars/index.js +++ b/projects/mars/index.js @@ -122,5 +122,6 @@ module.exports = { [1690945200, 'Launch on Neutron'], [1696906800, 'Mars v2 launch on Osmosis'], [1724166000, 'Mars v2 launch on Neutron'], + [1734098400, 'Perps launch on Neutron'] ], }; diff --git a/projects/mellow-protocol-v2/index.js b/projects/mellow-protocol-v2/index.js index b933fa5b717c..d3d2866ef3c5 100644 --- a/projects/mellow-protocol-v2/index.js +++ b/projects/mellow-protocol-v2/index.js @@ -18,6 +18,7 @@ const config = { '0x7b31F008c48EFb65da78eA0f255EE424af855249', '0x4f3Cc6359364004b245ad5bE36E6ad4e805dC961', '0x375A8eE22280076610cA2B4348d37cB1bEEBeba0', + '0xcC36e5272c422BEE9A8144cD2493Ac472082eBaD', ], }, } diff --git a/projects/memejob/index.js b/projects/memejob/index.js new file mode 100644 index 000000000000..4f868c6044e1 --- /dev/null +++ b/projects/memejob/index.js @@ -0,0 +1,11 @@ + +const { sumTokensExport } = require('../helper/unwrapLPs') +const ADDRESSES = require('../helper/coreAssets.json') +const MEMEJOB_CONTRACT = "0x950230ea77Dc168df543609c2349C87dea57e876"; + +module.exports = { + methodology: "TVL is represented by all HBAR held in active bonding curves within MemeJob.", + hedera: { + tvl: sumTokensExport({ owner: MEMEJOB_CONTRACT, tokens: [ADDRESSES.null] }), + }, +}; \ No newline at end of file diff --git a/projects/mutuari/index.js b/projects/mutuari/index.js index e7240c73e38d..f79c40a92d6b 100644 --- a/projects/mutuari/index.js +++ b/projects/mutuari/index.js @@ -1,12 +1,12 @@ const { sumTokens2 } = require("../helper/unwrapLPs") async function tvl(api) { - const pool = await api.call({ target: '0x831fc32221924f8a6d47251327ef67ebcc5cd6dc', abi: "address:mutuariPool" }) + const pool = await api.call({ target: '0x72b674D0546fda0C9B5205178740c98398456EaE', abi: "address:mutuariPool" }) const tokens = await api.call({ target: pool, abi: "address[]:getReserves" }) return sumTokens2({ api, owner: pool, tokens,}) } async function borrowed(api) { - const [_, borrowed] = await api.call({ target: '0x831fc32221924f8a6d47251327ef67ebcc5cd6dc', abi: "function getGeneralInfo() view returns (uint256 totalSupplied, uint256 totalBorrowed)" }) + const [_, borrowed] = await api.call({ target: '0x72b674D0546fda0C9B5205178740c98398456EaE', abi: "function getGeneralInfo() view returns (uint256 totalSupplied, uint256 totalBorrowed)" }) api.addGasToken(borrowed) return sumTokens2({ api }) } diff --git a/projects/neutral-trade/constants.js b/projects/neutral-trade/constants.js new file mode 100644 index 000000000000..2ee6e705dadb --- /dev/null +++ b/projects/neutral-trade/constants.js @@ -0,0 +1,129 @@ +const DATA_URL = 'https://raw.githubusercontent.com/neutral-trade/vaults-data/main'; + +const START_TIMESTAMP = 1730419200; // 2024-11-01 + + +const TOKENS = { + USDC: { + name: 'USDC', + mint: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v', + decimals: 6 + }, + SOL: { + name: 'SOL', + mint: 'So11111111111111111111111111111111111111112', + decimals: 9 + }, + WBTC: { + name: 'Wrapped BTC (Wormhole) (WBTC)', + mint: '3NZ9JMVBmGAqocybic2c7LQCJScmgsAZ6vQqTDzcqmJh', + decimals: 8 + }, + WETH: { + name: 'Wrapped ETH (Wormhole) (WETH)', + mint: '7vfCXTUXx5WJV5JADk17DUJ4ksgau7utNKj4b963voxs', + decimals: 8 + } +}; + +const VAULTS = [ + { + name: "USDC Basis (Perps Basket)", + address: "4cvgasNfbJ36yeMVJSkscgL2Yco9dFGdj52Wrg91fmHv", + token: TOKENS.USDC, + dataUrl: `${DATA_URL}/btcethfunding.json` + }, + { + name: "BTC Super Staking", + address: "BVddkVtFJLCihbVrtLo8e3iEd9NftuLunaznAxFFW8vf", + token: TOKENS.WBTC, + dataUrl: `${DATA_URL}/btcjlpnl.json` + }, + { + name: "ETH Super Staking", + address: "ENr5e1BMN5vFUHf4iCCPzR4GjWCKgtHnQcdniRQqMdEL", + token: TOKENS.WETH, + dataUrl: `${DATA_URL}/ethjlpnl.json` + }, + { + name: "USDC Staking (JLP Delta Neutral) v1", + //programId: "9Fcn3Fd4d5ocrb12xCUtEvezxcjFEAyHBPfrZDiPt9Qj", + address: "3Nkctq19AW7gs5hkxixUDjS9UVjmCwcNCo7rqPpub87c", + token: TOKENS.USDC, + dataUrl: `${DATA_URL}/jlpdn.json`, + }, + { + name: "USDC Staking (JLP Delta Neutral) v2", + address: "41Y8C4oxk4zgJT1KXyQr35UhZcfsp5mP86Z2G7UUzojU", + token: TOKENS.USDC, + dataUrl: `${DATA_URL}/jlpdnv2.json` + }, + { + name: "USDC Basis (Sanctum-INF)", + address: "CxL8eQmGhN9LKSoHj7bU95JekFPtyZoUc57mbehb5A56", + token: TOKENS.USDC, + dataUrl: `${DATA_URL}/solbasis.json` + }, + { + name: "SOL Super Staking", + address: "EuSLjg23BrtwYAk1t4TFe5ArYSXCVXLBqrHRBfWQiTeJ", + token: TOKENS.SOL, + dataUrl: `${DATA_URL}/soljlpnl.json` + }, + { + name: "JLP Traders Print", + address: "85XuR4kE5yxp1hk91WHAawinXZsuJowxy59STYYpM9pK", + token: TOKENS.USDC, + dataUrl: `${DATA_URL}/tradersprint.json` + }, + { + name: "JLP Traders Rekt", + address: "2r81MPMDjGSrbmGRwzDg6aqhe3t3vbKcrYfpes5bXckS", + token: TOKENS.USDC, + dataUrl: `${DATA_URL}/tradersrekt.json` + }, + { + name: "vip01", + address: "CZU38L2NyL6tqFxzYAGYkmkf2JG98tZfZ2CnUapVgXQe", + token: TOKENS.USDC, + dataUrl: `${DATA_URL}/vip01.json` + }, + { + name: "vip02", + address: "DUW6uWcrsjYmsYDjp9iGDN4JdRa2MqznjuxjKVok5Fsj", + token: TOKENS.USDC, + dataUrl: `${DATA_URL}/vip02.json` + }, + { + name: "vip03", + address: "Fd3k4c6Dv7m9673ae87P6duQrftY9UVfwiCxngNbJrUQ", + token: TOKENS.USDC, + dataUrl: `${DATA_URL}/vip03.json` + }, + // 'vip04', // currently inactive + { + name: "vip05", + address: "9BMEyctGvajEubk5iCRBnM9fkeTXUhrxaweYq34jZdC8", + token: TOKENS.USDC, + dataUrl: `${DATA_URL}/vip05.json` + }, + { + name: "vip06", + address: "6DFDj66PbPoTC16Sh51MJijoTTMYCbMCVC85tnc5UfQ3", + token: TOKENS.USDC, + dataUrl: `${DATA_URL}/vip06.json` + }, + { + name: "vip07", + address: "HTLvAjqc6Wkzh4i4QNLHhQHZAnrtVvkGyYeyCiUWLe9b", + token: TOKENS.USDC, + dataUrl: `${DATA_URL}/vip07.json` + } +]; + +module.exports = { + DATA_URL, + START_TIMESTAMP, + TOKENS, + VAULTS, +}; diff --git a/projects/neutral-trade/index.js b/projects/neutral-trade/index.js new file mode 100644 index 000000000000..6abdd85f6589 --- /dev/null +++ b/projects/neutral-trade/index.js @@ -0,0 +1,17 @@ +const { VAULTS, START_TIMESTAMP } = require("./constants") +const { drift: { vaultTvl } } = require("../helper/chain/rpcProxy") + +async function tvl(api) { + for (const vault of VAULTS) { + const token_tvl = await vaultTvl(vault.address, vault.version); + api.add(vault.token.mint, token_tvl); + } +} + + +module.exports = { + start: START_TIMESTAMP, + timetravel: false, + methodology: "The combined TVL and PnL of all public and private vaults.", + solana: { tvl }, +}; diff --git a/projects/onedex/index.js b/projects/onedex/index.js index 0270cd2bcbd9..67e89282abc5 100644 --- a/projects/onedex/index.js +++ b/projects/onedex/index.js @@ -5,6 +5,7 @@ module.exports = { elrond: { tvl: sumTokensExport({ owner: "erd1qqqqqqqqqqqqqpgqqz6vp9y50ep867vnr296mqf3dduh6guvmvlsu3sujc", + blacklistedTokens: ['GROK-f2a62f'] }), staking: sumTokensExport({ owners: ["erd1qqqqqqqqqqqqqpgql9z9vm8d599ya2r9seklpkcas6qmude4mvlsgrj7hv", "erd1qqqqqqqqqqqqqpgq8nlmvjm8gum6y2kqe0v296kgu8cm4jlemvlsays3ku"] diff --git a/projects/ostium/index.js b/projects/ostium/index.js index 84cb47d2ab2e..1427ac341b21 100644 --- a/projects/ostium/index.js +++ b/projects/ostium/index.js @@ -2,7 +2,10 @@ const ADDRESSES = require('../helper/coreAssets.json'); const { sumTokensExport } = require('../helper/unwrapLPs'); const owners = [ + // OLP vault '0x20D419a8e12C45f88fDA7c5760bb6923Cee27F98', + // Trading collateral + '0xcCd5891083A8acD2074690F65d3024E7D13d66E7', ]; const tokens = [ diff --git a/projects/ottopia/index.js b/projects/ottopia/index.js index f0bf14740dde..d64ddc6c0e5a 100644 --- a/projects/ottopia/index.js +++ b/projects/ottopia/index.js @@ -1,37 +1,33 @@ const sdk = require("@defillama/sdk"); -const { GraphQLClient, gql } = require("graphql-request"); +const { request, gql } = require("graphql-request"); const { staking } = require("../helper/staking"); const CLAM = "0xC250e9987A032ACAC293d838726C511E6E1C029d"; const PearlBank = "0x845EB7730a8D37e8D190Fb8bb9c582038331B48a"; -async function tvl({timestamp}, block, chainBlocks) { - let endpoint = sdk.graph.modifyEndpoint('CejrrsnSQAxHJBpkgiBrLHQZ7h2MkK9QArM8bJvN9GuQ'); - let graphQLClient = new GraphQLClient(endpoint); - let query = gql` - query tvl($start: BigInt!, $end: BigInt!) { - protocolMetrics( - where: { timestamp_gte: $start, timestamp_lt: $end } - orderBy: timestamp - orderDirection: desc - first: 1 - ) { - treasuryMarketValue - timestamp - } +const endpoint = sdk.graph.modifyEndpoint('CejrrsnSQAxHJBpkgiBrLHQZ7h2MkK9QArM8bJvN9GuQ') + +const query = gql` + query tvl { + protocolMetrics( + first: 1 + orderBy: timestamp + orderDirection: desc + ) { + treasuryMarketValue + timestamp } - `; - const results = await graphQLClient.request(query, { - start: timestamp - 2 * 60 * 60 * 1000, - end: timestamp, - }) - return { - usd: parseFloat(results.protocolMetrics[0].treasuryMarketValue), - }; + } +`; + +async function tvl(api) { + const results = await request(endpoint, query) + return api.addUSDValue(parseFloat(results.protocolMetrics[0].treasuryMarketValue)) } module.exports = { - methodology: "This adapter uses otterclam's subgraph to fetch tvl data.", + deadFrom: '2024-08-14', + methodology: "This adapter uses otterclam's subgraph to fetch tvl data.", polygon: { tvl, staking: staking(PearlBank, CLAM), diff --git a/projects/panoptic/index.js b/projects/panoptic/index.js new file mode 100644 index 000000000000..494beaa0a5fa --- /dev/null +++ b/projects/panoptic/index.js @@ -0,0 +1,77 @@ +const { getLogs2 } = require('../helper/cache/getLogs') +const { cachedGraphQuery } = require("../helper/cache"); +const { addUniV3LikePosition } = require('../helper/unwrapLPs'); + +const FACTORY = '0x000000000000010a1DEc6c46371A28A071F8bb01' +const SFPM = '0x0000000000000DEdEDdD16227aA3D836C5753194' + + +const SFPMChunksQuery = ` +query SFPMChunks($lastId: ID, $block: Int) { + chunks(first: 1000 + block: {number: $block} + where: {and: [{id_gt: $lastId}, { netLiquidity_gt: 100}]} + ) { + netLiquidity + tickLower + tickUpper + id + pool { id } + } +}` + +const abi = { + "PoolDeployed": "event PoolDeployed(address indexed poolAddress, address indexed uniswapPool, address collateralTracker0, address collateralTracker1)", + "PoolInitialized": "event PoolInitialized(address indexed uniswapPool, uint64 poolId, int24 minEnforcedTick, int24 maxEnforcedTick)", +} + +const config = { + ethereum: { + graphUrl: 'https://api.goldsky.com/api/public/project_cl9gc21q105380hxuh8ks53k3/subgraphs/panoptic-subgraph-mainnet/1.0.2/gn', + startBlock: 21389983, + safeBlockLimit: 50 + } +} + + +async function tvl(api) { + const chain = api.chain + const { startBlock, graphUrl, safeBlockLimit } = config[chain] + + const poolDeployedLogs = await getLogs2({ api, target: FACTORY, fromBlock: startBlock, eventAbi: abi.PoolDeployed, }) + const uniPools = poolDeployedLogs.map(log => log.uniswapPool.toLowerCase()) + const token0s = await api.multiCall({ abi: 'address:token0', calls: uniPools }) + const token1s = await api.multiCall({ abi: 'address:token1', calls: uniPools }) + const slot0s = await api.multiCall({ abi: 'function slot0() view returns (uint160 sqrtPriceX96, int24 tick, uint16 observationIndex, uint16 observationCardinality, uint16 observationCardinalityNext, uint8 feeProtocol, bool unlocked)', calls: uniPools }) + + const poolData = {} + const ownerTokens = [] + uniPools.forEach((pool, i) => { + // to compte tokens locked in panoptic pools + ownerTokens.push([[token0s[i], token1s[i]], poolDeployedLogs[i].poolAddress]) + + // to compute value locked in uni v3 pools + poolData[pool] = { + token0: token0s[i], + token1: token1s[i], + tick: slot0s[i].tick, + } + }) + + await api.sumTokens({ ownerTokens }) + + const chunks = await cachedGraphQuery(`panoptic/sfpm-chunks`, graphUrl, SFPMChunksQuery, { api, useBlock: true, fetchById: true, safeBlockLimit, }) + chunks.forEach(chunk => { + const { token0, token1, tick, } = poolData[chunk.pool.id.toLowerCase()] ?? {} + if (!tick) return; + addUniV3LikePosition({ api, token0, token1, tick, liquidity: chunk.netLiquidity, tickUpper: chunk.tickUpper, tickLower: chunk.tickLower, }) + }) +} + +module.exports = { + ethereum: { + tvl, + methodology: 'This adapter counts tokens held by all PanopticPool contracts created by the PanopticFactory, as well as the token composition of all Uniswap liquidity held by the SemiFungiblePositionManager (which is used by every PanopticPool to manage liquidity).', + start: 1734049991, + }, +} \ No newline at end of file diff --git a/projects/pendle/v2.js b/projects/pendle/v2.js index d1eb41e6cecd..209b052a69fd 100644 --- a/projects/pendle/v2.js +++ b/projects/pendle/v2.js @@ -58,7 +58,7 @@ const config = { }, base: { factories: [ - { factory: "0x5202F7477685686284b3F47B0A5334b15ea0393D", fromBlock: 22350099 }, // v3 + { factory: "0x59968008a703dC13E6beaECed644bdCe4ee45d13", fromBlock: 22350352 }, // v3 ], } }; @@ -130,7 +130,11 @@ Object.keys(config).forEach((chain) => { ? 18 : decimals[i])); let index = tokenAssetTypeSy.indexOf(sy[i]); if (index !== -1) { - value = (value * exchangeRates[index]) / 10 ** 18; + value = (value * exchangeRates[index]) / 10 ** ([ + '0x141ec2d606f12ff959d7d07cde6811e5fdff2831', + '0xec30e55b51d9518cfcf5e870bcf89c73f5708f72', + '0xd5cf704dc17403343965b4f9cd4d7b5e9b20cc52' + ].includes(sy[i].toLowerCase()) ? v.decimals : 18); } api.add(v.uAsset.toLowerCase(), value); }); diff --git a/projects/phemex/index.js b/projects/phemex/index.js index 3bb13492a33a..c5f73f5b1c83 100644 --- a/projects/phemex/index.js +++ b/projects/phemex/index.js @@ -7,7 +7,79 @@ const config = { }, ethereum: { owners: [ - '0xf7D13C7dBec85ff86Ee815f6dCbb3DEDAc78ca49' + '0xf7D13C7dBec85ff86Ee815f6dCbb3DEDAc78ca49', + '0x50be13b54f3eebbe415d20250598d81280e56772' + ], + }, + bsc: { + owners: [ + '0x50be13b54f3eebbe415d20250598d81280e56772' + ], + }, + base: { + owners: [ + '0x50be13b54f3eebbe415d20250598d81280e56772' + ], + }, + avax: { + owners: [ + '0x50be13b54f3eebbe415d20250598d81280e56772' + ], + }, + fantom: { + owners: [ + '0x50be13b54f3eebbe415d20250598d81280e56772' + ], + }, + arbitrum: { + owners: [ + '0x50be13b54f3eebbe415d20250598d81280e56772' + ], + }, + optimism: { + owners: [ + '0x50be13b54f3eebbe415d20250598d81280e56772' + ], + }, + polygon: { + owners: [ + '0x50be13b54f3eebbe415d20250598d81280e56772' + ], + }, + era: { + owners: [ + '0x50be13b54f3eebbe415d20250598d81280e56772' + ], + }, + linea: { + owners: [ + '0x50be13b54f3eebbe415d20250598d81280e56772' + ], + }, + ripple: { + owners: [ + 'rQKKvBvEfXbTThkqrtqaY3sAKuW6iqcMzX', + 'rLMAAuqJowC5yMccaPnappeLM8vDfdiDTg', + ], + }, + sui: { + owners: [ + '0x51fc8f63faf7b22d401623f9c3ae5183e564d701741770f12ad1851c6c45a0c8', + ], + }, + tron: { + owners: [ + 'THAABzWrhp84Nr7gxss7qhtzA5mp3d1qUo' + ], + }, + solana: { + owners: [ + 'EWSHJzKpzjpwz9GuNKkXWMHXAiwtB7obSGhdFKu5QZku' + ], + }, + polkadot: { + owners: [ + '15hTaSogYFyGyRJhXdpQWRR1J9oya5nj4nFppi4XgUVMCvmP' ], }, } diff --git a/projects/pionex-cex/index.js b/projects/pionex-cex/index.js index 5a5e2747f9f9..6ef048c5df6b 100644 --- a/projects/pionex-cex/index.js +++ b/projects/pionex-cex/index.js @@ -16,7 +16,6 @@ const config = { "0x3c22c17501047d862b3a98e296079966aefd8df7", "0xbbb72ba600d8493fea284d5fe44919f7b60d53f5", "0x67be8ce27ef8158d51d8593bb5b26eafacc955d9", - "0xee5b5b923ffce93a870b3104b7ca09c3db80047a" ], }, bitcoin: { @@ -33,7 +32,6 @@ const config = { "TLK8GVBqJNmcyaN5mpSPSzQfTjsSxb7sC9", "TGgMNPxdyUgdYwMSbMkpTPvaSkrRakKqcK", "TAA7sxJ259JgstGPjanb5sB6ZJuCPtCobs", - "TJDENsfBJs4RFETt1X1W8wMDc8M5XnJhCe", "TKRksVBKDBATKcifm4FXFHcD1FmJQ2bp3x" ], }, @@ -60,7 +58,11 @@ const config = { "0x67be8ce27ef8158d51d8593bb5b26eafacc955d9" ] }, - + avax: { + owners: [ + "0xF6D4E5a7c5215F91f59a95065190CCa24bf64554", + ] + }, } module.exports = cexExports(config) \ No newline at end of file diff --git a/projects/plenty/index.js b/projects/plenty/index.js index 2e72d1b4737e..612b82c3076b 100644 --- a/projects/plenty/index.js +++ b/projects/plenty/index.js @@ -1,20 +1,16 @@ const { sumTokens2, } = require('../helper/chain/tezos') const { getConfig } = require("../helper/cache") -async function tvl() { - return sumTokens2({ owners: await getDexes(), includeTezos: true, }) -} +const API_URL = 'https://config.mainnet.plenty.network/pools' -async function getDexes() { - const data = await getConfig('tezos/plenty', "https://config.mainnet.plenty.network/pools") - return Object.keys(data) +const tvl = async () => { + const data = await getConfig('tezos/plenty', API_URL) + return sumTokens2({ owners: Object.keys(data), includeTezos: true, }) } module.exports = { timetravel: false, misrepresentedTokens: true, start: '2023-01-01', - tezos: { - tvl, - }, + tezos: { tvl }, } \ No newline at end of file diff --git a/projects/polynetwork/index.js b/projects/polynetwork/index.js index 17c1ddff420e..ec5b0ff631f3 100644 --- a/projects/polynetwork/index.js +++ b/projects/polynetwork/index.js @@ -21,7 +21,7 @@ const blockchainEndpoints = { okexchain: 'getTVLOKC', neo3: 'getTVLNeo3', polygon: 'getTVLPolygon', - palette: 'getTVLPalette', + //palette: 'getTVLPalette', arbitrum: 'getTVLArbitrum', xdai: 'getTVLGnosisChain', zilliqa: 'getTVLZilliqa', diff --git a/projects/qomswap/index.js b/projects/qomswap/index.js new file mode 100644 index 000000000000..f45ad0177c5b --- /dev/null +++ b/projects/qomswap/index.js @@ -0,0 +1,4 @@ +const { uniTvlExport } = require('../helper/unknownTokens') + +module.exports = uniTvlExport('qom', '0x475f361993D6FAcBF32fB82B66be0fB40f3d974C') + diff --git a/projects/realt.js b/projects/realt.js index 49e477d2be13..faa866891c5a 100644 --- a/projects/realt.js +++ b/projects/realt.js @@ -4,7 +4,7 @@ const { get } = require('./helper/http') // Loop through all RealT tokens listed by realt.community API and accumulate tokenprice * supply, where supply is biggest of xdai or mainnet // See https://api.realt.community/ for reference async function xdaiTvl(api) { - let realt_tokens = await get('https://api.realt.community/v1/token') + let realt_tokens = await get('https://api.realtoken.community/v1/token') // Filter out deprecated contracts realt_tokens = realt_tokens.filter(t => !t['fullName'].startsWith('OLD-')).filter(t => t.xDaiContract && +t.tokenPrice) diff --git a/projects/reya-bridge/index.js b/projects/reya-bridge/index.js index 759eab1cbe63..5c52fe787d73 100644 --- a/projects/reya-bridge/index.js +++ b/projects/reya-bridge/index.js @@ -20,8 +20,9 @@ module.exports = { owners: [ "0x9239609eED7c40C6DDcEC25D247Ef205103590B6", // usdc vault "0xAd7bdD85fdA879fe7771A2546939972F202C1BaE", // eth vault + "0xCbEcd69ceFA64F55b72F8ac288FC5c452819B608" // usdc vault 2 ], - tokens: [ADDRESSES.optimism.USDC, ADDRESSES.optimism.WETH], + tokens: [ADDRESSES.optimism.USDC, ADDRESSES.optimism.WETH, ADDRESSES.optimism.USDC_CIRCLE], }), }, polygon: { @@ -31,8 +32,10 @@ module.exports = { owners: [ "0xC0acBb471465FCf848746D1837d8358aB891546c", // usdc vault "0x72384be7092144cD9a57526B486827E4eA632351", // eth vault + "0xBC31ec84bd7BC2c97B9413F6E473cE96Be153a25" // usdc vault 2 + ], + tokens: [ADDRESSES.polygon.USDC, ADDRESSES.polygon.WETH, ADDRESSES.polygon.USDC_CIRCLE ], - tokens: [ADDRESSES.polygon.USDC, ADDRESSES.polygon.WETH], }), }, base: { @@ -53,8 +56,9 @@ module.exports = { owners: [ "0xa0E9B6DA89BD0303A8163B81B8702388bE0Fde77", // usdc vault "0xD7BBE2f6D1B52A27D2dAC28298DE3974a3d13047", // eth vault + "0x11B3a7E08Eb2FdEa2745e4CB64648b10B28524A8" // usdc vault 2 ], - tokens: [ADDRESSES.arbitrum.USDC, ADDRESSES.arbitrum.WETH], + tokens: [ADDRESSES.arbitrum.USDC, ADDRESSES.arbitrum.WETH, ADDRESSES.arbitrum.USDC_CIRCLE], }), }, }; diff --git a/projects/rings/index.js b/projects/rings/index.js new file mode 100644 index 000000000000..4e20b7b281e4 --- /dev/null +++ b/projects/rings/index.js @@ -0,0 +1,43 @@ +const sdk = require("@defillama/sdk"); +const { sumTokensExport } = require("../helper/unwrapLPs"); + +module.exports = { + methodology: 'TVL counts the tokens deposited in the boring vaults.', + start: 1733726867 +} + +const config = { + ethereum: { + vaults: [ + '0xd3DCe716f3eF535C5Ff8d041c1A41C3bd89b97aE', + '0x3bcE5CB273F0F148010BbEa2470e7b5df84C7812', + ], + supportedAssets: [ + '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', // USDC + '0xdAC17F958D2ee523a2206206994597C13D831ec7', // USDT + '0x40D16FC0246aD3160Ccc09B8D0D3A2cD28aE6C2f', // GHO + '0x6B175474E89094C44Da98b954EedeAC495271d0F', // DAI + '0xdC035D45d973E3EC169d2276DDab16f1e407384F', // USDS + '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', // WETH + '0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0', // WSTETH + '0xCd5fE23C85820F7B72D0926FC9b05b43E359b7ee', // WEETH + ] + }, + sonic: { + vaults: [ + '0xd3DCe716f3eF535C5Ff8d041c1A41C3bd89b97aE', + '0x3bcE5CB273F0F148010BbEa2470e7b5df84C7812' + ], + supportedAssets: [ + '0x29219dd400f2Bf60E5a23d13Be72B486D4038894', // USDC + '0x309C92261178fA0CF748A855e90Ae73FDb79EBc7', // WETH + ] + }, +} + +Object.keys(config).forEach(chain => { + const { vaults, supportedAssets } = config[chain] + module.exports[chain] = { + tvl: sumTokensExport({ owners: vaults, tokens: supportedAssets}) + } +}) \ No newline at end of file diff --git a/projects/root-finance/index.js b/projects/root-finance/index.js index 42cf5917a93f..f78a34764802 100644 --- a/projects/root-finance/index.js +++ b/projects/root-finance/index.js @@ -31,6 +31,16 @@ const pools = [ { pool: 'component_rdx1czmq3me09q7p7g7hgsyaqctfw3he4hl6ypg6em2h7nyd2umk0dhhnq', resource: 'resource_rdx1thksg5ng70g9mmy9ne7wz0sc7auzrrwy7fmgcxzel2gvp8pj0xxfmf', + }, + // Adding WOWO Pool + { + pool: 'component_rdx1crsgd3yqvfh49599yrfpw08ezjwjuns04970mz2l4dnyxxhwzuecy5', + resource: 'resource_rdx1t4kc5ljyrwlxvg54s6gnctt7nwwgx89h9r2gvrpm369s23yhzyyzlx', + }, + // Adding EARLY Pool + { + pool: 'component_rdx1cr0pr68zxqvmfq2whn4nh22qcg2q5skdm7lt3qwvm6nfr2ccaryjsz', + resource: 'resource_rdx1t5xv44c0u99z096q00mv74emwmxwjw26m98lwlzq6ddlpe9f5cuc7s', } ]; diff --git a/projects/sablier/index.js b/projects/sablier-legacy/index.js similarity index 91% rename from projects/sablier/index.js rename to projects/sablier-legacy/index.js index 4a1894a2d146..f5260b315657 100644 --- a/projects/sablier/index.js +++ b/projects/sablier-legacy/index.js @@ -11,6 +11,20 @@ const blacklistedTokens = [ ADDRESSES.ethereum.MKR, ] +const config = { + ethereum: { + owners: [ + "0xA4fc358455Febe425536fd1878bE67FfDBDEC59a", // v1.0.0 + "0xCD18eAa163733Da39c232722cBC4E8940b1D8888", // v1.1.0 + ] + }, + arbitrum: { owners: ['0xaDB944B478818d95659067E70D2e5Fc43Fa3eDe9'], }, + avax: { owners: ['0x73f503fad13203C87889c3D5c567550b2d41D7a4'], }, + bsc: { owners: ['0x05BC7f5fb7F248d44d38703e5C921A8c16825161'], }, + optimism: { owners: ['0x6C5927c0679e6d857E87367bb635decbcB20F31c'], }, + polygon: { owners: ['0xAC18EAB6592F5fF6F9aCf5E0DCE0Df8E49124C06'], }, +} + async function getTokens(api, owners, isVesting) { let tokens = (await Promise.all(owners.map(i => covalentGetTokens(i, api, { onlyWhitelisted: false, })))).flat().filter(i => !blacklistedTokens.includes(i)) tokens = getUniqueAddresses(tokens) @@ -20,8 +34,11 @@ async function getTokens(api, owners, isVesting) { const symbol = symbols[index]; return symbol ? { token, symbol } : null; }).filter(pair => pair !== null); - - return validTokens.filter(token => isWhitelistedToken(token.symbol, token.token, isVesting)).map(token => token.token); + // Filter vesting tokens + const whitelistedTokens = validTokens.filter(token => { + return isWhitelistedToken(token.symbol, token.token, isVesting); + }); + return whitelistedTokens.map(token => token.token); } async function tvl(api) { @@ -54,20 +71,6 @@ module.exports = { } }; -const config = { - ethereum: { - owners: [ - "0xA4fc358455Febe425536fd1878bE67FfDBDEC59a", // v1.0.0 - "0xCD18eAa163733Da39c232722cBC4E8940b1D8888", // v1.1.0 - ] - }, - arbitrum: { owners: ['0xaDB944B478818d95659067E70D2e5Fc43Fa3eDe9'], }, - avax: { owners: ['0x73f503fad13203C87889c3D5c567550b2d41D7a4'], }, - bsc: { owners: ['0x05BC7f5fb7F248d44d38703e5C921A8c16825161'], }, - optimism: { owners: ['0x6C5927c0679e6d857E87367bb635decbcB20F31c'], }, - polygon: { owners: ['0xAC18EAB6592F5fF6F9aCf5E0DCE0Df8E49124C06'], }, -} - Object.keys(config).forEach(chain => { module.exports[chain] = { tvl, vesting } }) \ No newline at end of file diff --git a/projects/sablier-v2/index.js b/projects/sablier-lockup/index.js similarity index 98% rename from projects/sablier-v2/index.js rename to projects/sablier-lockup/index.js index 25f8db886fc0..590012a459f4 100644 --- a/projects/sablier-v2/index.js +++ b/projects/sablier-lockup/index.js @@ -1,6 +1,23 @@ const { isWhitelistedToken } = require('../helper/streamingHelper') const { cachedGraphQuery } = require('../helper/cache') +const config = { + arbitrum: { endpoints: ['8BnGPBojHycDxVo83LP468pUo4xDyCQbtTpHGZXR6SiB'], }, + base: { endpoints: ['3pxjsW9rbDjmZpoQWzc5CAo4vzcyYE9YQyTghntmnb1K'], }, + blast: { endpoints: ['BXoC2ToMZXnTmCjWftQRPh9zMyM7ysijMN54Nxzb2CEY'], }, + avax: { endpoints: ['FdVwZuMV43yCb1nPmjnLQwmzS58wvKuLMPzcZ4UWgWAc'], }, + era: { endpoints: ['GY2fGozmfZiZ3xF2MfevohLR4YGnyxGxAyxzi9zmU5bY'], }, + bsc: { endpoints: ['BVyi15zcH5eUg5PPKfRDDesezMezh6cAkn8LPvh7MVAF'], }, + ethereum: { endpoints: ['5EgaXheiBXZBCkepyGUYAu8pN31Dkbh7bpGtnLPqaT5m'], }, + linea: { endpoints: ['FoJnatzCZKyp9XjZyUBaw1juTb5ydnFvJvWUxS3oRCHZ'], }, + mode: { endpoints: ['5ezGnVwNucVTW45WCb91VBiKBEdiqT4ceHDhh1KGigYG'], }, + optimism: { endpoints: ['6e6Dvs1yDpsWDDREZRqxGi54SVdvTNzUdKpKJxniKVrp'], }, + polygon: { endpoints: ['CsDNYv9XPUMP8vufuwDVKQrVhsxhzzRHezjLFFKZZbrx'], }, + scroll: { endpoints: ['HVcngokCByfveLwguuafrBC34xB65Ne6tpGrXHmqDSrh'], }, + xdai: { endpoints: ['EXhNLbhCbsewJPx4jx5tutNXpxwdgng2kmX1J7w1bFyu'], }, +} + + async function getTokensConfig(api, isVesting) { const ownerTokens = [] const { endpoints } = config[api.chain] @@ -14,6 +31,7 @@ async function getTokensConfig(api, isVesting) { const owners = contracts.map(i => i.address) let tokens = assets.map(i => i.id) const symbols = assets.map(i => i.symbol) + // Filter vesting tokens tokens = tokens.filter((v, i) => isWhitelistedToken(symbols[i], v, isVesting)) owners.forEach(owner => ownerTokens.push([tokens, owner])) } @@ -29,22 +47,6 @@ async function vesting(api) { return api.sumTokens(await getTokensConfig(api, true)) } -const config = { - ethereum: { endpoints: ['5EgaXheiBXZBCkepyGUYAu8pN31Dkbh7bpGtnLPqaT5m'], }, - arbitrum: { endpoints: ['8BnGPBojHycDxVo83LP468pUo4xDyCQbtTpHGZXR6SiB'], }, - bsc: { endpoints: ['BVyi15zcH5eUg5PPKfRDDesezMezh6cAkn8LPvh7MVAF'], }, - xdai: { endpoints: ['EXhNLbhCbsewJPx4jx5tutNXpxwdgng2kmX1J7w1bFyu'], }, - optimism: { endpoints: ['6e6Dvs1yDpsWDDREZRqxGi54SVdvTNzUdKpKJxniKVrp'], }, - polygon: { endpoints: ['CsDNYv9XPUMP8vufuwDVKQrVhsxhzzRHezjLFFKZZbrx'], }, - avax: { endpoints: ['FdVwZuMV43yCb1nPmjnLQwmzS58wvKuLMPzcZ4UWgWAc'], }, - base: { endpoints: ['3pxjsW9rbDjmZpoQWzc5CAo4vzcyYE9YQyTghntmnb1K'], }, - blast: { endpoints: ['BXoC2ToMZXnTmCjWftQRPh9zMyM7ysijMN54Nxzb2CEY'], }, - scroll: { endpoints: ['HVcngokCByfveLwguuafrBC34xB65Ne6tpGrXHmqDSrh'], }, - era: { endpoints: ['GY2fGozmfZiZ3xF2MfevohLR4YGnyxGxAyxzi9zmU5bY'], }, - mode: { endpoints: ['5ezGnVwNucVTW45WCb91VBiKBEdiqT4ceHDhh1KGigYG'], }, - linea: { endpoints: ['FoJnatzCZKyp9XjZyUBaw1juTb5ydnFvJvWUxS3oRCHZ'], }, -} - Object.keys(config).forEach(chain => { module.exports[chain] = { tvl, vesting } }) diff --git a/projects/sacra/index.js b/projects/sacra/index.js index e9391e979e02..363a05c0ee26 100644 --- a/projects/sacra/index.js +++ b/projects/sacra/index.js @@ -11,12 +11,21 @@ const controllerReal = '0x6ce857d3037e87465b003aCbA264DDF2Cec6D5E4'; const tresuryReal = '0xd0C1378c177E961D96c06b0E8F6E7841476C81Ef'; const rewardPoolReal = '0xb35E67FD20070C3d3dC5EEa29D62e95b707471cA'; +// sonic contracts +const controllerSonic = '0x75e1e98650c119c4E3dCE3070CE6A5397Ed70c6a'; +const tresurySonic = '0x3bDbd2Ed1A214Ca4ba4421ddD7236ccA3EF088b6'; +const rewardPoolSonic = '0xda08F7DE9923acEe24CE292Ec2b20D45b1522Cb6'; + + module.exports = { - methodology: `We count the WFTM and USDC on treasuty, reward pool and controller contracts`, + methodology: `We count the WFTM, USDC and wS on treasuty, reward pool and controller contracts`, fantom: { tvl: sumTokensExport({ token: ADDRESSES.fantom.WFTM, owners: [controllerFantom, tresuryFantom, rewardPoolFantom] }) }, real: { tvl: sumTokensExport({ token: ADDRESSES.real.USDC, owners: [controllerReal, tresuryReal, rewardPoolReal] }) }, + sonic: { + tvl: sumTokensExport({ token: ADDRESSES.sonic.wS, owners: [controllerSonic, tresurySonic, rewardPoolSonic] }) + } } \ No newline at end of file diff --git a/projects/satoshi-protocol/index.js b/projects/satoshi-protocol/index.js index 1206ea125caa..f5300078d66d 100644 --- a/projects/satoshi-protocol/index.js +++ b/projects/satoshi-protocol/index.js @@ -6,18 +6,20 @@ const AssetConfigSettingEventABI = "event AssetConfigSetting(address asset,uint2 function createExports({ troveList, nymInformation, // { address, fromBlock } + aaveStrategyVaults, // { address, asset, aToken }[] + pellStrategyVaults, // { address, asset }[] }) { return { tvl: async (api) => { const tokens = []; const owners = []; - if(troveList) { + if (troveList) { owners.push(...troveList); const collaterals = await getCollateralsFromTrove(api, troveList); tokens.push(...collaterals); } - if(nymInformation) { + if (nymInformation) { const assetList = await getAssetListFromNymContract(api, nymInformation.address, nymInformation.fromBlock); assetList.forEach(asset => { owners.push(nymInformation.address); @@ -25,6 +27,27 @@ function createExports({ }) } + if (aaveStrategyVaults) { + const calls = [] + const tokens = [] + for (let index = 0; index < aaveStrategyVaults.length; index++) { + const { address: vault, aToken, asset } = aaveStrategyVaults[index]; + tokens.push(asset) + calls.push({ target: aToken, params: vault }) + } + const bals = await api.multiCall({ abi: 'erc20:balanceOf', calls }) + api.add(tokens, bals) + } + + if (pellStrategyVaults) { + const vaults = pellStrategyVaults.map(i => i.address) + const tokens = pellStrategyVaults.map(i => i.asset) + const strategies = await api.multiCall({ abi: 'address:pellStrategy', calls: vaults }) + const calls2 = strategies.map((v, i) => ({ target: v, params: vaults[i] })) + const bals = await api.multiCall({ abi: "function userUnderlyingView(address) external view returns (uint256)", calls: calls2 }) + api.add(tokens, bals) + } + return sumTokens2({ api, tokensAndOwners2: [tokens, owners] }) }, } @@ -36,7 +59,7 @@ async function getCollateralsFromTrove(api, troveList) { } async function getAssetListFromNymContract(api, nymContractAddress, fromBlock) { - const logs = await getLogs({api, target: nymContractAddress, fromBlock, eventAbi: AssetConfigSettingEventABI, onlyArgs: true}); + const logs = await getLogs({ api, target: nymContractAddress, fromBlock, eventAbi: AssetConfigSettingEventABI, onlyArgs: true }); const assetList = logs.map(item => item.asset); return assetList; } @@ -71,7 +94,20 @@ module.exports = { nymInformation: { address: '0x7253493c3259137431a120752e410b38d0c715C2', fromBlock: 4614620, - } + }, + aaveStrategyVaults: [ + { + address: '0x713dD0E14376a6d34D0Fde2783dca52c9fD852bA', + aToken: '0xd6890176e8d912142AC489e8B5D8D93F8dE74D60', // aBOBWBTC + asset: '0x03C7054BCB39f7b2e5B2c7AcB37583e32D70Cfa3', // BOB WBTC + } + ], + pellStrategyVaults: [ + { + address: '0x04485140d6618be431D8841de4365510717df4fd', + asset: '0x03C7054BCB39f7b2e5B2c7AcB37583e32D70Cfa3', // BOB WBTC + } + ], }), bsquared: createExports({ troveList: [ diff --git a/projects/silverswap/index.js b/projects/silverswap/index.js new file mode 100644 index 000000000000..a8882973d89c --- /dev/null +++ b/projects/silverswap/index.js @@ -0,0 +1,5 @@ +const { uniV3Export } = require('../helper/uniswapV3') + +module.exports = uniV3Export({ + sonic: { factory: '0xb860200BD68dc39cEAfd6ebb82883f189f4CdA76', fromBlock: 186117, isAlgebra: true, } +}) diff --git a/projects/sonic-market-amm/index.js b/projects/sonic-market-amm/index.js new file mode 100644 index 000000000000..aaef76582be4 --- /dev/null +++ b/projects/sonic-market-amm/index.js @@ -0,0 +1,4 @@ +const { uniTvlExports } = require('../helper/unknownTokens') +module.exports = uniTvlExports({ + 'sonic': '0x01D6747dD2d65dDD90FAEC2C84727c2706ee28E2' +}) \ No newline at end of file diff --git a/projects/sonic-market-orderbook/index.js b/projects/sonic-market-orderbook/index.js new file mode 100644 index 000000000000..aba82ce753f7 --- /dev/null +++ b/projects/sonic-market-orderbook/index.js @@ -0,0 +1,33 @@ +const { getLogs2 } = require('../helper/cache/getLogs') +const { sumTokens2 } = require('../helper/unwrapLPs') +const { getUniqueAddresses } = require('../helper/utils') + +const abi = { + openEvent: 'event Open(uint192 indexed id, address indexed base, address indexed quote, uint64 unitSize, uint24 makerPolicy, uint24 takerPolicy, address hooks)', +} + +const config = { + sonic: { factory: '0xD4aD5Ed9E1436904624b6dB8B1BE31f36317C636', fromBlock: 297198, }, +} + +function customCacheFunction({ cache, logs }) { + if (!cache.logs) cache.logs = [] + const tokens = logs.map(({ base, quote }) => [base, quote]).flat() + cache.logs.push(...tokens) + cache.logs = getUniqueAddresses(cache.logs) + return cache +} + +async function tvl(api) { + const { factory, fromBlock } = config[api.chain] + const tokens = await getLogs2({ api, factory, eventAbi: abi.openEvent, fromBlock, extraKey: 'open-address', customCacheFunction, skipCacheRead: true }) + return sumTokens2({ api, owner: factory, tokens, permitFailure: true }) +} + +module.exports = { + methodology: "TVL consists of assets deposited into the Sonic Market Book Manager contract", +}; + +Object.keys(config).forEach(chain => { + module.exports[chain] = { tvl } +}) \ No newline at end of file diff --git a/projects/spectra/index.js b/projects/spectra/index.js index cda61e4b6e30..1b6a71bb2fe7 100644 --- a/projects/spectra/index.js +++ b/projects/spectra/index.js @@ -2,6 +2,11 @@ const { getLogs } = require("../helper/cache/getLogs"); const abi = require("./abi.json"); const config = require("./config.json"); const sdk = require("@defillama/sdk"); +const { staking } = require("../helper/staking.js") + +// staking - SPECTRA token +const SPECTRA = "0x64fcc3a02eeeba05ef701b7eed066c6ebd5d4e51" +const veSPECTRA = "0x6a89228055c7c28430692e342f149f37462b478b" module.exports = { methodology: `All deposited underlying in Spectra Principal Tokens and all underlying supplied as liquidity in Spectra Markets`, @@ -121,3 +126,5 @@ Object.keys(config).forEach((chain) => { return logs.map((i) => i.pt); } }); + +module.exports.base.staking = staking(veSPECTRA, SPECTRA) \ No newline at end of file diff --git a/projects/stacks-sbtc/index.js b/projects/stacks-sbtc/index.js new file mode 100644 index 000000000000..d6fee8651099 --- /dev/null +++ b/projects/stacks-sbtc/index.js @@ -0,0 +1,9 @@ +const { sumTokensExport } = require('../helper/sumTokens'); +const bitcoinAddressBook = require('../helper/bitcoin-book/index.js') + + +module.exports = { + bitcoin: { + tvl: sumTokensExport({ owners: bitcoinAddressBook.stacksSBTC }), + }, +}; diff --git a/projects/stakestone-berastone/index.js b/projects/stakestone-berastone/index.js new file mode 100644 index 000000000000..a72cb080b1cc --- /dev/null +++ b/projects/stakestone-berastone/index.js @@ -0,0 +1,16 @@ +const vaultABI = { + "getUnderlyings": "function getUnderlyings() external view returns (address[])" +} + +const Vault = '0x8f88aE3798E8fF3D0e0DE7465A0863C9bbB577f0'; + +const Tvl = async (api) => { + const underlyings = await api.call({ abi: vaultABI.getUnderlyings, target: Vault }) + return api.sumTokens({ owner: Vault, tokens: underlyings }) +} + +module.exports = { + ethereum: { + tvl: Tvl, + } +} diff --git a/projects/stakestone-btc/index.js b/projects/stakestone-btc/index.js index 9d7ce6adfba3..bec2f208501f 100644 --- a/projects/stakestone-btc/index.js +++ b/projects/stakestone-btc/index.js @@ -23,3 +23,4 @@ module.exports = { tvl: ethTvl, } } +module.exports.doublecounted = true; \ No newline at end of file diff --git a/projects/steer/index.js b/projects/steer/index.js index ff409d3ae88e..fdaa8dca14d8 100644 --- a/projects/steer/index.js +++ b/projects/steer/index.js @@ -181,11 +181,34 @@ const supportedChains = [ { name: 'Zircuit', subgraphEndpoint: 'https://app.sentio.xyz/api/v1/graphql/rakesh/steer-protocol-zircuit', - headers: {'api-key': 'yu0Dep8seTmFjvlmAXN1ILNggARnx74MB' - }, + headers: {'api-key': 'yu0Dep8seTmFjvlmAXN1ILNggARnx74MB'}, chainId: 48900, identifier: 'zircuit' }, + { + name: 'Sonic', + subgraphEndpoint: 'https://api.0xgraph.xyz/api/public/803c8c8c-be12-4188-8523-b9853e23051d/subgraphs/steer-protocol-sonic/prod/gn', + chainId: 146, + identifier: 'sonic' + }, + { + name: 'Moonbeam', + subgraphEndpoint: 'https://api.goldsky.com/api/public/project_clohj3ta78ok12nzs5m8yag0b/subgraphs/steer-protocol-moonbeam/prod/gn', + chainId: 1284, + identifier: 'moonbeam' + }, + // { + // name: 'Sei', + // subgraphEndpoint: 'https://api.goldsky.com/api/public/project_clu1fg6ajhsho01x7ajld3f5a/subgraphs/dragonswap-v3-prod/1.0.5/gn', + // chainId: 1, // null? + // identifier: 'sei' // sei-network + // }, + { + name: 'Taiko', + subgraphEndpoint: 'https://api.goldsky.com/api/public/project_clohj3ta78ok12nzs5m8yag0b/subgraphs/steer-protocol-taiko/1.1.1/gn', + chainId: 167000, + identifier: 'taiko' + }, ] // Fetch active vaults and associated data @todo limited to 1000 per chain diff --git a/projects/sushiswap-v3/index.js b/projects/sushiswap-v3/index.js index 64f6fd8beb17..0e97e040d1b0 100644 --- a/projects/sushiswap-v3/index.js +++ b/projects/sushiswap-v3/index.js @@ -95,6 +95,7 @@ module.exports = uniV3Export({ blast: { factory: '0x7680d4b43f3d1d54d6cfeeb2169463bfa7a6cf0d', fromBlock: 284122, }, //europa: { factory: '0x51d15889b66A2c919dBbD624d53B47a9E8feC4bB', fromBlock: 5124251, }, rsk: { factory: '0x46B3fDF7B5cde91Ac049936bF0Bdb12C5D22202E', fromBlock: 6365060, }, //this one + sonic: { factory: '0x46B3fDF7B5cde91Ac049936bF0Bdb12C5D22202E', fromBlock: 1, }, //this one }); const config = { diff --git a/projects/sushiswap/api.js b/projects/sushiswap/api.js index 1efce7786f2f..a732fcf3825e 100644 --- a/projects/sushiswap/api.js +++ b/projects/sushiswap/api.js @@ -133,6 +133,7 @@ module.exports = { linea: { tvl: getUniTVL({ factory: '0xFbc12984689e5f15626Bad03Ad60160Fe98B303C', useDefaultCoreAssets: true, }) }, thundercore: { tvl: tvl2 }, islm: { tvl: tvl2 }, + sonic: { tvl: tvl2 }, } // module.exports.polygon.tvl = getChainTVL('polygon') diff --git a/projects/swellchain/index.js b/projects/swellchain/index.js new file mode 100644 index 000000000000..0673aaa37dc1 --- /dev/null +++ b/projects/swellchain/index.js @@ -0,0 +1,14 @@ +const { sumTokensExport } = require("../helper/unwrapLPs"); + +module.exports = { + ethereum: { + tvl: sumTokensExport({ + owners: [ + "0x7aA4960908B13D104bf056B23E2C76B43c5AACc8", // L1StandardBridge + "0x758E0EE66102816F5C3Ec9ECc1188860fbb87812", // OptimismPortal2 + "0xecf3376512EDAcA4FBB63d2c67d12a0397d24121", // wstETH L1ERC20TokenBridge + ], + fetchCoValentTokens: true, + }), + } +}; diff --git a/projects/swissborg/index.js b/projects/swissborg/index.js index ba5c888a264c..4f8a3445ed2d 100644 --- a/projects/swissborg/index.js +++ b/projects/swissborg/index.js @@ -21,6 +21,7 @@ const config = { '0x8F0d8b27bF808976Fa94f03e2230b4bca95bf3C4', '0xe2484A7Ac1b9Cb6D8E55fd00e129aB913172bea6', '0xdbe15F6573108B6736c70779C683Ca633c18aFe2', + '0xa2E07DB4e92F66071Ca68984517972F5625AB325', ], }, bitcoin: { @@ -49,6 +50,7 @@ const config = { 'Fe7SEekiKygziaEGKxsDsgLVzrCfNvVBvAYsaJBwFA8s', 'AR2ecEWY2vfsXmd4fUxc196LhbX5p8TnhvJg8t3fgYUN', '7Sng9GTnkjjb8WTF2kYX8JWqGHHwJGk5Ke9639zREUAR', + '3jvARuePRR6KpNAeYYGRQzs8W4VYsWWxe4BfoTSTZhUr', ], }, polkadot: { diff --git a/projects/synapse/config.js b/projects/synapse/config.js index d0b9b8c9418d..382124df237b 100644 --- a/projects/synapse/config.js +++ b/projects/synapse/config.js @@ -370,7 +370,7 @@ module.exports = { { pool: ADDRESSES.aurora.nUSD, tokens: [ - ADDRESSES.canto.NOTE, + '0x4e71a2e537b7f9d9413d3991d37958c0b5e1e503', // "0xd8836af2e565d3befce7d906af63ee45a57e8f80", // nUSD ] }, diff --git a/projects/syncswap/index.js b/projects/syncswap/index.js index b24b4c8d1034..170dd73e6c5f 100644 --- a/projects/syncswap/index.js +++ b/projects/syncswap/index.js @@ -43,21 +43,27 @@ async function tvl(api) { const config = { era: { fromBlock: 9775, - stableFactorys: ['0x5b9f21d407F35b10CbfDDca17D5D84b129356ea3','0x81251524898774F5F2FCaE7E7ae86112Cb5C317f'], - classicFactorys: ['0xf2DAd89f2788a8CD54625C60b55cD3d2D0ACa7Cb','0x0a34FBDf37C246C0B401da5f00ABd6529d906193'], - aquaFactorys: ['0x20b28B1e4665FFf290650586ad76E977EAb90c5D','0xFfa499b019394d9bEB5e21FC54AD572E4942302b','0x0754870C1aAb00eDCFABDF4e6FEbDD30e90f327d'] + stableFactorys: ['0x5b9f21d407F35b10CbfDDca17D5D84b129356ea3', '0x81251524898774F5F2FCaE7E7ae86112Cb5C317f'], + classicFactorys: ['0xf2DAd89f2788a8CD54625C60b55cD3d2D0ACa7Cb', '0x0a34FBDf37C246C0B401da5f00ABd6529d906193'], + aquaFactorys: ['0x20b28B1e4665FFf290650586ad76E977EAb90c5D', '0xFfa499b019394d9bEB5e21FC54AD572E4942302b', '0x0754870C1aAb00eDCFABDF4e6FEbDD30e90f327d'] }, linea: { fromBlock: 716, - stableFactorys: ['0xE4CF807E351b56720B17A59094179e7Ed9dD3727','0x61Abf754fc031C544236053495a193f3518e9101','0x024A096bAb43587d24004C95C3e20FcB7518Ad86'], - classicFactorys: ['0x37BAc764494c8db4e54BDE72f6965beA9fa0AC2d','0x9573994Ae6C9b35627976d26FA89e507e71FBaA2','0xb8AbaEa25E42DA5ac6897C9DAb0a8157885fE32b'], - aquaFactorys: ['0x7a31060d8524c21496a352BE65549eEf1e864fb0','0x1080EE857D165186aF7F8d63e8ec510C28A6d1Ea'] + stableFactorys: ['0xE4CF807E351b56720B17A59094179e7Ed9dD3727', '0x61Abf754fc031C544236053495a193f3518e9101', '0x024A096bAb43587d24004C95C3e20FcB7518Ad86'], + classicFactorys: ['0x37BAc764494c8db4e54BDE72f6965beA9fa0AC2d', '0x9573994Ae6C9b35627976d26FA89e507e71FBaA2', '0xb8AbaEa25E42DA5ac6897C9DAb0a8157885fE32b'], + aquaFactorys: ['0x7a31060d8524c21496a352BE65549eEf1e864fb0', '0x1080EE857D165186aF7F8d63e8ec510C28A6d1Ea'] + }, + sophon: { + fromBlock: 38459, + stableFactorys: ["0x8c9d66ba3e1d7681cffffa3c7d9807adae368e74"], + classicFactorys: ["0x432bcc3bc62de9186f9e8763c82d43e418681e6c"], + aquaFactorys: ["0xa2e2f6b5db704fde654db69895c89523332e538e"], }, scroll: { fromBlock: 80875, - stableFactorys: ['0xE4CF807E351b56720B17A59094179e7Ed9dD3727','0x5BEBDA7E264b03bB963CB2418f40C5ffcefb7A9e','0xA2acA673C00495A184F88De533BBa8e1b7f38D00'], - classicFactorys: ['0x37BAc764494c8db4e54BDE72f6965beA9fa0AC2d','0xDAEdEcF3F1Caf8d9050A0C973B77E40bA8024F69','0x76f549af692efA64952d02c075226df9878Fb54C'], - aquaFactorys: ['0xa033eAbcCfd9b71543E34dec43935467A230Ce2d','0x87aeb51d606056F48D241C4072f55ACd9D937018'] + stableFactorys: ['0xE4CF807E351b56720B17A59094179e7Ed9dD3727', '0x5BEBDA7E264b03bB963CB2418f40C5ffcefb7A9e', '0xA2acA673C00495A184F88De533BBa8e1b7f38D00'], + classicFactorys: ['0x37BAc764494c8db4e54BDE72f6965beA9fa0AC2d', '0xDAEdEcF3F1Caf8d9050A0C973B77E40bA8024F69', '0x76f549af692efA64952d02c075226df9878Fb54C'], + aquaFactorys: ['0xa033eAbcCfd9b71543E34dec43935467A230Ce2d', '0x87aeb51d606056F48D241C4072f55ACd9D937018'] }, } diff --git a/projects/tempest-finance/chains.js b/projects/tempest-finance/chains.js index fefbc9aee644..4d9f171e4d73 100644 --- a/projects/tempest-finance/chains.js +++ b/projects/tempest-finance/chains.js @@ -7,4 +7,5 @@ module.exports = { base: 8453, arbitrum: 42161, scroll: 534352, + swellchain: 1923, } \ No newline at end of file diff --git a/projects/tempest-finance/index.js b/projects/tempest-finance/index.js index 915b98dbf0fd..330e8fb5c7c6 100644 --- a/projects/tempest-finance/index.js +++ b/projects/tempest-finance/index.js @@ -1,20 +1,20 @@ +const { sumTokens2 } = require("../helper/unwrapLPs"); const chains = require("./chains"); const axios = require("axios"); async function tvl(api) { - const response = await axios.get(`https://protocol-service-api.tempestfinance.xyz/api/v1/vaults?chainId=${chains[api.chain]}`) - const vaults = response.data.data.vaults; + const response = await axios.get(`https://protocol-service-api.tempestfinance.xyz/api/v1/vaults?chainId=${chains[api.chain]}`) + const vaults = response.data.data.vaults; - const tokens = vaults.map(vault => vault.mainAsset); - const balances = await api.multiCall({ abi: 'uint256:totalAssets', calls: vaults.map(vault => vault.address) }); + const tokens = vaults.map(vault => vault.mainAsset); + const balances = await api.multiCall({ abi: 'uint256:totalAssets', calls: vaults.map(vault => vault.address) }); - api.addTokens(tokens, balances) + api.addTokens(tokens, balances) + return sumTokens2({ api }) } Object.keys(chains).forEach(chain => { - module.exports[chain] = { - tvl: async (api) => { - return await tvl(api) - } - } + module.exports[chain] = { + tvl + } }) diff --git a/projects/theo-network/index.js b/projects/theo-network/index.js new file mode 100644 index 000000000000..a02ebfb8e64a --- /dev/null +++ b/projects/theo-network/index.js @@ -0,0 +1,20 @@ +const { getConfig } = require('../helper/cache') + +const config = { + ethereum: {}, + arbitrum: {}, + base: {}, +} + +Object.keys(config).forEach(chain => { + module.exports[chain] = { + tvl: async (api) => { + const { [chain]: data } = await getConfig('theo-network', "https://vaults.theo.xyz/vaults/vaultInfo"); + + const calls = Object.values(data).map(i => i.contract) + const tokens = Object.values(data).map(i => i.asset) + const bals = await api.multiCall({ abi: 'uint256:totalBalance', calls }) + api.add(tokens, bals) + } + } +}) \ No newline at end of file diff --git a/projects/thriveonmars/index.js b/projects/thriveonmars/index.js new file mode 100644 index 000000000000..aec445e302e9 --- /dev/null +++ b/projects/thriveonmars/index.js @@ -0,0 +1,18 @@ +const { get_account_tvl } = require("../helper/chain/eos"); + +// Thrive On Mars +// https://thriveonmars.com +async function wax() { + const accounts = ["play.mars"]; + const tokens = [ + ["eosio.token", "WAX", "wax"] + ]; + return await get_account_tvl(accounts, tokens, "wax"); +} + +module.exports = { + methodology: `Thrive On Mars TVL is achieved by querying token balances from NFT gaming contracts`, + wax: { + tvl: wax + }, +} \ No newline at end of file diff --git a/projects/treasury/impermax.js b/projects/treasury/impermax.js index 8ec65d3c2a5e..27e981b1263c 100644 --- a/projects/treasury/impermax.js +++ b/projects/treasury/impermax.js @@ -1,12 +1,25 @@ const { nullAddress, treasuryExports } = require("../helper/treasury"); -const treasury = "0x7f959c082bc30f3ea88187fac1a640438ad7bf20"; +const treasury = "0xc28f68cd2df0fcc50f0058fb20abbc77bec8bdc6"; +const operations = "0x2157bfbb446744fc92bd95c3911eb58d0a9b01bd"; module.exports = treasuryExports({ arbitrum: { tokens: [ nullAddress, ], - owners: [treasury,], + owners: [treasury, operations], }, -}) \ No newline at end of file + base: { + tokens: [ + nullAddress, + ], + owners: [treasury, operations], + }, + blast: { + tokens: [ + nullAddress, + ], + owners: [treasury, operations], + }, +}) diff --git a/projects/tren-finance/index.js b/projects/tren-finance/index.js new file mode 100644 index 000000000000..482491b2eb46 --- /dev/null +++ b/projects/tren-finance/index.js @@ -0,0 +1,44 @@ +const SSL = ['0xDC4a311f0D852934d9b51C0eAc7c7e13EA1DF11b', '0xDFF4a68044eb68c60354810E9316B2B6DB88B3eb'] + +async function tvl(api) { + const stables = await api.multiCall({ abi: 'address:stable', calls: SSL }) + await api.sumTokens({ tokensAndOwners2: [stables, SSL] }) + const hyperPools = ['0xDC4a311f0D852934d9b51C0eAc7c7e13EA1DF11b'] + + const vaults = await api.multiCall({ abi: 'address:vault', calls: hyperPools }) + const vaultBalances = await api.multiCall({ abi: 'erc20:balanceOf', calls: vaults.map((v, i) => ({ target: v, params: hyperPools[i] })) }) + const vaultSupplies = await api.multiCall({ abi: 'uint256:totalSupply', calls: vaults }) + const vToken0s = await api.multiCall({ abi: 'address:token0', calls: vaults }) + const vToken1s = await api.multiCall({ abi: 'address:token1', calls: vaults }) + const vTokenAmounts = await api.multiCall({ abi: 'function getTotalAmounts() view returns (uint256 total0, uint256 total1)', calls: vaults }) + + vaults.forEach((_vault, i) => { + const token0 = vToken0s[i] + const token1 = vToken1s[i] + const { total0, total1, } = vTokenAmounts[i] + const ratio = vaultBalances[i] / vaultSupplies[i] + api.add(token0, total0 * ratio) + api.add(token1, total1 * ratio) + }) + + const curvePoolVaults = ['0xDFF4a68044eb68c60354810E9316B2B6DB88B3eb'] + const curvePools = await api.multiCall({ abi: 'address:curvePool', calls: curvePoolVaults }) + const cBalances = await api.multiCall({ abi: 'erc20:balanceOf', calls: curvePools.map((v, i) => ({ target: v, params: curvePoolVaults[i] })) }) + const cSupplies = await api.multiCall({ abi: 'uint256:totalSupply', calls: curvePools }) + + + for (const cPool of curvePools) { + const i = curvePools.indexOf(cPool) + const cTokens = await api.fetchList({ lengthAbi: 'N_COINS', itemAbi: 'coins', target: cPool }) + const ratio = cBalances[i] / cSupplies[i] + const bals = await api.multiCall({ abi: 'erc20:balanceOf', calls: cTokens.map((v) => ({ target: v, params: cPool })) }) + for (let j=0; j - sumTokens2({ + tvl: async (api) => { + const totalBalances = await sumTokens2({ api, - owners: [ - "0x32400084C286CF3E17e7B677ea9583e60a000324", - "0x57891966931Eb4Bb6FB81430E6cE0A03AAbDe063", - "0xD7f9f54194C633F36CCD5F3da84ad4a1c38cB2cB" - ], + owner: target, fetchCoValentTokens: true, - }), + }) + const balances = await api.multiCall({ + calls: [gasQuery, ...Object.keys(totalBalances)].map(token => ({ + target, params: [chainId, token.substring(token.indexOf(':') + 1)] + })), + abi: { "inputs": [{ "internalType": "uint256", "name": "chainId", "type": "uint256" }, { "internalType": "address", "name": "l1Token", "type": "address" }], "name": "chainBalance", "outputs": [{ "internalType": "uint256", "name": "balance", "type": "uint256" }], "stateMutability": "view", "type": "function" }, + permitFailure: true, + withMetadata: true + }) + api._balances._balances = {} + balances.map(call => { + const token = call.input.params[1] + api.add(token == gasQuery ? gasAddress : token, call.output) + }) + } }, }; diff --git a/projects/uniswap/index.js b/projects/uniswap/index.js index cc57513de302..3d71604d603e 100644 --- a/projects/uniswap/index.js +++ b/projects/uniswap/index.js @@ -17,7 +17,7 @@ const blacklists = { base: ['0xb17d69c91135516b0256c67e8bd32cd238b56161'], ethereum: ['0xa850478adaace4c08fc61de44d8cf3b64f359bec', '0x055284a4ca6532ecc219ac06b577d540c686669d', '0x8c0411f2ad5470a66cb2e9c64536cfb8dcd54d51', '0x277667eb3e34f134adf870be9550e9f323d0dc24', '0x4c83a7f819a5c37d64b4c5a2f8238ea082fa1f4e', '0x290a6a7460b308ee3f19023d2d00de604bcf5b42', '0x4b5ab61593a2401b1075b90c04cbcdd3f87ce011', '0x582d23c7ec6b59afd041a522ff64ff081e8c0d2d', '0x1f98431c8ad98523631ae4a59f267346ea31f984', '0xaf44e10ed87d90f28bff2d1fbef1f64b090f5ebb', '0xdfef6416ea3e6ce587ed42aa7cb2e586362cbbfa', '0x7e9c15c43f0d6c4a12e6bdff7c7d55d0f80e3e23', '0x1111111becab3c8866712ebf23fc4741010b8dce', '0x77777777b79f2fa437bf526169f98aa0c884c4b7', '0x630d98424efe0ea27fb1b3ab7741907dffeaad78'], arbitrum: ['0xd4d2f4110878a33ea5b97f0665e518253446161a', '0xB50721BCf8d664c30412Cfbc6cf7a15145234ad1',], - polygon: ['0x8d52c2d70a7c28a9daac2ff12ad9bfbf041cd318', '0x1f98431c8ad98523631ae4a59f267346ea31f984', '0xd5302a8ead77b85ea3326b45f4714e0b3432b233', '0xc951ab482ff11d8df636742e1f1c3fc8037427a9',], + polygon: ['0x8d52c2d70a7c28a9daac2ff12ad9bfbf041cd318', '0x1f98431c8ad98523631ae4a59f267346ea31f984', '0xd5302a8ead77b85ea3326b45f4714e0b3432b233', '0xc951ab482ff11d8df636742e1f1c3fc8037427a9', '0xbF7970D56a150cD0b60BD08388A4A75a27777777'], } function v3TvlPaged(chain) { @@ -92,6 +92,7 @@ module.exports = { bob: { factory: "0xcb2436774C3e191c85056d248EF4260ce5f27A9D", fromBlock: 5188280 }, lisk: { factory: "0x0d922Fb1Bc191F64970ac40376643808b4B74Df9", fromBlock: 577168 }, wc: { factory: "0x7a5028BDa40e7B173C278C5342087826455ea25a", fromBlock: 1603366 }, + corn: { factory: "0xcb2436774C3e191c85056d248EF4260ce5f27A9D", fromBlock: 10878 }, }), filecoin: { tvl: filecoinTvl }, } @@ -111,4 +112,4 @@ module.exports.sei.tvl = async (api) => { const token1s = await api.multiCall({ abi: 'address:token1', calls: pools }) const ownerTokens = pools.map((pool, i) => [[token0s[i], token1s[i]], pool]) return sumTokens2({ api, ownerTokens }) -} \ No newline at end of file +} diff --git a/projects/vaderai/index.js b/projects/vaderai/index.js new file mode 100644 index 000000000000..331d27064f7f --- /dev/null +++ b/projects/vaderai/index.js @@ -0,0 +1,14 @@ +const { staking } = require('../helper/staking'); + +const vaderAddress = '0x731814e491571a2e9ee3c5b1f7f3b962ee8f4870'; + +module.exports = { + base: { + tvl: () => ({}), + staking: staking( + '0x1d6bb701eecedcd53966402064ce1c5b9eddc780', + vaderAddress + ), + }, + methodology: "$VADER coins can be staked in the protocol to earn rewards.", +}; diff --git a/projects/vectis/index.js b/projects/vectis/index.js index d7bb8070a376..bcf2bb46faa6 100644 --- a/projects/vectis/index.js +++ b/projects/vectis/index.js @@ -18,8 +18,12 @@ const vaultUserAddresses = [ new PublicKey("9Zmn9v5A2YWUQj47bkEmcnc37ZsYe83rsRK8VV2j1UqX"), //Vault A new PublicKey("4KvPuh1wG8j1pLnZUC5CuqTm2a41PWNtik1NwpLoRquE"), //Vault B new PublicKey("Hcs63usAc6cxWccycrVwx1mrNgNSpUZaUgFm7Lw9tSkR"), //Vault C - new PublicKey("MzEPFp2LwCSMMPHLQsqfE7SN6xkPHZ8Uym2HfrH7g5P"), //Yield Compress A - new PublicKey("CMiyE7M98DSPBEhQGTA6CzNodWkNuuW4y9HoocfK75nG") //Yield Compress B + new PublicKey("ARLwHJ3CYLkVTeW3nHvPBmGQ7SLQdhZbAkWHzYrq57rt"), //Vault D + new PublicKey("FyH3qGRQSG7AmdEsPEVDxdJJLnLhAn3CZ48acQU34LFr"), //Vault E + new PublicKey("MzEPFp2LwCSMMPHLQsqfE7SN6xkPHZ8Uym2HfrH7g5P"), //Yield Compass A + new PublicKey("CMiyE7M98DSPBEhQGTA6CzNodWkNuuW4y9HoocfK75nG"), //Yield Compass B + new PublicKey("CnaXXuzc2S5UFSGoBRuKVNnzXBvxbaMwq6hZu5m91CAV") //LST Yield Compass + ]; @@ -41,52 +45,65 @@ const vaultUserAddresses = [ * */ async function tvl(api) { + // Get all vault accounts first const accounts = await getMultipleAccounts(vaultUserAddresses) const deserializedData = accounts.map(deserializeUserPositions) - const perpIndices = deserializedData.map(data => data.perpPositions.map(position => position.market_index)).flat() - const perpKeys = perpIndices.map(index => getVaultPublicKey('perp_market', index)) - const perpAccounts = await getMultipleAccounts(perpKeys) - const perpAccountMap = {} - perpIndices.forEach((v, i) => perpAccountMap[v] = perpAccounts[i]) + // Collect unique market indices upfront + const allSpotIndices = new Set() + const allPerpIndices = new Set() + + deserializedData.forEach(({ spotPositions, perpPositions }) => { + spotPositions?.forEach(pos => allSpotIndices.add(pos.market_index)) + perpPositions?.forEach(pos => allPerpIndices.add(pos.market_index)) + }) + + // Batch fetch + const allKeys = [ + ...[...allSpotIndices].map(index => getVaultPublicKey('spot_market', index)), + ...[...allPerpIndices].map(index => getVaultPublicKey('perp_market', index)) + ] + + const allAccounts = await getMultipleAccounts(allKeys) + + // Create lookup maps + const spotAccountMap = {} + const perpAccountMap = {} + + let offset = 0 + ;[...allSpotIndices].forEach((index, i) => { + spotAccountMap[index] = allAccounts[i] + offset = i + 1 + }) + ;[...allPerpIndices].forEach((index, i) => { + perpAccountMap[index] = allAccounts[i + offset] + }) + // Process positions using the cached account data for (const { spotPositions, perpPositions } of deserializedData) { - // - // Process spot positions if (spotPositions?.length) { - const spotIndices = spotPositions.map(position => position.market_index) - const spotKeys = spotIndices.map(index => getVaultPublicKey('spot_market', index)) - const spotAccounts = await getMultipleAccounts(spotKeys) - const spotAccountMap = {} - spotIndices.forEach((v, i) => spotAccountMap[v] = spotAccounts[i]) - spotPositions.forEach(position => { - const tokenMint = getTokenMintFromMarketIndex(position.market_index); - const adjustedBalance = processSpotPosition(position, spotAccountMap[position.market_index]); - api.add(tokenMint, adjustedBalance); - }); + const tokenMint = getTokenMintFromMarketIndex(position.market_index) + const adjustedBalance = processSpotPosition(position, spotAccountMap[position.market_index]) + api.add(tokenMint, adjustedBalance) + }) } - // Process perp positions if (perpPositions?.length) { + perpPositions.map(position => { + const baseTokenMint = getPerpTokenMintFromMarketIndex(position.market_index) + const { baseBalance, quoteBalance } = processPerpPosition(position) + api.add(baseTokenMint, baseBalance) - perpPositions.map(async position => { - // Handle base asset - const baseTokenMint = getPerpTokenMintFromMarketIndex(position.market_index); - const { baseBalance, quoteBalance } = processPerpPosition(position); - api.add(baseTokenMint, baseBalance); - // - // Handle quote asset (always USDC) - const quoteTokenMint = getTokenMintFromMarketIndex(0); - // - api.add(quoteTokenMint, quoteBalance); + const quoteTokenMint = getTokenMintFromMarketIndex(0) + api.add(quoteTokenMint, quoteBalance) - const { cumulativeFundingRateLong, cumulativeFundingRateShort, } = getPerpMarketFundingRates(perpAccountMap[position.market_index]); - const currentCumulativeFundingRate = position.base_asset_amount > 0n ? cumulativeFundingRateLong : cumulativeFundingRateShort; - const difference = (currentCumulativeFundingRate - BigInt(position.last_cumulative_funding_rate)) / BigInt(10 ** 6); - const fundingRatePnl = (difference * (position.base_asset_amount) / BigInt(10 ** 6)); + const { cumulativeFundingRateLong, cumulativeFundingRateShort } = getPerpMarketFundingRates(perpAccountMap[position.market_index]) + const currentCumulativeFundingRate = position.base_asset_amount > 0n ? cumulativeFundingRateLong : cumulativeFundingRateShort + const difference = (currentCumulativeFundingRate - BigInt(position.last_cumulative_funding_rate)) / BigInt(10 ** 6) + const fundingRatePnl = (difference * (position.base_asset_amount) / BigInt(10 ** 6)) - api.add(quoteTokenMint, fundingRatePnl); + api.add(quoteTokenMint, fundingRatePnl) }) } } diff --git a/projects/vectis/spotMarkets.js b/projects/vectis/spotMarkets.js index e171a00e0081..9ca75e4598a7 100644 --- a/projects/vectis/spotMarkets.js +++ b/projects/vectis/spotMarkets.js @@ -1,4 +1,3 @@ -const ADDRESSES = require('../helper/coreAssets.json') const anchor = require('@coral-xyz/anchor'); const { PublicKey } = require("@solana/web3.js"); const DRIFT_PROGRAM_ID = new PublicKey('dRiftyHA39MWEi3m9aunc5MzRF1JYuBsbn6VPcn33UH') @@ -6,12 +5,27 @@ const DRIFT_PROGRAM_ID = new PublicKey('dRiftyHA39MWEi3m9aunc5MzRF1JYuBsbn6VPcn3 const SPOT_MARKETS = { 0: { name: 'USDC', - mint: ADDRESSES.solana.USDC, + mint: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v', decimals: 6 }, 1: { name: 'SOL', - mint: ADDRESSES.solana.SOL, + mint: 'So11111111111111111111111111111111111111112', + decimals: 9 + }, + 6: { + name: 'jitoSOL', + mint: 'J1toso1uCk3RLmjorhTtrVwY9HJ7X8V9yYac6Y7kGCPn', + decimals: 9 + }, + 16:{ + name:'INF', + mint:'5oVNBeEEQvYi1cX3ir8Dx5n1P7pdxydbGF2X4TxVusJm', + decimals: 9 + }, + 17:{ + name:'dSOL', + mint:'Dso1bDeDjCQxTrWHqUUi63oBvV7Mdm6WaobLbQ7gnPQ', decimals: 9 }, 19: { @@ -19,6 +33,11 @@ const SPOT_MARKETS = { mint: '27G8MtK7VtTcCHkpASjSDdkWWYfoqT6ggEuKidVJidD4', decimals: 6 }, + 22: { + name: 'PYUSD', + mint: '2b1kV6DkPAnxd5ixfnxCpjxmKwqjjaYmCZfHsFu24GXo', + decimals: 6 + }, 28: { name: 'USDS', mint: 'USDSwr9ApdHk5bvJKMjzff41FfuX8bSxdKcR81vTwcA', @@ -29,7 +48,7 @@ const SPOT_MARKETS = { const PERP_MARKETS = { 0: { name: 'SOL-PERP', - mint: ADDRESSES.solana.SOL, + mint: 'So11111111111111111111111111111111111111112', baseDecimals: 9, quoteDecimals: 6 }, diff --git a/projects/velar-amm/api.js b/projects/velar-amm/api.js index 58e64eda5c74..524311d2b773 100644 --- a/projects/velar-amm/api.js +++ b/projects/velar-amm/api.js @@ -39,7 +39,7 @@ async function uniTvl(api, factory, isStable = false) { token1Bal: reserve1?.value, }) sdk.log(`velar-amm: ${i}/${pairCount}`) - await sleep(1100) + await sleep(3100) } return transformDexBalances({ chain: 'stacks', data, balances: api.getBalances() }) } \ No newline at end of file diff --git a/projects/velvet-capital-v3/index.js b/projects/velvet-capital-v3/index.js index 4e748c20821a..d5730c980918 100644 --- a/projects/velvet-capital-v3/index.js +++ b/projects/velvet-capital-v3/index.js @@ -3,7 +3,8 @@ const { sumTokens2 } = require('../helper/unwrapLPs') const config = { base: { address: '0xf93659fb357899e092813bc3a2959ceDb3282a7f', blacklistedTokens: [ADDRESSES.bsc.USDT, "0x96af5739ca66ca55ab71ac9f308720d5044995ee","0xca4f1536cd29d42bcbc8211f1b621ba9e817433f"]}, - bsc: { address: '0xA1fe1C37Bf899C7F7521082C002dFA4fEbAaA8dd', blacklistedTokens: [ADDRESSES.optimism.WETH_1] } + bsc: { address: '0xA1fe1C37Bf899C7F7521082C002dFA4fEbAaA8dd', blacklistedTokens: [ADDRESSES.optimism.WETH_1] }, + ethereum: { address: '0x7c530c9ED5E734964453Ce62Ae9C4e31a247738B'} } const abi = { diff --git a/projects/wagmi-com/index.js b/projects/wagmi-com/index.js index ab0bfb6f1cd4..fe6b758f0d6e 100644 --- a/projects/wagmi-com/index.js +++ b/projects/wagmi-com/index.js @@ -10,6 +10,7 @@ module.exports = uniV3Export({ zklink: { factory: '0x6175b648473F1d4c1549aAC3c2d007e7720585e6', fromBlock: 1339353, }, iotaevm: { factory: '0x01Bd510B2eA106917e711f9a05a42fC162bee2Ac', fromBlock: 143828, }, base: { factory: '0x576A1301B42942537d38FB147895fE83fB418fD4', fromBlock: 14250787, }, + sonic: { factory: '0x56CFC796bC88C9c7e1b38C2b0aF9B7120B079aef', fromBlock: 276406, } }) module.exports.kava = { tvl: uniV3GraphExport({ name: 'wagmi-kava', graphURL: 'https://kava.graph.wagmi.com/subgraphs/name/v3' }) } @@ -17,6 +18,7 @@ module.exports.kava = { tvl: uniV3GraphExport({ name: 'wagmi-kava', graphURL: 'h const stakingConfig = { metis: { swagmi: '0x5fb3983adc4dcc82a610a91d2e329f6401352558', wagmi: '0xaf20f5f19698f1d19351028cd7103b63d30de7d7', }, kava: { swagmi: '0x3690d1a9fb569c21372f8091527ab44f1dc9630f', wagmi: '0xaf20f5f19698f1d19351028cd7103b63d30de7d7', }, + sonic: { swagmi: '0x4b5d9db7910448e2F236509D9eE242673AFa28aA', wagmi: '0x0e0Ce4D450c705F8a0B6Dd9d5123e3df2787D16B', } } Object.keys(stakingConfig).forEach(chain => { diff --git a/projects/yieldnest/index.js b/projects/yieldnest/index.js index 7c3cc6bf56d6..deb2d6737ae6 100644 --- a/projects/yieldnest/index.js +++ b/projects/yieldnest/index.js @@ -22,8 +22,8 @@ module.exports = { bsc: { tvl: async (api) => { const ynBNB = '0x304B5845b9114182ECb4495Be4C91a273b74B509' - const ynBnbBalance = await api.call({ abi: 'uint256:totalAssets', target: ynBNB }) - api.add(ADDRESSES.null, ynBnbBalance) + const ynBTCk = '0x78839cE14a8213779128Ee4da6D75E1326606A56' + return api.erc4626Sum({ calls: [ynBNB, ynBTCk], isOG4626: true}) } }, } diff --git a/projects/zeebu/index.js b/projects/zeebu/index.js new file mode 100644 index 000000000000..eb559cc0ae56 --- /dev/null +++ b/projects/zeebu/index.js @@ -0,0 +1,23 @@ +const { staking } = require('../helper/staking') + +const VOTING_ESCROW_ADDRESSES = { + ethereum: '0x8e76Cdf3b14c540aB54aFa7f8492AC1d16Ecfb35', + base: '0xcf08d1ec5d8e566d95299399307f75f98d6aea03', + bsc: '0xd3e8cD2eDbf252860E02ffb245fD654b1ab30f30', +}; + +const ZBU_ADDRESSES = { + ethereum: '0xe77f6aCD24185e149e329C1C0F479201b9Ec2f4B', + base: '0x2C8C89C442436CC6C0a77943E09c8Daf49Da3161', + bsc: '0x4D3dc895a9EDb234DfA3e303A196c009dC918f84', +}; + + +Object.keys(VOTING_ESCROW_ADDRESSES).forEach(chain => { + module.exports[chain] = { + tvl: () => ({}), + staking: staking(VOTING_ESCROW_ADDRESSES[chain], ZBU_ADDRESSES[chain]) + } +}) + +module.exports.base.pool2 = staking('0x45dd22aCe398002b34cB37b363B2F02C7dd47842', '0xC3889F9764d68BDF2e16f237206746344172A147') \ No newline at end of file diff --git a/projects/zivoe/index.js b/projects/zivoe/index.js new file mode 100644 index 000000000000..27b631ea5c79 --- /dev/null +++ b/projects/zivoe/index.js @@ -0,0 +1,49 @@ +const { getLogs2 } = require("../helper/cache/getLogs"); + +const LOANS_FROM_BLOCK = 20973423; + +// On-Chain Credit Locker +const OCC_USDC = "0xfAb4e880467e26ED46F00c669C28fEaC58262698"; + +// TVL Owners +const DAO = "0xB65a66621D7dE34afec9b9AC0755133051550dD7"; +const YDL = "0xfB7920B55887840643e20952f22Eb18dDC474B2B"; +const ST_STT = "0x0D45c292baCdC47CE850E4c83a2FA2e8509DEd5D"; +const ST_JTT = "0xcacdB1A5a11F824E02De4CA6E7b2D12BB278aA7c"; + +// TVL Asset +const USDC = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"; + +async function borrowed(api) { + const loansIds = await getLogs2({ + api, + target: OCC_USDC, + eventAbi: "event OfferAccepted(uint256 indexed id, uint256 principal, address indexed borrower, uint256 paymentDueBy)", + fromBlock: LOANS_FROM_BLOCK, + customCacheFunction: ({ cache, logs }) => { + if (!cache.logs) cache.logs = [] + cache.logs.push(...logs.map(i => i.id.toString())) + cache.logs = [...new Set(cache.logs)] + return cache + }, + }); + + const loans = await api.multiCall({ + abi: "function loans(uint256) view returns (address borrower, uint256 principalOwed, uint256 APR, uint256 APRLateFee, uint256 paymentDueBy, uint256 paymentsRemaining, uint256 term, uint256 paymentInterval, uint256 offerExpiry, uint256 gracePeriod, int8 paymentSchedule, uint8 state)", + target: OCC_USDC, + calls: loansIds, + }); + const owedAmounts = loans.map(({ principalOwed }) => principalOwed); + + const occAsset = await api.call({ abi: "address:stablecoin", target: OCC_USDC }); + const tokens = Array(owedAmounts.length).fill(occAsset); + + api.addTokens(tokens, owedAmounts); +} + +module.exports = { + ethereum: { + tvl: () => ({}), + borrowed, + }, +}; diff --git a/utils/handleError.js b/utils/handleError.js index 049f9b2cd972..e360dc9dc792 100644 --- a/utils/handleError.js +++ b/utils/handleError.js @@ -22,7 +22,7 @@ function getStackMessage(stack) { if (!stack) return [] if (/ at (checkExportKeys)/.test(stack)) return [] - const isNodeMolule = m => /node_modules/.test(m) + const isNodeMolule = m => /node_modules/.test(m) && !/defillama/.test(m) const isNotLoggerMessage = m => !/log/.test(m) const isNotInternalMessage = m => !/node:internal/.test(m)