Skip to content

Commit 7d730d3

Browse files
authored
Merge branch 'DefiLlama:main' into main
2 parents 319bb81 + 14130ab commit 7d730d3

File tree

220 files changed

+4408
-1477
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

220 files changed

+4408
-1477
lines changed

.prettierrc

Lines changed: 0 additions & 1 deletion
This file was deleted.

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

projects/0xscans/index.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
const { sumTokensExport } = require('../helper/unknownTokens')
2+
3+
const zeroxscans = "0x10703cA5e253306e2ABABD68e963198be8887c81"
4+
const stakingPool = "0x67a37e939A46eFFd65A91949eC7c8587BD82aAa7"
5+
6+
module.exports = {
7+
ethereum: {
8+
tvl: () => ({}),
9+
staking: sumTokensExport({ owners: [stakingPool], tokens: [zeroxscans] }),
10+
},
11+
methodology:
12+
"Counts all 0xScans tokens in the staking pools",
13+
};

projects/21-co/index.js

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
const { cexExports } = require('../helper/cex')
2+
3+
const config = {
4+
bitcoin: {
5+
owners: [
6+
'1HTGi4tfXSEtcXD4pk6S3vBs3s64hWY1pW'
7+
],
8+
},
9+
solana: {
10+
owners: [
11+
'FvLsZiM3g2ZnehkK42c4EoLASBdchKnqzxyAEmGhViZq'
12+
],
13+
},
14+
ripple: {
15+
owners: [
16+
'rHTG5htCXSNtcXDhFkaSsvB1s1ah6WYrFW'
17+
],
18+
},
19+
litecoin: {
20+
owners: [
21+
'LbgDyHCVc6UwsKuDzt5jKwFdG5TLsN5tbf'
22+
],
23+
},
24+
polkadot: {
25+
owners: [
26+
'161fEUkrGhhAog8QG1ik3sfch9UzPdvAJtUwRH6WZnsgqkuw'
27+
],
28+
},
29+
cardano: {
30+
owners: [
31+
'addr1q976xcl3r2vt6he4q3rq6lyq8832v5mgpdds0e84z7vn0hma5d3lzx5ch40n2pzxp47gqw0z5efksz6mqlj029uexl0snqdsul'
32+
],
33+
},
34+
/*
35+
doge: {
36+
owners: [
37+
'DMbNFKqJpr9B9XPfZL5zbgMTvzpN7h7sfz'
38+
],
39+
}, */
40+
bep2: {
41+
owners: [
42+
'bnb1k3ulpgw4wzl0e8qx80u87aq9w7ekfygruzs4dg'
43+
],
44+
},
45+
/* bitcoin_cash: {
46+
owners: [
47+
'qz68nu9p64ctalyuqcalslm5q4mmxey3qvr4y9mgt8'
48+
],
49+
} */
50+
}
51+
52+
module.exports = cexExports(config)

projects/BlastNYAN/index.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
const { sumTokensExport } = require('../helper/unknownTokens')
2+
const WETH = '0x4300000000000000000000000000000000000004'
3+
const BLNYAN = '0x9aAC39ca368D27bf03887CCe32f28b44F466072F'
4+
const BLNYAN_WETH_SLP = '0x0E9309f32881899F6D4aC2711c6E21367A84CA26'
5+
6+
const stakingBLNYANContract = '0xA76D6dc805d0EbEcb3787c781ce3A18feEF020cb'
7+
const feeDistro = '0xBC8a7a845cC7A8246EB34856Afe6f1a3d62BD9C6'
8+
const stakeLpEarnWeth = '0x0a3A757BE3049C2d9444d025E98D37b2a81a0a32'
9+
const button = '0x00066Ed6c2F7d6CC6e66c678BaEE2C8683B632e6'
10+
const opts = { useDefaultCoreAssets: true, lps: [BLNYAN_WETH_SLP] }
11+
12+
module.exports = {
13+
misrepresentedTokens: true,
14+
blast: {
15+
tvl: sumTokensExport({ owners: [feeDistro, button], tokens: [WETH], ...opts, }),
16+
pool2: sumTokensExport({ ...opts, owners: [stakeLpEarnWeth], tokens: [BLNYAN_WETH_SLP], }),
17+
staking: sumTokensExport({ owners: [stakingBLNYANContract], tokens: [BLNYAN], ...opts, }),
18+
},
19+
methodology:
20+
'Counts as TVL the ETH, blNYAN and LP assets deposited through-out the protocol',
21+
}

