Skip to content

Commit

Permalink
Merge branch 'DefiLlama:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
samster91 authored Mar 15, 2024
2 parents fcd7edb + c05d2b8 commit 9855aee
Show file tree
Hide file tree
Showing 454 changed files with 7,877 additions and 2,987 deletions.
1 change: 0 additions & 1 deletion .prettierrc

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Also, don't hesitate to send a message on [our discord](https://discord.defillam
1. PLEASE PLEASE **enable "Allow edits by maintainers" while putting up the PR.**
2. Once your adapter has been merged, it takes time to show on the UI. No need to notify us on Discord.
3. Sorry, We no longer accept fetch adapter for new projects (reason: https://github.com/DefiLlama/DefiLlama-Adapters/discussions/432), we prefer the tvl to computed from blockchain data, if you have trouble with creating a the adapter, please hop onto our discord, we are happy to assist you.
3. Sorry, We no longer accept fetch adapter for new projects (reason: https://github.com/DefiLlama/DefiLlama-Adapters/discussions/432), we prefer the tvl to be computed from blockchain data, if you have trouble with creating a the adapter, please hop onto our discord, we are happy to assist you.
4. **For updating listing info** It is a different repo, you can find your listing in this file: https://github.com/DefiLlama/defillama-server/blob/master/defi/src/protocols/data2.ts, you can edit it there and put up a PR
5. Do not edit/push `package-lock.json` file as part of your changes, we use lockfileVersion 2, and most use v1 and using that messes up our CI
6. No need to go to our discord and announce that you've created a PR, we monitor all PRs and will review it asap
Expand Down
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.

17 changes: 13 additions & 4 deletions projects/0xLend/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
const { usdCompoundExports } = require("../helper/compound");
module.exports = {
kcc: usdCompoundExports("0x337d8719f70D514367aBe780F7c1eAd1c0113Bc7", "kcc", "0x309f1639018e8B272126C4B99af442AA25Dcd1F2")
}
const { compoundExports2 } = require('../helper/compound')

const config = {
kcc: { comptroller: '0x337d8719f70D514367aBe780F7c1eAd1c0113Bc7', cether: '0x309f1639018e8b272126c4b99af442aa25dcd1f2' },
era: { comptroller: '0x599bb9202EE2D2F95EDe9f88F622854f7ef2c371', cether: '0x9dae6c8c431ffc6d21b836e0d8d113e8365defb9' },
blast: { comptroller: '0x1DD821C9E27fB2399DAb75AedB113c80C755DCa6', cether: '0xd9fcbd7b60966d013a28ff87925f75bb49e9b5ee' },
}

Object.keys(config).forEach(chain => {
module.exports[chain] = compoundExports2(config[chain])
})

module.exports.kcc.borrowed = () => ({})
13 changes: 13 additions & 0 deletions projects/0xscans/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const { sumTokensExport } = require('../helper/unknownTokens')

const zeroxscans = "0x10703cA5e253306e2ABABD68e963198be8887c81"
const stakingPool = "0x67a37e939A46eFFd65A91949eC7c8587BD82aAa7"

module.exports = {
ethereum: {
tvl: () => ({}),
staking: sumTokensExport({ owners: [stakingPool], tokens: [zeroxscans] }),
},
methodology:
"Counts all 0xScans tokens in the staking pools",
};
52 changes: 52 additions & 0 deletions projects/21-co/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
const { cexExports } = require('../helper/cex')

const config = {
bitcoin: {
owners: [
'1HTGi4tfXSEtcXD4pk6S3vBs3s64hWY1pW'
],
},
solana: {
owners: [
'FvLsZiM3g2ZnehkK42c4EoLASBdchKnqzxyAEmGhViZq'
],
},
ripple: {
owners: [
'rHTG5htCXSNtcXDhFkaSsvB1s1ah6WYrFW'
],
},
litecoin: {
owners: [
'LbgDyHCVc6UwsKuDzt5jKwFdG5TLsN5tbf'
],
},
polkadot: {
owners: [
'161fEUkrGhhAog8QG1ik3sfch9UzPdvAJtUwRH6WZnsgqkuw'
],
},
cardano: {
owners: [
'addr1q976xcl3r2vt6he4q3rq6lyq8832v5mgpdds0e84z7vn0hma5d3lzx5ch40n2pzxp47gqw0z5efksz6mqlj029uexl0snqdsul'
],
},
/*
doge: {
owners: [
'DMbNFKqJpr9B9XPfZL5zbgMTvzpN7h7sfz'
],
}, */
bep2: {
owners: [
'bnb1k3ulpgw4wzl0e8qx80u87aq9w7ekfygruzs4dg'
],
},
/* bitcoin_cash: {
owners: [
'qz68nu9p64ctalyuqcalslm5q4mmxey3qvr4y9mgt8'
],
} */
}

module.exports = cexExports(config)
11 changes: 11 additions & 0 deletions projects/Akitaswap/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const { getUniTVL } = require("../helper/unknownTokens");
module.exports = {
misrepresentedTokens: true,

blast: {
tvl: getUniTVL({
factory: "0x27C429dfF0e6d3B43B2C404C35f58C2b36cef916",
useDefaultCoreAssets: true,
}),
},
};
8 changes: 8 additions & 0 deletions projects/AvoLend/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const { compoundExports2 } = require('../helper/compound');

module.exports = {
blast: compoundExports2({
comptroller: '0xe20cE0Db739e4B6Afa9989c87bE7C8C25cbeB5Ea',
cether: '0x29e15766d6b203C35c2D51AAEc4Cf964129Af088',
}),
};
35 changes: 35 additions & 0 deletions projects/BlastNYAN/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
const ADDRESSES = require('../helper/coreAssets.json')
const { sumTokensExport } = require('../helper/unknownTokens')
const WETH = ADDRESSES.blast.WETH
const BLNYAN = '0x9aAC39ca368D27bf03887CCe32f28b44F466072F'
const BLNYAN_WETH_SLP = '0x0E9309f32881899F6D4aC2711c6E21367A84CA26'

const stakingBLNYANContract = '0xA76D6dc805d0EbEcb3787c781ce3A18feEF020cb'
const feeDistro = '0xBC8a7a845cC7A8246EB34856Afe6f1a3d62BD9C6'
const stakeLpEarnWeth = '0xF63Ef9F4320f9d16731a40ff1f58a966ee086806'
const button = '0x00066Ed6c2F7d6CC6e66c678BaEE2C8683B632e6'
const lockPoints = '0x46B3a66ef4fAC801B455884035eF2862F01e6158'
const opts = { useDefaultCoreAssets: true, lps: [BLNYAN_WETH_SLP] }

module.exports = {
misrepresentedTokens: true,
blast: {
tvl: sumTokensExport({
owners: [lockPoints, feeDistro, button],
tokens: [WETH],
...opts,
}),
pool2: sumTokensExport({
...opts,
owners: [stakeLpEarnWeth],
tokens: [BLNYAN_WETH_SLP],
}),
staking: sumTokensExport({
owners: [stakingBLNYANContract, lockPoints],
tokens: [BLNYAN],
...opts,
}),
},
methodology:
'Counts as TVL the ETH only. blNYAN and LP assets deposited are counted as Pool2 and staking Respectively',
}
6 changes: 6 additions & 0 deletions projects/Blaster/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const { uniV3Export } = require("../helper/uniswapV3");
const { mergeExports } = require('../helper/utils')

module.exports = mergeExports([
uniV3Export({ blast: { factory: "0x9792FaeA53Af241bCE57C7C8D6622d5DaAD0D4Fc", fromBlock: 693561, }, }),
])
11 changes: 11 additions & 0 deletions projects/Gas404Swap/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const { getUniTVL } = require("../helper/unknownTokens");
module.exports = {
misrepresentedTokens: true,

bsc: {
tvl: getUniTVL({
factory: "0xb6aC3914b53Cd3b39F11Fc9B380c3E605E994E20",
useDefaultCoreAssets: true,
}),
},
};
6 changes: 6 additions & 0 deletions projects/LemonBlast/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const { getUniTVL } = require('../helper/unknownTokens')

module.exports = {
misrepresentedTokens: true,
blast: { tvl: getUniTVL({ factory: '0x31329BcDC90faD4d65764ccf91f833ec1d5fB5A4', useDefaultCoreAssets: true, fetchBalances: true, }), },
}
1 change: 1 addition & 0 deletions projects/MantisSwap/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const { sumTokens2 } = require("../helper/unwrapLPs");
const config = {
polygon: { vaults: ['0x62Ba5e1AB1fa304687f132f67E35bFC5247166aD'] },
polygon_zkevm: { vaults: ['0x12d41b6DF938C739F00c392575e3FD9292d98215'] },
mode: { vaults: ['0x4af97f73343b226C5a5872dCd2d1c4944BDb3E77'] },
}

const MAX_LP_TOKENS = 3
Expand Down
22 changes: 22 additions & 0 deletions projects/MeowProtocol/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
const { sumTokens2 } = require('../helper/unwrapLPs')

const config = {
ethereum: '0x9aE578d5ad69B051E6FbC7EBB18A12C2D459D914',
scroll: '0x4b71CAF14Cf8529101498976C44B8445797A5886'
}

Object.keys(config).forEach(chain => {
const lendingPoolCore = config[chain]
module.exports[chain] = {
tvl: async (_, _b, _cb, { api, }) => {
const tokens = await api.call({ abi: 'address[]:getReserves', target: lendingPoolCore })
return sumTokens2({api, tokens, owner: lendingPoolCore })
},
borrowed: async (_, _b, _cb, { api, }) => {
const tokens = await api.call({ abi: 'address[]:getReserves', target: lendingPoolCore })
const bals = await api.multiCall({ abi: "function getReserveTotalBorrows(address _reserve) view returns (uint256)", target: lendingPoolCore, calls: tokens })
api.add(tokens, bals)
return api.getBalances()
}
}
})
8 changes: 8 additions & 0 deletions projects/Produs/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const { getUniTVL, } = require('../helper/unknownTokens')

module.exports = {
misrepresentedTokens: true,
bsc: {
tvl: getUniTVL({ factory: '0x8ae5527706446943cBA8589313EC217a4a7288a4', useDefaultCoreAssets: true, fetchBalances: true, }),
},
};
30 changes: 30 additions & 0 deletions projects/SecuredFinance/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
const config = {
ethereum: {},
arbitrum: {},
avax: {},
polygon_zkevm: {
tokenVault: '0x0896AC8B9e2DC3545392ff65061E5a8a3eD68824',
currencyController: '0x9E1254292195F241FA2DF1aA51af23796627A74B',
},
};

Object.keys(config).forEach(chain => {
const {
tokenVault = '0xB74749b2213916b1dA3b869E41c7c57f1db69393',
currencyController = '0x7dca6b6BF30cd28ADe83e86e21e82e3F852bF2DC',
} = config[chain];
module.exports[chain] = {
tvl: async (_, _b, _cb, { api }) => {
const bytes = await api.call({
abi: 'function getCurrencies() view returns (bytes32[])',
target: currencyController,
});
const tokens = await api.multiCall({
abi: 'function getTokenAddress(bytes32) view returns (address)',
calls: bytes,
target: tokenVault,
});
return api.sumTokens({ owner: tokenVault, tokens });
},
};
});
12 changes: 12 additions & 0 deletions projects/XDX/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const { getUniTVL } = require('../helper/unknownTokens')

module.exports = {
misrepresentedTokens: true,
blast: {
tvl: getUniTVL({
fetchBalances: true,
useDefaultCoreAssets: true,
factory: '0xF55dE36072beCebF162d2d54C49964f3b0683711',
})
}
}
34 changes: 22 additions & 12 deletions projects/aada/index.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,30 @@
const { sumTokensExport, } = require("../helper/chain/cardano");
const { sumTokensExport } = require("../helper/chain/cardano");

const scriptAdresses = [
'addr1zy9940grv28qxz9k82l9gmqd80vfd8a2734e35yzsz9cqktfjcnq9fczt4qkxgec2hz6x7f38vnj8xuxywk4x4qgzh9smq5w00', //request.hs -- Request created. Lender to fund
'addr1zykhtew0z93z6hmgu2ew7kl9puqz0wmafp0f3jypuejkwmrfjcnq9fczt4qkxgec2hz6x7f38vnj8xuxywk4x4qgzh9skq4p22', //collateral.hs -- Loan funded. Borrower to repay
'addr1zxfgvtfgp9476dhmq8fkm3x8wg20v33s6c9unyxmnpm0y5rfjcnq9fczt4qkxgec2hz6x7f38vnj8xuxywk4x4qgzh9st8q78h', //interest.hs -- Borrower repaid -- Lender to claim
'addr1zxcjtxuc7mj8w6v9l3dfxvm30kxf78nzw387mqjqvszxr4mfjcnq9fczt4qkxgec2hz6x7f38vnj8xuxywk4x4qgzh9sp92046', //liquidation.hs -- Funds were liquidated. Borrower to claim
'addr1zytwe3qhc0kf5k8yaur60cnhcxjg9zvfdnftp0rfu2czprtfjcnq9fczt4qkxgec2hz6x7f38vnj8xuxywk4x4qgzh9sgzwepc', //debt_request.hs -- Funds locked as liquidity deposits 'addr1z8tjrqy2dj5uk6her4ksltyxy2flzykktxkahzlahm9nwctfjcnq9fczt4qkxgec2hz6x7f38vnj8xuxywk4x4qgzh9st86ewu', //request.hs v2 -- Funds locked as liquidity deposits
'addr1zyc7w5n699ews00yujnhw59g4nuzykuzgl5x6nzqp49zv5tfjcnq9fczt4qkxgec2hz6x7f38vnj8xuxywk4x4qgzh9sdyxnxc', //collateral.hs v2-- Funds locked as liquidity deposits
'addr1zy6v8c7xdhftln7zk5uvt9h6jaknaxlx6hz5nkw63mpgwamfjcnq9fczt4qkxgec2hz6x7f38vnj8xuxywk4x4qgzh9sw9snf6', //debt_request.hs v2-- Funds locked as liquidity deposits
"addr1zy9940grv28qxz9k82l9gmqd80vfd8a2734e35yzsz9cqktfjcnq9fczt4qkxgec2hz6x7f38vnj8xuxywk4x4qgzh9smq5w00", //request.hs -- Request created. Lender to fund
"addr1zykhtew0z93z6hmgu2ew7kl9puqz0wmafp0f3jypuejkwmrfjcnq9fczt4qkxgec2hz6x7f38vnj8xuxywk4x4qgzh9skq4p22", //collateral.hs -- Loan funded. Borrower to repay
"addr1zxfgvtfgp9476dhmq8fkm3x8wg20v33s6c9unyxmnpm0y5rfjcnq9fczt4qkxgec2hz6x7f38vnj8xuxywk4x4qgzh9st8q78h", //interest.hs -- Borrower repaid -- Lender to claim
"addr1zxcjtxuc7mj8w6v9l3dfxvm30kxf78nzw387mqjqvszxr4mfjcnq9fczt4qkxgec2hz6x7f38vnj8xuxywk4x4qgzh9sp92046", //liquidation.hs -- Funds were liquidated. Borrower to claim
"addr1zytwe3qhc0kf5k8yaur60cnhcxjg9zvfdnftp0rfu2czprtfjcnq9fczt4qkxgec2hz6x7f38vnj8xuxywk4x4qgzh9sgzwepc", //debt_request.hs -- Funds locked as liquidity deposits 'addr1z8tjrqy2dj5uk6her4ksltyxy2flzykktxkahzlahm9nwctfjcnq9fczt4qkxgec2hz6x7f38vnj8xuxywk4x4qgzh9st86ewu', //request.hs v2 -- Funds locked as liquidity deposits
"addr1zyc7w5n699ews00yujnhw59g4nuzykuzgl5x6nzqp49zv5tfjcnq9fczt4qkxgec2hz6x7f38vnj8xuxywk4x4qgzh9sdyxnxc", //collateral.hs v2-- Funds locked as liquidity deposits
"addr1zy6v8c7xdhftln7zk5uvt9h6jaknaxlx6hz5nkw63mpgwamfjcnq9fczt4qkxgec2hz6x7f38vnj8xuxywk4x4qgzh9sw9snf6", //debt_request.hs v2-- Funds locked as liquidity deposits
"script1xt5vpt33fm6tu3fvz65enpnlvmg6z7gle9evktmuwn3c6gjfc7p", // Pool contract
"script1nwvlaa0wnf43wzjp3xv738k6myam74dlrlh027mq20trg3ng772", // Collateral contract
"script1sqscxzh7mkzlmgf98k3tuadkds8xt3yzzj8t3jnfpypukld9xck", // Leftovers contract
];

module.exports = {
methodology: 'Counts amount of AADA staked; by a price of ADA sitting in the orderbook.',
methodology:
"Calculates the total of idle tokens held in pool contracts or collateral tokens secured in the collateral contract.",
timetravel: false,
cardano: {
staking: sumTokensExport({ owner: 'addr1wyvej5rmcrhfpcwrwmnqsjtwvf8gv3dn64vwy3xzekp95wqqhdkwa' , tokens: ['8fef2d34078659493ce161a6c7fba4b56afefa8535296a5743f6958741414441']}),
tvl: sumTokensExport({ scripts: scriptAdresses, })
}
staking: sumTokensExport({
owner: "addr1wyvej5rmcrhfpcwrwmnqsjtwvf8gv3dn64vwy3xzekp95wqqhdkwa",
tokens: [
"8fef2d34078659493ce161a6c7fba4b56afefa8535296a5743f6958741414441",
],
}),
tvl: sumTokensExport({ scripts: scriptAdresses }),
},
hallmarks: [[1708560053, "V2 Launch"]],
};
3 changes: 2 additions & 1 deletion projects/aave/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const { getV2Reserves, getTvl, getBorrowed, aaveChainTvl } = require('../helper/
const { staking } = require('../helper/staking');
const { ammMarket } = require('./amm');
const { unwrapBalancerToken } = require('../helper/unwrapLPs');
const methodologies = require('../helper/methodologies');


const addressesProviderRegistryETH = "0x52D306e36E3B6B02c153d0266ff0f85d18BCD413";
Expand Down Expand Up @@ -49,7 +50,7 @@ function v2(chain, v2Registry){

module.exports = {
timetravel: true,
methodology: `Counts the tokens locked in the contracts to be used as collateral to borrow or to earn yield. Borrowed coins are not counted towards the TVL, so only the coins actually locked in the contracts are counted. There's multiple reasons behind this but one of the main ones is to avoid inflating the TVL through cycled lending`,
methodology: methodologies.lendingMarket,
ethereum: {
staking: staking(aaveStakingContract, aaveTokenAddress),
pool2: stakingBalancerTvl,
Expand Down
3 changes: 2 additions & 1 deletion projects/aave/v3.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const { aaveChainTvl } = require('../helper/aave');
const methodologies = require('../helper/methodologies');

const v3params = ["0x770ef9f4fe897e59daCc474EF11238303F9552b6", undefined, ["0x69FA688f1Dc47d4B5d8029D5a35FB7a548310654"]]

Expand All @@ -24,7 +25,7 @@ function v3(chain) {
}

module.exports = {
methodology: `Counts the tokens locked in the contracts to be used as collateral to borrow or to earn yield. Borrowed coins are not counted towards the TVL, so only the coins actually locked in the contracts are counted. There's multiple reasons behind this but one of the main ones is to avoid inflating the TVL through cycled lending`,
methodology: methodologies.lendingMarket,
avax: v3("avax"),
...["optimism", "fantom", "harmony", "arbitrum", "polygon", "ethereum", "metis", "base", "xdai", "scroll", "bsc"].reduce((t, c) => ({ ...t, [c]: v3(c) }), {}),
hallmarks: [
Expand Down
Loading

0 comments on commit 9855aee

Please sign in to comment.