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