projects/MeowProtocol/index.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
const { sumTokens2 } = require('../helper/unwrapLPs')
2+
3+
const config = {
4+
ethereum: '0x9aE578d5ad69B051E6FbC7EBB18A12C2D459D914',
5+
scroll: '0x4b71CAF14Cf8529101498976C44B8445797A5886'
6+
}
7+
8+
Object.keys(config).forEach(chain => {
9+
const lendingPoolCore = config[chain]
10+
module.exports[chain] = {
11+
tvl: async (_, _b, _cb, { api, }) => {
12+
const tokens = await api.call({ abi: 'address[]:getReserves', target: lendingPoolCore })
13+
return sumTokens2({api, tokens, owner: lendingPoolCore })
14+
},
15+
borrowed: async (_, _b, _cb, { api, }) => {
16+
const tokens = await api.call({ abi: 'address[]:getReserves', target: lendingPoolCore })
17+
const bals = await api.multiCall({ abi: "function getReserveTotalBorrows(address _reserve) view returns (uint256)", target: lendingPoolCore, calls: tokens })
18+
api.add(tokens, bals)
19+
return api.getBalances()
20+
}
21+
}
22+
})

projects/SecuredFinance/index.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
const config = {
2+
ethereum: {},
3+
arbitrum: {},
4+
avax: {},
5+
polygon_zkevm: {
6+
tokenVault: '0x0896AC8B9e2DC3545392ff65061E5a8a3eD68824',
7+
currencyController: '0x9E1254292195F241FA2DF1aA51af23796627A74B',
8+
},
9+
};
10+
11+
Object.keys(config).forEach(chain => {
12+
const {
13+
tokenVault = '0xB74749b2213916b1dA3b869E41c7c57f1db69393',
14+
currencyController = '0x7dca6b6BF30cd28ADe83e86e21e82e3F852bF2DC',
15+
} = config[chain];
16+
module.exports[chain] = {
17+
tvl: async (_, _b, _cb, { api }) => {
18+
const bytes = await api.call({
19+
abi: 'function getCurrencies() view returns (bytes32[])',
20+
target: currencyController,
21+
});
22+
const tokens = await api.multiCall({
23+
abi: 'function getTokenAddress(bytes32) view returns (address)',
24+
calls: bytes,
25+
target: tokenVault,
26+
});
27+
return api.sumTokens({ owner: tokenVault, tokens });
28+
},
29+
};
30+
});

