Skip to content

Commit f2460d2

Browse files
committed
Merge remote-tracking branch 'origin2/main'
# Conflicts: # projects/yel/index.js
2 parents 7cc16ca + 719452c commit f2460d2

File tree

213 files changed

+4140
-3472
lines changed

Some content is hidden

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

213 files changed

+4140
-3472
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Please send answers to questions there https://github.com/DefiLlama/DefiLlama-Ad
2020

2121
## Work in progress
2222

23-
This is a work in progress. The goal is to eventually handle historical data. DefiLlama aims to be transparent, accurate and open source.
23+
This is a work in progress. DefiLlama aims to be transparent, accurate and open source.
2424

2525
If you have any suggestions, want to contribute or want to chat, please join [our discord](https://discord.defillama.com/) and drop a message.
2626

@@ -29,6 +29,8 @@ If you have any suggestions, want to contribute or want to chat, please join [ou
2929
node test.js projects/pangolin/index.js
3030
# Add a timestamp at the end to run the adapter at a historical timestamp
3131
node test.js projects/aave/v3.js 1729080692
32+
# or using YYYY-MM-DD
33+
node test.js projects/aave/v3.js 2024-10-16
3234
```
3335

3436
## Changing RPC providers
@@ -39,7 +41,7 @@ BSC_RPC="..."
3941
POLYGON_RPC="..."
4042
```
4143

42-
The name of each rpc is `{CHAIN-NAME}_RPC`, and the name we use for each chain can be found [here](https://github.com/DefiLlama/defillama-sdk/blob/master/src/providers.json)
44+
The name of each rpc is `{CHAIN-NAME}_RPC`, and the name we use for each chain can be found [here](https://unpkg.com/@defillama/sdk@5.0.116/build/providers.json). If you run into issues with a chain make sure to update the sdk with `npm update @defillama/sdk`.
4345

4446
## Adapter rules
4547
- Never add extra npm packages, if you need a chain-level package for your chain, ask us and we'll consider it, but we can't accept any npm package that is project-specific

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

projects/5ire-dapp-staking/index.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
const STAKING_CONTRACT_V1 = "0xaa137EC3474ab407f3Be37b16576227dfE75Eb8D"
2+
const STAKING_CONTRACT_V2 = "0x83D1B4277454EDAcF54A14fc586326386648A959"
3+
const TOKEN_5IRE_ETH = "0x3bd7d4F524D09F4e331577247A048D56e4b67a7F"
4+
const { stakings } = require("../helper/staking")
5+
6+
7+
module.exports = {
8+
methodology: 'Total staked tokens in 5ire Dapp Staking',
9+
ethereum: {
10+
tvl: () => ({}),
11+
staking: stakings([STAKING_CONTRACT_V1, STAKING_CONTRACT_V2], TOKEN_5IRE_ETH),
12+
},
13+
}
14+
15+
16+

projects/abracadabra/api.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
const {fetchChainExports} = require('../helper/exports')
21
const {fetchURL} = require('../helper/utils')
32

43
const endpoint = "https://analytics.abracadabra.money/api/statistic/tvl"
@@ -18,10 +17,14 @@ function chainTvl(chain){
1817
}
1918
}
2019

21-
module.exports = fetchChainExports(chainTvl, Object.keys(chainIds))
2220
module.exports.misrepresentedTokens = true;
2321
module.exports.hallmarks = [
2422
[1651881600, "UST depeg"],
2523
[1643245200, "0xSifu revealed as QuadrigaCX founder"],
2624
[1667826000, "FTX collapse, Alameda repays FTT loans"],
2725
]
26+
27+
28+
Object.keys(chainIds).forEach(chain => {
29+
module.exports[chain] = { tvl: chainTvl(chain) }
30+
})

projects/accumulated-finance/index.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
const ADDRESSES = require('../helper/coreAssets.json')
1+
const ADDRESSES = require('../helper/coreAssets.json');
2+
const { sumTokens2 } = require('../helper/unwrapLPs');
23

34
const config = {
45
"accumulate": [
@@ -70,6 +71,13 @@ const config = {
7071
}
7172
}
7273
],
74+
"artela": [
75+
{
76+
"artela": {
77+
"LST": "0xcba2aeec821b0b119857a9ab39e09b034249681a"
78+
},
79+
}
80+
],
7381
"stETH": [
7482
{
7583
"ethereum": {
@@ -115,7 +123,7 @@ Object.entries(transformedConfig).forEach(([chain, configs]) => {
115123
totalSupply += parseInt(supply, 10);
116124
api.add(token ?? baseToken ?? ADDRESSES.null, supply, { skipChain: !!baseToken })
117125
}
118-
return api.getBalances();
126+
return sumTokens2({ api })
119127
},
120128
}
121129
})

projects/alphafi/index.js

Lines changed: 47 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -166,13 +166,6 @@ const ALPHAFI_BLUEFIN_TVL_IDS = [
166166
token0Type: ADDRESSES.sui.SUI,
167167
token1Type: "0x2053d08c1e2bd02791056171aab0fd12bd7cd7efad2ab8f6b9c8902f14df2ff2::ausd::AUSD"
168168
},
169-
{ //alpha usdc
170-
poolID: "0x4540c5e7de64088c0c2c30abc51f7e6bbe6bc48703667c108aa1de23f6aa40e6",
171-
parentPoolID: "0x6595edf6d8c8b6894a5c6760843ae2fde81cb37d8586984dd1345b0f00bfecd8",
172-
investorID: "0x187ca6f373d20465a730125c93e62a96c6a73354a1a8b35cbdd2b39278b7b141",
173-
token0Type: "0xfe3afec26c59e874f3c1d60b8203cb3852d2bb2aa415df9548b8d688e6683f93::alpha::ALPHA",
174-
token1Type: ADDRESSES.sui.USDC_CIRCLE
175-
},
176169
{ //wbtc usdc
177170
poolID: "0xbc0de037958d7988710c40f4e7317f8f3ffca4fa3cc9e1c18bc1ebd7ec65cd6e",
178171
parentPoolID: "0x38282481e3a024c50254c31ebfc4710e003fe1b219c0aa31482a860bd58c4ab0",
@@ -250,6 +243,20 @@ const ALPHAFI_BLUEFIN_TVL_IDS = [
250243
token0Type: ADDRESSES.sui.suiUSDT,
251244
token1Type: ADDRESSES.sui.USDC_CIRCLE
252245
},
246+
{ // stsui buck
247+
poolID: "0xdee56209e25c0eafdd3e06ee9f4aae03d173478d158fb4c5c1fbae7c75d4cd72",
248+
parentPoolID: "0x0bc35f5b7e7b77dadc62c2630e9efafb1beb4122fd5393bf3b99586abf3ca8b1",
249+
investorID: "0xb5633adb8cfb5a4e6580002b21bc403d5d096dbca07495986b4882619ce05279",
250+
token0Type: "0xd1b72982e40348d069bb1ff701e634c117bb5f741f44dff91e472d3b01461e55::stsui::STSUI",
251+
token1Type: ADDRESSES.sui.BUCK
252+
},
253+
{ // stsui musd
254+
poolID: "0xb251e187a4e688dd3dbbf378e4aacfdd41de6a81e2a4bc10c7b80e056c1da630",
255+
parentPoolID: "0x0da4bcb1669ae3b6ce80f024e3a2076e2c4e2cc899d4724fce94da0f729bc968",
256+
investorID: "0xa8a705f8819e01396927c1ec179a140750597ed3b5268d205bbf5240979fda86",
257+
token0Type: "0xd1b72982e40348d069bb1ff701e634c117bb5f741f44dff91e472d3b01461e55::stsui::STSUI",
258+
token1Type: "0xe44df51c0b21a27ab915fa1fe2ca610cd3eaa6d9666fe5e62b988bf7f0bd8722::musd::MUSD"
259+
},
253260

254261
]
255262
const ALPHAFI_BLUEFIN_AUTOBALANCE_TVL_IDS = [
@@ -274,6 +281,27 @@ const ALPHAFI_BLUEFIN_AUTOBALANCE_TVL_IDS = [
274281
token0Type: ADDRESSES.sui.suiUSDT,
275282
token1Type: ADDRESSES.sui.USDC_CIRCLE
276283
},
284+
{ //deep sui
285+
poolID: "0x76fb78985fae4cf24bcd933ea5e8a6e818e9d4b51c091c4c4a78b6720199e81e",
286+
parentPoolID: "0x1b06371d74082856a1be71760cf49f6a377d050eb57afd017f203e89b09c89a2",
287+
investorID: "0x217a85380d0cf4b4c5a870b8f6d11b8e3bc66de87e86d0376080ca7e60e6506c",
288+
token0Type: "0xdeeb7a4662eec9f2f3def03fb937a663dddaa2e215b8078a284d026b7946c270::deep::DEEP",
289+
token1Type: ADDRESSES.sui.SUI
290+
},
291+
{ //blue sui
292+
poolID: "0xb8cf0bf8b39f465c1b845e5ee8c2c53424c3faf97fb8e0ef1139abb9001e844a",
293+
parentPoolID: "0xde705d4f3ded922b729d9b923be08e1391dd4caeff8496326123934d0fb1c312",
294+
investorID: "0xf7785cf8b3d3f9bee48bf4d90a142d7ec98b25d6784408ffedc11633d7124197",
295+
token0Type: "0xe1b45a0e641b9955a20aa0ad1c1f4ad86aad8afb07296d4085e349a50e90bdca::blue::BLUE",
296+
token1Type: ADDRESSES.sui.SUI
297+
},
298+
{ //deep blue
299+
poolID: "0x37671a77fb00a3323304f2586d18694bb93a6bc840e8184634ebe66d69eb48db",
300+
parentPoolID: "0x4b8271fc4819078e44ee9a0506a824b77464789d57ace355d0562a4776c51840",
301+
investorID: "0x90364be9cca6c1df042f269fb944fd49ba1c74688789fe33329aa6d40ac8552a",
302+
token0Type: "0xdeeb7a4662eec9f2f3def03fb937a663dddaa2e215b8078a284d026b7946c270::deep::DEEP",
303+
token1Type: "0xe1b45a0e641b9955a20aa0ad1c1f4ad86aad8afb07296d4085e349a50e90bdca::blue::BLUE"
304+
},
277305
]
278306
const ALPHAFI_NAVI_TVL_IDS = [
279307
{
@@ -331,6 +359,11 @@ const ALPHAFI_NAVI_TVL_IDS = [
331359
tokenType: "0xa99b8952d4f7d947ea77fe0ecdcc9e5fc0bcab2841d6e2a5aa00c3044e5544b5::navx::NAVX",
332360
expo: 9
333361
},
362+
{
363+
poolID: "0xd1125035ab6e2889239442031c130c641b75b430b71057bb79710ad578cc2867",
364+
tokenType: "0xd1b72982e40348d069bb1ff701e634c117bb5f741f44dff91e472d3b01461e55::stsui::STSUI",
365+
expo: 9
366+
},
334367
]
335368
const ALPHAFI_NAVI_LOOP_TVL_IDS = [
336369
{ //sui vsui
@@ -386,6 +419,13 @@ const ALPHAFI_POOL2_IDS = [{
386419
token0Type: "0xfe3afec26c59e874f3c1d60b8203cb3852d2bb2aa415df9548b8d688e6683f93::alpha::ALPHA",
387420
token1Type: ADDRESSES.sui.USDC_CIRCLE
388421
},
422+
{ //alpha usdc
423+
poolID: "0x4540c5e7de64088c0c2c30abc51f7e6bbe6bc48703667c108aa1de23f6aa40e6",
424+
parentPoolID: "0x6595edf6d8c8b6894a5c6760843ae2fde81cb37d8586984dd1345b0f00bfecd8",
425+
investorID: "0x187ca6f373d20465a730125c93e62a96c6a73354a1a8b35cbdd2b39278b7b141",
426+
token0Type: "0xfe3afec26c59e874f3c1d60b8203cb3852d2bb2aa415df9548b8d688e6683f93::alpha::ALPHA",
427+
token1Type: ADDRESSES.sui.USDC_CIRCLE
428+
},
389429
]
390430

391431
const ALPHA_POOL_ID = "0x6ee8f60226edf48772f81e5986994745dae249c2605a5b12de6602ef1b05b0c1"

projects/amped/index.js

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,26 @@ const phoenixVaultAddress = '0xa6b88069EDC7a0C2F062226743C8985FF72bB2Eb';
55
const phoenixStakingAddress = '0x3c9586567a429BA0467Bc63FD38ea71bB6B912E0';
66
const phoenixAmpAddress = '0xca7F14F14d975bEFfEe190Cd3cD232a3a988Ab9C';
77

8+
const sonicVaultAddress = '0x11944027D4eDC1C17db2D5E9020530dcEcEfb85b';
9+
const sonicStakingAddress = '0xb382901Ff357afb612e3E239656fc5F2FDe250dc';
10+
const sonicAmpAddress = '0xAc611438AE5F3953DeDB47c2ea8d6650D601C1B4';
11+
12+
const bscVaultAddress = '0xdcFaaf6f3bb71B270404992853588BE9B7fc89EA';
13+
const bscStakingAddress = '0x9fe50b66fc34cA06BbC684fF13242d61c860F190';
14+
const bscAmpAddress = '0x16DF3d8978d17fE725Dc307aD14FdE3B12E6Da75';
15+
816
module.exports = {
917
start: '2024-06-06',
1018
lightlink_phoenix: {
11-
staking: staking(phoenixStakingAddress, phoenixAmpAddress),
12-
tvl: gmxExports({ vault: phoenixVaultAddress, })
19+
staking: staking(phoenixStakingAddress, phoenixAmpAddress),
20+
tvl: gmxExports({ vault: phoenixVaultAddress, })
21+
},
22+
bsc: {
23+
staking: staking(bscStakingAddress, bscAmpAddress),
24+
tvl: gmxExports({ vault: bscVaultAddress, })
1325
},
14-
};
26+
sonic: {
27+
staking: staking(sonicStakingAddress, sonicAmpAddress),
28+
tvl: gmxExports({ vault: sonicVaultAddress, })
29+
}
30+
};

projects/arcadia-finance-v2/index.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,10 @@ async function unwrapArcadiaAeroLP({ api, ownerIds }) {
5353

5454
async function uwrapStakedSlipstreamLP({ api, sSlipNftIds, }) {
5555
const { slipNFT } = config;
56-
const balances = api.getBalances();
5756

5857
// Arcadia's staked slipstream NFT wrapper issues a position with the same ID as the wrapped NFT
5958
// -> fetch the values of the wrapped IDs by simply fetching the values of those IDs on the native slipstream NFT
60-
await unwrapSlipstreamNFT({ balances: balances, positionIds: sSlipNftIds, nftAddress: slipNFT, chain: 'base', blacklistedTokens: [], whitelistedTokens: [], uniV3ExtraConfig: {} });
59+
await unwrapSlipstreamNFT({ api, positionIds: sSlipNftIds, nftAddress: slipNFT, });
6160
}
6261

6362
async function tvl (api) {
@@ -67,6 +66,8 @@ async function tvl (api) {
6766
const accs = []
6867

6968
const uTokens = await api.multiCall({ abi: "address:asset", calls: pools });
69+
await api.sumTokens({ blacklistedTokens: [uniNFT, slipNFT, wAeroNFT, sAeroNFT, sSlipNFT, alienBaseNFT], tokensAndOwners2: [uTokens, pools] });
70+
7071
const accounts = await api.fetchList({ lengthAbi: 'allAccountsLength', itemAbi: 'allAccounts', target: factory, })
7172
const assetDatas = await api.multiCall({ abi: abi.generateAssetData, calls: accounts, permitFailure: true })
7273

@@ -83,7 +84,7 @@ async function tvl (api) {
8384
await sumTokens2({ api, owners: accs, uniV3ExtraConfig: { nftAddress: alienBaseNFT } })
8485

8586
// add all simple ERC20s
86-
await api.sumTokens({ ownerTokens, blacklistedTokens: [uniNFT, slipNFT, wAeroNFT, sAeroNFT, sSlipNFT, alienBaseNFT], tokensAndOwners2: [uTokens, pools] });
87+
await api.sumTokens({ ownerTokens, blacklistedTokens: [uniNFT, slipNFT, wAeroNFT, sAeroNFT, sSlipNFT, alienBaseNFT],});
8788

8889
// add all Arcadia-wrapped LP positions
8990
await unwrapArcadiaAeroLP({ api, ownerIds });
@@ -95,6 +96,7 @@ async function tvl (api) {
9596
module.exports = {
9697
methodology: "TVL is calculated as the sum of all Account values and the available balance in the liquidity pools. Assets are not double counted.",
9798
base: { tvl },
99+
isHeavyProtocol: true,
98100
start: '2024-03-25', // Mon Mar 25 2024 18:00:00 GMT+0000
99101
hallmarks: [
100102
[Math.floor(new Date("2024-04-03") / 1e3), "Points program announced."],

projects/artexswap_xyz/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
const { uniTvlExports } = require('../helper/unknownTokens')
2+
module.exports = uniTvlExports({
3+
'artela': '0xb1F3A78eaE0A85a0940AC87FCF98db8d05225FB9'
4+
})

projects/atoll/index.js

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
2+
const atETH = '0x284D81e48fBc782Aa9186a03a226690aEA5cBe0E';
3+
const scETH = '0x3bce5cb273f0f148010bbea2470e7b5df84c7812';
4+
const WETH = '0x50c42deacd8fc9773493ed674b675be577f2634b';
5+
6+
async function tvl(api) {
7+
// swapx atETH-scETH AMO
8+
const AMO_adapter_swapx_atETHscETH = '0x8c4c8ec44b10bcc62afaa3caa73c6b99469c48db';
9+
const swapx_atETHscETH_gauge = '0xBBb10f33DCDd50BD4317459A4B051FC319B29585';
10+
const swapx_atETHscETH_LP = "0x20737388dbc9F7E56f4Cc69D41DA62C96B355DB0"
11+
12+
const vault_AMO_owned = await api.call({
13+
abi: 'erc20:balanceOf',
14+
target: swapx_atETHscETH_gauge,
15+
params: [AMO_adapter_swapx_atETHscETH],
16+
});
17+
const vault_total_supply = await api.call({
18+
abi: 'erc20:totalSupply',
19+
target: swapx_atETHscETH_LP,
20+
});
21+
const [vault_atETH_amount, vault_scETH_amount] = await api.call({
22+
abi: 'function getTotalAmounts() view returns (uint256,uint256)',
23+
target: swapx_atETHscETH_LP,
24+
});
25+
26+
const AMO_atETH_amount = vault_atETH_amount * vault_AMO_owned / vault_total_supply
27+
const AMO_scETH_amount = vault_scETH_amount * vault_AMO_owned / vault_total_supply
28+
console.log(AMO_atETH_amount, AMO_scETH_amount)
29+
api.addTokens([atETH, scETH], [AMO_atETH_amount, AMO_scETH_amount])
30+
31+
}
32+
33+
module.exports = {
34+
methodology: 'AMO owned liquidity',
35+
sonic: {
36+
tvl,
37+
}
38+
};

0 commit comments

Comments
 (0)