@paraswap/dex-lib 3.11.5 → 3.11.6
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/{inception/inception-ineth-pool.json → cables/CablesMainnetRFQ.json} +511 -490
- package/build/abi/fluid-dex/resolver.abi.json +731 -4
- package/build/abi/integral/factory.json +333 -0
- package/build/abi/integral/oracle.json +501 -0
- package/build/abi/integral/pool.json +1041 -0
- 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/cables/cables.d.ts +59 -0
- package/build/dex/cables/cables.js +599 -0
- package/build/dex/cables/cables.js.map +1 -0
- package/build/dex/cables/config.d.ts +4 -0
- package/build/dex/cables/config.js +15 -0
- package/build/dex/cables/config.js.map +1 -0
- package/build/dex/cables/constants.d.ts +20 -0
- package/build/dex/cables/constants.js +24 -0
- package/build/dex/cables/constants.js.map +1 -0
- package/build/dex/cables/rate-fetcher.d.ts +34 -0
- package/build/dex/cables/rate-fetcher.js +106 -0
- package/build/dex/cables/rate-fetcher.js.map +1 -0
- package/build/dex/cables/types.d.ts +113 -0
- package/build/dex/cables/types.js +19 -0
- package/build/dex/cables/types.js.map +1 -0
- package/build/dex/cables/validators.d.ts +5 -0
- package/build/dex/cables/validators.js +49 -0
- package/build/dex/cables/validators.js.map +1 -0
- package/build/dex/fluid-dex/config.js +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/fluid-dex/fluid-dex-liquidity-proxy.js +28 -1
- package/build/dex/fluid-dex/fluid-dex-liquidity-proxy.js.map +1 -1
- package/build/dex/fluid-dex/fluid-dex.d.ts +19 -10
- package/build/dex/fluid-dex/fluid-dex.js +213 -55
- package/build/dex/fluid-dex/fluid-dex.js.map +1 -1
- package/build/dex/fluid-dex/types.d.ts +22 -2
- 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/Executor03BytecodeBuilder.js +8 -3
- package/build/executor/Executor03BytecodeBuilder.js.map +1 -1
- package/package.json +1 -1
- package/src/abi/fluid-dex/resolver.abi.json +731 -4
- package/src/dex/fluid-dex/config.ts +1 -1
- package/src/dex/fluid-dex/fluid-dex-e2e.test.ts +157 -6
- package/src/dex/fluid-dex/fluid-dex-events.test.ts +2 -4
- package/src/dex/fluid-dex/fluid-dex-integration.test.ts +69 -9
- package/src/dex/fluid-dex/fluid-dex-liquidity-proxy.ts +33 -0
- package/src/dex/fluid-dex/fluid-dex.ts +311 -89
- package/src/dex/fluid-dex/types.ts +25 -1
- package/src/executor/Executor03BytecodeBuilder.ts +10 -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/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-pool.d.ts +0 -76
- package/build/dex/balancer-v3/balancer-v3-pool.js +0 -383
- package/build/dex/balancer-v3/balancer-v3-pool.js.map +0 -1
- package/build/dex/balancer-v3/balancer-v3.d.ts +0 -57
- package/build/dex/balancer-v3/balancer-v3.js +0 -373
- package/build/dex/balancer-v3/balancer-v3.js.map +0 -1
- package/build/dex/balancer-v3/config.d.ts +0 -8
- package/build/dex/balancer-v3/config.js +0 -24
- package/build/dex/balancer-v3/config.js.map +0 -1
- package/build/dex/balancer-v3/getOnChainState.d.ts +0 -10
- package/build/dex/balancer-v3/getOnChainState.js +0 -158
- package/build/dex/balancer-v3/getOnChainState.js.map +0 -1
- package/build/dex/balancer-v3/getPoolsApi.d.ts +0 -2
- package/build/dex/balancer-v3/getPoolsApi.js +0 -81
- package/build/dex/balancer-v3/getPoolsApi.js.map +0 -1
- package/build/dex/balancer-v3/getTopPoolsApi.d.ts +0 -13
- package/build/dex/balancer-v3/getTopPoolsApi.js +0 -62
- package/build/dex/balancer-v3/getTopPoolsApi.js.map +0 -1
- package/build/dex/balancer-v3/types.d.ts +0 -63
- package/build/dex/balancer-v3/types.js +0 -3
- package/build/dex/balancer-v3/types.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
|
@@ -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,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC;QACtD,SAAS,EAAE,gBAAgB;QAC3B,OAAO,EAAE,cAAc;QACvB,OAAO,EAAE,OAAO;KACjB,CAAC,CAAC;IAEH,MAAM,iBAAiB,GAA0B,EAAE,CAAC;IACpD,KAAK,IAAI,GAAG,IAAI,cAAc,EAAE;QAC9B,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE;YACvC,iBAAiB,CAAC,GAAG,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC;SACzC;QACD,iBAAiB,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KAC9C;IAED,MAAM,YAAY,GAAG,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC;SAChD,GAAG,CAAC,MAAM,CAAC;SACX,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IAEzC,KAAK,IAAI,WAAW,IAAI,YAAY,EAAE;QACpC,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,EAAE;YAC9B,YAAY,CAAC,WAAW,CAAC,GAAG,MAAM,SAAS,CAAC,YAAY,CAAC,GAAG,CAAC,QAAQ,CACnE,WAAW,CACZ,CAAC;SACH;QAED,MAAM,SAAS,CAAC,OAAO,EAAE,MAAM,CAAC,iBAAiB,CAAC,WAAW,CAAC,EAAE;YAC9D,CAAC,WAAW,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC;SACzC,CAAC,CAAC;KACJ;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED,KAAK,UAAU,IAAI;IACjB,uGAAuG;IACvG,kBAAkB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;AACzC,CAAC;AAED,IAAI,EAAE;KACH,IAAI,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,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;SACrE;KACF;CACF,CAAC;AAMF,MAAa,WAAY,SAAQ,sBAAS;IAIxC,YACY,OAAgB,EAC1B,MAAc,EACJ,SAAqB;QAE/B,KAAK,CACH,OAAO,EACP,MAAM,EACN,SAAS,EACT,EAAE,EACF,IAAI,eAAS,CAAC,oCAAoB,CAAC,EACnC,SAAS,EACT,yBAAiB,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CACnC,CAAC;QAZQ,YAAO,GAAP,OAAO,CAAS;QAEhB,cAAS,GAAT,SAAS,CAAY;IAWjC,CAAC;IAED,MAAM,CAAC,qBAAqB;QAC1B,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,KAAK,CAAC,cAAc,CAClB,QAAgB,EAChB,SAAiB,EACjB,SAAiB,EACjB,UAAkB,EAClB,IAAmB,EACnB,IAAc;QAEd,MAAM,YAAY,GAChB,IAAI,KAAK,oBAAQ,CAAC,IAAI;YACpB,CAAC,CAAC,0BAAkB,CAAC,UAAU;YAC/B,CAAC,CAAC,0BAAkB,CAAC,WAAW,CAAC;QAErC,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC/C,MAAM,kBAAkB,GACtB,IAAI,KAAK,oBAAQ,CAAC,IAAI;YACpB,CAAC,CAAC;gBACE,SAAS,EAAE,IAAI,CAAC,eAAe;gBAC/B,QAAQ,EAAE,SAAS;gBACnB,gBAAgB,EAAE,UAAU;gBAC5B,IAAI;aACL;YACH,CAAC,CAAC;gBACE,SAAS,EAAE,IAAI,CAAC,eAAe;gBAC/B,SAAS,EAAE,UAAU;gBACrB,eAAe,EAAE,SAAS;gBAC1B,IAAI;aACL,CAAC;QAER,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,kBAAkB,CAAC,YAAY,EAAE;YACjE,kBAAkB;SACnB,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC,qCAAqC,CAC/C,QAAQ,EACR,SAAS,EACT,SAAS,EACT,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
|
-
}
|
|
@@ -1,79 +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.AlienV3 = 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
|
-
AlienV3: {
|
|
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
|
-
DackieSwapV3: {
|
|
29
|
-
[constants_1.Network.BASE]: {
|
|
30
|
-
factory: '0x3D237AC6D2f425D2E890Cc99198818cc1FA48870',
|
|
31
|
-
quoter: '0x4fDBD73aD4B1DDde594BF05497C15f76308eFfb9',
|
|
32
|
-
router: '0x195FBc5B8Fbd5Ac739C1BA57D4Ef6D5a704F34f7',
|
|
33
|
-
// supportedFees: [10000n, 2500n, 500n, 100n],
|
|
34
|
-
supportedFees: [100n],
|
|
35
|
-
stateMulticall: '0x7160f736c52e1e78e92FD4eE4D73e21A7Cf4F950',
|
|
36
|
-
uniswapMulticall: '0x091e99cb1C49331a94dD62755D168E941AbD0693',
|
|
37
|
-
chunksCount: 10,
|
|
38
|
-
initRetryFrequency: 10,
|
|
39
|
-
initHash: `0x6ce8eb472fa82df5469c6ab6d485f17c3ad13c8cd7af59b3d4a8026c5ce0f7e2`,
|
|
40
|
-
subgraphURL: 'https://api.studio.thegraph.com/query/59130/v3alb/0.3',
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
};
|
|
44
|
-
class AlienV3 extends uniswap_v3_1.UniswapV3 {
|
|
45
|
-
constructor(network, dexKey, dexHelper) {
|
|
46
|
-
super(network, dexKey, dexHelper, {}, new abi_1.Interface(AlienBaseV3Router_abi_json_1.default), undefined, exports.AlienBaseV3Config[dexKey][network]);
|
|
47
|
-
this.network = network;
|
|
48
|
-
this.dexHelper = dexHelper;
|
|
49
|
-
}
|
|
50
|
-
static getDirectFunctionName() {
|
|
51
|
-
return [];
|
|
52
|
-
}
|
|
53
|
-
async getSimpleParam(srcToken, destToken, srcAmount, destAmount, data, side) {
|
|
54
|
-
const swapFunction = side === constants_1.SwapSide.SELL
|
|
55
|
-
? types_1.UniswapV3Functions.exactInput
|
|
56
|
-
: types_1.UniswapV3Functions.exactOutput;
|
|
57
|
-
const path = this._encodePath(data.path, side);
|
|
58
|
-
const swapFunctionParams = side === constants_1.SwapSide.SELL
|
|
59
|
-
? {
|
|
60
|
-
recipient: this.augustusAddress,
|
|
61
|
-
amountIn: srcAmount,
|
|
62
|
-
amountOutMinimum: destAmount,
|
|
63
|
-
path,
|
|
64
|
-
}
|
|
65
|
-
: {
|
|
66
|
-
recipient: this.augustusAddress,
|
|
67
|
-
amountOut: destAmount,
|
|
68
|
-
amountInMaximum: srcAmount,
|
|
69
|
-
path,
|
|
70
|
-
};
|
|
71
|
-
const swapData = this.routerIface.encodeFunctionData(swapFunction, [
|
|
72
|
-
swapFunctionParams,
|
|
73
|
-
]);
|
|
74
|
-
return this.buildSimpleParamWithoutWETHConversion(srcToken, srcAmount, destToken, destAmount, swapData, this.config.router);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
exports.AlienV3 = AlienV3;
|
|
78
|
-
AlienV3.dexKeysWithNetwork = (0, utils_1.getDexKeysWithNetwork)(exports.AlienBaseV3Config);
|
|
79
|
-
//# sourceMappingURL=alien-v3.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"alien-v3.js","sourceRoot":"","sources":["../../../../../src/dex/uniswap-v3/forks/alien-v3/alien-v3.ts"],"names":[],"mappings":";;;;;;AAAA,4CAA+C;AAC/C,qDAA0D;AAG1D,6CAA0D;AAC1D,uCAMqB;AACrB,iDAA6C;AAC7C,uHAAyF;AAE5E,QAAA,iBAAiB,GAA4B;IACxD,OAAO,EAAE;QACP,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;SACrE;KACF;IACD,YAAY,EAAE;QACZ,CAAC,mBAAO,CAAC,IAAI,CAAC,EAAE;YACd,OAAO,EAAE,4CAA4C;YACrD,MAAM,EAAE,4CAA4C;YACpD,MAAM,EAAE,4CAA4C;YACpD,8CAA8C;YAC9C,aAAa,EAAE,CAAC,IAAI,CAAC;YACrB,cAAc,EAAE,4CAA4C;YAC5D,gBAAgB,EAAE,4CAA4C;YAC9D,WAAW,EAAE,EAAE;YACf,kBAAkB,EAAE,EAAE;YACtB,QAAQ,EAAE,oEAAoE;YAC9E,WAAW,EAAE,uDAAuD;SACrE;KACF;CACF,CAAC;AAMF,MAAa,OAAQ,SAAQ,sBAAS;IAIpC,YACY,OAAgB,EAC1B,MAAc,EACJ,SAAqB;QAE/B,KAAK,CACH,OAAO,EACP,MAAM,EACN,SAAS,EACT,EAAE,EACF,IAAI,eAAS,CAAC,oCAAoB,CAAC,EACnC,SAAS,EACT,yBAAiB,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CACnC,CAAC;QAZQ,YAAO,GAAP,OAAO,CAAS;QAEhB,cAAS,GAAT,SAAS,CAAY;IAWjC,CAAC;IAED,MAAM,CAAC,qBAAqB;QAC1B,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,KAAK,CAAC,cAAc,CAClB,QAAgB,EAChB,SAAiB,EACjB,SAAiB,EACjB,UAAkB,EAClB,IAAmB,EACnB,IAAc;QAEd,MAAM,YAAY,GAChB,IAAI,KAAK,oBAAQ,CAAC,IAAI;YACpB,CAAC,CAAC,0BAAkB,CAAC,UAAU;YAC/B,CAAC,CAAC,0BAAkB,CAAC,WAAW,CAAC;QAErC,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC/C,MAAM,kBAAkB,GACtB,IAAI,KAAK,oBAAQ,CAAC,IAAI;YACpB,CAAC,CAAC;gBACE,SAAS,EAAE,IAAI,CAAC,eAAe;gBAC/B,QAAQ,EAAE,SAAS;gBACnB,gBAAgB,EAAE,UAAU;gBAC5B,IAAI;aACL;YACH,CAAC,CAAC;gBACE,SAAS,EAAE,IAAI,CAAC,eAAe;gBAC/B,SAAS,EAAE,UAAU;gBACrB,eAAe,EAAE,SAAS;gBAC1B,IAAI;aACL,CAAC;QAER,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,kBAAkB,CAAC,YAAY,EAAE;YACjE,kBAAkB;SACnB,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC,qCAAqC,CAC/C,QAAQ,EACR,SAAS,EACT,SAAS,EACT,UAAU,EACV,QAAQ,EACR,IAAI,CAAC,MAAM,CAAC,MAAM,CACnB,CAAC;IACJ,CAAC;;AAjEH,0BAkEC;AAjEe,0BAAkB,GAC9B,IAAA,6BAAqB,EAAC,yBAAiB,CAAC,CAAC"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { DeepReadonly } from 'ts-essentials';
|
|
2
|
-
import { PoolState } from './types';
|
|
3
|
-
import { SwapSide } from '@paraswap/core';
|
|
4
|
-
export declare function _getOutputs(state: DeepReadonly<PoolState>, amounts: bigint[], zeroForOne: boolean, side: SwapSide, destTokenBalance: bigint, fmode?: boolean): import("./types").OutputResult | null;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports._getOutputs = void 0;
|
|
4
|
-
const core_1 = require("@paraswap/core");
|
|
5
|
-
const uniswap_v3_math_1 = require("./contract-math/uniswap-v3-math");
|
|
6
|
-
function _getOutputs(state, amounts, zeroForOne, side, destTokenBalance, fmode) {
|
|
7
|
-
try {
|
|
8
|
-
const outputsResult = uniswap_v3_math_1.uniswapV3Math.queryOutputs(state, amounts, zeroForOne, side, fmode);
|
|
9
|
-
if (side === core_1.SwapSide.SELL) {
|
|
10
|
-
if (outputsResult.outputs[0] > destTokenBalance) {
|
|
11
|
-
return null;
|
|
12
|
-
}
|
|
13
|
-
for (let i = 0; i < outputsResult.outputs.length; i++) {
|
|
14
|
-
if (outputsResult.outputs[i] > destTokenBalance) {
|
|
15
|
-
outputsResult.outputs[i] = 0n;
|
|
16
|
-
outputsResult.tickCounts[i] = 0;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
if (amounts[0] > destTokenBalance) {
|
|
22
|
-
return null;
|
|
23
|
-
}
|
|
24
|
-
// This may be improved by first checking outputs and requesting outputs
|
|
25
|
-
// only for amounts that makes more sense, but I don't think this is really
|
|
26
|
-
// important now
|
|
27
|
-
for (let i = 0; i < amounts.length; i++) {
|
|
28
|
-
if (amounts[i] > destTokenBalance) {
|
|
29
|
-
outputsResult.outputs[i] = 0n;
|
|
30
|
-
outputsResult.tickCounts[i] = 0;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
return outputsResult;
|
|
35
|
-
}
|
|
36
|
-
catch (e) {
|
|
37
|
-
// eslint-disable-next-line no-console
|
|
38
|
-
console.debug(`received error in _getOutputs while calculating outputs`, e);
|
|
39
|
-
return null;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
exports._getOutputs = _getOutputs;
|
|
43
|
-
//# sourceMappingURL=uniswap-v3-pricing.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"uniswap-v3-pricing.js","sourceRoot":"","sources":["../../../src/dex/uniswap-v3/uniswap-v3-pricing.ts"],"names":[],"mappings":";;;AAEA,yCAA0C;AAC1C,qEAAgE;AAEhE,SAAgB,WAAW,CACzB,KAA8B,EAC9B,OAAiB,EACjB,UAAmB,EACnB,IAAc,EACd,gBAAwB,EACxB,KAAe;IAEf,IAAI;QACF,MAAM,aAAa,GAAG,+BAAa,CAAC,YAAY,CAC9C,KAAK,EACL,OAAO,EACP,UAAU,EACV,IAAI,EACJ,KAAK,CACN,CAAC;QAEF,IAAI,IAAI,KAAK,eAAQ,CAAC,IAAI,EAAE;YAC1B,IAAI,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,gBAAgB,EAAE;gBAC/C,OAAO,IAAI,CAAC;aACb;YAED,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,aAAa,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBACrD,IAAI,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,gBAAgB,EAAE;oBAC/C,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;oBAC9B,aAAa,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;iBACjC;aACF;SACF;aAAM;YACL,IAAI,OAAO,CAAC,CAAC,CAAC,GAAG,gBAAgB,EAAE;gBACjC,OAAO,IAAI,CAAC;aACb;YAED,wEAAwE;YACxE,2EAA2E;YAC3E,gBAAgB;YAChB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBACvC,IAAI,OAAO,CAAC,CAAC,CAAC,GAAG,gBAAgB,EAAE;oBACjC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;oBAC9B,aAAa,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;iBACjC;aACF;SACF;QAED,OAAO,aAAa,CAAC;KACtB;IAAC,OAAO,CAAC,EAAE;QACV,sCAAsC;QACtC,OAAO,CAAC,KAAK,CAAC,yDAAyD,EAAE,CAAC,CAAC,CAAC;QAC5E,OAAO,IAAI,CAAC;KACb;AACH,CAAC;AAlDD,kCAkDC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const worker_threads_1 = require("worker_threads");
|
|
4
|
-
const uniswap_v3_pricing_1 = require("./uniswap-v3-pricing");
|
|
5
|
-
const { state, amounts, zeroForOne, side, destTokenBalance, fmode } = worker_threads_1.workerData;
|
|
6
|
-
const result = (0, uniswap_v3_pricing_1._getOutputs)(state, amounts, zeroForOne, side, destTokenBalance, fmode);
|
|
7
|
-
if (worker_threads_1.parentPort) {
|
|
8
|
-
worker_threads_1.parentPort.postMessage(result);
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=uniswap-v3-worker.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"uniswap-v3-worker.js","sourceRoot":"","sources":["../../../src/dex/uniswap-v3/uniswap-v3-worker.ts"],"names":[],"mappings":";;AAAA,mDAAwD;AAKxD,6DAAmD;AAWnD,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,GACjE,2BAAU,CAAC;AACb,MAAM,MAAM,GAAG,IAAA,gCAAW,EACxB,KAAK,EACL,OAAO,EACP,UAAU,EACV,IAAI,EACJ,gBAAgB,EAChB,KAAK,CACN,CAAC;AAEF,IAAI,2BAAU,EAAE;IACd,2BAAU,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;CAChC"}
|