@gearbox-protocol/sdk 0.0.55 → 0.0.56
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/lib/core/pathfinder.d.ts +35 -5
- package/lib/core/pathfinder.js +547 -67
- package/lib/core/token.d.ts +5 -0
- package/lib/core/token.js +8 -1
- package/lib/core/tradeTypes.d.ts +2 -0
- package/lib/pathfinder/connectorPathAsset.d.ts +7 -0
- package/lib/pathfinder/connectorPathAsset.js +144 -0
- package/lib/pathfinder/convexLPTokenPathAsset.d.ts +5 -0
- package/lib/pathfinder/convexLPTokenPathAsset.js +77 -0
- package/lib/pathfinder/curveLPPathAsset.d.ts +5 -0
- package/lib/pathfinder/curveLPPathAsset.js +72 -0
- package/lib/pathfinder/metaCurveLPPathAsset.d.ts +5 -0
- package/lib/pathfinder/metaCurveLPPathAsset.js +72 -0
- package/lib/pathfinder/normalTokenPathAsset.d.ts +5 -0
- package/lib/pathfinder/normalTokenPathAsset.js +136 -0
- package/lib/pathfinder/path.d.ts +41 -0
- package/lib/pathfinder/path.js +302 -0
- package/lib/pathfinder/pathfinder.d.ts +28 -0
- package/lib/pathfinder/pathfinder.js +519 -0
- package/lib/pathfinder/yearnVaultOfCurveLPPathAsset.d.ts +5 -0
- package/lib/pathfinder/yearnVaultOfCurveLPPathAsset.js +87 -0
- package/lib/pathfinder/yearnVaultOfMetaCurveLPPathAsset.d.ts +5 -0
- package/lib/pathfinder/yearnVaultOfMetaCurveLPPathAsset.js +87 -0
- package/lib/pathfinder/yearnVaultPathAsset.d.ts +5 -0
- package/lib/pathfinder/yearnVaultPathAsset.js +87 -0
- package/lib/utils/types.d.ts +3 -0
- package/lib/utils/types.js +2 -0
- package/package.json +1 -1
- package/src/core/contracts.ts +11 -1
- package/src/core/token.ts +12 -0
- package/src/core/tradeTypes.ts +2 -0
- package/src/pathfinder/connectorPathAsset.ts +69 -0
- package/src/pathfinder/convexLPTokenPathAsset.ts +33 -0
- package/src/pathfinder/curveLPPathAsset.ts +10 -0
- package/src/pathfinder/metaCurveLPPathAsset.ts +12 -0
- package/src/pathfinder/normalTokenPathAsset.ts +68 -0
- package/src/pathfinder/path.ts +259 -0
- package/src/pathfinder/yearnVaultOfCurveLPPathAsset.ts +22 -0
- package/src/pathfinder/yearnVaultOfMetaCurveLPPathAsset.ts +22 -0
- package/src/pathfinder/yearnVaultPathAsset.ts +27 -0
- package/src/utils/types.ts +3 -0
- package/src/core/pathfinder.ts +0 -115
package/lib/core/token.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { NetworkType } from "./constants";
|
|
2
2
|
import { ConvexPoolContract } from "./contracts";
|
|
3
3
|
import { TradeAction } from "./tradeTypes";
|
|
4
|
+
import { PartialRecord } from "../utils/types";
|
|
5
|
+
import { BigNumber } from "ethers";
|
|
4
6
|
export declare enum TokenType {
|
|
5
7
|
CONNECTOR = 0,
|
|
6
8
|
NORMAL_TOKEN = 1,
|
|
@@ -14,6 +16,8 @@ export declare enum TokenType {
|
|
|
14
16
|
DIESEL_LP_TOKEN = 9
|
|
15
17
|
}
|
|
16
18
|
export declare const priority: Record<TokenType, number>;
|
|
19
|
+
export declare const Curve3CrvUnderlyingTokenIndex: PartialRecord<SupportedToken, BigNumber>;
|
|
20
|
+
export declare const ConnectorTokens: Array<SupportedToken>;
|
|
17
21
|
export declare type NormalToken = "1INCH" | "AAVE" | "COMP" | "CRV" | "DAI" | "DPI" | "FEI" | "LINK" | "SNX" | "SUSHI" | "UNI" | "USDC" | "USDT" | "WBTC" | "WETH" | "YFI" | "STETH" | "FTM" | "CVX" | "FRAX" | "FXS" | "LDO" | "SPELL" | "LUSD" | "sUSD" | "GUSD" | "LUNA" | "LQTY";
|
|
18
22
|
export declare type CurveLPToken = "3Crv" | "steCRV" | "FRAX3CRV" | "LUSD3CRV" | "crvPlain3andSUSD" | "gusd3CRV";
|
|
19
23
|
export declare type YearnLPToken = "yvDAI" | "yvUSDC" | "yvWETH" | "yvWBTC" | "yvCurve_stETH" | "yvCURVE_FRAX_POOL";
|
|
@@ -90,6 +94,7 @@ declare type DieselTokenData = {
|
|
|
90
94
|
} & TokenBase;
|
|
91
95
|
declare type GearboxTokenData = {
|
|
92
96
|
symbol: GearboxToken;
|
|
97
|
+
swapActions?: Array<TradeAction>;
|
|
93
98
|
type: TokenType.NORMAL_TOKEN;
|
|
94
99
|
} & TokenBase;
|
|
95
100
|
export declare type TokenDataI = NormalConnectorTokenData | NormalTokenData | CurveLPTokenData | MetaCurveLPTokenData | YearnVaultTokenData | YearnVaultOfCurveLPTokenData | YearnVaultOfMetaCurveLPTokenData | ConvexLPTokenData | ConvexPhantomTokenData | DieselTokenData | GearboxTokenData;
|
package/lib/core/token.js
CHANGED
|
@@ -12,9 +12,10 @@ var __assign = (this && this.__assign) || function () {
|
|
|
12
12
|
};
|
|
13
13
|
var _a;
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.tokenDataByAddress = exports.tokenDataByNetwork = exports.supportedTokens = exports.priority = exports.TokenType = void 0;
|
|
15
|
+
exports.tokenDataByAddress = exports.tokenDataByNetwork = exports.supportedTokens = exports.ConnectorTokens = exports.Curve3CrvUnderlyingTokenIndex = exports.priority = exports.TokenType = void 0;
|
|
16
16
|
var mappers_1 = require("../utils/mappers");
|
|
17
17
|
var tradeTypes_1 = require("./tradeTypes");
|
|
18
|
+
var ethers_1 = require("ethers");
|
|
18
19
|
var TokenType;
|
|
19
20
|
(function (TokenType) {
|
|
20
21
|
TokenType[TokenType["CONNECTOR"] = 0] = "CONNECTOR";
|
|
@@ -40,6 +41,12 @@ exports.priority = (_a = {},
|
|
|
40
41
|
_a[TokenType.CONVEX_STAKED_PHANTOM_TOKEN] = 5,
|
|
41
42
|
_a[TokenType.DIESEL_LP_TOKEN] = 6,
|
|
42
43
|
_a);
|
|
44
|
+
exports.Curve3CrvUnderlyingTokenIndex = {
|
|
45
|
+
DAI: ethers_1.BigNumber.from(0),
|
|
46
|
+
USDC: ethers_1.BigNumber.from(1),
|
|
47
|
+
USDT: ethers_1.BigNumber.from(2)
|
|
48
|
+
};
|
|
49
|
+
exports.ConnectorTokens = ["DAI", "USDC", "WETH", "WBTC"];
|
|
43
50
|
exports.supportedTokens = {
|
|
44
51
|
"1INCH": {
|
|
45
52
|
name: "1INCH",
|
package/lib/core/tradeTypes.d.ts
CHANGED
|
@@ -20,9 +20,11 @@ export declare enum TradeType {
|
|
|
20
20
|
export declare type TradeAction = {
|
|
21
21
|
type: TradeType.UniswapV2Swap;
|
|
22
22
|
contract: UniswapV2Contract;
|
|
23
|
+
tokenOut?: NormalToken;
|
|
23
24
|
} | {
|
|
24
25
|
type: TradeType.UniswapV3Swap;
|
|
25
26
|
contract: "UNISWAP_V3_ROUTER";
|
|
27
|
+
tokenOut?: NormalToken;
|
|
26
28
|
} | {
|
|
27
29
|
type: TradeType.CurveExchange;
|
|
28
30
|
contract: CurvePoolContract;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BigNumber } from "ethers";
|
|
2
|
+
import { SupportedToken } from "../core/token";
|
|
3
|
+
import { Path, PathAsset } from "./path";
|
|
4
|
+
export declare class ConnectorPathAsset extends PathAsset {
|
|
5
|
+
getBestPath(currentToken: SupportedToken, p: Path): Promise<Path>;
|
|
6
|
+
getMaxPoolAmount(currentToken: SupportedToken, currentBalance: BigNumber, p: Path): Promise<BigNumber>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
+
function step(op) {
|
|
31
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
+
while (_) try {
|
|
33
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
34
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
+
switch (op[0]) {
|
|
36
|
+
case 0: case 1: t = op; break;
|
|
37
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
+
default:
|
|
41
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
+
if (t[2]) _.ops.pop();
|
|
46
|
+
_.trys.pop(); continue;
|
|
47
|
+
}
|
|
48
|
+
op = body.call(thisArg, _);
|
|
49
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
|
+
exports.ConnectorPathAsset = void 0;
|
|
55
|
+
var ethers_1 = require("ethers");
|
|
56
|
+
var token_1 = require("../core/token");
|
|
57
|
+
var path_1 = require("./path");
|
|
58
|
+
var ConnectorPathAsset = /** @class */ (function (_super) {
|
|
59
|
+
__extends(ConnectorPathAsset, _super);
|
|
60
|
+
function ConnectorPathAsset() {
|
|
61
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
62
|
+
}
|
|
63
|
+
ConnectorPathAsset.prototype.getBestPath = function (currentToken, p) {
|
|
64
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
65
|
+
var currentBalance, currentTokenAddress, currentTokenData, nextToken, nextTokenAddress, actionData, _i, _a, swapAction, tmpActionData;
|
|
66
|
+
return __generator(this, function (_b) {
|
|
67
|
+
switch (_b.label) {
|
|
68
|
+
case 0:
|
|
69
|
+
currentBalance = p.balances[currentToken].sub(1);
|
|
70
|
+
currentTokenAddress = token_1.tokenDataByNetwork[p.networkType][currentToken];
|
|
71
|
+
currentTokenData = token_1.supportedTokens[currentToken];
|
|
72
|
+
nextToken = p.pool;
|
|
73
|
+
nextTokenAddress = token_1.tokenDataByNetwork[p.networkType][nextToken];
|
|
74
|
+
actionData = {
|
|
75
|
+
callData: {
|
|
76
|
+
targetContract: "",
|
|
77
|
+
callData: ""
|
|
78
|
+
},
|
|
79
|
+
amountOut: ethers_1.BigNumber.from(0),
|
|
80
|
+
gasLimit: ethers_1.BigNumber.from(0),
|
|
81
|
+
};
|
|
82
|
+
_i = 0, _a = currentTokenData.swapActions;
|
|
83
|
+
_b.label = 1;
|
|
84
|
+
case 1:
|
|
85
|
+
if (!(_i < _a.length)) return [3 /*break*/, 4];
|
|
86
|
+
swapAction = _a[_i];
|
|
87
|
+
return [4 /*yield*/, this.getActionData(swapAction, currentTokenAddress, currentToken, currentBalance, nextTokenAddress, nextToken, p)];
|
|
88
|
+
case 2:
|
|
89
|
+
tmpActionData = _b.sent();
|
|
90
|
+
if (tmpActionData.amountOut > actionData.amountOut) {
|
|
91
|
+
actionData = tmpActionData;
|
|
92
|
+
}
|
|
93
|
+
_b.label = 3;
|
|
94
|
+
case 3:
|
|
95
|
+
_i++;
|
|
96
|
+
return [3 /*break*/, 1];
|
|
97
|
+
case 4:
|
|
98
|
+
if (actionData.callData.targetContract != "") {
|
|
99
|
+
p.balances[nextToken].add(actionData.amountOut);
|
|
100
|
+
p.balances[currentToken] = ethers_1.BigNumber.from(1);
|
|
101
|
+
p.totalGasLimit.add(actionData.gasLimit);
|
|
102
|
+
p.calls.push(actionData.callData);
|
|
103
|
+
}
|
|
104
|
+
return [4 /*yield*/, p.getBestPath()];
|
|
105
|
+
case 5: return [2 /*return*/, _b.sent()];
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
};
|
|
110
|
+
// Only compute the maximum amount of pool token output, will not modify path.
|
|
111
|
+
ConnectorPathAsset.prototype.getMaxPoolAmount = function (currentToken, currentBalance, p) {
|
|
112
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
113
|
+
var currentTokenAddress, currentTokenData, nextToken, nextTokenAddress, maxAmountOut, _i, _a, swapAction, actionData;
|
|
114
|
+
return __generator(this, function (_b) {
|
|
115
|
+
switch (_b.label) {
|
|
116
|
+
case 0:
|
|
117
|
+
currentTokenAddress = token_1.tokenDataByNetwork[p.networkType][currentToken];
|
|
118
|
+
currentTokenData = token_1.supportedTokens[currentToken];
|
|
119
|
+
nextToken = p.pool;
|
|
120
|
+
nextTokenAddress = token_1.tokenDataByNetwork[p.networkType][nextToken];
|
|
121
|
+
maxAmountOut = ethers_1.BigNumber.from(0);
|
|
122
|
+
_i = 0, _a = currentTokenData.swapActions;
|
|
123
|
+
_b.label = 1;
|
|
124
|
+
case 1:
|
|
125
|
+
if (!(_i < _a.length)) return [3 /*break*/, 4];
|
|
126
|
+
swapAction = _a[_i];
|
|
127
|
+
return [4 /*yield*/, this.getActionData(swapAction, currentTokenAddress, currentToken, currentBalance, nextTokenAddress, nextToken, p)];
|
|
128
|
+
case 2:
|
|
129
|
+
actionData = _b.sent();
|
|
130
|
+
if (actionData.amountOut > maxAmountOut) {
|
|
131
|
+
maxAmountOut = actionData.amountOut;
|
|
132
|
+
}
|
|
133
|
+
_b.label = 3;
|
|
134
|
+
case 3:
|
|
135
|
+
_i++;
|
|
136
|
+
return [3 /*break*/, 1];
|
|
137
|
+
case 4: return [2 /*return*/, maxAmountOut];
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
});
|
|
141
|
+
};
|
|
142
|
+
return ConnectorPathAsset;
|
|
143
|
+
}(path_1.PathAsset));
|
|
144
|
+
exports.ConnectorPathAsset = ConnectorPathAsset;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
+
function step(op) {
|
|
31
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
+
while (_) try {
|
|
33
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
34
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
+
switch (op[0]) {
|
|
36
|
+
case 0: case 1: t = op; break;
|
|
37
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
+
default:
|
|
41
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
+
if (t[2]) _.ops.pop();
|
|
46
|
+
_.trys.pop(); continue;
|
|
47
|
+
}
|
|
48
|
+
op = body.call(thisArg, _);
|
|
49
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
|
+
exports.ConvexLPTokenPathAsset = void 0;
|
|
55
|
+
var token_1 = require("../core/token");
|
|
56
|
+
var contracts_1 = require("../core/contracts");
|
|
57
|
+
var tradeTypes_1 = require("../core/tradeTypes");
|
|
58
|
+
var path_1 = require("./path");
|
|
59
|
+
var ConvexLPTokenPathAsset = /** @class */ (function (_super) {
|
|
60
|
+
__extends(ConvexLPTokenPathAsset, _super);
|
|
61
|
+
function ConvexLPTokenPathAsset() {
|
|
62
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
63
|
+
}
|
|
64
|
+
ConvexLPTokenPathAsset.prototype.getBestPath = function (currentToken, p) {
|
|
65
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
66
|
+
var currentBalance, currentTokenData, _i, _a, lpAction, actionContractAddress, adapterAddress, outputToken;
|
|
67
|
+
return __generator(this, function (_b) {
|
|
68
|
+
switch (_b.label) {
|
|
69
|
+
case 0: throw Error("Implementation not finished!");
|
|
70
|
+
case 1: return [2 /*return*/, _b.sent()];
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
return ConvexLPTokenPathAsset;
|
|
76
|
+
}(path_1.PathAsset));
|
|
77
|
+
exports.ConvexLPTokenPathAsset = ConvexLPTokenPathAsset;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
+
function step(op) {
|
|
31
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
+
while (_) try {
|
|
33
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
34
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
+
switch (op[0]) {
|
|
36
|
+
case 0: case 1: t = op; break;
|
|
37
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
+
default:
|
|
41
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
+
if (t[2]) _.ops.pop();
|
|
46
|
+
_.trys.pop(); continue;
|
|
47
|
+
}
|
|
48
|
+
op = body.call(thisArg, _);
|
|
49
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
|
+
exports.CurveLPPathAsset = void 0;
|
|
55
|
+
var path_1 = require("./path");
|
|
56
|
+
var CurveLPPathAsset = /** @class */ (function (_super) {
|
|
57
|
+
__extends(CurveLPPathAsset, _super);
|
|
58
|
+
function CurveLPPathAsset() {
|
|
59
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
60
|
+
}
|
|
61
|
+
CurveLPPathAsset.prototype.getBestPath = function (currentToken, p) {
|
|
62
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
63
|
+
return __generator(this, function (_a) {
|
|
64
|
+
console.log(currentToken);
|
|
65
|
+
console.log(p);
|
|
66
|
+
throw Error("Not implemented yet.");
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
return CurveLPPathAsset;
|
|
71
|
+
}(path_1.PathAsset));
|
|
72
|
+
exports.CurveLPPathAsset = CurveLPPathAsset;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
+
function step(op) {
|
|
31
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
+
while (_) try {
|
|
33
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
34
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
+
switch (op[0]) {
|
|
36
|
+
case 0: case 1: t = op; break;
|
|
37
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
+
default:
|
|
41
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
+
if (t[2]) _.ops.pop();
|
|
46
|
+
_.trys.pop(); continue;
|
|
47
|
+
}
|
|
48
|
+
op = body.call(thisArg, _);
|
|
49
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
|
+
exports.MetaCurveLPPathAsset = void 0;
|
|
55
|
+
var path_1 = require("./path");
|
|
56
|
+
var MetaCurveLPPathAsset = /** @class */ (function (_super) {
|
|
57
|
+
__extends(MetaCurveLPPathAsset, _super);
|
|
58
|
+
function MetaCurveLPPathAsset() {
|
|
59
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
60
|
+
}
|
|
61
|
+
MetaCurveLPPathAsset.prototype.getBestPath = function (currentToken, p) {
|
|
62
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
63
|
+
return __generator(this, function (_a) {
|
|
64
|
+
console.log(currentToken);
|
|
65
|
+
console.log(p);
|
|
66
|
+
throw Error("Not implemented yet.");
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
return MetaCurveLPPathAsset;
|
|
71
|
+
}(path_1.PathAsset));
|
|
72
|
+
exports.MetaCurveLPPathAsset = MetaCurveLPPathAsset;
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
+
function step(op) {
|
|
31
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
+
while (_) try {
|
|
33
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
34
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
+
switch (op[0]) {
|
|
36
|
+
case 0: case 1: t = op; break;
|
|
37
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
+
default:
|
|
41
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
+
if (t[2]) _.ops.pop();
|
|
46
|
+
_.trys.pop(); continue;
|
|
47
|
+
}
|
|
48
|
+
op = body.call(thisArg, _);
|
|
49
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
|
+
exports.NormalTokenPathAsset = void 0;
|
|
55
|
+
var ethers_1 = require("ethers");
|
|
56
|
+
var token_1 = require("../core/token");
|
|
57
|
+
var path_1 = require("./path");
|
|
58
|
+
var connectorPathAsset_1 = require("./connectorPathAsset");
|
|
59
|
+
var NormalTokenPathAsset = /** @class */ (function (_super) {
|
|
60
|
+
__extends(NormalTokenPathAsset, _super);
|
|
61
|
+
function NormalTokenPathAsset() {
|
|
62
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
63
|
+
}
|
|
64
|
+
NormalTokenPathAsset.prototype.getBestPath = function (currentToken, p) {
|
|
65
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
66
|
+
var currentBalance, currentTokenAddress, currentTokenData, actionData, nextToken, maxPoolAmountOut, _i, ConnectorTokens_1, connToken, connTokenAddress, _a, _b, swapAction, tmpActionData, connectorPathAsset, poolAmountOut;
|
|
67
|
+
return __generator(this, function (_c) {
|
|
68
|
+
switch (_c.label) {
|
|
69
|
+
case 0:
|
|
70
|
+
currentBalance = p.balances[currentToken].sub(1);
|
|
71
|
+
currentTokenAddress = token_1.tokenDataByNetwork[p.networkType][currentToken];
|
|
72
|
+
currentTokenData = token_1.supportedTokens[currentToken];
|
|
73
|
+
actionData = {
|
|
74
|
+
callData: {
|
|
75
|
+
targetContract: "",
|
|
76
|
+
callData: ""
|
|
77
|
+
},
|
|
78
|
+
amountOut: ethers_1.BigNumber.from(0),
|
|
79
|
+
gasLimit: ethers_1.BigNumber.from(0),
|
|
80
|
+
};
|
|
81
|
+
nextToken = p.pool;
|
|
82
|
+
maxPoolAmountOut = ethers_1.BigNumber.from(0);
|
|
83
|
+
_i = 0, ConnectorTokens_1 = token_1.ConnectorTokens;
|
|
84
|
+
_c.label = 1;
|
|
85
|
+
case 1:
|
|
86
|
+
if (!(_i < ConnectorTokens_1.length)) return [3 /*break*/, 8];
|
|
87
|
+
connToken = ConnectorTokens_1[_i];
|
|
88
|
+
connTokenAddress = token_1.tokenDataByNetwork[p.networkType][connToken];
|
|
89
|
+
_a = 0, _b = currentTokenData.swapActions;
|
|
90
|
+
_c.label = 2;
|
|
91
|
+
case 2:
|
|
92
|
+
if (!(_a < _b.length)) return [3 /*break*/, 7];
|
|
93
|
+
swapAction = _b[_a];
|
|
94
|
+
return [4 /*yield*/, this.getActionData(swapAction, currentTokenAddress, currentToken, currentBalance, connTokenAddress, connToken, p)];
|
|
95
|
+
case 3:
|
|
96
|
+
tmpActionData = _c.sent();
|
|
97
|
+
if (!(connToken != p.pool)) return [3 /*break*/, 5];
|
|
98
|
+
connectorPathAsset = new connectorPathAsset_1.ConnectorPathAsset();
|
|
99
|
+
return [4 /*yield*/, connectorPathAsset.getMaxPoolAmount(connToken, actionData.amountOut, p)];
|
|
100
|
+
case 4:
|
|
101
|
+
poolAmountOut = _c.sent();
|
|
102
|
+
if (poolAmountOut > maxPoolAmountOut) {
|
|
103
|
+
maxPoolAmountOut = poolAmountOut;
|
|
104
|
+
actionData = tmpActionData;
|
|
105
|
+
nextToken = connToken;
|
|
106
|
+
}
|
|
107
|
+
return [3 /*break*/, 6];
|
|
108
|
+
case 5:
|
|
109
|
+
if (actionData.amountOut > maxPoolAmountOut) {
|
|
110
|
+
maxPoolAmountOut = actionData.amountOut;
|
|
111
|
+
actionData = tmpActionData;
|
|
112
|
+
nextToken = p.pool;
|
|
113
|
+
}
|
|
114
|
+
_c.label = 6;
|
|
115
|
+
case 6:
|
|
116
|
+
_a++;
|
|
117
|
+
return [3 /*break*/, 2];
|
|
118
|
+
case 7:
|
|
119
|
+
_i++;
|
|
120
|
+
return [3 /*break*/, 1];
|
|
121
|
+
case 8:
|
|
122
|
+
if (actionData.callData.targetContract != "") {
|
|
123
|
+
p.balances[nextToken].add(actionData.amountOut);
|
|
124
|
+
p.balances[currentToken] = ethers_1.BigNumber.from(1);
|
|
125
|
+
p.totalGasLimit.add(actionData.gasLimit);
|
|
126
|
+
p.calls.push(actionData.callData);
|
|
127
|
+
}
|
|
128
|
+
return [4 /*yield*/, p.getBestPath()];
|
|
129
|
+
case 9: return [2 /*return*/, _c.sent()];
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
};
|
|
134
|
+
return NormalTokenPathAsset;
|
|
135
|
+
}(path_1.PathAsset));
|
|
136
|
+
exports.NormalTokenPathAsset = NormalTokenPathAsset;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { BigNumber, ethers } from "ethers";
|
|
2
|
+
import { CreditManagerData } from "../core/creditManager";
|
|
3
|
+
import { MultiCall } from "../core/multicall";
|
|
4
|
+
import { SupportedToken } from "../core/token";
|
|
5
|
+
import { NetworkType } from "../core/constants";
|
|
6
|
+
import { CreditAccountData } from "../core/creditAccount";
|
|
7
|
+
import { TradeAction } from "../core/tradeTypes";
|
|
8
|
+
export declare class Path {
|
|
9
|
+
readonly calls: Array<MultiCall>;
|
|
10
|
+
readonly balances: Record<SupportedToken, BigNumber>;
|
|
11
|
+
readonly pool: SupportedToken;
|
|
12
|
+
readonly creditManager: CreditManagerData;
|
|
13
|
+
readonly creditAccount: CreditAccountData;
|
|
14
|
+
readonly networkType: NetworkType;
|
|
15
|
+
readonly provider: ethers.providers.Provider;
|
|
16
|
+
readonly totalGasLimit: BigNumber;
|
|
17
|
+
constructor(opts: {
|
|
18
|
+
balances: Record<SupportedToken, BigNumber>;
|
|
19
|
+
pool: SupportedToken;
|
|
20
|
+
creditManager: CreditManagerData;
|
|
21
|
+
creditAccount: CreditAccountData;
|
|
22
|
+
networkType: NetworkType;
|
|
23
|
+
provider: ethers.providers.Provider;
|
|
24
|
+
totalGasLimit: BigNumber;
|
|
25
|
+
});
|
|
26
|
+
private comparedByPriority;
|
|
27
|
+
getBestPath(): Promise<Path>;
|
|
28
|
+
}
|
|
29
|
+
export interface ActionData {
|
|
30
|
+
callData: MultiCall;
|
|
31
|
+
amountOut: BigNumber;
|
|
32
|
+
gasLimit: BigNumber;
|
|
33
|
+
}
|
|
34
|
+
export declare abstract class PathAsset {
|
|
35
|
+
abstract getBestPath(currentToken: SupportedToken, p: Path): Promise<Path>;
|
|
36
|
+
getUniswapV2SwapData(adapterAddress: string, currentTokenAddress: string, currentBalance: BigNumber, nextTokenAddress: string, p: Path): Promise<ActionData>;
|
|
37
|
+
getUniswapV3SwapData(adapterAddress: string, currentTokenAddress: string, currentBalance: BigNumber, nextTokenAddress: string, p: Path): Promise<ActionData>;
|
|
38
|
+
getCurveActionData(adapterAddress: string, currentToken: SupportedToken, currentBalance: BigNumber, nextToken: SupportedToken, p: Path): Promise<ActionData>;
|
|
39
|
+
getActionData(swapAction: TradeAction, currentTokenAddress: string, currentToken: SupportedToken, currentBalance: BigNumber, nextTokenAddress: string, nextToken: SupportedToken, p: Path): Promise<ActionData>;
|
|
40
|
+
getYearnActionData(lpAction: TradeAction, currentBalance: BigNumber, p: Path): Promise<ActionData>;
|
|
41
|
+
}
|