@paraswap/dex-lib 4.0.22 → 4.0.23
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/balancer-v2/config.js +1 -1
- package/build/dex/balancer-v2/config.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/generic-rfq/e2e-test-config.js +3 -3
- package/build/dex/generic-rfq/e2e-test-config.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/maverick-v1/config.js +1 -1
- package/build/dex/maverick-v1/config.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/uniswap-v3/config.js +1 -1
- package/build/dex/uniswap-v3/config.js.map +1 -1
- 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/package.json +1 -1
- package/src/dex/balancer-v2/balancer-v2-e2e.test.ts +165 -102
- package/src/dex/balancer-v2/balancer-v2-integration.test.ts +238 -80
- package/src/dex/balancer-v2/config.ts +1 -2
- package/src/dex/generic-rfq/e2e-test-config.ts +3 -3
- package/src/dex/generic-rfq/generic-rfq-e2e.test.ts +2 -2
- package/src/dex/maverick-v1/config.ts +1 -2
- package/src/dex/uniswap-v3/config.ts +1 -2
- package/tests/constants-e2e.ts +1 -1
- package/tests/smart-tokens.ts +1 -3
- package/tests/tenderly-simulation.ts +149 -84
- package/tests/utils-e2e.ts +5 -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/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/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-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
|
@@ -23,35 +23,36 @@ function testForNetwork(
|
|
|
23
23
|
tokenAAmount: string,
|
|
24
24
|
tokenBAmount: string,
|
|
25
25
|
nativeTokenAmount: string,
|
|
26
|
-
|
|
26
|
+
excludeNativeTokenTests: boolean = false,
|
|
27
27
|
) {
|
|
28
|
+
const config = generateConfig(network);
|
|
28
29
|
const provider = new StaticJsonRpcProvider(
|
|
29
|
-
|
|
30
|
+
config.privateHttpProvider,
|
|
30
31
|
network,
|
|
31
32
|
);
|
|
32
33
|
const tokens = Tokens[network];
|
|
33
34
|
const holders = Holders[network];
|
|
34
35
|
const nativeTokenSymbol = NativeTokenSymbols[network];
|
|
36
|
+
const sleepMs = 10000;
|
|
35
37
|
|
|
36
38
|
const sideToContractMethods = new Map([
|
|
37
39
|
[
|
|
38
40
|
SwapSide.SELL,
|
|
39
41
|
[
|
|
40
|
-
// ContractMethod.simpleSwap,
|
|
41
|
-
// ContractMethod.multiSwap,
|
|
42
|
-
// ContractMethod.megaSwap,
|
|
43
42
|
ContractMethod.swapExactAmountIn,
|
|
44
43
|
ContractMethod.swapExactAmountInOnBalancerV2,
|
|
44
|
+
// ContractMethod.simpleSwap,
|
|
45
|
+
// ContractMethod.megaSwap,
|
|
46
|
+
// ContractMethod.multiSwap,
|
|
45
47
|
],
|
|
46
48
|
],
|
|
47
49
|
[
|
|
48
50
|
SwapSide.BUY,
|
|
49
51
|
[
|
|
50
|
-
// ContractMethod.simpleBuy,
|
|
51
|
-
// ContractMethod.buy,
|
|
52
|
-
// DirectMethodsV6.directBuy,
|
|
53
52
|
ContractMethod.swapExactAmountOut,
|
|
54
53
|
ContractMethod.swapExactAmountOutOnBalancerV2,
|
|
54
|
+
// ContractMethod.simpleBuy,
|
|
55
|
+
// ContractMethod.buy,
|
|
55
56
|
],
|
|
56
57
|
],
|
|
57
58
|
]);
|
|
@@ -59,59 +60,119 @@ function testForNetwork(
|
|
|
59
60
|
describe(`${network}`, () => {
|
|
60
61
|
sideToContractMethods.forEach((contractMethods, side) =>
|
|
61
62
|
describe(`${side}`, () => {
|
|
62
|
-
contractMethods.forEach((contractMethod:
|
|
63
|
+
contractMethods.forEach((contractMethod: ContractMethod) => {
|
|
63
64
|
describe(`${contractMethod}`, () => {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
65
|
+
if (excludeNativeTokenTests) {
|
|
66
|
+
it(`${tokenASymbol} -> ${tokenBSymbol}`, async () => {
|
|
67
|
+
await testE2E(
|
|
68
|
+
tokens[tokenASymbol],
|
|
69
|
+
tokens[tokenBSymbol],
|
|
70
|
+
holders[tokenASymbol],
|
|
71
|
+
side === SwapSide.SELL ? tokenAAmount : tokenBAmount,
|
|
72
|
+
side,
|
|
73
|
+
dexKey,
|
|
74
|
+
contractMethod,
|
|
75
|
+
network,
|
|
76
|
+
provider,
|
|
77
|
+
undefined,
|
|
78
|
+
undefined,
|
|
79
|
+
undefined,
|
|
80
|
+
undefined,
|
|
81
|
+
sleepMs,
|
|
82
|
+
);
|
|
83
|
+
});
|
|
84
|
+
it(`${tokenBSymbol} -> ${tokenASymbol}`, async () => {
|
|
85
|
+
await testE2E(
|
|
86
|
+
tokens[tokenBSymbol],
|
|
87
|
+
tokens[tokenASymbol],
|
|
88
|
+
holders[tokenBSymbol],
|
|
89
|
+
side === SwapSide.SELL ? tokenBAmount : tokenAAmount,
|
|
90
|
+
side,
|
|
91
|
+
dexKey,
|
|
92
|
+
contractMethod,
|
|
93
|
+
network,
|
|
94
|
+
provider,
|
|
95
|
+
undefined,
|
|
96
|
+
undefined,
|
|
97
|
+
undefined,
|
|
98
|
+
undefined,
|
|
99
|
+
sleepMs,
|
|
100
|
+
);
|
|
101
|
+
});
|
|
102
|
+
} else {
|
|
103
|
+
it(`${nativeTokenSymbol} -> ${tokenASymbol}`, async () => {
|
|
104
|
+
await testE2E(
|
|
105
|
+
tokens[nativeTokenSymbol],
|
|
106
|
+
tokens[tokenASymbol],
|
|
107
|
+
holders[nativeTokenSymbol],
|
|
108
|
+
side === SwapSide.SELL ? nativeTokenAmount : tokenAAmount,
|
|
109
|
+
side,
|
|
110
|
+
dexKey,
|
|
111
|
+
contractMethod,
|
|
112
|
+
network,
|
|
113
|
+
provider,
|
|
114
|
+
undefined,
|
|
115
|
+
undefined,
|
|
116
|
+
undefined,
|
|
117
|
+
undefined,
|
|
118
|
+
sleepMs,
|
|
119
|
+
);
|
|
120
|
+
});
|
|
121
|
+
it(`${tokenASymbol} -> ${nativeTokenSymbol}`, async () => {
|
|
122
|
+
await testE2E(
|
|
123
|
+
tokens[tokenASymbol],
|
|
124
|
+
tokens[nativeTokenSymbol],
|
|
125
|
+
holders[tokenASymbol],
|
|
126
|
+
side === SwapSide.SELL ? tokenAAmount : nativeTokenAmount,
|
|
127
|
+
side,
|
|
128
|
+
dexKey,
|
|
129
|
+
contractMethod,
|
|
130
|
+
network,
|
|
131
|
+
provider,
|
|
132
|
+
undefined,
|
|
133
|
+
undefined,
|
|
134
|
+
undefined,
|
|
135
|
+
undefined,
|
|
136
|
+
sleepMs,
|
|
137
|
+
);
|
|
138
|
+
});
|
|
139
|
+
it(`${tokenASymbol} -> ${tokenBSymbol}`, async () => {
|
|
140
|
+
await testE2E(
|
|
141
|
+
tokens[tokenASymbol],
|
|
142
|
+
tokens[tokenBSymbol],
|
|
143
|
+
holders[tokenASymbol],
|
|
144
|
+
side === SwapSide.SELL ? tokenAAmount : tokenBAmount,
|
|
145
|
+
side,
|
|
146
|
+
dexKey,
|
|
147
|
+
contractMethod,
|
|
148
|
+
network,
|
|
149
|
+
provider,
|
|
150
|
+
undefined,
|
|
151
|
+
undefined,
|
|
152
|
+
undefined,
|
|
153
|
+
undefined,
|
|
154
|
+
sleepMs,
|
|
155
|
+
);
|
|
156
|
+
});
|
|
157
|
+
it(`${tokenBSymbol} -> ${tokenASymbol}`, async () => {
|
|
158
|
+
await testE2E(
|
|
159
|
+
tokens[tokenBSymbol],
|
|
160
|
+
tokens[tokenASymbol],
|
|
161
|
+
holders[tokenBSymbol],
|
|
162
|
+
side === SwapSide.SELL ? tokenBAmount : tokenAAmount,
|
|
163
|
+
side,
|
|
164
|
+
dexKey,
|
|
165
|
+
contractMethod,
|
|
166
|
+
network,
|
|
167
|
+
provider,
|
|
168
|
+
undefined,
|
|
169
|
+
undefined,
|
|
170
|
+
undefined,
|
|
171
|
+
undefined,
|
|
172
|
+
sleepMs,
|
|
173
|
+
);
|
|
174
|
+
});
|
|
175
|
+
}
|
|
115
176
|
});
|
|
116
177
|
});
|
|
117
178
|
}),
|
|
@@ -120,7 +181,7 @@ function testForNetwork(
|
|
|
120
181
|
}
|
|
121
182
|
|
|
122
183
|
describe('BalancerV2 E2E', () => {
|
|
123
|
-
describe('
|
|
184
|
+
describe('Mainnet', () => {
|
|
124
185
|
const dexKey = 'BalancerV2';
|
|
125
186
|
const network = Network.MAINNET;
|
|
126
187
|
const tokens = Tokens[Network.MAINNET];
|
|
@@ -130,7 +191,7 @@ describe('BalancerV2 E2E', () => {
|
|
|
130
191
|
network,
|
|
131
192
|
);
|
|
132
193
|
|
|
133
|
-
describe
|
|
194
|
+
describe('GHO -> USDT', () => {
|
|
134
195
|
const pairs: { name: string; sellAmount: string; buyAmount: string }[][] =
|
|
135
196
|
[
|
|
136
197
|
[
|
|
@@ -796,7 +857,7 @@ describe('BalancerV2 E2E', () => {
|
|
|
796
857
|
*/
|
|
797
858
|
});
|
|
798
859
|
|
|
799
|
-
describe('
|
|
860
|
+
describe('Polygon_v6', () => {
|
|
800
861
|
const dexKey = 'BalancerV2';
|
|
801
862
|
const network = Network.POLYGON;
|
|
802
863
|
const tokens = Tokens[Network.POLYGON];
|
|
@@ -909,7 +970,7 @@ describe('BalancerV2 E2E', () => {
|
|
|
909
970
|
});
|
|
910
971
|
});
|
|
911
972
|
|
|
912
|
-
describe('
|
|
973
|
+
describe('Arbitrum', () => {
|
|
913
974
|
const dexKey = 'BalancerV2';
|
|
914
975
|
const network = Network.ARBITRUM;
|
|
915
976
|
const tokens = Tokens[Network.ARBITRUM];
|
|
@@ -1087,7 +1148,7 @@ describe('BalancerV2 E2E', () => {
|
|
|
1087
1148
|
});
|
|
1088
1149
|
});
|
|
1089
1150
|
|
|
1090
|
-
describe('
|
|
1151
|
+
describe('Fantom', () => {
|
|
1091
1152
|
const dexKey = 'BeetsFi';
|
|
1092
1153
|
const network = Network.FANTOM;
|
|
1093
1154
|
const tokens = Tokens[network];
|
|
@@ -1208,7 +1269,7 @@ describe('BalancerV2 E2E', () => {
|
|
|
1208
1269
|
});
|
|
1209
1270
|
});
|
|
1210
1271
|
|
|
1211
|
-
describe('
|
|
1272
|
+
describe('Polygon', () => {
|
|
1212
1273
|
const dexKey = 'BalancerV2';
|
|
1213
1274
|
const network = Network.POLYGON;
|
|
1214
1275
|
const tokens = Tokens[Network.POLYGON];
|
|
@@ -1302,7 +1363,7 @@ describe('BalancerV2 E2E', () => {
|
|
|
1302
1363
|
});
|
|
1303
1364
|
});
|
|
1304
1365
|
|
|
1305
|
-
describe('
|
|
1366
|
+
describe('Avalanche', () => {
|
|
1306
1367
|
const dexKey = 'BalancerV2';
|
|
1307
1368
|
const network = Network.AVALANCHE;
|
|
1308
1369
|
const tokens = Tokens[Network.AVALANCHE];
|
|
@@ -1478,51 +1539,53 @@ describe('BalancerV2 E2E', () => {
|
|
|
1478
1539
|
});
|
|
1479
1540
|
});
|
|
1480
1541
|
|
|
1481
|
-
describe('
|
|
1542
|
+
describe('Base', () => {
|
|
1482
1543
|
const dexKey = 'BalancerV2';
|
|
1483
1544
|
const network = Network.BASE;
|
|
1484
1545
|
|
|
1485
|
-
|
|
1486
|
-
|
|
1546
|
+
describe('USDC -> GOLD', () => {
|
|
1547
|
+
const tokenASymbol: string = 'USDC';
|
|
1548
|
+
const tokenBSymbol: string = 'GOLD';
|
|
1487
1549
|
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1550
|
+
const tokenAAmount: string = '11110010';
|
|
1551
|
+
const tokenBAmount: string = '210000000000000000000';
|
|
1552
|
+
const nativeTokenAmount = '1000000000000000000';
|
|
1491
1553
|
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
describe('BalancerV2_MAINNET', () => {
|
|
1504
|
-
const dexKey = 'BalancerV2';
|
|
1505
|
-
const network = Network.MAINNET;
|
|
1554
|
+
testForNetwork(
|
|
1555
|
+
network,
|
|
1556
|
+
dexKey,
|
|
1557
|
+
tokenASymbol,
|
|
1558
|
+
tokenBSymbol,
|
|
1559
|
+
tokenAAmount,
|
|
1560
|
+
tokenBAmount,
|
|
1561
|
+
nativeTokenAmount,
|
|
1562
|
+
);
|
|
1563
|
+
});
|
|
1506
1564
|
|
|
1507
|
-
|
|
1508
|
-
|
|
1565
|
+
describe('WETH -> USDC', () => {
|
|
1566
|
+
const tokenASymbol: string = 'WETH';
|
|
1567
|
+
const tokenBSymbol: string = 'USDC';
|
|
1509
1568
|
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1569
|
+
// const tokenAAmount: string = '375699066125449';
|
|
1570
|
+
const tokenAAmount: string = '300000000000000';
|
|
1571
|
+
// const tokenBAmount: string = '1196427';
|
|
1572
|
+
const tokenBAmount: string = '1000000';
|
|
1573
|
+
const nativeTokenAmount = '1000000000000000000';
|
|
1513
1574
|
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1575
|
+
testForNetwork(
|
|
1576
|
+
network,
|
|
1577
|
+
dexKey,
|
|
1578
|
+
tokenASymbol,
|
|
1579
|
+
tokenBSymbol,
|
|
1580
|
+
tokenAAmount,
|
|
1581
|
+
tokenBAmount,
|
|
1582
|
+
nativeTokenAmount,
|
|
1583
|
+
true,
|
|
1584
|
+
);
|
|
1585
|
+
});
|
|
1523
1586
|
});
|
|
1524
1587
|
|
|
1525
|
-
describe('
|
|
1588
|
+
describe('Gnosis', () => {
|
|
1526
1589
|
const dexKey = 'BalancerV2';
|
|
1527
1590
|
const network = Network.GNOSIS;
|
|
1528
1591
|
|