Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…pters into desyn
  • Loading branch information
santinoYoung committed Jul 20, 2024
2 parents 1ccf6a9 + c679703 commit a256542
Show file tree
Hide file tree
Showing 140 changed files with 2,198 additions and 1,088 deletions.
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 23 additions & 16 deletions projects/accumulated-finance/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,24 +37,31 @@ const config = {
}
],
"zeta": [
{
"zeta": {
"baseToken": '0xf091867ec603a6628ed83d274e835539d82e9cc8',
"LST": '0xcba2aeec821b0b119857a9ab39e09b034249681a'
}
},
{
"bsc": {
"baseToken": "0xf091867ec603a6628ed83d274e835539d82e9cc8",
"LST": "0xcf123d8638266629fb02fc415ad47bd47de01a6b"
{
"zeta": {
"baseToken": '0xf091867ec603a6628ed83d274e835539d82e9cc8',
"LST": '0xcba2aeec821b0b119857a9ab39e09b034249681a'
}
},
{
"bsc": {
"baseToken": "0xf091867ec603a6628ed83d274e835539d82e9cc8",
"LST": "0xcf123d8638266629fb02fc415ad47bd47de01a6b"
},
},
},
{
"ethereum": {
"baseToken": "0xf091867ec603a6628ed83d274e835539d82e9cc8",
"LST": "0xf38feedb0c85c1e1d6864c7513ac646d28bb0cfc"
{
"ethereum": {
"baseToken": "0xf091867ec603a6628ed83d274e835539d82e9cc8",
"LST": "0xf38feedb0c85c1e1d6864c7513ac646d28bb0cfc"
}
},
],
"sei": [
{
"sei": {
"LST": "0xcba2aeec821b0b119857a9ab39e09b034249681a"
},
}
},
]
}

Expand Down
11 changes: 2 additions & 9 deletions projects/agentfi/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@ async function tvl(api) {
const blasterswapv2 = dexBalancerAgents.map(i => [uniV2Lp.blasterswap, i.agentAddress])
const ringv2 = dexBalancerAgents.map(i => [uniV2Lp.ring, i.agentAddress])

const blasterswapV3 = concentratedLiquidityAgents.map(i => [uniV3NftManager.blasterswap, i.agentAddress])
const blasterswap2V3 = concentratedLiquidityAgents.map(i => [uniV3NftManager.blasterswap2, i.agentAddress])
const thrusterV3 = concentratedLiquidityAgents.map(i => [uniV3NftManager.thruster, i.agentAddress])

const agents = concentratedLiquidityAgents.map(i => i.agentAddress)
await sumTokens2({ api, owners: agents, uniV3ExtraConfig: { nftAddress: [uniV3NftManager.blasterswap, uniV3NftManager.blasterswap2, uniV3NftManager.thruster]}})

await getTvlForDexBalancer(dexBalancerAgents.map(i => i.agentAddress), api)
await getTvlForLooperWithOrbit(looperAgentsAddresses, api)
Expand All @@ -33,11 +31,6 @@ async function tvl(api) {
...blasterswapv2,
...ringv2,
],
uniV3nftsAndOwners: [
...blasterswapV3,
...blasterswap2V3,
...thrusterV3
],
resolveLP: true,
api,
})
Expand Down
24 changes: 24 additions & 0 deletions projects/airdao-bridge/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const { sumTokensExport, nullAddress } = require("../helper/unwrapLPs");
const ADDRESSES = require('../helper/coreAssets.json')

const CHAINS = {
ethereum: {
locker: "0x0De2669e8A7A6F6CC0cBD3Cf2D1EEaD89e243208",
tokens: [ADDRESSES.ethereum.USDC, ADDRESSES.ethereum.USDT, ADDRESSES.ethereum.WETH]
},
bsc: {
locker: "0x92fa52d3043725D00Eab422440C4e9ef3ba180d3",
tokens: [ADDRESSES.bsc.USDC, ADDRESSES.bsc.USDT, ADDRESSES.bsc.WBNB, ADDRESSES.bsc.BUSD]
},
}

