Skip to content

Commit

Permalink
Merge branch 'main' into polkamarket
Browse files Browse the repository at this point in the history
  • Loading branch information
g1nt0ki authored Aug 6, 2024
2 parents b8d8a2a + f682051 commit a90a736
Show file tree
Hide file tree
Showing 80 changed files with 2,487 additions and 1,496 deletions.
1,894 changes: 1,009 additions & 885 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion projects/GajFinance/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ async function stakingAvax(timestamp, ethBlock, chainBlocks) {
}

module.exports = {
broken: 'Api is no longer reachable',
methodology: "TVL comes from NFT Farming, Jungle Pools, MasterChef and Vaults",
avax:{
staking: stakingAvax,
Expand Down
13 changes: 13 additions & 0 deletions projects/aevo-xyz/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,17 @@ module.exports = {
]
})
},
base: {
tvl: sumTokensExport({
owners: [
'0x6ee3907D1B9423584195979812379143B327fb48', // Native USDC
'0xA8bD0eCb10a83CC6E14FC5381f384DD3C0779e8B', // WETH
],
tokens: [
ADDRESSES.base.USDC,
ADDRESSES.base.USDbC,
ADDRESSES.base.WETH,
]
})
}
}
6 changes: 3 additions & 3 deletions projects/affine-defi-liquid/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ module.exports = {
ethereum: {
tvl: sumERC4626VaultsExport({
vaults: [
'0x0D53bc2BA508dFdf47084d511F13Bb2eb3f8317B',
'0x47657094e3AF11c47d5eF4D3598A1536B394EEc4',
'0xcbC632833687DacDcc7DfaC96F6c5989381f4B47',
'0xF0a949B935e367A94cDFe0F2A54892C2BC7b2131',
],
isOG4626: true,
}),
},
}
}
10 changes: 10 additions & 0 deletions projects/airpuff/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,12 @@ module.exports = {
reStakingToken: "0xeA1A6307D9b18F8d1cbf1c3Dd6aad8416C06a221",
oracle: "0xb09cbB6Aa95A004F9aeE4349DF431aF5ad03ECe4",
};


tokensAndOwners.push([eETH.reStakingToken, eETH.vault]);



