Skip to content

Commit 7f2e3ca

Browse files
committed
impermax-v3: add borrowable yields
1 parent de1a9d5 commit 7f2e3ca

File tree

5 files changed

+658
-0
lines changed

5 files changed

+658
-0
lines changed

src/adaptors/impermax-v3/abi.js

+220
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,220 @@
1+
module.exports = {
2+
allLendingPools: {
3+
constant: true,
4+
inputs: [
5+
{
6+
internalType: 'uint256',
7+
name: '',
8+
type: 'uint256',
9+
},
10+
],
11+
name: 'allLendingPools',
12+
outputs: [
13+
{
14+
internalType: 'address',
15+
name: '',
16+
type: 'address',
17+
},
18+
],
19+
payable: false,
20+
stateMutability: 'view',
21+
type: 'function',
22+
},
23+
allLendingPoolsLength: {
24+
constant: true,
25+
inputs: [],
26+
name: 'allLendingPoolsLength',
27+
outputs: [
28+
{
29+
internalType: 'uint256',
30+
name: '',
31+
type: 'uint256',
32+
},
33+
],
34+
payable: false,
35+
stateMutability: 'view',
36+
type: 'function',
37+
},
38+
getLendingPool: {
39+
constant: true,
40+
inputs: [
41+
{
42+
internalType: 'address',
43+
name: '',
44+
type: 'address',
45+
},
46+
],
47+
name: 'getLendingPool',
48+
outputs: [
49+
{
50+
internalType: 'bool',
51+
name: 'initialized',
52+
type: 'bool',
53+
},
54+
{
55+
internalType: 'uint24',
56+
name: 'lendingPoolId',
57+
type: 'uint24',
58+
},
59+
{
60+
internalType: 'address',
61+
name: 'collateral',
62+
type: 'address',
63+
},
64+
{
65+
internalType: 'address',
66+
name: 'borrowable0',
67+
type: 'address',
68+
},
69+
{
70+
internalType: 'address',
71+
name: 'borrowable1',
72+
type: 'address',
73+
},
74+
],
75+
payable: false,
76+
stateMutability: 'view',
77+
type: 'function',
78+
},
79+
underlying: {
80+
constant: true,
81+
inputs: [],
82+
name: 'underlying',
83+
outputs: [
84+
{
85+
internalType: 'address',
86+
name: '',
87+
type: 'address',
88+
},
89+
],
90+
payable: false,
91+
stateMutability: 'view',
92+
type: 'function',
93+
},
94+
totalBorrows: {
95+
constant: true,
96+
inputs: [],
97+
name: 'totalBorrows',
98+
outputs: [{ internalType: 'uint112', name: '', type: 'uint112' }],
99+
payable: false,
100+
stateMutability: 'view',
101+
type: 'function',
102+
},
103+
underlying: {
104+
constant: true,
105+
inputs: [],
106+
name: 'underlying',
107+
outputs: [{ internalType: 'address', name: '', type: 'address' }],
108+
payable: false,
109+
stateMutability: 'view',
110+
type: 'function',
111+
},
112+
symbol: {
113+
inputs: [],
114+
name: 'symbol',
115+
outputs: [{ internalType: 'string', name: '', type: 'string' }],
116+
stateMutability: 'view',
117+
type: 'function',
118+
},
119+
getReserves: {
120+
constant: true,
121+
inputs: [],
122+
name: 'getReserves',
123+
outputs: [
124+
{ internalType: 'uint112', name: 'reserve0', type: 'uint112' },
125+
{ internalType: 'uint112', name: 'reserve1', type: 'uint112' },
126+
{ internalType: 'uint32', name: 'blockTimestampLast', type: 'uint32' },
127+
],
128+
payable: false,
129+
stateMutability: 'view',
130+
type: 'function',
131+
},
132+
token0: {
133+
constant: true,
134+
inputs: [],
135+
name: 'token0',
136+
outputs: [{ internalType: 'address', name: '', type: 'address' }],
137+
payable: false,
138+
stateMutability: 'view',
139+
type: 'function',
140+
},
141+
token1: {
142+
constant: true,
143+
inputs: [],
144+
name: 'token1',
145+
outputs: [{ internalType: 'address', name: '', type: 'address' }],
146+
payable: false,
147+
stateMutability: 'view',
148+
type: 'function',
149+
},
150+
decimals: {
151+
constant: true,
152+
inputs: [],
153+
name: 'decimals',
154+
outputs: [{ internalType: 'uint8', name: '', type: 'uint8' }],
155+
payable: false,
156+
stateMutability: 'view',
157+
type: 'function',
158+
},
159+
reserveFactor: {
160+
constant: true,
161+
inputs: [],
162+
name: 'reserveFactor',
163+
outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
164+
payable: false,
165+
stateMutability: 'view',
166+
type: 'function',
167+
},
168+
borrowRate: {
169+
constant: true,
170+
inputs: [],
171+
name: 'borrowRate',
172+
outputs: [{ internalType: 'uint48', name: '', type: 'uint48' }],
173+
payable: false,
174+
stateMutability: 'view',
175+
type: 'function',
176+
},
177+
factory: {
178+
inputs: [],
179+
name: 'factory',
180+
outputs: [{ internalType: 'address', name: '', type: 'address' }],
181+
stateMutability: 'view',
182+
type: 'function',
183+
},
184+
totalSupply: {
185+
constant: true,
186+
inputs: [],
187+
name: 'totalSupply',
188+
outputs: [{ internalType:'uint256', name: '', 'type': 'uint256'}],
189+
payable: false,
190+
stateMutability:'view',
191+
type: 'function'
192+
},
193+
safetyMarginSqrt: {
194+
constant: true,
195+
inputs: [],
196+
name: 'safetyMarginSqrt',
197+
outputs: [{ internalType:'uint256', name: '', 'type': 'uint256'}],
198+
payable: false,
199+
stateMutability:'view',
200+
type: 'function'
201+
},
202+
liquidationPenalty: {
203+
constant: true,
204+
inputs: [],
205+
name: 'liquidationPenalty',
206+
outputs: [{ internalType:'uint256', name: '', 'type': 'uint256'}],
207+
payable: false,
208+
stateMutability:'view',
209+
type: 'function'
210+
},
211+
liquidationIncentive: {
212+
constant: true,
213+
inputs: [],
214+
name: 'liquidationIncentive',
215+
outputs: [{ internalType:'uint256', name: '', 'type': 'uint256'}],
216+
payable: false,
217+
stateMutability:'view',
218+
type: 'function'
219+
},
220+
};