module.exports = {
methodology:
"Adds up the total value locked as collateral on the Bridge platform"
}

Object.keys(CHAINS).forEach(chain => {
module.exports[chain] = {
tvl: sumTokensExport({ owner: CHAINS[chain].locker, tokens: CHAINS[chain].tokens })
}
})
11 changes: 7 additions & 4 deletions projects/alexar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,26 @@ const chainMapping = {
};

const chainListSupply = ['juno', 'cosmos', 'comdex', 'carbon', 'crescent', 'injective', 'kujira', 'osmosis', 'persistence', 'stargaze', 'secret', 'stargaze', 'umee', 'evmos', 'terra2'];
const chainListTotal = ['avax', 'bsc', 'moonbeam', 'polygon', 'fantom', 'arbitrum', 'aurora', 'celo', 'kava', 'mantle', 'ethereum',];
const chainListTotal = ['avax', 'bsc', 'moonbeam', 'polygon', 'fantom', 'arbitrum', 'aurora', 'celo', 'kava', 'mantle', 'ethereum', 'base'];


chainListSupply.concat(chainListTotal).forEach(chain => {
module.exports[chain] = { tvl };
async function tvl(api) {
const config = await getConfig('alexar', 'https://api.axelarscan.io/cross-chain/tvl')
const config = await getConfig('alexar', 'https://api.axelarscan.io/api/getTVL')
const tokensAndOwners = []
const owners = []
const mappedChain = chainMapping[chain] || chain;
config.data.forEach(({ tvl: { [mappedChain]: assetTvl } = {} }) => {
if (!assetTvl) return;

const isEVM = assetTvl.gateway_address?.startsWith('0x')
const data = assetTvl.contract_data
if (isEVM) {
if (assetTvl.contract_data.symbol.startsWith('axl')) return;
tokensAndOwners.push([assetTvl.contract_data.address, assetTvl.gateway_address])
if (data.symbol.startsWith('axl')) return;
tokensAndOwners.push([data.address, assetTvl.gateway_address])
if (data.token_manager_address)
tokensAndOwners.push([data.address, data.token_manager_address])
} else {
if (assetTvl.denom_data.symbol.startsWith('axl')) return;
owners.push(...assetTvl.source_escrow_addresses)
Expand Down
27 changes: 20 additions & 7 deletions projects/alien-finance/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
const owner = "0x50454acC07bf8fC78100619a1b68e9E8d28cE022"
const DAPP_POOL = "0x50454acC07bf8fC78100619a1b68e9E8d28cE022"
const BLAST_POOL = "0x02B7BF59e034529d90e2ae8F8d1699376Dd05ade"
const BLAST_POOL_LAUNCH = 1719390003

module.exports = {
blast: {
Expand All @@ -8,11 +10,22 @@ module.exports = {
};

async function tvl(api) {
const tokens = await api.call({ abi: 'address[]:getAllMarkets', target: owner})
return api.sumTokens({ owner, tokens})
const dappPoolTokens = await api.call({ abi: 'address[]:getAllMarkets', target: DAPP_POOL});
const blastPoolTokens = api.timestamp > BLAST_POOL_LAUNCH ? await api.call({ abi: 'address[]:getAllMarkets', target: BLAST_POOL}) : [];

return api.sumTokens({ tokensAndOwners: [
...dappPoolTokens.map(token => [token, DAPP_POOL]),
...blastPoolTokens.map(token => [token, BLAST_POOL]),
] })
}
async function borrowed(api) {
const tokens = await api.call({ abi: 'address[]:getAllMarkets', target: owner})
const bals = await api.multiCall({ abi: 'function getTotalBorrow(address) view returns (uint256)', calls: tokens, target: owner})
api.add(tokens, bals)
}
const dappPoolTokens = await api.call({ abi: 'address[]:getAllMarkets', target: DAPP_POOL});
const dappPoolBorrow = await api.multiCall({ abi: 'function getTotalBorrow(address) view returns (uint256)', calls: dappPoolTokens, target: DAPP_POOL})
api.add(dappPoolTokens, dappPoolBorrow)

if (api.timestamp > BLAST_POOL_LAUNCH) {
const blastPoolTokens = await api.call({ abi: 'address[]:getAllMarkets', target: BLAST_POOL});
const blastPoolBorrow = await api.multiCall({ abi: 'function getTotalBorrow(address) view returns (uint256)', calls: blastPoolTokens, target: BLAST_POOL})
api.add(blastPoolTokens, blastPoolBorrow)
}
}
9 changes: 9 additions & 0 deletions projects/anzen-v2/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const sdk = require('@defillama/sdk')
const USDz = '0xa469b7ee9ee773642b3e93e842e5d9b5baa10067';
const Base_USDz = '0x04d5ddf5f3a8939889f11e97f8c4bb48317f1938';
const Blast_USDz = '0x52056ed29fe015f4ba2e3b079d10c0b87f46e8c6';
const Manta_USDz = '0x73d23f3778a90be8846e172354a115543df2a7e4';
const SPCT = '0xf30a29f1c540724fd8c5c4be1af604a6c6800d29'; // Secured collateral

const mainnet_tvl = async (api) => {
Expand All @@ -22,6 +23,11 @@ const blast_tvl = async (api) => {
api.add(Blast_USDz, supply)
}

const manta_tvl = async (api) => {
const supply = await api.call({ abi: 'erc20:totalSupply', target: Manta_USDz })
api.add(Manta_USDz, supply)
}

const collateral_assets = async (api) => {
const supply = await api.call({ abi: 'erc20:totalSupply', target: SPCT })
api.add(SPCT, supply)
Expand All @@ -38,4 +44,7 @@ module.exports = {
blast: {
tvl: blast_tvl,
},
manta: {
tvl: manta_tvl,
},
};
2 changes: 1 addition & 1 deletion projects/augmented-finance/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const config = {

module.exports = {
methodology: methodologies.lendingMarket,
// deadFrom: 2024-02-22
deadFrom: "2024-02-22"
};

Object.keys(config).forEach(chain => {
Expand Down
3 changes: 3 additions & 0 deletions projects/augur/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,7 @@ module.exports = {
ethereum: {
tvl,
},
hallmarks:[
[1613091600, "Election market resolves"]
]
}
15 changes: 15 additions & 0 deletions projects/aurus/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const ASSETS = [
'0xe4a6f23fb9e00fca037aa0ea0a6954de0a6c53bf', // TXAU - gold
'0x34abce75d2f8f33940c721dca0f562617787bff3', // TXAG - silver
'0x19b22dbadc298c359a1d1b59e35f352a2b40e33c' // TXPT - platinum
]

module.exports = {
methodology: "TVL corresponds to the total amount of Assets minted",
ethereum: {
tvl: async (api) => {
const totalSupplies = await api.multiCall({calls: ASSETS, abi: 'erc20:totalSupply'})
api.add(ASSETS, totalSupplies)
}
}
}
3 changes: 2 additions & 1 deletion projects/avalon-finance/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ const mainMarket = {
}

const innovativeMarket = {
merlin: aaveExports('', '0x91b212e9FaF20117Eae59d6289CB38749DDFc070', undefined, ['0x883cb2E2d9c5D4D9aF5b0d37fc39Fa2284405682'],{v3: true}),
merlin: aaveExports('', '0x91b212e9FaF20117Eae59d6289CB38749DDFc070', undefined, ['0x883cb2E2d9c5D4D9aF5b0d37fc39Fa2284405682'], { v3: true }),
btr: aaveExports('', '0x90EA8C92AddE4D3f323Dad9E36f0E0395dbc929d', undefined, ['0x4c25c261Fe47bC216113D140BaF72B05E151bcE4'], { v3: true }),
}

module.exports = mergeExports(mainMarket, innovativeMarket)
Expand Down
7 changes: 5 additions & 2 deletions projects/betfolio/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ const config = {
}

async function getContracts() {
const { data: { list } } = await getConfig('betfolio', 'https://api.betfolio.co/api/v1/user/predictionList?limit=1000&duration=&type=')
return list.map(i => i.contract_address)
const [list0Res, list1Res] = await Promise.all([
getConfig('betfolio', 'https://api.betfolio.co/api/v1/user/predictionList?limit=1000&duration=&type='),
getConfig('betfolioSoloPrediction', 'https://api.betfolio.co/api/v1/user/getSoloPredictions?limit=1000&type=All&theme=All&solo_type=All')
]);
return [...list0Res.data.list, ...list1Res.data.list].map(i => i.contract_address)
}

Object.keys(config).forEach(chain => {
Expand Down
25 changes: 25 additions & 0 deletions projects/binance/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,7 @@ const assetList = [
['USDC', 'ARB', '0xf977814e90da44bfa03b6295a0616a897441acec'],
['USDC', 'AVAX', '0x4aefa39caeadd662ae31ab0ce7c8c2c9c0a013e8'],
['USDC', 'AVAX', '0x9f8c163cba728e99993abe7495f06c0a3c8ac8b9'],
['AVAX', 'AVAX', '0x835678a611b28684005a5e2233695fb6cbbb0007'],
['USDC', 'BEP2', 'bnb1fnd0k5l4p3ck2j9x9dp36chk059w977pszdgdz'],
['USDC', 'BEP2', 'bnb1u2agwjat20494fmc6jnuau0ls937cfjn4pjwtn'],
['USDC', 'BEP20', '0x0e4158c85ff724526233c1aeb4ff6f0c46827fbe'],
Expand Down Expand Up @@ -593,6 +594,30 @@ const assetList = [
['XRP', 'XRP', 'rhWj9gaovwu2hZxYW7p388P8GRbuXFLQkK'],
['XRP', 'XRP', 'rpmxpWis42eYV4oMhyxJNSzrLRdacJVooa'],
['XRP', 'XRP', 'rs8ZPbYqgecRcDzQpJYAMhSxSi5htsjnza'],
['USDT', 'ETH', '0x835678a611b28684005a5e2233695fb6cbbb0007'],
['ETH', 'ETH', '0x835678a611b28684005a5e2233695fb6cbbb0007'],
['ETH', 'ARB', '0xf92402bb795fd7cd08fb83839689db79099c8c9c'],
['AVAX', 'AVAX', '0x978b21a854dbefcd6d51dfd269875d158046240b'],
['USDC', 'AVAX', '0x978b21a854dbefcd6d51dfd269875d158046240b'],
['USDT', 'AVAX', '0x978b21a854dbefcd6d51dfd269875d158046240b'],
['AVAX', 'AVAX', '0xcddc5d0ebeb71a08fff26909aa6c0d4e256b4fe1'],
['USDC', 'AVAX', '0xcddc5d0ebeb71a08fff26909aa6c0d4e256b4fe1'],
['USDT', 'AVAX', '0xcddc5d0ebeb71a08fff26909aa6c0d4e256b4fe1'],
['AVAX', 'AVAX', '0x6d8be5cdf0d7dee1f04e25fd70b001ae3b907824'],
['USDC', 'AVAX', '0x6d8be5cdf0d7dee1f04e25fd70b001ae3b907824'],
['USDT', 'AVAX', '0x6d8be5cdf0d7dee1f04e25fd70b001ae3b907824'],
['AVAX', 'AVAX', '0x3bce63c6c9abf7a47f52c9a3a7950867700b0158'],
['USDC', 'AVAX', '0x3bce63c6c9abf7a47f52c9a3a7950867700b0158'],
['USDT', 'AVAX', '0x3bce63c6c9abf7a47f52c9a3a7950867700b0158'],
['AVAX', 'AVAX', '0xaba2d404c5c41da5964453a368aff2604ae80a14'],
['USDC', 'AVAX', '0xaba2d404c5c41da5964453a368aff2604ae80a14'],
['USDT', 'AVAX', '0xaba2d404c5c41da5964453a368aff2604ae80a14'],
['ETH', 'BASE', '0x3304e22ddaa22bcdc5fca2269b418046ae7b566a'],
['USDC', 'BASE', '0x3304e22ddaa22bcdc5fca2269b418046ae7b566a'],
['ETH', 'ETH', '0x1b46970cfe6a271e884f636663c257a5a571fb2c'],
['MATIC', 'MATIC', '0x505e71695e9bc45943c58adec1650577bca68fd9'],
['USDT', 'MATIC', '0x505e71695e9bc45943c58adec1650577bca68fd9'],
['USDT', 'TRX', 'TRGCqsUXeynKTgynp2j9g3sg7Nux2KtB3u'],
]

function getAddresses(chain) {
Expand Down
3 changes: 1 addition & 2 deletions projects/bitindi-dex/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const { uniTvlExport } = require('../helper/unknownTokens')
module.exports = uniTvlExport('bitindi', '0x87cef801D44D6eDa8106087e7676153c30e36950', true)
module.exports.bitindi.tvl = () => ({})

// deadFrom: '2023-12-20',
module.exports.deadFrom = '2023-12-20'
3 changes: 1 addition & 2 deletions projects/bitindi/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const ADDRESSES = require('../helper/coreAssets.json')
const { staking } = require('../helper/staking')

module.exports = {
Expand All @@ -11,5 +10,5 @@ module.exports = {
staking: () => ({}),
// staking: staking('0x140c312c8841B0a7152946C0Bc2BD343bA51bbcc', ADDRESSES.bitindi.WBNI),
},
// deadFrom: '2023-12-20',
deadFrom: '2023-12-20',
};
11 changes: 11 additions & 0 deletions projects/blasterswap-vaults/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const { stakings } = require("../helper/staking.js");

const vaults = ['0x0464a36beCf9967111D2dCAb57CAf4a2376f6E3F', '0xC52fb7E613e401a0195C2fdB369618580D58C91D', '0x013249266842e078999088807033D80531A84260'];
const tokens = ['0xb1a5700fa2358173fe465e6ea4ff52e36e88e2ad', '0xd43D8aDAC6A4C7d9Aeece7c3151FcA8f23752cf8', '0x5ffd9EbD27f2fcAB044c0f0a26A45Cb62fa29c06'];

module.exports = {
blast: {
tvl: () => ({}),
staking: stakings(vaults, tokens)
},
}
23 changes: 19 additions & 4 deletions projects/bmx/index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,27 @@
const { staking } = require("../helper/staking");
const { gmxExports } = require("../helper/gmx");
const sdk = require('@defillama/sdk')

const vaultAddress = "0xec8d8D4b215727f3476FF0ab41c406FA99b4272C";
const vaultAddresses = {
base: "0xec8d8D4b215727f3476FF0ab41c406FA99b4272C",
mode: "0xff745bdB76AfCBa9d3ACdCd71664D4250Ef1ae49"
};
const stakingAddresses = {
base: "0x3085F25Cbb5F34531229077BAAC20B9ef2AE85CB",
mode: "0x773F34397d5F378D993F498Ee646FFe4184E00A3"
};
const tokenAddresses = {
base: "0x548f93779fBC992010C07467cBaf329DD5F059B7",
mode: "0x66eEd5FF1701E6ed8470DC391F05e27B1d0657eb"
};

module.exports = {
methodology: "BMX liquidity is calculated by the value of tokens in the BLT pool.",
methodology: "BMX Classic liquidity is calculated by the value of tokens in the BLT/MLT pool. TVL also includes BMX staked.",
base: {
tvl: gmxExports({ vault: vaultAddress })
tvl: gmxExports({ vault: vaultAddresses.base }),
staking: staking(stakingAddresses.base, tokenAddresses.base)
},
mode: {
tvl: gmxExports({ vault: vaultAddresses.mode }),
staking: staking(stakingAddresses.mode, tokenAddresses.mode)
}
};
Loading

0 comments on commit a256542

Please sign in to comment.