Skip to content

Commit 9db60cf

Browse files
committed
Merge branch 'main' into nibiru/silverswap
2 parents ad6230d + b9683ed commit 9db60cf

File tree

160 files changed

+2362
-2022
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

160 files changed

+2362
-2022
lines changed

projects/9summits/index.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
const { getCuratorExport } = require("../helper/curators");
22

33
const configs = {
4-
methodology: 'Count all assets are depoisted in all vaults curated by 9Summits.',
4+
methodology: 'Count all assets are deposited in all vaults curated by 9Summits.',
55
blockchains: {
66
ethereum: {
7+
morphoVaultOwners: [
8+
'0x23E6aecB76675462Ad8f2B31eC7C492060c2fAEF',
9+
],
710
morpho: [
8-
'0xb5e4576C2FAA16b0cC59D1A2f3366164844Ef9E0',
9-
'0xD5Ac156319f2491d4ad1Ec4aA5ed0ED48C0fa173',
10-
'0x1E2aAaDcF528b9cC08F43d4fd7db488cE89F5741',
11-
'0x00B6f2C15E4439749f192D10c70f65354848Cf4b',
12-
'0x0bB2751a90fFF62e844b1521637DeD28F3f5046A',
11+
'0xb5e4576C2FAA16b0cC59D1A2f3366164844Ef9E0', // co-curator with tulip-capital
12+
'0x1E2aAaDcF528b9cC08F43d4fd7db488cE89F5741', // co-curator with tulip-capital
13+
'0x0bB2751a90fFF62e844b1521637DeD28F3f5046A', // co-curator with tulip-capital
1314
],
1415
},
1516
base: {
16-
morpho: [
17-
'0x5496b42ad0deCebFab0db944D83260e60D54f667',
18-
'0xF540D790413FCFAedAC93518Ae99EdDacE82cb78'
17+
morphoVaultOwners: [
18+
'0x23E6aecB76675462Ad8f2B31eC7C492060c2fAEF',
1919
],
2020
},
2121
}

projects/Fountain-Protocol/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,7 @@ module.exports= mergeExports([
1111
[unitroller_lpt_oasis, '0x63f1fe2e1da490611fc16e4a5d92b7ec7d0911a9'],
1212
].map( ([comptroller, cether]) => ({
1313
oasis: compoundExports2({ comptroller, cether, }),
14-
})))
14+
})))
15+
16+
module.exports.deadFrom = '2023-06-22'
17+
module.exports.oasis.borrowed= () => ({})

projects/SMARDEX-P2P-Lending/index.js

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
const headers = {
2+
origin: "https://subgraph.smardex.io",
3+
referer: "https://subgraph.smardex.io",
4+
"x-api-key": process.env.SMARDEX_SUBGRAPH_API_KEY,
5+
};
6+
7+
const subgraphUrl = "https://subgraph.smardex.io/ethereum/spro";
8+
9+
const getTokenMetrics = async () => {
10+
const tokenMetricsQuery = `{
11+
tokenMetrics_collection {
12+
id
13+
totalCollateralAmount
14+
totalBorrowedAmount
15+
}
16+
}`;
17+
18+
const result = await fetch(subgraphUrl, {
19+
method: "POST",
20+
headers,
21+
body: JSON.stringify({
22+
query: tokenMetricsQuery,
23+
}),
24+
}).then((res) => res.json());
25+
return result?.data?.tokenMetrics_collection || [];
26+
};
27+
28+
async function getP2pData(isBorrowed = false) {
29+
const tokenMetrics = await getTokenMetrics();
30+
31+
return tokenMetrics.reduce((acc, token) => {
32+
const totalBorrowedAmount = parseFloat(token.totalBorrowedAmount);
33+
34+
return {
35+
...acc,
36+
[token.id]:
37+
// We only need to add the total collateral amount if it's not borrowed
38+
totalBorrowedAmount + parseFloat(isBorrowed ? 0 : token.totalCollateralAmount),
39+
};
40+
}, {});
41+
}
42+
43+
module.exports = {
44+
ethereum: {
45+
tvl: () => getP2pData(),
46+
borrowed: () => getP2pData(true),
47+
},
48+
};
49+
// node test.js projects/p2p-lending/index.js