src/adaptors/impermax-v3/blacklist.js

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
const blacklistedLendingPools = {
2+
ethereum: [
3+
/* No token prices */
4+
'0x3e5b7929c71b4d6fe88c3577382786d6169005d7',
5+
'0x4849bb3f7fcad49437f3107a578e063677424302',
6+
'0x81ec6e89fd4e45c90ce77c9abbea3629f649c4e9',
7+
'0x8dcba0b75c1038c4babbdc0ff3bd9a8f6979dd13',
8+
'0xa00d47b4b304792eb07b09233467b690db847c91',
9+
'0xe46456153cf0e767528f4a4cd3b613d5c4101e48',
10+
'0xefa2e1e46b83d572d01521c4c64845b0227b6314',
11+
'0xf28e099827cb05c9c35397859b4b626218c5a1cc',
12+
],
13+
polygon: [
14+
/* very old pools ignore */
15+
'0x1e987756305c6506a8687e6ceb85872c48ceaa3b',
16+
'0x2bb779ce585a19a202ccc6e583968431b3f15ea8',
17+
'0x5c796c3cee0ca11e21f707bc3dfea8edda6b197d',
18+
'0x63489c42530234b8f5d1124d2e671129be32b3b5',
19+
'0xb343cc2378dcff9a6f81b4eee3d8ecdc88560f6a',
20+
'0xb957d5a232eebd7c4c4b0a1af9f2043430304e65',
21+
'0xc1b384610a90513ea599bb15fefa3d5bffb2a790',
22+
'0xec07dd093007aae16508f76c07d26217b7db9f1b',
23+
'0x2cbc4487f0b489d554b72b2e7f9679c3cd1efbc2',
24+
'0x06d3ae1cfe7d3d27b8b9f541e2d76e5f33778923',
25+
'0x242dd049be49e795cd60f0da812deef7cf4104dc',
26+
'0x7166f0509bd1deedf90e42046025d929078089b4',
27+
'0x6817f1adf8fc29f5cf23ba814cee18120f5e88b7',
28+
],
29+
fantom: [
30+
'0x65151e7a82c4415a73756608e2c66b39a57dca12'.toLowerCase(),
31+
'0x16875107bb3ce4b0c120c95b3b8d3f94d799c0ef'.toLowerCase(),
32+
],
33+
scroll: [
34+
/* deployed with the univ2 not staked so ignore these */
35+
'0x838D141BdBECeAA2EB1C576b6a4309f26f795CF2'.toLowerCase(), // tkn/chi
36+
'0xFFCe6dB18f18D711EF7Bf45b501A6b652b44bC43'.toLowerCase(), // zen/chi
37+
'0xD448ac2A2d9C85010459E5f5Bf81931E5Bc40EC3'.toLowerCase(), // chi/weth
38+
'0x7f0997bC0ee78553DDAb736d945b7Ba10Fe38B2E'.toLowerCase(), // wbtc/weth
39+
'0x94d81405985A4c34EaC4945d2b98c74258EdD07F'.toLowerCase(), // tkn/chi - stakedlp
40+
'0xE8f4895DF06a0c69A9BA87509EfdBBFBAFe86c2d'.toLowerCase(), // weth/tkn - stakedlp
41+
'0x7c80Be56a6f23A3E598822648baaFD7524fe1239'.toLowerCase(), // chi/wUKRE stakedlp
42+
'0xDD14d0c651C63e1EeA5bd8b250cf99757425D68F'.toLowerCase(), // chi/usdc stakedlp
43+
],
44+
arbitrum: [
45+
/* Exclude IMX/WETH pool on sushi */
46+
'0xb7e5e74b52b9ada1042594cfd8abbdee506cc6c5',
47+
/* No token prices */
48+
'0x15ed28e9396fa906b2a2bca0c729d7cced7c646e',
49+
'0xcc5c1540683aff992201d8922df44898e1cc9806',
50+
'0x01a464e2bf76bd4a3a50073026ff2335584d67d8',
51+
'0x1c1ccd7199afb175b425e9a1a910a3326f73faa3',
52+
'0x3d5fcbed1c9b6c9b0f6dea1ded55b161a6efef31',
53+
'0x4b28550846405a7825247f54070b568c2ece3eeb',
54+
'0xcf49f93ff15b0ab9d336f1d5c8697f12d95012c4',
55+
],
56+
};
57+
58+
const blacklistedLendingVaults = {
59+
scroll: ['0x83f22f87f504f8b9f10eb73ab05c58a0973b6681'],
60+
polygon: [],
61+
real: [],
62+
arbitrum: ['0x7f2ffc27618afded2813e457953514c54778fa1c'],
63+
ethereum: [],
64+
optimism: [],
65+
fantom: [],
66+
};
67+
68+
module.exports = {
69+
blacklistedLendingPools,
70+
blacklistedLendingVaults,
71+
};
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
const GECKOTERMINAL_IDS = {
2+
avalanche: 'avax',
3+
ethereum: 'eth',
4+
polygon: 'polygon_pos',
5+
arbitrum: 'arbitrum',
6+
fantom: 'ftm',
7+
base: 'base',
8+
scroll: 'scroll',
9+
optimism: 'optimism',
10+
real: 're-al',
11+
blast: 'blast',
12+
sonic: 'sonic'
13+
}
14+
15+
module.exports = {
16+
GECKOTERMINAL_IDS
17+
}

0 commit comments

Comments
 (0)