Skip to content

Commit 11c4882

Browse files
authored
Merge branch 'DefiLlama:main' into main
2 parents 6e4842e + 91126b7 commit 11c4882

File tree

494 files changed

+8464
-7675
lines changed

Some content is hidden

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

494 files changed

+8464
-7675
lines changed

package-lock.json

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

projects/01/index.js

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,12 @@
1-
const ADDRESSES = require('../helper/coreAssets.json')
2-
const { sumTokens2 } = require('../helper/solana')
1+
const { sumTokensExport } = require('../helper/solana')
32

4-
async function tvl() {
5-
const tokens = [
6-
ADDRESSES.solana.USDC,
7-
ADDRESSES.solana.SOL,
8-
ADDRESSES.solana.USDT,
9-
"7vfCXTUXx5WJV5JADk17DUJ4ksgau7utNKj4b963voxs",
10-
"9n4nbM75f5Ui33ZbPYXn59EwSgE8CGsHtAeTH5YFeJ9E",
11-
"mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So",
12-
"9vMJfxuKxXBoEa7rM12mYLMwTacLMLDJqHozw96WQL8i",
13-
]
14-
const owner = 'HjHSNe8hhvZ8hKCRrhKg1DGiGPd9NYQbUjT1SQRDo4kZ'
15-
16-
return sumTokens2({ owner, tokens })
17-
}
183
module.exports = {
194
hallmarks:[
205
[1667865600, "FTX collapse"]
216
],
227
timetravel: false,
238
solana: {
24-
tvl,
9+
tvl: sumTokensExport({ owner: 'HjHSNe8hhvZ8hKCRrhKg1DGiGPd9NYQbUjT1SQRDo4kZ' }),
2510
},
2611
methodology: `To obtain the tvl we're getting the vault accounts information where user deposited collateral is stored.`,
2712
}

projects/Astra/index.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
const { getUniTVL } = require('../helper/unknownTokens')
2+
3+
const FACTORY = "0x2b6852CeDEF193ece9814Ee99BE4A4Df7F463557" // This factory is on AirDAO Mainnet (Chain Id: 16718)
4+
5+
const dexTVL = getUniTVL({ factory: FACTORY, useDefaultCoreAssets: true, fetchBalances: true, })
6+
7+
module.exports = {
8+
misrepresentedTokens: true,
9+
methodology: `Uses factory(${FACTORY}) address to find and price Liquidity Pool pairs.`,
10+
airdao: {
11+
tvl: dexTVL
12+
}
13+
};