projects/SMARDEX-USDN/index.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
const ADDRESSES = require('../helper/coreAssets.json')
2+
3+
const USDN_PROTOCOL_ADDRESS = "0x656cB8C6d154Aad29d8771384089be5B5141f01a";
4+
const WSTETH_TOKEN_ADDRESS = ADDRESSES.ethereum.WSTETH;
5+
const REBALANCER_ADDRESS = "0xaebcc85a5594e687f6b302405e6e92d616826e03";
6+
7+
async function fetchUSDNData(api) {
8+
9+
const balanceVault = await api.call({ target: USDN_PROTOCOL_ADDRESS, abi: "uint256:getBalanceVault", });
10+
const balanceLong = await api.call({ target: USDN_PROTOCOL_ADDRESS, abi: "uint256:getBalanceLong", });
11+
const rebalancerCurrentStateData = await api.call({
12+
target: REBALANCER_ADDRESS,
13+
abi: "function getCurrentStateData() view returns (uint128 pendingAssets_, uint256 maxLeverage_, (int24 tick, uint256 tickVersion, uint256 index) currentPosId_)",
14+
});
15+
16+
return {
17+
getBalanceVault: balanceVault,
18+
getBalanceLong: balanceLong,
19+
rebalancerPendingAssets: rebalancerCurrentStateData.pendingAssets_,
20+
};
21+
}
22+
23+
const getEthereumTVL = async (api, block, chainBlocks) => {
24+
const usdnData = await fetchUSDNData(api);
25+
26+
api.add(WSTETH_TOKEN_ADDRESS, Object.values(usdnData))
27+
return api.getBalances();
28+
};
29+
30+
module.exports["ethereum"] = {
31+
timetravel: true,
32+
tvl: getEthereumTVL
33+
};

projects/SmarDex/index.js

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,32 +10,11 @@ const config = {
1010
};
1111

1212
const ethereumFactory = "0xB878DC600550367e14220d4916Ff678fB284214F";
13-
const USDN_PROTOCOL_ADDRESS = "0x656cB8C6d154Aad29d8771384089be5B5141f01a";
14-
const WSTETH_TOKEN_ADDRESS = ADDRESSES.ethereum.WSTETH;
15-
const REBALANCER_ADDRESS = "0xaebcc85a5594e687f6b302405e6e92d616826e03";
16-
17-
async function fetchUSDNData(api) {
18-
19-
const balanceVault = await api.call({ target: USDN_PROTOCOL_ADDRESS, abi: "uint256:getBalanceVault", });
20-
const balanceLong = await api.call({ target: USDN_PROTOCOL_ADDRESS, abi: "uint256:getBalanceLong", });
21-
const rebalancerCurrentStateData = await api.call({
22-
target: REBALANCER_ADDRESS,
23-
abi: "function getCurrentStateData() view returns (uint128 pendingAssets_, uint256 maxLeverage_, (int24 tick, uint256 tickVersion, uint256 index) currentPosId_)",
24-
});
25-
26-
return {
27-
getBalanceVault: balanceVault,
28-
getBalanceLong: balanceLong,
29-
rebalancerPendingAssets: rebalancerCurrentStateData.pendingAssets_,
30-
};
31-
}
3213

3314
const getEthereumTVL = async (api, block, chainBlocks) => {
34-
const usdnData = await fetchUSDNData(api);
3515
const uniTVL = await getUniTVL({ factory: ethereumFactory, fetchBalances: true, useDefaultCoreAssets: false })(api, block, chainBlocks);
3616

3717
api.addBalances(uniTVL)
38-
api.add(WSTETH_TOKEN_ADDRESS, Object.values(usdnData))
3918
return api.getBalances();
4019
};
4120

projects/TowerDEX/factoryTvl.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ async function getAllPairs(factory, chain, {blacklistedPairs = []} = {}) {
4949
return dtos
5050
}
5151

52-
const isNotXYK = (pair) => pair.pair_type && pair.pair_type.custom === 'concentrated'
52+
const isNotXYK = (pair) => pair.pair_type && pair.pair_type.concentrated
5353

