Skip to content

Commit 4aef0e3

Browse files
authored
Merge branch 'DefiLlama:main' into main
2 parents 45cd291 + 9841cd2 commit 4aef0e3

File tree

59 files changed

+894
-653
lines changed

Some content is hidden

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

59 files changed

+894
-653
lines changed

projects/abacus/index.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
const wildCreditABI = require('../wildcredit/abi.json');
2+
3+
const config = {
4+
arbitrum: { strategy: '0xB4E291f443f51D80186dd3EE0Af7F4a4E6e90804', veToken: '0xAAA343032aA79eE9a6897Dab03bef967c3289a06', token: '0xAAA6C1E32C55A7Bfa8066A6FAE9b42650F262418' },
5+
avax: { strategy: '0xedEd6a22bf714d4B19b7e7bC1CA0BCF88956751c', veToken: '0xAAAEa1fB9f3DE3F70E89f37B69Ab11B47eb9Ce6F', token: '0xaaab9d12a30504559b0c5a9a5977fee4a6081c6b' },
6+
bsc: { strategy: '0x37e46C030e0d843b39F692c9108E54945F4CCCf7', veToken: '0xfBBF371C9B0B994EebFcC977CEf603F7f31c070D', token: '0xF4C8E32EaDEC4BFe97E0F595AdD0f4450a863a11' },
7+
polygon: { strategy: '0x32dAc1B8AD93b53F549D6555e01c35dCC50b6229', veToken: '0xB419cE2ea99f356BaE0caC47282B9409E38200fa', token: '0xBFA35599c7AEbb0dAcE9b5aa3ca5f2a79624D8Eb' },
8+
mantle: { strategy: '0xCaAF554900E33ae5DBc66ae9f8ADc3049B7D31dB', veToken: '0xAAAEa1fB9f3DE3F70E89f37B69Ab11B47eb9Ce6F', token: '0xC1E0C8C30F251A07a894609616580ad2CEb547F2' },
9+
}
10+
11+
Object.keys(config).forEach(chain => {
12+
const { strategy, veToken, token, } = config[chain]
13+
module.exports[chain] = {
14+
tvl: async (api) => {
15+
const nftPositions = await api.call({ abi: 'erc20:balanceOf', target: veToken, params: strategy })
16+
const positionIds = await api.multiCall({
17+
abi: wildCreditABI.tokenOfOwnerByIndex, target: veToken,
18+
calls: Array(Number(nftPositions)).fill(0).map((_, index) => ({ params: [strategy, index] }))
19+
})
20+
const locked = await api.multiCall({ abi: 'function locked(uint256) view returns (uint256 amount, uint256 end)', calls: positionIds, target: veToken })
21+
locked.forEach(i => api.add(token, i.amount))
22+
}
23+
}
24+
})

projects/abstraDex/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11

2+
3+
24
const { getUniTVL } = require("../helper/unknownTokens");
35

