tx · 7BhDE2surYHbLxh547JLzvT966Zb4mQCRu7aQ8DRXpnp

3NAefciWv6f9fWvEXdGgpHfanJFG8HqfjuT:  -0.03600000 Waves

2023.01.19 18:15 [2411977] smart account 3NAefciWv6f9fWvEXdGgpHfanJFG8HqfjuT > SELF 0.00000000 Waves

{ "type": 13, "id": "7BhDE2surYHbLxh547JLzvT966Zb4mQCRu7aQ8DRXpnp", "fee": 3600000, "feeAssetId": null, "timestamp": 1674141342859, "version": 1, "sender": "3NAefciWv6f9fWvEXdGgpHfanJFG8HqfjuT", "senderPublicKey": "D1BL65meykxFZTCuq7jq9HSGLLnWvQamQPUNrguW5w39", "proofs": [ "5X8bxjPCnxMc4stZndpJg1tf4rGHqzoRYNHZbYFUoa2JVkZ7pV4cfjD48bocgnA9qwLneMVWJ62rW8BQKcjwEv6A" ], "script": "base64:BgLtKAgCEgMKAQgSAwoBCBIAEgQKAgEEEgQKAgEEEgMKAQESABIECgIIARIAEgQKAggBEgQKAggBEgQKAgEBEgMKAQESBQoDAQEBEgUKAwEIARIECgIBCBIECgIBCBIECgIICBIECgIICBIECgIIARIAEgMKAQgSBQoDAQEBEgQKAggBEgQKAgEBEgQKAggIEgsKCQgBAQIBAggEBBIGCgQICAEIIgZzY2FsZTgiDHNjYWxlOEJpZ0ludCIHc2NhbGUxOCIKemVyb0JpZ0ludCIEYmlnMCIEYmlnMSIEYmlnMiIEYmlnMyIEYmlnNCIKc2xpcHBhZ2U0RCILd2F2ZXNTdHJpbmciBUFtdWx0IgVEY29udiIDU0VQIgVFTVBUWSIKUG9vbEFjdGl2ZSIKUG9vbFB1dERpcyIOUG9vbE1hdGNoZXJEaXMiDFBvb2xTaHV0ZG93biIOaWR4UG9vbEFkZHJlc3MiCWlkeFBvb2xTdCIJaWR4TFBBc0lkIglpZHhBbUFzSWQiCWlkeFByQXNJZCILaWR4QW10QXNEY20iDWlkeFByaWNlQXNEY20iC2lkeElBbXRBc0lkIg1pZHhJUHJpY2VBc0lkIg9pZHh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0tleQQCaFUJAPQDAwgFAmVZCWJvZHlCeXRlcwkAkQMCCAUCZVkGcHJvb2ZzAAEFAmhSAwMDBQJoUwUCaFQHBQJoVQcGCQECYUUDBQJoUwUCaFQFAmhVAwkAAQIFAmdqAhRTZXRTY3JpcHRUcmFuc2FjdGlvbgQCY0IFAmdqAwkA9AMDCAUCaE8JYm9keUJ5dGVzCQCRAwIIBQJoTwZwcm9vZnMAAAUCaFEGBAJoVgkA9gMBCQEFdmFsdWUBCAUCY0IGc2NyaXB0BAJoVwkA2wQBCQEFdmFsdWUBCQCdCAIFAmFQCQECYUMABAJoWAkA8QcBBQR0aGlzAwkAAAIFAmhXBQJoVgkBAiE9AgUCaFgFAmhWBwkA9AMDCAUCaE8JYm9keUJ5dGVzCQCRAwIIBQJoTwZwcm9vZnMAAAUCaFFXp+Ww", "chainId": 84, "height": 2411977, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3NFLG7ZXqRTmbnjJrWXKV1np4uQ7nKDmuwPcY4bpHQmi Next: it5oTgQEutT9ZGq9fAUmFPnZFUeVmsghAAVYhF4nDm9 Diff:
OldNewDifferences
335335 }
336336
337337
338+func getD (xp) = {
339+ let xp0 = xp[0]
340+ let xp1 = xp[1]
341+ let s = (xp0 + xp1)
342+ if ((s == big0))
343+ then big0
344+ else {
345+ let a = parseIntValue(A)
346+ let ann = (a * 2)
347+ let p = fraction(xp0, xp1, big1)
348+ let xp0_xp1_n_n = fraction(p, big4, big1)
349+ let ann_s = fraction(toBigInt(ann), s, big1)
350+ let ann_1 = toBigInt((ann - 1))
351+ func calcDNext (d) = {
352+ let dd = fraction(d, d, big1)
353+ let ddd = fraction(dd, d, big1)
354+ let dp = fraction(ddd, big1, xp0_xp1_n_n)
355+ fraction((ann_s + fraction(dp, big2, big1)), d, (fraction(ann_1, d, big1) + fraction(big3, dp, big1)))
356+ }
357+
358+ func calc (acc,i) = if (acc._2)
359+ then acc
360+ else {
361+ let d = acc._1
362+ let dNext = calcDNext(d)
363+ let dDiffRaw = (dNext - value(d))
364+ let dDiff = if ((big0 > dDiffRaw))
365+ then -(dDiffRaw)
366+ else dDiffRaw
367+ if ((big1 >= dDiff))
368+ then $Tuple2(dNext, true)
369+ else $Tuple2(dNext, false)
370+ }
371+
372+ let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
373+ let $t01257312621 = {
374+ let $l = arr
375+ let $s = size($l)
376+ let $acc0 = $Tuple2(s, false)
377+ func $f0_1 ($a,$i) = if (($i >= $s))
378+ then $a
379+ else calc($a, $l[$i])
380+
381+ func $f0_2 ($a,$i) = if (($i >= $s))
382+ then $a
383+ else throw("List size exceeds 15")
384+
385+ $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)
386+ }
387+ let d = $t01257312621._1
388+ let found = $t01257312621._2
389+ if (found)
390+ then d
391+ else throw(("D calculation error, D = " + toString(d)))
392+ }
393+ }
394+
395+
338396 func ego (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
339397 let lpId = cfgLpAssetId
340398 let amId = toBase58String(value(cfgAmountAssetId))
403461 let userPriceX18 = cpbi(inPrAssetAmtX18, inAmAssetAmtX18)
404462 let amBalanceX18 = t1(amBalance, amtDcm)
405463 let prBalanceX18 = t1(prBalance, priceDcm)
464+ let D0 = getD([amBalanceX18, prBalanceX18])
406465 let r = if ((lpEm == 0))
407466 then {
408- let curPriceX18 = zeroBigInt
409- let slippageX18 = zeroBigInt
410- let lpAmtX18 = pow((inAmAssetAmtX18 * inPrAssetAmtX18), 0, toBigInt(5), 1, 0, DOWN)
411- $Tuple5(f1(lpAmtX18, scale8), f1(inAmAssetAmtX18, amtDcm), f1(inPrAssetAmtX18, priceDcm), cpbi((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18)
467+ let D1 = getD([(amBalanceX18 + inAmAssetAmtX18), (prBalanceX18 + inPrAssetAmtX18)])
468+ let checkD = if ((D1 > D0))
469+ then true
470+ else throw("D1 should be greater than D0")
471+ if ((checkD == checkD))
472+ then {
473+ let curPriceX18 = zeroBigInt
474+ let slippageX18 = zeroBigInt
475+ let lpAmtX18 = D1
476+ $Tuple5(f1(lpAmtX18, scale8), f1(inAmAssetAmtX18, amtDcm), f1(inPrAssetAmtX18, priceDcm), cpbi((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18)
477+ }
478+ else throw("Strict value is not equal to itself.")
412479 }
413480 else {
414481 let curPriceX18 = cpbi(prBalanceX18, amBalanceX18)
429496 else $Tuple2(inAmAssetAmtX18, prViaAmX18)
430497 let expAmtAssetAmtX18 = expectedAmts._1
431498 let expPriceAssetAmtX18 = expectedAmts._2
432- let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18, FLOOR)
433- $Tuple5(fromX18Round(lpAmtX18, scale8, FLOOR), fromX18Round(expAmtAssetAmtX18, amtDcm, CEILING), fromX18Round(expPriceAssetAmtX18, priceDcm, CEILING), curPriceX18, slippageX18)
499+ let D1 = getD([(amBalanceX18 + expAmtAssetAmtX18), (prBalanceX18 + expPriceAssetAmtX18)])
500+ let checkD = if ((D1 > D0))
501+ then true
502+ else throw("D1 should be greater than D0")
503+ if ((checkD == checkD))
504+ then {
505+ let lpAmtX18 = fraction(lpEmissionX18, (D1 - D0), D0)
506+ $Tuple5(fromX18Round(lpAmtX18, scale8, FLOOR), fromX18Round(expAmtAssetAmtX18, amtDcm, CEILING), fromX18Round(expPriceAssetAmtX18, priceDcm, CEILING), curPriceX18, slippageX18)
507+ }
508+ else throw("Strict value is not equal to itself.")
434509 }
435510 }
436511 let calcLpAmt = r._1
446521 else calcLpAmt
447522 let amDiff = (inAmAmt - calcAmAssetPmt)
448523 let prDiff = (inPrAmt - calcPrAssetPmt)
449- let $t01872619071 = if (if (isOneAsset)
524+ let $t02046020805 = if (if (isOneAsset)
450525 then (pmtId == amIdStr)
451526 else false)
452527 then $Tuple2(pmtAmt, 0)
455530 else false)
456531 then $Tuple2(0, pmtAmt)
457532 else $Tuple2(calcAmAssetPmt, calcPrAssetPmt)
458- let writeAmAmt = $t01872619071._1
459- let writePrAmt = $t01872619071._2
533+ let writeAmAmt = $t02046020805._1
534+ let writePrAmt = $t02046020805._2
460535 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))]
461536 $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEm, lpId, sts, commonState, amDiff, prDiff, inAmId, inPrId)
462- }
463- }
464-
465-
466-func getD (xp) = {
467- let xp0 = xp[0]
468- let xp1 = xp[1]
469- let s = (xp0 + xp1)
470- if ((s == big0))
471- then big0
472- else {
473- let a = parseIntValue(A)
474- let ann = (a * 2)
475- let p = fraction(xp0, xp1, big1)
476- let xp0_xp1_n_n = fraction(p, big4, big1)
477- let ann_s = fraction(toBigInt(ann), s, big1)
478- let ann_1 = toBigInt((ann - 1))
479- func calcDNext (d) = {
480- let dd = fraction(d, d, big1)
481- let ddd = fraction(dd, d, big1)
482- let dp = fraction(ddd, big1, xp0_xp1_n_n)
483- fraction((ann_s + fraction(dp, big2, big1)), d, (fraction(ann_1, d, big1) + fraction(big3, dp, big1)))
484- }
485-
486- func calc (acc,i) = if (acc._2)
487- then acc
488- else {
489- let d = acc._1
490- let dNext = calcDNext(d)
491- let dDiffRaw = (dNext - value(d))
492- let dDiff = if ((big0 > dDiffRaw))
493- then -(dDiffRaw)
494- else dDiffRaw
495- if ((big1 >= dDiff))
496- then $Tuple2(dNext, true)
497- else $Tuple2(dNext, false)
498- }
499-
500- let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
501- let $t02097821026 = {
502- let $l = arr
503- let $s = size($l)
504- let $acc0 = $Tuple2(s, false)
505- func $f0_1 ($a,$i) = if (($i >= $s))
506- then $a
507- else calc($a, $l[$i])
508-
509- func $f0_2 ($a,$i) = if (($i >= $s))
510- then $a
511- else throw("List size exceeds 15")
512-
513- $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15)
514- }
515- let d = $t02097821026._1
516- let found = $t02097821026._2
517- if (found)
518- then d
519- else throw(("D calculation error, D = " + toString(d)))
520537 }
521538 }
522539
533550 let c = (((((D * D) / (x * n)) * D) * aPrecision) / (ann * n))
534551 let b = ((s + ((D * aPrecision) / ann)) - D)
535552 func calc (acc,cur) = {
536- let $t02151821538 = acc
537- let y = $t02151821538._1
538- let found = $t02151821538._2
553+ let $t02200022020 = acc
554+ let y = $t02200022020._1
555+ let found = $t02200022020._2
539556 if ((found != unit))
540557 then acc
541558 else {
548565 }
549566
550567 let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
551- let $t02184521892 = {
568+ let $t02232722374 = {
552569 let $l = arr
553570 let $s = size($l)
554571 let $acc0 = $Tuple2(D, unit)
562579
563580 $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)
564581 }
565- let y = $t02184521892._1
566- let found = $t02184521892._2
582+ let y = $t02232722374._1
583+ let found = $t02232722374._2
567584 if ((found != unit))
568585 then y
569586 else throw(("Y calculation error, Y = " + toString(y)))
605622 func validateMatcherOrderAllowed (order) = {
606623 let amountAssetAmount = order.amount
607624 let priceAssetAmount = fraction(order.amount, order.price, scale8, FLOOR)
608- let $t02393624148 = if ((order.orderType == Buy))
625+ let $t02441824630 = if ((order.orderType == Buy))
609626 then $Tuple2(amountAssetAmount, -(priceAssetAmount))
610627 else $Tuple2(-(amountAssetAmount), priceAssetAmount)
611- let amountAssetBalanceDelta = $t02393624148._1
612- let priceAssetBalanceDelta = $t02393624148._2
628+ let amountAssetBalanceDelta = $t02441824630._1
629+ let priceAssetBalanceDelta = $t02441824630._2
613630 if (if (if (igs())
614631 then true
615632 else (cfgPoolStatus == PoolMatcherDis))
622639 then throw("Wr assets")
623640 else {
624641 let dLp = parseBigIntValue(getStringValue(this, keyDLp))
625- let $t02447824578 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
626- let unusedActions = $t02447824578._1
627- let dLpNew = $t02447824578._2
642+ let $t02496025060 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
643+ let unusedActions = $t02496025060._1
644+ let dLpNew = $t02496025060._2
628645 let isOrderValid = (dLpNew >= dLp)
629646 isOrderValid
630647 }
677694 then {
678695 let amBalance = getAccBalance(amId)
679696 let prBalance = getAccBalance(prId)
680- let $t02684427306 = if ((txId == ""))
697+ let $t02732627788 = if ((txId == ""))
681698 then $Tuple2(amBalance, prBalance)
682699 else if ((pmtAssetId == amId))
683700 then if ((pmtAmtRaw > amBalance))
688705 then throw("invalid payment amount")
689706 else $Tuple2(amBalance, (prBalance - pmtAmtRaw))
690707 else throw("wrong pmtAssetId")
691- let amBalanceOld = $t02684427306._1
692- let prBalanceOld = $t02684427306._2
693- let $t02731227488 = if ((pmtAssetId == amId))
708+ let amBalanceOld = $t02732627788._1
709+ let prBalanceOld = $t02732627788._2
710+ let $t02779427970 = if ((pmtAssetId == amId))
694711 then $Tuple2(pmtAmtRaw, 0)
695712 else if ((pmtAssetId == prId))
696713 then $Tuple2(0, pmtAmtRaw)
697714 else throw("invalid payment")
698- let amAmountRaw = $t02731227488._1
699- let prAmountRaw = $t02731227488._2
700- let $t02749227746 = if (withTakeFee)
715+ let amAmountRaw = $t02779427970._1
716+ let prAmountRaw = $t02779427970._2
717+ let $t02797428228 = if (withTakeFee)
701718 then $Tuple3(takeFee(amAmountRaw, inFee)._1, takeFee(prAmountRaw, inFee)._1, takeFee(pmtAmtRaw, inFee)._2)
702719 else $Tuple3(amAmountRaw, prAmountRaw, 0)
703- let amAmount = $t02749227746._1
704- let prAmount = $t02749227746._2
705- let feeAmount = $t02749227746._3
720+ let amAmount = $t02797428228._1
721+ let prAmount = $t02797428228._2
722+ let feeAmount = $t02797428228._3
706723 let amBalanceNew = (amBalanceOld + amAmount)
707724 let prBalanceNew = (prBalanceOld + prAmount)
708- let D0 = getD([toBigInt(amBalanceOld), toBigInt(prBalanceOld)])
709- let D1 = getD([toBigInt(amBalanceNew), toBigInt(prBalanceNew)])
725+ let D0 = getD([t1(amBalanceOld, cfgAmountAssetDecimals), t1(prBalanceOld, cfgPriceAssetDecimals)])
726+ let D1 = getD([t1(amBalanceNew, cfgAmountAssetDecimals), t1(prBalanceNew, cfgPriceAssetDecimals)])
710727 let checkD = if ((D1 > D0))
711728 then true
712729 else throw()
750767 else {
751768 let amBalance = getAccBalance(amId)
752769 let prBalance = getAccBalance(prId)
753- let $t02979629907 = {
770+ let $t03034030451 = {
754771 let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, pmtAmt], nil)
755772 if ($isInstanceOf(@, "(Int, Int)"))
756773 then @
757774 else throw(($getType(@) + " couldn't be cast to (Int, Int)"))
758775 }
759- if (($t02979629907 == $t02979629907))
776+ if (($t03034030451 == $t03034030451))
760777 then {
761- let feeAmount = $t02979629907._2
762- let totalGet = $t02979629907._1
778+ let feeAmount = $t03034030451._2
779+ let totalGet = $t03034030451._1
763780 let totalAmount = if (if ((minOutAmount > 0))
764781 then (minOutAmount > totalGet)
765782 else false)
766783 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
767784 else totalGet
768- let $t03009730404 = if ((outAssetId == amId))
785+ let $t03064130948 = if ((outAssetId == amId))
769786 then $Tuple4(totalAmount, 0, ((amBalance - totalAmount) - feeAmount), prBalance)
770787 else if ((outAssetId == prId))
771788 then $Tuple4(0, totalAmount, amBalance, ((prBalance - totalAmount) - feeAmount))
772789 else throw("invalid out asset id")
773- let outAm = $t03009730404._1
774- let outPr = $t03009730404._2
775- let amBalanceNew = $t03009730404._3
776- let prBalanceNew = $t03009730404._4
790+ let outAm = $t03064130948._1
791+ let outPr = $t03064130948._2
792+ let amBalanceNew = $t03064130948._3
793+ let prBalanceNew = $t03064130948._4
777794 let curPrX18 = cpbi(t1(prBalanceNew, prDecimals), t1(amBalanceNew, amDecimals))
778795 let curPr = f1(curPrX18, scale8)
779796 let outAssetIdOrWaves = if ((outAssetId == "WAVES"))
788805 let burn = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
789806 if ((burn == burn))
790807 then {
791- let $t03118931539 = {
808+ let $t03173332083 = {
792809 let feeAmountForCalc = if ((this == feeCollectorAddress))
793810 then 0
794811 else feeAmount
799816 then $Tuple2(-((totalGet + feeAmountForCalc)), 0)
800817 else $Tuple2(0, -((totalGet + feeAmountForCalc)))
801818 }
802- let amountAssetBalanceDelta = $t03118931539._1
803- let priceAssetBalanceDelta = $t03118931539._2
804- let $t03154231650 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
805- let refreshDLpActions = $t03154231650._1
806- let updatedDLp = $t03154231650._2
819+ let amountAssetBalanceDelta = $t03173332083._1
820+ let priceAssetBalanceDelta = $t03173332083._2
821+ let $t03208632194 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
822+ let refreshDLpActions = $t03208632194._1
823+ let updatedDLp = $t03208632194._2
807824 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
808825 if ((isUpdatedDLpValid == isUpdatedDLpValid))
809826 then $Tuple2((state ++ refreshDLpActions), totalAmount)
972989 else throw("Strict value is not equal to itself.")
973990 }
974991 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
975- let $t03579935941 = refreshDLpInternal(0, 0, 0)
976- let refreshDLpActions = $t03579935941._1
977- let updatedDLp = $t03579935941._2
992+ let $t03634336485 = refreshDLpInternal(0, 0, 0)
993+ let refreshDLpActions = $t03634336485._1
994+ let updatedDLp = $t03634336485._2
978995 let check = if ((updatedDLp >= currentDLp))
979996 then true
980997 else throwErr(makeString(["updated DLp lower than current DLp", toString(amountAssetBalance), toString(priceAssetBalance), toString(lpAssetEmission), toString(currentDLp), toString(updatedDLp), toString(amDiff), toString(prDiff)], " "))
10471064 else calcCurrentDLp(toBigInt(0), toBigInt(pmtAmt), toBigInt(0))
10481065 if ((currentDLp == currentDLp))
10491066 then {
1050- let $t03758237740 = calcPutOneTkn(pmtAmt, pmtAssetId, toString(userAddress), toBase58String(i.transactionId), true)
1051- if (($t03758237740 == $t03758237740))
1067+ let $t03812638284 = calcPutOneTkn(pmtAmt, pmtAssetId, toString(userAddress), toBase58String(i.transactionId), true)
1068+ if (($t03812638284 == $t03812638284))
10521069 then {
1053- let feeAmount = $t03758237740._3
1054- let state = $t03758237740._2
1055- let estimLP = $t03758237740._1
1070+ let feeAmount = $t03812638284._3
1071+ let state = $t03812638284._2
1072+ let estimLP = $t03812638284._1
10561073 let emitLpAmt = if (if ((minOutAmount > 0))
10571074 then (minOutAmount > estimLP)
10581075 else false)
10801097 let sendFeeToMatcher = if ((feeAmount > 0))
10811098 then [ScriptTransfer(feeCollectorAddress, feeAmount, fromBase58String(pmtAssetId))]
10821099 else nil
1083- let $t03855538904 = if ((this == feeCollectorAddress))
1100+ let $t03909939448 = if ((this == feeCollectorAddress))
10841101 then $Tuple2(0, 0)
10851102 else {
10861103 let paymentInAmountAsset = if ((pmt.assetId == cfgAmountAssetId))
10901107 then $Tuple2(-(feeAmount), 0)
10911108 else $Tuple2(0, -(feeAmount))
10921109 }
1093- let amountAssetBalanceDelta = $t03855538904._1
1094- let priceAssetBalanceDelta = $t03855538904._2
1095- let $t03890739015 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1096- let refreshDLpActions = $t03890739015._1
1097- let updatedDLp = $t03890739015._2
1110+ let amountAssetBalanceDelta = $t03909939448._1
1111+ let priceAssetBalanceDelta = $t03909939448._2
1112+ let $t03945139559 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1113+ let refreshDLpActions = $t03945139559._1
1114+ let updatedDLp = $t03945139559._2
10981115 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
10991116 if ((isUpdatedDLpValid == isUpdatedDLpValid))
11001117 then $Tuple2((((state ++ lpTrnsfr) ++ sendFeeToMatcher) ++ refreshDLpActions), emitLpAmt)
11261143 let currentDLp = calcCurrentDLp(amAssetPmt, prAssetPmt, toBigInt(0))
11271144 if ((currentDLp == currentDLp))
11281145 then {
1129- let $t04004540110 = refreshDLpInternal(0, 0, 0)
1130- let refreshDLpActions = $t04004540110._1
1131- let updatedDLp = $t04004540110._2
1146+ let $t04058940654 = refreshDLpInternal(0, 0, 0)
1147+ let refreshDLpActions = $t04058940654._1
1148+ let updatedDLp = $t04058940654._2
11321149 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
11331150 if ((isUpdatedDLpValid == isUpdatedDLpValid))
11341151 then (state ++ refreshDLpActions)
11531170 let b = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
11541171 if ((b == b))
11551172 then {
1156- let $t04128341365 = refreshDLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1157- let refreshDLpActions = $t04128341365._1
1158- let updatedDLp = $t04128341365._2
1173+ let $t04182741909 = refreshDLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1174+ let refreshDLpActions = $t04182741909._1
1175+ let updatedDLp = $t04182741909._2
11591176 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
11601177 if ((isUpdatedDLpValid == isUpdatedDLpValid))
11611178 then (state ++ refreshDLpActions)
11901207 else throwErr("exactly 1 payment are expected")]
11911208 if ((checks == checks))
11921209 then {
1193- let $t04198342138 = getOneTknV2Internal(outAssetId, minOutAmount, i.payments, i.caller, i.originCaller, i.transactionId)
1194- let state = $t04198342138._1
1195- let totalAmount = $t04198342138._2
1210+ let $t04252742682 = getOneTknV2Internal(outAssetId, minOutAmount, i.payments, i.caller, i.originCaller, i.transactionId)
1211+ let state = $t04252742682._1
1212+ let totalAmount = $t04252742682._2
11961213 $Tuple2(state, totalAmount)
11971214 }
11981215 else throw("Strict value is not equal to itself.")
12091226 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
12101227 then {
12111228 let dLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyDLp), "0")), fmtErr("invalid dLp"))
1212- let $t04266242726 = refreshDLpInternal(0, 0, 0)
1213- let dLpUpdateActions = $t04266242726._1
1214- let updatedDLp = $t04266242726._2
1229+ let $t04320643270 = refreshDLpInternal(0, 0, 0)
1230+ let dLpUpdateActions = $t04320643270._1
1231+ let updatedDLp = $t04320643270._2
12151232 let actions = if ((dLp != updatedDLp))
12161233 then dLpUpdateActions
12171234 else throwErr("nothing to refresh")
12391256 let newY = getYD(xp, index, D1)
12401257 let dy = (xp[index] - newY)
12411258 let totalGetRaw = max([0, toInt((dy - big1))])
1242- let $t04365643711 = takeFee(totalGetRaw, outFee)
1243- let totalGet = $t04365643711._1
1244- let feeAmount = $t04365643711._2
1259+ let $t04420044255 = takeFee(totalGetRaw, outFee)
1260+ let totalGet = $t04420044255._1
1261+ let feeAmount = $t04420044255._2
12451262 $Tuple2(nil, $Tuple2(totalGet, feeAmount))
12461263 }
12471264
12541271 let lpId = toBase58String(value(cfgLpAssetId))
12551272 let amBalance = getAccBalance(amId)
12561273 let prBalance = getAccBalance(prId)
1257- let $t04408644201 = {
1274+ let $t04463044745 = {
12581275 let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, lpAssetAmount], nil)
12591276 if ($isInstanceOf(@, "(Int, Int)"))
12601277 then @
12611278 else throw(($getType(@) + " couldn't be cast to (Int, Int)"))
12621279 }
1263- let totalGet = $t04408644201._1
1264- let feeAmount = $t04408644201._2
1280+ let totalGet = $t04463044745._1
1281+ let feeAmount = $t04463044745._2
12651282 let r = ego("", lpId, lpAssetAmount, this)
12661283 let outAmAmt = r._1
12671284 let outPrAmt = r._2
12951312 let burnLPAssetOnFactory = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
12961313 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
12971314 then {
1298- let $t04536745448 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1299- let refreshDLpActions = $t04536745448._1
1300- let updatedDLp = $t04536745448._2
1315+ let $t04591145992 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1316+ let refreshDLpActions = $t04591145992._1
1317+ let updatedDLp = $t04591145992._2
13011318 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
13021319 if ((isUpdatedDLpValid == isUpdatedDLpValid))
13031320 then (state ++ refreshDLpActions)
13421359 let burnA = invoke(fca, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
13431360 if ((burnA == burnA))
13441361 then {
1345- let $t04647546556 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1346- let refreshDLpActions = $t04647546556._1
1347- let updatedDLp = $t04647546556._2
1362+ let $t04701947100 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1363+ let refreshDLpActions = $t04701947100._1
1364+ let updatedDLp = $t04701947100._2
13481365 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
13491366 if ((isUpdatedDLpValid == isUpdatedDLpValid))
13501367 then (state ++ refreshDLpActions)
13951412 let burnLPAssetOnFactory = invoke(fca, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
13961413 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
13971414 then {
1398- let $t04780747888 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1399- let refreshDLpActions = $t04780747888._1
1400- let updatedDLp = $t04780747888._2
1415+ let $t04835148432 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1416+ let refreshDLpActions = $t04835148432._1
1417+ let updatedDLp = $t04835148432._2
14011418 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
14021419 if ((isUpdatedDLpValid == isUpdatedDLpValid))
14031420 then (state ++ refreshDLpActions)
14441461 let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), unstakeAmount], nil)
14451462 if ((unstakeInv == unstakeInv))
14461463 then {
1447- let $t04878348971 = getOneTknV2Internal(outAssetId, minOutAmount, [AttachedPayment(lpAssetId, unstakeAmount)], i.caller, i.originCaller, i.transactionId)
1448- let state = $t04878348971._1
1449- let totalAmount = $t04878348971._2
1464+ let $t04932749515 = getOneTknV2Internal(outAssetId, minOutAmount, [AttachedPayment(lpAssetId, unstakeAmount)], i.caller, i.originCaller, i.transactionId)
1465+ let state = $t04932749515._1
1466+ let totalAmount = $t04932749515._2
14501467 $Tuple2(state, totalAmount)
14511468 }
14521469 else throw("Strict value is not equal to itself.")
14581475
14591476 @Callable(i)
14601477 func putOneTknV2WithBonusREADONLY (paymentAmountRaw,paymentAssetId) = {
1461- let $t04909949202 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", true)
1462- let lpAmount = $t04909949202._1
1463- let state = $t04909949202._2
1464- let feeAmount = $t04909949202._3
1465- let bonus = $t04909949202._4
1478+ let $t04964349746 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", true)
1479+ let lpAmount = $t04964349746._1
1480+ let state = $t04964349746._2
1481+ let feeAmount = $t04964349746._3
1482+ let bonus = $t04964349746._4
14661483 $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus))
14671484 }
14681485
14701487
14711488 @Callable(i)
14721489 func putOneTknV2WithoutTakeFeeREADONLY (paymentAmountRaw,paymentAssetId) = {
1473- let $t04935049454 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", false)
1474- let lpAmount = $t04935049454._1
1475- let state = $t04935049454._2
1476- let feeAmount = $t04935049454._3
1477- let bonus = $t04935049454._4
1490+ let $t04989449998 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", false)
1491+ let lpAmount = $t04989449998._1
1492+ let state = $t04989449998._2
1493+ let feeAmount = $t04989449998._3
1494+ let bonus = $t04989449998._4
14781495 $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus))
14791496 }
14801497
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let scale8 = 100000000
55
66 let scale8BigInt = toBigInt(100000000)
77
88 let scale18 = toBigInt(1000000000000000000)
99
1010 let zeroBigInt = toBigInt(0)
1111
1212 let big0 = toBigInt(0)
1313
1414 let big1 = toBigInt(1)
1515
1616 let big2 = toBigInt(2)
1717
1818 let big3 = toBigInt(3)
1919
2020 let big4 = toBigInt(4)
2121
2222 let slippage4D = toBigInt((scale8 - ((scale8 * 1) / scale8)))
2323
2424 let wavesString = "WAVES"
2525
2626 let Amult = "100"
2727
2828 let Dconv = "1"
2929
3030 let SEP = "__"
3131
3232 let EMPTY = ""
3333
3434 let PoolActive = 1
3535
3636 let PoolPutDis = 2
3737
3838 let PoolMatcherDis = 3
3939
4040 let PoolShutdown = 4
4141
4242 let idxPoolAddress = 1
4343
4444 let idxPoolSt = 2
4545
4646 let idxLPAsId = 3
4747
4848 let idxAmAsId = 4
4949
5050 let idxPrAsId = 5
5151
5252 let idxAmtAsDcm = 6
5353
5454 let idxPriceAsDcm = 7
5555
5656 let idxIAmtAsId = 8
5757
5858 let idxIPriceAsId = 9
5959
6060 let idxFactStakCntr = 1
6161
6262 let idxFactoryRestCntr = 6
6363
6464 let idxFactSlippCntr = 7
6565
6666 let idxFactGwxRewCntr = 10
6767
6868 let feeDefault = fraction(10, scale8, 10000)
6969
7070 func t1 (origVal,origScaleMult) = fraction(toBigInt(origVal), scale18, toBigInt(origScaleMult))
7171
7272
7373 func t1BigInt (origVal,origScaleMult) = fraction(origVal, scale18, origScaleMult)
7474
7575
7676 func f1 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), scale18))
7777
7878
7979 func fromX18Round (val,resultScaleMult,round) = toInt(fraction(val, toBigInt(resultScaleMult), scale18, round))
8080
8181
8282 func t2 (origVal,origScaleMult) = fraction(origVal, scale18, toBigInt(origScaleMult))
8383
8484
8585 func f2 (val,resultScaleMult) = fraction(val, toBigInt(resultScaleMult), scale18)
8686
8787
8888 func ts (amt,resScale,curScale) = fraction(amt, resScale, curScale)
8989
9090
9191 func abs (val) = if ((zeroBigInt > val))
9292 then -(val)
9393 else val
9494
9595
9696 func absBigInt (val) = if ((zeroBigInt > val))
9797 then -(val)
9898 else val
9999
100100
101101 func fc () = "%s__factoryContract"
102102
103103
104104 func mpk () = "%s__managerPublicKey"
105105
106106
107107 func pmpk () = "%s__pendingManagerPublicKey"
108108
109109
110110 func pl () = "%s%s__price__last"
111111
112112
113113 func ph (h,t) = makeString(["%s%s%d%d__price__history", toString(h), toString(t)], SEP)
114114
115115
116116 func pau (ua,txId) = ((("%s%s%s__P__" + ua) + "__") + txId)
117117
118118
119119 func gau (ua,txId) = ((("%s%s%s__G__" + ua) + "__") + txId)
120120
121121
122122 func aa () = "%s__amountAsset"
123123
124124
125125 func pa () = "%s__priceAsset"
126126
127127
128128 func amp () = "%s__amp"
129129
130130
131131 func ada () = "%s__addonAddr"
132132
133133
134134 let keyFee = "%s__fee"
135135
136136 let fee = valueOrElse(getInteger(this, keyFee), feeDefault)
137137
138138 let keyDLp = makeString(["%s", "dLp"], SEP)
139139
140140 let keyDLpRefreshedHeight = makeString(["%s", "dLpRefreshedHeight"], SEP)
141141
142142 let keyDLpRefreshDelay = makeString(["%s", "refreshDLpDelay"], SEP)
143143
144144 let dLpRefreshDelayDefault = 1
145145
146146 let dLpRefreshDelay = valueOrElse(getInteger(this, keyDLpRefreshDelay), dLpRefreshDelayDefault)
147147
148148 func fcfg () = "%s__factoryConfig"
149149
150150
151151 func mtpk () = "%s%s__matcher__publicKey"
152152
153153
154154 func pc (iAmtAs,iPrAs) = (((("%d%d%s__" + iAmtAs) + "__") + iPrAs) + "__config")
155155
156156
157157 func mba (bAStr) = ("%s%s%s__mappings__baseAsset2internalId__" + bAStr)
158158
159159
160160 func aps () = "%s__shutdown"
161161
162162
163163 func keyAllowedLpStableScriptHash () = "%s__allowedLpStableScriptHash"
164164
165165
166166 func keyFeeCollectorAddress () = "%s__feeCollectorAddress"
167167
168168
169169 func toe (orV,sendrV,matchV) = throw(((((("Failed: ordValid=" + toString(orV)) + " sndrValid=") + toString(sendrV)) + " mtchrValid=") + toString(matchV)))
170170
171171
172172 func strf (addr,key) = valueOrErrorMessage(getString(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], ""))
173173
174174
175175 func intf (addr,key) = valueOrErrorMessage(getInteger(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], ""))
176176
177177
178178 func throwErr (msg) = throw(makeString(["lp_stable.ride:", msg], " "))
179179
180180
181181 func fmtErr (msg) = makeString(["lp_stable.ride:", msg], " ")
182182
183183
184184 let fca = addressFromStringValue(strf(this, fc()))
185185
186186 let inFee = {
187187 let @ = invoke(fca, "getInFeeREADONLY", [toString(this)], nil)
188188 if ($isInstanceOf(@, "Int"))
189189 then @
190190 else throw(($getType(@) + " couldn't be cast to Int"))
191191 }
192192
193193 let outFee = {
194194 let @ = invoke(fca, "getOutFeeREADONLY", [toString(this)], nil)
195195 if ($isInstanceOf(@, "Int"))
196196 then @
197197 else throw(($getType(@) + " couldn't be cast to Int"))
198198 }
199199
200200 let A = strf(this, amp())
201201
202202 func igs () = valueOrElse(getBoolean(fca, aps()), false)
203203
204204
205205 func mp () = fromBase58String(strf(fca, mtpk()))
206206
207207
208208 let feeCollectorAddress = addressFromStringValue(strf(fca, keyFeeCollectorAddress()))
209209
210210 func gpc () = {
211211 let amtAs = strf(this, aa())
212212 let priceAs = strf(this, pa())
213213 let iPriceAs = intf(fca, mba(priceAs))
214214 let iAmtAs = intf(fca, mba(amtAs))
215215 split(strf(fca, pc(toString(iAmtAs), toString(iPriceAs))), SEP)
216216 }
217217
218218
219219 func parseAssetId (input) = if ((input == wavesString))
220220 then unit
221221 else fromBase58String(input)
222222
223223
224224 func assetIdToString (input) = if ((input == unit))
225225 then wavesString
226226 else toBase58String(value(input))
227227
228228
229229 func parsePoolConfig (poolConfig) = $Tuple9(addressFromStringValue(poolConfig[idxPoolAddress]), parseIntValue(poolConfig[idxPoolSt]), fromBase58String(poolConfig[idxLPAsId]), parseAssetId(poolConfig[idxAmAsId]), parseAssetId(poolConfig[idxPrAsId]), parseIntValue(poolConfig[idxAmtAsDcm]), parseIntValue(poolConfig[idxPriceAsDcm]), fromBase58String(poolConfig[idxIAmtAsId]), fromBase58String(poolConfig[idxIPriceAsId]))
230230
231231
232232 let poolConfigParsed = parsePoolConfig(gpc())
233233
234234 let $t078478076 = poolConfigParsed
235235
236236 let cfgPoolAddress = $t078478076._1
237237
238238 let cfgPoolStatus = $t078478076._2
239239
240240 let cfgLpAssetId = $t078478076._3
241241
242242 let cfgAmountAssetId = $t078478076._4
243243
244244 let cfgPriceAssetId = $t078478076._5
245245
246246 let cfgAmountAssetDecimals = $t078478076._6
247247
248248 let cfgPriceAssetDecimals = $t078478076._7
249249
250250 let cfgInAmountAssedId = $t078478076._8
251251
252252 let cfgInPriceAssetId = $t078478076._9
253253
254254 func gfc () = split(strf(fca, fcfg()), SEP)
255255
256256
257257 let factoryConfig = gfc()
258258
259259 let stakingContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactStakCntr]), "Invalid staking contract address")
260260
261261 let slipageContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactSlippCntr]), "Invalid slipage contract address")
262262
263263 let gwxContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactGwxRewCntr]), "Invalid gwx contract address")
264264
265265 let restContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactoryRestCntr]), "Invalid gwx contract address")
266266
267267 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)
268268
269269
270270 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)
271271
272272
273273 func getAccBalance (assetId) = if ((assetId == "WAVES"))
274274 then wavesBalance(this).available
275275 else assetBalance(this, fromBase58String(assetId))
276276
277277
278278 func cpbi (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18)
279279
280280
281281 func cpbir (prAmtX18,amAmtX18,round) = fraction(prAmtX18, scale18, amAmtX18, round)
282282
283283
284284 func vad (A1,A2,slippage) = {
285285 let diff = fraction((A1 - A2), scale8BigInt, A2)
286286 let pass = ((slippage - abs(diff)) > zeroBigInt)
287287 if (!(pass))
288288 then throw(("Big slpg: " + toString(diff)))
289289 else $Tuple2(pass, min([A1, A2]))
290290 }
291291
292292
293293 func vd (D1,D0,slpg) = {
294294 let diff = fraction(D0, scale8BigInt, D1)
295295 let fail = (slpg > diff)
296296 if (if (fail)
297297 then true
298298 else (D0 > D1))
299299 then throw(((((((toString(D0) + " ") + toString(D1)) + " ") + toString(diff)) + " ") + toString(slpg)))
300300 else fail
301301 }
302302
303303
304304 func pcp (amAssetDcm,prAssetDcm,amAmt,prAmt) = {
305305 let amtAsAmtX18 = t1(amAmt, amAssetDcm)
306306 let prAsAmtX18 = t1(prAmt, prAssetDcm)
307307 cpbi(prAsAmtX18, amtAsAmtX18)
308308 }
309309
310310
311311 func calcPrices (amAmt,prAmt,lpAmt) = {
312312 let amtAsDcm = cfgAmountAssetDecimals
313313 let prAsDcm = cfgPriceAssetDecimals
314314 let priceX18 = pcp(amtAsDcm, prAsDcm, amAmt, prAmt)
315315 let amAmtX18 = t1(amAmt, amtAsDcm)
316316 let prAmtX18 = t1(prAmt, prAsDcm)
317317 let lpAmtX18 = t1(lpAmt, scale8)
318318 let lpPrInAmAsX18 = cpbi(amAmtX18, lpAmtX18)
319319 let lpPrInPrAsX18 = cpbi(prAmtX18, lpAmtX18)
320320 [priceX18, lpPrInAmAsX18, lpPrInPrAsX18]
321321 }
322322
323323
324324 func calculatePrices (amAmt,prAmt,lpAmt) = {
325325 let p = calcPrices(amAmt, prAmt, lpAmt)
326326 [f1(p[0], scale8), f1(p[1], scale8), f1(p[2], scale8)]
327327 }
328328
329329
330330 func takeFee (amount,fee) = {
331331 let feeAmount = if ((fee == 0))
332332 then 0
333333 else fraction(amount, fee, scale8)
334334 $Tuple2((amount - feeAmount), feeAmount)
335335 }
336336
337337
338+func getD (xp) = {
339+ let xp0 = xp[0]
340+ let xp1 = xp[1]
341+ let s = (xp0 + xp1)
342+ if ((s == big0))
343+ then big0
344+ else {
345+ let a = parseIntValue(A)
346+ let ann = (a * 2)
347+ let p = fraction(xp0, xp1, big1)
348+ let xp0_xp1_n_n = fraction(p, big4, big1)
349+ let ann_s = fraction(toBigInt(ann), s, big1)
350+ let ann_1 = toBigInt((ann - 1))
351+ func calcDNext (d) = {
352+ let dd = fraction(d, d, big1)
353+ let ddd = fraction(dd, d, big1)
354+ let dp = fraction(ddd, big1, xp0_xp1_n_n)
355+ fraction((ann_s + fraction(dp, big2, big1)), d, (fraction(ann_1, d, big1) + fraction(big3, dp, big1)))
356+ }
357+
358+ func calc (acc,i) = if (acc._2)
359+ then acc
360+ else {
361+ let d = acc._1
362+ let dNext = calcDNext(d)
363+ let dDiffRaw = (dNext - value(d))
364+ let dDiff = if ((big0 > dDiffRaw))
365+ then -(dDiffRaw)
366+ else dDiffRaw
367+ if ((big1 >= dDiff))
368+ then $Tuple2(dNext, true)
369+ else $Tuple2(dNext, false)
370+ }
371+
372+ let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
373+ let $t01257312621 = {
374+ let $l = arr
375+ let $s = size($l)
376+ let $acc0 = $Tuple2(s, false)
377+ func $f0_1 ($a,$i) = if (($i >= $s))
378+ then $a
379+ else calc($a, $l[$i])
380+
381+ func $f0_2 ($a,$i) = if (($i >= $s))
382+ then $a
383+ else throw("List size exceeds 15")
384+
385+ $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)
386+ }
387+ let d = $t01257312621._1
388+ let found = $t01257312621._2
389+ if (found)
390+ then d
391+ else throw(("D calculation error, D = " + toString(d)))
392+ }
393+ }
394+
395+
338396 func ego (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
339397 let lpId = cfgLpAssetId
340398 let amId = toBase58String(value(cfgAmountAssetId))
341399 let prId = toBase58String(value(cfgPriceAssetId))
342400 let amDcm = cfgAmountAssetDecimals
343401 let prDcm = cfgPriceAssetDecimals
344402 let sts = toString(cfgPoolStatus)
345403 let lpEmiss = valueOrErrorMessage(assetInfo(lpId), "Wrong LP id").quantity
346404 if ((toBase58String(lpId) != pmtAssetId))
347405 then throw("Wrong pmt asset")
348406 else {
349407 let amBalance = getAccBalance(amId)
350408 let amBalanceX18 = t1(amBalance, amDcm)
351409 let prBalance = getAccBalance(prId)
352410 let prBalanceX18 = t1(prBalance, prDcm)
353411 let curPriceX18 = cpbi(prBalanceX18, amBalanceX18)
354412 let curPrice = f1(curPriceX18, scale8)
355413 let pmtLpAmtX18 = t1(pmtLpAmt, scale8)
356414 let lpEmissX18 = t1(lpEmiss, scale8)
357415 let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissX18)
358416 let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissX18)
359417 let outAmAmt = fromX18Round(outAmAmtX18, amDcm, FLOOR)
360418 let outPrAmt = fromX18Round(outPrAmtX18, prDcm, FLOOR)
361419 let state = if ((txId58 == ""))
362420 then nil
363421 else [ScriptTransfer(userAddress, outAmAmt, if ((amId == "WAVES"))
364422 then unit
365423 else fromBase58String(amId)), ScriptTransfer(userAddress, outPrAmt, if ((prId == "WAVES"))
366424 then unit
367425 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)]
368426 $Tuple10(outAmAmt, outPrAmt, amId, prId, amBalance, prBalance, lpEmiss, curPriceX18, sts, state)
369427 }
370428 }
371429
372430
373431 func epo (txId58,slippage,inAmAmt,inAmId,inPrAmt,inPrId,userAddress,isEval,emitLp,isOneAsset,validateSlippage,pmtAmt,pmtId) = {
374432 let lpId = cfgLpAssetId
375433 let amIdStr = toBase58String(value(cfgAmountAssetId))
376434 let prIdStr = toBase58String(value(cfgPriceAssetId))
377435 let inAmIdStr = cfgInAmountAssedId
378436 let inPrIdStr = cfgInPriceAssetId
379437 let amtDcm = cfgAmountAssetDecimals
380438 let priceDcm = cfgPriceAssetDecimals
381439 let sts = toString(cfgPoolStatus)
382440 let lpEm = valueOrErrorMessage(assetInfo(lpId), "Wr lp as").quantity
383441 let amBalance = if (isEval)
384442 then getAccBalance(amIdStr)
385443 else if (if (isOneAsset)
386444 then (pmtId == amIdStr)
387445 else false)
388446 then (getAccBalance(amIdStr) - pmtAmt)
389447 else if (isOneAsset)
390448 then getAccBalance(amIdStr)
391449 else (getAccBalance(amIdStr) - inAmAmt)
392450 let prBalance = if (isEval)
393451 then getAccBalance(prIdStr)
394452 else if (if (isOneAsset)
395453 then (pmtId == prIdStr)
396454 else false)
397455 then (getAccBalance(prIdStr) - pmtAmt)
398456 else if (isOneAsset)
399457 then getAccBalance(prIdStr)
400458 else (getAccBalance(prIdStr) - inPrAmt)
401459 let inAmAssetAmtX18 = t1(inAmAmt, amtDcm)
402460 let inPrAssetAmtX18 = t1(inPrAmt, priceDcm)
403461 let userPriceX18 = cpbi(inPrAssetAmtX18, inAmAssetAmtX18)
404462 let amBalanceX18 = t1(amBalance, amtDcm)
405463 let prBalanceX18 = t1(prBalance, priceDcm)
464+ let D0 = getD([amBalanceX18, prBalanceX18])
406465 let r = if ((lpEm == 0))
407466 then {
408- let curPriceX18 = zeroBigInt
409- let slippageX18 = zeroBigInt
410- let lpAmtX18 = pow((inAmAssetAmtX18 * inPrAssetAmtX18), 0, toBigInt(5), 1, 0, DOWN)
411- $Tuple5(f1(lpAmtX18, scale8), f1(inAmAssetAmtX18, amtDcm), f1(inPrAssetAmtX18, priceDcm), cpbi((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18)
467+ let D1 = getD([(amBalanceX18 + inAmAssetAmtX18), (prBalanceX18 + inPrAssetAmtX18)])
468+ let checkD = if ((D1 > D0))
469+ then true
470+ else throw("D1 should be greater than D0")
471+ if ((checkD == checkD))
472+ then {
473+ let curPriceX18 = zeroBigInt
474+ let slippageX18 = zeroBigInt
475+ let lpAmtX18 = D1
476+ $Tuple5(f1(lpAmtX18, scale8), f1(inAmAssetAmtX18, amtDcm), f1(inPrAssetAmtX18, priceDcm), cpbi((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18)
477+ }
478+ else throw("Strict value is not equal to itself.")
412479 }
413480 else {
414481 let curPriceX18 = cpbi(prBalanceX18, amBalanceX18)
415482 let slippageRealX18 = fraction(abs((curPriceX18 - userPriceX18)), scale18, curPriceX18)
416483 let slippageX18 = t1(slippage, scale8)
417484 if (if (if (validateSlippage)
418485 then (curPriceX18 != zeroBigInt)
419486 else false)
420487 then (slippageRealX18 > slippageX18)
421488 else false)
422489 then throw(((("Price slippage " + toString(slippageRealX18)) + " > ") + toString(slippageX18)))
423490 else {
424491 let lpEmissionX18 = t1(lpEm, scale8)
425492 let prViaAmX18 = fraction(inAmAssetAmtX18, cpbir(prBalanceX18, amBalanceX18, CEILING), scale18, CEILING)
426493 let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, cpbir(prBalanceX18, amBalanceX18, FLOOR), CEILING)
427494 let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18))
428495 then $Tuple2(amViaPrX18, inPrAssetAmtX18)
429496 else $Tuple2(inAmAssetAmtX18, prViaAmX18)
430497 let expAmtAssetAmtX18 = expectedAmts._1
431498 let expPriceAssetAmtX18 = expectedAmts._2
432- let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18, FLOOR)
433- $Tuple5(fromX18Round(lpAmtX18, scale8, FLOOR), fromX18Round(expAmtAssetAmtX18, amtDcm, CEILING), fromX18Round(expPriceAssetAmtX18, priceDcm, CEILING), curPriceX18, slippageX18)
499+ let D1 = getD([(amBalanceX18 + expAmtAssetAmtX18), (prBalanceX18 + expPriceAssetAmtX18)])
500+ let checkD = if ((D1 > D0))
501+ then true
502+ else throw("D1 should be greater than D0")
503+ if ((checkD == checkD))
504+ then {
505+ let lpAmtX18 = fraction(lpEmissionX18, (D1 - D0), D0)
506+ $Tuple5(fromX18Round(lpAmtX18, scale8, FLOOR), fromX18Round(expAmtAssetAmtX18, amtDcm, CEILING), fromX18Round(expPriceAssetAmtX18, priceDcm, CEILING), curPriceX18, slippageX18)
507+ }
508+ else throw("Strict value is not equal to itself.")
434509 }
435510 }
436511 let calcLpAmt = r._1
437512 let calcAmAssetPmt = r._2
438513 let calcPrAssetPmt = r._3
439514 let curPrice = f1(r._4, scale8)
440515 let slippageCalc = f1(r._5, scale8)
441516 if ((0 >= calcLpAmt))
442517 then throw("LP <= 0")
443518 else {
444519 let emitLpAmt = if (!(emitLp))
445520 then 0
446521 else calcLpAmt
447522 let amDiff = (inAmAmt - calcAmAssetPmt)
448523 let prDiff = (inPrAmt - calcPrAssetPmt)
449- let $t01872619071 = if (if (isOneAsset)
524+ let $t02046020805 = if (if (isOneAsset)
450525 then (pmtId == amIdStr)
451526 else false)
452527 then $Tuple2(pmtAmt, 0)
453528 else if (if (isOneAsset)
454529 then (pmtId == prIdStr)
455530 else false)
456531 then $Tuple2(0, pmtAmt)
457532 else $Tuple2(calcAmAssetPmt, calcPrAssetPmt)
458- let writeAmAmt = $t01872619071._1
459- let writePrAmt = $t01872619071._2
533+ let writeAmAmt = $t02046020805._1
534+ let writePrAmt = $t02046020805._2
460535 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))]
461536 $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEm, lpId, sts, commonState, amDiff, prDiff, inAmId, inPrId)
462- }
463- }
464-
465-
466-func getD (xp) = {
467- let xp0 = xp[0]
468- let xp1 = xp[1]
469- let s = (xp0 + xp1)
470- if ((s == big0))
471- then big0
472- else {
473- let a = parseIntValue(A)
474- let ann = (a * 2)
475- let p = fraction(xp0, xp1, big1)
476- let xp0_xp1_n_n = fraction(p, big4, big1)
477- let ann_s = fraction(toBigInt(ann), s, big1)
478- let ann_1 = toBigInt((ann - 1))
479- func calcDNext (d) = {
480- let dd = fraction(d, d, big1)
481- let ddd = fraction(dd, d, big1)
482- let dp = fraction(ddd, big1, xp0_xp1_n_n)
483- fraction((ann_s + fraction(dp, big2, big1)), d, (fraction(ann_1, d, big1) + fraction(big3, dp, big1)))
484- }
485-
486- func calc (acc,i) = if (acc._2)
487- then acc
488- else {
489- let d = acc._1
490- let dNext = calcDNext(d)
491- let dDiffRaw = (dNext - value(d))
492- let dDiff = if ((big0 > dDiffRaw))
493- then -(dDiffRaw)
494- else dDiffRaw
495- if ((big1 >= dDiff))
496- then $Tuple2(dNext, true)
497- else $Tuple2(dNext, false)
498- }
499-
500- let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
501- let $t02097821026 = {
502- let $l = arr
503- let $s = size($l)
504- let $acc0 = $Tuple2(s, false)
505- func $f0_1 ($a,$i) = if (($i >= $s))
506- then $a
507- else calc($a, $l[$i])
508-
509- func $f0_2 ($a,$i) = if (($i >= $s))
510- then $a
511- else throw("List size exceeds 15")
512-
513- $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15)
514- }
515- let d = $t02097821026._1
516- let found = $t02097821026._2
517- if (found)
518- then d
519- else throw(("D calculation error, D = " + toString(d)))
520537 }
521538 }
522539
523540
524541 func getYD (xp,i,D) = {
525542 let n = big2
526543 let x = xp[if ((i == 0))
527544 then 1
528545 else 0]
529546 let aPrecision = parseBigIntValue(Amult)
530547 let a = (parseBigIntValue(A) * aPrecision)
531548 let s = x
532549 let ann = (a * n)
533550 let c = (((((D * D) / (x * n)) * D) * aPrecision) / (ann * n))
534551 let b = ((s + ((D * aPrecision) / ann)) - D)
535552 func calc (acc,cur) = {
536- let $t02151821538 = acc
537- let y = $t02151821538._1
538- let found = $t02151821538._2
553+ let $t02200022020 = acc
554+ let y = $t02200022020._1
555+ let found = $t02200022020._2
539556 if ((found != unit))
540557 then acc
541558 else {
542559 let yNext = (((y * y) + c) / ((big2 * y) + b))
543560 let yDiff = absBigInt((yNext - value(y)))
544561 if ((big1 >= yDiff))
545562 then $Tuple2(yNext, cur)
546563 else $Tuple2(yNext, unit)
547564 }
548565 }
549566
550567 let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
551- let $t02184521892 = {
568+ let $t02232722374 = {
552569 let $l = arr
553570 let $s = size($l)
554571 let $acc0 = $Tuple2(D, unit)
555572 func $f0_1 ($a,$i) = if (($i >= $s))
556573 then $a
557574 else calc($a, $l[$i])
558575
559576 func $f0_2 ($a,$i) = if (($i >= $s))
560577 then $a
561578 else throw("List size exceeds 15")
562579
563580 $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)
564581 }
565- let y = $t02184521892._1
566- let found = $t02184521892._2
582+ let y = $t02232722374._1
583+ let found = $t02232722374._2
567584 if ((found != unit))
568585 then y
569586 else throw(("Y calculation error, Y = " + toString(y)))
570587 }
571588
572589
573590 func calcDLp (amountBalance,priceBalance,lpEmission) = {
574591 let updatedDLp = fraction(getD([t1BigInt(amountBalance, toBigInt(cfgAmountAssetDecimals)), t1BigInt(priceBalance, toBigInt(cfgPriceAssetDecimals))]), scale18, lpEmission)
575592 if ((lpEmission == big0))
576593 then big0
577594 else updatedDLp
578595 }
579596
580597
581598 func calcCurrentDLp (amountAssetDelta,priceAssetDelta,lpAssetEmissionDelta) = {
582599 let amountAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) - amountAssetDelta)
583600 let priceAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) - priceAssetDelta)
584601 let lpAssetEmission = (toBigInt(value(assetInfo(cfgLpAssetId)).quantity) - lpAssetEmissionDelta)
585602 let currentDLp = calcDLp(amountAssetBalance, priceAssetBalance, lpAssetEmission)
586603 currentDLp
587604 }
588605
589606
590607 func refreshDLpInternal (amountAssetBalanceDelta,priceAssetBalanceDelta,lpAssetEmissionDelta) = {
591608 let amountAssetBalance = (getAccBalance(assetIdToString(cfgAmountAssetId)) + amountAssetBalanceDelta)
592609 let priceAssetBalance = (getAccBalance(assetIdToString(cfgPriceAssetId)) + priceAssetBalanceDelta)
593610 let lpAssetEmission = (value(assetInfo(cfgLpAssetId)).quantity + lpAssetEmissionDelta)
594611 let updatedDLp = calcDLp(toBigInt(amountAssetBalance), toBigInt(priceAssetBalance), toBigInt(lpAssetEmission))
595612 let actions = [IntegerEntry(keyDLpRefreshedHeight, height), StringEntry(keyDLp, toString(updatedDLp))]
596613 $Tuple2(actions, updatedDLp)
597614 }
598615
599616
600617 func validateUpdatedDLp (oldDLp,updatedDLp) = if ((updatedDLp >= oldDLp))
601618 then true
602619 else throwErr("updated DLp lower than current DLp")
603620
604621
605622 func validateMatcherOrderAllowed (order) = {
606623 let amountAssetAmount = order.amount
607624 let priceAssetAmount = fraction(order.amount, order.price, scale8, FLOOR)
608- let $t02393624148 = if ((order.orderType == Buy))
625+ let $t02441824630 = if ((order.orderType == Buy))
609626 then $Tuple2(amountAssetAmount, -(priceAssetAmount))
610627 else $Tuple2(-(amountAssetAmount), priceAssetAmount)
611- let amountAssetBalanceDelta = $t02393624148._1
612- let priceAssetBalanceDelta = $t02393624148._2
628+ let amountAssetBalanceDelta = $t02441824630._1
629+ let priceAssetBalanceDelta = $t02441824630._2
613630 if (if (if (igs())
614631 then true
615632 else (cfgPoolStatus == PoolMatcherDis))
616633 then true
617634 else (cfgPoolStatus == PoolShutdown))
618635 then throw("Admin blocked")
619636 else if (if ((order.assetPair.amountAsset != cfgAmountAssetId))
620637 then true
621638 else (order.assetPair.priceAsset != cfgPriceAssetId))
622639 then throw("Wr assets")
623640 else {
624641 let dLp = parseBigIntValue(getStringValue(this, keyDLp))
625- let $t02447824578 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
626- let unusedActions = $t02447824578._1
627- let dLpNew = $t02447824578._2
642+ let $t02496025060 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
643+ let unusedActions = $t02496025060._1
644+ let dLpNew = $t02496025060._2
628645 let isOrderValid = (dLpNew >= dLp)
629646 isOrderValid
630647 }
631648 }
632649
633650
634651 func cg (i) = if ((size(i.payments) != 1))
635652 then throw("1 pmnt exp")
636653 else {
637654 let pmt = value(i.payments[0])
638655 let pmtAssetId = value(pmt.assetId)
639656 let pmtAmt = pmt.amount
640657 let r = ego(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller)
641658 let outAmAmt = r._1
642659 let outPrAmt = r._2
643660 let sts = parseIntValue(r._9)
644661 let state = r._10
645662 if (if (igs())
646663 then true
647664 else (sts == PoolShutdown))
648665 then throw(("Admin blocked: " + toString(sts)))
649666 else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state)
650667 }
651668
652669
653670 func cp (caller,txId,amAsPmt,prAsPmt,slippage,emitLp,isOneAsset,validateSlippage,pmtAmt,pmtId) = {
654671 let r = epo(txId, slippage, value(amAsPmt).amount, value(amAsPmt).assetId, value(prAsPmt).amount, value(prAsPmt).assetId, caller, (txId == ""), emitLp, isOneAsset, validateSlippage, pmtAmt, pmtId)
655672 let sts = parseIntValue(r._8)
656673 if (if (if (igs())
657674 then true
658675 else (sts == PoolPutDis))
659676 then true
660677 else (sts == PoolShutdown))
661678 then throw(("Blocked:" + toString(sts)))
662679 else r
663680 }
664681
665682
666683 func calcPutOneTkn (pmtAmtRaw,pmtAssetId,userAddress,txId,withTakeFee) = {
667684 let amId = toBase58String(value(cfgAmountAssetId))
668685 let prId = toBase58String(value(cfgPriceAssetId))
669686 let lpId = cfgLpAssetId
670687 let amtDcm = cfgAmountAssetDecimals
671688 let priceDcm = cfgPriceAssetDecimals
672689 let lpAssetEmission = toBigInt(valueOrErrorMessage(assetInfo(lpId), "invalid lp asset").quantity)
673690 let chechEmission = if ((lpAssetEmission > big0))
674691 then true
675692 else throw("initial deposit requires all coins")
676693 if ((chechEmission == chechEmission))
677694 then {
678695 let amBalance = getAccBalance(amId)
679696 let prBalance = getAccBalance(prId)
680- let $t02684427306 = if ((txId == ""))
697+ let $t02732627788 = if ((txId == ""))
681698 then $Tuple2(amBalance, prBalance)
682699 else if ((pmtAssetId == amId))
683700 then if ((pmtAmtRaw > amBalance))
684701 then throw("invalid payment amount")
685702 else $Tuple2((amBalance - pmtAmtRaw), prBalance)
686703 else if ((pmtAssetId == prId))
687704 then if ((pmtAmtRaw > prBalance))
688705 then throw("invalid payment amount")
689706 else $Tuple2(amBalance, (prBalance - pmtAmtRaw))
690707 else throw("wrong pmtAssetId")
691- let amBalanceOld = $t02684427306._1
692- let prBalanceOld = $t02684427306._2
693- let $t02731227488 = if ((pmtAssetId == amId))
708+ let amBalanceOld = $t02732627788._1
709+ let prBalanceOld = $t02732627788._2
710+ let $t02779427970 = if ((pmtAssetId == amId))
694711 then $Tuple2(pmtAmtRaw, 0)
695712 else if ((pmtAssetId == prId))
696713 then $Tuple2(0, pmtAmtRaw)
697714 else throw("invalid payment")
698- let amAmountRaw = $t02731227488._1
699- let prAmountRaw = $t02731227488._2
700- let $t02749227746 = if (withTakeFee)
715+ let amAmountRaw = $t02779427970._1
716+ let prAmountRaw = $t02779427970._2
717+ let $t02797428228 = if (withTakeFee)
701718 then $Tuple3(takeFee(amAmountRaw, inFee)._1, takeFee(prAmountRaw, inFee)._1, takeFee(pmtAmtRaw, inFee)._2)
702719 else $Tuple3(amAmountRaw, prAmountRaw, 0)
703- let amAmount = $t02749227746._1
704- let prAmount = $t02749227746._2
705- let feeAmount = $t02749227746._3
720+ let amAmount = $t02797428228._1
721+ let prAmount = $t02797428228._2
722+ let feeAmount = $t02797428228._3
706723 let amBalanceNew = (amBalanceOld + amAmount)
707724 let prBalanceNew = (prBalanceOld + prAmount)
708- let D0 = getD([toBigInt(amBalanceOld), toBigInt(prBalanceOld)])
709- let D1 = getD([toBigInt(amBalanceNew), toBigInt(prBalanceNew)])
725+ let D0 = getD([t1(amBalanceOld, cfgAmountAssetDecimals), t1(prBalanceOld, cfgPriceAssetDecimals)])
726+ let D1 = getD([t1(amBalanceNew, cfgAmountAssetDecimals), t1(prBalanceNew, cfgPriceAssetDecimals)])
710727 let checkD = if ((D1 > D0))
711728 then true
712729 else throw()
713730 if ((checkD == checkD))
714731 then {
715732 let lpAmount = fraction(lpAssetEmission, (D1 - D0), D0, FLOOR)
716733 let curPrice = f1(cpbi(t1(prBalanceNew, priceDcm), t1(amBalanceNew, amtDcm)), scale8)
717734 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))]
718735 let poolProportion = fraction(prBalanceOld, scale8, amBalanceOld)
719736 let amountAssetPart = fraction(pmtAmtRaw, scale8, (poolProportion + scale8))
720737 let priceAssetPart = (pmtAmtRaw - amountAssetPart)
721738 let lpAmtBoth = fraction(lpAssetEmission, toBigInt(priceAssetPart), toBigInt(prBalanceOld))
722739 let bonus = toInt(fraction((lpAmount - lpAmtBoth), scale8BigInt, lpAmtBoth))
723740 $Tuple4(toInt(lpAmount), commonState, feeAmount, bonus)
724741 }
725742 else throw("Strict value is not equal to itself.")
726743 }
727744 else throw("Strict value is not equal to itself.")
728745 }
729746
730747
731748 func getOneTknV2Internal (outAssetId,minOutAmount,payments,caller,originCaller,transactionId) = {
732749 let lpId = toBase58String(value(cfgLpAssetId))
733750 let amId = toBase58String(value(cfgAmountAssetId))
734751 let prId = toBase58String(value(cfgPriceAssetId))
735752 let amDecimals = cfgAmountAssetDecimals
736753 let prDecimals = cfgPriceAssetDecimals
737754 let poolStatus = cfgPoolStatus
738755 let userAddress = if ((caller == restContract))
739756 then originCaller
740757 else caller
741758 let pmt = value(payments[0])
742759 let pmtAssetId = value(pmt.assetId)
743760 let pmtAmt = pmt.amount
744761 let currentDLp = calcCurrentDLp(big0, big0, big0)
745762 if ((currentDLp == currentDLp))
746763 then {
747764 let txId58 = toBase58String(transactionId)
748765 if ((lpId != toBase58String(pmtAssetId)))
749766 then throw("Wrong LP")
750767 else {
751768 let amBalance = getAccBalance(amId)
752769 let prBalance = getAccBalance(prId)
753- let $t02979629907 = {
770+ let $t03034030451 = {
754771 let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, pmtAmt], nil)
755772 if ($isInstanceOf(@, "(Int, Int)"))
756773 then @
757774 else throw(($getType(@) + " couldn't be cast to (Int, Int)"))
758775 }
759- if (($t02979629907 == $t02979629907))
776+ if (($t03034030451 == $t03034030451))
760777 then {
761- let feeAmount = $t02979629907._2
762- let totalGet = $t02979629907._1
778+ let feeAmount = $t03034030451._2
779+ let totalGet = $t03034030451._1
763780 let totalAmount = if (if ((minOutAmount > 0))
764781 then (minOutAmount > totalGet)
765782 else false)
766783 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
767784 else totalGet
768- let $t03009730404 = if ((outAssetId == amId))
785+ let $t03064130948 = if ((outAssetId == amId))
769786 then $Tuple4(totalAmount, 0, ((amBalance - totalAmount) - feeAmount), prBalance)
770787 else if ((outAssetId == prId))
771788 then $Tuple4(0, totalAmount, amBalance, ((prBalance - totalAmount) - feeAmount))
772789 else throw("invalid out asset id")
773- let outAm = $t03009730404._1
774- let outPr = $t03009730404._2
775- let amBalanceNew = $t03009730404._3
776- let prBalanceNew = $t03009730404._4
790+ let outAm = $t03064130948._1
791+ let outPr = $t03064130948._2
792+ let amBalanceNew = $t03064130948._3
793+ let prBalanceNew = $t03064130948._4
777794 let curPrX18 = cpbi(t1(prBalanceNew, prDecimals), t1(amBalanceNew, amDecimals))
778795 let curPr = f1(curPrX18, scale8)
779796 let outAssetIdOrWaves = if ((outAssetId == "WAVES"))
780797 then unit
781798 else fromBase58String(outAssetId)
782799 let sendFeeToMatcher = if ((feeAmount > 0))
783800 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetIdOrWaves)]
784801 else nil
785802 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)
786803 if ((state == state))
787804 then {
788805 let burn = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
789806 if ((burn == burn))
790807 then {
791- let $t03118931539 = {
808+ let $t03173332083 = {
792809 let feeAmountForCalc = if ((this == feeCollectorAddress))
793810 then 0
794811 else feeAmount
795812 let outInAmountAsset = if ((parseAssetId(outAssetId) == cfgAmountAssetId))
796813 then true
797814 else false
798815 if (outInAmountAsset)
799816 then $Tuple2(-((totalGet + feeAmountForCalc)), 0)
800817 else $Tuple2(0, -((totalGet + feeAmountForCalc)))
801818 }
802- let amountAssetBalanceDelta = $t03118931539._1
803- let priceAssetBalanceDelta = $t03118931539._2
804- let $t03154231650 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
805- let refreshDLpActions = $t03154231650._1
806- let updatedDLp = $t03154231650._2
819+ let amountAssetBalanceDelta = $t03173332083._1
820+ let priceAssetBalanceDelta = $t03173332083._2
821+ let $t03208632194 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
822+ let refreshDLpActions = $t03208632194._1
823+ let updatedDLp = $t03208632194._2
807824 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
808825 if ((isUpdatedDLpValid == isUpdatedDLpValid))
809826 then $Tuple2((state ++ refreshDLpActions), totalAmount)
810827 else throw("Strict value is not equal to itself.")
811828 }
812829 else throw("Strict value is not equal to itself.")
813830 }
814831 else throw("Strict value is not equal to itself.")
815832 }
816833 else throw("Strict value is not equal to itself.")
817834 }
818835 }
819836 else throw("Strict value is not equal to itself.")
820837 }
821838
822839
823840 func m () = match getString(mpk()) {
824841 case s: String =>
825842 fromBase58String(s)
826843 case _: Unit =>
827844 unit
828845 case _ =>
829846 throw("Match error")
830847 }
831848
832849
833850 func pm () = match getString(pmpk()) {
834851 case s: String =>
835852 fromBase58String(s)
836853 case _: Unit =>
837854 unit
838855 case _ =>
839856 throw("Match error")
840857 }
841858
842859
843860 let pd = throw("Permission denied")
844861
845862 func isManager (i) = match m() {
846863 case pk: ByteVector =>
847864 (i.callerPublicKey == pk)
848865 case _: Unit =>
849866 (i.caller == this)
850867 case _ =>
851868 throw("Match error")
852869 }
853870
854871
855872 func mm (i) = match m() {
856873 case pk: ByteVector =>
857874 if ((i.callerPublicKey == pk))
858875 then true
859876 else pd
860877 case _: Unit =>
861878 if ((i.caller == this))
862879 then true
863880 else pd
864881 case _ =>
865882 throw("Match error")
866883 }
867884
868885
869886 @Callable(i)
870887 func constructor (fc) = {
871888 let c = mm(i)
872889 if ((c == c))
873890 then [StringEntry(fc(), fc)]
874891 else throw("Strict value is not equal to itself.")
875892 }
876893
877894
878895
879896 @Callable(i)
880897 func setManager (pendingManagerPublicKey) = {
881898 let c = mm(i)
882899 if ((c == c))
883900 then {
884901 let cm = fromBase58String(pendingManagerPublicKey)
885902 if ((cm == cm))
886903 then [StringEntry(pmpk(), pendingManagerPublicKey)]
887904 else throw("Strict value is not equal to itself.")
888905 }
889906 else throw("Strict value is not equal to itself.")
890907 }
891908
892909
893910
894911 @Callable(i)
895912 func confirmManager () = {
896913 let p = pm()
897914 let hpm = if (isDefined(p))
898915 then true
899916 else throw("No pending manager")
900917 if ((hpm == hpm))
901918 then {
902919 let cpm = if ((i.callerPublicKey == value(p)))
903920 then true
904921 else throw("You are not pending manager")
905922 if ((cpm == cpm))
906923 then [StringEntry(mpk(), toBase58String(value(p))), DeleteEntry(pmpk())]
907924 else throw("Strict value is not equal to itself.")
908925 }
909926 else throw("Strict value is not equal to itself.")
910927 }
911928
912929
913930
914931 @Callable(i)
915932 func put (slip,autoStake) = {
916933 let factCfg = gfc()
917934 let stakingCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactStakCntr]), "Wr st addr")
918935 let slipCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactSlippCntr]), "Wr sl addr")
919936 if ((0 > slip))
920937 then throw("Wrong slippage")
921938 else if ((size(i.payments) != 2))
922939 then throw("2 pmnts expd")
923940 else {
924941 let amAssetPmt = toBigInt(value(i.payments[0]).amount)
925942 let prAssetPmt = toBigInt(value(i.payments[1]).amount)
926943 let amountAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) - amAssetPmt)
927944 if ((amountAssetBalance == amountAssetBalance))
928945 then {
929946 let priceAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) - prAssetPmt)
930947 if ((priceAssetBalance == priceAssetBalance))
931948 then {
932949 let lpAssetEmission = toBigInt(value(assetInfo(cfgLpAssetId)).quantity)
933950 if ((lpAssetEmission == lpAssetEmission))
934951 then {
935952 let currentDLp = calcCurrentDLp(amAssetPmt, prAssetPmt, toBigInt(0))
936953 if ((currentDLp == currentDLp))
937954 then {
938955 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, "")
939956 let emitLpAmt = e._2
940957 let lpAssetId = e._7
941958 let state = e._9
942959 let amDiff = e._10
943960 let prDiff = e._11
944961 let amId = e._12
945962 let prId = e._13
946963 let r = invoke(fca, "emit", [emitLpAmt], nil)
947964 if ((r == r))
948965 then {
949966 let el = match r {
950967 case legacy: Address =>
951968 invoke(legacy, "emit", [emitLpAmt], nil)
952969 case _ =>
953970 unit
954971 }
955972 if ((el == el))
956973 then {
957974 let sa = if ((amDiff > 0))
958975 then invoke(slipCntr, "put", nil, [AttachedPayment(amId, amDiff)])
959976 else nil
960977 if ((sa == sa))
961978 then {
962979 let sp = if ((prDiff > 0))
963980 then invoke(slipCntr, "put", nil, [AttachedPayment(prId, prDiff)])
964981 else nil
965982 if ((sp == sp))
966983 then {
967984 let lpTrnsfr = if (autoStake)
968985 then {
969986 let ss = invoke(stakingCntr, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)])
970987 if ((ss == ss))
971988 then nil
972989 else throw("Strict value is not equal to itself.")
973990 }
974991 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
975- let $t03579935941 = refreshDLpInternal(0, 0, 0)
976- let refreshDLpActions = $t03579935941._1
977- let updatedDLp = $t03579935941._2
992+ let $t03634336485 = refreshDLpInternal(0, 0, 0)
993+ let refreshDLpActions = $t03634336485._1
994+ let updatedDLp = $t03634336485._2
978995 let check = if ((updatedDLp >= currentDLp))
979996 then true
980997 else throwErr(makeString(["updated DLp lower than current DLp", toString(amountAssetBalance), toString(priceAssetBalance), toString(lpAssetEmission), toString(currentDLp), toString(updatedDLp), toString(amDiff), toString(prDiff)], " "))
981998 if ((check == check))
982999 then {
9831000 let lpAssetEmissionAfter = value(assetInfo(cfgLpAssetId)).quantity
9841001 if ((lpAssetEmissionAfter == lpAssetEmissionAfter))
9851002 then ((state ++ lpTrnsfr) ++ refreshDLpActions)
9861003 else throw("Strict value is not equal to itself.")
9871004 }
9881005 else throw("Strict value is not equal to itself.")
9891006 }
9901007 else throw("Strict value is not equal to itself.")
9911008 }
9921009 else throw("Strict value is not equal to itself.")
9931010 }
9941011 else throw("Strict value is not equal to itself.")
9951012 }
9961013 else throw("Strict value is not equal to itself.")
9971014 }
9981015 else throw("Strict value is not equal to itself.")
9991016 }
10001017 else throw("Strict value is not equal to itself.")
10011018 }
10021019 else throw("Strict value is not equal to itself.")
10031020 }
10041021 else throw("Strict value is not equal to itself.")
10051022 }
10061023 }
10071024
10081025
10091026
10101027 @Callable(i)
10111028 func putOneTknV2 (minOutAmount,autoStake) = {
10121029 let isPoolOneTokenOperationsDisabled = {
10131030 let @ = invoke(fca, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
10141031 if ($isInstanceOf(@, "Boolean"))
10151032 then @
10161033 else throw(($getType(@) + " couldn't be cast to Boolean"))
10171034 }
10181035 let isPutDisabled = if (if (if (igs())
10191036 then true
10201037 else (cfgPoolStatus == PoolPutDis))
10211038 then true
10221039 else (cfgPoolStatus == PoolShutdown))
10231040 then true
10241041 else isPoolOneTokenOperationsDisabled
10251042 let checks = [if (if (!(isPutDisabled))
10261043 then true
10271044 else isManager(i))
10281045 then true
10291046 else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1))
10301047 then true
10311048 else throwErr("exactly 1 payment are expected")]
10321049 if ((checks == checks))
10331050 then {
10341051 let amId = toBase58String(value(cfgAmountAssetId))
10351052 let prId = toBase58String(value(cfgPriceAssetId))
10361053 let lpId = cfgLpAssetId
10371054 let amDecimals = cfgAmountAssetDecimals
10381055 let prDecimals = cfgPriceAssetDecimals
10391056 let userAddress = if ((i.caller == this))
10401057 then i.originCaller
10411058 else i.caller
10421059 let pmt = value(i.payments[0])
10431060 let pmtAssetId = toBase58String(value(pmt.assetId))
10441061 let pmtAmt = pmt.amount
10451062 let currentDLp = if ((pmt.assetId == cfgAmountAssetId))
10461063 then calcCurrentDLp(toBigInt(pmtAmt), toBigInt(0), toBigInt(0))
10471064 else calcCurrentDLp(toBigInt(0), toBigInt(pmtAmt), toBigInt(0))
10481065 if ((currentDLp == currentDLp))
10491066 then {
1050- let $t03758237740 = calcPutOneTkn(pmtAmt, pmtAssetId, toString(userAddress), toBase58String(i.transactionId), true)
1051- if (($t03758237740 == $t03758237740))
1067+ let $t03812638284 = calcPutOneTkn(pmtAmt, pmtAssetId, toString(userAddress), toBase58String(i.transactionId), true)
1068+ if (($t03812638284 == $t03812638284))
10521069 then {
1053- let feeAmount = $t03758237740._3
1054- let state = $t03758237740._2
1055- let estimLP = $t03758237740._1
1070+ let feeAmount = $t03812638284._3
1071+ let state = $t03812638284._2
1072+ let estimLP = $t03812638284._1
10561073 let emitLpAmt = if (if ((minOutAmount > 0))
10571074 then (minOutAmount > estimLP)
10581075 else false)
10591076 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
10601077 else estimLP
10611078 let e = invoke(fca, "emit", [emitLpAmt], nil)
10621079 if ((e == e))
10631080 then {
10641081 let el = match e {
10651082 case legacy: Address =>
10661083 invoke(legacy, "emit", [emitLpAmt], nil)
10671084 case _ =>
10681085 unit
10691086 }
10701087 if ((el == el))
10711088 then {
10721089 let lpTrnsfr = if (autoStake)
10731090 then {
10741091 let ss = invoke(stakingContract, "stake", nil, [AttachedPayment(lpId, emitLpAmt)])
10751092 if ((ss == ss))
10761093 then nil
10771094 else throw("Strict value is not equal to itself.")
10781095 }
10791096 else [ScriptTransfer(i.caller, emitLpAmt, lpId)]
10801097 let sendFeeToMatcher = if ((feeAmount > 0))
10811098 then [ScriptTransfer(feeCollectorAddress, feeAmount, fromBase58String(pmtAssetId))]
10821099 else nil
1083- let $t03855538904 = if ((this == feeCollectorAddress))
1100+ let $t03909939448 = if ((this == feeCollectorAddress))
10841101 then $Tuple2(0, 0)
10851102 else {
10861103 let paymentInAmountAsset = if ((pmt.assetId == cfgAmountAssetId))
10871104 then true
10881105 else false
10891106 if (paymentInAmountAsset)
10901107 then $Tuple2(-(feeAmount), 0)
10911108 else $Tuple2(0, -(feeAmount))
10921109 }
1093- let amountAssetBalanceDelta = $t03855538904._1
1094- let priceAssetBalanceDelta = $t03855538904._2
1095- let $t03890739015 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1096- let refreshDLpActions = $t03890739015._1
1097- let updatedDLp = $t03890739015._2
1110+ let amountAssetBalanceDelta = $t03909939448._1
1111+ let priceAssetBalanceDelta = $t03909939448._2
1112+ let $t03945139559 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1113+ let refreshDLpActions = $t03945139559._1
1114+ let updatedDLp = $t03945139559._2
10981115 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
10991116 if ((isUpdatedDLpValid == isUpdatedDLpValid))
11001117 then $Tuple2((((state ++ lpTrnsfr) ++ sendFeeToMatcher) ++ refreshDLpActions), emitLpAmt)
11011118 else throw("Strict value is not equal to itself.")
11021119 }
11031120 else throw("Strict value is not equal to itself.")
11041121 }
11051122 else throw("Strict value is not equal to itself.")
11061123 }
11071124 else throw("Strict value is not equal to itself.")
11081125 }
11091126 else throw("Strict value is not equal to itself.")
11101127 }
11111128 else throw("Strict value is not equal to itself.")
11121129 }
11131130
11141131
11151132
11161133 @Callable(i)
11171134 func putForFree (maxSlpg) = if ((0 > maxSlpg))
11181135 then throw("Wrong slpg")
11191136 else if ((size(i.payments) != 2))
11201137 then throw("2 pmnts expd")
11211138 else {
11221139 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, "")
11231140 let state = estPut._9
11241141 let amAssetPmt = toBigInt(value(i.payments[0]).amount)
11251142 let prAssetPmt = toBigInt(value(i.payments[1]).amount)
11261143 let currentDLp = calcCurrentDLp(amAssetPmt, prAssetPmt, toBigInt(0))
11271144 if ((currentDLp == currentDLp))
11281145 then {
1129- let $t04004540110 = refreshDLpInternal(0, 0, 0)
1130- let refreshDLpActions = $t04004540110._1
1131- let updatedDLp = $t04004540110._2
1146+ let $t04058940654 = refreshDLpInternal(0, 0, 0)
1147+ let refreshDLpActions = $t04058940654._1
1148+ let updatedDLp = $t04058940654._2
11321149 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
11331150 if ((isUpdatedDLpValid == isUpdatedDLpValid))
11341151 then (state ++ refreshDLpActions)
11351152 else throw("Strict value is not equal to itself.")
11361153 }
11371154 else throw("Strict value is not equal to itself.")
11381155 }
11391156
11401157
11411158
11421159 @Callable(i)
11431160 func get () = {
11441161 let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(0))
11451162 if ((currentDLp == currentDLp))
11461163 then {
11471164 let r = cg(i)
11481165 let outAmtAmt = r._1
11491166 let outPrAmt = r._2
11501167 let pmtAmt = r._3
11511168 let pmtAssetId = r._4
11521169 let state = r._5
11531170 let b = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
11541171 if ((b == b))
11551172 then {
1156- let $t04128341365 = refreshDLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1157- let refreshDLpActions = $t04128341365._1
1158- let updatedDLp = $t04128341365._2
1173+ let $t04182741909 = refreshDLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1174+ let refreshDLpActions = $t04182741909._1
1175+ let updatedDLp = $t04182741909._2
11591176 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
11601177 if ((isUpdatedDLpValid == isUpdatedDLpValid))
11611178 then (state ++ refreshDLpActions)
11621179 else throw("Strict value is not equal to itself.")
11631180 }
11641181 else throw("Strict value is not equal to itself.")
11651182 }
11661183 else throw("Strict value is not equal to itself.")
11671184 }
11681185
11691186
11701187
11711188 @Callable(i)
11721189 func getOneTknV2 (outAssetId,minOutAmount) = {
11731190 let isPoolOneTokenOperationsDisabled = {
11741191 let @ = invoke(fca, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
11751192 if ($isInstanceOf(@, "Boolean"))
11761193 then @
11771194 else throw(($getType(@) + " couldn't be cast to Boolean"))
11781195 }
11791196 let isGetDisabled = if (if (igs())
11801197 then true
11811198 else (cfgPoolStatus == PoolShutdown))
11821199 then true
11831200 else isPoolOneTokenOperationsDisabled
11841201 let checks = [if (if (!(isGetDisabled))
11851202 then true
11861203 else isManager(i))
11871204 then true
11881205 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1))
11891206 then true
11901207 else throwErr("exactly 1 payment are expected")]
11911208 if ((checks == checks))
11921209 then {
1193- let $t04198342138 = getOneTknV2Internal(outAssetId, minOutAmount, i.payments, i.caller, i.originCaller, i.transactionId)
1194- let state = $t04198342138._1
1195- let totalAmount = $t04198342138._2
1210+ let $t04252742682 = getOneTknV2Internal(outAssetId, minOutAmount, i.payments, i.caller, i.originCaller, i.transactionId)
1211+ let state = $t04252742682._1
1212+ let totalAmount = $t04252742682._2
11961213 $Tuple2(state, totalAmount)
11971214 }
11981215 else throw("Strict value is not equal to itself.")
11991216 }
12001217
12011218
12021219
12031220 @Callable(i)
12041221 func refreshDLp () = {
12051222 let lastRefreshedBlockHeight = valueOrElse(getInteger(keyDLpRefreshedHeight), 0)
12061223 let checkLastRefreshedBlockHeight = if (((height - lastRefreshedBlockHeight) >= dLpRefreshDelay))
12071224 then unit
12081225 else throwErr(makeString([toString(dLpRefreshDelay), " blocks have not passed since the previous call"], ""))
12091226 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
12101227 then {
12111228 let dLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyDLp), "0")), fmtErr("invalid dLp"))
1212- let $t04266242726 = refreshDLpInternal(0, 0, 0)
1213- let dLpUpdateActions = $t04266242726._1
1214- let updatedDLp = $t04266242726._2
1229+ let $t04320643270 = refreshDLpInternal(0, 0, 0)
1230+ let dLpUpdateActions = $t04320643270._1
1231+ let updatedDLp = $t04320643270._2
12151232 let actions = if ((dLp != updatedDLp))
12161233 then dLpUpdateActions
12171234 else throwErr("nothing to refresh")
12181235 $Tuple2(actions, toString(updatedDLp))
12191236 }
12201237 else throw("Strict value is not equal to itself.")
12211238 }
12221239
12231240
12241241
12251242 @Callable(i)
12261243 func getOneTknV2READONLY (outAssetId,lpAssetAmount) = {
12271244 let amId = toBase58String(value(cfgAmountAssetId))
12281245 let prId = toBase58String(value(cfgPriceAssetId))
12291246 let lpId = toBase58String(value(cfgLpAssetId))
12301247 let xp = [toBigInt(getAccBalance(amId)), toBigInt(getAccBalance(prId))]
12311248 let lpEmission = toBigInt(valueOrErrorMessage(assetInfo(fromBase58String(lpId)), "invalid lp asset").quantity)
12321249 let D0 = getD(xp)
12331250 let D1 = (D0 - fraction(toBigInt(lpAssetAmount), D0, lpEmission))
12341251 let index = if ((outAssetId == amId))
12351252 then 0
12361253 else if ((outAssetId == prId))
12371254 then 1
12381255 else throw("invalid out asset id")
12391256 let newY = getYD(xp, index, D1)
12401257 let dy = (xp[index] - newY)
12411258 let totalGetRaw = max([0, toInt((dy - big1))])
1242- let $t04365643711 = takeFee(totalGetRaw, outFee)
1243- let totalGet = $t04365643711._1
1244- let feeAmount = $t04365643711._2
1259+ let $t04420044255 = takeFee(totalGetRaw, outFee)
1260+ let totalGet = $t04420044255._1
1261+ let feeAmount = $t04420044255._2
12451262 $Tuple2(nil, $Tuple2(totalGet, feeAmount))
12461263 }
12471264
12481265
12491266
12501267 @Callable(i)
12511268 func getOneTknV2WithBonusREADONLY (outAssetId,lpAssetAmount) = {
12521269 let amId = toBase58String(value(cfgAmountAssetId))
12531270 let prId = toBase58String(value(cfgPriceAssetId))
12541271 let lpId = toBase58String(value(cfgLpAssetId))
12551272 let amBalance = getAccBalance(amId)
12561273 let prBalance = getAccBalance(prId)
1257- let $t04408644201 = {
1274+ let $t04463044745 = {
12581275 let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, lpAssetAmount], nil)
12591276 if ($isInstanceOf(@, "(Int, Int)"))
12601277 then @
12611278 else throw(($getType(@) + " couldn't be cast to (Int, Int)"))
12621279 }
1263- let totalGet = $t04408644201._1
1264- let feeAmount = $t04408644201._2
1280+ let totalGet = $t04463044745._1
1281+ let feeAmount = $t04463044745._2
12651282 let r = ego("", lpId, lpAssetAmount, this)
12661283 let outAmAmt = r._1
12671284 let outPrAmt = r._2
12681285 let sumOfGetAssets = (outAmAmt + outPrAmt)
12691286 let bonus = if ((sumOfGetAssets == 0))
12701287 then if ((totalGet == 0))
12711288 then 0
12721289 else throw("bonus calculation error")
12731290 else fraction((totalGet - sumOfGetAssets), scale8, sumOfGetAssets)
12741291 $Tuple2(nil, $Tuple3(totalGet, feeAmount, bonus))
12751292 }
12761293
12771294
12781295
12791296 @Callable(i)
12801297 func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = {
12811298 let r = cg(i)
12821299 let outAmAmt = r._1
12831300 let outPrAmt = r._2
12841301 let pmtAmt = r._3
12851302 let pmtAssetId = r._4
12861303 let state = r._5
12871304 if ((noLessThenAmtAsset > outAmAmt))
12881305 then throw(((("Failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset)))
12891306 else if ((noLessThenPriceAsset > outPrAmt))
12901307 then throw(((("Failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset)))
12911308 else {
12921309 let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(0))
12931310 if ((currentDLp == currentDLp))
12941311 then {
12951312 let burnLPAssetOnFactory = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
12961313 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
12971314 then {
1298- let $t04536745448 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1299- let refreshDLpActions = $t04536745448._1
1300- let updatedDLp = $t04536745448._2
1315+ let $t04591145992 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1316+ let refreshDLpActions = $t04591145992._1
1317+ let updatedDLp = $t04591145992._2
13011318 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
13021319 if ((isUpdatedDLpValid == isUpdatedDLpValid))
13031320 then (state ++ refreshDLpActions)
13041321 else throw("Strict value is not equal to itself.")
13051322 }
13061323 else throw("Strict value is not equal to itself.")
13071324 }
13081325 else throw("Strict value is not equal to itself.")
13091326 }
13101327 }
13111328
13121329
13131330
13141331 @Callable(i)
13151332 func unstakeAndGet (amount) = {
13161333 let checkPayments = if ((size(i.payments) != 0))
13171334 then throw("No pmnts expd")
13181335 else true
13191336 if ((checkPayments == checkPayments))
13201337 then {
13211338 let factoryCfg = gfc()
13221339 let lpAssetId = cfgLpAssetId
13231340 let staking = valueOrErrorMessage(addressFromString(factoryCfg[idxFactStakCntr]), "Wr st addr")
13241341 let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(0))
13251342 if ((currentDLp == currentDLp))
13261343 then {
13271344 let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), amount], nil)
13281345 if ((unstakeInv == unstakeInv))
13291346 then {
13301347 let r = ego(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller)
13311348 let outAmAmt = r._1
13321349 let outPrAmt = r._2
13331350 let sts = parseIntValue(r._9)
13341351 let state = r._10
13351352 let v = if (if (igs())
13361353 then true
13371354 else (sts == PoolShutdown))
13381355 then throw(("Blocked: " + toString(sts)))
13391356 else true
13401357 if ((v == v))
13411358 then {
13421359 let burnA = invoke(fca, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
13431360 if ((burnA == burnA))
13441361 then {
1345- let $t04647546556 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1346- let refreshDLpActions = $t04647546556._1
1347- let updatedDLp = $t04647546556._2
1362+ let $t04701947100 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1363+ let refreshDLpActions = $t04701947100._1
1364+ let updatedDLp = $t04701947100._2
13481365 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
13491366 if ((isUpdatedDLpValid == isUpdatedDLpValid))
13501367 then (state ++ refreshDLpActions)
13511368 else throw("Strict value is not equal to itself.")
13521369 }
13531370 else throw("Strict value is not equal to itself.")
13541371 }
13551372 else throw("Strict value is not equal to itself.")
13561373 }
13571374 else throw("Strict value is not equal to itself.")
13581375 }
13591376 else throw("Strict value is not equal to itself.")
13601377 }
13611378 else throw("Strict value is not equal to itself.")
13621379 }
13631380
13641381
13651382
13661383 @Callable(i)
13671384 func unstakeAndGetNoLess (unstakeAmount,noLessThenAmountAsset,noLessThenPriceAsset) = {
13681385 let isGetDisabled = if (igs())
13691386 then true
13701387 else (cfgPoolStatus == PoolShutdown)
13711388 let checks = [if (!(isGetDisabled))
13721389 then true
13731390 else throw("get operation is blocked by admin"), if ((size(i.payments) == 0))
13741391 then true
13751392 else throw("no payments are expected")]
13761393 if ((checks == checks))
13771394 then {
13781395 let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(0))
13791396 if ((currentDLp == currentDLp))
13801397 then {
13811398 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
13821399 if ((unstakeInv == unstakeInv))
13831400 then {
13841401 let res = ego(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller)
13851402 let outAmAmt = res._1
13861403 let outPrAmt = res._2
13871404 let state = res._10
13881405 let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset))
13891406 then true
13901407 else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset))
13911408 then true
13921409 else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))]
13931410 if ((checkAmounts == checkAmounts))
13941411 then {
13951412 let burnLPAssetOnFactory = invoke(fca, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
13961413 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
13971414 then {
1398- let $t04780747888 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1399- let refreshDLpActions = $t04780747888._1
1400- let updatedDLp = $t04780747888._2
1415+ let $t04835148432 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1416+ let refreshDLpActions = $t04835148432._1
1417+ let updatedDLp = $t04835148432._2
14011418 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
14021419 if ((isUpdatedDLpValid == isUpdatedDLpValid))
14031420 then (state ++ refreshDLpActions)
14041421 else throw("Strict value is not equal to itself.")
14051422 }
14061423 else throw("Strict value is not equal to itself.")
14071424 }
14081425 else throw("Strict value is not equal to itself.")
14091426 }
14101427 else throw("Strict value is not equal to itself.")
14111428 }
14121429 else throw("Strict value is not equal to itself.")
14131430 }
14141431 else throw("Strict value is not equal to itself.")
14151432 }
14161433
14171434
14181435
14191436 @Callable(i)
14201437 func unstakeAndGetOneTknV2 (unstakeAmount,outAssetId,minOutAmount) = {
14211438 let isPoolOneTokenOperationsDisabled = {
14221439 let @ = invoke(fca, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
14231440 if ($isInstanceOf(@, "Boolean"))
14241441 then @
14251442 else throw(($getType(@) + " couldn't be cast to Boolean"))
14261443 }
14271444 let isGetDisabled = if (if (igs())
14281445 then true
14291446 else (cfgPoolStatus == PoolShutdown))
14301447 then true
14311448 else isPoolOneTokenOperationsDisabled
14321449 let checks = [if (if (!(isGetDisabled))
14331450 then true
14341451 else isManager(i))
14351452 then true
14361453 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 0))
14371454 then true
14381455 else throwErr("no payments are expected")]
14391456 if ((checks == checks))
14401457 then {
14411458 let factoryCfg = gfc()
14421459 let lpAssetId = cfgLpAssetId
14431460 let staking = valueOrErrorMessage(addressFromString(factoryCfg[idxFactStakCntr]), "Wr st addr")
14441461 let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), unstakeAmount], nil)
14451462 if ((unstakeInv == unstakeInv))
14461463 then {
1447- let $t04878348971 = getOneTknV2Internal(outAssetId, minOutAmount, [AttachedPayment(lpAssetId, unstakeAmount)], i.caller, i.originCaller, i.transactionId)
1448- let state = $t04878348971._1
1449- let totalAmount = $t04878348971._2
1464+ let $t04932749515 = getOneTknV2Internal(outAssetId, minOutAmount, [AttachedPayment(lpAssetId, unstakeAmount)], i.caller, i.originCaller, i.transactionId)
1465+ let state = $t04932749515._1
1466+ let totalAmount = $t04932749515._2
14501467 $Tuple2(state, totalAmount)
14511468 }
14521469 else throw("Strict value is not equal to itself.")
14531470 }
14541471 else throw("Strict value is not equal to itself.")
14551472 }
14561473
14571474
14581475
14591476 @Callable(i)
14601477 func putOneTknV2WithBonusREADONLY (paymentAmountRaw,paymentAssetId) = {
1461- let $t04909949202 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", true)
1462- let lpAmount = $t04909949202._1
1463- let state = $t04909949202._2
1464- let feeAmount = $t04909949202._3
1465- let bonus = $t04909949202._4
1478+ let $t04964349746 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", true)
1479+ let lpAmount = $t04964349746._1
1480+ let state = $t04964349746._2
1481+ let feeAmount = $t04964349746._3
1482+ let bonus = $t04964349746._4
14661483 $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus))
14671484 }
14681485
14691486
14701487
14711488 @Callable(i)
14721489 func putOneTknV2WithoutTakeFeeREADONLY (paymentAmountRaw,paymentAssetId) = {
1473- let $t04935049454 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", false)
1474- let lpAmount = $t04935049454._1
1475- let state = $t04935049454._2
1476- let feeAmount = $t04935049454._3
1477- let bonus = $t04935049454._4
1490+ let $t04989449998 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", false)
1491+ let lpAmount = $t04989449998._1
1492+ let state = $t04989449998._2
1493+ let feeAmount = $t04989449998._3
1494+ let bonus = $t04989449998._4
14781495 $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus))
14791496 }
14801497
14811498
14821499
14831500 @Callable(i)
14841501 func activate (amtAsStr,prAsStr) = if ((toString(i.caller) != toString(fca)))
14851502 then throw("denied")
14861503 else $Tuple2([StringEntry(aa(), amtAsStr), StringEntry(pa(), prAsStr)], "success")
14871504
14881505
14891506
14901507 @Callable(i)
14911508 func setS (k,v) = if ((toString(i.caller) != strf(this, ada())))
14921509 then pd
14931510 else [StringEntry(k, v)]
14941511
14951512
14961513
14971514 @Callable(i)
14981515 func setI (k,v) = if ((toString(i.caller) != strf(this, ada())))
14991516 then pd
15001517 else [IntegerEntry(k, v)]
15011518
15021519
15031520
15041521 @Callable(i)
15051522 func getPoolConfigWrapperREADONLY () = $Tuple2(nil, gpc())
15061523
15071524
15081525
15091526 @Callable(i)
15101527 func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId))
15111528
15121529
15131530
15141531 @Callable(i)
15151532 func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = {
15161533 let pr = calcPrices(amAmt, prAmt, lpAmt)
15171534 $Tuple2(nil, [toString(pr[0]), toString(pr[1]), toString(pr[2])])
15181535 }
15191536
15201537
15211538
15221539 @Callable(i)
15231540 func fromX18WrapperREADONLY (val,resScaleMult) = $Tuple2(nil, f1(parseBigIntValue(val), resScaleMult))
15241541
15251542
15261543
15271544 @Callable(i)
15281545 func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(t1(origVal, origScaleMult)))
15291546
15301547
15311548
15321549 @Callable(i)
15331550 func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(cpbi(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18))))
15341551
15351552
15361553
15371554 @Callable(i)
15381555 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, ""))
15391556
15401557
15411558
15421559 @Callable(i)
15431560 func estimateGetOperationWrapperREADONLY (txId58,pmtAsId,pmtLpAmt,usrAddr) = {
15441561 let r = ego(txId58, pmtAsId, pmtLpAmt, addressFromStringValue(usrAddr))
15451562 $Tuple2(nil, $Tuple10(r._1, r._2, r._3, r._4, r._5, r._6, r._7, toString(r._8), r._9, r._10))
15461563 }
15471564
15481565
15491566 @Verifier(tx)
15501567 func verify () = {
15511568 let targetPublicKey = match m() {
15521569 case pk: ByteVector =>
15531570 pk
15541571 case _: Unit =>
15551572 tx.senderPublicKey
15561573 case _ =>
15571574 throw("Match error")
15581575 }
15591576 match tx {
15601577 case order: Order =>
15611578 let matcherPub = mp()
15621579 let orderValid = validateMatcherOrderAllowed(order)
15631580 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
15641581 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
15651582 if (if (if (orderValid)
15661583 then senderValid
15671584 else false)
15681585 then matcherValid
15691586 else false)
15701587 then true
15711588 else toe(orderValid, senderValid, matcherValid)
15721589 case s: SetScriptTransaction =>
15731590 if (sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey))
15741591 then true
15751592 else {
15761593 let newHash = blake2b256(value(s.script))
15771594 let allowedHash = fromBase64String(value(getString(fca, keyAllowedLpStableScriptHash())))
15781595 let currentHash = scriptHash(this)
15791596 if ((allowedHash == newHash))
15801597 then (currentHash != newHash)
15811598 else false
15821599 }
15831600 case _ =>
15841601 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
15851602 }
15861603 }
15871604

github/deemru/w8io/026f985 
213.23 ms