projects/abracadabra/index.js

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const abi = require('./abi.json');
99
const bentoBoxAddresses = {
1010
"arbitrum": ["0x74c764D41B77DBbb4fe771daB1939B00b146894A", "0x7c8fef8ea9b1fe46a7689bfb8149341c90431d38"],
1111
"avax": ["0xf4F46382C2bE1603Dc817551Ff9A7b333Ed1D18f", "0x1fC83f75499b7620d53757f0b01E2ae626aAE530"],
12+
"blast": ["0xC8f5Eb8A632f9600D1c7BC91e97dAD5f8B1e3748"],
1213
"bsc": ["0x090185f2135308BaD17527004364eBcC2D37e5F6"],
1314
"ethereum": ["0xF5BCE5077908a1b7370B9ae04AdC565EBd643966", "0xd96f48665a1410C0cd669A88898ecA36B9Fc2cce"],
1415
"fantom": ["0xF5BCE5077908a1b7370B9ae04AdC565EBd643966", "0x74A0BcA2eeEdf8883cb91E37e9ff49430f20a616"],
@@ -21,6 +22,7 @@ const underlyingTokens = {
2122
"0x3477Df28ce70Cecf61fFfa7a95be4BEC3B3c7e75": "0x5402B5F40310bDED796c7D0F3FF6683f5C0cFfdf",
2223
},
2324
avax: {},
25+
blast: {},
2426
bsc: {},
2527
ethereum: {
2628
"0x5958A8DB7dfE0CC49382209069b00F54e17929C2": "0x903C9974aAA431A765e60bC07aF45f0A1B3b61fb",
@@ -32,6 +34,16 @@ const underlyingTokens = {
3234
optimism: {},
3335
};
3436

37+
const liquidityLaunchEvents = {
38+
blast: {
39+
contractAddress: "0xa64B73699Cc7334810E382A4C09CAEc53636Ab96",
40+
supportedTokens: [
41+
"0x4300000000000000000000000000000000000003", // USDb
42+
// "0x76DA31D7C9CbEAE102aff34D3398bC450c8374c1", // MIM
43+
]
44+
},
45+
};
46+
3547
async function tvl(_, _1, _2, { api }) {
3648
const { chain } = api
3749
const marketsArray = [];
@@ -49,13 +61,20 @@ async function tvl(_, _1, _2, { api }) {
4961
).flat()
5062
const bals = await api.multiCall({ calls, abi: abi.balanceOf, })
5163
api.addTokens(tokens, bals)
64+
65+
const liquidityLaunchEvent = liquidityLaunchEvents[chain];
66+
if (liquidityLaunchEvent)
67+
await api.sumTokens({ owner: liquidityLaunchEvent.contractAddress, tokens: liquidityLaunchEvent.supportedTokens })
68+
69+
70+
5271
return api.getBalances()
5372
}
5473

55-
const chains = ['arbitrum', 'avax', 'bsc', 'ethereum', 'fantom', 'kava', 'optimism'];
74+
const chains = ['arbitrum', 'avax', 'blast', 'bsc', 'ethereum', 'fantom', 'kava', 'optimism'];
5675
chains.forEach(chain => module.exports[chain] = { tvl }),
57-
module.exports.hallmarks = [
58-
[1651881600, "UST depeg"],
59-
[1643245200, "0xSifu revealed as QuadrigaCX founder"],
60-
[1667826000, "FTX collapse, Alameda repays FTT loans"],
61-
]
76+
module.exports.hallmarks = [
77+
[1651881600, "UST depeg"],
78+
[1643245200, "0xSifu revealed as QuadrigaCX founder"],
79+
[1667826000, "FTX collapse, Alameda repays FTT loans"],
80+
]

projects/abracadabra/market.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
"0x2450Bf8e625e98e14884355205af6F97E3E68d07": "0x781655d802670bbA3c89aeBaaEa59D3182fD755D",
2222
"0x56984F04d2d04B2F63403f0EbeDD3487716bA49d": "0x0da67235dD5787D67955420C84ca1cEcd4E5Bb3b"
2323
},
24+
"blast": {
25+
"0x79e8CAd80E2aA49A246B789584C45aAB1CFe402e": "0x4300000000000000000000000000000000000004"
26+
},
2427
"bsc": {
2528
"0x692CF15F80415D83E8c0e139cAbcDA67fcc12C90": "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",
2629
"0xF8049467F3A9D50176f4816b20cDdd9bB8a93319": "0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82"
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
const { covalentGetTokens } = require('../helper/token')
2+
const { getWhitelistedTokens } = require('../helper/streamingHelper')
3+
4+
const config = {
5+
linea: { owners: ['0xD2AA294B9A5097F4A09fd941eD0bE665bd85Eab2'], },
6+
}
7+
8+
module.exports = {
9+
methodology: "TVL is based on the active balances of assets deposited at the V2 stream vaults for token streaming and vesting.",
10+
}
11+
12+
Object.keys(config).forEach(chain => {
13+
const { owners } = config[chain]
14+
module.exports[chain] = {
15+
tvl: tvl(false),
16+
vesting: tvl(true),
17+
}
18+
19+
function tvl(isVesting) {
20+
return async (_, _1, _2, { api }) => {
21+
const tokens = (await Promise.all(owners.map(i => covalentGetTokens(i, api, { onlyWhitelisted: false, })))).flat()
22+
return api.sumTokens({ owners, tokens: await getWhitelistedTokens({ api, tokens, isVesting})})
23+
}
24+
}
25+
})

0 commit comments

Comments
 (0)