@defisaver/automation-sdk 3.3.2-dev → 3.3.2-dev.1
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/cjs/constants/index.js +100 -5
- package/cjs/index.d.ts +2 -1
- package/cjs/index.js +1 -1
- package/cjs/services/strategiesService.js +28 -27
- package/cjs/services/strategySubService.d.ts +3 -2
- package/cjs/services/strategySubService.js +15 -9
- package/cjs/services/strategySubService.test.js +314 -0
- package/cjs/services/subDataService.d.ts +25 -9
- package/cjs/services/subDataService.js +78 -26
- package/cjs/services/subDataService.test.js +456 -0
- package/cjs/services/triggerService.d.ts +6 -6
- package/cjs/services/triggerService.js +14 -11
- package/cjs/services/triggerService.test.js +46 -0
- package/cjs/types/enums.d.ts +26 -8
- package/cjs/types/enums.js +21 -2
- package/cjs/types/index.d.ts +1 -8
- package/esm/constants/index.js +100 -5
- package/esm/index.d.ts +2 -1
- package/esm/index.js +2 -2
- package/esm/services/strategiesService.js +28 -27
- package/esm/services/strategySubService.d.ts +3 -2
- package/esm/services/strategySubService.js +15 -9
- package/esm/services/strategySubService.test.js +314 -0
- package/esm/services/subDataService.d.ts +25 -9
- package/esm/services/subDataService.js +77 -25
- package/esm/services/subDataService.test.js +456 -0
- package/esm/services/triggerService.d.ts +6 -6
- package/esm/services/triggerService.js +13 -10
- package/esm/services/triggerService.test.js +47 -1
- package/esm/types/enums.d.ts +26 -8
- package/esm/types/enums.js +21 -2
- package/esm/types/index.d.ts +1 -8
- package/package.json +2 -2
- package/src/constants/index.ts +103 -5
- package/src/index.ts +4 -2
- package/src/services/strategiesService.ts +31 -37
- package/src/services/strategySubService.test.ts +347 -0
- package/src/services/strategySubService.ts +57 -20
- package/src/services/subDataService.test.ts +532 -0
- package/src/services/subDataService.ts +122 -33
- package/src/services/triggerService.test.ts +50 -0
- package/src/services/triggerService.ts +21 -14
- package/src/types/enums.ts +21 -2
- package/src/types/index.ts +20 -9
- package/umd/index.js +0 -34219
|
@@ -164,7 +164,7 @@ export const aaveV2LeverageManagementSubData = {
|
|
|
164
164
|
},
|
|
165
165
|
};
|
|
166
166
|
|
|
167
|
-
export const aaveV3LeverageManagementSubData = {
|
|
167
|
+
export const aaveV3LeverageManagementSubData = {
|
|
168
168
|
decode(subData: SubData): { targetRatio: number } {
|
|
169
169
|
const ratioWei = AbiCoder.decodeParameter('uint256', subData[0]) as any as string;
|
|
170
170
|
const targetRatio = weiToRatioPercentage(ratioWei);
|
|
@@ -177,12 +177,20 @@ export const aaveV3LeverageManagementSubDataWithoutSubProxy = {
|
|
|
177
177
|
encode(
|
|
178
178
|
targetRatio: number,
|
|
179
179
|
ratioState: RatioState,
|
|
180
|
+
market: EthereumAddress,
|
|
181
|
+
user: EthereumAddress,
|
|
182
|
+
isGeneric: boolean,
|
|
180
183
|
): SubData {
|
|
181
184
|
const encodedTargetRatio = AbiCoder.encodeParameter('uint256', ratioPercentageToWei(targetRatio));
|
|
182
185
|
const encodedRatioState = AbiCoder.encodeParameter('uint8', ratioState);
|
|
186
|
+
|
|
187
|
+
if (isGeneric) {
|
|
188
|
+
const encodedMarket = AbiCoder.encodeParameter('address', market);
|
|
189
|
+
const encodedUser = AbiCoder.encodeParameter('address', user);
|
|
190
|
+
return [encodedTargetRatio, encodedRatioState, encodedMarket, encodedUser];
|
|
191
|
+
}
|
|
183
192
|
const encodedUseDefaultMarket = AbiCoder.encodeParameter('bool', true);
|
|
184
193
|
const encodedUseOnBehalf = AbiCoder.encodeParameter('bool', false);
|
|
185
|
-
|
|
186
194
|
return [encodedTargetRatio, encodedRatioState, encodedUseDefaultMarket, encodedUseOnBehalf];
|
|
187
195
|
},
|
|
188
196
|
decode(subData: SubData): { targetRatio: number, ratioState: RatioState } {
|
|
@@ -193,6 +201,118 @@ export const aaveV3LeverageManagementSubDataWithoutSubProxy = {
|
|
|
193
201
|
},
|
|
194
202
|
};
|
|
195
203
|
|
|
204
|
+
export const aaveV3LeverageManagementOnPriceGeneric = {
|
|
205
|
+
encode(
|
|
206
|
+
collAsset: EthereumAddress,
|
|
207
|
+
collAssetId: number,
|
|
208
|
+
debtAsset: EthereumAddress,
|
|
209
|
+
debtAssetId: number,
|
|
210
|
+
marketAddr: EthereumAddress,
|
|
211
|
+
targetRatio: number,
|
|
212
|
+
user: EthereumAddress,
|
|
213
|
+
): SubData {
|
|
214
|
+
const encodedColl = AbiCoder.encodeParameter('address', collAsset);
|
|
215
|
+
const encodedCollId = AbiCoder.encodeParameter('uint8', collAssetId);
|
|
216
|
+
const encodedDebt = AbiCoder.encodeParameter('address', debtAsset);
|
|
217
|
+
const encodedDebtId = AbiCoder.encodeParameter('uint8', debtAssetId);
|
|
218
|
+
const encodedMarket = AbiCoder.encodeParameter('address', marketAddr);
|
|
219
|
+
const encodedTargetRatio = AbiCoder.encodeParameter('uint256', ratioPercentageToWei(targetRatio));
|
|
220
|
+
const userEncoded = AbiCoder.encodeParameter('address', user);
|
|
221
|
+
|
|
222
|
+
return [
|
|
223
|
+
encodedColl,
|
|
224
|
+
encodedCollId,
|
|
225
|
+
encodedDebt,
|
|
226
|
+
encodedDebtId,
|
|
227
|
+
encodedMarket,
|
|
228
|
+
encodedTargetRatio,
|
|
229
|
+
userEncoded,
|
|
230
|
+
];
|
|
231
|
+
},
|
|
232
|
+
decode(subData: SubData): {
|
|
233
|
+
collAsset: EthereumAddress,
|
|
234
|
+
collAssetId: number,
|
|
235
|
+
debtAsset: EthereumAddress,
|
|
236
|
+
debtAssetId: number,
|
|
237
|
+
marketAddr: EthereumAddress,
|
|
238
|
+
targetRatio: number,
|
|
239
|
+
user: EthereumAddress,
|
|
240
|
+
} {
|
|
241
|
+
const collAsset = AbiCoder.decodeParameter('address', subData[0]) as unknown as EthereumAddress;
|
|
242
|
+
const collAssetId = Number(AbiCoder.decodeParameter('uint8', subData[1]));
|
|
243
|
+
const debtAsset = AbiCoder.decodeParameter('address', subData[2]) as unknown as EthereumAddress;
|
|
244
|
+
const debtAssetId = Number(AbiCoder.decodeParameter('uint8', subData[3]));
|
|
245
|
+
const marketAddr = AbiCoder.decodeParameter('address', subData[4]) as unknown as EthereumAddress;
|
|
246
|
+
|
|
247
|
+
const weiRatio = AbiCoder.decodeParameter('uint256', subData[5]) as unknown as string;
|
|
248
|
+
const targetRatio = weiToRatioPercentage(weiRatio);
|
|
249
|
+
|
|
250
|
+
const user = AbiCoder.decodeParameter('address', subData[6]) as unknown as EthereumAddress;
|
|
251
|
+
|
|
252
|
+
return {
|
|
253
|
+
collAsset,
|
|
254
|
+
collAssetId,
|
|
255
|
+
debtAsset,
|
|
256
|
+
debtAssetId,
|
|
257
|
+
marketAddr,
|
|
258
|
+
targetRatio,
|
|
259
|
+
user,
|
|
260
|
+
};
|
|
261
|
+
},
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
export const aaveV3CloseGenericSubData = {
|
|
265
|
+
encode(
|
|
266
|
+
collAsset: EthereumAddress,
|
|
267
|
+
collAssetId: number,
|
|
268
|
+
debtAsset: EthereumAddress,
|
|
269
|
+
debtAssetId: number,
|
|
270
|
+
closeType: CloseStrategyType,
|
|
271
|
+
marketAddr: EthereumAddress,
|
|
272
|
+
user: EthereumAddress,
|
|
273
|
+
): SubData {
|
|
274
|
+
const encodedColl = AbiCoder.encodeParameter('address', collAsset);
|
|
275
|
+
const encodedCollId = AbiCoder.encodeParameter('uint8', collAssetId);
|
|
276
|
+
const encodedDebt = AbiCoder.encodeParameter('address', debtAsset);
|
|
277
|
+
const encodedDebtId = AbiCoder.encodeParameter('uint8', debtAssetId);
|
|
278
|
+
const encodedCloseType = AbiCoder.encodeParameter('uint8', closeType);
|
|
279
|
+
const encodedMarket = AbiCoder.encodeParameter('address', marketAddr);
|
|
280
|
+
const userEncoded = AbiCoder.encodeParameter('address', user);
|
|
281
|
+
|
|
282
|
+
return [
|
|
283
|
+
encodedColl,
|
|
284
|
+
encodedCollId,
|
|
285
|
+
encodedDebt,
|
|
286
|
+
encodedDebtId,
|
|
287
|
+
encodedCloseType,
|
|
288
|
+
encodedMarket,
|
|
289
|
+
userEncoded,
|
|
290
|
+
];
|
|
291
|
+
},
|
|
292
|
+
|
|
293
|
+
decode(subData: SubData): {
|
|
294
|
+
collAsset: EthereumAddress,
|
|
295
|
+
collAssetId: number,
|
|
296
|
+
debtAsset: EthereumAddress,
|
|
297
|
+
debtAssetId: number,
|
|
298
|
+
closeType: CloseStrategyType,
|
|
299
|
+
marketAddr: EthereumAddress,
|
|
300
|
+
user: EthereumAddress,
|
|
301
|
+
} {
|
|
302
|
+
const collAsset = AbiCoder.decodeParameter('address', subData[0]) as unknown as EthereumAddress;
|
|
303
|
+
const collAssetId = Number(AbiCoder.decodeParameter('uint8', subData[1]));
|
|
304
|
+
const debtAsset = AbiCoder.decodeParameter('address', subData[2]) as unknown as EthereumAddress;
|
|
305
|
+
const debtAssetId = Number(AbiCoder.decodeParameter('uint8', subData[3]));
|
|
306
|
+
const closeType = Number(AbiCoder.decodeParameter('uint8', subData[4])) as CloseStrategyType;
|
|
307
|
+
const marketAddr = AbiCoder.decodeParameter('address', subData[5]) as unknown as EthereumAddress;
|
|
308
|
+
const user = AbiCoder.decodeParameter('address', subData[6]) as unknown as EthereumAddress;
|
|
309
|
+
|
|
310
|
+
return {
|
|
311
|
+
collAsset, collAssetId, debtAsset, debtAssetId, closeType, marketAddr, user,
|
|
312
|
+
};
|
|
313
|
+
},
|
|
314
|
+
};
|
|
315
|
+
|
|
196
316
|
export const aaveV3QuotePriceSubData = {
|
|
197
317
|
encode(
|
|
198
318
|
collAsset: EthereumAddress,
|
|
@@ -1022,34 +1142,3 @@ export const compoundV3CloseSubData = {
|
|
|
1022
1142
|
};
|
|
1023
1143
|
},
|
|
1024
1144
|
};
|
|
1025
|
-
|
|
1026
|
-
export const liquityV2InterestRateAdjustmentSubData = {
|
|
1027
|
-
encode: (
|
|
1028
|
-
market: EthereumAddress,
|
|
1029
|
-
troveId: string,
|
|
1030
|
-
interestRateChange: string,
|
|
1031
|
-
) => {
|
|
1032
|
-
const marketEncoded = AbiCoder.encodeParameter('address', market);
|
|
1033
|
-
const troveIdEncoded = AbiCoder.encodeParameter('uint256', troveId);
|
|
1034
|
-
const interestRateChangeWei = new Dec(interestRateChange).mul(1e16).toString();
|
|
1035
|
-
const interestRateChangeEncoded = AbiCoder.encodeParameter('uint256', interestRateChangeWei.toString());
|
|
1036
|
-
|
|
1037
|
-
return [
|
|
1038
|
-
marketEncoded,
|
|
1039
|
-
troveIdEncoded,
|
|
1040
|
-
interestRateChangeEncoded,
|
|
1041
|
-
];
|
|
1042
|
-
},
|
|
1043
|
-
decode: (subData: SubData) => {
|
|
1044
|
-
const market = AbiCoder.decodeParameter('address', subData[0]) as unknown as EthereumAddress;
|
|
1045
|
-
const troveId = AbiCoder.decodeParameter('uint256', subData[1]) as any as string;
|
|
1046
|
-
const interestRateChangeWei = AbiCoder.decodeParameter('uint256', subData[2]) as any as string;
|
|
1047
|
-
const interestRateChange = new Dec(interestRateChangeWei).div(10 ** 16).toString();
|
|
1048
|
-
|
|
1049
|
-
return {
|
|
1050
|
-
market,
|
|
1051
|
-
troveId,
|
|
1052
|
-
interestRateChange,
|
|
1053
|
-
};
|
|
1054
|
-
},
|
|
1055
|
-
};
|
|
@@ -31,6 +31,7 @@ import {
|
|
|
31
31
|
morphoBlueRatioTrigger,
|
|
32
32
|
crvUsdHealthRatioTrigger, liquityV2DebtInFrontTrigger, liquityV2AdjustTimeTrigger,
|
|
33
33
|
compoundV3PriceRangeTrigger,
|
|
34
|
+
aaveV3QuotePriceRangeTrigger,
|
|
34
35
|
} from './triggerService';
|
|
35
36
|
|
|
36
37
|
describe('Feature: triggerService.ts', () => {
|
|
@@ -1231,4 +1232,53 @@ describe('Feature: triggerService.ts', () => {
|
|
|
1231
1232
|
});
|
|
1232
1233
|
});
|
|
1233
1234
|
});
|
|
1235
|
+
describe('When testing triggerService.aaveV3PriceRangeTrigger', () => {
|
|
1236
|
+
describe('encode()', () => {
|
|
1237
|
+
const examples: Array<[[string], [collToken: EthereumAddress, debtToken: EthereumAddress, lowerPrice: number, upperPrice: number]]> = [
|
|
1238
|
+
[
|
|
1239
|
+
['0x000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000000000000000000000000000000000000000000000000000022ecb25c000000000000000000000000000000000000000000000000000000005d21dba000'],
|
|
1240
|
+
[web3Utils.toChecksumAddress('0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2'), web3Utils.toChecksumAddress('0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'), 1500, 4000]
|
|
1241
|
+
],
|
|
1242
|
+
[
|
|
1243
|
+
['0x000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000746a528800'],
|
|
1244
|
+
[web3Utils.toChecksumAddress('0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2'), web3Utils.toChecksumAddress('0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'), 0, 5000]
|
|
1245
|
+
],
|
|
1246
|
+
];
|
|
1247
|
+
|
|
1248
|
+
examples.forEach(([expected, actual]) => {
|
|
1249
|
+
it(`Given ${actual} should return expected value: ${expected}`, () => {
|
|
1250
|
+
expect(aaveV3QuotePriceRangeTrigger.encode(...actual)).to.eql(expected);
|
|
1251
|
+
});
|
|
1252
|
+
});
|
|
1253
|
+
});
|
|
1254
|
+
|
|
1255
|
+
describe('decode()', () => {
|
|
1256
|
+
const examples: Array<[{ collToken: EthereumAddress, debtToken: EthereumAddress, lowerPrice: string, upperPrice: string }, TriggerData]> = [
|
|
1257
|
+
[
|
|
1258
|
+
{
|
|
1259
|
+
collToken: web3Utils.toChecksumAddress('0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2'),
|
|
1260
|
+
debtToken: web3Utils.toChecksumAddress('0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'),
|
|
1261
|
+
lowerPrice: '1500',
|
|
1262
|
+
upperPrice: '4000',
|
|
1263
|
+
},
|
|
1264
|
+
['0x000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000000000000000000000000000000000000000000000000000022ecb25c000000000000000000000000000000000000000000000000000000005d21dba000'],
|
|
1265
|
+
],
|
|
1266
|
+
[
|
|
1267
|
+
{
|
|
1268
|
+
collToken: web3Utils.toChecksumAddress('0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2'),
|
|
1269
|
+
debtToken: web3Utils.toChecksumAddress('0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'),
|
|
1270
|
+
lowerPrice: '0',
|
|
1271
|
+
upperPrice: '5000',
|
|
1272
|
+
},
|
|
1273
|
+
['000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000746a528800'],
|
|
1274
|
+
],
|
|
1275
|
+
];
|
|
1276
|
+
|
|
1277
|
+
examples.forEach(([expected, actual]) => {
|
|
1278
|
+
it(`Given ${actual} should return expected value: ${JSON.stringify(expected)}`, () => {
|
|
1279
|
+
expect(aaveV3QuotePriceRangeTrigger.decode(actual)).to.eql(expected);
|
|
1280
|
+
});
|
|
1281
|
+
});
|
|
1282
|
+
});
|
|
1283
|
+
});
|
|
1234
1284
|
});
|
|
@@ -658,24 +658,31 @@ export const compoundV3PriceRangeTrigger = {
|
|
|
658
658
|
},
|
|
659
659
|
};
|
|
660
660
|
|
|
661
|
-
export const
|
|
661
|
+
export const aaveV3QuotePriceRangeTrigger = {
|
|
662
662
|
encode(
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
663
|
+
collToken: EthereumAddress,
|
|
664
|
+
debtToken: EthereumAddress,
|
|
665
|
+
lowerPrice: number,
|
|
666
|
+
upperPrice: number,
|
|
667
667
|
) {
|
|
668
|
-
|
|
669
|
-
const
|
|
670
|
-
|
|
668
|
+
// Price is scaled to 1e8
|
|
669
|
+
const lowerPriceFormatted = new Dec(lowerPrice).mul(1e8).floor().toString();
|
|
670
|
+
const upperPriceFormatted = new Dec(upperPrice).mul(1e8).floor().toString();
|
|
671
|
+
return [
|
|
672
|
+
AbiCoder.encodeParameters(
|
|
673
|
+
['address', 'address', 'uint256', 'uint256'],
|
|
674
|
+
[collToken, debtToken, lowerPriceFormatted, upperPriceFormatted]),
|
|
675
|
+
];
|
|
671
676
|
},
|
|
672
|
-
decode(
|
|
673
|
-
|
|
677
|
+
decode(
|
|
678
|
+
triggerData: TriggerData,
|
|
679
|
+
) {
|
|
680
|
+
const decodedData = AbiCoder.decodeParameters(['address', 'address', 'uint256', 'uint256'], triggerData[0]);
|
|
674
681
|
return {
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
682
|
+
collToken: decodedData[0] as EthereumAddress,
|
|
683
|
+
debtToken: decodedData[1] as EthereumAddress,
|
|
684
|
+
lowerPrice: new Dec(decodedData[2] as string).div(1e8).toString(),
|
|
685
|
+
upperPrice: new Dec(decodedData[3] as string).div(1e8).toString(),
|
|
679
686
|
};
|
|
680
687
|
},
|
|
681
688
|
};
|
package/src/types/enums.ts
CHANGED
|
@@ -96,7 +96,6 @@ export namespace Strategies {
|
|
|
96
96
|
LIQUITY_DEBT_IN_FRONT_REPAY = 75,
|
|
97
97
|
CURVEUSD_PAYBACK = 92,
|
|
98
98
|
LIQUITY_V2_PAYBACK = 113,
|
|
99
|
-
LIQUITY_V2_INTEREST_RATE_ADJUSTMENT = 124,
|
|
100
99
|
}
|
|
101
100
|
|
|
102
101
|
export enum OptimismIds {
|
|
@@ -144,7 +143,6 @@ export namespace Strategies {
|
|
|
144
143
|
RepayOnPrice = 'repay-on-price',
|
|
145
144
|
EoaBoostOnPrice = 'eoa-boost-on-price',
|
|
146
145
|
EoaRepayOnPrice = 'eoa-repay-on-price',
|
|
147
|
-
InterestRateAdjustment = 'interest-rate-adjustment',
|
|
148
146
|
}
|
|
149
147
|
export enum IdOverrides {
|
|
150
148
|
TakeProfit = 'take-profit',
|
|
@@ -215,6 +213,12 @@ export namespace Bundles {
|
|
|
215
213
|
COMP_V3_EOA_REPAY_ON_PRICE = 49,
|
|
216
214
|
COMP_V3_EOA_BOOST_ON_PRICE = 50,
|
|
217
215
|
COMP_V3_EOA_CLOSE = 51,
|
|
216
|
+
// TODO -> Watch out for Liquity V2 Strategy deploy, should change IDs or here or there !!!
|
|
217
|
+
AAVE_V3_EOA_REPAY = 52,
|
|
218
|
+
AAVE_V3_EOA_BOOST = 53,
|
|
219
|
+
AAVE_V3_EOA_REPAY_ON_PRICE = 54,
|
|
220
|
+
AAVE_V3_EOA_BOOST_ON_PRICE = 55,
|
|
221
|
+
AAVE_V3_EOA_CLOSE = 56,
|
|
218
222
|
}
|
|
219
223
|
|
|
220
224
|
export enum OptimismIds {
|
|
@@ -224,6 +228,11 @@ export namespace Bundles {
|
|
|
224
228
|
AAVE_V3_CLOSE_TO_COLLATERAL = 3,
|
|
225
229
|
AAVE_V3_OPEN_ORDER_FROM_COLLATERAL = 4,
|
|
226
230
|
AAVE_V3_REPAY_ON_PRICE = 5,
|
|
231
|
+
AAVE_V3_EOA_REPAY = 6,
|
|
232
|
+
AAVE_V3_EOA_BOOST = 7,
|
|
233
|
+
AAVE_V3_EOA_REPAY_ON_PRICE = 8,
|
|
234
|
+
AAVE_V3_EOA_BOOST_ON_PRICE = 9,
|
|
235
|
+
AAVE_V3_EOA_CLOSE = 10,
|
|
227
236
|
}
|
|
228
237
|
|
|
229
238
|
export enum BaseIds {
|
|
@@ -248,6 +257,11 @@ export namespace Bundles {
|
|
|
248
257
|
COMP_V3_EOA_CLOSE = 20,
|
|
249
258
|
COMP_V3_EOA_REPAY = 21,
|
|
250
259
|
COMP_V3_EOA_BOOST = 22,
|
|
260
|
+
AAVE_V3_EOA_REPAY = 23,
|
|
261
|
+
AAVE_V3_EOA_BOOST = 24,
|
|
262
|
+
AAVE_V3_EOA_REPAY_ON_PRICE = 25,
|
|
263
|
+
AAVE_V3_EOA_BOOST_ON_PRICE = 26,
|
|
264
|
+
AAVE_V3_EOA_CLOSE = 27,
|
|
251
265
|
}
|
|
252
266
|
|
|
253
267
|
export enum ArbitrumIds {
|
|
@@ -269,6 +283,11 @@ export namespace Bundles {
|
|
|
269
283
|
COMP_V3_EOA_CLOSE = 15,
|
|
270
284
|
COMP_V3_EOA_REPAY = 16,
|
|
271
285
|
COMP_V3_EOA_BOOST = 17,
|
|
286
|
+
AAVE_V3_EOA_REPAY = 18,
|
|
287
|
+
AAVE_V3_EOA_BOOST = 19,
|
|
288
|
+
AAVE_V3_EOA_REPAY_ON_PRICE = 20,
|
|
289
|
+
AAVE_V3_EOA_BOOST_ON_PRICE = 21,
|
|
290
|
+
AAVE_V3_EOA_CLOSE = 22,
|
|
272
291
|
}
|
|
273
292
|
}
|
|
274
293
|
|
package/src/types/index.ts
CHANGED
|
@@ -124,6 +124,26 @@ export declare namespace Position {
|
|
|
124
124
|
mergeWithId?: Strategies.Identifiers,
|
|
125
125
|
mergeId?: Strategies.Identifiers
|
|
126
126
|
}
|
|
127
|
+
// TODO -> Prob should be better to type it something like this
|
|
128
|
+
// type RatioProtection =
|
|
129
|
+
// | (Base & {
|
|
130
|
+
// triggerRepayRatio: number
|
|
131
|
+
// targetRepayRatio: number
|
|
132
|
+
// repayEnabled: boolean
|
|
133
|
+
|
|
134
|
+
// triggerBoostRatio?: never
|
|
135
|
+
// targetBoostRatio?: never
|
|
136
|
+
// boostEnabled?: never
|
|
137
|
+
// })
|
|
138
|
+
// | (Base & {
|
|
139
|
+
// triggerBoostRatio: number
|
|
140
|
+
// targetBoostRatio: number
|
|
141
|
+
// boostEnabled: boolean
|
|
142
|
+
|
|
143
|
+
// triggerRepayRatio?: never
|
|
144
|
+
// targetRepayRatio?: never
|
|
145
|
+
// repayEnabled?: never
|
|
146
|
+
// });
|
|
127
147
|
interface RatioProtection extends Base {
|
|
128
148
|
triggerRepayRatio?: number,
|
|
129
149
|
targetRepayRatio?: number,
|
|
@@ -190,14 +210,6 @@ export declare namespace Position {
|
|
|
190
210
|
triggerRatio: number;
|
|
191
211
|
}
|
|
192
212
|
|
|
193
|
-
interface InterestRateAdjustmentLiquityV2 extends Base {
|
|
194
|
-
market: EthereumAddress,
|
|
195
|
-
troveId: string,
|
|
196
|
-
criticalDebtInFrontLimit: string,
|
|
197
|
-
nonCriticalDebtInFrontLimit: string,
|
|
198
|
-
interestRateChange: string,
|
|
199
|
-
}
|
|
200
|
-
|
|
201
213
|
interface TrailingStop extends Base {
|
|
202
214
|
roundId: number,
|
|
203
215
|
triggerPercentage: number,
|
|
@@ -247,7 +259,6 @@ export declare namespace Position {
|
|
|
247
259
|
| Specific.BoostOnPriceMorpho
|
|
248
260
|
| Specific.BoostOnPriceLiquityV2
|
|
249
261
|
| Specific.PaybackLiquityV2
|
|
250
|
-
| Specific.InterestRateAdjustmentLiquityV2
|
|
251
262
|
| Specific.CompoundV3LeverageManagementOnPrice
|
|
252
263
|
| Specific.CompoundV3CloseOnPrice;
|
|
253
264
|
|