46
const config = {
@@ -7,6 +9,7 @@ const config = {
79
zeta: '0x174c4C03DfeA09682728A5959A253bf1F7C7766F',
810
blast: '0xA7afB6163c331DDb0845843889D6f9544328846F',
911
cyeth: '0x174c4c03dfea09682728a5959a253bf1f7c7766f',
12+
cronos_zkevm: '0x76D1fC018676f8A973474C24F40A2e14e401b770',
1013
}
1114

1215
module.exports = {
@@ -15,4 +18,5 @@ module.exports = {
1518

1619
Object.keys(config).forEach(chain => {
1720
module.exports[chain] = { tvl: getUniTVL({ factory: config[chain], useDefaultCoreAssets: true, }), }
18-
})
21+
})
22+

projects/alphpad/index.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
const alephium = require('../helper/chain/alephium')
2+
3+
const Addresses = {
4+
apad: '27HxXZJBTPjhHXwoF1Ue8sLMcSxYdxefoN2U6d8TKmZsm',
5+
alphApadPool: 'vFpZ1DF93x1xGHoXM8rsDBFjpcoSsCi5ZEuA5NG5UJGX',
6+
alphUsdtPool: '2A5R8KZQ3rhKYrW7bAS4JTjY9FCFLJg6HjQpqSFZBqACX',
7+
vault: 'yzoCumd4Fpi959NSis9Nnyr28UkgyRYqrKBgYNAuYj3m'
8+
}
9+
10+
async function apadLocked() {
11+
const results = await alephium.contractMultiCall([
12+
{ group: 0, address: Addresses.vault, methodIndex: 34 },
13+
{ group: 0, address: Addresses.alphApadPool, methodIndex: 8 },
14+
{ group: 0, address: Addresses.alphUsdtPool, methodIndex: 8 },
15+
]);
16+
const apadLocked = results[0].returns[0].value;
17+
const apadInAlph = results[1].returns[0].value / results[1].returns[1].value;
18+
const alphInUsd = (results[2].returns[1].value * 10 ** 12) / results[2].returns[0].value;
19+
return ((apadLocked / 10 ** 18) * apadInAlph) * alphInUsd;
20+
}
21+
22+
async function staking(api) {
23+
const apadLockedValue = await apadLocked();
24+
api.addCGToken('tether', apadLockedValue)
25+
}
26+
27+
28+
module.exports = {
29+
timetravel: false,
30+
methodology: 'TVL locked in the APAD on Alephium',
31+
alephium: {
32+
tvl: () => ({}),
33+
staking
34+
}
35+
}

projects/anzen-v2/index.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ const USDz = '0xa469b7ee9ee773642b3e93e842e5d9b5baa10067';
66
const Base_USDz = '0x04d5ddf5f3a8939889f11e97f8c4bb48317f1938';
77
const Blast_USDz = '0x52056ed29fe015f4ba2e3b079d10c0b87f46e8c6';
88
const Manta_USDz = '0x73d23f3778a90be8846e172354a115543df2a7e4';
9+
const Arbitrum_USDz = '0x5018609ab477cc502e170a5accf5312b86a4b94f';
910
const SPCT = '0xf30a29f1c540724fd8c5c4be1af604a6c6800d29'; // Secured collateral
1011

1112
const mainnet_tvl = async (api) => {
@@ -28,6 +29,11 @@ const manta_tvl = async (api) => {
2829
api.add(Manta_USDz, supply)
2930
}
3031

32+
const arbitrum_tvl = async (api) => {
33+
const supply = await api.call({ abi: 'erc20:totalSupply', target: Arbitrum_USDz })
34+
api.add(Arbitrum_USDz, supply)
35+
}
36+
3137
const collateral_assets = async (api) => {
3238
const supply = await api.call({ abi: 'erc20:totalSupply', target: SPCT })
3339
api.add(SPCT, supply)
@@ -47,4 +53,7 @@ module.exports = {
4753
manta: {
4854
tvl: manta_tvl,
4955
},
56+
arbitrum: {
57+
tvl: arbitrum_tvl,
58+
},
5059
};

projects/aqua-network/index.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
const { get } = require('../helper/http')
2+
const AQUA_STATS_URL = "https://amm-api.aqua.network/api/external/v1/statistics/totals/?size=all"
3+
4+
let _data
5+
6+
async function getData() {
7+
if (!_data)
8+
_data = get(AQUA_STATS_URL)
9+
const data = await _data
10+
const res = {}
11+
data.forEach((item) => {
12+
res[item.date] = item.tvl / 1e8
13+
})
14+
return res
15+
}
16+
17+
function formatUnixTimestamp(unixTimestamp) {
18+
const date = new Date(unixTimestamp * 1000); // Convert Unix timestamp to milliseconds
19+
const year = date.getFullYear();
20+
const month = String(date.getMonth() + 1).padStart(2, '0'); // Months are zero-based
21+
const day = String(date.getDate()).padStart(2, '0');
22+
return `${year}-${month}-${day}`;
23+
}
24+
25+
async function tvl(api) {
26+
const key = formatUnixTimestamp(api.timestamp)
27+
const allData = await getData()
28+
const usdValue = allData[key]
29+
if (!usdValue)
30+
throw new Error('No data found for current date');
31+
api.addCGToken('tether', usdValue)
32+
}
33+
34+
module.exports = {
35+
start: 1719792000,
36+
misrepresentedTokens: true,
37+
methodology:
38+
'counts the liquidity of the Pools on AMM, data is pulled from the Aquarius API: "https://amm-api.aqua.network/api/external/v1/statistics/totals/".',
39+
stellar: { tvl },
40+
};

projects/atomichub/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,15 @@ async function eos() {
1212
// AtomicHub
1313
// https://wax.atomichub.io/
1414
async function wax() {
15+
const accounts = ["atomicmarket", "atomicassets"];
1516
const tokens = [
1617
["eosio.token", "WAX", "wax"],
1718
];
18-
return await get_account_tvl("atomicmarket", tokens, "wax");
19+
return await get_account_tvl(accounts, tokens, "wax");
1920
}
2021

2122
module.exports = {
22-
methodology: `AtomicHub TVL is achieved by querying token balances from AtomicHub's smart contract.`,
23+
methodology: `AtomicHub TVL is achieved by querying token balances from AtomicHub's smart contracts.`,
2324
eos: {
2425
tvl: eos
2526
},

projects/avalon-finance/index.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,19 @@ const innovativeMarket = {
1818
merlin: aaveExports('', '0x91b212e9FaF20117Eae59d6289CB38749DDFc070', undefined, ['0x883cb2E2d9c5D4D9aF5b0d37fc39Fa2284405682'], { v3: true }),
1919
btr: aaveExports('', '0x90EA8C92AddE4D3f323Dad9E36f0E0395dbc929d', undefined, ['0x4c25c261Fe47bC216113D140BaF72B05E151bcE4'], { v3: true }),
2020
}
21+
const pumpBTCMarkets = {
22+
// Ethereum - Pump BTC
23+
ethereum: aaveExports('', '0xE00A3FE97714765A1a2054E850724Fd1320FaCc0', undefined, ['0x2eE0438BCC1876cEA2c6fc43dD21417cF3D1c2eF'], { v3: true }),
24+
// BSC - PumpBTC
25+
bsc: aaveExports('', '0xb1C93Ba1286b6CCA1496C266f0eBfCe94b0C0cc0', undefined, ['0x58c937fa2D147117dB43d187f9411151edfFf03c'], { v3: true }),
26+
}
27+
28+
const otherProtocolTokenMarkets = {
29+
// ETH - Swell BTC
30+
ethereum: aaveExports('', '0x3975BE5E668b189b8Ac9049B96A9D9561c4F5273', undefined, ['0x87Ed94868f6fbaA834Db81a1C5854c445caCaB67'], { v3: true }),
31+
// Merlin - UniBTC
32+
merlin: aaveExports('', '0x0024818043D04B1Cc9685233D47eF7eea6Df0A5E', undefined, ['0x623700Fee1dF64088f258e2c4DAB4D6aEac4dDA6'], { v3: true }),
33+
}
2134

22-
module.exports = mergeExports(mainMarket, innovativeMarket)
35+
module.exports = mergeExports(mainMarket, innovativeMarket,pumpBTCMarkets,otherProtocolTokenMarkets)
2336
module.exports.methodology = methodologies.lendingMarket

projects/bcraft/index.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
const { sumTokens2, nullAddress } = require('../helper/unwrapLPs')
2+
const clans = "0x0De0D0cF717af57D2101F6Be0962fA890c1FBeC6"
3+
async function tvl(time, ethBlock, _b, { api}) {
4+
return sumTokens2({ tokens: [nullAddress], owner: clans, api })
5+
}
6+
7+
module.exports = {
8+
methodology: `We count the ETH on ${clans}`,
9+
base: {
10+
tvl: tvl
11+
}
12+
}

projects/binance-btc/index.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
const sdk = require('@defillama/sdk');
2+
const { sumTokensExport } = require('../helper/sumTokens');
3+
4+
const owners = [
5+
'3LYJfcfHPXYJreMsASk2jkn69LWEYKzexb'
6+
]
7+
8+
module.exports = {
9+
methodology: "BTC on btc chain",
10+
bitcoin: {
11+
tvl: sdk.util.sumChainTvls([
12+
sumTokensExport({ owners }),
13+
]),
14+
},
15+
};

projects/bitmap-game/index.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
const { staking } = require('../helper/staking')
2+
const STAKE_MERL_CONTRACT = '0xb311c4b8091aff30Bb928b17Cc59Ce5D8775b13A'
3+
const MERL_TOKEN = '0x5c46bFF4B38dc1EAE09C5BAc65872a1D8bc87378'
4+
const STAKE_BITMAP_TOKEN_CONTRACT = '0x8567bD39b8870990a2cA14Df3102a00A7d72f7E3'
5+
const BITMAP_TOKEN = '0x7b0400231Cddf8a7ACa78D8c0483890cd0c6fFD6'
6+
7+
module.exports = {
8+
merlin: {
9+
tvl: staking([STAKE_BITMAP_TOKEN_CONTRACT, STAKE_MERL_CONTRACT,], MERL_TOKEN),
10+
staking: staking([STAKE_BITMAP_TOKEN_CONTRACT, STAKE_MERL_CONTRACT,], BITMAP_TOKEN,),
11+
}
12+
}

0 commit comments

Comments
 (0)