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 pull request #3 from DefiLlama/main
Sync with origin
- Loading branch information
Showing
441 changed files
with
7,973 additions
and
13,222 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
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
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,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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
const { getUniTVL } = require('../helper/unknownTokens') | ||
|
||
module.exports = { | ||
misrepresentedTokens: true, | ||
avax: { tvl: getUniTVL({ factory: '0x49a5044268A54467a94905d1458A88413695afc1', useDefaultCoreAssets: true, fetchBalances: 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
const ADDRESSES = require('../helper/coreAssets.json') | ||
const { queryV1Beta1 } = require("../helper/chain/cosmos"); | ||
|
||
const accounts = Object.values({ | ||
account1: 'cro1l3weyh4fkneyeatdh6jwp0u0t4qha22ycpnq7r', | ||
account2: 'cro1zqvl7yj0zcqe7p0qnpg0sk94gpa38hzwz8shjn', | ||
account3: 'cro1pduq0ga2ans0sspph6r5hcf77cqypz6de7n64y', | ||
account4: 'cro1fncg0fsr8vt30qaqmzqxunnrkxr6a7xxkfpr7y', | ||
account5: 'cro1hhfh6xaflg8zwhwvrs7sgur2pyfunjqeu8wsd6', | ||
}) | ||
|
||
async function tvl(_, _1, _2, { api }) { | ||
const data = await Promise.all(accounts.map(account => queryV1Beta1({ chain: 'cronos', url: `/staking/v1beta1/delegations/${account}`, }))); | ||
const factroy_contract_address = '0x66f5997b7810723aceeeb8a880846fc117081bd0'; | ||
data.map(i => i.delegation_responses).flat().forEach(i => api.add(ADDRESSES.cronos.WCRO, i.balance.amount * 1e10)) | ||
return api.sumTokens({ owner: factroy_contract_address, tokens: ['0x5c7f8a570d578ed84e63fdfa7b1ee72deae1ae23']}) | ||
} | ||
|
||
module.exports = { | ||
timetravel: false, | ||
methodology: `The TVL is counted as the total delegated CRO and the flexible pool CRO. We query the crypto.org api for the delegations and sum up the CRO being delegated. We query the balanceOf the flexible pool address from WCRO contract`, | ||
cronos: { | ||
tvl, | ||
} | ||
} |
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,38 @@ | ||
const { getOwnerAllAccount, getTokenAccountBalance,getSolBalance } = require('../helper/solana') | ||
const ADDRESSES = require('../helper/coreAssets.json') | ||
|
||
const sdk = require('@defillama/sdk') | ||
const { PublicKey } = require("@solana/web3.js") | ||
|
||
const DROP = 'DropTpWcDmP7kVRUEoKSJaMVi62hGo9jp19Hz19JVsjh'; | ||
const PYTH = 'HZ1JovNiVvGrGNiiYvEozEVgZ58xaU3RKwX8eACQBCt3'; | ||
const PARIMUTUEL_WALLET = 'DCa1Xir4zDEtz78beFcXCHUNXdeBnrxBiRuuapHrBE3F'; | ||
const PARIMUTUEL_ACCOUNT = 'mD62sAqPAiVbHGPTTeEianTYa1AytkKqqcxMvQxF3S3'; | ||
|
||
const predictionTokens = [ | ||
DROP, | ||
PYTH | ||
] | ||
async function tvl(_, _1, _2, { api }) { | ||
|
||
// get the total tokens deposited in the games | ||
const tokensInAccount = await getOwnerAllAccount(PARIMUTUEL_WALLET); | ||
tokensInAccount.forEach((pToken) => { | ||
const total = pToken.uiAmount; | ||
const tokenMint = pToken.mint; | ||
// check to make sure it's one of the tokens used for predicting | ||
if (predictionTokens.includes(tokenMint)) | ||
{ | ||
//sdk.log('#found',tokenMint) | ||
api.add(tokenMint,total); | ||
} | ||
}); | ||
const sols = await getSolBalance(PARIMUTUEL_WALLET); | ||
api.add(ADDRESSES.solana.SOL,sols); | ||
} | ||
|
||
module.exports = { | ||
timetravel: false, | ||
methodology: 'Count the number of tokens that are currently deposited in all the live prediction games', | ||
solana: { tvl, }, | ||
} |
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,4 @@ | ||
const { uniTvlExport } = require('../helper/unknownTokens'); | ||
|
||
module.exports.hallmarks = [[1703808000, "Rug Pull"]] | ||
module.exports = uniTvlExport('beam', '0x671235E91df0A21F319260F9e93Fc459519E163C', { fetchBalances: 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
const { uniTvlExport } = require('../helper/unknownTokens'); | ||
|
||
module.exports = uniTvlExport('zkfair', '0x3582Ccde3F786229CE6Dbd88c5aDb86bF64DAA31', { fetchBalances: 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
const { getUniTVL } = require('../helper/unknownTokens.js') | ||
|
||
module.exports = { | ||
misrepresentedTokens: true, | ||
manta:{ | ||
tvl: getUniTVL({ | ||
useDefaultCoreAssets: true, | ||
hasStablePools: true, | ||
factory: '0x951f08e103570C0385649B24bE892eefFb5Ce067', | ||
}), | ||
}, | ||
} |
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,3 @@ | ||
const { uniTvlExport } = require('../helper/unknownTokens') | ||
|
||
module.exports = uniTvlExport('arbitrum', '0x9fA0988D9e4b6362e0aaA02D1A09196a78c177e1', { fetchBalances: 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
const { uniV3Export } = require('../helper/uniswapV3') | ||
const factory = '0x009c4ef7C0e0Dd6bd1ea28417c01Ea16341367c3' | ||
|
||
module.exports = uniV3Export({ | ||
bsc: { factory, fromBlock: 34184408 } | ||
}) |
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,19 @@ | ||
const { stakings } = require("../helper/staking"); | ||
const { getUniTVL } = require('../helper/unknownTokens') | ||
const masterchefV2Address = '0x2e881a10f682a3b2CBaaF8fc5A9a94E98D4879B4'; // SquadSwap's MasterChef V2 contract | ||
const masterchefV3Address = '0x44eC8143EB368cAbB00c4EfF085AF276260202B5'; // SquadSwap's MasterChef V3 contract | ||
const squadTokenAddress = '0x2d2567dec25c9795117228adc7fd58116d2e310c'; // SquadSwap token contract | ||
|
||
module.exports = { | ||
methodology: "TVL is calculated from total liquidity of SquadSwap's active pools", | ||
bsc: { | ||
tvl: getUniTVL({ | ||
factory: '0x1D9F43a6195054313ac1aE423B1f810f593b6ac1', | ||
useDefaultCoreAssets: true, | ||
}), | ||
staking: stakings([ | ||
masterchefV2Address, | ||
masterchefV3Address, | ||
], squadTokenAddress) | ||
} | ||
}; |
Oops, something went wrong.