tx · 4J4TzApuukBCCo4YSPXpTxmFLDWAFGu2vYfR6MFjJMFC 3N8G95pEaYEhZ4U3m3UrzpEzwBFn5vvXsZH: -0.05100000 Waves 2022.08.02 16:54 [2166952] smart account 3N8G95pEaYEhZ4U3m3UrzpEzwBFn5vvXsZH > SELF 0.00000000 Waves
{ "type": 13, "id": "4J4TzApuukBCCo4YSPXpTxmFLDWAFGu2vYfR6MFjJMFC", "fee": 5100000, "feeAssetId": null, "timestamp": 1659448464653, "version": 2, "chainId": 84, "sender": "3N8G95pEaYEhZ4U3m3UrzpEzwBFn5vvXsZH", "senderPublicKey": "Hj6oyH6As5UWo8fZ1K4hPsEY7nxH3MvhBqDD6axiwjXs", "proofs": [ "4NXWue515yKY4ENEj5kLMSniWygiMvpbsToxzxyfCm4xUX388D2EsnAdzQQDP7Bv5e41NCMw7d7VJRN19GLRnQKC" ], "script": "base64:BgJPCAISABIAEgkKBwEBAQEBAQESDgoMAQEBAQEBAQgICAEBEgUKAwEBARIFCgMBAQESABIDCgEBEgASAwoBCBIAEgMKAQgSAwoBCBIECgIIAXgACWtfb3JhX2tleQIJa19vcmFfa2V5AA9rX29yYV9ibG9ja19rZXkCD2tfb3JhX2Jsb2NrX2tleQAFa19vcmECBWtfb3JhAAlrX2JhbGFuY2UCCWtfYmFsYW5jZQAOa19wb3NpdGlvblNpemUCDmtfcG9zaXRpb25TaXplABBrX3Bvc2l0aW9uTWFyZ2luAhBrX3Bvc2l0aW9uTWFyZ2luABZrX3Bvc2l0aW9uT3Blbk5vdGlvbmFsAhZrX3Bvc2l0aW9uT3Blbk5vdGlvbmFsAC5rX3Bvc2l0aW9uTGFzdFVwZGF0ZWRDdW11bGF0aXZlUHJlbWl1bUZyYWN0aW9uAhJrX3Bvc2l0aW9uRnJhY3Rpb24ADWtfaW5pdGlhbGl6ZWQCDWtfaW5pdGlhbGl6ZWQACGtfcGF1c2VkAghrX3BhdXNlZAAFa19mZWUCBWtfZmVlAA9rX2Z1bmRpbmdQZXJ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91bnQJAMwIAgkA2AQBCQEKcXVvdGVBc3NldAAFA25pbAUDbmlsAwkAAAIFB3Vuc3Rha2UFB3Vuc3Rha2UJAM4IAgkBCHdpdGhkcmF3AgkBEUBleHRyTmF0aXZlKDEwNjIpAQUHX3RyYWRlcgUHX2Ftb3VudAkBDXVwZGF0ZUJhbGFuY2UBCQBlAgkBCGNiYWxhbmNlAAUHX2Ftb3VudAkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgECdHgBBnZlcmlmeQAJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAJAQ5hZG1pblB1YmxpY0tleQCD1+UI", "height": 2166952, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 91v8xQ5aRYVhg5gC1PqePck5ZM6JcGbw5ELvRK9AJ639 Next: Ei9tbgMjGRJbCZMHUkWYzyzJTiQ9XsvKgd1TTUVrLTvn Diff:
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "k_ora_key" | |
83 | 83 | ||
84 | 84 | let O = "k_staking_address" | |
85 | 85 | ||
86 | - | func P () = valueOrErrorMessage(addressFromString(getStringValue(this, I)), "Coordinator not set") | |
86 | + | let P = "k_miner_address" | |
87 | + | ||
88 | + | func Q () = valueOrErrorMessage(addressFromString(getStringValue(this, I)), "Coordinator not set") | |
87 | 89 | ||
88 | 90 | ||
89 | - | func | |
91 | + | func R () = addressFromString(getStringValue(Q(), K)) | |
90 | 92 | ||
91 | 93 | ||
92 | - | func | |
94 | + | func S () = fromBase58String(getStringValue(Q(), L)) | |
93 | 95 | ||
94 | 96 | ||
95 | - | func | |
97 | + | func T () = fromBase58String(getStringValue(Q(), M)) | |
96 | 98 | ||
97 | 99 | ||
98 | - | func | |
100 | + | func U () = valueOrErrorMessage(addressFromString(getStringValue(Q(), N)), "Quote asset staking not set") | |
99 | 101 | ||
100 | 102 | ||
101 | - | func | |
103 | + | func V () = valueOrErrorMessage(addressFromString(getStringValue(Q(), O)), "Insurance not set") | |
102 | 104 | ||
103 | 105 | ||
104 | - | func | |
106 | + | func W () = valueOrErrorMessage(addressFromString(getStringValue(Q(), J)), "Insurance not set") | |
105 | 107 | ||
106 | 108 | ||
107 | - | let W = 1 | |
108 | - | ||
109 | - | let X = 2 | |
110 | - | ||
111 | - | let Y = 60 | |
112 | - | ||
113 | - | let Z = 15 | |
114 | - | ||
115 | - | let aa = 15 | |
116 | - | ||
117 | - | let ab = 1000 | |
118 | - | ||
119 | - | let ac = (1 * (((((10 * 10) * 10) * 10) * 10) * 10)) | |
120 | - | ||
121 | - | let ad = (100 * ac) | |
122 | - | ||
123 | - | let ae = (86400 * ac) | |
124 | - | ||
125 | - | let af = 100 | |
126 | - | ||
127 | - | let ag = 1 | |
128 | - | ||
129 | - | let ah = 2 | |
130 | - | ||
131 | - | func ai (aj) = (toString(aj) + ",") | |
109 | + | func X () = valueOrErrorMessage(addressFromString(getStringValue(Q(), P)), "Insurance not set") | |
132 | 110 | ||
133 | 111 | ||
134 | - | func ak (aj,al) = fraction(aj, ac, al, HALFEVEN) | |
112 | + | let Y = 1 | |
113 | + | ||
114 | + | let Z = 2 | |
115 | + | ||
116 | + | let aa = 60 | |
117 | + | ||
118 | + | let ab = 15 | |
119 | + | ||
120 | + | let ac = 15 | |
121 | + | ||
122 | + | let ad = 1000 | |
123 | + | ||
124 | + | let ae = (1 * (((((10 * 10) * 10) * 10) * 10) * 10)) | |
125 | + | ||
126 | + | let af = (100 * ae) | |
127 | + | ||
128 | + | let ag = (86400 * ae) | |
129 | + | ||
130 | + | let ah = 100 | |
131 | + | ||
132 | + | let ai = 1 | |
133 | + | ||
134 | + | let aj = 2 | |
135 | + | ||
136 | + | func ak (al) = (toString(al) + ",") | |
135 | 137 | ||
136 | 138 | ||
137 | - | func am ( | |
139 | + | func am (al,an) = fraction(al, ae, an, HALFEVEN) | |
138 | 140 | ||
139 | 141 | ||
140 | - | func an (aj) = if ((aj > 0)) | |
141 | - | then aj | |
142 | - | else -(aj) | |
142 | + | func ao (al,an) = fraction(al, an, ae, HALFEVEN) | |
143 | 143 | ||
144 | 144 | ||
145 | - | func | |
146 | - | then | |
147 | - | else al | |
145 | + | func ap (al) = if ((al > 0)) | |
146 | + | then al | |
147 | + | else -(al) | |
148 | 148 | ||
149 | 149 | ||
150 | - | func ap (aq,ar) = ((aq + "_") + ar) | |
150 | + | func aq (al,an) = if ((al >= an)) | |
151 | + | then al | |
152 | + | else an | |
151 | 153 | ||
152 | 154 | ||
153 | - | func as (at) = { | |
154 | - | func au (av,aw) = ((av + aw) + ",") | |
155 | + | func ar (as,at) = ((as + "_") + at) | |
155 | 156 | ||
156 | - | let ax = { | |
157 | - | let ay = at | |
158 | - | let az = size(ay) | |
159 | - | let aA = "" | |
160 | - | func aB (aC,aD) = if ((aD >= az)) | |
161 | - | then aC | |
162 | - | else au(aC, ay[aD]) | |
163 | 157 | ||
164 | - | func aE (aC,aD) = if ((aD >= az)) | |
165 | - | then aC | |
158 | + | func au (av) = { | |
159 | + | func aw (ax,ay) = ((ax + ay) + ",") | |
160 | + | ||
161 | + | let az = { | |
162 | + | let aA = av | |
163 | + | let aB = size(aA) | |
164 | + | let aC = "" | |
165 | + | func aD (aE,aF) = if ((aF >= aB)) | |
166 | + | then aE | |
167 | + | else aw(aE, aA[aF]) | |
168 | + | ||
169 | + | func aG (aE,aF) = if ((aF >= aB)) | |
170 | + | then aE | |
166 | 171 | else throw("List size exceeds 20") | |
167 | 172 | ||
168 | - | | |
173 | + | aG(aD(aD(aD(aD(aD(aD(aD(aD(aD(aD(aD(aD(aD(aD(aD(aD(aD(aD(aD(aD(aC, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20) | |
169 | 174 | } | |
170 | - | let | |
171 | - | let | |
172 | - | then drop( | |
173 | - | else | |
174 | - | | |
175 | + | let aH = dropRight(az, 1) | |
176 | + | let aI = if ((take(aH, 1) == ",")) | |
177 | + | then drop(aH, 1) | |
178 | + | else aH | |
179 | + | aI | |
175 | 180 | } | |
176 | 181 | ||
177 | 182 | ||
178 | - | func | |
183 | + | func aJ (aK) = split(aK, ",") | |
179 | 184 | ||
180 | 185 | ||
181 | - | func | |
182 | - | then (removeByIndex( | |
183 | - | else ( | |
186 | + | func aL (av,aM,aN) = if ((size(av) > aM)) | |
187 | + | then (removeByIndex(av, 0) :+ aN) | |
188 | + | else (av :+ aN) | |
184 | 189 | ||
185 | 190 | ||
186 | - | func | |
191 | + | func aO (aP) = valueOrErrorMessage(getInteger(this, aP), ("no value for " + aP)) | |
187 | 192 | ||
188 | 193 | ||
189 | - | func | |
194 | + | func aQ () = aO(d) | |
190 | 195 | ||
191 | 196 | ||
192 | - | func | |
197 | + | func aR () = aO(k) | |
193 | 198 | ||
194 | 199 | ||
195 | - | func | |
200 | + | func aS () = aO(m) | |
196 | 201 | ||
197 | 202 | ||
198 | - | func | |
203 | + | func aT () = aO(B) | |
199 | 204 | ||
200 | 205 | ||
201 | - | func | |
206 | + | func aU () = aO(C) | |
202 | 207 | ||
203 | 208 | ||
204 | - | func | |
209 | + | func aV () = aO(D) | |
205 | 210 | ||
206 | 211 | ||
207 | - | func | |
212 | + | func aW () = aO(G) | |
208 | 213 | ||
209 | 214 | ||
210 | - | func | |
215 | + | func aX () = aO(H) | |
211 | 216 | ||
212 | 217 | ||
213 | - | func | |
218 | + | func aY () = aO(y) | |
214 | 219 | ||
215 | 220 | ||
216 | - | func | |
221 | + | func aZ () = aO(l) | |
217 | 222 | ||
218 | 223 | ||
219 | - | func | |
224 | + | func ba () = (aZ() * ae) | |
220 | 225 | ||
221 | 226 | ||
222 | - | func | |
227 | + | func bb () = (aZ() * ad) | |
223 | 228 | ||
224 | 229 | ||
225 | - | func | |
230 | + | func bc () = aO(n) | |
226 | 231 | ||
227 | 232 | ||
228 | - | func | |
233 | + | func bd () = aO(o) | |
229 | 234 | ||
230 | 235 | ||
231 | - | func | |
236 | + | func be () = aO(p) | |
232 | 237 | ||
233 | 238 | ||
234 | - | func | |
239 | + | func bf () = aO(q) | |
235 | 240 | ||
236 | 241 | ||
237 | - | func | |
242 | + | func bg () = aO(w) | |
238 | 243 | ||
239 | 244 | ||
240 | - | func | |
245 | + | func bh () = aO(x) | |
241 | 246 | ||
242 | 247 | ||
243 | - | func | |
248 | + | func bi () = aO(F) | |
244 | 249 | ||
245 | 250 | ||
246 | - | func | |
251 | + | func bj () = aO(E) | |
247 | 252 | ||
248 | 253 | ||
249 | - | func | |
250 | - | let | |
251 | - | if (if ( | |
252 | - | then (0 > | |
254 | + | func bk (bl,bm,bn) = { | |
255 | + | let bo = (bl - bm) | |
256 | + | if (if (bn) | |
257 | + | then (0 > bo) | |
253 | 258 | else false) | |
254 | 259 | then throw("Invalid margin") | |
255 | - | else if (if (!( | |
256 | - | then ( | |
260 | + | else if (if (!(bn)) | |
261 | + | then (bo >= 0) | |
257 | 262 | else false) | |
258 | 263 | then throw("Invalid margin") | |
259 | 264 | else true | |
260 | 265 | } | |
261 | 266 | ||
262 | 267 | ||
263 | - | func | |
268 | + | func bp (bq) = if ((bq == 0)) | |
264 | 269 | then throw("Should not be called with _positionSize == 0") | |
265 | - | else if (( | |
266 | - | then | |
267 | - | else | |
270 | + | else if ((bq > 0)) | |
271 | + | then bg() | |
272 | + | else bh() | |
268 | 273 | ||
269 | 274 | ||
270 | - | func | |
271 | - | let | |
272 | - | let | |
273 | - | if ($isInstanceOf( | |
275 | + | func br (bs) = { | |
276 | + | let bt = getInteger(this, ar(e, bs)) | |
277 | + | let bu = bt | |
278 | + | if ($isInstanceOf(bu, "Int")) | |
274 | 279 | then { | |
275 | - | let | |
276 | - | $Tuple4( | |
280 | + | let bv = bu | |
281 | + | $Tuple4(bv, getIntegerValue(this, ar(f, bs)), getIntegerValue(this, ar(g, bs)), getIntegerValue(this, ar(h, bs))) | |
277 | 282 | } | |
278 | 283 | else $Tuple4(0, 0, 0, 0) | |
279 | 284 | } | |
280 | 285 | ||
281 | 286 | ||
282 | - | func | |
287 | + | func bw (bs) = if ((br(bs)._1 == 0)) | |
283 | 288 | then throw("No open position") | |
284 | 289 | else true | |
285 | 290 | ||
286 | 291 | ||
287 | - | func | |
292 | + | func bx () = valueOrElse(getBoolean(this, i), false) | |
288 | 293 | ||
289 | 294 | ||
290 | - | func | |
295 | + | func by () = valueOrElse(getBoolean(this, j), false) | |
291 | 296 | ||
292 | 297 | ||
293 | - | func | |
298 | + | func bz (bA,bB,bC) = if (bA) | |
294 | 299 | then { | |
295 | - | let | |
296 | - | if ((0 >= | |
300 | + | let bD = (aU() - bC) | |
301 | + | if ((0 >= bD)) | |
297 | 302 | then throw("Tx lead to base asset reserve <= 0, revert") | |
298 | - | else $Tuple4(( | |
303 | + | else $Tuple4((aT() + bB), bD, (aV() + bC), (aW() + bB)) | |
299 | 304 | } | |
300 | 305 | else { | |
301 | - | let | |
302 | - | if ((0 >= | |
306 | + | let bE = (aT() - bB) | |
307 | + | if ((0 >= bE)) | |
303 | 308 | then throw("Tx lead to base quote reserve <= 0, revert") | |
304 | - | else $Tuple4( | |
309 | + | else $Tuple4(bE, (aU() + bC), (aV() - bC), (aW() - bB)) | |
305 | 310 | } | |
306 | 311 | ||
307 | 312 | ||
308 | - | func | |
309 | - | let | |
310 | - | let | |
311 | - | let | |
312 | - | let | |
313 | - | let | |
314 | - | let | |
315 | - | then ( | |
316 | - | else ( | |
317 | - | let | |
318 | - | let | |
319 | - | let | |
320 | - | then | |
321 | - | else -( | |
322 | - | let | |
323 | - | let | |
324 | - | if (( | |
325 | - | then throw(((("Price impact " + toString( | |
313 | + | func bF (bA,bB) = { | |
314 | + | let bG = aT() | |
315 | + | let bH = aU() | |
316 | + | let bI = am(bG, bH) | |
317 | + | let bJ = ao(bB, bI) | |
318 | + | let aP = ao(bG, bH) | |
319 | + | let bK = if (bA) | |
320 | + | then (bG + bB) | |
321 | + | else (bG - bB) | |
322 | + | let bL = am(aP, bK) | |
323 | + | let bM = ap((bL - bH)) | |
324 | + | let bN = if (bA) | |
325 | + | then bM | |
326 | + | else -(bM) | |
327 | + | let bO = ((bJ - bM) / bJ) | |
328 | + | let bP = bf() | |
329 | + | if ((bO > bP)) | |
330 | + | then throw(((("Price impact " + toString(bO)) + " > max price impact ") + toString(bP))) | |
326 | 331 | else { | |
327 | - | let | |
328 | - | let | |
329 | - | let | |
330 | - | let | |
331 | - | let | |
332 | - | $Tuple5( | |
332 | + | let bQ = bz(bA, bB, bM) | |
333 | + | let bR = bQ._1 | |
334 | + | let bS = bQ._2 | |
335 | + | let bT = bQ._3 | |
336 | + | let bU = bQ._4 | |
337 | + | $Tuple5(bN, bR, bS, bT, bU) | |
333 | 338 | } | |
334 | 339 | } | |
335 | 340 | ||
336 | 341 | ||
337 | - | func | |
338 | - | let | |
342 | + | func bV (bW,bX,bY,bZ) = { | |
343 | + | let ca = if ((bW != 0)) | |
339 | 344 | then { | |
340 | - | let | |
341 | - | | |
345 | + | let cb = bp(bW) | |
346 | + | ao((cb - bY), bW) | |
342 | 347 | } | |
343 | 348 | else 0 | |
344 | - | let | |
345 | - | let | |
346 | - | then $Tuple2(0, | |
347 | - | else $Tuple2( | |
348 | - | let | |
349 | - | let | |
350 | - | $Tuple3( | |
349 | + | let cc = ((bZ - ca) + bX) | |
350 | + | let cd = if ((0 > cc)) | |
351 | + | then $Tuple2(0, ap(cc)) | |
352 | + | else $Tuple2(ap(cc), 0) | |
353 | + | let ce = cd._1 | |
354 | + | let cf = cd._2 | |
355 | + | $Tuple3(ce, cf, ca) | |
351 | 356 | } | |
352 | 357 | ||
353 | 358 | ||
354 | - | func | |
355 | - | let | |
356 | - | let | |
357 | - | if (( | |
359 | + | func cg (bA,bC) = { | |
360 | + | let ch = aT() | |
361 | + | let ci = aU() | |
362 | + | if ((bC == 0)) | |
358 | 363 | then throw("Invalid base asset amount") | |
359 | 364 | else { | |
360 | - | let | |
361 | - | let | |
362 | - | then ( | |
363 | - | else ( | |
364 | - | let | |
365 | - | let | |
366 | - | let | |
367 | - | let | |
368 | - | let | |
369 | - | let | |
370 | - | let | |
371 | - | $Tuple7( | |
372 | - | then | |
373 | - | else 0)), ( | |
374 | - | then | |
365 | + | let aP = ao(ch, ci) | |
366 | + | let cj = if (bA) | |
367 | + | then (ci + bC) | |
368 | + | else (ci - bC) | |
369 | + | let ck = am(aP, cj) | |
370 | + | let cl = ap((ck - ch)) | |
371 | + | let cm = bz(!(bA), cl, bC) | |
372 | + | let bR = cm._1 | |
373 | + | let bS = cm._2 | |
374 | + | let bT = cm._3 | |
375 | + | let bU = cm._4 | |
376 | + | $Tuple7(cl, bR, bS, bT, bU, (bj() - (if (bA) | |
377 | + | then ap(bC) | |
378 | + | else 0)), (bi() - (if (!(bA)) | |
379 | + | then ap(bC) | |
375 | 380 | else 0))) | |
376 | 381 | } | |
377 | 382 | } | |
378 | 383 | ||
379 | 384 | ||
380 | - | func | |
381 | - | let | |
382 | - | let | |
383 | - | let | |
384 | - | let | |
385 | - | | |
385 | + | func cn () = { | |
386 | + | let co = valueOrErrorMessage(addressFromString(getStringValue(this, c)), "") | |
387 | + | let cp = getStringValue(this, a) | |
388 | + | let cq = getStringValue(this, b) | |
389 | + | let cr = getIntegerValue(co, cp) | |
390 | + | cr | |
386 | 391 | } | |
387 | 392 | ||
388 | 393 | ||
389 | - | func | |
390 | - | let | |
391 | - | let | |
392 | - | | |
394 | + | func cs () = { | |
395 | + | let ch = aT() | |
396 | + | let ci = aU() | |
397 | + | am(ch, ci) | |
393 | 398 | } | |
394 | 399 | ||
395 | 400 | ||
396 | - | func | |
397 | - | let | |
398 | - | let | |
399 | - | ( | |
401 | + | func ct () = { | |
402 | + | let cu = cn() | |
403 | + | let cv = cs() | |
404 | + | (am(ap((cu - cv)), cu) > be()) | |
400 | 405 | } | |
401 | 406 | ||
402 | 407 | ||
403 | - | func | |
404 | - | let | |
405 | - | let | |
406 | - | let | |
407 | - | let | |
408 | - | let | |
409 | - | let | |
410 | - | if (( | |
408 | + | func cw (bs,cx) = { | |
409 | + | let cy = br(bs) | |
410 | + | let bv = cy._1 | |
411 | + | let cz = cy._2 | |
412 | + | let cA = cy._3 | |
413 | + | let cB = cy._4 | |
414 | + | let cC = ap(bv) | |
415 | + | if ((cC == 0)) | |
411 | 416 | then throw("Invalid position size") | |
412 | 417 | else { | |
413 | - | let | |
414 | - | let | |
418 | + | let cD = (0 > bv) | |
419 | + | let cE = if ((cx == ai)) | |
415 | 420 | then { | |
416 | - | let | |
417 | - | let | |
418 | - | let | |
419 | - | let | |
420 | - | let | |
421 | - | | |
421 | + | let cF = cg(!(cD), cC) | |
422 | + | let cG = cF._1 | |
423 | + | let cH = cF._2 | |
424 | + | let cI = cF._3 | |
425 | + | let cJ = cF._4 | |
426 | + | cG | |
422 | 427 | } | |
423 | - | else | |
424 | - | let | |
425 | - | then ( | |
426 | - | else ( | |
427 | - | $Tuple2( | |
428 | + | else ao(cC, cn()) | |
429 | + | let cK = if (cD) | |
430 | + | then (cA - cE) | |
431 | + | else (cE - cA) | |
432 | + | $Tuple2(cE, cK) | |
428 | 433 | } | |
429 | 434 | } | |
430 | 435 | ||
431 | 436 | ||
432 | - | func | |
437 | + | func cL (cM,cN,cO) = am((cM - cN), cO) | |
433 | 438 | ||
434 | 439 | ||
435 | - | func | |
436 | - | let | |
437 | - | let | |
438 | - | let | |
439 | - | let | |
440 | - | let | |
441 | - | let | |
442 | - | let | |
443 | - | let | |
444 | - | let | |
445 | - | let | |
446 | - | let | |
447 | - | | |
440 | + | func cP (bs,cx) = { | |
441 | + | let cQ = br(bs) | |
442 | + | let bv = cQ._1 | |
443 | + | let cz = cQ._2 | |
444 | + | let cR = cQ._3 | |
445 | + | let cB = cQ._4 | |
446 | + | let cS = cw(bs, cx) | |
447 | + | let cE = cS._1 | |
448 | + | let cK = cS._2 | |
449 | + | let cT = bV(bv, cz, cB, cK) | |
450 | + | let ce = cT._1 | |
451 | + | let cf = cT._2 | |
452 | + | cL(ce, cf, cE) | |
448 | 453 | } | |
449 | 454 | ||
450 | 455 | ||
451 | - | func | |
456 | + | func cU (bs) = cP(bs, ai) | |
452 | 457 | ||
453 | 458 | ||
454 | - | func | |
455 | - | let | |
456 | - | let | |
457 | - | let | |
458 | - | let | |
459 | - | let | |
460 | - | let | |
461 | - | let | |
462 | - | let | |
463 | - | let | |
464 | - | let | |
465 | - | let | |
466 | - | let | |
467 | - | let | |
468 | - | let | |
469 | - | let | |
470 | - | let | |
471 | - | let | |
472 | - | let | |
473 | - | let | |
474 | - | let | |
475 | - | let | |
476 | - | let | |
477 | - | let | |
478 | - | $Tuple12( | |
459 | + | func cV (bs) = { | |
460 | + | let cW = br(bs) | |
461 | + | let bv = cW._1 | |
462 | + | let cz = cW._2 | |
463 | + | let cA = cW._3 | |
464 | + | let cB = cW._4 | |
465 | + | let cX = cw(bs, ai) | |
466 | + | let cH = cX._1 | |
467 | + | let cK = cX._2 | |
468 | + | let cY = bV(bv, cz, cB, cK) | |
469 | + | let ce = cY._1 | |
470 | + | let cf = cY._2 | |
471 | + | let cZ = -(bv) | |
472 | + | let da = cK | |
473 | + | let db = -(ce) | |
474 | + | let dc = cg((bv > 0), ap(bv)) | |
475 | + | let dd = dc._1 | |
476 | + | let bK = dc._2 | |
477 | + | let bL = dc._3 | |
478 | + | let de = dc._4 | |
479 | + | let df = dc._5 | |
480 | + | let dg = dc._6 | |
481 | + | let dh = dc._7 | |
482 | + | let di = (aX() - cA) | |
483 | + | $Tuple12(cZ, cf, da, db, bK, bL, de, df, di, dd, dg, dh) | |
479 | 484 | } | |
480 | 485 | ||
481 | 486 | ||
482 | - | func | |
483 | - | let | |
484 | - | let | |
485 | - | let | |
486 | - | let | |
487 | - | func | |
488 | - | then ( | |
489 | - | else | |
487 | + | func dj () = { | |
488 | + | let dk = ((lastBlock.timestamp / 1000) / 60) | |
489 | + | let dl = (dk - ab) | |
490 | + | let dm = valueOrElse(getString(this, r), "") | |
491 | + | let dn = split(dm, ",") | |
492 | + | func do (ax,dp) = if ((dl >= parseIntValue(dp))) | |
493 | + | then (ax :+ parseIntValue(dp)) | |
494 | + | else ax | |
490 | 495 | ||
491 | - | let | |
492 | - | let | |
493 | - | let | |
494 | - | let | |
495 | - | func | |
496 | - | then | |
497 | - | else | |
496 | + | let dq = { | |
497 | + | let aA = dn | |
498 | + | let aB = size(aA) | |
499 | + | let aC = nil | |
500 | + | func aD (aE,aF) = if ((aF >= aB)) | |
501 | + | then aE | |
502 | + | else do(aE, aA[aF]) | |
498 | 503 | ||
499 | - | func | |
500 | - | then | |
504 | + | func aG (aE,aF) = if ((aF >= aB)) | |
505 | + | then aE | |
501 | 506 | else throw("List size exceeds 20") | |
502 | 507 | ||
503 | - | | |
508 | + | aG(aD(aD(aD(aD(aD(aD(aD(aD(aD(aD(aD(aD(aD(aD(aD(aD(aD(aD(aD(aD(aC, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20) | |
504 | 509 | } | |
505 | - | let | |
506 | - | then max( | |
507 | - | else parseIntValue( | |
508 | - | let | |
509 | - | let | |
510 | - | let | |
511 | - | let | |
512 | - | let | |
513 | - | let | |
514 | - | let | |
515 | - | (( | |
510 | + | let dr = if ((size(dq) > 0)) | |
511 | + | then max(dq) | |
512 | + | else parseIntValue(dn[0]) | |
513 | + | let ds = valueOrElse(getInteger(this, s), 0) | |
514 | + | let dt = valueOrElse(getInteger(this, ((t + "_") + toString(ds))), 0) | |
515 | + | let du = valueOrElse(getInteger(this, ((u + "_") + toString(ds))), 0) | |
516 | + | let dv = (dt + ((dk - ds) * du)) | |
517 | + | let dw = valueOrElse(getInteger(this, ((t + "_") + toString(dr))), 0) | |
518 | + | let dx = valueOrElse(getInteger(this, ((u + "_") + toString(dr))), 0) | |
519 | + | let dy = (dw + ((dl - dr) * dx)) | |
520 | + | ((dv - dy) / ab) | |
516 | 521 | } | |
517 | 522 | ||
518 | 523 | ||
519 | - | func | |
524 | + | func dz (dA,dB,dC,dD,dE,dF,dG) = [IntegerEntry(m, dA), IntegerEntry(n, dB), IntegerEntry(o, dC), IntegerEntry(l, dD), IntegerEntry(k, dE), IntegerEntry(p, dF), IntegerEntry(q, dG)] | |
520 | 525 | ||
521 | 526 | ||
522 | - | func | |
527 | + | func dH (dI,dJ,dK,dL,dM) = [IntegerEntry(y, dI), IntegerEntry(w, dJ), IntegerEntry(x, dK), IntegerEntry(z, dL), IntegerEntry(A, dM)] | |
523 | 528 | ||
524 | 529 | ||
525 | - | func | |
530 | + | func dN (at,dO,dP,dQ,cb) = [IntegerEntry(ar(e, at), dO), IntegerEntry(ar(f, at), dP), IntegerEntry(ar(g, at), dQ), IntegerEntry(ar(h, at), cb)] | |
526 | 531 | ||
527 | 532 | ||
528 | - | func | |
529 | - | let | |
530 | - | let | |
531 | - | if (( | |
533 | + | func dR (dS) = { | |
534 | + | let dk = ((lastBlock.timestamp / 1000) / 60) | |
535 | + | let dT = valueOrElse(getInteger(this, s), 0) | |
536 | + | if ((dT > dk)) | |
532 | 537 | then throw("TWAP out-of-order") | |
533 | 538 | else { | |
534 | - | let | |
535 | - | then | |
536 | - | else | |
537 | - | if (( | |
539 | + | let ds = if ((dT == 0)) | |
540 | + | then dk | |
541 | + | else dT | |
542 | + | if ((dk > dT)) | |
538 | 543 | then { | |
539 | - | let | |
540 | - | let | |
541 | - | let | |
542 | - | let | |
543 | - | [IntegerEntry( | |
544 | + | let dU = valueOrElse(getInteger(this, ((t + "_") + toString(dT))), 0) | |
545 | + | let dV = valueOrElse(getInteger(this, ((u + "_") + toString(dT))), dS) | |
546 | + | let dW = (dU + ((dk - ds) * dV)) | |
547 | + | let dn = aL(aJ(valueOrElse(getString(this, r), "")), ab, toString(dk)) | |
548 | + | [IntegerEntry(ar(t, toString(dk)), dW), IntegerEntry(ar(u, toString(dk)), dS), IntegerEntry(ar(v, toString(dk)), dT), IntegerEntry(s, dk), StringEntry(r, au(dn))] | |
544 | 549 | } | |
545 | 550 | else { | |
546 | - | let | |
547 | - | let | |
548 | - | let | |
549 | - | let | |
550 | - | [IntegerEntry( | |
551 | + | let dX = valueOrElse(getInteger(this, ar(v, toString(dk))), 0) | |
552 | + | let dU = valueOrElse(getInteger(this, ar(t, toString(dX))), 0) | |
553 | + | let dV = valueOrElse(getInteger(this, ar(u, toString(dX))), dS) | |
554 | + | let dW = (dU + ((dk - dX) * dV)) | |
555 | + | [IntegerEntry(ar(t, toString(dk)), dW), IntegerEntry(ar(u, toString(dk)), dS)] | |
551 | 556 | } | |
552 | 557 | } | |
553 | 558 | } | |
554 | 559 | ||
555 | 560 | ||
556 | - | func | |
557 | - | then throw(((((("Invalid AMM state data: " + toString( | |
558 | - | else ([IntegerEntry(B, | |
561 | + | func dY (bG,bH,dZ,ea,eb,ec,ed) = if (((ec - ed) != dZ)) | |
562 | + | then throw(((((("Invalid AMM state data: " + toString(ec)) + " + ") + toString(ed)) + " != ") + toString(dZ))) | |
563 | + | else ([IntegerEntry(B, bG), IntegerEntry(C, bH), IntegerEntry(D, dZ), IntegerEntry(G, ea), IntegerEntry(H, eb), IntegerEntry(E, ec), IntegerEntry(F, ed)] ++ dR(am(bG, bH))) | |
559 | 564 | ||
560 | 565 | ||
561 | - | func | |
566 | + | func ee (at) = [DeleteEntry(ar(e, at)), DeleteEntry(ar(f, at)), DeleteEntry(ar(g, at)), DeleteEntry(ar(h, at))] | |
562 | 567 | ||
563 | 568 | ||
564 | - | func | |
565 | - | let | |
566 | - | if (( | |
567 | - | then throw(((("Unable to withdraw " + toString( | |
568 | - | else [ScriptTransfer( | |
569 | + | func ef (at,eg) = { | |
570 | + | let eh = assetBalance(this, T()) | |
571 | + | if ((eg > eh)) | |
572 | + | then throw(((("Unable to withdraw " + toString(eg)) + " from contract balance ") + toString(eh))) | |
573 | + | else [ScriptTransfer(at, eg, T())] | |
569 | 574 | } | |
570 | 575 | ||
571 | 576 | ||
572 | - | func | |
577 | + | func ei (ej) = if ((0 > ej)) | |
573 | 578 | then throw("Balance") | |
574 | - | else [IntegerEntry(d, | |
579 | + | else [IntegerEntry(d, ej)] | |
575 | 580 | ||
576 | 581 | ||
577 | - | func | |
582 | + | func ek (ej) = [ScriptTransfer(V(), ej, T())] | |
578 | 583 | ||
579 | 584 | ||
580 | - | @Callable( | |
581 | - | func pause () = if (( | |
585 | + | @Callable(ej) | |
586 | + | func pause () = if ((ej.caller != R())) | |
582 | 587 | then throw("Invalid togglePause params") | |
583 | 588 | else [BooleanEntry(j, true)] | |
584 | 589 | ||
585 | 590 | ||
586 | 591 | ||
587 | - | @Callable( | |
588 | - | func unpause () = if (( | |
592 | + | @Callable(ej) | |
593 | + | func unpause () = if ((ej.caller != R())) | |
589 | 594 | then throw("Invalid togglePause params") | |
590 | 595 | else [BooleanEntry(j, false)] | |
591 | 596 | ||
592 | 597 | ||
593 | 598 | ||
594 | - | @Callable( | |
595 | - | func changeSettings ( | |
599 | + | @Callable(ej) | |
600 | + | func changeSettings (dA,dB,dC,dD,dE,dF,dG) = if ((ej.caller != R())) | |
596 | 601 | then throw("Invalid changeSettings params") | |
597 | - | else | |
602 | + | else dz(dA, dB, dC, dD, dE, dF, dG) | |
598 | 603 | ||
599 | 604 | ||
600 | 605 | ||
601 | - | @Callable( | |
602 | - | func initialize ( | |
606 | + | @Callable(ej) | |
607 | + | func initialize (bG,bH,dD,dA,dB,dC,dE,el,em,en,dF,dG) = if (if (if (if (if (if (if (if (if (if ((0 >= bG)) | |
603 | 608 | then true | |
604 | - | else (0 >= bF)) | |
609 | + | else (0 >= bH)) | |
610 | + | then true | |
611 | + | else (0 >= dD)) | |
612 | + | then true | |
613 | + | else (0 >= dA)) | |
605 | 614 | then true | |
606 | 615 | else (0 >= dB)) | |
607 | 616 | then true | |
608 | - | else (0 >= dy)) | |
609 | - | then true | |
610 | - | else (0 >= dz)) | |
611 | - | then true | |
612 | - | else (0 >= dA)) | |
613 | - | then true | |
614 | 617 | else (0 >= dC)) | |
615 | - | then true | |
616 | - | else (0 >= dD)) | |
617 | 618 | then true | |
618 | 619 | else (0 >= dE)) | |
619 | 620 | then true | |
620 | - | else bv()) | |
621 | + | else (0 >= dF)) | |
622 | + | then true | |
623 | + | else (0 >= dG)) | |
624 | + | then true | |
625 | + | else bx()) | |
621 | 626 | then throw("Invalid initialize parameters") | |
622 | - | else (((( | |
627 | + | else ((((dY(bG, bH, 0, 0, 0, 0, 0) ++ dz(dA, dB, dC, dD, dE, dF, dG)) ++ dH((lastBlock.timestamp + dD), 0, 0, 0, 0)) ++ ei(0)) ++ [BooleanEntry(i, true), StringEntry(c, el), StringEntry(a, em), StringEntry(I, en)]) | |
623 | 628 | ||
624 | 629 | ||
625 | 630 | ||
626 | - | @Callable( | |
627 | - | func decreasePosition ( | |
631 | + | @Callable(ej) | |
632 | + | func decreasePosition (eg,eo,ep) = if (if (if (if (if (if ((0 >= eg)) | |
628 | 633 | then true | |
629 | - | else if (((1 * | |
634 | + | else if (((1 * ae) > eo)) | |
630 | 635 | then true | |
631 | - | else ( | |
636 | + | else (eo > (3 * ae))) | |
632 | 637 | then true | |
633 | - | else !( | |
638 | + | else !(bx())) | |
634 | 639 | then true | |
635 | - | else !( | |
640 | + | else !(bk(am(ae, eo), aS(), true))) | |
636 | 641 | then true | |
637 | - | else !( | |
642 | + | else !(bw(toString(ej.caller)))) | |
638 | 643 | then true | |
639 | - | else | |
644 | + | else by()) | |
640 | 645 | then throw("Invalid decreasePosition parameters") | |
641 | 646 | else { | |
642 | - | let | |
643 | - | let | |
644 | - | let | |
645 | - | let | |
646 | - | let | |
647 | - | let | |
648 | - | then | |
649 | - | else | |
650 | - | let | |
651 | - | let | |
652 | - | let | |
653 | - | let | |
654 | - | let | |
655 | - | let | |
647 | + | let eq = br(toString(ej.caller)) | |
648 | + | let er = eq._1 | |
649 | + | let es = eq._2 | |
650 | + | let et = eq._3 | |
651 | + | let eu = eq._4 | |
652 | + | let ev = if ((er > 0)) | |
653 | + | then Z | |
654 | + | else Y | |
655 | + | let ew = (ev == Y) | |
656 | + | let ex = ao(eg, eo) | |
657 | + | let ey = cw(toString(ej.caller), ai) | |
658 | + | let ez = ey._1 | |
659 | + | let cK = ey._2 | |
660 | + | let eA = if ((ez > ex)) | |
656 | 661 | then { | |
657 | - | let | |
658 | - | let | |
659 | - | let | |
660 | - | let | |
661 | - | let | |
662 | - | let | |
663 | - | let | |
664 | - | if (if (( | |
665 | - | then ( | |
662 | + | let eB = bF(ew, ex) | |
663 | + | let cZ = eB._1 | |
664 | + | let bK = eB._2 | |
665 | + | let bL = eB._3 | |
666 | + | let de = eB._4 | |
667 | + | let df = eB._5 | |
668 | + | let eC = ap(cZ) | |
669 | + | if (if ((ep != 0)) | |
670 | + | then (ep > eC) | |
666 | 671 | else false) | |
667 | - | then throw(((("Too little base asset exchanged, got " + toString( | |
672 | + | then throw(((("Too little base asset exchanged, got " + toString(eC)) + " expected ") + toString(ep))) | |
668 | 673 | else { | |
669 | - | let | |
670 | - | let | |
671 | - | let | |
672 | - | let | |
673 | - | let | |
674 | - | let | |
675 | - | let | |
676 | - | let | |
677 | - | then (( | |
678 | - | else (( | |
679 | - | let | |
680 | - | $Tuple11( | |
681 | - | then | |
682 | - | else 0)), ( | |
683 | - | then | |
674 | + | let da = am(ao(cK, eC), ap(er)) | |
675 | + | let eD = bV(er, es, eu, da) | |
676 | + | let ce = eD._1 | |
677 | + | let cf = eD._2 | |
678 | + | let ca = eD._3 | |
679 | + | let dd = ex | |
680 | + | let eE = (cK - da) | |
681 | + | let eF = if ((er > 0)) | |
682 | + | then ((ez - dd) - eE) | |
683 | + | else ((eE + ez) - dd) | |
684 | + | let eG = (er + cZ) | |
685 | + | $Tuple11(eG, ce, ap(eF), bp(eG), bL, bK, de, df, (aX() - ex), (bj() - (if ((eG > 0)) | |
686 | + | then ap(cZ) | |
687 | + | else 0)), (bi() - (if ((0 > eG)) | |
688 | + | then ap(cZ) | |
684 | 689 | else 0))) | |
685 | 690 | } | |
686 | 691 | } | |
687 | 692 | else throw("Close position first") | |
688 | - | let eE = ey._1 | |
689 | - | let eF = ey._2 | |
690 | - | let eG = ey._3 | |
691 | - | let eH = ey._4 | |
692 | - | let bJ = ey._5 | |
693 | - | let bI = ey._6 | |
694 | - | let dc = ey._7 | |
695 | - | let dd = ey._8 | |
696 | - | let dg = ey._9 | |
697 | - | let de = ey._10 | |
698 | - | let df = ey._11 | |
699 | - | (dL(toString(eh.caller), eE, eF, eG, eH) ++ dW(bI, bJ, dc, dd, dg, de, df)) | |
693 | + | let eG = eA._1 | |
694 | + | let eH = eA._2 | |
695 | + | let eI = eA._3 | |
696 | + | let eJ = eA._4 | |
697 | + | let bL = eA._5 | |
698 | + | let bK = eA._6 | |
699 | + | let de = eA._7 | |
700 | + | let df = eA._8 | |
701 | + | let di = eA._9 | |
702 | + | let dg = eA._10 | |
703 | + | let dh = eA._11 | |
704 | + | let eK = invoke(X(), "notifyNotional", [toString(ej.caller), eI], nil) | |
705 | + | if ((eK == eK)) | |
706 | + | then (dN(toString(ej.caller), eG, eH, eI, eJ) ++ dY(bK, bL, de, df, di, dg, dh)) | |
707 | + | else throw("Strict value is not equal to itself.") | |
700 | 708 | } | |
701 | 709 | ||
702 | 710 | ||
703 | 711 | ||
704 | - | @Callable( | |
705 | - | func increasePosition ( | |
706 | - | let | |
707 | - | if (if (if (if (if (if (if (if (( | |
708 | - | then ( | |
712 | + | @Callable(ej) | |
713 | + | func increasePosition (ev,eo,ep) = { | |
714 | + | let eL = ej.payments[0].amount | |
715 | + | if (if (if (if (if (if (if (if ((ev != Y)) | |
716 | + | then (ev != Z) | |
709 | 717 | else false) | |
710 | 718 | then true | |
711 | - | else (0 >= | |
719 | + | else (0 >= eL)) | |
712 | 720 | then true | |
713 | - | else if (((1 * | |
721 | + | else if (((1 * ae) > eo)) | |
714 | 722 | then true | |
715 | - | else ( | |
723 | + | else (eo > (3 * ae))) | |
716 | 724 | then true | |
717 | - | else !( | |
725 | + | else !(bx())) | |
718 | 726 | then true | |
719 | - | else ( | |
727 | + | else (ej.payments[0].assetId != T())) | |
720 | 728 | then true | |
721 | - | else !( | |
729 | + | else !(bk(am(ae, eo), aS(), true))) | |
722 | 730 | then true | |
723 | - | else | |
731 | + | else by()) | |
724 | 732 | then throw("Invalid increasePosition parameters") | |
725 | 733 | else { | |
726 | - | let | |
727 | - | let | |
728 | - | let | |
729 | - | let | |
730 | - | let | |
731 | - | let | |
732 | - | let | |
733 | - | let | |
734 | - | let | |
735 | - | then ( | |
736 | - | else ( | |
737 | - | let | |
738 | - | then | |
734 | + | let eM = ao(eL, aR()) | |
735 | + | let eg = (eL - eM) | |
736 | + | let eN = br(toString(ej.caller)) | |
737 | + | let er = eN._1 | |
738 | + | let es = eN._2 | |
739 | + | let et = eN._3 | |
740 | + | let eu = eN._4 | |
741 | + | let eO = (er == 0) | |
742 | + | let eP = if ((er > 0)) | |
743 | + | then (ev == Y) | |
744 | + | else (ev == Z) | |
745 | + | let eQ = if (!(eO)) | |
746 | + | then eP | |
739 | 747 | else false | |
740 | - | let | |
741 | - | let | |
748 | + | let ew = (ev == Y) | |
749 | + | let eR = if (if (eO) | |
742 | 750 | then true | |
743 | - | else | |
751 | + | else eQ) | |
744 | 752 | then { | |
745 | - | let | |
746 | - | let | |
747 | - | let | |
748 | - | let | |
749 | - | let | |
750 | - | let | |
751 | - | let | |
752 | - | if (if (( | |
753 | - | then ( | |
753 | + | let ex = ao(eg, eo) | |
754 | + | let eS = bF(ew, ex) | |
755 | + | let bN = eS._1 | |
756 | + | let bK = eS._2 | |
757 | + | let bL = eS._3 | |
758 | + | let de = eS._4 | |
759 | + | let df = eS._5 | |
760 | + | if (if ((ep != 0)) | |
761 | + | then (ep > ap(bN)) | |
754 | 762 | else false) | |
755 | - | then throw(((("Limit error: " + toString( | |
763 | + | then throw(((("Limit error: " + toString(ap(bN))) + " < ") + toString(ep))) | |
756 | 764 | else { | |
757 | - | let | |
758 | - | let | |
759 | - | let | |
760 | - | let | |
761 | - | let | |
762 | - | let | |
763 | - | $Tuple11( | |
764 | - | then | |
765 | - | else 0)), ( | |
766 | - | then | |
765 | + | let eG = (er + bN) | |
766 | + | let eT = am(ex, eo) | |
767 | + | let eU = bV(er, es, eu, eT) | |
768 | + | let ce = eU._1 | |
769 | + | let cH = eU._2 | |
770 | + | let cI = eU._3 | |
771 | + | $Tuple11(eG, ce, (et + ex), bp(eG), bL, bK, de, df, (aX() + ex), (bj() + (if ((eG > 0)) | |
772 | + | then ap(bN) | |
773 | + | else 0)), (bi() + (if ((0 > eG)) | |
774 | + | then ap(bN) | |
767 | 775 | else 0))) | |
768 | 776 | } | |
769 | 777 | } | |
770 | 778 | else { | |
771 | - | let | |
772 | - | let | |
773 | - | let | |
774 | - | let | |
775 | - | if (( | |
779 | + | let ex = ao(eg, eo) | |
780 | + | let eV = cw(toString(ej.caller), ai) | |
781 | + | let ez = eV._1 | |
782 | + | let cK = eV._2 | |
783 | + | if ((ez > ex)) | |
776 | 784 | then throw("Use decreasePosition to decrease position size") | |
777 | 785 | else throw("Close position first") | |
778 | 786 | } | |
779 | - | let | |
780 | - | let | |
781 | - | let | |
782 | - | let | |
783 | - | let | |
784 | - | let | |
785 | - | let | |
786 | - | let | |
787 | - | let | |
788 | - | let | |
789 | - | let | |
790 | - | let | |
791 | - | let | |
792 | - | let | |
793 | - | if (( | |
787 | + | let eG = eR._1 | |
788 | + | let eH = eR._2 | |
789 | + | let eI = eR._3 | |
790 | + | let eJ = eR._4 | |
791 | + | let bL = eR._5 | |
792 | + | let bK = eR._6 | |
793 | + | let de = eR._7 | |
794 | + | let df = eR._8 | |
795 | + | let di = eR._9 | |
796 | + | let dg = eR._10 | |
797 | + | let dh = eR._11 | |
798 | + | let eW = (eM / 2) | |
799 | + | let eX = (eM - eW) | |
800 | + | let eY = invoke(U(), "lockNeutrinoSP", [toString(V()), ah], [AttachedPayment(T(), eg)]) | |
801 | + | if ((eY == eY)) | |
794 | 802 | then { | |
795 | - | let eW = invoke(V(), "deposit", nil, [AttachedPayment(S(), eU)]) | |
796 | - | if ((eW == eW)) | |
797 | - | then (((dL(toString(eh.caller), eE, eF, eG, eH) ++ dW(bI, bJ, dc, dd, dg, de, df)) ++ ei(eT)) ++ eg((aO() + ee))) | |
798 | - | else throw("Strict value is not equal to itself.") | |
799 | - | } | |
800 | - | else throw("Strict value is not equal to itself.") | |
801 | - | } | |
802 | - | } | |
803 | - | ||
804 | - | ||
805 | - | ||
806 | - | @Callable(eh) | |
807 | - | func addMargin () = { | |
808 | - | let eI = eh.payments[0].amount | |
809 | - | if (if (if (if ((eh.payments[0].assetId != S())) | |
810 | - | then true | |
811 | - | else !(bu(toString(eh.caller)))) | |
812 | - | then true | |
813 | - | else !(bv())) | |
814 | - | then true | |
815 | - | else bw()) | |
816 | - | then throw("Invalid addMargin parameters") | |
817 | - | else { | |
818 | - | let eJ = am(eI, aP()) | |
819 | - | let ee = (eI - eJ) | |
820 | - | let eX = bp(toString(eh.caller)) | |
821 | - | let ep = eX._1 | |
822 | - | let eq = eX._2 | |
823 | - | let er = eX._3 | |
824 | - | let es = eX._4 | |
825 | - | let eT = (eJ / 2) | |
826 | - | let eU = (eJ - eT) | |
827 | - | let eV = invoke(T(), "lockNeutrinoSP", [toString(U()), af], [AttachedPayment(S(), ee)]) | |
828 | - | if ((eV == eV)) | |
829 | - | then { | |
830 | - | let eW = invoke(V(), "deposit", nil, [AttachedPayment(S(), eU)]) | |
831 | - | if ((eW == eW)) | |
832 | - | then ((dL(toString(eh.caller), ep, (eq + ee), er, es) ++ ei(eT)) ++ eg((aO() + ee))) | |
833 | - | else throw("Strict value is not equal to itself.") | |
834 | - | } | |
835 | - | else throw("Strict value is not equal to itself.") | |
836 | - | } | |
837 | - | } | |
838 | - | ||
839 | - | ||
840 | - | ||
841 | - | @Callable(eh) | |
842 | - | func removeMargin (ee) = if (if (if (if ((0 >= ee)) | |
843 | - | then true | |
844 | - | else !(bu(toString(eh.caller)))) | |
845 | - | then true | |
846 | - | else !(bv())) | |
847 | - | then true | |
848 | - | else bw()) | |
849 | - | then throw("Invalid removeMargin parameters") | |
850 | - | else { | |
851 | - | let eY = bp(toString(eh.caller)) | |
852 | - | let ep = eY._1 | |
853 | - | let eq = eY._2 | |
854 | - | let er = eY._3 | |
855 | - | let es = eY._4 | |
856 | - | let eZ = -(ee) | |
857 | - | let fa = bT(ep, eq, es, eZ) | |
858 | - | let cc = fa._1 | |
859 | - | let cd = fa._2 | |
860 | - | if ((cd != 0)) | |
861 | - | then throw("Invalid removed margin amount") | |
862 | - | else { | |
863 | - | let fb = cJ(cc, cd, er) | |
864 | - | if (!(bi(fb, aQ(), true))) | |
865 | - | then throw(((("Too much margin removed: " + toString(fb)) + " < ") + toString(aQ()))) | |
866 | - | else { | |
867 | - | let fc = invoke(T(), "unlockNeutrino", [ee, toBase58String(S())], nil) | |
868 | - | if ((fc == fc)) | |
869 | - | then ((dL(toString(eh.caller), ep, cc, er, bn(ep)) ++ ed(eh.caller, ee)) ++ eg((aO() - ee))) | |
870 | - | else throw("Strict value is not equal to itself.") | |
871 | - | } | |
872 | - | } | |
873 | - | } | |
874 | - | ||
875 | - | ||
876 | - | ||
877 | - | @Callable(eh) | |
878 | - | func closePosition () = if (if (if (!(bu(toString(eh.caller)))) | |
879 | - | then true | |
880 | - | else !(bv())) | |
881 | - | then true | |
882 | - | else bw()) | |
883 | - | then throw("Invalid closePosition parameters") | |
884 | - | else { | |
885 | - | let fd = cT(toString(eh.caller)) | |
886 | - | let cF = fd._1 | |
887 | - | let fe = fd._2 | |
888 | - | let cY = fd._3 | |
889 | - | let cZ = fd._4 | |
890 | - | let bI = fd._5 | |
891 | - | let bJ = fd._6 | |
892 | - | let dc = fd._7 | |
893 | - | let dd = fd._8 | |
894 | - | let dg = fd._9 | |
895 | - | let cG = fd._10 | |
896 | - | let de = fd._11 | |
897 | - | let df = fd._12 | |
898 | - | if ((fe > 0)) | |
899 | - | then throw("Unable to close position with bad debt") | |
900 | - | else { | |
901 | - | let ff = an(cZ) | |
902 | - | let fg = (aO() - ff) | |
903 | - | let fh = if ((0 > fg)) | |
904 | - | then $Tuple2(0, an(fg)) | |
905 | - | else $Tuple2(fg, 0) | |
906 | - | let fi = fh._1 | |
907 | - | let fj = fh._2 | |
908 | - | let fk = if ((fj > 0)) | |
909 | - | then { | |
910 | - | let fl = invoke(V(), "withdraw", [fj], nil) | |
911 | - | if ((fl == fl)) | |
912 | - | then nil | |
913 | - | else throw("Strict value is not equal to itself.") | |
914 | - | } | |
915 | - | else nil | |
916 | - | if ((fk == fk)) | |
917 | - | then { | |
918 | - | let fc = invoke(T(), "unlockNeutrino", [(ff - fj), toBase58String(S())], nil) | |
919 | - | if ((fc == fc)) | |
920 | - | then (((ec(toString(eh.caller)) ++ dW(bI, bJ, dc, dd, dg, de, df)) ++ ed(eh.caller, ff)) ++ eg(fi)) | |
921 | - | else throw("Strict value is not equal to itself.") | |
922 | - | } | |
923 | - | else throw("Strict value is not equal to itself.") | |
924 | - | } | |
925 | - | } | |
926 | - | ||
927 | - | ||
928 | - | ||
929 | - | @Callable(eh) | |
930 | - | func liquidate (bq) = { | |
931 | - | let fm = cN(bq, ag) | |
932 | - | let fb = if (cr()) | |
933 | - | then { | |
934 | - | let fn = cN(bq, ah) | |
935 | - | ao(fm, fn) | |
936 | - | } | |
937 | - | else fm | |
938 | - | if (if (if (if (!(bi(fb, ba(), false))) | |
939 | - | then true | |
940 | - | else !(bu(bq))) | |
941 | - | then true | |
942 | - | else !(bv())) | |
943 | - | then true | |
944 | - | else bw()) | |
945 | - | then throw("Unable to liquidate") | |
946 | - | else { | |
947 | - | let fo = cT(bq) | |
948 | - | let cF = fo._1 | |
949 | - | let cd = fo._2 | |
950 | - | let cG = fo._3 | |
951 | - | let cH = fo._4 | |
952 | - | let bI = fo._5 | |
953 | - | let bJ = fo._6 | |
954 | - | let dc = fo._7 | |
955 | - | let dd = fo._8 | |
956 | - | let dg = fo._9 | |
957 | - | let db = fo._10 | |
958 | - | let de = fo._11 | |
959 | - | let df = fo._12 | |
960 | - | let fp = am(db, bb()) | |
961 | - | let fq = (fp / 2) | |
962 | - | let eU = (fp - fq) | |
963 | - | let fg = (aO() - fp) | |
964 | - | let fr = if ((0 > fg)) | |
965 | - | then $Tuple2(0, an(fg)) | |
966 | - | else $Tuple2(fg, 0) | |
967 | - | let fs = fr._1 | |
968 | - | let ft = fr._2 | |
969 | - | let fk = if ((ft > 0)) | |
970 | - | then { | |
971 | - | let fl = invoke(V(), "withdraw", [ft], nil) | |
972 | - | if ((fl == fl)) | |
973 | - | then nil | |
974 | - | else throw("Strict value is not equal to itself.") | |
975 | - | } | |
976 | - | else nil | |
977 | - | if ((fk == fk)) | |
978 | - | then { | |
979 | - | let fc = invoke(T(), "unlockNeutrino", [(fp - ft), toBase58String(S())], nil) | |
980 | - | if ((fc == fc)) | |
803 | + | let eZ = invoke(W(), "deposit", nil, [AttachedPayment(T(), eX)]) | |
804 | + | if ((eZ == eZ)) | |
981 | 805 | then { | |
982 | - | let eW = invoke(V(), "deposit", nil, [AttachedPayment(S(), eU)]) | |
983 | - | if ((eW == eW)) | |
984 | - | then (((ec(bq) ++ dW(bI, bJ, dc, dd, dg, de, df)) ++ ed(eh.caller, fq)) ++ eg(fs)) | |
806 | + | let fa = invoke(X(), "notifyFees", [toString(ej.caller), eM], nil) | |
807 | + | if ((fa == fa)) | |
808 | + | then { | |
809 | + | let eK = invoke(X(), "notifyNotional", [toString(ej.caller), eI], nil) | |
810 | + | if ((eK == eK)) | |
811 | + | then (((dN(toString(ej.caller), eG, eH, eI, eJ) ++ dY(bK, bL, de, df, di, dg, dh)) ++ ek(eW)) ++ ei((aQ() + eg))) | |
812 | + | else throw("Strict value is not equal to itself.") | |
813 | + | } | |
985 | 814 | else throw("Strict value is not equal to itself.") | |
986 | 815 | } | |
987 | 816 | else throw("Strict value is not equal to itself.") | |
992 | 821 | ||
993 | 822 | ||
994 | 823 | ||
995 | - | @Callable( | |
996 | - | func | |
997 | - | let | |
998 | - | if (if (if (( | |
824 | + | @Callable(ej) | |
825 | + | func addMargin () = { | |
826 | + | let eL = ej.payments[0].amount | |
827 | + | if (if (if (if ((ej.payments[0].assetId != T())) | |
999 | 828 | then true | |
1000 | - | else !( | |
829 | + | else !(bw(toString(ej.caller)))) | |
1001 | 830 | then true | |
1002 | - | else bw()) | |
1003 | - | then throw(((("Invalid funding block timestamp: " + toString(lastBlock.timestamp)) + " < ") + toString(fu))) | |
831 | + | else !(bx())) | |
832 | + | then true | |
833 | + | else by()) | |
834 | + | then throw("Invalid addMargin parameters") | |
1004 | 835 | else { | |
1005 | - | let fv = cl() | |
1006 | - | let fw = dh() | |
1007 | - | let fx = (fw - fv) | |
1008 | - | let fy = if (if ((bg() == 0)) | |
1009 | - | then true | |
1010 | - | else (bh() == 0)) | |
1011 | - | then $Tuple2(0, 0) | |
1012 | - | else if ((0 > fx)) | |
1013 | - | then { | |
1014 | - | let fz = ak(am(fx, aY()), ae) | |
1015 | - | let fA = ak(am(fz, bg()), bh()) | |
1016 | - | $Tuple2(fz, fA) | |
1017 | - | } | |
1018 | - | else { | |
1019 | - | let fA = ak(am(fx, aY()), ae) | |
1020 | - | let fz = ak(am(fA, bh()), bg()) | |
1021 | - | $Tuple2(fz, fA) | |
1022 | - | } | |
1023 | - | let fz = fy._1 | |
1024 | - | let fA = fy._2 | |
1025 | - | dF((fu + aZ()), (be() + fA), (bf() + fz), ak(fA, fv), ak(fz, fv)) | |
836 | + | let eM = ao(eL, aR()) | |
837 | + | let eg = (eL - eM) | |
838 | + | let fb = br(toString(ej.caller)) | |
839 | + | let er = fb._1 | |
840 | + | let es = fb._2 | |
841 | + | let et = fb._3 | |
842 | + | let eu = fb._4 | |
843 | + | let eW = (eM / 2) | |
844 | + | let eX = (eM - eW) | |
845 | + | let eY = invoke(U(), "lockNeutrinoSP", [toString(V()), ah], [AttachedPayment(T(), eg)]) | |
846 | + | if ((eY == eY)) | |
847 | + | then { | |
848 | + | let eZ = invoke(W(), "deposit", nil, [AttachedPayment(T(), eX)]) | |
849 | + | if ((eZ == eZ)) | |
850 | + | then { | |
851 | + | let fa = invoke(X(), "notifyFees", [toString(ej.caller), eM], nil) | |
852 | + | if ((fa == fa)) | |
853 | + | then ((dN(toString(ej.caller), er, (es + eg), et, eu) ++ ek(eW)) ++ ei((aQ() + eg))) | |
854 | + | else throw("Strict value is not equal to itself.") | |
855 | + | } | |
856 | + | else throw("Strict value is not equal to itself.") | |
857 | + | } | |
858 | + | else throw("Strict value is not equal to itself.") | |
1026 | 859 | } | |
1027 | 860 | } | |
1028 | 861 | ||
1029 | 862 | ||
1030 | 863 | ||
1031 | - | @Callable(eh) | |
1032 | - | func v_get (bq) = { | |
1033 | - | let fB = cT(bq) | |
1034 | - | let cF = fB._1 | |
1035 | - | let cG = fB._2 | |
1036 | - | let cH = fB._3 | |
1037 | - | let fC = fB._4 | |
1038 | - | throw((((ai(cG) + ai(cH)) + ai(fC)) + ai(cS(bq)))) | |
864 | + | @Callable(ej) | |
865 | + | func removeMargin (eg) = if (if (if (if ((0 >= eg)) | |
866 | + | then true | |
867 | + | else !(bw(toString(ej.caller)))) | |
868 | + | then true | |
869 | + | else !(bx())) | |
870 | + | then true | |
871 | + | else by()) | |
872 | + | then throw("Invalid removeMargin parameters") | |
873 | + | else { | |
874 | + | let fc = br(toString(ej.caller)) | |
875 | + | let er = fc._1 | |
876 | + | let es = fc._2 | |
877 | + | let et = fc._3 | |
878 | + | let eu = fc._4 | |
879 | + | let fd = -(eg) | |
880 | + | let fe = bV(er, es, eu, fd) | |
881 | + | let ce = fe._1 | |
882 | + | let cf = fe._2 | |
883 | + | if ((cf != 0)) | |
884 | + | then throw("Invalid removed margin amount") | |
885 | + | else { | |
886 | + | let ff = cL(ce, cf, et) | |
887 | + | if (!(bk(ff, aS(), true))) | |
888 | + | then throw(((("Too much margin removed: " + toString(ff)) + " < ") + toString(aS()))) | |
889 | + | else { | |
890 | + | let fg = invoke(U(), "unlockNeutrino", [eg, toBase58String(T())], nil) | |
891 | + | if ((fg == fg)) | |
892 | + | then ((dN(toString(ej.caller), er, ce, et, bp(er)) ++ ef(ej.caller, eg)) ++ ei((aQ() - eg))) | |
893 | + | else throw("Strict value is not equal to itself.") | |
894 | + | } | |
895 | + | } | |
896 | + | } | |
897 | + | ||
898 | + | ||
899 | + | ||
900 | + | @Callable(ej) | |
901 | + | func closePosition () = if (if (if (!(bw(toString(ej.caller)))) | |
902 | + | then true | |
903 | + | else !(bx())) | |
904 | + | then true | |
905 | + | else by()) | |
906 | + | then throw("Invalid closePosition parameters") | |
907 | + | else { | |
908 | + | let fh = cV(toString(ej.caller)) | |
909 | + | let cH = fh._1 | |
910 | + | let fi = fh._2 | |
911 | + | let da = fh._3 | |
912 | + | let db = fh._4 | |
913 | + | let bK = fh._5 | |
914 | + | let bL = fh._6 | |
915 | + | let de = fh._7 | |
916 | + | let df = fh._8 | |
917 | + | let di = fh._9 | |
918 | + | let cI = fh._10 | |
919 | + | let dg = fh._11 | |
920 | + | let dh = fh._12 | |
921 | + | if ((fi > 0)) | |
922 | + | then throw("Unable to close position with bad debt") | |
923 | + | else { | |
924 | + | let fj = ap(db) | |
925 | + | let fk = (aQ() - fj) | |
926 | + | let fl = if ((0 > fk)) | |
927 | + | then $Tuple2(0, ap(fk)) | |
928 | + | else $Tuple2(fk, 0) | |
929 | + | let fm = fl._1 | |
930 | + | let fn = fl._2 | |
931 | + | let fo = if ((fn > 0)) | |
932 | + | then { | |
933 | + | let fp = invoke(W(), "withdraw", [fn], nil) | |
934 | + | if ((fp == fp)) | |
935 | + | then nil | |
936 | + | else throw("Strict value is not equal to itself.") | |
937 | + | } | |
938 | + | else nil | |
939 | + | if ((fo == fo)) | |
940 | + | then { | |
941 | + | let fg = invoke(U(), "unlockNeutrino", [(fj - fn), toBase58String(T())], nil) | |
942 | + | if ((fg == fg)) | |
943 | + | then { | |
944 | + | let eK = invoke(X(), "notifyNotional", [toString(ej.caller), 0], nil) | |
945 | + | if ((eK == eK)) | |
946 | + | then (((ee(toString(ej.caller)) ++ dY(bK, bL, de, df, di, dg, dh)) ++ ef(ej.caller, fj)) ++ ei(fm)) | |
947 | + | else throw("Strict value is not equal to itself.") | |
948 | + | } | |
949 | + | else throw("Strict value is not equal to itself.") | |
950 | + | } | |
951 | + | else throw("Strict value is not equal to itself.") | |
952 | + | } | |
953 | + | } | |
954 | + | ||
955 | + | ||
956 | + | ||
957 | + | @Callable(ej) | |
958 | + | func liquidate (bs) = { | |
959 | + | let fq = cP(bs, ai) | |
960 | + | let ff = if (ct()) | |
961 | + | then { | |
962 | + | let fr = cP(bs, aj) | |
963 | + | aq(fq, fr) | |
964 | + | } | |
965 | + | else fq | |
966 | + | if (if (if (if (!(bk(ff, bc(), false))) | |
967 | + | then true | |
968 | + | else !(bw(bs))) | |
969 | + | then true | |
970 | + | else !(bx())) | |
971 | + | then true | |
972 | + | else by()) | |
973 | + | then throw("Unable to liquidate") | |
974 | + | else { | |
975 | + | let fs = cV(bs) | |
976 | + | let cH = fs._1 | |
977 | + | let cf = fs._2 | |
978 | + | let cI = fs._3 | |
979 | + | let cJ = fs._4 | |
980 | + | let bK = fs._5 | |
981 | + | let bL = fs._6 | |
982 | + | let de = fs._7 | |
983 | + | let df = fs._8 | |
984 | + | let di = fs._9 | |
985 | + | let dd = fs._10 | |
986 | + | let dg = fs._11 | |
987 | + | let dh = fs._12 | |
988 | + | let ft = ao(dd, bd()) | |
989 | + | let fu = (ft / 2) | |
990 | + | let eX = (ft - fu) | |
991 | + | let fk = (aQ() - ft) | |
992 | + | let fv = if ((0 > fk)) | |
993 | + | then $Tuple2(0, ap(fk)) | |
994 | + | else $Tuple2(fk, 0) | |
995 | + | let fw = fv._1 | |
996 | + | let fx = fv._2 | |
997 | + | let fo = if ((fx > 0)) | |
998 | + | then { | |
999 | + | let fp = invoke(W(), "withdraw", [fx], nil) | |
1000 | + | if ((fp == fp)) | |
1001 | + | then nil | |
1002 | + | else throw("Strict value is not equal to itself.") | |
1003 | + | } | |
1004 | + | else nil | |
1005 | + | if ((fo == fo)) | |
1006 | + | then { | |
1007 | + | let fg = invoke(U(), "unlockNeutrino", [(ft - fx), toBase58String(T())], nil) | |
1008 | + | if ((fg == fg)) | |
1009 | + | then { | |
1010 | + | let eZ = invoke(W(), "deposit", nil, [AttachedPayment(T(), eX)]) | |
1011 | + | if ((eZ == eZ)) | |
1012 | + | then { | |
1013 | + | let eK = invoke(X(), "notifyNotional", [bs, 0], nil) | |
1014 | + | if ((eK == eK)) | |
1015 | + | then (((ee(bs) ++ dY(bK, bL, de, df, di, dg, dh)) ++ ef(ej.caller, fu)) ++ ei(fw)) | |
1016 | + | else throw("Strict value is not equal to itself.") | |
1017 | + | } | |
1018 | + | else throw("Strict value is not equal to itself.") | |
1019 | + | } | |
1020 | + | else throw("Strict value is not equal to itself.") | |
1021 | + | } | |
1022 | + | else throw("Strict value is not equal to itself.") | |
1023 | + | } | |
1039 | 1024 | } | |
1040 | 1025 | ||
1041 | 1026 | ||
1042 | 1027 | ||
1043 | - | @Callable(eh) | |
1044 | - | func view_calcRemainMarginWithFundingPayment (bq) = { | |
1045 | - | let fD = bp(bq) | |
1046 | - | let bt = fD._1 | |
1047 | - | let cx = fD._2 | |
1048 | - | let cP = fD._3 | |
1049 | - | let cz = fD._4 | |
1050 | - | let fE = cu(bq, ag) | |
1051 | - | let cC = fE._1 | |
1052 | - | let cI = fE._2 | |
1053 | - | let fF = bT(bt, cx, cz, cI) | |
1054 | - | let cc = fF._1 | |
1055 | - | let cd = fF._2 | |
1056 | - | let bY = fF._3 | |
1057 | - | throw(((ai(cc) + ai(bY)) + ai(cS(bq)))) | |
1028 | + | @Callable(ej) | |
1029 | + | func payFunding () = { | |
1030 | + | let fy = aY() | |
1031 | + | if (if (if ((fy > lastBlock.timestamp)) | |
1032 | + | then true | |
1033 | + | else !(bx())) | |
1034 | + | then true | |
1035 | + | else by()) | |
1036 | + | then throw(((("Invalid funding block timestamp: " + toString(lastBlock.timestamp)) + " < ") + toString(fy))) | |
1037 | + | else { | |
1038 | + | let fz = cn() | |
1039 | + | let fA = dj() | |
1040 | + | let fB = (fA - fz) | |
1041 | + | let fC = if (if ((bi() == 0)) | |
1042 | + | then true | |
1043 | + | else (bj() == 0)) | |
1044 | + | then $Tuple2(0, 0) | |
1045 | + | else if ((0 > fB)) | |
1046 | + | then { | |
1047 | + | let fD = am(ao(fB, ba()), ag) | |
1048 | + | let fE = am(ao(fD, bi()), bj()) | |
1049 | + | $Tuple2(fD, fE) | |
1050 | + | } | |
1051 | + | else { | |
1052 | + | let fE = am(ao(fB, ba()), ag) | |
1053 | + | let fD = am(ao(fE, bj()), bi()) | |
1054 | + | $Tuple2(fD, fE) | |
1055 | + | } | |
1056 | + | let fD = fC._1 | |
1057 | + | let fE = fC._2 | |
1058 | + | dH((fy + bb()), (bg() + fE), (bh() + fD), am(fE, fz), am(fD, fz)) | |
1059 | + | } | |
1058 | 1060 | } | |
1059 | 1061 | ||
1060 | 1062 | ||
1061 | - | @Verifier(fG) | |
1062 | - | func fH () = sigVerify(fG.bodyBytes, fG.proofs[0], R()) | |
1063 | + | ||
1064 | + | @Callable(ej) | |
1065 | + | func v_get (bs) = { | |
1066 | + | let fF = cV(bs) | |
1067 | + | let cH = fF._1 | |
1068 | + | let cI = fF._2 | |
1069 | + | let cJ = fF._3 | |
1070 | + | let fG = fF._4 | |
1071 | + | throw((((ak(cI) + ak(cJ)) + ak(fG)) + ak(cU(bs)))) | |
1072 | + | } | |
1073 | + | ||
1074 | + | ||
1075 | + | ||
1076 | + | @Callable(ej) | |
1077 | + | func view_calcRemainMarginWithFundingPayment (bs) = { | |
1078 | + | let fH = br(bs) | |
1079 | + | let bv = fH._1 | |
1080 | + | let cz = fH._2 | |
1081 | + | let cR = fH._3 | |
1082 | + | let cB = fH._4 | |
1083 | + | let fI = cw(bs, ai) | |
1084 | + | let cE = fI._1 | |
1085 | + | let cK = fI._2 | |
1086 | + | let fJ = bV(bv, cz, cB, cK) | |
1087 | + | let ce = fJ._1 | |
1088 | + | let cf = fJ._2 | |
1089 | + | let ca = fJ._3 | |
1090 | + | throw(((ak(ce) + ak(ca)) + ak(cU(bs)))) | |
1091 | + | } | |
1092 | + | ||
1093 | + | ||
1094 | + | ||
1095 | + | @Callable(ej) | |
1096 | + | func forceMoveAsset (bs,eg) = if (if ((addressFromPublicKey(S()) != ej.caller)) | |
1097 | + | then true | |
1098 | + | else (0 > eg)) | |
1099 | + | then throw("Invalid forceMoveAsset parameters") | |
1100 | + | else { | |
1101 | + | let fg = invoke(U(), "unlockNeutrino", [eg, toBase58String(T())], nil) | |
1102 | + | if ((fg == fg)) | |
1103 | + | then (ef(addressFromStringValue(bs), eg) ++ ei((aQ() - eg))) | |
1104 | + | else throw("Strict value is not equal to itself.") | |
1105 | + | } | |
1106 | + | ||
1107 | + | ||
1108 | + | @Verifier(fK) | |
1109 | + | func fL () = sigVerify(fK.bodyBytes, fK.proofs[0], S()) | |
1063 | 1110 |
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "k_ora_key" | |
5 | 5 | ||
6 | 6 | let b = "k_ora_block_key" | |
7 | 7 | ||
8 | 8 | let c = "k_ora" | |
9 | 9 | ||
10 | 10 | let d = "k_balance" | |
11 | 11 | ||
12 | 12 | let e = "k_positionSize" | |
13 | 13 | ||
14 | 14 | let f = "k_positionMargin" | |
15 | 15 | ||
16 | 16 | let g = "k_positionOpenNotional" | |
17 | 17 | ||
18 | 18 | let h = "k_positionFraction" | |
19 | 19 | ||
20 | 20 | let i = "k_initialized" | |
21 | 21 | ||
22 | 22 | let j = "k_paused" | |
23 | 23 | ||
24 | 24 | let k = "k_fee" | |
25 | 25 | ||
26 | 26 | let l = "k_fundingPeriod" | |
27 | 27 | ||
28 | 28 | let m = "k_initMarginRatio" | |
29 | 29 | ||
30 | 30 | let n = "k_mmr" | |
31 | 31 | ||
32 | 32 | let o = "k_liquidationFeeRatio" | |
33 | 33 | ||
34 | 34 | let p = "k_spreadLimit" | |
35 | 35 | ||
36 | 36 | let q = "k_maxPriceImpact" | |
37 | 37 | ||
38 | 38 | let r = "k_lastDataStr" | |
39 | 39 | ||
40 | 40 | let s = "k_lastMinuteId" | |
41 | 41 | ||
42 | 42 | let t = "k_twapDataLastCumulativePrice" | |
43 | 43 | ||
44 | 44 | let u = "k_twapDataLastPrice" | |
45 | 45 | ||
46 | 46 | let v = "k_twapDataPreviousMinuteId" | |
47 | 47 | ||
48 | 48 | let w = "k_latestLongPremiumFraction" | |
49 | 49 | ||
50 | 50 | let x = "k_latestShortPremiumFraction" | |
51 | 51 | ||
52 | 52 | let y = "k_nextFundingBlockMinTimestamp" | |
53 | 53 | ||
54 | 54 | let z = "k_longFundingRate" | |
55 | 55 | ||
56 | 56 | let A = "k_shortFundingRate" | |
57 | 57 | ||
58 | 58 | let B = "k_qtAstR" | |
59 | 59 | ||
60 | 60 | let C = "k_bsAstR" | |
61 | 61 | ||
62 | 62 | let D = "k_totalPositionSize" | |
63 | 63 | ||
64 | 64 | let E = "k_totalLongPositionSize" | |
65 | 65 | ||
66 | 66 | let F = "k_totalShortPositionSize" | |
67 | 67 | ||
68 | 68 | let G = "k_cumulativeNotional" | |
69 | 69 | ||
70 | 70 | let H = "k_openInterestNotional" | |
71 | 71 | ||
72 | 72 | let I = "k_coordinatorAddress" | |
73 | 73 | ||
74 | 74 | let J = "k_insurance_address" | |
75 | 75 | ||
76 | 76 | let K = "k_admin_address" | |
77 | 77 | ||
78 | 78 | let L = "k_admin_public_key" | |
79 | 79 | ||
80 | 80 | let M = "k_quote_asset" | |
81 | 81 | ||
82 | 82 | let N = "k_quote_staking" | |
83 | 83 | ||
84 | 84 | let O = "k_staking_address" | |
85 | 85 | ||
86 | - | func P () = valueOrErrorMessage(addressFromString(getStringValue(this, I)), "Coordinator not set") | |
86 | + | let P = "k_miner_address" | |
87 | + | ||
88 | + | func Q () = valueOrErrorMessage(addressFromString(getStringValue(this, I)), "Coordinator not set") | |
87 | 89 | ||
88 | 90 | ||
89 | - | func | |
91 | + | func R () = addressFromString(getStringValue(Q(), K)) | |
90 | 92 | ||
91 | 93 | ||
92 | - | func | |
94 | + | func S () = fromBase58String(getStringValue(Q(), L)) | |
93 | 95 | ||
94 | 96 | ||
95 | - | func | |
97 | + | func T () = fromBase58String(getStringValue(Q(), M)) | |
96 | 98 | ||
97 | 99 | ||
98 | - | func | |
100 | + | func U () = valueOrErrorMessage(addressFromString(getStringValue(Q(), N)), "Quote asset staking not set") | |
99 | 101 | ||
100 | 102 | ||
101 | - | func | |
103 | + | func V () = valueOrErrorMessage(addressFromString(getStringValue(Q(), O)), "Insurance not set") | |
102 | 104 | ||
103 | 105 | ||
104 | - | func | |
106 | + | func W () = valueOrErrorMessage(addressFromString(getStringValue(Q(), J)), "Insurance not set") | |
105 | 107 | ||
106 | 108 | ||
107 | - | let W = 1 | |
108 | - | ||
109 | - | let X = 2 | |
110 | - | ||
111 | - | let Y = 60 | |
112 | - | ||
113 | - | let Z = 15 | |
114 | - | ||
115 | - | let aa = 15 | |
116 | - | ||
117 | - | let ab = 1000 | |
118 | - | ||
119 | - | let ac = (1 * (((((10 * 10) * 10) * 10) * 10) * 10)) | |
120 | - | ||
121 | - | let ad = (100 * ac) | |
122 | - | ||
123 | - | let ae = (86400 * ac) | |
124 | - | ||
125 | - | let af = 100 | |
126 | - | ||
127 | - | let ag = 1 | |
128 | - | ||
129 | - | let ah = 2 | |
130 | - | ||
131 | - | func ai (aj) = (toString(aj) + ",") | |
109 | + | func X () = valueOrErrorMessage(addressFromString(getStringValue(Q(), P)), "Insurance not set") | |
132 | 110 | ||
133 | 111 | ||
134 | - | func ak (aj,al) = fraction(aj, ac, al, HALFEVEN) | |
112 | + | let Y = 1 | |
113 | + | ||
114 | + | let Z = 2 | |
115 | + | ||
116 | + | let aa = 60 | |
117 | + | ||
118 | + | let ab = 15 | |
119 | + | ||
120 | + | let ac = 15 | |
121 | + | ||
122 | + | let ad = 1000 | |
123 | + | ||
124 | + | let ae = (1 * (((((10 * 10) * 10) * 10) * 10) * 10)) | |
125 | + | ||
126 | + | let af = (100 * ae) | |
127 | + | ||
128 | + | let ag = (86400 * ae) | |
129 | + | ||
130 | + | let ah = 100 | |
131 | + | ||
132 | + | let ai = 1 | |
133 | + | ||
134 | + | let aj = 2 | |
135 | + | ||
136 | + | func ak (al) = (toString(al) + ",") | |
135 | 137 | ||
136 | 138 | ||
137 | - | func am ( | |
139 | + | func am (al,an) = fraction(al, ae, an, HALFEVEN) | |
138 | 140 | ||
139 | 141 | ||
140 | - | func an (aj) = if ((aj > 0)) | |
141 | - | then aj | |
142 | - | else -(aj) | |
142 | + | func ao (al,an) = fraction(al, an, ae, HALFEVEN) | |
143 | 143 | ||
144 | 144 | ||
145 | - | func | |
146 | - | then | |
147 | - | else al | |
145 | + | func ap (al) = if ((al > 0)) | |
146 | + | then al | |
147 | + | else -(al) | |
148 | 148 | ||
149 | 149 | ||
150 | - | func ap (aq,ar) = ((aq + "_") + ar) | |
150 | + | func aq (al,an) = if ((al >= an)) | |
151 | + | then al | |
152 | + | else an | |
151 | 153 | ||
152 | 154 | ||
153 | - | func as (at) = { | |
154 | - | func au (av,aw) = ((av + aw) + ",") | |
155 | + | func ar (as,at) = ((as + "_") + at) | |
155 | 156 | ||
156 | - | let ax = { | |
157 | - | let ay = at | |
158 | - | let az = size(ay) | |
159 | - | let aA = "" | |
160 | - | func aB (aC,aD) = if ((aD >= az)) | |
161 | - | then aC | |
162 | - | else au(aC, ay[aD]) | |
163 | 157 | ||
164 | - | func aE (aC,aD) = if ((aD >= az)) | |
165 | - | then aC | |
158 | + | func au (av) = { | |
159 | + | func aw (ax,ay) = ((ax + ay) + ",") | |
160 | + | ||
161 | + | let az = { | |
162 | + | let aA = av | |
163 | + | let aB = size(aA) | |
164 | + | let aC = "" | |
165 | + | func aD (aE,aF) = if ((aF >= aB)) | |
166 | + | then aE | |
167 | + | else aw(aE, aA[aF]) | |
168 | + | ||
169 | + | func aG (aE,aF) = if ((aF >= aB)) | |
170 | + | then aE | |
166 | 171 | else throw("List size exceeds 20") | |
167 | 172 | ||
168 | - | | |
173 | + | aG(aD(aD(aD(aD(aD(aD(aD(aD(aD(aD(aD(aD(aD(aD(aD(aD(aD(aD(aD(aD(aC, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20) | |
169 | 174 | } | |
170 | - | let | |
171 | - | let | |
172 | - | then drop( | |
173 | - | else | |
174 | - | | |
175 | + | let aH = dropRight(az, 1) | |
176 | + | let aI = if ((take(aH, 1) == ",")) | |
177 | + | then drop(aH, 1) | |
178 | + | else aH | |
179 | + | aI | |
175 | 180 | } | |
176 | 181 | ||
177 | 182 | ||
178 | - | func | |
183 | + | func aJ (aK) = split(aK, ",") | |
179 | 184 | ||
180 | 185 | ||
181 | - | func | |
182 | - | then (removeByIndex( | |
183 | - | else ( | |
186 | + | func aL (av,aM,aN) = if ((size(av) > aM)) | |
187 | + | then (removeByIndex(av, 0) :+ aN) | |
188 | + | else (av :+ aN) | |
184 | 189 | ||
185 | 190 | ||
186 | - | func | |
191 | + | func aO (aP) = valueOrErrorMessage(getInteger(this, aP), ("no value for " + aP)) | |
187 | 192 | ||
188 | 193 | ||
189 | - | func | |
194 | + | func aQ () = aO(d) | |
190 | 195 | ||
191 | 196 | ||
192 | - | func | |
197 | + | func aR () = aO(k) | |
193 | 198 | ||
194 | 199 | ||
195 | - | func | |
200 | + | func aS () = aO(m) | |
196 | 201 | ||
197 | 202 | ||
198 | - | func | |
203 | + | func aT () = aO(B) | |
199 | 204 | ||
200 | 205 | ||
201 | - | func | |
206 | + | func aU () = aO(C) | |
202 | 207 | ||
203 | 208 | ||
204 | - | func | |
209 | + | func aV () = aO(D) | |
205 | 210 | ||
206 | 211 | ||
207 | - | func | |
212 | + | func aW () = aO(G) | |
208 | 213 | ||
209 | 214 | ||
210 | - | func | |
215 | + | func aX () = aO(H) | |
211 | 216 | ||
212 | 217 | ||
213 | - | func | |
218 | + | func aY () = aO(y) | |
214 | 219 | ||
215 | 220 | ||
216 | - | func | |
221 | + | func aZ () = aO(l) | |
217 | 222 | ||
218 | 223 | ||
219 | - | func | |
224 | + | func ba () = (aZ() * ae) | |
220 | 225 | ||
221 | 226 | ||
222 | - | func | |
227 | + | func bb () = (aZ() * ad) | |
223 | 228 | ||
224 | 229 | ||
225 | - | func | |
230 | + | func bc () = aO(n) | |
226 | 231 | ||
227 | 232 | ||
228 | - | func | |
233 | + | func bd () = aO(o) | |
229 | 234 | ||
230 | 235 | ||
231 | - | func | |
236 | + | func be () = aO(p) | |
232 | 237 | ||
233 | 238 | ||
234 | - | func | |
239 | + | func bf () = aO(q) | |
235 | 240 | ||
236 | 241 | ||
237 | - | func | |
242 | + | func bg () = aO(w) | |
238 | 243 | ||
239 | 244 | ||
240 | - | func | |
245 | + | func bh () = aO(x) | |
241 | 246 | ||
242 | 247 | ||
243 | - | func | |
248 | + | func bi () = aO(F) | |
244 | 249 | ||
245 | 250 | ||
246 | - | func | |
251 | + | func bj () = aO(E) | |
247 | 252 | ||
248 | 253 | ||
249 | - | func | |
250 | - | let | |
251 | - | if (if ( | |
252 | - | then (0 > | |
254 | + | func bk (bl,bm,bn) = { | |
255 | + | let bo = (bl - bm) | |
256 | + | if (if (bn) | |
257 | + | then (0 > bo) | |
253 | 258 | else false) | |
254 | 259 | then throw("Invalid margin") | |
255 | - | else if (if (!( | |
256 | - | then ( | |
260 | + | else if (if (!(bn)) | |
261 | + | then (bo >= 0) | |
257 | 262 | else false) | |
258 | 263 | then throw("Invalid margin") | |
259 | 264 | else true | |
260 | 265 | } | |
261 | 266 | ||
262 | 267 | ||
263 | - | func | |
268 | + | func bp (bq) = if ((bq == 0)) | |
264 | 269 | then throw("Should not be called with _positionSize == 0") | |
265 | - | else if (( | |
266 | - | then | |
267 | - | else | |
270 | + | else if ((bq > 0)) | |
271 | + | then bg() | |
272 | + | else bh() | |
268 | 273 | ||
269 | 274 | ||
270 | - | func | |
271 | - | let | |
272 | - | let | |
273 | - | if ($isInstanceOf( | |
275 | + | func br (bs) = { | |
276 | + | let bt = getInteger(this, ar(e, bs)) | |
277 | + | let bu = bt | |
278 | + | if ($isInstanceOf(bu, "Int")) | |
274 | 279 | then { | |
275 | - | let | |
276 | - | $Tuple4( | |
280 | + | let bv = bu | |
281 | + | $Tuple4(bv, getIntegerValue(this, ar(f, bs)), getIntegerValue(this, ar(g, bs)), getIntegerValue(this, ar(h, bs))) | |
277 | 282 | } | |
278 | 283 | else $Tuple4(0, 0, 0, 0) | |
279 | 284 | } | |
280 | 285 | ||
281 | 286 | ||
282 | - | func | |
287 | + | func bw (bs) = if ((br(bs)._1 == 0)) | |
283 | 288 | then throw("No open position") | |
284 | 289 | else true | |
285 | 290 | ||
286 | 291 | ||
287 | - | func | |
292 | + | func bx () = valueOrElse(getBoolean(this, i), false) | |
288 | 293 | ||
289 | 294 | ||
290 | - | func | |
295 | + | func by () = valueOrElse(getBoolean(this, j), false) | |
291 | 296 | ||
292 | 297 | ||
293 | - | func | |
298 | + | func bz (bA,bB,bC) = if (bA) | |
294 | 299 | then { | |
295 | - | let | |
296 | - | if ((0 >= | |
300 | + | let bD = (aU() - bC) | |
301 | + | if ((0 >= bD)) | |
297 | 302 | then throw("Tx lead to base asset reserve <= 0, revert") | |
298 | - | else $Tuple4(( | |
303 | + | else $Tuple4((aT() + bB), bD, (aV() + bC), (aW() + bB)) | |
299 | 304 | } | |
300 | 305 | else { | |
301 | - | let | |
302 | - | if ((0 >= | |
306 | + | let bE = (aT() - bB) | |
307 | + | if ((0 >= bE)) | |
303 | 308 | then throw("Tx lead to base quote reserve <= 0, revert") | |
304 | - | else $Tuple4( | |
309 | + | else $Tuple4(bE, (aU() + bC), (aV() - bC), (aW() - bB)) | |
305 | 310 | } | |
306 | 311 | ||
307 | 312 | ||
308 | - | func | |
309 | - | let | |
310 | - | let | |
311 | - | let | |
312 | - | let | |
313 | - | let | |
314 | - | let | |
315 | - | then ( | |
316 | - | else ( | |
317 | - | let | |
318 | - | let | |
319 | - | let | |
320 | - | then | |
321 | - | else -( | |
322 | - | let | |
323 | - | let | |
324 | - | if (( | |
325 | - | then throw(((("Price impact " + toString( | |
313 | + | func bF (bA,bB) = { | |
314 | + | let bG = aT() | |
315 | + | let bH = aU() | |
316 | + | let bI = am(bG, bH) | |
317 | + | let bJ = ao(bB, bI) | |
318 | + | let aP = ao(bG, bH) | |
319 | + | let bK = if (bA) | |
320 | + | then (bG + bB) | |
321 | + | else (bG - bB) | |
322 | + | let bL = am(aP, bK) | |
323 | + | let bM = ap((bL - bH)) | |
324 | + | let bN = if (bA) | |
325 | + | then bM | |
326 | + | else -(bM) | |
327 | + | let bO = ((bJ - bM) / bJ) | |
328 | + | let bP = bf() | |
329 | + | if ((bO > bP)) | |
330 | + | then throw(((("Price impact " + toString(bO)) + " > max price impact ") + toString(bP))) | |
326 | 331 | else { | |
327 | - | let | |
328 | - | let | |
329 | - | let | |
330 | - | let | |
331 | - | let | |
332 | - | $Tuple5( | |
332 | + | let bQ = bz(bA, bB, bM) | |
333 | + | let bR = bQ._1 | |
334 | + | let bS = bQ._2 | |
335 | + | let bT = bQ._3 | |
336 | + | let bU = bQ._4 | |
337 | + | $Tuple5(bN, bR, bS, bT, bU) | |
333 | 338 | } | |
334 | 339 | } | |
335 | 340 | ||
336 | 341 | ||
337 | - | func | |
338 | - | let | |
342 | + | func bV (bW,bX,bY,bZ) = { | |
343 | + | let ca = if ((bW != 0)) | |
339 | 344 | then { | |
340 | - | let | |
341 | - | | |
345 | + | let cb = bp(bW) | |
346 | + | ao((cb - bY), bW) | |
342 | 347 | } | |
343 | 348 | else 0 | |
344 | - | let | |
345 | - | let | |
346 | - | then $Tuple2(0, | |
347 | - | else $Tuple2( | |
348 | - | let | |
349 | - | let | |
350 | - | $Tuple3( | |
349 | + | let cc = ((bZ - ca) + bX) | |
350 | + | let cd = if ((0 > cc)) | |
351 | + | then $Tuple2(0, ap(cc)) | |
352 | + | else $Tuple2(ap(cc), 0) | |
353 | + | let ce = cd._1 | |
354 | + | let cf = cd._2 | |
355 | + | $Tuple3(ce, cf, ca) | |
351 | 356 | } | |
352 | 357 | ||
353 | 358 | ||
354 | - | func | |
355 | - | let | |
356 | - | let | |
357 | - | if (( | |
359 | + | func cg (bA,bC) = { | |
360 | + | let ch = aT() | |
361 | + | let ci = aU() | |
362 | + | if ((bC == 0)) | |
358 | 363 | then throw("Invalid base asset amount") | |
359 | 364 | else { | |
360 | - | let | |
361 | - | let | |
362 | - | then ( | |
363 | - | else ( | |
364 | - | let | |
365 | - | let | |
366 | - | let | |
367 | - | let | |
368 | - | let | |
369 | - | let | |
370 | - | let | |
371 | - | $Tuple7( | |
372 | - | then | |
373 | - | else 0)), ( | |
374 | - | then | |
365 | + | let aP = ao(ch, ci) | |
366 | + | let cj = if (bA) | |
367 | + | then (ci + bC) | |
368 | + | else (ci - bC) | |
369 | + | let ck = am(aP, cj) | |
370 | + | let cl = ap((ck - ch)) | |
371 | + | let cm = bz(!(bA), cl, bC) | |
372 | + | let bR = cm._1 | |
373 | + | let bS = cm._2 | |
374 | + | let bT = cm._3 | |
375 | + | let bU = cm._4 | |
376 | + | $Tuple7(cl, bR, bS, bT, bU, (bj() - (if (bA) | |
377 | + | then ap(bC) | |
378 | + | else 0)), (bi() - (if (!(bA)) | |
379 | + | then ap(bC) | |
375 | 380 | else 0))) | |
376 | 381 | } | |
377 | 382 | } | |
378 | 383 | ||
379 | 384 | ||
380 | - | func | |
381 | - | let | |
382 | - | let | |
383 | - | let | |
384 | - | let | |
385 | - | | |
385 | + | func cn () = { | |
386 | + | let co = valueOrErrorMessage(addressFromString(getStringValue(this, c)), "") | |
387 | + | let cp = getStringValue(this, a) | |
388 | + | let cq = getStringValue(this, b) | |
389 | + | let cr = getIntegerValue(co, cp) | |
390 | + | cr | |
386 | 391 | } | |
387 | 392 | ||
388 | 393 | ||
389 | - | func | |
390 | - | let | |
391 | - | let | |
392 | - | | |
394 | + | func cs () = { | |
395 | + | let ch = aT() | |
396 | + | let ci = aU() | |
397 | + | am(ch, ci) | |
393 | 398 | } | |
394 | 399 | ||
395 | 400 | ||
396 | - | func | |
397 | - | let | |
398 | - | let | |
399 | - | ( | |
401 | + | func ct () = { | |
402 | + | let cu = cn() | |
403 | + | let cv = cs() | |
404 | + | (am(ap((cu - cv)), cu) > be()) | |
400 | 405 | } | |
401 | 406 | ||
402 | 407 | ||
403 | - | func | |
404 | - | let | |
405 | - | let | |
406 | - | let | |
407 | - | let | |
408 | - | let | |
409 | - | let | |
410 | - | if (( | |
408 | + | func cw (bs,cx) = { | |
409 | + | let cy = br(bs) | |
410 | + | let bv = cy._1 | |
411 | + | let cz = cy._2 | |
412 | + | let cA = cy._3 | |
413 | + | let cB = cy._4 | |
414 | + | let cC = ap(bv) | |
415 | + | if ((cC == 0)) | |
411 | 416 | then throw("Invalid position size") | |
412 | 417 | else { | |
413 | - | let | |
414 | - | let | |
418 | + | let cD = (0 > bv) | |
419 | + | let cE = if ((cx == ai)) | |
415 | 420 | then { | |
416 | - | let | |
417 | - | let | |
418 | - | let | |
419 | - | let | |
420 | - | let | |
421 | - | | |
421 | + | let cF = cg(!(cD), cC) | |
422 | + | let cG = cF._1 | |
423 | + | let cH = cF._2 | |
424 | + | let cI = cF._3 | |
425 | + | let cJ = cF._4 | |
426 | + | cG | |
422 | 427 | } | |
423 | - | else | |
424 | - | let | |
425 | - | then ( | |
426 | - | else ( | |
427 | - | $Tuple2( | |
428 | + | else ao(cC, cn()) | |
429 | + | let cK = if (cD) | |
430 | + | then (cA - cE) | |
431 | + | else (cE - cA) | |
432 | + | $Tuple2(cE, cK) | |
428 | 433 | } | |
429 | 434 | } | |
430 | 435 | ||
431 | 436 | ||
432 | - | func | |
437 | + | func cL (cM,cN,cO) = am((cM - cN), cO) | |
433 | 438 | ||
434 | 439 | ||
435 | - | func | |
436 | - | let | |
437 | - | let | |
438 | - | let | |
439 | - | let | |
440 | - | let | |
441 | - | let | |
442 | - | let | |
443 | - | let | |
444 | - | let | |
445 | - | let | |
446 | - | let | |
447 | - | | |
440 | + | func cP (bs,cx) = { | |
441 | + | let cQ = br(bs) | |
442 | + | let bv = cQ._1 | |
443 | + | let cz = cQ._2 | |
444 | + | let cR = cQ._3 | |
445 | + | let cB = cQ._4 | |
446 | + | let cS = cw(bs, cx) | |
447 | + | let cE = cS._1 | |
448 | + | let cK = cS._2 | |
449 | + | let cT = bV(bv, cz, cB, cK) | |
450 | + | let ce = cT._1 | |
451 | + | let cf = cT._2 | |
452 | + | cL(ce, cf, cE) | |
448 | 453 | } | |
449 | 454 | ||
450 | 455 | ||
451 | - | func | |
456 | + | func cU (bs) = cP(bs, ai) | |
452 | 457 | ||
453 | 458 | ||
454 | - | func | |
455 | - | let | |
456 | - | let | |
457 | - | let | |
458 | - | let | |
459 | - | let | |
460 | - | let | |
461 | - | let | |
462 | - | let | |
463 | - | let | |
464 | - | let | |
465 | - | let | |
466 | - | let | |
467 | - | let | |
468 | - | let | |
469 | - | let | |
470 | - | let | |
471 | - | let | |
472 | - | let | |
473 | - | let | |
474 | - | let | |
475 | - | let | |
476 | - | let | |
477 | - | let | |
478 | - | $Tuple12( | |
459 | + | func cV (bs) = { | |
460 | + | let cW = br(bs) | |
461 | + | let bv = cW._1 | |
462 | + | let cz = cW._2 | |
463 | + | let cA = cW._3 | |
464 | + | let cB = cW._4 | |
465 | + | let cX = cw(bs, ai) | |
466 | + | let cH = cX._1 | |
467 | + | let cK = cX._2 | |
468 | + | let cY = bV(bv, cz, cB, cK) | |
469 | + | let ce = cY._1 | |
470 | + | let cf = cY._2 | |
471 | + | let cZ = -(bv) | |
472 | + | let da = cK | |
473 | + | let db = -(ce) | |
474 | + | let dc = cg((bv > 0), ap(bv)) | |
475 | + | let dd = dc._1 | |
476 | + | let bK = dc._2 | |
477 | + | let bL = dc._3 | |
478 | + | let de = dc._4 | |
479 | + | let df = dc._5 | |
480 | + | let dg = dc._6 | |
481 | + | let dh = dc._7 | |
482 | + | let di = (aX() - cA) | |
483 | + | $Tuple12(cZ, cf, da, db, bK, bL, de, df, di, dd, dg, dh) | |
479 | 484 | } | |
480 | 485 | ||
481 | 486 | ||
482 | - | func | |
483 | - | let | |
484 | - | let | |
485 | - | let | |
486 | - | let | |
487 | - | func | |
488 | - | then ( | |
489 | - | else | |
487 | + | func dj () = { | |
488 | + | let dk = ((lastBlock.timestamp / 1000) / 60) | |
489 | + | let dl = (dk - ab) | |
490 | + | let dm = valueOrElse(getString(this, r), "") | |
491 | + | let dn = split(dm, ",") | |
492 | + | func do (ax,dp) = if ((dl >= parseIntValue(dp))) | |
493 | + | then (ax :+ parseIntValue(dp)) | |
494 | + | else ax | |
490 | 495 | ||
491 | - | let | |
492 | - | let | |
493 | - | let | |
494 | - | let | |
495 | - | func | |
496 | - | then | |
497 | - | else | |
496 | + | let dq = { | |
497 | + | let aA = dn | |
498 | + | let aB = size(aA) | |
499 | + | let aC = nil | |
500 | + | func aD (aE,aF) = if ((aF >= aB)) | |
501 | + | then aE | |
502 | + | else do(aE, aA[aF]) | |
498 | 503 | ||
499 | - | func | |
500 | - | then | |
504 | + | func aG (aE,aF) = if ((aF >= aB)) | |
505 | + | then aE | |
501 | 506 | else throw("List size exceeds 20") | |
502 | 507 | ||
503 | - | | |
508 | + | aG(aD(aD(aD(aD(aD(aD(aD(aD(aD(aD(aD(aD(aD(aD(aD(aD(aD(aD(aD(aD(aC, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20) | |
504 | 509 | } | |
505 | - | let | |
506 | - | then max( | |
507 | - | else parseIntValue( | |
508 | - | let | |
509 | - | let | |
510 | - | let | |
511 | - | let | |
512 | - | let | |
513 | - | let | |
514 | - | let | |
515 | - | (( | |
510 | + | let dr = if ((size(dq) > 0)) | |
511 | + | then max(dq) | |
512 | + | else parseIntValue(dn[0]) | |
513 | + | let ds = valueOrElse(getInteger(this, s), 0) | |
514 | + | let dt = valueOrElse(getInteger(this, ((t + "_") + toString(ds))), 0) | |
515 | + | let du = valueOrElse(getInteger(this, ((u + "_") + toString(ds))), 0) | |
516 | + | let dv = (dt + ((dk - ds) * du)) | |
517 | + | let dw = valueOrElse(getInteger(this, ((t + "_") + toString(dr))), 0) | |
518 | + | let dx = valueOrElse(getInteger(this, ((u + "_") + toString(dr))), 0) | |
519 | + | let dy = (dw + ((dl - dr) * dx)) | |
520 | + | ((dv - dy) / ab) | |
516 | 521 | } | |
517 | 522 | ||
518 | 523 | ||
519 | - | func | |
524 | + | func dz (dA,dB,dC,dD,dE,dF,dG) = [IntegerEntry(m, dA), IntegerEntry(n, dB), IntegerEntry(o, dC), IntegerEntry(l, dD), IntegerEntry(k, dE), IntegerEntry(p, dF), IntegerEntry(q, dG)] | |
520 | 525 | ||
521 | 526 | ||
522 | - | func | |
527 | + | func dH (dI,dJ,dK,dL,dM) = [IntegerEntry(y, dI), IntegerEntry(w, dJ), IntegerEntry(x, dK), IntegerEntry(z, dL), IntegerEntry(A, dM)] | |
523 | 528 | ||
524 | 529 | ||
525 | - | func | |
530 | + | func dN (at,dO,dP,dQ,cb) = [IntegerEntry(ar(e, at), dO), IntegerEntry(ar(f, at), dP), IntegerEntry(ar(g, at), dQ), IntegerEntry(ar(h, at), cb)] | |
526 | 531 | ||
527 | 532 | ||
528 | - | func | |
529 | - | let | |
530 | - | let | |
531 | - | if (( | |
533 | + | func dR (dS) = { | |
534 | + | let dk = ((lastBlock.timestamp / 1000) / 60) | |
535 | + | let dT = valueOrElse(getInteger(this, s), 0) | |
536 | + | if ((dT > dk)) | |
532 | 537 | then throw("TWAP out-of-order") | |
533 | 538 | else { | |
534 | - | let | |
535 | - | then | |
536 | - | else | |
537 | - | if (( | |
539 | + | let ds = if ((dT == 0)) | |
540 | + | then dk | |
541 | + | else dT | |
542 | + | if ((dk > dT)) | |
538 | 543 | then { | |
539 | - | let | |
540 | - | let | |
541 | - | let | |
542 | - | let | |
543 | - | [IntegerEntry( | |
544 | + | let dU = valueOrElse(getInteger(this, ((t + "_") + toString(dT))), 0) | |
545 | + | let dV = valueOrElse(getInteger(this, ((u + "_") + toString(dT))), dS) | |
546 | + | let dW = (dU + ((dk - ds) * dV)) | |
547 | + | let dn = aL(aJ(valueOrElse(getString(this, r), "")), ab, toString(dk)) | |
548 | + | [IntegerEntry(ar(t, toString(dk)), dW), IntegerEntry(ar(u, toString(dk)), dS), IntegerEntry(ar(v, toString(dk)), dT), IntegerEntry(s, dk), StringEntry(r, au(dn))] | |
544 | 549 | } | |
545 | 550 | else { | |
546 | - | let | |
547 | - | let | |
548 | - | let | |
549 | - | let | |
550 | - | [IntegerEntry( | |
551 | + | let dX = valueOrElse(getInteger(this, ar(v, toString(dk))), 0) | |
552 | + | let dU = valueOrElse(getInteger(this, ar(t, toString(dX))), 0) | |
553 | + | let dV = valueOrElse(getInteger(this, ar(u, toString(dX))), dS) | |
554 | + | let dW = (dU + ((dk - dX) * dV)) | |
555 | + | [IntegerEntry(ar(t, toString(dk)), dW), IntegerEntry(ar(u, toString(dk)), dS)] | |
551 | 556 | } | |
552 | 557 | } | |
553 | 558 | } | |
554 | 559 | ||
555 | 560 | ||
556 | - | func | |
557 | - | then throw(((((("Invalid AMM state data: " + toString( | |
558 | - | else ([IntegerEntry(B, | |
561 | + | func dY (bG,bH,dZ,ea,eb,ec,ed) = if (((ec - ed) != dZ)) | |
562 | + | then throw(((((("Invalid AMM state data: " + toString(ec)) + " + ") + toString(ed)) + " != ") + toString(dZ))) | |
563 | + | else ([IntegerEntry(B, bG), IntegerEntry(C, bH), IntegerEntry(D, dZ), IntegerEntry(G, ea), IntegerEntry(H, eb), IntegerEntry(E, ec), IntegerEntry(F, ed)] ++ dR(am(bG, bH))) | |
559 | 564 | ||
560 | 565 | ||
561 | - | func | |
566 | + | func ee (at) = [DeleteEntry(ar(e, at)), DeleteEntry(ar(f, at)), DeleteEntry(ar(g, at)), DeleteEntry(ar(h, at))] | |
562 | 567 | ||
563 | 568 | ||
564 | - | func | |
565 | - | let | |
566 | - | if (( | |
567 | - | then throw(((("Unable to withdraw " + toString( | |
568 | - | else [ScriptTransfer( | |
569 | + | func ef (at,eg) = { | |
570 | + | let eh = assetBalance(this, T()) | |
571 | + | if ((eg > eh)) | |
572 | + | then throw(((("Unable to withdraw " + toString(eg)) + " from contract balance ") + toString(eh))) | |
573 | + | else [ScriptTransfer(at, eg, T())] | |
569 | 574 | } | |
570 | 575 | ||
571 | 576 | ||
572 | - | func | |
577 | + | func ei (ej) = if ((0 > ej)) | |
573 | 578 | then throw("Balance") | |
574 | - | else [IntegerEntry(d, | |
579 | + | else [IntegerEntry(d, ej)] | |
575 | 580 | ||
576 | 581 | ||
577 | - | func | |
582 | + | func ek (ej) = [ScriptTransfer(V(), ej, T())] | |
578 | 583 | ||
579 | 584 | ||
580 | - | @Callable( | |
581 | - | func pause () = if (( | |
585 | + | @Callable(ej) | |
586 | + | func pause () = if ((ej.caller != R())) | |
582 | 587 | then throw("Invalid togglePause params") | |
583 | 588 | else [BooleanEntry(j, true)] | |
584 | 589 | ||
585 | 590 | ||
586 | 591 | ||
587 | - | @Callable( | |
588 | - | func unpause () = if (( | |
592 | + | @Callable(ej) | |
593 | + | func unpause () = if ((ej.caller != R())) | |
589 | 594 | then throw("Invalid togglePause params") | |
590 | 595 | else [BooleanEntry(j, false)] | |
591 | 596 | ||
592 | 597 | ||
593 | 598 | ||
594 | - | @Callable( | |
595 | - | func changeSettings ( | |
599 | + | @Callable(ej) | |
600 | + | func changeSettings (dA,dB,dC,dD,dE,dF,dG) = if ((ej.caller != R())) | |
596 | 601 | then throw("Invalid changeSettings params") | |
597 | - | else | |
602 | + | else dz(dA, dB, dC, dD, dE, dF, dG) | |
598 | 603 | ||
599 | 604 | ||
600 | 605 | ||
601 | - | @Callable( | |
602 | - | func initialize ( | |
606 | + | @Callable(ej) | |
607 | + | func initialize (bG,bH,dD,dA,dB,dC,dE,el,em,en,dF,dG) = if (if (if (if (if (if (if (if (if (if ((0 >= bG)) | |
603 | 608 | then true | |
604 | - | else (0 >= bF)) | |
609 | + | else (0 >= bH)) | |
610 | + | then true | |
611 | + | else (0 >= dD)) | |
612 | + | then true | |
613 | + | else (0 >= dA)) | |
605 | 614 | then true | |
606 | 615 | else (0 >= dB)) | |
607 | 616 | then true | |
608 | - | else (0 >= dy)) | |
609 | - | then true | |
610 | - | else (0 >= dz)) | |
611 | - | then true | |
612 | - | else (0 >= dA)) | |
613 | - | then true | |
614 | 617 | else (0 >= dC)) | |
615 | - | then true | |
616 | - | else (0 >= dD)) | |
617 | 618 | then true | |
618 | 619 | else (0 >= dE)) | |
619 | 620 | then true | |
620 | - | else bv()) | |
621 | + | else (0 >= dF)) | |
622 | + | then true | |
623 | + | else (0 >= dG)) | |
624 | + | then true | |
625 | + | else bx()) | |
621 | 626 | then throw("Invalid initialize parameters") | |
622 | - | else (((( | |
627 | + | else ((((dY(bG, bH, 0, 0, 0, 0, 0) ++ dz(dA, dB, dC, dD, dE, dF, dG)) ++ dH((lastBlock.timestamp + dD), 0, 0, 0, 0)) ++ ei(0)) ++ [BooleanEntry(i, true), StringEntry(c, el), StringEntry(a, em), StringEntry(I, en)]) | |
623 | 628 | ||
624 | 629 | ||
625 | 630 | ||
626 | - | @Callable( | |
627 | - | func decreasePosition ( | |
631 | + | @Callable(ej) | |
632 | + | func decreasePosition (eg,eo,ep) = if (if (if (if (if (if ((0 >= eg)) | |
628 | 633 | then true | |
629 | - | else if (((1 * | |
634 | + | else if (((1 * ae) > eo)) | |
630 | 635 | then true | |
631 | - | else ( | |
636 | + | else (eo > (3 * ae))) | |
632 | 637 | then true | |
633 | - | else !( | |
638 | + | else !(bx())) | |
634 | 639 | then true | |
635 | - | else !( | |
640 | + | else !(bk(am(ae, eo), aS(), true))) | |
636 | 641 | then true | |
637 | - | else !( | |
642 | + | else !(bw(toString(ej.caller)))) | |
638 | 643 | then true | |
639 | - | else | |
644 | + | else by()) | |
640 | 645 | then throw("Invalid decreasePosition parameters") | |
641 | 646 | else { | |
642 | - | let | |
643 | - | let | |
644 | - | let | |
645 | - | let | |
646 | - | let | |
647 | - | let | |
648 | - | then | |
649 | - | else | |
650 | - | let | |
651 | - | let | |
652 | - | let | |
653 | - | let | |
654 | - | let | |
655 | - | let | |
647 | + | let eq = br(toString(ej.caller)) | |
648 | + | let er = eq._1 | |
649 | + | let es = eq._2 | |
650 | + | let et = eq._3 | |
651 | + | let eu = eq._4 | |
652 | + | let ev = if ((er > 0)) | |
653 | + | then Z | |
654 | + | else Y | |
655 | + | let ew = (ev == Y) | |
656 | + | let ex = ao(eg, eo) | |
657 | + | let ey = cw(toString(ej.caller), ai) | |
658 | + | let ez = ey._1 | |
659 | + | let cK = ey._2 | |
660 | + | let eA = if ((ez > ex)) | |
656 | 661 | then { | |
657 | - | let | |
658 | - | let | |
659 | - | let | |
660 | - | let | |
661 | - | let | |
662 | - | let | |
663 | - | let | |
664 | - | if (if (( | |
665 | - | then ( | |
662 | + | let eB = bF(ew, ex) | |
663 | + | let cZ = eB._1 | |
664 | + | let bK = eB._2 | |
665 | + | let bL = eB._3 | |
666 | + | let de = eB._4 | |
667 | + | let df = eB._5 | |
668 | + | let eC = ap(cZ) | |
669 | + | if (if ((ep != 0)) | |
670 | + | then (ep > eC) | |
666 | 671 | else false) | |
667 | - | then throw(((("Too little base asset exchanged, got " + toString( | |
672 | + | then throw(((("Too little base asset exchanged, got " + toString(eC)) + " expected ") + toString(ep))) | |
668 | 673 | else { | |
669 | - | let | |
670 | - | let | |
671 | - | let | |
672 | - | let | |
673 | - | let | |
674 | - | let | |
675 | - | let | |
676 | - | let | |
677 | - | then (( | |
678 | - | else (( | |
679 | - | let | |
680 | - | $Tuple11( | |
681 | - | then | |
682 | - | else 0)), ( | |
683 | - | then | |
674 | + | let da = am(ao(cK, eC), ap(er)) | |
675 | + | let eD = bV(er, es, eu, da) | |
676 | + | let ce = eD._1 | |
677 | + | let cf = eD._2 | |
678 | + | let ca = eD._3 | |
679 | + | let dd = ex | |
680 | + | let eE = (cK - da) | |
681 | + | let eF = if ((er > 0)) | |
682 | + | then ((ez - dd) - eE) | |
683 | + | else ((eE + ez) - dd) | |
684 | + | let eG = (er + cZ) | |
685 | + | $Tuple11(eG, ce, ap(eF), bp(eG), bL, bK, de, df, (aX() - ex), (bj() - (if ((eG > 0)) | |
686 | + | then ap(cZ) | |
687 | + | else 0)), (bi() - (if ((0 > eG)) | |
688 | + | then ap(cZ) | |
684 | 689 | else 0))) | |
685 | 690 | } | |
686 | 691 | } | |
687 | 692 | else throw("Close position first") | |
688 | - | let eE = ey._1 | |
689 | - | let eF = ey._2 | |
690 | - | let eG = ey._3 | |
691 | - | let eH = ey._4 | |
692 | - | let bJ = ey._5 | |
693 | - | let bI = ey._6 | |
694 | - | let dc = ey._7 | |
695 | - | let dd = ey._8 | |
696 | - | let dg = ey._9 | |
697 | - | let de = ey._10 | |
698 | - | let df = ey._11 | |
699 | - | (dL(toString(eh.caller), eE, eF, eG, eH) ++ dW(bI, bJ, dc, dd, dg, de, df)) | |
693 | + | let eG = eA._1 | |
694 | + | let eH = eA._2 | |
695 | + | let eI = eA._3 | |
696 | + | let eJ = eA._4 | |
697 | + | let bL = eA._5 | |
698 | + | let bK = eA._6 | |
699 | + | let de = eA._7 | |
700 | + | let df = eA._8 | |
701 | + | let di = eA._9 | |
702 | + | let dg = eA._10 | |
703 | + | let dh = eA._11 | |
704 | + | let eK = invoke(X(), "notifyNotional", [toString(ej.caller), eI], nil) | |
705 | + | if ((eK == eK)) | |
706 | + | then (dN(toString(ej.caller), eG, eH, eI, eJ) ++ dY(bK, bL, de, df, di, dg, dh)) | |
707 | + | else throw("Strict value is not equal to itself.") | |
700 | 708 | } | |
701 | 709 | ||
702 | 710 | ||
703 | 711 | ||
704 | - | @Callable( | |
705 | - | func increasePosition ( | |
706 | - | let | |
707 | - | if (if (if (if (if (if (if (if (( | |
708 | - | then ( | |
712 | + | @Callable(ej) | |
713 | + | func increasePosition (ev,eo,ep) = { | |
714 | + | let eL = ej.payments[0].amount | |
715 | + | if (if (if (if (if (if (if (if ((ev != Y)) | |
716 | + | then (ev != Z) | |
709 | 717 | else false) | |
710 | 718 | then true | |
711 | - | else (0 >= | |
719 | + | else (0 >= eL)) | |
712 | 720 | then true | |
713 | - | else if (((1 * | |
721 | + | else if (((1 * ae) > eo)) | |
714 | 722 | then true | |
715 | - | else ( | |
723 | + | else (eo > (3 * ae))) | |
716 | 724 | then true | |
717 | - | else !( | |
725 | + | else !(bx())) | |
718 | 726 | then true | |
719 | - | else ( | |
727 | + | else (ej.payments[0].assetId != T())) | |
720 | 728 | then true | |
721 | - | else !( | |
729 | + | else !(bk(am(ae, eo), aS(), true))) | |
722 | 730 | then true | |
723 | - | else | |
731 | + | else by()) | |
724 | 732 | then throw("Invalid increasePosition parameters") | |
725 | 733 | else { | |
726 | - | let | |
727 | - | let | |
728 | - | let | |
729 | - | let | |
730 | - | let | |
731 | - | let | |
732 | - | let | |
733 | - | let | |
734 | - | let | |
735 | - | then ( | |
736 | - | else ( | |
737 | - | let | |
738 | - | then | |
734 | + | let eM = ao(eL, aR()) | |
735 | + | let eg = (eL - eM) | |
736 | + | let eN = br(toString(ej.caller)) | |
737 | + | let er = eN._1 | |
738 | + | let es = eN._2 | |
739 | + | let et = eN._3 | |
740 | + | let eu = eN._4 | |
741 | + | let eO = (er == 0) | |
742 | + | let eP = if ((er > 0)) | |
743 | + | then (ev == Y) | |
744 | + | else (ev == Z) | |
745 | + | let eQ = if (!(eO)) | |
746 | + | then eP | |
739 | 747 | else false | |
740 | - | let | |
741 | - | let | |
748 | + | let ew = (ev == Y) | |
749 | + | let eR = if (if (eO) | |
742 | 750 | then true | |
743 | - | else | |
751 | + | else eQ) | |
744 | 752 | then { | |
745 | - | let | |
746 | - | let | |
747 | - | let | |
748 | - | let | |
749 | - | let | |
750 | - | let | |
751 | - | let | |
752 | - | if (if (( | |
753 | - | then ( | |
753 | + | let ex = ao(eg, eo) | |
754 | + | let eS = bF(ew, ex) | |
755 | + | let bN = eS._1 | |
756 | + | let bK = eS._2 | |
757 | + | let bL = eS._3 | |
758 | + | let de = eS._4 | |
759 | + | let df = eS._5 | |
760 | + | if (if ((ep != 0)) | |
761 | + | then (ep > ap(bN)) | |
754 | 762 | else false) | |
755 | - | then throw(((("Limit error: " + toString( | |
763 | + | then throw(((("Limit error: " + toString(ap(bN))) + " < ") + toString(ep))) | |
756 | 764 | else { | |
757 | - | let | |
758 | - | let | |
759 | - | let | |
760 | - | let | |
761 | - | let | |
762 | - | let | |
763 | - | $Tuple11( | |
764 | - | then | |
765 | - | else 0)), ( | |
766 | - | then | |
765 | + | let eG = (er + bN) | |
766 | + | let eT = am(ex, eo) | |
767 | + | let eU = bV(er, es, eu, eT) | |
768 | + | let ce = eU._1 | |
769 | + | let cH = eU._2 | |
770 | + | let cI = eU._3 | |
771 | + | $Tuple11(eG, ce, (et + ex), bp(eG), bL, bK, de, df, (aX() + ex), (bj() + (if ((eG > 0)) | |
772 | + | then ap(bN) | |
773 | + | else 0)), (bi() + (if ((0 > eG)) | |
774 | + | then ap(bN) | |
767 | 775 | else 0))) | |
768 | 776 | } | |
769 | 777 | } | |
770 | 778 | else { | |
771 | - | let | |
772 | - | let | |
773 | - | let | |
774 | - | let | |
775 | - | if (( | |
779 | + | let ex = ao(eg, eo) | |
780 | + | let eV = cw(toString(ej.caller), ai) | |
781 | + | let ez = eV._1 | |
782 | + | let cK = eV._2 | |
783 | + | if ((ez > ex)) | |
776 | 784 | then throw("Use decreasePosition to decrease position size") | |
777 | 785 | else throw("Close position first") | |
778 | 786 | } | |
779 | - | let | |
780 | - | let | |
781 | - | let | |
782 | - | let | |
783 | - | let | |
784 | - | let | |
785 | - | let | |
786 | - | let | |
787 | - | let | |
788 | - | let | |
789 | - | let | |
790 | - | let | |
791 | - | let | |
792 | - | let | |
793 | - | if (( | |
787 | + | let eG = eR._1 | |
788 | + | let eH = eR._2 | |
789 | + | let eI = eR._3 | |
790 | + | let eJ = eR._4 | |
791 | + | let bL = eR._5 | |
792 | + | let bK = eR._6 | |
793 | + | let de = eR._7 | |
794 | + | let df = eR._8 | |
795 | + | let di = eR._9 | |
796 | + | let dg = eR._10 | |
797 | + | let dh = eR._11 | |
798 | + | let eW = (eM / 2) | |
799 | + | let eX = (eM - eW) | |
800 | + | let eY = invoke(U(), "lockNeutrinoSP", [toString(V()), ah], [AttachedPayment(T(), eg)]) | |
801 | + | if ((eY == eY)) | |
794 | 802 | then { | |
795 | - | let eW = invoke(V(), "deposit", nil, [AttachedPayment(S(), eU)]) | |
796 | - | if ((eW == eW)) | |
797 | - | then (((dL(toString(eh.caller), eE, eF, eG, eH) ++ dW(bI, bJ, dc, dd, dg, de, df)) ++ ei(eT)) ++ eg((aO() + ee))) | |
798 | - | else throw("Strict value is not equal to itself.") | |
799 | - | } | |
800 | - | else throw("Strict value is not equal to itself.") | |
801 | - | } | |
802 | - | } | |
803 | - | ||
804 | - | ||
805 | - | ||
806 | - | @Callable(eh) | |
807 | - | func addMargin () = { | |
808 | - | let eI = eh.payments[0].amount | |
809 | - | if (if (if (if ((eh.payments[0].assetId != S())) | |
810 | - | then true | |
811 | - | else !(bu(toString(eh.caller)))) | |
812 | - | then true | |
813 | - | else !(bv())) | |
814 | - | then true | |
815 | - | else bw()) | |
816 | - | then throw("Invalid addMargin parameters") | |
817 | - | else { | |
818 | - | let eJ = am(eI, aP()) | |
819 | - | let ee = (eI - eJ) | |
820 | - | let eX = bp(toString(eh.caller)) | |
821 | - | let ep = eX._1 | |
822 | - | let eq = eX._2 | |
823 | - | let er = eX._3 | |
824 | - | let es = eX._4 | |
825 | - | let eT = (eJ / 2) | |
826 | - | let eU = (eJ - eT) | |
827 | - | let eV = invoke(T(), "lockNeutrinoSP", [toString(U()), af], [AttachedPayment(S(), ee)]) | |
828 | - | if ((eV == eV)) | |
829 | - | then { | |
830 | - | let eW = invoke(V(), "deposit", nil, [AttachedPayment(S(), eU)]) | |
831 | - | if ((eW == eW)) | |
832 | - | then ((dL(toString(eh.caller), ep, (eq + ee), er, es) ++ ei(eT)) ++ eg((aO() + ee))) | |
833 | - | else throw("Strict value is not equal to itself.") | |
834 | - | } | |
835 | - | else throw("Strict value is not equal to itself.") | |
836 | - | } | |
837 | - | } | |
838 | - | ||
839 | - | ||
840 | - | ||
841 | - | @Callable(eh) | |
842 | - | func removeMargin (ee) = if (if (if (if ((0 >= ee)) | |
843 | - | then true | |
844 | - | else !(bu(toString(eh.caller)))) | |
845 | - | then true | |
846 | - | else !(bv())) | |
847 | - | then true | |
848 | - | else bw()) | |
849 | - | then throw("Invalid removeMargin parameters") | |
850 | - | else { | |
851 | - | let eY = bp(toString(eh.caller)) | |
852 | - | let ep = eY._1 | |
853 | - | let eq = eY._2 | |
854 | - | let er = eY._3 | |
855 | - | let es = eY._4 | |
856 | - | let eZ = -(ee) | |
857 | - | let fa = bT(ep, eq, es, eZ) | |
858 | - | let cc = fa._1 | |
859 | - | let cd = fa._2 | |
860 | - | if ((cd != 0)) | |
861 | - | then throw("Invalid removed margin amount") | |
862 | - | else { | |
863 | - | let fb = cJ(cc, cd, er) | |
864 | - | if (!(bi(fb, aQ(), true))) | |
865 | - | then throw(((("Too much margin removed: " + toString(fb)) + " < ") + toString(aQ()))) | |
866 | - | else { | |
867 | - | let fc = invoke(T(), "unlockNeutrino", [ee, toBase58String(S())], nil) | |
868 | - | if ((fc == fc)) | |
869 | - | then ((dL(toString(eh.caller), ep, cc, er, bn(ep)) ++ ed(eh.caller, ee)) ++ eg((aO() - ee))) | |
870 | - | else throw("Strict value is not equal to itself.") | |
871 | - | } | |
872 | - | } | |
873 | - | } | |
874 | - | ||
875 | - | ||
876 | - | ||
877 | - | @Callable(eh) | |
878 | - | func closePosition () = if (if (if (!(bu(toString(eh.caller)))) | |
879 | - | then true | |
880 | - | else !(bv())) | |
881 | - | then true | |
882 | - | else bw()) | |
883 | - | then throw("Invalid closePosition parameters") | |
884 | - | else { | |
885 | - | let fd = cT(toString(eh.caller)) | |
886 | - | let cF = fd._1 | |
887 | - | let fe = fd._2 | |
888 | - | let cY = fd._3 | |
889 | - | let cZ = fd._4 | |
890 | - | let bI = fd._5 | |
891 | - | let bJ = fd._6 | |
892 | - | let dc = fd._7 | |
893 | - | let dd = fd._8 | |
894 | - | let dg = fd._9 | |
895 | - | let cG = fd._10 | |
896 | - | let de = fd._11 | |
897 | - | let df = fd._12 | |
898 | - | if ((fe > 0)) | |
899 | - | then throw("Unable to close position with bad debt") | |
900 | - | else { | |
901 | - | let ff = an(cZ) | |
902 | - | let fg = (aO() - ff) | |
903 | - | let fh = if ((0 > fg)) | |
904 | - | then $Tuple2(0, an(fg)) | |
905 | - | else $Tuple2(fg, 0) | |
906 | - | let fi = fh._1 | |
907 | - | let fj = fh._2 | |
908 | - | let fk = if ((fj > 0)) | |
909 | - | then { | |
910 | - | let fl = invoke(V(), "withdraw", [fj], nil) | |
911 | - | if ((fl == fl)) | |
912 | - | then nil | |
913 | - | else throw("Strict value is not equal to itself.") | |
914 | - | } | |
915 | - | else nil | |
916 | - | if ((fk == fk)) | |
917 | - | then { | |
918 | - | let fc = invoke(T(), "unlockNeutrino", [(ff - fj), toBase58String(S())], nil) | |
919 | - | if ((fc == fc)) | |
920 | - | then (((ec(toString(eh.caller)) ++ dW(bI, bJ, dc, dd, dg, de, df)) ++ ed(eh.caller, ff)) ++ eg(fi)) | |
921 | - | else throw("Strict value is not equal to itself.") | |
922 | - | } | |
923 | - | else throw("Strict value is not equal to itself.") | |
924 | - | } | |
925 | - | } | |
926 | - | ||
927 | - | ||
928 | - | ||
929 | - | @Callable(eh) | |
930 | - | func liquidate (bq) = { | |
931 | - | let fm = cN(bq, ag) | |
932 | - | let fb = if (cr()) | |
933 | - | then { | |
934 | - | let fn = cN(bq, ah) | |
935 | - | ao(fm, fn) | |
936 | - | } | |
937 | - | else fm | |
938 | - | if (if (if (if (!(bi(fb, ba(), false))) | |
939 | - | then true | |
940 | - | else !(bu(bq))) | |
941 | - | then true | |
942 | - | else !(bv())) | |
943 | - | then true | |
944 | - | else bw()) | |
945 | - | then throw("Unable to liquidate") | |
946 | - | else { | |
947 | - | let fo = cT(bq) | |
948 | - | let cF = fo._1 | |
949 | - | let cd = fo._2 | |
950 | - | let cG = fo._3 | |
951 | - | let cH = fo._4 | |
952 | - | let bI = fo._5 | |
953 | - | let bJ = fo._6 | |
954 | - | let dc = fo._7 | |
955 | - | let dd = fo._8 | |
956 | - | let dg = fo._9 | |
957 | - | let db = fo._10 | |
958 | - | let de = fo._11 | |
959 | - | let df = fo._12 | |
960 | - | let fp = am(db, bb()) | |
961 | - | let fq = (fp / 2) | |
962 | - | let eU = (fp - fq) | |
963 | - | let fg = (aO() - fp) | |
964 | - | let fr = if ((0 > fg)) | |
965 | - | then $Tuple2(0, an(fg)) | |
966 | - | else $Tuple2(fg, 0) | |
967 | - | let fs = fr._1 | |
968 | - | let ft = fr._2 | |
969 | - | let fk = if ((ft > 0)) | |
970 | - | then { | |
971 | - | let fl = invoke(V(), "withdraw", [ft], nil) | |
972 | - | if ((fl == fl)) | |
973 | - | then nil | |
974 | - | else throw("Strict value is not equal to itself.") | |
975 | - | } | |
976 | - | else nil | |
977 | - | if ((fk == fk)) | |
978 | - | then { | |
979 | - | let fc = invoke(T(), "unlockNeutrino", [(fp - ft), toBase58String(S())], nil) | |
980 | - | if ((fc == fc)) | |
803 | + | let eZ = invoke(W(), "deposit", nil, [AttachedPayment(T(), eX)]) | |
804 | + | if ((eZ == eZ)) | |
981 | 805 | then { | |
982 | - | let eW = invoke(V(), "deposit", nil, [AttachedPayment(S(), eU)]) | |
983 | - | if ((eW == eW)) | |
984 | - | then (((ec(bq) ++ dW(bI, bJ, dc, dd, dg, de, df)) ++ ed(eh.caller, fq)) ++ eg(fs)) | |
806 | + | let fa = invoke(X(), "notifyFees", [toString(ej.caller), eM], nil) | |
807 | + | if ((fa == fa)) | |
808 | + | then { | |
809 | + | let eK = invoke(X(), "notifyNotional", [toString(ej.caller), eI], nil) | |
810 | + | if ((eK == eK)) | |
811 | + | then (((dN(toString(ej.caller), eG, eH, eI, eJ) ++ dY(bK, bL, de, df, di, dg, dh)) ++ ek(eW)) ++ ei((aQ() + eg))) | |
812 | + | else throw("Strict value is not equal to itself.") | |
813 | + | } | |
985 | 814 | else throw("Strict value is not equal to itself.") | |
986 | 815 | } | |
987 | 816 | else throw("Strict value is not equal to itself.") | |
988 | 817 | } | |
989 | 818 | else throw("Strict value is not equal to itself.") | |
990 | 819 | } | |
991 | 820 | } | |
992 | 821 | ||
993 | 822 | ||
994 | 823 | ||
995 | - | @Callable( | |
996 | - | func | |
997 | - | let | |
998 | - | if (if (if (( | |
824 | + | @Callable(ej) | |
825 | + | func addMargin () = { | |
826 | + | let eL = ej.payments[0].amount | |
827 | + | if (if (if (if ((ej.payments[0].assetId != T())) | |
999 | 828 | then true | |
1000 | - | else !( | |
829 | + | else !(bw(toString(ej.caller)))) | |
1001 | 830 | then true | |
1002 | - | else bw()) | |
1003 | - | then throw(((("Invalid funding block timestamp: " + toString(lastBlock.timestamp)) + " < ") + toString(fu))) | |
831 | + | else !(bx())) | |
832 | + | then true | |
833 | + | else by()) | |
834 | + | then throw("Invalid addMargin parameters") | |
1004 | 835 | else { | |
1005 | - | let fv = cl() | |
1006 | - | let fw = dh() | |
1007 | - | let fx = (fw - fv) | |
1008 | - | let fy = if (if ((bg() == 0)) | |
1009 | - | then true | |
1010 | - | else (bh() == 0)) | |
1011 | - | then $Tuple2(0, 0) | |
1012 | - | else if ((0 > fx)) | |
1013 | - | then { | |
1014 | - | let fz = ak(am(fx, aY()), ae) | |
1015 | - | let fA = ak(am(fz, bg()), bh()) | |
1016 | - | $Tuple2(fz, fA) | |
1017 | - | } | |
1018 | - | else { | |
1019 | - | let fA = ak(am(fx, aY()), ae) | |
1020 | - | let fz = ak(am(fA, bh()), bg()) | |
1021 | - | $Tuple2(fz, fA) | |
1022 | - | } | |
1023 | - | let fz = fy._1 | |
1024 | - | let fA = fy._2 | |
1025 | - | dF((fu + aZ()), (be() + fA), (bf() + fz), ak(fA, fv), ak(fz, fv)) | |
836 | + | let eM = ao(eL, aR()) | |
837 | + | let eg = (eL - eM) | |
838 | + | let fb = br(toString(ej.caller)) | |
839 | + | let er = fb._1 | |
840 | + | let es = fb._2 | |
841 | + | let et = fb._3 | |
842 | + | let eu = fb._4 | |
843 | + | let eW = (eM / 2) | |
844 | + | let eX = (eM - eW) | |
845 | + | let eY = invoke(U(), "lockNeutrinoSP", [toString(V()), ah], [AttachedPayment(T(), eg)]) | |
846 | + | if ((eY == eY)) | |
847 | + | then { | |
848 | + | let eZ = invoke(W(), "deposit", nil, [AttachedPayment(T(), eX)]) | |
849 | + | if ((eZ == eZ)) | |
850 | + | then { | |
851 | + | let fa = invoke(X(), "notifyFees", [toString(ej.caller), eM], nil) | |
852 | + | if ((fa == fa)) | |
853 | + | then ((dN(toString(ej.caller), er, (es + eg), et, eu) ++ ek(eW)) ++ ei((aQ() + eg))) | |
854 | + | else throw("Strict value is not equal to itself.") | |
855 | + | } | |
856 | + | else throw("Strict value is not equal to itself.") | |
857 | + | } | |
858 | + | else throw("Strict value is not equal to itself.") | |
1026 | 859 | } | |
1027 | 860 | } | |
1028 | 861 | ||
1029 | 862 | ||
1030 | 863 | ||
1031 | - | @Callable(eh) | |
1032 | - | func v_get (bq) = { | |
1033 | - | let fB = cT(bq) | |
1034 | - | let cF = fB._1 | |
1035 | - | let cG = fB._2 | |
1036 | - | let cH = fB._3 | |
1037 | - | let fC = fB._4 | |
1038 | - | throw((((ai(cG) + ai(cH)) + ai(fC)) + ai(cS(bq)))) | |
864 | + | @Callable(ej) | |
865 | + | func removeMargin (eg) = if (if (if (if ((0 >= eg)) | |
866 | + | then true | |
867 | + | else !(bw(toString(ej.caller)))) | |
868 | + | then true | |
869 | + | else !(bx())) | |
870 | + | then true | |
871 | + | else by()) | |
872 | + | then throw("Invalid removeMargin parameters") | |
873 | + | else { | |
874 | + | let fc = br(toString(ej.caller)) | |
875 | + | let er = fc._1 | |
876 | + | let es = fc._2 | |
877 | + | let et = fc._3 | |
878 | + | let eu = fc._4 | |
879 | + | let fd = -(eg) | |
880 | + | let fe = bV(er, es, eu, fd) | |
881 | + | let ce = fe._1 | |
882 | + | let cf = fe._2 | |
883 | + | if ((cf != 0)) | |
884 | + | then throw("Invalid removed margin amount") | |
885 | + | else { | |
886 | + | let ff = cL(ce, cf, et) | |
887 | + | if (!(bk(ff, aS(), true))) | |
888 | + | then throw(((("Too much margin removed: " + toString(ff)) + " < ") + toString(aS()))) | |
889 | + | else { | |
890 | + | let fg = invoke(U(), "unlockNeutrino", [eg, toBase58String(T())], nil) | |
891 | + | if ((fg == fg)) | |
892 | + | then ((dN(toString(ej.caller), er, ce, et, bp(er)) ++ ef(ej.caller, eg)) ++ ei((aQ() - eg))) | |
893 | + | else throw("Strict value is not equal to itself.") | |
894 | + | } | |
895 | + | } | |
896 | + | } | |
897 | + | ||
898 | + | ||
899 | + | ||
900 | + | @Callable(ej) | |
901 | + | func closePosition () = if (if (if (!(bw(toString(ej.caller)))) | |
902 | + | then true | |
903 | + | else !(bx())) | |
904 | + | then true | |
905 | + | else by()) | |
906 | + | then throw("Invalid closePosition parameters") | |
907 | + | else { | |
908 | + | let fh = cV(toString(ej.caller)) | |
909 | + | let cH = fh._1 | |
910 | + | let fi = fh._2 | |
911 | + | let da = fh._3 | |
912 | + | let db = fh._4 | |
913 | + | let bK = fh._5 | |
914 | + | let bL = fh._6 | |
915 | + | let de = fh._7 | |
916 | + | let df = fh._8 | |
917 | + | let di = fh._9 | |
918 | + | let cI = fh._10 | |
919 | + | let dg = fh._11 | |
920 | + | let dh = fh._12 | |
921 | + | if ((fi > 0)) | |
922 | + | then throw("Unable to close position with bad debt") | |
923 | + | else { | |
924 | + | let fj = ap(db) | |
925 | + | let fk = (aQ() - fj) | |
926 | + | let fl = if ((0 > fk)) | |
927 | + | then $Tuple2(0, ap(fk)) | |
928 | + | else $Tuple2(fk, 0) | |
929 | + | let fm = fl._1 | |
930 | + | let fn = fl._2 | |
931 | + | let fo = if ((fn > 0)) | |
932 | + | then { | |
933 | + | let fp = invoke(W(), "withdraw", [fn], nil) | |
934 | + | if ((fp == fp)) | |
935 | + | then nil | |
936 | + | else throw("Strict value is not equal to itself.") | |
937 | + | } | |
938 | + | else nil | |
939 | + | if ((fo == fo)) | |
940 | + | then { | |
941 | + | let fg = invoke(U(), "unlockNeutrino", [(fj - fn), toBase58String(T())], nil) | |
942 | + | if ((fg == fg)) | |
943 | + | then { | |
944 | + | let eK = invoke(X(), "notifyNotional", [toString(ej.caller), 0], nil) | |
945 | + | if ((eK == eK)) | |
946 | + | then (((ee(toString(ej.caller)) ++ dY(bK, bL, de, df, di, dg, dh)) ++ ef(ej.caller, fj)) ++ ei(fm)) | |
947 | + | else throw("Strict value is not equal to itself.") | |
948 | + | } | |
949 | + | else throw("Strict value is not equal to itself.") | |
950 | + | } | |
951 | + | else throw("Strict value is not equal to itself.") | |
952 | + | } | |
953 | + | } | |
954 | + | ||
955 | + | ||
956 | + | ||
957 | + | @Callable(ej) | |
958 | + | func liquidate (bs) = { | |
959 | + | let fq = cP(bs, ai) | |
960 | + | let ff = if (ct()) | |
961 | + | then { | |
962 | + | let fr = cP(bs, aj) | |
963 | + | aq(fq, fr) | |
964 | + | } | |
965 | + | else fq | |
966 | + | if (if (if (if (!(bk(ff, bc(), false))) | |
967 | + | then true | |
968 | + | else !(bw(bs))) | |
969 | + | then true | |
970 | + | else !(bx())) | |
971 | + | then true | |
972 | + | else by()) | |
973 | + | then throw("Unable to liquidate") | |
974 | + | else { | |
975 | + | let fs = cV(bs) | |
976 | + | let cH = fs._1 | |
977 | + | let cf = fs._2 | |
978 | + | let cI = fs._3 | |
979 | + | let cJ = fs._4 | |
980 | + | let bK = fs._5 | |
981 | + | let bL = fs._6 | |
982 | + | let de = fs._7 | |
983 | + | let df = fs._8 | |
984 | + | let di = fs._9 | |
985 | + | let dd = fs._10 | |
986 | + | let dg = fs._11 | |
987 | + | let dh = fs._12 | |
988 | + | let ft = ao(dd, bd()) | |
989 | + | let fu = (ft / 2) | |
990 | + | let eX = (ft - fu) | |
991 | + | let fk = (aQ() - ft) | |
992 | + | let fv = if ((0 > fk)) | |
993 | + | then $Tuple2(0, ap(fk)) | |
994 | + | else $Tuple2(fk, 0) | |
995 | + | let fw = fv._1 | |
996 | + | let fx = fv._2 | |
997 | + | let fo = if ((fx > 0)) | |
998 | + | then { | |
999 | + | let fp = invoke(W(), "withdraw", [fx], nil) | |
1000 | + | if ((fp == fp)) | |
1001 | + | then nil | |
1002 | + | else throw("Strict value is not equal to itself.") | |
1003 | + | } | |
1004 | + | else nil | |
1005 | + | if ((fo == fo)) | |
1006 | + | then { | |
1007 | + | let fg = invoke(U(), "unlockNeutrino", [(ft - fx), toBase58String(T())], nil) | |
1008 | + | if ((fg == fg)) | |
1009 | + | then { | |
1010 | + | let eZ = invoke(W(), "deposit", nil, [AttachedPayment(T(), eX)]) | |
1011 | + | if ((eZ == eZ)) | |
1012 | + | then { | |
1013 | + | let eK = invoke(X(), "notifyNotional", [bs, 0], nil) | |
1014 | + | if ((eK == eK)) | |
1015 | + | then (((ee(bs) ++ dY(bK, bL, de, df, di, dg, dh)) ++ ef(ej.caller, fu)) ++ ei(fw)) | |
1016 | + | else throw("Strict value is not equal to itself.") | |
1017 | + | } | |
1018 | + | else throw("Strict value is not equal to itself.") | |
1019 | + | } | |
1020 | + | else throw("Strict value is not equal to itself.") | |
1021 | + | } | |
1022 | + | else throw("Strict value is not equal to itself.") | |
1023 | + | } | |
1039 | 1024 | } | |
1040 | 1025 | ||
1041 | 1026 | ||
1042 | 1027 | ||
1043 | - | @Callable(eh) | |
1044 | - | func view_calcRemainMarginWithFundingPayment (bq) = { | |
1045 | - | let fD = bp(bq) | |
1046 | - | let bt = fD._1 | |
1047 | - | let cx = fD._2 | |
1048 | - | let cP = fD._3 | |
1049 | - | let cz = fD._4 | |
1050 | - | let fE = cu(bq, ag) | |
1051 | - | let cC = fE._1 | |
1052 | - | let cI = fE._2 | |
1053 | - | let fF = bT(bt, cx, cz, cI) | |
1054 | - | let cc = fF._1 | |
1055 | - | let cd = fF._2 | |
1056 | - | let bY = fF._3 | |
1057 | - | throw(((ai(cc) + ai(bY)) + ai(cS(bq)))) | |
1028 | + | @Callable(ej) | |
1029 | + | func payFunding () = { | |
1030 | + | let fy = aY() | |
1031 | + | if (if (if ((fy > lastBlock.timestamp)) | |
1032 | + | then true | |
1033 | + | else !(bx())) | |
1034 | + | then true | |
1035 | + | else by()) | |
1036 | + | then throw(((("Invalid funding block timestamp: " + toString(lastBlock.timestamp)) + " < ") + toString(fy))) | |
1037 | + | else { | |
1038 | + | let fz = cn() | |
1039 | + | let fA = dj() | |
1040 | + | let fB = (fA - fz) | |
1041 | + | let fC = if (if ((bi() == 0)) | |
1042 | + | then true | |
1043 | + | else (bj() == 0)) | |
1044 | + | then $Tuple2(0, 0) | |
1045 | + | else if ((0 > fB)) | |
1046 | + | then { | |
1047 | + | let fD = am(ao(fB, ba()), ag) | |
1048 | + | let fE = am(ao(fD, bi()), bj()) | |
1049 | + | $Tuple2(fD, fE) | |
1050 | + | } | |
1051 | + | else { | |
1052 | + | let fE = am(ao(fB, ba()), ag) | |
1053 | + | let fD = am(ao(fE, bj()), bi()) | |
1054 | + | $Tuple2(fD, fE) | |
1055 | + | } | |
1056 | + | let fD = fC._1 | |
1057 | + | let fE = fC._2 | |
1058 | + | dH((fy + bb()), (bg() + fE), (bh() + fD), am(fE, fz), am(fD, fz)) | |
1059 | + | } | |
1058 | 1060 | } | |
1059 | 1061 | ||
1060 | 1062 | ||
1061 | - | @Verifier(fG) | |
1062 | - | func fH () = sigVerify(fG.bodyBytes, fG.proofs[0], R()) | |
1063 | + | ||
1064 | + | @Callable(ej) | |
1065 | + | func v_get (bs) = { | |
1066 | + | let fF = cV(bs) | |
1067 | + | let cH = fF._1 | |
1068 | + | let cI = fF._2 | |
1069 | + | let cJ = fF._3 | |
1070 | + | let fG = fF._4 | |
1071 | + | throw((((ak(cI) + ak(cJ)) + ak(fG)) + ak(cU(bs)))) | |
1072 | + | } | |
1073 | + | ||
1074 | + | ||
1075 | + | ||
1076 | + | @Callable(ej) | |
1077 | + | func view_calcRemainMarginWithFundingPayment (bs) = { | |
1078 | + | let fH = br(bs) | |
1079 | + | let bv = fH._1 | |
1080 | + | let cz = fH._2 | |
1081 | + | let cR = fH._3 | |
1082 | + | let cB = fH._4 | |
1083 | + | let fI = cw(bs, ai) | |
1084 | + | let cE = fI._1 | |
1085 | + | let cK = fI._2 | |
1086 | + | let fJ = bV(bv, cz, cB, cK) | |
1087 | + | let ce = fJ._1 | |
1088 | + | let cf = fJ._2 | |
1089 | + | let ca = fJ._3 | |
1090 | + | throw(((ak(ce) + ak(ca)) + ak(cU(bs)))) | |
1091 | + | } | |
1092 | + | ||
1093 | + | ||
1094 | + | ||
1095 | + | @Callable(ej) | |
1096 | + | func forceMoveAsset (bs,eg) = if (if ((addressFromPublicKey(S()) != ej.caller)) | |
1097 | + | then true | |
1098 | + | else (0 > eg)) | |
1099 | + | then throw("Invalid forceMoveAsset parameters") | |
1100 | + | else { | |
1101 | + | let fg = invoke(U(), "unlockNeutrino", [eg, toBase58String(T())], nil) | |
1102 | + | if ((fg == fg)) | |
1103 | + | then (ef(addressFromStringValue(bs), eg) ++ ei((aQ() - eg))) | |
1104 | + | else throw("Strict value is not equal to itself.") | |
1105 | + | } | |
1106 | + | ||
1107 | + | ||
1108 | + | @Verifier(fK) | |
1109 | + | func fL () = sigVerify(fK.bodyBytes, fK.proofs[0], S()) | |
1063 | 1110 |
github/deemru/w8io/169f3d6 323.81 ms ◑