tx · 8BvDNGLK6j3Up8oKjGFsGXPwf8869XzRh48XkMdCuD2Z

3MzGPAZokuNfqjMuP7yDXFATZjhjtEP5UCa:  -0.03700000 Waves

2023.05.03 10:59 [2561305] smart account 3MzGPAZokuNfqjMuP7yDXFATZjhjtEP5UCa > SELF 0.00000000 Waves

{ "type": 13, "id": "8BvDNGLK6j3Up8oKjGFsGXPwf8869XzRh48XkMdCuD2Z", "fee": 3700000, "feeAssetId": null, "timestamp": 1683100784819, "version": 2, "chainId": 84, "sender": "3MzGPAZokuNfqjMuP7yDXFATZjhjtEP5UCa", "senderPublicKey": "4EBKd2zSCvpiSLeyovT5FUuMvGpi6oxdBAbvQybSYi6p", "proofs": [ "YNS9GDjLiXSyo6ruyXsuARrZWhK2AKsvY4qhBk7hwMtCMnSTmhTEMJBukDEHu8NTeAHLSTFqdgv18eVfV9kZCUu" ], "script": "base64:BgJiCAISBAoCCAgSAwoBCBIAEgMKAQgSDwoNCAEBAQEBAQgBAQEBARILCgkIAQEBCAEBAQESBQoDCAgBEggKBggIAQEBARIOCgwICAEBAQEBAQgIAQESAwoBARIDCgEBEgMKAQFCABRrX2Nvb3JkaW5hdG9yQWRkcmVzcwIUa19jb29yZGluYXRvckFkZHJlc3MAD2tfYWRtaW5fYWRkcmVzcwIPa19hZG1pbl9hZGRyZXNzAA1rX3F1b3RlX2Fzc2V0Ag1rX3F1b3RlX2Fzc2V0AAVrX2FtbQIFa19hbW0AEWtfbWFuYWdlcl9hZGRyZXNzAhFrX21hbmFnZXJfYWRkcmVzcwASa19wb3NpdGlvblNlcXVlbmNlAhJrX3Bvc2l0aW9uU2VxdWVuY2UADmtfcG9zaXRpb25TaXplAg5rX3Bvc2l0aW9uU2l6ZQAQa19leGVjdXRlZE9yZGVycwIQa19leGVjdXRlZE9yZGVycwAQa19jYW5jZWxlZE9yZGVycwIQa19jYW5jZWxlZE9yZGVycwAHa19vcmRlcgIHa19vcmRlcgAOa19vcmRlclJlcXVlc3QCCmtfb3JkZXJ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hdG9yQWRkcmVzcwMJAQlpc0RlZmluZWQBBQ5jb29yZGluYXRvclN0cgQFYWRtaW4JAJ0IAgkBEUBleHRyTmF0aXZlKDEwNjIpAQkBBXZhbHVlAQUOY29vcmRpbmF0b3JTdHIFD2tfYWRtaW5fYWRkcmVzcwMJAQlpc0RlZmluZWQBBQVhZG1pbgkBC3ZhbHVlT3JFbHNlAgkAmwgCCQERQGV4dHJOYXRpdmUoMTA2MikBCQEFdmFsdWUBBQVhZG1pbgkArAICCQCsAgIJAKwCAgIHc3RhdHVzXwkApQgBBQR0aGlzAgFfCQDYBAEIBQJ0eAJpZAcJAAIBAi51bmFibGUgdG8gdmVyaWZ5OiBhZG1pbiBub3Qgc2V0IGluIGNvb3JkaW5hdG9yCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACAUCdHgPc2VuZGVyUHVibGljS2V5mbvhOg==", "height": 2561305, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9LcQaLNXkXYqtYStNyvvREGvA84mY4gSubqhHMwgY85V Next: D3U1NZrYntYoAQiuS775RNur1fupPcWYyBm42cQB9gqC Diff:
OldNewDifferences
166166 let refLink = orderPartList[8]
167167 let positionId = valueOrErrorMessage(parseInt(orderPartList[9]), "Invalid positionId")
168168 let limitPrice = valueOrErrorMessage(parseInt(orderPartList[10]), "Invalid limitPrice")
169- $Tuple11(amm, trader, amountIn, leverage, type, triggerPrice, paymentUsdn, side, refLink, positionId, limitPrice)
169+ let expiration = if ((size(orderPartList) > 11))
170+ then valueOrErrorMessage(parseInt(orderPartList[11]), "Invalid limitPrice")
171+ else 0
172+ $Tuple12(amm, trader, amountIn, leverage, type, triggerPrice, paymentUsdn, side, refLink, positionId, limitPrice, expiration)
170173 }
171174
172175
230233 func getSpread (_price) = muld(_price, SPREAD_LIMIT)
231234
232235
233-func saveOrder (_orderId,_amm,_trader,_amountIn,_leverage,_type,_triggerPrice,_paymentUsdn,_side,_refLink,_positionId,_limitPrice) = {
234- let orderStr = makeString([_amm, _trader, toString(_amountIn), toString(_leverage), toString(_type), toString(_triggerPrice), toString(_paymentUsdn), toString(_side), _refLink, toString(_positionId), toString(_limitPrice)], ",")
236+func saveOrder (_orderId,_amm,_trader,_amountIn,_leverage,_type,_triggerPrice,_paymentUsdn,_side,_refLink,_positionId,_limitPrice,_expiration) = {
237+ let orderStr = makeString([_amm, _trader, toString(_amountIn), toString(_leverage), toString(_type), toString(_triggerPrice), toString(_paymentUsdn), toString(_side), _refLink, toString(_positionId), toString(_limitPrice), toString(_expiration)], ",")
235238 [StringEntry(orderKey(_orderId), orderStr)]
236239 }
237240
294297 let positionIds = getPositionIds(_amm, _trader)
295298 func cleanUpOne (_acc,_orderId) = {
296299 let orderIdInt = valueOrErrorMessage(parseInt(_orderId), "Invalid order id")
297- let $t01115611351 = getOrder(orderIdInt)
298- let _x1 = $t01115611351._1
299- let _x2 = $t01115611351._2
300- let _x3 = $t01115611351._3
301- let _x4 = $t01115611351._4
302- let _type = $t01115611351._5
303- let _x5 = $t01115611351._6
304- let _x6 = $t01115611351._7
305- let _x7 = $t01115611351._8
306- let _x8 = $t01115611351._9
307- let _positionId = $t01115611351._10
308- let _x9 = $t01115611351._11
300+ let $t01135911575 = getOrder(orderIdInt)
301+ let _x1 = $t01135911575._1
302+ let _x2 = $t01135911575._2
303+ let _x3 = $t01135911575._3
304+ let _x4 = $t01135911575._4
305+ let _type = $t01135911575._5
306+ let _x5 = $t01135911575._6
307+ let _x6 = $t01135911575._7
308+ let _x7 = $t01135911575._8
309+ let _x8 = $t01135911575._9
310+ let _positionId = $t01135911575._10
311+ let _x9 = $t01135911575._11
312+ let _expiration = $t01135911575._12
309313 if (if (if (if ((_type == STOP))
310314 then true
311315 else (_type == TAKE))
321325 else _acc
322326 }
323327
324- let $t01170411779 = {
328+ let $t01192812003 = {
325329 let $l = orders
326330 let $s = size($l)
327331 let $acc0 = $Tuple2(orders, nil)
335339
336340 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10)
337341 }
338- let newOrders = $t01170411779._1
339- let cancelActions = $t01170411779._2
342+ let newOrders = $t01192812003._1
343+ let cancelActions = $t01192812003._2
340344 ((cancelActions ++ updateTraderOrderCount(_amm, _trader, size(newOrders))) ++ updateOrderIdStr(makeString(newOrders, ","), _amm, _trader))
341345 }
342346
366370
367371
368372 @Callable(i)
369-func createOrder (_amm,_type,_triggerPrice,_limitPrice,_amountIn,_leverage,_side,_refLink,_stopTriggerPrice,_stopLimitPrice,_takeTriggerPrice,_takeLimitPrice) = {
373+func createOrder (_amm,_type,_triggerPrice,_limitPrice,_amountIn,_leverage,_side,_refLink,_stopTriggerPrice,_stopLimitPrice,_takeTriggerPrice,_takeLimitPrice,_expiration) = {
370374 let _trader = toString(i.caller)
371375 let cleanUp = invoke(this, "cleanUpStaleOrders", [_amm, _trader], nil)
372376 if ((cleanUp == cleanUp))
373377 then if ((size(i.payments) > 1))
374378 then throw("Invalid createOrder parameters: invalid payment count")
375379 else {
376- let $t01427514527 = if ((size(i.payments) == 1))
380+ let $t01452114773 = if ((size(i.payments) == 1))
377381 then $Tuple2(toBase58String(valueOrErrorMessage(i.payments[0].assetId, "Invalid asset id")), i.payments[0].amount)
378382 else $Tuple2("", 0)
379- let paymentAssetId = $t01427514527._1
380- let paymentAmount = $t01427514527._2
381- let doCall = invoke(this, "internalCreateOrder", [_trader, _amm, _type, _triggerPrice, _limitPrice, _amountIn, _leverage, _side, _refLink, paymentAssetId, paymentAmount], nil)
383+ let paymentAssetId = $t01452114773._1
384+ let paymentAmount = $t01452114773._2
385+ let doCall = invoke(this, "internalCreateOrder", [_trader, _amm, _type, _triggerPrice, _limitPrice, _amountIn, _leverage, _side, _refLink, paymentAssetId, paymentAmount, _expiration], nil)
382386 if ((doCall == doCall))
383387 then {
384388 let orderId = match doCall {
448452 else SHORT
449453 let doCreateStopOrder = if ((_stopTriggerPrice > 0))
450454 then {
451- let doCreateStopOrder = invoke(this, "internalCreateOrder", [_trader, _amm, STOP, _stopTriggerPrice, _stopLimitPrice, amountIn, 0, stopLossSide, _refLink, "", 0], nil)
455+ let doCreateStopOrder = invoke(this, "internalCreateOrder", [_trader, _amm, STOP, _stopTriggerPrice, _stopLimitPrice, amountIn, 0, stopLossSide, _refLink, "", 0, 0], nil)
452456 if ((doCreateStopOrder == doCreateStopOrder))
453457 then nil
454458 else throw("Strict value is not equal to itself.")
458462 then {
459463 let doCreateTakeOrder = if ((_takeTriggerPrice > 0))
460464 then {
461- let doCreateTakeOrder = invoke(this, "internalCreateOrder", [_trader, _amm, TAKE, _takeTriggerPrice, _takeLimitPrice, amountIn, 0, stopLossSide, _refLink, "", 0], nil)
465+ let doCreateTakeOrder = invoke(this, "internalCreateOrder", [_trader, _amm, TAKE, _takeTriggerPrice, _takeLimitPrice, amountIn, 0, stopLossSide, _refLink, "", 0, 0], nil)
462466 if ((doCreateTakeOrder == doCreateTakeOrder))
463467 then nil
464468 else throw("Strict value is not equal to itself.")
514518
515519
516520 @Callable(i)
517-func internalCreateOrder (_trader,_amm,_type,_triggerPrice,_limitPrice,_amountIn,_leverage,_side,_refLink,_paymentAssetId,_paymentAmount) = {
518- let x1 = toString(!(initialized()))
519- let x2 = toString(!(isWhitelist(_amm)))
520- let x3 = toString((0 >= _triggerPrice))
521- let x4 = toString((0 > _limitPrice))
522- let x5 = toString((0 >= _amountIn))
523- let x6 = toString((0 > _leverage))
524- let x7 = toString(!(if ((_side == LONG))
521+func internalCreateOrder (_trader,_amm,_type,_triggerPrice,_limitPrice,_amountIn,_leverage,_side,_refLink,_paymentAssetId,_paymentAmount,_expiration) = if (if (if (if (if (if (if (if (if (if (!(initialized()))
522+ then true
523+ else !(isWhitelist(_amm)))
524+ then true
525+ else (0 >= _triggerPrice))
526+ then true
527+ else (0 > _limitPrice))
528+ then true
529+ else (0 >= _amountIn))
530+ then true
531+ else (0 > _leverage))
532+ then true
533+ else !(if ((_side == LONG))
525534 then true
526535 else (_side == SHORT)))
527- let x8 = toString(!(if (if ((_type == STOP))
536+ then true
537+ else !(if (if ((_type == STOP))
528538 then true
529539 else (_type == TAKE))
530540 then true
531541 else (_type == LIMIT)))
532- let x9 = toString(!((i.caller == this)))
533- let all = makeString([x1, x2, x3, x4, x5, x6, x7, x8, x9], ",")
534- if (if (if (if (if (if (if (if (if (!(initialized()))
535- then true
536- else !(isWhitelist(_amm)))
537- then true
538- else (0 >= _triggerPrice))
539- then true
540- else (0 > _limitPrice))
541- then true
542- else (0 >= _amountIn))
543- then true
544- else (0 > _leverage))
545- then true
546- else !(if ((_side == LONG))
542+ then true
543+ else !((i.caller == this)))
544+ then true
545+ else (0 > _expiration))
546+ then throw("Invalid internalCreateOrder parameters")
547+ else {
548+ let orderId = (currentOrderId() + 1)
549+ let positionDirection = getPositionDirection(_side, _type)
550+ let newTraderOrderCount = (getTraderOrderCount(_amm, _trader) + 1)
551+ let positionSize = getPositionSize(_amm, _trader, positionDirection)
552+ let _direction = if (if (if ((positionSize == 0))
547553 then true
548- else (_side == SHORT)))
549- then true
550- else !(if (if ((_type == STOP))
554+ else if ((positionSize > 0))
555+ then (_side == LONG)
556+ else false)
551557 then true
552- else (_type == TAKE))
553- then true
554- else (_type == LIMIT)))
555- then true
556- else !((i.caller == this)))
557- then throw(("Invalid internalCreateOrder parameters " + all))
558- else {
559- let orderId = (currentOrderId() + 1)
560- let positionDirection = getPositionDirection(_side, _type)
561- let newTraderOrderCount = (getTraderOrderCount(_amm, _trader) + 1)
562- let positionSize = getPositionSize(_amm, _trader, positionDirection)
563- let _direction = if (if (if ((positionSize == 0))
558+ else if ((0 > positionSize))
559+ then (_side == SHORT)
560+ else false)
561+ then INCREASE
562+ else DECREASE
563+ if (if ((positionSize == 0))
564+ then if ((_type == STOP))
564565 then true
565- else if ((positionSize > 0))
566- then (_side == LONG)
567- else false)
568- then true
569- else if ((0 > positionSize))
570- then (_side == SHORT)
571- else false)
572- then INCREASE
573- else DECREASE
574- if (if ((positionSize == 0))
575- then if ((_type == STOP))
576- then true
577- else (_type == TAKE)
578- else false)
579- then throw("Can not create STOP/TAKE order: no position")
580- else {
581- let usdnPayment = if ((_direction == INCREASE))
582- then if (if ((_paymentAssetId != toBase58String(quoteAsset())))
566+ else (_type == TAKE)
567+ else false)
568+ then throw("Can not create STOP/TAKE order: no position")
569+ else {
570+ let usdnPayment = if ((_direction == INCREASE))
571+ then if (if ((_paymentAssetId != toBase58String(quoteAsset())))
572+ then true
573+ else (_paymentAmount != _amountIn))
574+ then throw("Invalid createLimitOrder parameters: invalid payment")
575+ else {
576+ let stake = invoke(managerAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), _paymentAmount)])
577+ if ((stake == stake))
578+ then _paymentAmount
579+ else throw("Strict value is not equal to itself.")
580+ }
581+ else 0
582+ if ((usdnPayment == usdnPayment))
583+ then {
584+ let positionId = if ((positionSize != 0))
585+ then getPositionId(_amm, _trader, positionDirection)
586+ else 0
587+ if (if (if ((_type == STOP))
583588 then true
584- else (_paymentAmount != _amountIn))
585- then throw("Invalid createLimitOrder parameters: invalid payment")
586- else {
587- let stake = invoke(managerAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), _paymentAmount)])
588- if ((stake == stake))
589- then _paymentAmount
590- else throw("Strict value is not equal to itself.")
591- }
592- else 0
593- if ((usdnPayment == usdnPayment))
594- then {
595- let positionId = if ((positionSize != 0))
596- then getPositionId(_amm, _trader, positionDirection)
597- else 0
598- if (if (if ((_type == STOP))
599- then true
600- else (_type == TAKE))
601- then (positionId == 0)
602- else false)
603- then throw("STOP and TAKE order should be assigned to position with id != 0")
604- else if ((newTraderOrderCount > MAX_TRADER_ORDERS_PER_AMM))
605- then throw("Invalid createLimitOrder parameters: order count")
606- else {
607- let changeSet = (((saveOrder(orderId, _amm, _trader, _amountIn, _leverage, _type, _triggerPrice, usdnPayment, _side, _refLink, positionId, _limitPrice) ++ addRemoveOrderId(orderId, _amm, _trader, true)) ++ updateTraderOrderCount(_amm, _trader, newTraderOrderCount)) ++ updateLastOrderId(orderId))
608- $Tuple2(changeSet, orderId)
609- }
610- }
611- else throw("Strict value is not equal to itself.")
612- }
613- }
614- }
589+ else (_type == TAKE))
590+ then (positionId == 0)
591+ else false)
592+ then throw("STOP and TAKE order should be assigned to position with id != 0")
593+ else if ((newTraderOrderCount > MAX_TRADER_ORDERS_PER_AMM))
594+ then throw("Invalid createLimitOrder parameters: order count")
595+ else {
596+ let changeSet = (((saveOrder(orderId, _amm, _trader, _amountIn, _leverage, _type, _triggerPrice, usdnPayment, _side, _refLink, positionId, _limitPrice, _expiration) ++ addRemoveOrderId(orderId, _amm, _trader, true)) ++ updateTraderOrderCount(_amm, _trader, newTraderOrderCount)) ++ updateLastOrderId(orderId))
597+ $Tuple2(changeSet, orderId)
598+ }
599+ }
600+ else throw("Strict value is not equal to itself.")
601+ }
602+ }
615603
616604
617605
618606 @Callable(i)
619607 func cancelOrder (_orderId) = {
620- let $t02378624005 = getOrder(_orderId)
621- let _amm = $t02378624005._1
622- let _trader = $t02378624005._2
623- let _amountIn = $t02378624005._3
624- let _leverage = $t02378624005._4
625- let _type = $t02378624005._5
626- let _triggerPrice = $t02378624005._6
627- let _amountUsdn = $t02378624005._7
628- let _side = $t02378624005._8
629- let _refLink = $t02378624005._9
630- let _positionId = $t02378624005._10
631- let _limitPrice = $t02378624005._11
608+ let $t02383724056 = getOrder(_orderId)
609+ let _amm = $t02383724056._1
610+ let _trader = $t02383724056._2
611+ let _amountIn = $t02383724056._3
612+ let _leverage = $t02383724056._4
613+ let _type = $t02383724056._5
614+ let _triggerPrice = $t02383724056._6
615+ let _amountUsdn = $t02383724056._7
616+ let _side = $t02383724056._8
617+ let _refLink = $t02383724056._9
618+ let _positionId = $t02383724056._10
619+ let _limitPrice = $t02383724056._11
632620 if (if (if (!(initialized()))
633621 then true
634622 else !(isValid(_orderId)))
662650
663651 @Callable(i)
664652 func executeOrder (_orderId) = {
665- let $t02520325422 = getOrder(_orderId)
666- let _amm = $t02520325422._1
667- let _trader = $t02520325422._2
668- let _amountIn = $t02520325422._3
669- let _leverage = $t02520325422._4
670- let _type = $t02520325422._5
671- let _triggerPrice = $t02520325422._6
672- let _amountUsdn = $t02520325422._7
673- let _side = $t02520325422._8
674- let _refLink = $t02520325422._9
675- let _positionId = $t02520325422._10
676- let _limitPrice = $t02520325422._11
653+ let $t02525425473 = getOrder(_orderId)
654+ let _amm = $t02525425473._1
655+ let _trader = $t02525425473._2
656+ let _amountIn = $t02525425473._3
657+ let _leverage = $t02525425473._4
658+ let _type = $t02525425473._5
659+ let _triggerPrice = $t02525425473._6
660+ let _amountUsdn = $t02525425473._7
661+ let _side = $t02525425473._8
662+ let _refLink = $t02525425473._9
663+ let _positionId = $t02525425473._10
664+ let _limitPrice = $t02525425473._11
677665 let cleanUp = invoke(this, "cleanUpStaleOrders", [_amm, _trader], nil)
678666 if ((cleanUp == cleanUp))
679667 then {
689677 let currentPositionId = if ((positionSize != 0))
690678 then getPositionId(_amm, _trader, positionDirection)
691679 else 0
692- let $t02592929307 = if ((_type == STOP))
680+ let $t02598029358 = if ((_type == STOP))
693681 then {
694682 let _positionDirection = if ((positionSize > 0))
695683 then LONG
746734 else throw("Can not execute LIMIT order: triggerPrice mismatch")
747735 }
748736 else throw(("Invalid order type: " + toString(_type)))
749- let method = $t02592929307._1
750- let args = $t02592929307._2
751- let payments = $t02592929307._3
737+ let method = $t02598029358._1
738+ let args = $t02598029358._2
739+ let payments = $t02598029358._3
752740 let withdraw = if ((size(payments) == 1))
753741 then {
754742 let unstake = invoke(managerAddress(), "withdraw", [toBase58String(quoteAsset()), payments[0].amount], nil)
782770 else LONG
783771 let makeTakeOrder = if (haveOrderRequest(_orderId, TAKE))
784772 then {
785- let $t03026930468 = getOrderRequest(_orderId, TAKE)
786- let newOrderId = $t03026930468._1
787- let newAmm = $t03026930468._2
788- let newTrader = $t03026930468._3
789- let newType = $t03026930468._4
790- let newTriggerPrice = $t03026930468._5
791- let newLimitPrice = $t03026930468._6
792- let doCall = invoke(this, "internalCreateOrder", [newTrader, newAmm, newType, newTriggerPrice, newLimitPrice, positionSizeDelta, 0, closeOrderSide, "", "", 0], nil)
773+ let $t03032030519 = getOrderRequest(_orderId, TAKE)
774+ let newOrderId = $t03032030519._1
775+ let newAmm = $t03032030519._2
776+ let newTrader = $t03032030519._3
777+ let newType = $t03032030519._4
778+ let newTriggerPrice = $t03032030519._5
779+ let newLimitPrice = $t03032030519._6
780+ let doCall = invoke(this, "internalCreateOrder", [newTrader, newAmm, newType, newTriggerPrice, newLimitPrice, positionSizeDelta, 0, closeOrderSide, "", "", 0, 0], nil)
793781 if ((doCall == doCall))
794782 then nil
795783 else throw("Strict value is not equal to itself.")
799787 then {
800788 let makeStopOrder = if (haveOrderRequest(_orderId, STOP))
801789 then {
802- let $t03102431223 = getOrderRequest(_orderId, STOP)
803- let newOrderId = $t03102431223._1
804- let newAmm = $t03102431223._2
805- let newTrader = $t03102431223._3
806- let newType = $t03102431223._4
807- let newTriggerPrice = $t03102431223._5
808- let newLimitPrice = $t03102431223._6
809- let doCall = invoke(this, "internalCreateOrder", [newTrader, newAmm, newType, newTriggerPrice, newLimitPrice, positionSizeDelta, 0, closeOrderSide, "", "", 0], nil)
790+ let $t03109231291 = getOrderRequest(_orderId, STOP)
791+ let newOrderId = $t03109231291._1
792+ let newAmm = $t03109231291._2
793+ let newTrader = $t03109231291._3
794+ let newType = $t03109231291._4
795+ let newTriggerPrice = $t03109231291._5
796+ let newLimitPrice = $t03109231291._6
797+ let doCall = invoke(this, "internalCreateOrder", [newTrader, newAmm, newType, newTriggerPrice, newLimitPrice, positionSizeDelta, 0, closeOrderSide, "", "", 0, 0], nil)
810798 if ((doCall == doCall))
811799 then nil
812800 else throw("Strict value is not equal to itself.")
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_address = "k_admin_address"
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_executedOrders = "k_executedOrders"
1919
2020 let k_canceledOrders = "k_canceledOrders"
2121
2222 let k_order = "k_order"
2323
2424 let k_orderRequest = "k_orderReq"
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 = 10
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 orderRequestKey (_orderId,_type) = ((((k_orderRequest + "_") + toString(_orderId)) + "_") + toString(_type))
8787
8888
8989 func traderOrderCountKey (_amm,_trader) = ((((k_traderOrderCnt + "_") + _amm) + "_") + _trader)
9090
9191
9292 func traderOrderIdsKey (_amm,_trader) = ((((k_traderOrderIds + "_") + _amm) + "_") + _trader)
9393
9494
9595 func coordinator () = valueOrErrorMessage(addressFromString(getStringValue(this, k_coordinatorAddress)), "Coordinator not set")
9696
9797
9898 func quoteAsset () = fromBase58String(getStringValue(coordinator(), k_quote_asset))
9999
100100
101101 func managerAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_manager_address)), "Manager not set")
102102
103103
104104 func isWhitelist (_address) = valueOrElse(getBoolean(coordinator(), toCompositeKey(k_amm, _address)), false)
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 haveOrderRequest (_orderId,_type) = {
136136 let key = orderRequestKey(_orderId, _type)
137137 isDefined(getString(this, key))
138138 }
139139
140140
141141 func getOrderRequest (_orderId,_type) = {
142142 let key = orderRequestKey(_orderId, _type)
143143 let orderRequestStr = valueOrErrorMessage(getString(this, key), ("Not order request for key: " + key))
144144 let orderRequestPartList = split(orderRequestStr, ",")
145145 let orderId = valueOrErrorMessage(parseInt(orderRequestPartList[0]), "Invalid orderId")
146146 let amm = orderRequestPartList[1]
147147 let trader = orderRequestPartList[2]
148148 let type = valueOrErrorMessage(parseInt(orderRequestPartList[3]), "Invalid type")
149149 let triggerPrice = valueOrErrorMessage(parseInt(orderRequestPartList[4]), "Invalid triggerPrice")
150150 let limitPrice = valueOrErrorMessage(parseInt(orderRequestPartList[5]), "Invalid limitPrice")
151151 $Tuple6(orderId, amm, trader, type, triggerPrice, limitPrice)
152152 }
153153
154154
155155 func getOrder (_orderId) = {
156156 let orderStr = valueOrErrorMessage(getString(this, orderKey(_orderId)), ("Invalid order id: " + toString(_orderId)))
157157 let orderPartList = split(orderStr, ",")
158158 let amm = orderPartList[0]
159159 let trader = orderPartList[1]
160160 let amountIn = valueOrErrorMessage(parseInt(orderPartList[2]), "Invalid amountIn")
161161 let leverage = valueOrErrorMessage(parseInt(orderPartList[3]), "Invalid leverage")
162162 let type = valueOrErrorMessage(parseInt(orderPartList[4]), "Invalid type")
163163 let triggerPrice = valueOrErrorMessage(parseInt(orderPartList[5]), "Invalid triggerPrice")
164164 let paymentUsdn = valueOrErrorMessage(parseInt(orderPartList[6]), "Invalid paymentUsdn")
165165 let side = valueOrErrorMessage(parseInt(orderPartList[7]), "Invalid side")
166166 let refLink = orderPartList[8]
167167 let positionId = valueOrErrorMessage(parseInt(orderPartList[9]), "Invalid positionId")
168168 let limitPrice = valueOrErrorMessage(parseInt(orderPartList[10]), "Invalid limitPrice")
169- $Tuple11(amm, trader, amountIn, leverage, type, triggerPrice, paymentUsdn, side, refLink, positionId, limitPrice)
169+ let expiration = if ((size(orderPartList) > 11))
170+ then valueOrErrorMessage(parseInt(orderPartList[11]), "Invalid limitPrice")
171+ else 0
172+ $Tuple12(amm, trader, amountIn, leverage, type, triggerPrice, paymentUsdn, side, refLink, positionId, limitPrice, expiration)
170173 }
171174
172175
173176 func getMarketPrice (_amm) = {
174177 let s = invoke(addressFromStringValue(_amm), "computeSpotPrice", nil, nil)
175178 if ((s == s))
176179 then {
177180 let res = match s {
178181 case t: Int =>
179182 t
180183 case _ =>
181184 throw("Invalid computeSpotPrice result")
182185 }
183186 value(res)
184187 }
185188 else throw("Strict value is not equal to itself.")
186189 }
187190
188191
189192 func getFee (_amm,_trader) = {
190193 let s = invoke(addressFromStringValue(_amm), "computeFeeForTraderWithArtifact", [_trader, ""], nil)
191194 if ((s == s))
192195 then {
193196 let res = match s {
194197 case t: (Int, Boolean) =>
195198 t._1
196199 case _ =>
197200 throw("Invalid computeFeeForTraderWithArtifact result")
198201 }
199202 value(res)
200203 }
201204 else throw("Strict value is not equal to itself.")
202205 }
203206
204207
205208 func getPositionDirection (_orderSide,_orderType) = if (if ((_orderType == TAKE))
206209 then true
207210 else (_orderType == STOP))
208211 then if ((_orderSide == LONG))
209212 then SHORT
210213 else LONG
211214 else _orderSide
212215
213216
214217 func getPositionSize (_amm,_trader,_direction) = {
215218 let amm = addressFromStringValue(_amm)
216219 let positionKey = ((_trader + "_") + toString(_direction))
217220 let sizeKey = toCompositeKey(k_positionSize, positionKey)
218221 valueOrElse(getInteger(amm, sizeKey), 0)
219222 }
220223
221224
222225 func getPositionId (_amm,_trader,_direction) = {
223226 let amm = addressFromStringValue(_amm)
224227 let positionKey = ((_trader + "_") + toString(_direction))
225228 let seqKey = toCompositeKey(k_positionSequence, positionKey)
226229 valueOrElse(getInteger(amm, seqKey), 0)
227230 }
228231
229232
230233 func getSpread (_price) = muld(_price, SPREAD_LIMIT)
231234
232235
233-func saveOrder (_orderId,_amm,_trader,_amountIn,_leverage,_type,_triggerPrice,_paymentUsdn,_side,_refLink,_positionId,_limitPrice) = {
234- let orderStr = makeString([_amm, _trader, toString(_amountIn), toString(_leverage), toString(_type), toString(_triggerPrice), toString(_paymentUsdn), toString(_side), _refLink, toString(_positionId), toString(_limitPrice)], ",")
236+func saveOrder (_orderId,_amm,_trader,_amountIn,_leverage,_type,_triggerPrice,_paymentUsdn,_side,_refLink,_positionId,_limitPrice,_expiration) = {
237+ let orderStr = makeString([_amm, _trader, toString(_amountIn), toString(_leverage), toString(_type), toString(_triggerPrice), toString(_paymentUsdn), toString(_side), _refLink, toString(_positionId), toString(_limitPrice), toString(_expiration)], ",")
235238 [StringEntry(orderKey(_orderId), orderStr)]
236239 }
237240
238241
239242 func saveOrderRequest (_orderId,_amm,_trader,_type,_triggerPrice,_limitPrice) = {
240243 let orderReqStr = makeString([toString(_orderId), _amm, _trader, toString(_type), toString(_triggerPrice), toString(_limitPrice)], ",")
241244 [StringEntry(orderRequestKey(_orderId, _type), orderReqStr)]
242245 }
243246
244247
245248 func updateOrderIdStr (_orderIdsNewStr,_amm,_trader) = [StringEntry(traderOrderIdsKey(_amm, _trader), _orderIdsNewStr)]
246249
247250
248251 func addRemoveOrderIdList (_orderIds,_orderId,_amm,_trader,_add) = {
249252 let orderIdsNew = if (_add)
250253 then (_orderIds :+ toString(_orderId))
251254 else removeByIndex(_orderIds, valueOrErrorMessage(indexOf(_orderIds, toString(_orderId)), ("No order with id: " + toString(_orderId))))
252255 orderIdsNew
253256 }
254257
255258
256259 func addRemoveOrderId (_orderId,_amm,_trader,_add) = {
257260 let orderIds = traderAmmOrdersIds(_amm, _trader)
258261 let orderIdsNew = addRemoveOrderIdList(orderIds, _orderId, _amm, _trader, _add)
259262 let orderIdsNewStr = makeString(orderIdsNew, ",")
260263 updateOrderIdStr(orderIdsNewStr, _amm, _trader)
261264 }
262265
263266
264267 func updateTraderOrderCount (_amm,_trader,_count) = if ((0 > _count))
265268 then throw(("Invalid order count: " + toString(_count)))
266269 else [IntegerEntry(traderOrderCountKey(_amm, _trader), _count)]
267270
268271
269272 func updateLastOrderId (_lastOrderId) = [IntegerEntry(k_lastOrderId, _lastOrderId)]
270273
271274
272275 func markExecuteOrder (_orderId) = [BooleanEntry(toCompositeKey(k_executedOrders, toString(_orderId)), true)]
273276
274277
275278 func markCancelOrder (_orderId) = [BooleanEntry(toCompositeKey(k_canceledOrders, toString(_orderId)), true)]
276279
277280
278281 func getPositionIds (_amm,_trader) = {
279282 let longPositionSize = getPositionSize(_amm, _trader, LONG)
280283 let currentLongPositionId = if ((longPositionSize != 0))
281284 then getPositionId(_amm, _trader, LONG)
282285 else 0
283286 let shortPositionSize = getPositionSize(_amm, _trader, SHORT)
284287 let currentShortPositionId = if ((shortPositionSize != 0))
285288 then getPositionId(_amm, _trader, SHORT)
286289 else 0
287290 [currentLongPositionId, currentShortPositionId]
288291 }
289292
290293
291294 @Callable(i)
292295 func cleanUpStaleOrders (_amm,_trader) = {
293296 let orders = traderAmmOrdersIds(_amm, _trader)
294297 let positionIds = getPositionIds(_amm, _trader)
295298 func cleanUpOne (_acc,_orderId) = {
296299 let orderIdInt = valueOrErrorMessage(parseInt(_orderId), "Invalid order id")
297- let $t01115611351 = getOrder(orderIdInt)
298- let _x1 = $t01115611351._1
299- let _x2 = $t01115611351._2
300- let _x3 = $t01115611351._3
301- let _x4 = $t01115611351._4
302- let _type = $t01115611351._5
303- let _x5 = $t01115611351._6
304- let _x6 = $t01115611351._7
305- let _x7 = $t01115611351._8
306- let _x8 = $t01115611351._9
307- let _positionId = $t01115611351._10
308- let _x9 = $t01115611351._11
300+ let $t01135911575 = getOrder(orderIdInt)
301+ let _x1 = $t01135911575._1
302+ let _x2 = $t01135911575._2
303+ let _x3 = $t01135911575._3
304+ let _x4 = $t01135911575._4
305+ let _type = $t01135911575._5
306+ let _x5 = $t01135911575._6
307+ let _x6 = $t01135911575._7
308+ let _x7 = $t01135911575._8
309+ let _x8 = $t01135911575._9
310+ let _positionId = $t01135911575._10
311+ let _x9 = $t01135911575._11
312+ let _expiration = $t01135911575._12
309313 if (if (if (if ((_type == STOP))
310314 then true
311315 else (_type == TAKE))
312316 then (positionIds[0] != _positionId)
313317 else false)
314318 then (positionIds[1] != _positionId)
315319 else false)
316320 then {
317321 let change = markCancelOrder(orderIdInt)
318322 let newOrderList = addRemoveOrderIdList(_acc._1, orderIdInt, _amm, _trader, false)
319323 $Tuple2(newOrderList, (_acc._2 ++ change))
320324 }
321325 else _acc
322326 }
323327
324- let $t01170411779 = {
328+ let $t01192812003 = {
325329 let $l = orders
326330 let $s = size($l)
327331 let $acc0 = $Tuple2(orders, nil)
328332 func $f0_1 ($a,$i) = if (($i >= $s))
329333 then $a
330334 else cleanUpOne($a, $l[$i])
331335
332336 func $f0_2 ($a,$i) = if (($i >= $s))
333337 then $a
334338 else throw("List size exceeds 10")
335339
336340 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10)
337341 }
338- let newOrders = $t01170411779._1
339- let cancelActions = $t01170411779._2
342+ let newOrders = $t01192812003._1
343+ let cancelActions = $t01192812003._2
340344 ((cancelActions ++ updateTraderOrderCount(_amm, _trader, size(newOrders))) ++ updateOrderIdStr(makeString(newOrders, ","), _amm, _trader))
341345 }
342346
343347
344348
345349 @Callable(i)
346350 func setContext (_sender) = if ((i.caller != this))
347351 then throw("Only self-call")
348352 else [StringEntry(k_sender, _sender)]
349353
350354
351355
352356 @Callable(i)
353357 func resetContext () = if ((i.caller != this))
354358 then throw("Only self-call")
355359 else [DeleteEntry(k_sender)]
356360
357361
358362
359363 @Callable(i)
360364 func initialize (_coordinator) = if (if (initialized())
361365 then true
362366 else (i.caller != this))
363367 then throw("Unable to initialize")
364368 else [StringEntry(k_coordinatorAddress, toString(addressFromStringValue(_coordinator))), BooleanEntry(k_initialized, true)]
365369
366370
367371
368372 @Callable(i)
369-func createOrder (_amm,_type,_triggerPrice,_limitPrice,_amountIn,_leverage,_side,_refLink,_stopTriggerPrice,_stopLimitPrice,_takeTriggerPrice,_takeLimitPrice) = {
373+func createOrder (_amm,_type,_triggerPrice,_limitPrice,_amountIn,_leverage,_side,_refLink,_stopTriggerPrice,_stopLimitPrice,_takeTriggerPrice,_takeLimitPrice,_expiration) = {
370374 let _trader = toString(i.caller)
371375 let cleanUp = invoke(this, "cleanUpStaleOrders", [_amm, _trader], nil)
372376 if ((cleanUp == cleanUp))
373377 then if ((size(i.payments) > 1))
374378 then throw("Invalid createOrder parameters: invalid payment count")
375379 else {
376- let $t01427514527 = if ((size(i.payments) == 1))
380+ let $t01452114773 = if ((size(i.payments) == 1))
377381 then $Tuple2(toBase58String(valueOrErrorMessage(i.payments[0].assetId, "Invalid asset id")), i.payments[0].amount)
378382 else $Tuple2("", 0)
379- let paymentAssetId = $t01427514527._1
380- let paymentAmount = $t01427514527._2
381- let doCall = invoke(this, "internalCreateOrder", [_trader, _amm, _type, _triggerPrice, _limitPrice, _amountIn, _leverage, _side, _refLink, paymentAssetId, paymentAmount], nil)
383+ let paymentAssetId = $t01452114773._1
384+ let paymentAmount = $t01452114773._2
385+ let doCall = invoke(this, "internalCreateOrder", [_trader, _amm, _type, _triggerPrice, _limitPrice, _amountIn, _leverage, _side, _refLink, paymentAssetId, paymentAmount, _expiration], nil)
382386 if ((doCall == doCall))
383387 then {
384388 let orderId = match doCall {
385389 case t: Int =>
386390 t
387391 case _ =>
388392 throw("Invalid ID of created order")
389393 }
390394 if ((_type == LIMIT))
391395 then {
392396 let makeStop = if ((_stopTriggerPrice > 0))
393397 then {
394398 let doMakeStop = invoke(this, "internalCreateOrderRequest", [_trader, _amm, orderId, STOP, _stopTriggerPrice, _stopLimitPrice], nil)
395399 if ((doMakeStop == doMakeStop))
396400 then nil
397401 else throw("Strict value is not equal to itself.")
398402 }
399403 else nil
400404 let makeTake = if ((_takeTriggerPrice > 0))
401405 then {
402406 let doMakeTake = invoke(this, "internalCreateOrderRequest", [_trader, _amm, orderId, TAKE, _takeTriggerPrice, _takeLimitPrice], nil)
403407 if ((doMakeTake == doMakeTake))
404408 then nil
405409 else throw("Strict value is not equal to itself.")
406410 }
407411 else nil
408412 (makeStop ++ makeTake)
409413 }
410414 else nil
411415 }
412416 else throw("Strict value is not equal to itself.")
413417 }
414418 else throw("Strict value is not equal to itself.")
415419 }
416420
417421
418422
419423 @Callable(i)
420424 func increasePositionWithStopLoss (_amm,_direction,_leverage,_minBaseAssetAmount,_refLink,_stopTriggerPrice,_stopLimitPrice,_takeTriggerPrice,_takeLimitPrice) = {
421425 let _trader = toString(i.caller)
422426 let cleanUp = invoke(this, "cleanUpStaleOrders", [_amm, _trader], nil)
423427 if ((cleanUp == cleanUp))
424428 then if (if (!(initialized()))
425429 then true
426430 else !(isWhitelist(_amm)))
427431 then throw("Invalid increasePositionWithStopLoss parameters")
428432 else {
429433 let positionSize = getPositionSize(_amm, _trader, _direction)
430434 if ((positionSize != 0))
431435 then throw("Invalid increasePositionWithStopLoss parameters: only new position")
432436 else {
433437 let doSetContext = invoke(this, "setContext", [_trader], nil)
434438 if ((doSetContext == doSetContext))
435439 then {
436440 let doClosePosition = invoke(addressFromStringValue(_amm), "increasePosition", [_direction, _leverage, _minBaseAssetAmount, _refLink], i.payments)
437441 if ((doClosePosition == doClosePosition))
438442 then {
439443 let doResetContext = invoke(this, "resetContext", nil, nil)
440444 if ((doResetContext == doResetContext))
441445 then {
442446 let openedPositionSize = getPositionSize(_amm, _trader, _direction)
443447 if ((openedPositionSize == openedPositionSize))
444448 then {
445449 let amountIn = abs(openedPositionSize)
446450 let stopLossSide = if ((0 > openedPositionSize))
447451 then LONG
448452 else SHORT
449453 let doCreateStopOrder = if ((_stopTriggerPrice > 0))
450454 then {
451- let doCreateStopOrder = invoke(this, "internalCreateOrder", [_trader, _amm, STOP, _stopTriggerPrice, _stopLimitPrice, amountIn, 0, stopLossSide, _refLink, "", 0], nil)
455+ let doCreateStopOrder = invoke(this, "internalCreateOrder", [_trader, _amm, STOP, _stopTriggerPrice, _stopLimitPrice, amountIn, 0, stopLossSide, _refLink, "", 0, 0], nil)
452456 if ((doCreateStopOrder == doCreateStopOrder))
453457 then nil
454458 else throw("Strict value is not equal to itself.")
455459 }
456460 else nil
457461 if ((doCreateStopOrder == doCreateStopOrder))
458462 then {
459463 let doCreateTakeOrder = if ((_takeTriggerPrice > 0))
460464 then {
461- let doCreateTakeOrder = invoke(this, "internalCreateOrder", [_trader, _amm, TAKE, _takeTriggerPrice, _takeLimitPrice, amountIn, 0, stopLossSide, _refLink, "", 0], nil)
465+ let doCreateTakeOrder = invoke(this, "internalCreateOrder", [_trader, _amm, TAKE, _takeTriggerPrice, _takeLimitPrice, amountIn, 0, stopLossSide, _refLink, "", 0, 0], nil)
462466 if ((doCreateTakeOrder == doCreateTakeOrder))
463467 then nil
464468 else throw("Strict value is not equal to itself.")
465469 }
466470 else nil
467471 if ((doCreateTakeOrder == doCreateTakeOrder))
468472 then nil
469473 else throw("Strict value is not equal to itself.")
470474 }
471475 else throw("Strict value is not equal to itself.")
472476 }
473477 else throw("Strict value is not equal to itself.")
474478 }
475479 else throw("Strict value is not equal to itself.")
476480 }
477481 else throw("Strict value is not equal to itself.")
478482 }
479483 else throw("Strict value is not equal to itself.")
480484 }
481485 }
482486 else throw("Strict value is not equal to itself.")
483487 }
484488
485489
486490
487491 @Callable(i)
488492 func internalMarkOrderExecuted (_amm,_trader,_orderId) = if (if (if (!(initialized()))
489493 then true
490494 else !(isWhitelist(_amm)))
491495 then true
492496 else !((i.caller == this)))
493497 then throw("Invalid internalMarkOrderExecuted parameters")
494498 else {
495499 let newTraderOrderCount = (getTraderOrderCount(_amm, _trader) - 1)
496500 ((updateTraderOrderCount(_amm, _trader, newTraderOrderCount) ++ addRemoveOrderId(_orderId, _amm, _trader, false)) ++ markExecuteOrder(_orderId))
497501 }
498502
499503
500504
501505 @Callable(i)
502506 func internalCreateOrderRequest (_trader,_amm,_orderId,_type,_triggerPrice,_limitPrice) = if (if (if (if (if (!(initialized()))
503507 then true
504508 else !(isWhitelist(_amm)))
505509 then true
506510 else (0 >= _triggerPrice))
507511 then true
508512 else (0 > _limitPrice))
509513 then true
510514 else !((i.caller == this)))
511515 then throw("Invalid internalCreateOrderRequest parameters")
512516 else saveOrderRequest(_orderId, _amm, _trader, _type, _triggerPrice, _limitPrice)
513517
514518
515519
516520 @Callable(i)
517-func internalCreateOrder (_trader,_amm,_type,_triggerPrice,_limitPrice,_amountIn,_leverage,_side,_refLink,_paymentAssetId,_paymentAmount) = {
518- let x1 = toString(!(initialized()))
519- let x2 = toString(!(isWhitelist(_amm)))
520- let x3 = toString((0 >= _triggerPrice))
521- let x4 = toString((0 > _limitPrice))
522- let x5 = toString((0 >= _amountIn))
523- let x6 = toString((0 > _leverage))
524- let x7 = toString(!(if ((_side == LONG))
521+func internalCreateOrder (_trader,_amm,_type,_triggerPrice,_limitPrice,_amountIn,_leverage,_side,_refLink,_paymentAssetId,_paymentAmount,_expiration) = if (if (if (if (if (if (if (if (if (if (!(initialized()))
522+ then true
523+ else !(isWhitelist(_amm)))
524+ then true
525+ else (0 >= _triggerPrice))
526+ then true
527+ else (0 > _limitPrice))
528+ then true
529+ else (0 >= _amountIn))
530+ then true
531+ else (0 > _leverage))
532+ then true
533+ else !(if ((_side == LONG))
525534 then true
526535 else (_side == SHORT)))
527- let x8 = toString(!(if (if ((_type == STOP))
536+ then true
537+ else !(if (if ((_type == STOP))
528538 then true
529539 else (_type == TAKE))
530540 then true
531541 else (_type == LIMIT)))
532- let x9 = toString(!((i.caller == this)))
533- let all = makeString([x1, x2, x3, x4, x5, x6, x7, x8, x9], ",")
534- if (if (if (if (if (if (if (if (if (!(initialized()))
535- then true
536- else !(isWhitelist(_amm)))
537- then true
538- else (0 >= _triggerPrice))
539- then true
540- else (0 > _limitPrice))
541- then true
542- else (0 >= _amountIn))
543- then true
544- else (0 > _leverage))
545- then true
546- else !(if ((_side == LONG))
542+ then true
543+ else !((i.caller == this)))
544+ then true
545+ else (0 > _expiration))
546+ then throw("Invalid internalCreateOrder parameters")
547+ else {
548+ let orderId = (currentOrderId() + 1)
549+ let positionDirection = getPositionDirection(_side, _type)
550+ let newTraderOrderCount = (getTraderOrderCount(_amm, _trader) + 1)
551+ let positionSize = getPositionSize(_amm, _trader, positionDirection)
552+ let _direction = if (if (if ((positionSize == 0))
547553 then true
548- else (_side == SHORT)))
549- then true
550- else !(if (if ((_type == STOP))
554+ else if ((positionSize > 0))
555+ then (_side == LONG)
556+ else false)
551557 then true
552- else (_type == TAKE))
553- then true
554- else (_type == LIMIT)))
555- then true
556- else !((i.caller == this)))
557- then throw(("Invalid internalCreateOrder parameters " + all))
558- else {
559- let orderId = (currentOrderId() + 1)
560- let positionDirection = getPositionDirection(_side, _type)
561- let newTraderOrderCount = (getTraderOrderCount(_amm, _trader) + 1)
562- let positionSize = getPositionSize(_amm, _trader, positionDirection)
563- let _direction = if (if (if ((positionSize == 0))
558+ else if ((0 > positionSize))
559+ then (_side == SHORT)
560+ else false)
561+ then INCREASE
562+ else DECREASE
563+ if (if ((positionSize == 0))
564+ then if ((_type == STOP))
564565 then true
565- else if ((positionSize > 0))
566- then (_side == LONG)
567- else false)
568- then true
569- else if ((0 > positionSize))
570- then (_side == SHORT)
571- else false)
572- then INCREASE
573- else DECREASE
574- if (if ((positionSize == 0))
575- then if ((_type == STOP))
576- then true
577- else (_type == TAKE)
578- else false)
579- then throw("Can not create STOP/TAKE order: no position")
580- else {
581- let usdnPayment = if ((_direction == INCREASE))
582- then if (if ((_paymentAssetId != toBase58String(quoteAsset())))
566+ else (_type == TAKE)
567+ else false)
568+ then throw("Can not create STOP/TAKE order: no position")
569+ else {
570+ let usdnPayment = if ((_direction == INCREASE))
571+ then if (if ((_paymentAssetId != toBase58String(quoteAsset())))
572+ then true
573+ else (_paymentAmount != _amountIn))
574+ then throw("Invalid createLimitOrder parameters: invalid payment")
575+ else {
576+ let stake = invoke(managerAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), _paymentAmount)])
577+ if ((stake == stake))
578+ then _paymentAmount
579+ else throw("Strict value is not equal to itself.")
580+ }
581+ else 0
582+ if ((usdnPayment == usdnPayment))
583+ then {
584+ let positionId = if ((positionSize != 0))
585+ then getPositionId(_amm, _trader, positionDirection)
586+ else 0
587+ if (if (if ((_type == STOP))
583588 then true
584- else (_paymentAmount != _amountIn))
585- then throw("Invalid createLimitOrder parameters: invalid payment")
586- else {
587- let stake = invoke(managerAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), _paymentAmount)])
588- if ((stake == stake))
589- then _paymentAmount
590- else throw("Strict value is not equal to itself.")
591- }
592- else 0
593- if ((usdnPayment == usdnPayment))
594- then {
595- let positionId = if ((positionSize != 0))
596- then getPositionId(_amm, _trader, positionDirection)
597- else 0
598- if (if (if ((_type == STOP))
599- then true
600- else (_type == TAKE))
601- then (positionId == 0)
602- else false)
603- then throw("STOP and TAKE order should be assigned to position with id != 0")
604- else if ((newTraderOrderCount > MAX_TRADER_ORDERS_PER_AMM))
605- then throw("Invalid createLimitOrder parameters: order count")
606- else {
607- let changeSet = (((saveOrder(orderId, _amm, _trader, _amountIn, _leverage, _type, _triggerPrice, usdnPayment, _side, _refLink, positionId, _limitPrice) ++ addRemoveOrderId(orderId, _amm, _trader, true)) ++ updateTraderOrderCount(_amm, _trader, newTraderOrderCount)) ++ updateLastOrderId(orderId))
608- $Tuple2(changeSet, orderId)
609- }
610- }
611- else throw("Strict value is not equal to itself.")
612- }
613- }
614- }
589+ else (_type == TAKE))
590+ then (positionId == 0)
591+ else false)
592+ then throw("STOP and TAKE order should be assigned to position with id != 0")
593+ else if ((newTraderOrderCount > MAX_TRADER_ORDERS_PER_AMM))
594+ then throw("Invalid createLimitOrder parameters: order count")
595+ else {
596+ let changeSet = (((saveOrder(orderId, _amm, _trader, _amountIn, _leverage, _type, _triggerPrice, usdnPayment, _side, _refLink, positionId, _limitPrice, _expiration) ++ addRemoveOrderId(orderId, _amm, _trader, true)) ++ updateTraderOrderCount(_amm, _trader, newTraderOrderCount)) ++ updateLastOrderId(orderId))
597+ $Tuple2(changeSet, orderId)
598+ }
599+ }
600+ else throw("Strict value is not equal to itself.")
601+ }
602+ }
615603
616604
617605
618606 @Callable(i)
619607 func cancelOrder (_orderId) = {
620- let $t02378624005 = getOrder(_orderId)
621- let _amm = $t02378624005._1
622- let _trader = $t02378624005._2
623- let _amountIn = $t02378624005._3
624- let _leverage = $t02378624005._4
625- let _type = $t02378624005._5
626- let _triggerPrice = $t02378624005._6
627- let _amountUsdn = $t02378624005._7
628- let _side = $t02378624005._8
629- let _refLink = $t02378624005._9
630- let _positionId = $t02378624005._10
631- let _limitPrice = $t02378624005._11
608+ let $t02383724056 = getOrder(_orderId)
609+ let _amm = $t02383724056._1
610+ let _trader = $t02383724056._2
611+ let _amountIn = $t02383724056._3
612+ let _leverage = $t02383724056._4
613+ let _type = $t02383724056._5
614+ let _triggerPrice = $t02383724056._6
615+ let _amountUsdn = $t02383724056._7
616+ let _side = $t02383724056._8
617+ let _refLink = $t02383724056._9
618+ let _positionId = $t02383724056._10
619+ let _limitPrice = $t02383724056._11
632620 if (if (if (!(initialized()))
633621 then true
634622 else !(isValid(_orderId)))
635623 then true
636624 else !((toString(i.caller) == _trader)))
637625 then throw("Invalid cancelOrder parameters")
638626 else {
639627 let cleanUp = invoke(this, "cleanUpStaleOrders", [_amm, _trader], nil)
640628 if ((cleanUp == cleanUp))
641629 then {
642630 let newTraderOrderCount = (getTraderOrderCount(_amm, _trader) - 1)
643631 let withdraw = if ((_amountUsdn > 0))
644632 then {
645633 let unstake = invoke(managerAddress(), "withdraw", [toBase58String(quoteAsset()), _amountUsdn], nil)
646634 if ((unstake == unstake))
647635 then nil
648636 else throw("Strict value is not equal to itself.")
649637 }
650638 else nil
651639 if ((withdraw == withdraw))
652640 then (((markCancelOrder(_orderId) ++ addRemoveOrderId(_orderId, _amm, _trader, false)) ++ updateTraderOrderCount(_amm, _trader, newTraderOrderCount)) ++ (if ((_amountUsdn > 0))
653641 then [ScriptTransfer(i.caller, _amountUsdn, quoteAsset())]
654642 else nil))
655643 else throw("Strict value is not equal to itself.")
656644 }
657645 else throw("Strict value is not equal to itself.")
658646 }
659647 }
660648
661649
662650
663651 @Callable(i)
664652 func executeOrder (_orderId) = {
665- let $t02520325422 = getOrder(_orderId)
666- let _amm = $t02520325422._1
667- let _trader = $t02520325422._2
668- let _amountIn = $t02520325422._3
669- let _leverage = $t02520325422._4
670- let _type = $t02520325422._5
671- let _triggerPrice = $t02520325422._6
672- let _amountUsdn = $t02520325422._7
673- let _side = $t02520325422._8
674- let _refLink = $t02520325422._9
675- let _positionId = $t02520325422._10
676- let _limitPrice = $t02520325422._11
653+ let $t02525425473 = getOrder(_orderId)
654+ let _amm = $t02525425473._1
655+ let _trader = $t02525425473._2
656+ let _amountIn = $t02525425473._3
657+ let _leverage = $t02525425473._4
658+ let _type = $t02525425473._5
659+ let _triggerPrice = $t02525425473._6
660+ let _amountUsdn = $t02525425473._7
661+ let _side = $t02525425473._8
662+ let _refLink = $t02525425473._9
663+ let _positionId = $t02525425473._10
664+ let _limitPrice = $t02525425473._11
677665 let cleanUp = invoke(this, "cleanUpStaleOrders", [_amm, _trader], nil)
678666 if ((cleanUp == cleanUp))
679667 then {
680668 let positionDirection = getPositionDirection(_side, _type)
681669 if (if (!(initialized()))
682670 then true
683671 else !(isValid(_orderId)))
684672 then throw("Invalid executeOrder parameters")
685673 else {
686674 let positionSize = getPositionSize(_amm, _trader, positionDirection)
687675 if ((positionSize == positionSize))
688676 then {
689677 let currentPositionId = if ((positionSize != 0))
690678 then getPositionId(_amm, _trader, positionDirection)
691679 else 0
692- let $t02592929307 = if ((_type == STOP))
680+ let $t02598029358 = if ((_type == STOP))
693681 then {
694682 let _positionDirection = if ((positionSize > 0))
695683 then LONG
696684 else if ((0 > positionSize))
697685 then SHORT
698686 else throw("Can not execute STOP order: no open position")
699687 let marketPrice = getMarketPrice(_amm)
700688 let isExecutable = if ((_side == _positionDirection))
701689 then throw("Can not execute STOP order: reduce only")
702690 else if ((currentPositionId != _positionId))
703691 then throw("Can not execute STOP order: position closed")
704692 else if ((_positionDirection == LONG))
705693 then (_triggerPrice >= marketPrice)
706694 else (marketPrice >= _triggerPrice)
707695 if (isExecutable)
708696 then $Tuple3("closePosition", [minv(_amountIn, abs(positionSize)), positionDirection, muld(_limitPrice, abs(positionSize)), false], nil)
709697 else throw("Can not execute STOP order: triggerPrice mismatch")
710698 }
711699 else if ((_type == TAKE))
712700 then {
713701 let _positionDirection = if ((positionSize > 0))
714702 then LONG
715703 else if ((0 > positionSize))
716704 then SHORT
717705 else throw("Can not execute STOP order: no open position")
718706 let marketPrice = getMarketPrice(_amm)
719707 let isExecutable = if ((_side == _positionDirection))
720708 then throw("Can not execute TAKE order: reduce only")
721709 else if ((currentPositionId != _positionId))
722710 then throw(((("Can not execute TAKE order: position closed " + toString(currentPositionId)) + "!=") + toString(_positionId)))
723711 else if ((_positionDirection == LONG))
724712 then (marketPrice >= _triggerPrice)
725713 else (_triggerPrice >= marketPrice)
726714 if (isExecutable)
727715 then $Tuple3("closePosition", [minv(_amountIn, abs(positionSize)), positionDirection, muld(_limitPrice, abs(positionSize)), false], nil)
728716 else throw("Can not execute TAKE order: triggerPrice mismatch")
729717 }
730718 else if ((_type == LIMIT))
731719 then {
732720 let marketPrice = getMarketPrice(_amm)
733721 let spread = if ((_limitPrice == 0))
734722 then getSpread(_triggerPrice)
735723 else abs((_triggerPrice - _limitPrice))
736724 let isExecutable = if ((marketPrice >= (_triggerPrice - spread)))
737725 then ((_triggerPrice + spread) >= marketPrice)
738726 else false
739727 if (isExecutable)
740728 then {
741729 let amountInWithFee = (_amountUsdn - muld(_amountUsdn, getFee(_amm, _trader)))
742730 $Tuple3("increasePosition", [_side, _leverage, if ((_limitPrice == 0))
743731 then 0
744732 else divd(amountInWithFee, _limitPrice), _refLink], [AttachedPayment(quoteAsset(), _amountUsdn)])
745733 }
746734 else throw("Can not execute LIMIT order: triggerPrice mismatch")
747735 }
748736 else throw(("Invalid order type: " + toString(_type)))
749- let method = $t02592929307._1
750- let args = $t02592929307._2
751- let payments = $t02592929307._3
737+ let method = $t02598029358._1
738+ let args = $t02598029358._2
739+ let payments = $t02598029358._3
752740 let withdraw = if ((size(payments) == 1))
753741 then {
754742 let unstake = invoke(managerAddress(), "withdraw", [toBase58String(quoteAsset()), payments[0].amount], nil)
755743 if ((unstake == unstake))
756744 then nil
757745 else throw("Strict value is not equal to itself.")
758746 }
759747 else nil
760748 if ((withdraw == withdraw))
761749 then {
762750 let doSetContext = invoke(this, "setContext", [_trader], nil)
763751 if ((doSetContext == doSetContext))
764752 then {
765753 let doClosePosition = invoke(addressFromStringValue(_amm), method, args, payments)
766754 if ((doClosePosition == doClosePosition))
767755 then {
768756 let doResetContext = invoke(this, "resetContext", nil, nil)
769757 if ((doResetContext == doResetContext))
770758 then {
771759 let executeOrderRequest = if ((_type == LIMIT))
772760 then {
773761 let newPositionSize = getPositionSize(_amm, _trader, positionDirection)
774762 if ((newPositionSize == newPositionSize))
775763 then {
776764 let newPositionId = getPositionId(_amm, _trader, positionDirection)
777765 if ((newPositionId == newPositionId))
778766 then {
779767 let positionSizeDelta = (newPositionSize - positionSize)
780768 let closeOrderSide = if ((newPositionSize > 0))
781769 then SHORT
782770 else LONG
783771 let makeTakeOrder = if (haveOrderRequest(_orderId, TAKE))
784772 then {
785- let $t03026930468 = getOrderRequest(_orderId, TAKE)
786- let newOrderId = $t03026930468._1
787- let newAmm = $t03026930468._2
788- let newTrader = $t03026930468._3
789- let newType = $t03026930468._4
790- let newTriggerPrice = $t03026930468._5
791- let newLimitPrice = $t03026930468._6
792- let doCall = invoke(this, "internalCreateOrder", [newTrader, newAmm, newType, newTriggerPrice, newLimitPrice, positionSizeDelta, 0, closeOrderSide, "", "", 0], nil)
773+ let $t03032030519 = getOrderRequest(_orderId, TAKE)
774+ let newOrderId = $t03032030519._1
775+ let newAmm = $t03032030519._2
776+ let newTrader = $t03032030519._3
777+ let newType = $t03032030519._4
778+ let newTriggerPrice = $t03032030519._5
779+ let newLimitPrice = $t03032030519._6
780+ let doCall = invoke(this, "internalCreateOrder", [newTrader, newAmm, newType, newTriggerPrice, newLimitPrice, positionSizeDelta, 0, closeOrderSide, "", "", 0, 0], nil)
793781 if ((doCall == doCall))
794782 then nil
795783 else throw("Strict value is not equal to itself.")
796784 }
797785 else nil
798786 if ((makeTakeOrder == makeTakeOrder))
799787 then {
800788 let makeStopOrder = if (haveOrderRequest(_orderId, STOP))
801789 then {
802- let $t03102431223 = getOrderRequest(_orderId, STOP)
803- let newOrderId = $t03102431223._1
804- let newAmm = $t03102431223._2
805- let newTrader = $t03102431223._3
806- let newType = $t03102431223._4
807- let newTriggerPrice = $t03102431223._5
808- let newLimitPrice = $t03102431223._6
809- let doCall = invoke(this, "internalCreateOrder", [newTrader, newAmm, newType, newTriggerPrice, newLimitPrice, positionSizeDelta, 0, closeOrderSide, "", "", 0], nil)
790+ let $t03109231291 = getOrderRequest(_orderId, STOP)
791+ let newOrderId = $t03109231291._1
792+ let newAmm = $t03109231291._2
793+ let newTrader = $t03109231291._3
794+ let newType = $t03109231291._4
795+ let newTriggerPrice = $t03109231291._5
796+ let newLimitPrice = $t03109231291._6
797+ let doCall = invoke(this, "internalCreateOrder", [newTrader, newAmm, newType, newTriggerPrice, newLimitPrice, positionSizeDelta, 0, closeOrderSide, "", "", 0, 0], nil)
810798 if ((doCall == doCall))
811799 then nil
812800 else throw("Strict value is not equal to itself.")
813801 }
814802 else nil
815803 if ((makeStopOrder == makeStopOrder))
816804 then (makeTakeOrder ++ makeStopOrder)
817805 else throw("Strict value is not equal to itself.")
818806 }
819807 else throw("Strict value is not equal to itself.")
820808 }
821809 else throw("Strict value is not equal to itself.")
822810 }
823811 else throw("Strict value is not equal to itself.")
824812 }
825813 else nil
826814 if ((executeOrderRequest == executeOrderRequest))
827815 then {
828816 let doMarkOrderExecuted = invoke(this, "internalMarkOrderExecuted", [_amm, _trader, _orderId], nil)
829817 if ((doMarkOrderExecuted == doMarkOrderExecuted))
830818 then nil
831819 else throw("Strict value is not equal to itself.")
832820 }
833821 else throw("Strict value is not equal to itself.")
834822 }
835823 else throw("Strict value is not equal to itself.")
836824 }
837825 else throw("Strict value is not equal to itself.")
838826 }
839827 else throw("Strict value is not equal to itself.")
840828 }
841829 else throw("Strict value is not equal to itself.")
842830 }
843831 else throw("Strict value is not equal to itself.")
844832 }
845833 }
846834 else throw("Strict value is not equal to itself.")
847835 }
848836
849837
850838
851839 @Callable(i)
852840 func view_canExecuteOrder (_orderId) = {
853841 let s = invoke(this, "executeOrder", [_orderId], nil)
854842 if ((s == s))
855843 then throw("Success")
856844 else throw("Strict value is not equal to itself.")
857845 }
858846
859847
860848 @Verifier(tx)
861849 func verify () = {
862850 let coordinatorStr = getString(this, k_coordinatorAddress)
863851 if (isDefined(coordinatorStr))
864852 then {
865853 let admin = getString(addressFromStringValue(value(coordinatorStr)), k_admin_address)
866854 if (isDefined(admin))
867855 then valueOrElse(getBoolean(addressFromStringValue(value(admin)), ((("status_" + toString(this)) + "_") + toBase58String(tx.id))), false)
868856 else throw("unable to verify: admin not set in coordinator")
869857 }
870858 else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
871859 }
872860

github/deemru/w8io/169f3d6 
152.53 ms