tx · Fj8LyeAxMh3HyxXSCJcfdzuxbkP34QExpoCxpuGYvYrU

3N9kbR6BQEQV7pwBfDFzprJtNofgi6fSJ6Y:  -0.03700000 Waves

2022.12.21 20:40 [2370372] smart account 3N9kbR6BQEQV7pwBfDFzprJtNofgi6fSJ6Y > SELF 0.00000000 Waves

{ "type": 13, "id": "Fj8LyeAxMh3HyxXSCJcfdzuxbkP34QExpoCxpuGYvYrU", "fee": 3700000, "feeAssetId": null, "timestamp": 1671644440005, "version": 2, "chainId": 84, "sender": "3N9kbR6BQEQV7pwBfDFzprJtNofgi6fSJ6Y", "senderPublicKey": "EajGg1J8duApPELWPw9gVkPwAKFC9hujhvCcne4FunUa", "proofs": [ "2b1ioECWLgjEpbDacsYGNQMb1VGcPKqNumL1NbfzChW8bP7NYMHrfzYp5GKAyB566iZTV6PWV9PYHjxoVNwkjDog" ], "script": "base64:BgJLCAISBAoCCAgSAwoBCBIAEgMKAQgSCgoICAEBAQEBAQgSCwoJCAEBAQgBAQEBEg0KCwgIAQEBAQEBCAgBEgMKAQESAwoBARIDCgEBOwAUa19jb29yZGluYXRvckFkZHJlc3MCFGtfY29vcmRpbmF0b3JBZGRyZXNzABJrX2FkbWluX3B1YmxpY19rZXkCEmtfYWRtaW5fcHVibGljX2tleQANa19xdW90ZV9hc3NldAINa19xdW90ZV9hc3NldAAFa19hbW0CBWtfYW1tABFrX21hbmFnZXJfYWRkcmVzcwIRa19tYW5hZ2VyX2FkZHJlc3MAEmtfcG9zaXRpb25TZXF1ZW5jZQISa19wb3NpdGlvblNlcXVlbmNlAA5rX3Bvc2l0aW9uU2l6ZQIOa19wb3NpdGlvblNpemUABWtfZmVlAgVrX2ZlZQAQa19leGVjdXRlZE9yZGVycwIQa19leGVjdXRlZE9yZGVycwAQa19jYW5jZWxlZE9yZGVycwIQa19jYW5jZWxlZE9yZGVycwAHa19vcmRlcgIHa19vcmRlcgANa19sYXN0T3JkZXJJZAINa19sYXN0T3JkZXJJZAAQa190cmFkZXJ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b1Jlc2V0Q29udGV4dAQTbmV3VHJhZGVyT3JkZXJDb3VudAkAZQIJARNnZXRUcmFkZXJPcmRlckNvdW50AgUEX2FtbQUHX3RyYWRlcgABCQDOCAIJAM4IAgkBFnVwZGF0ZVRyYWRlck9yZGVyQ291bnQDBQRfYW1tBQdfdHJhZGVyBRNuZXdUcmFkZXJPcmRlckNvdW50CQEQYWRkUmVtb3ZlT3JkZXJJZAQFCF9vcmRlcklkBQRfYW1tBQdfdHJhZGVyBwkBEG1hcmtFeGVjdXRlT3JkZXIBBQhfb3JkZXJJZAkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgFpARR2aWV3X2NhbkV4ZWN1dGVPcmRlcgEIX29yZGVySWQEAXMJAPwHBAUEdGhpcwIMZXhlY3V0ZU9yZGVyCQDMCAIFCF9vcmRlcklkBQNuaWwFA25pbAMJAAACBQFzBQFzCQACAQIHU3VjY2VzcwkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgECdHgBBnZlcmlmeQAJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAJAQ5hZG1pblB1YmxpY0tleQC8ceGo", "height": 2370372, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9HEMv6NzTacEfbxV2S5MSzaPbbvk6qzzx3MmD4UrEe71 Next: G7FXZm7SAJJt3w4FYMYKa97zdrFBQqRBG961NkLTHbhM Diff:
OldNewDifferences
2727
2828 let m = "k_traderOrderCnt"
2929
30-let n = "k_sender"
30+let n = "k_traderOrderIds"
3131
32-let o = "k_initialized"
32+let o = "k_sender"
3333
34-let p = 1
34+let p = "k_initialized"
3535
36-let q = 2
36+let q = 1
3737
38-let r = 3
38+let r = 2
3939
40-let s = 1
40+let s = 3
4141
42-let t = 2
42+let t = 1
4343
44-let u = 1
44+let u = 2
4545
46-let v = 2
46+let v = 1
4747
48-let w = 5
48+let w = 2
4949
50-let x = lastBlock.timestamp
50+let x = 5
5151
52-let y = (1 * (((((10 * 10) * 10) * 10) * 10) * 10))
52+let y = lastBlock.timestamp
5353
54-let z = (y / 200)
54+let z = (1 * (((((10 * 10) * 10) * 10) * 10) * 10))
5555
56-func A (B) = if ((B > 0))
57- then B
58- else -(B)
56+let A = (z / 200)
57+
58+func B (C) = if ((C > 0))
59+ then C
60+ else -(C)
5961
6062
61-func C (B,D) = fraction(B, y, D, HALFEVEN)
63+func D (C,E) = fraction(C, z, E, HALFEVEN)
6264
6365
64-func E (B,D) = fraction(B, D, y, HALFEVEN)
66+func F (C,E) = fraction(C, E, z, HALFEVEN)
6567
6668
67-func F (B,D) = if ((B > D))
68- then D
69- else B
69+func G (C,E) = if ((C > E))
70+ then E
71+ else C
7072
7173
72-func G (H,I) = ((H + "_") + I)
74+func H (I,J) = ((I + "_") + J)
7375
7476
75-func J (K) = ((i + "_") + toString(K))
77+func K (L) = ((i + "_") + toString(L))
7678
7779
78-func L (K) = ((j + "_") + toString(K))
80+func M (L) = ((j + "_") + toString(L))
7981
8082
81-func M (K) = G(k, toString(K))
83+func N (L) = H(k, toString(L))
8284
8385
84-func N (O,P) = ((((m + "_") + O) + "_") + P)
86+func O (P,Q) = ((((m + "_") + P) + "_") + Q)
8587
8688
87-func Q () = valueOrErrorMessage(addressFromString(getStringValue(this, a)), "Coordinator not set")
89+func R (P,Q) = ((((n + "_") + P) + "_") + Q)
8890
8991
90-func R () = fromBase58String(getStringValue(Q(), c))
92+func S () = valueOrErrorMessage(addressFromString(getStringValue(this, a)), "Coordinator not set")
9193
9294
93-func S () = valueOrErrorMessage(addressFromString(getStringValue(Q(), e)), "Manager not set")
95+func T () = fromBase58String(getStringValue(S(), c))
9496
9597
96-func T (I) = valueOrElse(getBoolean(Q(), G(d, I)), false)
98+func U () = valueOrErrorMessage(addressFromString(getStringValue(S(), e)), "Manager not set")
9799
98100
99-func U () = fromBase58String(getStringValue(Q(), b))
101+func V (J) = valueOrElse(getBoolean(S(), H(d, J)), false)
100102
101103
102-func V () = valueOrElse(getBoolean(this, o), false)
104+func W () = fromBase58String(getStringValue(S(), b))
103105
104106
105-func W (K) = if (valueOrElse(getBoolean(this, J(K)), false))
106- then throw(("Order already executed: " + toString(K)))
107- else if (valueOrElse(getBoolean(this, L(K)), false))
108- then throw(("Order already cancelled: " + toString(K)))
107+func X () = valueOrElse(getBoolean(this, p), false)
108+
109+
110+func Y (L) = if (valueOrElse(getBoolean(this, K(L)), false))
111+ then throw(("Order already executed: " + toString(L)))
112+ else if (valueOrElse(getBoolean(this, M(L)), false))
113+ then throw(("Order already cancelled: " + toString(L)))
109114 else true
110115
111116
112-func X () = valueOrElse(getInteger(this, l), 0)
117+func Z () = valueOrElse(getInteger(this, l), 0)
113118
114119
115-func Y (O,P) = {
116- let Z = N(O, P)
117- valueOrElse(getInteger(this, Z), 0)
120+func aa (P,Q) = {
121+ let ab = O(P, Q)
122+ valueOrElse(getInteger(this, ab), 0)
118123 }
119124
120125
121-func aa (K) = {
122- let ab = valueOrErrorMessage(getString(this, M(K)), ("Invalid order id: " + toString(K)))
123- let ac = split(ab, ",")
124- let ad = ac[0]
125- let ae = ac[1]
126- let af = valueOrErrorMessage(parseInt(ac[2]), "Invalid amountIn")
127- let ag = valueOrErrorMessage(parseInt(ac[3]), "Invalid leverage")
128- let ah = valueOrErrorMessage(parseInt(ac[4]), "Invalid type")
129- let ai = valueOrErrorMessage(parseInt(ac[5]), "Invalid triggerPrice")
130- let aj = valueOrErrorMessage(parseInt(ac[6]), "Invalid paymentUsdn")
131- let ak = valueOrErrorMessage(parseInt(ac[7]), "Invalid side")
132- let al = ac[8]
133- let am = valueOrErrorMessage(parseInt(ac[9]), "Invalid positionId")
134- let an = valueOrErrorMessage(parseInt(ac[10]), "Invalid limitPrice")
135- $Tuple11(ad, ae, af, ag, ah, ai, aj, ak, al, am, an)
126+func ac (P,Q) = {
127+ let ab = R(P, Q)
128+ let ad = valueOrElse(getString(this, ab), "")
129+ if ((ad == ""))
130+ then nil
131+ else split(ad, ",")
136132 }
137133
138134
139-func ao (O) = {
140- let ap = invoke(addressFromStringValue(O), "computeSpotPrice", nil, nil)
141- if ((ap == ap))
135+func ae (L) = {
136+ let af = valueOrErrorMessage(getString(this, N(L)), ("Invalid order id: " + toString(L)))
137+ let ag = split(af, ",")
138+ let ah = ag[0]
139+ let ai = ag[1]
140+ let aj = valueOrErrorMessage(parseInt(ag[2]), "Invalid amountIn")
141+ let ak = valueOrErrorMessage(parseInt(ag[3]), "Invalid leverage")
142+ let al = valueOrErrorMessage(parseInt(ag[4]), "Invalid type")
143+ let am = valueOrErrorMessage(parseInt(ag[5]), "Invalid triggerPrice")
144+ let an = valueOrErrorMessage(parseInt(ag[6]), "Invalid paymentUsdn")
145+ let ao = valueOrErrorMessage(parseInt(ag[7]), "Invalid side")
146+ let ap = ag[8]
147+ let aq = valueOrErrorMessage(parseInt(ag[9]), "Invalid positionId")
148+ let ar = valueOrErrorMessage(parseInt(ag[10]), "Invalid limitPrice")
149+ $Tuple11(ah, ai, aj, ak, al, am, an, ao, ap, aq, ar)
150+ }
151+
152+
153+func as (P) = {
154+ let at = invoke(addressFromStringValue(P), "computeSpotPrice", nil, nil)
155+ if ((at == at))
142156 then {
143- let aq = {
144- let ar = ap
145- if ($isInstanceOf(ar, "Int"))
157+ let au = {
158+ let av = at
159+ if ($isInstanceOf(av, "Int"))
146160 then {
147- let as = ar
148- as
161+ let aw = av
162+ aw
149163 }
150164 else throw("Invalid computeSpotPrice result")
151165 }
152- value(aq)
166+ value(au)
153167 }
154168 else throw("Strict value is not equal to itself.")
155169 }
156170
157171
158-func at (O,P) = {
159- let ap = invoke(addressFromStringValue(O), "computeFeeForTraderWithArtifact", [P, ""], nil)
160- if ((ap == ap))
172+func ax (P,Q) = {
173+ let at = invoke(addressFromStringValue(P), "computeFeeForTraderWithArtifact", [Q, ""], nil)
174+ if ((at == at))
161175 then {
162- let aq = {
163- let ar = ap
164- if ($isInstanceOf(ar, "(Int, Boolean)"))
176+ let au = {
177+ let av = at
178+ if ($isInstanceOf(av, "(Int, Boolean)"))
165179 then {
166- let as = ar
167- as._1
180+ let aw = av
181+ aw._1
168182 }
169183 else throw("Invalid computeFeeForTraderWithArtifact result")
170184 }
171- value(aq)
185+ value(au)
172186 }
173187 else throw("Strict value is not equal to itself.")
174188 }
175189
176190
177-func au (O,P) = {
178- let ad = addressFromStringValue(O)
179- let av = G(g, P)
180- valueOrElse(getInteger(ad, av), 0)
191+func ay (P,Q) = {
192+ let ah = addressFromStringValue(P)
193+ let az = H(g, Q)
194+ valueOrElse(getInteger(ah, az), 0)
181195 }
182196
183197
184-func aw (O,P) = {
185- let ad = addressFromStringValue(O)
186- let ax = G(f, P)
187- valueOrElse(getInteger(ad, ax), 0)
198+func aA (P,Q) = {
199+ let ah = addressFromStringValue(P)
200+ let aB = H(f, Q)
201+ valueOrElse(getInteger(ah, aB), 0)
188202 }
189203
190204
191-func ay (az) = E(az, z)
205+func aC (aD) = F(aD, A)
192206
193207
194-func aA (K,O,P,aB,aC,aD,aE,aF,aG,aH,aI,aJ) = {
195- let ab = makeString([O, P, toString(aB), toString(aC), toString(aD), toString(aE), toString(aF), toString(aG), aH, toString(aI), toString(aJ)], ",")
196-[StringEntry(M(K), ab)]
208+func aE (L,P,Q,aF,aG,aH,aI,aJ,aK,aL,aM,aN) = {
209+ let af = makeString([P, Q, toString(aF), toString(aG), toString(aH), toString(aI), toString(aJ), toString(aK), aL, toString(aM), toString(aN)], ",")
210+[StringEntry(N(L), af)]
197211 }
198212
199213
200-func aK (O,P,aL) = [IntegerEntry(N(O, P), aL)]
214+func aO (L,P,Q,aP) = {
215+ let aQ = ac(P, Q)
216+ let aR = if (aP)
217+ then (aQ :+ toString(L))
218+ else removeByIndex(aQ, valueOrErrorMessage(indexOf(aQ, toString(L)), ("No order with id: " + toString(L))))
219+ let aS = makeString(aR, ",")
220+[StringEntry(R(P, Q), aS)]
221+ }
201222
202223
203-func aM (aN) = [IntegerEntry(l, aN)]
224+func aT (P,Q,aU) = [IntegerEntry(O(P, Q), aU)]
204225
205226
206-func aO (K) = [BooleanEntry(G(i, toString(K)), true)]
227+func aV (aW) = [IntegerEntry(l, aW)]
207228
208229
209-func aP (K) = [BooleanEntry(G(j, toString(K)), true)]
230+func aX (L) = [BooleanEntry(H(i, toString(L)), true)]
210231
211232
212-@Callable(aQ)
213-func setContext (aR) = if ((aQ.caller != this))
214- then throw("Only self-call")
215- else [StringEntry(n, aR)]
233+func aY (L) = [BooleanEntry(H(j, toString(L)), true)]
216234
217235
218-
219-@Callable(aQ)
220-func resetContext () = if ((aQ.caller != this))
221- then throw("Only self-call")
222- else [DeleteEntry(n)]
223-
224-
225-
226-@Callable(aQ)
227-func initialize (aS) = if (V())
228- then throw("Already initialized")
229- else [StringEntry(a, aS), BooleanEntry(o, true)]
230-
231-
232-
233-@Callable(aQ)
234-func createOrder (O,aD,aE,aJ,aB,aC,aG,aH) = if ((size(aQ.payments) > 1))
235- then throw("Invalid createOrder parameters: invalid payment count")
236- else {
237- let aT = if ((size(aQ.payments) == 1))
238- then $Tuple2(toBase58String(valueOrErrorMessage(aQ.payments[0].assetId, "Invalid asset id")), aQ.payments[0].amount)
239- else $Tuple2("", 0)
240- let aU = aT._1
241- let aV = aT._2
242- let aW = invoke(this, "internalCreateOrder", [toString(aQ.caller), O, aD, aE, aJ, aB, aC, aG, aH, aU, aV], nil)
243- if ((aW == aW))
244- then nil
245- else throw("Strict value is not equal to itself.")
236+@Callable(aZ)
237+func cleanUpStaleOrders (P,Q) = {
238+ let ba = ac(P, Q)
239+ func bb (bc,L) = {
240+ let bd = valueOrErrorMessage(parseInt(L), "Invalid order id")
241+ let be = ae(bd)
242+ let bf = be._1
243+ let bg = be._2
244+ let bh = be._3
245+ let bi = be._4
246+ let aH = be._5
247+ let bj = be._6
248+ let bk = be._7
249+ let bl = be._8
250+ let bm = be._9
251+ let aM = be._10
252+ let bn = be._11
253+ let bo = ay(P, Q)
254+ let bp = if ((bo != 0))
255+ then aA(P, Q)
256+ else 0
257+ if (if (if ((aH == q))
258+ then true
259+ else (aH == r))
260+ then (bp != aM)
261+ else false)
262+ then {
263+ let bq = (aY(bd) ++ aO(bd, P, Q, false))
264+ (bc ++ bq)
265+ }
266+ else bc
246267 }
247268
269+ let br = ba
270+ let bs = size(br)
271+ let bt = nil
272+ func bu (bv,bw) = if ((bw >= bs))
273+ then bv
274+ else bb(bv, br[bw])
248275
276+ func bx (bv,bw) = if ((bw >= bs))
277+ then bv
278+ else throw("List size exceeds 5")
249279
250-@Callable(aQ)
251-func increasePositionWithStopLoss (O,aX,aC,aY,aH,aZ,ba,bb,bc) = {
252- let P = toString(aQ.caller)
253- if (if (!(V()))
254- then true
255- else !(T(O)))
256- then throw("Invalid increasePositionWithStopLoss parameters")
257- else {
258- let bd = au(O, P)
259- if ((bd != 0))
260- then throw("Invalid increasePositionWithStopLoss parameters: only new position")
261- else {
262- let be = invoke(this, "setContext", [P], nil)
263- if ((be == be))
264- then {
265- let bf = invoke(addressFromStringValue(O), "increasePosition", [aX, aC, aY, aH], aQ.payments)
266- if ((bf == bf))
267- then {
268- let bg = invoke(this, "resetContext", nil, nil)
269- if ((bg == bg))
270- then {
271- let bh = au(O, P)
272- if ((bh == bh))
273- then {
274- let af = A(bh)
275- let bi = if ((0 > bh))
276- then s
277- else t
278- let bj = if ((aZ > 0))
279- then {
280- let bj = invoke(this, "internalCreateOrder", [P, O, p, aZ, ba, af, 0, bi, aH, "", 0], nil)
281- if ((bj == bj))
282- then nil
283- else throw("Strict value is not equal to itself.")
284- }
285- else nil
286- if ((bj == bj))
287- then {
288- let bk = if ((bb > 0))
289- then {
290- let bk = invoke(this, "internalCreateOrder", [P, O, q, bb, bc, af, 0, bi, aH, "", 0], nil)
291- if ((bk == bk))
292- then nil
293- else throw("Strict value is not equal to itself.")
294- }
295- else nil
296- if ((bk == bk))
297- then nil
298- else throw("Strict value is not equal to itself.")
299- }
300- else throw("Strict value is not equal to itself.")
301- }
302- else throw("Strict value is not equal to itself.")
303- }
304- else throw("Strict value is not equal to itself.")
305- }
306- else throw("Strict value is not equal to itself.")
307- }
308- else throw("Strict value is not equal to itself.")
309- }
310- }
280+ bx(bu(bu(bu(bu(bu(bt, 0), 1), 2), 3), 4), 5)
311281 }
312282
313283
314284
315-@Callable(aQ)
316-func internalCreateOrder (P,O,aD,aE,aJ,aB,aC,aG,aH,bl,bm) = if (if (if (if (if (if (if (if (if (!(V()))
285+@Callable(aZ)
286+func setContext (by) = if ((aZ.caller != this))
287+ then throw("Only self-call")
288+ else [StringEntry(o, by)]
289+
290+
291+
292+@Callable(aZ)
293+func resetContext () = if ((aZ.caller != this))
294+ then throw("Only self-call")
295+ else [DeleteEntry(o)]
296+
297+
298+
299+@Callable(aZ)
300+func initialize (bz) = if (X())
301+ then throw("Already initialized")
302+ else [StringEntry(a, bz), BooleanEntry(p, true)]
303+
304+
305+
306+@Callable(aZ)
307+func createOrder (P,aH,aI,aN,aF,aG,aK,aL) = {
308+ let Q = toString(aZ.caller)
309+ let bA = invoke(this, "cleanUpStaleOrders", [P, Q], nil)
310+ if ((bA == bA))
311+ then if ((size(aZ.payments) > 1))
312+ then throw("Invalid createOrder parameters: invalid payment count")
313+ else {
314+ let bB = if ((size(aZ.payments) == 1))
315+ then $Tuple2(toBase58String(valueOrErrorMessage(aZ.payments[0].assetId, "Invalid asset id")), aZ.payments[0].amount)
316+ else $Tuple2("", 0)
317+ let bC = bB._1
318+ let bD = bB._2
319+ let bE = invoke(this, "internalCreateOrder", [Q, P, aH, aI, aN, aF, aG, aK, aL, bC, bD], nil)
320+ if ((bE == bE))
321+ then nil
322+ else throw("Strict value is not equal to itself.")
323+ }
324+ else throw("Strict value is not equal to itself.")
325+ }
326+
327+
328+
329+@Callable(aZ)
330+func increasePositionWithStopLoss (P,bF,aG,bG,aL,bH,bI,bJ,bK) = {
331+ let Q = toString(aZ.caller)
332+ let bA = invoke(this, "cleanUpStaleOrders", [P, Q], nil)
333+ if ((bA == bA))
334+ then if (if (!(X()))
335+ then true
336+ else !(V(P)))
337+ then throw("Invalid increasePositionWithStopLoss parameters")
338+ else {
339+ let bo = ay(P, Q)
340+ if ((bo != 0))
341+ then throw("Invalid increasePositionWithStopLoss parameters: only new position")
342+ else {
343+ let bL = invoke(this, "setContext", [Q], nil)
344+ if ((bL == bL))
345+ then {
346+ let bM = invoke(addressFromStringValue(P), "increasePosition", [bF, aG, bG, aL], aZ.payments)
347+ if ((bM == bM))
348+ then {
349+ let bN = invoke(this, "resetContext", nil, nil)
350+ if ((bN == bN))
351+ then {
352+ let bO = ay(P, Q)
353+ if ((bO == bO))
354+ then {
355+ let aj = B(bO)
356+ let bP = if ((0 > bO))
357+ then t
358+ else u
359+ let bQ = if ((bH > 0))
360+ then {
361+ let bQ = invoke(this, "internalCreateOrder", [Q, P, q, bH, bI, aj, 0, bP, aL, "", 0], nil)
362+ if ((bQ == bQ))
363+ then nil
364+ else throw("Strict value is not equal to itself.")
365+ }
366+ else nil
367+ if ((bQ == bQ))
368+ then {
369+ let bR = if ((bJ > 0))
370+ then {
371+ let bR = invoke(this, "internalCreateOrder", [Q, P, r, bJ, bK, aj, 0, bP, aL, "", 0], nil)
372+ if ((bR == bR))
373+ then nil
374+ else throw("Strict value is not equal to itself.")
375+ }
376+ else nil
377+ if ((bR == bR))
378+ then nil
379+ else throw("Strict value is not equal to itself.")
380+ }
381+ else throw("Strict value is not equal to itself.")
382+ }
383+ else throw("Strict value is not equal to itself.")
384+ }
385+ else throw("Strict value is not equal to itself.")
386+ }
387+ else throw("Strict value is not equal to itself.")
388+ }
389+ else throw("Strict value is not equal to itself.")
390+ }
391+ }
392+ else throw("Strict value is not equal to itself.")
393+ }
394+
395+
396+
397+@Callable(aZ)
398+func internalCreateOrder (Q,P,aH,aI,aN,aF,aG,aK,aL,bS,bT) = if (if (if (if (if (if (if (if (if (!(X()))
317399 then true
318- else !(T(O)))
400+ else !(V(P)))
319401 then true
320- else (0 >= aE))
402+ else (0 >= aI))
321403 then true
322- else (0 > aJ))
404+ else (0 > aN))
323405 then true
324- else (0 >= aB))
406+ else (0 >= aF))
325407 then true
326- else (0 > aC))
408+ else (0 > aG))
327409 then true
328- else !(if ((aG == s))
410+ else !(if ((aK == t))
329411 then true
330- else (aG == t)))
412+ else (aK == u)))
331413 then true
332- else !(if (if ((aD == p))
414+ else !(if (if ((aH == q))
333415 then true
334- else (aD == q))
416+ else (aH == r))
335417 then true
336- else (aD == r)))
418+ else (aH == s)))
337419 then true
338- else !((aQ.caller == this)))
420+ else !((aZ.caller == this)))
339421 then throw("Invalid createOrder parameters")
340422 else {
341- let bn = (X() + 1)
342- let bo = (Y(O, P) + 1)
343- let bd = au(O, P)
344- let aX = if (if (if ((bd == 0))
423+ let bU = (Z() + 1)
424+ let bV = (aa(P, Q) + 1)
425+ let bo = ay(P, Q)
426+ let bF = if (if (if ((bo == 0))
345427 then true
346- else if ((bd > 0))
347- then (aG == s)
428+ else if ((bo > 0))
429+ then (aK == t)
348430 else false)
349431 then true
350- else if ((0 > bd))
351- then (aG == t)
432+ else if ((0 > bo))
433+ then (aK == u)
352434 else false)
353- then u
354- else v
355- if (if ((bd == 0))
356- then if ((aD == p))
435+ then v
436+ else w
437+ if (if ((bo == 0))
438+ then if ((aH == q))
357439 then true
358- else (aD == q)
440+ else (aH == r)
359441 else false)
360442 then throw("Can not create STOP/TAKE order: no position")
361443 else {
362- let bp = if ((aX == u))
363- then if (if ((bl != toBase58String(R())))
444+ let bW = if ((bF == v))
445+ then if (if ((bS != toBase58String(T())))
364446 then true
365- else (bm != aB))
447+ else (bT != aF))
366448 then throw("Invalid createLimitOrder parameters: invalid payment")
367449 else {
368- let bq = invoke(S(), "deposit", nil, [AttachedPayment(R(), bm)])
369- if ((bq == bq))
370- then bm
450+ let bX = invoke(U(), "deposit", nil, [AttachedPayment(T(), bT)])
451+ if ((bX == bX))
452+ then bT
371453 else throw("Strict value is not equal to itself.")
372454 }
373455 else 0
374- if ((bp == bp))
456+ if ((bW == bW))
375457 then {
376- let am = if ((bd != 0))
377- then aw(O, P)
458+ let aq = if ((bo != 0))
459+ then aA(P, Q)
378460 else 0
379- if ((bo > w))
461+ if ((bV > x))
380462 then throw("Invalid createLimitOrder parameters: order count")
381- else ((aA(bn, O, P, aB, aC, aD, aE, bp, aG, aH, am, aJ) ++ aK(O, P, bo)) ++ aM(bn))
463+ else (((aE(bU, P, Q, aF, aG, aH, aI, bW, aK, aL, aq, aN) ++ aO(bU, P, Q, true)) ++ aT(P, Q, bV)) ++ aV(bU))
382464 }
383465 else throw("Strict value is not equal to itself.")
384466 }
386468
387469
388470
389-@Callable(aQ)
390-func cancelOrder (K) = {
391- let br = aa(K)
392- let O = br._1
393- let P = br._2
394- let aB = br._3
395- let aC = br._4
396- let aD = br._5
397- let aE = br._6
398- let bs = br._7
399- let aG = br._8
400- let aH = br._9
401- let aI = br._10
402- let aJ = br._11
403- if (if (if (!(V()))
471+@Callable(aZ)
472+func cancelOrder (L) = {
473+ let bY = ae(L)
474+ let P = bY._1
475+ let Q = bY._2
476+ let aF = bY._3
477+ let aG = bY._4
478+ let aH = bY._5
479+ let aI = bY._6
480+ let bZ = bY._7
481+ let aK = bY._8
482+ let aL = bY._9
483+ let aM = bY._10
484+ let aN = bY._11
485+ if (if (if (!(X()))
404486 then true
405- else !(W(K)))
487+ else !(Y(L)))
406488 then true
407- else !((toString(aQ.caller) == P)))
489+ else !((toString(aZ.caller) == Q)))
408490 then throw("Invalid cancelOrder parameters")
409491 else {
410- let bo = (Y(O, P) - 1)
411- let bt = if ((bs > 0))
492+ let bA = invoke(this, "cleanUpStaleOrders", [P, Q], nil)
493+ if ((bA == bA))
412494 then {
413- let bu = invoke(S(), "withdraw", [toBase58String(R()), bs], nil)
414- if ((bu == bu))
415- then nil
416- else throw("Strict value is not equal to itself.")
417- }
418- else nil
419- if ((bt == bt))
420- then ((aP(K) ++ aK(O, P, bo)) ++ (if ((bs > 0))
421- then [ScriptTransfer(aQ.caller, bs, R())]
422- else nil))
423- else throw("Strict value is not equal to itself.")
424- }
425- }
426-
427-
428-
429-@Callable(aQ)
430-func executeOrder (K) = {
431- let bv = aa(K)
432- let O = bv._1
433- let P = bv._2
434- let aB = bv._3
435- let aC = bv._4
436- let aD = bv._5
437- let aE = bv._6
438- let bs = bv._7
439- let aG = bv._8
440- let aH = bv._9
441- let aI = bv._10
442- let aJ = bv._11
443- if (if (!(V()))
444- then true
445- else !(W(K)))
446- then throw("Invalid executeOrder parameters")
447- else {
448- let bd = au(O, P)
449- let bw = if ((bd != 0))
450- then aw(O, P)
451- else 0
452- let bx = if ((aD == p))
453- then {
454- let by = if ((bd > 0))
455- then s
456- else if ((0 > bd))
457- then t
458- else throw("Can not execute STOP order: no open position")
459- let bz = ao(O)
460- let bA = if ((aG == by))
461- then throw("Can not execute STOP order: reduce only")
462- else if ((bw != aI))
463- then throw("Can not execute STOP order: position closed")
464- else if ((by == s))
465- then (aE >= bz)
466- else (bz >= aE)
467- if (bA)
468- then $Tuple3("closePosition", [F(aB, A(bd)), E(aJ, A(bd))], nil)
469- else throw("Can not execute STOP order: triggerPrice mismatch")
470- }
471- else if ((aD == q))
472- then {
473- let by = if ((bd > 0))
474- then s
475- else if ((0 > bd))
476- then t
477- else throw("Can not execute STOP order: no open position")
478- let bz = ao(O)
479- let bA = if ((aG == by))
480- then throw("Can not execute TAKE order: reduce only")
481- else if ((bw != aI))
482- then throw(((("Can not execute TAKE order: position closed " + toString(bw)) + "!=") + toString(aI)))
483- else if ((by == s))
484- then (bz >= aE)
485- else (aE >= bz)
486- if (bA)
487- then $Tuple3("closePosition", [F(aB, A(bd)), E(aJ, A(bd))], nil)
488- else throw("Can not execute TAKE order: triggerPrice mismatch")
489- }
490- else if ((aD == r))
495+ let bV = (aa(P, Q) - 1)
496+ let ca = if ((bZ > 0))
491497 then {
492- let bz = ao(O)
493- let bB = if ((aJ == 0))
494- then ay(aE)
495- else A((aE - aJ))
496- let bA = if ((bz >= (aE - bB)))
497- then ((aE + bB) >= bz)
498- else false
499- if (bA)
500- then {
501- let by = if ((bd > 0))
502- then s
503- else if ((0 > bd))
504- then t
505- else -1
506- let bC = if ((bd == 0))
507- then u
508- else if ((by == aG))
509- then u
510- else v
511- if ((bC == u))
512- then {
513- let bD = (bs - E(bs, at(O, P)))
514- $Tuple3("increasePosition", [aG, aC, if ((aJ == 0))
515- then 0
516- else C(bD, aJ), aH], [AttachedPayment(R(), bs)])
517- }
518- else $Tuple3("closePosition", [aB, E(aB, aJ)], nil)
519- }
520- else throw("Can not execute LIMIT order: triggerPrice mismatch")
521- }
522- else throw(("Invalid order type: " + toString(aD)))
523- let bE = bx._1
524- let bF = bx._2
525- let bG = bx._3
526- let bt = if ((size(bG) == 1))
527- then {
528- let bu = invoke(S(), "withdraw", [toBase58String(R()), bG[0].amount], nil)
529- if ((bu == bu))
530- then nil
531- else throw("Strict value is not equal to itself.")
532- }
533- else nil
534- if ((bt == bt))
535- then {
536- let be = invoke(this, "setContext", [P], nil)
537- if ((be == be))
538- then {
539- let bf = invoke(addressFromStringValue(O), bE, bF, bG)
540- if ((bf == bf))
541- then {
542- let bg = invoke(this, "resetContext", nil, nil)
543- if ((bg == bg))
544- then aO(K)
545- else throw("Strict value is not equal to itself.")
546- }
498+ let cb = invoke(U(), "withdraw", [toBase58String(T()), bZ], nil)
499+ if ((cb == cb))
500+ then nil
547501 else throw("Strict value is not equal to itself.")
548502 }
503+ else nil
504+ if ((ca == ca))
505+ then (((aY(L) ++ aO(L, P, Q, false)) ++ aT(P, Q, bV)) ++ (if ((bZ > 0))
506+ then [ScriptTransfer(aZ.caller, bZ, T())]
507+ else nil))
549508 else throw("Strict value is not equal to itself.")
550509 }
551510 else throw("Strict value is not equal to itself.")
554513
555514
556515
557-@Callable(aQ)
558-func view_canExecuteOrder (K) = {
559- let ap = invoke(this, "executeOrder", [K], nil)
560- if ((ap == ap))
516+@Callable(aZ)
517+func executeOrder (L) = {
518+ let cc = ae(L)
519+ let P = cc._1
520+ let Q = cc._2
521+ let aF = cc._3
522+ let aG = cc._4
523+ let aH = cc._5
524+ let aI = cc._6
525+ let bZ = cc._7
526+ let aK = cc._8
527+ let aL = cc._9
528+ let aM = cc._10
529+ let aN = cc._11
530+ let bA = invoke(this, "cleanUpStaleOrders", [P, Q], nil)
531+ if ((bA == bA))
532+ then if (if (!(X()))
533+ then true
534+ else !(Y(L)))
535+ then throw("Invalid executeOrder parameters")
536+ else {
537+ let bo = ay(P, Q)
538+ let bp = if ((bo != 0))
539+ then aA(P, Q)
540+ else 0
541+ let cd = if ((aH == q))
542+ then {
543+ let ce = if ((bo > 0))
544+ then t
545+ else if ((0 > bo))
546+ then u
547+ else throw("Can not execute STOP order: no open position")
548+ let cf = as(P)
549+ let cg = if ((aK == ce))
550+ then throw("Can not execute STOP order: reduce only")
551+ else if ((bp != aM))
552+ then throw("Can not execute STOP order: position closed")
553+ else if ((ce == t))
554+ then (aI >= cf)
555+ else (cf >= aI)
556+ if (cg)
557+ then $Tuple3("closePosition", [G(aF, B(bo)), F(aN, B(bo))], nil)
558+ else throw("Can not execute STOP order: triggerPrice mismatch")
559+ }
560+ else if ((aH == r))
561+ then {
562+ let ce = if ((bo > 0))
563+ then t
564+ else if ((0 > bo))
565+ then u
566+ else throw("Can not execute STOP order: no open position")
567+ let cf = as(P)
568+ let cg = if ((aK == ce))
569+ then throw("Can not execute TAKE order: reduce only")
570+ else if ((bp != aM))
571+ then throw(((("Can not execute TAKE order: position closed " + toString(bp)) + "!=") + toString(aM)))
572+ else if ((ce == t))
573+ then (cf >= aI)
574+ else (aI >= cf)
575+ if (cg)
576+ then $Tuple3("closePosition", [G(aF, B(bo)), F(aN, B(bo))], nil)
577+ else throw("Can not execute TAKE order: triggerPrice mismatch")
578+ }
579+ else if ((aH == s))
580+ then {
581+ let cf = as(P)
582+ let ch = if ((aN == 0))
583+ then aC(aI)
584+ else B((aI - aN))
585+ let cg = if ((cf >= (aI - ch)))
586+ then ((aI + ch) >= cf)
587+ else false
588+ if (cg)
589+ then {
590+ let ce = if ((bo > 0))
591+ then t
592+ else if ((0 > bo))
593+ then u
594+ else -1
595+ let ci = if ((bo == 0))
596+ then v
597+ else if ((ce == aK))
598+ then v
599+ else w
600+ if ((ci == v))
601+ then {
602+ let cj = (bZ - F(bZ, ax(P, Q)))
603+ $Tuple3("increasePosition", [aK, aG, if ((aN == 0))
604+ then 0
605+ else D(cj, aN), aL], [AttachedPayment(T(), bZ)])
606+ }
607+ else $Tuple3("closePosition", [aF, F(aF, aN)], nil)
608+ }
609+ else throw("Can not execute LIMIT order: triggerPrice mismatch")
610+ }
611+ else throw(("Invalid order type: " + toString(aH)))
612+ let ck = cd._1
613+ let cl = cd._2
614+ let cm = cd._3
615+ let ca = if ((size(cm) == 1))
616+ then {
617+ let cb = invoke(U(), "withdraw", [toBase58String(T()), cm[0].amount], nil)
618+ if ((cb == cb))
619+ then nil
620+ else throw("Strict value is not equal to itself.")
621+ }
622+ else nil
623+ if ((ca == ca))
624+ then {
625+ let bL = invoke(this, "setContext", [Q], nil)
626+ if ((bL == bL))
627+ then {
628+ let bM = invoke(addressFromStringValue(P), ck, cl, cm)
629+ if ((bM == bM))
630+ then {
631+ let bN = invoke(this, "resetContext", nil, nil)
632+ if ((bN == bN))
633+ then {
634+ let bV = (aa(P, Q) - 1)
635+ ((aT(P, Q, bV) ++ aO(L, P, Q, false)) ++ aX(L))
636+ }
637+ else throw("Strict value is not equal to itself.")
638+ }
639+ else throw("Strict value is not equal to itself.")
640+ }
641+ else throw("Strict value is not equal to itself.")
642+ }
643+ else throw("Strict value is not equal to itself.")
644+ }
645+ else throw("Strict value is not equal to itself.")
646+ }
647+
648+
649+
650+@Callable(aZ)
651+func view_canExecuteOrder (L) = {
652+ let at = invoke(this, "executeOrder", [L], nil)
653+ if ((at == at))
561654 then throw("Success")
562655 else throw("Strict value is not equal to itself.")
563656 }
564657
565658
566-@Verifier(bH)
567-func bI () = sigVerify(bH.bodyBytes, bH.proofs[0], U())
659+@Verifier(cn)
660+func co () = sigVerify(cn.bodyBytes, cn.proofs[0], W())
568661
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = "k_coordinatorAddress"
55
66 let b = "k_admin_public_key"
77
88 let c = "k_quote_asset"
99
1010 let d = "k_amm"
1111
1212 let e = "k_manager_address"
1313
1414 let f = "k_positionSequence"
1515
1616 let g = "k_positionSize"
1717
1818 let h = "k_fee"
1919
2020 let i = "k_executedOrders"
2121
2222 let j = "k_canceledOrders"
2323
2424 let k = "k_order"
2525
2626 let l = "k_lastOrderId"
2727
2828 let m = "k_traderOrderCnt"
2929
30-let n = "k_sender"
30+let n = "k_traderOrderIds"
3131
32-let o = "k_initialized"
32+let o = "k_sender"
3333
34-let p = 1
34+let p = "k_initialized"
3535
36-let q = 2
36+let q = 1
3737
38-let r = 3
38+let r = 2
3939
40-let s = 1
40+let s = 3
4141
42-let t = 2
42+let t = 1
4343
44-let u = 1
44+let u = 2
4545
46-let v = 2
46+let v = 1
4747
48-let w = 5
48+let w = 2
4949
50-let x = lastBlock.timestamp
50+let x = 5
5151
52-let y = (1 * (((((10 * 10) * 10) * 10) * 10) * 10))
52+let y = lastBlock.timestamp
5353
54-let z = (y / 200)
54+let z = (1 * (((((10 * 10) * 10) * 10) * 10) * 10))
5555
56-func A (B) = if ((B > 0))
57- then B
58- else -(B)
56+let A = (z / 200)
57+
58+func B (C) = if ((C > 0))
59+ then C
60+ else -(C)
5961
6062
61-func C (B,D) = fraction(B, y, D, HALFEVEN)
63+func D (C,E) = fraction(C, z, E, HALFEVEN)
6264
6365
64-func E (B,D) = fraction(B, D, y, HALFEVEN)
66+func F (C,E) = fraction(C, E, z, HALFEVEN)
6567
6668
67-func F (B,D) = if ((B > D))
68- then D
69- else B
69+func G (C,E) = if ((C > E))
70+ then E
71+ else C
7072
7173
72-func G (H,I) = ((H + "_") + I)
74+func H (I,J) = ((I + "_") + J)
7375
7476
75-func J (K) = ((i + "_") + toString(K))
77+func K (L) = ((i + "_") + toString(L))
7678
7779
78-func L (K) = ((j + "_") + toString(K))
80+func M (L) = ((j + "_") + toString(L))
7981
8082
81-func M (K) = G(k, toString(K))
83+func N (L) = H(k, toString(L))
8284
8385
84-func N (O,P) = ((((m + "_") + O) + "_") + P)
86+func O (P,Q) = ((((m + "_") + P) + "_") + Q)
8587
8688
87-func Q () = valueOrErrorMessage(addressFromString(getStringValue(this, a)), "Coordinator not set")
89+func R (P,Q) = ((((n + "_") + P) + "_") + Q)
8890
8991
90-func R () = fromBase58String(getStringValue(Q(), c))
92+func S () = valueOrErrorMessage(addressFromString(getStringValue(this, a)), "Coordinator not set")
9193
9294
93-func S () = valueOrErrorMessage(addressFromString(getStringValue(Q(), e)), "Manager not set")
95+func T () = fromBase58String(getStringValue(S(), c))
9496
9597
96-func T (I) = valueOrElse(getBoolean(Q(), G(d, I)), false)
98+func U () = valueOrErrorMessage(addressFromString(getStringValue(S(), e)), "Manager not set")
9799
98100
99-func U () = fromBase58String(getStringValue(Q(), b))
101+func V (J) = valueOrElse(getBoolean(S(), H(d, J)), false)
100102
101103
102-func V () = valueOrElse(getBoolean(this, o), false)
104+func W () = fromBase58String(getStringValue(S(), b))
103105
104106
105-func W (K) = if (valueOrElse(getBoolean(this, J(K)), false))
106- then throw(("Order already executed: " + toString(K)))
107- else if (valueOrElse(getBoolean(this, L(K)), false))
108- then throw(("Order already cancelled: " + toString(K)))
107+func X () = valueOrElse(getBoolean(this, p), false)
108+
109+
110+func Y (L) = if (valueOrElse(getBoolean(this, K(L)), false))
111+ then throw(("Order already executed: " + toString(L)))
112+ else if (valueOrElse(getBoolean(this, M(L)), false))
113+ then throw(("Order already cancelled: " + toString(L)))
109114 else true
110115
111116
112-func X () = valueOrElse(getInteger(this, l), 0)
117+func Z () = valueOrElse(getInteger(this, l), 0)
113118
114119
115-func Y (O,P) = {
116- let Z = N(O, P)
117- valueOrElse(getInteger(this, Z), 0)
120+func aa (P,Q) = {
121+ let ab = O(P, Q)
122+ valueOrElse(getInteger(this, ab), 0)
118123 }
119124
120125
121-func aa (K) = {
122- let ab = valueOrErrorMessage(getString(this, M(K)), ("Invalid order id: " + toString(K)))
123- let ac = split(ab, ",")
124- let ad = ac[0]
125- let ae = ac[1]
126- let af = valueOrErrorMessage(parseInt(ac[2]), "Invalid amountIn")
127- let ag = valueOrErrorMessage(parseInt(ac[3]), "Invalid leverage")
128- let ah = valueOrErrorMessage(parseInt(ac[4]), "Invalid type")
129- let ai = valueOrErrorMessage(parseInt(ac[5]), "Invalid triggerPrice")
130- let aj = valueOrErrorMessage(parseInt(ac[6]), "Invalid paymentUsdn")
131- let ak = valueOrErrorMessage(parseInt(ac[7]), "Invalid side")
132- let al = ac[8]
133- let am = valueOrErrorMessage(parseInt(ac[9]), "Invalid positionId")
134- let an = valueOrErrorMessage(parseInt(ac[10]), "Invalid limitPrice")
135- $Tuple11(ad, ae, af, ag, ah, ai, aj, ak, al, am, an)
126+func ac (P,Q) = {
127+ let ab = R(P, Q)
128+ let ad = valueOrElse(getString(this, ab), "")
129+ if ((ad == ""))
130+ then nil
131+ else split(ad, ",")
136132 }
137133
138134
139-func ao (O) = {
140- let ap = invoke(addressFromStringValue(O), "computeSpotPrice", nil, nil)
141- if ((ap == ap))
135+func ae (L) = {
136+ let af = valueOrErrorMessage(getString(this, N(L)), ("Invalid order id: " + toString(L)))
137+ let ag = split(af, ",")
138+ let ah = ag[0]
139+ let ai = ag[1]
140+ let aj = valueOrErrorMessage(parseInt(ag[2]), "Invalid amountIn")
141+ let ak = valueOrErrorMessage(parseInt(ag[3]), "Invalid leverage")
142+ let al = valueOrErrorMessage(parseInt(ag[4]), "Invalid type")
143+ let am = valueOrErrorMessage(parseInt(ag[5]), "Invalid triggerPrice")
144+ let an = valueOrErrorMessage(parseInt(ag[6]), "Invalid paymentUsdn")
145+ let ao = valueOrErrorMessage(parseInt(ag[7]), "Invalid side")
146+ let ap = ag[8]
147+ let aq = valueOrErrorMessage(parseInt(ag[9]), "Invalid positionId")
148+ let ar = valueOrErrorMessage(parseInt(ag[10]), "Invalid limitPrice")
149+ $Tuple11(ah, ai, aj, ak, al, am, an, ao, ap, aq, ar)
150+ }
151+
152+
153+func as (P) = {
154+ let at = invoke(addressFromStringValue(P), "computeSpotPrice", nil, nil)
155+ if ((at == at))
142156 then {
143- let aq = {
144- let ar = ap
145- if ($isInstanceOf(ar, "Int"))
157+ let au = {
158+ let av = at
159+ if ($isInstanceOf(av, "Int"))
146160 then {
147- let as = ar
148- as
161+ let aw = av
162+ aw
149163 }
150164 else throw("Invalid computeSpotPrice result")
151165 }
152- value(aq)
166+ value(au)
153167 }
154168 else throw("Strict value is not equal to itself.")
155169 }
156170
157171
158-func at (O,P) = {
159- let ap = invoke(addressFromStringValue(O), "computeFeeForTraderWithArtifact", [P, ""], nil)
160- if ((ap == ap))
172+func ax (P,Q) = {
173+ let at = invoke(addressFromStringValue(P), "computeFeeForTraderWithArtifact", [Q, ""], nil)
174+ if ((at == at))
161175 then {
162- let aq = {
163- let ar = ap
164- if ($isInstanceOf(ar, "(Int, Boolean)"))
176+ let au = {
177+ let av = at
178+ if ($isInstanceOf(av, "(Int, Boolean)"))
165179 then {
166- let as = ar
167- as._1
180+ let aw = av
181+ aw._1
168182 }
169183 else throw("Invalid computeFeeForTraderWithArtifact result")
170184 }
171- value(aq)
185+ value(au)
172186 }
173187 else throw("Strict value is not equal to itself.")
174188 }
175189
176190
177-func au (O,P) = {
178- let ad = addressFromStringValue(O)
179- let av = G(g, P)
180- valueOrElse(getInteger(ad, av), 0)
191+func ay (P,Q) = {
192+ let ah = addressFromStringValue(P)
193+ let az = H(g, Q)
194+ valueOrElse(getInteger(ah, az), 0)
181195 }
182196
183197
184-func aw (O,P) = {
185- let ad = addressFromStringValue(O)
186- let ax = G(f, P)
187- valueOrElse(getInteger(ad, ax), 0)
198+func aA (P,Q) = {
199+ let ah = addressFromStringValue(P)
200+ let aB = H(f, Q)
201+ valueOrElse(getInteger(ah, aB), 0)
188202 }
189203
190204
191-func ay (az) = E(az, z)
205+func aC (aD) = F(aD, A)
192206
193207
194-func aA (K,O,P,aB,aC,aD,aE,aF,aG,aH,aI,aJ) = {
195- let ab = makeString([O, P, toString(aB), toString(aC), toString(aD), toString(aE), toString(aF), toString(aG), aH, toString(aI), toString(aJ)], ",")
196-[StringEntry(M(K), ab)]
208+func aE (L,P,Q,aF,aG,aH,aI,aJ,aK,aL,aM,aN) = {
209+ let af = makeString([P, Q, toString(aF), toString(aG), toString(aH), toString(aI), toString(aJ), toString(aK), aL, toString(aM), toString(aN)], ",")
210+[StringEntry(N(L), af)]
197211 }
198212
199213
200-func aK (O,P,aL) = [IntegerEntry(N(O, P), aL)]
214+func aO (L,P,Q,aP) = {
215+ let aQ = ac(P, Q)
216+ let aR = if (aP)
217+ then (aQ :+ toString(L))
218+ else removeByIndex(aQ, valueOrErrorMessage(indexOf(aQ, toString(L)), ("No order with id: " + toString(L))))
219+ let aS = makeString(aR, ",")
220+[StringEntry(R(P, Q), aS)]
221+ }
201222
202223
203-func aM (aN) = [IntegerEntry(l, aN)]
224+func aT (P,Q,aU) = [IntegerEntry(O(P, Q), aU)]
204225
205226
206-func aO (K) = [BooleanEntry(G(i, toString(K)), true)]
227+func aV (aW) = [IntegerEntry(l, aW)]
207228
208229
209-func aP (K) = [BooleanEntry(G(j, toString(K)), true)]
230+func aX (L) = [BooleanEntry(H(i, toString(L)), true)]
210231
211232
212-@Callable(aQ)
213-func setContext (aR) = if ((aQ.caller != this))
214- then throw("Only self-call")
215- else [StringEntry(n, aR)]
233+func aY (L) = [BooleanEntry(H(j, toString(L)), true)]
216234
217235
218-
219-@Callable(aQ)
220-func resetContext () = if ((aQ.caller != this))
221- then throw("Only self-call")
222- else [DeleteEntry(n)]
223-
224-
225-
226-@Callable(aQ)
227-func initialize (aS) = if (V())
228- then throw("Already initialized")
229- else [StringEntry(a, aS), BooleanEntry(o, true)]
230-
231-
232-
233-@Callable(aQ)
234-func createOrder (O,aD,aE,aJ,aB,aC,aG,aH) = if ((size(aQ.payments) > 1))
235- then throw("Invalid createOrder parameters: invalid payment count")
236- else {
237- let aT = if ((size(aQ.payments) == 1))
238- then $Tuple2(toBase58String(valueOrErrorMessage(aQ.payments[0].assetId, "Invalid asset id")), aQ.payments[0].amount)
239- else $Tuple2("", 0)
240- let aU = aT._1
241- let aV = aT._2
242- let aW = invoke(this, "internalCreateOrder", [toString(aQ.caller), O, aD, aE, aJ, aB, aC, aG, aH, aU, aV], nil)
243- if ((aW == aW))
244- then nil
245- else throw("Strict value is not equal to itself.")
236+@Callable(aZ)
237+func cleanUpStaleOrders (P,Q) = {
238+ let ba = ac(P, Q)
239+ func bb (bc,L) = {
240+ let bd = valueOrErrorMessage(parseInt(L), "Invalid order id")
241+ let be = ae(bd)
242+ let bf = be._1
243+ let bg = be._2
244+ let bh = be._3
245+ let bi = be._4
246+ let aH = be._5
247+ let bj = be._6
248+ let bk = be._7
249+ let bl = be._8
250+ let bm = be._9
251+ let aM = be._10
252+ let bn = be._11
253+ let bo = ay(P, Q)
254+ let bp = if ((bo != 0))
255+ then aA(P, Q)
256+ else 0
257+ if (if (if ((aH == q))
258+ then true
259+ else (aH == r))
260+ then (bp != aM)
261+ else false)
262+ then {
263+ let bq = (aY(bd) ++ aO(bd, P, Q, false))
264+ (bc ++ bq)
265+ }
266+ else bc
246267 }
247268
269+ let br = ba
270+ let bs = size(br)
271+ let bt = nil
272+ func bu (bv,bw) = if ((bw >= bs))
273+ then bv
274+ else bb(bv, br[bw])
248275
276+ func bx (bv,bw) = if ((bw >= bs))
277+ then bv
278+ else throw("List size exceeds 5")
249279
250-@Callable(aQ)
251-func increasePositionWithStopLoss (O,aX,aC,aY,aH,aZ,ba,bb,bc) = {
252- let P = toString(aQ.caller)
253- if (if (!(V()))
254- then true
255- else !(T(O)))
256- then throw("Invalid increasePositionWithStopLoss parameters")
257- else {
258- let bd = au(O, P)
259- if ((bd != 0))
260- then throw("Invalid increasePositionWithStopLoss parameters: only new position")
261- else {
262- let be = invoke(this, "setContext", [P], nil)
263- if ((be == be))
264- then {
265- let bf = invoke(addressFromStringValue(O), "increasePosition", [aX, aC, aY, aH], aQ.payments)
266- if ((bf == bf))
267- then {
268- let bg = invoke(this, "resetContext", nil, nil)
269- if ((bg == bg))
270- then {
271- let bh = au(O, P)
272- if ((bh == bh))
273- then {
274- let af = A(bh)
275- let bi = if ((0 > bh))
276- then s
277- else t
278- let bj = if ((aZ > 0))
279- then {
280- let bj = invoke(this, "internalCreateOrder", [P, O, p, aZ, ba, af, 0, bi, aH, "", 0], nil)
281- if ((bj == bj))
282- then nil
283- else throw("Strict value is not equal to itself.")
284- }
285- else nil
286- if ((bj == bj))
287- then {
288- let bk = if ((bb > 0))
289- then {
290- let bk = invoke(this, "internalCreateOrder", [P, O, q, bb, bc, af, 0, bi, aH, "", 0], nil)
291- if ((bk == bk))
292- then nil
293- else throw("Strict value is not equal to itself.")
294- }
295- else nil
296- if ((bk == bk))
297- then nil
298- else throw("Strict value is not equal to itself.")
299- }
300- else throw("Strict value is not equal to itself.")
301- }
302- else throw("Strict value is not equal to itself.")
303- }
304- else throw("Strict value is not equal to itself.")
305- }
306- else throw("Strict value is not equal to itself.")
307- }
308- else throw("Strict value is not equal to itself.")
309- }
310- }
280+ bx(bu(bu(bu(bu(bu(bt, 0), 1), 2), 3), 4), 5)
311281 }
312282
313283
314284
315-@Callable(aQ)
316-func internalCreateOrder (P,O,aD,aE,aJ,aB,aC,aG,aH,bl,bm) = if (if (if (if (if (if (if (if (if (!(V()))
285+@Callable(aZ)
286+func setContext (by) = if ((aZ.caller != this))
287+ then throw("Only self-call")
288+ else [StringEntry(o, by)]
289+
290+
291+
292+@Callable(aZ)
293+func resetContext () = if ((aZ.caller != this))
294+ then throw("Only self-call")
295+ else [DeleteEntry(o)]
296+
297+
298+
299+@Callable(aZ)
300+func initialize (bz) = if (X())
301+ then throw("Already initialized")
302+ else [StringEntry(a, bz), BooleanEntry(p, true)]
303+
304+
305+
306+@Callable(aZ)
307+func createOrder (P,aH,aI,aN,aF,aG,aK,aL) = {
308+ let Q = toString(aZ.caller)
309+ let bA = invoke(this, "cleanUpStaleOrders", [P, Q], nil)
310+ if ((bA == bA))
311+ then if ((size(aZ.payments) > 1))
312+ then throw("Invalid createOrder parameters: invalid payment count")
313+ else {
314+ let bB = if ((size(aZ.payments) == 1))
315+ then $Tuple2(toBase58String(valueOrErrorMessage(aZ.payments[0].assetId, "Invalid asset id")), aZ.payments[0].amount)
316+ else $Tuple2("", 0)
317+ let bC = bB._1
318+ let bD = bB._2
319+ let bE = invoke(this, "internalCreateOrder", [Q, P, aH, aI, aN, aF, aG, aK, aL, bC, bD], nil)
320+ if ((bE == bE))
321+ then nil
322+ else throw("Strict value is not equal to itself.")
323+ }
324+ else throw("Strict value is not equal to itself.")
325+ }
326+
327+
328+
329+@Callable(aZ)
330+func increasePositionWithStopLoss (P,bF,aG,bG,aL,bH,bI,bJ,bK) = {
331+ let Q = toString(aZ.caller)
332+ let bA = invoke(this, "cleanUpStaleOrders", [P, Q], nil)
333+ if ((bA == bA))
334+ then if (if (!(X()))
335+ then true
336+ else !(V(P)))
337+ then throw("Invalid increasePositionWithStopLoss parameters")
338+ else {
339+ let bo = ay(P, Q)
340+ if ((bo != 0))
341+ then throw("Invalid increasePositionWithStopLoss parameters: only new position")
342+ else {
343+ let bL = invoke(this, "setContext", [Q], nil)
344+ if ((bL == bL))
345+ then {
346+ let bM = invoke(addressFromStringValue(P), "increasePosition", [bF, aG, bG, aL], aZ.payments)
347+ if ((bM == bM))
348+ then {
349+ let bN = invoke(this, "resetContext", nil, nil)
350+ if ((bN == bN))
351+ then {
352+ let bO = ay(P, Q)
353+ if ((bO == bO))
354+ then {
355+ let aj = B(bO)
356+ let bP = if ((0 > bO))
357+ then t
358+ else u
359+ let bQ = if ((bH > 0))
360+ then {
361+ let bQ = invoke(this, "internalCreateOrder", [Q, P, q, bH, bI, aj, 0, bP, aL, "", 0], nil)
362+ if ((bQ == bQ))
363+ then nil
364+ else throw("Strict value is not equal to itself.")
365+ }
366+ else nil
367+ if ((bQ == bQ))
368+ then {
369+ let bR = if ((bJ > 0))
370+ then {
371+ let bR = invoke(this, "internalCreateOrder", [Q, P, r, bJ, bK, aj, 0, bP, aL, "", 0], nil)
372+ if ((bR == bR))
373+ then nil
374+ else throw("Strict value is not equal to itself.")
375+ }
376+ else nil
377+ if ((bR == bR))
378+ then nil
379+ else throw("Strict value is not equal to itself.")
380+ }
381+ else throw("Strict value is not equal to itself.")
382+ }
383+ else throw("Strict value is not equal to itself.")
384+ }
385+ else throw("Strict value is not equal to itself.")
386+ }
387+ else throw("Strict value is not equal to itself.")
388+ }
389+ else throw("Strict value is not equal to itself.")
390+ }
391+ }
392+ else throw("Strict value is not equal to itself.")
393+ }
394+
395+
396+
397+@Callable(aZ)
398+func internalCreateOrder (Q,P,aH,aI,aN,aF,aG,aK,aL,bS,bT) = if (if (if (if (if (if (if (if (if (!(X()))
317399 then true
318- else !(T(O)))
400+ else !(V(P)))
319401 then true
320- else (0 >= aE))
402+ else (0 >= aI))
321403 then true
322- else (0 > aJ))
404+ else (0 > aN))
323405 then true
324- else (0 >= aB))
406+ else (0 >= aF))
325407 then true
326- else (0 > aC))
408+ else (0 > aG))
327409 then true
328- else !(if ((aG == s))
410+ else !(if ((aK == t))
329411 then true
330- else (aG == t)))
412+ else (aK == u)))
331413 then true
332- else !(if (if ((aD == p))
414+ else !(if (if ((aH == q))
333415 then true
334- else (aD == q))
416+ else (aH == r))
335417 then true
336- else (aD == r)))
418+ else (aH == s)))
337419 then true
338- else !((aQ.caller == this)))
420+ else !((aZ.caller == this)))
339421 then throw("Invalid createOrder parameters")
340422 else {
341- let bn = (X() + 1)
342- let bo = (Y(O, P) + 1)
343- let bd = au(O, P)
344- let aX = if (if (if ((bd == 0))
423+ let bU = (Z() + 1)
424+ let bV = (aa(P, Q) + 1)
425+ let bo = ay(P, Q)
426+ let bF = if (if (if ((bo == 0))
345427 then true
346- else if ((bd > 0))
347- then (aG == s)
428+ else if ((bo > 0))
429+ then (aK == t)
348430 else false)
349431 then true
350- else if ((0 > bd))
351- then (aG == t)
432+ else if ((0 > bo))
433+ then (aK == u)
352434 else false)
353- then u
354- else v
355- if (if ((bd == 0))
356- then if ((aD == p))
435+ then v
436+ else w
437+ if (if ((bo == 0))
438+ then if ((aH == q))
357439 then true
358- else (aD == q)
440+ else (aH == r)
359441 else false)
360442 then throw("Can not create STOP/TAKE order: no position")
361443 else {
362- let bp = if ((aX == u))
363- then if (if ((bl != toBase58String(R())))
444+ let bW = if ((bF == v))
445+ then if (if ((bS != toBase58String(T())))
364446 then true
365- else (bm != aB))
447+ else (bT != aF))
366448 then throw("Invalid createLimitOrder parameters: invalid payment")
367449 else {
368- let bq = invoke(S(), "deposit", nil, [AttachedPayment(R(), bm)])
369- if ((bq == bq))
370- then bm
450+ let bX = invoke(U(), "deposit", nil, [AttachedPayment(T(), bT)])
451+ if ((bX == bX))
452+ then bT
371453 else throw("Strict value is not equal to itself.")
372454 }
373455 else 0
374- if ((bp == bp))
456+ if ((bW == bW))
375457 then {
376- let am = if ((bd != 0))
377- then aw(O, P)
458+ let aq = if ((bo != 0))
459+ then aA(P, Q)
378460 else 0
379- if ((bo > w))
461+ if ((bV > x))
380462 then throw("Invalid createLimitOrder parameters: order count")
381- else ((aA(bn, O, P, aB, aC, aD, aE, bp, aG, aH, am, aJ) ++ aK(O, P, bo)) ++ aM(bn))
463+ else (((aE(bU, P, Q, aF, aG, aH, aI, bW, aK, aL, aq, aN) ++ aO(bU, P, Q, true)) ++ aT(P, Q, bV)) ++ aV(bU))
382464 }
383465 else throw("Strict value is not equal to itself.")
384466 }
385467 }
386468
387469
388470
389-@Callable(aQ)
390-func cancelOrder (K) = {
391- let br = aa(K)
392- let O = br._1
393- let P = br._2
394- let aB = br._3
395- let aC = br._4
396- let aD = br._5
397- let aE = br._6
398- let bs = br._7
399- let aG = br._8
400- let aH = br._9
401- let aI = br._10
402- let aJ = br._11
403- if (if (if (!(V()))
471+@Callable(aZ)
472+func cancelOrder (L) = {
473+ let bY = ae(L)
474+ let P = bY._1
475+ let Q = bY._2
476+ let aF = bY._3
477+ let aG = bY._4
478+ let aH = bY._5
479+ let aI = bY._6
480+ let bZ = bY._7
481+ let aK = bY._8
482+ let aL = bY._9
483+ let aM = bY._10
484+ let aN = bY._11
485+ if (if (if (!(X()))
404486 then true
405- else !(W(K)))
487+ else !(Y(L)))
406488 then true
407- else !((toString(aQ.caller) == P)))
489+ else !((toString(aZ.caller) == Q)))
408490 then throw("Invalid cancelOrder parameters")
409491 else {
410- let bo = (Y(O, P) - 1)
411- let bt = if ((bs > 0))
492+ let bA = invoke(this, "cleanUpStaleOrders", [P, Q], nil)
493+ if ((bA == bA))
412494 then {
413- let bu = invoke(S(), "withdraw", [toBase58String(R()), bs], nil)
414- if ((bu == bu))
415- then nil
416- else throw("Strict value is not equal to itself.")
417- }
418- else nil
419- if ((bt == bt))
420- then ((aP(K) ++ aK(O, P, bo)) ++ (if ((bs > 0))
421- then [ScriptTransfer(aQ.caller, bs, R())]
422- else nil))
423- else throw("Strict value is not equal to itself.")
424- }
425- }
426-
427-
428-
429-@Callable(aQ)
430-func executeOrder (K) = {
431- let bv = aa(K)
432- let O = bv._1
433- let P = bv._2
434- let aB = bv._3
435- let aC = bv._4
436- let aD = bv._5
437- let aE = bv._6
438- let bs = bv._7
439- let aG = bv._8
440- let aH = bv._9
441- let aI = bv._10
442- let aJ = bv._11
443- if (if (!(V()))
444- then true
445- else !(W(K)))
446- then throw("Invalid executeOrder parameters")
447- else {
448- let bd = au(O, P)
449- let bw = if ((bd != 0))
450- then aw(O, P)
451- else 0
452- let bx = if ((aD == p))
453- then {
454- let by = if ((bd > 0))
455- then s
456- else if ((0 > bd))
457- then t
458- else throw("Can not execute STOP order: no open position")
459- let bz = ao(O)
460- let bA = if ((aG == by))
461- then throw("Can not execute STOP order: reduce only")
462- else if ((bw != aI))
463- then throw("Can not execute STOP order: position closed")
464- else if ((by == s))
465- then (aE >= bz)
466- else (bz >= aE)
467- if (bA)
468- then $Tuple3("closePosition", [F(aB, A(bd)), E(aJ, A(bd))], nil)
469- else throw("Can not execute STOP order: triggerPrice mismatch")
470- }
471- else if ((aD == q))
472- then {
473- let by = if ((bd > 0))
474- then s
475- else if ((0 > bd))
476- then t
477- else throw("Can not execute STOP order: no open position")
478- let bz = ao(O)
479- let bA = if ((aG == by))
480- then throw("Can not execute TAKE order: reduce only")
481- else if ((bw != aI))
482- then throw(((("Can not execute TAKE order: position closed " + toString(bw)) + "!=") + toString(aI)))
483- else if ((by == s))
484- then (bz >= aE)
485- else (aE >= bz)
486- if (bA)
487- then $Tuple3("closePosition", [F(aB, A(bd)), E(aJ, A(bd))], nil)
488- else throw("Can not execute TAKE order: triggerPrice mismatch")
489- }
490- else if ((aD == r))
495+ let bV = (aa(P, Q) - 1)
496+ let ca = if ((bZ > 0))
491497 then {
492- let bz = ao(O)
493- let bB = if ((aJ == 0))
494- then ay(aE)
495- else A((aE - aJ))
496- let bA = if ((bz >= (aE - bB)))
497- then ((aE + bB) >= bz)
498- else false
499- if (bA)
500- then {
501- let by = if ((bd > 0))
502- then s
503- else if ((0 > bd))
504- then t
505- else -1
506- let bC = if ((bd == 0))
507- then u
508- else if ((by == aG))
509- then u
510- else v
511- if ((bC == u))
512- then {
513- let bD = (bs - E(bs, at(O, P)))
514- $Tuple3("increasePosition", [aG, aC, if ((aJ == 0))
515- then 0
516- else C(bD, aJ), aH], [AttachedPayment(R(), bs)])
517- }
518- else $Tuple3("closePosition", [aB, E(aB, aJ)], nil)
519- }
520- else throw("Can not execute LIMIT order: triggerPrice mismatch")
521- }
522- else throw(("Invalid order type: " + toString(aD)))
523- let bE = bx._1
524- let bF = bx._2
525- let bG = bx._3
526- let bt = if ((size(bG) == 1))
527- then {
528- let bu = invoke(S(), "withdraw", [toBase58String(R()), bG[0].amount], nil)
529- if ((bu == bu))
530- then nil
531- else throw("Strict value is not equal to itself.")
532- }
533- else nil
534- if ((bt == bt))
535- then {
536- let be = invoke(this, "setContext", [P], nil)
537- if ((be == be))
538- then {
539- let bf = invoke(addressFromStringValue(O), bE, bF, bG)
540- if ((bf == bf))
541- then {
542- let bg = invoke(this, "resetContext", nil, nil)
543- if ((bg == bg))
544- then aO(K)
545- else throw("Strict value is not equal to itself.")
546- }
498+ let cb = invoke(U(), "withdraw", [toBase58String(T()), bZ], nil)
499+ if ((cb == cb))
500+ then nil
547501 else throw("Strict value is not equal to itself.")
548502 }
503+ else nil
504+ if ((ca == ca))
505+ then (((aY(L) ++ aO(L, P, Q, false)) ++ aT(P, Q, bV)) ++ (if ((bZ > 0))
506+ then [ScriptTransfer(aZ.caller, bZ, T())]
507+ else nil))
549508 else throw("Strict value is not equal to itself.")
550509 }
551510 else throw("Strict value is not equal to itself.")
552511 }
553512 }
554513
555514
556515
557-@Callable(aQ)
558-func view_canExecuteOrder (K) = {
559- let ap = invoke(this, "executeOrder", [K], nil)
560- if ((ap == ap))
516+@Callable(aZ)
517+func executeOrder (L) = {
518+ let cc = ae(L)
519+ let P = cc._1
520+ let Q = cc._2
521+ let aF = cc._3
522+ let aG = cc._4
523+ let aH = cc._5
524+ let aI = cc._6
525+ let bZ = cc._7
526+ let aK = cc._8
527+ let aL = cc._9
528+ let aM = cc._10
529+ let aN = cc._11
530+ let bA = invoke(this, "cleanUpStaleOrders", [P, Q], nil)
531+ if ((bA == bA))
532+ then if (if (!(X()))
533+ then true
534+ else !(Y(L)))
535+ then throw("Invalid executeOrder parameters")
536+ else {
537+ let bo = ay(P, Q)
538+ let bp = if ((bo != 0))
539+ then aA(P, Q)
540+ else 0
541+ let cd = if ((aH == q))
542+ then {
543+ let ce = if ((bo > 0))
544+ then t
545+ else if ((0 > bo))
546+ then u
547+ else throw("Can not execute STOP order: no open position")
548+ let cf = as(P)
549+ let cg = if ((aK == ce))
550+ then throw("Can not execute STOP order: reduce only")
551+ else if ((bp != aM))
552+ then throw("Can not execute STOP order: position closed")
553+ else if ((ce == t))
554+ then (aI >= cf)
555+ else (cf >= aI)
556+ if (cg)
557+ then $Tuple3("closePosition", [G(aF, B(bo)), F(aN, B(bo))], nil)
558+ else throw("Can not execute STOP order: triggerPrice mismatch")
559+ }
560+ else if ((aH == r))
561+ then {
562+ let ce = if ((bo > 0))
563+ then t
564+ else if ((0 > bo))
565+ then u
566+ else throw("Can not execute STOP order: no open position")
567+ let cf = as(P)
568+ let cg = if ((aK == ce))
569+ then throw("Can not execute TAKE order: reduce only")
570+ else if ((bp != aM))
571+ then throw(((("Can not execute TAKE order: position closed " + toString(bp)) + "!=") + toString(aM)))
572+ else if ((ce == t))
573+ then (cf >= aI)
574+ else (aI >= cf)
575+ if (cg)
576+ then $Tuple3("closePosition", [G(aF, B(bo)), F(aN, B(bo))], nil)
577+ else throw("Can not execute TAKE order: triggerPrice mismatch")
578+ }
579+ else if ((aH == s))
580+ then {
581+ let cf = as(P)
582+ let ch = if ((aN == 0))
583+ then aC(aI)
584+ else B((aI - aN))
585+ let cg = if ((cf >= (aI - ch)))
586+ then ((aI + ch) >= cf)
587+ else false
588+ if (cg)
589+ then {
590+ let ce = if ((bo > 0))
591+ then t
592+ else if ((0 > bo))
593+ then u
594+ else -1
595+ let ci = if ((bo == 0))
596+ then v
597+ else if ((ce == aK))
598+ then v
599+ else w
600+ if ((ci == v))
601+ then {
602+ let cj = (bZ - F(bZ, ax(P, Q)))
603+ $Tuple3("increasePosition", [aK, aG, if ((aN == 0))
604+ then 0
605+ else D(cj, aN), aL], [AttachedPayment(T(), bZ)])
606+ }
607+ else $Tuple3("closePosition", [aF, F(aF, aN)], nil)
608+ }
609+ else throw("Can not execute LIMIT order: triggerPrice mismatch")
610+ }
611+ else throw(("Invalid order type: " + toString(aH)))
612+ let ck = cd._1
613+ let cl = cd._2
614+ let cm = cd._3
615+ let ca = if ((size(cm) == 1))
616+ then {
617+ let cb = invoke(U(), "withdraw", [toBase58String(T()), cm[0].amount], nil)
618+ if ((cb == cb))
619+ then nil
620+ else throw("Strict value is not equal to itself.")
621+ }
622+ else nil
623+ if ((ca == ca))
624+ then {
625+ let bL = invoke(this, "setContext", [Q], nil)
626+ if ((bL == bL))
627+ then {
628+ let bM = invoke(addressFromStringValue(P), ck, cl, cm)
629+ if ((bM == bM))
630+ then {
631+ let bN = invoke(this, "resetContext", nil, nil)
632+ if ((bN == bN))
633+ then {
634+ let bV = (aa(P, Q) - 1)
635+ ((aT(P, Q, bV) ++ aO(L, P, Q, false)) ++ aX(L))
636+ }
637+ else throw("Strict value is not equal to itself.")
638+ }
639+ else throw("Strict value is not equal to itself.")
640+ }
641+ else throw("Strict value is not equal to itself.")
642+ }
643+ else throw("Strict value is not equal to itself.")
644+ }
645+ else throw("Strict value is not equal to itself.")
646+ }
647+
648+
649+
650+@Callable(aZ)
651+func view_canExecuteOrder (L) = {
652+ let at = invoke(this, "executeOrder", [L], nil)
653+ if ((at == at))
561654 then throw("Success")
562655 else throw("Strict value is not equal to itself.")
563656 }
564657
565658
566-@Verifier(bH)
567-func bI () = sigVerify(bH.bodyBytes, bH.proofs[0], U())
659+@Verifier(cn)
660+func co () = sigVerify(cn.bodyBytes, cn.proofs[0], W())
568661

github/deemru/w8io/026f985 
111.55 ms