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