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