tx · 3riYoefdzdAU5V2ZsYpwRL8NHdP2wfa9u5rdS6rW6kJm 3MzKSdTH2jFbypLsoNfrH7QgkzSbx3EYwCA: -0.03700000 Waves 2022.12.26 17:02 [2377335] smart account 3MzKSdTH2jFbypLsoNfrH7QgkzSbx3EYwCA > SELF 0.00000000 Waves
{ "type": 13, "id": "3riYoefdzdAU5V2ZsYpwRL8NHdP2wfa9u5rdS6rW6kJm", "fee": 3700000, "feeAssetId": null, "timestamp": 1672063340828, "version": 1, "sender": "3MzKSdTH2jFbypLsoNfrH7QgkzSbx3EYwCA", "senderPublicKey": "35yd3qw1gxKDxKwGAykHN9fANbXNWwseaUwbWDj24o3x", "proofs": [ "3uvFREUa5HRVQvZk6sYN5vxh6ajLx68ARxDu2UwrNS8NkbY8iXLiRx8WGJrgMKPZU13CCg8zeGPXnS8fJBuPaFJf" ], "script": "base64:BgKwKQgCEgMKAQgSAwoBCBIAEgQKAgEEEgQKAgEEEgMKAQESABIECgIIARIAEgQKAggBEgQKAggBEgQKAgEBEgMKAQESBQoDAQEBEgUKAwEIARIECgIBCBIECgIBCBIECgIICBIECgIICBIECgIIARIAEgMKAQgSBQoDAQEBEgQKAggBEgQKAgEBEgQKAggIEgsKCQgBAQIBAggEBBIGCgQICAEIEgAiBnNjYWxlOCIMc2NhbGU4QmlnSW50IgdzY2FsZTE4Igp6ZXJvQmlnSW50IgRiaWcwIgRiaWcxIgRiaWcyIgRiaWczIgRiaWc0IgpzbGlwcGFnZTREIgt3YXZlc1N0cmluZyIFQW11bHQiBURjb252IgNTRVAiBUVNUFRZIgpQb29sQWN0aXZlIgpQb29sUHV0RGlzIg5Qb29sTWF0Y2hlckRpcyIMUG9vbFNodXRkb3duIg5pZHhQb29sQWRkcmVzcyIJaWR4UG9vbFN0IglpZHhMUEFzSWQiCWlkeEFtQXNJZCIJaWR4UHJBc0lkIgtpZHhBbXRBc0RjbSINaWR4UHJpY2VBc0RjbSILaWR4SUFtdEFzSWQiDWlkeElQcmljZUFz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lwdAQCaWIJANsEAQkBBXZhbHVlAQkAnQgCBQJhTQkBAmF6AAQCaWMJAPEHAQUEdGhpcwMDCQAAAgUCaWIFAmlhCQECIT0CBQJpYwUCaWEHBgkA9AMDCAUCaFQJYm9keUJ5dGVzCQCRAwIIBQJoVAZwcm9vZnMAAAUCaFYJAPQDAwgFAmhUCWJvZHlCeXRlcwkAkQMCCAUCaFQGcHJvb2ZzAAAFAmhWEB+pZQ==", "chainId": 84, "height": 2377335, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CXX4t6DDoZZXmENLU8rS66cZ9jk6Wy7Bv13Ea6CJze6S Next: ifSiZEVeJsuvg16BfSG9RrMTxbTZ93V1wETg6eWTaVA Diff:
Old | New | Differences | |
---|---|---|---|
386 | 386 | $Tuple5(f1(lpAmtX18, scale8), f1(inAmAssetAmtX18, amtDcm), f1(inPrAssetAmtX18, priceDcm), cpbi((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18) | |
387 | 387 | } | |
388 | 388 | else { | |
389 | - | let curPriceX18 = | |
389 | + | let curPriceX18 = cpbi(prBalanceX18, amBalanceX18) | |
390 | 390 | let slippageRealX18 = fraction(abs((curPriceX18 - userPriceX18)), scale18, curPriceX18) | |
391 | 391 | let slippageX18 = t1(slippage, scale8) | |
392 | 392 | if (if (if (validateSlippage) | |
397 | 397 | then throw(((("Price slippage " + toString(slippageRealX18)) + " > ") + toString(slippageX18))) | |
398 | 398 | else { | |
399 | 399 | let lpEmissionX18 = t1(lpEm, scale8) | |
400 | - | let prViaAmX18 = fraction(inAmAssetAmtX18, | |
401 | - | let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, | |
400 | + | let prViaAmX18 = fraction(inAmAssetAmtX18, cpbir(prBalanceX18, amBalanceX18, CEILING), scale18, CEILING) | |
401 | + | let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, cpbir(prBalanceX18, amBalanceX18, FLOOR), CEILING) | |
402 | 402 | let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18)) | |
403 | 403 | then $Tuple2(amViaPrX18, inPrAssetAmtX18) | |
404 | 404 | else $Tuple2(inAmAssetAmtX18, prViaAmX18) | |
405 | 405 | let expAmtAssetAmtX18 = expectedAmts._1 | |
406 | 406 | let expPriceAssetAmtX18 = expectedAmts._2 | |
407 | - | let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18) | |
407 | + | let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18, FLOOR) | |
408 | 408 | $Tuple5(fromX18Round(lpAmtX18, scale8, FLOOR), fromX18Round(expAmtAssetAmtX18, amtDcm, CEILING), fromX18Round(expPriceAssetAmtX18, priceDcm, CEILING), curPriceX18, slippageX18) | |
409 | 409 | } | |
410 | 410 | } | |
421 | 421 | else calcLpAmt | |
422 | 422 | let amDiff = (inAmAmt - calcAmAssetPmt) | |
423 | 423 | let prDiff = (inPrAmt - calcPrAssetPmt) | |
424 | - | let $ | |
424 | + | let $t01838418729 = if (if (isOneAsset) | |
425 | 425 | then (pmtId == amIdStr) | |
426 | 426 | else false) | |
427 | 427 | then $Tuple2(pmtAmt, 0) | |
430 | 430 | else false) | |
431 | 431 | then $Tuple2(0, pmtAmt) | |
432 | 432 | else $Tuple2(calcAmAssetPmt, calcPrAssetPmt) | |
433 | - | let writeAmAmt = $ | |
434 | - | let writePrAmt = $ | |
433 | + | let writeAmAmt = $t01838418729._1 | |
434 | + | let writePrAmt = $t01838418729._2 | |
435 | 435 | let commonState = [IntegerEntry(pl(), curPrice), IntegerEntry(ph(height, lastBlock.timestamp), curPrice), StringEntry(pau(userAddress, txId58), dataPutActionInfo(writeAmAmt, writePrAmt, emitLpAmt, curPrice, slippage, slippageCalc, height, lastBlock.timestamp, amDiff, prDiff))] | |
436 | 436 | $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEm, lpId, sts, commonState, amDiff, prDiff, inAmId, inPrId) | |
437 | 437 | } | |
473 | 473 | } | |
474 | 474 | ||
475 | 475 | let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] | |
476 | - | let $ | |
476 | + | let $t02065720705 = { | |
477 | 477 | let $l = arr | |
478 | 478 | let $s = size($l) | |
479 | 479 | let $acc0 = $Tuple2(s, false) | |
487 | 487 | ||
488 | 488 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($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), 11), 12), 13), 14), 15) | |
489 | 489 | } | |
490 | - | let d = $ | |
491 | - | let found = $ | |
490 | + | let d = $t02065720705._1 | |
491 | + | let found = $t02065720705._2 | |
492 | 492 | if (found) | |
493 | 493 | then d | |
494 | 494 | else throw(("D calculation error, D = " + toString(d))) | |
512 | 512 | let ann_aPrecision = (ann - aPrecision) | |
513 | 513 | let n1 = (n + big1) | |
514 | 514 | func calc (acc,cur) = { | |
515 | - | let $ | |
516 | - | let d = $ | |
517 | - | let found = $ | |
515 | + | let $t02133421354 = acc | |
516 | + | let d = $t02133421354._1 | |
517 | + | let found = $t02133421354._2 | |
518 | 518 | if ((found != unit)) | |
519 | 519 | then acc | |
520 | 520 | else { | |
528 | 528 | } | |
529 | 529 | ||
530 | 530 | let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] | |
531 | - | let $ | |
531 | + | let $t02177521822 = { | |
532 | 532 | let $l = arr | |
533 | 533 | let $s = size($l) | |
534 | 534 | let $acc0 = $Tuple2(s, unit) | |
542 | 542 | ||
543 | 543 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($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), 11), 12), 13), 14), 15) | |
544 | 544 | } | |
545 | - | let d = $ | |
546 | - | let found = $ | |
545 | + | let d = $t02177521822._1 | |
546 | + | let found = $t02177521822._2 | |
547 | 547 | if ((found != unit)) | |
548 | 548 | then d | |
549 | 549 | else throw(("D calculation error, D = " + toString(d))) | |
563 | 563 | let c = (((((D * D) / (x * n)) * D) * aPrecision) / (ann * n)) | |
564 | 564 | let b = ((s + ((D * aPrecision) / ann)) - D) | |
565 | 565 | func calc (acc,cur) = { | |
566 | - | let $ | |
567 | - | let y = $ | |
568 | - | let found = $ | |
566 | + | let $t02232222342 = acc | |
567 | + | let y = $t02232222342._1 | |
568 | + | let found = $t02232222342._2 | |
569 | 569 | if ((found != unit)) | |
570 | 570 | then acc | |
571 | 571 | else { | |
578 | 578 | } | |
579 | 579 | ||
580 | 580 | let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] | |
581 | - | let $ | |
581 | + | let $t02264922696 = { | |
582 | 582 | let $l = arr | |
583 | 583 | let $s = size($l) | |
584 | 584 | let $acc0 = $Tuple2(D, unit) | |
592 | 592 | ||
593 | 593 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($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), 11), 12), 13), 14), 15) | |
594 | 594 | } | |
595 | - | let y = $ | |
596 | - | let found = $ | |
595 | + | let y = $t02264922696._1 | |
596 | + | let found = $t02264922696._2 | |
597 | 597 | if ((found != unit)) | |
598 | 598 | then y | |
599 | 599 | else throw(("Y calculation error, Y = " + toString(y))) | |
635 | 635 | func validateMatcherOrderAllowed (order) = { | |
636 | 636 | let amountAssetAmount = order.amount | |
637 | 637 | let priceAssetAmount = fraction(order.amount, order.price, scale8, FLOOR) | |
638 | - | let $ | |
638 | + | let $t02463524847 = if ((order.orderType == Buy)) | |
639 | 639 | then $Tuple2(amountAssetAmount, -(priceAssetAmount)) | |
640 | 640 | else $Tuple2(-(amountAssetAmount), priceAssetAmount) | |
641 | - | let amountAssetBalanceDelta = $ | |
642 | - | let priceAssetBalanceDelta = $ | |
641 | + | let amountAssetBalanceDelta = $t02463524847._1 | |
642 | + | let priceAssetBalanceDelta = $t02463524847._2 | |
643 | 643 | if (if (if (igs()) | |
644 | 644 | then true | |
645 | 645 | else (cfgPoolStatus == PoolMatcherDis)) | |
652 | 652 | then throw("Wr assets") | |
653 | 653 | else { | |
654 | 654 | let dLp = parseBigIntValue(getStringValue(this, keyDLp)) | |
655 | - | let $ | |
656 | - | let unusedActions = $ | |
657 | - | let dLpNew = $ | |
655 | + | let $t02517725277 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0) | |
656 | + | let unusedActions = $t02517725277._1 | |
657 | + | let dLpNew = $t02517725277._2 | |
658 | 658 | let isOrderValid = (dLpNew >= dLp) | |
659 | 659 | isOrderValid | |
660 | 660 | } | |
707 | 707 | then { | |
708 | 708 | let amBalance = getAccBalance(amId) | |
709 | 709 | let prBalance = getAccBalance(prId) | |
710 | - | let $ | |
710 | + | let $t02754328005 = if ((txId == "")) | |
711 | 711 | then $Tuple2(amBalance, prBalance) | |
712 | 712 | else if ((pmtAssetId == amId)) | |
713 | 713 | then if ((pmtAmtRaw > amBalance)) | |
718 | 718 | then throw("invalid payment amount") | |
719 | 719 | else $Tuple2(amBalance, (prBalance - pmtAmtRaw)) | |
720 | 720 | else throw("wrong pmtAssetId") | |
721 | - | let amBalanceOld = $ | |
722 | - | let prBalanceOld = $ | |
723 | - | let $ | |
721 | + | let amBalanceOld = $t02754328005._1 | |
722 | + | let prBalanceOld = $t02754328005._2 | |
723 | + | let $t02801128187 = if ((pmtAssetId == amId)) | |
724 | 724 | then $Tuple2(pmtAmtRaw, 0) | |
725 | 725 | else if ((pmtAssetId == prId)) | |
726 | 726 | then $Tuple2(0, pmtAmtRaw) | |
727 | 727 | else throw("invalid payment") | |
728 | - | let amAmountRaw = $ | |
729 | - | let prAmountRaw = $ | |
730 | - | let $ | |
728 | + | let amAmountRaw = $t02801128187._1 | |
729 | + | let prAmountRaw = $t02801128187._2 | |
730 | + | let $t02819128430 = if (withTakeFee) | |
731 | 731 | then $Tuple3(takeFee(amAmountRaw)._1, takeFee(prAmountRaw)._1, takeFee(pmtAmtRaw)._2) | |
732 | 732 | else $Tuple3(amAmountRaw, prAmountRaw, 0) | |
733 | - | let amAmount = $ | |
734 | - | let prAmount = $ | |
735 | - | let feeAmount = $ | |
733 | + | let amAmount = $t02819128430._1 | |
734 | + | let prAmount = $t02819128430._2 | |
735 | + | let feeAmount = $t02819128430._3 | |
736 | 736 | let amBalanceNew = (amBalanceOld + amAmount) | |
737 | 737 | let prBalanceNew = (prBalanceOld + prAmount) | |
738 | 738 | let D0 = getD([toBigInt(amBalanceOld), toBigInt(prBalanceOld)]) | |
780 | 780 | else { | |
781 | 781 | let amBalance = getAccBalance(amId) | |
782 | 782 | let prBalance = getAccBalance(prId) | |
783 | - | let $ | |
783 | + | let $t03048030591 = { | |
784 | 784 | let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, pmtAmt], nil) | |
785 | 785 | if ($isInstanceOf(@, "(Int, Int)")) | |
786 | 786 | then @ | |
787 | 787 | else throw(($getType(@) + " couldn't be cast to (Int, Int)")) | |
788 | 788 | } | |
789 | - | if (($ | |
789 | + | if (($t03048030591 == $t03048030591)) | |
790 | 790 | then { | |
791 | - | let feeAmount = $ | |
792 | - | let totalGet = $ | |
791 | + | let feeAmount = $t03048030591._2 | |
792 | + | let totalGet = $t03048030591._1 | |
793 | 793 | let totalAmount = if (if ((minOutAmount > 0)) | |
794 | 794 | then (minOutAmount > totalGet) | |
795 | 795 | else false) | |
796 | 796 | then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], "")) | |
797 | 797 | else totalGet | |
798 | - | let $ | |
798 | + | let $t03078131088 = if ((outAssetId == amId)) | |
799 | 799 | then $Tuple4(totalAmount, 0, ((amBalance - totalAmount) - feeAmount), prBalance) | |
800 | 800 | else if ((outAssetId == prId)) | |
801 | 801 | then $Tuple4(0, totalAmount, amBalance, ((prBalance - totalAmount) - feeAmount)) | |
802 | 802 | else throw("invalid out asset id") | |
803 | - | let outAm = $ | |
804 | - | let outPr = $ | |
805 | - | let amBalanceNew = $ | |
806 | - | let prBalanceNew = $ | |
803 | + | let outAm = $t03078131088._1 | |
804 | + | let outPr = $t03078131088._2 | |
805 | + | let amBalanceNew = $t03078131088._3 | |
806 | + | let prBalanceNew = $t03078131088._4 | |
807 | 807 | let curPrX18 = cpbi(t1(prBalanceNew, prDecimals), t1(amBalanceNew, amDecimals)) | |
808 | 808 | let curPr = f1(curPrX18, scale8) | |
809 | 809 | let outAssetIdOrWaves = if ((outAssetId == "WAVES")) | |
818 | 818 | let burn = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
819 | 819 | if ((burn == burn)) | |
820 | 820 | then { | |
821 | - | let $ | |
821 | + | let $t03187332223 = { | |
822 | 822 | let feeAmountForCalc = if ((this == feeCollectorAddress)) | |
823 | 823 | then 0 | |
824 | 824 | else feeAmount | |
829 | 829 | then $Tuple2(-((totalGet + feeAmountForCalc)), 0) | |
830 | 830 | else $Tuple2(0, -((totalGet + feeAmountForCalc))) | |
831 | 831 | } | |
832 | - | let amountAssetBalanceDelta = $ | |
833 | - | let priceAssetBalanceDelta = $ | |
834 | - | let $ | |
835 | - | let refreshDLpActions = $ | |
836 | - | let updatedDLp = $ | |
832 | + | let amountAssetBalanceDelta = $t03187332223._1 | |
833 | + | let priceAssetBalanceDelta = $t03187332223._2 | |
834 | + | let $t03222632334 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0) | |
835 | + | let refreshDLpActions = $t03222632334._1 | |
836 | + | let updatedDLp = $t03222632334._2 | |
837 | 837 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
838 | 838 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
839 | 839 | then $Tuple2((state ++ refreshDLpActions), totalAmount) | |
1002 | 1002 | else throw("Strict value is not equal to itself.") | |
1003 | 1003 | } | |
1004 | 1004 | else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)] | |
1005 | - | let $ | |
1006 | - | let refreshDLpActions = $ | |
1007 | - | let updatedDLp = $ | |
1005 | + | let $t03648336625 = refreshDLpInternal(0, 0, 0) | |
1006 | + | let refreshDLpActions = $t03648336625._1 | |
1007 | + | let updatedDLp = $t03648336625._2 | |
1008 | 1008 | let check = if ((updatedDLp >= currentDLp)) | |
1009 | 1009 | then true | |
1010 | 1010 | else throwErr(makeString(["updated DLp lower than current DLp", toString(amountAssetBalance), toString(priceAssetBalance), toString(lpAssetEmission), toString(currentDLp), toString(updatedDLp)], " ")) | |
1077 | 1077 | else calcCurrentDLp(toBigInt(0), toBigInt(pmtAmt), toBigInt(0)) | |
1078 | 1078 | if ((currentDLp == currentDLp)) | |
1079 | 1079 | then { | |
1080 | - | let $ | |
1081 | - | if (($ | |
1080 | + | let $t03853138689 = calcPutOneTkn(pmtAmt, pmtAssetId, toString(userAddress), toBase58String(i.transactionId), true) | |
1081 | + | if (($t03853138689 == $t03853138689)) | |
1082 | 1082 | then { | |
1083 | - | let feeAmount = $ | |
1084 | - | let state = $ | |
1085 | - | let estimLP = $ | |
1083 | + | let feeAmount = $t03853138689._3 | |
1084 | + | let state = $t03853138689._2 | |
1085 | + | let estimLP = $t03853138689._1 | |
1086 | 1086 | let emitLpAmt = if (if ((minOutAmount > 0)) | |
1087 | 1087 | then (minOutAmount > estimLP) | |
1088 | 1088 | else false) | |
1110 | 1110 | let sendFeeToMatcher = if ((feeAmount > 0)) | |
1111 | 1111 | then [ScriptTransfer(feeCollectorAddress, feeAmount, fromBase58String(pmtAssetId))] | |
1112 | 1112 | else nil | |
1113 | - | let $ | |
1113 | + | let $t03950439853 = if ((this == feeCollectorAddress)) | |
1114 | 1114 | then $Tuple2(0, 0) | |
1115 | 1115 | else { | |
1116 | 1116 | let paymentInAmountAsset = if ((pmt.assetId == cfgAmountAssetId)) | |
1120 | 1120 | then $Tuple2(-(feeAmount), 0) | |
1121 | 1121 | else $Tuple2(0, -(feeAmount)) | |
1122 | 1122 | } | |
1123 | - | let amountAssetBalanceDelta = $ | |
1124 | - | let priceAssetBalanceDelta = $ | |
1125 | - | let $ | |
1126 | - | let refreshDLpActions = $ | |
1127 | - | let updatedDLp = $ | |
1123 | + | let amountAssetBalanceDelta = $t03950439853._1 | |
1124 | + | let priceAssetBalanceDelta = $t03950439853._2 | |
1125 | + | let $t03985639964 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0) | |
1126 | + | let refreshDLpActions = $t03985639964._1 | |
1127 | + | let updatedDLp = $t03985639964._2 | |
1128 | 1128 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1129 | 1129 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1130 | 1130 | then $Tuple2((((state ++ lpTrnsfr) ++ sendFeeToMatcher) ++ refreshDLpActions), emitLpAmt) | |
1156 | 1156 | let currentDLp = calcCurrentDLp(amAssetPmt, prAssetPmt, toBigInt(0)) | |
1157 | 1157 | if ((currentDLp == currentDLp)) | |
1158 | 1158 | then { | |
1159 | - | let $ | |
1160 | - | let refreshDLpActions = $ | |
1161 | - | let updatedDLp = $ | |
1159 | + | let $t04099441059 = refreshDLpInternal(0, 0, 0) | |
1160 | + | let refreshDLpActions = $t04099441059._1 | |
1161 | + | let updatedDLp = $t04099441059._2 | |
1162 | 1162 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1163 | 1163 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1164 | 1164 | then (state ++ refreshDLpActions) | |
1183 | 1183 | let b = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
1184 | 1184 | if ((b == b)) | |
1185 | 1185 | then { | |
1186 | - | let $ | |
1187 | - | let refreshDLpActions = $ | |
1188 | - | let updatedDLp = $ | |
1186 | + | let $t04223242314 = refreshDLpInternal(-(outAmtAmt), -(outPrAmt), 0) | |
1187 | + | let refreshDLpActions = $t04223242314._1 | |
1188 | + | let updatedDLp = $t04223242314._2 | |
1189 | 1189 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1190 | 1190 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1191 | 1191 | then (state ++ refreshDLpActions) | |
1220 | 1220 | else throwErr("exactly 1 payment are expected")] | |
1221 | 1221 | if ((checks == checks)) | |
1222 | 1222 | then { | |
1223 | - | let $ | |
1224 | - | let state = $ | |
1225 | - | let totalAmount = $ | |
1223 | + | let $t04293243087 = getOneTknV2Internal(outAssetId, minOutAmount, i.payments, i.caller, i.originCaller, i.transactionId) | |
1224 | + | let state = $t04293243087._1 | |
1225 | + | let totalAmount = $t04293243087._2 | |
1226 | 1226 | $Tuple2(state, totalAmount) | |
1227 | 1227 | } | |
1228 | 1228 | else throw("Strict value is not equal to itself.") | |
1239 | 1239 | if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight)) | |
1240 | 1240 | then { | |
1241 | 1241 | let dLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyDLp), "0")), fmtErr("invalid dLp")) | |
1242 | - | let $ | |
1243 | - | let dLpUpdateActions = $ | |
1244 | - | let updatedDLp = $ | |
1242 | + | let $t04361143675 = refreshDLpInternal(0, 0, 0) | |
1243 | + | let dLpUpdateActions = $t04361143675._1 | |
1244 | + | let updatedDLp = $t04361143675._2 | |
1245 | 1245 | let actions = if ((dLp != updatedDLp)) | |
1246 | 1246 | then dLpUpdateActions | |
1247 | 1247 | else throwErr("nothing to refresh") | |
1269 | 1269 | let newY = getYD(xp, index, D1) | |
1270 | 1270 | let dy = (xp[index] - newY) | |
1271 | 1271 | let totalGetRaw = max([0, toInt((dy - big1))]) | |
1272 | - | let $ | |
1273 | - | let totalGet = $ | |
1274 | - | let feeAmount = $ | |
1272 | + | let $t04460544654 = takeFee(totalGetRaw) | |
1273 | + | let totalGet = $t04460544654._1 | |
1274 | + | let feeAmount = $t04460544654._2 | |
1275 | 1275 | $Tuple2(nil, $Tuple2(totalGet, feeAmount)) | |
1276 | 1276 | } | |
1277 | 1277 | ||
1284 | 1284 | let lpId = toBase58String(value(cfgLpAssetId)) | |
1285 | 1285 | let amBalance = getAccBalance(amId) | |
1286 | 1286 | let prBalance = getAccBalance(prId) | |
1287 | - | let $ | |
1287 | + | let $t04502945144 = { | |
1288 | 1288 | let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, lpAssetAmount], nil) | |
1289 | 1289 | if ($isInstanceOf(@, "(Int, Int)")) | |
1290 | 1290 | then @ | |
1291 | 1291 | else throw(($getType(@) + " couldn't be cast to (Int, Int)")) | |
1292 | 1292 | } | |
1293 | - | let totalGet = $ | |
1294 | - | let feeAmount = $ | |
1293 | + | let totalGet = $t04502945144._1 | |
1294 | + | let feeAmount = $t04502945144._2 | |
1295 | 1295 | let r = ego("", lpId, lpAssetAmount, this) | |
1296 | 1296 | let outAmAmt = r._1 | |
1297 | 1297 | let outPrAmt = r._2 | |
1337 | 1337 | let burnLPAssetOnFactory = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
1338 | 1338 | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
1339 | 1339 | then { | |
1340 | - | let $ | |
1341 | - | let refreshDLpActions = $ | |
1342 | - | let updatedDLp = $ | |
1340 | + | let $t04668346764 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0) | |
1341 | + | let refreshDLpActions = $t04668346764._1 | |
1342 | + | let updatedDLp = $t04668346764._2 | |
1343 | 1343 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1344 | 1344 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1345 | 1345 | then (state ++ refreshDLpActions) | |
1390 | 1390 | let burnA = invoke(fca, "burn", [amount], [AttachedPayment(lpAssetId, amount)]) | |
1391 | 1391 | if ((burnA == burnA)) | |
1392 | 1392 | then { | |
1393 | - | let $ | |
1394 | - | let refreshDLpActions = $ | |
1395 | - | let updatedDLp = $ | |
1393 | + | let $t04778847869 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0) | |
1394 | + | let refreshDLpActions = $t04778847869._1 | |
1395 | + | let updatedDLp = $t04778847869._2 | |
1396 | 1396 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1397 | 1397 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1398 | 1398 | then (state ++ refreshDLpActions) | |
1439 | 1439 | let burnLPAssetOnFactory = invoke(fca, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)]) | |
1440 | 1440 | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
1441 | 1441 | then { | |
1442 | - | let $ | |
1443 | - | let refreshDLpActions = $ | |
1444 | - | let updatedDLp = $ | |
1442 | + | let $t04911749198 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0) | |
1443 | + | let refreshDLpActions = $t04911749198._1 | |
1444 | + | let updatedDLp = $t04911749198._2 | |
1445 | 1445 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1446 | 1446 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1447 | 1447 | then (state ++ refreshDLpActions) | |
1486 | 1486 | let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), unstakeAmount], nil) | |
1487 | 1487 | if ((unstakeInv == unstakeInv)) | |
1488 | 1488 | then { | |
1489 | - | let $ | |
1490 | - | let state = $ | |
1491 | - | let totalAmount = $ | |
1489 | + | let $t05009350281 = getOneTknV2Internal(outAssetId, minOutAmount, [AttachedPayment(lpAssetId, unstakeAmount)], i.caller, i.originCaller, i.transactionId) | |
1490 | + | let state = $t05009350281._1 | |
1491 | + | let totalAmount = $t05009350281._2 | |
1492 | 1492 | $Tuple2(state, totalAmount) | |
1493 | 1493 | } | |
1494 | 1494 | else throw("Strict value is not equal to itself.") | |
1500 | 1500 | ||
1501 | 1501 | @Callable(i) | |
1502 | 1502 | func putOneTknV2WithBonusREADONLY (paymentAmountRaw,paymentAssetId) = { | |
1503 | - | let $ | |
1504 | - | let lpAmount = $ | |
1505 | - | let state = $ | |
1506 | - | let feeAmount = $ | |
1507 | - | let bonus = $ | |
1503 | + | let $t05040950512 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", true) | |
1504 | + | let lpAmount = $t05040950512._1 | |
1505 | + | let state = $t05040950512._2 | |
1506 | + | let feeAmount = $t05040950512._3 | |
1507 | + | let bonus = $t05040950512._4 | |
1508 | 1508 | $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus)) | |
1509 | 1509 | } | |
1510 | 1510 | ||
1512 | 1512 | ||
1513 | 1513 | @Callable(i) | |
1514 | 1514 | func putOneTknV2WithoutTakeFeeREADONLY (paymentAmountRaw,paymentAssetId) = { | |
1515 | - | let $ | |
1516 | - | let lpAmount = $ | |
1517 | - | let state = $ | |
1518 | - | let feeAmount = $ | |
1519 | - | let bonus = $ | |
1515 | + | let $t05066050764 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", false) | |
1516 | + | let lpAmount = $t05066050764._1 | |
1517 | + | let state = $t05066050764._2 | |
1518 | + | let feeAmount = $t05066050764._3 | |
1519 | + | let bonus = $t05066050764._4 | |
1520 | 1520 | $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus)) | |
1521 | 1521 | } | |
1522 | 1522 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let scale8 = 100000000 | |
5 | 5 | ||
6 | 6 | let scale8BigInt = toBigInt(100000000) | |
7 | 7 | ||
8 | 8 | let scale18 = toBigInt(1000000000000000000) | |
9 | 9 | ||
10 | 10 | let zeroBigInt = toBigInt(0) | |
11 | 11 | ||
12 | 12 | let big0 = toBigInt(0) | |
13 | 13 | ||
14 | 14 | let big1 = toBigInt(1) | |
15 | 15 | ||
16 | 16 | let big2 = toBigInt(2) | |
17 | 17 | ||
18 | 18 | let big3 = toBigInt(3) | |
19 | 19 | ||
20 | 20 | let big4 = toBigInt(4) | |
21 | 21 | ||
22 | 22 | let slippage4D = toBigInt((scale8 - ((scale8 * 1) / scale8))) | |
23 | 23 | ||
24 | 24 | let wavesString = "WAVES" | |
25 | 25 | ||
26 | 26 | let Amult = "100" | |
27 | 27 | ||
28 | 28 | let Dconv = "1" | |
29 | 29 | ||
30 | 30 | let SEP = "__" | |
31 | 31 | ||
32 | 32 | let EMPTY = "" | |
33 | 33 | ||
34 | 34 | let PoolActive = 1 | |
35 | 35 | ||
36 | 36 | let PoolPutDis = 2 | |
37 | 37 | ||
38 | 38 | let PoolMatcherDis = 3 | |
39 | 39 | ||
40 | 40 | let PoolShutdown = 4 | |
41 | 41 | ||
42 | 42 | let idxPoolAddress = 1 | |
43 | 43 | ||
44 | 44 | let idxPoolSt = 2 | |
45 | 45 | ||
46 | 46 | let idxLPAsId = 3 | |
47 | 47 | ||
48 | 48 | let idxAmAsId = 4 | |
49 | 49 | ||
50 | 50 | let idxPrAsId = 5 | |
51 | 51 | ||
52 | 52 | let idxAmtAsDcm = 6 | |
53 | 53 | ||
54 | 54 | let idxPriceAsDcm = 7 | |
55 | 55 | ||
56 | 56 | let idxIAmtAsId = 8 | |
57 | 57 | ||
58 | 58 | let idxIPriceAsId = 9 | |
59 | 59 | ||
60 | 60 | let idxFactStakCntr = 1 | |
61 | 61 | ||
62 | 62 | let idxFactoryRestCntr = 6 | |
63 | 63 | ||
64 | 64 | let idxFactSlippCntr = 7 | |
65 | 65 | ||
66 | 66 | let idxFactGwxRewCntr = 10 | |
67 | 67 | ||
68 | 68 | let feeDefault = fraction(10, scale8, 10000) | |
69 | 69 | ||
70 | 70 | func t1 (origVal,origScaleMult) = fraction(toBigInt(origVal), scale18, toBigInt(origScaleMult)) | |
71 | 71 | ||
72 | 72 | ||
73 | 73 | func f1 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), scale18)) | |
74 | 74 | ||
75 | 75 | ||
76 | 76 | func fromX18Round (val,resultScaleMult,round) = toInt(fraction(val, toBigInt(resultScaleMult), scale18, round)) | |
77 | 77 | ||
78 | 78 | ||
79 | 79 | func ts (amt,resScale,curScale) = fraction(amt, resScale, curScale) | |
80 | 80 | ||
81 | 81 | ||
82 | 82 | func abs (val) = if ((zeroBigInt > val)) | |
83 | 83 | then -(val) | |
84 | 84 | else val | |
85 | 85 | ||
86 | 86 | ||
87 | 87 | func absBigInt (val) = if ((zeroBigInt > val)) | |
88 | 88 | then -(val) | |
89 | 89 | else val | |
90 | 90 | ||
91 | 91 | ||
92 | 92 | func fc () = "%s__factoryContract" | |
93 | 93 | ||
94 | 94 | ||
95 | 95 | func mpk () = "%s__managerPublicKey" | |
96 | 96 | ||
97 | 97 | ||
98 | 98 | func pmpk () = "%s__pendingManagerPublicKey" | |
99 | 99 | ||
100 | 100 | ||
101 | 101 | func pl () = "%s%s__price__last" | |
102 | 102 | ||
103 | 103 | ||
104 | 104 | func ph (h,t) = makeString(["%s%s%d%d__price__history", toString(h), toString(t)], SEP) | |
105 | 105 | ||
106 | 106 | ||
107 | 107 | func pau (ua,txId) = ((("%s%s%s__P__" + ua) + "__") + txId) | |
108 | 108 | ||
109 | 109 | ||
110 | 110 | func gau (ua,txId) = ((("%s%s%s__G__" + ua) + "__") + txId) | |
111 | 111 | ||
112 | 112 | ||
113 | 113 | func aa () = "%s__amountAsset" | |
114 | 114 | ||
115 | 115 | ||
116 | 116 | func pa () = "%s__priceAsset" | |
117 | 117 | ||
118 | 118 | ||
119 | 119 | func amp () = "%s__amp" | |
120 | 120 | ||
121 | 121 | ||
122 | 122 | func ada () = "%s__addonAddr" | |
123 | 123 | ||
124 | 124 | ||
125 | 125 | let keyFee = "%s__fee" | |
126 | 126 | ||
127 | 127 | let fee = valueOrElse(getInteger(this, keyFee), feeDefault) | |
128 | 128 | ||
129 | 129 | let keyDLp = makeString(["%s", "dLp"], SEP) | |
130 | 130 | ||
131 | 131 | let keyDLpRefreshedHeight = makeString(["%s", "dLpRefreshedHeight"], SEP) | |
132 | 132 | ||
133 | 133 | let keyDLpRefreshDelay = makeString(["%s", "refreshDLpDelay"], SEP) | |
134 | 134 | ||
135 | 135 | let dLpRefreshDelayDefault = 1 | |
136 | 136 | ||
137 | 137 | let dLpRefreshDelay = valueOrElse(getInteger(this, keyDLpRefreshDelay), dLpRefreshDelayDefault) | |
138 | 138 | ||
139 | 139 | func fcfg () = "%s__factoryConfig" | |
140 | 140 | ||
141 | 141 | ||
142 | 142 | func mtpk () = "%s%s__matcher__publicKey" | |
143 | 143 | ||
144 | 144 | ||
145 | 145 | func pc (iAmtAs,iPrAs) = (((("%d%d%s__" + iAmtAs) + "__") + iPrAs) + "__config") | |
146 | 146 | ||
147 | 147 | ||
148 | 148 | func mba (bAStr) = ("%s%s%s__mappings__baseAsset2internalId__" + bAStr) | |
149 | 149 | ||
150 | 150 | ||
151 | 151 | func aps () = "%s__shutdown" | |
152 | 152 | ||
153 | 153 | ||
154 | 154 | func keyAllowedLpStableScriptHash () = "%s__allowedLpStableScriptHash" | |
155 | 155 | ||
156 | 156 | ||
157 | 157 | func keyFeeCollectorAddress () = "%s__feeCollectorAddress" | |
158 | 158 | ||
159 | 159 | ||
160 | 160 | func toe (orV,sendrV,matchV) = throw(((((("Failed: ordValid=" + toString(orV)) + " sndrValid=") + toString(sendrV)) + " mtchrValid=") + toString(matchV))) | |
161 | 161 | ||
162 | 162 | ||
163 | 163 | func strf (addr,key) = valueOrErrorMessage(getString(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], "")) | |
164 | 164 | ||
165 | 165 | ||
166 | 166 | func intf (addr,key) = valueOrErrorMessage(getInteger(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], "")) | |
167 | 167 | ||
168 | 168 | ||
169 | 169 | func throwErr (msg) = throw(makeString(["lp_stable.ride:", msg], " ")) | |
170 | 170 | ||
171 | 171 | ||
172 | 172 | func fmtErr (msg) = makeString(["lp_stable.ride:", msg], " ") | |
173 | 173 | ||
174 | 174 | ||
175 | 175 | let fca = addressFromStringValue(strf(this, fc())) | |
176 | 176 | ||
177 | 177 | let A = strf(this, amp()) | |
178 | 178 | ||
179 | 179 | func igs () = valueOrElse(getBoolean(fca, aps()), false) | |
180 | 180 | ||
181 | 181 | ||
182 | 182 | func mp () = fromBase58String(strf(fca, mtpk())) | |
183 | 183 | ||
184 | 184 | ||
185 | 185 | let feeCollectorAddress = addressFromStringValue(strf(fca, keyFeeCollectorAddress())) | |
186 | 186 | ||
187 | 187 | func gpc () = { | |
188 | 188 | let amtAs = strf(this, aa()) | |
189 | 189 | let priceAs = strf(this, pa()) | |
190 | 190 | let iPriceAs = intf(fca, mba(priceAs)) | |
191 | 191 | let iAmtAs = intf(fca, mba(amtAs)) | |
192 | 192 | split(strf(fca, pc(toString(iAmtAs), toString(iPriceAs))), SEP) | |
193 | 193 | } | |
194 | 194 | ||
195 | 195 | ||
196 | 196 | func parseAssetId (input) = if ((input == wavesString)) | |
197 | 197 | then unit | |
198 | 198 | else fromBase58String(input) | |
199 | 199 | ||
200 | 200 | ||
201 | 201 | func assetIdToString (input) = if ((input == unit)) | |
202 | 202 | then wavesString | |
203 | 203 | else toBase58String(value(input)) | |
204 | 204 | ||
205 | 205 | ||
206 | 206 | func parsePoolConfig (poolConfig) = $Tuple9(addressFromStringValue(poolConfig[idxPoolAddress]), parseIntValue(poolConfig[idxPoolSt]), fromBase58String(poolConfig[idxLPAsId]), parseAssetId(poolConfig[idxAmAsId]), parseAssetId(poolConfig[idxPrAsId]), parseIntValue(poolConfig[idxAmtAsDcm]), parseIntValue(poolConfig[idxPriceAsDcm]), fromBase58String(poolConfig[idxIAmtAsId]), fromBase58String(poolConfig[idxIPriceAsId])) | |
207 | 207 | ||
208 | 208 | ||
209 | 209 | let poolConfigParsed = parsePoolConfig(gpc()) | |
210 | 210 | ||
211 | 211 | let $t073837612 = poolConfigParsed | |
212 | 212 | ||
213 | 213 | let cfgPoolAddress = $t073837612._1 | |
214 | 214 | ||
215 | 215 | let cfgPoolStatus = $t073837612._2 | |
216 | 216 | ||
217 | 217 | let cfgLpAssetId = $t073837612._3 | |
218 | 218 | ||
219 | 219 | let cfgAmountAssetId = $t073837612._4 | |
220 | 220 | ||
221 | 221 | let cfgPriceAssetId = $t073837612._5 | |
222 | 222 | ||
223 | 223 | let cfgAmountAssetDecimals = $t073837612._6 | |
224 | 224 | ||
225 | 225 | let cfgPriceAssetDecimals = $t073837612._7 | |
226 | 226 | ||
227 | 227 | let cfgInAmountAssedId = $t073837612._8 | |
228 | 228 | ||
229 | 229 | let cfgInPriceAssetId = $t073837612._9 | |
230 | 230 | ||
231 | 231 | func gfc () = split(strf(fca, fcfg()), SEP) | |
232 | 232 | ||
233 | 233 | ||
234 | 234 | let factoryConfig = gfc() | |
235 | 235 | ||
236 | 236 | let stakingContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactStakCntr]), "Invalid staking contract address") | |
237 | 237 | ||
238 | 238 | let slipageContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactSlippCntr]), "Invalid slipage contract address") | |
239 | 239 | ||
240 | 240 | let gwxContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactGwxRewCntr]), "Invalid gwx contract address") | |
241 | 241 | ||
242 | 242 | let restContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactoryRestCntr]), "Invalid gwx contract address") | |
243 | 243 | ||
244 | 244 | func dataPutActionInfo (inAmtAssetAmt,inPriceAssetAmt,outLpAmt,price,slipByUser,slippageReal,txHeight,txTimestamp,slipageAmAmt,slipagePrAmt) = makeString(["%d%d%d%d%d%d%d%d%d%d", toString(inAmtAssetAmt), toString(inPriceAssetAmt), toString(outLpAmt), toString(price), toString(slipByUser), toString(slippageReal), toString(txHeight), toString(txTimestamp), toString(slipageAmAmt), toString(slipagePrAmt)], SEP) | |
245 | 245 | ||
246 | 246 | ||
247 | 247 | func dataGetActionInfo (outAmtAssetAmt,outPriceAssetAmt,inLpAmt,price,txHeight,txTimestamp) = makeString(["%d%d%d%d%d%d", toString(outAmtAssetAmt), toString(outPriceAssetAmt), toString(inLpAmt), toString(price), toString(txHeight), toString(txTimestamp)], SEP) | |
248 | 248 | ||
249 | 249 | ||
250 | 250 | func getAccBalance (assetId) = if ((assetId == "WAVES")) | |
251 | 251 | then wavesBalance(this).available | |
252 | 252 | else assetBalance(this, fromBase58String(assetId)) | |
253 | 253 | ||
254 | 254 | ||
255 | 255 | func cpbi (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18) | |
256 | 256 | ||
257 | 257 | ||
258 | 258 | func cpbir (prAmtX18,amAmtX18,round) = fraction(prAmtX18, scale18, amAmtX18, round) | |
259 | 259 | ||
260 | 260 | ||
261 | 261 | func vad (A1,A2,slippage) = { | |
262 | 262 | let diff = fraction((A1 - A2), scale8BigInt, A2) | |
263 | 263 | let pass = ((slippage - abs(diff)) > zeroBigInt) | |
264 | 264 | if (!(pass)) | |
265 | 265 | then throw(("Big slpg: " + toString(diff))) | |
266 | 266 | else $Tuple2(pass, min([A1, A2])) | |
267 | 267 | } | |
268 | 268 | ||
269 | 269 | ||
270 | 270 | func vd (D1,D0,slpg) = { | |
271 | 271 | let diff = fraction(D0, scale8BigInt, D1) | |
272 | 272 | let fail = (slpg > diff) | |
273 | 273 | if (if (fail) | |
274 | 274 | then true | |
275 | 275 | else (D0 > D1)) | |
276 | 276 | then throw(((((((toString(D0) + " ") + toString(D1)) + " ") + toString(diff)) + " ") + toString(slpg))) | |
277 | 277 | else fail | |
278 | 278 | } | |
279 | 279 | ||
280 | 280 | ||
281 | 281 | func pcp (amAssetDcm,prAssetDcm,amAmt,prAmt) = { | |
282 | 282 | let amtAsAmtX18 = t1(amAmt, amAssetDcm) | |
283 | 283 | let prAsAmtX18 = t1(prAmt, prAssetDcm) | |
284 | 284 | cpbi(prAsAmtX18, amtAsAmtX18) | |
285 | 285 | } | |
286 | 286 | ||
287 | 287 | ||
288 | 288 | func calcPrices (amAmt,prAmt,lpAmt) = { | |
289 | 289 | let amtAsDcm = cfgAmountAssetDecimals | |
290 | 290 | let prAsDcm = cfgPriceAssetDecimals | |
291 | 291 | let priceX18 = pcp(amtAsDcm, prAsDcm, amAmt, prAmt) | |
292 | 292 | let amAmtX18 = t1(amAmt, amtAsDcm) | |
293 | 293 | let prAmtX18 = t1(prAmt, prAsDcm) | |
294 | 294 | let lpAmtX18 = t1(lpAmt, scale8) | |
295 | 295 | let lpPrInAmAsX18 = cpbi(amAmtX18, lpAmtX18) | |
296 | 296 | let lpPrInPrAsX18 = cpbi(prAmtX18, lpAmtX18) | |
297 | 297 | [priceX18, lpPrInAmAsX18, lpPrInPrAsX18] | |
298 | 298 | } | |
299 | 299 | ||
300 | 300 | ||
301 | 301 | func calculatePrices (amAmt,prAmt,lpAmt) = { | |
302 | 302 | let p = calcPrices(amAmt, prAmt, lpAmt) | |
303 | 303 | [f1(p[0], scale8), f1(p[1], scale8), f1(p[2], scale8)] | |
304 | 304 | } | |
305 | 305 | ||
306 | 306 | ||
307 | 307 | func takeFee (amount) = { | |
308 | 308 | let feeAmount = fraction(amount, fee, scale8) | |
309 | 309 | $Tuple2((amount - feeAmount), feeAmount) | |
310 | 310 | } | |
311 | 311 | ||
312 | 312 | ||
313 | 313 | func ego (txId58,pmtAssetId,pmtLpAmt,userAddress) = { | |
314 | 314 | let lpId = cfgLpAssetId | |
315 | 315 | let amId = toBase58String(value(cfgAmountAssetId)) | |
316 | 316 | let prId = toBase58String(value(cfgPriceAssetId)) | |
317 | 317 | let amDcm = cfgAmountAssetDecimals | |
318 | 318 | let prDcm = cfgPriceAssetDecimals | |
319 | 319 | let sts = toString(cfgPoolStatus) | |
320 | 320 | let lpEmiss = valueOrErrorMessage(assetInfo(lpId), "Wrong LP id").quantity | |
321 | 321 | if ((toBase58String(lpId) != pmtAssetId)) | |
322 | 322 | then throw("Wrong pmt asset") | |
323 | 323 | else { | |
324 | 324 | let amBalance = getAccBalance(amId) | |
325 | 325 | let amBalanceX18 = t1(amBalance, amDcm) | |
326 | 326 | let prBalance = getAccBalance(prId) | |
327 | 327 | let prBalanceX18 = t1(prBalance, prDcm) | |
328 | 328 | let curPriceX18 = cpbi(prBalanceX18, amBalanceX18) | |
329 | 329 | let curPrice = f1(curPriceX18, scale8) | |
330 | 330 | let pmtLpAmtX18 = t1(pmtLpAmt, scale8) | |
331 | 331 | let lpEmissX18 = t1(lpEmiss, scale8) | |
332 | 332 | let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissX18) | |
333 | 333 | let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissX18) | |
334 | 334 | let outAmAmt = fromX18Round(outAmAmtX18, amDcm, FLOOR) | |
335 | 335 | let outPrAmt = fromX18Round(outPrAmtX18, prDcm, FLOOR) | |
336 | 336 | let state = if ((txId58 == "")) | |
337 | 337 | then nil | |
338 | 338 | else [ScriptTransfer(userAddress, outAmAmt, if ((amId == "WAVES")) | |
339 | 339 | then unit | |
340 | 340 | else fromBase58String(amId)), ScriptTransfer(userAddress, outPrAmt, if ((prId == "WAVES")) | |
341 | 341 | then unit | |
342 | 342 | else fromBase58String(prId)), StringEntry(gau(toString(userAddress), txId58), dataGetActionInfo(outAmAmt, outPrAmt, pmtLpAmt, curPrice, height, lastBlock.timestamp)), IntegerEntry(pl(), curPrice), IntegerEntry(ph(height, lastBlock.timestamp), curPrice)] | |
343 | 343 | $Tuple10(outAmAmt, outPrAmt, amId, prId, amBalance, prBalance, lpEmiss, curPriceX18, sts, state) | |
344 | 344 | } | |
345 | 345 | } | |
346 | 346 | ||
347 | 347 | ||
348 | 348 | func epo (txId58,slippage,inAmAmt,inAmId,inPrAmt,inPrId,userAddress,isEval,emitLp,isOneAsset,validateSlippage,pmtAmt,pmtId) = { | |
349 | 349 | let lpId = cfgLpAssetId | |
350 | 350 | let amIdStr = toBase58String(value(cfgAmountAssetId)) | |
351 | 351 | let prIdStr = toBase58String(value(cfgPriceAssetId)) | |
352 | 352 | let inAmIdStr = cfgInAmountAssedId | |
353 | 353 | let inPrIdStr = cfgInPriceAssetId | |
354 | 354 | let amtDcm = cfgAmountAssetDecimals | |
355 | 355 | let priceDcm = cfgPriceAssetDecimals | |
356 | 356 | let sts = toString(cfgPoolStatus) | |
357 | 357 | let lpEm = valueOrErrorMessage(assetInfo(lpId), "Wr lp as").quantity | |
358 | 358 | let amBalance = if (isEval) | |
359 | 359 | then getAccBalance(amIdStr) | |
360 | 360 | else if (if (isOneAsset) | |
361 | 361 | then (pmtId == amIdStr) | |
362 | 362 | else false) | |
363 | 363 | then (getAccBalance(amIdStr) - pmtAmt) | |
364 | 364 | else if (isOneAsset) | |
365 | 365 | then getAccBalance(amIdStr) | |
366 | 366 | else (getAccBalance(amIdStr) - inAmAmt) | |
367 | 367 | let prBalance = if (isEval) | |
368 | 368 | then getAccBalance(prIdStr) | |
369 | 369 | else if (if (isOneAsset) | |
370 | 370 | then (pmtId == prIdStr) | |
371 | 371 | else false) | |
372 | 372 | then (getAccBalance(prIdStr) - pmtAmt) | |
373 | 373 | else if (isOneAsset) | |
374 | 374 | then getAccBalance(prIdStr) | |
375 | 375 | else (getAccBalance(prIdStr) - inPrAmt) | |
376 | 376 | let inAmAssetAmtX18 = t1(inAmAmt, amtDcm) | |
377 | 377 | let inPrAssetAmtX18 = t1(inPrAmt, priceDcm) | |
378 | 378 | let userPriceX18 = cpbi(inPrAssetAmtX18, inAmAssetAmtX18) | |
379 | 379 | let amBalanceX18 = t1(amBalance, amtDcm) | |
380 | 380 | let prBalanceX18 = t1(prBalance, priceDcm) | |
381 | 381 | let r = if ((lpEm == 0)) | |
382 | 382 | then { | |
383 | 383 | let curPriceX18 = zeroBigInt | |
384 | 384 | let slippageX18 = zeroBigInt | |
385 | 385 | let lpAmtX18 = pow((inAmAssetAmtX18 * inPrAssetAmtX18), 0, toBigInt(5), 1, 0, DOWN) | |
386 | 386 | $Tuple5(f1(lpAmtX18, scale8), f1(inAmAssetAmtX18, amtDcm), f1(inPrAssetAmtX18, priceDcm), cpbi((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18) | |
387 | 387 | } | |
388 | 388 | else { | |
389 | - | let curPriceX18 = | |
389 | + | let curPriceX18 = cpbi(prBalanceX18, amBalanceX18) | |
390 | 390 | let slippageRealX18 = fraction(abs((curPriceX18 - userPriceX18)), scale18, curPriceX18) | |
391 | 391 | let slippageX18 = t1(slippage, scale8) | |
392 | 392 | if (if (if (validateSlippage) | |
393 | 393 | then (curPriceX18 != zeroBigInt) | |
394 | 394 | else false) | |
395 | 395 | then (slippageRealX18 > slippageX18) | |
396 | 396 | else false) | |
397 | 397 | then throw(((("Price slippage " + toString(slippageRealX18)) + " > ") + toString(slippageX18))) | |
398 | 398 | else { | |
399 | 399 | let lpEmissionX18 = t1(lpEm, scale8) | |
400 | - | let prViaAmX18 = fraction(inAmAssetAmtX18, | |
401 | - | let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, | |
400 | + | let prViaAmX18 = fraction(inAmAssetAmtX18, cpbir(prBalanceX18, amBalanceX18, CEILING), scale18, CEILING) | |
401 | + | let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, cpbir(prBalanceX18, amBalanceX18, FLOOR), CEILING) | |
402 | 402 | let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18)) | |
403 | 403 | then $Tuple2(amViaPrX18, inPrAssetAmtX18) | |
404 | 404 | else $Tuple2(inAmAssetAmtX18, prViaAmX18) | |
405 | 405 | let expAmtAssetAmtX18 = expectedAmts._1 | |
406 | 406 | let expPriceAssetAmtX18 = expectedAmts._2 | |
407 | - | let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18) | |
407 | + | let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18, FLOOR) | |
408 | 408 | $Tuple5(fromX18Round(lpAmtX18, scale8, FLOOR), fromX18Round(expAmtAssetAmtX18, amtDcm, CEILING), fromX18Round(expPriceAssetAmtX18, priceDcm, CEILING), curPriceX18, slippageX18) | |
409 | 409 | } | |
410 | 410 | } | |
411 | 411 | let calcLpAmt = r._1 | |
412 | 412 | let calcAmAssetPmt = r._2 | |
413 | 413 | let calcPrAssetPmt = r._3 | |
414 | 414 | let curPrice = f1(r._4, scale8) | |
415 | 415 | let slippageCalc = f1(r._5, scale8) | |
416 | 416 | if ((0 >= calcLpAmt)) | |
417 | 417 | then throw("LP <= 0") | |
418 | 418 | else { | |
419 | 419 | let emitLpAmt = if (!(emitLp)) | |
420 | 420 | then 0 | |
421 | 421 | else calcLpAmt | |
422 | 422 | let amDiff = (inAmAmt - calcAmAssetPmt) | |
423 | 423 | let prDiff = (inPrAmt - calcPrAssetPmt) | |
424 | - | let $ | |
424 | + | let $t01838418729 = if (if (isOneAsset) | |
425 | 425 | then (pmtId == amIdStr) | |
426 | 426 | else false) | |
427 | 427 | then $Tuple2(pmtAmt, 0) | |
428 | 428 | else if (if (isOneAsset) | |
429 | 429 | then (pmtId == prIdStr) | |
430 | 430 | else false) | |
431 | 431 | then $Tuple2(0, pmtAmt) | |
432 | 432 | else $Tuple2(calcAmAssetPmt, calcPrAssetPmt) | |
433 | - | let writeAmAmt = $ | |
434 | - | let writePrAmt = $ | |
433 | + | let writeAmAmt = $t01838418729._1 | |
434 | + | let writePrAmt = $t01838418729._2 | |
435 | 435 | let commonState = [IntegerEntry(pl(), curPrice), IntegerEntry(ph(height, lastBlock.timestamp), curPrice), StringEntry(pau(userAddress, txId58), dataPutActionInfo(writeAmAmt, writePrAmt, emitLpAmt, curPrice, slippage, slippageCalc, height, lastBlock.timestamp, amDiff, prDiff))] | |
436 | 436 | $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEm, lpId, sts, commonState, amDiff, prDiff, inAmId, inPrId) | |
437 | 437 | } | |
438 | 438 | } | |
439 | 439 | ||
440 | 440 | ||
441 | 441 | func getD (xp) = { | |
442 | 442 | let xp0 = xp[0] | |
443 | 443 | let xp1 = xp[1] | |
444 | 444 | let s = (xp0 + xp1) | |
445 | 445 | if ((s == big0)) | |
446 | 446 | then big0 | |
447 | 447 | else { | |
448 | 448 | let a = parseIntValue(A) | |
449 | 449 | let ann = (a * 2) | |
450 | 450 | let p = fraction(xp0, xp1, big1) | |
451 | 451 | let xp0_xp1_n_n = fraction(p, big4, big1) | |
452 | 452 | let ann_s = fraction(toBigInt(ann), s, big1) | |
453 | 453 | let ann_1 = toBigInt((ann - 1)) | |
454 | 454 | func calcDNext (d) = { | |
455 | 455 | let dd = fraction(d, d, big1) | |
456 | 456 | let ddd = fraction(dd, d, big1) | |
457 | 457 | let dp = fraction(ddd, big1, xp0_xp1_n_n) | |
458 | 458 | fraction((ann_s + fraction(dp, big2, big1)), d, (fraction(ann_1, d, big1) + fraction(big3, dp, big1)), CEILING) | |
459 | 459 | } | |
460 | 460 | ||
461 | 461 | func calc (acc,i) = if (acc._2) | |
462 | 462 | then acc | |
463 | 463 | else { | |
464 | 464 | let d = acc._1 | |
465 | 465 | let dNext = calcDNext(d) | |
466 | 466 | let dDiffRaw = toInt((dNext - value(d))) | |
467 | 467 | let dDiff = if ((0 > dDiffRaw)) | |
468 | 468 | then -(dDiffRaw) | |
469 | 469 | else dDiffRaw | |
470 | 470 | if ((1 >= dDiff)) | |
471 | 471 | then $Tuple2(dNext, true) | |
472 | 472 | else $Tuple2(dNext, false) | |
473 | 473 | } | |
474 | 474 | ||
475 | 475 | let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] | |
476 | - | let $ | |
476 | + | let $t02065720705 = { | |
477 | 477 | let $l = arr | |
478 | 478 | let $s = size($l) | |
479 | 479 | let $acc0 = $Tuple2(s, false) | |
480 | 480 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
481 | 481 | then $a | |
482 | 482 | else calc($a, $l[$i]) | |
483 | 483 | ||
484 | 484 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
485 | 485 | then $a | |
486 | 486 | else throw("List size exceeds 15") | |
487 | 487 | ||
488 | 488 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($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), 11), 12), 13), 14), 15) | |
489 | 489 | } | |
490 | - | let d = $ | |
491 | - | let found = $ | |
490 | + | let d = $t02065720705._1 | |
491 | + | let found = $t02065720705._2 | |
492 | 492 | if (found) | |
493 | 493 | then d | |
494 | 494 | else throw(("D calculation error, D = " + toString(d))) | |
495 | 495 | } | |
496 | 496 | } | |
497 | 497 | ||
498 | 498 | ||
499 | 499 | func getDOld (xp) = { | |
500 | 500 | let n = big2 | |
501 | 501 | let xp0 = xp[0] | |
502 | 502 | let xp1 = xp[1] | |
503 | 503 | let aPrecision = parseBigIntValue(Amult) | |
504 | 504 | let a = (parseBigIntValue(A) * aPrecision) | |
505 | 505 | let s = (xp0 + xp1) | |
506 | 506 | if ((s == big0)) | |
507 | 507 | then big0 | |
508 | 508 | else { | |
509 | 509 | let ann = (a * n) | |
510 | 510 | let xp0_xp1_n_n = (((xp0 * xp1) * n) * n) | |
511 | 511 | let ann_s_aPrecision = ((ann * s) / aPrecision) | |
512 | 512 | let ann_aPrecision = (ann - aPrecision) | |
513 | 513 | let n1 = (n + big1) | |
514 | 514 | func calc (acc,cur) = { | |
515 | - | let $ | |
516 | - | let d = $ | |
517 | - | let found = $ | |
515 | + | let $t02133421354 = acc | |
516 | + | let d = $t02133421354._1 | |
517 | + | let found = $t02133421354._2 | |
518 | 518 | if ((found != unit)) | |
519 | 519 | then acc | |
520 | 520 | else { | |
521 | 521 | let dp = (((d * d) * d) / xp0_xp1_n_n) | |
522 | 522 | let dNext = (((ann_s_aPrecision + (dp * n)) * d) / (((ann_aPrecision * d) / aPrecision) + (n1 * dp))) | |
523 | 523 | let dDiff = absBigInt((dNext - value(d))) | |
524 | 524 | if ((big1 >= dDiff)) | |
525 | 525 | then $Tuple2(dNext, cur) | |
526 | 526 | else $Tuple2(dNext, unit) | |
527 | 527 | } | |
528 | 528 | } | |
529 | 529 | ||
530 | 530 | let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] | |
531 | - | let $ | |
531 | + | let $t02177521822 = { | |
532 | 532 | let $l = arr | |
533 | 533 | let $s = size($l) | |
534 | 534 | let $acc0 = $Tuple2(s, unit) | |
535 | 535 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
536 | 536 | then $a | |
537 | 537 | else calc($a, $l[$i]) | |
538 | 538 | ||
539 | 539 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
540 | 540 | then $a | |
541 | 541 | else throw("List size exceeds 15") | |
542 | 542 | ||
543 | 543 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($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), 11), 12), 13), 14), 15) | |
544 | 544 | } | |
545 | - | let d = $ | |
546 | - | let found = $ | |
545 | + | let d = $t02177521822._1 | |
546 | + | let found = $t02177521822._2 | |
547 | 547 | if ((found != unit)) | |
548 | 548 | then d | |
549 | 549 | else throw(("D calculation error, D = " + toString(d))) | |
550 | 550 | } | |
551 | 551 | } | |
552 | 552 | ||
553 | 553 | ||
554 | 554 | func getYD (xp,i,D) = { | |
555 | 555 | let n = big2 | |
556 | 556 | let x = xp[if ((i == 0)) | |
557 | 557 | then 1 | |
558 | 558 | else 0] | |
559 | 559 | let aPrecision = parseBigIntValue(Amult) | |
560 | 560 | let a = (parseBigIntValue(A) * aPrecision) | |
561 | 561 | let s = x | |
562 | 562 | let ann = (a * n) | |
563 | 563 | let c = (((((D * D) / (x * n)) * D) * aPrecision) / (ann * n)) | |
564 | 564 | let b = ((s + ((D * aPrecision) / ann)) - D) | |
565 | 565 | func calc (acc,cur) = { | |
566 | - | let $ | |
567 | - | let y = $ | |
568 | - | let found = $ | |
566 | + | let $t02232222342 = acc | |
567 | + | let y = $t02232222342._1 | |
568 | + | let found = $t02232222342._2 | |
569 | 569 | if ((found != unit)) | |
570 | 570 | then acc | |
571 | 571 | else { | |
572 | 572 | let yNext = (((y * y) + c) / ((big2 * y) + b)) | |
573 | 573 | let yDiff = absBigInt((yNext - value(y))) | |
574 | 574 | if ((big1 >= yDiff)) | |
575 | 575 | then $Tuple2(yNext, cur) | |
576 | 576 | else $Tuple2(yNext, unit) | |
577 | 577 | } | |
578 | 578 | } | |
579 | 579 | ||
580 | 580 | let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] | |
581 | - | let $ | |
581 | + | let $t02264922696 = { | |
582 | 582 | let $l = arr | |
583 | 583 | let $s = size($l) | |
584 | 584 | let $acc0 = $Tuple2(D, unit) | |
585 | 585 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
586 | 586 | then $a | |
587 | 587 | else calc($a, $l[$i]) | |
588 | 588 | ||
589 | 589 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
590 | 590 | then $a | |
591 | 591 | else throw("List size exceeds 15") | |
592 | 592 | ||
593 | 593 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($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), 11), 12), 13), 14), 15) | |
594 | 594 | } | |
595 | - | let y = $ | |
596 | - | let found = $ | |
595 | + | let y = $t02264922696._1 | |
596 | + | let found = $t02264922696._2 | |
597 | 597 | if ((found != unit)) | |
598 | 598 | then y | |
599 | 599 | else throw(("Y calculation error, Y = " + toString(y))) | |
600 | 600 | } | |
601 | 601 | ||
602 | 602 | ||
603 | 603 | func calcDLp (amountBalance,priceBalance,lpEmission) = { | |
604 | 604 | let updatedDLp = fraction(getD([amountBalance, priceBalance]), scale18, lpEmission) | |
605 | 605 | if ((lpEmission == big0)) | |
606 | 606 | then big0 | |
607 | 607 | else updatedDLp | |
608 | 608 | } | |
609 | 609 | ||
610 | 610 | ||
611 | 611 | func calcCurrentDLp (amountAssetDelta,priceAssetDelta,lpAssetEmissionDelta) = { | |
612 | 612 | let amountAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) - amountAssetDelta) | |
613 | 613 | let priceAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) - priceAssetDelta) | |
614 | 614 | let lpAssetEmission = (toBigInt(value(assetInfo(cfgLpAssetId)).quantity) - lpAssetEmissionDelta) | |
615 | 615 | let currentDLp = calcDLp(amountAssetBalance, priceAssetBalance, lpAssetEmission) | |
616 | 616 | currentDLp | |
617 | 617 | } | |
618 | 618 | ||
619 | 619 | ||
620 | 620 | func refreshDLpInternal (amountAssetBalanceDelta,priceAssetBalanceDelta,lpAssetEmissionDelta) = { | |
621 | 621 | let amountAssetBalance = (getAccBalance(assetIdToString(cfgAmountAssetId)) + amountAssetBalanceDelta) | |
622 | 622 | let priceAssetBalance = (getAccBalance(assetIdToString(cfgPriceAssetId)) + priceAssetBalanceDelta) | |
623 | 623 | let lpAssetEmission = (value(assetInfo(cfgLpAssetId)).quantity + lpAssetEmissionDelta) | |
624 | 624 | let updatedDLp = calcDLp(toBigInt(amountAssetBalance), toBigInt(priceAssetBalance), toBigInt(lpAssetEmission)) | |
625 | 625 | let actions = [IntegerEntry(keyDLpRefreshedHeight, height), StringEntry(keyDLp, toString(updatedDLp))] | |
626 | 626 | $Tuple2(actions, updatedDLp) | |
627 | 627 | } | |
628 | 628 | ||
629 | 629 | ||
630 | 630 | func validateUpdatedDLp (oldDLp,updatedDLp) = if ((updatedDLp >= oldDLp)) | |
631 | 631 | then true | |
632 | 632 | else throwErr("updated DLp lower than current DLp") | |
633 | 633 | ||
634 | 634 | ||
635 | 635 | func validateMatcherOrderAllowed (order) = { | |
636 | 636 | let amountAssetAmount = order.amount | |
637 | 637 | let priceAssetAmount = fraction(order.amount, order.price, scale8, FLOOR) | |
638 | - | let $ | |
638 | + | let $t02463524847 = if ((order.orderType == Buy)) | |
639 | 639 | then $Tuple2(amountAssetAmount, -(priceAssetAmount)) | |
640 | 640 | else $Tuple2(-(amountAssetAmount), priceAssetAmount) | |
641 | - | let amountAssetBalanceDelta = $ | |
642 | - | let priceAssetBalanceDelta = $ | |
641 | + | let amountAssetBalanceDelta = $t02463524847._1 | |
642 | + | let priceAssetBalanceDelta = $t02463524847._2 | |
643 | 643 | if (if (if (igs()) | |
644 | 644 | then true | |
645 | 645 | else (cfgPoolStatus == PoolMatcherDis)) | |
646 | 646 | then true | |
647 | 647 | else (cfgPoolStatus == PoolShutdown)) | |
648 | 648 | then throw("Admin blocked") | |
649 | 649 | else if (if ((order.assetPair.amountAsset != cfgAmountAssetId)) | |
650 | 650 | then true | |
651 | 651 | else (order.assetPair.priceAsset != cfgPriceAssetId)) | |
652 | 652 | then throw("Wr assets") | |
653 | 653 | else { | |
654 | 654 | let dLp = parseBigIntValue(getStringValue(this, keyDLp)) | |
655 | - | let $ | |
656 | - | let unusedActions = $ | |
657 | - | let dLpNew = $ | |
655 | + | let $t02517725277 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0) | |
656 | + | let unusedActions = $t02517725277._1 | |
657 | + | let dLpNew = $t02517725277._2 | |
658 | 658 | let isOrderValid = (dLpNew >= dLp) | |
659 | 659 | isOrderValid | |
660 | 660 | } | |
661 | 661 | } | |
662 | 662 | ||
663 | 663 | ||
664 | 664 | func cg (i) = if ((size(i.payments) != 1)) | |
665 | 665 | then throw("1 pmnt exp") | |
666 | 666 | else { | |
667 | 667 | let pmt = value(i.payments[0]) | |
668 | 668 | let pmtAssetId = value(pmt.assetId) | |
669 | 669 | let pmtAmt = pmt.amount | |
670 | 670 | let r = ego(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller) | |
671 | 671 | let outAmAmt = r._1 | |
672 | 672 | let outPrAmt = r._2 | |
673 | 673 | let sts = parseIntValue(r._9) | |
674 | 674 | let state = r._10 | |
675 | 675 | if (if (igs()) | |
676 | 676 | then true | |
677 | 677 | else (sts == PoolShutdown)) | |
678 | 678 | then throw(("Admin blocked: " + toString(sts))) | |
679 | 679 | else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state) | |
680 | 680 | } | |
681 | 681 | ||
682 | 682 | ||
683 | 683 | func cp (caller,txId,amAsPmt,prAsPmt,slippage,emitLp,isOneAsset,validateSlippage,pmtAmt,pmtId) = { | |
684 | 684 | let r = epo(txId, slippage, value(amAsPmt).amount, value(amAsPmt).assetId, value(prAsPmt).amount, value(prAsPmt).assetId, caller, (txId == ""), emitLp, isOneAsset, validateSlippage, pmtAmt, pmtId) | |
685 | 685 | let sts = parseIntValue(r._8) | |
686 | 686 | if (if (if (igs()) | |
687 | 687 | then true | |
688 | 688 | else (sts == PoolPutDis)) | |
689 | 689 | then true | |
690 | 690 | else (sts == PoolShutdown)) | |
691 | 691 | then throw(("Blocked:" + toString(sts))) | |
692 | 692 | else r | |
693 | 693 | } | |
694 | 694 | ||
695 | 695 | ||
696 | 696 | func calcPutOneTkn (pmtAmtRaw,pmtAssetId,userAddress,txId,withTakeFee) = { | |
697 | 697 | let amId = toBase58String(value(cfgAmountAssetId)) | |
698 | 698 | let prId = toBase58String(value(cfgPriceAssetId)) | |
699 | 699 | let lpId = cfgLpAssetId | |
700 | 700 | let amtDcm = cfgAmountAssetDecimals | |
701 | 701 | let priceDcm = cfgPriceAssetDecimals | |
702 | 702 | let lpAssetEmission = toBigInt(valueOrErrorMessage(assetInfo(lpId), "invalid lp asset").quantity) | |
703 | 703 | let chechEmission = if ((lpAssetEmission > big0)) | |
704 | 704 | then true | |
705 | 705 | else throw("initial deposit requires all coins") | |
706 | 706 | if ((chechEmission == chechEmission)) | |
707 | 707 | then { | |
708 | 708 | let amBalance = getAccBalance(amId) | |
709 | 709 | let prBalance = getAccBalance(prId) | |
710 | - | let $ | |
710 | + | let $t02754328005 = if ((txId == "")) | |
711 | 711 | then $Tuple2(amBalance, prBalance) | |
712 | 712 | else if ((pmtAssetId == amId)) | |
713 | 713 | then if ((pmtAmtRaw > amBalance)) | |
714 | 714 | then throw("invalid payment amount") | |
715 | 715 | else $Tuple2((amBalance - pmtAmtRaw), prBalance) | |
716 | 716 | else if ((pmtAssetId == prId)) | |
717 | 717 | then if ((pmtAmtRaw > prBalance)) | |
718 | 718 | then throw("invalid payment amount") | |
719 | 719 | else $Tuple2(amBalance, (prBalance - pmtAmtRaw)) | |
720 | 720 | else throw("wrong pmtAssetId") | |
721 | - | let amBalanceOld = $ | |
722 | - | let prBalanceOld = $ | |
723 | - | let $ | |
721 | + | let amBalanceOld = $t02754328005._1 | |
722 | + | let prBalanceOld = $t02754328005._2 | |
723 | + | let $t02801128187 = if ((pmtAssetId == amId)) | |
724 | 724 | then $Tuple2(pmtAmtRaw, 0) | |
725 | 725 | else if ((pmtAssetId == prId)) | |
726 | 726 | then $Tuple2(0, pmtAmtRaw) | |
727 | 727 | else throw("invalid payment") | |
728 | - | let amAmountRaw = $ | |
729 | - | let prAmountRaw = $ | |
730 | - | let $ | |
728 | + | let amAmountRaw = $t02801128187._1 | |
729 | + | let prAmountRaw = $t02801128187._2 | |
730 | + | let $t02819128430 = if (withTakeFee) | |
731 | 731 | then $Tuple3(takeFee(amAmountRaw)._1, takeFee(prAmountRaw)._1, takeFee(pmtAmtRaw)._2) | |
732 | 732 | else $Tuple3(amAmountRaw, prAmountRaw, 0) | |
733 | - | let amAmount = $ | |
734 | - | let prAmount = $ | |
735 | - | let feeAmount = $ | |
733 | + | let amAmount = $t02819128430._1 | |
734 | + | let prAmount = $t02819128430._2 | |
735 | + | let feeAmount = $t02819128430._3 | |
736 | 736 | let amBalanceNew = (amBalanceOld + amAmount) | |
737 | 737 | let prBalanceNew = (prBalanceOld + prAmount) | |
738 | 738 | let D0 = getD([toBigInt(amBalanceOld), toBigInt(prBalanceOld)]) | |
739 | 739 | let D1 = getD([toBigInt(amBalanceNew), toBigInt(prBalanceNew)]) | |
740 | 740 | let checkD = if ((D1 > D0)) | |
741 | 741 | then true | |
742 | 742 | else throw() | |
743 | 743 | if ((checkD == checkD)) | |
744 | 744 | then { | |
745 | 745 | let lpAmount = fraction(lpAssetEmission, (D1 - D0), D0, FLOOR) | |
746 | 746 | let curPrice = f1(cpbi(t1(prBalanceNew, priceDcm), t1(amBalanceNew, amtDcm)), scale8) | |
747 | 747 | let commonState = [IntegerEntry(pl(), curPrice), IntegerEntry(ph(height, lastBlock.timestamp), curPrice), StringEntry(pau(userAddress, txId), dataPutActionInfo(amAmountRaw, prAmountRaw, toInt(lpAmount), curPrice, 0, 0, height, lastBlock.timestamp, 0, 0))] | |
748 | 748 | let poolProportion = fraction(prBalanceOld, scale8, amBalanceOld) | |
749 | 749 | let amountAssetPart = fraction(pmtAmtRaw, scale8, (poolProportion + scale8)) | |
750 | 750 | let priceAssetPart = (pmtAmtRaw - amountAssetPart) | |
751 | 751 | let lpAmtBoth = fraction(lpAssetEmission, toBigInt(priceAssetPart), toBigInt(prBalanceOld)) | |
752 | 752 | let bonus = toInt(fraction((lpAmount - lpAmtBoth), scale8BigInt, lpAmtBoth)) | |
753 | 753 | $Tuple4(toInt(lpAmount), commonState, feeAmount, bonus) | |
754 | 754 | } | |
755 | 755 | else throw("Strict value is not equal to itself.") | |
756 | 756 | } | |
757 | 757 | else throw("Strict value is not equal to itself.") | |
758 | 758 | } | |
759 | 759 | ||
760 | 760 | ||
761 | 761 | func getOneTknV2Internal (outAssetId,minOutAmount,payments,caller,originCaller,transactionId) = { | |
762 | 762 | let lpId = toBase58String(value(cfgLpAssetId)) | |
763 | 763 | let amId = toBase58String(value(cfgAmountAssetId)) | |
764 | 764 | let prId = toBase58String(value(cfgPriceAssetId)) | |
765 | 765 | let amDecimals = cfgAmountAssetDecimals | |
766 | 766 | let prDecimals = cfgPriceAssetDecimals | |
767 | 767 | let poolStatus = cfgPoolStatus | |
768 | 768 | let userAddress = if ((caller == restContract)) | |
769 | 769 | then originCaller | |
770 | 770 | else caller | |
771 | 771 | let pmt = value(payments[0]) | |
772 | 772 | let pmtAssetId = value(pmt.assetId) | |
773 | 773 | let pmtAmt = pmt.amount | |
774 | 774 | let currentDLp = calcCurrentDLp(big0, big0, big0) | |
775 | 775 | if ((currentDLp == currentDLp)) | |
776 | 776 | then { | |
777 | 777 | let txId58 = toBase58String(transactionId) | |
778 | 778 | if ((lpId != toBase58String(pmtAssetId))) | |
779 | 779 | then throw("Wrong LP") | |
780 | 780 | else { | |
781 | 781 | let amBalance = getAccBalance(amId) | |
782 | 782 | let prBalance = getAccBalance(prId) | |
783 | - | let $ | |
783 | + | let $t03048030591 = { | |
784 | 784 | let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, pmtAmt], nil) | |
785 | 785 | if ($isInstanceOf(@, "(Int, Int)")) | |
786 | 786 | then @ | |
787 | 787 | else throw(($getType(@) + " couldn't be cast to (Int, Int)")) | |
788 | 788 | } | |
789 | - | if (($ | |
789 | + | if (($t03048030591 == $t03048030591)) | |
790 | 790 | then { | |
791 | - | let feeAmount = $ | |
792 | - | let totalGet = $ | |
791 | + | let feeAmount = $t03048030591._2 | |
792 | + | let totalGet = $t03048030591._1 | |
793 | 793 | let totalAmount = if (if ((minOutAmount > 0)) | |
794 | 794 | then (minOutAmount > totalGet) | |
795 | 795 | else false) | |
796 | 796 | then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], "")) | |
797 | 797 | else totalGet | |
798 | - | let $ | |
798 | + | let $t03078131088 = if ((outAssetId == amId)) | |
799 | 799 | then $Tuple4(totalAmount, 0, ((amBalance - totalAmount) - feeAmount), prBalance) | |
800 | 800 | else if ((outAssetId == prId)) | |
801 | 801 | then $Tuple4(0, totalAmount, amBalance, ((prBalance - totalAmount) - feeAmount)) | |
802 | 802 | else throw("invalid out asset id") | |
803 | - | let outAm = $ | |
804 | - | let outPr = $ | |
805 | - | let amBalanceNew = $ | |
806 | - | let prBalanceNew = $ | |
803 | + | let outAm = $t03078131088._1 | |
804 | + | let outPr = $t03078131088._2 | |
805 | + | let amBalanceNew = $t03078131088._3 | |
806 | + | let prBalanceNew = $t03078131088._4 | |
807 | 807 | let curPrX18 = cpbi(t1(prBalanceNew, prDecimals), t1(amBalanceNew, amDecimals)) | |
808 | 808 | let curPr = f1(curPrX18, scale8) | |
809 | 809 | let outAssetIdOrWaves = if ((outAssetId == "WAVES")) | |
810 | 810 | then unit | |
811 | 811 | else fromBase58String(outAssetId) | |
812 | 812 | let sendFeeToMatcher = if ((feeAmount > 0)) | |
813 | 813 | then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetIdOrWaves)] | |
814 | 814 | else nil | |
815 | 815 | let state = ([ScriptTransfer(userAddress, totalAmount, outAssetIdOrWaves), StringEntry(gau(toString(userAddress), txId58), dataGetActionInfo(outAm, outPr, pmtAmt, curPr, height, lastBlock.timestamp)), IntegerEntry(pl(), curPr), IntegerEntry(ph(height, lastBlock.timestamp), curPr)] ++ sendFeeToMatcher) | |
816 | 816 | if ((state == state)) | |
817 | 817 | then { | |
818 | 818 | let burn = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
819 | 819 | if ((burn == burn)) | |
820 | 820 | then { | |
821 | - | let $ | |
821 | + | let $t03187332223 = { | |
822 | 822 | let feeAmountForCalc = if ((this == feeCollectorAddress)) | |
823 | 823 | then 0 | |
824 | 824 | else feeAmount | |
825 | 825 | let outInAmountAsset = if ((parseAssetId(outAssetId) == cfgAmountAssetId)) | |
826 | 826 | then true | |
827 | 827 | else false | |
828 | 828 | if (outInAmountAsset) | |
829 | 829 | then $Tuple2(-((totalGet + feeAmountForCalc)), 0) | |
830 | 830 | else $Tuple2(0, -((totalGet + feeAmountForCalc))) | |
831 | 831 | } | |
832 | - | let amountAssetBalanceDelta = $ | |
833 | - | let priceAssetBalanceDelta = $ | |
834 | - | let $ | |
835 | - | let refreshDLpActions = $ | |
836 | - | let updatedDLp = $ | |
832 | + | let amountAssetBalanceDelta = $t03187332223._1 | |
833 | + | let priceAssetBalanceDelta = $t03187332223._2 | |
834 | + | let $t03222632334 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0) | |
835 | + | let refreshDLpActions = $t03222632334._1 | |
836 | + | let updatedDLp = $t03222632334._2 | |
837 | 837 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
838 | 838 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
839 | 839 | then $Tuple2((state ++ refreshDLpActions), totalAmount) | |
840 | 840 | else throw("Strict value is not equal to itself.") | |
841 | 841 | } | |
842 | 842 | else throw("Strict value is not equal to itself.") | |
843 | 843 | } | |
844 | 844 | else throw("Strict value is not equal to itself.") | |
845 | 845 | } | |
846 | 846 | else throw("Strict value is not equal to itself.") | |
847 | 847 | } | |
848 | 848 | } | |
849 | 849 | else throw("Strict value is not equal to itself.") | |
850 | 850 | } | |
851 | 851 | ||
852 | 852 | ||
853 | 853 | func m () = match getString(mpk()) { | |
854 | 854 | case s: String => | |
855 | 855 | fromBase58String(s) | |
856 | 856 | case _: Unit => | |
857 | 857 | unit | |
858 | 858 | case _ => | |
859 | 859 | throw("Match error") | |
860 | 860 | } | |
861 | 861 | ||
862 | 862 | ||
863 | 863 | func pm () = match getString(pmpk()) { | |
864 | 864 | case s: String => | |
865 | 865 | fromBase58String(s) | |
866 | 866 | case _: Unit => | |
867 | 867 | unit | |
868 | 868 | case _ => | |
869 | 869 | throw("Match error") | |
870 | 870 | } | |
871 | 871 | ||
872 | 872 | ||
873 | 873 | let pd = throw("Permission denied") | |
874 | 874 | ||
875 | 875 | func isManager (i) = match m() { | |
876 | 876 | case pk: ByteVector => | |
877 | 877 | (i.callerPublicKey == pk) | |
878 | 878 | case _: Unit => | |
879 | 879 | (i.caller == this) | |
880 | 880 | case _ => | |
881 | 881 | throw("Match error") | |
882 | 882 | } | |
883 | 883 | ||
884 | 884 | ||
885 | 885 | func mm (i) = match m() { | |
886 | 886 | case pk: ByteVector => | |
887 | 887 | if ((i.callerPublicKey == pk)) | |
888 | 888 | then true | |
889 | 889 | else pd | |
890 | 890 | case _: Unit => | |
891 | 891 | if ((i.caller == this)) | |
892 | 892 | then true | |
893 | 893 | else pd | |
894 | 894 | case _ => | |
895 | 895 | throw("Match error") | |
896 | 896 | } | |
897 | 897 | ||
898 | 898 | ||
899 | 899 | @Callable(i) | |
900 | 900 | func constructor (fc) = { | |
901 | 901 | let c = mm(i) | |
902 | 902 | if ((c == c)) | |
903 | 903 | then [StringEntry(fc(), fc)] | |
904 | 904 | else throw("Strict value is not equal to itself.") | |
905 | 905 | } | |
906 | 906 | ||
907 | 907 | ||
908 | 908 | ||
909 | 909 | @Callable(i) | |
910 | 910 | func setManager (pendingManagerPublicKey) = { | |
911 | 911 | let c = mm(i) | |
912 | 912 | if ((c == c)) | |
913 | 913 | then { | |
914 | 914 | let cm = fromBase58String(pendingManagerPublicKey) | |
915 | 915 | if ((cm == cm)) | |
916 | 916 | then [StringEntry(pmpk(), pendingManagerPublicKey)] | |
917 | 917 | else throw("Strict value is not equal to itself.") | |
918 | 918 | } | |
919 | 919 | else throw("Strict value is not equal to itself.") | |
920 | 920 | } | |
921 | 921 | ||
922 | 922 | ||
923 | 923 | ||
924 | 924 | @Callable(i) | |
925 | 925 | func confirmManager () = { | |
926 | 926 | let p = pm() | |
927 | 927 | let hpm = if (isDefined(p)) | |
928 | 928 | then true | |
929 | 929 | else throw("No pending manager") | |
930 | 930 | if ((hpm == hpm)) | |
931 | 931 | then { | |
932 | 932 | let cpm = if ((i.callerPublicKey == value(p))) | |
933 | 933 | then true | |
934 | 934 | else throw("You are not pending manager") | |
935 | 935 | if ((cpm == cpm)) | |
936 | 936 | then [StringEntry(mpk(), toBase58String(value(p))), DeleteEntry(pmpk())] | |
937 | 937 | else throw("Strict value is not equal to itself.") | |
938 | 938 | } | |
939 | 939 | else throw("Strict value is not equal to itself.") | |
940 | 940 | } | |
941 | 941 | ||
942 | 942 | ||
943 | 943 | ||
944 | 944 | @Callable(i) | |
945 | 945 | func put (slip,autoStake) = { | |
946 | 946 | let factCfg = gfc() | |
947 | 947 | let stakingCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactStakCntr]), "Wr st addr") | |
948 | 948 | let slipCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactSlippCntr]), "Wr sl addr") | |
949 | 949 | if ((0 > slip)) | |
950 | 950 | then throw("Wrong slippage") | |
951 | 951 | else if ((size(i.payments) != 2)) | |
952 | 952 | then throw("2 pmnts expd") | |
953 | 953 | else { | |
954 | 954 | let amAssetPmt = toBigInt(value(i.payments[0]).amount) | |
955 | 955 | let prAssetPmt = toBigInt(value(i.payments[1]).amount) | |
956 | 956 | let amountAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) - amAssetPmt) | |
957 | 957 | if ((amountAssetBalance == amountAssetBalance)) | |
958 | 958 | then { | |
959 | 959 | let priceAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) - prAssetPmt) | |
960 | 960 | if ((priceAssetBalance == priceAssetBalance)) | |
961 | 961 | then { | |
962 | 962 | let lpAssetEmission = toBigInt(value(assetInfo(cfgLpAssetId)).quantity) | |
963 | 963 | if ((lpAssetEmission == lpAssetEmission)) | |
964 | 964 | then { | |
965 | 965 | let currentDLp = calcCurrentDLp(amAssetPmt, prAssetPmt, toBigInt(0)) | |
966 | 966 | if ((currentDLp == currentDLp)) | |
967 | 967 | then { | |
968 | 968 | let e = cp(toString(i.caller), toBase58String(i.transactionId), AttachedPayment(value(i.payments[0]).assetId, value(i.payments[0]).amount), i.payments[1], slip, true, false, true, 0, "") | |
969 | 969 | let emitLpAmt = e._2 | |
970 | 970 | let lpAssetId = e._7 | |
971 | 971 | let state = e._9 | |
972 | 972 | let amDiff = e._10 | |
973 | 973 | let prDiff = e._11 | |
974 | 974 | let amId = e._12 | |
975 | 975 | let prId = e._13 | |
976 | 976 | let r = invoke(fca, "emit", [emitLpAmt], nil) | |
977 | 977 | if ((r == r)) | |
978 | 978 | then { | |
979 | 979 | let el = match r { | |
980 | 980 | case legacy: Address => | |
981 | 981 | invoke(legacy, "emit", [emitLpAmt], nil) | |
982 | 982 | case _ => | |
983 | 983 | unit | |
984 | 984 | } | |
985 | 985 | if ((el == el)) | |
986 | 986 | then { | |
987 | 987 | let sa = if ((amDiff > 0)) | |
988 | 988 | then invoke(slipCntr, "put", nil, [AttachedPayment(amId, amDiff)]) | |
989 | 989 | else nil | |
990 | 990 | if ((sa == sa)) | |
991 | 991 | then { | |
992 | 992 | let sp = if ((prDiff > 0)) | |
993 | 993 | then invoke(slipCntr, "put", nil, [AttachedPayment(prId, prDiff)]) | |
994 | 994 | else nil | |
995 | 995 | if ((sp == sp)) | |
996 | 996 | then { | |
997 | 997 | let lpTrnsfr = if (autoStake) | |
998 | 998 | then { | |
999 | 999 | let ss = invoke(stakingCntr, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)]) | |
1000 | 1000 | if ((ss == ss)) | |
1001 | 1001 | then nil | |
1002 | 1002 | else throw("Strict value is not equal to itself.") | |
1003 | 1003 | } | |
1004 | 1004 | else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)] | |
1005 | - | let $ | |
1006 | - | let refreshDLpActions = $ | |
1007 | - | let updatedDLp = $ | |
1005 | + | let $t03648336625 = refreshDLpInternal(0, 0, 0) | |
1006 | + | let refreshDLpActions = $t03648336625._1 | |
1007 | + | let updatedDLp = $t03648336625._2 | |
1008 | 1008 | let check = if ((updatedDLp >= currentDLp)) | |
1009 | 1009 | then true | |
1010 | 1010 | else throwErr(makeString(["updated DLp lower than current DLp", toString(amountAssetBalance), toString(priceAssetBalance), toString(lpAssetEmission), toString(currentDLp), toString(updatedDLp)], " ")) | |
1011 | 1011 | if ((check == check)) | |
1012 | 1012 | then { | |
1013 | 1013 | let lpAssetEmissionAfter = value(assetInfo(cfgLpAssetId)).quantity | |
1014 | 1014 | if ((lpAssetEmissionAfter == lpAssetEmissionAfter)) | |
1015 | 1015 | then ((state ++ lpTrnsfr) ++ refreshDLpActions) | |
1016 | 1016 | else throw("Strict value is not equal to itself.") | |
1017 | 1017 | } | |
1018 | 1018 | else throw("Strict value is not equal to itself.") | |
1019 | 1019 | } | |
1020 | 1020 | else throw("Strict value is not equal to itself.") | |
1021 | 1021 | } | |
1022 | 1022 | else throw("Strict value is not equal to itself.") | |
1023 | 1023 | } | |
1024 | 1024 | else throw("Strict value is not equal to itself.") | |
1025 | 1025 | } | |
1026 | 1026 | else throw("Strict value is not equal to itself.") | |
1027 | 1027 | } | |
1028 | 1028 | else throw("Strict value is not equal to itself.") | |
1029 | 1029 | } | |
1030 | 1030 | else throw("Strict value is not equal to itself.") | |
1031 | 1031 | } | |
1032 | 1032 | else throw("Strict value is not equal to itself.") | |
1033 | 1033 | } | |
1034 | 1034 | else throw("Strict value is not equal to itself.") | |
1035 | 1035 | } | |
1036 | 1036 | } | |
1037 | 1037 | ||
1038 | 1038 | ||
1039 | 1039 | ||
1040 | 1040 | @Callable(i) | |
1041 | 1041 | func putOneTknV2 (minOutAmount,autoStake) = { | |
1042 | 1042 | let isPoolOneTokenOperationsDisabled = { | |
1043 | 1043 | let @ = invoke(fca, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
1044 | 1044 | if ($isInstanceOf(@, "Boolean")) | |
1045 | 1045 | then @ | |
1046 | 1046 | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
1047 | 1047 | } | |
1048 | 1048 | let isPutDisabled = if (if (if (igs()) | |
1049 | 1049 | then true | |
1050 | 1050 | else (cfgPoolStatus == PoolPutDis)) | |
1051 | 1051 | then true | |
1052 | 1052 | else (cfgPoolStatus == PoolShutdown)) | |
1053 | 1053 | then true | |
1054 | 1054 | else isPoolOneTokenOperationsDisabled | |
1055 | 1055 | let checks = [if (if (!(isPutDisabled)) | |
1056 | 1056 | then true | |
1057 | 1057 | else isManager(i)) | |
1058 | 1058 | then true | |
1059 | 1059 | else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1)) | |
1060 | 1060 | then true | |
1061 | 1061 | else throwErr("exactly 1 payment are expected")] | |
1062 | 1062 | if ((checks == checks)) | |
1063 | 1063 | then { | |
1064 | 1064 | let amId = toBase58String(value(cfgAmountAssetId)) | |
1065 | 1065 | let prId = toBase58String(value(cfgPriceAssetId)) | |
1066 | 1066 | let lpId = cfgLpAssetId | |
1067 | 1067 | let amDecimals = cfgAmountAssetDecimals | |
1068 | 1068 | let prDecimals = cfgPriceAssetDecimals | |
1069 | 1069 | let userAddress = if ((i.caller == this)) | |
1070 | 1070 | then i.originCaller | |
1071 | 1071 | else i.caller | |
1072 | 1072 | let pmt = value(i.payments[0]) | |
1073 | 1073 | let pmtAssetId = toBase58String(value(pmt.assetId)) | |
1074 | 1074 | let pmtAmt = pmt.amount | |
1075 | 1075 | let currentDLp = if ((pmt.assetId == cfgAmountAssetId)) | |
1076 | 1076 | then calcCurrentDLp(toBigInt(pmtAmt), toBigInt(0), toBigInt(0)) | |
1077 | 1077 | else calcCurrentDLp(toBigInt(0), toBigInt(pmtAmt), toBigInt(0)) | |
1078 | 1078 | if ((currentDLp == currentDLp)) | |
1079 | 1079 | then { | |
1080 | - | let $ | |
1081 | - | if (($ | |
1080 | + | let $t03853138689 = calcPutOneTkn(pmtAmt, pmtAssetId, toString(userAddress), toBase58String(i.transactionId), true) | |
1081 | + | if (($t03853138689 == $t03853138689)) | |
1082 | 1082 | then { | |
1083 | - | let feeAmount = $ | |
1084 | - | let state = $ | |
1085 | - | let estimLP = $ | |
1083 | + | let feeAmount = $t03853138689._3 | |
1084 | + | let state = $t03853138689._2 | |
1085 | + | let estimLP = $t03853138689._1 | |
1086 | 1086 | let emitLpAmt = if (if ((minOutAmount > 0)) | |
1087 | 1087 | then (minOutAmount > estimLP) | |
1088 | 1088 | else false) | |
1089 | 1089 | then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], "")) | |
1090 | 1090 | else estimLP | |
1091 | 1091 | let e = invoke(fca, "emit", [emitLpAmt], nil) | |
1092 | 1092 | if ((e == e)) | |
1093 | 1093 | then { | |
1094 | 1094 | let el = match e { | |
1095 | 1095 | case legacy: Address => | |
1096 | 1096 | invoke(legacy, "emit", [emitLpAmt], nil) | |
1097 | 1097 | case _ => | |
1098 | 1098 | unit | |
1099 | 1099 | } | |
1100 | 1100 | if ((el == el)) | |
1101 | 1101 | then { | |
1102 | 1102 | let lpTrnsfr = if (autoStake) | |
1103 | 1103 | then { | |
1104 | 1104 | let ss = invoke(stakingContract, "stake", nil, [AttachedPayment(lpId, emitLpAmt)]) | |
1105 | 1105 | if ((ss == ss)) | |
1106 | 1106 | then nil | |
1107 | 1107 | else throw("Strict value is not equal to itself.") | |
1108 | 1108 | } | |
1109 | 1109 | else [ScriptTransfer(i.caller, emitLpAmt, lpId)] | |
1110 | 1110 | let sendFeeToMatcher = if ((feeAmount > 0)) | |
1111 | 1111 | then [ScriptTransfer(feeCollectorAddress, feeAmount, fromBase58String(pmtAssetId))] | |
1112 | 1112 | else nil | |
1113 | - | let $ | |
1113 | + | let $t03950439853 = if ((this == feeCollectorAddress)) | |
1114 | 1114 | then $Tuple2(0, 0) | |
1115 | 1115 | else { | |
1116 | 1116 | let paymentInAmountAsset = if ((pmt.assetId == cfgAmountAssetId)) | |
1117 | 1117 | then true | |
1118 | 1118 | else false | |
1119 | 1119 | if (paymentInAmountAsset) | |
1120 | 1120 | then $Tuple2(-(feeAmount), 0) | |
1121 | 1121 | else $Tuple2(0, -(feeAmount)) | |
1122 | 1122 | } | |
1123 | - | let amountAssetBalanceDelta = $ | |
1124 | - | let priceAssetBalanceDelta = $ | |
1125 | - | let $ | |
1126 | - | let refreshDLpActions = $ | |
1127 | - | let updatedDLp = $ | |
1123 | + | let amountAssetBalanceDelta = $t03950439853._1 | |
1124 | + | let priceAssetBalanceDelta = $t03950439853._2 | |
1125 | + | let $t03985639964 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0) | |
1126 | + | let refreshDLpActions = $t03985639964._1 | |
1127 | + | let updatedDLp = $t03985639964._2 | |
1128 | 1128 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1129 | 1129 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1130 | 1130 | then $Tuple2((((state ++ lpTrnsfr) ++ sendFeeToMatcher) ++ refreshDLpActions), emitLpAmt) | |
1131 | 1131 | else throw("Strict value is not equal to itself.") | |
1132 | 1132 | } | |
1133 | 1133 | else throw("Strict value is not equal to itself.") | |
1134 | 1134 | } | |
1135 | 1135 | else throw("Strict value is not equal to itself.") | |
1136 | 1136 | } | |
1137 | 1137 | else throw("Strict value is not equal to itself.") | |
1138 | 1138 | } | |
1139 | 1139 | else throw("Strict value is not equal to itself.") | |
1140 | 1140 | } | |
1141 | 1141 | else throw("Strict value is not equal to itself.") | |
1142 | 1142 | } | |
1143 | 1143 | ||
1144 | 1144 | ||
1145 | 1145 | ||
1146 | 1146 | @Callable(i) | |
1147 | 1147 | func putForFree (maxSlpg) = if ((0 > maxSlpg)) | |
1148 | 1148 | then throw("Wrong slpg") | |
1149 | 1149 | else if ((size(i.payments) != 2)) | |
1150 | 1150 | then throw("2 pmnts expd") | |
1151 | 1151 | else { | |
1152 | 1152 | let estPut = cp(toString(i.caller), toBase58String(i.transactionId), AttachedPayment(value(i.payments[0]).assetId, value(i.payments[0]).amount), i.payments[1], maxSlpg, false, false, true, 0, "") | |
1153 | 1153 | let state = estPut._9 | |
1154 | 1154 | let amAssetPmt = toBigInt(value(i.payments[0]).amount) | |
1155 | 1155 | let prAssetPmt = toBigInt(value(i.payments[1]).amount) | |
1156 | 1156 | let currentDLp = calcCurrentDLp(amAssetPmt, prAssetPmt, toBigInt(0)) | |
1157 | 1157 | if ((currentDLp == currentDLp)) | |
1158 | 1158 | then { | |
1159 | - | let $ | |
1160 | - | let refreshDLpActions = $ | |
1161 | - | let updatedDLp = $ | |
1159 | + | let $t04099441059 = refreshDLpInternal(0, 0, 0) | |
1160 | + | let refreshDLpActions = $t04099441059._1 | |
1161 | + | let updatedDLp = $t04099441059._2 | |
1162 | 1162 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1163 | 1163 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1164 | 1164 | then (state ++ refreshDLpActions) | |
1165 | 1165 | else throw("Strict value is not equal to itself.") | |
1166 | 1166 | } | |
1167 | 1167 | else throw("Strict value is not equal to itself.") | |
1168 | 1168 | } | |
1169 | 1169 | ||
1170 | 1170 | ||
1171 | 1171 | ||
1172 | 1172 | @Callable(i) | |
1173 | 1173 | func get () = { | |
1174 | 1174 | let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1175 | 1175 | if ((currentDLp == currentDLp)) | |
1176 | 1176 | then { | |
1177 | 1177 | let r = cg(i) | |
1178 | 1178 | let outAmtAmt = r._1 | |
1179 | 1179 | let outPrAmt = r._2 | |
1180 | 1180 | let pmtAmt = r._3 | |
1181 | 1181 | let pmtAssetId = r._4 | |
1182 | 1182 | let state = r._5 | |
1183 | 1183 | let b = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
1184 | 1184 | if ((b == b)) | |
1185 | 1185 | then { | |
1186 | - | let $ | |
1187 | - | let refreshDLpActions = $ | |
1188 | - | let updatedDLp = $ | |
1186 | + | let $t04223242314 = refreshDLpInternal(-(outAmtAmt), -(outPrAmt), 0) | |
1187 | + | let refreshDLpActions = $t04223242314._1 | |
1188 | + | let updatedDLp = $t04223242314._2 | |
1189 | 1189 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1190 | 1190 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1191 | 1191 | then (state ++ refreshDLpActions) | |
1192 | 1192 | else throw("Strict value is not equal to itself.") | |
1193 | 1193 | } | |
1194 | 1194 | else throw("Strict value is not equal to itself.") | |
1195 | 1195 | } | |
1196 | 1196 | else throw("Strict value is not equal to itself.") | |
1197 | 1197 | } | |
1198 | 1198 | ||
1199 | 1199 | ||
1200 | 1200 | ||
1201 | 1201 | @Callable(i) | |
1202 | 1202 | func getOneTknV2 (outAssetId,minOutAmount) = { | |
1203 | 1203 | let isPoolOneTokenOperationsDisabled = { | |
1204 | 1204 | let @ = invoke(fca, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
1205 | 1205 | if ($isInstanceOf(@, "Boolean")) | |
1206 | 1206 | then @ | |
1207 | 1207 | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
1208 | 1208 | } | |
1209 | 1209 | let isGetDisabled = if (if (igs()) | |
1210 | 1210 | then true | |
1211 | 1211 | else (cfgPoolStatus == PoolShutdown)) | |
1212 | 1212 | then true | |
1213 | 1213 | else isPoolOneTokenOperationsDisabled | |
1214 | 1214 | let checks = [if (if (!(isGetDisabled)) | |
1215 | 1215 | then true | |
1216 | 1216 | else isManager(i)) | |
1217 | 1217 | then true | |
1218 | 1218 | else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1)) | |
1219 | 1219 | then true | |
1220 | 1220 | else throwErr("exactly 1 payment are expected")] | |
1221 | 1221 | if ((checks == checks)) | |
1222 | 1222 | then { | |
1223 | - | let $ | |
1224 | - | let state = $ | |
1225 | - | let totalAmount = $ | |
1223 | + | let $t04293243087 = getOneTknV2Internal(outAssetId, minOutAmount, i.payments, i.caller, i.originCaller, i.transactionId) | |
1224 | + | let state = $t04293243087._1 | |
1225 | + | let totalAmount = $t04293243087._2 | |
1226 | 1226 | $Tuple2(state, totalAmount) | |
1227 | 1227 | } | |
1228 | 1228 | else throw("Strict value is not equal to itself.") | |
1229 | 1229 | } | |
1230 | 1230 | ||
1231 | 1231 | ||
1232 | 1232 | ||
1233 | 1233 | @Callable(i) | |
1234 | 1234 | func refreshDLp () = { | |
1235 | 1235 | let lastRefreshedBlockHeight = valueOrElse(getInteger(keyDLpRefreshedHeight), 0) | |
1236 | 1236 | let checkLastRefreshedBlockHeight = if (((height - lastRefreshedBlockHeight) >= dLpRefreshDelay)) | |
1237 | 1237 | then unit | |
1238 | 1238 | else throwErr(makeString([toString(dLpRefreshDelay), " blocks have not passed since the previous call"], "")) | |
1239 | 1239 | if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight)) | |
1240 | 1240 | then { | |
1241 | 1241 | let dLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyDLp), "0")), fmtErr("invalid dLp")) | |
1242 | - | let $ | |
1243 | - | let dLpUpdateActions = $ | |
1244 | - | let updatedDLp = $ | |
1242 | + | let $t04361143675 = refreshDLpInternal(0, 0, 0) | |
1243 | + | let dLpUpdateActions = $t04361143675._1 | |
1244 | + | let updatedDLp = $t04361143675._2 | |
1245 | 1245 | let actions = if ((dLp != updatedDLp)) | |
1246 | 1246 | then dLpUpdateActions | |
1247 | 1247 | else throwErr("nothing to refresh") | |
1248 | 1248 | $Tuple2(actions, toString(updatedDLp)) | |
1249 | 1249 | } | |
1250 | 1250 | else throw("Strict value is not equal to itself.") | |
1251 | 1251 | } | |
1252 | 1252 | ||
1253 | 1253 | ||
1254 | 1254 | ||
1255 | 1255 | @Callable(i) | |
1256 | 1256 | func getOneTknV2READONLY (outAssetId,lpAssetAmount) = { | |
1257 | 1257 | let amId = toBase58String(value(cfgAmountAssetId)) | |
1258 | 1258 | let prId = toBase58String(value(cfgPriceAssetId)) | |
1259 | 1259 | let lpId = toBase58String(value(cfgLpAssetId)) | |
1260 | 1260 | let xp = [toBigInt(getAccBalance(amId)), toBigInt(getAccBalance(prId))] | |
1261 | 1261 | let lpEmission = toBigInt(valueOrErrorMessage(assetInfo(fromBase58String(lpId)), "invalid lp asset").quantity) | |
1262 | 1262 | let D0 = getD(xp) | |
1263 | 1263 | let D1 = (D0 - fraction(toBigInt(lpAssetAmount), D0, lpEmission)) | |
1264 | 1264 | let index = if ((outAssetId == amId)) | |
1265 | 1265 | then 0 | |
1266 | 1266 | else if ((outAssetId == prId)) | |
1267 | 1267 | then 1 | |
1268 | 1268 | else throw("invalid out asset id") | |
1269 | 1269 | let newY = getYD(xp, index, D1) | |
1270 | 1270 | let dy = (xp[index] - newY) | |
1271 | 1271 | let totalGetRaw = max([0, toInt((dy - big1))]) | |
1272 | - | let $ | |
1273 | - | let totalGet = $ | |
1274 | - | let feeAmount = $ | |
1272 | + | let $t04460544654 = takeFee(totalGetRaw) | |
1273 | + | let totalGet = $t04460544654._1 | |
1274 | + | let feeAmount = $t04460544654._2 | |
1275 | 1275 | $Tuple2(nil, $Tuple2(totalGet, feeAmount)) | |
1276 | 1276 | } | |
1277 | 1277 | ||
1278 | 1278 | ||
1279 | 1279 | ||
1280 | 1280 | @Callable(i) | |
1281 | 1281 | func getOneTknV2WithBonusREADONLY (outAssetId,lpAssetAmount) = { | |
1282 | 1282 | let amId = toBase58String(value(cfgAmountAssetId)) | |
1283 | 1283 | let prId = toBase58String(value(cfgPriceAssetId)) | |
1284 | 1284 | let lpId = toBase58String(value(cfgLpAssetId)) | |
1285 | 1285 | let amBalance = getAccBalance(amId) | |
1286 | 1286 | let prBalance = getAccBalance(prId) | |
1287 | - | let $ | |
1287 | + | let $t04502945144 = { | |
1288 | 1288 | let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, lpAssetAmount], nil) | |
1289 | 1289 | if ($isInstanceOf(@, "(Int, Int)")) | |
1290 | 1290 | then @ | |
1291 | 1291 | else throw(($getType(@) + " couldn't be cast to (Int, Int)")) | |
1292 | 1292 | } | |
1293 | - | let totalGet = $ | |
1294 | - | let feeAmount = $ | |
1293 | + | let totalGet = $t04502945144._1 | |
1294 | + | let feeAmount = $t04502945144._2 | |
1295 | 1295 | let r = ego("", lpId, lpAssetAmount, this) | |
1296 | 1296 | let outAmAmt = r._1 | |
1297 | 1297 | let outPrAmt = r._2 | |
1298 | 1298 | let sumOfGetAssets = (outAmAmt + outPrAmt) | |
1299 | 1299 | let bonus = if ((sumOfGetAssets == 0)) | |
1300 | 1300 | then if ((totalGet == 0)) | |
1301 | 1301 | then 0 | |
1302 | 1302 | else throw("bonus calculation error") | |
1303 | 1303 | else fraction((totalGet - sumOfGetAssets), scale8, sumOfGetAssets) | |
1304 | 1304 | $Tuple2(nil, $Tuple3(totalGet, feeAmount, bonus)) | |
1305 | 1305 | } | |
1306 | 1306 | ||
1307 | 1307 | ||
1308 | 1308 | ||
1309 | 1309 | @Callable(i) | |
1310 | 1310 | func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = { | |
1311 | 1311 | let aab = toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) | |
1312 | 1312 | if ((aab == aab)) | |
1313 | 1313 | then { | |
1314 | 1314 | let pab = toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) | |
1315 | 1315 | if ((pab == pab)) | |
1316 | 1316 | then { | |
1317 | 1317 | let lae = toBigInt(value(assetInfo(cfgLpAssetId)).quantity) | |
1318 | 1318 | if ((lae == lae)) | |
1319 | 1319 | then { | |
1320 | 1320 | let laea = (lae - toBigInt(value(i.payments[0]).amount)) | |
1321 | 1321 | if ((laea == laea)) | |
1322 | 1322 | then { | |
1323 | 1323 | let r = cg(i) | |
1324 | 1324 | let outAmAmt = r._1 | |
1325 | 1325 | let outPrAmt = r._2 | |
1326 | 1326 | let pmtAmt = r._3 | |
1327 | 1327 | let pmtAssetId = r._4 | |
1328 | 1328 | let state = r._5 | |
1329 | 1329 | if ((noLessThenAmtAsset > outAmAmt)) | |
1330 | 1330 | then throw(((("Failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset))) | |
1331 | 1331 | else if ((noLessThenPriceAsset > outPrAmt)) | |
1332 | 1332 | then throw(((("Failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset))) | |
1333 | 1333 | else { | |
1334 | 1334 | let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1335 | 1335 | if ((currentDLp == currentDLp)) | |
1336 | 1336 | then { | |
1337 | 1337 | let burnLPAssetOnFactory = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
1338 | 1338 | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
1339 | 1339 | then { | |
1340 | - | let $ | |
1341 | - | let refreshDLpActions = $ | |
1342 | - | let updatedDLp = $ | |
1340 | + | let $t04668346764 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0) | |
1341 | + | let refreshDLpActions = $t04668346764._1 | |
1342 | + | let updatedDLp = $t04668346764._2 | |
1343 | 1343 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1344 | 1344 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1345 | 1345 | then (state ++ refreshDLpActions) | |
1346 | 1346 | else throw("Strict value is not equal to itself.") | |
1347 | 1347 | } | |
1348 | 1348 | else throw("Strict value is not equal to itself.") | |
1349 | 1349 | } | |
1350 | 1350 | else throw("Strict value is not equal to itself.") | |
1351 | 1351 | } | |
1352 | 1352 | } | |
1353 | 1353 | else throw("Strict value is not equal to itself.") | |
1354 | 1354 | } | |
1355 | 1355 | else throw("Strict value is not equal to itself.") | |
1356 | 1356 | } | |
1357 | 1357 | else throw("Strict value is not equal to itself.") | |
1358 | 1358 | } | |
1359 | 1359 | else throw("Strict value is not equal to itself.") | |
1360 | 1360 | } | |
1361 | 1361 | ||
1362 | 1362 | ||
1363 | 1363 | ||
1364 | 1364 | @Callable(i) | |
1365 | 1365 | func unstakeAndGet (amount) = { | |
1366 | 1366 | let checkPayments = if ((size(i.payments) != 0)) | |
1367 | 1367 | then throw("No pmnts expd") | |
1368 | 1368 | else true | |
1369 | 1369 | if ((checkPayments == checkPayments)) | |
1370 | 1370 | then { | |
1371 | 1371 | let factoryCfg = gfc() | |
1372 | 1372 | let lpAssetId = cfgLpAssetId | |
1373 | 1373 | let staking = valueOrErrorMessage(addressFromString(factoryCfg[idxFactStakCntr]), "Wr st addr") | |
1374 | 1374 | let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1375 | 1375 | let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), amount], nil) | |
1376 | 1376 | if ((unstakeInv == unstakeInv)) | |
1377 | 1377 | then { | |
1378 | 1378 | let r = ego(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller) | |
1379 | 1379 | let outAmAmt = r._1 | |
1380 | 1380 | let outPrAmt = r._2 | |
1381 | 1381 | let sts = parseIntValue(r._9) | |
1382 | 1382 | let state = r._10 | |
1383 | 1383 | let v = if (if (igs()) | |
1384 | 1384 | then true | |
1385 | 1385 | else (sts == PoolShutdown)) | |
1386 | 1386 | then throw(("Blocked: " + toString(sts))) | |
1387 | 1387 | else true | |
1388 | 1388 | if ((v == v)) | |
1389 | 1389 | then { | |
1390 | 1390 | let burnA = invoke(fca, "burn", [amount], [AttachedPayment(lpAssetId, amount)]) | |
1391 | 1391 | if ((burnA == burnA)) | |
1392 | 1392 | then { | |
1393 | - | let $ | |
1394 | - | let refreshDLpActions = $ | |
1395 | - | let updatedDLp = $ | |
1393 | + | let $t04778847869 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0) | |
1394 | + | let refreshDLpActions = $t04778847869._1 | |
1395 | + | let updatedDLp = $t04778847869._2 | |
1396 | 1396 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1397 | 1397 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1398 | 1398 | then (state ++ refreshDLpActions) | |
1399 | 1399 | else throw("Strict value is not equal to itself.") | |
1400 | 1400 | } | |
1401 | 1401 | else throw("Strict value is not equal to itself.") | |
1402 | 1402 | } | |
1403 | 1403 | else throw("Strict value is not equal to itself.") | |
1404 | 1404 | } | |
1405 | 1405 | else throw("Strict value is not equal to itself.") | |
1406 | 1406 | } | |
1407 | 1407 | else throw("Strict value is not equal to itself.") | |
1408 | 1408 | } | |
1409 | 1409 | ||
1410 | 1410 | ||
1411 | 1411 | ||
1412 | 1412 | @Callable(i) | |
1413 | 1413 | func unstakeAndGetNoLess (unstakeAmount,noLessThenAmountAsset,noLessThenPriceAsset) = { | |
1414 | 1414 | let isGetDisabled = if (igs()) | |
1415 | 1415 | then true | |
1416 | 1416 | else (cfgPoolStatus == PoolShutdown) | |
1417 | 1417 | let checks = [if (!(isGetDisabled)) | |
1418 | 1418 | then true | |
1419 | 1419 | else throw("get operation is blocked by admin"), if ((size(i.payments) == 0)) | |
1420 | 1420 | then true | |
1421 | 1421 | else throw("no payments are expected")] | |
1422 | 1422 | if ((checks == checks)) | |
1423 | 1423 | then { | |
1424 | 1424 | let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1425 | 1425 | let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil) | |
1426 | 1426 | if ((unstakeInv == unstakeInv)) | |
1427 | 1427 | then { | |
1428 | 1428 | let res = ego(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller) | |
1429 | 1429 | let outAmAmt = res._1 | |
1430 | 1430 | let outPrAmt = res._2 | |
1431 | 1431 | let state = res._10 | |
1432 | 1432 | let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset)) | |
1433 | 1433 | then true | |
1434 | 1434 | else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset)) | |
1435 | 1435 | then true | |
1436 | 1436 | else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))] | |
1437 | 1437 | if ((checkAmounts == checkAmounts)) | |
1438 | 1438 | then { | |
1439 | 1439 | let burnLPAssetOnFactory = invoke(fca, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)]) | |
1440 | 1440 | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
1441 | 1441 | then { | |
1442 | - | let $ | |
1443 | - | let refreshDLpActions = $ | |
1444 | - | let updatedDLp = $ | |
1442 | + | let $t04911749198 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0) | |
1443 | + | let refreshDLpActions = $t04911749198._1 | |
1444 | + | let updatedDLp = $t04911749198._2 | |
1445 | 1445 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1446 | 1446 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1447 | 1447 | then (state ++ refreshDLpActions) | |
1448 | 1448 | else throw("Strict value is not equal to itself.") | |
1449 | 1449 | } | |
1450 | 1450 | else throw("Strict value is not equal to itself.") | |
1451 | 1451 | } | |
1452 | 1452 | else throw("Strict value is not equal to itself.") | |
1453 | 1453 | } | |
1454 | 1454 | else throw("Strict value is not equal to itself.") | |
1455 | 1455 | } | |
1456 | 1456 | else throw("Strict value is not equal to itself.") | |
1457 | 1457 | } | |
1458 | 1458 | ||
1459 | 1459 | ||
1460 | 1460 | ||
1461 | 1461 | @Callable(i) | |
1462 | 1462 | func unstakeAndGetOneTknV2 (unstakeAmount,outAssetId,minOutAmount) = { | |
1463 | 1463 | let isPoolOneTokenOperationsDisabled = { | |
1464 | 1464 | let @ = invoke(fca, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
1465 | 1465 | if ($isInstanceOf(@, "Boolean")) | |
1466 | 1466 | then @ | |
1467 | 1467 | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
1468 | 1468 | } | |
1469 | 1469 | let isGetDisabled = if (if (igs()) | |
1470 | 1470 | then true | |
1471 | 1471 | else (cfgPoolStatus == PoolShutdown)) | |
1472 | 1472 | then true | |
1473 | 1473 | else isPoolOneTokenOperationsDisabled | |
1474 | 1474 | let checks = [if (if (!(isGetDisabled)) | |
1475 | 1475 | then true | |
1476 | 1476 | else isManager(i)) | |
1477 | 1477 | then true | |
1478 | 1478 | else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 0)) | |
1479 | 1479 | then true | |
1480 | 1480 | else throwErr("no payments are expected")] | |
1481 | 1481 | if ((checks == checks)) | |
1482 | 1482 | then { | |
1483 | 1483 | let factoryCfg = gfc() | |
1484 | 1484 | let lpAssetId = cfgLpAssetId | |
1485 | 1485 | let staking = valueOrErrorMessage(addressFromString(factoryCfg[idxFactStakCntr]), "Wr st addr") | |
1486 | 1486 | let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), unstakeAmount], nil) | |
1487 | 1487 | if ((unstakeInv == unstakeInv)) | |
1488 | 1488 | then { | |
1489 | - | let $ | |
1490 | - | let state = $ | |
1491 | - | let totalAmount = $ | |
1489 | + | let $t05009350281 = getOneTknV2Internal(outAssetId, minOutAmount, [AttachedPayment(lpAssetId, unstakeAmount)], i.caller, i.originCaller, i.transactionId) | |
1490 | + | let state = $t05009350281._1 | |
1491 | + | let totalAmount = $t05009350281._2 | |
1492 | 1492 | $Tuple2(state, totalAmount) | |
1493 | 1493 | } | |
1494 | 1494 | else throw("Strict value is not equal to itself.") | |
1495 | 1495 | } | |
1496 | 1496 | else throw("Strict value is not equal to itself.") | |
1497 | 1497 | } | |
1498 | 1498 | ||
1499 | 1499 | ||
1500 | 1500 | ||
1501 | 1501 | @Callable(i) | |
1502 | 1502 | func putOneTknV2WithBonusREADONLY (paymentAmountRaw,paymentAssetId) = { | |
1503 | - | let $ | |
1504 | - | let lpAmount = $ | |
1505 | - | let state = $ | |
1506 | - | let feeAmount = $ | |
1507 | - | let bonus = $ | |
1503 | + | let $t05040950512 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", true) | |
1504 | + | let lpAmount = $t05040950512._1 | |
1505 | + | let state = $t05040950512._2 | |
1506 | + | let feeAmount = $t05040950512._3 | |
1507 | + | let bonus = $t05040950512._4 | |
1508 | 1508 | $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus)) | |
1509 | 1509 | } | |
1510 | 1510 | ||
1511 | 1511 | ||
1512 | 1512 | ||
1513 | 1513 | @Callable(i) | |
1514 | 1514 | func putOneTknV2WithoutTakeFeeREADONLY (paymentAmountRaw,paymentAssetId) = { | |
1515 | - | let $ | |
1516 | - | let lpAmount = $ | |
1517 | - | let state = $ | |
1518 | - | let feeAmount = $ | |
1519 | - | let bonus = $ | |
1515 | + | let $t05066050764 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", false) | |
1516 | + | let lpAmount = $t05066050764._1 | |
1517 | + | let state = $t05066050764._2 | |
1518 | + | let feeAmount = $t05066050764._3 | |
1519 | + | let bonus = $t05066050764._4 | |
1520 | 1520 | $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus)) | |
1521 | 1521 | } | |
1522 | 1522 | ||
1523 | 1523 | ||
1524 | 1524 | ||
1525 | 1525 | @Callable(i) | |
1526 | 1526 | func activate (amtAsStr,prAsStr) = if ((toString(i.caller) != toString(fca))) | |
1527 | 1527 | then throw("denied") | |
1528 | 1528 | else $Tuple2([StringEntry(aa(), amtAsStr), StringEntry(pa(), prAsStr)], "success") | |
1529 | 1529 | ||
1530 | 1530 | ||
1531 | 1531 | ||
1532 | 1532 | @Callable(i) | |
1533 | 1533 | func setS (k,v) = if ((toString(i.caller) != strf(this, ada()))) | |
1534 | 1534 | then pd | |
1535 | 1535 | else [StringEntry(k, v)] | |
1536 | 1536 | ||
1537 | 1537 | ||
1538 | 1538 | ||
1539 | 1539 | @Callable(i) | |
1540 | 1540 | func setI (k,v) = if ((toString(i.caller) != strf(this, ada()))) | |
1541 | 1541 | then pd | |
1542 | 1542 | else [IntegerEntry(k, v)] | |
1543 | 1543 | ||
1544 | 1544 | ||
1545 | 1545 | ||
1546 | 1546 | @Callable(i) | |
1547 | 1547 | func getPoolConfigWrapperREADONLY () = $Tuple2(nil, gpc()) | |
1548 | 1548 | ||
1549 | 1549 | ||
1550 | 1550 | ||
1551 | 1551 | @Callable(i) | |
1552 | 1552 | func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId)) | |
1553 | 1553 | ||
1554 | 1554 | ||
1555 | 1555 | ||
1556 | 1556 | @Callable(i) | |
1557 | 1557 | func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = { | |
1558 | 1558 | let pr = calcPrices(amAmt, prAmt, lpAmt) | |
1559 | 1559 | $Tuple2(nil, [toString(pr[0]), toString(pr[1]), toString(pr[2])]) | |
1560 | 1560 | } | |
1561 | 1561 | ||
1562 | 1562 | ||
1563 | 1563 | ||
1564 | 1564 | @Callable(i) | |
1565 | 1565 | func fromX18WrapperREADONLY (val,resScaleMult) = $Tuple2(nil, f1(parseBigIntValue(val), resScaleMult)) | |
1566 | 1566 | ||
1567 | 1567 | ||
1568 | 1568 | ||
1569 | 1569 | @Callable(i) | |
1570 | 1570 | func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(t1(origVal, origScaleMult))) | |
1571 | 1571 | ||
1572 | 1572 | ||
1573 | 1573 | ||
1574 | 1574 | @Callable(i) | |
1575 | 1575 | func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(cpbi(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18)))) | |
1576 | 1576 | ||
1577 | 1577 | ||
1578 | 1578 | ||
1579 | 1579 | @Callable(i) | |
1580 | 1580 | func estimatePutOperationWrapperREADONLY (txId58,slippage,inAmAmt,inAmId,inPrAmt,inPrId,usrAddr,isEval,emitLp) = $Tuple2(nil, epo(txId58, slippage, inAmAmt, inAmId, inPrAmt, inPrId, usrAddr, isEval, emitLp, true, false, 0, "")) | |
1581 | 1581 | ||
1582 | 1582 | ||
1583 | 1583 | ||
1584 | 1584 | @Callable(i) | |
1585 | 1585 | func estimateGetOperationWrapperREADONLY (txId58,pmtAsId,pmtLpAmt,usrAddr) = { | |
1586 | 1586 | let r = ego(txId58, pmtAsId, pmtLpAmt, addressFromStringValue(usrAddr)) | |
1587 | 1587 | $Tuple2(nil, $Tuple10(r._1, r._2, r._3, r._4, r._5, r._6, r._7, toString(r._8), r._9, r._10)) | |
1588 | 1588 | } | |
1589 | 1589 | ||
1590 | 1590 | ||
1591 | 1591 | ||
1592 | 1592 | @Callable(i) | |
1593 | 1593 | func getFeeREADONLY () = $Tuple2(nil, fee) | |
1594 | 1594 | ||
1595 | 1595 | ||
1596 | 1596 | @Verifier(tx) | |
1597 | 1597 | func verify () = { | |
1598 | 1598 | let targetPublicKey = match m() { | |
1599 | 1599 | case pk: ByteVector => | |
1600 | 1600 | pk | |
1601 | 1601 | case _: Unit => | |
1602 | 1602 | tx.senderPublicKey | |
1603 | 1603 | case _ => | |
1604 | 1604 | throw("Match error") | |
1605 | 1605 | } | |
1606 | 1606 | match tx { | |
1607 | 1607 | case order: Order => | |
1608 | 1608 | let matcherPub = mp() | |
1609 | 1609 | let orderValid = validateMatcherOrderAllowed(order) | |
1610 | 1610 | let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey) | |
1611 | 1611 | let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub) | |
1612 | 1612 | if (if (if (orderValid) | |
1613 | 1613 | then senderValid | |
1614 | 1614 | else false) | |
1615 | 1615 | then matcherValid | |
1616 | 1616 | else false) | |
1617 | 1617 | then true | |
1618 | 1618 | else toe(orderValid, senderValid, matcherValid) | |
1619 | 1619 | case s: SetScriptTransaction => | |
1620 | 1620 | let newHash = blake2b256(value(s.script)) | |
1621 | 1621 | let allowedHash = fromBase64String(value(getString(fca, keyAllowedLpStableScriptHash()))) | |
1622 | 1622 | let currentHash = scriptHash(this) | |
1623 | 1623 | if (if ((allowedHash == newHash)) | |
1624 | 1624 | then (currentHash != newHash) | |
1625 | 1625 | else false) | |
1626 | 1626 | then true | |
1627 | 1627 | else sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
1628 | 1628 | case _ => | |
1629 | 1629 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
1630 | 1630 | } | |
1631 | 1631 | } | |
1632 | 1632 |
github/deemru/w8io/03bedc9 245.84 ms ◑![]()