projects/DigiFT/index.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ const sdk = require('@defillama/sdk');
22
//Polygon FeedPrice contract address
33
const DFeedPriceAddress = "0x7d4d68f18d1be3410ab8d827fb7ebc690f938d2d"
44
const tokenListAbi = "function getAllTokenRecords() view returns (tuple(uint256 chainId, address tokenAddress, uint64 tokenType)[])"
5-
5+
66
async function getTokenList(tokenAPI, chainId) {
77
return (await tokenAPI.call({
88
target: DFeedPriceAddress,
99
abi: tokenListAbi
1010
})).filter(item => item[0] == chainId && item[2] == '1').map(item => item[1]);
1111
}
12-
12+
1313
module.exports = {
1414
ethereum: {
1515
tvl: async (api) => {
@@ -19,5 +19,14 @@ module.exports = {
1919
api.addTokens(tokens, tokenSupplies)
2020
return api.getBalances()
2121
}
22+
},
23+
arbitrum: {
24+
tvl: async (api) => {
25+
const tokenAPI = new sdk.ChainApi({ chain: 'polygon', timestamp: api.timestamp, });
26+
const tokens = await getTokenList(tokenAPI, api.chainId)
27+
const tokenSupplies = await api.multiCall({ abi: 'uint256:totalSupply', calls: tokens})
28+
api.addTokens(tokens, tokenSupplies)
29+
return api.getBalances()
30+
}
2231
}
2332
};

projects/DropCopy/index.js

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,10 @@
1-
const { getOwnerAllAccount, getTokenAccountBalance,getSolBalance } = require('../helper/solana')
2-
const ADDRESSES = require('../helper/coreAssets.json')
3-
4-
const sdk = require('@defillama/sdk')
5-
const { PublicKey } = require("@solana/web3.js")
1+
const { sumTokens2 } = require('../helper/solana')
62

73
const DROP = 'DropTpWcDmP7kVRUEoKSJaMVi62hGo9jp19Hz19JVsjh';
8-
const PYTH = 'HZ1JovNiVvGrGNiiYvEozEVgZ58xaU3RKwX8eACQBCt3';
94
const PARIMUTUEL_WALLET = 'DCa1Xir4zDEtz78beFcXCHUNXdeBnrxBiRuuapHrBE3F';
10-
const PARIMUTUEL_ACCOUNT = 'mD62sAqPAiVbHGPTTeEianTYa1AytkKqqcxMvQxF3S3';
11-
12-
const predictionTokens = [
13-
DROP,
14-
PYTH
15-
]
16-
async function tvl(api) {
175

18-
// get the total tokens deposited in the games
19-
const tokensInAccount = await getOwnerAllAccount(PARIMUTUEL_WALLET);
20-
tokensInAccount.forEach((pToken) => {
21-
const total = pToken.uiAmount;
22-
const tokenMint = pToken.mint;
23-
// check to make sure it's one of the tokens used for predicting
24-
if (predictionTokens.includes(tokenMint))
25-
{
26-
//sdk.log('#found',tokenMint)
27-
api.add(tokenMint,total);
28-
}
29-
});
30-
const sols = await getSolBalance(PARIMUTUEL_WALLET);
31-
api.add(ADDRESSES.solana.SOL,sols);
6+
async function tvl() {
7+
return sumTokens2({ owner: PARIMUTUEL_WALLET, solOwners: [PARIMUTUEL_WALLET], blacklistedTokens: [DROP]})
328
}
339

3410
module.exports = {

projects/GajFinance/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ async function stakingAvax(timestamp, ethBlock, chainBlocks) {
1111
}
1212

1313
module.exports = {
14-
broken: 'Api is no longer reachable',
1514
methodology: "TVL comes from NFT Farming, Jungle Pools, MasterChef and Vaults",
1615
avax:{
1716
staking: stakingAvax,

projects/RandomReward/index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
const { sumTokensExport, nullAddress } = require("../helper/unwrapLPs");
2+
3+
const RR_ETHEREUM = '0x5ec1e43163b303b13fea20a892cba7e5568d8a8f';
4+
5+
module.exports = {
6+
methodology: `Total ETH held in the Random Reward contract, available for distribution.`,
7+
ethereum: { tvl: sumTokensExport({ owner: RR_ETHEREUM, tokens: [nullAddress]}), },
8+
};

projects/Solily/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ module.exports = {
55
[1655251200, "Rug Pull"]
66
],
77
timetravel: false,
8+
deadFrom: 1655251200,
89
solana: {
910
tvl: () => 0,
1011
},

projects/aark/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ async function tvl(api) {
55
return api.sumTokens({ owner: VAULT_CONTRACT_ADDRESS, tokens: [
66
ADDRESSES.arbitrum.WETH,
77
ADDRESSES.arbitrum.USDC,
8-
'0x17FC002b466eEc40DaE837Fc4bE5c67993ddBd6F', //FRAX
8+
ADDRESSES.arbitrum.FRAX, //FRAX
99
ADDRESSES.arbitrum.USDC_CIRCLE,
1010
ADDRESSES.arbitrum.WSTETH,
1111
ADDRESSES.arbitrum.DAI,

projects/aave/v3.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
const { aaveChainTvl } = require('../helper/aave');
1+
const { aaveChainTvl, aaveExports } = require('../helper/aave');
22
const methodologies = require('../helper/methodologies');
3+
const { mergeExports } = require('../helper/utils');
34

45
const v3params = ["0x770ef9f4fe897e59daCc474EF11238303F9552b6", undefined, ["0x69FA688f1Dc47d4B5d8029D5a35FB7a548310654"]]
56

@@ -24,13 +25,16 @@ function v3(chain) {
2425
}
2526
}
2627

27-
module.exports = {
28+
module.exports = mergeExports({
2829
methodology: methodologies.lendingMarket,
2930
avax: v3("avax"),
3031
...["optimism", "fantom", "harmony", "arbitrum", "polygon", "ethereum", "metis", "base", "xdai", "scroll", "bsc"].reduce((t, c) => ({ ...t, [c]: v3(c) }), {}),
3132
hallmarks: [
3233
[1659630089, "Start OP Rewards"],
3334
[1650471689, "Start AVAX Rewards"]
3435
],
35-
};
36+
}, {
37+
// Lido pool
38+
ethereum: aaveExports(undefined, "0x770ef9f4fe897e59daCc474EF11238303F9552b6", undefined, ["0xa3206d66cF94AA1e93B21a9D8d409d6375309F4A"], { v3: true, }),
39+
});
3640
// node test.js projects/aave/index.js

0 commit comments

Comments
 (0)