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