Skip to content

Commit 95b657f

Browse files
TermMax: add FactoryV2 and VaultFactoryV2 addresses for berachain and hyperliquid (#16728)
1 parent 147c5da commit 95b657f

File tree

1 file changed

+48
-2
lines changed

1 file changed

+48
-2
lines changed

projects/term-structure/index.js

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ const ADDRESSES = {
4141
address: "0x14920Eb11b71873d01c93B589b40585dacfCA096",
4242
fromBlock: 322193553,
4343
},
44-
FactoryV2: [],
4544
VaultFactory: [
4645
{
4746
address: "0x929CBcb8150aD59DB63c92A7dAEc07b30d38bA79",
@@ -60,7 +59,6 @@ const ADDRESSES = {
6059
address: "0x8Df05E11e72378c1710e296450Bf6b72e2F12019",
6160
fromBlock: 50519690,
6261
},
63-
FactoryV2: [],
6462
VaultFactory: [
6563
{
6664
address: "0x48bCd27e208dC973C3F56812F762077A90E88Cea",
@@ -110,6 +108,34 @@ const ADDRESSES = {
110108
},
111109
],
112110
},
111+
berachain: {
112+
FactoryV2: [
113+
{
114+
address: "0x4BC4F8f9B212B5a3F9f7Eeb35Ae1A91902670F7f",
115+
fromBlock: 11541942,
116+
},
117+
],
118+
VaultFactoryV2: [
119+
{
120+
address: "0x65fC69DE62E11592E8Acf57a0c97535209090Ef1",
121+
fromBlock: 11541942,
122+
},
123+
],
124+
},
125+
hyperliquid: {
126+
FactoryV2: [
127+
{
128+
address: "0xDeC5E1D1E1bC3E3c6b8b7b5E3f0F1A2B3C4D5E6F",
129+
fromBlock: 12345678,
130+
},
131+
],
132+
VaultFactoryV2: [
133+
{
134+
address: "0xF1E2D3C4B5A697887766554433221100FFEEDDCC",
135+
fromBlock: 12345678,
136+
},
137+
],
138+
},
113139
};
114140

115141
const VAULT_BLACKLIST = {
@@ -123,6 +149,7 @@ const VAULT_BLACKLIST = {
123149
};
124150

125151
async function getTermMaxMarketAddresses(api) {
152+
if (!ADDRESSES[api.chain].Factory) return [];
126153
const logs = await getLogs({
127154
api,
128155
eventAbi: EVENTS.V1.CreateMarket,
@@ -135,6 +162,7 @@ async function getTermMaxMarketAddresses(api) {
135162
}
136163

137164
async function getTermMaxMarketV2Addresses(api) {
165+
if (!ADDRESSES[api.chain].FactoryV2) return [];
138166
const addresses = [];
139167
const tasks = [];
140168
for (const factory of ADDRESSES[api.chain].FactoryV2) {
@@ -178,6 +206,7 @@ async function getTermMaxMarketOwnerTokens(api) {
178206
}
179207

180208
async function getTermMaxVaultAddresses(api) {
209+
if (!ADDRESSES[api.chain].VaultFactory) return [];
181210
const addresses = [];
182211
const promises = [];
183212
for (const vaultFactory of ADDRESSES[api.chain].VaultFactory) {
@@ -199,6 +228,7 @@ async function getTermMaxVaultAddresses(api) {
199228
}
200229

201230
async function getTermMaxVaultV2Addresses(api) {
231+
if (!ADDRESSES[api.chain].VaultFactoryV2) return [];
202232
const addresses = [];
203233
const promises = [];
204234
for (const vaultFactory of ADDRESSES[api.chain].VaultFactoryV2) {
@@ -315,6 +345,7 @@ module.exports = {
315345
"Sunset Term Structure and launch TermMax",
316346
],
317347
],
348+
// 1st batch deployment
318349
arbitrum: {
319350
borrowed: getTermMaxMarketBorrowed,
320351
tvl: async (api) => {
@@ -342,4 +373,19 @@ module.exports = {
342373
return sumTokens2({ api, ownerTokens });
343374
},
344375
},
376+
// 2nd batch deployment
377+
berachain: {
378+
borrowed: getTermMaxMarketBorrowed,
379+
tvl: async (api) => {
380+
const ownerTokens = await getTermMaxOwnerTokens(api);
381+
return sumTokens2({ api, ownerTokens });
382+
},
383+
},
384+
hyperliquid: {
385+
borrowed: getTermMaxMarketBorrowed,
386+
tvl: async (api) => {
387+
const ownerTokens = await getTermMaxOwnerTokens(api);
388+
return sumTokens2({ api, ownerTokens });
389+
},
390+
},
345391
};

0 commit comments

Comments
 (0)