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
Stonepapa authored May 4, 2024
2 parents aec9d80 + fd9cca4 commit d00c334
Show file tree
Hide file tree
Showing 16 changed files with 140 additions and 141 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"test": "echo \"Error: no test specified\" && exit 1",
"weeklyChanges": "git pull && git diff $(git log -1 --before=@{7.days.ago} --format=%H) --stat | grep -E \"projects/\" | cut -d / -f 2 | cut -d \" \" -f 1 | uniq | wc -l",
"dev": "babel-watch curve.js",
"lint": "eslint .",
"eslint:github-action": "eslint .",
"lint": "eslint -c .eslintrc.js .",
"eslint:github-action": "eslint -c .eslintrc.js .",
"test-interactive": "node utils/testInteractive",
"tvl": "cd utils;npm i; cd ..; node utils/testInteractive",
"treasury": "cd utils;npm i; cd ..; node utils/testInteractive treasury",
Expand Down
10 changes: 5 additions & 5 deletions projects/aera/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ const config = {
comets: [
{
address: '0xA5EDBDD9646f8dFF606d7448e414884C7d905dCA',
baseToken: '0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8',
baseToken: ADDRESSES.arbitrum.USDC,
},
{
address: '0x9c4ec768c28520B50860ea7a15bd7213a9fF58bf',
baseToken: '0xaf88d065e77c8cC2239327C5EDb3A432268e5831',
baseToken: ADDRESSES.arbitrum.USDC_CIRCLE,
},
],
cometReward: '0x88730d254A2f7e6AC8388c3198aFd694bA9f7fae',
Expand All @@ -99,15 +99,15 @@ const config = {
comets: [
{
address: '0x46e6b214b524310239732D51387075E0e70970bf',
baseToken: '0x4200000000000000000000000000000000000006',
baseToken: ADDRESSES.optimism.WETH_1,
},
{
address: '0xb125E6687d4313864e53df431d5425969c15Eb2F',
baseToken: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',
baseToken: ADDRESSES.base.USDC,
},
{
address: '0x9c4ec768c28520B50860ea7a15bd7213a9fF58bf',
baseToken: '0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA',
baseToken: ADDRESSES.base.USDbC,
},
],
cometReward: '0x123964802e6ABabBE1Bc9547D72Ef1B69B00A6b1',
Expand Down
2 changes: 1 addition & 1 deletion projects/airpuff/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ module.exports = {

const airPuff1XstoneMode = {
vault: "0xaC9dAdf209F14f46Fe103C6E5C787130a6129205",
pendleAddress: "0x80137510979822322193FC997d400D5A6C747bf7",
pendleAddress: ADDRESSES.mode.STONE,
};

const airPuff1XMerlinBTCMode = {
Expand Down
3 changes: 2 additions & 1 deletion projects/bitgenie/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ const stakingContracts = [
"0x237826695a575D9Fd2FA7C184E5f37593aBc1529",
"0x63C8860e93697dB85716C9ee7F15D09EAC62136C",
"0x19a0D0b1734bdB167D393e7BB7a57418e3a8cCA8",
"0x1DBa95577DFe76d8e86af00aEB614479cb7917D2"
"0x1DBa95577DFe76d8e86af00aEB614479cb7917D2",
"0xC795A8D5f83F5A172f606AC2516276Ee7DF63407"
];


Expand Down
15 changes: 15 additions & 0 deletions projects/bunnyswap/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const { sumTokensExport } = require("../helper/unwrapLPs")

module.exports={
base: {
tvl: sumTokensExport({
tokens:[
"0x4200000000000000000000000000000000000006",
"0x0bD4887f7D41B35CD75DFF9FfeE2856106f86670"
],
owners:[
"0x7cfc830448484cdf830625373820241e61ef4acf"
]
})
},
}
6 changes: 2 additions & 4 deletions projects/glif/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@ module.exports = {
methodology:
"The GLIF Pools protocol is a liquid leasing protocol for Filecoin that requires borrowers to collateralize FIL in order to borrow for their storage providing operation. This TVL calculation adds the total amount of FIL deposited into the protocol, and the total amount of locked FIL collateral by borrowers, to arrive at TVL.",
filecoin: {
tvl: async (_, height, _1, { api }) => {
tvl: async (api) => {
let url = INDEXER_API;
if (!!height && height >= 0) {
url += `?height=${height}`;
}
url += `?timestamp=${api.timestamp}`;
// this call is too costly to perform on chain in this environment,
// we wrapped the tvl in a server that derives the information directly on-chain
// but serves it in a more efficient manner to not overload defillama frontend
Expand Down
5 changes: 3 additions & 2 deletions projects/helper/cache/uniswap.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const ADDRESSES = require('../coreAssets.json')

const uniswapAbi = require('../abis/uniswap')
const { getCache, setCache, } = require('../cache');
Expand Down Expand Up @@ -28,8 +29,8 @@ function getUniTVL({ coreAssets, blacklist = [], factory, blacklistedTokens,
let chain = api?.chain
if (!chain)
chain = _chain
// const supply = await api.call({ abi: 'erc20:totalSupply', target: '0x1d1bc800e71576a59f9ef88bb679fa13c2e10abf' })
// console.log(await sdk.api.eth.getBalance({ target: '0x1d1bc800e71576a59f9ef88bb679fa13c2e10abf', chain: api.chain }), supply)
// const supply = await api.call({ abi: 'erc20:totalSupply', target: ADDRESSES.area.WAREA })
// console.log(await sdk.api.eth.getBalance({ target: ADDRESSES.area.WAREA, chain: api.chain }), supply)
factory = normalizeAddress(factory, chain)
blacklist = (blacklistedTokens || blacklist).map(i => normalizeAddress(i, chain))
const key = `${factory}-${chain}`
Expand Down
54 changes: 52 additions & 2 deletions projects/helper/coreAssets.json
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,10 @@
"SWAPZ": "0x9b6fbf0ea23faf0d77b94d5699b44062e5e747ac",
"DAI": "0xe3f5a90f9cb311505cd691a46596599aa1a0ad7d",
"SCAR": "0x8d9fb713587174ee97e91866050c383b5cee6209",
"sVLX": "0xaadbaa6758fc00dec9b43a0364a372605d8f1883",
"VLX": "0x2b1abeb48f875465bf0d3a262a2080ab1c7a3e39",
"ETH_1": "0x380f73bad5e7396b260f737291ae5a8100baabcd",
"USDT_1": "0x4b773e1ae1baa4894e51cc1d1faf485c91b1012f",
"ADA": "0x3611fbfb06ffbcef9afb210f6ace86742e6c14a4"
},
"telos": {
Expand Down Expand Up @@ -1585,6 +1589,7 @@
"MEER_2": "0x457dE4e275A6b3C0D3750519221dD1dF19d54f01"
},
"mode": {
"STONE": "0x80137510979822322193fc997d400d5a6c747bf7",
"WETH": "0x4200000000000000000000000000000000000006",
"USDC": "0xd988097fb8612cc24eeC14542bC03424c656005f",
"USDT": "0xf0F161fDA2712DB8b566946122a5af183995e2eD",
Expand Down Expand Up @@ -1629,6 +1634,13 @@
"NEW": "0xf4905b9bc02ce21c98eac1803693a9357d5253bf"
},
"zeta": {
"USDC": "0x05BA149A7bd6dC1F937fA9046A9e05C05f3b18b0",
"USDC_1": "0x0cbe0dF132a6c6B4a2974Fa1b7Fb953CF0Cc798a",
"USDT": "0x7c8dDa80bbBE1254a7aACf3219EBe1481c6E01d7",
"USDT_1": "0x91d4F0D54090Df2D81e834c3c8CE71C6c865e79F",
"ETH": "0xd97b1de3619ed2c6beb3860147e30ca8a7dc9891",
"BNB": "0x48f80608b672dc30dc7e3dbbd0343c5f02c738eb",
"BTC": "0x13A0c5930C028511Dc02665E7285134B6d11A5f4",
"WZETA": "0x5f0b1a82749cb4e2278ec87f8bf6b618dc71a8bf"
},
"blast": {
Expand All @@ -1649,7 +1661,8 @@
"BTN": "0x8148b71232162ea7a0b1c8bfe2b8f023934bfb58"
},
"area": {
"AREA": "0x298b6a733cd34e41ca87b264d968c8ca7b0b9931"
"AREA": "0x298b6a733cd34e41ca87b264d968c8ca7b0b9931",
"WAREA": "0x1d1bc800e71576a59f9ef88bb679fa13c2e10abf"
},
"defiverse": {
"OAS": "0x5a89E11Cb554E00c2f51C4bb7F05bc7Ab0Fa6351",
Expand All @@ -1662,6 +1675,11 @@
"USDC": "0x300a7b57dc85b6a9776e249614abf0fe5c9905fb"
},
"merlin": {
"SATS": "0x4dcb91cc19aadfe5a6672781eb09abad00c19e4c",
"RATS": "0x69181a1f082ea83a152621e4fa527c936abfa501",
"ORDI": "0x0726523eba12edad467c55a962842ef358865559",
"USDT": "0x967aec3276b63c5e2262da9641db9dbebb07dc0d",
"USDC": "0x6b4ecada640f1b30dbdb68f77821a03a5f282ebe",
"WBTC": "0xF6D226f9Dc15d9bB51182815b320D3fBE324e1bA",
"WBTC_1": "0xB880fd278198bd590252621d4CD071b1842E9Bcd"
},
Expand All @@ -1674,6 +1692,9 @@
"WUSDC": "0x79Cb92a2806BF4f82B614A84b6805963b8b1D8BB"
},
"zklink": {
"WBTC": "0xda4aaed3a53962c83b35697cd138cc6df43af71f",
"USDT": "0x2f8a25ac62179b31d62d7f80884ae57464699059",
"USDC": "0x1a1a3b2ff016332e866787b311fcb63928464509",
"WETH": "0x8280a4e7D5B3B658ec4580d3Bc30f5e50454F169"
},
"kinto": {
Expand Down Expand Up @@ -1720,5 +1741,34 @@
},
"zora": {
"USDzC": "0xcccccccc7021b32ebb4e8c08314bd62f7c653ec4"
},
"ancient8": {
"WETH": "0x4200000000000000000000000000000000000006"
},
"karak": {
"USDC": "0xa415021bc5c4c3b5b989116dc35ae95d9c962c8d",
"rsETH": "0xf948aacec00289fc33d8226391f7e04bb457ad49",
"WETH": "0x4200000000000000000000000000000000000006"
},
"bsquared": {
"WBTC": "0x4200000000000000000000000000000000000006",
"USDT": "0x681202351a488040fa4fdcc24188afb582c9dd62",
"USDC": "0xe544e8a38add9b1abf21922090445ba93f74b9e5"
},
"planq": {
"WPLANQ": "0x5ebcdf1de1781e8b5d41c016b0574ad53e2f6e1a"
},
"lac": {
"LAC": "0x2911a1ab18546cb501628be8625c7503a2a7db54"
},
"bob": {
"WETH": "0x4200000000000000000000000000000000000006",
"WBTC": "0x03c7054bcb39f7b2e5b2c7acb37583e32d70cfa3",
"USDT": "0x05d032ac25d322df992303dca074ee7392c117b9",
"USDC": "0xe75d0fb2c24a55ca1e3f96781a2bcc7bdba058f0",
"STETH": "0x85008aE6198BC91aC0735CB5497CF125ddAAc528",
"STONE": "0x96147a9ae9a42d7da551fd2322ca15b71032f342",
"RETH": "0xb5686c4f60904ec2bda6277d6fe1f7caa8d1b41a",
"TBTC": "0xbba2ef945d523c4e2608c9e1214c2cc64d4fc2e2"
}
}
}
118 changes: 6 additions & 112 deletions projects/helper/tokenMapping.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,117 +35,19 @@ const ibcMappings = {
}

const fixBalancesTokens = {
optimism: {
'0xD9cC3D70E730503E7f28c1B407389198c4B75FA2': { coingeckoId: "tlx", decimals: 18, },
},
ancient8: {
[ADDRESSES.nul]: { coingeckoId: "ethereum", decimals: 18, },
[ADDRESSES.optimism.WETH_1]: { coingeckoId: "ethereum", decimals: 18, },
},
area: {
'0x1d1bc800e71576a59f9ef88bb679fa13c2e10abf': { coingeckoId: 'areon-network', decimals: 18, },
},
// Sample Code
ozone: {
// '0x83048f0bf34feed8ced419455a4320a735a92e9d': { coingeckoId: "ozonechain", decimals: 18 }, // was mapped to wrong chain
},

karak: {
'0xa415021bc5c4c3b5b989116dc35ae95d9c962c8d': { coingeckoId: 'usd-coin', decimals: 6, },
'0xf948aacec00289fc33d8226391f7e04bb457ad49': { coingeckoId: 'restaked-swell-eth', decimals: 18, },
[ADDRESSES.optimism.WETH_1]: { coingeckoId: 'ethereum', decimals: 18, },
},
linea: {
'0x894134a25a5fac1c2c26f1d8fbf05111a3cb9487': { coingeckoId: 'grai', decimals: 18, },
'0x023617babed6cef5da825bea8363a5a9862e120f': { coingeckoId: "savings-dai", decimals: 18, },
},
arbitrum: {
'0xe46C5eA6Da584507eAF8dB2F3F57d7F578192e13': { coingeckoId: 'zeepr', decimals: 18, },
},
core: {
'0x1281E326C6e4413A98DafBd0D174a4Ae07ff4223': { coingeckoId: "zeepr", decimals: 18, },
[ADDRESSES.core.coreBTC]: { coingeckoId: "bitcoin", decimals: 8 },
},
bsc: {
'0x55CBAC75C1af769eB7FD37d27A5cb6437EB29abB': { coingeckoId: "zeepr", decimals: 18, },
},
manta: {
'0x0863C7BcdB6Cf6edd5dc4bbd181A8D555AedbfBd': { coingeckoId: "zeepr", decimals: 18, },
},
polygon: {
'0x49fdEA2192b04e54E6D1cB5E3B3b996BAA6f621F': { coingeckoId: "zeepr", decimals: 18, },
},
zkfair: {
'0x5d26DeA980716e4aBa19F5B73Eb3DCcE1889F042': { coingeckoId: "zeepr", decimals: 18, },
},
scroll: {
"0x80137510979822322193fc997d400d5a6c747bf7": { coingeckoId: "ethereum:0x7122985656e38bdc0302db86685bb972b145bd3c", decimals: 0 },
"0xa25b25548B4C98B0c7d3d27dcA5D5ca743d68b7F": { coingeckoId: "kelp-dao-restaked-eth", decimals: 18 }
},
velas: {
'0xaadbaa6758fc00dec9b43a0364a372605d8f1883': { coingeckoId: "staked-vlx", decimals: 18, },
'0x2b1abeb48f875465bf0d3a262a2080ab1c7a3e39': { coingeckoId: "velas", decimals: 18, },
'0x380f73bad5e7396b260f737291ae5a8100baabcd': { coingeckoId: "ethereum", decimals: 18, },
'0x4b773e1ae1baa4894e51cc1d1faf485c91b1012f': { coingeckoId: "tether", decimals: 6, },
},
merlin: {
'0x4dcb91cc19aadfe5a6672781eb09abad00c19e4c': { coingeckoId: "sats-ordinals", decimals: 18, },
'0x69181a1f082ea83a152621e4fa527c936abfa501': { coingeckoId: "rats", decimals: 18, },
'0x0726523eba12edad467c55a962842ef358865559': { coingeckoId: "ordinals", decimals: 18, },
[ADDRESSES.null]: { coingeckoId: "bitcoin", decimals: 18, },
'0x967aec3276b63c5e2262da9641db9dbebb07dc0d': { coingeckoId: "tether", decimals: 6, },
'0x6b4ecada640f1b30dbdb68f77821a03a5f282ebe': { coingeckoId: "usd-coin", decimals: 6, },
},
zeta: {
[ADDRESSES.zeta.WZETA]: { decimals: 18, coingeckoId: "zetachain" },
[ADDRESSES.null]: { decimals: 18, coingeckoId: "zetachain" },
"0x05BA149A7bd6dC1F937fA9046A9e05C05f3b18b0": { decimals: 18, coingeckoId: "usd-coin" },
"0x0cbe0dF132a6c6B4a2974Fa1b7Fb953CF0Cc798a": { decimals: 18, coingeckoId: "usd-coin" },
"0x7c8dDa80bbBE1254a7aACf3219EBe1481c6E01d7": { decimals: 18, coingeckoId: "tether" },
"0x91d4F0D54090Df2D81e834c3c8CE71C6c865e79F": { decimals: 18, coingeckoId: "tether" },
"0xd97b1de3619ed2c6beb3860147e30ca8a7dc9891": { decimals: 18, coingeckoId: "ethereum" },
"0x48f80608b672dc30dc7e3dbbd0343c5f02c738eb": { decimals: 18, coingeckoId: "binancecoin" },
"0x13A0c5930C028511Dc02665E7285134B6d11A5f4": { decimals: 18, coingeckoId: "bitcoin" }
},
mode: {
'0x80137510979822322193fc997d400d5a6c747bf7': { coingeckoId: "stakestone-ether", decimals: 18 },
},
zklink: {
[ADDRESSES.null]: { coingeckoId: "ethereum", decimals: 18, },
'0xda4aaed3a53962c83b35697cd138cc6df43af71f': { coingeckoId: "wrapped-bitcoin", decimals: 8, },
'0x2f8a25ac62179b31d62d7f80884ae57464699059': { coingeckoId: "tether", decimals: 6, },
'0x1a1a3b2ff016332e866787b311fcb63928464509': { coingeckoId: "usd-coin", decimals: 6, },
},
bsquared: {
[ADDRESSES.null]: { coingeckoId: "bitcoin", decimals: 18, },
[ADDRESSES.optimism.WETH_1]: { coingeckoId: "bitcoin", decimals: 18, },
'0x681202351a488040fa4fdcc24188afb582c9dd62': { coingeckoId: "tether", decimals: 6, },
'0xe544e8a38add9b1abf21922090445ba93f74b9e5': { coingeckoId: "usd-coin", decimals: 6, },
},
planq: {
'0x5ebcdf1de1781e8b5d41c016b0574ad53e2f6e1a': { coingeckoId: "planq", decimals: 18, },
},
xlayer: {
[ADDRESSES.xlayer.WOKB]: { coingeckoId: "okb", decimals: 18, },
[ADDRESSES.xlayer.WBTC]: { coingeckoId: "wrapped-bitcoin", decimals: 8, },
[ADDRESSES.xlayer.WETH]: { coingeckoId: "ethereum", decimals: 18, },
[ADDRESSES.xlayer.USDT]: { coingeckoId: "tether", decimals: 6, },
[ADDRESSES.xlayer.USDC]: { coingeckoId: "usd-coin", decimals: 6, },
},
lac: {
'0x2911a1ab18546cb501628be8625c7503a2a7db54': { coingeckoId: "la-coin", decimals: 18, },
},
rpg: {
'0xdaa6a6919c9543d8787490f5e9ad532c4d7ce9e8': { coingeckoId: "deherogame-amazing-token", decimals: 18, },
'0x36426b7bf5709e5c2160411c6e8b1832e3404fe1': { coingeckoId: "mixmarvel", decimals: 18, },
},
genesys: {
[ADDRESSES.genesys.WGSYS]: { coingeckoId: "genesys", decimals: 18 },
[ADDRESSES.mode.STONE]: { coingeckoId: "ethereum:0x7122985656e38bdc0302db86685bb972b145bd3c", decimals: 0 },
},
zora: {
[ADDRESSES.null]: { coingeckoId: "ethereum", decimals: 18, },
[ADDRESSES.zora.USDzC]: { coingeckoId: "usd-coin", decimals: 6, },
tezos: {
"KT1PnUZCp3u2KzWr93pn4DD7HAJnm3rWVrgn": { coingeckoId: "tezos", decimals: 6 },
"KT18fp5rcTW7mbWDmzFwjLDUhs5MeJmagDSZ-17": { coingeckoId: "usd-coin", decimals: 6 },
"KT18fp5rcTW7mbWDmzFwjLDUhs5MeJmagDSZ-18": { coingeckoId: "tether", decimals: 6 },
},

acala: {
ACA: { coingeckoId: "acala", decimals: 12 },
LDOT: { coingeckoId: "liquid-staking-dot", decimals: 10 },
Expand All @@ -160,14 +62,6 @@ const fixBalancesTokens = {
KINT: { coingeckoId: "kintsugi", decimals: 12 },
KBTC: { coingeckoId: "kintsugi-btc", decimals: 8 },
},
bob: {
[ADDRESSES.null]: { coingeckoId: "ethereum", decimals: 18, },
[ADDRESSES.optimism.WETH_1]: { coingeckoId: "ethereum", decimals: 18, },
'0x03c7054bcb39f7b2e5b2c7acb37583e32d70cfa3': { coingeckoId: "wrapped-bitcoin", decimals: 8, },
'0x05d032ac25d322df992303dca074ee7392c117b9': { coingeckoId: "tether", decimals: 6, },
'0xe75d0fb2c24a55ca1e3f96781a2bcc7bdba058f0': { coingeckoId: "usd-coin", decimals: 6, },
'0xbba2ef945d523c4e2608c9e1214c2cc64d4fc2e2': { coingeckoId: "tbtc", decimals: 18, },
}
}

ibcChains.forEach(chain => fixBalancesTokens[chain] = { ...ibcMappings, ...(fixBalancesTokens[chain] || {}) })
Expand Down
8 changes: 4 additions & 4 deletions projects/meson/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ const config = {
tokens: [
ADDRESSES.bsc.iUSD,
'0x480E158395cC5b41e5584347c495584cA2cAf78d',
'0x6b4eCAdA640F1B30dBdB68f77821A03A5f282EbE',
'0x967aEC3276b63c5E2262da9641DB9dbeBB07dC0d',
ADDRESSES.merlin.USDC,
ADDRESSES.merlin.USDT,
'0x9bd60d6FC99843207B8149f9190438C1F81BDdcD',
'0xB5d8b1e73c79483d7750C5b8DF8db45A0d24e2cf',
ADDRESSES.merlin.WBTC_1,
Expand All @@ -19,12 +19,12 @@ const config = {
},
bsquared: {
tokens: [
'0x681202351a488040Fa4FdCc24188AfB582c9DD62',
ADDRESSES.bsquared.USDT,
'0x7537C1F80c9E157ED7AFD93a494be3e1f04f1462',
'0xa793740863F1710A87070a5918820976ff32B758',
'0xC2Fe4f673455Ef92299770a09CDB5E8756A525D5',
'0xD48d3A551757ac47655fCe25BDE1B0B6b1Cb2a5A',
'0xE544e8a38aDD9B1ABF21922090445Ba93f74B9E5',
ADDRESSES.bsquared.USDC,
],
id: 'b2',
},
Expand Down
Loading

0 comments on commit d00c334

Please sign in to comment.