// leverage users
const ezETH = {
vault: "0x32a0ce2bDfc37eE606aB905b4f9fC286049A774f",
Expand Down Expand Up @@ -334,6 +338,11 @@ module.exports = {
pendleAddress: "0xb05cabcd99cf9a73b19805edefc5f67ca5d1895e",
};

const bptrswETH1x2 = {
vault: "0x76338fca82925Fe2Df2C4F2c6e9545247617C634",
pendleAddress: "0x7bAf258049cc8B9A78097723dc19a8b103D4098F"
};

//new 1x strats on pendle v2

//PT Tensorplex Staked TAO 27JUN2024 (PT-stTAO-...)
Expand Down Expand Up @@ -388,6 +397,7 @@ module.exports = {
bptzrsETH1x,
bptzUSDe1x,
bptrswETH1x,
bptrswETH1x2,
pTEzETHDEC30,
].map((i) => [i.pendleAddress, i.vault]);
tokensAndOwners.push(...tokensAndOwners2);
Expand Down
66 changes: 62 additions & 4 deletions projects/alphafi/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const sui = require("../helper/chain/sui")
const { addUniV3LikePosition } = require("../helper/unwrapLPs")

const ALPHAFI_TVL_IDS = [
const ALPHAFI_CETUS_TVL_IDS = [
{

poolID: "0x30066d9879374276dc01177fbd239a9377b497bcd347c82811d75fcda35b18e5",
Expand Down Expand Up @@ -38,6 +38,49 @@ const ALPHAFI_TVL_IDS = [
token0Type: "0xaf8cd5edc19c4512f4259f0bee101a40d41ebed738ade5874359610ef8eeced5::coin::COIN",
token1Type: "0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf::coin::COIN"
},
{
poolID: "0x045e4e3ccd383bedeb8fda54c39a7a1b1a6ed6a9f66aec4998984373558f96a0",
cetusPoolID: "0x0254747f5ca059a1972cd7f6016485d51392a3fde608107b93bbaebea550f703",
investorID: "0xdd9018247d579bd7adfdbced4ed39c28821c6019461d37dbdf32f0d409959b1c",
token0Type: "0xa99b8952d4f7d947ea77fe0ecdcc9e5fc0bcab2841d6e2a5aa00c3044e5544b5::navx::NAVX",
token1Type: "0x2::sui::SUI"
},
{
poolID: "0x59ff9c5df31bfd0a59ac8393cf6f8db1373252e845958953e6199952d194dae4",
cetusPoolID: "0x81fe26939ed676dd766358a60445341a06cea407ca6f3671ef30f162c84126d5",
investorID: "0x8051a9ce43f9c21e58331b1ba2b1925e4ae4c001b1400459236d86d5d3d2888b",
token0Type: "0xce7ff77a83ea0cb6fd39bd8748e2ec89a3f41e8efdc3f4eb123e0ca37b184db2::buck::BUCK",
token1Type: "0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf::coin::COIN"
},

]

const ALPHAFI_NAVI_TVL_IDS = [
{
poolID: "0x643f84e0a33b19e2b511be46232610c6eb38e772931f582f019b8bbfb893ddb3",
tokenType: "0x2::sui::SUI",
expo: 9
},
{
poolID: "0x0d9598006d37077b4935400f6525d7f1070784e2d6f04765d76ae0a4880f7d0a",
tokenType: "0x549e8b69270defbfafd4f94e17ec44cdbdd99820b33bda2278dea3b9a32d3f55::cert::CERT",
expo: 9
},
{
poolID: "0xc696ca5b8f21a1f8fcd62cff16bbe5a396a4bed6f67909cfec8269eb16e60757",
tokenType: "0xc060006111016b8a020ad5b33834984a437aaa7d3c74c18e09a95d48aceab08c::coin::COIN",
expo: 6,
},
{
poolID: "0x01493446093dfcdcfc6c16dc31ffe40ba9ac2e99a3f6c16a0d285bff861944ae",
tokenType: "0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf::coin::COIN",
expo: 6
},
{
poolID: "0xe4eef7d4d8cafa3ef90ea486ff7d1eec347718375e63f1f778005ae646439aad",
tokenType: "0xaf8cd5edc19c4512f4259f0bee101a40d41ebed738ade5874359610ef8eeced5::coin::COIN",
expo: 8
},
]

const ALPHAFI_POOL2_IDS = [{
Expand All @@ -56,8 +99,8 @@ function asIntN(int, bits = 32) {
return Number(BigInt.asIntN(bits, BigInt(int)))
}

async function addPoolTVL(api, pools) {
for (const { poolID, cetusPoolID, investorID, token0Type, token1Type } of pools) {
async function addPoolTVL(api, alphafiCetusPools) {
for (const { poolID, cetusPoolID, investorID, token0Type, token1Type } of alphafiCetusPools) {
let investorObject = await sui.getObject(investorID)
let poolObject = await sui.getObject(poolID)
let cetusPoolObject = await sui.getObject(cetusPoolID)
Expand All @@ -73,13 +116,28 @@ async function addPoolTVL(api, pools) {
}
}

async function addPoolTVL2(api, alphafiNaviPools){

for (const { poolID, tokenType, expo } of alphafiNaviPools){
let poolObject = await sui.getObject(poolID);
let tokensInvested = poolObject.fields.tokensInvested;
let balance = BigInt(tokensInvested)/BigInt(Math.pow(10, 9-expo));
api.add(tokenType, balance);
}
}

async function tvl(api) {
await addPoolTVL(api, ALPHAFI_TVL_IDS)

await Promise.all([addPoolTVL(api, ALPHAFI_CETUS_TVL_IDS), addPoolTVL2(api, ALPHAFI_NAVI_TVL_IDS)])

}
async function pool2(api) {

await addPoolTVL(api, ALPHAFI_POOL2_IDS)

}


async function staking(api) {
let alphaPoolObject = await sui.getObject(ALPHA_POOL_ID)
api.addToken(ALPHA_COIN_TYPE, Number(alphaPoolObject.fields.alpha_bal))
Expand Down
12 changes: 11 additions & 1 deletion projects/apex-omni/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,17 @@ const tokens = [
const walletAddresses = {
bsc: ['0xb8d9f005654b7b127b34dae8f973ba729ca3a2d9'],
ethereum: ['0x35D173cdfE4d484BC5985fDa55FABad5892c7B82'],
arbitrum: ['0x3169844a120c0f517b4eb4a750c08d8518c8466a']
arbitrum: ['0x3169844a120c0f517b4eb4a750c08d8518c8466a'],
base: ['0xee7981c4642de8d19aed11da3bac59277dfd59d7'],
mantle: ['0x3c7c0ebfcd5786ef48df5ed127cddeb806db976c']

};

const tokenAddress = {
bsc: [ADDRESSES.bsc.USDT],
arbitrum: [ADDRESSES.arbitrum.USDT],
base: ['0xfde4C96c8593536E31F229EA8f37b2ADa2699bb2'],
mantle: [ADDRESSES.mantle.USDT]
}

module.exports = {
Expand All @@ -28,4 +32,10 @@ module.exports = {
arbitrum: {
tvl: sumTokensExport({ owners: walletAddresses.arbitrum, tokens: tokenAddress.arbitrum }),
},
base: {
tvl: sumTokensExport({ owners: walletAddresses.base, tokens: tokenAddress.base }),
},
mantle: {
tvl: sumTokensExport({ owners: walletAddresses.mantle, tokens: tokenAddress.mantle }),
},
};
12 changes: 0 additions & 12 deletions projects/babyswap/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,10 @@ const { staking } = require("../helper/staking");
const MasterChefContract = "0xdfAa0e08e357dB0153927C7EaBB492d1F60aC730";
const BABY = "0x53E562b9B7E5E94b81f10e96Ee70Ad06df3D2657";

// node test.js projects/babyswap/index.js

/*
module.exports = {
bsc: {
staking: staking(MasterChefContract, BABY),
tvl: bscTvl,
},
methodology:
"We count liquidity on the Farms (LP tokens) and Pools (single tokens) seccions threw MasterChef Contract",
};*/
const { getUniTVL } = require('../helper/unknownTokens')
module.exports = {
methodology: `Uses factory(0x86407bEa2078ea5f5EB5A52B2caA963bC1F889Da) address and whitelisted tokens address to find and price Liquidity Pool pairs`,
misrepresentedTokens: true,
incentivized: true,
bsc: {
tvl: getUniTVL({ factory: '0x86407bEa2078ea5f5EB5A52B2caA963bC1F889Da', useDefaultCoreAssets: true }),
staking: staking(MasterChefContract, BABY),
Expand Down
19 changes: 19 additions & 0 deletions projects/balancer-cow-amm/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const { v1Tvl } = require('../helper/balancer')
const sdk = require('@defillama/sdk')

const config = {
ethereum: [
['0xf76c421bAb7df8548604E60deCCcE50477C10462', 20432455],
['0x23fcC2166F991B8946D195de53745E1b804C91B7', 20391510],
],
xdai: [
['0x703Bd8115E6F21a37BB5Df97f78614ca72Ad7624', 35259725],
['0x7573B99BC09c11Dc0427fb9c6662bc603E008304', 35163914],
],
}

Object.keys(config).forEach(chain => {
module.exports[chain] = {
tvl: sdk.util.sumChainTvls(config[chain].map(c => v1Tvl(...c)))
}
})
1 change: 1 addition & 0 deletions projects/beefy/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ const chains = {
polygon_zkevm: 1101,
moonbeam: 1284,
moonriver: 1285,
sei: 1329,
kava: 2222,
mantle: 5000,
canto: 7700,
Expand Down
1 change: 0 additions & 1 deletion projects/bfly.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ module.exports={
methodology: "Data is retrieved from the api at https://fai.bfly.finance",
misrepresentedTokens: true,
timetravel: false,
incentivized: true,
starcoin: {
tvl,
}
Expand Down
8 changes: 8 additions & 0 deletions projects/binance/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ const assetList = [
['BTC', 'BTC', '3NXCvmLGz9SxYi6TnjbBQfQMcwiZ1iQETa'],
['BTC', 'BTC', '3NjHh71XgjikBoTNYdWgXiNeZcLaKNThgb'],
['BTC', 'BTC', '3Qxak1CZhLyZ7GVckKphLURdLBCjMfz9bA'],
['BTC', 'BTC', 'bc1qdtmav38lca8yu3rrcknnqx5242cckgxqws7m72'],
['BTC', 'BTC', 'bc1q32lyrhp9zpww22phqjwwmelta0c8a5q990ghs6'],
['BTC', 'BTC', 'bc1q78ufzeu8w8fwvxuphrdlg446xhyptf28fkatu5'],
['BTC', 'BTC', 'bc1q7t9fxfaakmtk8pj7tdxjvwsng6y9x76czuaf5h'],
Expand Down Expand Up @@ -227,6 +228,7 @@ const assetList = [
['DOT', 'DOT', '1743nDTMZisPgBCYSAgkUn1kVG7MePc9rvMEjoRNf4ipVkF'],
['DOT', 'DOT', '1P6bgxZi42kYYV545c3RSp7NJLUgASDpMP1ifXJazVR1e2N'],
['DOT', 'DOT', '1qnJN7FViy3HZaxZK9tGAA71zxHSBeUweirKqCaox4t8GT7'],
['DOT', 'DOT', '169HLL5FwyoazAXyc8g7M6VRFCbpiLKTW6yQBVHBjRBUcFra'],
['DOT', 'ETH', '0x21a31ee1afc51d94c2efccaa2092ad1028285549'],
['DOT', 'ETH', '0x28c6c06298d514db089934071355e5743bf21d60'],
['DOT', 'ETH', '0xdfd5293d8e347dfe59e90efd55b2956a1343963d'],
Expand Down Expand Up @@ -290,6 +292,7 @@ const assetList = [
['FDUSD', 'BEP20', '0x8894e0a0c962cb723c1976a4421c95949be2d4e3'],
['FDUSD', 'BEP20', '0xd3a22590f8243f8e83ac230d1842c9af0404c4a1'],
['FDUSD', 'BEP20', '0xe2fc31f816a9b94326492132018c3aecc4a93ae1'],
['USDT', 'BEP20', '0x4fdFE365436b5273a42F135C6a6244A20404271E'],
['FDUSD', 'ETH', '0x21a31ee1afc51d94c2efccaa2092ad1028285549'],
['FDUSD', 'ETH', '0x28c6c06298d514db089934071355e5743bf21d60'],
['FDUSD', 'ETH', '0x4a9e49a45a4b2545cb177f79c7381a30e1dc261f'],
Expand All @@ -306,6 +309,7 @@ const assetList = [
['GRT', 'ARB', '0xf977814e90da44bfa03b6295a0616a897441acec'],
['GRT', 'ETH', '0x21a31ee1afc51d94c2efccaa2092ad1028285549'],
['GRT', 'ETH', '0x28c6c06298d514db089934071355e5743bf21d60'],
['ETH', 'ETH', '0x4fdFE365436b5273a42F135C6a6244A20404271E'],
['GRT', 'ETH', '0x5a52e96bacdabb82fd05763e25335261b270efcb'],
['GRT', 'ETH', '0xdfd5293d8e347dfe59e90efd55b2956a1343963d'],
['GRT', 'ETH', '0xf977814e90da44bfa03b6295a0616a897441acec'],
Expand Down Expand Up @@ -426,6 +430,8 @@ const assetList = [
['SOL', 'SOL', '9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM'],
['SOL', 'SOL', 'BZ3kabSsMzbuJUguYxtmkRtzw7ACqw1DUMH8PcbvXiUr'],
['SOL', 'SOL', 'HXsKP7wrBWaQ8T2Vtjry3Nj3oUgwYcqq9vrHDM12G664'],
//added on 31/07/2024
['SOL', 'SOL', 'GK35nWN6ZHSGZrRTf8kTQd8RkFCighChPEb41XwSFVAC'],
['SSV', 'ETH', '0x21a31ee1afc51d94c2efccaa2092ad1028285549'],
['SSV', 'ETH', '0x28c6c06298d514db089934071355e5743bf21d60'],
['SSV', 'ETH', '0x4a9e49a45a4b2545cb177f79c7381a30e1dc261f'],
Expand Down Expand Up @@ -594,6 +600,8 @@ const assetList = [
['XRP', 'XRP', 'rhWj9gaovwu2hZxYW7p388P8GRbuXFLQkK'],
['XRP', 'XRP', 'rpmxpWis42eYV4oMhyxJNSzrLRdacJVooa'],
['XRP', 'XRP', 'rs8ZPbYqgecRcDzQpJYAMhSxSi5htsjnza'],
// added on 31/07/2024
['XRP', 'XRP', 'rwkbXMJQLQhVhcjZnnHV4zu39N7WcQXQKX'],
['USDT', 'ETH', '0x835678a611b28684005a5e2233695fb6cbbb0007'],
['ETH', 'ETH', '0x835678a611b28684005a5e2233695fb6cbbb0007'],
['ETH', 'ARB', '0xf92402bb795fd7cd08fb83839689db79099c8c9c'],
Expand Down
Loading

0 comments on commit a90a736

Please sign in to comment.