Skip to content

Commit adf3a3c

Browse files
WardenJakxg1nt0ki
andauthored
[FEAT]: Add definitive.fi (DefiLlama#9200)
* definitive adapter * code refactor --------- Co-authored-by: g1nt0ki <[email protected]>
1 parent 762f06b commit adf3a3c

File tree

1 file changed

+90
-0
lines changed

1 file changed

+90
-0
lines changed

projects/definitive/index.js

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
const CommunityVaultsLP = {
2+
arbitrum: [
3+
"0xbE3cb8CA59487D39b49d33A124cC93a83cB6fd16"
4+
],
5+
avax: [
6+
"0xe5b54e79cD1D53024A94df479B3099DBE72FB662",
7+
"0x1499BeB1FBf76420704e12a9F7E3Af99dCc39618",
8+
"0xEeF282aCCa091bE35AaCC0a6ce38708530749170",
9+
"0x99C409C681650964296916780A7aB540fFBd4Bc4",
10+
"0x123384ba6Cde21a3E8874cA878dF9d8a1326A0c6",
11+
"0x4a86E2ceE61a41a2F5c97906431611F1F26881ec",
12+
"0x90529324E6901fA8f69F207A6E58CE6F4367a519",
13+
"0x486B322cbcBf92A463769F0b1284D2b63FD66E2C",
14+
"0xd91f00d6Add5A1A59589B4756C3193892540B7d0",
15+
"0x751c09F0803C1351019c2249C3efA42C6e1ABaDD",
16+
"0xb4d844B64e972eA41dC87714A04EfF4CbFffDBaf"
17+
],
18+
base: [
19+
"0x85fa0A64c9D181226496A132BbBd1fc34116aAB9",
20+
"0xc38E40C35469d8e226E6ef39ff6741b5d1ef3C96",
21+
"0x6221452d88C21eC9D9Ea201191CEbEb47a758228",
22+
"0x70408e74fF424866c4F3b537892393B0228ea26f",
23+
"0xf9536Fe70c056f1d1220E5d73E1A2d8e9Ed770Ad",
24+
"0x20F3A0a03bd4a53eD32A259252469a345F45CB91",
25+
"0xc252d7692D9540DFb2be9932cfCf22b085dc81F8",
26+
"0x0F5a1bb0AA76fFfe8216b9D659ae56d948F1c375",
27+
"0x143e11dC78F8DCd39EDD70A90Baf89588a3a350B",
28+
"0x9BA4b909E2B40706ff1cD209B34006FD73c42A6D",
29+
"0x994c3586401a7fA10CA2E73136f7B7d1D251A640",
30+
"0xd3cc1C60c8C90f0B8CBb6334Da7bdEc505C28255",
31+
"0xc446F6d3178ccaAf919cB27D1C5FCc21C37f88dd"
32+
],
33+
ethereum: [
34+
"0xFefb05EB5abc0c378120b93ff37CEc8af4872A18"
35+
],
36+
optimism: [
37+
"0x4bBC0bFA0ea23fAec258924823bF9a3f870aAa95",
38+
"0xA1185B84FF6F18C00234995E8BE5aA9e701bad82",
39+
"0xfCAe29Da7c6cA5de03328E19f67E7b761ae39c15",
40+
"0x62FA680af3B0F546624645D9E40eE77607D4cEc3",
41+
"0x5Cdcc84bf78e89Da688d08a5d52100D0c33c751A"
42+
],
43+
polygon: [
44+
"0x926b5A53A6fd4f11177e5c4781551d5E58d75C3C",
45+
"0xBF279cc0d2E046F10D042F772dCe98B136f3B811"
46+
]
47+
}
48+
49+
const CommunityVaultsLLSD = {
50+
arbitrum: [
51+
"0x449b72B665C28D6190ff08A21b2130CaCf06E1c8" // Aave wstETH
52+
],
53+
avax: [
54+
"0xa460802fc6e7c1401B06078B332d5A1B52dff0D1",
55+
"0x7402282F04740F2f8CE97eE426f90d6F800A3C21",
56+
],
57+
base: [
58+
"0xC2cA42Ac871753d4623766581b7A963c2AD7209B",
59+
"0x035569b57390a095b4b3f7754214b39CA3145C75",
60+
"0xB3E741Ee16Df64eF9274261A397Df6Fd54073FFB"
61+
],
62+
ethereum: [
63+
"0x954F286AEc288af89601F53e5D8727540ba2f00f",
64+
"0x4184a083307a208f5bF20d0B44E161Bc55aae996"
65+
],
66+
optimism: [
67+
"0x3796103d23D207fB5db2CFEc97fd7a0ac0A70D82",
68+
"0xB2a74028CcCA97C4fA4686802246FdDEAa3A941B"
69+
],
70+
polygon: [
71+
"0x8347B60460421EE565F3aC26DaFbAC9D2fE8930e"
72+
],
73+
}
74+
75+
async function tvl(_, _1, _2, { api }) {
76+
/** Hyperstaking Community Vaults */
77+
const LLSDs = CommunityVaultsLLSD[api.chain]
78+
/** LP Community Vaults */
79+
const LPVaults = CommunityVaultsLP[api.chain]
80+
81+
return api.erc4626Sum({ calls: LLSDs.concat(LPVaults), isOG4626: true, })
82+
}
83+
84+
module.exports = {
85+
methodology: "For Hyperstaking, an onchain method calculates collateral + balance - debt. For LP, we can just calculate the value of LP tokens held in the vault"
86+
}
87+
88+
Object.keys(CommunityVaultsLP).forEach(chain => {
89+
module.exports[chain] = { tvl }
90+
})

0 commit comments

Comments
 (0)