@paraswap/dex-lib 4.0.3 → 4.0.4
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/.idea/aws.xml +17 -0
- package/.idea/codeStyles/Project.xml +19 -0
- package/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/.idea/misc.xml +6 -0
- package/.idea/modules.xml +8 -0
- package/.idea/paraswap-dex-lib.iml +9 -0
- package/.idea/prettier.xml +7 -0
- package/.idea/vcs.xml +6 -0
- package/build/abi/integral/factory.json +333 -0
- package/build/abi/integral/oracle.json +501 -0
- package/build/abi/{inception/inception-ineth-pool.json → integral/pool.json} +522 -543
- package/build/abi/{wombat/pool.json → integral/relayer.json} +720 -473
- package/build/dex/aave-v1/aave-v1.d.ts +1 -2
- package/build/dex/aave-v1/aave-v1.js +0 -23
- package/build/dex/aave-v1/aave-v1.js.map +1 -1
- package/build/dex/bebop/bebop.js +1 -1
- package/build/dex/bebop/bebop.js.map +1 -1
- package/build/dex/cables/cables.d.ts +4 -2
- package/build/dex/cables/cables.js +90 -155
- package/build/dex/cables/cables.js.map +1 -1
- package/build/dex/cables/constants.d.ts +0 -1
- package/build/dex/cables/constants.js +2 -3
- package/build/dex/cables/constants.js.map +1 -1
- package/build/dex/cables/rate-fetcher.js +26 -10
- package/build/dex/cables/rate-fetcher.js.map +1 -1
- package/build/dex/cables/types.d.ts +15 -28
- package/build/dex/cables/types.js +2 -13
- package/build/dex/cables/types.js.map +1 -1
- package/build/dex/dexalot/dexalot.js.map +1 -1
- package/build/dex/fluid-dex/fluid-dex-generate-pool.d.ts +49 -0
- package/build/dex/fluid-dex/fluid-dex-generate-pool.js +104 -0
- package/build/dex/fluid-dex/fluid-dex-generate-pool.js.map +1 -0
- package/build/dex/index.js +2 -0
- package/build/dex/index.js.map +1 -1
- package/build/dex/integral/config.d.ts +4 -0
- package/build/dex/integral/config.js +20 -0
- package/build/dex/integral/config.js.map +1 -0
- package/build/dex/integral/context.d.ts +40 -0
- package/build/dex/integral/context.js +158 -0
- package/build/dex/integral/context.js.map +1 -0
- package/build/dex/integral/integral-factory.d.ts +24 -0
- package/build/dex/integral/integral-factory.js +95 -0
- package/build/dex/integral/integral-factory.js.map +1 -0
- package/build/dex/integral/integral-pool.d.ts +50 -0
- package/build/dex/integral/integral-pool.js +149 -0
- package/build/dex/integral/integral-pool.js.map +1 -0
- package/build/dex/integral/integral-pricing.d.ts +18 -0
- package/build/dex/integral/integral-pricing.js +114 -0
- package/build/dex/integral/integral-pricing.js.map +1 -0
- package/build/dex/integral/integral-relayer.d.ts +42 -0
- package/build/dex/integral/integral-relayer.js +192 -0
- package/build/dex/integral/integral-relayer.js.map +1 -0
- package/build/dex/integral/integral-token.d.ts +27 -0
- package/build/dex/integral/integral-token.js +59 -0
- package/build/dex/integral/integral-token.js.map +1 -0
- package/build/dex/integral/integral.d.ts +41 -0
- package/build/dex/integral/integral.js +376 -0
- package/build/dex/integral/integral.js.map +1 -0
- package/build/dex/integral/types.d.ts +85 -0
- package/build/dex/integral/types.js +9 -0
- package/build/dex/integral/types.js.map +1 -0
- package/build/dex/integral/utils-e2e.d.ts +9 -0
- package/build/dex/integral/utils-e2e.js +131 -0
- package/build/dex/integral/utils-e2e.js.map +1 -0
- package/build/dex/integral/utils.d.ts +17 -0
- package/build/dex/integral/utils.js +94 -0
- package/build/dex/integral/utils.js.map +1 -0
- package/build/dex/jarvis.d.ts +1 -2
- package/build/dex/jarvis.js +0 -58
- package/build/dex/jarvis.js.map +1 -1
- package/build/dex/platypus/platypus.d.ts +1 -2
- package/build/dex/platypus/platypus.js +0 -45
- package/build/dex/platypus/platypus.js.map +1 -1
- package/build/dex/stable-pool.js +8 -1
- package/build/dex/stable-pool.js.map +1 -1
- package/build/dex/swaap-v1/swaap-v1.d.ts +1 -2
- package/build/dex/swaap-v1/swaap-v1.js +0 -14
- package/build/dex/swaap-v1/swaap-v1.js.map +1 -1
- package/build/dex/trader-joe-v2.1/optimizer.d.ts +2 -0
- package/build/dex/trader-joe-v2.1/optimizer.js +47 -0
- package/build/dex/trader-joe-v2.1/optimizer.js.map +1 -0
- package/build/dex/zerox/index.d.ts +26 -4
- package/build/dex/zerox/index.js +42 -50
- package/build/dex/zerox/index.js.map +1 -1
- package/build/dex/zerox/types.d.ts +0 -29
- package/build/dex/zerox/types.js +1 -8
- package/build/dex/zerox/types.js.map +1 -1
- package/build/executor/Executor01BytecodeBuilder.js +11 -6
- package/build/executor/Executor01BytecodeBuilder.js.map +1 -1
- package/build/executor/Executor02BytecodeBuilder.js +11 -6
- package/build/executor/Executor02BytecodeBuilder.js.map +1 -1
- package/build/executor/Executor03BytecodeBuilder.js +11 -6
- package/build/executor/Executor03BytecodeBuilder.js.map +1 -1
- package/build/types.d.ts +1 -0
- package/package.json +1 -1
- package/src/abi/cables/CablesMainnetRFQ.json +1083 -0
- package/src/dex/bebop/bebop.ts +1 -1
- package/src/dex/cables/cables-e2e.test.ts +207 -0
- package/src/dex/cables/cables-integration.test.ts +391 -0
- package/src/dex/cables/cables.ts +823 -0
- package/src/dex/cables/config.ts +13 -0
- package/src/dex/cables/constants.ts +33 -0
- package/src/dex/cables/rate-fetcher.ts +212 -0
- package/src/dex/cables/types.ts +113 -0
- package/src/dex/cables/validators.test.ts +151 -0
- package/src/dex/cables/validators.ts +61 -0
- package/src/dex/dexalot/dexalot.ts +1 -0
- package/src/dex/index.ts +2 -0
- package/src/executor/Executor01BytecodeBuilder.ts +15 -11
- package/src/executor/Executor02BytecodeBuilder.ts +13 -9
- package/src/executor/Executor03BytecodeBuilder.ts +16 -9
- package/src/types.ts +1 -0
- package/tests/constants-e2e.ts +2 -2
- package/.vscode/launch.json +0 -53
- package/.vscode/settings.json +0 -2
- package/.vscode/tasks.json +0 -15
- package/build/abi/inception/inception-ratio-feed.json +0 -329
- package/build/abi/inception/inception-vault.json +0 -991
- package/build/abi/uniswap-v3/AlienBaseV3Router.abi.json +0 -52
- package/build/abi/usual-m-smart-m/usualM.abi.json +0 -483
- package/build/abi/usual-m-usd0/usualCollateralDao.abi.json +0 -681
- package/build/abi/usual-m-wrapped-m/usualM.abi.json +0 -509
- package/build/dex/aave-v2/tokens-avalanche.json +0 -44
- package/build/dex/aave-v2/tokens-mainnet.json +0 -188
- package/build/dex/aave-v2/tokens-polygon.json +0 -44
- package/build/dex/balancer-v3/abi/balancerBatchRouter.d.ts +0 -729
- package/build/dex/balancer-v3/abi/balancerBatchRouter.js +0 -732
- package/build/dex/balancer-v3/abi/balancerBatchRouter.js.map +0 -1
- package/build/dex/balancer-v3/abi/balancerRouter.d.ts +0 -1406
- package/build/dex/balancer-v3/abi/balancerRouter.js +0 -1175
- package/build/dex/balancer-v3/abi/balancerRouter.js.map +0 -1
- package/build/dex/balancer-v3/abi/vaultExtension.V3.d.ts +0 -2081
- package/build/dex/balancer-v3/abi/vaultExtension.V3.js +0 -1851
- package/build/dex/balancer-v3/abi/vaultExtension.V3.js.map +0 -1
- package/build/dex/balancer-v3/balancer-v3-sepolia-pools.d.ts +0 -34
- package/build/dex/balancer-v3/balancer-v3-sepolia-pools.js +0 -406
- package/build/dex/balancer-v3/balancer-v3-sepolia-pools.js.map +0 -1
- package/build/dex/inception/config.d.ts +0 -4
- package/build/dex/inception/config.js +0 -109
- package/build/dex/inception/config.js.map +0 -1
- package/build/dex/inception/inception-event-pool.d.ts +0 -16
- package/build/dex/inception/inception-event-pool.js +0 -49
- package/build/dex/inception/inception-event-pool.js.map +0 -1
- package/build/dex/inception/inception.d.ts +0 -43
- package/build/dex/inception/inception.js +0 -180
- package/build/dex/inception/inception.js.map +0 -1
- package/build/dex/inception/tokens.d.ts +0 -9
- package/build/dex/inception/tokens.js +0 -28
- package/build/dex/inception/tokens.js.map +0 -1
- package/build/dex/inception/types.d.ts +0 -22
- package/build/dex/inception/types.js +0 -3
- package/build/dex/inception/types.js.map +0 -1
- package/build/dex/inception/utils.d.ts +0 -7
- package/build/dex/inception/utils.js +0 -58
- package/build/dex/inception/utils.js.map +0 -1
- package/build/dex/maker-psm/scripts/gem.abi.json +0 -136
- package/build/dex/maker-psm/scripts/validate-state.d.ts +0 -0
- package/build/dex/maker-psm/scripts/validate-state.js +0 -185
- package/build/dex/maker-psm/scripts/validate-state.js.map +0 -1
- package/build/dex/maker-psm/scripts/vat.abi.json +0 -243
- package/build/dex/solidly-v3/scripts/check-event-pool-event.d.ts +0 -1
- package/build/dex/solidly-v3/scripts/check-event-pool-event.js +0 -53
- package/build/dex/solidly-v3/scripts/check-event-pool-event.js.map +0 -1
- package/build/dex/uniswap-v3/forks/alien-base-v3/alien-base-v3.d.ts +0 -17
- package/build/dex/uniswap-v3/forks/alien-base-v3/alien-base-v3.js +0 -64
- package/build/dex/uniswap-v3/forks/alien-base-v3/alien-base-v3.js.map +0 -1
- package/build/dex/uniswap-v3/forks/alien-v3/alien-v3.d.ts +0 -17
- package/build/dex/uniswap-v3/forks/alien-v3/alien-v3.js +0 -79
- package/build/dex/uniswap-v3/forks/alien-v3/alien-v3.js.map +0 -1
- package/build/dex/uniswap-v3/uniswap-v3-pricing.d.ts +0 -4
- package/build/dex/uniswap-v3/uniswap-v3-pricing.js +0 -43
- package/build/dex/uniswap-v3/uniswap-v3-pricing.js.map +0 -1
- package/build/dex/uniswap-v3/uniswap-v3-worker.d.ts +0 -1
- package/build/dex/uniswap-v3/uniswap-v3-worker.js +0 -10
- package/build/dex/uniswap-v3/uniswap-v3-worker.js.map +0 -1
- package/build/dex/usual/types.d.ts +0 -13
- package/build/dex/usual/types.js +0 -3
- package/build/dex/usual/types.js.map +0 -1
- package/build/dex/usual/usual-bond.d.ts +0 -18
- package/build/dex/usual/usual-bond.js +0 -52
- package/build/dex/usual/usual-bond.js.map +0 -1
- package/build/dex/usual/usual-m-smart-m.d.ts +0 -17
- package/build/dex/usual/usual-m-smart-m.js +0 -50
- package/build/dex/usual/usual-m-smart-m.js.map +0 -1
- package/build/dex/usual/usual-m-usd0.d.ts +0 -17
- package/build/dex/usual/usual-m-usd0.js +0 -51
- package/build/dex/usual/usual-m-usd0.js.map +0 -1
- package/build/dex/usual/usual-m-wrapped-m.d.ts +0 -17
- package/build/dex/usual/usual-m-wrapped-m.js +0 -50
- package/build/dex/usual/usual-m-wrapped-m.js.map +0 -1
- package/build/dex/usual/usual.d.ts +0 -27
- package/build/dex/usual/usual.js +0 -125
- package/build/dex/usual/usual.js.map +0 -1
- package/build/dex/usual-m-smart-m/config.d.ts +0 -3
- package/build/dex/usual-m-smart-m/config.js +0 -13
- package/build/dex/usual-m-smart-m/config.js.map +0 -1
- package/build/dex/usual-m-smart-m/types.d.ts +0 -7
- package/build/dex/usual-m-smart-m/types.js +0 -3
- package/build/dex/usual-m-smart-m/types.js.map +0 -1
- package/build/dex/usual-m-smart-m/usual-m-smart-m.d.ts +0 -35
- package/build/dex/usual-m-smart-m/usual-m-smart-m.js +0 -161
- package/build/dex/usual-m-smart-m/usual-m-smart-m.js.map +0 -1
- package/build/dex/usual-m-usd0/config.d.ts +0 -3
- package/build/dex/usual-m-usd0/config.js +0 -14
- package/build/dex/usual-m-usd0/config.js.map +0 -1
- package/build/dex/usual-m-usd0/types.d.ts +0 -8
- package/build/dex/usual-m-usd0/types.js +0 -3
- package/build/dex/usual-m-usd0/types.js.map +0 -1
- package/build/dex/usual-m-usd0/usual-m-usd0.d.ts +0 -35
- package/build/dex/usual-m-usd0/usual-m-usd0.js +0 -159
- package/build/dex/usual-m-usd0/usual-m-usd0.js.map +0 -1
- package/build/lib/pub-sub.d.ts +0 -35
- package/build/lib/pub-sub.js +0 -106
- package/build/lib/pub-sub.js.map +0 -1
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// /* eslint-disable no-console */
|
|
3
|
-
// import dotenv from 'dotenv';
|
|
4
|
-
// dotenv.config();
|
|
5
|
-
// import { Network } from '../../../constants';
|
|
6
|
-
// import { DummyDexHelper } from '../../../dex-helper';
|
|
7
|
-
// import { BlockHeader } from 'web3-eth';
|
|
8
|
-
// import { MakerPsmConfig } from '../config';
|
|
9
|
-
// import { BigNumber, ethers } from 'ethers';
|
|
10
|
-
// import { Interface } from '@ethersproject/abi';
|
|
11
|
-
// import _ from 'lodash';
|
|
12
|
-
// import vatABI from './vat.abi.json';
|
|
13
|
-
// import gemABI from './gem.abi.json';
|
|
14
|
-
// // @ts-ignore
|
|
15
|
-
// import { Tokens } from '../../../../tests/constants-e2e';
|
|
16
|
-
// const tokens = Tokens[Network.MAINNET];
|
|
17
|
-
// const vatInterface = new Interface(vatABI);
|
|
18
|
-
// const gemInterface = new Interface(gemABI);
|
|
19
|
-
// const erc20Interface = new Interface([
|
|
20
|
-
// {
|
|
21
|
-
// constant: true,
|
|
22
|
-
// inputs: [{ internalType: 'address', name: '', type: 'address' }],
|
|
23
|
-
// name: 'balanceOf',
|
|
24
|
-
// outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
|
|
25
|
-
// payable: false,
|
|
26
|
-
// stateMutability: 'view',
|
|
27
|
-
// type: 'function',
|
|
28
|
-
// },
|
|
29
|
-
// ]);
|
|
30
|
-
// const network = Network.MAINNET;
|
|
31
|
-
// const vat = MakerPsmConfig.MakerPsm[Network.MAINNET].vatAddress;
|
|
32
|
-
// const MOVE_TOPIC =
|
|
33
|
-
// '0xbb35783b00000000000000000000000000000000000000000000000000000000';
|
|
34
|
-
// const dexHelper = new DummyDexHelper(network);
|
|
35
|
-
// async function findNewGems(): Promise<boolean> {
|
|
36
|
-
// const network = Network.MAINNET;
|
|
37
|
-
// const dexHelper = new DummyDexHelper(network);
|
|
38
|
-
// const lastBlockNumber = await dexHelper.provider.getBlockNumber();
|
|
39
|
-
// const startBlockNumber = lastBlockNumber - 1_000_000;
|
|
40
|
-
// const endBlockNumber = lastBlockNumber;
|
|
41
|
-
// // const startBlockNumber = endBlockNumber - 700_000;
|
|
42
|
-
// const totalRange = endBlockNumber - startBlockNumber;
|
|
43
|
-
// const smallChunkSize = 10_000;
|
|
44
|
-
// const bigChunkSize = 100_000;
|
|
45
|
-
// const bigChunks = Math.ceil(totalRange / bigChunkSize);
|
|
46
|
-
// const smallChunks = Math.ceil(bigChunkSize / smallChunkSize);
|
|
47
|
-
// const uniquePotentialGemJoinsSet = new Set();
|
|
48
|
-
// for (let i = 0; i < bigChunks; i++) {
|
|
49
|
-
// console.log('Processing chunk', i + 1, 'of', bigChunks);
|
|
50
|
-
// const from = startBlockNumber + i * bigChunkSize;
|
|
51
|
-
// console.log(
|
|
52
|
-
// new Array(smallChunks).fill(0).map((_, smallChunkNumber) => ({
|
|
53
|
-
// fromBlock: from + smallChunkNumber * smallChunkSize,
|
|
54
|
-
// toBlock: from + smallChunkNumber * smallChunkSize + smallChunkSize,
|
|
55
|
-
// })),
|
|
56
|
-
// );
|
|
57
|
-
// const logsToDispatch = (
|
|
58
|
-
// await Promise.all(
|
|
59
|
-
// new Array(smallChunks).fill(0).map((_, smallChunkNumber) =>
|
|
60
|
-
// dexHelper.provider.getLogs({
|
|
61
|
-
// fromBlock: from + smallChunkNumber * smallChunkSize,
|
|
62
|
-
// toBlock: from + smallChunkNumber * smallChunkSize + smallChunkSize,
|
|
63
|
-
// address: vat,
|
|
64
|
-
// }),
|
|
65
|
-
// ),
|
|
66
|
-
// )
|
|
67
|
-
// ).flat();
|
|
68
|
-
// const moveLogs = logsToDispatch.filter(l => l.topics[0] === MOVE_TOPIC);
|
|
69
|
-
// const potentialGemJoins = moveLogs.map(
|
|
70
|
-
// l => ethers.utils.defaultAbiCoder.decode(['address'], l.topics[1])[0],
|
|
71
|
-
// );
|
|
72
|
-
// potentialGemJoins.forEach(gemJoin =>
|
|
73
|
-
// uniquePotentialGemJoinsSet.add(gemJoin),
|
|
74
|
-
// );
|
|
75
|
-
// }
|
|
76
|
-
// const uniquePotentialGemJoins = Array.from(uniquePotentialGemJoinsSet);
|
|
77
|
-
// console.log('unique potential gem joins', uniquePotentialGemJoins.length);
|
|
78
|
-
// const gemJoinCalldata = uniquePotentialGemJoins
|
|
79
|
-
// .map(gemJoin => {
|
|
80
|
-
// return [
|
|
81
|
-
// {
|
|
82
|
-
// target: gemJoin,
|
|
83
|
-
// callData: vatInterface.encodeFunctionData('gemJoin'),
|
|
84
|
-
// },
|
|
85
|
-
// ];
|
|
86
|
-
// })
|
|
87
|
-
// .flat();
|
|
88
|
-
// const slicedGemJoinCallData = _.chunk(gemJoinCalldata, 500);
|
|
89
|
-
// const gemJoinData = (
|
|
90
|
-
// await Promise.all(
|
|
91
|
-
// slicedGemJoinCallData.map(async _multiCallData =>
|
|
92
|
-
// dexHelper.multiContract.methods
|
|
93
|
-
// .tryAggregate(false, _multiCallData)
|
|
94
|
-
// .call({}),
|
|
95
|
-
// ),
|
|
96
|
-
// )
|
|
97
|
-
// ).flat();
|
|
98
|
-
// // console.log(
|
|
99
|
-
// // gemJoinData
|
|
100
|
-
// // .map((data, i) => ({ ...data, index: i }))
|
|
101
|
-
// // .filter(d => d.returnData !== '0x' && d.returnData.length === 66)
|
|
102
|
-
// // .map(d => [d.returnData, gemJoinCalldata[d.index]]),
|
|
103
|
-
// // );
|
|
104
|
-
// const gemJoins = gemJoinData
|
|
105
|
-
// .filter(d => d.returnData !== '0x' && d.returnData.length === 66)
|
|
106
|
-
// .map(
|
|
107
|
-
// d => ethers.utils.defaultAbiCoder.decode(['address'], d.returnData)[0],
|
|
108
|
-
// );
|
|
109
|
-
// const uniqueGemJoins = [...new Set(gemJoins)];
|
|
110
|
-
// console.log('unique gem joins', uniqueGemJoins.length);
|
|
111
|
-
// const gemCalldata = uniqueGemJoins
|
|
112
|
-
// .map(gemJoin => {
|
|
113
|
-
// return [
|
|
114
|
-
// {
|
|
115
|
-
// target: gemJoin,
|
|
116
|
-
// callData: gemInterface.encodeFunctionData('gem'),
|
|
117
|
-
// },
|
|
118
|
-
// ];
|
|
119
|
-
// })
|
|
120
|
-
// .flat();
|
|
121
|
-
// const returnGemData = await dexHelper.multiContract.methods
|
|
122
|
-
// .tryAggregate(false, gemCalldata)
|
|
123
|
-
// .call({});
|
|
124
|
-
// const gems = returnGemData
|
|
125
|
-
// .filter((d: any) => d.returnData !== '0x')
|
|
126
|
-
// .map(
|
|
127
|
-
// (d: any) =>
|
|
128
|
-
// ethers.utils.defaultAbiCoder.decode(['address'], d.returnData)[0],
|
|
129
|
-
// );
|
|
130
|
-
// const balanceCalldata = gems
|
|
131
|
-
// .map((gem: any, i: number) => {
|
|
132
|
-
// return [
|
|
133
|
-
// {
|
|
134
|
-
// target: gem,
|
|
135
|
-
// callData: erc20Interface.encodeFunctionData('balanceOf', [
|
|
136
|
-
// uniqueGemJoins[i],
|
|
137
|
-
// ]),
|
|
138
|
-
// },
|
|
139
|
-
// ];
|
|
140
|
-
// })
|
|
141
|
-
// .flat();
|
|
142
|
-
// const returnBalanceData = await dexHelper.multiContract.methods
|
|
143
|
-
// .tryAggregate(false, balanceCalldata)
|
|
144
|
-
// .call({});
|
|
145
|
-
// console.log(returnBalanceData);
|
|
146
|
-
// const balances: BigNumber[] = returnBalanceData
|
|
147
|
-
// .filter((d: any) => d.returnData !== '0x')
|
|
148
|
-
// .map(
|
|
149
|
-
// (d: any) =>
|
|
150
|
-
// ethers.utils.defaultAbiCoder.decode(['uint256'], d.returnData)[0],
|
|
151
|
-
// );
|
|
152
|
-
// console.log(balances.map(b => b.toString()));
|
|
153
|
-
// const data = uniqueGemJoins.map((gemJoin, i) => {
|
|
154
|
-
// const token = Object.values(tokens).find(
|
|
155
|
-
// t => t.address.toLowerCase() === gems[i].toLowerCase(),
|
|
156
|
-
// );
|
|
157
|
-
// const symbol = token
|
|
158
|
-
// ? Object.entries(tokens).find(
|
|
159
|
-
// ([symbol, t]) => t.address.toLowerCase() === gems[i].toLowerCase(),
|
|
160
|
-
// )?.[0]
|
|
161
|
-
// : 'Not found';
|
|
162
|
-
// const balance = token
|
|
163
|
-
// ? Number(ethers.utils.formatUnits(balances[i], token.decimals))
|
|
164
|
-
// : balances[i].toString();
|
|
165
|
-
// return {
|
|
166
|
-
// gemJoin,
|
|
167
|
-
// gem: gems[i],
|
|
168
|
-
// balance,
|
|
169
|
-
// ...(token
|
|
170
|
-
// ? {
|
|
171
|
-
// address: gems[i],
|
|
172
|
-
// decimals: token.decimals,
|
|
173
|
-
// symbol,
|
|
174
|
-
// }
|
|
175
|
-
// : { address: gems[i] }),
|
|
176
|
-
// };
|
|
177
|
-
// });
|
|
178
|
-
// console.log(data);
|
|
179
|
-
// // const address = logsToDispatch[0].address;
|
|
180
|
-
// return true;
|
|
181
|
-
// }
|
|
182
|
-
// findNewGems()
|
|
183
|
-
// .then(() => console.log('Done'))
|
|
184
|
-
// .catch(e => console.error(e));
|
|
185
|
-
//# sourceMappingURL=validate-state.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validate-state.js","sourceRoot":"","sources":["../../../../src/dex/maker-psm/scripts/validate-state.ts"],"names":[],"mappings":";AAAA,kCAAkC;AAClC,+BAA+B;AAC/B,mBAAmB;AAEnB,gDAAgD;AAChD,wDAAwD;AACxD,0CAA0C;AAC1C,8CAA8C;AAC9C,8CAA8C;AAC9C,kDAAkD;AAClD,0BAA0B;AAC1B,uCAAuC;AACvC,uCAAuC;AACvC,gBAAgB;AAChB,4DAA4D;AAE5D,0CAA0C;AAE1C,8CAA8C;AAC9C,8CAA8C;AAC9C,yCAAyC;AACzC,MAAM;AACN,sBAAsB;AACtB,wEAAwE;AACxE,yBAAyB;AACzB,yEAAyE;AACzE,sBAAsB;AACtB,+BAA+B;AAC/B,wBAAwB;AACxB,OAAO;AACP,MAAM;AAEN,mCAAmC;AACnC,mEAAmE;AACnE,qBAAqB;AACrB,0EAA0E;AAE1E,iDAAiD;AAEjD,mDAAmD;AACnD,qCAAqC;AACrC,mDAAmD;AAEnD,uEAAuE;AAEvE,0DAA0D;AAC1D,4CAA4C;AAC5C,0DAA0D;AAE1D,0DAA0D;AAE1D,mCAAmC;AACnC,kCAAkC;AAElC,4DAA4D;AAE5D,kEAAkE;AAElE,kDAAkD;AAElD,0CAA0C;AAC1C,+DAA+D;A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ACb,WAAW;AACX,SAAS;AACT,eAAe;AAEf,oEAAoE;AACpE,4CAA4C;AAC5C,iBAAiB;AAEjB,oCAAoC;AAEpC,oDAAoD;AACpD,iDAAiD;AACjD,YAAY;AACZ,oBAAoB;AACpB,6EAA6E;AAC7E,SAAS;AAET,kDAAkD;AAElD,sDAAsD;AACtD,gDAAgD;AAChD,gEAAgE;AAChE,SAAS;AACT,2BAA2B;AAC3B,uCAAuC;AACvC,gFAAgF;AAChF,iBAAiB;AACjB,uBAAuB;AACvB,4BAA4B;AAC5B,wEAAwE;AACxE,kCAAkC;AAElC,eAAe;AACf,iBAAiB;AACjB,sBAAsB;AACtB,iBAAiB;AACjB,kBAAkB;AAClB,cAAc;AACd,gCAAgC;AAChC,wCAAwC;AACxC,sBAAsB;AACtB,cAAc;AACd,mCAAmC;AACnC,SAAS;AACT,QAAQ;AAER,uBAAuB;AAEvB,kDAAkD;AAClD,iBAAiB;AACjB,IAAI;AAEJ,gBAAgB;AAChB,qCAAqC;AACrC,mCAAmC"}
|
|
@@ -1,243 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"inputs": [
|
|
4
|
-
{ "internalType": "address", "name": "gemJoin_", "type": "address" },
|
|
5
|
-
{ "internalType": "address", "name": "daiJoin_", "type": "address" },
|
|
6
|
-
{ "internalType": "address", "name": "vow_", "type": "address" }
|
|
7
|
-
],
|
|
8
|
-
"stateMutability": "nonpayable",
|
|
9
|
-
"type": "constructor"
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
"anonymous": false,
|
|
13
|
-
"inputs": [
|
|
14
|
-
{
|
|
15
|
-
"indexed": true,
|
|
16
|
-
"internalType": "address",
|
|
17
|
-
"name": "owner",
|
|
18
|
-
"type": "address"
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
"indexed": false,
|
|
22
|
-
"internalType": "uint256",
|
|
23
|
-
"name": "value",
|
|
24
|
-
"type": "uint256"
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
"indexed": false,
|
|
28
|
-
"internalType": "uint256",
|
|
29
|
-
"name": "fee",
|
|
30
|
-
"type": "uint256"
|
|
31
|
-
}
|
|
32
|
-
],
|
|
33
|
-
"name": "BuyGem",
|
|
34
|
-
"type": "event"
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
"anonymous": false,
|
|
38
|
-
"inputs": [
|
|
39
|
-
{
|
|
40
|
-
"indexed": false,
|
|
41
|
-
"internalType": "address",
|
|
42
|
-
"name": "user",
|
|
43
|
-
"type": "address"
|
|
44
|
-
}
|
|
45
|
-
],
|
|
46
|
-
"name": "Deny",
|
|
47
|
-
"type": "event"
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
"anonymous": false,
|
|
51
|
-
"inputs": [
|
|
52
|
-
{
|
|
53
|
-
"indexed": true,
|
|
54
|
-
"internalType": "bytes32",
|
|
55
|
-
"name": "what",
|
|
56
|
-
"type": "bytes32"
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
"indexed": false,
|
|
60
|
-
"internalType": "uint256",
|
|
61
|
-
"name": "data",
|
|
62
|
-
"type": "uint256"
|
|
63
|
-
}
|
|
64
|
-
],
|
|
65
|
-
"name": "File",
|
|
66
|
-
"type": "event"
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
"anonymous": false,
|
|
70
|
-
"inputs": [
|
|
71
|
-
{
|
|
72
|
-
"indexed": false,
|
|
73
|
-
"internalType": "address",
|
|
74
|
-
"name": "user",
|
|
75
|
-
"type": "address"
|
|
76
|
-
}
|
|
77
|
-
],
|
|
78
|
-
"name": "Rely",
|
|
79
|
-
"type": "event"
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
"anonymous": false,
|
|
83
|
-
"inputs": [
|
|
84
|
-
{
|
|
85
|
-
"indexed": true,
|
|
86
|
-
"internalType": "address",
|
|
87
|
-
"name": "owner",
|
|
88
|
-
"type": "address"
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
"indexed": false,
|
|
92
|
-
"internalType": "uint256",
|
|
93
|
-
"name": "value",
|
|
94
|
-
"type": "uint256"
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
"indexed": false,
|
|
98
|
-
"internalType": "uint256",
|
|
99
|
-
"name": "fee",
|
|
100
|
-
"type": "uint256"
|
|
101
|
-
}
|
|
102
|
-
],
|
|
103
|
-
"name": "SellGem",
|
|
104
|
-
"type": "event"
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
"inputs": [
|
|
108
|
-
{ "internalType": "address", "name": "usr", "type": "address" },
|
|
109
|
-
{ "internalType": "uint256", "name": "gemAmt", "type": "uint256" }
|
|
110
|
-
],
|
|
111
|
-
"name": "buyGem",
|
|
112
|
-
"outputs": [],
|
|
113
|
-
"stateMutability": "nonpayable",
|
|
114
|
-
"type": "function"
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
"inputs": [],
|
|
118
|
-
"name": "dai",
|
|
119
|
-
"outputs": [
|
|
120
|
-
{ "internalType": "contract DaiAbstract", "name": "", "type": "address" }
|
|
121
|
-
],
|
|
122
|
-
"stateMutability": "view",
|
|
123
|
-
"type": "function"
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
"inputs": [],
|
|
127
|
-
"name": "daiJoin",
|
|
128
|
-
"outputs": [
|
|
129
|
-
{
|
|
130
|
-
"internalType": "contract DaiJoinAbstract",
|
|
131
|
-
"name": "",
|
|
132
|
-
"type": "address"
|
|
133
|
-
}
|
|
134
|
-
],
|
|
135
|
-
"stateMutability": "view",
|
|
136
|
-
"type": "function"
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
"inputs": [{ "internalType": "address", "name": "usr", "type": "address" }],
|
|
140
|
-
"name": "deny",
|
|
141
|
-
"outputs": [],
|
|
142
|
-
"stateMutability": "nonpayable",
|
|
143
|
-
"type": "function"
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
"inputs": [
|
|
147
|
-
{ "internalType": "bytes32", "name": "what", "type": "bytes32" },
|
|
148
|
-
{ "internalType": "uint256", "name": "data", "type": "uint256" }
|
|
149
|
-
],
|
|
150
|
-
"name": "file",
|
|
151
|
-
"outputs": [],
|
|
152
|
-
"stateMutability": "nonpayable",
|
|
153
|
-
"type": "function"
|
|
154
|
-
},
|
|
155
|
-
{
|
|
156
|
-
"inputs": [],
|
|
157
|
-
"name": "gemJoin",
|
|
158
|
-
"outputs": [
|
|
159
|
-
{
|
|
160
|
-
"internalType": "contract AuthGemJoinAbstract",
|
|
161
|
-
"name": "",
|
|
162
|
-
"type": "address"
|
|
163
|
-
}
|
|
164
|
-
],
|
|
165
|
-
"stateMutability": "view",
|
|
166
|
-
"type": "function"
|
|
167
|
-
},
|
|
168
|
-
{
|
|
169
|
-
"inputs": [{ "internalType": "address", "name": "usr", "type": "address" }],
|
|
170
|
-
"name": "hope",
|
|
171
|
-
"outputs": [],
|
|
172
|
-
"stateMutability": "nonpayable",
|
|
173
|
-
"type": "function"
|
|
174
|
-
},
|
|
175
|
-
{
|
|
176
|
-
"inputs": [],
|
|
177
|
-
"name": "ilk",
|
|
178
|
-
"outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }],
|
|
179
|
-
"stateMutability": "view",
|
|
180
|
-
"type": "function"
|
|
181
|
-
},
|
|
182
|
-
{
|
|
183
|
-
"inputs": [{ "internalType": "address", "name": "usr", "type": "address" }],
|
|
184
|
-
"name": "nope",
|
|
185
|
-
"outputs": [],
|
|
186
|
-
"stateMutability": "nonpayable",
|
|
187
|
-
"type": "function"
|
|
188
|
-
},
|
|
189
|
-
{
|
|
190
|
-
"inputs": [{ "internalType": "address", "name": "usr", "type": "address" }],
|
|
191
|
-
"name": "rely",
|
|
192
|
-
"outputs": [],
|
|
193
|
-
"stateMutability": "nonpayable",
|
|
194
|
-
"type": "function"
|
|
195
|
-
},
|
|
196
|
-
{
|
|
197
|
-
"inputs": [
|
|
198
|
-
{ "internalType": "address", "name": "usr", "type": "address" },
|
|
199
|
-
{ "internalType": "uint256", "name": "gemAmt", "type": "uint256" }
|
|
200
|
-
],
|
|
201
|
-
"name": "sellGem",
|
|
202
|
-
"outputs": [],
|
|
203
|
-
"stateMutability": "nonpayable",
|
|
204
|
-
"type": "function"
|
|
205
|
-
},
|
|
206
|
-
{
|
|
207
|
-
"inputs": [],
|
|
208
|
-
"name": "tin",
|
|
209
|
-
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
|
210
|
-
"stateMutability": "view",
|
|
211
|
-
"type": "function"
|
|
212
|
-
},
|
|
213
|
-
{
|
|
214
|
-
"inputs": [],
|
|
215
|
-
"name": "tout",
|
|
216
|
-
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
|
217
|
-
"stateMutability": "view",
|
|
218
|
-
"type": "function"
|
|
219
|
-
},
|
|
220
|
-
{
|
|
221
|
-
"inputs": [],
|
|
222
|
-
"name": "vat",
|
|
223
|
-
"outputs": [
|
|
224
|
-
{ "internalType": "contract VatAbstract", "name": "", "type": "address" }
|
|
225
|
-
],
|
|
226
|
-
"stateMutability": "view",
|
|
227
|
-
"type": "function"
|
|
228
|
-
},
|
|
229
|
-
{
|
|
230
|
-
"inputs": [],
|
|
231
|
-
"name": "vow",
|
|
232
|
-
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
|
|
233
|
-
"stateMutability": "view",
|
|
234
|
-
"type": "function"
|
|
235
|
-
},
|
|
236
|
-
{
|
|
237
|
-
"inputs": [{ "internalType": "address", "name": "", "type": "address" }],
|
|
238
|
-
"name": "wards",
|
|
239
|
-
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
|
240
|
-
"stateMutability": "view",
|
|
241
|
-
"type": "function"
|
|
242
|
-
}
|
|
243
|
-
]
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,53 +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
|
-
/* eslint-disable no-console */
|
|
7
|
-
const dotenv_1 = __importDefault(require("dotenv"));
|
|
8
|
-
dotenv_1.default.config();
|
|
9
|
-
const constants_1 = require("../../../constants");
|
|
10
|
-
const dex_helper_1 = require("../../../dex-helper");
|
|
11
|
-
const config_1 = require("./../config");
|
|
12
|
-
const solidly_v3_1 = require("../solidly-v3");
|
|
13
|
-
const dex = 'SolidlyV3';
|
|
14
|
-
const factory = config_1.SolidlyV3Config[dex][constants_1.Network.MAINNET].factory;
|
|
15
|
-
const blockHeaders = {};
|
|
16
|
-
async function checkForPoolEvents(startBlockNumber, endBlockNumber) {
|
|
17
|
-
const network = constants_1.Network.MAINNET;
|
|
18
|
-
const dexHelper = new dex_helper_1.DummyDexHelper(network);
|
|
19
|
-
const solidlyV3 = new solidly_v3_1.SolidlyV3(network, dex, dexHelper);
|
|
20
|
-
await solidlyV3.initializePricing(startBlockNumber);
|
|
21
|
-
const logsToDispatch = await dexHelper.provider.getLogs({
|
|
22
|
-
fromBlock: startBlockNumber,
|
|
23
|
-
toBlock: endBlockNumber,
|
|
24
|
-
address: factory,
|
|
25
|
-
});
|
|
26
|
-
const logsByBlockNumber = {};
|
|
27
|
-
for (let log of logsToDispatch) {
|
|
28
|
-
if (!logsByBlockNumber[log.blockNumber]) {
|
|
29
|
-
logsByBlockNumber[log.blockNumber] = [];
|
|
30
|
-
}
|
|
31
|
-
logsByBlockNumber[log.blockNumber].push(log);
|
|
32
|
-
}
|
|
33
|
-
const sortedBlocks = Object.keys(logsByBlockNumber)
|
|
34
|
-
.map(Number)
|
|
35
|
-
.sort((a, b) => Number(a) - Number(b));
|
|
36
|
-
for (let blockNumber of sortedBlocks) {
|
|
37
|
-
if (!blockHeaders[blockNumber]) {
|
|
38
|
-
blockHeaders[blockNumber] = await dexHelper.web3Provider.eth.getBlock(blockNumber);
|
|
39
|
-
}
|
|
40
|
-
await solidlyV3.factory?.update(logsByBlockNumber[blockNumber], {
|
|
41
|
-
[blockNumber]: blockHeaders[blockNumber],
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
return true;
|
|
45
|
-
}
|
|
46
|
-
async function main() {
|
|
47
|
-
// event for https://etherscan.io/tx/0x2bef7c17f3f775525f076aeb20567ee25eb820e92aa8422fbfe4bed652fd2bd3
|
|
48
|
-
checkForPoolEvents(18758010, 18758019);
|
|
49
|
-
}
|
|
50
|
-
main()
|
|
51
|
-
.then(() => console.log('Done'))
|
|
52
|
-
.catch(e => console.error(e));
|
|
53
|
-
//# sourceMappingURL=check-event-pool-event.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"check-event-pool-event.js","sourceRoot":"","sources":["../../../../src/dex/solidly-v3/scripts/check-event-pool-event.ts"],"names":[],"mappings":";;;;;AAAA,+BAA+B;AAC/B,oDAA4B;AAC5B,gBAAM,CAAC,MAAM,EAAE,CAAC;AAIhB,kDAA6C;AAC7C,oDAAqD;AACrD,wCAA8C;AAC9C,8CAA0C;AAE1C,MAAM,GAAG,GAAG,WAAW,CAAC;AACxB,MAAM,OAAO,GAAG,wBAAe,CAAC,GAAG,CAAC,CAAC,mBAAO,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC;AAC9D,MAAM,YAAY,GAAgC,EAAE,CAAC;AAErD,KAAK,UAAU,kBAAkB,CAC/B,gBAAwB,EACxB,cAAsB;IAEtB,MAAM,OAAO,GAAG,mBAAO,CAAC,OAAO,CAAC;IAChC,MAAM,SAAS,GAAG,IAAI,2BAAc,CAAC,OAAO,CAAC,CAAC;IAE9C,MAAM,SAAS,GAAG,IAAI,sBAAS,CAAC,OAAO,EAAE,GAAG,EAAE,SAAS,CAAC,CAAC;IACzD,MAAM,SAAS,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;IAEpD,MAAM,cAAc,GAAG,MAAM,SA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AC,CAAC;KAC/B,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Network, SwapSide } from '../../../../constants';
|
|
2
|
-
import { IDexHelper } from '../../../../dex-helper';
|
|
3
|
-
import { DexConfigMap, SimpleExchangeParam } from '../../../../types';
|
|
4
|
-
import { DexParams, UniswapV3Data } from '../../types';
|
|
5
|
-
import { UniswapV3 } from '../../uniswap-v3';
|
|
6
|
-
export declare const AlienBaseV3Config: DexConfigMap<DexParams>;
|
|
7
|
-
export declare class AlienBaseV3 extends UniswapV3 {
|
|
8
|
-
protected network: Network;
|
|
9
|
-
protected dexHelper: IDexHelper;
|
|
10
|
-
static dexKeysWithNetwork: {
|
|
11
|
-
key: string;
|
|
12
|
-
networks: Network[];
|
|
13
|
-
}[];
|
|
14
|
-
constructor(network: Network, dexKey: string, dexHelper: IDexHelper);
|
|
15
|
-
static getDirectFunctionName(): string[];
|
|
16
|
-
getSimpleParam(srcToken: string, destToken: string, srcAmount: string, destAmount: string, data: UniswapV3Data, side: SwapSide): Promise<SimpleExchangeParam>;
|
|
17
|
-
}
|
|
@@ -1,64 +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.AlienBaseV3 = exports.AlienBaseV3Config = void 0;
|
|
7
|
-
const abi_1 = require("@ethersproject/abi");
|
|
8
|
-
const constants_1 = require("../../../../constants");
|
|
9
|
-
const utils_1 = require("../../../../utils");
|
|
10
|
-
const types_1 = require("../../types");
|
|
11
|
-
const uniswap_v3_1 = require("../../uniswap-v3");
|
|
12
|
-
const AlienBaseV3Router_abi_json_1 = __importDefault(require("../../../../abi/uniswap-v3/AlienBaseV3Router.abi.json"));
|
|
13
|
-
exports.AlienBaseV3Config = {
|
|
14
|
-
AlienBaseV3: {
|
|
15
|
-
[constants_1.Network.BASE]: {
|
|
16
|
-
factory: '0x0Fd83557b2be93617c9C1C1B6fd549401C74558C',
|
|
17
|
-
quoter: '0x4fDBD73aD4B1DDde594BF05497C15f76308eFfb9',
|
|
18
|
-
router: '0xB20C411FC84FBB27e78608C24d0056D974ea9411',
|
|
19
|
-
supportedFees: [10000n, 3000n, 750n, 200n],
|
|
20
|
-
stateMulticall: '0x7160f736c52e1e78e92FD4eE4D73e21A7Cf4F950',
|
|
21
|
-
uniswapMulticall: '0x091e99cb1C49331a94dD62755D168E941AbD0693',
|
|
22
|
-
chunksCount: 10,
|
|
23
|
-
initRetryFrequency: 10,
|
|
24
|
-
initHash: `0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54`,
|
|
25
|
-
subgraphURL: 'https://api.studio.thegraph.com/query/59130/v3alb/0.3',
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
};
|
|
29
|
-
class AlienBaseV3 extends uniswap_v3_1.UniswapV3 {
|
|
30
|
-
constructor(network, dexKey, dexHelper) {
|
|
31
|
-
super(network, dexKey, dexHelper, {}, new abi_1.Interface(AlienBaseV3Router_abi_json_1.default), undefined, exports.AlienBaseV3Config[dexKey][network]);
|
|
32
|
-
this.network = network;
|
|
33
|
-
this.dexHelper = dexHelper;
|
|
34
|
-
}
|
|
35
|
-
static getDirectFunctionName() {
|
|
36
|
-
return [];
|
|
37
|
-
}
|
|
38
|
-
async getSimpleParam(srcToken, destToken, srcAmount, destAmount, data, side) {
|
|
39
|
-
const swapFunction = side === constants_1.SwapSide.SELL
|
|
40
|
-
? types_1.UniswapV3Functions.exactInput
|
|
41
|
-
: types_1.UniswapV3Functions.exactOutput;
|
|
42
|
-
const path = this._encodePath(data.path, side);
|
|
43
|
-
const swapFunctionParams = side === constants_1.SwapSide.SELL
|
|
44
|
-
? {
|
|
45
|
-
recipient: this.augustusAddress,
|
|
46
|
-
amountIn: srcAmount,
|
|
47
|
-
amountOutMinimum: destAmount,
|
|
48
|
-
path,
|
|
49
|
-
}
|
|
50
|
-
: {
|
|
51
|
-
recipient: this.augustusAddress,
|
|
52
|
-
amountOut: destAmount,
|
|
53
|
-
amountInMaximum: srcAmount,
|
|
54
|
-
path,
|
|
55
|
-
};
|
|
56
|
-
const swapData = this.routerIface.encodeFunctionData(swapFunction, [
|
|
57
|
-
swapFunctionParams,
|
|
58
|
-
]);
|
|
59
|
-
return this.buildSimpleParamWithoutWETHConversion(srcToken, srcAmount, destToken, destAmount, swapData, this.config.router);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
exports.AlienBaseV3 = AlienBaseV3;
|
|
63
|
-
AlienBaseV3.dexKeysWithNetwork = (0, utils_1.getDexKeysWithNetwork)(exports.AlienBaseV3Config);
|
|
64
|
-
//# sourceMappingURL=alien-base-v3.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"alien-base-v3.js","sourceRoot":"","sources":["../../../../../src/dex/uniswap-v3/forks/alien-base-v3/alien-base-v3.ts"],"names":[],"mappings":";;;;;;AAAA,4CAA+C;AAC/C,qDAA0D;AAG1D,6CAA0D;AAC1D,uCAMqB;AACrB,iDAA6C;AAC7C,uHAAyF;AAE5E,QAAA,iBAAiB,GAA4B;IACxD,WAAW,EAAE;QACX,CAAC,mBAAO,CAAC,IAAI,CAAC,EAAE;YACd,OAAO,EAAE,4CAA4C;YACrD,MAAM,EAAE,4CAA4C;YACpD,MAAM,EAAE,4CAA4C;YACpD,aAAa,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC;YAC1C,cAAc,EAAE,4CAA4C;YAC5D,gBAAgB,EAAE,4CAA4C;YAC9D,WAAW,EAAE,EAAE;YACf,kBAAkB,EAAE,EAAE;YACtB,QAAQ,EAAE,oEAAoE;YAC9E,WAAW,EAAE,uDAAuD;SAC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T,UAAU,EACV,QAAQ,EACR,IAAI,CAAC,MAAM,CAAC,MAAM,CACnB,CAAC;IACJ,CAAC;;AAjEH,kCAkEC;AAjEe,8BAAkB,GAC9B,IAAA,6BAAqB,EAAC,yBAAiB,CAAC,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Network, SwapSide } from '../../../../constants';
|
|
2
|
-
import { IDexHelper } from '../../../../dex-helper';
|
|
3
|
-
import { DexConfigMap, SimpleExchangeParam } from '../../../../types';
|
|
4
|
-
import { DexParams, UniswapV3Data } from '../../types';
|
|
5
|
-
import { UniswapV3 } from '../../uniswap-v3';
|
|
6
|
-
export declare const AlienBaseV3Config: DexConfigMap<DexParams>;
|
|
7
|
-
export declare class AlienV3 extends UniswapV3 {
|
|
8
|
-
protected network: Network;
|
|
9
|
-
protected dexHelper: IDexHelper;
|
|
10
|
-
static dexKeysWithNetwork: {
|
|
11
|
-
key: string;
|
|
12
|
-
networks: Network[];
|
|
13
|
-
}[];
|
|
14
|
-
constructor(network: Network, dexKey: string, dexHelper: IDexHelper);
|
|
15
|
-
static getDirectFunctionName(): string[];
|
|
16
|
-
getSimpleParam(srcToken: string, destToken: string, srcAmount: string, destAmount: string, data: UniswapV3Data, side: SwapSide): Promise<SimpleExchangeParam>;
|
|
17
|
-
}
|