diff --git a/projects/GajFinance/index.js b/projects/GajFinance/index.js index a50a4daddc26..d363c4c95c46 100644 --- a/projects/GajFinance/index.js +++ b/projects/GajFinance/index.js @@ -11,7 +11,6 @@ async function stakingAvax(timestamp, ethBlock, chainBlocks) { } module.exports = { - broken: 'Api is no longer reachable', methodology: "TVL comes from NFT Farming, Jungle Pools, MasterChef and Vaults", avax:{ staking: stakingAvax, diff --git a/projects/babyswap/index.js b/projects/babyswap/index.js index 409c98f85ae5..8fdc293ff0a4 100644 --- a/projects/babyswap/index.js +++ b/projects/babyswap/index.js @@ -3,22 +3,10 @@ const { staking } = require("../helper/staking"); const MasterChefContract = "0xdfAa0e08e357dB0153927C7EaBB492d1F60aC730"; const BABY = "0x53E562b9B7E5E94b81f10e96Ee70Ad06df3D2657"; -// node test.js projects/babyswap/index.js - -/* -module.exports = { - bsc: { - staking: staking(MasterChefContract, BABY), - tvl: bscTvl, - }, - methodology: - "We count liquidity on the Farms (LP tokens) and Pools (single tokens) seccions threw MasterChef Contract", -};*/ const { getUniTVL } = require('../helper/unknownTokens') module.exports = { methodology: `Uses factory(0x86407bEa2078ea5f5EB5A52B2caA963bC1F889Da) address and whitelisted tokens address to find and price Liquidity Pool pairs`, misrepresentedTokens: true, - incentivized: true, bsc: { tvl: getUniTVL({ factory: '0x86407bEa2078ea5f5EB5A52B2caA963bC1F889Da', useDefaultCoreAssets: true }), staking: staking(MasterChefContract, BABY), diff --git a/projects/bfly.js b/projects/bfly.js index dcea3c526d32..29089ee81605 100644 --- a/projects/bfly.js +++ b/projects/bfly.js @@ -40,7 +40,6 @@ module.exports={ methodology: "Data is retrieved from the api at https://fai.bfly.finance", misrepresentedTokens: true, timetravel: false, - incentivized: true, starcoin: { tvl, } diff --git a/projects/coconuts-finance/index.js b/projects/coconuts-finance/index.js index 69fd9c5358ac..be0cd1a2116c 100644 --- a/projects/coconuts-finance/index.js +++ b/projects/coconuts-finance/index.js @@ -2,5 +2,5 @@ module.exports = { avax: { tvl: () => ({}) }, - broken: 'Api is down' + deadFrom: '2022-04-27', }; diff --git a/projects/coincollect/index.js b/projects/coincollect/index.js index a2f458f0902a..505e00c21f64 100644 --- a/projects/coincollect/index.js +++ b/projects/coincollect/index.js @@ -1,4 +1,3 @@ -const { staking } = require("../helper/staking"); const { getUniTVL, sumTokensExport } = require('../helper/unknownTokens') const MasterChefContract = "0x46A928F2386b8c38cdde028a32c5b7aa19F40445"; @@ -7,7 +6,6 @@ const COLLECT = "0x56633733fc8BAf9f730AD2b6b9956Ae22c6d4148"; module.exports = { methodology: `Uses factory(0x2bc17223A99B6e2857796a5F64A1ED91067b5657) address to count liquidity in pools as TVL.`, misrepresentedTokens: true, - incentivized: true, polygon: { tvl: getUniTVL({ factory: '0x2bc17223A99B6e2857796a5F64A1ED91067b5657', useDefaultCoreAssets: true, fetchBalances: true }), staking: sumTokensExport({owner: MasterChefContract, tokens: [COLLECT], lps: ['0x0cCc84b6506003487AEC687085e82C2f912E607B'], useDefaultCoreAssets: true, }), diff --git a/projects/dddx.js b/projects/dddx.js index 74a17009ea41..5f23d33d4707 100644 --- a/projects/dddx.js +++ b/projects/dddx.js @@ -3,7 +3,6 @@ const { stakings } = require("./helper/staking"); module.exports = { misrepresentedTokens: true, - incentivized: true, bsc: { tvl: getUniTVL({ factory: '0xb5737A06c330c22056C77a4205D16fFD1436c81b', useDefaultCoreAssets: true }), staking: stakings( @@ -14,7 +13,6 @@ module.exports = { ], '0x4B6ee8188d6Df169E1071a7c96929640D61f144f', - 'bsc' ) } }; diff --git a/projects/fluxbeam-xyz/index.js b/projects/fluxbeam-xyz/index.js index 85f3641269f6..9b6a164e6d17 100644 --- a/projects/fluxbeam-xyz/index.js +++ b/projects/fluxbeam-xyz/index.js @@ -21,4 +21,5 @@ async function tvl(api) { module.exports = { timetravel: false, solana: { tvl, }, + isHeavyProtocol: true, } diff --git a/projects/helper/solana.js b/projects/helper/solana.js index c06adfd8845e..05f88094cb64 100644 --- a/projects/helper/solana.js +++ b/projects/helper/solana.js @@ -61,14 +61,15 @@ async function getTokenSupply(token) { } async function getTokenAccountBalances(tokenAccounts, { individual = false, allowError = false, chain = 'solana' } = {}) { - log('total token accounts: ', tokenAccounts.length) + const sleepTime = tokenAccounts.length > 2000 ? 2000 : 200 + log('total token accounts: ', tokenAccounts.length, 'sleepTime: ', sleepTime) tokenAccounts.forEach((val, i) => { if (typeof val === 'string') tokenAccounts[i] = new PublicKey(val) }) const connection = getConnection(chain) const balancesIndividual = [] const balances = {} - const res = await runInChunks(tokenAccounts, chunk => connection.getMultipleAccountsInfo(chunk)) + const res = await runInChunks(tokenAccounts, chunk => connection.getMultipleAccountsInfo(chunk), { sleepTime }) res.forEach((data, idx) => { if (!data) { diff --git a/projects/helper/whitelistedExportKeys.json b/projects/helper/whitelistedExportKeys.json index 8aa6014b2003..e6d5646e6c8f 100644 --- a/projects/helper/whitelistedExportKeys.json +++ b/projects/helper/whitelistedExportKeys.json @@ -9,12 +9,9 @@ "borrowed", "start", "doublecounted", - "treasury", "hallmarks", - "incentivized", - "offers", + "isHeavyProtocol", "deadFrom", - "broken", "ownTokens", "vesting" ] \ No newline at end of file diff --git a/projects/kyotoswap/index.js b/projects/kyotoswap/index.js index 9e449835eef7..c15b026003b7 100644 --- a/projects/kyotoswap/index.js +++ b/projects/kyotoswap/index.js @@ -8,7 +8,6 @@ const KSWAP = "0x29ABc4D03D133D8Fd1F1C54318428353CE08727E"; module.exports = { methodology: `Uses factory(${FACTORY}) address and whitelisted tokens address to find and price Liquidity Pool pairs`, misrepresentedTokens: true, - incentivized: true, bsc: { tvl: getUniTVL({ factory: FACTORY, diff --git a/projects/orbitalswap/index.js b/projects/orbitalswap/index.js index 09847f3e5d10..85b3a09f5a3b 100644 --- a/projects/orbitalswap/index.js +++ b/projects/orbitalswap/index.js @@ -8,7 +8,6 @@ const { getUniTVL } = require('../helper/unknownTokens') module.exports = { methodology: `Uses factory(0x1A04Afe9778f95829017741bF46C9524B91433fB) address and whitelisted tokens address to find and price Liquidity Pool pairs`, misrepresentedTokens: true, - incentivized: true, bsc: { tvl: getUniTVL({ factory: '0x1A04Afe9778f95829017741bF46C9524B91433fB', useDefaultCoreAssets: true }), staking: staking(MasterChefContract, ORB), diff --git a/projects/safedollar/farm-utils.js b/projects/safedollar/farm-utils.js deleted file mode 100644 index 3dba529c5be0..000000000000 --- a/projects/safedollar/farm-utils.js +++ /dev/null @@ -1,105 +0,0 @@ -const sdk = require('@defillama/sdk'); -const farmPolygon = require('./farms-polygon.json'); - -const farmLPBalance = async ( - chain, - block, - masterChef, - lpToken, - token0, - token1, -) => { - const balances = ( - await sdk.api.abi.multiCall({ - abi: 'erc20:balanceOf', - calls: [ - { - target: token0, - params: [lpToken], - }, - { - target: token1, - params: [lpToken], - }, - { - target: lpToken, - params: [masterChef], - }, - ], - block, - chain: chain, - }) - ).output; - - const lpTotalSuply = ( - await sdk.api.abi.call({ - target: lpToken, - abi: 'erc20:totalSupply', - chain: chain, - block, - }) - ).output; - - const token0Locked = (balances[2].output * balances[0].output) / lpTotalSuply; - const token1Locked = (balances[2].output * balances[1].output) / lpTotalSuply; - return [ - { token: `${chain}:${token0}`, locked: token0Locked }, - { token: `${chain}:${token1}`, locked: token1Locked }, - ]; -}; - -const farmSingleTokenBalance = async (chain, block, masterChef, token) => { - const masterChefBalance = ( - await sdk.api.abi.call({ - target: token, - abi: 'erc20:balanceOf', - params: [masterChef], - chain: chain, - block, - }) - ).output; - - return [{ token: `${chain}:${token}`, locked: masterChefBalance }]; -}; - - -const polygonFarmLocked = async (block) => { - const balances = {}; - const tokens = farmPolygon.tokens; - - const allPools = farmPolygon.farms - .map((t) => { - return t.pools.map((pool) => { - return Object.assign(pool, { - masterChef: t.masterChef, - }); - }); - }) - .reduce((acc, current) => [...acc, ...current], []); - - const promises = allPools.map((item) => { - return item.single - ? farmSingleTokenBalance('polygon', block, item.masterChef, item.lpToken) - : farmLPBalance( - 'polygon', - block, - item.masterChef, - item.lpToken, - tokens[item.token0], - tokens[item.token1], - ); - }); - - const data = await Promise.all(promises); - data.forEach((farm) => { - farm.forEach((item) => { - sdk.util.sumSingleBalance(balances, item.token, item.locked); - }); - }); - - return balances; -}; - -module.exports = { - polygonFarmLocked, -}; diff --git a/projects/safedollar/farms-polygon.json b/projects/safedollar/farms-polygon.json deleted file mode 100644 index 5c9f8352b537..000000000000 --- a/projects/safedollar/farms-polygon.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "tokens": { - "usdc": "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174", - "eth": "0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619", - "weth": "0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619", - "matic": "0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270", - "quick": "0x831753DD7087CaC61aB5644b308642cc1c33Dc13", - "sds": "0xAB72EE159Ff70b64beEcBbB0FbBE58b372391C54", - "safedollar": "0x66C59Dded4EF01a3412a8B019B6e41D4a8C49A35", - "susdc": "0xd2eba21c2e0d6f996fdd063ae20aca8264ac1929", - "smatic": "0xc1ac5c0b73ba01a31c93884c28a31e9985842c38" - }, - "farms": [ - { - "masterChef": "0x69E7Bbe85db0364397378364458952bEcB886920", - "reward": "sds", - "pools": [ - { - "id": 0, - "lpToken": "0x46A30dFece0E0fc0977eefd15bd0595fdDe15a10", - "token0": "usdc", - "token1": "sds", - "rewardToken": "sds" - }, - { - "id": 1, - "lpToken": "0x08e57E45b190d7b05003E6f80BA7cFdCA762cfb8", - "token0": "usdc", - "token1": "susdc", - "rewardToken": "sds" - }, - { - "id": 2, - "lpToken": "0x6649F12E210862e0045B3dFe7E6eA1F8F0565049", - "token0": "usdc", - "token1": "safedollar", - "rewardToken": "sds" - }, - { - "id": 3, - "lpToken": "0x853Ee4b2A13f8a742d64C8F088bE7bA2131f670d", - "token0": "usdc", - "token1": "weth", - "rewardToken": "sds" - }, - { - "id": 4, - "lpToken": "0xa14B83FbB32C5207ab84370a28d01E4720B9C348", - "token0": "safedollar", - "token1": "smatic", - "rewardToken": "sds" - }, - { - "id": 5, - "lpToken": "0xB949de02e5bB30DaC57460a61aBd4Fcd9c256f18", - "token0": "matic", - "token1": "smatic", - "rewardToken": "sds" - } - ] - }, - { - "masterChef": "0x46C6a9b8E3243FB0dfB069119D5Fc6a75EEc8604", - "reward": "safedollar", - "pools": [ - { - "id": 0, - "lpToken": "0x352db329B707773DD3174859F1047Fb4Fd2030BC", - "token0": "sds", - "rewardToken": "safedollar", - "single": true - } - ] - } - ] -} diff --git a/projects/safedollar/index.js b/projects/safedollar/index.js index 4daf15b48437..fabf82dbde66 100644 --- a/projects/safedollar/index.js +++ b/projects/safedollar/index.js @@ -1,63 +1,6 @@ -const ADDRESSES = require('../helper/coreAssets.json') -const sdk = require('@defillama/sdk'); -const farmUtils = require('./farm-utils'); -/** - * calculate collateral locked in safedollar - */ -const Contracts = { - SafeAssets: [{ - collateralAddress: "0x736Fb0CbB5F55941ecF6A811be4926c2cFa4dD4b", - address: ADDRESSES.polygon.USDC - },{ - collateralAddress: "0xbd75b2a992ea83abed729e60022c9fe8fe539e54", - address: ADDRESSES.polygon.WMATIC_2 - }], - - boardRoom: "0x46C6a9b8E3243FB0dfB069119D5Fc6a75EEc8604", - sds: "0xAB72EE159Ff70b64beEcBbB0FbBE58b372391C54" -} -const polygonTvl = async (timestamp, ethBlock, chainBlocks) => { - // --- Sections of boardroom --- - const stakeboardroom$ = sdk - .api.abi.call({ - target: Contracts.sds, - abi: 'erc20:balanceOf', - chain: 'polygon', - block: chainBlocks['polygon'], - params: [Contracts.boardRoom], - }).then(x => x.output) - - const [farmTvl, sdsStaked] = await Promise.all([ - - farmUtils.polygonFarmLocked(chainBlocks['polygon']), - stakeboardroom$ - ]) - const balances = { - [`polygon:${Contracts.sds}`]: sdsStaked, - }; - // --- Sections of Safe Assets --- - const promises$ = Contracts.SafeAssets.map((item) => { - return sdk - .api.abi.call({ - target: item.address, - abi: 'erc20:balanceOf', - chain: 'polygon', - block: chainBlocks['polygon'], - params: [item.collateralAddress], - }).then(x => { - sdk.util.sumSingleBalance(balances, `polygon:${item.address}`, x.output) - }) - }); - const collateralBalance = await Promise.all(promises$) - for (const [token, balance] of Object.entries(farmTvl)) { - sdk.util.sumSingleBalance(balances, token, balance) - } - return balances -}; - module.exports = { polygon: { - tvl: polygonTvl, + tvl: () => ({}), }, - // broken: 'Api is down, discord seems deserted.', + deadFrom: '2022-04-27', }; \ No newline at end of file diff --git a/projects/serum.js b/projects/serum.js index 0a399c1b0b47..5a6b55ee5818 100644 --- a/projects/serum.js +++ b/projects/serum.js @@ -28,6 +28,7 @@ async function tvl(api) { module.exports = { timetravel: false, + isHeavyProtocol: true, hallmarks: [ [1667826000, "FTX/Alameda collapse"], [1680310800, "Move to onchain data"], diff --git a/projects/starswap-starcoin/index.js b/projects/starswap-starcoin/index.js index ffc84f98a4f2..7c1a82d5a95b 100644 --- a/projects/starswap-starcoin/index.js +++ b/projects/starswap-starcoin/index.js @@ -18,7 +18,6 @@ module.exports = { methodology: `Starswap's TVL is achieved by making a call to it's API: https://swap-api.starcoin.org/main/v1/farmingTvlInUsd (Farming) and https://swap-api.starcoin.org/main/v1/syrupPoolTvlInUsd (Stake).`, misrepresentedTokens: true, timetravel: false, - incentivized: true, starcoin: { tvl, staking, diff --git a/projects/tower-finance/index.js b/projects/tower-finance/index.js index 55db19d0cd09..42e490d44286 100644 --- a/projects/tower-finance/index.js +++ b/projects/tower-finance/index.js @@ -3,5 +3,5 @@ module.exports = { polygon: { tvl: () => ({}), }, - broken: 'website is down, discord link expired, twitter no longer active. Rugged?' + deadFrom: '2022-04-27', } \ No newline at end of file diff --git a/projects/zigzag/index.js b/projects/zigzag/index.js index 1e5c7905e50c..af400ea6a802 100644 --- a/projects/zigzag/index.js +++ b/projects/zigzag/index.js @@ -1,20 +1,6 @@ const ADDRESSES = require('../helper/coreAssets.json') -const { get } = require('../helper/http') -const { toUSDTBalances } = require('../helper/balances') const { sumTokensExport } = require('../helper/unwrapLPs') -async function offers() { - const markets = await get('https://zigzag-exchange.herokuapp.com/api/v1/markets') - const marketInfos = await get('https://zigzag-exchange.herokuapp.com/api/v1/marketinfos?chain_id=1&market=' + Object.keys(markets).join(',')) - let total = 0 - Object.keys(markets).forEach(market => { - const info = marketInfos[market] - const { baseVolume, quoteVolume } = markets[market] - if (!info) return; - total += baseVolume * info.baseAsset.usdPrice + quoteVolume * info.quoteAsset.usdPrice - }) - return toUSDTBalances(total) -} module.exports = { timetravel: false, diff --git a/projects/zilswap.js b/projects/zilswap.js index bdf561a99c3d..a517f2c1a72a 100644 --- a/projects/zilswap.js +++ b/projects/zilswap.js @@ -14,5 +14,4 @@ module.exports = { methodology: `ZilSwap TVL is achieved by making a call to its API: https://stats.zilswap.org/liquidity`, misrepresentedTokens: true, timetravel: false, - incentivized: true, }