tx · 9LcQaLNXkXYqtYStNyvvREGvA84mY4gSubqhHMwgY85V 3MzGPAZokuNfqjMuP7yDXFATZjhjtEP5UCa: -0.03700000 Waves 2023.03.23 21:29 [2503003] smart account 3MzGPAZokuNfqjMuP7yDXFATZjhjtEP5UCa > SELF 0.00000000 Waves
{ "type": 13, "id": "9LcQaLNXkXYqtYStNyvvREGvA84mY4gSubqhHMwgY85V", "fee": 3700000, "feeAssetId": null, "timestamp": 1679596205081, "version": 2, "chainId": 84, "sender": "3MzGPAZokuNfqjMuP7yDXFATZjhjtEP5UCa", "senderPublicKey": "4EBKd2zSCvpiSLeyovT5FUuMvGpi6oxdBAbvQybSYi6p", "proofs": [ "3rQZFkvsTM34TshY89Sion6DnnqAkxstgMUKBAamMXxTZ2dHADMmxc2gXmPfKeJviuXPMd3MdA918Hd7GrjKYbHo" ], "script": "base64:BgJgCAISBAoCCAgSAwoBCBIAEgMKAQgSDgoMCAEBAQEBAQgBAQEBEgsKCQgBAQEIAQEBARIFCgMICAESCAoGCAgBAQEBEg0KCwgIAQEBAQEBCAgBEgMKAQESAwoBARIDCgEBQgAUa19jb29yZGluYXRvckFkZHJlc3MCFGtfY29vcmRpbmF0b3JBZGRyZXNzAA9rX2FkbWluX2FkZHJlc3MCD2tfYWRtaW5fYWRkcmVzcwANa19xdW90ZV9hc3NldAINa19xdW90ZV9hc3NldAAFa19hbW0CBWtfYW1tABFrX21hbmFnZXJfYWRkcmVzcwIRa19tYW5hZ2VyX2FkZHJlc3MAEmtfcG9zaXRpb25TZXF1ZW5jZQISa19wb3NpdGlvblNlcXVlbmNlAA5rX3Bvc2l0aW9uU2l6ZQIOa19wb3NpdGlvblNpemUAEGtfZXhlY3V0ZWRPcmRlcnMCEGtfZXhlY3V0ZWRPcmRlcnMAEGtfY2FuY2VsZWRPcmRlcnMCEGtfY2FuY2VsZWRPcmRlcnMAB2tfb3JkZXICB2tfb3JkZXIADmtfb3JkZXJSZXF1ZXN0AgprX29yZGVyUmVxAA1rX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VzcwkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgECdHgBBnZlcmlmeQAEDmNvb3JkaW5hdG9yU3RyCQCdCAIFBHRoaXMFFGtfY29vcmRpbmF0b3JBZGRyZXNzAwkBCWlzRGVmaW5lZAEFDmNvb3JkaW5hdG9yU3RyBAVhZG1pbgkAnQgCCQERQGV4dHJOYXRpdmUoMTA2MikBCQEFdmFsdWUBBQ5jb29yZGluYXRvclN0cgUPa19hZG1pbl9hZGRyZXNzAwkBCWlzRGVmaW5lZAEFBWFkbWluCQELdmFsdWVPckVsc2UCCQCbCAIJARFAZXh0ck5hdGl2ZSgxMDYyKQEJAQV2YWx1ZQEFBWFkbWluCQCsAgIJAKwCAgkArAICAgdzdGF0dXNfCQClCAEFBHRoaXMCAV8JANgEAQgFAnR4AmlkBwkAAgECLnVuYWJsZSB0byB2ZXJpZnk6IGFkbWluIG5vdCBzZXQgaW4gY29vcmRpbmF0b3IJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXk4/OYT", "height": 2503003, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: ED8H92iHUuNVXbc1JqPsV7FJVe87wKAUMxhtLrbD1XXU Next: 8BvDNGLK6j3Up8oKjGFsGXPwf8869XzRh48XkMdCuD2Z Diff:
Old | New | Differences | |
---|---|---|---|
514 | 514 | ||
515 | 515 | ||
516 | 516 | @Callable(i) | |
517 | - | func internalCreateOrder (_trader,_amm,_type,_triggerPrice,_limitPrice,_amountIn,_leverage,_side,_refLink,_paymentAssetId,_paymentAmount) = if (if (if (if (if (if (if (if (if (!(initialized())) | |
518 | - | then true | |
519 | - | else !(isWhitelist(_amm))) | |
520 | - | then true | |
521 | - | else (0 >= _triggerPrice)) | |
522 | - | then true | |
523 | - | else (0 > _limitPrice)) | |
524 | - | then true | |
525 | - | else (0 >= _amountIn)) | |
526 | - | then true | |
527 | - | else (0 > _leverage)) | |
528 | - | then true | |
529 | - | else !(if ((_side == LONG)) | |
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)) | |
530 | 525 | then true | |
531 | 526 | else (_side == SHORT))) | |
532 | - | then true | |
533 | - | else !(if (if ((_type == STOP)) | |
527 | + | let x8 = toString(!(if (if ((_type == STOP)) | |
534 | 528 | then true | |
535 | 529 | else (_type == TAKE)) | |
536 | 530 | then true | |
537 | 531 | else (_type == LIMIT))) | |
538 | - | then true | |
539 | - | else !((i.caller == this))) | |
540 | - | then throw("Invalid internalCreateOrder parameters") | |
541 | - | else { | |
542 | - | let orderId = (currentOrderId() + 1) | |
543 | - | let positionDirection = getPositionDirection(_side, _type) | |
544 | - | let newTraderOrderCount = (getTraderOrderCount(_amm, _trader) + 1) | |
545 | - | let positionSize = getPositionSize(_amm, _trader, positionDirection) | |
546 | - | let _direction = if (if (if ((positionSize == 0)) | |
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)) | |
547 | 547 | then true | |
548 | - | else if ((positionSize > 0)) | |
549 | - | then (_side == LONG) | |
548 | + | else (_side == SHORT))) | |
549 | + | then true | |
550 | + | else !(if (if ((_type == STOP)) | |
551 | + | 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)) | |
564 | + | 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) | |
550 | 578 | else false) | |
551 | - | then true | |
552 | - | else if ((0 > positionSize)) | |
553 | - | then (_side == SHORT) | |
554 | - | else false) | |
555 | - | then INCREASE | |
556 | - | else DECREASE | |
557 | - | if (if ((positionSize == 0)) | |
558 | - | then if ((_type == STOP)) | |
559 | - | then true | |
560 | - | else (_type == TAKE) | |
561 | - | else false) | |
562 | - | then throw("Can not create STOP/TAKE order: no position") | |
563 | - | else { | |
564 | - | let usdnPayment = if ((_direction == INCREASE)) | |
565 | - | then if (if ((_paymentAssetId != toBase58String(quoteAsset()))) | |
566 | - | then true | |
567 | - | else (_paymentAmount != _amountIn)) | |
568 | - | then throw("Invalid createLimitOrder parameters: invalid payment") | |
569 | - | else { | |
570 | - | let stake = invoke(managerAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), _paymentAmount)]) | |
571 | - | if ((stake == stake)) | |
572 | - | then _paymentAmount | |
573 | - | else throw("Strict value is not equal to itself.") | |
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()))) | |
583 | + | 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 | + | } | |
574 | 610 | } | |
575 | - | else 0 | |
576 | - | if ((usdnPayment == usdnPayment)) | |
577 | - | then { | |
578 | - | let positionId = if ((positionSize != 0)) | |
579 | - | then getPositionId(_amm, _trader, positionDirection) | |
580 | - | else 0 | |
581 | - | if (if (if ((_type == STOP)) | |
582 | - | then true | |
583 | - | else (_type == TAKE)) | |
584 | - | then (positionId == 0) | |
585 | - | else false) | |
586 | - | then throw("STOP and TAKE order should be assigned to position with id != 0") | |
587 | - | else if ((newTraderOrderCount > MAX_TRADER_ORDERS_PER_AMM)) | |
588 | - | then throw("Invalid createLimitOrder parameters: order count") | |
589 | - | else { | |
590 | - | 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)) | |
591 | - | $Tuple2(changeSet, orderId) | |
592 | - | } | |
593 | - | } | |
594 | - | else throw("Strict value is not equal to itself.") | |
595 | - | } | |
596 | - | } | |
611 | + | else throw("Strict value is not equal to itself.") | |
612 | + | } | |
613 | + | } | |
614 | + | } | |
597 | 615 | ||
598 | 616 | ||
599 | 617 | ||
600 | 618 | @Callable(i) | |
601 | 619 | func cancelOrder (_orderId) = { | |
602 | - | let $ | |
603 | - | let _amm = $ | |
604 | - | let _trader = $ | |
605 | - | let _amountIn = $ | |
606 | - | let _leverage = $ | |
607 | - | let _type = $ | |
608 | - | let _triggerPrice = $ | |
609 | - | let _amountUsdn = $ | |
610 | - | let _side = $ | |
611 | - | let _refLink = $ | |
612 | - | let _positionId = $ | |
613 | - | let _limitPrice = $ | |
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 | |
614 | 632 | if (if (if (!(initialized())) | |
615 | 633 | then true | |
616 | 634 | else !(isValid(_orderId))) | |
644 | 662 | ||
645 | 663 | @Callable(i) | |
646 | 664 | func executeOrder (_orderId) = { | |
647 | - | let $ | |
648 | - | let _amm = $ | |
649 | - | let _trader = $ | |
650 | - | let _amountIn = $ | |
651 | - | let _leverage = $ | |
652 | - | let _type = $ | |
653 | - | let _triggerPrice = $ | |
654 | - | let _amountUsdn = $ | |
655 | - | let _side = $ | |
656 | - | let _refLink = $ | |
657 | - | let _positionId = $ | |
658 | - | let _limitPrice = $ | |
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 | |
659 | 677 | let cleanUp = invoke(this, "cleanUpStaleOrders", [_amm, _trader], nil) | |
660 | 678 | if ((cleanUp == cleanUp)) | |
661 | 679 | then { | |
671 | 689 | let currentPositionId = if ((positionSize != 0)) | |
672 | 690 | then getPositionId(_amm, _trader, positionDirection) | |
673 | 691 | else 0 | |
674 | - | let $ | |
692 | + | let $t02592929307 = if ((_type == STOP)) | |
675 | 693 | then { | |
676 | 694 | let _positionDirection = if ((positionSize > 0)) | |
677 | 695 | then LONG | |
728 | 746 | else throw("Can not execute LIMIT order: triggerPrice mismatch") | |
729 | 747 | } | |
730 | 748 | else throw(("Invalid order type: " + toString(_type))) | |
731 | - | let method = $ | |
732 | - | let args = $ | |
733 | - | let payments = $ | |
749 | + | let method = $t02592929307._1 | |
750 | + | let args = $t02592929307._2 | |
751 | + | let payments = $t02592929307._3 | |
734 | 752 | let withdraw = if ((size(payments) == 1)) | |
735 | 753 | then { | |
736 | 754 | let unstake = invoke(managerAddress(), "withdraw", [toBase58String(quoteAsset()), payments[0].amount], nil) | |
764 | 782 | else LONG | |
765 | 783 | let makeTakeOrder = if (haveOrderRequest(_orderId, TAKE)) | |
766 | 784 | then { | |
767 | - | let $ | |
768 | - | let newOrderId = $ | |
769 | - | let newAmm = $ | |
770 | - | let newTrader = $ | |
771 | - | let newType = $ | |
772 | - | let newTriggerPrice = $ | |
773 | - | let newLimitPrice = $ | |
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 | |
774 | 792 | let doCall = invoke(this, "internalCreateOrder", [newTrader, newAmm, newType, newTriggerPrice, newLimitPrice, positionSizeDelta, 0, closeOrderSide, "", "", 0], nil) | |
775 | 793 | if ((doCall == doCall)) | |
776 | 794 | then nil | |
781 | 799 | then { | |
782 | 800 | let makeStopOrder = if (haveOrderRequest(_orderId, STOP)) | |
783 | 801 | then { | |
784 | - | let $ | |
785 | - | let newOrderId = $ | |
786 | - | let newAmm = $ | |
787 | - | let newTrader = $ | |
788 | - | let newType = $ | |
789 | - | let newTriggerPrice = $ | |
790 | - | let newLimitPrice = $ | |
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 | |
791 | 809 | let doCall = invoke(this, "internalCreateOrder", [newTrader, newAmm, newType, newTriggerPrice, newLimitPrice, positionSizeDelta, 0, closeOrderSide, "", "", 0], nil) | |
792 | 810 | if ((doCall == doCall)) | |
793 | 811 | then nil |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let k_coordinatorAddress = "k_coordinatorAddress" | |
5 | 5 | ||
6 | 6 | let k_admin_address = "k_admin_address" | |
7 | 7 | ||
8 | 8 | let k_quote_asset = "k_quote_asset" | |
9 | 9 | ||
10 | 10 | let k_amm = "k_amm" | |
11 | 11 | ||
12 | 12 | let k_manager_address = "k_manager_address" | |
13 | 13 | ||
14 | 14 | let k_positionSequence = "k_positionSequence" | |
15 | 15 | ||
16 | 16 | let k_positionSize = "k_positionSize" | |
17 | 17 | ||
18 | 18 | let k_executedOrders = "k_executedOrders" | |
19 | 19 | ||
20 | 20 | let k_canceledOrders = "k_canceledOrders" | |
21 | 21 | ||
22 | 22 | let k_order = "k_order" | |
23 | 23 | ||
24 | 24 | let k_orderRequest = "k_orderReq" | |
25 | 25 | ||
26 | 26 | let k_lastOrderId = "k_lastOrderId" | |
27 | 27 | ||
28 | 28 | let k_traderOrderCnt = "k_traderOrderCnt" | |
29 | 29 | ||
30 | 30 | let k_traderOrderIds = "k_traderOrderIds" | |
31 | 31 | ||
32 | 32 | let k_sender = "k_sender" | |
33 | 33 | ||
34 | 34 | let k_initialized = "k_initialized" | |
35 | 35 | ||
36 | 36 | let STOP = 1 | |
37 | 37 | ||
38 | 38 | let TAKE = 2 | |
39 | 39 | ||
40 | 40 | let LIMIT = 3 | |
41 | 41 | ||
42 | 42 | let LONG = 1 | |
43 | 43 | ||
44 | 44 | let SHORT = 2 | |
45 | 45 | ||
46 | 46 | let INCREASE = 1 | |
47 | 47 | ||
48 | 48 | let DECREASE = 2 | |
49 | 49 | ||
50 | 50 | let MAX_TRADER_ORDERS_PER_AMM = 10 | |
51 | 51 | ||
52 | 52 | let TIME = lastBlock.timestamp | |
53 | 53 | ||
54 | 54 | let DECIMAL_UNIT = (1 * (((((10 * 10) * 10) * 10) * 10) * 10)) | |
55 | 55 | ||
56 | 56 | let SPREAD_LIMIT = (DECIMAL_UNIT / 200) | |
57 | 57 | ||
58 | 58 | func abs (_x) = if ((_x > 0)) | |
59 | 59 | then _x | |
60 | 60 | else -(_x) | |
61 | 61 | ||
62 | 62 | ||
63 | 63 | func divd (_x,_y) = fraction(_x, DECIMAL_UNIT, _y, HALFEVEN) | |
64 | 64 | ||
65 | 65 | ||
66 | 66 | func muld (_x,_y) = fraction(_x, _y, DECIMAL_UNIT, HALFEVEN) | |
67 | 67 | ||
68 | 68 | ||
69 | 69 | func minv (_x,_y) = if ((_x > _y)) | |
70 | 70 | then _y | |
71 | 71 | else _x | |
72 | 72 | ||
73 | 73 | ||
74 | 74 | func toCompositeKey (_key,_address) = ((_key + "_") + _address) | |
75 | 75 | ||
76 | 76 | ||
77 | 77 | func executedOrderKey (_orderId) = ((k_executedOrders + "_") + toString(_orderId)) | |
78 | 78 | ||
79 | 79 | ||
80 | 80 | func canceledOrderKey (_orderId) = ((k_canceledOrders + "_") + toString(_orderId)) | |
81 | 81 | ||
82 | 82 | ||
83 | 83 | func orderKey (_orderId) = toCompositeKey(k_order, toString(_orderId)) | |
84 | 84 | ||
85 | 85 | ||
86 | 86 | func orderRequestKey (_orderId,_type) = ((((k_orderRequest + "_") + toString(_orderId)) + "_") + toString(_type)) | |
87 | 87 | ||
88 | 88 | ||
89 | 89 | func traderOrderCountKey (_amm,_trader) = ((((k_traderOrderCnt + "_") + _amm) + "_") + _trader) | |
90 | 90 | ||
91 | 91 | ||
92 | 92 | func traderOrderIdsKey (_amm,_trader) = ((((k_traderOrderIds + "_") + _amm) + "_") + _trader) | |
93 | 93 | ||
94 | 94 | ||
95 | 95 | func coordinator () = valueOrErrorMessage(addressFromString(getStringValue(this, k_coordinatorAddress)), "Coordinator not set") | |
96 | 96 | ||
97 | 97 | ||
98 | 98 | func quoteAsset () = fromBase58String(getStringValue(coordinator(), k_quote_asset)) | |
99 | 99 | ||
100 | 100 | ||
101 | 101 | func managerAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_manager_address)), "Manager not set") | |
102 | 102 | ||
103 | 103 | ||
104 | 104 | func isWhitelist (_address) = valueOrElse(getBoolean(coordinator(), toCompositeKey(k_amm, _address)), false) | |
105 | 105 | ||
106 | 106 | ||
107 | 107 | func initialized () = valueOrElse(getBoolean(this, k_initialized), false) | |
108 | 108 | ||
109 | 109 | ||
110 | 110 | func isValid (_orderId) = if (valueOrElse(getBoolean(this, executedOrderKey(_orderId)), false)) | |
111 | 111 | then throw(("Order already executed: " + toString(_orderId))) | |
112 | 112 | else if (valueOrElse(getBoolean(this, canceledOrderKey(_orderId)), false)) | |
113 | 113 | then throw(("Order already cancelled: " + toString(_orderId))) | |
114 | 114 | else true | |
115 | 115 | ||
116 | 116 | ||
117 | 117 | func currentOrderId () = valueOrElse(getInteger(this, k_lastOrderId), 0) | |
118 | 118 | ||
119 | 119 | ||
120 | 120 | func getTraderOrderCount (_amm,_trader) = { | |
121 | 121 | let key = traderOrderCountKey(_amm, _trader) | |
122 | 122 | valueOrElse(getInteger(this, key), 0) | |
123 | 123 | } | |
124 | 124 | ||
125 | 125 | ||
126 | 126 | func traderAmmOrdersIds (_amm,_trader) = { | |
127 | 127 | let key = traderOrderIdsKey(_amm, _trader) | |
128 | 128 | let val = valueOrElse(getString(this, key), "") | |
129 | 129 | if ((val == "")) | |
130 | 130 | then nil | |
131 | 131 | else split(val, ",") | |
132 | 132 | } | |
133 | 133 | ||
134 | 134 | ||
135 | 135 | func haveOrderRequest (_orderId,_type) = { | |
136 | 136 | let key = orderRequestKey(_orderId, _type) | |
137 | 137 | isDefined(getString(this, key)) | |
138 | 138 | } | |
139 | 139 | ||
140 | 140 | ||
141 | 141 | func getOrderRequest (_orderId,_type) = { | |
142 | 142 | let key = orderRequestKey(_orderId, _type) | |
143 | 143 | let orderRequestStr = valueOrErrorMessage(getString(this, key), ("Not order request for key: " + key)) | |
144 | 144 | let orderRequestPartList = split(orderRequestStr, ",") | |
145 | 145 | let orderId = valueOrErrorMessage(parseInt(orderRequestPartList[0]), "Invalid orderId") | |
146 | 146 | let amm = orderRequestPartList[1] | |
147 | 147 | let trader = orderRequestPartList[2] | |
148 | 148 | let type = valueOrErrorMessage(parseInt(orderRequestPartList[3]), "Invalid type") | |
149 | 149 | let triggerPrice = valueOrErrorMessage(parseInt(orderRequestPartList[4]), "Invalid triggerPrice") | |
150 | 150 | let limitPrice = valueOrErrorMessage(parseInt(orderRequestPartList[5]), "Invalid limitPrice") | |
151 | 151 | $Tuple6(orderId, amm, trader, type, triggerPrice, limitPrice) | |
152 | 152 | } | |
153 | 153 | ||
154 | 154 | ||
155 | 155 | func getOrder (_orderId) = { | |
156 | 156 | let orderStr = valueOrErrorMessage(getString(this, orderKey(_orderId)), ("Invalid order id: " + toString(_orderId))) | |
157 | 157 | let orderPartList = split(orderStr, ",") | |
158 | 158 | let amm = orderPartList[0] | |
159 | 159 | let trader = orderPartList[1] | |
160 | 160 | let amountIn = valueOrErrorMessage(parseInt(orderPartList[2]), "Invalid amountIn") | |
161 | 161 | let leverage = valueOrErrorMessage(parseInt(orderPartList[3]), "Invalid leverage") | |
162 | 162 | let type = valueOrErrorMessage(parseInt(orderPartList[4]), "Invalid type") | |
163 | 163 | let triggerPrice = valueOrErrorMessage(parseInt(orderPartList[5]), "Invalid triggerPrice") | |
164 | 164 | let paymentUsdn = valueOrErrorMessage(parseInt(orderPartList[6]), "Invalid paymentUsdn") | |
165 | 165 | let side = valueOrErrorMessage(parseInt(orderPartList[7]), "Invalid side") | |
166 | 166 | let refLink = orderPartList[8] | |
167 | 167 | let positionId = valueOrErrorMessage(parseInt(orderPartList[9]), "Invalid positionId") | |
168 | 168 | let limitPrice = valueOrErrorMessage(parseInt(orderPartList[10]), "Invalid limitPrice") | |
169 | 169 | $Tuple11(amm, trader, amountIn, leverage, type, triggerPrice, paymentUsdn, side, refLink, positionId, limitPrice) | |
170 | 170 | } | |
171 | 171 | ||
172 | 172 | ||
173 | 173 | func getMarketPrice (_amm) = { | |
174 | 174 | let s = invoke(addressFromStringValue(_amm), "computeSpotPrice", nil, nil) | |
175 | 175 | if ((s == s)) | |
176 | 176 | then { | |
177 | 177 | let res = match s { | |
178 | 178 | case t: Int => | |
179 | 179 | t | |
180 | 180 | case _ => | |
181 | 181 | throw("Invalid computeSpotPrice result") | |
182 | 182 | } | |
183 | 183 | value(res) | |
184 | 184 | } | |
185 | 185 | else throw("Strict value is not equal to itself.") | |
186 | 186 | } | |
187 | 187 | ||
188 | 188 | ||
189 | 189 | func getFee (_amm,_trader) = { | |
190 | 190 | let s = invoke(addressFromStringValue(_amm), "computeFeeForTraderWithArtifact", [_trader, ""], nil) | |
191 | 191 | if ((s == s)) | |
192 | 192 | then { | |
193 | 193 | let res = match s { | |
194 | 194 | case t: (Int, Boolean) => | |
195 | 195 | t._1 | |
196 | 196 | case _ => | |
197 | 197 | throw("Invalid computeFeeForTraderWithArtifact result") | |
198 | 198 | } | |
199 | 199 | value(res) | |
200 | 200 | } | |
201 | 201 | else throw("Strict value is not equal to itself.") | |
202 | 202 | } | |
203 | 203 | ||
204 | 204 | ||
205 | 205 | func getPositionDirection (_orderSide,_orderType) = if (if ((_orderType == TAKE)) | |
206 | 206 | then true | |
207 | 207 | else (_orderType == STOP)) | |
208 | 208 | then if ((_orderSide == LONG)) | |
209 | 209 | then SHORT | |
210 | 210 | else LONG | |
211 | 211 | else _orderSide | |
212 | 212 | ||
213 | 213 | ||
214 | 214 | func getPositionSize (_amm,_trader,_direction) = { | |
215 | 215 | let amm = addressFromStringValue(_amm) | |
216 | 216 | let positionKey = ((_trader + "_") + toString(_direction)) | |
217 | 217 | let sizeKey = toCompositeKey(k_positionSize, positionKey) | |
218 | 218 | valueOrElse(getInteger(amm, sizeKey), 0) | |
219 | 219 | } | |
220 | 220 | ||
221 | 221 | ||
222 | 222 | func getPositionId (_amm,_trader,_direction) = { | |
223 | 223 | let amm = addressFromStringValue(_amm) | |
224 | 224 | let positionKey = ((_trader + "_") + toString(_direction)) | |
225 | 225 | let seqKey = toCompositeKey(k_positionSequence, positionKey) | |
226 | 226 | valueOrElse(getInteger(amm, seqKey), 0) | |
227 | 227 | } | |
228 | 228 | ||
229 | 229 | ||
230 | 230 | func getSpread (_price) = muld(_price, SPREAD_LIMIT) | |
231 | 231 | ||
232 | 232 | ||
233 | 233 | func saveOrder (_orderId,_amm,_trader,_amountIn,_leverage,_type,_triggerPrice,_paymentUsdn,_side,_refLink,_positionId,_limitPrice) = { | |
234 | 234 | let orderStr = makeString([_amm, _trader, toString(_amountIn), toString(_leverage), toString(_type), toString(_triggerPrice), toString(_paymentUsdn), toString(_side), _refLink, toString(_positionId), toString(_limitPrice)], ",") | |
235 | 235 | [StringEntry(orderKey(_orderId), orderStr)] | |
236 | 236 | } | |
237 | 237 | ||
238 | 238 | ||
239 | 239 | func saveOrderRequest (_orderId,_amm,_trader,_type,_triggerPrice,_limitPrice) = { | |
240 | 240 | let orderReqStr = makeString([toString(_orderId), _amm, _trader, toString(_type), toString(_triggerPrice), toString(_limitPrice)], ",") | |
241 | 241 | [StringEntry(orderRequestKey(_orderId, _type), orderReqStr)] | |
242 | 242 | } | |
243 | 243 | ||
244 | 244 | ||
245 | 245 | func updateOrderIdStr (_orderIdsNewStr,_amm,_trader) = [StringEntry(traderOrderIdsKey(_amm, _trader), _orderIdsNewStr)] | |
246 | 246 | ||
247 | 247 | ||
248 | 248 | func addRemoveOrderIdList (_orderIds,_orderId,_amm,_trader,_add) = { | |
249 | 249 | let orderIdsNew = if (_add) | |
250 | 250 | then (_orderIds :+ toString(_orderId)) | |
251 | 251 | else removeByIndex(_orderIds, valueOrErrorMessage(indexOf(_orderIds, toString(_orderId)), ("No order with id: " + toString(_orderId)))) | |
252 | 252 | orderIdsNew | |
253 | 253 | } | |
254 | 254 | ||
255 | 255 | ||
256 | 256 | func addRemoveOrderId (_orderId,_amm,_trader,_add) = { | |
257 | 257 | let orderIds = traderAmmOrdersIds(_amm, _trader) | |
258 | 258 | let orderIdsNew = addRemoveOrderIdList(orderIds, _orderId, _amm, _trader, _add) | |
259 | 259 | let orderIdsNewStr = makeString(orderIdsNew, ",") | |
260 | 260 | updateOrderIdStr(orderIdsNewStr, _amm, _trader) | |
261 | 261 | } | |
262 | 262 | ||
263 | 263 | ||
264 | 264 | func updateTraderOrderCount (_amm,_trader,_count) = if ((0 > _count)) | |
265 | 265 | then throw(("Invalid order count: " + toString(_count))) | |
266 | 266 | else [IntegerEntry(traderOrderCountKey(_amm, _trader), _count)] | |
267 | 267 | ||
268 | 268 | ||
269 | 269 | func updateLastOrderId (_lastOrderId) = [IntegerEntry(k_lastOrderId, _lastOrderId)] | |
270 | 270 | ||
271 | 271 | ||
272 | 272 | func markExecuteOrder (_orderId) = [BooleanEntry(toCompositeKey(k_executedOrders, toString(_orderId)), true)] | |
273 | 273 | ||
274 | 274 | ||
275 | 275 | func markCancelOrder (_orderId) = [BooleanEntry(toCompositeKey(k_canceledOrders, toString(_orderId)), true)] | |
276 | 276 | ||
277 | 277 | ||
278 | 278 | func getPositionIds (_amm,_trader) = { | |
279 | 279 | let longPositionSize = getPositionSize(_amm, _trader, LONG) | |
280 | 280 | let currentLongPositionId = if ((longPositionSize != 0)) | |
281 | 281 | then getPositionId(_amm, _trader, LONG) | |
282 | 282 | else 0 | |
283 | 283 | let shortPositionSize = getPositionSize(_amm, _trader, SHORT) | |
284 | 284 | let currentShortPositionId = if ((shortPositionSize != 0)) | |
285 | 285 | then getPositionId(_amm, _trader, SHORT) | |
286 | 286 | else 0 | |
287 | 287 | [currentLongPositionId, currentShortPositionId] | |
288 | 288 | } | |
289 | 289 | ||
290 | 290 | ||
291 | 291 | @Callable(i) | |
292 | 292 | func cleanUpStaleOrders (_amm,_trader) = { | |
293 | 293 | let orders = traderAmmOrdersIds(_amm, _trader) | |
294 | 294 | let positionIds = getPositionIds(_amm, _trader) | |
295 | 295 | func cleanUpOne (_acc,_orderId) = { | |
296 | 296 | let orderIdInt = valueOrErrorMessage(parseInt(_orderId), "Invalid order id") | |
297 | 297 | let $t01115611351 = getOrder(orderIdInt) | |
298 | 298 | let _x1 = $t01115611351._1 | |
299 | 299 | let _x2 = $t01115611351._2 | |
300 | 300 | let _x3 = $t01115611351._3 | |
301 | 301 | let _x4 = $t01115611351._4 | |
302 | 302 | let _type = $t01115611351._5 | |
303 | 303 | let _x5 = $t01115611351._6 | |
304 | 304 | let _x6 = $t01115611351._7 | |
305 | 305 | let _x7 = $t01115611351._8 | |
306 | 306 | let _x8 = $t01115611351._9 | |
307 | 307 | let _positionId = $t01115611351._10 | |
308 | 308 | let _x9 = $t01115611351._11 | |
309 | 309 | if (if (if (if ((_type == STOP)) | |
310 | 310 | then true | |
311 | 311 | else (_type == TAKE)) | |
312 | 312 | then (positionIds[0] != _positionId) | |
313 | 313 | else false) | |
314 | 314 | then (positionIds[1] != _positionId) | |
315 | 315 | else false) | |
316 | 316 | then { | |
317 | 317 | let change = markCancelOrder(orderIdInt) | |
318 | 318 | let newOrderList = addRemoveOrderIdList(_acc._1, orderIdInt, _amm, _trader, false) | |
319 | 319 | $Tuple2(newOrderList, (_acc._2 ++ change)) | |
320 | 320 | } | |
321 | 321 | else _acc | |
322 | 322 | } | |
323 | 323 | ||
324 | 324 | let $t01170411779 = { | |
325 | 325 | let $l = orders | |
326 | 326 | let $s = size($l) | |
327 | 327 | let $acc0 = $Tuple2(orders, nil) | |
328 | 328 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
329 | 329 | then $a | |
330 | 330 | else cleanUpOne($a, $l[$i]) | |
331 | 331 | ||
332 | 332 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
333 | 333 | then $a | |
334 | 334 | else throw("List size exceeds 10") | |
335 | 335 | ||
336 | 336 | $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) | |
337 | 337 | } | |
338 | 338 | let newOrders = $t01170411779._1 | |
339 | 339 | let cancelActions = $t01170411779._2 | |
340 | 340 | ((cancelActions ++ updateTraderOrderCount(_amm, _trader, size(newOrders))) ++ updateOrderIdStr(makeString(newOrders, ","), _amm, _trader)) | |
341 | 341 | } | |
342 | 342 | ||
343 | 343 | ||
344 | 344 | ||
345 | 345 | @Callable(i) | |
346 | 346 | func setContext (_sender) = if ((i.caller != this)) | |
347 | 347 | then throw("Only self-call") | |
348 | 348 | else [StringEntry(k_sender, _sender)] | |
349 | 349 | ||
350 | 350 | ||
351 | 351 | ||
352 | 352 | @Callable(i) | |
353 | 353 | func resetContext () = if ((i.caller != this)) | |
354 | 354 | then throw("Only self-call") | |
355 | 355 | else [DeleteEntry(k_sender)] | |
356 | 356 | ||
357 | 357 | ||
358 | 358 | ||
359 | 359 | @Callable(i) | |
360 | 360 | func initialize (_coordinator) = if (if (initialized()) | |
361 | 361 | then true | |
362 | 362 | else (i.caller != this)) | |
363 | 363 | then throw("Unable to initialize") | |
364 | 364 | else [StringEntry(k_coordinatorAddress, toString(addressFromStringValue(_coordinator))), BooleanEntry(k_initialized, true)] | |
365 | 365 | ||
366 | 366 | ||
367 | 367 | ||
368 | 368 | @Callable(i) | |
369 | 369 | func createOrder (_amm,_type,_triggerPrice,_limitPrice,_amountIn,_leverage,_side,_refLink,_stopTriggerPrice,_stopLimitPrice,_takeTriggerPrice,_takeLimitPrice) = { | |
370 | 370 | let _trader = toString(i.caller) | |
371 | 371 | let cleanUp = invoke(this, "cleanUpStaleOrders", [_amm, _trader], nil) | |
372 | 372 | if ((cleanUp == cleanUp)) | |
373 | 373 | then if ((size(i.payments) > 1)) | |
374 | 374 | then throw("Invalid createOrder parameters: invalid payment count") | |
375 | 375 | else { | |
376 | 376 | let $t01427514527 = if ((size(i.payments) == 1)) | |
377 | 377 | then $Tuple2(toBase58String(valueOrErrorMessage(i.payments[0].assetId, "Invalid asset id")), i.payments[0].amount) | |
378 | 378 | else $Tuple2("", 0) | |
379 | 379 | let paymentAssetId = $t01427514527._1 | |
380 | 380 | let paymentAmount = $t01427514527._2 | |
381 | 381 | let doCall = invoke(this, "internalCreateOrder", [_trader, _amm, _type, _triggerPrice, _limitPrice, _amountIn, _leverage, _side, _refLink, paymentAssetId, paymentAmount], nil) | |
382 | 382 | if ((doCall == doCall)) | |
383 | 383 | then { | |
384 | 384 | let orderId = match doCall { | |
385 | 385 | case t: Int => | |
386 | 386 | t | |
387 | 387 | case _ => | |
388 | 388 | throw("Invalid ID of created order") | |
389 | 389 | } | |
390 | 390 | if ((_type == LIMIT)) | |
391 | 391 | then { | |
392 | 392 | let makeStop = if ((_stopTriggerPrice > 0)) | |
393 | 393 | then { | |
394 | 394 | let doMakeStop = invoke(this, "internalCreateOrderRequest", [_trader, _amm, orderId, STOP, _stopTriggerPrice, _stopLimitPrice], nil) | |
395 | 395 | if ((doMakeStop == doMakeStop)) | |
396 | 396 | then nil | |
397 | 397 | else throw("Strict value is not equal to itself.") | |
398 | 398 | } | |
399 | 399 | else nil | |
400 | 400 | let makeTake = if ((_takeTriggerPrice > 0)) | |
401 | 401 | then { | |
402 | 402 | let doMakeTake = invoke(this, "internalCreateOrderRequest", [_trader, _amm, orderId, TAKE, _takeTriggerPrice, _takeLimitPrice], nil) | |
403 | 403 | if ((doMakeTake == doMakeTake)) | |
404 | 404 | then nil | |
405 | 405 | else throw("Strict value is not equal to itself.") | |
406 | 406 | } | |
407 | 407 | else nil | |
408 | 408 | (makeStop ++ makeTake) | |
409 | 409 | } | |
410 | 410 | else nil | |
411 | 411 | } | |
412 | 412 | else throw("Strict value is not equal to itself.") | |
413 | 413 | } | |
414 | 414 | else throw("Strict value is not equal to itself.") | |
415 | 415 | } | |
416 | 416 | ||
417 | 417 | ||
418 | 418 | ||
419 | 419 | @Callable(i) | |
420 | 420 | func increasePositionWithStopLoss (_amm,_direction,_leverage,_minBaseAssetAmount,_refLink,_stopTriggerPrice,_stopLimitPrice,_takeTriggerPrice,_takeLimitPrice) = { | |
421 | 421 | let _trader = toString(i.caller) | |
422 | 422 | let cleanUp = invoke(this, "cleanUpStaleOrders", [_amm, _trader], nil) | |
423 | 423 | if ((cleanUp == cleanUp)) | |
424 | 424 | then if (if (!(initialized())) | |
425 | 425 | then true | |
426 | 426 | else !(isWhitelist(_amm))) | |
427 | 427 | then throw("Invalid increasePositionWithStopLoss parameters") | |
428 | 428 | else { | |
429 | 429 | let positionSize = getPositionSize(_amm, _trader, _direction) | |
430 | 430 | if ((positionSize != 0)) | |
431 | 431 | then throw("Invalid increasePositionWithStopLoss parameters: only new position") | |
432 | 432 | else { | |
433 | 433 | let doSetContext = invoke(this, "setContext", [_trader], nil) | |
434 | 434 | if ((doSetContext == doSetContext)) | |
435 | 435 | then { | |
436 | 436 | let doClosePosition = invoke(addressFromStringValue(_amm), "increasePosition", [_direction, _leverage, _minBaseAssetAmount, _refLink], i.payments) | |
437 | 437 | if ((doClosePosition == doClosePosition)) | |
438 | 438 | then { | |
439 | 439 | let doResetContext = invoke(this, "resetContext", nil, nil) | |
440 | 440 | if ((doResetContext == doResetContext)) | |
441 | 441 | then { | |
442 | 442 | let openedPositionSize = getPositionSize(_amm, _trader, _direction) | |
443 | 443 | if ((openedPositionSize == openedPositionSize)) | |
444 | 444 | then { | |
445 | 445 | let amountIn = abs(openedPositionSize) | |
446 | 446 | let stopLossSide = if ((0 > openedPositionSize)) | |
447 | 447 | then LONG | |
448 | 448 | else SHORT | |
449 | 449 | let doCreateStopOrder = if ((_stopTriggerPrice > 0)) | |
450 | 450 | then { | |
451 | 451 | let doCreateStopOrder = invoke(this, "internalCreateOrder", [_trader, _amm, STOP, _stopTriggerPrice, _stopLimitPrice, amountIn, 0, stopLossSide, _refLink, "", 0], nil) | |
452 | 452 | if ((doCreateStopOrder == doCreateStopOrder)) | |
453 | 453 | then nil | |
454 | 454 | else throw("Strict value is not equal to itself.") | |
455 | 455 | } | |
456 | 456 | else nil | |
457 | 457 | if ((doCreateStopOrder == doCreateStopOrder)) | |
458 | 458 | then { | |
459 | 459 | let doCreateTakeOrder = if ((_takeTriggerPrice > 0)) | |
460 | 460 | then { | |
461 | 461 | let doCreateTakeOrder = invoke(this, "internalCreateOrder", [_trader, _amm, TAKE, _takeTriggerPrice, _takeLimitPrice, amountIn, 0, stopLossSide, _refLink, "", 0], nil) | |
462 | 462 | if ((doCreateTakeOrder == doCreateTakeOrder)) | |
463 | 463 | then nil | |
464 | 464 | else throw("Strict value is not equal to itself.") | |
465 | 465 | } | |
466 | 466 | else nil | |
467 | 467 | if ((doCreateTakeOrder == doCreateTakeOrder)) | |
468 | 468 | then nil | |
469 | 469 | else throw("Strict value is not equal to itself.") | |
470 | 470 | } | |
471 | 471 | else throw("Strict value is not equal to itself.") | |
472 | 472 | } | |
473 | 473 | else throw("Strict value is not equal to itself.") | |
474 | 474 | } | |
475 | 475 | else throw("Strict value is not equal to itself.") | |
476 | 476 | } | |
477 | 477 | else throw("Strict value is not equal to itself.") | |
478 | 478 | } | |
479 | 479 | else throw("Strict value is not equal to itself.") | |
480 | 480 | } | |
481 | 481 | } | |
482 | 482 | else throw("Strict value is not equal to itself.") | |
483 | 483 | } | |
484 | 484 | ||
485 | 485 | ||
486 | 486 | ||
487 | 487 | @Callable(i) | |
488 | 488 | func internalMarkOrderExecuted (_amm,_trader,_orderId) = if (if (if (!(initialized())) | |
489 | 489 | then true | |
490 | 490 | else !(isWhitelist(_amm))) | |
491 | 491 | then true | |
492 | 492 | else !((i.caller == this))) | |
493 | 493 | then throw("Invalid internalMarkOrderExecuted parameters") | |
494 | 494 | else { | |
495 | 495 | let newTraderOrderCount = (getTraderOrderCount(_amm, _trader) - 1) | |
496 | 496 | ((updateTraderOrderCount(_amm, _trader, newTraderOrderCount) ++ addRemoveOrderId(_orderId, _amm, _trader, false)) ++ markExecuteOrder(_orderId)) | |
497 | 497 | } | |
498 | 498 | ||
499 | 499 | ||
500 | 500 | ||
501 | 501 | @Callable(i) | |
502 | 502 | func internalCreateOrderRequest (_trader,_amm,_orderId,_type,_triggerPrice,_limitPrice) = if (if (if (if (if (!(initialized())) | |
503 | 503 | then true | |
504 | 504 | else !(isWhitelist(_amm))) | |
505 | 505 | then true | |
506 | 506 | else (0 >= _triggerPrice)) | |
507 | 507 | then true | |
508 | 508 | else (0 > _limitPrice)) | |
509 | 509 | then true | |
510 | 510 | else !((i.caller == this))) | |
511 | 511 | then throw("Invalid internalCreateOrderRequest parameters") | |
512 | 512 | else saveOrderRequest(_orderId, _amm, _trader, _type, _triggerPrice, _limitPrice) | |
513 | 513 | ||
514 | 514 | ||
515 | 515 | ||
516 | 516 | @Callable(i) | |
517 | - | func internalCreateOrder (_trader,_amm,_type,_triggerPrice,_limitPrice,_amountIn,_leverage,_side,_refLink,_paymentAssetId,_paymentAmount) = if (if (if (if (if (if (if (if (if (!(initialized())) | |
518 | - | then true | |
519 | - | else !(isWhitelist(_amm))) | |
520 | - | then true | |
521 | - | else (0 >= _triggerPrice)) | |
522 | - | then true | |
523 | - | else (0 > _limitPrice)) | |
524 | - | then true | |
525 | - | else (0 >= _amountIn)) | |
526 | - | then true | |
527 | - | else (0 > _leverage)) | |
528 | - | then true | |
529 | - | else !(if ((_side == LONG)) | |
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)) | |
530 | 525 | then true | |
531 | 526 | else (_side == SHORT))) | |
532 | - | then true | |
533 | - | else !(if (if ((_type == STOP)) | |
527 | + | let x8 = toString(!(if (if ((_type == STOP)) | |
534 | 528 | then true | |
535 | 529 | else (_type == TAKE)) | |
536 | 530 | then true | |
537 | 531 | else (_type == LIMIT))) | |
538 | - | then true | |
539 | - | else !((i.caller == this))) | |
540 | - | then throw("Invalid internalCreateOrder parameters") | |
541 | - | else { | |
542 | - | let orderId = (currentOrderId() + 1) | |
543 | - | let positionDirection = getPositionDirection(_side, _type) | |
544 | - | let newTraderOrderCount = (getTraderOrderCount(_amm, _trader) + 1) | |
545 | - | let positionSize = getPositionSize(_amm, _trader, positionDirection) | |
546 | - | let _direction = if (if (if ((positionSize == 0)) | |
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)) | |
547 | 547 | then true | |
548 | - | else if ((positionSize > 0)) | |
549 | - | then (_side == LONG) | |
548 | + | else (_side == SHORT))) | |
549 | + | then true | |
550 | + | else !(if (if ((_type == STOP)) | |
551 | + | 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)) | |
564 | + | 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) | |
550 | 578 | else false) | |
551 | - | then true | |
552 | - | else if ((0 > positionSize)) | |
553 | - | then (_side == SHORT) | |
554 | - | else false) | |
555 | - | then INCREASE | |
556 | - | else DECREASE | |
557 | - | if (if ((positionSize == 0)) | |
558 | - | then if ((_type == STOP)) | |
559 | - | then true | |
560 | - | else (_type == TAKE) | |
561 | - | else false) | |
562 | - | then throw("Can not create STOP/TAKE order: no position") | |
563 | - | else { | |
564 | - | let usdnPayment = if ((_direction == INCREASE)) | |
565 | - | then if (if ((_paymentAssetId != toBase58String(quoteAsset()))) | |
566 | - | then true | |
567 | - | else (_paymentAmount != _amountIn)) | |
568 | - | then throw("Invalid createLimitOrder parameters: invalid payment") | |
569 | - | else { | |
570 | - | let stake = invoke(managerAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), _paymentAmount)]) | |
571 | - | if ((stake == stake)) | |
572 | - | then _paymentAmount | |
573 | - | else throw("Strict value is not equal to itself.") | |
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()))) | |
583 | + | 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 | + | } | |
574 | 610 | } | |
575 | - | else 0 | |
576 | - | if ((usdnPayment == usdnPayment)) | |
577 | - | then { | |
578 | - | let positionId = if ((positionSize != 0)) | |
579 | - | then getPositionId(_amm, _trader, positionDirection) | |
580 | - | else 0 | |
581 | - | if (if (if ((_type == STOP)) | |
582 | - | then true | |
583 | - | else (_type == TAKE)) | |
584 | - | then (positionId == 0) | |
585 | - | else false) | |
586 | - | then throw("STOP and TAKE order should be assigned to position with id != 0") | |
587 | - | else if ((newTraderOrderCount > MAX_TRADER_ORDERS_PER_AMM)) | |
588 | - | then throw("Invalid createLimitOrder parameters: order count") | |
589 | - | else { | |
590 | - | 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)) | |
591 | - | $Tuple2(changeSet, orderId) | |
592 | - | } | |
593 | - | } | |
594 | - | else throw("Strict value is not equal to itself.") | |
595 | - | } | |
596 | - | } | |
611 | + | else throw("Strict value is not equal to itself.") | |
612 | + | } | |
613 | + | } | |
614 | + | } | |
597 | 615 | ||
598 | 616 | ||
599 | 617 | ||
600 | 618 | @Callable(i) | |
601 | 619 | func cancelOrder (_orderId) = { | |
602 | - | let $ | |
603 | - | let _amm = $ | |
604 | - | let _trader = $ | |
605 | - | let _amountIn = $ | |
606 | - | let _leverage = $ | |
607 | - | let _type = $ | |
608 | - | let _triggerPrice = $ | |
609 | - | let _amountUsdn = $ | |
610 | - | let _side = $ | |
611 | - | let _refLink = $ | |
612 | - | let _positionId = $ | |
613 | - | let _limitPrice = $ | |
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 | |
614 | 632 | if (if (if (!(initialized())) | |
615 | 633 | then true | |
616 | 634 | else !(isValid(_orderId))) | |
617 | 635 | then true | |
618 | 636 | else !((toString(i.caller) == _trader))) | |
619 | 637 | then throw("Invalid cancelOrder parameters") | |
620 | 638 | else { | |
621 | 639 | let cleanUp = invoke(this, "cleanUpStaleOrders", [_amm, _trader], nil) | |
622 | 640 | if ((cleanUp == cleanUp)) | |
623 | 641 | then { | |
624 | 642 | let newTraderOrderCount = (getTraderOrderCount(_amm, _trader) - 1) | |
625 | 643 | let withdraw = if ((_amountUsdn > 0)) | |
626 | 644 | then { | |
627 | 645 | let unstake = invoke(managerAddress(), "withdraw", [toBase58String(quoteAsset()), _amountUsdn], nil) | |
628 | 646 | if ((unstake == unstake)) | |
629 | 647 | then nil | |
630 | 648 | else throw("Strict value is not equal to itself.") | |
631 | 649 | } | |
632 | 650 | else nil | |
633 | 651 | if ((withdraw == withdraw)) | |
634 | 652 | then (((markCancelOrder(_orderId) ++ addRemoveOrderId(_orderId, _amm, _trader, false)) ++ updateTraderOrderCount(_amm, _trader, newTraderOrderCount)) ++ (if ((_amountUsdn > 0)) | |
635 | 653 | then [ScriptTransfer(i.caller, _amountUsdn, quoteAsset())] | |
636 | 654 | else nil)) | |
637 | 655 | else throw("Strict value is not equal to itself.") | |
638 | 656 | } | |
639 | 657 | else throw("Strict value is not equal to itself.") | |
640 | 658 | } | |
641 | 659 | } | |
642 | 660 | ||
643 | 661 | ||
644 | 662 | ||
645 | 663 | @Callable(i) | |
646 | 664 | func executeOrder (_orderId) = { | |
647 | - | let $ | |
648 | - | let _amm = $ | |
649 | - | let _trader = $ | |
650 | - | let _amountIn = $ | |
651 | - | let _leverage = $ | |
652 | - | let _type = $ | |
653 | - | let _triggerPrice = $ | |
654 | - | let _amountUsdn = $ | |
655 | - | let _side = $ | |
656 | - | let _refLink = $ | |
657 | - | let _positionId = $ | |
658 | - | let _limitPrice = $ | |
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 | |
659 | 677 | let cleanUp = invoke(this, "cleanUpStaleOrders", [_amm, _trader], nil) | |
660 | 678 | if ((cleanUp == cleanUp)) | |
661 | 679 | then { | |
662 | 680 | let positionDirection = getPositionDirection(_side, _type) | |
663 | 681 | if (if (!(initialized())) | |
664 | 682 | then true | |
665 | 683 | else !(isValid(_orderId))) | |
666 | 684 | then throw("Invalid executeOrder parameters") | |
667 | 685 | else { | |
668 | 686 | let positionSize = getPositionSize(_amm, _trader, positionDirection) | |
669 | 687 | if ((positionSize == positionSize)) | |
670 | 688 | then { | |
671 | 689 | let currentPositionId = if ((positionSize != 0)) | |
672 | 690 | then getPositionId(_amm, _trader, positionDirection) | |
673 | 691 | else 0 | |
674 | - | let $ | |
692 | + | let $t02592929307 = if ((_type == STOP)) | |
675 | 693 | then { | |
676 | 694 | let _positionDirection = if ((positionSize > 0)) | |
677 | 695 | then LONG | |
678 | 696 | else if ((0 > positionSize)) | |
679 | 697 | then SHORT | |
680 | 698 | else throw("Can not execute STOP order: no open position") | |
681 | 699 | let marketPrice = getMarketPrice(_amm) | |
682 | 700 | let isExecutable = if ((_side == _positionDirection)) | |
683 | 701 | then throw("Can not execute STOP order: reduce only") | |
684 | 702 | else if ((currentPositionId != _positionId)) | |
685 | 703 | then throw("Can not execute STOP order: position closed") | |
686 | 704 | else if ((_positionDirection == LONG)) | |
687 | 705 | then (_triggerPrice >= marketPrice) | |
688 | 706 | else (marketPrice >= _triggerPrice) | |
689 | 707 | if (isExecutable) | |
690 | 708 | then $Tuple3("closePosition", [minv(_amountIn, abs(positionSize)), positionDirection, muld(_limitPrice, abs(positionSize)), false], nil) | |
691 | 709 | else throw("Can not execute STOP order: triggerPrice mismatch") | |
692 | 710 | } | |
693 | 711 | else if ((_type == TAKE)) | |
694 | 712 | then { | |
695 | 713 | let _positionDirection = if ((positionSize > 0)) | |
696 | 714 | then LONG | |
697 | 715 | else if ((0 > positionSize)) | |
698 | 716 | then SHORT | |
699 | 717 | else throw("Can not execute STOP order: no open position") | |
700 | 718 | let marketPrice = getMarketPrice(_amm) | |
701 | 719 | let isExecutable = if ((_side == _positionDirection)) | |
702 | 720 | then throw("Can not execute TAKE order: reduce only") | |
703 | 721 | else if ((currentPositionId != _positionId)) | |
704 | 722 | then throw(((("Can not execute TAKE order: position closed " + toString(currentPositionId)) + "!=") + toString(_positionId))) | |
705 | 723 | else if ((_positionDirection == LONG)) | |
706 | 724 | then (marketPrice >= _triggerPrice) | |
707 | 725 | else (_triggerPrice >= marketPrice) | |
708 | 726 | if (isExecutable) | |
709 | 727 | then $Tuple3("closePosition", [minv(_amountIn, abs(positionSize)), positionDirection, muld(_limitPrice, abs(positionSize)), false], nil) | |
710 | 728 | else throw("Can not execute TAKE order: triggerPrice mismatch") | |
711 | 729 | } | |
712 | 730 | else if ((_type == LIMIT)) | |
713 | 731 | then { | |
714 | 732 | let marketPrice = getMarketPrice(_amm) | |
715 | 733 | let spread = if ((_limitPrice == 0)) | |
716 | 734 | then getSpread(_triggerPrice) | |
717 | 735 | else abs((_triggerPrice - _limitPrice)) | |
718 | 736 | let isExecutable = if ((marketPrice >= (_triggerPrice - spread))) | |
719 | 737 | then ((_triggerPrice + spread) >= marketPrice) | |
720 | 738 | else false | |
721 | 739 | if (isExecutable) | |
722 | 740 | then { | |
723 | 741 | let amountInWithFee = (_amountUsdn - muld(_amountUsdn, getFee(_amm, _trader))) | |
724 | 742 | $Tuple3("increasePosition", [_side, _leverage, if ((_limitPrice == 0)) | |
725 | 743 | then 0 | |
726 | 744 | else divd(amountInWithFee, _limitPrice), _refLink], [AttachedPayment(quoteAsset(), _amountUsdn)]) | |
727 | 745 | } | |
728 | 746 | else throw("Can not execute LIMIT order: triggerPrice mismatch") | |
729 | 747 | } | |
730 | 748 | else throw(("Invalid order type: " + toString(_type))) | |
731 | - | let method = $ | |
732 | - | let args = $ | |
733 | - | let payments = $ | |
749 | + | let method = $t02592929307._1 | |
750 | + | let args = $t02592929307._2 | |
751 | + | let payments = $t02592929307._3 | |
734 | 752 | let withdraw = if ((size(payments) == 1)) | |
735 | 753 | then { | |
736 | 754 | let unstake = invoke(managerAddress(), "withdraw", [toBase58String(quoteAsset()), payments[0].amount], nil) | |
737 | 755 | if ((unstake == unstake)) | |
738 | 756 | then nil | |
739 | 757 | else throw("Strict value is not equal to itself.") | |
740 | 758 | } | |
741 | 759 | else nil | |
742 | 760 | if ((withdraw == withdraw)) | |
743 | 761 | then { | |
744 | 762 | let doSetContext = invoke(this, "setContext", [_trader], nil) | |
745 | 763 | if ((doSetContext == doSetContext)) | |
746 | 764 | then { | |
747 | 765 | let doClosePosition = invoke(addressFromStringValue(_amm), method, args, payments) | |
748 | 766 | if ((doClosePosition == doClosePosition)) | |
749 | 767 | then { | |
750 | 768 | let doResetContext = invoke(this, "resetContext", nil, nil) | |
751 | 769 | if ((doResetContext == doResetContext)) | |
752 | 770 | then { | |
753 | 771 | let executeOrderRequest = if ((_type == LIMIT)) | |
754 | 772 | then { | |
755 | 773 | let newPositionSize = getPositionSize(_amm, _trader, positionDirection) | |
756 | 774 | if ((newPositionSize == newPositionSize)) | |
757 | 775 | then { | |
758 | 776 | let newPositionId = getPositionId(_amm, _trader, positionDirection) | |
759 | 777 | if ((newPositionId == newPositionId)) | |
760 | 778 | then { | |
761 | 779 | let positionSizeDelta = (newPositionSize - positionSize) | |
762 | 780 | let closeOrderSide = if ((newPositionSize > 0)) | |
763 | 781 | then SHORT | |
764 | 782 | else LONG | |
765 | 783 | let makeTakeOrder = if (haveOrderRequest(_orderId, TAKE)) | |
766 | 784 | then { | |
767 | - | let $ | |
768 | - | let newOrderId = $ | |
769 | - | let newAmm = $ | |
770 | - | let newTrader = $ | |
771 | - | let newType = $ | |
772 | - | let newTriggerPrice = $ | |
773 | - | let newLimitPrice = $ | |
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 | |
774 | 792 | let doCall = invoke(this, "internalCreateOrder", [newTrader, newAmm, newType, newTriggerPrice, newLimitPrice, positionSizeDelta, 0, closeOrderSide, "", "", 0], nil) | |
775 | 793 | if ((doCall == doCall)) | |
776 | 794 | then nil | |
777 | 795 | else throw("Strict value is not equal to itself.") | |
778 | 796 | } | |
779 | 797 | else nil | |
780 | 798 | if ((makeTakeOrder == makeTakeOrder)) | |
781 | 799 | then { | |
782 | 800 | let makeStopOrder = if (haveOrderRequest(_orderId, STOP)) | |
783 | 801 | then { | |
784 | - | let $ | |
785 | - | let newOrderId = $ | |
786 | - | let newAmm = $ | |
787 | - | let newTrader = $ | |
788 | - | let newType = $ | |
789 | - | let newTriggerPrice = $ | |
790 | - | let newLimitPrice = $ | |
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 | |
791 | 809 | let doCall = invoke(this, "internalCreateOrder", [newTrader, newAmm, newType, newTriggerPrice, newLimitPrice, positionSizeDelta, 0, closeOrderSide, "", "", 0], nil) | |
792 | 810 | if ((doCall == doCall)) | |
793 | 811 | then nil | |
794 | 812 | else throw("Strict value is not equal to itself.") | |
795 | 813 | } | |
796 | 814 | else nil | |
797 | 815 | if ((makeStopOrder == makeStopOrder)) | |
798 | 816 | then (makeTakeOrder ++ makeStopOrder) | |
799 | 817 | else throw("Strict value is not equal to itself.") | |
800 | 818 | } | |
801 | 819 | else throw("Strict value is not equal to itself.") | |
802 | 820 | } | |
803 | 821 | else throw("Strict value is not equal to itself.") | |
804 | 822 | } | |
805 | 823 | else throw("Strict value is not equal to itself.") | |
806 | 824 | } | |
807 | 825 | else nil | |
808 | 826 | if ((executeOrderRequest == executeOrderRequest)) | |
809 | 827 | then { | |
810 | 828 | let doMarkOrderExecuted = invoke(this, "internalMarkOrderExecuted", [_amm, _trader, _orderId], nil) | |
811 | 829 | if ((doMarkOrderExecuted == doMarkOrderExecuted)) | |
812 | 830 | then nil | |
813 | 831 | else throw("Strict value is not equal to itself.") | |
814 | 832 | } | |
815 | 833 | else throw("Strict value is not equal to itself.") | |
816 | 834 | } | |
817 | 835 | else throw("Strict value is not equal to itself.") | |
818 | 836 | } | |
819 | 837 | else throw("Strict value is not equal to itself.") | |
820 | 838 | } | |
821 | 839 | else throw("Strict value is not equal to itself.") | |
822 | 840 | } | |
823 | 841 | else throw("Strict value is not equal to itself.") | |
824 | 842 | } | |
825 | 843 | else throw("Strict value is not equal to itself.") | |
826 | 844 | } | |
827 | 845 | } | |
828 | 846 | else throw("Strict value is not equal to itself.") | |
829 | 847 | } | |
830 | 848 | ||
831 | 849 | ||
832 | 850 | ||
833 | 851 | @Callable(i) | |
834 | 852 | func view_canExecuteOrder (_orderId) = { | |
835 | 853 | let s = invoke(this, "executeOrder", [_orderId], nil) | |
836 | 854 | if ((s == s)) | |
837 | 855 | then throw("Success") | |
838 | 856 | else throw("Strict value is not equal to itself.") | |
839 | 857 | } | |
840 | 858 | ||
841 | 859 | ||
842 | 860 | @Verifier(tx) | |
843 | 861 | func verify () = { | |
844 | 862 | let coordinatorStr = getString(this, k_coordinatorAddress) | |
845 | 863 | if (isDefined(coordinatorStr)) | |
846 | 864 | then { | |
847 | 865 | let admin = getString(addressFromStringValue(value(coordinatorStr)), k_admin_address) | |
848 | 866 | if (isDefined(admin)) | |
849 | 867 | then valueOrElse(getBoolean(addressFromStringValue(value(admin)), ((("status_" + toString(this)) + "_") + toBase58String(tx.id))), false) | |
850 | 868 | else throw("unable to verify: admin not set in coordinator") | |
851 | 869 | } | |
852 | 870 | else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
853 | 871 | } | |
854 | 872 |
github/deemru/w8io/169f3d6 117.16 ms ◑