forked from DefiLlama/DefiLlama-Adapters
-
Notifications
You must be signed in to change notification settings - Fork 0
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,137 changed files
with
21,366 additions
and
20,985 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
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
Large diffs are not rendered by default.
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,17 +1,19 @@ | ||
const ADDRESSES = require('../helper/coreAssets.json') | ||
const {compoundExports} = require('../helper/compound') | ||
const {compoundExports2} = require('../helper/compound') | ||
|
||
const master0vix = "0x8849f1a0cB6b5D6076aB150546EddEe193754F1C"; | ||
const oMATIC = "0xE554E874c9c60E45F1Debd479389C76230ae25A8"; | ||
const matic = ADDRESSES.polygon.WMATIC_2; | ||
const chain = "polygon"; | ||
|
||
module.exports = { | ||
hallmarks: [ | ||
[Math.floor(new Date('2023-04-28')/1e3), 'Protocol was hacked!'], | ||
[Math.floor(new Date('2023-12-14')/1e3), 'Protocol was migrated to Keom!'], | ||
], | ||
polygon: compoundExports(master0vix, chain, oMATIC, matic), | ||
polygon_zkevm: compoundExports("0x6EA32f626e3A5c41547235ebBdf861526e11f482", "polygon_zkevm", "0xee1727f5074e747716637e1776b7f7c7133f16b1", ADDRESSES.polygon_zkevm.WETH), | ||
polygon: compoundExports2({ comptroller: master0vix, cether: oMATIC, }), | ||
polygon_zkevm: { | ||
tvl: () => ({}), | ||
borrowed: () => ({}), | ||
}, | ||
deadFrom: "2023-12-14", | ||
}; | ||
|
||
delete module.exports.polygon.borrowed | ||
module.exports.polygon.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
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,7 @@ | ||
const { gmxExports } = require('../helper/gmx') | ||
|
||
module.exports = { | ||
scroll: { | ||
tvl: gmxExports({ vault: '0x2C145157e59CfB69a4607643D178B015E6A3004a' }) | ||
}, | ||
}; |
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 ADDRESSES = require('../helper/coreAssets.json'); | ||
const { sumTokensExport } = require('../helper/unwrapLPs'); | ||
const MARKET_1155TECH_CONTRACT = '0x33b77fAf955Ed3eDAf939ae66C4D7a2D78bc30C6'; | ||
|
||
module.exports = { | ||
methodology: 'Value of all Keys across all art markets is TVL in the protocol', | ||
start: 7280880, | ||
canto: { | ||
tvl: sumTokensExport({ owner: MARKET_1155TECH_CONTRACT, tokens: [ADDRESSES.canto.NOTE] }) | ||
} | ||
}; |
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,72 +1,26 @@ | ||
const sdk = require('@defillama/sdk'); | ||
const { default: BigNumber } = require('bignumber.js'); | ||
const Abis = require('./abi.json'); | ||
const {getTokenId} = require('./utils') | ||
|
||
const Contracts = { | ||
moonbeam: { | ||
pools: { | ||
'ob3p': '0x04e274f709e1ae71aff4f994b4267143ec6a381a', | ||
'ob3pbusd': '0x7e758319d46E0A053220e3728B3eE47a1979316a', | ||
}, | ||
ignoredLps: ['0xe7a7dfb89f84a0cf850bcd399d0ec906ab232e9d'], | ||
} | ||
}; | ||
|
||
const poolTvl = async (chain, poolAddress, block) => { | ||
const [balances, tokens] = await Promise.all([ | ||
sdk.api.abi.call({ | ||
target: poolAddress, | ||
abi: Abis.getTokenBalances, | ||
chain: chain, | ||
block, | ||
}), | ||
sdk.api.abi.call({ | ||
target: poolAddress, | ||
abi: Abis.getTokens, | ||
chain: chain, | ||
block, | ||
}), | ||
]); | ||
|
||
const sum = {}; | ||
|
||
tokens.output.forEach((token, i) => { | ||
if ( | ||
Contracts[chain].ignoredLps && | ||
Contracts[chain].ignoredLps.includes(token.toLowerCase()) | ||
) { | ||
return; | ||
} | ||
const [symbol, decimals] = getTokenId(token.toLowerCase()); | ||
sum[symbol] = new BigNumber(balances.output[i]).div(new BigNumber(10).pow(decimals)).toNumber() | ||
} | ||
|
||
const moonbeamTvl = async (timestamp, ethBlock, chainBlocks, { api }) => { | ||
const pools = Object.values(Contracts.moonbeam.pools) | ||
const tokens = await api.multiCall({ abi: Abis.getTokens, calls: pools }) | ||
const bals = await api.multiCall({ abi: Abis.getTokenBalances, calls: pools }) | ||
tokens.forEach((token, i) => { | ||
api.addTokens(token, bals[i]) | ||
}); | ||
|
||
return sum; | ||
}; | ||
|
||
const moonbeamTvl = async (timestamp, ethBlock, chainBlocks) => { | ||
let block = chainBlocks['moonbeam']; | ||
const tvl = {}; | ||
|
||
for (let address of Object.values(Contracts.moonbeam.pools)) { | ||
const balances = await poolTvl( | ||
'moonbeam', | ||
address, | ||
block, | ||
); | ||
|
||
Object.entries(balances).forEach(([token, value]) => { | ||
sdk.util.sumSingleBalance(tvl, token, value); | ||
}); | ||
} | ||
|
||
return tvl; | ||
api.removeTokenBalance('0xe7a7dfb89f84a0cf850bcd399d0ec906ab232e9d') | ||
}; | ||
|
||
module.exports = { | ||
moonbeam: { | ||
tvl: moonbeamTvl, | ||
}, | ||
|
||
}; |
This file was deleted.
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
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.