@paraswap/dex-lib 2.13.0 → 2.14.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/config.js +5 -23
- package/build/config.js.map +1 -1
- package/build/dex/curve-v1/config.js +0 -2
- package/build/dex/curve-v1/config.js.map +1 -1
- package/build/dex/curve-v1/curve-v1.js +0 -2
- package/build/dex/curve-v1/curve-v1.js.map +1 -1
- package/build/dex/curve-v1/types.d.ts +0 -1
- package/build/dex/curve-v1/types.js.map +1 -1
- package/build/dex/index.js +2 -2
- package/build/dex/index.js.map +1 -1
- package/build/dex/simple-exchange.d.ts +0 -1
- package/build/dex/simple-exchange.js +1 -3
- package/build/dex/simple-exchange.js.map +1 -1
- package/build/lib/decoders.d.ts +1 -2
- package/build/lib/decoders.js +1 -8
- package/build/lib/decoders.js.map +1 -1
- package/build/lib/multi-wrapper.d.ts +1 -2
- package/build/lib/multi-wrapper.js.map +1 -1
- package/build/lib/tokens/balancer-fetcher.js +5 -4
- package/build/lib/tokens/balancer-fetcher.js.map +1 -1
- package/build/lib/tokens/utils.d.ts +2 -2
- package/build/lib/tokens/utils.js +1 -1
- package/build/lib/tokens/utils.js.map +1 -1
- package/build/types.d.ts +0 -3
- package/dex-template/__DexName__-e2e.test.ts.template +0 -1
- package/dex-template/__DexName__-events.test.ts.template +0 -1
- package/dex-template/__DexName__-integration.test.ts.template +0 -1
- package/dex-template/__DexName__-pool.ts.template +5 -8
- package/package.json +1 -1
- package/scripts/generate-bytecode.ts +0 -2
- package/src/abi/woo-fi/WooFeeManager.abi.json +318 -0
- package/src/abi/{woo-fi-v2/WooPPV2.abi.json → woo-fi/WooPP.abi.json} +169 -201
- package/src/abi/{woo-fi-v2/WooOracleV2.abi.json → woo-fi/Wooracle.abi.json} +50 -148
- package/src/config.ts +5 -27
- package/src/dex/balancer-v2/balancer-v2-e2e.test.ts +1 -0
- package/src/dex/curve-v1/config.ts +0 -2
- package/src/dex/curve-v1/curve-v1-e2e.test.ts +37 -18
- package/src/dex/curve-v1/curve-v1.ts +0 -2
- package/src/dex/curve-v1/types.ts +0 -1
- package/src/dex/index.ts +2 -2
- package/src/dex/simple-exchange.ts +1 -4
- package/src/dex/woo-fi/config.ts +141 -0
- package/src/dex/woo-fi/constants.ts +21 -0
- package/src/dex/woo-fi/types.ts +55 -0
- package/src/dex/woo-fi/woo-fi-decimal-math.ts +45 -0
- package/src/dex/woo-fi/woo-fi-e2e.test.ts +183 -0
- package/src/dex/woo-fi/woo-fi-integration.test.ts +416 -0
- package/src/dex/woo-fi/woo-fi-math.ts +527 -0
- package/src/dex/woo-fi/woo-fi.ts +693 -0
- package/src/lib/decoders.ts +1 -12
- package/src/lib/multi-wrapper.ts +1 -2
- package/src/lib/tokens/balancer-fetcher.ts +6 -5
- package/src/lib/tokens/utils.ts +3 -5
- package/src/types.ts +0 -4
- package/tests/constants-e2e.ts +9 -9
- package/tests/tenderly-simulation.ts +1 -1
- package/tests/utils-e2e.ts +0 -2
- package/tests/utils.ts +0 -2
- package/src/abi/woo-fi-v2/IntegrationHelper.abi.json +0 -116
- package/src/dex/woo-fi-v2/config.ts +0 -87
- package/src/dex/woo-fi-v2/constants.ts +0 -22
- package/src/dex/woo-fi-v2/decoders.ts +0 -45
- package/src/dex/woo-fi-v2/types.ts +0 -63
- package/src/dex/woo-fi-v2/utils.ts +0 -19
- package/src/dex/woo-fi-v2/woo-fi-v2-e2e.test.ts +0 -216
- package/src/dex/woo-fi-v2/woo-fi-v2-integration.test.ts +0 -495
- package/src/dex/woo-fi-v2/woo-fi-v2-math.ts +0 -195
- package/src/dex/woo-fi-v2/woo-fi-v2-pool.ts +0 -112
- package/src/dex/woo-fi-v2/woo-fi-v2.ts +0 -487
- package/src/lib/log-messages-suppressor.ts +0 -173
- package/src/lib/stateful-rpc-poller/state-polling-manager.ts +0 -320
- package/src/lib/stateful-rpc-poller/stateful-rpc-poller.ts +0 -604
- package/src/lib/stateful-rpc-poller/types.ts +0 -66
- package/src/lib/stateful-rpc-poller/utils.ts +0 -23
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
[
|
|
2
2
|
{ "inputs": [], "stateMutability": "nonpayable", "type": "constructor" },
|
|
3
|
+
{
|
|
4
|
+
"anonymous": false,
|
|
5
|
+
"inputs": [
|
|
6
|
+
{
|
|
7
|
+
"indexed": true,
|
|
8
|
+
"internalType": "address",
|
|
9
|
+
"name": "previousOwner",
|
|
10
|
+
"type": "address"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"indexed": true,
|
|
14
|
+
"internalType": "address",
|
|
15
|
+
"name": "newOwner",
|
|
16
|
+
"type": "address"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"name": "OwnershipTransferPrepared",
|
|
20
|
+
"type": "event"
|
|
21
|
+
},
|
|
3
22
|
{
|
|
4
23
|
"anonymous": false,
|
|
5
24
|
"inputs": [
|
|
@@ -21,30 +40,31 @@
|
|
|
21
40
|
},
|
|
22
41
|
{
|
|
23
42
|
"inputs": [],
|
|
24
|
-
"name": "
|
|
25
|
-
"outputs": [{ "internalType": "
|
|
43
|
+
"name": "_NEW_OWNER_",
|
|
44
|
+
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
|
|
26
45
|
"stateMutability": "view",
|
|
27
46
|
"type": "function"
|
|
28
47
|
},
|
|
29
48
|
{
|
|
30
|
-
"inputs": [
|
|
31
|
-
"name": "
|
|
32
|
-
"outputs": [
|
|
33
|
-
{ "internalType": "address", "name": "oracle", "type": "address" },
|
|
34
|
-
{ "internalType": "uint8", "name": "decimal", "type": "uint8" },
|
|
35
|
-
{ "internalType": "bool", "name": "cloPreferred", "type": "bool" }
|
|
36
|
-
],
|
|
49
|
+
"inputs": [],
|
|
50
|
+
"name": "_OWNER_",
|
|
51
|
+
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
|
|
37
52
|
"stateMutability": "view",
|
|
38
53
|
"type": "function"
|
|
39
54
|
},
|
|
55
|
+
{
|
|
56
|
+
"inputs": [],
|
|
57
|
+
"name": "claimOwnership",
|
|
58
|
+
"outputs": [],
|
|
59
|
+
"stateMutability": "nonpayable",
|
|
60
|
+
"type": "function"
|
|
61
|
+
},
|
|
40
62
|
{
|
|
41
63
|
"inputs": [
|
|
42
64
|
{ "internalType": "address", "name": "base", "type": "address" }
|
|
43
65
|
],
|
|
44
|
-
"name": "
|
|
45
|
-
"outputs": [
|
|
46
|
-
{ "internalType": "address", "name": "clo", "type": "address" }
|
|
47
|
-
],
|
|
66
|
+
"name": "getCoeff",
|
|
67
|
+
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
|
48
68
|
"stateMutability": "view",
|
|
49
69
|
"type": "function"
|
|
50
70
|
},
|
|
@@ -52,11 +72,8 @@
|
|
|
52
72
|
"inputs": [
|
|
53
73
|
{ "internalType": "address", "name": "base", "type": "address" }
|
|
54
74
|
],
|
|
55
|
-
"name": "
|
|
56
|
-
"outputs": [
|
|
57
|
-
{ "internalType": "uint256", "name": "", "type": "uint256" },
|
|
58
|
-
{ "internalType": "uint256", "name": "", "type": "uint256" }
|
|
59
|
-
],
|
|
75
|
+
"name": "getPrice",
|
|
76
|
+
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
|
60
77
|
"stateMutability": "view",
|
|
61
78
|
"type": "function"
|
|
62
79
|
},
|
|
@@ -64,8 +81,8 @@
|
|
|
64
81
|
"inputs": [
|
|
65
82
|
{ "internalType": "address", "name": "base", "type": "address" }
|
|
66
83
|
],
|
|
67
|
-
"name": "
|
|
68
|
-
"outputs": [{ "internalType": "
|
|
84
|
+
"name": "getSpread",
|
|
85
|
+
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
|
69
86
|
"stateMutability": "view",
|
|
70
87
|
"type": "function"
|
|
71
88
|
},
|
|
@@ -81,28 +98,23 @@
|
|
|
81
98
|
"type": "function"
|
|
82
99
|
},
|
|
83
100
|
{
|
|
84
|
-
"inputs": [
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
"
|
|
101
|
+
"inputs": [
|
|
102
|
+
{ "internalType": "address", "name": "newOwner", "type": "address" }
|
|
103
|
+
],
|
|
104
|
+
"name": "initOwner",
|
|
105
|
+
"outputs": [],
|
|
106
|
+
"stateMutability": "nonpayable",
|
|
88
107
|
"type": "function"
|
|
89
108
|
},
|
|
90
109
|
{
|
|
91
110
|
"inputs": [
|
|
92
111
|
{ "internalType": "address", "name": "base", "type": "address" }
|
|
93
112
|
],
|
|
94
|
-
"name": "
|
|
113
|
+
"name": "isFeasible",
|
|
95
114
|
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
|
|
96
115
|
"stateMutability": "view",
|
|
97
116
|
"type": "function"
|
|
98
117
|
},
|
|
99
|
-
{
|
|
100
|
-
"inputs": [],
|
|
101
|
-
"name": "owner",
|
|
102
|
-
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
|
|
103
|
-
"stateMutability": "view",
|
|
104
|
-
"type": "function"
|
|
105
|
-
},
|
|
106
118
|
{
|
|
107
119
|
"inputs": [
|
|
108
120
|
{ "internalType": "address", "name": "base", "type": "address" },
|
|
@@ -173,7 +185,7 @@
|
|
|
173
185
|
],
|
|
174
186
|
"name": "price",
|
|
175
187
|
"outputs": [
|
|
176
|
-
{ "internalType": "uint256", "name": "
|
|
188
|
+
{ "internalType": "uint256", "name": "priceNow", "type": "uint256" },
|
|
177
189
|
{ "internalType": "bool", "name": "feasible", "type": "bool" }
|
|
178
190
|
],
|
|
179
191
|
"stateMutability": "view",
|
|
@@ -186,57 +198,9 @@
|
|
|
186
198
|
"stateMutability": "view",
|
|
187
199
|
"type": "function"
|
|
188
200
|
},
|
|
189
|
-
{
|
|
190
|
-
"inputs": [],
|
|
191
|
-
"name": "renounceOwnership",
|
|
192
|
-
"outputs": [],
|
|
193
|
-
"stateMutability": "nonpayable",
|
|
194
|
-
"type": "function"
|
|
195
|
-
},
|
|
196
|
-
{
|
|
197
|
-
"inputs": [
|
|
198
|
-
{ "internalType": "address", "name": "addr", "type": "address" },
|
|
199
|
-
{ "internalType": "bool", "name": "flag", "type": "bool" }
|
|
200
|
-
],
|
|
201
|
-
"name": "setAdmin",
|
|
202
|
-
"outputs": [],
|
|
203
|
-
"stateMutability": "nonpayable",
|
|
204
|
-
"type": "function"
|
|
205
|
-
},
|
|
206
|
-
{
|
|
207
|
-
"inputs": [
|
|
208
|
-
{ "internalType": "uint64", "name": "_bound", "type": "uint64" }
|
|
209
|
-
],
|
|
210
|
-
"name": "setBound",
|
|
211
|
-
"outputs": [],
|
|
212
|
-
"stateMutability": "nonpayable",
|
|
213
|
-
"type": "function"
|
|
214
|
-
},
|
|
215
|
-
{
|
|
216
|
-
"inputs": [
|
|
217
|
-
{ "internalType": "address", "name": "token", "type": "address" },
|
|
218
|
-
{ "internalType": "address", "name": "_oracle", "type": "address" },
|
|
219
|
-
{ "internalType": "bool", "name": "_cloPreferred", "type": "bool" }
|
|
220
|
-
],
|
|
221
|
-
"name": "setCLOracle",
|
|
222
|
-
"outputs": [],
|
|
223
|
-
"stateMutability": "nonpayable",
|
|
224
|
-
"type": "function"
|
|
225
|
-
},
|
|
226
|
-
{
|
|
227
|
-
"inputs": [
|
|
228
|
-
{ "internalType": "address", "name": "token", "type": "address" },
|
|
229
|
-
{ "internalType": "bool", "name": "_cloPreferred", "type": "bool" }
|
|
230
|
-
],
|
|
231
|
-
"name": "setCloPreferred",
|
|
232
|
-
"outputs": [],
|
|
233
|
-
"stateMutability": "nonpayable",
|
|
234
|
-
"type": "function"
|
|
235
|
-
},
|
|
236
201
|
{
|
|
237
202
|
"inputs": [
|
|
238
|
-
{ "internalType": "address", "name": "
|
|
239
|
-
{ "internalType": "address", "name": "_oracle", "type": "address" }
|
|
203
|
+
{ "internalType": "address", "name": "newQuoteToken", "type": "address" }
|
|
240
204
|
],
|
|
241
205
|
"name": "setQuoteToken",
|
|
242
206
|
"outputs": [],
|
|
@@ -269,17 +233,10 @@
|
|
|
269
233
|
],
|
|
270
234
|
"name": "state",
|
|
271
235
|
"outputs": [
|
|
272
|
-
{
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
{ "internalType": "uint64", "name": "coeff", "type": "uint64" },
|
|
277
|
-
{ "internalType": "bool", "name": "woFeasible", "type": "bool" }
|
|
278
|
-
],
|
|
279
|
-
"internalType": "struct IWooracleV2.State",
|
|
280
|
-
"name": "",
|
|
281
|
-
"type": "tuple"
|
|
282
|
-
}
|
|
236
|
+
{ "internalType": "uint256", "name": "priceNow", "type": "uint256" },
|
|
237
|
+
{ "internalType": "uint256", "name": "spreadNow", "type": "uint256" },
|
|
238
|
+
{ "internalType": "uint256", "name": "coeffNow", "type": "uint256" },
|
|
239
|
+
{ "internalType": "bool", "name": "feasible", "type": "bool" }
|
|
283
240
|
],
|
|
284
241
|
"stateMutability": "view",
|
|
285
242
|
"type": "function"
|
|
@@ -299,60 +256,5 @@
|
|
|
299
256
|
"outputs": [],
|
|
300
257
|
"stateMutability": "nonpayable",
|
|
301
258
|
"type": "function"
|
|
302
|
-
},
|
|
303
|
-
{
|
|
304
|
-
"inputs": [
|
|
305
|
-
{ "internalType": "address", "name": "base", "type": "address" }
|
|
306
|
-
],
|
|
307
|
-
"name": "woCoeff",
|
|
308
|
-
"outputs": [{ "internalType": "uint64", "name": "", "type": "uint64" }],
|
|
309
|
-
"stateMutability": "view",
|
|
310
|
-
"type": "function"
|
|
311
|
-
},
|
|
312
|
-
{
|
|
313
|
-
"inputs": [
|
|
314
|
-
{ "internalType": "address", "name": "base", "type": "address" }
|
|
315
|
-
],
|
|
316
|
-
"name": "woPrice",
|
|
317
|
-
"outputs": [
|
|
318
|
-
{ "internalType": "uint128", "name": "priceOut", "type": "uint128" },
|
|
319
|
-
{
|
|
320
|
-
"internalType": "uint256",
|
|
321
|
-
"name": "priceTimestampOut",
|
|
322
|
-
"type": "uint256"
|
|
323
|
-
}
|
|
324
|
-
],
|
|
325
|
-
"stateMutability": "view",
|
|
326
|
-
"type": "function"
|
|
327
|
-
},
|
|
328
|
-
{
|
|
329
|
-
"inputs": [
|
|
330
|
-
{ "internalType": "address", "name": "base", "type": "address" }
|
|
331
|
-
],
|
|
332
|
-
"name": "woSpread",
|
|
333
|
-
"outputs": [{ "internalType": "uint64", "name": "", "type": "uint64" }],
|
|
334
|
-
"stateMutability": "view",
|
|
335
|
-
"type": "function"
|
|
336
|
-
},
|
|
337
|
-
{
|
|
338
|
-
"inputs": [
|
|
339
|
-
{ "internalType": "address", "name": "base", "type": "address" }
|
|
340
|
-
],
|
|
341
|
-
"name": "woState",
|
|
342
|
-
"outputs": [
|
|
343
|
-
{
|
|
344
|
-
"components": [
|
|
345
|
-
{ "internalType": "uint128", "name": "price", "type": "uint128" },
|
|
346
|
-
{ "internalType": "uint64", "name": "spread", "type": "uint64" },
|
|
347
|
-
{ "internalType": "uint64", "name": "coeff", "type": "uint64" },
|
|
348
|
-
{ "internalType": "bool", "name": "woFeasible", "type": "bool" }
|
|
349
|
-
],
|
|
350
|
-
"internalType": "struct IWooracleV2.State",
|
|
351
|
-
"name": "",
|
|
352
|
-
"type": "tuple"
|
|
353
|
-
}
|
|
354
|
-
],
|
|
355
|
-
"stateMutability": "view",
|
|
356
|
-
"type": "function"
|
|
357
259
|
}
|
|
358
260
|
]
|
package/src/config.ts
CHANGED
|
@@ -25,8 +25,6 @@ type BaseConfig = {
|
|
|
25
25
|
uniswapV2ExchangeRouterAddress: Address;
|
|
26
26
|
uniswapV3EventLoggingSampleRate?: number;
|
|
27
27
|
rfqConfigs: Record<string, RFQConfig>;
|
|
28
|
-
rpcPollingMaxAllowedStateDelayInBlocks: number;
|
|
29
|
-
rpcPollingBlocksBackToTriggerUpdate: number;
|
|
30
28
|
hashFlowAuthToken?: string;
|
|
31
29
|
hashFlowDisabledMMs: string[];
|
|
32
30
|
};
|
|
@@ -54,8 +52,6 @@ const baseConfigs: { [network: number]: BaseConfig } = {
|
|
|
54
52
|
},
|
|
55
53
|
uniswapV2ExchangeRouterAddress:
|
|
56
54
|
'0xF9234CB08edb93c0d4a4d4c70cC3FfD070e78e07',
|
|
57
|
-
rpcPollingMaxAllowedStateDelayInBlocks: 0,
|
|
58
|
-
rpcPollingBlocksBackToTriggerUpdate: 0,
|
|
59
55
|
hashFlowAuthToken: process.env.API_KEY_HASHFLOW_AUTH_TOKEN,
|
|
60
56
|
hashFlowDisabledMMs:
|
|
61
57
|
process.env[`HASHFLOW_DISABLED_MMS_1`]?.split(',') || [],
|
|
@@ -138,8 +134,6 @@ const baseConfigs: { [network: number]: BaseConfig } = {
|
|
|
138
134
|
uniswapV2ExchangeRouterAddress:
|
|
139
135
|
'0x53e693c6C7FFC4446c53B205Cf513105Bf140D7b',
|
|
140
136
|
rfqConfigs: {},
|
|
141
|
-
rpcPollingMaxAllowedStateDelayInBlocks: 5,
|
|
142
|
-
rpcPollingBlocksBackToTriggerUpdate: 3,
|
|
143
137
|
},
|
|
144
138
|
[Network.BSC]: {
|
|
145
139
|
network: Network.BSC,
|
|
@@ -161,8 +155,6 @@ const baseConfigs: { [network: number]: BaseConfig } = {
|
|
|
161
155
|
BscAdapter02: '0xe102429Ef7CAaBaAA3bc2C017aC784c5F665EE82',
|
|
162
156
|
BscBuyAdapter: '0xA7f4fBCEB76a1B1c05C106a4289C28B3b91C17ca',
|
|
163
157
|
},
|
|
164
|
-
rpcPollingMaxAllowedStateDelayInBlocks: 1,
|
|
165
|
-
rpcPollingBlocksBackToTriggerUpdate: 1,
|
|
166
158
|
uniswapV2ExchangeRouterAddress:
|
|
167
159
|
'0x53e693c6C7FFC4446c53B205Cf513105Bf140D7b',
|
|
168
160
|
rfqConfigs: {},
|
|
@@ -185,15 +177,13 @@ const baseConfigs: { [network: number]: BaseConfig } = {
|
|
|
185
177
|
process.env[`HASHFLOW_DISABLED_MMS_137`]?.split(',') || [],
|
|
186
178
|
adapterAddresses: {
|
|
187
179
|
PolygonAdapter01: '0xE44769f42E1e9592f86B82f206407a8f7C84b4ed',
|
|
188
|
-
PolygonAdapter02: '
|
|
180
|
+
PolygonAdapter02: '0x72C851edA05915F4cbbeF27E3AFd3Bc87F86b001',
|
|
189
181
|
PolygonBuyAdapter: '0xbE36ddfCDB6D60c1B20FfD73594540E5cc2c7E97',
|
|
190
182
|
},
|
|
191
183
|
uniswapV2ExchangeRouterAddress:
|
|
192
184
|
'0xf3938337F7294fEf84e9B2c6D548A93F956Cc281',
|
|
193
185
|
uniswapV3EventLoggingSampleRate: 0,
|
|
194
186
|
rfqConfigs: {},
|
|
195
|
-
rpcPollingMaxAllowedStateDelayInBlocks: 2,
|
|
196
|
-
rpcPollingBlocksBackToTriggerUpdate: 1,
|
|
197
187
|
},
|
|
198
188
|
[Network.AVALANCHE]: {
|
|
199
189
|
network: Network.AVALANCHE,
|
|
@@ -212,15 +202,13 @@ const baseConfigs: { [network: number]: BaseConfig } = {
|
|
|
212
202
|
hashFlowDisabledMMs:
|
|
213
203
|
process.env[`HASHFLOW_DISABLED_MMS_43114`]?.split(',') || [],
|
|
214
204
|
adapterAddresses: {
|
|
215
|
-
AvalancheAdapter01: '
|
|
205
|
+
AvalancheAdapter01: '0x5b99094C3c2129F17b78cE5eBD1Cd8ADB887b340',
|
|
216
206
|
AvalancheAdapter02: '0x3fd845dE49eBa45565d3b58CDEbf88d9bdA7aBf6',
|
|
217
207
|
AvalancheBuyAdapter: '0xad2f7039B0F4c410654886D049ae8406F5aDe709',
|
|
218
208
|
},
|
|
219
209
|
uniswapV2ExchangeRouterAddress:
|
|
220
210
|
'0x53e693c6C7FFC4446c53B205Cf513105Bf140D7b',
|
|
221
211
|
rfqConfigs: {},
|
|
222
|
-
rpcPollingMaxAllowedStateDelayInBlocks: 2,
|
|
223
|
-
rpcPollingBlocksBackToTriggerUpdate: 1,
|
|
224
212
|
},
|
|
225
213
|
[Network.FANTOM]: {
|
|
226
214
|
network: Network.FANTOM,
|
|
@@ -240,14 +228,12 @@ const baseConfigs: { [network: number]: BaseConfig } = {
|
|
|
240
228
|
process.env[`HASHFLOW_DISABLED_MMS_250`]?.split(',') || [],
|
|
241
229
|
|
|
242
230
|
adapterAddresses: {
|
|
243
|
-
FantomAdapter01: '
|
|
231
|
+
FantomAdapter01: '0xD9026Ca611EEC89dd4030ae86953F2d8D899535c',
|
|
244
232
|
FantomBuyAdapter: '0x27eb327B7255a2bF666EBB4D60AB4752dA4611b9',
|
|
245
233
|
},
|
|
246
234
|
uniswapV2ExchangeRouterAddress:
|
|
247
235
|
'0xAB86e2bC9ec5485a9b60E684BA6d49bf4686ACC2',
|
|
248
236
|
rfqConfigs: {},
|
|
249
|
-
rpcPollingMaxAllowedStateDelayInBlocks: 2,
|
|
250
|
-
rpcPollingBlocksBackToTriggerUpdate: 1,
|
|
251
237
|
},
|
|
252
238
|
[Network.ARBITRUM]: {
|
|
253
239
|
network: Network.ARBITRUM,
|
|
@@ -267,15 +253,13 @@ const baseConfigs: { [network: number]: BaseConfig } = {
|
|
|
267
253
|
process.env[`HASHFLOW_DISABLED_MMS_42161`]?.split(',') || [],
|
|
268
254
|
adapterAddresses: {
|
|
269
255
|
ArbitrumAdapter01: '0x745Ec73855CeC7249E5fF4c9DD81cc65b4D297a9',
|
|
270
|
-
ArbitrumAdapter02: '
|
|
256
|
+
ArbitrumAdapter02: '0xa003dFBA51C9e1e56C67ae445b852bdEd7aC5EEd',
|
|
271
257
|
ArbitrumBuyAdapter: '0xfa072107a2CCfE5664794282EF36400735ABB70F',
|
|
272
258
|
},
|
|
273
259
|
uniswapV2ExchangeRouterAddress:
|
|
274
260
|
'0xB41dD984730dAf82f5C41489E21ac79D5e3B61bC',
|
|
275
261
|
uniswapV3EventLoggingSampleRate: 0,
|
|
276
262
|
rfqConfigs: {},
|
|
277
|
-
rpcPollingMaxAllowedStateDelayInBlocks: 4,
|
|
278
|
-
rpcPollingBlocksBackToTriggerUpdate: 3,
|
|
279
263
|
},
|
|
280
264
|
[Network.OPTIMISM]: {
|
|
281
265
|
network: Network.OPTIMISM,
|
|
@@ -295,15 +279,13 @@ const baseConfigs: { [network: number]: BaseConfig } = {
|
|
|
295
279
|
process.env[`HASHFLOW_DISABLED_MMS_10`]?.split(',') || [],
|
|
296
280
|
|
|
297
281
|
adapterAddresses: {
|
|
298
|
-
OptimismAdapter01: '
|
|
282
|
+
OptimismAdapter01: '0xB6EBBB9f9957556Fd798927ae7c250759a235407',
|
|
299
283
|
OptimismBuyAdapter: '0x4Ae8ad57912e207f5bFaFbF2e90486e5feab1634',
|
|
300
284
|
},
|
|
301
285
|
uniswapV2ExchangeRouterAddress:
|
|
302
286
|
'0xB41dD984730dAf82f5C41489E21ac79D5e3B61bC',
|
|
303
287
|
uniswapV3EventLoggingSampleRate: 0,
|
|
304
288
|
rfqConfigs: {},
|
|
305
|
-
rpcPollingMaxAllowedStateDelayInBlocks: 5,
|
|
306
|
-
rpcPollingBlocksBackToTriggerUpdate: 3,
|
|
307
289
|
},
|
|
308
290
|
};
|
|
309
291
|
|
|
@@ -340,10 +322,6 @@ export function generateConfig(network: number): Config {
|
|
|
340
322
|
uniswapV2ExchangeRouterAddress: baseConfig.uniswapV2ExchangeRouterAddress,
|
|
341
323
|
uniswapV3EventLoggingSampleRate: baseConfig.uniswapV3EventLoggingSampleRate,
|
|
342
324
|
rfqConfigs: baseConfig.rfqConfigs,
|
|
343
|
-
rpcPollingMaxAllowedStateDelayInBlocks:
|
|
344
|
-
baseConfig.rpcPollingMaxAllowedStateDelayInBlocks,
|
|
345
|
-
rpcPollingBlocksBackToTriggerUpdate:
|
|
346
|
-
baseConfig.rpcPollingBlocksBackToTriggerUpdate,
|
|
347
325
|
hashFlowAuthToken: baseConfig.hashFlowAuthToken,
|
|
348
326
|
hashFlowDisabledMMs: baseConfig.hashFlowDisabledMMs,
|
|
349
327
|
};
|
|
@@ -104,7 +104,6 @@ export const CurveV1Config: DexConfigMap<DexParams> = {
|
|
|
104
104
|
],
|
|
105
105
|
pools: {
|
|
106
106
|
Compound: {
|
|
107
|
-
isPaused: true,
|
|
108
107
|
underlying: [
|
|
109
108
|
'0x6b175474e89094c44da98b954eedeac495271d0f',
|
|
110
109
|
'0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
|
|
@@ -122,7 +121,6 @@ export const CurveV1Config: DexConfigMap<DexParams> = {
|
|
|
122
121
|
baseToken: '0x5d3a536e4d6dbd6114cc1ead35777bab948e3643',
|
|
123
122
|
},
|
|
124
123
|
USDT: {
|
|
125
|
-
isPaused: true,
|
|
126
124
|
underlying: [
|
|
127
125
|
'0x6b175474e89094c44da98b954eedeac495271d0f',
|
|
128
126
|
'0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
|
|
@@ -23,11 +23,28 @@ describe('CurveV1 E2E', () => {
|
|
|
23
23
|
network,
|
|
24
24
|
);
|
|
25
25
|
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
const tokensToTest = [
|
|
27
|
+
[
|
|
28
|
+
{
|
|
29
|
+
symbol: 'USDT',
|
|
30
|
+
amount: (10 ** 8).toString(),
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
symbol: 'DAI',
|
|
34
|
+
amount: (10 ** 8).toString(),
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
[
|
|
38
|
+
{
|
|
39
|
+
symbol: 'CUSDC',
|
|
40
|
+
amount: (10 ** 8).toString(),
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
symbol: 'CDAI',
|
|
44
|
+
amount: (10 ** 8).toString(),
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
];
|
|
31
48
|
|
|
32
49
|
const sideToContractMethods = new Map([
|
|
33
50
|
[
|
|
@@ -42,19 +59,21 @@ describe('CurveV1 E2E', () => {
|
|
|
42
59
|
|
|
43
60
|
sideToContractMethods.forEach((contractMethods, side) =>
|
|
44
61
|
contractMethods.forEach((contractMethod: ContractMethod) => {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
62
|
+
tokensToTest.forEach(pair => {
|
|
63
|
+
describe(`${contractMethod}`, () => {
|
|
64
|
+
it(`${pair[0].symbol} -> ${pair[1].symbol}`, async () => {
|
|
65
|
+
await testE2E(
|
|
66
|
+
tokens[pair[0].symbol],
|
|
67
|
+
tokens[pair[1].symbol],
|
|
68
|
+
holders[pair[0].symbol],
|
|
69
|
+
side === SwapSide.SELL ? pair[0].amount : pair[1].amount,
|
|
70
|
+
side,
|
|
71
|
+
dexKey,
|
|
72
|
+
contractMethod,
|
|
73
|
+
network,
|
|
74
|
+
provider,
|
|
75
|
+
);
|
|
76
|
+
});
|
|
58
77
|
});
|
|
59
78
|
});
|
|
60
79
|
}),
|
|
@@ -122,8 +122,6 @@ export class CurveV1 extends SimpleExchange implements IDex<CurveV1Data> {
|
|
|
122
122
|
>((acc, key) => {
|
|
123
123
|
const poolConf = dexConfig.pools[key];
|
|
124
124
|
|
|
125
|
-
if (poolConf.isPaused) return acc;
|
|
126
|
-
|
|
127
125
|
acc[key] = {
|
|
128
126
|
underlying: poolConf.underlying.map(t => t.toLowerCase()),
|
|
129
127
|
coins: poolConf.coins.map(t => t.toLowerCase()),
|
package/src/dex/index.ts
CHANGED
|
@@ -38,7 +38,7 @@ import { MakerPsm } from './maker-psm/maker-psm';
|
|
|
38
38
|
import { KyberDmm } from './kyberdmm/kyberdmm';
|
|
39
39
|
import { Platypus } from './platypus/platypus';
|
|
40
40
|
import { GMX } from './gmx/gmx';
|
|
41
|
-
import {
|
|
41
|
+
// import { WooFi } from './woo-fi/woo-fi';
|
|
42
42
|
import { ParaSwapLimitOrders } from './paraswap-limit-orders/paraswap-limit-orders';
|
|
43
43
|
import { AugustusRFQOrder } from './augustus-rfq';
|
|
44
44
|
import { Solidly } from './solidly/solidly';
|
|
@@ -107,7 +107,7 @@ const Dexes = [
|
|
|
107
107
|
Platypus,
|
|
108
108
|
GMX,
|
|
109
109
|
JarvisV6,
|
|
110
|
-
|
|
110
|
+
// WooFi,
|
|
111
111
|
ParaSwapLimitOrders,
|
|
112
112
|
Solidly,
|
|
113
113
|
SolidlyEthereum,
|
|
@@ -4,7 +4,6 @@ import { Address, SimpleExchangeParam, NumberAsString } from '../types';
|
|
|
4
4
|
import { CACHE_PREFIX, ETHER_ADDRESS } from '../constants';
|
|
5
5
|
import SimpleSwapHelperABI from '../abi/SimpleSwapHelperRouter.json';
|
|
6
6
|
import ERC20ABI from '../abi/erc20.json';
|
|
7
|
-
import augustusABI from '../abi/augustus.json';
|
|
8
7
|
import { isETHAddress } from '../utils';
|
|
9
8
|
import { MAX_UINT } from '../constants';
|
|
10
9
|
import Web3 from 'web3';
|
|
@@ -19,7 +18,6 @@ export class SimpleExchange {
|
|
|
19
18
|
isFeeOnTransferSupported = false;
|
|
20
19
|
|
|
21
20
|
protected augustusAddress: Address;
|
|
22
|
-
protected augustusInterface: Interface;
|
|
23
21
|
private provider: Web3;
|
|
24
22
|
|
|
25
23
|
protected network: number;
|
|
@@ -34,7 +32,6 @@ export class SimpleExchange {
|
|
|
34
32
|
|
|
35
33
|
this.network = dexHelper.config.data.network;
|
|
36
34
|
this.augustusAddress = dexHelper.config.data.augustusAddress;
|
|
37
|
-
this.augustusInterface = new Interface(augustusABI);
|
|
38
35
|
this.provider = dexHelper.web3Provider;
|
|
39
36
|
|
|
40
37
|
this.dexmapKey =
|
|
@@ -124,6 +121,6 @@ export class SimpleExchange {
|
|
|
124
121
|
}
|
|
125
122
|
|
|
126
123
|
getDeadline() {
|
|
127
|
-
return Math.floor(new Date().getTime() / 1000) +
|
|
124
|
+
return Math.floor(new Date().getTime() / 1000) + 60 * 60;
|
|
128
125
|
}
|
|
129
126
|
}
|