@defisaver/sdk 1.3.16 → 1.3.17-aave-v4-dev
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/Strategy.d.ts +1 -0
- package/esm/src/Strategy.js +3 -0
- package/esm/src/actions/aavev4/AaveV4BorrowAction.d.ts +17 -0
- package/esm/src/actions/aavev4/AaveV4BorrowAction.js +26 -0
- package/esm/src/actions/aavev4/AaveV4CollateralSwitchAction.d.ts +16 -0
- package/esm/src/actions/aavev4/AaveV4CollateralSwitchAction.js +24 -0
- package/esm/src/actions/aavev4/AaveV4PaybackAction.d.ts +23 -0
- package/esm/src/actions/aavev4/AaveV4PaybackAction.js +46 -0
- package/esm/src/actions/aavev4/AaveV4StoreRatioAction.d.ts +14 -0
- package/esm/src/actions/aavev4/AaveV4StoreRatioAction.js +20 -0
- package/esm/src/actions/aavev4/AaveV4SupplyAction.d.ts +25 -0
- package/esm/src/actions/aavev4/AaveV4SupplyAction.js +49 -0
- package/esm/src/actions/aavev4/AaveV4WithdrawAction.d.ts +17 -0
- package/esm/src/actions/aavev4/AaveV4WithdrawAction.js +26 -0
- package/esm/src/actions/aavev4/index.d.ts +6 -0
- package/esm/src/actions/aavev4/index.js +6 -0
- package/esm/src/actions/checkers/AaveV4RatioCheckAction.d.ts +16 -0
- package/esm/src/actions/checkers/AaveV4RatioCheckAction.js +24 -0
- package/esm/src/actions/checkers/index.d.ts +1 -0
- package/esm/src/actions/checkers/index.js +1 -0
- package/esm/src/actions/index.d.ts +2 -1
- package/esm/src/actions/index.js +2 -1
- package/esm/src/addresses.d.ts +35 -0
- package/esm/src/addresses.js +10 -0
- package/esm/src/index.d.ts +140 -0
- package/esm/src/triggers/AaveV4QuotePriceRangeTrigger.d.ts +10 -0
- package/esm/src/triggers/AaveV4QuotePriceRangeTrigger.js +12 -0
- package/esm/src/triggers/AaveV4QuotePriceTrigger.d.ts +10 -0
- package/esm/src/triggers/AaveV4QuotePriceTrigger.js +12 -0
- package/esm/src/triggers/AaveV4RatioTrigger.d.ts +10 -0
- package/esm/src/triggers/AaveV4RatioTrigger.js +12 -0
- package/esm/src/triggers/index.d.ts +3 -0
- package/esm/src/triggers/index.js +3 -0
- package/package.json +1 -1
- package/src/Strategy.ts +4 -0
- package/src/actions/aavev4/AaveV4BorrowAction.ts +39 -0
- package/src/actions/aavev4/AaveV4CollateralSwitchAction.ts +36 -0
- package/src/actions/aavev4/AaveV4PaybackAction.ts +51 -0
- package/src/actions/aavev4/AaveV4StoreRatioAction.ts +30 -0
- package/src/actions/aavev4/AaveV4SupplyAction.ts +55 -0
- package/src/actions/aavev4/AaveV4WithdrawAction.ts +39 -0
- package/src/actions/aavev4/index.ts +6 -0
- package/src/actions/checkers/AaveV4RatioCheckAction.ts +36 -0
- package/src/actions/checkers/index.ts +2 -1
- package/src/actions/index.ts +2 -0
- package/src/addresses.ts +15 -2
- package/src/triggers/AaveV4QuotePriceRangeTrigger.ts +25 -0
- package/src/triggers/AaveV4QuotePriceTrigger.ts +25 -0
- package/src/triggers/AaveV4RatioTrigger.ts +24 -0
- package/src/triggers/index.ts +4 -1
- package/umd/index.js +964 -581
package/esm/src/Strategy.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export declare class Strategy {
|
|
|
13
13
|
addSubSlot(name: string, type: string): void;
|
|
14
14
|
addTrigger(newTrigger: Action): void;
|
|
15
15
|
addAction(newAction: Action): void;
|
|
16
|
+
addActions(newActions: Array<Action>): void;
|
|
16
17
|
print(): void;
|
|
17
18
|
getSubSlots(): any;
|
|
18
19
|
encodeForDsProxyCall(): (string | string[] | number[][])[];
|
package/esm/src/Strategy.js
CHANGED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { EthAddress, uint256 } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* AaveV4BorrowAction
|
|
5
|
+
*
|
|
6
|
+
* @category AaveV4
|
|
7
|
+
*/
|
|
8
|
+
export declare class AaveV4BorrowAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param spoke Address of the spoke.
|
|
11
|
+
* @param onBehalf Address to borrow tokens on behalf of. Defaults to the user's wallet if not provided.
|
|
12
|
+
* @param to Address that will receive the borrowed tokens.
|
|
13
|
+
* @param reserveId Reserve id.
|
|
14
|
+
* @param amount Amount of tokens to borrow.
|
|
15
|
+
*/
|
|
16
|
+
constructor(spoke: EthAddress, onBehalf: EthAddress, to: EthAddress, reserveId: uint256, amount: uint256);
|
|
17
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
/**
|
|
4
|
+
* AaveV4BorrowAction
|
|
5
|
+
*
|
|
6
|
+
* @category AaveV4
|
|
7
|
+
*/
|
|
8
|
+
export class AaveV4BorrowAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param spoke Address of the spoke.
|
|
11
|
+
* @param onBehalf Address to borrow tokens on behalf of. Defaults to the user's wallet if not provided.
|
|
12
|
+
* @param to Address that will receive the borrowed tokens.
|
|
13
|
+
* @param reserveId Reserve id.
|
|
14
|
+
* @param amount Amount of tokens to borrow.
|
|
15
|
+
*/
|
|
16
|
+
constructor(spoke, onBehalf, to, reserveId, amount) {
|
|
17
|
+
super('AaveV4Borrow', getAddr('AaveV4Borrow'), ['address', 'address', 'address', 'uint256', 'uint256'], [spoke, onBehalf, to, reserveId, amount]);
|
|
18
|
+
this.mappableArgs = [
|
|
19
|
+
this.args[0],
|
|
20
|
+
this.args[1],
|
|
21
|
+
this.args[2],
|
|
22
|
+
this.args[3],
|
|
23
|
+
this.args[4],
|
|
24
|
+
];
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { EthAddress, uint256 } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* AaveV4CollateralSwitchAction
|
|
5
|
+
*
|
|
6
|
+
* @category AaveV4
|
|
7
|
+
*/
|
|
8
|
+
export declare class AaveV4CollateralSwitchAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param spoke Address of the spoke.
|
|
11
|
+
* @param onBehalf Address to switch collateral on behalf of. Defaults to the user's wallet if not provided.
|
|
12
|
+
* @param reserveId Reserve id.
|
|
13
|
+
* @param useAsCollateral Whether to use the tokens as collateral.
|
|
14
|
+
*/
|
|
15
|
+
constructor(spoke: EthAddress, onBehalf: EthAddress, reserveId: uint256, useAsCollateral: boolean);
|
|
16
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
/**
|
|
4
|
+
* AaveV4CollateralSwitchAction
|
|
5
|
+
*
|
|
6
|
+
* @category AaveV4
|
|
7
|
+
*/
|
|
8
|
+
export class AaveV4CollateralSwitchAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param spoke Address of the spoke.
|
|
11
|
+
* @param onBehalf Address to switch collateral on behalf of. Defaults to the user's wallet if not provided.
|
|
12
|
+
* @param reserveId Reserve id.
|
|
13
|
+
* @param useAsCollateral Whether to use the tokens as collateral.
|
|
14
|
+
*/
|
|
15
|
+
constructor(spoke, onBehalf, reserveId, useAsCollateral) {
|
|
16
|
+
super('AaveV4CollateralSwitch', getAddr('AaveV4CollateralSwitch'), ['address', 'address', 'uint256', 'bool'], [spoke, onBehalf, reserveId, useAsCollateral]);
|
|
17
|
+
this.mappableArgs = [
|
|
18
|
+
this.args[0],
|
|
19
|
+
this.args[1],
|
|
20
|
+
this.args[2],
|
|
21
|
+
this.args[3],
|
|
22
|
+
];
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { EthAddress, uint256 } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* AaveV4PaybackAction
|
|
5
|
+
*
|
|
6
|
+
* @category AaveV4
|
|
7
|
+
*/
|
|
8
|
+
export declare class AaveV4PaybackAction extends Action {
|
|
9
|
+
tokenForApproval: EthAddress;
|
|
10
|
+
/**
|
|
11
|
+
* @param spoke Address of the spoke.
|
|
12
|
+
* @param onBehalf Address to payback tokens on behalf of. Defaults to the user's wallet if not provided.
|
|
13
|
+
* @param from Address from which to pull the payback tokens.
|
|
14
|
+
* @param reserveId Reserve id.
|
|
15
|
+
* @param amount Amount of tokens to payback. Send type(uint).max to payback whole amount.
|
|
16
|
+
* @param tokenAddress Address of the token to approve. Optional, as it is only used for token approval, not part of encoding.
|
|
17
|
+
*/
|
|
18
|
+
constructor(spoke: EthAddress, onBehalf: EthAddress, from: EthAddress, reserveId: uint256, amount: uint256, tokenAddress?: EthAddress);
|
|
19
|
+
getAssetsToApprove(): Promise<{
|
|
20
|
+
asset: string;
|
|
21
|
+
owner: any;
|
|
22
|
+
}[]>;
|
|
23
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { getAssetInfoByAddress } from '@defisaver/tokens';
|
|
11
|
+
import { Action } from '../../Action';
|
|
12
|
+
import { getAddr } from '../../addresses';
|
|
13
|
+
/**
|
|
14
|
+
* AaveV4PaybackAction
|
|
15
|
+
*
|
|
16
|
+
* @category AaveV4
|
|
17
|
+
*/
|
|
18
|
+
export class AaveV4PaybackAction extends Action {
|
|
19
|
+
/**
|
|
20
|
+
* @param spoke Address of the spoke.
|
|
21
|
+
* @param onBehalf Address to payback tokens on behalf of. Defaults to the user's wallet if not provided.
|
|
22
|
+
* @param from Address from which to pull the payback tokens.
|
|
23
|
+
* @param reserveId Reserve id.
|
|
24
|
+
* @param amount Amount of tokens to payback. Send type(uint).max to payback whole amount.
|
|
25
|
+
* @param tokenAddress Address of the token to approve. Optional, as it is only used for token approval, not part of encoding.
|
|
26
|
+
*/
|
|
27
|
+
constructor(spoke, onBehalf, from, reserveId, amount, tokenAddress = getAddr('Empty')) {
|
|
28
|
+
super('AaveV4Payback', getAddr('AaveV4Payback'), ['address', 'address', 'address', 'uint256', 'uint256'], [spoke, onBehalf, from, reserveId, amount]);
|
|
29
|
+
this.mappableArgs = [
|
|
30
|
+
this.args[0],
|
|
31
|
+
this.args[1],
|
|
32
|
+
this.args[2],
|
|
33
|
+
this.args[3],
|
|
34
|
+
this.args[4],
|
|
35
|
+
];
|
|
36
|
+
this.tokenForApproval = tokenAddress;
|
|
37
|
+
}
|
|
38
|
+
getAssetsToApprove() {
|
|
39
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
40
|
+
const asset = getAssetInfoByAddress(this.tokenForApproval);
|
|
41
|
+
if (asset.symbol !== 'ETH')
|
|
42
|
+
return [{ asset: this.tokenForApproval, owner: this.args[2] }];
|
|
43
|
+
return [];
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { EthAddress } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* AaveV4StoreRatioAction - Stores the ratio for a user in transient storage so it can be checked later after strategy execution.
|
|
5
|
+
*
|
|
6
|
+
* @category AaveV4
|
|
7
|
+
*/
|
|
8
|
+
export declare class AaveV4StoreRatioAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param spoke Address of the spoke.
|
|
11
|
+
* @param user Address of the user to store the ratio for.
|
|
12
|
+
*/
|
|
13
|
+
constructor(spoke: EthAddress, user: EthAddress);
|
|
14
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
/**
|
|
4
|
+
* AaveV4StoreRatioAction - Stores the ratio for a user in transient storage so it can be checked later after strategy execution.
|
|
5
|
+
*
|
|
6
|
+
* @category AaveV4
|
|
7
|
+
*/
|
|
8
|
+
export class AaveV4StoreRatioAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param spoke Address of the spoke.
|
|
11
|
+
* @param user Address of the user to store the ratio for.
|
|
12
|
+
*/
|
|
13
|
+
constructor(spoke, user) {
|
|
14
|
+
super('AaveV4StoreRatio', getAddr('Empty'), ['address', 'address'], [spoke, user]);
|
|
15
|
+
this.mappableArgs = [
|
|
16
|
+
this.args[0],
|
|
17
|
+
this.args[1],
|
|
18
|
+
];
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { EthAddress, uint256 } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* AaveV4SupplyAction
|
|
5
|
+
*
|
|
6
|
+
* @category AaveV4
|
|
7
|
+
*/
|
|
8
|
+
export declare class AaveV4SupplyAction extends Action {
|
|
9
|
+
tokenForApproval: EthAddress;
|
|
10
|
+
/**
|
|
11
|
+
* @param spoke Address of the spoke.
|
|
12
|
+
* @param onBehalf Address to supply tokens on behalf of. Defaults to the user's wallet if not provided.
|
|
13
|
+
* @param from Address from which to pull collateral asset.
|
|
14
|
+
* @param reserveId Reserve id.
|
|
15
|
+
* @param amount Amount of tokens to supply.
|
|
16
|
+
* @param useAsCollateral Whether to use the tokens as collateral.
|
|
17
|
+
* @param tokenAddress Address of the token to approve. Optional, as it is only used for token approval, not part of encoding.
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
constructor(spoke: EthAddress, onBehalf: EthAddress, from: EthAddress, reserveId: uint256, amount: uint256, useAsCollateral: boolean, tokenAddress?: EthAddress);
|
|
21
|
+
getAssetsToApprove(): Promise<{
|
|
22
|
+
asset: string;
|
|
23
|
+
owner: any;
|
|
24
|
+
}[]>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { getAssetInfoByAddress } from '@defisaver/tokens';
|
|
11
|
+
import { Action } from '../../Action';
|
|
12
|
+
import { getAddr } from '../../addresses';
|
|
13
|
+
/**
|
|
14
|
+
* AaveV4SupplyAction
|
|
15
|
+
*
|
|
16
|
+
* @category AaveV4
|
|
17
|
+
*/
|
|
18
|
+
export class AaveV4SupplyAction extends Action {
|
|
19
|
+
/**
|
|
20
|
+
* @param spoke Address of the spoke.
|
|
21
|
+
* @param onBehalf Address to supply tokens on behalf of. Defaults to the user's wallet if not provided.
|
|
22
|
+
* @param from Address from which to pull collateral asset.
|
|
23
|
+
* @param reserveId Reserve id.
|
|
24
|
+
* @param amount Amount of tokens to supply.
|
|
25
|
+
* @param useAsCollateral Whether to use the tokens as collateral.
|
|
26
|
+
* @param tokenAddress Address of the token to approve. Optional, as it is only used for token approval, not part of encoding.
|
|
27
|
+
*
|
|
28
|
+
*/
|
|
29
|
+
constructor(spoke, onBehalf, from, reserveId, amount, useAsCollateral, tokenAddress = getAddr('Empty')) {
|
|
30
|
+
super('AaveV4Supply', getAddr('AaveV4Supply'), ['address', 'address', 'address', 'uint256', 'uint256', 'bool'], [spoke, onBehalf, from, reserveId, amount, useAsCollateral]);
|
|
31
|
+
this.mappableArgs = [
|
|
32
|
+
this.args[0],
|
|
33
|
+
this.args[1],
|
|
34
|
+
this.args[2],
|
|
35
|
+
this.args[3],
|
|
36
|
+
this.args[4],
|
|
37
|
+
this.args[5],
|
|
38
|
+
];
|
|
39
|
+
this.tokenForApproval = tokenAddress;
|
|
40
|
+
}
|
|
41
|
+
getAssetsToApprove() {
|
|
42
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
const asset = getAssetInfoByAddress(this.tokenForApproval);
|
|
44
|
+
if (asset.symbol !== 'ETH')
|
|
45
|
+
return [{ asset: this.tokenForApproval, owner: this.args[2] }];
|
|
46
|
+
return [];
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { EthAddress, uint256 } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* AaveV4WithdrawAction
|
|
5
|
+
*
|
|
6
|
+
* @category AaveV4
|
|
7
|
+
*/
|
|
8
|
+
export declare class AaveV4WithdrawAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param spoke Address of the spoke.
|
|
11
|
+
* @param onBehalf Address to withdraw tokens on behalf of. Defaults to the user's wallet if not provided.
|
|
12
|
+
* @param to Address that will receive the withdrawn tokens.
|
|
13
|
+
* @param reserveId Reserve id.
|
|
14
|
+
* @param amount Amount of tokens to withdraw. Send type(uint).max to withdraw whole amount.
|
|
15
|
+
*/
|
|
16
|
+
constructor(spoke: EthAddress, onBehalf: EthAddress, to: EthAddress, reserveId: uint256, amount: uint256);
|
|
17
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
/**
|
|
4
|
+
* AaveV4WithdrawAction
|
|
5
|
+
*
|
|
6
|
+
* @category AaveV4
|
|
7
|
+
*/
|
|
8
|
+
export class AaveV4WithdrawAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param spoke Address of the spoke.
|
|
11
|
+
* @param onBehalf Address to withdraw tokens on behalf of. Defaults to the user's wallet if not provided.
|
|
12
|
+
* @param to Address that will receive the withdrawn tokens.
|
|
13
|
+
* @param reserveId Reserve id.
|
|
14
|
+
* @param amount Amount of tokens to withdraw. Send type(uint).max to withdraw whole amount.
|
|
15
|
+
*/
|
|
16
|
+
constructor(spoke, onBehalf, to, reserveId, amount) {
|
|
17
|
+
super('AaveV4Withdraw', getAddr('AaveV4Withdraw'), ['address', 'address', 'address', 'uint256', 'uint256'], [spoke, onBehalf, to, reserveId, amount]);
|
|
18
|
+
this.mappableArgs = [
|
|
19
|
+
this.args[0],
|
|
20
|
+
this.args[1],
|
|
21
|
+
this.args[2],
|
|
22
|
+
this.args[3],
|
|
23
|
+
this.args[4],
|
|
24
|
+
];
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { EthAddress, uint256, uint8 } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* AaveV4RatioCheckAction - Checks aave V4 ratio for user position
|
|
5
|
+
*
|
|
6
|
+
* @category AaveV4RatioCheck
|
|
7
|
+
*/
|
|
8
|
+
export declare class AaveV4RatioCheckAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param ratioState State of the ratio (IN_BOOST or IN_REPAY)
|
|
11
|
+
* @param targetRatio Target ratio.
|
|
12
|
+
* @param spoke Aave V4 spoke address.
|
|
13
|
+
* @param user User address.
|
|
14
|
+
*/
|
|
15
|
+
constructor(ratioState: uint8, targetRatio: uint256, spoke: EthAddress, user: EthAddress);
|
|
16
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
/**
|
|
4
|
+
* AaveV4RatioCheckAction - Checks aave V4 ratio for user position
|
|
5
|
+
*
|
|
6
|
+
* @category AaveV4RatioCheck
|
|
7
|
+
*/
|
|
8
|
+
export class AaveV4RatioCheckAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param ratioState State of the ratio (IN_BOOST or IN_REPAY)
|
|
11
|
+
* @param targetRatio Target ratio.
|
|
12
|
+
* @param spoke Aave V4 spoke address.
|
|
13
|
+
* @param user User address.
|
|
14
|
+
*/
|
|
15
|
+
constructor(ratioState, targetRatio, spoke, user) {
|
|
16
|
+
super('AaveV4RatioCheck', getAddr('Empty'), ['uint8', 'uint256', 'address', 'address'], [ratioState, targetRatio, spoke, user]);
|
|
17
|
+
this.mappableArgs = [
|
|
18
|
+
this.args[0],
|
|
19
|
+
this.args[1],
|
|
20
|
+
this.args[2],
|
|
21
|
+
this.args[3],
|
|
22
|
+
];
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -39,4 +39,5 @@ import * as etherfi from './etherfi';
|
|
|
39
39
|
import * as fluid from './fluid';
|
|
40
40
|
import * as pendle from './pendle';
|
|
41
41
|
import * as umbrella from './umbrella';
|
|
42
|
-
|
|
42
|
+
import * as aaveV4 from './aavev4';
|
|
43
|
+
export { aave, maker, compound, basic, flashloan, uniswap, reflexer, dydx, uniswapV3, checkers, liquity, yearn, lido, insta, balancer, curve, guni, mstable, rari, aaveV3, convex, chickenBonds, compoundV3, morpho, bprotocol, lsv, spark, curveusd, morphoblue, summerfi, llamalend, merkl, eulerV2, sky, liquityV2, stkgho, renzo, etherfi, fluid, pendle, umbrella, aaveV4, };
|
package/esm/src/actions/index.js
CHANGED
|
@@ -39,4 +39,5 @@ import * as etherfi from './etherfi';
|
|
|
39
39
|
import * as fluid from './fluid';
|
|
40
40
|
import * as pendle from './pendle';
|
|
41
41
|
import * as umbrella from './umbrella';
|
|
42
|
-
|
|
42
|
+
import * as aaveV4 from './aavev4';
|
|
43
|
+
export { aave, maker, compound, basic, flashloan, uniswap, reflexer, dydx, uniswapV3, checkers, liquity, yearn, lido, insta, balancer, curve, guni, mstable, rari, aaveV3, convex, chickenBonds, compoundV3, morpho, bprotocol, lsv, spark, curveusd, morphoblue, summerfi, llamalend, merkl, eulerV2, sky, liquityV2, stkgho, renzo, etherfi, fluid, pendle, umbrella, aaveV4, };
|
package/esm/src/addresses.d.ts
CHANGED
|
@@ -277,6 +277,11 @@ export declare const actionAddresses: {
|
|
|
277
277
|
SFApproveTokens: string;
|
|
278
278
|
SummerfiUnsub: string;
|
|
279
279
|
SummerfiUnsubV2: string;
|
|
280
|
+
AaveV4Supply: string;
|
|
281
|
+
AaveV4Withdraw: string;
|
|
282
|
+
AaveV4Borrow: string;
|
|
283
|
+
AaveV4Payback: string;
|
|
284
|
+
AaveV4CollateralSwitch: string;
|
|
280
285
|
AaveV3DelegateCredit?: undefined;
|
|
281
286
|
AaveV3RatioTrigger?: undefined;
|
|
282
287
|
GasFeeTakerL2?: undefined;
|
|
@@ -563,6 +568,11 @@ export declare const actionAddresses: {
|
|
|
563
568
|
UmbrellaClaimRewards?: undefined;
|
|
564
569
|
UmbrellaStake?: undefined;
|
|
565
570
|
UmbrellaUnstake?: undefined;
|
|
571
|
+
AaveV4Supply?: undefined;
|
|
572
|
+
AaveV4Withdraw?: undefined;
|
|
573
|
+
AaveV4Borrow?: undefined;
|
|
574
|
+
AaveV4Payback?: undefined;
|
|
575
|
+
AaveV4CollateralSwitch?: undefined;
|
|
566
576
|
MorphoBlueView?: undefined;
|
|
567
577
|
} | {
|
|
568
578
|
DFSSell: string;
|
|
@@ -844,6 +854,11 @@ export declare const actionAddresses: {
|
|
|
844
854
|
UmbrellaClaimRewards?: undefined;
|
|
845
855
|
UmbrellaStake?: undefined;
|
|
846
856
|
UmbrellaUnstake?: undefined;
|
|
857
|
+
AaveV4Supply?: undefined;
|
|
858
|
+
AaveV4Withdraw?: undefined;
|
|
859
|
+
AaveV4Borrow?: undefined;
|
|
860
|
+
AaveV4Payback?: undefined;
|
|
861
|
+
AaveV4CollateralSwitch?: undefined;
|
|
847
862
|
AaveV3DelegateCredit?: undefined;
|
|
848
863
|
AaveV3RatioTrigger?: undefined;
|
|
849
864
|
} | {
|
|
@@ -1125,6 +1140,11 @@ export declare const actionAddresses: {
|
|
|
1125
1140
|
UmbrellaClaimRewards?: undefined;
|
|
1126
1141
|
UmbrellaStake?: undefined;
|
|
1127
1142
|
UmbrellaUnstake?: undefined;
|
|
1143
|
+
AaveV4Supply?: undefined;
|
|
1144
|
+
AaveV4Withdraw?: undefined;
|
|
1145
|
+
AaveV4Borrow?: undefined;
|
|
1146
|
+
AaveV4Payback?: undefined;
|
|
1147
|
+
AaveV4CollateralSwitch?: undefined;
|
|
1128
1148
|
AaveV3DelegateCredit?: undefined;
|
|
1129
1149
|
AaveV3RatioTrigger?: undefined;
|
|
1130
1150
|
AaveV3RatioCheck?: undefined;
|
|
@@ -1406,6 +1426,11 @@ export declare const actionAddresses: {
|
|
|
1406
1426
|
SFApproveTokens?: undefined;
|
|
1407
1427
|
SummerfiUnsub?: undefined;
|
|
1408
1428
|
SummerfiUnsubV2?: undefined;
|
|
1429
|
+
AaveV4Supply?: undefined;
|
|
1430
|
+
AaveV4Withdraw?: undefined;
|
|
1431
|
+
AaveV4Borrow?: undefined;
|
|
1432
|
+
AaveV4Payback?: undefined;
|
|
1433
|
+
AaveV4CollateralSwitch?: undefined;
|
|
1409
1434
|
AaveV3RatioTrigger?: undefined;
|
|
1410
1435
|
GasFeeTakerL2?: undefined;
|
|
1411
1436
|
AaveV3RatioCheck?: undefined;
|
|
@@ -1688,6 +1713,11 @@ export declare const actionAddresses: {
|
|
|
1688
1713
|
SFApproveTokens?: undefined;
|
|
1689
1714
|
SummerfiUnsub?: undefined;
|
|
1690
1715
|
SummerfiUnsubV2?: undefined;
|
|
1716
|
+
AaveV4Supply?: undefined;
|
|
1717
|
+
AaveV4Withdraw?: undefined;
|
|
1718
|
+
AaveV4Borrow?: undefined;
|
|
1719
|
+
AaveV4Payback?: undefined;
|
|
1720
|
+
AaveV4CollateralSwitch?: undefined;
|
|
1691
1721
|
AaveV3RatioTrigger?: undefined;
|
|
1692
1722
|
GasFeeTakerL2?: undefined;
|
|
1693
1723
|
AaveV3RatioCheck?: undefined;
|
|
@@ -1701,6 +1731,7 @@ export declare const otherAddresses: {
|
|
|
1701
1731
|
DFSRegistry: string;
|
|
1702
1732
|
DFSProxyRegistry: string;
|
|
1703
1733
|
ProxyRegistry: string;
|
|
1734
|
+
SFProxyEntryPoint: string;
|
|
1704
1735
|
McdCdpManager: string;
|
|
1705
1736
|
BCdpManager: string;
|
|
1706
1737
|
AaveDefaultMarket: string;
|
|
@@ -1722,6 +1753,7 @@ export declare const otherAddresses: {
|
|
|
1722
1753
|
RecipeExecutorForTxSaver: string;
|
|
1723
1754
|
DFSRegistry: string;
|
|
1724
1755
|
ProxyRegistry: string;
|
|
1756
|
+
SFProxyEntryPoint: string;
|
|
1725
1757
|
DSGuardFactory: string;
|
|
1726
1758
|
AdminVault: string;
|
|
1727
1759
|
DefisaverLogger: string;
|
|
@@ -1744,6 +1776,7 @@ export declare const otherAddresses: {
|
|
|
1744
1776
|
RecipeExecutorForTxSaver: string;
|
|
1745
1777
|
DFSRegistry: string;
|
|
1746
1778
|
ProxyRegistry: string;
|
|
1779
|
+
SFProxyEntryPoint: string;
|
|
1747
1780
|
DSGuardFactory: string;
|
|
1748
1781
|
AdminVault: string;
|
|
1749
1782
|
DefisaverLogger: string;
|
|
@@ -1771,6 +1804,7 @@ export declare const otherAddresses: {
|
|
|
1771
1804
|
RecipeExecutorForTxSaver?: undefined;
|
|
1772
1805
|
DFSProxyRegistry?: undefined;
|
|
1773
1806
|
ProxyRegistry?: undefined;
|
|
1807
|
+
SFProxyEntryPoint?: undefined;
|
|
1774
1808
|
McdCdpManager?: undefined;
|
|
1775
1809
|
BCdpManager?: undefined;
|
|
1776
1810
|
AaveDefaultMarket?: undefined;
|
|
@@ -1792,6 +1826,7 @@ export declare const otherAddresses: {
|
|
|
1792
1826
|
RecipeExecutorForTxSaver?: undefined;
|
|
1793
1827
|
DFSProxyRegistry?: undefined;
|
|
1794
1828
|
ProxyRegistry?: undefined;
|
|
1829
|
+
SFProxyEntryPoint?: undefined;
|
|
1795
1830
|
McdCdpManager?: undefined;
|
|
1796
1831
|
BCdpManager?: undefined;
|
|
1797
1832
|
AaveDefaultMarket?: undefined;
|
package/esm/src/addresses.js
CHANGED
|
@@ -318,6 +318,12 @@ export const actionAddresses = {
|
|
|
318
318
|
SFApproveTokens: '0x0aC29D44eeC8e8f3b010c2e8FC960957db0c8298',
|
|
319
319
|
SummerfiUnsub: '0x926405D69b77A514ED974901095AcFf9e5131366',
|
|
320
320
|
SummerfiUnsubV2: '0x5E805eD9B7581a9f1398F75833f9663a459F5E30',
|
|
321
|
+
// AaveV4
|
|
322
|
+
AaveV4Supply: '0x30f333997eA08CA7Af95E32F4f90DACEf284D746',
|
|
323
|
+
AaveV4Withdraw: '0x8fc7F5dCeb5da1B0293A246ed6aeDc44EB37dB38',
|
|
324
|
+
AaveV4Borrow: '0x0a58710A67837E6d026B83c434519c5f0A0cD7a1',
|
|
325
|
+
AaveV4Payback: '0xCbcbD3b3e0D704Ad26b7dCfe1BdA6e85CDd8DBf0',
|
|
326
|
+
AaveV4CollateralSwitch: '0x19Ef19d6b8818103b8Cae086BB23e183EF7E433f',
|
|
321
327
|
},
|
|
322
328
|
[NETWORKS.optimism.chainId]: {
|
|
323
329
|
DFSSell: '0x9f234af5c10c136863a20865ba00b26951ab8269',
|
|
@@ -649,6 +655,7 @@ export const otherAddresses = {
|
|
|
649
655
|
DFSRegistry: '0x287778F121F134C66212FB16c9b53eC991D32f5b',
|
|
650
656
|
DFSProxyRegistry: '0x29474FdaC7142f9aB7773B8e38264FA15E3805ed',
|
|
651
657
|
ProxyRegistry: '0x4678f0a6958e4D2Bc4F1BAF7Bc52E8F3564f3fE4',
|
|
658
|
+
SFProxyEntryPoint: '0xAa15ca459659F35B1064EC546A44d962d54bA89e',
|
|
652
659
|
McdCdpManager: '0x5ef30b9986345249bc32d8928b7ee64de9435e39',
|
|
653
660
|
BCdpManager: '0x3f30c2381CD8B917Dd96EB2f1A4F96D91324BBed',
|
|
654
661
|
AaveDefaultMarket: '0xB53C1a33016B2DC2fF3653530bfF1848a515c8c5',
|
|
@@ -668,6 +675,7 @@ export const otherAddresses = {
|
|
|
668
675
|
RecipeExecutorForTxSaver: '0x993A8c81142044E1CB0Cf0c3d84BEa235d842Fb0',
|
|
669
676
|
DFSRegistry: '0xAf707Ee480204Ed6e2640B53cE86F680D28Afcbd',
|
|
670
677
|
ProxyRegistry: '0x283Cc5C26e53D66ed2Ea252D986F094B37E6e895',
|
|
678
|
+
SFProxyEntryPoint: '0x06299D4A07E8C6D7C1aEc14Ab2F46DF05Dd9588E',
|
|
671
679
|
DSGuardFactory: '0xc19d0F1E2b38AA283E226Ca4044766A43aA7B02b',
|
|
672
680
|
AdminVault: '0x136b1bEAfff362530F98f10E3D8C38f3a3F3d38C',
|
|
673
681
|
DefisaverLogger: '0xFc2f1355296ab7dd98a1260E3Ff5E906999d4Acb',
|
|
@@ -679,6 +687,7 @@ export const otherAddresses = {
|
|
|
679
687
|
RecipeExecutorForTxSaver: '0x7a25174229ea402d8ccd35fc6d55af079c399884',
|
|
680
688
|
DFSRegistry: '0xBF1CaC12DB60819Bfa71A328282ecbc1D40443aA',
|
|
681
689
|
ProxyRegistry: '0x283Cc5C26e53D66ed2Ea252D986F094B37E6e895',
|
|
690
|
+
SFProxyEntryPoint: '0x15D776C062bF292f8F70A81533E49adC7C06Cb69',
|
|
682
691
|
DSGuardFactory: '0x5261abC3a94a6475D0A1171daE94A5f84fbaEcD2',
|
|
683
692
|
AdminVault: '0xd47D8D97cAd12A866900eEc6Cde1962529F25351',
|
|
684
693
|
DefisaverLogger: '0xE6f9A5C850dbcD12bc64f40d692F537250aDEC38',
|
|
@@ -690,6 +699,7 @@ export const otherAddresses = {
|
|
|
690
699
|
RecipeExecutorForTxSaver: '0x7a87565b77dd65bbc153fe20e97743842f1a6e0c',
|
|
691
700
|
DFSRegistry: '0x347FB634271F666353F23A3362f3935D96F97476',
|
|
692
701
|
ProxyRegistry: '0x425fA97285965E01Cc5F951B62A51F6CDEA5cc0d',
|
|
702
|
+
SFProxyEntryPoint: '0xab6e5cde983fF98Cdb0F61f5F99cb58D40D0c837',
|
|
693
703
|
DSGuardFactory: '0x7783da8958013a57a5514737a4FBDFF06A0056e1',
|
|
694
704
|
AdminVault: '0xD8E67968d8a0df4beCf2D50daE1e34d4d80C701C',
|
|
695
705
|
DefisaverLogger: '0xc9D6EfA6e08B66a5Cdc516Bcd5807c2fa69E0f2A',
|