-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'DefiLlama:main' into main
- Loading branch information
Showing
1,679 changed files
with
11,341 additions
and
8,770 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,13 @@ | ||
const { usdCompoundExports } = require("../helper/compound"); | ||
module.exports = { | ||
kcc: usdCompoundExports("0x337d8719f70D514367aBe780F7c1eAd1c0113Bc7", "kcc", "0x309f1639018e8B272126C4B99af442AA25Dcd1F2") | ||
} | ||
const { compoundExports2 } = require('../helper/compound') | ||
|
||
const config = { | ||
kcc: { comptroller: '0x337d8719f70D514367aBe780F7c1eAd1c0113Bc7', cether: '0x309f1639018e8b272126c4b99af442aa25dcd1f2' }, | ||
era: { comptroller: '0x599bb9202EE2D2F95EDe9f88F622854f7ef2c371', cether: '0x9dae6c8c431ffc6d21b836e0d8d113e8365defb9' }, | ||
blast: { comptroller: '0x1DD821C9E27fB2399DAb75AedB113c80C755DCa6', cether: '0xd9fcbd7b60966d013a28ff87925f75bb49e9b5ee' }, | ||
} | ||
|
||
Object.keys(config).forEach(chain => { | ||
module.exports[chain] = compoundExports2(config[chain]) | ||
}) | ||
|
||
module.exports.kcc.borrowed = () => ({}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,104 +1,57 @@ | ||
const ADDRESSES = require('../helper/coreAssets.json') | ||
const { GraphQLClient, gql } = require('graphql-request') | ||
const { getBlock } = require('../helper/http') | ||
const { staking } = require('../helper/staking') | ||
const sdk = require('@defillama/sdk') | ||
|
||
const CONFIG = { | ||
ethereum: { | ||
uri: 'https://api.thegraph.com/subgraphs/name/0xnodes/system11', | ||
strategy_token: ADDRESSES.ethereum.WETH, //wETH | ||
bios_token: '0xAACa86B876ca011844b5798ECA7a67591A9743C8', | ||
kernel_addr: '0xcfcff4eb4799cda732e5b27c3a36a9ce82dbabe0' | ||
}, | ||
bsc: { | ||
uri: 'https://api.thegraph.com/subgraphs/name/0xnodes/system11-bsc', | ||
strategy_token: '0x418D75f65a02b3D53B2418FB8E1fe493759c7605', //wBNB | ||
bios_token: '0xcf87d3d50a98a7832f5cfdf99ae1b88c7cfba4a7', | ||
kernel_addr: '0x37c12de5367fa61ad05e2bf2d032d7ce5dd31793' | ||
}, | ||
polygon: { | ||
uri: 'https://api.thegraph.com/subgraphs/name/0xnodes/system11-polygon', | ||
strategy_token: ADDRESSES.ethereum.MATIC, //wMATIC | ||
bios_token: '0xe20d2df5041f8ed06976846470f727295cdd4d23', | ||
kernel_addr: '0x267720b5d8dcbdb847fc333ccc68cb284648b816' | ||
}, | ||
fantom: { | ||
uri: 'https://api.thegraph.com/subgraphs/name/0xnodes/system11-fantom', | ||
strategy_token: ADDRESSES.ethereum.FTM, //wFTM | ||
bios_token: '0x75e0eb8e6d92ab832bb11e46c041d06a89ac5f0d', | ||
kernel_addr: '0x9db0e84ea53c5a3c000a721bb4295a6053b3de78' | ||
}, | ||
avax: { | ||
uri: 'https://api.thegraph.com/subgraphs/name/0xnodes/system11-avalanche', | ||
strategy_token: '0x85f138bfEE4ef8e540890CFb48F620571d67Eda3', //wAVAX | ||
bios_token: '0xd7783a275e53fc6746dedfbad4a06059937502a4', | ||
kernel_addr: '0x479ea3715682e6255234e788875bdbded6faae41' | ||
}, | ||
metis: { | ||
uri: 'https://andromeda-graph.metis.io/subgraphs/name/0xnodes/System11-metis', | ||
strategy_token: '0x9E32b13ce7f2E80A01932B42553652E053D6ed8e', //METIS | ||
bios_token: '0x3405a1bd46b85c5c029483fbecf2f3e611026e45', | ||
kernel_addr: '0xa1DA47F6563e7B17075FcA61DeDC4622aE2F3912' | ||
}, | ||
} | ||
function offset(chain) { | ||
switch (chain) { | ||
case 'ethereum': | ||
return 110 | ||
case 'bsc': | ||
return 600 | ||
case 'polygon': | ||
return 750 | ||
case 'fantom': | ||
return 1500 | ||
case 'metis': | ||
return 500 | ||
case 'avax': | ||
return 750 | ||
} | ||
} | ||
function chainTvl(chain) { | ||
return async (timestamp, ethBlock, chainBlocks) => { | ||
if (timestamp > 1659527340) return {} | ||
const { [chain]:{ uri }} = CONFIG | ||
const { [chain]:{ strategy_token }} = CONFIG | ||
var graphQLClient = new GraphQLClient(uri) | ||
const block = (await getBlock(timestamp, chain, chainBlocks)) - offset(chain) | ||
var query = gql`{strategyTokenBalances(block: {number: `+block+`}){amount}}` | ||
const results = await graphQLClient.request(query) | ||
let amount = 0 | ||
for (let i = 0; i < results.strategyTokenBalances.length; i++) { //loop through the array | ||
amount += Number(results.strategyTokenBalances[i].amount); //Do the math! | ||
} | ||
const balances = {} | ||
sdk.util.sumSingleBalance(balances, strategy_token, amount) | ||
return balances | ||
} | ||
} | ||
|
||
function stakingTvl(chain) { | ||
const { [chain]:{ bios_token }} = CONFIG | ||
const { [chain]:{ kernel_addr }} = CONFIG | ||
return staking(kernel_addr, bios_token, chain) | ||
return staking(kernel_addr, bios_token) | ||
} | ||
function chainExports(chainTvl, stakingTvl, chains){ | ||
|
||
function chainExports(chains){ | ||
const chainTvls = chains.reduce((obj, chain) => ({ | ||
...obj, | ||
[chain]: { | ||
tvl:chainTvl(chain), | ||
tvl: () => ({}), | ||
staking: stakingTvl(chain) | ||
} | ||
}), {}) | ||
return chainTvls | ||
} | ||
const tvlExports = chainExports(chainTvl, stakingTvl , ['ethereum', 'bsc', 'polygon', 'fantom', 'metis', 'avax']) | ||
const tvlExports = chainExports(['ethereum', 'bsc', 'polygon', 'fantom', 'metis', 'avax']) | ||
module.exports = { | ||
hallmarks: [ | ||
[1659527340, "Protocol declared insolvent"], | ||
], | ||
methodology: ` Counts the number of wrapped native tokens in all yield strategies across all the chains the protocol is deployed on | ||
+ staking counts the number of BIOS tokens staked in the kernels across all the chains (PFA: Protocol Fee Accruals by staking assets)`, | ||
start: 1633046400, // Friday 1. October 2021 00:00:00 GMT | ||
...tvlExports | ||
...tvlExports, | ||
deadFrom: 1659527340, | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
const { sumTokensExport } = require("../helper/unwrapLPs"); | ||
|
||
const tokens = require("../helper/coreAssets.json"); | ||
|
||
const TOKENS = [ | ||
tokens.null, | ||
]; | ||
|
||
const ethereumContract = [ | ||
"0x66be1bc6C6aF47900BBD4F3711801bE6C2c6CB32", | ||
]; | ||
|
||
module.exports = { | ||
ethereum: { tvl: sumTokensExport({ owners: ethereumContract, tokens: TOKENS }) } | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
const { getUniTVL } = require("../helper/unknownTokens"); | ||
module.exports = { | ||
misrepresentedTokens: true, | ||
|
||
blast: { | ||
tvl: getUniTVL({ | ||
factory: "0x27C429dfF0e6d3B43B2C404C35f58C2b36cef916", | ||
useDefaultCoreAssets: true, | ||
}), | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
const { compoundExports2 } = require('../helper/compound'); | ||
|
||
module.exports = { | ||
blast: compoundExports2({ | ||
comptroller: '0xe20cE0Db739e4B6Afa9989c87bE7C8C25cbeB5Ea', | ||
cether: '0x29e15766d6b203C35c2D51AAEc4Cf964129Af088', | ||
}), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
const ADDRESSES = require('../helper/coreAssets.json') | ||
const { sumTokensExport } = require('../helper/unknownTokens') | ||
const WETH = ADDRESSES.blast.WETH | ||
const BLNYAN = '0x9aAC39ca368D27bf03887CCe32f28b44F466072F' | ||
const BLNYAN_WETH_SLP = '0x0E9309f32881899F6D4aC2711c6E21367A84CA26' | ||
|
||
const stakingBLNYANContract = '0xA76D6dc805d0EbEcb3787c781ce3A18feEF020cb' | ||
const feeDistro = '0xBC8a7a845cC7A8246EB34856Afe6f1a3d62BD9C6' | ||
const stakeLpEarnWeth = '0xF63Ef9F4320f9d16731a40ff1f58a966ee086806' | ||
const button = '0x00066Ed6c2F7d6CC6e66c678BaEE2C8683B632e6' | ||
const lockPoints = '0x46B3a66ef4fAC801B455884035eF2862F01e6158' | ||
const opts = { useDefaultCoreAssets: true, lps: [BLNYAN_WETH_SLP] } | ||
|
||
module.exports = { | ||
misrepresentedTokens: true, | ||
blast: { | ||
tvl: sumTokensExport({ | ||
owners: [lockPoints, feeDistro, button], | ||
tokens: [WETH], | ||
...opts, | ||
}), | ||
pool2: sumTokensExport({ | ||
...opts, | ||
owners: [stakeLpEarnWeth], | ||
tokens: [BLNYAN_WETH_SLP], | ||
}), | ||
staking: sumTokensExport({ | ||
owners: [stakingBLNYANContract, lockPoints], | ||
tokens: [BLNYAN], | ||
...opts, | ||
}), | ||
}, | ||
methodology: | ||
'Counts as TVL the ETH only. blNYAN and LP assets deposited are counted as Pool2 and staking Respectively', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
const { uniV3Export } = require("../helper/uniswapV3"); | ||
const { mergeExports } = require('../helper/utils') | ||
|
||
module.exports = mergeExports([ | ||
uniV3Export({ blast: { factory: "0x9792FaeA53Af241bCE57C7C8D6622d5DaAD0D4Fc", fromBlock: 693561, }, }), | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.