@paraswap/dex-lib 4.7.5 → 4.7.7-unified-blacklist.0
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/build/abi/BProtocol.json +1155 -0
- package/build/abi/Jarvis.json +1172 -0
- package/build/abi/MStableAsset.json +1545 -0
- package/build/abi/OneInchLp.json +1304 -0
- package/build/abi/Onebit.json +736 -0
- package/build/abi/Shell.json +1294 -0
- package/build/abi/TraderJoeV2Router.json +50 -0
- package/build/abi/wUSDM.json +757 -0
- package/build/abi/zrx.v2.json +1967 -0
- package/build/abi/zrx.v3.json +3454 -0
- package/build/abi/zrx.v4.json +2193 -0
- package/build/dex/OneInchLp.d.ts +24 -0
- package/build/dex/OneInchLp.js +43 -0
- package/build/dex/OneInchLp.js.map +1 -0
- package/build/dex/bProtocol/bProtocol.d.ts +15 -0
- package/build/dex/bProtocol/bProtocol.js +56 -0
- package/build/dex/bProtocol/bProtocol.js.map +1 -0
- package/build/dex/bProtocol/types.d.ts +11 -0
- package/build/dex/bProtocol/types.js +8 -0
- package/build/dex/bProtocol/types.js.map +1 -0
- package/build/dex/bebop/bebop.d.ts +2 -4
- package/build/dex/bebop/bebop.js +12 -42
- package/build/dex/bebop/bebop.js.map +1 -1
- package/build/dex/bebop/constants.d.ts +0 -5
- package/build/dex/bebop/constants.js +1 -7
- package/build/dex/bebop/constants.js.map +1 -1
- package/build/dex/cables/cables.d.ts +3 -6
- package/build/dex/cables/cables.js +7 -51
- package/build/dex/cables/cables.js.map +1 -1
- package/build/dex/cables/constants.d.ts +0 -5
- package/build/dex/cables/constants.js +1 -6
- package/build/dex/cables/constants.js.map +1 -1
- package/build/dex/cables/rate-fetcher.d.ts +1 -3
- package/build/dex/cables/rate-fetcher.js +6 -8
- package/build/dex/cables/rate-fetcher.js.map +1 -1
- package/build/dex/cables/types.d.ts +1 -6
- package/build/dex/dexalot/constants.d.ts +0 -2
- package/build/dex/dexalot/constants.js +1 -3
- package/build/dex/dexalot/constants.js.map +1 -1
- package/build/dex/dexalot/dexalot.d.ts +2 -8
- package/build/dex/dexalot/dexalot.js +5 -43
- package/build/dex/dexalot/dexalot.js.map +1 -1
- package/build/dex/dexalot/rate-fetcher.d.ts +1 -3
- package/build/dex/dexalot/rate-fetcher.js +6 -8
- package/build/dex/dexalot/rate-fetcher.js.map +1 -1
- package/build/dex/dexalot/types.d.ts +1 -2
- package/build/dex/generic-rfq/generic-rfq.d.ts +0 -2
- package/build/dex/generic-rfq/generic-rfq.js +1 -8
- package/build/dex/generic-rfq/generic-rfq.js.map +1 -1
- package/build/dex/generic-rfq/rate-fetcher.d.ts +8 -10
- package/build/dex/generic-rfq/rate-fetcher.js +6 -11
- package/build/dex/generic-rfq/rate-fetcher.js.map +1 -1
- package/build/dex/generic-rfq/types.d.ts +6 -0
- package/build/dex/generic-rfq/types.js +12 -1
- package/build/dex/generic-rfq/types.js.map +1 -1
- package/build/dex/hashflow/hashflow.d.ts +2 -5
- package/build/dex/hashflow/hashflow.js +4 -15
- package/build/dex/hashflow/hashflow.js.map +1 -1
- package/build/dex/idex.d.ts +12 -2
- package/build/dex/idle-dao/idle-dao.d.ts +0 -1
- package/build/dex/idle-dao/idle-dao.js +11 -23
- package/build/dex/idle-dao/idle-dao.js.map +1 -1
- package/build/dex/jarvis.d.ts +56 -0
- package/build/dex/jarvis.js +163 -0
- package/build/dex/jarvis.js.map +1 -0
- package/build/dex/limit-order-exchange.d.ts +2 -2
- package/build/dex/limit-order-exchange.js +5 -3
- package/build/dex/limit-order-exchange.js.map +1 -1
- package/build/dex/mStable.d.ts +44 -0
- package/build/dex/mStable.js +75 -0
- package/build/dex/mStable.js.map +1 -0
- package/build/dex/maker-psm/maker-psm.d.ts +41 -4
- package/build/dex/maker-psm/maker-psm.js +143 -40
- package/build/dex/maker-psm/maker-psm.js.map +1 -1
- package/build/dex/onebit/onebit.d.ts +16 -0
- package/build/dex/onebit/onebit.js +61 -0
- package/build/dex/onebit/onebit.js.map +1 -0
- package/build/dex/onebit/types.d.ts +14 -0
- package/build/dex/onebit/types.js +8 -0
- package/build/dex/onebit/types.js.map +1 -0
- package/build/dex/paraswap-limit-orders/paraswap-limit-orders.d.ts +0 -1
- package/build/dex/paraswap-limit-orders/paraswap-limit-orders.js +0 -8
- package/build/dex/paraswap-limit-orders/paraswap-limit-orders.js.map +1 -1
- package/build/dex/se-vlr/config.d.ts +3 -0
- package/build/dex/se-vlr/config.js +24 -0
- package/build/dex/se-vlr/config.js.map +1 -0
- package/build/dex/{maker-psm/maker-psm-event-pool.d.ts → se-vlr/se-vlr-pool.d.ts} +11 -15
- package/build/dex/se-vlr/se-vlr-pool.js +70 -0
- package/build/dex/se-vlr/se-vlr-pool.js.map +1 -0
- package/build/dex/se-vlr/se-vlr.d.ts +35 -0
- package/build/dex/se-vlr/se-vlr.js +131 -0
- package/build/dex/se-vlr/se-vlr.js.map +1 -0
- package/build/dex/se-vlr/types.d.ts +6 -0
- package/build/dex/se-vlr/types.js +3 -0
- package/build/dex/se-vlr/types.js.map +1 -0
- package/build/dex/shell.d.ts +25 -0
- package/build/dex/shell.js +41 -0
- package/build/dex/shell.js.map +1 -0
- package/build/dex/simple-exchange-with-restrictions.d.ts +5 -4
- package/build/dex/simple-exchange-with-restrictions.js +20 -5
- package/build/dex/simple-exchange-with-restrictions.js.map +1 -1
- package/build/dex/swaap-v2/swaap-v2.d.ts +2 -5
- package/build/dex/swaap-v2/swaap-v2.js +4 -16
- package/build/dex/swaap-v2/swaap-v2.js.map +1 -1
- package/build/dex/trader-joe-v2.d.ts +40 -0
- package/build/dex/trader-joe-v2.js +74 -0
- package/build/dex/trader-joe-v2.js.map +1 -0
- package/build/dex/uniswap-v3/uniswap-v3-new.d.ts +94 -0
- package/build/dex/uniswap-v3/uniswap-v3-new.js +923 -0
- package/build/dex/uniswap-v3/uniswap-v3-new.js.map +1 -0
- package/build/dex/uniswap-v4/contract-math/Position.d.ts +0 -6
- package/build/dex/uniswap-v4/contract-math/Position.js +0 -29
- package/build/dex/uniswap-v4/contract-math/Position.js.map +1 -1
- package/build/dex/usual-bond/config.d.ts +3 -0
- package/build/dex/usual-bond/config.js +13 -0
- package/build/dex/usual-bond/config.js.map +1 -0
- package/build/dex/usual-bond/types.d.ts +7 -0
- package/build/dex/usual-bond/types.js +3 -0
- package/build/dex/usual-bond/types.js.map +1 -0
- package/build/dex/usual-bond/usual-bond.d.ts +35 -0
- package/build/dex/usual-bond/usual-bond.js +176 -0
- package/build/dex/usual-bond/usual-bond.js.map +1 -0
- package/build/dex/wusdm/config.d.ts +3 -0
- package/build/dex/wusdm/config.js +43 -0
- package/build/dex/wusdm/config.js.map +1 -0
- package/build/dex/wusdm/constants.d.ts +2 -0
- package/build/dex/wusdm/constants.js +6 -0
- package/build/dex/wusdm/constants.js.map +1 -0
- package/build/dex/wusdm/types.d.ts +18 -0
- package/build/dex/wusdm/types.js +11 -0
- package/build/dex/wusdm/types.js.map +1 -0
- package/build/dex/wusdm/wusdm-pool.d.ts +21 -0
- package/build/dex/wusdm/wusdm-pool.js +74 -0
- package/build/dex/wusdm/wusdm-pool.js.map +1 -0
- package/build/dex/wusdm/wusdm.d.ts +46 -0
- package/build/dex/wusdm/wusdm.js +243 -0
- package/build/dex/wusdm/wusdm.js.map +1 -0
- package/build/dex/zerox/config.d.ts +2 -0
- package/build/dex/zerox/config.js +33 -0
- package/build/dex/zerox/config.js.map +1 -0
- package/build/dex/zerox/index.d.ts +22 -0
- package/build/dex/zerox/index.js +225 -0
- package/build/dex/zerox/index.js.map +1 -0
- package/build/dex/zerox/order.d.ts +88 -0
- package/build/dex/zerox/order.js +53 -0
- package/build/dex/zerox/order.js.map +1 -0
- package/build/dex/zerox/types.d.ts +73 -0
- package/build/dex/zerox/types.js +21 -0
- package/build/dex/zerox/types.js.map +1 -0
- package/build/dex-helper/dummy-dex-helper.js +25 -1
- package/build/dex-helper/dummy-dex-helper.js.map +1 -1
- package/build/dex-helper/icache.d.ts +4 -0
- package/build/pricing-helper.d.ts +1 -0
- package/build/pricing-helper.js +34 -0
- package/build/pricing-helper.js.map +1 -1
- package/package.json +1 -1
- package/build/dex/maker-psm/maker-psm-event-pool.js +0 -132
- package/build/dex/maker-psm/maker-psm-event-pool.js.map +0 -1
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { SwapSide } from '../constants';
|
|
2
|
+
import { AdapterExchangeParam, Address, SimpleExchangeParam } from '../types';
|
|
3
|
+
import { IDexTxBuilder } from './idex';
|
|
4
|
+
import { IDexHelper } from '../dex-helper';
|
|
5
|
+
import { SimpleExchange } from './simple-exchange';
|
|
6
|
+
import { NumberAsString } from '@paraswap/core';
|
|
7
|
+
import { AsyncOrSync } from 'ts-essentials';
|
|
8
|
+
import { Interface } from '@ethersproject/abi';
|
|
9
|
+
declare type TraderJoeV2RouterSellParams = [
|
|
10
|
+
_amountIn: NumberAsString,
|
|
11
|
+
_amountOutMin: NumberAsString,
|
|
12
|
+
_pairBinSteps: NumberAsString[],
|
|
13
|
+
_tokenPath: Address[],
|
|
14
|
+
to: Address,
|
|
15
|
+
_deadline: number
|
|
16
|
+
];
|
|
17
|
+
declare type TraderJoeV2RouterBuyParams = [
|
|
18
|
+
_amountOut: NumberAsString,
|
|
19
|
+
_amountInMax: NumberAsString,
|
|
20
|
+
_pairBinSteps: NumberAsString[],
|
|
21
|
+
_tokenPath: Address[],
|
|
22
|
+
to: Address,
|
|
23
|
+
_deadline: string
|
|
24
|
+
];
|
|
25
|
+
declare type TraderJoeV2RouterParam = TraderJoeV2RouterSellParams | TraderJoeV2RouterBuyParams;
|
|
26
|
+
export declare type TraderJoeV2Data = {
|
|
27
|
+
tokenIn: string;
|
|
28
|
+
tokenOut: string;
|
|
29
|
+
binStep: string;
|
|
30
|
+
};
|
|
31
|
+
export declare class TraderJoeV2 extends SimpleExchange implements IDexTxBuilder<TraderJoeV2Data, TraderJoeV2RouterParam> {
|
|
32
|
+
static dexKeys: string[];
|
|
33
|
+
protected routerAddress: string;
|
|
34
|
+
exchangeRouterInterface: Interface;
|
|
35
|
+
needWrapNative: boolean;
|
|
36
|
+
constructor(dexHelper: IDexHelper);
|
|
37
|
+
getAdapterParam(srcToken: Address, destToken: Address, srcAmount: NumberAsString, destAmount: NumberAsString, data: TraderJoeV2Data, side: SwapSide): AdapterExchangeParam;
|
|
38
|
+
getSimpleParam(srcToken: Address, destToken: Address, srcAmount: NumberAsString, destAmount: NumberAsString, data: TraderJoeV2Data, side: SwapSide): AsyncOrSync<SimpleExchangeParam>;
|
|
39
|
+
}
|
|
40
|
+
export {};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.TraderJoeV2 = void 0;
|
|
7
|
+
const constants_1 = require("../constants");
|
|
8
|
+
const simple_exchange_1 = require("./simple-exchange");
|
|
9
|
+
const abi_1 = require("@ethersproject/abi");
|
|
10
|
+
const TraderJoeV2Router_json_1 = __importDefault(require("../abi/TraderJoeV2Router.json"));
|
|
11
|
+
const TRADERJOE_V2_ROUTER_ADDRESS = {
|
|
12
|
+
[constants_1.Network.AVALANCHE]: '0xE3Ffc583dC176575eEA7FD9dF2A7c65F7E23f4C3',
|
|
13
|
+
[constants_1.Network.ARBITRUM]: '0x7BFd7192E76D950832c77BB412aaE841049D8D9B',
|
|
14
|
+
[constants_1.Network.BSC]: '0xb66A2704a0dabC1660941628BE987B4418f7a9E8',
|
|
15
|
+
};
|
|
16
|
+
var TraderJoeV2RouterFunctions;
|
|
17
|
+
(function (TraderJoeV2RouterFunctions) {
|
|
18
|
+
TraderJoeV2RouterFunctions["swapExactTokensForTokens"] = "swapExactTokensForTokens";
|
|
19
|
+
TraderJoeV2RouterFunctions["swapTokensForExactTokens"] = "swapTokensForExactTokens";
|
|
20
|
+
})(TraderJoeV2RouterFunctions || (TraderJoeV2RouterFunctions = {}));
|
|
21
|
+
class TraderJoeV2 extends simple_exchange_1.SimpleExchange {
|
|
22
|
+
constructor(dexHelper) {
|
|
23
|
+
super(dexHelper, 'traderjoev2');
|
|
24
|
+
this.needWrapNative = true;
|
|
25
|
+
this.routerAddress =
|
|
26
|
+
TRADERJOE_V2_ROUTER_ADDRESS[dexHelper.config.data.network];
|
|
27
|
+
this.exchangeRouterInterface = new abi_1.Interface(TraderJoeV2Router_json_1.default);
|
|
28
|
+
}
|
|
29
|
+
getAdapterParam(srcToken, destToken, srcAmount, destAmount, data, side) {
|
|
30
|
+
const payload = this.abiCoder.encodeParameter({
|
|
31
|
+
ParentStruct: {
|
|
32
|
+
_pairBinSteps: 'uint256[]',
|
|
33
|
+
_tokenPath: 'address[]',
|
|
34
|
+
_deadline: 'uint256',
|
|
35
|
+
},
|
|
36
|
+
}, {
|
|
37
|
+
_pairBinSteps: [data.binStep],
|
|
38
|
+
_tokenPath: [data.tokenIn, data.tokenOut],
|
|
39
|
+
_deadline: (0, simple_exchange_1.getLocalDeadlineAsFriendlyPlaceholder)(), // FIXME: more gas efficient to pass block.timestamp in adapter
|
|
40
|
+
});
|
|
41
|
+
return {
|
|
42
|
+
targetExchange: this.routerAddress,
|
|
43
|
+
payload,
|
|
44
|
+
networkFee: '0',
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
getSimpleParam(srcToken, destToken, srcAmount, destAmount, data, side) {
|
|
48
|
+
const swapFunction = side === constants_1.SwapSide.SELL
|
|
49
|
+
? TraderJoeV2RouterFunctions.swapExactTokensForTokens
|
|
50
|
+
: TraderJoeV2RouterFunctions.swapTokensForExactTokens;
|
|
51
|
+
const swapFunctionParams = side === constants_1.SwapSide.SELL
|
|
52
|
+
? [
|
|
53
|
+
srcAmount,
|
|
54
|
+
destAmount,
|
|
55
|
+
[data.binStep],
|
|
56
|
+
[srcToken, destToken],
|
|
57
|
+
this.augustusAddress,
|
|
58
|
+
(0, simple_exchange_1.getLocalDeadlineAsFriendlyPlaceholder)(),
|
|
59
|
+
]
|
|
60
|
+
: [
|
|
61
|
+
destAmount,
|
|
62
|
+
srcAmount,
|
|
63
|
+
[data.binStep],
|
|
64
|
+
[srcToken, destToken],
|
|
65
|
+
this.augustusAddress,
|
|
66
|
+
(0, simple_exchange_1.getLocalDeadlineAsFriendlyPlaceholder)(),
|
|
67
|
+
];
|
|
68
|
+
const swapData = this.exchangeRouterInterface.encodeFunctionData(swapFunction, swapFunctionParams);
|
|
69
|
+
return this.buildSimpleParamWithoutWETHConversion(srcToken, srcAmount, destToken, destAmount, swapData, this.routerAddress);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
exports.TraderJoeV2 = TraderJoeV2;
|
|
73
|
+
TraderJoeV2.dexKeys = ['traderjoev2'];
|
|
74
|
+
//# sourceMappingURL=trader-joe-v2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trader-joe-v2.js","sourceRoot":"","sources":["../../src/dex/trader-joe-v2.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAiD;AAIjD,uDAG2B;AAG3B,4CAA6D;AAC7D,2FAAiE;AAEjE,MAAM,2BAA2B,GAAmC;IAClE,CAAC,mBAAO,CAAC,SAAS,CAAC,EAAE,4CAA4C;IACjE,CAAC,mBAAO,CAAC,QAAQ,CAAC,EAAE,4CAA4C;IAChE,CAAC,mBAAO,CAAC,GAAG,CAAC,EAAE,4CAA4C;CAC5D,CAAC;AA8BF,IAAK,0BAGJ;AAHD,WAAK,0BAA0B;IAC7B,mFAAqD,CAAA;IACrD,mFAAqD,CAAA;AACvD,CAAC,EAHI,0BAA0B,KAA1B,0BAA0B,QAG9B;AAED,MAAa,WACX,SAAQ,gCAAc;IAQtB,YAAY,SAAqB;QAC/B,KAAK,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;QAHlC,mBAAc,GAAG,IAAI,CAAC;QAKpB,IAAI,CAAC,aAAa;YAChB,2BAA2B,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAE7D,IAAI,CAAC,uBAAuB,GAAG,IAAI,eAAS,CAC1C,gCAAsC,CACvC,CAAC;IACJ,CAAC;IAED,eAAe,CACb,QAAiB,EACjB,SAAkB,EAClB,SAAyB,EACzB,UAA0B,EAC1B,IAAqB,EACrB,IAAc;QAEd,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,eAAe,CAC3C;YACE,YAAY,EAAE;gBACZ,aAAa,EAAE,WAAW;gBAC1B,UAAU,EAAE,WAAW;gBACvB,SAAS,EAAE,SAAS;aACrB;SACF,EACD;YACE,aAAa,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC;YAC7B,UAAU,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC;YACzC,SAAS,EAAE,IAAA,uDAAqC,GAAE,EAAE,+DAA+D;SACpH,CACF,CAAC;QAEF,OAAO;YACL,cAAc,EAAE,IAAI,CAAC,aAAa;YAClC,OAAO;YACP,UAAU,EAAE,GAAG;SAChB,CAAC;IACJ,CAAC;IAED,cAAc,CACZ,QAAiB,EACjB,SAAkB,EAClB,SAAyB,EACzB,UAA0B,EAC1B,IAAqB,EACrB,IAAc;QAEd,MAAM,YAAY,GAChB,IAAI,KAAK,oBAAQ,CAAC,IAAI;YACpB,CAAC,CAAC,0BAA0B,CAAC,wBAAwB;YACrD,CAAC,CAAC,0BAA0B,CAAC,wBAAwB,CAAC;QAE1D,MAAM,kBAAkB,GACtB,IAAI,KAAK,oBAAQ,CAAC,IAAI;YACpB,CAAC,CAAC;gBACE,SAAS;gBACT,UAAU;gBACV,CAAC,IAAI,CAAC,OAAO,CAAC;gBACd,CAAC,QAAQ,EAAE,SAAS,CAAC;gBACrB,IAAI,CAAC,eAAe;gBACpB,IAAA,uDAAqC,GAAE;aACxC;YACH,CAAC,CAAC;gBACE,UAAU;gBACV,SAAS;gBACT,CAAC,IAAI,CAAC,OAAO,CAAC;gBACd,CAAC,QAAQ,EAAE,SAAS,CAAC;gBACrB,IAAI,CAAC,eAAe;gBACpB,IAAA,uDAAqC,GAAE;aACxC,CAAC;QACR,MAAM,QAAQ,GAAG,IAAI,CAAC,uBAAuB,CAAC,kBAAkB,CAC9D,YAAY,EACZ,kBAAkB,CACnB,CAAC;QAEF,OAAO,IAAI,CAAC,qCAAqC,CAC/C,QAAQ,EACR,SAAS,EACT,SAAS,EACT,UAAU,EACV,QAAQ,EACR,IAAI,CAAC,aAAa,CACnB,CAAC;IACJ,CAAC;;AA9FH,kCA+FC;AA3FQ,mBAAO,GAAG,CAAC,aAAa,CAAC,CAAC"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { Interface } from '@ethersproject/abi';
|
|
2
|
+
import { AdapterExchangeParam, Address, DexExchangeParam, ExchangePrices, ExchangeTxInfo, Logger, NumberAsString, PoolLiquidity, PoolPrices, PreprocessTransactionOptions, SimpleExchangeParam, Token, TxInfo } from '../../types';
|
|
3
|
+
import { Network, SwapSide } from '../../constants';
|
|
4
|
+
import { IDex } from '../../dex/idex';
|
|
5
|
+
import { IDexHelper } from '../../dex-helper/idex-helper';
|
|
6
|
+
import { DexParams, OutputResult, PoolState, UniswapV3Data, UniswapV3Param, UniswapV3ParamsDirect } from './types';
|
|
7
|
+
import { SimpleExchange } from '../simple-exchange';
|
|
8
|
+
import { UniswapV3EventPool } from './uniswap-v3-pool';
|
|
9
|
+
import { DeepReadonly } from 'ts-essentials';
|
|
10
|
+
import { Contract } from 'web3-eth-contract';
|
|
11
|
+
import { OptimalSwapExchange } from '@paraswap/core';
|
|
12
|
+
import { OnPoolCreatedCallback, UniswapV3Factory } from './uniswap-v3-factory';
|
|
13
|
+
export declare const PoolsRegistryHashKey = "dl_poolsRegistry";
|
|
14
|
+
export declare const UNISWAPV3_CLEAN_NOT_EXISTING_POOL_TTL_MS: number;
|
|
15
|
+
export declare const UNISWAPV3_CLEAN_NOT_EXISTING_POOL_INTERVAL_MS: number;
|
|
16
|
+
export declare const UNISWAPV3_QUOTE_GASLIMIT = 200000;
|
|
17
|
+
export declare class UniswapV3 extends SimpleExchange implements IDex<UniswapV3Data, UniswapV3Param | UniswapV3ParamsDirect> {
|
|
18
|
+
protected network: Network;
|
|
19
|
+
protected dexHelper: IDexHelper;
|
|
20
|
+
protected adapters: import("../../types").AdapterMappings;
|
|
21
|
+
readonly routerIface: Interface;
|
|
22
|
+
readonly quoterIface: Interface;
|
|
23
|
+
protected config: DexParams;
|
|
24
|
+
protected poolsToPreload: {
|
|
25
|
+
token0: Address;
|
|
26
|
+
token1: Address;
|
|
27
|
+
}[];
|
|
28
|
+
protected readonly factory: UniswapV3Factory;
|
|
29
|
+
readonly isFeeOnTransferSupported: boolean;
|
|
30
|
+
readonly eventPools: Record<string, UniswapV3EventPool | null>;
|
|
31
|
+
readonly hasConstantPriceLargeAmounts = false;
|
|
32
|
+
readonly needWrapNative = true;
|
|
33
|
+
readonly directSwapIface: Interface;
|
|
34
|
+
intervalTask?: NodeJS.Timeout;
|
|
35
|
+
static dexKeysWithNetwork: {
|
|
36
|
+
key: string;
|
|
37
|
+
networks: Network[];
|
|
38
|
+
}[];
|
|
39
|
+
logger: Logger;
|
|
40
|
+
private uniswapMulti;
|
|
41
|
+
protected stateMultiContract: Contract;
|
|
42
|
+
protected notExistingPoolSetKey: string;
|
|
43
|
+
constructor(network: Network, dexKey: string, dexHelper: IDexHelper, adapters?: import("../../types").AdapterMappings, routerIface?: Interface, quoterIface?: Interface, config?: DexParams, poolsToPreload?: {
|
|
44
|
+
token0: Address;
|
|
45
|
+
token1: Address;
|
|
46
|
+
}[]);
|
|
47
|
+
get supportedFees(): bigint[];
|
|
48
|
+
getAdapters(side: SwapSide): {
|
|
49
|
+
name: string;
|
|
50
|
+
index: number;
|
|
51
|
+
}[] | null;
|
|
52
|
+
getPoolIdentifier(srcAddress: Address, destAddress: Address, fee: bigint, tickSpacing?: bigint): string;
|
|
53
|
+
initializePricing(blockNumber: number): Promise<void>;
|
|
54
|
+
protected onPoolCreatedDeleteFromNonExistingSet(): OnPoolCreatedCallback;
|
|
55
|
+
getPool(srcAddress: Address, destAddress: Address, fee: bigint, blockNumber: number, tickSpacing?: bigint): Promise<UniswapV3EventPool | null>;
|
|
56
|
+
protected getPoolInstance(token0: string, token1: string, fee: bigint, tickSpacing?: bigint): UniswapV3EventPool;
|
|
57
|
+
protected getFactoryInstance(): UniswapV3Factory;
|
|
58
|
+
addMasterPool(poolKey: string, blockNumber: number): Promise<boolean>;
|
|
59
|
+
getPoolIdentifiers(srcToken: Token, destToken: Token, side: SwapSide, blockNumber: number): Promise<string[]>;
|
|
60
|
+
protected getPoolsForIdentifiers(srcAddress: string, destAddress: string, blockNumber: number): Promise<(UniswapV3EventPool | null)[]>;
|
|
61
|
+
getPricingFromRpc(from: Token, to: Token, amounts: bigint[], side: SwapSide, pools: UniswapV3EventPool[], states: PoolState[]): Promise<ExchangePrices<UniswapV3Data> | null>;
|
|
62
|
+
protected getSelectedPools(srcAddress: string, destAddress: string, blockNumber: number): Promise<(UniswapV3EventPool | null)[]>;
|
|
63
|
+
getPricesVolume(srcToken: Token, destToken: Token, amounts: bigint[], side: SwapSide, blockNumber: number, limitPools?: string[]): Promise<null | ExchangePrices<UniswapV3Data>>;
|
|
64
|
+
protected prepareData(srcAddress: string, destAddress: string, pool: UniswapV3EventPool, state: PoolState): UniswapV3Data;
|
|
65
|
+
getCalldataGasCost(poolPrices: PoolPrices<UniswapV3Data>): number | number[];
|
|
66
|
+
getTokenFromAddress(address: Address): Token;
|
|
67
|
+
preProcessTransaction(optimalSwapExchange: OptimalSwapExchange<UniswapV3Data>, srcToken: Token, _0: Token, _1: SwapSide, options: PreprocessTransactionOptions): Promise<[OptimalSwapExchange<UniswapV3Data>, ExchangeTxInfo]>;
|
|
68
|
+
getDirectParam(srcToken: Address, destToken: Address, srcAmount: NumberAsString, destAmount: NumberAsString, expectedAmount: NumberAsString, data: UniswapV3Data, side: SwapSide, permit: string, uuid: string, feePercent: NumberAsString, deadline: NumberAsString, partner: string, beneficiary: string, contractMethod: string): TxInfo<UniswapV3Param>;
|
|
69
|
+
static getDirectFunctionName(): string[];
|
|
70
|
+
getDirectParamV6(srcToken: Address, destToken: Address, fromAmount: NumberAsString, toAmount: NumberAsString, quotedAmount: NumberAsString, data: UniswapV3Data, side: SwapSide, permit: string, uuid: string, partnerAndFee: string, beneficiary: string, blockNumber: number, contractMethod: string): {
|
|
71
|
+
params: UniswapV3ParamsDirect;
|
|
72
|
+
encoder: (...params: (string | UniswapV3ParamsDirect)[]) => string;
|
|
73
|
+
networkFee: string;
|
|
74
|
+
};
|
|
75
|
+
static getDirectFunctionNameV6(): string[];
|
|
76
|
+
getAdapterParam(srcToken: string, destToken: string, srcAmount: string, destAmount: string, data: UniswapV3Data, side: SwapSide): AdapterExchangeParam;
|
|
77
|
+
getDexParam(srcToken: Address, destToken: Address, srcAmount: NumberAsString, destAmount: NumberAsString, recipient: Address, data: UniswapV3Data, side: SwapSide): DexExchangeParam;
|
|
78
|
+
getSimpleParam(srcToken: string, destToken: string, srcAmount: string, destAmount: string, data: UniswapV3Data, side: SwapSide): Promise<SimpleExchangeParam>;
|
|
79
|
+
getTopPoolsForToken(tokenAddress: Address, limit: number): Promise<PoolLiquidity[]>;
|
|
80
|
+
private _getPoolsFromIdentifiers;
|
|
81
|
+
protected _getLoweredAddresses(srcToken: Token, destToken: Token): string[];
|
|
82
|
+
protected _sortTokens(srcAddress: Address, destAddress: Address): string[];
|
|
83
|
+
private _toLowerForAllConfigAddresses;
|
|
84
|
+
protected _getOutputs(state: DeepReadonly<PoolState>, amounts: bigint[], zeroForOne: boolean, side: SwapSide, destTokenBalance: bigint): OutputResult | null;
|
|
85
|
+
private _querySubgraph;
|
|
86
|
+
protected _encodePath(path: {
|
|
87
|
+
tokenIn: Address;
|
|
88
|
+
tokenOut: Address;
|
|
89
|
+
fee: NumberAsString;
|
|
90
|
+
}[], side: SwapSide): string;
|
|
91
|
+
private _encodePathV6;
|
|
92
|
+
private _encodePool;
|
|
93
|
+
releaseResources(): void;
|
|
94
|
+
}
|