@1delta/margin-fetcher 0.0.19 → 0.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/abis/aave-v2/YLDR.d.ts.map +1 -1
- package/dist/abis/aave-v2/YLDR.js +176 -148
- package/dist/abis/aave-v3/YLDR.js +29 -29
- package/dist/abis/compound-v3/Comet.d.ts +0 -20
- package/dist/abis/compound-v3/Comet.d.ts.map +1 -1
- package/dist/abis/compound-v3/Comet.js +0 -25
- package/dist/lending/fetchLender.js +1 -1
- package/dist/lending/user-data/abis.d.ts +20 -20
- package/dist/lending/user-data/compound-v3/userCallBuild.d.ts.map +1 -1
- package/dist/lending/user-data/compound-v3/userCallBuild.js +1 -7
- package/dist/lending/user-data/compound-v3/userCallParse.d.ts +2 -2
- package/dist/lending/user-data/compound-v3/userCallParse.d.ts.map +1 -1
- package/dist/lending/user-data/compound-v3/userCallParse.js +19 -20
- package/dist/lending/user-data/morpho/userCallBuild.d.ts.map +1 -1
- package/dist/lending/user-data/morpho/userCallBuild.js +6 -4
- package/dist/prices/main-prices/addresses/morpho.d.ts.map +1 -1
- package/dist/prices/main-prices/addresses/morpho.js +191 -0
- package/dist/prices/main-prices/fetchOracleData.js +4 -2
- package/dist/yields/index.d.ts.map +1 -1
- package/dist/yields/index.js +13 -1
- package/package.json +2 -2
- package/src/abis/aave-v2/YLDR.ts +177 -149
- package/src/abis/aave-v3/YLDR.ts +45 -45
- package/src/abis/compound-v3/Comet.ts +0 -25
- package/src/lending/fetchLender.ts +1 -1
- package/src/lending/user-data/compound-v3/userCallBuild.ts +1 -8
- package/src/lending/user-data/compound-v3/userCallParse.ts +39 -29
- package/src/lending/user-data/morpho/userCallBuild.ts +6 -4
- package/src/prices/main-prices/addresses/morpho.ts +191 -0
- package/src/prices/main-prices/fetchOracleData.ts +4 -2
- package/src/yields/index.ts +15 -0
- package/test/index.test.ts +101 -97
- package/test/mainPriceMB.test.ts +1 -1
- package/test/mainPrices.test.ts +2 -2
- package/test/morpho.test.ts +1 -1
- package/test/morphoPrice.test.ts +1 -1
- package/test/yields.test.ts +27 -0
- package/tsconfig.json +2 -1
- package/dist/abis/aave/AToken.d.ts +0 -526
- package/dist/abis/aave/AToken.d.ts.map +0 -1
- package/dist/abis/aave/AToken.js +0 -686
- package/dist/abis/aave/AavePoolV3.d.ts +0 -819
- package/dist/abis/aave/AavePoolV3.d.ts.map +0 -1
- package/dist/abis/aave/AavePoolV3.js +0 -1060
- package/dist/abis/init/Core.d.ts +0 -523
- package/dist/abis/init/Core.d.ts.map +0 -1
- package/dist/abis/init/Core.js +0 -681
- package/dist/abis/init/InitFlashAggregator.d.ts +0 -624
- package/dist/abis/init/InitFlashAggregator.d.ts.map +0 -1
- package/dist/abis/init/InitFlashAggregator.js +0 -795
- package/dist/abis/init/PosManager.d.ts +0 -802
- package/dist/abis/init/PosManager.d.ts.map +0 -1
- package/dist/abis/init/PosManager.js +0 -1055
- package/dist/abis/uniswap/FeeOnTransferDetector.d.ts +0 -102
- package/dist/abis/uniswap/FeeOnTransferDetector.d.ts.map +0 -1
- package/dist/abis/uniswap/FeeOnTransferDetector.js +0 -133
- package/dist/abis/uniswap/UniswapV2Pair.d.ts +0 -513
- package/dist/abis/uniswap/UniswapV2Pair.d.ts.map +0 -1
- package/dist/abis/uniswap/UniswapV2Pair.js +0 -659
- package/src/abis/aave/AToken.ts +0 -686
- package/src/abis/aave/AavePoolV3.ts +0 -1060
- package/src/abis/init/Core.ts +0 -681
- package/src/abis/init/InitFlashAggregator.ts +0 -795
- package/src/abis/init/PosManager.ts +0 -1055
- package/src/abis/uniswap/FeeOnTransferDetector.ts +0 -133
- package/src/abis/uniswap/UniswapV2Pair.ts +0 -659
- /package/test/{userdata.test.ts → userData.test.ts} +0 -0
package/src/abis/aave-v2/YLDR.ts
CHANGED
|
@@ -1,199 +1,227 @@
|
|
|
1
1
|
export const YLDRProtocolDataProviderAbi = [
|
|
2
2
|
{
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
{
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
]
|
|
3
|
+
type: 'constructor',
|
|
4
|
+
inputs: [
|
|
5
|
+
{
|
|
6
|
+
type: 'address',
|
|
7
|
+
name: 'addressesProvider',
|
|
8
|
+
internalType: 'contract ILendingPoolAddressesProvider',
|
|
9
|
+
},
|
|
10
|
+
],
|
|
11
11
|
},
|
|
12
12
|
{
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
{
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
13
|
+
type: 'function',
|
|
14
|
+
stateMutability: 'view',
|
|
15
|
+
outputs: [
|
|
16
|
+
{
|
|
17
|
+
type: 'address',
|
|
18
|
+
name: '',
|
|
19
|
+
internalType: 'contract ILendingPoolAddressesProvider',
|
|
20
|
+
},
|
|
21
21
|
],
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
name: 'ADDRESSES_PROVIDER',
|
|
23
|
+
inputs: [],
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
{
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
26
|
+
type: 'function',
|
|
27
|
+
stateMutability: 'view',
|
|
28
|
+
outputs: [
|
|
29
|
+
{
|
|
30
|
+
type: 'tuple[]',
|
|
31
|
+
name: '',
|
|
32
|
+
internalType: 'struct AaveProtocolDataProvider.TokenData[]',
|
|
33
|
+
components: [
|
|
34
34
|
{
|
|
35
|
-
|
|
35
|
+
type: 'string',
|
|
36
36
|
},
|
|
37
37
|
{
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
]
|
|
41
|
-
}
|
|
38
|
+
type: 'address',
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
},
|
|
42
42
|
],
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
name: 'getAllATokens',
|
|
44
|
+
inputs: [],
|
|
45
45
|
},
|
|
46
46
|
{
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
{
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
47
|
+
type: 'function',
|
|
48
|
+
stateMutability: 'view',
|
|
49
|
+
outputs: [
|
|
50
|
+
{
|
|
51
|
+
type: 'tuple[]',
|
|
52
|
+
name: '',
|
|
53
|
+
internalType: 'struct AaveProtocolDataProvider.TokenData[]',
|
|
54
|
+
components: [
|
|
55
55
|
{
|
|
56
|
-
|
|
56
|
+
type: 'string',
|
|
57
57
|
},
|
|
58
58
|
{
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
]
|
|
62
|
-
}
|
|
59
|
+
type: 'address',
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
},
|
|
63
63
|
],
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
name: 'getAllReservesTokens',
|
|
65
|
+
inputs: [],
|
|
66
66
|
},
|
|
67
|
-
{"inputs":[{"internalType":"address","name":"asset","type":"address"}],"name":"getReserveConfigurationData","outputs":[{"internalType":"uint256","name":"decimals","type":"uint256"},{"internalType":"uint256","name":"ltv","type":"uint256"},{"internalType":"uint256","name":"liquidationThreshold","type":"uint256"},{"internalType":"uint256","name":"liquidationBonus","type":"uint256"},{"internalType":"uint256","name":"reserveFactor","type":"uint256"},{"internalType":"bool","name":"usageAsCollateralEnabled","type":"bool"},{"internalType":"bool","name":"borrowingEnabled","type":"bool"},{"internalType":"bool","name":"isActive","type":"bool"},{"internalType":"bool","name":"isFrozen","type":"bool"}],"stateMutability":"view","type":"function"},
|
|
68
67
|
{
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
"internalType": "uint256",
|
|
91
|
-
"name": "liquidityRate",
|
|
92
|
-
"type": "uint256"
|
|
93
|
-
}, {
|
|
94
|
-
"internalType": "uint256",
|
|
95
|
-
"name": "variableBorrowRate",
|
|
96
|
-
"type": "uint256"
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
"internalType": "uint256",
|
|
100
|
-
"name": "liquidityIndex",
|
|
101
|
-
"type": "uint256"
|
|
102
|
-
}, { "internalType": "uint256", "name": "variableBorrowIndex", "type": "uint256" },
|
|
103
|
-
{ "internalType": "uint40", "name": "lastUpdateTimestamp", "type": "uint40" }],
|
|
104
|
-
"stateMutability": "view", "type": "function"
|
|
68
|
+
inputs: [{ internalType: 'address', name: 'asset', type: 'address' }],
|
|
69
|
+
name: 'getReserveConfigurationData',
|
|
70
|
+
outputs: [
|
|
71
|
+
{ internalType: 'uint256', name: 'decimals', type: 'uint256' },
|
|
72
|
+
{ internalType: 'uint256', name: 'ltv', type: 'uint256' },
|
|
73
|
+
{
|
|
74
|
+
internalType: 'uint256',
|
|
75
|
+
name: 'liquidationThreshold',
|
|
76
|
+
type: 'uint256',
|
|
77
|
+
},
|
|
78
|
+
{ internalType: 'uint256', name: 'liquidationBonus', type: 'uint256' },
|
|
79
|
+
{ internalType: 'uint256', name: 'reserveFactor', type: 'uint256' },
|
|
80
|
+
{ internalType: 'bool', name: 'usageAsCollateralEnabled', type: 'bool' },
|
|
81
|
+
{ internalType: 'bool', name: 'borrowingEnabled', type: 'bool' },
|
|
82
|
+
{ internalType: 'bool', name: 'isActive', type: 'bool' },
|
|
83
|
+
{ internalType: 'bool', name: 'isFrozen', type: 'bool' },
|
|
84
|
+
],
|
|
85
|
+
stateMutability: 'view',
|
|
86
|
+
type: 'function',
|
|
105
87
|
},
|
|
106
88
|
{
|
|
107
|
-
|
|
108
|
-
"stateMutability": "view",
|
|
109
|
-
"outputs": [
|
|
89
|
+
inputs: [
|
|
110
90
|
{
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
91
|
+
internalType: 'address',
|
|
92
|
+
name: 'asset',
|
|
93
|
+
type: 'address',
|
|
114
94
|
},
|
|
95
|
+
],
|
|
96
|
+
name: 'getReserveData',
|
|
97
|
+
outputs: [
|
|
115
98
|
{
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
99
|
+
internalType: 'uint256',
|
|
100
|
+
name: 'accruedToTreasuryScaled',
|
|
101
|
+
type: 'uint256',
|
|
119
102
|
},
|
|
120
103
|
{
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
}
|
|
104
|
+
internalType: 'uint256',
|
|
105
|
+
name: 'totalYToken',
|
|
106
|
+
type: 'uint256',
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
internalType: 'uint256',
|
|
110
|
+
name: 'totalVariableDebt',
|
|
111
|
+
type: 'uint256',
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
internalType: 'uint256',
|
|
115
|
+
name: 'liquidityRate',
|
|
116
|
+
type: 'uint256',
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
internalType: 'uint256',
|
|
120
|
+
name: 'variableBorrowRate',
|
|
121
|
+
type: 'uint256',
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
internalType: 'uint256',
|
|
125
|
+
name: 'liquidityIndex',
|
|
126
|
+
type: 'uint256',
|
|
127
|
+
},
|
|
128
|
+
{ internalType: 'uint256', name: 'variableBorrowIndex', type: 'uint256' },
|
|
129
|
+
{ internalType: 'uint40', name: 'lastUpdateTimestamp', type: 'uint40' },
|
|
130
|
+
],
|
|
131
|
+
stateMutability: 'view',
|
|
132
|
+
type: 'function',
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
type: 'function',
|
|
136
|
+
stateMutability: 'view',
|
|
137
|
+
outputs: [
|
|
138
|
+
{
|
|
139
|
+
type: 'address',
|
|
140
|
+
name: 'aTokenAddress',
|
|
141
|
+
internalType: 'address',
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
type: 'address',
|
|
145
|
+
name: 'stableDebtTokenAddress',
|
|
146
|
+
internalType: 'address',
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
type: 'address',
|
|
150
|
+
name: 'variableDebtTokenAddress',
|
|
151
|
+
internalType: 'address',
|
|
152
|
+
},
|
|
153
|
+
],
|
|
154
|
+
name: 'getReserveTokensAddresses',
|
|
155
|
+
inputs: [
|
|
156
|
+
{
|
|
157
|
+
type: 'address',
|
|
158
|
+
name: 'asset',
|
|
159
|
+
internalType: 'address',
|
|
160
|
+
},
|
|
125
161
|
],
|
|
126
|
-
"name": "getReserveTokensAddresses",
|
|
127
|
-
"inputs": [
|
|
128
|
-
{
|
|
129
|
-
"type": "address",
|
|
130
|
-
"name": "asset",
|
|
131
|
-
"internalType": "address"
|
|
132
|
-
}
|
|
133
|
-
]
|
|
134
162
|
},
|
|
135
163
|
{
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
164
|
+
type: 'function',
|
|
165
|
+
stateMutability: 'view',
|
|
166
|
+
outputs: [
|
|
139
167
|
{
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
168
|
+
type: 'uint256',
|
|
169
|
+
name: 'currentATokenBalance',
|
|
170
|
+
internalType: 'uint256',
|
|
143
171
|
},
|
|
144
172
|
{
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
173
|
+
type: 'uint256',
|
|
174
|
+
name: 'currentStableDebt',
|
|
175
|
+
internalType: 'uint256',
|
|
148
176
|
},
|
|
149
177
|
{
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
178
|
+
type: 'uint256',
|
|
179
|
+
name: 'currentVariableDebt',
|
|
180
|
+
internalType: 'uint256',
|
|
153
181
|
},
|
|
154
182
|
{
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
183
|
+
type: 'uint256',
|
|
184
|
+
name: 'principalStableDebt',
|
|
185
|
+
internalType: 'uint256',
|
|
158
186
|
},
|
|
159
187
|
{
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
188
|
+
type: 'uint256',
|
|
189
|
+
name: 'scaledVariableDebt',
|
|
190
|
+
internalType: 'uint256',
|
|
163
191
|
},
|
|
164
192
|
{
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
193
|
+
type: 'uint256',
|
|
194
|
+
name: 'stableBorrowRate',
|
|
195
|
+
internalType: 'uint256',
|
|
168
196
|
},
|
|
169
197
|
{
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
198
|
+
type: 'uint256',
|
|
199
|
+
name: 'liquidityRate',
|
|
200
|
+
internalType: 'uint256',
|
|
173
201
|
},
|
|
174
202
|
{
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
203
|
+
type: 'uint40',
|
|
204
|
+
name: 'stableRateLastUpdated',
|
|
205
|
+
internalType: 'uint40',
|
|
178
206
|
},
|
|
179
207
|
{
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
}
|
|
208
|
+
type: 'bool',
|
|
209
|
+
name: 'usageAsCollateralEnabled',
|
|
210
|
+
internalType: 'bool',
|
|
211
|
+
},
|
|
184
212
|
],
|
|
185
|
-
|
|
186
|
-
|
|
213
|
+
name: 'getUserReserveData',
|
|
214
|
+
inputs: [
|
|
187
215
|
{
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
216
|
+
type: 'address',
|
|
217
|
+
name: 'asset',
|
|
218
|
+
internalType: 'address',
|
|
191
219
|
},
|
|
192
220
|
{
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
}
|
|
197
|
-
]
|
|
198
|
-
}
|
|
199
|
-
] as const
|
|
221
|
+
type: 'address',
|
|
222
|
+
name: 'user',
|
|
223
|
+
internalType: 'address',
|
|
224
|
+
},
|
|
225
|
+
],
|
|
226
|
+
},
|
|
227
|
+
] as const
|
package/src/abis/aave-v3/YLDR.ts
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
1
|
export const YLDRAbi = [
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
] as const
|
|
2
|
+
{
|
|
3
|
+
inputs: [
|
|
4
|
+
{
|
|
5
|
+
internalType: 'address',
|
|
6
|
+
name: 'asset',
|
|
7
|
+
type: 'address',
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
internalType: 'address',
|
|
11
|
+
name: 'user',
|
|
12
|
+
type: 'address',
|
|
13
|
+
},
|
|
14
|
+
],
|
|
15
|
+
name: 'getUserReserveData',
|
|
16
|
+
outputs: [
|
|
17
|
+
{
|
|
18
|
+
internalType: 'uint256',
|
|
19
|
+
name: 'currentYTokenBalance',
|
|
20
|
+
type: 'uint256',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
internalType: 'uint256',
|
|
24
|
+
name: 'currentVariableDebt',
|
|
25
|
+
type: 'uint256',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
internalType: 'uint256',
|
|
29
|
+
name: 'scaledVariableDebt',
|
|
30
|
+
type: 'uint256',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
internalType: 'uint256',
|
|
34
|
+
name: 'liquidityRate',
|
|
35
|
+
type: 'uint256',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
internalType: 'bool',
|
|
39
|
+
name: 'usageAsCollateralEnabled',
|
|
40
|
+
type: 'bool',
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
stateMutability: 'view',
|
|
44
|
+
type: 'function',
|
|
45
|
+
},
|
|
46
|
+
] as const
|
|
@@ -1292,31 +1292,6 @@ export const CometAbi = [
|
|
|
1292
1292
|
"stateMutability": "nonpayable",
|
|
1293
1293
|
"type": "function"
|
|
1294
1294
|
},
|
|
1295
|
-
{
|
|
1296
|
-
"anonymous": false,
|
|
1297
|
-
"inputs": [
|
|
1298
|
-
{
|
|
1299
|
-
"indexed": true,
|
|
1300
|
-
"internalType": "address",
|
|
1301
|
-
"name": "owner",
|
|
1302
|
-
"type": "address"
|
|
1303
|
-
},
|
|
1304
|
-
{
|
|
1305
|
-
"indexed": true,
|
|
1306
|
-
"internalType": "address",
|
|
1307
|
-
"name": "spender",
|
|
1308
|
-
"type": "address"
|
|
1309
|
-
},
|
|
1310
|
-
{
|
|
1311
|
-
"indexed": false,
|
|
1312
|
-
"internalType": "uint256",
|
|
1313
|
-
"name": "amount",
|
|
1314
|
-
"type": "uint256"
|
|
1315
|
-
}
|
|
1316
|
-
],
|
|
1317
|
-
"name": "Approval",
|
|
1318
|
-
"type": "event"
|
|
1319
|
-
},
|
|
1320
1295
|
{
|
|
1321
1296
|
"inputs": [
|
|
1322
1297
|
{
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { ProtocolDataProviderAbi } from '../abis/aave-v2/ProtocolDataProvider'
|
|
3
3
|
import { IncentivesControllerAbi } from '../abis/lendle/IncentivesController'
|
|
4
4
|
import { RewarderAbi } from '../abis/aurelius/Rewarder'
|
|
5
|
-
import { UniswapV2PairAbi } from '../abis/
|
|
5
|
+
import { UniswapV2PairAbi } from '../abis/oracle/UniswapV2Pair'
|
|
6
6
|
|
|
7
7
|
// aave v3 style
|
|
8
8
|
import { AavePoolV3UpgradedAbi } from '../abis/aave/AavePoolV3Upgraded'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Lender } from "@1delta/asset-registry"
|
|
2
2
|
import { Call } from "../../../utils/multicall"
|
|
3
|
-
import {
|
|
3
|
+
import { getLenderAssets } from "../../../utils"
|
|
4
4
|
import { getCompoundV3BaseAsset, getCompoundV3CometAddress, getCompoundV3CometRewardsAddress } from "./addresses"
|
|
5
5
|
|
|
6
6
|
export const buildCompoundV3UserCall = (chainId: string, lender: Lender, account: string): Call[] => {
|
|
@@ -10,12 +10,6 @@ export const buildCompoundV3UserCall = (chainId: string, lender: Lender, account
|
|
|
10
10
|
const assets = getLenderAssets(chainId, lender)
|
|
11
11
|
const assetsNoBase = assets.filter(a => a !== baseAsset)
|
|
12
12
|
|
|
13
|
-
const allowedCall = {
|
|
14
|
-
address: cometContractAddress,
|
|
15
|
-
name: 'isAllowed',
|
|
16
|
-
params: [account, getComposerAddress(chainId)],
|
|
17
|
-
}
|
|
18
|
-
|
|
19
13
|
const baseCalls = [
|
|
20
14
|
{
|
|
21
15
|
address: cometContractAddress,
|
|
@@ -45,7 +39,6 @@ export const buildCompoundV3UserCall = (chainId: string, lender: Lender, account
|
|
|
45
39
|
const calls = [
|
|
46
40
|
...callsNonBase,
|
|
47
41
|
...baseCalls,
|
|
48
|
-
allowedCall,
|
|
49
42
|
callEarnedBalances
|
|
50
43
|
]
|
|
51
44
|
return calls
|