tx · JAco3pQugD5qhd1Mc8q5S4gFRzpcvjbSBKy3PhxfXvcR

3MzGPAZokuNfqjMuP7yDXFATZjhjtEP5UCa:  -0.03700000 Waves

2023.01.18 17:33 [2410492] smart account 3MzGPAZokuNfqjMuP7yDXFATZjhjtEP5UCa > SELF 0.00000000 Waves

{ "type": 13, "id": "JAco3pQugD5qhd1Mc8q5S4gFRzpcvjbSBKy3PhxfXvcR", "fee": 3700000, "feeAssetId": null, "timestamp": 1674052419066, "version": 2, "chainId": 84, "sender": "3MzGPAZokuNfqjMuP7yDXFATZjhjtEP5UCa", "senderPublicKey": "4EBKd2zSCvpiSLeyovT5FUuMvGpi6oxdBAbvQybSYi6p", "proofs": [ "5g69VnKucaF94Jy6DTzSnazbMsrN8a9fpMwr1ECJXbfyhyvRMLdDuFTCx22fDirkZ3x1NU5vPgBBRAcV1fMLMBDH" ], "script": "base64:BgJLCAISBAoCCAgSAwoBCBIAEgMKAQgSCgoICAEBAQEBAQgSCwoJCAEBAQgBAQEBEg0KCwgIAQEBAQEBCAgBEgMKAQESAwoBARIDCgEBOwAUa19jb29yZGluYXRvckFkZHJlc3MCFGtfY29vcmRpbmF0b3JBZGRyZXNzABJrX2FkbWluX3B1YmxpY19rZXkCEmtfYWRtaW5fcHVibGljX2tleQANa19xdW90ZV9hc3NldAINa19xdW90ZV9hc3NldAAFa19hbW0CBWtfYW1tABFrX21hbmFnZXJfYWRkcmVzcwIRa19tYW5hZ2VyX2FkZHJlc3MAEmtfcG9zaXRpb25TZXF1ZW5jZQISa19wb3NpdGlvblNlcXVlbmNlAA5rX3Bvc2l0aW9uU2l6ZQIOa19wb3NpdGlvblNpemUABWtfZmVlAgVrX2ZlZQAQa19leGVjdXRlZE9yZGVycwIQa19leGVjdXRlZE9yZGVycwAQa19jYW5jZWxlZE9yZGVycwIQa19jYW5jZWxlZE9yZGVycwAHa19vcmRlcgIHa19vcmRlcgANa19sYXN0T3JkZXJJZAINa19sYXN0T3JkZXJJZAAQa190cmFkZ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DCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAkBDmFkbWluUHVibGljS2V5AMiubFs=", "height": 2410492, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: LyLp1Ltwsnp3VJC9FU6z4rUNxz8iD1MeWafoPCNHtMx Next: GeNcE4sbrT2XvrJngU5vHRqGqxsomEWQKGHwHCVuNL5P Diff:
OldNewDifferences
536536 let currentPositionId = if ((positionSize != 0))
537537 then getPositionId(_amm, _trader)
538538 else 0
539- let $t01772121542 = if ((_type == STOP))
539+ let $t01772121563 = if ((_type == STOP))
540540 then {
541541 let _positionDirection = if ((positionSize > 0))
542542 then LONG
552552 then (_triggerPrice >= marketPrice)
553553 else (marketPrice >= _triggerPrice)
554554 if (isExecutable)
555- then $Tuple3("closePosition", [minv(_amountIn, abs(positionSize)), muld(_limitPrice, abs(positionSize))], nil)
555+ then $Tuple3("closePosition", [minv(_amountIn, abs(positionSize)), muld(_limitPrice, abs(positionSize)), false], nil)
556556 else throw("Can not execute STOP order: triggerPrice mismatch")
557557 }
558558 else if ((_type == TAKE))
571571 then (marketPrice >= _triggerPrice)
572572 else (_triggerPrice >= marketPrice)
573573 if (isExecutable)
574- then $Tuple3("closePosition", [minv(_amountIn, abs(positionSize)), muld(_limitPrice, abs(positionSize))], nil)
574+ then $Tuple3("closePosition", [minv(_amountIn, abs(positionSize)), muld(_limitPrice, abs(positionSize)), false], nil)
575575 else throw("Can not execute TAKE order: triggerPrice mismatch")
576576 }
577577 else if ((_type == LIMIT))
602602 then 0
603603 else divd(amountInWithFee, _limitPrice), _refLink], [AttachedPayment(quoteAsset(), _amountUsdn)])
604604 }
605- else $Tuple3("closePosition", [_amountIn, muld(_amountIn, _limitPrice)], nil)
605+ else $Tuple3("closePosition", [_amountIn, muld(_amountIn, _limitPrice), false], nil)
606606 }
607607 else throw("Can not execute LIMIT order: triggerPrice mismatch")
608608 }
609609 else throw(("Invalid order type: " + toString(_type)))
610- let method = $t01772121542._1
611- let args = $t01772121542._2
612- let payments = $t01772121542._3
610+ let method = $t01772121563._1
611+ let args = $t01772121563._2
612+ let payments = $t01772121563._3
613613 let withdraw = if ((size(payments) == 1))
614614 then {
615615 let unstake = invoke(managerAddress(), "withdraw", [toBase58String(quoteAsset()), payments[0].amount], nil)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let k_coordinatorAddress = "k_coordinatorAddress"
55
66 let k_admin_public_key = "k_admin_public_key"
77
88 let k_quote_asset = "k_quote_asset"
99
1010 let k_amm = "k_amm"
1111
1212 let k_manager_address = "k_manager_address"
1313
1414 let k_positionSequence = "k_positionSequence"
1515
1616 let k_positionSize = "k_positionSize"
1717
1818 let k_fee = "k_fee"
1919
2020 let k_executedOrders = "k_executedOrders"
2121
2222 let k_canceledOrders = "k_canceledOrders"
2323
2424 let k_order = "k_order"
2525
2626 let k_lastOrderId = "k_lastOrderId"
2727
2828 let k_traderOrderCnt = "k_traderOrderCnt"
2929
3030 let k_traderOrderIds = "k_traderOrderIds"
3131
3232 let k_sender = "k_sender"
3333
3434 let k_initialized = "k_initialized"
3535
3636 let STOP = 1
3737
3838 let TAKE = 2
3939
4040 let LIMIT = 3
4141
4242 let LONG = 1
4343
4444 let SHORT = 2
4545
4646 let INCREASE = 1
4747
4848 let DECREASE = 2
4949
5050 let MAX_TRADER_ORDERS_PER_AMM = 5
5151
5252 let TIME = lastBlock.timestamp
5353
5454 let DECIMAL_UNIT = (1 * (((((10 * 10) * 10) * 10) * 10) * 10))
5555
5656 let SPREAD_LIMIT = (DECIMAL_UNIT / 200)
5757
5858 func abs (_x) = if ((_x > 0))
5959 then _x
6060 else -(_x)
6161
6262
6363 func divd (_x,_y) = fraction(_x, DECIMAL_UNIT, _y, HALFEVEN)
6464
6565
6666 func muld (_x,_y) = fraction(_x, _y, DECIMAL_UNIT, HALFEVEN)
6767
6868
6969 func minv (_x,_y) = if ((_x > _y))
7070 then _y
7171 else _x
7272
7373
7474 func toCompositeKey (_key,_address) = ((_key + "_") + _address)
7575
7676
7777 func executedOrderKey (_orderId) = ((k_executedOrders + "_") + toString(_orderId))
7878
7979
8080 func canceledOrderKey (_orderId) = ((k_canceledOrders + "_") + toString(_orderId))
8181
8282
8383 func orderKey (_orderId) = toCompositeKey(k_order, toString(_orderId))
8484
8585
8686 func traderOrderCountKey (_amm,_trader) = ((((k_traderOrderCnt + "_") + _amm) + "_") + _trader)
8787
8888
8989 func traderOrderIdsKey (_amm,_trader) = ((((k_traderOrderIds + "_") + _amm) + "_") + _trader)
9090
9191
9292 func coordinator () = valueOrErrorMessage(addressFromString(getStringValue(this, k_coordinatorAddress)), "Coordinator not set")
9393
9494
9595 func quoteAsset () = fromBase58String(getStringValue(coordinator(), k_quote_asset))
9696
9797
9898 func managerAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_manager_address)), "Manager not set")
9999
100100
101101 func isWhitelist (_address) = valueOrElse(getBoolean(coordinator(), toCompositeKey(k_amm, _address)), false)
102102
103103
104104 func adminPublicKey () = fromBase58String(getStringValue(coordinator(), k_admin_public_key))
105105
106106
107107 func initialized () = valueOrElse(getBoolean(this, k_initialized), false)
108108
109109
110110 func isValid (_orderId) = if (valueOrElse(getBoolean(this, executedOrderKey(_orderId)), false))
111111 then throw(("Order already executed: " + toString(_orderId)))
112112 else if (valueOrElse(getBoolean(this, canceledOrderKey(_orderId)), false))
113113 then throw(("Order already cancelled: " + toString(_orderId)))
114114 else true
115115
116116
117117 func currentOrderId () = valueOrElse(getInteger(this, k_lastOrderId), 0)
118118
119119
120120 func getTraderOrderCount (_amm,_trader) = {
121121 let key = traderOrderCountKey(_amm, _trader)
122122 valueOrElse(getInteger(this, key), 0)
123123 }
124124
125125
126126 func traderAmmOrdersIds (_amm,_trader) = {
127127 let key = traderOrderIdsKey(_amm, _trader)
128128 let val = valueOrElse(getString(this, key), "")
129129 if ((val == ""))
130130 then nil
131131 else split(val, ",")
132132 }
133133
134134
135135 func getOrder (_orderId) = {
136136 let orderStr = valueOrErrorMessage(getString(this, orderKey(_orderId)), ("Invalid order id: " + toString(_orderId)))
137137 let orderPartList = split(orderStr, ",")
138138 let amm = orderPartList[0]
139139 let trader = orderPartList[1]
140140 let amountIn = valueOrErrorMessage(parseInt(orderPartList[2]), "Invalid amountIn")
141141 let leverage = valueOrErrorMessage(parseInt(orderPartList[3]), "Invalid leverage")
142142 let type = valueOrErrorMessage(parseInt(orderPartList[4]), "Invalid type")
143143 let triggerPrice = valueOrErrorMessage(parseInt(orderPartList[5]), "Invalid triggerPrice")
144144 let paymentUsdn = valueOrErrorMessage(parseInt(orderPartList[6]), "Invalid paymentUsdn")
145145 let side = valueOrErrorMessage(parseInt(orderPartList[7]), "Invalid side")
146146 let refLink = orderPartList[8]
147147 let positionId = valueOrErrorMessage(parseInt(orderPartList[9]), "Invalid positionId")
148148 let limitPrice = valueOrErrorMessage(parseInt(orderPartList[10]), "Invalid limitPrice")
149149 $Tuple11(amm, trader, amountIn, leverage, type, triggerPrice, paymentUsdn, side, refLink, positionId, limitPrice)
150150 }
151151
152152
153153 func getMarketPrice (_amm) = {
154154 let s = invoke(addressFromStringValue(_amm), "computeSpotPrice", nil, nil)
155155 if ((s == s))
156156 then {
157157 let res = match s {
158158 case t: Int =>
159159 t
160160 case _ =>
161161 throw("Invalid computeSpotPrice result")
162162 }
163163 value(res)
164164 }
165165 else throw("Strict value is not equal to itself.")
166166 }
167167
168168
169169 func getFee (_amm,_trader) = {
170170 let s = invoke(addressFromStringValue(_amm), "computeFeeForTraderWithArtifact", [_trader, ""], nil)
171171 if ((s == s))
172172 then {
173173 let res = match s {
174174 case t: (Int, Boolean) =>
175175 t._1
176176 case _ =>
177177 throw("Invalid computeFeeForTraderWithArtifact result")
178178 }
179179 value(res)
180180 }
181181 else throw("Strict value is not equal to itself.")
182182 }
183183
184184
185185 func getPositionSize (_amm,_trader) = {
186186 let amm = addressFromStringValue(_amm)
187187 let sizeKey = toCompositeKey(k_positionSize, _trader)
188188 valueOrElse(getInteger(amm, sizeKey), 0)
189189 }
190190
191191
192192 func getPositionId (_amm,_trader) = {
193193 let amm = addressFromStringValue(_amm)
194194 let seqKey = toCompositeKey(k_positionSequence, _trader)
195195 valueOrElse(getInteger(amm, seqKey), 0)
196196 }
197197
198198
199199 func getSpread (_price) = muld(_price, SPREAD_LIMIT)
200200
201201
202202 func saveOrder (_orderId,_amm,_trader,_amountIn,_leverage,_type,_triggerPrice,_paymentUsdn,_side,_refLink,_positionId,_limitPrice) = {
203203 let orderStr = makeString([_amm, _trader, toString(_amountIn), toString(_leverage), toString(_type), toString(_triggerPrice), toString(_paymentUsdn), toString(_side), _refLink, toString(_positionId), toString(_limitPrice)], ",")
204204 [StringEntry(orderKey(_orderId), orderStr)]
205205 }
206206
207207
208208 func addRemoveOrderId (_orderId,_amm,_trader,_add) = {
209209 let orderIds = traderAmmOrdersIds(_amm, _trader)
210210 let orderIdsNew = if (_add)
211211 then (orderIds :+ toString(_orderId))
212212 else removeByIndex(orderIds, valueOrErrorMessage(indexOf(orderIds, toString(_orderId)), ("No order with id: " + toString(_orderId))))
213213 let orderIdsNewStr = makeString(orderIdsNew, ",")
214214 [StringEntry(traderOrderIdsKey(_amm, _trader), orderIdsNewStr)]
215215 }
216216
217217
218218 func updateTraderOrderCount (_amm,_trader,_count) = [IntegerEntry(traderOrderCountKey(_amm, _trader), _count)]
219219
220220
221221 func updateLastOrderId (_lastOrderId) = [IntegerEntry(k_lastOrderId, _lastOrderId)]
222222
223223
224224 func markExecuteOrder (_orderId) = [BooleanEntry(toCompositeKey(k_executedOrders, toString(_orderId)), true)]
225225
226226
227227 func markCancelOrder (_orderId) = [BooleanEntry(toCompositeKey(k_canceledOrders, toString(_orderId)), true)]
228228
229229
230230 @Callable(i)
231231 func cleanUpStaleOrders (_amm,_trader) = {
232232 let orders = traderAmmOrdersIds(_amm, _trader)
233233 let orderCount = getTraderOrderCount(_amm, _trader)
234234 func cleanUpOne (_acc,_orderId) = {
235235 let orderIdInt = valueOrErrorMessage(parseInt(_orderId), "Invalid order id")
236236 let $t083838578 = getOrder(orderIdInt)
237237 let _x1 = $t083838578._1
238238 let _x2 = $t083838578._2
239239 let _x3 = $t083838578._3
240240 let _x4 = $t083838578._4
241241 let _type = $t083838578._5
242242 let _x5 = $t083838578._6
243243 let _x6 = $t083838578._7
244244 let _x7 = $t083838578._8
245245 let _x8 = $t083838578._9
246246 let _positionId = $t083838578._10
247247 let _x9 = $t083838578._11
248248 let positionSize = getPositionSize(_amm, _trader)
249249 let currentPositionId = if ((positionSize != 0))
250250 then getPositionId(_amm, _trader)
251251 else 0
252252 if (if (if ((_type == STOP))
253253 then true
254254 else (_type == TAKE))
255255 then (currentPositionId != _positionId)
256256 else false)
257257 then {
258258 let change = (markCancelOrder(orderIdInt) ++ addRemoveOrderId(orderIdInt, _amm, _trader, false))
259259 $Tuple2((_acc._1 + 1), (_acc._2 ++ change))
260260 }
261261 else _acc
262262 }
263263
264264 let result = {
265265 let $l = orders
266266 let $s = size($l)
267267 let $acc0 = $Tuple2(0, nil)
268268 func $f0_1 ($a,$i) = if (($i >= $s))
269269 then $a
270270 else cleanUpOne($a, $l[$i])
271271
272272 func $f0_2 ($a,$i) = if (($i >= $s))
273273 then $a
274274 else throw("List size exceeds 5")
275275
276276 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5)
277277 }
278278 (result._2 ++ updateTraderOrderCount(_amm, _trader, (orderCount - result._1)))
279279 }
280280
281281
282282
283283 @Callable(i)
284284 func setContext (_sender) = if ((i.caller != this))
285285 then throw("Only self-call")
286286 else [StringEntry(k_sender, _sender)]
287287
288288
289289
290290 @Callable(i)
291291 func resetContext () = if ((i.caller != this))
292292 then throw("Only self-call")
293293 else [DeleteEntry(k_sender)]
294294
295295
296296
297297 @Callable(i)
298298 func initialize (_coordinator) = if (initialized())
299299 then throw("Already initialized")
300300 else [StringEntry(k_coordinatorAddress, _coordinator), BooleanEntry(k_initialized, true)]
301301
302302
303303
304304 @Callable(i)
305305 func createOrder (_amm,_type,_triggerPrice,_limitPrice,_amountIn,_leverage,_side,_refLink) = {
306306 let _trader = toString(i.caller)
307307 let cleanUp = invoke(this, "cleanUpStaleOrders", [_amm, _trader], nil)
308308 if ((cleanUp == cleanUp))
309309 then if ((size(i.payments) > 1))
310310 then throw("Invalid createOrder parameters: invalid payment count")
311311 else {
312312 let $t01028710539 = if ((size(i.payments) == 1))
313313 then $Tuple2(toBase58String(valueOrErrorMessage(i.payments[0].assetId, "Invalid asset id")), i.payments[0].amount)
314314 else $Tuple2("", 0)
315315 let paymentAssetId = $t01028710539._1
316316 let paymentAmount = $t01028710539._2
317317 let doCall = invoke(this, "internalCreateOrder", [_trader, _amm, _type, _triggerPrice, _limitPrice, _amountIn, _leverage, _side, _refLink, paymentAssetId, paymentAmount], nil)
318318 if ((doCall == doCall))
319319 then nil
320320 else throw("Strict value is not equal to itself.")
321321 }
322322 else throw("Strict value is not equal to itself.")
323323 }
324324
325325
326326
327327 @Callable(i)
328328 func increasePositionWithStopLoss (_amm,_direction,_leverage,_minBaseAssetAmount,_refLink,_stopTriggerPrice,_stopLimitPrice,_takeTriggerPrice,_takeLimitPrice) = {
329329 let _trader = toString(i.caller)
330330 let cleanUp = invoke(this, "cleanUpStaleOrders", [_amm, _trader], nil)
331331 if ((cleanUp == cleanUp))
332332 then if (if (!(initialized()))
333333 then true
334334 else !(isWhitelist(_amm)))
335335 then throw("Invalid increasePositionWithStopLoss parameters")
336336 else {
337337 let positionSize = getPositionSize(_amm, _trader)
338338 if ((positionSize != 0))
339339 then throw("Invalid increasePositionWithStopLoss parameters: only new position")
340340 else {
341341 let doSetContext = invoke(this, "setContext", [_trader], nil)
342342 if ((doSetContext == doSetContext))
343343 then {
344344 let doClosePosition = invoke(addressFromStringValue(_amm), "increasePosition", [_direction, _leverage, _minBaseAssetAmount, _refLink], i.payments)
345345 if ((doClosePosition == doClosePosition))
346346 then {
347347 let doResetContext = invoke(this, "resetContext", nil, nil)
348348 if ((doResetContext == doResetContext))
349349 then {
350350 let openedPositionSize = getPositionSize(_amm, _trader)
351351 if ((openedPositionSize == openedPositionSize))
352352 then {
353353 let amountIn = abs(openedPositionSize)
354354 let stopLossSide = if ((0 > openedPositionSize))
355355 then LONG
356356 else SHORT
357357 let doCreateStopOrder = if ((_stopTriggerPrice > 0))
358358 then {
359359 let doCreateStopOrder = invoke(this, "internalCreateOrder", [_trader, _amm, STOP, _stopTriggerPrice, _stopLimitPrice, amountIn, 0, stopLossSide, _refLink, "", 0], nil)
360360 if ((doCreateStopOrder == doCreateStopOrder))
361361 then nil
362362 else throw("Strict value is not equal to itself.")
363363 }
364364 else nil
365365 if ((doCreateStopOrder == doCreateStopOrder))
366366 then {
367367 let doCreateTakeOrder = if ((_takeTriggerPrice > 0))
368368 then {
369369 let doCreateTakeOrder = invoke(this, "internalCreateOrder", [_trader, _amm, TAKE, _takeTriggerPrice, _takeLimitPrice, amountIn, 0, stopLossSide, _refLink, "", 0], nil)
370370 if ((doCreateTakeOrder == doCreateTakeOrder))
371371 then nil
372372 else throw("Strict value is not equal to itself.")
373373 }
374374 else nil
375375 if ((doCreateTakeOrder == doCreateTakeOrder))
376376 then nil
377377 else throw("Strict value is not equal to itself.")
378378 }
379379 else throw("Strict value is not equal to itself.")
380380 }
381381 else throw("Strict value is not equal to itself.")
382382 }
383383 else throw("Strict value is not equal to itself.")
384384 }
385385 else throw("Strict value is not equal to itself.")
386386 }
387387 else throw("Strict value is not equal to itself.")
388388 }
389389 }
390390 else throw("Strict value is not equal to itself.")
391391 }
392392
393393
394394
395395 @Callable(i)
396396 func internalCreateOrder (_trader,_amm,_type,_triggerPrice,_limitPrice,_amountIn,_leverage,_side,_refLink,_paymentAssetId,_paymentAmount) = if (if (if (if (if (if (if (if (if (!(initialized()))
397397 then true
398398 else !(isWhitelist(_amm)))
399399 then true
400400 else (0 >= _triggerPrice))
401401 then true
402402 else (0 > _limitPrice))
403403 then true
404404 else (0 >= _amountIn))
405405 then true
406406 else (0 > _leverage))
407407 then true
408408 else !(if ((_side == LONG))
409409 then true
410410 else (_side == SHORT)))
411411 then true
412412 else !(if (if ((_type == STOP))
413413 then true
414414 else (_type == TAKE))
415415 then true
416416 else (_type == LIMIT)))
417417 then true
418418 else !((i.caller == this)))
419419 then throw("Invalid createOrder parameters")
420420 else {
421421 let orderId = (currentOrderId() + 1)
422422 let newTraderOrderCount = (getTraderOrderCount(_amm, _trader) + 1)
423423 let positionSize = getPositionSize(_amm, _trader)
424424 let _direction = if (if (if ((positionSize == 0))
425425 then true
426426 else if ((positionSize > 0))
427427 then (_side == LONG)
428428 else false)
429429 then true
430430 else if ((0 > positionSize))
431431 then (_side == SHORT)
432432 else false)
433433 then INCREASE
434434 else DECREASE
435435 if (if ((positionSize == 0))
436436 then if ((_type == STOP))
437437 then true
438438 else (_type == TAKE)
439439 else false)
440440 then throw("Can not create STOP/TAKE order: no position")
441441 else {
442442 let usdnPayment = if ((_direction == INCREASE))
443443 then if (if ((_paymentAssetId != toBase58String(quoteAsset())))
444444 then true
445445 else (_paymentAmount != _amountIn))
446446 then throw("Invalid createLimitOrder parameters: invalid payment")
447447 else {
448448 let stake = invoke(managerAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), _paymentAmount)])
449449 if ((stake == stake))
450450 then _paymentAmount
451451 else throw("Strict value is not equal to itself.")
452452 }
453453 else 0
454454 if ((usdnPayment == usdnPayment))
455455 then {
456456 let positionId = if ((positionSize != 0))
457457 then getPositionId(_amm, _trader)
458458 else 0
459459 if ((newTraderOrderCount > MAX_TRADER_ORDERS_PER_AMM))
460460 then throw("Invalid createLimitOrder parameters: order count")
461461 else (((saveOrder(orderId, _amm, _trader, _amountIn, _leverage, _type, _triggerPrice, usdnPayment, _side, _refLink, positionId, _limitPrice) ++ addRemoveOrderId(orderId, _amm, _trader, true)) ++ updateTraderOrderCount(_amm, _trader, newTraderOrderCount)) ++ updateLastOrderId(orderId))
462462 }
463463 else throw("Strict value is not equal to itself.")
464464 }
465465 }
466466
467467
468468
469469 @Callable(i)
470470 func cancelOrder (_orderId) = {
471471 let $t01590816127 = getOrder(_orderId)
472472 let _amm = $t01590816127._1
473473 let _trader = $t01590816127._2
474474 let _amountIn = $t01590816127._3
475475 let _leverage = $t01590816127._4
476476 let _type = $t01590816127._5
477477 let _triggerPrice = $t01590816127._6
478478 let _amountUsdn = $t01590816127._7
479479 let _side = $t01590816127._8
480480 let _refLink = $t01590816127._9
481481 let _positionId = $t01590816127._10
482482 let _limitPrice = $t01590816127._11
483483 if (if (if (!(initialized()))
484484 then true
485485 else !(isValid(_orderId)))
486486 then true
487487 else !((toString(i.caller) == _trader)))
488488 then throw("Invalid cancelOrder parameters")
489489 else {
490490 let cleanUp = invoke(this, "cleanUpStaleOrders", [_amm, _trader], nil)
491491 if ((cleanUp == cleanUp))
492492 then {
493493 let newTraderOrderCount = (getTraderOrderCount(_amm, _trader) - 1)
494494 let withdraw = if ((_amountUsdn > 0))
495495 then {
496496 let unstake = invoke(managerAddress(), "withdraw", [toBase58String(quoteAsset()), _amountUsdn], nil)
497497 if ((unstake == unstake))
498498 then nil
499499 else throw("Strict value is not equal to itself.")
500500 }
501501 else nil
502502 if ((withdraw == withdraw))
503503 then (((markCancelOrder(_orderId) ++ addRemoveOrderId(_orderId, _amm, _trader, false)) ++ updateTraderOrderCount(_amm, _trader, newTraderOrderCount)) ++ (if ((_amountUsdn > 0))
504504 then [ScriptTransfer(i.caller, _amountUsdn, quoteAsset())]
505505 else nil))
506506 else throw("Strict value is not equal to itself.")
507507 }
508508 else throw("Strict value is not equal to itself.")
509509 }
510510 }
511511
512512
513513
514514 @Callable(i)
515515 func executeOrder (_orderId) = {
516516 let $t01709817317 = getOrder(_orderId)
517517 let _amm = $t01709817317._1
518518 let _trader = $t01709817317._2
519519 let _amountIn = $t01709817317._3
520520 let _leverage = $t01709817317._4
521521 let _type = $t01709817317._5
522522 let _triggerPrice = $t01709817317._6
523523 let _amountUsdn = $t01709817317._7
524524 let _side = $t01709817317._8
525525 let _refLink = $t01709817317._9
526526 let _positionId = $t01709817317._10
527527 let _limitPrice = $t01709817317._11
528528 let cleanUp = invoke(this, "cleanUpStaleOrders", [_amm, _trader], nil)
529529 if ((cleanUp == cleanUp))
530530 then if (if (!(initialized()))
531531 then true
532532 else !(isValid(_orderId)))
533533 then throw("Invalid executeOrder parameters")
534534 else {
535535 let positionSize = getPositionSize(_amm, _trader)
536536 let currentPositionId = if ((positionSize != 0))
537537 then getPositionId(_amm, _trader)
538538 else 0
539- let $t01772121542 = if ((_type == STOP))
539+ let $t01772121563 = if ((_type == STOP))
540540 then {
541541 let _positionDirection = if ((positionSize > 0))
542542 then LONG
543543 else if ((0 > positionSize))
544544 then SHORT
545545 else throw("Can not execute STOP order: no open position")
546546 let marketPrice = getMarketPrice(_amm)
547547 let isExecutable = if ((_side == _positionDirection))
548548 then throw("Can not execute STOP order: reduce only")
549549 else if ((currentPositionId != _positionId))
550550 then throw("Can not execute STOP order: position closed")
551551 else if ((_positionDirection == LONG))
552552 then (_triggerPrice >= marketPrice)
553553 else (marketPrice >= _triggerPrice)
554554 if (isExecutable)
555- then $Tuple3("closePosition", [minv(_amountIn, abs(positionSize)), muld(_limitPrice, abs(positionSize))], nil)
555+ then $Tuple3("closePosition", [minv(_amountIn, abs(positionSize)), muld(_limitPrice, abs(positionSize)), false], nil)
556556 else throw("Can not execute STOP order: triggerPrice mismatch")
557557 }
558558 else if ((_type == TAKE))
559559 then {
560560 let _positionDirection = if ((positionSize > 0))
561561 then LONG
562562 else if ((0 > positionSize))
563563 then SHORT
564564 else throw("Can not execute STOP order: no open position")
565565 let marketPrice = getMarketPrice(_amm)
566566 let isExecutable = if ((_side == _positionDirection))
567567 then throw("Can not execute TAKE order: reduce only")
568568 else if ((currentPositionId != _positionId))
569569 then throw(((("Can not execute TAKE order: position closed " + toString(currentPositionId)) + "!=") + toString(_positionId)))
570570 else if ((_positionDirection == LONG))
571571 then (marketPrice >= _triggerPrice)
572572 else (_triggerPrice >= marketPrice)
573573 if (isExecutable)
574- then $Tuple3("closePosition", [minv(_amountIn, abs(positionSize)), muld(_limitPrice, abs(positionSize))], nil)
574+ then $Tuple3("closePosition", [minv(_amountIn, abs(positionSize)), muld(_limitPrice, abs(positionSize)), false], nil)
575575 else throw("Can not execute TAKE order: triggerPrice mismatch")
576576 }
577577 else if ((_type == LIMIT))
578578 then {
579579 let marketPrice = getMarketPrice(_amm)
580580 let spread = if ((_limitPrice == 0))
581581 then getSpread(_triggerPrice)
582582 else abs((_triggerPrice - _limitPrice))
583583 let isExecutable = if ((marketPrice >= (_triggerPrice - spread)))
584584 then ((_triggerPrice + spread) >= marketPrice)
585585 else false
586586 if (isExecutable)
587587 then {
588588 let _positionDirection = if ((positionSize > 0))
589589 then LONG
590590 else if ((0 > positionSize))
591591 then SHORT
592592 else -1
593593 let direction = if ((positionSize == 0))
594594 then INCREASE
595595 else if ((_positionDirection == _side))
596596 then INCREASE
597597 else DECREASE
598598 if ((direction == INCREASE))
599599 then {
600600 let amountInWithFee = (_amountUsdn - muld(_amountUsdn, getFee(_amm, _trader)))
601601 $Tuple3("increasePosition", [_side, _leverage, if ((_limitPrice == 0))
602602 then 0
603603 else divd(amountInWithFee, _limitPrice), _refLink], [AttachedPayment(quoteAsset(), _amountUsdn)])
604604 }
605- else $Tuple3("closePosition", [_amountIn, muld(_amountIn, _limitPrice)], nil)
605+ else $Tuple3("closePosition", [_amountIn, muld(_amountIn, _limitPrice), false], nil)
606606 }
607607 else throw("Can not execute LIMIT order: triggerPrice mismatch")
608608 }
609609 else throw(("Invalid order type: " + toString(_type)))
610- let method = $t01772121542._1
611- let args = $t01772121542._2
612- let payments = $t01772121542._3
610+ let method = $t01772121563._1
611+ let args = $t01772121563._2
612+ let payments = $t01772121563._3
613613 let withdraw = if ((size(payments) == 1))
614614 then {
615615 let unstake = invoke(managerAddress(), "withdraw", [toBase58String(quoteAsset()), payments[0].amount], nil)
616616 if ((unstake == unstake))
617617 then nil
618618 else throw("Strict value is not equal to itself.")
619619 }
620620 else nil
621621 if ((withdraw == withdraw))
622622 then {
623623 let doSetContext = invoke(this, "setContext", [_trader], nil)
624624 if ((doSetContext == doSetContext))
625625 then {
626626 let doClosePosition = invoke(addressFromStringValue(_amm), method, args, payments)
627627 if ((doClosePosition == doClosePosition))
628628 then {
629629 let doResetContext = invoke(this, "resetContext", nil, nil)
630630 if ((doResetContext == doResetContext))
631631 then {
632632 let newTraderOrderCount = (getTraderOrderCount(_amm, _trader) - 1)
633633 ((updateTraderOrderCount(_amm, _trader, newTraderOrderCount) ++ addRemoveOrderId(_orderId, _amm, _trader, false)) ++ markExecuteOrder(_orderId))
634634 }
635635 else throw("Strict value is not equal to itself.")
636636 }
637637 else throw("Strict value is not equal to itself.")
638638 }
639639 else throw("Strict value is not equal to itself.")
640640 }
641641 else throw("Strict value is not equal to itself.")
642642 }
643643 else throw("Strict value is not equal to itself.")
644644 }
645645
646646
647647
648648 @Callable(i)
649649 func view_canExecuteOrder (_orderId) = {
650650 let s = invoke(this, "executeOrder", [_orderId], nil)
651651 if ((s == s))
652652 then throw("Success")
653653 else throw("Strict value is not equal to itself.")
654654 }
655655
656656
657657 @Verifier(tx)
658658 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], adminPublicKey())
659659

github/deemru/w8io/873ac7e 
139.12 ms