5454
function getFactoryTvl(factory, {blacklistedPairs = []} = {}) {
5555
return async (api) => {

projects/acryptos/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ function fetchallchain(chainId) {
2020

2121
module.exports = {
2222
timetravel: false,
23-
methodology: "Acryptos TVL is the USD value of token within the vault and farm contracts",
23+
methodology: "Acryptos TVL is the USD value of token within the vault and farm contracts",
24+
misrepresentedTokens: true,
2425
ethereum: {
2526
tvl: fetchallchain(1),
2627
},

projects/alphaping/index.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
const { getCuratorExport } = require("../helper/curators");
22

33
const configs = {
4-
methodology: 'Count all assets are depoisted in all vaults curated by Alphaping.',
4+
methodology: 'Count all assets are deposited in all vaults curated by Alphaping.',
55
blockchains: {
66
ethereum: {
7-
morpho: [
8-
'0xb0f05E4De970A1aaf77f8C2F823953a367504BA9',
9-
'0x6619F92861C760AD11BA0D56E8ED63A33EccE22B',
10-
'0xFa7ED49Eb24A6117D8a3168EEE69D26b45C40C63',
11-
'0x47fe8Ab9eE47DD65c24df52324181790b9F47EfC'
7+
morphoVaultOwners: [
8+
'0xEB4Af6fA3AFA08B10d593EC8fF87efB03BC04645',
129
],
1310
},
1411
}

projects/alterscope/index.js

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,11 @@
11
const { getCuratorExport } = require("../helper/curators");
22

33
const configs = {
4-
methodology: 'Count all assets are depoisted in all vaults curated by Alterscope.',
4+
methodology: 'Count all assets are deposited in all vaults curated by Alterscope.',
55
blockchains: {
66
ethereum: {
7-
euler: [
8-
'0x45c3B59d53e2e148Aaa6a857521059676D5c0489',
9-
'0x6d18F74AAD8494B789aE34b5455816F79664d209',
10-
'0x29D824d54Fd5118543E81637b8f865d045191F30',
11-
'0xd6506dB835B465d5d823add8667362d7b86cFe5F',
12-
'0xa2f045eC60C624c46F1075FC589Df0f936F822C2',
13-
'0xFc323C1727853872A85098EA89a6882853B708dd',
14-
'0x1987c2DCf5674Cf90bEceBAd502714c357ce126a',
15-
'0x25C538cc5c5B4cDdf9a9A656f90d2d8129E841B2',
16-
'0xE5b9686c0cc4Be8a47eb4ed265d4203EA8232f94',
17-
'0xdFD25B2304f4F08031b4125ee49ea2Df6aB8B19b',
18-
'0x9167Ff08C18Ea05d70D5CBf0c576A33DCeE6de06',
19-
'0x99ba39845C4A12341C4B8cCEba1F11F4f6f84046',
20-
'0xD1552d878FE4869539ba4D03D207B54913a5C273',
21-
'0xfC67343ac17B158deb69de67Ba8A2eD7C47F0C74',
22-
'0x5a0064007ddDEa2C8d6547A7B1E862c619500994',
23-
'0x41722452C0348501825C494ec6C1579e9c32D277',
24-
'0xF69FF7901E199AE4Fc354048DA09C23c7699716c',
25-
'0xEd667E0DE292C040CF2183302c8DBDe1C06447d7',
26-
'0xB77e25555C2b3e6BCe5329D83eFD248534A907Aa',
27-
'0x28c6F8D44179ac93a5EBAe24189d887eeEF38cea',
28-
'0x6fc6BeCAe0fFAA08f699ec072f31983821a4D7ce',
29-
'0xaE4D563FC348e0FC3697Ed940b23a86779e095C8',
30-
'0xb4f7761C459D09f414e1190df275be3E24535750',
31-
'0xd005125E525664feC9394CEE5466Da15262fFe01',
7+
eulerVaultOwners: [
8+
'0x0d8249DD621fB1c386A7A7A949504035Dd3436A3',
329
],
3310
},
3411
}

projects/ampere/index.js

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
const ADDRESSES = require('../helper/coreAssets.json')
21
const { tombTvl } = require("../helper/tomb");
3-
const FUSE_ON_ETH = "0x970b9bb2c0444f5e81e9d0efb84c8ccdcdcaf84d";
4-
const FUSE_ON_FUSE = ADDRESSES.fuse.WFUSE;
52
const AMP = "0x2b09179D26FdDB27a24ee25328890791c7A984c2".toLowerCase();
63
const CURRENT = "0x3B1292FEf70C3F9Fb933DD2e2F4B734DcB35648d".toLowerCase();
74

@@ -12,24 +9,18 @@ const fuseLPs = [
129

1310
const rewardPool = "0x8Cdc3584B455b49634b9272247AD2AccEef58c98".toLowerCase();
1411
const masonry = "0x335C392DB4F0AD43f782B0646959E41FC1134350".toLowerCase();
15-
const genesisBlock = 1650700800;
16-
17-
const transform = (addr) => {
18-
if (addr.toLowerCase() === FUSE_ON_FUSE.toLowerCase()) return FUSE_ON_ETH;
19-
return "fuse:" + addr;
20-
};
2112

2213
module.exports = {
2314
methodology: "Pool2 deposits consist of AMP/FUSE and CURRENT/FUSE LP tokens deposits while the staking TVL consists of the CURRENT tokens locked within the Masonry contract, priced using Fuse on Ethereum mainnet.",
24-
start: genesisBlock,
15+
start: 1650700800,
2516
...tombTvl(
2617
AMP,
2718
CURRENT,
2819
rewardPool,
2920
masonry,
3021
fuseLPs,
3122
"fuse",
32-
transform,
23+
undefined,
3324
false,
3425
fuseLPs[1]
3526
),

projects/apostro/index.js

Lines changed: 16 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -4,61 +4,29 @@ const configs = {
44
methodology: 'Count all assets are depoisted in all vaults curated by Apostro.',
55
blockchains: {
66
ethereum: {
7-
morpho: [
8-
'0x214B47C50057eFaa7adc1B1C2608C3751Cd77D78',
9-
'0x5085Dd6FAd07c12e38fae01bc2a4938d2C08B1Bc',
10-
'0x4EDfaB296F8Eb15aC0907CF9eCb7079b1679Da57',
7+
morphoVaultOwners: [
8+
'0x3B8DfE237895f737271371F339eEcbd66Face43e',
9+
'0xf726311F85D45a7fECfFbC94bD8508a0A39958c6',
1110
],
12-
euler: [
13-
'0x315F93a074D0948E4D068e98a34092750ea8A38C',
14-
'0xc60400289B32E840909795a063aeccFb093E0b47',
15-
'0xE0c1bdab9A7d487c4fEcd402cb9b4f8B347e73c3',
16-
'0xe3Fd841FE4701bBA147e478CfBc46889116B7d3d',
17-
'0xc27B9587414f7d725e89b989aA63948a93f8DB71',
18-
'0x3A8992754E2EF51D8F90620d2766278af5C59b90',
19-
'0xcBC9B61177444A793B85442D3a953B90f6170b7D',
20-
'0x81fa50cBe6C7Ed61961fE601B7c5AC334c2c84bB',
21-
'0x7f1d29e70C644c387ded640B28E106e29E349074',
22-
'0x9f12d29c7CC72bb3d237E2D042A6D890421f9899',
23-
'0x396fD980c0463Ccb285d3ec6830978D5D97976EC',
24-
'0xA2038a5B7Ce1C195F0C52b77134c5369CCfe0148',
25-
'0xBc99605074737d36266f45E0d192dDe6CFDFd72a',
26-
'0x82D2CE1f71cbe391c05E21132811e5172d51A6EE',
27-
'0x29A9E5A004002Ff9E960bb8BB536E076F53cbDF1',
28-
'0xe11a462235A39C90921C4a59D4E8B2707330BCf2',
29-
'0xC605471aE09e0b7daA9e8813707d0DDbf9429Ad2',
30-
'0xD7B67cF0e7EDA8268b0f42de82dF87DfCC9a8537',
31-
'0xf9a23b059858CdD0e3ED0DDE89864BB82B88aa19',
11+
eulerVaultOwners: [
12+
'0x3B8DfE237895f737271371F339eEcbd66Face43e',
13+
'0xf726311F85D45a7fECfFbC94bD8508a0A39958c6',
3214
],
3315
},
3416
base: {
35-
morpho: [
36-
'0xcdDCDd18A16ED441F6CB10c3909e5e7ec2B9e8f3',
37-
'0xC484D83F667b779cc9907248101214235642258B',
17+
morphoVaultOwners: [
18+
'0x3B8DfE237895f737271371F339eEcbd66Face43e',
19+
'0xf726311F85D45a7fECfFbC94bD8508a0A39958c6',
20+
],
21+
eulerVaultOwners: [
22+
'0x3B8DfE237895f737271371F339eEcbd66Face43e',
23+
'0xf726311F85D45a7fECfFbC94bD8508a0A39958c6',
3824
],
39-
euler: [
40-
'0x596dBb33131fa2991cf5651cB57e4b15682C7F93',
41-
'0xEdCc195Ca09c9FCC1DD30b152C0b82045Ff2F91f',
42-
'0x29Dbce367F5157B924Af5093617bb128477D7A5C',
43-
'0xC063C3b3625DF5F362F60f35B0bcd98e0fa650fb',
44-
'0x5ce15fC058E762A6F9722fC6521A0c0F5eECD9BA',
45-
'0x1E2F1e8A97E96a2FDD6A8Da427603Ed1c8b3847F',
46-
'0x3F131Ac9D408926a8B36C1e03ce105f44DCD26Af',
47-
'0x34ABB4501419b1E5f836567C58300c861164101A',
48-
]
4925
},
5026
bsc: {
51-
euler: [
52-
'0xc27d44A8aEA0CDa482600136c0d0876e807f6C1a',
53-
'0x19C1d7E5a2b821D4e05fd9cFB8ba372C2cAA551B',
54-
'0x36AEb594689205878E1B57bFc011e0956D82ed08',
55-
'0xC6767dd1fFaA730f6fc90b353d5928E6e9d55C1b',
56-
'0xC0C13008711cE250699E3A94dCEED5EFd4e8e02a',
57-
'0x6078b5dE9d10587cb466ECbBF55C95898AFe99C2',
58-
'0xeEC4561f621C3629F2b36a07B207A7E06377e0D5',
59-
'0x3135551ce7945c03C18df7985E089DDBC763cEE8',
60-
'0x9AE0Da6ACc874119470b52f4f5647B74D042b18B',
61-
'0xa6282FfCDBC1d23dDAd65e97B9d033C4517Ec05E',
27+
eulerVaultOwners: [
28+
'0x3B8DfE237895f737271371F339eEcbd66Face43e',
29+
'0xf726311F85D45a7fECfFbC94bD8508a0A39958c6',
6230
],
6331
},
6432
}

projects/arkis/index.js

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
const { getLogs } = require("../helper/cache/getLogs");
22
const ADDRESSES = require('../helper/coreAssets.json');
33
const { sumTokens2 } = require("../helper/unwrapLPs");
4+
const axios = require("axios");
45

56
const native = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE";
67

@@ -24,6 +25,8 @@ const abis = {
2425
totalBorrowed: "function totalBorrowed() returns (uint256)",
2526
}
2627

28+
const arkis_wrapped_hype_vault = "0x454F936D5877Daf9366Ef1Fca1bDF888201Bb127";
29+
2730
const fetchFactoryLogs = async (api, type) => {
2831
const fromBlock = 21069508;
2932
const topic = type === "agreement" ? topics.agreementCreated : topics.accountDeployed;
@@ -76,7 +79,16 @@ const borrowed = async (api) => {
7679
})
7780
}
7881

82+
async function tvlHyperliquid(api) {
83+
const response = await axios.get(`https://www.hyperscan.com/api/v2/addresses/${arkis_wrapped_hype_vault}`);
84+
const hypeBalance = response.data.coin_balance || '0';
85+
api.add(ADDRESSES.null, hypeBalance);
86+
}
87+
88+
7989
module.exports = {
80-
methodology: "TVL is calculated by summing the balances of leverage assets, collaterals, and whitelisted tokens held in agreements and margin accounts deployed by factory contracts. Native tokens and LP tokens are also included.",
81-
ethereum : { tvl, borrowed }
82-
}
90+
methodology: "On Ethereum, TVL includes leverage assets, collaterals, whitelisted tokens, ETH, and LP tokens held in agreements and margin accounts created by factory contracts. " +
91+
"On Hyperliquid, TVL reflects the native HYPE held at the Arkis Wrapped HYPE Vault (0x454F936D5877Daf9366Ef1Fca1bDF888201Bb127), which backs the arkisHYPE token issued on Ethereum.",
92+
ethereum: { tvl, borrowed },
93+
hyperliquid: { tvl: tvlHyperliquid },
94+
}

projects/asymmetry-usdaf/index.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
const { getLiquityV2Tvl } = require('../helper/liquity')
2+
3+
const config = {
4+
ethereum: '0xCFf0DcAb01563e5324ef9D0AdB0677d9C167d791'
5+
}
6+
7+
Object.keys(config).forEach(chain => {
8+
module.exports[chain] = {
9+
tvl: getLiquityV2Tvl(config[chain])
10+
}
11+
})

0 commit comments

Comments
 (0)