@defisaver/sdk 1.0.55 → 1.0.57
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/esm/src/Action.d.ts +2 -2
- package/esm/src/actions/checkers/LiquityRatioIncreaseCheckAction.d.ts +13 -0
- package/esm/src/actions/checkers/LiquityRatioIncreaseCheckAction.js +18 -0
- package/esm/src/actions/checkers/MorphoAaveV2RatioCheckAction.d.ts +15 -0
- package/esm/src/actions/checkers/MorphoAaveV2RatioCheckAction.js +22 -0
- package/esm/src/actions/checkers/index.d.ts +2 -0
- package/esm/src/actions/checkers/index.js +2 -0
- package/esm/src/actions/curveusd/CurveUsdLevCreateAction.d.ts +2 -2
- package/esm/src/actions/curveusd/CurveUsdLevCreateAction.js +2 -2
- package/esm/src/actions/curveusd/CurveUsdRepayAction.d.ts +2 -2
- package/esm/src/actions/curveusd/CurveUsdRepayAction.js +2 -2
- package/esm/src/actions/curveusd/CurveUsdSelfLiquidateWithCollAction.d.ts +2 -2
- package/esm/src/actions/curveusd/CurveUsdSelfLiquidateWithCollAction.js +2 -2
- package/esm/src/addresses.js +6 -6
- package/esm/src/triggers/LiquityDebtInFrontWithLimitTrigger.d.ts +10 -0
- package/esm/src/triggers/LiquityDebtInFrontWithLimitTrigger.js +12 -0
- package/esm/src/triggers/MorphoAaveV2RatioTrigger.d.ts +10 -0
- package/esm/src/triggers/MorphoAaveV2RatioTrigger.js +12 -0
- package/esm/src/triggers/index.d.ts +2 -0
- package/esm/src/triggers/index.js +2 -0
- package/esm/src/types.d.ts +20 -20
- package/package.json +1 -1
- package/src/actions/checkers/LiquityRatioIncreaseCheckAction.ts +21 -0
- package/src/actions/checkers/MorphoAaveV2RatioCheckAction.ts +25 -0
- package/src/actions/checkers/index.ts +2 -0
- package/src/actions/curveusd/CurveUsdLevCreateAction.ts +4 -4
- package/src/actions/curveusd/CurveUsdRepayAction.ts +4 -4
- package/src/actions/curveusd/CurveUsdSelfLiquidateWithCollAction.ts +4 -4
- package/src/addresses.ts +6 -6
- package/src/triggers/LiquityDebtInFrontWithLimitTrigger.ts +19 -0
- package/src/triggers/MorphoAaveV2RatioTrigger.ts +15 -0
- package/src/triggers/index.ts +2 -0
- package/umd/index.js +465 -393
package/esm/src/Action.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AccessListItem, EthAddress } from './types';
|
|
2
|
-
type ParamTypes = Array<string | Array<any>>;
|
|
3
|
-
type Args = Array<any>;
|
|
2
|
+
declare type ParamTypes = Array<string | Array<any>>;
|
|
3
|
+
declare type Args = Array<any>;
|
|
4
4
|
/**
|
|
5
5
|
* Single action that can be executed directly, or combined into a set (ie. supply a vault)
|
|
6
6
|
*
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { uint256 } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* LiquityRatioCheckAction - Checks liquity ratio increase for user position and reverts if faulty
|
|
5
|
+
*
|
|
6
|
+
* @category Checkers
|
|
7
|
+
*/
|
|
8
|
+
export declare class LiquityRatioIncreaseCheckAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param targetRatio The ratio user want to be at
|
|
11
|
+
*/
|
|
12
|
+
constructor(targetRatioIncrease: uint256);
|
|
13
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
/**
|
|
4
|
+
* LiquityRatioCheckAction - Checks liquity ratio increase for user position and reverts if faulty
|
|
5
|
+
*
|
|
6
|
+
* @category Checkers
|
|
7
|
+
*/
|
|
8
|
+
export class LiquityRatioIncreaseCheckAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param targetRatio The ratio user want to be at
|
|
11
|
+
*/
|
|
12
|
+
constructor(targetRatioIncrease) {
|
|
13
|
+
super('LiquityRatioIncreaseCheck', getAddr('LiquityRatioIncreaseCheck'), ['uint256'], [targetRatioIncrease]);
|
|
14
|
+
this.mappableArgs = [
|
|
15
|
+
this.args[0],
|
|
16
|
+
];
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { uint8, uint256, EthAddress } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* MorphoAaveV2RatioCheckAction - Checks Morpho-AaveV2 ratio for user position and reverts if faulty
|
|
5
|
+
*
|
|
6
|
+
* @category Checkers
|
|
7
|
+
*/
|
|
8
|
+
export declare class MorphoAaveV2RatioCheckAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param ratioState If it should lower/higher
|
|
11
|
+
* @param targetRatio The ratio user want to be at
|
|
12
|
+
* @param user Address of the user we are checking the ratio for (default to proxy)
|
|
13
|
+
*/
|
|
14
|
+
constructor(ratioState: uint8, targetRatio: uint256, user: EthAddress);
|
|
15
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
/**
|
|
4
|
+
* MorphoAaveV2RatioCheckAction - Checks Morpho-AaveV2 ratio for user position and reverts if faulty
|
|
5
|
+
*
|
|
6
|
+
* @category Checkers
|
|
7
|
+
*/
|
|
8
|
+
export class MorphoAaveV2RatioCheckAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param ratioState If it should lower/higher
|
|
11
|
+
* @param targetRatio The ratio user want to be at
|
|
12
|
+
* @param user Address of the user we are checking the ratio for (default to proxy)
|
|
13
|
+
*/
|
|
14
|
+
constructor(ratioState, targetRatio, user) {
|
|
15
|
+
super('MorphoAaveV2RatioCheck', getAddr('MorphoAaveV2RatioCheck'), ['uint8', 'uint256', 'address'], [ratioState, targetRatio, user]);
|
|
16
|
+
this.mappableArgs = [
|
|
17
|
+
this.args[0],
|
|
18
|
+
this.args[1],
|
|
19
|
+
this.args[2],
|
|
20
|
+
];
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export * from './MakerRatioCheckAction';
|
|
2
2
|
export * from './AaveV3RatioCheckAction';
|
|
3
3
|
export * from './CompoundV3RatioCheckAction';
|
|
4
|
+
export * from './MorphoAaveV2RatioCheckAction';
|
|
4
5
|
export * from './LiquityRatioCheckAction';
|
|
5
6
|
export * from './SparkRatioCheckAction';
|
|
7
|
+
export * from './LiquityRatioIncreaseCheckAction';
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export * from './MakerRatioCheckAction';
|
|
2
2
|
export * from './AaveV3RatioCheckAction';
|
|
3
3
|
export * from './CompoundV3RatioCheckAction';
|
|
4
|
+
export * from './MorphoAaveV2RatioCheckAction';
|
|
4
5
|
export * from './LiquityRatioCheckAction';
|
|
5
6
|
export * from './SparkRatioCheckAction';
|
|
7
|
+
export * from './LiquityRatioIncreaseCheckAction';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Action } from '../../Action';
|
|
2
|
-
import { EthAddress, uint256, uint32, bytes } from '../../types';
|
|
2
|
+
import { EthAddress, uint256, uint32, bytes, uint24 } from '../../types';
|
|
3
3
|
/**
|
|
4
4
|
*
|
|
5
5
|
* @category CurveUsd
|
|
6
6
|
*/
|
|
7
7
|
export declare class CurveUsdLevCreateAction extends Action {
|
|
8
|
-
constructor(controllerAddress: EthAddress, collateralAmount: uint256, debtAmount: uint256, minAmount: uint256, nBands: uint256, from: EthAddress, additionData: bytes, gasUsed: uint32, dfsFeeDivider:
|
|
8
|
+
constructor(controllerAddress: EthAddress, collateralAmount: uint256, debtAmount: uint256, minAmount: uint256, nBands: uint256, from: EthAddress, additionData: bytes, gasUsed: uint32, dfsFeeDivider: uint24);
|
|
9
9
|
}
|
|
@@ -6,9 +6,9 @@ import { getAddr } from '../../addresses';
|
|
|
6
6
|
* @category CurveUsd
|
|
7
7
|
*/
|
|
8
8
|
export class CurveUsdLevCreateAction extends Action {
|
|
9
|
-
constructor(controllerAddress, collateralAmount, debtAmount, minAmount, nBands, from, additionData, gasUsed, dfsFeeDivider
|
|
9
|
+
constructor(controllerAddress, collateralAmount, debtAmount, minAmount, nBands, from, additionData, gasUsed, dfsFeeDivider) {
|
|
10
10
|
requireAddress(from);
|
|
11
|
-
super('CurveUsdLevCreate', getAddr('CurveUsdLevCreate'), ['address', 'uint256', 'uint256', 'uint256', 'uint256', 'address', 'bytes', 'uint32', '
|
|
11
|
+
super('CurveUsdLevCreate', getAddr('CurveUsdLevCreate'), ['address', 'uint256', 'uint256', 'uint256', 'uint256', 'address', 'bytes', 'uint32', 'uint24'], [controllerAddress, collateralAmount, debtAmount, minAmount, nBands, from, additionData, gasUsed, dfsFeeDivider]);
|
|
12
12
|
this.mappableArgs = [
|
|
13
13
|
...this.args,
|
|
14
14
|
];
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Action } from '../../Action';
|
|
2
|
-
import { EthAddress, uint256, uint32, bytes } from '../../types';
|
|
2
|
+
import { EthAddress, uint256, uint32, bytes, uint24 } from '../../types';
|
|
3
3
|
/**
|
|
4
4
|
*
|
|
5
5
|
* @category CurveUsd
|
|
6
6
|
*/
|
|
7
7
|
export declare class CurveUsdRepayAction extends Action {
|
|
8
|
-
constructor(controllerAddress: EthAddress, collAmount: uint256, to: EthAddress, minAmount: uint256, additionData: bytes, gasUsed: uint32, dfsFeeDivider:
|
|
8
|
+
constructor(controllerAddress: EthAddress, collAmount: uint256, to: EthAddress, minAmount: uint256, additionData: bytes, gasUsed: uint32, dfsFeeDivider: uint24);
|
|
9
9
|
}
|
|
@@ -5,8 +5,8 @@ import { getAddr } from '../../addresses';
|
|
|
5
5
|
* @category CurveUsd
|
|
6
6
|
*/
|
|
7
7
|
export class CurveUsdRepayAction extends Action {
|
|
8
|
-
constructor(controllerAddress, collAmount, to, minAmount, additionData, gasUsed, dfsFeeDivider
|
|
9
|
-
super('CurveUsdRepay', getAddr('CurveUsdRepay'), ['address', 'uint256', 'address', 'uint256', 'bytes', 'uint32', '
|
|
8
|
+
constructor(controllerAddress, collAmount, to, minAmount, additionData, gasUsed, dfsFeeDivider) {
|
|
9
|
+
super('CurveUsdRepay', getAddr('CurveUsdRepay'), ['address', 'uint256', 'address', 'uint256', 'bytes', 'uint32', 'uint24'], [controllerAddress, collAmount, to, minAmount, additionData, gasUsed, dfsFeeDivider]);
|
|
10
10
|
this.mappableArgs = [
|
|
11
11
|
...this.args,
|
|
12
12
|
];
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Action } from '../../Action';
|
|
2
|
-
import { EthAddress, uint256, uint32, bytes } from '../../types';
|
|
2
|
+
import { EthAddress, uint256, uint32, bytes, uint24 } from '../../types';
|
|
3
3
|
/**
|
|
4
4
|
*
|
|
5
5
|
* @category CurveUsd
|
|
6
6
|
*/
|
|
7
7
|
export declare class CurveUsdSelfLiquidateWithCollAction extends Action {
|
|
8
|
-
constructor(controllerAddress: EthAddress, percentage: uint256, minCrvUsdExpected: uint256, swapAmount: uint256, minAmount: uint256, to: EthAddress, additionData: bytes, gasUsed: uint32, dfsFeeDivider:
|
|
8
|
+
constructor(controllerAddress: EthAddress, percentage: uint256, minCrvUsdExpected: uint256, swapAmount: uint256, minAmount: uint256, to: EthAddress, additionData: bytes, gasUsed: uint32, dfsFeeDivider: uint24);
|
|
9
9
|
}
|
|
@@ -6,9 +6,9 @@ import { getAddr } from '../../addresses';
|
|
|
6
6
|
* @category CurveUsd
|
|
7
7
|
*/
|
|
8
8
|
export class CurveUsdSelfLiquidateWithCollAction extends Action {
|
|
9
|
-
constructor(controllerAddress, percentage, minCrvUsdExpected, swapAmount, minAmount, to, additionData, gasUsed, dfsFeeDivider
|
|
9
|
+
constructor(controllerAddress, percentage, minCrvUsdExpected, swapAmount, minAmount, to, additionData, gasUsed, dfsFeeDivider) {
|
|
10
10
|
requireAddress(to);
|
|
11
|
-
super('CurveUsdSelfLiquidateWithColl', getAddr('CurveUsdSelfLiquidateWithColl'), ['address', 'uint256', 'uint256', 'uint256', 'uint256', 'address', 'bytes', 'uint32', '
|
|
11
|
+
super('CurveUsdSelfLiquidateWithColl', getAddr('CurveUsdSelfLiquidateWithColl'), ['address', 'uint256', 'uint256', 'uint256', 'uint256', 'address', 'bytes', 'uint32', 'uint24'], [controllerAddress, percentage, minCrvUsdExpected, swapAmount, minAmount, to, additionData, gasUsed, dfsFeeDivider]);
|
|
12
12
|
this.mappableArgs = [
|
|
13
13
|
...this.args,
|
|
14
14
|
];
|
package/esm/src/addresses.js
CHANGED
|
@@ -158,9 +158,9 @@ export const actionAddresses = {
|
|
|
158
158
|
McdRatioCheck: '0x3f09773e5e945C6Aa1bc8a8B3492f507620DE1e1',
|
|
159
159
|
GasFeeTaker: '0x431F1E1A9859EF99953801dbdeB31d2846ADcc0d',
|
|
160
160
|
CurveStethPoolDeposit: '0x5Ae5870dC0C780e9eb68bE7a223eCd7F3BDad12B',
|
|
161
|
-
CurveStethPoolWithdraw: '
|
|
161
|
+
CurveStethPoolWithdraw: '0x41313695a4829a80c8019Ec8bCC529Fec08F9099',
|
|
162
162
|
CurveDeposit: '0xf46aCCE6d2559971bF5Aea03A10B3679709CE43d',
|
|
163
|
-
CurveWithdraw: '
|
|
163
|
+
CurveWithdraw: '0x7127A1Cd69eC2A1F91661bc0ED40aD5B73898A54',
|
|
164
164
|
McdBoostComposite: '0x0000000000000000000000000000000000000000',
|
|
165
165
|
McdRepayComposite: '0x0000000000000000000000000000000000000000',
|
|
166
166
|
// Euler
|
|
@@ -195,11 +195,11 @@ export const actionAddresses = {
|
|
|
195
195
|
CurveUsdSupply: '0xa55B3CE5ae7E59002f53b2153ABe326823ccCDE2',
|
|
196
196
|
CurveUsdAdjust: '0x6f69A7d0B1BE7602381d9cCE6B29F05B9D0b85e6',
|
|
197
197
|
CurveUsdWithdraw: '0x54B8D984fc79B000D7B6F6E0f52CD054E965120f',
|
|
198
|
-
CurveUsdLevCreate: '
|
|
199
|
-
CurveUsdRepay: '
|
|
200
|
-
CurveUsdSwapper: '
|
|
198
|
+
CurveUsdLevCreate: '0xcbd9aFc2b7532b9eeB3A7EC4ea8Bb4320795d9Ad',
|
|
199
|
+
CurveUsdRepay: '0xd12785e4834C1421fC7B64ca57d64E886e39b80F',
|
|
200
|
+
CurveUsdSwapper: '0xFA8c594b903651F97b27aCADEa83b720cfD7F80b',
|
|
201
201
|
CurveUsdSelfLiquidate: '0xd90d8a4955DfE9D4f45F7f60595313B0925ee1da',
|
|
202
|
-
CurveUsdSelfLiquidateWithColl: '
|
|
202
|
+
CurveUsdSelfLiquidateWithColl: '0x7cE305FC2A18c6820a533AD418dC0A549aFeDcAF',
|
|
203
203
|
},
|
|
204
204
|
[NETWORKS.optimism.chainId]: {
|
|
205
205
|
DFSSell: '0xC6c601fcAa870efd26C624F8c65fbc54cBe533b1',
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Action } from '../Action';
|
|
2
|
+
import { EthAddress, uint256 } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
*
|
|
6
|
+
* @category Triggers
|
|
7
|
+
*/
|
|
8
|
+
export declare class LiquityDebtInFrontWithLimitTrigger extends Action {
|
|
9
|
+
constructor(troveOwner: EthAddress, debtInFront: uint256);
|
|
10
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Action } from '../Action';
|
|
2
|
+
import { getAddr } from '../addresses';
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
*
|
|
6
|
+
* @category Triggers
|
|
7
|
+
*/
|
|
8
|
+
export class LiquityDebtInFrontWithLimitTrigger extends Action {
|
|
9
|
+
constructor(troveOwner, debtInFront) {
|
|
10
|
+
super('LiquityDebtInFrontWithLimitTrigger', getAddr('LiquityDebtInFrontWithLimitTrigger'), ['address', 'uint256'], [troveOwner, debtInFront]);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Action } from '../Action';
|
|
2
|
+
import { EthAddress, uint256, uint8 } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
*
|
|
6
|
+
* @category Triggers
|
|
7
|
+
*/
|
|
8
|
+
export declare class MorphoAaveV2RatioTrigger extends Action {
|
|
9
|
+
constructor(user: EthAddress, ratio: uint256, state: uint8);
|
|
10
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Action } from '../Action';
|
|
2
|
+
import { getAddr } from '../addresses';
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
*
|
|
6
|
+
* @category Triggers
|
|
7
|
+
*/
|
|
8
|
+
export class MorphoAaveV2RatioTrigger extends Action {
|
|
9
|
+
constructor(user, ratio, state) {
|
|
10
|
+
super('MorphoAaveV2RatioTrigger', getAddr('MorphoAaveV2RatioTrigger'), ['address', 'uint256', 'uint8'], [user, ratio, state]);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -11,5 +11,7 @@ export * from './CompV3RatioTrigger';
|
|
|
11
11
|
export * from './TrailingStopTrigger';
|
|
12
12
|
export * from './CBRebondTrigger';
|
|
13
13
|
export * from './AaveV3QuotePriceTrigger';
|
|
14
|
+
export * from './MorphoAaveV2RatioTrigger';
|
|
14
15
|
export * from './SparkRatioTrigger';
|
|
15
16
|
export * from './SparkQuotePriceTrigger';
|
|
17
|
+
export * from './LiquityDebtInFrontWithLimitTrigger';
|
|
@@ -11,5 +11,7 @@ export * from './CompV3RatioTrigger';
|
|
|
11
11
|
export * from './TrailingStopTrigger';
|
|
12
12
|
export * from './CBRebondTrigger';
|
|
13
13
|
export * from './AaveV3QuotePriceTrigger';
|
|
14
|
+
export * from './MorphoAaveV2RatioTrigger';
|
|
14
15
|
export * from './SparkRatioTrigger';
|
|
15
16
|
export * from './SparkQuotePriceTrigger';
|
|
17
|
+
export * from './LiquityDebtInFrontWithLimitTrigger';
|
package/esm/src/types.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
type AccessListItem = {
|
|
1
|
+
declare type AccessListItem = {
|
|
2
2
|
address: EthAddress;
|
|
3
3
|
storageKeys: Array<any>;
|
|
4
4
|
};
|
|
5
|
-
type AccessList = Array<Array<any>>;
|
|
6
|
-
type AccessLists = {
|
|
5
|
+
declare type AccessList = Array<Array<any>>;
|
|
6
|
+
declare type AccessLists = {
|
|
7
7
|
[key: string]: AccessList;
|
|
8
8
|
};
|
|
9
|
-
type Config = {
|
|
9
|
+
declare type Config = {
|
|
10
10
|
chainId: number;
|
|
11
11
|
testingMode: boolean;
|
|
12
12
|
[key: string]: any;
|
|
13
13
|
};
|
|
14
|
-
type Network = {
|
|
14
|
+
declare type Network = {
|
|
15
15
|
chainId: number;
|
|
16
16
|
chainName: string;
|
|
17
17
|
blockExplorerUrls: Array<string>;
|
|
@@ -23,24 +23,24 @@ type Network = {
|
|
|
23
23
|
symbol: string;
|
|
24
24
|
};
|
|
25
25
|
};
|
|
26
|
-
type Networks = {
|
|
26
|
+
declare type Networks = {
|
|
27
27
|
ethereum: Network;
|
|
28
28
|
optimism: Network;
|
|
29
29
|
arbitrum: Network;
|
|
30
30
|
base: Network;
|
|
31
31
|
};
|
|
32
|
-
type EthAddress = string;
|
|
33
|
-
type bytes32 = string;
|
|
34
|
-
type bytes = string | Array<any>;
|
|
35
|
-
type uint256 = string;
|
|
36
|
-
type uint32 = string;
|
|
37
|
-
type uint160 = string;
|
|
38
|
-
type uint128 = string;
|
|
39
|
-
type uint80 = string;
|
|
40
|
-
type uint64 = string;
|
|
41
|
-
type uint24 = string;
|
|
42
|
-
type uint16 = string;
|
|
43
|
-
type uint8 = string;
|
|
44
|
-
type int256 = string;
|
|
45
|
-
type int24 = string;
|
|
32
|
+
declare type EthAddress = string;
|
|
33
|
+
declare type bytes32 = string;
|
|
34
|
+
declare type bytes = string | Array<any>;
|
|
35
|
+
declare type uint256 = string;
|
|
36
|
+
declare type uint32 = string;
|
|
37
|
+
declare type uint160 = string;
|
|
38
|
+
declare type uint128 = string;
|
|
39
|
+
declare type uint80 = string;
|
|
40
|
+
declare type uint64 = string;
|
|
41
|
+
declare type uint24 = string;
|
|
42
|
+
declare type uint16 = string;
|
|
43
|
+
declare type uint8 = string;
|
|
44
|
+
declare type int256 = string;
|
|
45
|
+
declare type int24 = string;
|
|
46
46
|
export { AccessList, AccessListItem, AccessLists, Config, Network, Networks, EthAddress, bytes32, bytes, uint256, uint160, uint32, uint128, uint80, uint64, uint24, uint16, uint8, int256, int24, };
|
package/package.json
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
import { uint8, uint256 } from '../../types';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* LiquityRatioCheckAction - Checks liquity ratio increase for user position and reverts if faulty
|
|
7
|
+
*
|
|
8
|
+
* @category Checkers
|
|
9
|
+
*/
|
|
10
|
+
export class LiquityRatioIncreaseCheckAction extends Action {
|
|
11
|
+
/**
|
|
12
|
+
* @param targetRatio The ratio user want to be at
|
|
13
|
+
*/
|
|
14
|
+
constructor(targetRatioIncrease:uint256) {
|
|
15
|
+
super('LiquityRatioIncreaseCheck', getAddr('LiquityRatioIncreaseCheck'), ['uint256'], [targetRatioIncrease]);
|
|
16
|
+
|
|
17
|
+
this.mappableArgs = [
|
|
18
|
+
this.args[0],
|
|
19
|
+
];
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
import { uint8, uint256, EthAddress } from '../../types';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* MorphoAaveV2RatioCheckAction - Checks Morpho-AaveV2 ratio for user position and reverts if faulty
|
|
7
|
+
*
|
|
8
|
+
* @category Checkers
|
|
9
|
+
*/
|
|
10
|
+
export class MorphoAaveV2RatioCheckAction extends Action {
|
|
11
|
+
/**
|
|
12
|
+
* @param ratioState If it should lower/higher
|
|
13
|
+
* @param targetRatio The ratio user want to be at
|
|
14
|
+
* @param user Address of the user we are checking the ratio for (default to proxy)
|
|
15
|
+
*/
|
|
16
|
+
constructor(ratioState:uint8, targetRatio:uint256, user:EthAddress) {
|
|
17
|
+
super('MorphoAaveV2RatioCheck', getAddr('MorphoAaveV2RatioCheck'), ['uint8', 'uint256', 'address'], [ratioState, targetRatio, user]);
|
|
18
|
+
|
|
19
|
+
this.mappableArgs = [
|
|
20
|
+
this.args[0],
|
|
21
|
+
this.args[1],
|
|
22
|
+
this.args[2],
|
|
23
|
+
];
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export * from './MakerRatioCheckAction';
|
|
2
2
|
export * from './AaveV3RatioCheckAction';
|
|
3
3
|
export * from './CompoundV3RatioCheckAction';
|
|
4
|
+
export * from './MorphoAaveV2RatioCheckAction';
|
|
4
5
|
export * from './LiquityRatioCheckAction';
|
|
5
6
|
export * from './SparkRatioCheckAction';
|
|
7
|
+
export * from './LiquityRatioIncreaseCheckAction';
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
uint256,
|
|
7
7
|
uint32,
|
|
8
8
|
bytes,
|
|
9
|
+
uint24,
|
|
9
10
|
} from '../../types';
|
|
10
11
|
|
|
11
12
|
/**
|
|
@@ -22,15 +23,14 @@ export class CurveUsdLevCreateAction extends Action {
|
|
|
22
23
|
from: EthAddress,
|
|
23
24
|
additionData: bytes,
|
|
24
25
|
gasUsed: uint32,
|
|
25
|
-
dfsFeeDivider:
|
|
26
|
-
useSteth: Boolean,
|
|
26
|
+
dfsFeeDivider: uint24,
|
|
27
27
|
) {
|
|
28
28
|
requireAddress(from);
|
|
29
29
|
super(
|
|
30
30
|
'CurveUsdLevCreate',
|
|
31
31
|
getAddr('CurveUsdLevCreate'),
|
|
32
|
-
['address', 'uint256', 'uint256', 'uint256', 'uint256', 'address', 'bytes', 'uint32', '
|
|
33
|
-
[controllerAddress, collateralAmount, debtAmount, minAmount, nBands, from, additionData, gasUsed, dfsFeeDivider
|
|
32
|
+
['address', 'uint256', 'uint256', 'uint256', 'uint256', 'address', 'bytes', 'uint32', 'uint24'],
|
|
33
|
+
[controllerAddress, collateralAmount, debtAmount, minAmount, nBands, from, additionData, gasUsed, dfsFeeDivider],
|
|
34
34
|
);
|
|
35
35
|
|
|
36
36
|
this.mappableArgs = [
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
uint256,
|
|
6
6
|
uint32,
|
|
7
7
|
bytes,
|
|
8
|
+
uint24,
|
|
8
9
|
} from '../../types';
|
|
9
10
|
|
|
10
11
|
/**
|
|
@@ -19,14 +20,13 @@ export class CurveUsdRepayAction extends Action {
|
|
|
19
20
|
minAmount: uint256,
|
|
20
21
|
additionData: bytes,
|
|
21
22
|
gasUsed: uint32,
|
|
22
|
-
dfsFeeDivider:
|
|
23
|
-
useSteth: Boolean,
|
|
23
|
+
dfsFeeDivider: uint24,
|
|
24
24
|
) {
|
|
25
25
|
super(
|
|
26
26
|
'CurveUsdRepay',
|
|
27
27
|
getAddr('CurveUsdRepay'),
|
|
28
|
-
['address', 'uint256', 'address', 'uint256', 'bytes', 'uint32', '
|
|
29
|
-
[controllerAddress, collAmount, to, minAmount, additionData, gasUsed, dfsFeeDivider
|
|
28
|
+
['address', 'uint256', 'address', 'uint256', 'bytes', 'uint32', 'uint24'],
|
|
29
|
+
[controllerAddress, collAmount, to, minAmount, additionData, gasUsed, dfsFeeDivider],
|
|
30
30
|
);
|
|
31
31
|
|
|
32
32
|
this.mappableArgs = [
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
uint256,
|
|
7
7
|
uint32,
|
|
8
8
|
bytes,
|
|
9
|
+
uint24,
|
|
9
10
|
} from '../../types';
|
|
10
11
|
|
|
11
12
|
/**
|
|
@@ -22,15 +23,14 @@ export class CurveUsdSelfLiquidateWithCollAction extends Action {
|
|
|
22
23
|
to: EthAddress,
|
|
23
24
|
additionData: bytes,
|
|
24
25
|
gasUsed: uint32,
|
|
25
|
-
dfsFeeDivider:
|
|
26
|
-
useSteth: Boolean,
|
|
26
|
+
dfsFeeDivider: uint24,
|
|
27
27
|
) {
|
|
28
28
|
requireAddress(to);
|
|
29
29
|
super(
|
|
30
30
|
'CurveUsdSelfLiquidateWithColl',
|
|
31
31
|
getAddr('CurveUsdSelfLiquidateWithColl'),
|
|
32
|
-
['address', 'uint256', 'uint256', 'uint256', 'uint256', 'address', 'bytes', 'uint32', '
|
|
33
|
-
[controllerAddress, percentage, minCrvUsdExpected, swapAmount, minAmount, to, additionData, gasUsed, dfsFeeDivider
|
|
32
|
+
['address', 'uint256', 'uint256', 'uint256', 'uint256', 'address', 'bytes', 'uint32', 'uint24'],
|
|
33
|
+
[controllerAddress, percentage, minCrvUsdExpected, swapAmount, minAmount, to, additionData, gasUsed, dfsFeeDivider],
|
|
34
34
|
);
|
|
35
35
|
|
|
36
36
|
this.mappableArgs = [
|
package/src/addresses.ts
CHANGED
|
@@ -185,10 +185,10 @@ export const actionAddresses = {
|
|
|
185
185
|
GasFeeTaker: '0x431F1E1A9859EF99953801dbdeB31d2846ADcc0d',
|
|
186
186
|
|
|
187
187
|
CurveStethPoolDeposit: '0x5Ae5870dC0C780e9eb68bE7a223eCd7F3BDad12B',
|
|
188
|
-
CurveStethPoolWithdraw: '
|
|
188
|
+
CurveStethPoolWithdraw: '0x41313695a4829a80c8019Ec8bCC529Fec08F9099',
|
|
189
189
|
|
|
190
190
|
CurveDeposit: '0xf46aCCE6d2559971bF5Aea03A10B3679709CE43d',
|
|
191
|
-
CurveWithdraw: '
|
|
191
|
+
CurveWithdraw: '0x7127A1Cd69eC2A1F91661bc0ED40aD5B73898A54',
|
|
192
192
|
|
|
193
193
|
McdBoostComposite: '0x0000000000000000000000000000000000000000',
|
|
194
194
|
McdRepayComposite: '0x0000000000000000000000000000000000000000',
|
|
@@ -229,11 +229,11 @@ export const actionAddresses = {
|
|
|
229
229
|
CurveUsdSupply: '0xa55B3CE5ae7E59002f53b2153ABe326823ccCDE2',
|
|
230
230
|
CurveUsdAdjust: '0x6f69A7d0B1BE7602381d9cCE6B29F05B9D0b85e6',
|
|
231
231
|
CurveUsdWithdraw: '0x54B8D984fc79B000D7B6F6E0f52CD054E965120f',
|
|
232
|
-
CurveUsdLevCreate: '
|
|
233
|
-
CurveUsdRepay: '
|
|
234
|
-
CurveUsdSwapper: '
|
|
232
|
+
CurveUsdLevCreate: '0xcbd9aFc2b7532b9eeB3A7EC4ea8Bb4320795d9Ad',
|
|
233
|
+
CurveUsdRepay: '0xd12785e4834C1421fC7B64ca57d64E886e39b80F',
|
|
234
|
+
CurveUsdSwapper: '0xFA8c594b903651F97b27aCADEa83b720cfD7F80b',
|
|
235
235
|
CurveUsdSelfLiquidate: '0xd90d8a4955DfE9D4f45F7f60595313B0925ee1da',
|
|
236
|
-
CurveUsdSelfLiquidateWithColl: '
|
|
236
|
+
CurveUsdSelfLiquidateWithColl: '0x7cE305FC2A18c6820a533AD418dC0A549aFeDcAF',
|
|
237
237
|
},
|
|
238
238
|
[NETWORKS.optimism.chainId]: {
|
|
239
239
|
DFSSell: '0xC6c601fcAa870efd26C624F8c65fbc54cBe533b1',
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Action } from '../Action';
|
|
2
|
+
import { getAddr } from '../addresses';
|
|
3
|
+
import { EthAddress, uint256, uint8 } from '../types';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* @category Triggers
|
|
9
|
+
*/
|
|
10
|
+
export class LiquityDebtInFrontWithLimitTrigger extends Action {
|
|
11
|
+
constructor(troveOwner:EthAddress, debtInFront:uint256) {
|
|
12
|
+
super(
|
|
13
|
+
'LiquityDebtInFrontWithLimitTrigger',
|
|
14
|
+
getAddr('LiquityDebtInFrontWithLimitTrigger'),
|
|
15
|
+
['address', 'uint256'],
|
|
16
|
+
[troveOwner, debtInFront],
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Action } from '../Action';
|
|
2
|
+
import { getAddr } from '../addresses';
|
|
3
|
+
import { EthAddress, uint256, uint8 } from '../types';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
*
|
|
8
|
+
*
|
|
9
|
+
* @category Triggers
|
|
10
|
+
*/
|
|
11
|
+
export class MorphoAaveV2RatioTrigger extends Action {
|
|
12
|
+
constructor(user:EthAddress, ratio:uint256, state:uint8) {
|
|
13
|
+
super('MorphoAaveV2RatioTrigger', getAddr('MorphoAaveV2RatioTrigger'), ['address', 'uint256', 'uint8'], [user, ratio, state]);
|
|
14
|
+
}
|
|
15
|
+
}
|
package/src/triggers/index.ts
CHANGED
|
@@ -11,5 +11,7 @@ export * from './CompV3RatioTrigger';
|
|
|
11
11
|
export * from './TrailingStopTrigger';
|
|
12
12
|
export * from './CBRebondTrigger';
|
|
13
13
|
export * from './AaveV3QuotePriceTrigger';
|
|
14
|
+
export * from './MorphoAaveV2RatioTrigger';
|
|
14
15
|
export * from './SparkRatioTrigger';
|
|
15
16
|
export * from './SparkQuotePriceTrigger';
|
|
17
|
+
export * from './LiquityDebtInFrontWithLimitTrigger';
|