@paraswap/dex-lib 4.7.13 → 4.7.14-pharaoh-v3.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/PendleRouterStatic.json +19 -0
- package/build/abi/{MStableAsset.json → apex-defi/ApexDefiFactory.abi.json} +992 -788
- package/build/abi/{BProtocol.json → apex-defi/ApexDefiRouter.abi.json} +539 -574
- package/build/abi/apex-defi/ApexDefiToken.abi.json +229 -0
- package/build/abi/apex-defi/ApexDefiWrapper.abi.json +92 -0
- package/build/abi/{OneInchLp.json → apex-defi/ApexDefiWrapperFactory.abi.json} +577 -774
- package/build/abi/pangolin-v3/PangolinV3StateMulticall.abi.json +796 -0
- package/build/abi/pendle/pendle-deployer.abi.json +520 -0
- package/build/abi/pendle/pendle-oracle.abi.json +413 -0
- package/build/abi/pharaoh-v3/PharaohV3Factory.abi.json +349 -0
- package/build/abi/pharaoh-v3/PharaohV3Pool.abi.json +802 -0
- package/build/abi/pharaoh-v3/PharaohV3StateMulticall.abi.json +781 -0
- package/build/abi/ring-v2/few-wrapped-token.json +587 -0
- package/build/abi/ring-v2/ring-v2-factory.json +125 -0
- package/build/abi/ring-v2/ring-v2-pool.json +461 -0
- package/build/abi/ring-v2/ring-v2-router.json +332 -0
- package/build/abi/stabull/stabull-curve.json +738 -0
- package/build/abi/stabull/stabull-router.json +76 -0
- package/build/abi/uniswap-v4/hooks/SpotDynamicFeeManager.json +26 -0
- package/build/abi/uniswap-v4/hooks/SpotHook.json +54 -0
- package/build/abi/uniswap-v4/hooks/SpotPolicyManager.json +45 -0
- package/build/abi/uniswap-v4/hooks/cabalcoin-hook.abi.json +682 -0
- package/build/abi/uniswap-v4/hooks/fee-hook.abi.json +1335 -0
- package/build/dex/aave-pt-to-underlying/aave-pt-to-underlying-factory.d.ts +29 -0
- package/build/dex/aave-pt-to-underlying/aave-pt-to-underlying-factory.js +153 -0
- package/build/dex/aave-pt-to-underlying/aave-pt-to-underlying-factory.js.map +1 -0
- package/build/dex/{usual-bond/usual-bond.d.ts → aave-pt-to-underlying/aave-pt-to-underlying.d.ts} +23 -18
- package/build/dex/aave-pt-to-underlying/aave-pt-to-underlying.js +323 -0
- package/build/dex/aave-pt-to-underlying/aave-pt-to-underlying.js.map +1 -0
- package/build/dex/aave-pt-to-underlying/config.d.ts +3 -0
- package/build/dex/aave-pt-to-underlying/config.js +24 -0
- package/build/dex/aave-pt-to-underlying/config.js.map +1 -0
- package/build/dex/aave-pt-to-underlying/constants.d.ts +2 -0
- package/build/dex/aave-pt-to-underlying/constants.js +6 -0
- package/build/dex/aave-pt-to-underlying/constants.js.map +1 -0
- package/build/dex/aave-pt-to-underlying/types.d.ts +24 -0
- package/build/dex/aave-pt-to-underlying/types.js.map +1 -0
- package/build/dex/aave-pt-to-usdc/aave-pt-to-usdc.d.ts +39 -0
- package/build/dex/aave-pt-to-usdc/aave-pt-to-usdc.js +244 -0
- package/build/dex/aave-pt-to-usdc/aave-pt-to-usdc.js.map +1 -0
- package/build/dex/aave-pt-to-usdc/config.d.ts +3 -0
- package/build/dex/aave-pt-to-usdc/config.js +47 -0
- package/build/dex/aave-pt-to-usdc/config.js.map +1 -0
- package/build/dex/aave-pt-to-usdc/constants.d.ts +2 -0
- package/build/dex/aave-pt-to-usdc/constants.js +6 -0
- package/build/dex/aave-pt-to-usdc/constants.js.map +1 -0
- package/build/dex/aave-pt-to-usdc/types.d.ts +22 -0
- package/build/dex/aave-pt-to-usdc/types.js.map +1 -0
- package/build/dex/apex-defi/apex-defi-factory.d.ts +26 -0
- package/build/dex/apex-defi/apex-defi-factory.js +53 -0
- package/build/dex/apex-defi/apex-defi-factory.js.map +1 -0
- package/build/dex/apex-defi/apex-defi-pool.d.ts +55 -0
- package/build/dex/apex-defi/apex-defi-pool.js +247 -0
- package/build/dex/apex-defi/apex-defi-pool.js.map +1 -0
- package/build/dex/apex-defi/apex-defi-wrapper-factory.d.ts +57 -0
- package/build/dex/apex-defi/apex-defi-wrapper-factory.js +250 -0
- package/build/dex/apex-defi/apex-defi-wrapper-factory.js.map +1 -0
- package/build/dex/apex-defi/apex-defi.d.ts +97 -0
- package/build/dex/apex-defi/apex-defi.js +1021 -0
- package/build/dex/apex-defi/apex-defi.js.map +1 -0
- package/build/dex/apex-defi/config.d.ts +4 -0
- package/build/dex/apex-defi/config.js +138 -0
- package/build/dex/apex-defi/config.js.map +1 -0
- package/build/dex/apex-defi/types.d.ts +32 -0
- package/build/dex/apex-defi/types.js +3 -0
- package/build/dex/{usual-bond → apex-defi}/types.js.map +1 -1
- package/build/dex/apex-defi/utils.d.ts +46 -0
- package/build/dex/apex-defi/utils.js +133 -0
- package/build/dex/apex-defi/utils.js.map +1 -0
- package/build/dex/maker-psm/maker-psm-event-pool.d.ts +43 -0
- package/build/dex/maker-psm/maker-psm-event-pool.js +132 -0
- package/build/dex/maker-psm/maker-psm-event-pool.js.map +1 -0
- package/build/dex/miro-migrator/miro-migrator-state.d.ts +27 -0
- package/build/dex/miro-migrator/miro-migrator-state.js +89 -0
- package/build/dex/miro-migrator/miro-migrator-state.js.map +1 -0
- package/build/dex/{usual-bond → stabull}/config.d.ts +1 -1
- package/build/dex/stabull/config.js +177 -0
- package/build/dex/stabull/config.js.map +1 -0
- package/build/dex/{se-vlr/se-vlr-pool.d.ts → stabull/stabull-pool.d.ts} +13 -6
- package/build/dex/stabull/stabull-pool.js +113 -0
- package/build/dex/stabull/stabull-pool.js.map +1 -0
- package/build/dex/stabull/stabull.d.ts +55 -0
- package/build/dex/stabull/stabull.js +286 -0
- package/build/dex/stabull/stabull.js.map +1 -0
- package/build/dex/stabull/types.d.ts +21 -0
- package/build/dex/stabull/types.js +3 -0
- package/build/dex/stabull/types.js.map +1 -0
- package/build/dex/uniswap-v3/config.js +32 -0
- package/build/dex/uniswap-v3/config.js.map +1 -1
- package/build/dex/uniswap-v3/forks/pangolin-v3/utils.d.ts +4 -0
- package/build/dex/uniswap-v3/forks/pangolin-v3/utils.js +56 -0
- package/build/dex/uniswap-v3/forks/pangolin-v3/utils.js.map +1 -0
- package/build/dex/uniswap-v3/forks/pharaoh-v3/pharaoh-v3-pool.d.ts +12 -0
- package/build/dex/uniswap-v3/forks/pharaoh-v3/pharaoh-v3-pool.js +142 -0
- package/build/dex/uniswap-v3/forks/pharaoh-v3/pharaoh-v3-pool.js.map +1 -0
- package/build/dex/uniswap-v3/forks/pharaoh-v3/utils.d.ts +4 -0
- package/build/dex/uniswap-v3/forks/pharaoh-v3/utils.js +56 -0
- package/build/dex/uniswap-v3/forks/pharaoh-v3/utils.js.map +1 -0
- package/build/dex/uniswap-v3/forks/velodrome-slipstream/velodrome-slipstream-pool.d.ts +2 -2
- package/build/dex/uniswap-v3/forks/velodrome-slipstream/velodrome-slipstream-pool.js.map +1 -1
- package/build/dex/uniswap-v3/forks/velodrome-slipstream/velodrome-slipstream.js +1 -0
- package/build/dex/uniswap-v3/forks/velodrome-slipstream/velodrome-slipstream.js.map +1 -1
- package/build/dex/uniswap-v3/uniswap-v3-pool.d.ts +2 -1
- package/build/dex/uniswap-v3/uniswap-v3-pool.js +3 -1
- package/build/dex/uniswap-v3/uniswap-v3-pool.js.map +1 -1
- package/build/dex/uniswap-v3/uniswap-v3.js +1 -1
- package/build/dex/uniswap-v3/uniswap-v3.js.map +1 -1
- package/build/dex/uniswap-v4/contract-math/Position.d.ts +6 -0
- package/build/dex/uniswap-v4/contract-math/Position.js +29 -0
- package/build/dex/uniswap-v4/contract-math/Position.js.map +1 -1
- package/build/dex/uniswap-v4/hooks/cabalcoin-hook/cabalcoin-hook-pool.d.ts +7 -0
- package/build/dex/uniswap-v4/hooks/cabalcoin-hook/cabalcoin-hook-pool.js +28 -0
- package/build/dex/uniswap-v4/hooks/cabalcoin-hook/cabalcoin-hook-pool.js.map +1 -0
- package/build/dex/uniswap-v4/hooks/cabalcoin-hook/types.d.ts +0 -0
- package/build/dex/uniswap-v4/hooks/cabalcoin-hook/types.js +2 -0
- package/build/dex/uniswap-v4/hooks/cabalcoin-hook/types.js.map +1 -0
- package/build/dex/uniswap-v4/hooks/fee-hook/fee-hook-pool.d.ts +7 -0
- package/build/dex/uniswap-v4/hooks/fee-hook/fee-hook-pool.js +28 -0
- package/build/dex/uniswap-v4/hooks/fee-hook/fee-hook-pool.js.map +1 -0
- package/build/dex/uniswap-v4/hooks/fee-hook/types.d.ts +0 -0
- package/build/dex/uniswap-v4/hooks/fee-hook/types.js +2 -0
- package/build/dex/uniswap-v4/hooks/fee-hook/types.js.map +1 -0
- package/build/dex/uniswap-v4/hooks/index.d.ts +1 -0
- package/build/dex/uniswap-v4/hooks/index.js +9 -0
- package/build/dex/uniswap-v4/hooks/index.js.map +1 -0
- package/build/dex/uniswap-v4/hooks/spot.d.ts +15 -0
- package/build/dex/uniswap-v4/hooks/spot.js +109 -0
- package/build/dex/uniswap-v4/hooks/spot.js.map +1 -0
- package/build/dex/uniswap-v4/hooks/template.d.ts +150 -0
- package/build/dex/uniswap-v4/hooks/template.js +104 -0
- package/build/dex/uniswap-v4/hooks/template.js.map +1 -0
- package/build/dex/usdc-transmuter/usdc-transmuter-pool.d.ts +26 -0
- package/build/dex/usdc-transmuter/usdc-transmuter-pool.js +75 -0
- package/build/dex/usdc-transmuter/usdc-transmuter-pool.js.map +1 -0
- package/build/dex/usual/usual-usdc-usdc.d.ts +17 -0
- package/build/dex/usual/usual-usdc-usdc.js +59 -0
- package/build/dex/usual/usual-usdc-usdc.js.map +1 -0
- package/build/dex/{se-vlr → yo}/config.d.ts +1 -1
- package/build/dex/yo/config.js +21 -0
- package/build/dex/yo/config.js.map +1 -0
- package/build/dex/yo/types.d.ts +13 -0
- package/build/dex/yo/types.js +3 -0
- package/build/dex/{se-vlr → yo}/types.js.map +1 -1
- package/build/dex/yo/yo-pool.d.ts +13 -0
- package/build/dex/yo/yo-pool.js +26 -0
- package/build/dex/yo/yo-pool.js.map +1 -0
- package/build/dex/yo/yo.d.ts +39 -0
- package/build/dex/yo/yo.js +248 -0
- package/build/dex/yo/yo.js.map +1 -0
- package/build/implementations/api-paraswap-sdk.d.ts +25 -0
- package/build/implementations/api-paraswap-sdk.js +102 -0
- package/build/implementations/api-paraswap-sdk.js.map +1 -0
- package/package.json +1 -1
- package/build/abi/Jarvis.json +0 -1172
- package/build/abi/Onebit.json +0 -736
- package/build/abi/Shell.json +0 -1294
- package/build/abi/TraderJoeV2Router.json +0 -50
- package/build/abi/wUSDM.json +0 -757
- package/build/abi/zrx.v2.json +0 -1967
- package/build/abi/zrx.v3.json +0 -3454
- package/build/abi/zrx.v4.json +0 -2193
- package/build/dex/OneInchLp.d.ts +0 -24
- package/build/dex/OneInchLp.js +0 -43
- package/build/dex/OneInchLp.js.map +0 -1
- package/build/dex/bProtocol/bProtocol.d.ts +0 -15
- package/build/dex/bProtocol/bProtocol.js +0 -56
- package/build/dex/bProtocol/bProtocol.js.map +0 -1
- package/build/dex/bProtocol/types.d.ts +0 -11
- package/build/dex/bProtocol/types.js +0 -8
- package/build/dex/bProtocol/types.js.map +0 -1
- package/build/dex/jarvis.d.ts +0 -56
- package/build/dex/jarvis.js +0 -163
- package/build/dex/jarvis.js.map +0 -1
- package/build/dex/mStable.d.ts +0 -44
- package/build/dex/mStable.js +0 -75
- package/build/dex/mStable.js.map +0 -1
- package/build/dex/onebit/onebit.d.ts +0 -16
- package/build/dex/onebit/onebit.js +0 -61
- package/build/dex/onebit/onebit.js.map +0 -1
- package/build/dex/onebit/types.d.ts +0 -14
- package/build/dex/onebit/types.js +0 -8
- package/build/dex/onebit/types.js.map +0 -1
- package/build/dex/se-vlr/config.js +0 -24
- package/build/dex/se-vlr/config.js.map +0 -1
- package/build/dex/se-vlr/se-vlr-pool.js +0 -70
- package/build/dex/se-vlr/se-vlr-pool.js.map +0 -1
- package/build/dex/se-vlr/se-vlr.d.ts +0 -35
- package/build/dex/se-vlr/se-vlr.js +0 -131
- package/build/dex/se-vlr/se-vlr.js.map +0 -1
- package/build/dex/se-vlr/types.d.ts +0 -6
- package/build/dex/shell.d.ts +0 -25
- package/build/dex/shell.js +0 -41
- package/build/dex/shell.js.map +0 -1
- package/build/dex/trader-joe-v2.d.ts +0 -40
- package/build/dex/trader-joe-v2.js +0 -74
- package/build/dex/trader-joe-v2.js.map +0 -1
- package/build/dex/uniswap-v3/uniswap-v3-new.d.ts +0 -94
- package/build/dex/uniswap-v3/uniswap-v3-new.js +0 -923
- package/build/dex/uniswap-v3/uniswap-v3-new.js.map +0 -1
- package/build/dex/usual-bond/config.js +0 -13
- package/build/dex/usual-bond/config.js.map +0 -1
- package/build/dex/usual-bond/types.d.ts +0 -7
- package/build/dex/usual-bond/usual-bond.js +0 -176
- package/build/dex/usual-bond/usual-bond.js.map +0 -1
- package/build/dex/wusdm/config.d.ts +0 -3
- package/build/dex/wusdm/config.js +0 -43
- package/build/dex/wusdm/config.js.map +0 -1
- package/build/dex/wusdm/constants.d.ts +0 -2
- package/build/dex/wusdm/constants.js +0 -6
- package/build/dex/wusdm/constants.js.map +0 -1
- package/build/dex/wusdm/types.d.ts +0 -18
- package/build/dex/wusdm/types.js +0 -11
- package/build/dex/wusdm/types.js.map +0 -1
- package/build/dex/wusdm/wusdm-pool.d.ts +0 -21
- package/build/dex/wusdm/wusdm-pool.js +0 -74
- package/build/dex/wusdm/wusdm-pool.js.map +0 -1
- package/build/dex/wusdm/wusdm.d.ts +0 -46
- package/build/dex/wusdm/wusdm.js +0 -243
- package/build/dex/wusdm/wusdm.js.map +0 -1
- package/build/dex/zerox/config.d.ts +0 -2
- package/build/dex/zerox/config.js +0 -33
- package/build/dex/zerox/config.js.map +0 -1
- package/build/dex/zerox/index.d.ts +0 -22
- package/build/dex/zerox/index.js +0 -225
- package/build/dex/zerox/index.js.map +0 -1
- package/build/dex/zerox/order.d.ts +0 -88
- package/build/dex/zerox/order.js +0 -53
- package/build/dex/zerox/order.js.map +0 -1
- package/build/dex/zerox/types.d.ts +0 -73
- package/build/dex/zerox/types.js +0 -21
- package/build/dex/zerox/types.js.map +0 -1
- /package/build/dex/{se-vlr → aave-pt-to-underlying}/types.js +0 -0
- /package/build/dex/{usual-bond → aave-pt-to-usdc}/types.js +0 -0
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SeVlrConfig = void 0;
|
|
4
|
-
const constants_1 = require("../../constants");
|
|
5
|
-
exports.SeVlrConfig = {
|
|
6
|
-
seVLR: {
|
|
7
|
-
[constants_1.Network.MAINNET]: {
|
|
8
|
-
contractAddress: '0x40000320d200c110100638040f10500c8f0010b9',
|
|
9
|
-
VLR: '0x4e107a0000db66f0e9fd2039288bf811dd1f9c74',
|
|
10
|
-
WETH: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
|
|
11
|
-
},
|
|
12
|
-
[constants_1.Network.BASE]: {
|
|
13
|
-
contractAddress: '0x40000320d200c110100638040f10500c8f0010b9',
|
|
14
|
-
VLR: '0x4e107a0000db66f0e9fd2039288bf811dd1f9c74',
|
|
15
|
-
WETH: '0x4200000000000000000000000000000000000006 ',
|
|
16
|
-
},
|
|
17
|
-
[constants_1.Network.OPTIMISM]: {
|
|
18
|
-
contractAddress: '0x40000320d200c110100638040f10500c8f0010b9',
|
|
19
|
-
VLR: '0x4e107a0000db66f0e9fd2039288bf811dd1f9c74',
|
|
20
|
-
WETH: '0x4200000000000000000000000000000000000006 ',
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
};
|
|
24
|
-
//# sourceMappingURL=config.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/dex/se-vlr/config.ts"],"names":[],"mappings":";;;AAEA,+CAA0C;AAE7B,QAAA,WAAW,GAA4B;IAClD,KAAK,EAAE;QACL,CAAC,mBAAO,CAAC,OAAO,CAAC,EAAE;YACjB,eAAe,EAAE,4CAA4C;YAC7D,GAAG,EAAE,4CAA4C;YACjD,IAAI,EAAE,4CAA4C;SACnD;QACD,CAAC,mBAAO,CAAC,IAAI,CAAC,EAAE;YACd,eAAe,EAAE,4CAA4C;YAC7D,GAAG,EAAE,4CAA4C;YACjD,IAAI,EAAE,6CAA6C;SACpD;QACD,CAAC,mBAAO,CAAC,QAAQ,CAAC,EAAE;YAClB,eAAe,EAAE,4CAA4C;YAC7D,GAAG,EAAE,4CAA4C;YACjD,IAAI,EAAE,6CAA6C;SACpD;KACF;CACF,CAAC"}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SeVlrEventPool = void 0;
|
|
4
|
-
const abi_1 = require("@ethersproject/abi");
|
|
5
|
-
const utils_1 = require("../../utils");
|
|
6
|
-
const stateful_event_subscriber_1 = require("../../stateful-event-subscriber");
|
|
7
|
-
class SeVlrEventPool extends stateful_event_subscriber_1.StatefulEventSubscriber {
|
|
8
|
-
parentName;
|
|
9
|
-
network;
|
|
10
|
-
dexHelper;
|
|
11
|
-
seVlrIface;
|
|
12
|
-
handlers = {};
|
|
13
|
-
logDecoder;
|
|
14
|
-
addressesSubscribed;
|
|
15
|
-
constructor(parentName, network, dexHelper, logger, seVlrIface = new abi_1.Interface('' /* TODO: Import and put here SeVlr ABI */)) {
|
|
16
|
-
// TODO: Add pool name
|
|
17
|
-
super(parentName, 'POOL_NAME', dexHelper, logger);
|
|
18
|
-
this.parentName = parentName;
|
|
19
|
-
this.network = network;
|
|
20
|
-
this.dexHelper = dexHelper;
|
|
21
|
-
this.seVlrIface = seVlrIface;
|
|
22
|
-
// TODO: make logDecoder decode logs that
|
|
23
|
-
this.logDecoder = (log) => this.seVlrIface.parseLog(log);
|
|
24
|
-
this.addressesSubscribed = [
|
|
25
|
-
/* subscribed addresses */
|
|
26
|
-
];
|
|
27
|
-
// Add handlers
|
|
28
|
-
this.handlers['myEvent'] = this.handleMyEvent.bind(this);
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* The function is called every time any of the subscribed
|
|
32
|
-
* addresses release log. The function accepts the current
|
|
33
|
-
* state, updates the state according to the log, and returns
|
|
34
|
-
* the updated state.
|
|
35
|
-
* @param state - Current state of event subscriber
|
|
36
|
-
* @param log - Log released by one of the subscribed addresses
|
|
37
|
-
* @returns Updates state of the event subscriber after the log
|
|
38
|
-
*/
|
|
39
|
-
processLog(state, log) {
|
|
40
|
-
try {
|
|
41
|
-
const event = this.logDecoder(log);
|
|
42
|
-
if (event.name in this.handlers) {
|
|
43
|
-
return this.handlers[event.name](event, state, log);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
catch (e) {
|
|
47
|
-
(0, utils_1.catchParseLogError)(e, this.logger);
|
|
48
|
-
}
|
|
49
|
-
return null;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* The function generates state using on-chain calls. This
|
|
53
|
-
* function is called to regenerate state if the event based
|
|
54
|
-
* system fails to fetch events and the local state is no
|
|
55
|
-
* more correct.
|
|
56
|
-
* @param blockNumber - Blocknumber for which the state should
|
|
57
|
-
* should be generated
|
|
58
|
-
* @returns state of the event subscriber at blocknumber
|
|
59
|
-
*/
|
|
60
|
-
async generateState(blockNumber) {
|
|
61
|
-
// TODO: complete me!
|
|
62
|
-
return {};
|
|
63
|
-
}
|
|
64
|
-
// Its just a dummy example
|
|
65
|
-
handleMyEvent(event, state, log) {
|
|
66
|
-
return null;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
exports.SeVlrEventPool = SeVlrEventPool;
|
|
70
|
-
//# sourceMappingURL=se-vlr-pool.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"se-vlr-pool.js","sourceRoot":"","sources":["../../../src/dex/se-vlr/se-vlr-pool.ts"],"names":[],"mappings":";;;AAAA,4CAA+C;AAG/C,uCAAiD;AACjD,+EAA0E;AAI1E,MAAa,cAAe,SAAQ,mDAAkC;IAczD;IACC;IACA;IAEA;IAjBZ,QAAQ,GAM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WAAmB;QACrC,qBAAqB;QACrB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,2BAA2B;IAC3B,aAAa,CACX,KAAU,EACV,KAA8B,EAC9B,GAAkB;QAElB,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAlFD,wCAkFC"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { AsyncOrSync } from 'ts-essentials';
|
|
2
|
-
import { Token, Address, ExchangePrices, PoolPrices, AdapterExchangeParam, PoolLiquidity, Logger } from '../../types';
|
|
3
|
-
import { SwapSide, Network } from '../../constants';
|
|
4
|
-
import { IDex } from '../../dex/idex';
|
|
5
|
-
import { IDexHelper } from '../../dex-helper/idex-helper';
|
|
6
|
-
import { SeVlrData } from './types';
|
|
7
|
-
import { SimpleExchange } from '../simple-exchange';
|
|
8
|
-
import { SeVlrEventPool } from './se-vlr-pool';
|
|
9
|
-
export declare class SeVlr extends SimpleExchange implements IDex<SeVlrData> {
|
|
10
|
-
readonly network: Network;
|
|
11
|
-
readonly dexKey: string;
|
|
12
|
-
readonly dexHelper: IDexHelper;
|
|
13
|
-
protected eventPools: SeVlrEventPool;
|
|
14
|
-
readonly hasConstantPriceLargeAmounts = false;
|
|
15
|
-
readonly needWrapNative = true;
|
|
16
|
-
readonly isFeeOnTransferSupported = false;
|
|
17
|
-
static dexKeysWithNetwork: {
|
|
18
|
-
key: string;
|
|
19
|
-
networks: Network[];
|
|
20
|
-
}[];
|
|
21
|
-
logger: Logger;
|
|
22
|
-
constructor(network: Network, dexKey: string, dexHelper: IDexHelper);
|
|
23
|
-
initializePricing(blockNumber: number): Promise<void>;
|
|
24
|
-
getAdapters(side: SwapSide): {
|
|
25
|
-
name: string;
|
|
26
|
-
index: number;
|
|
27
|
-
}[] | null;
|
|
28
|
-
getPoolIdentifiers(srcToken: Token, destToken: Token, side: SwapSide, blockNumber: number): Promise<string[]>;
|
|
29
|
-
getPricesVolume(srcToken: Token, destToken: Token, amounts: bigint[], side: SwapSide, blockNumber: number, limitPools?: string[]): Promise<null | ExchangePrices<SeVlrData>>;
|
|
30
|
-
getCalldataGasCost(poolPrices: PoolPrices<SeVlrData>): number | number[];
|
|
31
|
-
getAdapterParam(srcToken: string, destToken: string, srcAmount: string, destAmount: string, data: SeVlrData, side: SwapSide): AdapterExchangeParam;
|
|
32
|
-
updatePoolState(): Promise<void>;
|
|
33
|
-
getTopPoolsForToken(tokenAddress: Address, limit: number): Promise<PoolLiquidity[]>;
|
|
34
|
-
releaseResources(): AsyncOrSync<void>;
|
|
35
|
-
}
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.SeVlr = void 0;
|
|
37
|
-
const CALLDATA_GAS_COST = __importStar(require("../../calldata-gas-cost"));
|
|
38
|
-
const utils_1 = require("../../utils");
|
|
39
|
-
const simple_exchange_1 = require("../simple-exchange");
|
|
40
|
-
const config_1 = require("./config");
|
|
41
|
-
const se_vlr_pool_1 = require("./se-vlr-pool");
|
|
42
|
-
class SeVlr extends simple_exchange_1.SimpleExchange {
|
|
43
|
-
network;
|
|
44
|
-
dexKey;
|
|
45
|
-
dexHelper;
|
|
46
|
-
eventPools;
|
|
47
|
-
hasConstantPriceLargeAmounts = false;
|
|
48
|
-
// TODO: set true here if protocols works only with wrapped asset
|
|
49
|
-
needWrapNative = true;
|
|
50
|
-
isFeeOnTransferSupported = false;
|
|
51
|
-
static dexKeysWithNetwork = (0, utils_1.getDexKeysWithNetwork)(config_1.SeVlrConfig);
|
|
52
|
-
logger;
|
|
53
|
-
constructor(network, dexKey, dexHelper) {
|
|
54
|
-
super(dexHelper, dexKey);
|
|
55
|
-
this.network = network;
|
|
56
|
-
this.dexKey = dexKey;
|
|
57
|
-
this.dexHelper = dexHelper;
|
|
58
|
-
this.logger = dexHelper.getLogger(dexKey);
|
|
59
|
-
this.eventPools = new se_vlr_pool_1.SeVlrEventPool(dexKey, network, dexHelper, this.logger);
|
|
60
|
-
}
|
|
61
|
-
// Initialize pricing is called once in the start of
|
|
62
|
-
// pricing service. It is intended to setup the integration
|
|
63
|
-
// for pricing requests. It is optional for a DEX to
|
|
64
|
-
// implement this function
|
|
65
|
-
async initializePricing(blockNumber) {
|
|
66
|
-
// TODO: complete me!
|
|
67
|
-
}
|
|
68
|
-
// Legacy: was only used for V5
|
|
69
|
-
// Returns the list of contract adapters (name and index)
|
|
70
|
-
// for a buy/sell. Return null if there are no adapters.
|
|
71
|
-
getAdapters(side) {
|
|
72
|
-
return null;
|
|
73
|
-
}
|
|
74
|
-
// Returns list of pool identifiers that can be used
|
|
75
|
-
// for a given swap. poolIdentifiers must be unique
|
|
76
|
-
// across DEXes. It is recommended to use
|
|
77
|
-
// ${dexKey}_${poolAddress} as a poolIdentifier
|
|
78
|
-
async getPoolIdentifiers(srcToken, destToken, side, blockNumber) {
|
|
79
|
-
// TODO: complete me!
|
|
80
|
-
return [];
|
|
81
|
-
}
|
|
82
|
-
// Returns pool prices for amounts.
|
|
83
|
-
// If limitPools is defined only pools in limitPools
|
|
84
|
-
// should be used. If limitPools is undefined then
|
|
85
|
-
// any pools can be used.
|
|
86
|
-
async getPricesVolume(srcToken, destToken, amounts, side, blockNumber, limitPools) {
|
|
87
|
-
// TODO: complete me!
|
|
88
|
-
return null;
|
|
89
|
-
}
|
|
90
|
-
// Returns estimated gas cost of calldata for this DEX in multiSwap
|
|
91
|
-
getCalldataGasCost(poolPrices) {
|
|
92
|
-
// TODO: update if there is any payload in getAdapterParam
|
|
93
|
-
return CALLDATA_GAS_COST.DEX_NO_PAYLOAD;
|
|
94
|
-
}
|
|
95
|
-
// Encode params required by the exchange adapter
|
|
96
|
-
// V5: Used for multiSwap, buy & megaSwap
|
|
97
|
-
// V6: Not used, can be left blank
|
|
98
|
-
// Hint: abiCoder.encodeParameter() could be useful
|
|
99
|
-
getAdapterParam(srcToken, destToken, srcAmount, destAmount, data, side) {
|
|
100
|
-
// TODO: complete me!
|
|
101
|
-
const { exchange } = data;
|
|
102
|
-
// Encode here the payload for adapter
|
|
103
|
-
const payload = '';
|
|
104
|
-
return {
|
|
105
|
-
targetExchange: exchange,
|
|
106
|
-
payload,
|
|
107
|
-
networkFee: '0',
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
// This is called once before getTopPoolsForToken is
|
|
111
|
-
// called for multiple tokens. This can be helpful to
|
|
112
|
-
// update common state required for calculating
|
|
113
|
-
// getTopPoolsForToken. It is optional for a DEX
|
|
114
|
-
// to implement this
|
|
115
|
-
async updatePoolState() {
|
|
116
|
-
// TODO: complete me!
|
|
117
|
-
}
|
|
118
|
-
// Returns list of top pools based on liquidity. Max
|
|
119
|
-
// limit number pools should be returned.
|
|
120
|
-
async getTopPoolsForToken(tokenAddress, limit) {
|
|
121
|
-
//TODO: complete me!
|
|
122
|
-
return [];
|
|
123
|
-
}
|
|
124
|
-
// This is optional function in case if your implementation has acquired any resources
|
|
125
|
-
// you need to release for graceful shutdown. For example, it may be any interval timer
|
|
126
|
-
releaseResources() {
|
|
127
|
-
// TODO: complete me!
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
exports.SeVlr = SeVlr;
|
|
131
|
-
//# sourceMappingURL=se-vlr.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"se-vlr.js","sourceRoot":"","sources":["../../../src/dex/se-vlr/se-vlr.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,2EAA6D;AAC7D,uCAAoD;AAIpD,wDAAoD;AACpD,qCAAuC;AACvC,+CAA+C;AAE/C,MAAa,KAAM,SAAQ,gCAAc;IAe5B;IACA;IACA;IAhBD,UAAU,CAAiB;IAE5B,4BAA4B,GAAG,KAAK,CAAC;IAC9C,iEAAiE;IACxD,cAAc,GAAG,IAAI,CAAC;IAEtB,wBAAwB,GAAG,KAAK,CAAC;IAEnC,MAAM,CAAC,kBAAkB,GAC9B,IAAA,6BAAqB,EAAC,oBAAW,CAAC,CAAC;IAErC,MAAM,CAAS;IAEf,YACW,OAAgB,EAChB,MAAc,EACd,SAAqB;QAE9B,KAAK,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QAJhB,YAAO,GAAP,OAAO,CAAS;QAChB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AAC;QAEnB,OAAO;YACL,cAAc,EAAE,QAAQ;YACxB,OAAO;YACP,UAAU,EAAE,GAAG;SAChB,CAAC;IACJ,CAAC;IAED,oDAAoD;IACpD,qDAAqD;IACrD,+CAA+C;IAC/C,gDAAgD;IAChD,oBAAoB;IACpB,KAAK,CAAC,eAAe;QACnB,qBAAqB;IACvB,CAAC;IAED,oDAAoD;IACpD,yCAAyC;IACzC,KAAK,CAAC,mBAAmB,CACvB,YAAqB,EACrB,KAAa;QAEb,oBAAoB;QACpB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,sFAAsF;IACtF,uFAAuF;IACvF,gBAAgB;QACd,qBAAqB;IACvB,CAAC;;AAhIH,sBAiIC"}
|
package/build/dex/shell.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Interface } from '@ethersproject/abi';
|
|
2
|
-
import { SwapSide } from '../constants';
|
|
3
|
-
import { AdapterExchangeParam, Address, SimpleExchangeParam } from '../types';
|
|
4
|
-
import { IDexTxBuilder } from './idex';
|
|
5
|
-
import { SimpleExchange } from './simple-exchange';
|
|
6
|
-
import { IDexHelper } from '../dex-helper';
|
|
7
|
-
export declare type ShellData = {
|
|
8
|
-
exchange: Address;
|
|
9
|
-
deadline?: number;
|
|
10
|
-
};
|
|
11
|
-
declare type ShellParam = [
|
|
12
|
-
_origin: string,
|
|
13
|
-
_target: string,
|
|
14
|
-
_originAmount: string,
|
|
15
|
-
_minTargetAmount: string,
|
|
16
|
-
_deadline: string
|
|
17
|
-
];
|
|
18
|
-
export declare class Shell extends SimpleExchange implements IDexTxBuilder<ShellData, ShellParam> {
|
|
19
|
-
static dexKeys: string[];
|
|
20
|
-
exchangeRouterInterface: Interface;
|
|
21
|
-
constructor(dexHelper: IDexHelper);
|
|
22
|
-
getAdapterParam(srcToken: string, destToken: string, srcAmount: string, destAmount: string, data: ShellData, side: SwapSide): AdapterExchangeParam;
|
|
23
|
-
getSimpleParam(srcToken: string, destToken: string, srcAmount: string, destAmount: string, data: ShellData, side: SwapSide): Promise<SimpleExchangeParam>;
|
|
24
|
-
}
|
|
25
|
-
export {};
|
package/build/dex/shell.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
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.Shell = void 0;
|
|
7
|
-
const abi_1 = require("@ethersproject/abi");
|
|
8
|
-
const simple_exchange_1 = require("./simple-exchange");
|
|
9
|
-
const Shell_json_1 = __importDefault(require("../abi/Shell.json"));
|
|
10
|
-
var ShellFunctions;
|
|
11
|
-
(function (ShellFunctions) {
|
|
12
|
-
ShellFunctions["originSwap"] = "originSwap";
|
|
13
|
-
})(ShellFunctions || (ShellFunctions = {}));
|
|
14
|
-
class Shell extends simple_exchange_1.SimpleExchange {
|
|
15
|
-
constructor(dexHelper) {
|
|
16
|
-
super(dexHelper, 'shell');
|
|
17
|
-
this.exchangeRouterInterface = new abi_1.Interface(Shell_json_1.default);
|
|
18
|
-
}
|
|
19
|
-
getAdapterParam(srcToken, destToken, srcAmount, destAmount, data, side) {
|
|
20
|
-
return {
|
|
21
|
-
targetExchange: data.exchange,
|
|
22
|
-
payload: '0x',
|
|
23
|
-
networkFee: '0',
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
async getSimpleParam(srcToken, destToken, srcAmount, destAmount, data, side) {
|
|
27
|
-
const swapFunction = ShellFunctions.originSwap;
|
|
28
|
-
const swapFunctionParams = [
|
|
29
|
-
srcToken,
|
|
30
|
-
destToken,
|
|
31
|
-
srcAmount,
|
|
32
|
-
destAmount,
|
|
33
|
-
(0, simple_exchange_1.getLocalDeadlineAsFriendlyPlaceholder)(),
|
|
34
|
-
];
|
|
35
|
-
const swapData = this.exchangeRouterInterface.encodeFunctionData(swapFunction, swapFunctionParams);
|
|
36
|
-
return this.buildSimpleParamWithoutWETHConversion(srcToken, srcAmount, destToken, destAmount, swapData, data.exchange);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
exports.Shell = Shell;
|
|
40
|
-
Shell.dexKeys = ['shell'];
|
|
41
|
-
//# sourceMappingURL=shell.js.map
|
package/build/dex/shell.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shell.js","sourceRoot":"","sources":["../../src/dex/shell.ts"],"names":[],"mappings":";;;;;;AAAA,4CAA6D;AAI7D,uDAG2B;AAC3B,mEAAyC;AAczC,IAAK,cAEJ;AAFD,WAAK,cAAc;IACjB,2CAAyB,CAAA;AAC3B,CAAC,EAFI,cAAc,KAAd,cAAc,QAElB;AAED,MAAa,KACX,SAAQ,gCAAc;IAMtB,YAAY,SAAqB;QAC/B,KAAK,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QAC1B,IAAI,CAAC,uBAAuB,GAAG,IAAI,eAAS,CAAC,oBAA0B,CAAC,CAAC;IAC3E,CAAC;IAED,eAAe,CACb,QAAgB,EAChB,SAAiB,EACjB,SAAiB,EACjB,UAAkB,EAClB,IAAe,EACf,IAAc;QAEd,OAAO;YACL,cAAc,EAAE,IAAI,CAAC,QAAQ;YAC7B,OAAO,EAAE,IAAI;YACb,UAAU,EAAE,GAAG;SAChB,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,cAAc,CAClB,QAAgB,EAChB,SAAiB,EACjB,SAAiB,EACjB,UAAkB,EAClB,IAAe,EACf,IAAc;QAEd,MAAM,YAAY,GAAG,cAAc,CAAC,UAAU,CAAC;QAC/C,MAAM,kBAAkB,GAAe;YACrC,QAAQ;YACR,SAAS;YACT,SAAS;YACT,UAAU;YACV,IAAA,uDAAqC,GAAE;SACxC,CAAC;QACF,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,QAAQ,CACd,CAAC;IACJ,CAAC;;AAxDH,sBAyDC;AArDQ,aAAO,GAAG,CAAC,OAAO,CAAC,CAAC"}
|
|
@@ -1,40 +0,0 @@
|
|
|
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 {};
|
|
@@ -1,74 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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;QAKp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AAU;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"}
|
|
@@ -1,94 +0,0 @@
|
|
|
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
|
-
}
|