1 | 1 | | {-# STDLIB_VERSION 6 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | let wxPool = addressFromStringValue("3PPZWgFNRKHLvM51pwS934C8VZ7d2F4Z58g") |
---|
5 | 5 | | |
---|
6 | 6 | | let usdnAssetId = base58'DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p' |
---|
7 | 7 | | |
---|
8 | 8 | | let usdnAssetIdString = "DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p" |
---|
9 | 9 | | |
---|
10 | 10 | | let usdnWavesLPTokenAssetId = base58'7KZbJrVopwJhkdwbe1eFDBbex4dkY63MxjTNjqXtrzj1' |
---|
11 | 11 | | |
---|
12 | 12 | | let nonRoutingPuzzlePool = addressFromStringValue("3PDrYPF6izza2sXWffzTPF7e2Fcir2CMpki") |
---|
13 | 13 | | |
---|
14 | 14 | | let surfAssetId = base58'At8D6NFFpheCbvKVnjVoeLL84Eo8NZn6ovManxfLaFWL' |
---|
15 | 15 | | |
---|
16 | 16 | | let surfAssetIdString = "At8D6NFFpheCbvKVnjVoeLL84Eo8NZn6ovManxfLaFWL" |
---|
17 | 17 | | |
---|
18 | 18 | | let nonRoutingPuzzleSurfPool = addressFromStringValue("3P7r93vXHuusageNJVGwzqaz3WMotAu49Yz") |
---|
19 | 19 | | |
---|
20 | 20 | | let swopSurfPool = addressFromStringValue("3PLp9KrdrbWAvSFHGJVEaszUubquz3M6mfe") |
---|
21 | 21 | | |
---|
22 | 22 | | let wxAssetId = base58'Atqv59EYzjFGuitKVnMRk6H8FukjoV3ktPorbEys25on' |
---|
23 | 23 | | |
---|
24 | 24 | | let wxAssetIdString = "Atqv59EYzjFGuitKVnMRk6H8FukjoV3ktPorbEys25on" |
---|
25 | 25 | | |
---|
26 | 26 | | let swopWxPool = addressFromStringValue("3PKi4G3VX2k42ZSmNNrmvgdDH7JzRaUhY7R") |
---|
27 | 27 | | |
---|
28 | 28 | | let wxWxPool = addressFromStringValue("3PCENpEKe8atwELZ7oCSmcdEfcRuKTrUx99") |
---|
29 | 29 | | |
---|
30 | 30 | | let usdnWxLPTokenAssetId = base58'F2AKkA513k5yHEJkLsU6vWxCYYk811GpjLhwEv2WGwZ9' |
---|
31 | 31 | | |
---|
32 | 32 | | let wxUsdcPool = addressFromStringValue("3PC3HtupBxBmy4WtZf1Tym1vrxg9MwbZRK1") |
---|
33 | 33 | | |
---|
34 | 34 | | let usdcAssetIdString = "6XtHjpXbs9RRJP2Sr9GUyVqzACcby9TkThHXnjVC5CDJ" |
---|
35 | 35 | | |
---|
36 | 36 | | let usdcAssetId = base58'6XtHjpXbs9RRJP2Sr9GUyVqzACcby9TkThHXnjVC5CDJ' |
---|
37 | 37 | | |
---|
38 | 38 | | let usdcWxLPTokenAssetId = base58'EK6N7S38xbtBT3SxAqoGdDLCiX6rojX6G169CnSyuE5' |
---|
39 | 39 | | |
---|
40 | 40 | | let puzzleUsdcPool = addressFromStringValue("3P93Kqz8PUbCudvMyjbci54WxQrtBtw4dbZ") |
---|
41 | 41 | | |
---|
42 | 42 | | let wxUsdtPool = addressFromStringValue("3P8KMyAJCPWNcyedqrmymxaeWonvmkhGauz") |
---|
43 | 43 | | |
---|
44 | 44 | | let usdtAssetIdString = "34N9YcEETLWn93qYQ64EsP1x89tSruJU44RrEMSXXEPJ" |
---|
45 | 45 | | |
---|
46 | 46 | | let usdtAssetId = base58'34N9YcEETLWn93qYQ64EsP1x89tSruJU44RrEMSXXEPJ' |
---|
47 | 47 | | |
---|
48 | 48 | | let usdtWxLPTokenAssetId = base58'97zHFp1C3cB7qfvx8Xv5f2rWp9nUSG5UnAamfPcW6txf' |
---|
49 | 49 | | |
---|
50 | 50 | | let puzzleUsdtPool = addressFromStringValue("3P93Kqz8PUbCudvMyjbci54WxQrtBtw4dbZ") |
---|
51 | 51 | | |
---|
52 | 52 | | let wxTsnPool = addressFromStringValue("3PH832eKnw67PFvJfUg9Knz6BHM87QvjMeL") |
---|
53 | 53 | | |
---|
54 | 54 | | let tsnAssetIdString = "8t4DPWTwPzpatHA9AkTxWAB47THnYzBsDnoY7fQqbG91" |
---|
55 | 55 | | |
---|
56 | 56 | | let tsnAssetId = base58'8t4DPWTwPzpatHA9AkTxWAB47THnYzBsDnoY7fQqbG91' |
---|
57 | 57 | | |
---|
58 | 58 | | let tsnWxLPTokenAssetId = base58'EbwpqrZjrvi7XLowkM5Z2rg7xVdzfg6S5ec9asarpAU9' |
---|
59 | 59 | | |
---|
60 | 60 | | let puzzleTsnPool = addressFromStringValue("3PN1eJpdhJyRptcN9iLTarsJBtR2Kb3NXSU") |
---|
61 | 61 | | |
---|
62 | 62 | | let wxBtcPool = addressFromStringValue("3PCBWDTA6jrFswd7gQgaE3Xk7gLM5RKofvp") |
---|
63 | 63 | | |
---|
64 | 64 | | let swopBtcPool = addressFromStringValue("3PACj2DLTw3uUhsUmT98zHU5M4hPufbHKav") |
---|
65 | 65 | | |
---|
66 | 66 | | let btcAssetIdString = "8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS" |
---|
67 | 67 | | |
---|
68 | 68 | | let btcAssetId = base58'8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS' |
---|
69 | 69 | | |
---|
70 | 70 | | let btcWxLPTokenAssetId = base58'8WhH5CCJ6NakPvEvAJcizqqD7H6axhupdYHDFumSDwsy' |
---|
71 | 71 | | |
---|
72 | 72 | | let wxEthPool = addressFromStringValue("3PEMqetsaJDbYMw1XGovmE37FB8VUhGnX9A") |
---|
73 | 73 | | |
---|
74 | 74 | | let ethAssetIdString = "474jTeYx2r2Va35794tCScAXWJG9hU2HcgxzMowaZUnu" |
---|
75 | 75 | | |
---|
76 | 76 | | let ethAssetId = base58'474jTeYx2r2Va35794tCScAXWJG9hU2HcgxzMowaZUnu' |
---|
77 | 77 | | |
---|
78 | 78 | | let ethWxLPTokenAssetId = base58'6gtgBD12xZkUTnzGofoFJpMg5gYG1FP6PaGyLviVQjbh' |
---|
79 | 79 | | |
---|
80 | 80 | | let swopEthPool = addressFromStringValue("3PNEC4YKqZiMMytFrYRVtpW2ujvi3aGXRPm") |
---|
81 | 81 | | |
---|
82 | 82 | | let wxLtcPool = addressFromStringValue("3P94wvu5gA7VhjPgAB3twaeqdwHCwNK2vsn") |
---|
83 | 83 | | |
---|
84 | 84 | | let ltcAssetIdString = "HZk1mbfuJpmxU1Fs4AX5MWLVYtctsNcg6e2C6VKqK8zk" |
---|
85 | 85 | | |
---|
86 | 86 | | let ltcAssetId = base58'HZk1mbfuJpmxU1Fs4AX5MWLVYtctsNcg6e2C6VKqK8zk' |
---|
87 | 87 | | |
---|
88 | 88 | | let ltcWxLPTokenAssetId = base58'CNkqC6GPi888WdJ1EuVtu9JGZ9VHpAn8eTHwR8YZxXbv' |
---|
89 | 89 | | |
---|
90 | 90 | | let swopLtcPool = addressFromStringValue("3P32Rjpo9YHoHaorLSxvnV6CkKFXyfDCkJh") |
---|
91 | 91 | | |
---|
92 | 92 | | let wxWestPool = addressFromStringValue("3PFxchXqKNjgP1CcbgFZjHyrEj9xMbSeLU3") |
---|
93 | 93 | | |
---|
94 | 94 | | let westAssetIdString = "4LHHvYGNKJUg5hj65aGD5vgScvCBmLpdRFtjokvCjSL8" |
---|
95 | 95 | | |
---|
96 | 96 | | let westAssetId = base58'4LHHvYGNKJUg5hj65aGD5vgScvCBmLpdRFtjokvCjSL8' |
---|
97 | 97 | | |
---|
98 | 98 | | let westWxLPTokenAssetId = base58'CaryXC3PhVr1rTxUGk8Bx7CcoxPX9ea3F5RGFiCe98Jr' |
---|
99 | 99 | | |
---|
100 | 100 | | let swopWestPool = addressFromStringValue("3P6DLdJTP2EySq9MFdJu6beUevrQd2sVVBh") |
---|
101 | 101 | | |
---|
102 | 102 | | let wxEggPool = addressFromStringValue("3P3Y38zymCHoTM6qcE9JcEA8rhaGTQbVMgu") |
---|
103 | 103 | | |
---|
104 | 104 | | let eggAssetIdString = "C1iWsKGqLwjHUndiQ7iXpdmPum9PeCDFfyXBdJJosDRS" |
---|
105 | 105 | | |
---|
106 | 106 | | let eggAssetId = base58'C1iWsKGqLwjHUndiQ7iXpdmPum9PeCDFfyXBdJJosDRS' |
---|
107 | 107 | | |
---|
108 | 108 | | let eggWxLPTokenAssetId = base58'EsGs3xQLW8QSRiABfztfVLe8u5a2pvNfkdti4VYes1ms' |
---|
109 | 109 | | |
---|
110 | 110 | | let swopEggPool = addressFromStringValue("3PEeJQRJT4v4XvSUBPmxhdWKz439nae7KtQ") |
---|
111 | 111 | | |
---|
112 | 112 | | let swopPlutoPool = addressFromStringValue("3PDSXwwA2xAtmxeo2bebDP3AA5ynZ2Krgnw") |
---|
113 | 113 | | |
---|
114 | 114 | | let plutoAssetIdString = "Ajso6nTTjptu2UHLx6hfSXVtHFtRBJCkKYd5SAyj7zf5" |
---|
115 | 115 | | |
---|
116 | 116 | | let plutoAssetId = base58'Ajso6nTTjptu2UHLx6hfSXVtHFtRBJCkKYd5SAyj7zf5' |
---|
117 | 117 | | |
---|
118 | 118 | | let puzzlePlutoPool = addressFromStringValue("3P93Kqz8PUbCudvMyjbci54WxQrtBtw4dbZ") |
---|
119 | 119 | | |
---|
120 | 120 | | func getIntegerByKey (key) = valueOrElse(getInteger(this, key), 35) |
---|
121 | 121 | | |
---|
122 | 122 | | |
---|
123 | 123 | | let a = getIntegerByKey("montant") |
---|
124 | 124 | | |
---|
125 | 125 | | @Callable(i) |
---|
126 | 126 | | func set (a) = if ((i.caller != this)) |
---|
127 | 127 | | then throw("you are not allowed to set!") |
---|
128 | 128 | | else [IntegerEntry("montant", a)] |
---|
129 | 129 | | |
---|
130 | 130 | | |
---|
131 | 131 | | |
---|
132 | 132 | | @Callable(i) |
---|
133 | 133 | | func a1 () = if ((i.caller != this)) |
---|
134 | 134 | | then throw("you are not allowed to arb!") |
---|
135 | 135 | | else { |
---|
136 | 136 | | let usdnBalanceBefore = assetBalance(this, usdnAssetId) |
---|
137 | 137 | | if ((usdnBalanceBefore == usdnBalanceBefore)) |
---|
138 | 138 | | then { |
---|
139 | 139 | | let wavesBalanceBefore = wavesBalance(this).available |
---|
140 | 140 | | if ((wavesBalanceBefore == wavesBalanceBefore)) |
---|
141 | 141 | | then { |
---|
142 | 142 | | let buyOnPuzzle = invoke(nonRoutingPuzzlePool, "swap", ["WAVES", 1], [AttachedPayment(usdnAssetId, (a * 1000000))]) |
---|
143 | 143 | | if ((buyOnPuzzle == buyOnPuzzle)) |
---|
144 | 144 | | then { |
---|
145 | 145 | | let wavesBalToSwap = (wavesBalance(this).available - wavesBalanceBefore) |
---|
146 | 146 | | if ((0 >= wavesBalToSwap)) |
---|
147 | 147 | | then throw("nothing to arb") |
---|
148 | 148 | | else { |
---|
149 | 149 | | let putTheTokenInThePool = invoke(wxPool, "putOneTkn", [1, false], [AttachedPayment(unit, wavesBalToSwap)]) |
---|
150 | 150 | | if ((putTheTokenInThePool == putTheTokenInThePool)) |
---|
151 | 151 | | then { |
---|
152 | 152 | | let lpTokenBalance = assetBalance(this, usdnWavesLPTokenAssetId) |
---|
153 | 153 | | if ((lpTokenBalance == lpTokenBalance)) |
---|
154 | 154 | | then { |
---|
155 | 155 | | let sellPoolToken = invoke(wxPool, "getOneTkn", [usdnAssetIdString, 1], [AttachedPayment(usdnWavesLPTokenAssetId, lpTokenBalance)]) |
---|
156 | 156 | | if ((sellPoolToken == sellPoolToken)) |
---|
157 | 157 | | then { |
---|
158 | 158 | | let usdnBalanceAfter = assetBalance(this, usdnAssetId) |
---|
159 | 159 | | if ((usdnBalanceAfter == usdnBalanceAfter)) |
---|
160 | 160 | | then if ((0 >= (usdnBalanceAfter - usdnBalanceBefore))) |
---|
161 | 161 | | then throw("WU PUZZLE -> WX [($_$)]") |
---|
162 | 162 | | else nil |
---|
163 | 163 | | else throw("Strict value is not equal to itself.") |
---|
164 | 164 | | } |
---|
165 | 165 | | else throw("Strict value is not equal to itself.") |
---|
166 | 166 | | } |
---|
167 | 167 | | else throw("Strict value is not equal to itself.") |
---|
168 | 168 | | } |
---|
169 | 169 | | else throw("Strict value is not equal to itself.") |
---|
170 | 170 | | } |
---|
171 | 171 | | } |
---|
172 | 172 | | else throw("Strict value is not equal to itself.") |
---|
173 | 173 | | } |
---|
174 | 174 | | else throw("Strict value is not equal to itself.") |
---|
175 | 175 | | } |
---|
176 | 176 | | else throw("Strict value is not equal to itself.") |
---|
177 | 177 | | } |
---|
178 | 178 | | |
---|
179 | 179 | | |
---|
180 | 180 | | |
---|
181 | 181 | | @Callable(i) |
---|
182 | 182 | | func a2 () = if ((i.caller != this)) |
---|
183 | 183 | | then throw("you are not allowed to arb!") |
---|
184 | 184 | | else { |
---|
185 | 185 | | let usdnBalanceBefore = assetBalance(this, usdnAssetId) |
---|
186 | 186 | | if ((usdnBalanceBefore == usdnBalanceBefore)) |
---|
187 | 187 | | then { |
---|
188 | 188 | | let wavesBalanceBefore = wavesBalance(this).available |
---|
189 | 189 | | if ((wavesBalanceBefore == wavesBalanceBefore)) |
---|
190 | 190 | | then { |
---|
191 | 191 | | let putTheTokenInThePool = invoke(wxPool, "putOneTkn", [1, false], [AttachedPayment(usdnAssetId, (a * 1000000))]) |
---|
192 | 192 | | if ((putTheTokenInThePool == putTheTokenInThePool)) |
---|
193 | 193 | | then { |
---|
194 | 194 | | let lpTokenBalance = assetBalance(this, usdnWavesLPTokenAssetId) |
---|
195 | 195 | | if ((lpTokenBalance == lpTokenBalance)) |
---|
196 | 196 | | then { |
---|
197 | 197 | | let sellPoolToken = invoke(wxPool, "getOneTkn", ["WAVES", 1], [AttachedPayment(usdnWavesLPTokenAssetId, lpTokenBalance)]) |
---|
198 | 198 | | if ((sellPoolToken == sellPoolToken)) |
---|
199 | 199 | | then { |
---|
200 | 200 | | let wavesBalToSwap = (wavesBalance(this).available - wavesBalanceBefore) |
---|
201 | 201 | | if ((0 >= wavesBalToSwap)) |
---|
202 | 202 | | then throw("nothing to arb") |
---|
203 | 203 | | else { |
---|
204 | 204 | | let buyOnPuzzle = invoke(nonRoutingPuzzlePool, "swap", [usdnAssetIdString, 1], [AttachedPayment(unit, wavesBalToSwap)]) |
---|
205 | 205 | | if ((buyOnPuzzle == buyOnPuzzle)) |
---|
206 | 206 | | then { |
---|
207 | 207 | | let usdnBalanceAfter = assetBalance(this, usdnAssetId) |
---|
208 | 208 | | if ((usdnBalanceAfter == usdnBalanceAfter)) |
---|
209 | 209 | | then if ((0 >= (usdnBalanceAfter - usdnBalanceBefore))) |
---|
210 | 210 | | then throw("WU WX -> PUZZLE [($_$)]") |
---|
211 | 211 | | else nil |
---|
212 | 212 | | else throw("Strict value is not equal to itself.") |
---|
213 | 213 | | } |
---|
214 | 214 | | else throw("Strict value is not equal to itself.") |
---|
215 | 215 | | } |
---|
216 | 216 | | } |
---|
217 | 217 | | else throw("Strict value is not equal to itself.") |
---|
218 | 218 | | } |
---|
219 | 219 | | else throw("Strict value is not equal to itself.") |
---|
220 | 220 | | } |
---|
221 | 221 | | else throw("Strict value is not equal to itself.") |
---|
222 | 222 | | } |
---|
223 | 223 | | else throw("Strict value is not equal to itself.") |
---|
224 | 224 | | } |
---|
225 | 225 | | else throw("Strict value is not equal to itself.") |
---|
226 | 226 | | } |
---|
227 | 227 | | |
---|
228 | 228 | | |
---|
229 | 229 | | |
---|
230 | 230 | | @Callable(i) |
---|
231 | 231 | | func a3 () = if ((i.caller != this)) |
---|
232 | 232 | | then throw("you are not allowed to arb!") |
---|
233 | 233 | | else { |
---|
234 | 234 | | let usdnBalanceBefore = assetBalance(this, usdnAssetId) |
---|
235 | 235 | | if ((usdnBalanceBefore == usdnBalanceBefore)) |
---|
236 | 236 | | then { |
---|
237 | 237 | | let buySurfOnPuzzle = invoke(nonRoutingPuzzleSurfPool, "swap", [surfAssetIdString, 1], [AttachedPayment(usdnAssetId, (a * 1000000))]) |
---|
238 | 238 | | if ((buySurfOnPuzzle == buySurfOnPuzzle)) |
---|
239 | 239 | | then { |
---|
240 | 240 | | let surfBalToSwap = assetBalance(this, surfAssetId) |
---|
241 | 241 | | let swapSurfOnSwop = invoke(swopSurfPool, "exchange", [1], [AttachedPayment(surfAssetId, surfBalToSwap)]) |
---|
242 | 242 | | if ((swapSurfOnSwop == swapSurfOnSwop)) |
---|
243 | 243 | | then { |
---|
244 | 244 | | let usdnBalanceAfter = assetBalance(this, usdnAssetId) |
---|
245 | 245 | | if ((usdnBalanceAfter == usdnBalanceAfter)) |
---|
246 | 246 | | then if ((0 >= (usdnBalanceAfter - usdnBalanceBefore))) |
---|
247 | 247 | | then throw("SURF PUZZLE -> SWOP [($_$)]") |
---|
248 | 248 | | else nil |
---|
249 | 249 | | else throw("Strict value is not equal to itself.") |
---|
250 | 250 | | } |
---|
251 | 251 | | else throw("Strict value is not equal to itself.") |
---|
252 | 252 | | } |
---|
253 | 253 | | else throw("Strict value is not equal to itself.") |
---|
254 | 254 | | } |
---|
255 | 255 | | else throw("Strict value is not equal to itself.") |
---|
256 | 256 | | } |
---|
257 | 257 | | |
---|
258 | 258 | | |
---|
259 | 259 | | |
---|
260 | 260 | | @Callable(i) |
---|
261 | 261 | | func a4 () = if ((i.caller != this)) |
---|
262 | 262 | | then throw("you are not allowed to arb!") |
---|
263 | 263 | | else { |
---|
264 | 264 | | let usdnBalanceBefore = assetBalance(this, usdnAssetId) |
---|
265 | 265 | | if ((usdnBalanceBefore == usdnBalanceBefore)) |
---|
266 | 266 | | then { |
---|
267 | 267 | | let swapToSurfOnSwop = invoke(swopSurfPool, "exchange", [1], [AttachedPayment(usdnAssetId, (a * 1000000))]) |
---|
268 | 268 | | if ((swapToSurfOnSwop == swapToSurfOnSwop)) |
---|
269 | 269 | | then { |
---|
270 | 270 | | let surfBalToSwap = assetBalance(this, surfAssetId) |
---|
271 | 271 | | let sellSurfOnPuzzle = invoke(nonRoutingPuzzleSurfPool, "swap", [usdnAssetIdString, 1], [AttachedPayment(surfAssetId, surfBalToSwap)]) |
---|
272 | 272 | | if ((sellSurfOnPuzzle == sellSurfOnPuzzle)) |
---|
273 | 273 | | then { |
---|
274 | 274 | | let usdnBalanceAfter = assetBalance(this, usdnAssetId) |
---|
275 | 275 | | if ((usdnBalanceAfter == usdnBalanceAfter)) |
---|
276 | 276 | | then if ((0 >= (usdnBalanceAfter - usdnBalanceBefore))) |
---|
277 | 277 | | then throw("SURF SWOP -> PUZZLE [($_$)]") |
---|
278 | 278 | | else nil |
---|
279 | 279 | | else throw("Strict value is not equal to itself.") |
---|
280 | 280 | | } |
---|
281 | 281 | | else throw("Strict value is not equal to itself.") |
---|
282 | 282 | | } |
---|
283 | 283 | | else throw("Strict value is not equal to itself.") |
---|
284 | 284 | | } |
---|
285 | 285 | | else throw("Strict value is not equal to itself.") |
---|
286 | 286 | | } |
---|
287 | 287 | | |
---|
288 | 288 | | |
---|
289 | 289 | | |
---|
290 | 290 | | @Callable(i) |
---|
291 | 291 | | func a5 () = if ((i.caller != this)) |
---|
292 | 292 | | then throw("you are not allowed to arb!") |
---|
293 | 293 | | else { |
---|
294 | 294 | | let usdnBalanceBefore = assetBalance(this, usdnAssetId) |
---|
295 | 295 | | if ((usdnBalanceBefore == usdnBalanceBefore)) |
---|
296 | 296 | | then { |
---|
297 | 297 | | let putTheTokenInThePool = invoke(wxWxPool, "putOneTkn", [1, false], [AttachedPayment(usdnAssetId, (a * 1000000))]) |
---|
298 | 298 | | if ((putTheTokenInThePool == putTheTokenInThePool)) |
---|
299 | 299 | | then { |
---|
300 | 300 | | let lpTokenBalance = assetBalance(this, usdnWxLPTokenAssetId) |
---|
301 | 301 | | if ((lpTokenBalance == lpTokenBalance)) |
---|
302 | 302 | | then { |
---|
303 | 303 | | let sellPoolToken = invoke(wxWxPool, "getOneTkn", [wxAssetIdString, 1], [AttachedPayment(usdnWxLPTokenAssetId, lpTokenBalance)]) |
---|
304 | 304 | | if ((sellPoolToken == sellPoolToken)) |
---|
305 | 305 | | then { |
---|
306 | 306 | | let wxBalToSwap = assetBalance(this, wxAssetId) |
---|
307 | 307 | | let swapWxOnSwop = invoke(swopWxPool, "exchange", [1], [AttachedPayment(wxAssetId, wxBalToSwap)]) |
---|
308 | 308 | | if ((swapWxOnSwop == swapWxOnSwop)) |
---|
309 | 309 | | then { |
---|
310 | 310 | | let usdnBalanceAfter = assetBalance(this, usdnAssetId) |
---|
311 | 311 | | if ((usdnBalanceAfter == usdnBalanceAfter)) |
---|
312 | 312 | | then if ((0 >= (usdnBalanceAfter - usdnBalanceBefore))) |
---|
313 | 313 | | then throw("WX WX -> SWOP [($_$)]") |
---|
314 | 314 | | else nil |
---|
315 | 315 | | else throw("Strict value is not equal to itself.") |
---|
316 | 316 | | } |
---|
317 | 317 | | else throw("Strict value is not equal to itself.") |
---|
318 | 318 | | } |
---|
319 | 319 | | else throw("Strict value is not equal to itself.") |
---|
320 | 320 | | } |
---|
321 | 321 | | else throw("Strict value is not equal to itself.") |
---|
322 | 322 | | } |
---|
323 | 323 | | else throw("Strict value is not equal to itself.") |
---|
324 | 324 | | } |
---|
325 | 325 | | else throw("Strict value is not equal to itself.") |
---|
326 | 326 | | } |
---|
327 | 327 | | |
---|
328 | 328 | | |
---|
329 | 329 | | |
---|
330 | 330 | | @Callable(i) |
---|
331 | 331 | | func a6 () = if ((i.caller != this)) |
---|
332 | 332 | | then throw("you are not allowed to arb!") |
---|
333 | 333 | | else { |
---|
334 | 334 | | let usdnBalanceBefore = assetBalance(this, usdnAssetId) |
---|
335 | 335 | | if ((usdnBalanceBefore == usdnBalanceBefore)) |
---|
336 | 336 | | then { |
---|
337 | 337 | | let swapToWxOnSwop = invoke(swopWxPool, "exchange", [1], [AttachedPayment(usdnAssetId, (a * 1000000))]) |
---|
338 | 338 | | if ((swapToWxOnSwop == swapToWxOnSwop)) |
---|
339 | 339 | | then { |
---|
340 | 340 | | let wxBalToSwap = assetBalance(this, wxAssetId) |
---|
341 | 341 | | let putTheTokenInThePool = invoke(wxWxPool, "putOneTkn", [1, false], [AttachedPayment(wxAssetId, wxBalToSwap)]) |
---|
342 | 342 | | if ((putTheTokenInThePool == putTheTokenInThePool)) |
---|
343 | 343 | | then { |
---|
344 | 344 | | let lpTokenBalance = assetBalance(this, usdnWxLPTokenAssetId) |
---|
345 | 345 | | if ((lpTokenBalance == lpTokenBalance)) |
---|
346 | 346 | | then { |
---|
347 | 347 | | let sellPoolToken = invoke(wxWxPool, "getOneTkn", [usdnAssetIdString, 1], [AttachedPayment(usdnWxLPTokenAssetId, lpTokenBalance)]) |
---|
348 | 348 | | if ((sellPoolToken == sellPoolToken)) |
---|
349 | 349 | | then { |
---|
350 | 350 | | let usdnBalanceAfter = assetBalance(this, usdnAssetId) |
---|
351 | 351 | | if ((usdnBalanceAfter == usdnBalanceAfter)) |
---|
352 | 352 | | then if ((0 >= (usdnBalanceAfter - usdnBalanceBefore))) |
---|
353 | 353 | | then throw("WX SWOP -> WX [($_$)]") |
---|
354 | 354 | | else nil |
---|
355 | 355 | | else throw("Strict value is not equal to itself.") |
---|
356 | 356 | | } |
---|
357 | 357 | | else throw("Strict value is not equal to itself.") |
---|
358 | 358 | | } |
---|
359 | 359 | | else throw("Strict value is not equal to itself.") |
---|
360 | 360 | | } |
---|
361 | 361 | | else throw("Strict value is not equal to itself.") |
---|
362 | 362 | | } |
---|
363 | 363 | | else throw("Strict value is not equal to itself.") |
---|
364 | 364 | | } |
---|
365 | 365 | | else throw("Strict value is not equal to itself.") |
---|
366 | 366 | | } |
---|
367 | 367 | | |
---|
368 | 368 | | |
---|
369 | 369 | | |
---|
370 | 370 | | @Callable(i) |
---|
371 | 371 | | func a7 () = if ((i.caller != this)) |
---|
372 | 372 | | then throw("you are not allowed to arb!") |
---|
373 | 373 | | else { |
---|
374 | 374 | | let usdnBalanceBefore = assetBalance(this, usdnAssetId) |
---|
375 | 375 | | if ((usdnBalanceBefore == usdnBalanceBefore)) |
---|
376 | 376 | | then { |
---|
377 | 377 | | let buyUsdcOnPuzzle = invoke(puzzleUsdcPool, "swap", [usdcAssetIdString, 1], [AttachedPayment(usdnAssetId, (a * 1000000))]) |
---|
378 | 378 | | if ((buyUsdcOnPuzzle == buyUsdcOnPuzzle)) |
---|
379 | 379 | | then { |
---|
380 | 380 | | let usdcBalToSwap = assetBalance(this, usdcAssetId) |
---|
381 | 381 | | if ((usdcBalToSwap == usdcBalToSwap)) |
---|
382 | 382 | | then { |
---|
383 | 383 | | let putTheTokenInThePool = invoke(wxUsdcPool, "putOneTknV2", [1, false], [AttachedPayment(usdcAssetId, usdcBalToSwap)]) |
---|
384 | 384 | | if ((putTheTokenInThePool == putTheTokenInThePool)) |
---|
385 | 385 | | then { |
---|
386 | 386 | | let lpTokenBalance = assetBalance(this, usdcWxLPTokenAssetId) |
---|
387 | 387 | | if ((lpTokenBalance == lpTokenBalance)) |
---|
388 | 388 | | then { |
---|
389 | 389 | | let sellPoolToken = invoke(wxUsdcPool, "getOneTknV2", [usdnAssetIdString, 1], [AttachedPayment(usdcWxLPTokenAssetId, lpTokenBalance)]) |
---|
390 | 390 | | if ((sellPoolToken == sellPoolToken)) |
---|
391 | 391 | | then { |
---|
392 | 392 | | let usdnBalanceAfter = assetBalance(this, usdnAssetId) |
---|
393 | 393 | | if ((usdnBalanceAfter == usdnBalanceAfter)) |
---|
394 | 394 | | then if ((0 >= (usdnBalanceAfter - usdnBalanceBefore))) |
---|
395 | 395 | | then throw("USDC PUZZLE -> WX [($_$)]") |
---|
396 | 396 | | else nil |
---|
397 | 397 | | else throw("Strict value is not equal to itself.") |
---|
398 | 398 | | } |
---|
399 | 399 | | else throw("Strict value is not equal to itself.") |
---|
400 | 400 | | } |
---|
401 | 401 | | else throw("Strict value is not equal to itself.") |
---|
402 | 402 | | } |
---|
403 | 403 | | else throw("Strict value is not equal to itself.") |
---|
404 | 404 | | } |
---|
405 | 405 | | else throw("Strict value is not equal to itself.") |
---|
406 | 406 | | } |
---|
407 | 407 | | else throw("Strict value is not equal to itself.") |
---|
408 | 408 | | } |
---|
409 | 409 | | else throw("Strict value is not equal to itself.") |
---|
410 | 410 | | } |
---|
411 | 411 | | |
---|
412 | 412 | | |
---|
413 | 413 | | |
---|
414 | 414 | | @Callable(i) |
---|
415 | 415 | | func a8 () = if ((i.caller != this)) |
---|
416 | 416 | | then throw("you are not allowed to arb!") |
---|
417 | 417 | | else { |
---|
418 | 418 | | let usdnBalanceBefore = assetBalance(this, usdnAssetId) |
---|
419 | 419 | | if ((usdnBalanceBefore == usdnBalanceBefore)) |
---|
420 | 420 | | then { |
---|
421 | 421 | | let putTheTokenInThePool = invoke(wxUsdcPool, "putOneTknV2", [1, false], [AttachedPayment(usdnAssetId, (a * 1000000))]) |
---|
422 | 422 | | if ((putTheTokenInThePool == putTheTokenInThePool)) |
---|
423 | 423 | | then { |
---|
424 | 424 | | let lpTokenBalance = assetBalance(this, usdcWxLPTokenAssetId) |
---|
425 | 425 | | if ((lpTokenBalance == lpTokenBalance)) |
---|
426 | 426 | | then { |
---|
427 | 427 | | let sellPoolToken = invoke(wxUsdcPool, "getOneTknV2", [usdcAssetIdString, 1], [AttachedPayment(usdcWxLPTokenAssetId, lpTokenBalance)]) |
---|
428 | 428 | | if ((sellPoolToken == sellPoolToken)) |
---|
429 | 429 | | then { |
---|
430 | 430 | | let usdcBalToSwap = assetBalance(this, usdcAssetId) |
---|
431 | 431 | | if ((usdcBalToSwap == usdcBalToSwap)) |
---|
432 | 432 | | then { |
---|
433 | 433 | | let sellUsdcOnPuzzle = invoke(puzzleUsdcPool, "swap", [usdnAssetIdString, 1], [AttachedPayment(usdcAssetId, usdcBalToSwap)]) |
---|
434 | 434 | | if ((sellUsdcOnPuzzle == sellUsdcOnPuzzle)) |
---|
435 | 435 | | then { |
---|
436 | 436 | | let usdnBalanceAfter = assetBalance(this, usdnAssetId) |
---|
437 | 437 | | if ((usdnBalanceAfter == usdnBalanceAfter)) |
---|
438 | 438 | | then if ((0 >= (usdnBalanceAfter - usdnBalanceBefore))) |
---|
439 | 439 | | then throw("USDC WX -> PUZZLE [($_$)]") |
---|
440 | 440 | | else nil |
---|
441 | 441 | | else throw("Strict value is not equal to itself.") |
---|
442 | 442 | | } |
---|
443 | 443 | | else throw("Strict value is not equal to itself.") |
---|
444 | 444 | | } |
---|
445 | 445 | | else throw("Strict value is not equal to itself.") |
---|
446 | 446 | | } |
---|
447 | 447 | | else throw("Strict value is not equal to itself.") |
---|
448 | 448 | | } |
---|
449 | 449 | | else throw("Strict value is not equal to itself.") |
---|
450 | 450 | | } |
---|
451 | 451 | | else throw("Strict value is not equal to itself.") |
---|
452 | 452 | | } |
---|
453 | 453 | | else throw("Strict value is not equal to itself.") |
---|
454 | 454 | | } |
---|
455 | 455 | | |
---|
456 | 456 | | |
---|
457 | 457 | | |
---|
458 | 458 | | @Callable(i) |
---|
459 | 459 | | func a9 () = if ((i.caller != this)) |
---|
460 | 460 | | then throw("you are not allowed to arb!") |
---|
461 | 461 | | else { |
---|
462 | 462 | | let usdnBalanceBefore = assetBalance(this, usdnAssetId) |
---|
463 | 463 | | if ((usdnBalanceBefore == usdnBalanceBefore)) |
---|
464 | 464 | | then { |
---|
465 | 465 | | let buyUsdtOnPuzzle = invoke(puzzleUsdtPool, "swap", [usdtAssetIdString, 1], [AttachedPayment(usdnAssetId, (a * 1000000))]) |
---|
466 | 466 | | if ((buyUsdtOnPuzzle == buyUsdtOnPuzzle)) |
---|
467 | 467 | | then { |
---|
468 | 468 | | let usdtBalToSwap = assetBalance(this, usdtAssetId) |
---|
469 | 469 | | if ((usdtBalToSwap == usdtBalToSwap)) |
---|
470 | 470 | | then { |
---|
471 | 471 | | let putTheTokenInThePool = invoke(wxUsdtPool, "putOneTknV2", [1, false], [AttachedPayment(usdtAssetId, usdtBalToSwap)]) |
---|
472 | 472 | | if ((putTheTokenInThePool == putTheTokenInThePool)) |
---|
473 | 473 | | then { |
---|
474 | 474 | | let lpTokenBalance = assetBalance(this, usdtWxLPTokenAssetId) |
---|
475 | 475 | | if ((lpTokenBalance == lpTokenBalance)) |
---|
476 | 476 | | then { |
---|
477 | 477 | | let sellPoolToken = invoke(wxUsdtPool, "getOneTknV2", [usdnAssetIdString, 1], [AttachedPayment(usdtWxLPTokenAssetId, lpTokenBalance)]) |
---|
478 | 478 | | if ((sellPoolToken == sellPoolToken)) |
---|
479 | 479 | | then { |
---|
480 | 480 | | let usdnBalanceAfter = assetBalance(this, usdnAssetId) |
---|
481 | 481 | | if ((usdnBalanceAfter == usdnBalanceAfter)) |
---|
482 | 482 | | then if ((0 >= (usdnBalanceAfter - usdnBalanceBefore))) |
---|
483 | 483 | | then throw("USDT PUZZLE -> WX [($_$)]") |
---|
484 | 484 | | else nil |
---|
485 | 485 | | else throw("Strict value is not equal to itself.") |
---|
486 | 486 | | } |
---|
487 | 487 | | else throw("Strict value is not equal to itself.") |
---|
488 | 488 | | } |
---|
489 | 489 | | else throw("Strict value is not equal to itself.") |
---|
490 | 490 | | } |
---|
491 | 491 | | else throw("Strict value is not equal to itself.") |
---|
492 | 492 | | } |
---|
493 | 493 | | else throw("Strict value is not equal to itself.") |
---|
494 | 494 | | } |
---|
495 | 495 | | else throw("Strict value is not equal to itself.") |
---|
496 | 496 | | } |
---|
497 | 497 | | else throw("Strict value is not equal to itself.") |
---|
498 | 498 | | } |
---|
499 | 499 | | |
---|
500 | 500 | | |
---|
501 | 501 | | |
---|
502 | 502 | | @Callable(i) |
---|
503 | 503 | | func a10 () = if ((i.caller != this)) |
---|
504 | 504 | | then throw("you are not allowed to arb!") |
---|
505 | 505 | | else { |
---|
506 | 506 | | let usdnBalanceBefore = assetBalance(this, usdnAssetId) |
---|
507 | 507 | | if ((usdnBalanceBefore == usdnBalanceBefore)) |
---|
508 | 508 | | then { |
---|
509 | 509 | | let putTheTokenInThePool = invoke(wxUsdtPool, "putOneTknV2", [1, false], [AttachedPayment(usdnAssetId, (a * 1000000))]) |
---|
510 | 510 | | if ((putTheTokenInThePool == putTheTokenInThePool)) |
---|
511 | 511 | | then { |
---|
512 | 512 | | let lpTokenBalance = assetBalance(this, usdtWxLPTokenAssetId) |
---|
513 | 513 | | if ((lpTokenBalance == lpTokenBalance)) |
---|
514 | 514 | | then { |
---|
515 | 515 | | let sellPoolToken = invoke(wxUsdtPool, "getOneTknV2", [usdtAssetIdString, 1], [AttachedPayment(usdtWxLPTokenAssetId, lpTokenBalance)]) |
---|
516 | 516 | | if ((sellPoolToken == sellPoolToken)) |
---|
517 | 517 | | then { |
---|
518 | 518 | | let usdtBalToSwap = assetBalance(this, usdtAssetId) |
---|
519 | 519 | | if ((usdtBalToSwap == usdtBalToSwap)) |
---|
520 | 520 | | then { |
---|
521 | 521 | | let sellUsdtOnPuzzle = invoke(puzzleUsdtPool, "swap", [usdnAssetIdString, 1], [AttachedPayment(usdtAssetId, usdtBalToSwap)]) |
---|
522 | 522 | | if ((sellUsdtOnPuzzle == sellUsdtOnPuzzle)) |
---|
523 | 523 | | then { |
---|
524 | 524 | | let usdnBalanceAfter = assetBalance(this, usdnAssetId) |
---|
525 | 525 | | if ((usdnBalanceAfter == usdnBalanceAfter)) |
---|
526 | 526 | | then if ((0 >= (usdnBalanceAfter - usdnBalanceBefore))) |
---|
527 | 527 | | then throw("USDT WX -> PUZZLE [($_$)]") |
---|
528 | 528 | | else nil |
---|
529 | 529 | | else throw("Strict value is not equal to itself.") |
---|
530 | 530 | | } |
---|
531 | 531 | | else throw("Strict value is not equal to itself.") |
---|
532 | 532 | | } |
---|
533 | 533 | | else throw("Strict value is not equal to itself.") |
---|
534 | 534 | | } |
---|
535 | 535 | | else throw("Strict value is not equal to itself.") |
---|
536 | 536 | | } |
---|
537 | 537 | | else throw("Strict value is not equal to itself.") |
---|
538 | 538 | | } |
---|
539 | 539 | | else throw("Strict value is not equal to itself.") |
---|
540 | 540 | | } |
---|
541 | 541 | | else throw("Strict value is not equal to itself.") |
---|
542 | 542 | | } |
---|
543 | 543 | | |
---|
544 | 544 | | |
---|
545 | 545 | | |
---|
546 | 546 | | @Callable(i) |
---|
547 | 547 | | func a11 () = if ((i.caller != this)) |
---|
548 | 548 | | then throw("you are not allowed to arb!") |
---|
549 | 549 | | else { |
---|
550 | 550 | | let usdnBalanceBefore = assetBalance(this, usdnAssetId) |
---|
551 | 551 | | if ((usdnBalanceBefore == usdnBalanceBefore)) |
---|
552 | 552 | | then { |
---|
553 | 553 | | let buyTsnOnPuzzle = invoke(puzzleTsnPool, "swap", [tsnAssetIdString, 1], [AttachedPayment(usdnAssetId, (a * 1000000))]) |
---|
554 | 554 | | if ((buyTsnOnPuzzle == buyTsnOnPuzzle)) |
---|
555 | 555 | | then { |
---|
556 | 556 | | let tsnBalToSwap = assetBalance(this, tsnAssetId) |
---|
557 | 557 | | if ((tsnBalToSwap == tsnBalToSwap)) |
---|
558 | 558 | | then { |
---|
559 | 559 | | let putTheTokenInThePool = invoke(wxTsnPool, "putOneTkn", [1, false], [AttachedPayment(tsnAssetId, tsnBalToSwap)]) |
---|
560 | 560 | | if ((putTheTokenInThePool == putTheTokenInThePool)) |
---|
561 | 561 | | then { |
---|
562 | 562 | | let lpTokenBalance = assetBalance(this, tsnWxLPTokenAssetId) |
---|
563 | 563 | | if ((lpTokenBalance == lpTokenBalance)) |
---|
564 | 564 | | then { |
---|
565 | 565 | | let sellPoolToken = invoke(wxTsnPool, "getOneTkn", [usdnAssetIdString, 1], [AttachedPayment(tsnWxLPTokenAssetId, lpTokenBalance)]) |
---|
566 | 566 | | if ((sellPoolToken == sellPoolToken)) |
---|
567 | 567 | | then { |
---|
568 | 568 | | let usdnBalanceAfter = assetBalance(this, usdnAssetId) |
---|
569 | 569 | | if ((usdnBalanceAfter == usdnBalanceAfter)) |
---|
570 | 570 | | then if ((0 >= (usdnBalanceAfter - usdnBalanceBefore))) |
---|
571 | 571 | | then throw("TSN PUZZLE -> WX [($_$)]") |
---|
572 | 572 | | else nil |
---|
573 | 573 | | else throw("Strict value is not equal to itself.") |
---|
574 | 574 | | } |
---|
575 | 575 | | else throw("Strict value is not equal to itself.") |
---|
576 | 576 | | } |
---|
577 | 577 | | else throw("Strict value is not equal to itself.") |
---|
578 | 578 | | } |
---|
579 | 579 | | else throw("Strict value is not equal to itself.") |
---|
580 | 580 | | } |
---|
581 | 581 | | else throw("Strict value is not equal to itself.") |
---|
582 | 582 | | } |
---|
583 | 583 | | else throw("Strict value is not equal to itself.") |
---|
584 | 584 | | } |
---|
585 | 585 | | else throw("Strict value is not equal to itself.") |
---|
586 | 586 | | } |
---|
587 | 587 | | |
---|
588 | 588 | | |
---|
589 | 589 | | |
---|
590 | 590 | | @Callable(i) |
---|
591 | 591 | | func a12 () = if ((i.caller != this)) |
---|
592 | 592 | | then throw("you are not allowed to arb!") |
---|
593 | 593 | | else { |
---|
594 | 594 | | let usdnBalanceBefore = assetBalance(this, usdnAssetId) |
---|
595 | 595 | | if ((usdnBalanceBefore == usdnBalanceBefore)) |
---|
596 | 596 | | then { |
---|
597 | 597 | | let putTheTokenInThePool = invoke(wxTsnPool, "putOneTkn", [1, false], [AttachedPayment(usdnAssetId, (a * 1000000))]) |
---|
598 | 598 | | if ((putTheTokenInThePool == putTheTokenInThePool)) |
---|
599 | 599 | | then { |
---|
600 | 600 | | let lpTokenBalance = assetBalance(this, tsnWxLPTokenAssetId) |
---|
601 | 601 | | if ((lpTokenBalance == lpTokenBalance)) |
---|
602 | 602 | | then { |
---|
603 | 603 | | let sellPoolToken = invoke(wxTsnPool, "getOneTkn", [tsnAssetIdString, 1], [AttachedPayment(tsnWxLPTokenAssetId, lpTokenBalance)]) |
---|
604 | 604 | | if ((sellPoolToken == sellPoolToken)) |
---|
605 | 605 | | then { |
---|
606 | 606 | | let tsnBalToSwap = assetBalance(this, tsnAssetId) |
---|
607 | 607 | | if ((tsnBalToSwap == tsnBalToSwap)) |
---|
608 | 608 | | then { |
---|
609 | 609 | | let selltsnOnPuzzle = invoke(puzzleTsnPool, "swap", [usdnAssetIdString, 1], [AttachedPayment(tsnAssetId, tsnBalToSwap)]) |
---|
610 | 610 | | if ((selltsnOnPuzzle == selltsnOnPuzzle)) |
---|
611 | 611 | | then { |
---|
612 | 612 | | let usdnBalanceAfter = assetBalance(this, usdnAssetId) |
---|
613 | 613 | | if ((usdnBalanceAfter == usdnBalanceAfter)) |
---|
614 | 614 | | then if ((0 >= (usdnBalanceAfter - usdnBalanceBefore))) |
---|
615 | 615 | | then throw("TSN WX -> PUZZLE [($_$)]") |
---|
616 | 616 | | else nil |
---|
617 | 617 | | else throw("Strict value is not equal to itself.") |
---|
618 | 618 | | } |
---|
619 | 619 | | else throw("Strict value is not equal to itself.") |
---|
620 | 620 | | } |
---|
621 | 621 | | else throw("Strict value is not equal to itself.") |
---|
622 | 622 | | } |
---|
623 | 623 | | else throw("Strict value is not equal to itself.") |
---|
624 | 624 | | } |
---|
625 | 625 | | else throw("Strict value is not equal to itself.") |
---|
626 | 626 | | } |
---|
627 | 627 | | else throw("Strict value is not equal to itself.") |
---|
628 | 628 | | } |
---|
629 | 629 | | else throw("Strict value is not equal to itself.") |
---|
630 | 630 | | } |
---|
631 | 631 | | |
---|
632 | 632 | | |
---|
633 | 633 | | |
---|
634 | 634 | | @Callable(i) |
---|
635 | 635 | | func a13 () = if ((i.caller != this)) |
---|
636 | 636 | | then throw("you are not allowed to arb!") |
---|
637 | 637 | | else { |
---|
638 | 638 | | let usdnBalanceBefore = assetBalance(this, usdnAssetId) |
---|
639 | 639 | | if ((usdnBalanceBefore == usdnBalanceBefore)) |
---|
640 | 640 | | then { |
---|
641 | 641 | | let putTheTokenInThePool = invoke(wxBtcPool, "putOneTkn", [1, false], [AttachedPayment(usdnAssetId, (a * 1000000))]) |
---|
642 | 642 | | if ((putTheTokenInThePool == putTheTokenInThePool)) |
---|
643 | 643 | | then { |
---|
644 | 644 | | let lpTokenBalance = assetBalance(this, btcWxLPTokenAssetId) |
---|
645 | 645 | | if ((lpTokenBalance == lpTokenBalance)) |
---|
646 | 646 | | then { |
---|
647 | 647 | | let sellPoolToken = invoke(wxBtcPool, "getOneTkn", [btcAssetIdString, 1], [AttachedPayment(btcWxLPTokenAssetId, lpTokenBalance)]) |
---|
648 | 648 | | if ((sellPoolToken == sellPoolToken)) |
---|
649 | 649 | | then { |
---|
650 | 650 | | let btcBalToSwap = assetBalance(this, btcAssetId) |
---|
651 | 651 | | let swapBtcOnSwop = invoke(swopBtcPool, "exchange", [1], [AttachedPayment(btcAssetId, btcBalToSwap)]) |
---|
652 | 652 | | if ((swapBtcOnSwop == swapBtcOnSwop)) |
---|
653 | 653 | | then { |
---|
654 | 654 | | let usdnBalanceAfter = assetBalance(this, usdnAssetId) |
---|
655 | 655 | | if ((usdnBalanceAfter == usdnBalanceAfter)) |
---|
656 | 656 | | then if ((0 >= (usdnBalanceAfter - usdnBalanceBefore))) |
---|
657 | 657 | | then throw("BTC WX -> SWOP [($_$)]") |
---|
658 | 658 | | else nil |
---|
659 | 659 | | else throw("Strict value is not equal to itself.") |
---|
660 | 660 | | } |
---|
661 | 661 | | else throw("Strict value is not equal to itself.") |
---|
662 | 662 | | } |
---|
663 | 663 | | else throw("Strict value is not equal to itself.") |
---|
664 | 664 | | } |
---|
665 | 665 | | else throw("Strict value is not equal to itself.") |
---|
666 | 666 | | } |
---|
667 | 667 | | else throw("Strict value is not equal to itself.") |
---|
668 | 668 | | } |
---|
669 | 669 | | else throw("Strict value is not equal to itself.") |
---|
670 | 670 | | } |
---|
671 | 671 | | |
---|
672 | 672 | | |
---|
673 | 673 | | |
---|
674 | 674 | | @Callable(i) |
---|
675 | 675 | | func a14 () = if ((i.caller != this)) |
---|
676 | 676 | | then throw("you are not allowed to arb!") |
---|
677 | 677 | | else { |
---|
678 | 678 | | let usdnBalanceBefore = assetBalance(this, usdnAssetId) |
---|
679 | 679 | | if ((usdnBalanceBefore == usdnBalanceBefore)) |
---|
680 | 680 | | then { |
---|
681 | 681 | | let swapToBtcOnSwop = invoke(swopBtcPool, "exchange", [1], [AttachedPayment(usdnAssetId, (a * 1000000))]) |
---|
682 | 682 | | if ((swapToBtcOnSwop == swapToBtcOnSwop)) |
---|
683 | 683 | | then { |
---|
684 | 684 | | let btcBalToSwap = assetBalance(this, btcAssetId) |
---|
685 | 685 | | let putTheTokenInThePool = invoke(wxBtcPool, "putOneTkn", [1, false], [AttachedPayment(btcAssetId, btcBalToSwap)]) |
---|
686 | 686 | | if ((putTheTokenInThePool == putTheTokenInThePool)) |
---|
687 | 687 | | then { |
---|
688 | 688 | | let lpTokenBalance = assetBalance(this, btcWxLPTokenAssetId) |
---|
689 | 689 | | if ((lpTokenBalance == lpTokenBalance)) |
---|
690 | 690 | | then { |
---|
691 | 691 | | let sellPoolToken = invoke(wxBtcPool, "getOneTkn", [usdnAssetIdString, 1], [AttachedPayment(btcWxLPTokenAssetId, lpTokenBalance)]) |
---|
692 | 692 | | if ((sellPoolToken == sellPoolToken)) |
---|
693 | 693 | | then { |
---|
694 | 694 | | let usdnBalanceAfter = assetBalance(this, usdnAssetId) |
---|
695 | 695 | | if ((usdnBalanceAfter == usdnBalanceAfter)) |
---|
696 | 696 | | then if ((0 >= (usdnBalanceAfter - usdnBalanceBefore))) |
---|
697 | 697 | | then throw("BTC SWOP -> WX [($_$)]") |
---|
698 | 698 | | else nil |
---|
699 | 699 | | else throw("Strict value is not equal to itself.") |
---|
700 | 700 | | } |
---|
701 | 701 | | else throw("Strict value is not equal to itself.") |
---|
702 | 702 | | } |
---|
703 | 703 | | else throw("Strict value is not equal to itself.") |
---|
704 | 704 | | } |
---|
705 | 705 | | else throw("Strict value is not equal to itself.") |
---|
706 | 706 | | } |
---|
707 | 707 | | else throw("Strict value is not equal to itself.") |
---|
708 | 708 | | } |
---|
709 | 709 | | else throw("Strict value is not equal to itself.") |
---|
710 | 710 | | } |
---|
711 | 711 | | |
---|
712 | 712 | | |
---|
713 | 713 | | |
---|
714 | 714 | | @Callable(i) |
---|
715 | 715 | | func a15 () = if ((i.caller != this)) |
---|
716 | 716 | | then throw("you are not allowed to arb!") |
---|
717 | 717 | | else { |
---|
718 | 718 | | let usdnBalanceBefore = assetBalance(this, usdnAssetId) |
---|
719 | 719 | | if ((usdnBalanceBefore == usdnBalanceBefore)) |
---|
720 | 720 | | then { |
---|
721 | 721 | | let putTheTokenInThePool = invoke(wxEthPool, "putOneTkn", [1, false], [AttachedPayment(usdnAssetId, (a * 1000000))]) |
---|
722 | 722 | | if ((putTheTokenInThePool == putTheTokenInThePool)) |
---|
723 | 723 | | then { |
---|
724 | 724 | | let lpTokenBalance = assetBalance(this, ethWxLPTokenAssetId) |
---|
725 | 725 | | if ((lpTokenBalance == lpTokenBalance)) |
---|
726 | 726 | | then { |
---|
727 | 727 | | let sellPoolToken = invoke(wxEthPool, "getOneTkn", [ethAssetIdString, 1], [AttachedPayment(ethWxLPTokenAssetId, lpTokenBalance)]) |
---|
728 | 728 | | if ((sellPoolToken == sellPoolToken)) |
---|
729 | 729 | | then { |
---|
730 | 730 | | let ethBalToSwap = assetBalance(this, ethAssetId) |
---|
731 | 731 | | let swapEthOnSwop = invoke(swopEthPool, "exchange", [1], [AttachedPayment(ethAssetId, ethBalToSwap)]) |
---|
732 | 732 | | if ((swapEthOnSwop == swapEthOnSwop)) |
---|
733 | 733 | | then { |
---|
734 | 734 | | let usdnBalanceAfter = assetBalance(this, usdnAssetId) |
---|
735 | 735 | | if ((usdnBalanceAfter == usdnBalanceAfter)) |
---|
736 | 736 | | then if ((0 >= (usdnBalanceAfter - usdnBalanceBefore))) |
---|
737 | 737 | | then throw("ETH WX -> SWOP [($_$)]") |
---|
738 | 738 | | else nil |
---|
739 | 739 | | else throw("Strict value is not equal to itself.") |
---|
740 | 740 | | } |
---|
741 | 741 | | else throw("Strict value is not equal to itself.") |
---|
742 | 742 | | } |
---|
743 | 743 | | else throw("Strict value is not equal to itself.") |
---|
744 | 744 | | } |
---|
745 | 745 | | else throw("Strict value is not equal to itself.") |
---|
746 | 746 | | } |
---|
747 | 747 | | else throw("Strict value is not equal to itself.") |
---|
748 | 748 | | } |
---|
749 | 749 | | else throw("Strict value is not equal to itself.") |
---|
750 | 750 | | } |
---|
751 | 751 | | |
---|
752 | 752 | | |
---|
753 | 753 | | |
---|
754 | 754 | | @Callable(i) |
---|
755 | 755 | | func a16 () = if ((i.caller != this)) |
---|
756 | 756 | | then throw("you are not allowed to arb!") |
---|
757 | 757 | | else { |
---|
758 | 758 | | let usdnBalanceBefore = assetBalance(this, usdnAssetId) |
---|
759 | 759 | | if ((usdnBalanceBefore == usdnBalanceBefore)) |
---|
760 | 760 | | then { |
---|
761 | 761 | | let swapToEthOnSwop = invoke(swopEthPool, "exchange", [1], [AttachedPayment(usdnAssetId, (a * 1000000))]) |
---|
762 | 762 | | if ((swapToEthOnSwop == swapToEthOnSwop)) |
---|
763 | 763 | | then { |
---|
764 | 764 | | let ethBalToSwap = assetBalance(this, ethAssetId) |
---|
765 | 765 | | let putTheTokenInThePool = invoke(wxEthPool, "putOneTkn", [1, false], [AttachedPayment(ethAssetId, ethBalToSwap)]) |
---|
766 | 766 | | if ((putTheTokenInThePool == putTheTokenInThePool)) |
---|
767 | 767 | | then { |
---|
768 | 768 | | let lpTokenBalance = assetBalance(this, ethWxLPTokenAssetId) |
---|
769 | 769 | | if ((lpTokenBalance == lpTokenBalance)) |
---|
770 | 770 | | then { |
---|
771 | 771 | | let sellPoolToken = invoke(wxEthPool, "getOneTkn", [usdnAssetIdString, 1], [AttachedPayment(ethWxLPTokenAssetId, lpTokenBalance)]) |
---|
772 | 772 | | if ((sellPoolToken == sellPoolToken)) |
---|
773 | 773 | | then { |
---|
774 | 774 | | let usdnBalanceAfter = assetBalance(this, usdnAssetId) |
---|
775 | 775 | | if ((usdnBalanceAfter == usdnBalanceAfter)) |
---|
776 | 776 | | then if ((0 >= (usdnBalanceAfter - usdnBalanceBefore))) |
---|
777 | 777 | | then throw("ETH SWOP -> WX [($_$)]") |
---|
778 | 778 | | else nil |
---|
779 | 779 | | else throw("Strict value is not equal to itself.") |
---|
780 | 780 | | } |
---|
781 | 781 | | else throw("Strict value is not equal to itself.") |
---|
782 | 782 | | } |
---|
783 | 783 | | else throw("Strict value is not equal to itself.") |
---|
784 | 784 | | } |
---|
785 | 785 | | else throw("Strict value is not equal to itself.") |
---|
786 | 786 | | } |
---|
787 | 787 | | else throw("Strict value is not equal to itself.") |
---|
788 | 788 | | } |
---|
789 | 789 | | else throw("Strict value is not equal to itself.") |
---|
790 | 790 | | } |
---|
791 | 791 | | |
---|
792 | 792 | | |
---|
793 | 793 | | |
---|
794 | 794 | | @Callable(i) |
---|
795 | 795 | | func a17 () = if ((i.caller != this)) |
---|
796 | 796 | | then throw("you are not allowed to arb!") |
---|
797 | 797 | | else { |
---|
798 | 798 | | let usdnBalanceBefore = assetBalance(this, usdnAssetId) |
---|
799 | 799 | | if ((usdnBalanceBefore == usdnBalanceBefore)) |
---|
800 | 800 | | then { |
---|
801 | 801 | | let putTheTokenInThePool = invoke(wxLtcPool, "putOneTkn", [1, false], [AttachedPayment(usdnAssetId, (a * 1000000))]) |
---|
802 | 802 | | if ((putTheTokenInThePool == putTheTokenInThePool)) |
---|
803 | 803 | | then { |
---|
804 | 804 | | let lpTokenBalance = assetBalance(this, ltcWxLPTokenAssetId) |
---|
805 | 805 | | if ((lpTokenBalance == lpTokenBalance)) |
---|
806 | 806 | | then { |
---|
807 | 807 | | let sellPoolToken = invoke(wxLtcPool, "getOneTkn", [ltcAssetIdString, 1], [AttachedPayment(ltcWxLPTokenAssetId, lpTokenBalance)]) |
---|
808 | 808 | | if ((sellPoolToken == sellPoolToken)) |
---|
809 | 809 | | then { |
---|
810 | 810 | | let ltcBalToSwap = assetBalance(this, ltcAssetId) |
---|
811 | 811 | | let swapLtcOnSwop = invoke(swopLtcPool, "exchange", [1], [AttachedPayment(ltcAssetId, ltcBalToSwap)]) |
---|
812 | 812 | | if ((swapLtcOnSwop == swapLtcOnSwop)) |
---|
813 | 813 | | then { |
---|
814 | 814 | | let usdnBalanceAfter = assetBalance(this, usdnAssetId) |
---|
815 | 815 | | if ((usdnBalanceAfter == usdnBalanceAfter)) |
---|
816 | 816 | | then if ((0 >= (usdnBalanceAfter - usdnBalanceBefore))) |
---|
817 | 817 | | then throw("LTC WX -> SWOP [($_$)]") |
---|
818 | 818 | | else nil |
---|
819 | 819 | | else throw("Strict value is not equal to itself.") |
---|
820 | 820 | | } |
---|
821 | 821 | | else throw("Strict value is not equal to itself.") |
---|
822 | 822 | | } |
---|
823 | 823 | | else throw("Strict value is not equal to itself.") |
---|
824 | 824 | | } |
---|
825 | 825 | | else throw("Strict value is not equal to itself.") |
---|
826 | 826 | | } |
---|
827 | 827 | | else throw("Strict value is not equal to itself.") |
---|
828 | 828 | | } |
---|
829 | 829 | | else throw("Strict value is not equal to itself.") |
---|
830 | 830 | | } |
---|
831 | 831 | | |
---|
832 | 832 | | |
---|
833 | 833 | | |
---|
834 | 834 | | @Callable(i) |
---|
835 | 835 | | func a18 () = if ((i.caller != this)) |
---|
836 | 836 | | then throw("you are not allowed to arb!") |
---|
837 | 837 | | else { |
---|
838 | 838 | | let usdnBalanceBefore = assetBalance(this, usdnAssetId) |
---|
839 | 839 | | if ((usdnBalanceBefore == usdnBalanceBefore)) |
---|
840 | 840 | | then { |
---|
841 | 841 | | let swapToLtcOnSwop = invoke(swopLtcPool, "exchange", [1], [AttachedPayment(usdnAssetId, (a * 1000000))]) |
---|
842 | 842 | | if ((swapToLtcOnSwop == swapToLtcOnSwop)) |
---|
843 | 843 | | then { |
---|
844 | 844 | | let ltcBalToSwap = assetBalance(this, ltcAssetId) |
---|
845 | 845 | | let putTheTokenInThePool = invoke(wxLtcPool, "putOneTkn", [1, false], [AttachedPayment(ltcAssetId, ltcBalToSwap)]) |
---|
846 | 846 | | if ((putTheTokenInThePool == putTheTokenInThePool)) |
---|
847 | 847 | | then { |
---|
848 | 848 | | let lpTokenBalance = assetBalance(this, ltcWxLPTokenAssetId) |
---|
849 | 849 | | if ((lpTokenBalance == lpTokenBalance)) |
---|
850 | 850 | | then { |
---|
851 | 851 | | let sellPoolToken = invoke(wxLtcPool, "getOneTkn", [usdnAssetIdString, 1], [AttachedPayment(ltcWxLPTokenAssetId, lpTokenBalance)]) |
---|
852 | 852 | | if ((sellPoolToken == sellPoolToken)) |
---|
853 | 853 | | then { |
---|
854 | 854 | | let usdnBalanceAfter = assetBalance(this, usdnAssetId) |
---|
855 | 855 | | if ((usdnBalanceAfter == usdnBalanceAfter)) |
---|
856 | 856 | | then if ((0 >= (usdnBalanceAfter - usdnBalanceBefore))) |
---|
857 | 857 | | then throw("LTC SWOP -> WX [($_$)]") |
---|
858 | 858 | | else nil |
---|
859 | 859 | | else throw("Strict value is not equal to itself.") |
---|
860 | 860 | | } |
---|
861 | 861 | | else throw("Strict value is not equal to itself.") |
---|
862 | 862 | | } |
---|
863 | 863 | | else throw("Strict value is not equal to itself.") |
---|
864 | 864 | | } |
---|
865 | 865 | | else throw("Strict value is not equal to itself.") |
---|
866 | 866 | | } |
---|
867 | 867 | | else throw("Strict value is not equal to itself.") |
---|
868 | 868 | | } |
---|
869 | 869 | | else throw("Strict value is not equal to itself.") |
---|
870 | 870 | | } |
---|
871 | 871 | | |
---|
872 | 872 | | |
---|
873 | 873 | | |
---|
874 | 874 | | @Callable(i) |
---|
875 | 875 | | func a19 () = if ((i.caller != this)) |
---|
876 | 876 | | then throw("you are not allowed to arb!") |
---|
877 | 877 | | else { |
---|
878 | 878 | | let usdnBalanceBefore = assetBalance(this, usdnAssetId) |
---|
879 | 879 | | if ((usdnBalanceBefore == usdnBalanceBefore)) |
---|
880 | 880 | | then { |
---|
881 | 881 | | let putTheTokenInThePool = invoke(wxWestPool, "putOneTkn", [1, false], [AttachedPayment(usdnAssetId, (a * 1000000))]) |
---|
882 | 882 | | if ((putTheTokenInThePool == putTheTokenInThePool)) |
---|
883 | 883 | | then { |
---|
884 | 884 | | let lpTokenBalance = assetBalance(this, westWxLPTokenAssetId) |
---|
885 | 885 | | if ((lpTokenBalance == lpTokenBalance)) |
---|
886 | 886 | | then { |
---|
887 | 887 | | let sellPoolToken = invoke(wxWestPool, "getOneTkn", [westAssetIdString, 1], [AttachedPayment(westWxLPTokenAssetId, lpTokenBalance)]) |
---|
888 | 888 | | if ((sellPoolToken == sellPoolToken)) |
---|
889 | 889 | | then { |
---|
890 | 890 | | let westBalToSwap = assetBalance(this, westAssetId) |
---|
891 | 891 | | let swapWestOnSwop = invoke(swopWestPool, "exchange", [1], [AttachedPayment(westAssetId, westBalToSwap)]) |
---|
892 | 892 | | if ((swapWestOnSwop == swapWestOnSwop)) |
---|
893 | 893 | | then { |
---|
894 | 894 | | let usdnBalanceAfter = assetBalance(this, usdnAssetId) |
---|
895 | 895 | | if ((usdnBalanceAfter == usdnBalanceAfter)) |
---|
896 | 896 | | then if ((0 >= (usdnBalanceAfter - usdnBalanceBefore))) |
---|
897 | 897 | | then throw("WEST WX -> SWOP [($_$)]") |
---|
898 | 898 | | else nil |
---|
899 | 899 | | else throw("Strict value is not equal to itself.") |
---|
900 | 900 | | } |
---|
901 | 901 | | else throw("Strict value is not equal to itself.") |
---|
902 | 902 | | } |
---|
903 | 903 | | else throw("Strict value is not equal to itself.") |
---|
904 | 904 | | } |
---|
905 | 905 | | else throw("Strict value is not equal to itself.") |
---|
906 | 906 | | } |
---|
907 | 907 | | else throw("Strict value is not equal to itself.") |
---|
908 | 908 | | } |
---|
909 | 909 | | else throw("Strict value is not equal to itself.") |
---|
910 | 910 | | } |
---|
911 | 911 | | |
---|
912 | 912 | | |
---|
913 | 913 | | |
---|
914 | 914 | | @Callable(i) |
---|
915 | 915 | | func a20 () = if ((i.caller != this)) |
---|
916 | 916 | | then throw("you are not allowed to arb!") |
---|
917 | 917 | | else { |
---|
918 | 918 | | let usdnBalanceBefore = assetBalance(this, usdnAssetId) |
---|
919 | 919 | | if ((usdnBalanceBefore == usdnBalanceBefore)) |
---|
920 | 920 | | then { |
---|
921 | 921 | | let swapToWestOnSwop = invoke(swopWestPool, "exchange", [1], [AttachedPayment(usdnAssetId, (a * 1000000))]) |
---|
922 | 922 | | if ((swapToWestOnSwop == swapToWestOnSwop)) |
---|
923 | 923 | | then { |
---|
924 | 924 | | let westBalToSwap = assetBalance(this, westAssetId) |
---|
925 | 925 | | let putTheTokenInThePool = invoke(wxWestPool, "putOneTkn", [1, false], [AttachedPayment(westAssetId, westBalToSwap)]) |
---|
926 | 926 | | if ((putTheTokenInThePool == putTheTokenInThePool)) |
---|
927 | 927 | | then { |
---|
928 | 928 | | let lpTokenBalance = assetBalance(this, westWxLPTokenAssetId) |
---|
929 | 929 | | if ((lpTokenBalance == lpTokenBalance)) |
---|
930 | 930 | | then { |
---|
931 | 931 | | let sellPoolToken = invoke(wxWestPool, "getOneTkn", [usdnAssetIdString, 1], [AttachedPayment(westWxLPTokenAssetId, lpTokenBalance)]) |
---|
932 | 932 | | if ((sellPoolToken == sellPoolToken)) |
---|
933 | 933 | | then { |
---|
934 | 934 | | let usdnBalanceAfter = assetBalance(this, usdnAssetId) |
---|
935 | 935 | | if ((usdnBalanceAfter == usdnBalanceAfter)) |
---|
936 | 936 | | then if ((0 >= (usdnBalanceAfter - usdnBalanceBefore))) |
---|
937 | 937 | | then throw("WEST SWOP -> WX [($_$)]") |
---|
938 | 938 | | else nil |
---|
939 | 939 | | else throw("Strict value is not equal to itself.") |
---|
940 | 940 | | } |
---|
941 | 941 | | else throw("Strict value is not equal to itself.") |
---|
942 | 942 | | } |
---|
943 | 943 | | else throw("Strict value is not equal to itself.") |
---|
944 | 944 | | } |
---|
945 | 945 | | else throw("Strict value is not equal to itself.") |
---|
946 | 946 | | } |
---|
947 | 947 | | else throw("Strict value is not equal to itself.") |
---|
948 | 948 | | } |
---|
949 | 949 | | else throw("Strict value is not equal to itself.") |
---|
950 | 950 | | } |
---|
951 | 951 | | |
---|
952 | 952 | | |
---|
953 | 953 | | |
---|
954 | 954 | | @Callable(i) |
---|
955 | 955 | | func a21 () = if ((i.caller != this)) |
---|
956 | 956 | | then throw("you are not allowed to arb!") |
---|
957 | 957 | | else { |
---|
958 | 958 | | let usdnBalanceBefore = assetBalance(this, usdnAssetId) |
---|
959 | 959 | | if ((usdnBalanceBefore == usdnBalanceBefore)) |
---|
960 | 960 | | then { |
---|
961 | 961 | | let putTheTokenInThePool = invoke(wxEggPool, "putOneTkn", [1, false], [AttachedPayment(usdnAssetId, (a * 1000000))]) |
---|
962 | 962 | | if ((putTheTokenInThePool == putTheTokenInThePool)) |
---|
963 | 963 | | then { |
---|
964 | 964 | | let lpTokenBalance = assetBalance(this, eggWxLPTokenAssetId) |
---|
965 | 965 | | if ((lpTokenBalance == lpTokenBalance)) |
---|
966 | 966 | | then { |
---|
967 | 967 | | let sellPoolToken = invoke(wxEggPool, "getOneTkn", [eggAssetIdString, 1], [AttachedPayment(eggWxLPTokenAssetId, lpTokenBalance)]) |
---|
968 | 968 | | if ((sellPoolToken == sellPoolToken)) |
---|
969 | 969 | | then { |
---|
970 | 970 | | let eggBalToSwap = assetBalance(this, eggAssetId) |
---|
971 | 971 | | let swapEggOnSwop = invoke(swopEggPool, "exchange", [1], [AttachedPayment(eggAssetId, eggBalToSwap)]) |
---|
972 | 972 | | if ((swapEggOnSwop == swapEggOnSwop)) |
---|
973 | 973 | | then { |
---|
974 | 974 | | let usdnBalanceAfter = assetBalance(this, usdnAssetId) |
---|
975 | 975 | | if ((usdnBalanceAfter == usdnBalanceAfter)) |
---|
976 | 976 | | then if ((0 >= (usdnBalanceAfter - usdnBalanceBefore))) |
---|
977 | 977 | | then throw("EGG WX -> SWOP [($_$)]") |
---|
978 | 978 | | else nil |
---|
979 | 979 | | else throw("Strict value is not equal to itself.") |
---|
980 | 980 | | } |
---|
981 | 981 | | else throw("Strict value is not equal to itself.") |
---|
982 | 982 | | } |
---|
983 | 983 | | else throw("Strict value is not equal to itself.") |
---|
984 | 984 | | } |
---|
985 | 985 | | else throw("Strict value is not equal to itself.") |
---|
986 | 986 | | } |
---|
987 | 987 | | else throw("Strict value is not equal to itself.") |
---|
988 | 988 | | } |
---|
989 | 989 | | else throw("Strict value is not equal to itself.") |
---|
990 | 990 | | } |
---|
991 | 991 | | |
---|
992 | 992 | | |
---|
993 | 993 | | |
---|
994 | 994 | | @Callable(i) |
---|
995 | 995 | | func a22 () = if ((i.caller != this)) |
---|
996 | 996 | | then throw("you are not allowed to arb!") |
---|
997 | 997 | | else { |
---|
998 | 998 | | let usdnBalanceBefore = assetBalance(this, usdnAssetId) |
---|
999 | 999 | | if ((usdnBalanceBefore == usdnBalanceBefore)) |
---|
1000 | 1000 | | then { |
---|
1001 | 1001 | | let swapToEggOnSwop = invoke(swopEggPool, "exchange", [1], [AttachedPayment(usdnAssetId, (a * 1000000))]) |
---|
1002 | 1002 | | if ((swapToEggOnSwop == swapToEggOnSwop)) |
---|
1003 | 1003 | | then { |
---|
1004 | 1004 | | let eggBalToSwap = assetBalance(this, eggAssetId) |
---|
1005 | 1005 | | let putTheTokenInThePool = invoke(wxEggPool, "putOneTkn", [1, false], [AttachedPayment(eggAssetId, eggBalToSwap)]) |
---|
1006 | 1006 | | if ((putTheTokenInThePool == putTheTokenInThePool)) |
---|
1007 | 1007 | | then { |
---|
1008 | 1008 | | let lpTokenBalance = assetBalance(this, eggWxLPTokenAssetId) |
---|
1009 | 1009 | | if ((lpTokenBalance == lpTokenBalance)) |
---|
1010 | 1010 | | then { |
---|
1011 | 1011 | | let sellPoolToken = invoke(wxEggPool, "getOneTkn", [usdnAssetIdString, 1], [AttachedPayment(eggWxLPTokenAssetId, lpTokenBalance)]) |
---|
1012 | 1012 | | if ((sellPoolToken == sellPoolToken)) |
---|
1013 | 1013 | | then { |
---|
1014 | 1014 | | let usdnBalanceAfter = assetBalance(this, usdnAssetId) |
---|
1015 | 1015 | | if ((usdnBalanceAfter == usdnBalanceAfter)) |
---|
1016 | 1016 | | then if ((0 >= (usdnBalanceAfter - usdnBalanceBefore))) |
---|
1017 | 1017 | | then throw("EGG SWOP -> WX [($_$)]") |
---|
1018 | 1018 | | else nil |
---|
1019 | 1019 | | else throw("Strict value is not equal to itself.") |
---|
1020 | 1020 | | } |
---|
1021 | 1021 | | else throw("Strict value is not equal to itself.") |
---|
1022 | 1022 | | } |
---|
1023 | 1023 | | else throw("Strict value is not equal to itself.") |
---|
1024 | 1024 | | } |
---|
1025 | 1025 | | else throw("Strict value is not equal to itself.") |
---|
1026 | 1026 | | } |
---|
1027 | 1027 | | else throw("Strict value is not equal to itself.") |
---|
1028 | 1028 | | } |
---|
1029 | 1029 | | else throw("Strict value is not equal to itself.") |
---|
1030 | 1030 | | } |
---|
1031 | 1031 | | |
---|
1032 | 1032 | | |
---|
1033 | 1033 | | |
---|
1034 | 1034 | | @Callable(i) |
---|
1035 | 1035 | | func a23 () = if ((i.caller != this)) |
---|
1036 | 1036 | | then throw("you are not allowed to arb!") |
---|
1037 | 1037 | | else { |
---|
1038 | 1038 | | let usdnBalanceBefore = assetBalance(this, usdnAssetId) |
---|
1039 | 1039 | | if ((usdnBalanceBefore == usdnBalanceBefore)) |
---|
1040 | 1040 | | then { |
---|
1041 | 1041 | | let buyPlutoOnPuzzle = invoke(puzzlePlutoPool, "swap", [plutoAssetIdString, 1], [AttachedPayment(usdnAssetId, (a * 1000000))]) |
---|
1042 | 1042 | | if ((buyPlutoOnPuzzle == buyPlutoOnPuzzle)) |
---|
1043 | 1043 | | then { |
---|
1044 | 1044 | | let plutoBalToSwap = assetBalance(this, plutoAssetId) |
---|
1045 | 1045 | | let swapPlutoOnSwop = invoke(swopPlutoPool, "exchange", [1], [AttachedPayment(plutoAssetId, plutoBalToSwap)]) |
---|
1046 | 1046 | | if ((swapPlutoOnSwop == swapPlutoOnSwop)) |
---|
1047 | 1047 | | then { |
---|
1048 | 1048 | | let usdnBalanceAfter = assetBalance(this, usdnAssetId) |
---|
1049 | 1049 | | if ((usdnBalanceAfter == usdnBalanceAfter)) |
---|
1050 | 1050 | | then if ((0 >= (usdnBalanceAfter - usdnBalanceBefore))) |
---|
1051 | 1051 | | then throw("PLUTO PUZZLE -> SWOP [($_$)]") |
---|
1052 | 1052 | | else nil |
---|
1053 | 1053 | | else throw("Strict value is not equal to itself.") |
---|
1054 | 1054 | | } |
---|
1055 | 1055 | | else throw("Strict value is not equal to itself.") |
---|
1056 | 1056 | | } |
---|
1057 | 1057 | | else throw("Strict value is not equal to itself.") |
---|
1058 | 1058 | | } |
---|
1059 | 1059 | | else throw("Strict value is not equal to itself.") |
---|
1060 | 1060 | | } |
---|
1061 | 1061 | | |
---|
1062 | 1062 | | |
---|
1063 | 1063 | | |
---|
1064 | 1064 | | @Callable(i) |
---|
1065 | 1065 | | func a24 () = if ((i.caller != this)) |
---|
1066 | 1066 | | then throw("you are not allowed to arb!") |
---|
1067 | 1067 | | else { |
---|
1068 | 1068 | | let usdnBalanceBefore = assetBalance(this, usdnAssetId) |
---|
1069 | 1069 | | if ((usdnBalanceBefore == usdnBalanceBefore)) |
---|
1070 | 1070 | | then { |
---|
1071 | 1071 | | let swapToPlutoOnSwop = invoke(swopPlutoPool, "exchange", [1], [AttachedPayment(usdnAssetId, (a * 1000000))]) |
---|
1072 | 1072 | | if ((swapToPlutoOnSwop == swapToPlutoOnSwop)) |
---|
1073 | 1073 | | then { |
---|
1074 | 1074 | | let plutoBalToSwap = assetBalance(this, plutoAssetId) |
---|
1075 | 1075 | | let sellPlutoOnPuzzle = invoke(puzzlePlutoPool, "swap", [usdnAssetIdString, 1], [AttachedPayment(plutoAssetId, plutoBalToSwap)]) |
---|
1076 | 1076 | | if ((sellPlutoOnPuzzle == sellPlutoOnPuzzle)) |
---|
1077 | 1077 | | then { |
---|
1078 | 1078 | | let usdnBalanceAfter = assetBalance(this, usdnAssetId) |
---|
1079 | 1079 | | if ((usdnBalanceAfter == usdnBalanceAfter)) |
---|
1080 | 1080 | | then if ((0 >= (usdnBalanceAfter - usdnBalanceBefore))) |
---|
1081 | 1081 | | then throw("PLUTO SWOP -> PUZZLE [($_$)]") |
---|
1082 | 1082 | | else nil |
---|
1083 | 1083 | | else throw("Strict value is not equal to itself.") |
---|
1084 | 1084 | | } |
---|
1085 | 1085 | | else throw("Strict value is not equal to itself.") |
---|
1086 | 1086 | | } |
---|
1087 | 1087 | | else throw("Strict value is not equal to itself.") |
---|
1088 | 1088 | | } |
---|
1089 | 1089 | | else throw("Strict value is not equal to itself.") |
---|
1090 | 1090 | | } |
---|
1091 | 1091 | | |
---|
1092 | 1092 | | |
---|
1093 | 1093 | | @Verifier(tx) |
---|
1094 | 1094 | | func verify () = sigVerify_128Kb(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) |
---|
1095 | 1095 | | |
---|