tx · JFbdagHpBNy3qRjSWLENLoGQgGKW4W16TfJTNB2LHPQ

3NAefciWv6f9fWvEXdGgpHfanJFG8HqfjuT:  -0.04100000 Waves

2023.10.16 12:14 [2800980] smart account 3NAefciWv6f9fWvEXdGgpHfanJFG8HqfjuT > SELF 0.00000000 Waves

{ "type": 13, "id": "JFbdagHpBNy3qRjSWLENLoGQgGKW4W16TfJTNB2LHPQ", "fee": 4100000, "feeAssetId": null, "timestamp": 1697447686404, "version": 2, "chainId": 84, "sender": "3NAefciWv6f9fWvEXdGgpHfanJFG8HqfjuT", "senderPublicKey": "D1BL65meykxFZTCuq7jq9HSGLLnWvQamQPUNrguW5w39", "proofs": [ "3YYALjP7hkjnDgis1f51CXj475EtLvRwaEzKnivTVndpVeBZTyK8WDyJr4Uk1QfjKcC1keJQq6GiVFFFbHvAE5R" ], "script": "base64:BgKkLQgCEgUKAwEEARIHCgUBBAEIARIDCgEIEgQKAgEEEgQKAgEEEgMKAQESABIECgIIARIAEgQKAggBEgQKAggBEgQKAgEBEgMKAQESBQoDAQEBEgUKAwEIARIECgIBCBIECgIBCBIECgIICBIAEgMKAQgSBQoDAQEBEgQKAggBEgQKAgEBEgQKAggIEgsKCQgBAQIBAggEBBIGCgQICAEIEgAiBnNjYWxlOCIMc2NhbGU4QmlnSW50IgdzY2FsZTE4Igp6ZXJvQmlnSW50IgRiaWcwIgRiaWcxIgRiaWcyIgRiaWczIgRiaWc0IgpzbGlwcGFnZTREIgt3YXZlc1N0cmluZyIKYW1wSW5pdGlhbCIFQW11bHQiBURjb252IgNTRVAiBUVNUFRZIgpQb29sQWN0aXZlIgpQb29sUHV0RGlzIg5Qb29sTWF0Y2hlckRpcyIMUG9vbFNodXRkb3duIg5pZHhQb29sQWRkcmVzcyIJaWR4UG9vbFN0IglpZHhMUEFzSWQiCWlkeEFtQXNJZCIJaWR4UHJBc0lkIgtpZHhBbXRBc0RjbSINaWR4UHJpY2VBc0RjbSILaWR4SUFtdEFzSWQiDWlkeElQc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compacted Prev: GRcFi8nMnpSuK2qCwNkiQC8pSkvtEdqofCaugFZbQnRN Next: HrUNq8fAZmz84rG89pdDkgQ1Q7ng9kB4imWr4FPrDzNR Diff:
OldNewDifferences
2222 let slippage4D = toBigInt((scale8 - ((scale8 * 1) / scale8)))
2323
2424 let wavesString = "WAVES"
25+
26+let ampInitial = 50
2527
2628 let Amult = "100"
2729
125127 func pa () = "%s__priceAsset"
126128
127129
128-func amp () = makeString(["%s%s", "amp", toString(this)], SEP)
130+func amp () = "%s__amp"
131+
132+
133+func keyAmpHistory (heightBlocks) = ("%s%d__amp__" + toString(heightBlocks))
134+
135+
136+func keyChangeAmpLastCall () = "%s__changeAmpLastCall"
129137
130138
131139 let keyFee = "%s__fee"
221229 else throw(($getType(@) + " couldn't be cast to Int"))
222230 }
223231
224-let A = strf(fca, amp())
232+let A = strf(this, amp())
225233
226234 func igs () = valueOrElse(getBoolean(fca, aps()), false)
227235
255263
256264 let poolConfigParsed = parsePoolConfig(gpc())
257265
258-let $t084928678 = poolConfigParsed
266+let $t086088794 = poolConfigParsed
259267
260-let cfgPoolAddress = $t084928678._1
268+let cfgPoolAddress = $t086088794._1
261269
262-let cfgPoolStatus = $t084928678._2
270+let cfgPoolStatus = $t086088794._2
263271
264-let cfgLpAssetId = $t084928678._3
272+let cfgLpAssetId = $t086088794._3
265273
266-let cfgAmountAssetId = $t084928678._4
274+let cfgAmountAssetId = $t086088794._4
267275
268-let cfgPriceAssetId = $t084928678._5
276+let cfgPriceAssetId = $t086088794._5
269277
270-let cfgAmountAssetDecimals = $t084928678._6
278+let cfgAmountAssetDecimals = $t086088794._6
271279
272-let cfgPriceAssetDecimals = $t084928678._7
280+let cfgPriceAssetDecimals = $t086088794._7
273281
274282 func gfc () = split(strf(fca, fcfg()), SEP)
275283
390398 }
391399
392400 let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
393- let $t01318313231 = {
401+ let $t01329913347 = {
394402 let $l = arr
395403 let $s = size($l)
396404 let $acc0 = $Tuple2(s, false)
404412
405413 $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($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17)
406414 }
407- let d = $t01318313231._1
408- let found = $t01318313231._2
415+ let d = $t01329913347._1
416+ let found = $t01329913347._2
409417 if (found)
410418 then d
411419 else throw(("D calculation error, D = " + toString(d)))
539547 else calcLpAmt
540548 let amDiff = (inAmAmt - calcAmAssetPmt)
541549 let prDiff = (inPrAmt - calcPrAssetPmt)
542- let $t02099321338 = if (if (isOneAsset)
550+ let $t02110921454 = if (if (isOneAsset)
543551 then (pmtId == amIdStr)
544552 else false)
545553 then $Tuple2(pmtAmt, 0)
548556 else false)
549557 then $Tuple2(0, pmtAmt)
550558 else $Tuple2(calcAmAssetPmt, calcPrAssetPmt)
551- let writeAmAmt = $t02099321338._1
552- let writePrAmt = $t02099321338._2
559+ let writeAmAmt = $t02110921454._1
560+ let writePrAmt = $t02110921454._2
553561 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))]
554562 $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEm, lpId, sts, commonState, amDiff, prDiff, inAmId, inPrId)
555563 }
568576 let c = (((((D * D) / (x * n)) * D) * aPrecision) / (ann * n))
569577 let b = ((s + ((D * aPrecision) / ann)) - D)
570578 func calc (acc,cur) = {
571- let $t02253322553 = acc
572- let y = $t02253322553._1
573- let found = $t02253322553._2
579+ let $t02264922669 = acc
580+ let y = $t02264922669._1
581+ let found = $t02264922669._2
574582 if ((found != unit))
575583 then acc
576584 else {
583591 }
584592
585593 let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
586- let $t02286022907 = {
594+ let $t02297623023 = {
587595 let $l = arr
588596 let $s = size($l)
589597 let $acc0 = $Tuple2(D, unit)
597605
598606 $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)
599607 }
600- let y = $t02286022907._1
601- let found = $t02286022907._2
608+ let y = $t02297623023._1
609+ let found = $t02297623023._2
602610 if ((found != unit))
603611 then y
604612 else throw(("Y calculation error, Y = " + toString(y)))
642650 let priceAssetBalance = getAccBalance(assetIdToString(cfgPriceAssetId))
643651 let amountAssetAmount = order.amount
644652 let priceAssetAmount = fraction(order.amount, order.price, scale8, FLOOR)
645- let $t02510525317 = if ((order.orderType == Buy))
653+ let $t02522125433 = if ((order.orderType == Buy))
646654 then $Tuple2(amountAssetAmount, -(priceAssetAmount))
647655 else $Tuple2(-(amountAssetAmount), priceAssetAmount)
648- let amountAssetBalanceDelta = $t02510525317._1
649- let priceAssetBalanceDelta = $t02510525317._2
656+ let amountAssetBalanceDelta = $t02522125433._1
657+ let priceAssetBalanceDelta = $t02522125433._2
650658 if (if (if (igs())
651659 then true
652660 else (cfgPoolStatus == PoolMatcherDis))
659667 then throw("Wr assets")
660668 else {
661669 let dLp = parseBigIntValue(valueOrElse(getString(this, keyDLp), "0"))
662- let $t02565925759 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
663- let unusedActions = $t02565925759._1
664- let dLpNew = $t02565925759._2
670+ let $t02577525875 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
671+ let unusedActions = $t02577525875._1
672+ let dLpNew = $t02577525875._2
665673 let isOrderValid = (dLpNew >= dLp)
666674 let info = makeString(["dLp=", toString(dLp), " dLpNew=", toString(dLpNew), " amountAssetBalance=", toString(amountAssetBalance), " priceAssetBalance=", toString(priceAssetBalance), " amountAssetBalanceDelta=", toString(amountAssetBalanceDelta), " priceAssetBalanceDelta=", toString(priceAssetBalanceDelta), " height=", toString(height)], "")
667675 $Tuple2(isOrderValid, info)
715723 then {
716724 let amBalance = getAccBalance(amId)
717725 let prBalance = getAccBalance(prId)
718- let $t02841528877 = if ((txId == ""))
726+ let $t02853128993 = if ((txId == ""))
719727 then $Tuple2(amBalance, prBalance)
720728 else if ((pmtAssetId == amId))
721729 then if ((pmtAmtRaw > amBalance))
726734 then throw("invalid payment amount")
727735 else $Tuple2(amBalance, (prBalance - pmtAmtRaw))
728736 else throw("wrong pmtAssetId")
729- let amBalanceOld = $t02841528877._1
730- let prBalanceOld = $t02841528877._2
731- let $t02888329059 = if ((pmtAssetId == amId))
737+ let amBalanceOld = $t02853128993._1
738+ let prBalanceOld = $t02853128993._2
739+ let $t02899929175 = if ((pmtAssetId == amId))
732740 then $Tuple2(pmtAmtRaw, 0)
733741 else if ((pmtAssetId == prId))
734742 then $Tuple2(0, pmtAmtRaw)
735743 else throw("invalid payment")
736- let amAmountRaw = $t02888329059._1
737- let prAmountRaw = $t02888329059._2
738- let $t02906329317 = if (withTakeFee)
744+ let amAmountRaw = $t02899929175._1
745+ let prAmountRaw = $t02899929175._2
746+ let $t02917929433 = if (withTakeFee)
739747 then $Tuple3(takeFee(amAmountRaw, inFee)._1, takeFee(prAmountRaw, inFee)._1, takeFee(pmtAmtRaw, inFee)._2)
740748 else $Tuple3(amAmountRaw, prAmountRaw, 0)
741- let amAmount = $t02906329317._1
742- let prAmount = $t02906329317._2
743- let feeAmount = $t02906329317._3
749+ let amAmount = $t02917929433._1
750+ let prAmount = $t02917929433._2
751+ let feeAmount = $t02917929433._3
744752 let amBalanceNew = (amBalanceOld + amAmount)
745753 let prBalanceNew = (prBalanceOld + prAmount)
746754 let D0 = getD([t1(amBalanceOld, cfgAmountAssetDecimals), t1(prBalanceOld, cfgPriceAssetDecimals)])
788796 else {
789797 let amBalance = getAccBalance(amId)
790798 let prBalance = getAccBalance(prId)
791- let $t03142931540 = {
799+ let $t03154531656 = {
792800 let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, pmtAmt], nil)
793801 if ($isInstanceOf(@, "(Int, Int)"))
794802 then @
795803 else throw(($getType(@) + " couldn't be cast to (Int, Int)"))
796804 }
797- if (($t03142931540 == $t03142931540))
805+ if (($t03154531656 == $t03154531656))
798806 then {
799- let feeAmount = $t03142931540._2
800- let totalGet = $t03142931540._1
807+ let feeAmount = $t03154531656._2
808+ let totalGet = $t03154531656._1
801809 let totalAmount = if (if ((minOutAmount > 0))
802810 then (minOutAmount > totalGet)
803811 else false)
804812 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
805813 else totalGet
806- let $t03173032037 = if ((outAssetId == amId))
814+ let $t03184632153 = if ((outAssetId == amId))
807815 then $Tuple4(totalAmount, 0, ((amBalance - totalAmount) - feeAmount), prBalance)
808816 else if ((outAssetId == prId))
809817 then $Tuple4(0, totalAmount, amBalance, ((prBalance - totalAmount) - feeAmount))
810818 else throw("invalid out asset id")
811- let outAm = $t03173032037._1
812- let outPr = $t03173032037._2
813- let amBalanceNew = $t03173032037._3
814- let prBalanceNew = $t03173032037._4
819+ let outAm = $t03184632153._1
820+ let outPr = $t03184632153._2
821+ let amBalanceNew = $t03184632153._3
822+ let prBalanceNew = $t03184632153._4
815823 let curPrX18 = cpbi(t1(prBalanceNew, prDecimals), t1(amBalanceNew, amDecimals))
816824 let curPr = f1(curPrX18, scale8)
817825 let outAssetIdOrWaves = if ((outAssetId == "WAVES"))
826834 let burn = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
827835 if ((burn == burn))
828836 then {
829- let $t03282233172 = {
837+ let $t03293833288 = {
830838 let feeAmountForCalc = if ((this == feeCollectorAddress))
831839 then 0
832840 else feeAmount
837845 then $Tuple2(-((totalGet + feeAmountForCalc)), 0)
838846 else $Tuple2(0, -((totalGet + feeAmountForCalc)))
839847 }
840- let amountAssetBalanceDelta = $t03282233172._1
841- let priceAssetBalanceDelta = $t03282233172._2
842- let $t03317533283 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
843- let refreshDLpActions = $t03317533283._1
844- let updatedDLp = $t03317533283._2
848+ let amountAssetBalanceDelta = $t03293833288._1
849+ let priceAssetBalanceDelta = $t03293833288._2
850+ let $t03329133399 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
851+ let refreshDLpActions = $t03329133399._1
852+ let updatedDLp = $t03329133399._2
845853 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
846854 if ((isUpdatedDLpValid == isUpdatedDLpValid))
847855 then $Tuple2((state ++ refreshDLpActions), totalAmount)
913921 let c = (((((D * D) / (x * n)) * D) * aPrecision) / (ann * n))
914922 let b = ((s + ((D * aPrecision) / ann)) - D)
915923 func calc (acc,cur) = {
916- let $t03477034790 = acc
917- let y = $t03477034790._1
918- let found = $t03477034790._2
924+ let $t03488634906 = acc
925+ let y = $t03488634906._1
926+ let found = $t03488634906._2
919927 if ((found != unit))
920928 then acc
921929 else {
928936 }
929937
930938 let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
931- let $t03512135168 = {
939+ let $t03523735284 = {
932940 let $l = arr
933941 let $s = size($l)
934942 let $acc0 = $Tuple2(D, unit)
942950
943951 $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)
944952 }
945- let y = $t03512135168._1
946- let found = $t03512135168._2
953+ let y = $t03523735284._1
954+ let found = $t03523735284._2
947955 if ((found != unit))
948956 then y
949957 else throw(("Y calculation error, Y = " + toString(y)))
955963
956964 @Callable(i)
957965 func calculateAmountOutForSwapREADONLY (cleanAmountIn,isReverse,feePoolAmount) = {
958- let $t03552035944 = if ((isReverse == false))
966+ let $t03563636060 = if ((isReverse == false))
959967 then {
960968 let assetOut = strf(this, pa())
961969 let poolAmountInBalance = (toBigInt(getAccBalance(strf(this, aa()))) + toBigInt(cleanAmountIn))
966974 let poolAmountInBalance = (toBigInt(getAccBalance(strf(this, pa()))) + toBigInt(cleanAmountIn))
967975 $Tuple2(assetOut, poolAmountInBalance)
968976 }
969- let assetOut = $t03552035944._1
970- let poolAmountInBalance = $t03552035944._2
977+ let assetOut = $t03563636060._1
978+ let poolAmountInBalance = $t03563636060._2
971979 let poolConfig = gpc()
972980 let amId = poolConfig[idxAmAsId]
973981 let prId = poolConfig[idxPrAsId]
10221030 then {
10231031 let pmt = value(i.payments[0])
10241032 let assetIn = assetIdToString(pmt.assetId)
1025- let $t03767938073 = if ((isReverse == false))
1033+ let $t03779538189 = if ((isReverse == false))
10261034 then {
10271035 let assetOut = strf(this, pa())
10281036 let poolAmountInBalance = (getAccBalance(assetIn) - value(i.payments[0]).amount)
10331041 let poolAmountInBalance = (getAccBalance(assetIn) - value(i.payments[0]).amount)
10341042 $Tuple2(assetOut, poolAmountInBalance)
10351043 }
1036- let assetOut = $t03767938073._1
1037- let poolAmountInBalance = $t03767938073._2
1044+ let assetOut = $t03779538189._1
1045+ let poolAmountInBalance = $t03779538189._2
10381046 let poolConfig = gpc()
10391047 let amId = poolConfig[idxAmAsId]
10401048 let prId = poolConfig[idxPrAsId]
11501158 else throw("Strict value is not equal to itself.")
11511159 }
11521160 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
1153- let $t04252842670 = refreshDLpInternal(0, 0, 0)
1154- let refreshDLpActions = $t04252842670._1
1155- let updatedDLp = $t04252842670._2
1161+ let $t04264442786 = refreshDLpInternal(0, 0, 0)
1162+ let refreshDLpActions = $t04264442786._1
1163+ let updatedDLp = $t04264442786._2
11561164 let check = if ((updatedDLp >= currentDLp))
11571165 then true
11581166 else throwErr(makeString(["updated DLp lower than current DLp", toString(amountAssetBalance), toString(priceAssetBalance), toString(lpAssetEmission), toString(currentDLp), toString(updatedDLp), toString(amDiff), toString(prDiff)], " "))
12251233 else calcCurrentDLp(toBigInt(0), toBigInt(pmtAmt), toBigInt(0))
12261234 if ((currentDLp == currentDLp))
12271235 then {
1228- let $t04431144469 = calcPutOneTkn(pmtAmt, pmtAssetId, toString(userAddress), toBase58String(i.transactionId), true)
1229- if (($t04431144469 == $t04431144469))
1236+ let $t04442744585 = calcPutOneTkn(pmtAmt, pmtAssetId, toString(userAddress), toBase58String(i.transactionId), true)
1237+ if (($t04442744585 == $t04442744585))
12301238 then {
1231- let feeAmount = $t04431144469._3
1232- let state = $t04431144469._2
1233- let estimLP = $t04431144469._1
1239+ let feeAmount = $t04442744585._3
1240+ let state = $t04442744585._2
1241+ let estimLP = $t04442744585._1
12341242 let emitLpAmt = if (if ((minOutAmount > 0))
12351243 then (minOutAmount > estimLP)
12361244 else false)
12581266 let sendFeeToMatcher = if ((feeAmount > 0))
12591267 then [ScriptTransfer(feeCollectorAddress, feeAmount, fromBase58String(pmtAssetId))]
12601268 else nil
1261- let $t04535445703 = if ((this == feeCollectorAddress))
1269+ let $t04547045819 = if ((this == feeCollectorAddress))
12621270 then $Tuple2(0, 0)
12631271 else {
12641272 let paymentInAmountAsset = if ((pmt.assetId == cfgAmountAssetId))
12681276 then $Tuple2(-(feeAmount), 0)
12691277 else $Tuple2(0, -(feeAmount))
12701278 }
1271- let amountAssetBalanceDelta = $t04535445703._1
1272- let priceAssetBalanceDelta = $t04535445703._2
1273- let $t04570645814 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1274- let refreshDLpActions = $t04570645814._1
1275- let updatedDLp = $t04570645814._2
1279+ let amountAssetBalanceDelta = $t04547045819._1
1280+ let priceAssetBalanceDelta = $t04547045819._2
1281+ let $t04582245930 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1282+ let refreshDLpActions = $t04582245930._1
1283+ let updatedDLp = $t04582245930._2
12761284 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
12771285 if ((isUpdatedDLpValid == isUpdatedDLpValid))
12781286 then $Tuple2((((state ++ lpTrnsfr) ++ sendFeeToMatcher) ++ refreshDLpActions), emitLpAmt)
13041312 let currentDLp = calcCurrentDLp(amAssetPmt, prAssetPmt, toBigInt(0))
13051313 if ((currentDLp == currentDLp))
13061314 then {
1307- let $t04684446909 = refreshDLpInternal(0, 0, 0)
1308- let refreshDLpActions = $t04684446909._1
1309- let updatedDLp = $t04684446909._2
1315+ let $t04696047025 = refreshDLpInternal(0, 0, 0)
1316+ let refreshDLpActions = $t04696047025._1
1317+ let updatedDLp = $t04696047025._2
13101318 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
13111319 if ((isUpdatedDLpValid == isUpdatedDLpValid))
13121320 then (state ++ refreshDLpActions)
13311339 let b = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
13321340 if ((b == b))
13331341 then {
1334- let $t04808248164 = refreshDLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1335- let refreshDLpActions = $t04808248164._1
1336- let updatedDLp = $t04808248164._2
1342+ let $t04819848280 = refreshDLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1343+ let refreshDLpActions = $t04819848280._1
1344+ let updatedDLp = $t04819848280._2
13371345 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
13381346 if ((isUpdatedDLpValid == isUpdatedDLpValid))
13391347 then (state ++ refreshDLpActions)
13681376 else throwErr("exactly 1 payment are expected")]
13691377 if ((checks == checks))
13701378 then {
1371- let $t04878248937 = getOneTknV2Internal(outAssetId, minOutAmount, i.payments, i.caller, i.originCaller, i.transactionId)
1372- let state = $t04878248937._1
1373- let totalAmount = $t04878248937._2
1379+ let $t04889849053 = getOneTknV2Internal(outAssetId, minOutAmount, i.payments, i.caller, i.originCaller, i.transactionId)
1380+ let state = $t04889849053._1
1381+ let totalAmount = $t04889849053._2
13741382 $Tuple2(state, totalAmount)
13751383 }
13761384 else throw("Strict value is not equal to itself.")
13871395 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
13881396 then {
13891397 let dLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyDLp), "0")), fmtErr("invalid dLp"))
1390- let $t04946149525 = refreshDLpInternal(0, 0, 0)
1391- let dLpUpdateActions = $t04946149525._1
1392- let updatedDLp = $t04946149525._2
1398+ let $t04957749641 = refreshDLpInternal(0, 0, 0)
1399+ let dLpUpdateActions = $t04957749641._1
1400+ let updatedDLp = $t04957749641._2
13931401 let actions = if ((dLp != updatedDLp))
13941402 then dLpUpdateActions
13951403 else throwErr("nothing to refresh")
14171425 let newY = getYD(xp, index, D1)
14181426 let dy = (xp[index] - newY)
14191427 let totalGetRaw = max([0, toInt((dy - big1))])
1420- let $t05053550590 = takeFee(totalGetRaw, outFee)
1421- let totalGet = $t05053550590._1
1422- let feeAmount = $t05053550590._2
1428+ let $t05065150706 = takeFee(totalGetRaw, outFee)
1429+ let totalGet = $t05065150706._1
1430+ let feeAmount = $t05065150706._2
14231431 $Tuple2(nil, $Tuple2(totalGet, feeAmount))
14241432 }
14251433
14321440 let lpId = toBase58String(value(cfgLpAssetId))
14331441 let amBalance = getAccBalance(amId)
14341442 let prBalance = getAccBalance(prId)
1435- let $t05096551080 = {
1443+ let $t05108151196 = {
14361444 let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, lpAssetAmount], nil)
14371445 if ($isInstanceOf(@, "(Int, Int)"))
14381446 then @
14391447 else throw(($getType(@) + " couldn't be cast to (Int, Int)"))
14401448 }
1441- let totalGet = $t05096551080._1
1442- let feeAmount = $t05096551080._2
1449+ let totalGet = $t05108151196._1
1450+ let feeAmount = $t05108151196._2
14431451 let r = ego("", lpId, lpAssetAmount, this)
14441452 let outAmAmt = r._1
14451453 let outPrAmt = r._2
14731481 let burnLPAssetOnFactory = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
14741482 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
14751483 then {
1476- let $t05224652327 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1477- let refreshDLpActions = $t05224652327._1
1478- let updatedDLp = $t05224652327._2
1484+ let $t05236252443 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1485+ let refreshDLpActions = $t05236252443._1
1486+ let updatedDLp = $t05236252443._2
14791487 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
14801488 if ((isUpdatedDLpValid == isUpdatedDLpValid))
14811489 then (state ++ refreshDLpActions)
15201528 let burnA = invoke(fca, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
15211529 if ((burnA == burnA))
15221530 then {
1523- let $t05335453435 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1524- let refreshDLpActions = $t05335453435._1
1525- let updatedDLp = $t05335453435._2
1531+ let $t05347053551 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1532+ let refreshDLpActions = $t05347053551._1
1533+ let updatedDLp = $t05347053551._2
15261534 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
15271535 if ((isUpdatedDLpValid == isUpdatedDLpValid))
15281536 then (state ++ refreshDLpActions)
15731581 let burnLPAssetOnFactory = invoke(fca, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
15741582 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
15751583 then {
1576- let $t05468654767 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1577- let refreshDLpActions = $t05468654767._1
1578- let updatedDLp = $t05468654767._2
1584+ let $t05480254883 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1585+ let refreshDLpActions = $t05480254883._1
1586+ let updatedDLp = $t05480254883._2
15791587 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
15801588 if ((isUpdatedDLpValid == isUpdatedDLpValid))
15811589 then (state ++ refreshDLpActions)
16241632 let unstakeInv = invoke(staking, "unstakeINTERNAL", [lpAssetId, unstakeAmount, userAddress.bytes, lpAssetRecipientAddress.bytes], nil)
16251633 if ((unstakeInv == unstakeInv))
16261634 then {
1627- let $t05578955977 = getOneTknV2Internal(outAssetId, minOutAmount, [AttachedPayment(lpAssetId, unstakeAmount)], i.caller, i.originCaller, i.transactionId)
1628- let state = $t05578955977._1
1629- let totalAmount = $t05578955977._2
1635+ let $t05590556093 = getOneTknV2Internal(outAssetId, minOutAmount, [AttachedPayment(lpAssetId, unstakeAmount)], i.caller, i.originCaller, i.transactionId)
1636+ let state = $t05590556093._1
1637+ let totalAmount = $t05590556093._2
16301638 $Tuple2(state, totalAmount)
16311639 }
16321640 else throw("Strict value is not equal to itself.")
16381646
16391647 @Callable(i)
16401648 func putOneTknV2WithBonusREADONLY (paymentAmountRaw,paymentAssetId) = {
1641- let $t05610556208 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", true)
1642- let lpAmount = $t05610556208._1
1643- let state = $t05610556208._2
1644- let feeAmount = $t05610556208._3
1645- let bonus = $t05610556208._4
1649+ let $t05622156324 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", true)
1650+ let lpAmount = $t05622156324._1
1651+ let state = $t05622156324._2
1652+ let feeAmount = $t05622156324._3
1653+ let bonus = $t05622156324._4
16461654 $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus))
16471655 }
16481656
16501658
16511659 @Callable(i)
16521660 func putOneTknV2WithoutTakeFeeREADONLY (paymentAmountRaw,paymentAssetId) = {
1653- let $t05635656460 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", false)
1654- let lpAmount = $t05635656460._1
1655- let state = $t05635656460._2
1656- let feeAmount = $t05635656460._3
1657- let bonus = $t05635656460._4
1661+ let $t05647256576 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", false)
1662+ let lpAmount = $t05647256576._1
1663+ let state = $t05647256576._2
1664+ let feeAmount = $t05647256576._3
1665+ let bonus = $t05647256576._4
16581666 $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus))
16591667 }
16601668
16631671 @Callable(i)
16641672 func activate (amtAsStr,prAsStr) = if ((toString(i.caller) != toString(fca)))
16651673 then throw("denied")
1666- else $Tuple2([StringEntry(aa(), amtAsStr), StringEntry(pa(), prAsStr)], "success")
1674+ else $Tuple2([StringEntry(aa(), amtAsStr), StringEntry(pa(), prAsStr), StringEntry(amp(), toString(ampInitial)), StringEntry(keyAmpHistory(height), toString(ampInitial))], "success")
16671675
16681676
16691677
17151723
17161724 @Callable(i)
17171725 func changeAmp () = {
1718- let fcaInv = invoke(fca, "changeAmp", [toString(this)], nil)
1719- if ((fcaInv == fcaInv))
1720- then nil
1726+ let cfg = invoke(fca, "getChangeAmpConfigREADONLY", [toString(this)], nil)
1727+ let $t05905659255 = match cfg {
1728+ case list: List[Any] =>
1729+ $Tuple3({
1730+ let @ = list[0]
1731+ if ($isInstanceOf(@, "Int"))
1732+ then @
1733+ else throw(($getType(@) + " couldn't be cast to Int"))
1734+ }, {
1735+ let @ = list[1]
1736+ if ($isInstanceOf(@, "Int"))
1737+ then @
1738+ else throw(($getType(@) + " couldn't be cast to Int"))
1739+ }, {
1740+ let @ = list[2]
1741+ if ($isInstanceOf(@, "Int"))
1742+ then @
1743+ else throw(($getType(@) + " couldn't be cast to Int"))
1744+ })
1745+ case _ =>
1746+ throwErr("invalid entry type")
1747+ }
1748+ let delay = $t05905659255._1
1749+ let delta = $t05905659255._2
1750+ let target = $t05905659255._3
1751+ let curAmp = parseIntValue(getStringValue(amp()))
1752+ let newAmpRaw = (curAmp + delta)
1753+ let newAmp = if ((0 > delta))
1754+ then if ((target > newAmpRaw))
1755+ then target
1756+ else newAmpRaw
1757+ else if ((newAmpRaw > target))
1758+ then target
1759+ else newAmpRaw
1760+ let lastCall = valueOrElse(getInteger(keyChangeAmpLastCall()), 0)
1761+ let wait = (lastCall + delay)
1762+ let checks = [if ((height > wait))
1763+ then true
1764+ else throwErr("try again in few blocks"), if ((curAmp != newAmp))
1765+ then true
1766+ else throwErr("already reached target")]
1767+ if ((checks == checks))
1768+ then [IntegerEntry(keyChangeAmpLastCall(), height), StringEntry(amp(), toString(newAmp)), StringEntry(keyAmpHistory(height), toString(newAmp))]
17211769 else throw("Strict value is not equal to itself.")
17221770 }
17231771
17351783 match tx {
17361784 case order: Order =>
17371785 let matcherPub = mp()
1738- let $t05904859165 = if (skipOrderValidation())
1786+ let $t06018860305 = if (skipOrderValidation())
17391787 then $Tuple2(true, "")
17401788 else validateMatcherOrderAllowed(order)
1741- let orderValid = $t05904859165._1
1742- let orderValidInfo = $t05904859165._2
1789+ let orderValid = $t06018860305._1
1790+ let orderValidInfo = $t06018860305._2
17431791 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
17441792 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
17451793 if (if (if (orderValid)
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"
25+
26+let ampInitial = 50
2527
2628 let Amult = "100"
2729
2830 let Dconv = "1"
2931
3032 let SEP = "__"
3133
3234 let EMPTY = ""
3335
3436 let PoolActive = 1
3537
3638 let PoolPutDis = 2
3739
3840 let PoolMatcherDis = 3
3941
4042 let PoolShutdown = 4
4143
4244 let idxPoolAddress = 1
4345
4446 let idxPoolSt = 2
4547
4648 let idxLPAsId = 3
4749
4850 let idxAmAsId = 4
4951
5052 let idxPrAsId = 5
5153
5254 let idxAmtAsDcm = 6
5355
5456 let idxPriceAsDcm = 7
5557
5658 let idxIAmtAsId = 8
5759
5860 let idxIPriceAsId = 9
5961
6062 let idxFactStakCntr = 1
6163
6264 let idxFactoryRestCntr = 6
6365
6466 let idxFactSlippCntr = 7
6567
6668 let idxFactGwxRewCntr = 10
6769
6870 let feeDefault = fraction(10, scale8, 10000)
6971
7072 func t1 (origVal,origScaleMult) = fraction(toBigInt(origVal), scale18, toBigInt(origScaleMult))
7173
7274
7375 func t1BigInt (origVal,origScaleMult) = fraction(origVal, scale18, origScaleMult)
7476
7577
7678 func f1 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), scale18))
7779
7880
7981 func fromX18Round (val,resultScaleMult,round) = toInt(fraction(val, toBigInt(resultScaleMult), scale18, round))
8082
8183
8284 func t2 (origVal,origScaleMult) = fraction(origVal, scale18, toBigInt(origScaleMult))
8385
8486
8587 func f2 (val,resultScaleMult) = fraction(val, toBigInt(resultScaleMult), scale18)
8688
8789
8890 func ts (amt,resScale,curScale) = fraction(amt, resScale, curScale)
8991
9092
9193 func abs (val) = if ((zeroBigInt > val))
9294 then -(val)
9395 else val
9496
9597
9698 func absBigInt (val) = if ((zeroBigInt > val))
9799 then -(val)
98100 else val
99101
100102
101103 func fc () = "%s__factoryContract"
102104
103105
104106 func keyManagerPublicKey () = "%s__managerPublicKey"
105107
106108
107109 func keyManagerVaultAddress () = "%s__managerVaultAddress"
108110
109111
110112 func pl () = "%s%s__price__last"
111113
112114
113115 func ph (h,t) = makeString(["%s%s%d%d__price__history", toString(h), toString(t)], SEP)
114116
115117
116118 func pau (ua,txId) = ((("%s%s%s__P__" + ua) + "__") + txId)
117119
118120
119121 func gau (ua,txId) = ((("%s%s%s__G__" + ua) + "__") + txId)
120122
121123
122124 func aa () = "%s__amountAsset"
123125
124126
125127 func pa () = "%s__priceAsset"
126128
127129
128-func amp () = makeString(["%s%s", "amp", toString(this)], SEP)
130+func amp () = "%s__amp"
131+
132+
133+func keyAmpHistory (heightBlocks) = ("%s%d__amp__" + toString(heightBlocks))
134+
135+
136+func keyChangeAmpLastCall () = "%s__changeAmpLastCall"
129137
130138
131139 let keyFee = "%s__fee"
132140
133141 let fee = valueOrElse(getInteger(this, keyFee), feeDefault)
134142
135143 let keyDLp = makeString(["%s", "dLp"], SEP)
136144
137145 let keyDLpRefreshedHeight = makeString(["%s", "dLpRefreshedHeight"], SEP)
138146
139147 let keyDLpRefreshDelay = makeString(["%s", "refreshDLpDelay"], SEP)
140148
141149 let dLpRefreshDelayDefault = 30
142150
143151 let dLpRefreshDelay = valueOrElse(getInteger(this, keyDLpRefreshDelay), dLpRefreshDelayDefault)
144152
145153 func fcfg () = "%s__factoryConfig"
146154
147155
148156 func mtpk () = "%s%s__matcher__publicKey"
149157
150158
151159 func pc (iAmtAs,iPrAs) = (((("%d%d%s__" + iAmtAs) + "__") + iPrAs) + "__config")
152160
153161
154162 func mba (bAStr) = ("%s%s%s__mappings__baseAsset2internalId__" + bAStr)
155163
156164
157165 func aps () = "%s__shutdown"
158166
159167
160168 func keyAllowedLpStableScriptHash () = "%s__allowedLpStableScriptHash"
161169
162170
163171 func keyFeeCollectorAddress () = "%s__feeCollectorAddress"
164172
165173
166174 func keySkipOrderValidation (poolAddress) = ("%s%s__skipOrderValidation__" + poolAddress)
167175
168176
169177 func throwOrderError (orderValid,orderValidInfo,senderValid,matcherValid) = throw((((((((("order validation failed: orderValid=" + toString(orderValid)) + " (") + orderValidInfo) + ")") + " senderValid=") + toString(senderValid)) + " matcherValid=") + toString(matcherValid)))
170178
171179
172180 func addressFromStringOrThis (addressString) = match addressFromString(addressString) {
173181 case a: Address =>
174182 a
175183 case _ =>
176184 this
177185 }
178186
179187
180188 func getManagerVaultAddressOrThis () = {
181189 let factoryAddress = match getString(fc()) {
182190 case fca: String =>
183191 addressFromStringOrThis(fca)
184192 case _ =>
185193 this
186194 }
187195 match getString(factoryAddress, keyManagerVaultAddress()) {
188196 case s: String =>
189197 addressFromStringOrThis(s)
190198 case _ =>
191199 this
192200 }
193201 }
194202
195203
196204 func strf (addr,key) = valueOrErrorMessage(getString(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], ""))
197205
198206
199207 func intf (addr,key) = valueOrErrorMessage(getInteger(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], ""))
200208
201209
202210 func throwErr (msg) = throw(makeString(["lp_stable.ride:", msg], " "))
203211
204212
205213 func fmtErr (msg) = makeString(["lp_stable.ride:", msg], " ")
206214
207215
208216 let fca = addressFromStringValue(strf(this, fc()))
209217
210218 let inFee = {
211219 let @ = invoke(fca, "getInFeeREADONLY", [toString(this)], nil)
212220 if ($isInstanceOf(@, "Int"))
213221 then @
214222 else throw(($getType(@) + " couldn't be cast to Int"))
215223 }
216224
217225 let outFee = {
218226 let @ = invoke(fca, "getOutFeeREADONLY", [toString(this)], nil)
219227 if ($isInstanceOf(@, "Int"))
220228 then @
221229 else throw(($getType(@) + " couldn't be cast to Int"))
222230 }
223231
224-let A = strf(fca, amp())
232+let A = strf(this, amp())
225233
226234 func igs () = valueOrElse(getBoolean(fca, aps()), false)
227235
228236
229237 func mp () = fromBase58String(strf(fca, mtpk()))
230238
231239
232240 let feeCollectorAddress = addressFromStringValue(strf(fca, keyFeeCollectorAddress()))
233241
234242 func gpc () = {
235243 let amtAs = strf(this, aa())
236244 let priceAs = strf(this, pa())
237245 let iPriceAs = intf(fca, mba(priceAs))
238246 let iAmtAs = intf(fca, mba(amtAs))
239247 split(strf(fca, pc(toString(iAmtAs), toString(iPriceAs))), SEP)
240248 }
241249
242250
243251 func parseAssetId (input) = if ((input == wavesString))
244252 then unit
245253 else fromBase58String(input)
246254
247255
248256 func assetIdToString (input) = if ((input == unit))
249257 then wavesString
250258 else toBase58String(value(input))
251259
252260
253261 func parsePoolConfig (poolConfig) = $Tuple7(addressFromStringValue(poolConfig[idxPoolAddress]), parseIntValue(poolConfig[idxPoolSt]), fromBase58String(poolConfig[idxLPAsId]), parseAssetId(poolConfig[idxAmAsId]), parseAssetId(poolConfig[idxPrAsId]), parseIntValue(poolConfig[idxAmtAsDcm]), parseIntValue(poolConfig[idxPriceAsDcm]))
254262
255263
256264 let poolConfigParsed = parsePoolConfig(gpc())
257265
258-let $t084928678 = poolConfigParsed
266+let $t086088794 = poolConfigParsed
259267
260-let cfgPoolAddress = $t084928678._1
268+let cfgPoolAddress = $t086088794._1
261269
262-let cfgPoolStatus = $t084928678._2
270+let cfgPoolStatus = $t086088794._2
263271
264-let cfgLpAssetId = $t084928678._3
272+let cfgLpAssetId = $t086088794._3
265273
266-let cfgAmountAssetId = $t084928678._4
274+let cfgAmountAssetId = $t086088794._4
267275
268-let cfgPriceAssetId = $t084928678._5
276+let cfgPriceAssetId = $t086088794._5
269277
270-let cfgAmountAssetDecimals = $t084928678._6
278+let cfgAmountAssetDecimals = $t086088794._6
271279
272-let cfgPriceAssetDecimals = $t084928678._7
280+let cfgPriceAssetDecimals = $t086088794._7
273281
274282 func gfc () = split(strf(fca, fcfg()), SEP)
275283
276284
277285 let factoryConfig = gfc()
278286
279287 let stakingContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactStakCntr]), "Invalid staking contract address")
280288
281289 let slipageContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactSlippCntr]), "Invalid slipage contract address")
282290
283291 let gwxContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactGwxRewCntr]), "Invalid gwx contract address")
284292
285293 let restContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactoryRestCntr]), "Invalid gwx contract address")
286294
287295 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)
288296
289297
290298 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)
291299
292300
293301 func getAccBalance (assetId) = if ((assetId == "WAVES"))
294302 then wavesBalance(this).available
295303 else assetBalance(this, fromBase58String(assetId))
296304
297305
298306 func cpbi (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18)
299307
300308
301309 func cpbir (prAmtX18,amAmtX18,round) = fraction(prAmtX18, scale18, amAmtX18, round)
302310
303311
304312 func vad (A1,A2,slippage) = {
305313 let diff = fraction((A1 - A2), scale8BigInt, A2)
306314 let pass = ((slippage - abs(diff)) > zeroBigInt)
307315 if (!(pass))
308316 then throw(("Big slpg: " + toString(diff)))
309317 else $Tuple2(pass, min([A1, A2]))
310318 }
311319
312320
313321 func vd (D1,D0,slpg) = {
314322 let diff = fraction(D0, scale8BigInt, D1)
315323 let fail = (slpg > diff)
316324 if (if (fail)
317325 then true
318326 else (D0 > D1))
319327 then throw(((((((toString(D0) + " ") + toString(D1)) + " ") + toString(diff)) + " ") + toString(slpg)))
320328 else fail
321329 }
322330
323331
324332 func pcp (amAssetDcm,prAssetDcm,amAmt,prAmt) = {
325333 let amtAsAmtX18 = t1(amAmt, amAssetDcm)
326334 let prAsAmtX18 = t1(prAmt, prAssetDcm)
327335 cpbi(prAsAmtX18, amtAsAmtX18)
328336 }
329337
330338
331339 func calcPrices (amAmt,prAmt,lpAmt) = {
332340 let amtAsDcm = cfgAmountAssetDecimals
333341 let prAsDcm = cfgPriceAssetDecimals
334342 let priceX18 = pcp(amtAsDcm, prAsDcm, amAmt, prAmt)
335343 let amAmtX18 = t1(amAmt, amtAsDcm)
336344 let prAmtX18 = t1(prAmt, prAsDcm)
337345 let lpAmtX18 = t1(lpAmt, scale8)
338346 let lpPrInAmAsX18 = cpbi(amAmtX18, lpAmtX18)
339347 let lpPrInPrAsX18 = cpbi(prAmtX18, lpAmtX18)
340348 [priceX18, lpPrInAmAsX18, lpPrInPrAsX18]
341349 }
342350
343351
344352 func calculatePrices (amAmt,prAmt,lpAmt) = {
345353 let p = calcPrices(amAmt, prAmt, lpAmt)
346354 [f1(p[0], scale8), f1(p[1], scale8), f1(p[2], scale8)]
347355 }
348356
349357
350358 func takeFee (amount,fee) = {
351359 let feeAmount = if ((fee == 0))
352360 then 0
353361 else fraction(amount, fee, scale8)
354362 $Tuple2((amount - feeAmount), feeAmount)
355363 }
356364
357365
358366 func getD (xp) = {
359367 let xp0 = xp[0]
360368 let xp1 = xp[1]
361369 let s = (xp0 + xp1)
362370 if ((s == big0))
363371 then big0
364372 else {
365373 let a = parseIntValue(A)
366374 let ann = (a * 2)
367375 let p = fraction(xp0, xp1, big1)
368376 let xp0_xp1_n_n = fraction(p, big4, big1)
369377 let ann_s = fraction(toBigInt(ann), s, big1)
370378 let ann_1 = toBigInt((ann - 1))
371379 func calcDNext (d) = {
372380 let dd = fraction(d, d, big1)
373381 let ddd = fraction(dd, d, big1)
374382 let dp = fraction(ddd, big1, xp0_xp1_n_n)
375383 fraction((ann_s + fraction(dp, big2, big1)), d, (fraction(ann_1, d, big1) + fraction(big3, dp, big1)))
376384 }
377385
378386 func calc (acc,i) = if (acc._2)
379387 then acc
380388 else {
381389 let d = acc._1
382390 let dNext = calcDNext(d)
383391 let dDiffRaw = (dNext - value(d))
384392 let dDiff = if ((big0 > dDiffRaw))
385393 then -(dDiffRaw)
386394 else dDiffRaw
387395 if ((big1 >= dDiff))
388396 then $Tuple2(dNext, true)
389397 else $Tuple2(dNext, false)
390398 }
391399
392400 let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
393- let $t01318313231 = {
401+ let $t01329913347 = {
394402 let $l = arr
395403 let $s = size($l)
396404 let $acc0 = $Tuple2(s, false)
397405 func $f0_1 ($a,$i) = if (($i >= $s))
398406 then $a
399407 else calc($a, $l[$i])
400408
401409 func $f0_2 ($a,$i) = if (($i >= $s))
402410 then $a
403411 else throw("List size exceeds 17")
404412
405413 $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($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17)
406414 }
407- let d = $t01318313231._1
408- let found = $t01318313231._2
415+ let d = $t01329913347._1
416+ let found = $t01329913347._2
409417 if (found)
410418 then d
411419 else throw(("D calculation error, D = " + toString(d)))
412420 }
413421 }
414422
415423
416424 func ego (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
417425 let lpId = cfgLpAssetId
418426 let amId = toBase58String(value(cfgAmountAssetId))
419427 let prId = toBase58String(value(cfgPriceAssetId))
420428 let amDcm = cfgAmountAssetDecimals
421429 let prDcm = cfgPriceAssetDecimals
422430 let sts = toString(cfgPoolStatus)
423431 let lpEmiss = valueOrErrorMessage(assetInfo(lpId), "Wrong LP id").quantity
424432 if ((toBase58String(lpId) != pmtAssetId))
425433 then throw("Wrong pmt asset")
426434 else {
427435 let amBalance = getAccBalance(amId)
428436 let amBalanceX18 = t1(amBalance, amDcm)
429437 let prBalance = getAccBalance(prId)
430438 let prBalanceX18 = t1(prBalance, prDcm)
431439 let curPriceX18 = cpbi(prBalanceX18, amBalanceX18)
432440 let curPrice = f1(curPriceX18, scale8)
433441 let pmtLpAmtX18 = t1(pmtLpAmt, scale8)
434442 let lpEmissX18 = t1(lpEmiss, scale8)
435443 let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissX18)
436444 let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissX18)
437445 let outAmAmt = fromX18Round(outAmAmtX18, amDcm, FLOOR)
438446 let outPrAmt = fromX18Round(outPrAmtX18, prDcm, FLOOR)
439447 let state = if ((txId58 == ""))
440448 then nil
441449 else [ScriptTransfer(userAddress, outAmAmt, if ((amId == "WAVES"))
442450 then unit
443451 else fromBase58String(amId)), ScriptTransfer(userAddress, outPrAmt, if ((prId == "WAVES"))
444452 then unit
445453 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)]
446454 $Tuple10(outAmAmt, outPrAmt, amId, prId, amBalance, prBalance, lpEmiss, curPriceX18, sts, state)
447455 }
448456 }
449457
450458
451459 func epo (txId58,slippage,inAmAmt,inAmId,inPrAmt,inPrId,userAddress,isEval,emitLp,isOneAsset,validateSlippage,pmtAmt,pmtId) = {
452460 let lpId = cfgLpAssetId
453461 let amIdStr = toBase58String(value(cfgAmountAssetId))
454462 let prIdStr = toBase58String(value(cfgPriceAssetId))
455463 let amtDcm = cfgAmountAssetDecimals
456464 let priceDcm = cfgPriceAssetDecimals
457465 let sts = toString(cfgPoolStatus)
458466 let lpEm = valueOrErrorMessage(assetInfo(lpId), "Wr lp as").quantity
459467 let amBalance = if (isEval)
460468 then getAccBalance(amIdStr)
461469 else if (if (isOneAsset)
462470 then (pmtId == amIdStr)
463471 else false)
464472 then (getAccBalance(amIdStr) - pmtAmt)
465473 else if (isOneAsset)
466474 then getAccBalance(amIdStr)
467475 else (getAccBalance(amIdStr) - inAmAmt)
468476 let prBalance = if (isEval)
469477 then getAccBalance(prIdStr)
470478 else if (if (isOneAsset)
471479 then (pmtId == prIdStr)
472480 else false)
473481 then (getAccBalance(prIdStr) - pmtAmt)
474482 else if (isOneAsset)
475483 then getAccBalance(prIdStr)
476484 else (getAccBalance(prIdStr) - inPrAmt)
477485 let inAmAssetAmtX18 = t1(inAmAmt, amtDcm)
478486 let inPrAssetAmtX18 = t1(inPrAmt, priceDcm)
479487 let userPriceX18 = cpbi(inPrAssetAmtX18, inAmAssetAmtX18)
480488 let amBalanceX18 = t1(amBalance, amtDcm)
481489 let prBalanceX18 = t1(prBalance, priceDcm)
482490 let D0 = getD([amBalanceX18, prBalanceX18])
483491 let r = if ((lpEm == 0))
484492 then {
485493 let D1 = getD([(amBalanceX18 + inAmAssetAmtX18), (prBalanceX18 + inPrAssetAmtX18)])
486494 let checkD = if ((D1 > D0))
487495 then true
488496 else throw("D1 should be greater than D0")
489497 if ((checkD == checkD))
490498 then {
491499 let curPriceX18 = zeroBigInt
492500 let slippageX18 = zeroBigInt
493501 let lpAmtX18 = D1
494502 $Tuple5(f1(lpAmtX18, scale8), f1(inAmAssetAmtX18, amtDcm), f1(inPrAssetAmtX18, priceDcm), cpbi((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18)
495503 }
496504 else throw("Strict value is not equal to itself.")
497505 }
498506 else {
499507 let curPriceX18 = cpbi(prBalanceX18, amBalanceX18)
500508 let slippageRealX18 = fraction(abs((curPriceX18 - userPriceX18)), scale18, curPriceX18)
501509 let slippageX18 = t1(slippage, scale8)
502510 if (if (if (validateSlippage)
503511 then (curPriceX18 != zeroBigInt)
504512 else false)
505513 then (slippageRealX18 > slippageX18)
506514 else false)
507515 then throw(((("Price slippage " + toString(slippageRealX18)) + " > ") + toString(slippageX18)))
508516 else {
509517 let lpEmissionX18 = t1(lpEm, scale8)
510518 let prViaAmX18 = fraction(inAmAssetAmtX18, cpbir(prBalanceX18, amBalanceX18, CEILING), scale18, CEILING)
511519 let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, cpbir(prBalanceX18, amBalanceX18, FLOOR), CEILING)
512520 let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18))
513521 then $Tuple2(amViaPrX18, inPrAssetAmtX18)
514522 else $Tuple2(inAmAssetAmtX18, prViaAmX18)
515523 let expAmtAssetAmtX18 = expectedAmts._1
516524 let expPriceAssetAmtX18 = expectedAmts._2
517525 let D1 = getD([(amBalanceX18 + expAmtAssetAmtX18), (prBalanceX18 + expPriceAssetAmtX18)])
518526 let checkD = if ((D1 > D0))
519527 then true
520528 else throw("D1 should be greater than D0")
521529 if ((checkD == checkD))
522530 then {
523531 let lpAmtX18 = fraction(lpEmissionX18, (D1 - D0), D0)
524532 $Tuple5(fromX18Round(lpAmtX18, scale8, FLOOR), fromX18Round(expAmtAssetAmtX18, amtDcm, CEILING), fromX18Round(expPriceAssetAmtX18, priceDcm, CEILING), curPriceX18, slippageX18)
525533 }
526534 else throw("Strict value is not equal to itself.")
527535 }
528536 }
529537 let calcLpAmt = r._1
530538 let calcAmAssetPmt = r._2
531539 let calcPrAssetPmt = r._3
532540 let curPrice = f1(r._4, scale8)
533541 let slippageCalc = f1(r._5, scale8)
534542 if ((0 >= calcLpAmt))
535543 then throw("LP <= 0")
536544 else {
537545 let emitLpAmt = if (!(emitLp))
538546 then 0
539547 else calcLpAmt
540548 let amDiff = (inAmAmt - calcAmAssetPmt)
541549 let prDiff = (inPrAmt - calcPrAssetPmt)
542- let $t02099321338 = if (if (isOneAsset)
550+ let $t02110921454 = if (if (isOneAsset)
543551 then (pmtId == amIdStr)
544552 else false)
545553 then $Tuple2(pmtAmt, 0)
546554 else if (if (isOneAsset)
547555 then (pmtId == prIdStr)
548556 else false)
549557 then $Tuple2(0, pmtAmt)
550558 else $Tuple2(calcAmAssetPmt, calcPrAssetPmt)
551- let writeAmAmt = $t02099321338._1
552- let writePrAmt = $t02099321338._2
559+ let writeAmAmt = $t02110921454._1
560+ let writePrAmt = $t02110921454._2
553561 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))]
554562 $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEm, lpId, sts, commonState, amDiff, prDiff, inAmId, inPrId)
555563 }
556564 }
557565
558566
559567 func getYD (xp,i,D) = {
560568 let n = big2
561569 let x = xp[if ((i == 0))
562570 then 1
563571 else 0]
564572 let aPrecision = parseBigIntValue(Amult)
565573 let a = (parseBigIntValue(A) * aPrecision)
566574 let s = x
567575 let ann = (a * n)
568576 let c = (((((D * D) / (x * n)) * D) * aPrecision) / (ann * n))
569577 let b = ((s + ((D * aPrecision) / ann)) - D)
570578 func calc (acc,cur) = {
571- let $t02253322553 = acc
572- let y = $t02253322553._1
573- let found = $t02253322553._2
579+ let $t02264922669 = acc
580+ let y = $t02264922669._1
581+ let found = $t02264922669._2
574582 if ((found != unit))
575583 then acc
576584 else {
577585 let yNext = (((y * y) + c) / ((big2 * y) + b))
578586 let yDiff = absBigInt((yNext - value(y)))
579587 if ((big1 >= yDiff))
580588 then $Tuple2(yNext, cur)
581589 else $Tuple2(yNext, unit)
582590 }
583591 }
584592
585593 let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
586- let $t02286022907 = {
594+ let $t02297623023 = {
587595 let $l = arr
588596 let $s = size($l)
589597 let $acc0 = $Tuple2(D, unit)
590598 func $f0_1 ($a,$i) = if (($i >= $s))
591599 then $a
592600 else calc($a, $l[$i])
593601
594602 func $f0_2 ($a,$i) = if (($i >= $s))
595603 then $a
596604 else throw("List size exceeds 15")
597605
598606 $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)
599607 }
600- let y = $t02286022907._1
601- let found = $t02286022907._2
608+ let y = $t02297623023._1
609+ let found = $t02297623023._2
602610 if ((found != unit))
603611 then y
604612 else throw(("Y calculation error, Y = " + toString(y)))
605613 }
606614
607615
608616 func calcDLp (amountBalance,priceBalance,lpEmission) = {
609617 let updatedDLp = fraction(getD([t1BigInt(amountBalance, toBigInt(cfgAmountAssetDecimals)), t1BigInt(priceBalance, toBigInt(cfgPriceAssetDecimals))]), scale18, lpEmission)
610618 if ((lpEmission == big0))
611619 then big0
612620 else updatedDLp
613621 }
614622
615623
616624 func calcCurrentDLp (amountAssetDelta,priceAssetDelta,lpAssetEmissionDelta) = {
617625 let amountAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) - amountAssetDelta)
618626 let priceAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) - priceAssetDelta)
619627 let lpAssetEmission = (toBigInt(value(assetInfo(cfgLpAssetId)).quantity) - lpAssetEmissionDelta)
620628 let currentDLp = calcDLp(amountAssetBalance, priceAssetBalance, lpAssetEmission)
621629 currentDLp
622630 }
623631
624632
625633 func refreshDLpInternal (amountAssetBalanceDelta,priceAssetBalanceDelta,lpAssetEmissionDelta) = {
626634 let amountAssetBalance = (getAccBalance(assetIdToString(cfgAmountAssetId)) + amountAssetBalanceDelta)
627635 let priceAssetBalance = (getAccBalance(assetIdToString(cfgPriceAssetId)) + priceAssetBalanceDelta)
628636 let lpAssetEmission = (value(assetInfo(cfgLpAssetId)).quantity + lpAssetEmissionDelta)
629637 let updatedDLp = calcDLp(toBigInt(amountAssetBalance), toBigInt(priceAssetBalance), toBigInt(lpAssetEmission))
630638 let actions = [IntegerEntry(keyDLpRefreshedHeight, height), StringEntry(keyDLp, toString(updatedDLp))]
631639 $Tuple2(actions, updatedDLp)
632640 }
633641
634642
635643 func validateUpdatedDLp (oldDLp,updatedDLp) = if ((updatedDLp >= oldDLp))
636644 then true
637645 else throwErr("updated DLp lower than current DLp")
638646
639647
640648 func validateMatcherOrderAllowed (order) = {
641649 let amountAssetBalance = getAccBalance(assetIdToString(cfgAmountAssetId))
642650 let priceAssetBalance = getAccBalance(assetIdToString(cfgPriceAssetId))
643651 let amountAssetAmount = order.amount
644652 let priceAssetAmount = fraction(order.amount, order.price, scale8, FLOOR)
645- let $t02510525317 = if ((order.orderType == Buy))
653+ let $t02522125433 = if ((order.orderType == Buy))
646654 then $Tuple2(amountAssetAmount, -(priceAssetAmount))
647655 else $Tuple2(-(amountAssetAmount), priceAssetAmount)
648- let amountAssetBalanceDelta = $t02510525317._1
649- let priceAssetBalanceDelta = $t02510525317._2
656+ let amountAssetBalanceDelta = $t02522125433._1
657+ let priceAssetBalanceDelta = $t02522125433._2
650658 if (if (if (igs())
651659 then true
652660 else (cfgPoolStatus == PoolMatcherDis))
653661 then true
654662 else (cfgPoolStatus == PoolShutdown))
655663 then throw("Admin blocked")
656664 else if (if ((order.assetPair.amountAsset != cfgAmountAssetId))
657665 then true
658666 else (order.assetPair.priceAsset != cfgPriceAssetId))
659667 then throw("Wr assets")
660668 else {
661669 let dLp = parseBigIntValue(valueOrElse(getString(this, keyDLp), "0"))
662- let $t02565925759 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
663- let unusedActions = $t02565925759._1
664- let dLpNew = $t02565925759._2
670+ let $t02577525875 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
671+ let unusedActions = $t02577525875._1
672+ let dLpNew = $t02577525875._2
665673 let isOrderValid = (dLpNew >= dLp)
666674 let info = makeString(["dLp=", toString(dLp), " dLpNew=", toString(dLpNew), " amountAssetBalance=", toString(amountAssetBalance), " priceAssetBalance=", toString(priceAssetBalance), " amountAssetBalanceDelta=", toString(amountAssetBalanceDelta), " priceAssetBalanceDelta=", toString(priceAssetBalanceDelta), " height=", toString(height)], "")
667675 $Tuple2(isOrderValid, info)
668676 }
669677 }
670678
671679
672680 func cg (i) = if ((size(i.payments) != 1))
673681 then throw("1 pmnt exp")
674682 else {
675683 let pmt = value(i.payments[0])
676684 let pmtAssetId = value(pmt.assetId)
677685 let pmtAmt = pmt.amount
678686 let r = ego(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller)
679687 let outAmAmt = r._1
680688 let outPrAmt = r._2
681689 let sts = parseIntValue(r._9)
682690 let state = r._10
683691 if (if (igs())
684692 then true
685693 else (sts == PoolShutdown))
686694 then throw(("Admin blocked: " + toString(sts)))
687695 else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state)
688696 }
689697
690698
691699 func cp (caller,txId,amAsPmt,prAsPmt,slippage,emitLp,isOneAsset,validateSlippage,pmtAmt,pmtId) = {
692700 let r = epo(txId, slippage, value(amAsPmt).amount, value(amAsPmt).assetId, value(prAsPmt).amount, value(prAsPmt).assetId, caller, (txId == ""), emitLp, isOneAsset, validateSlippage, pmtAmt, pmtId)
693701 let sts = parseIntValue(r._8)
694702 if (if (if (igs())
695703 then true
696704 else (sts == PoolPutDis))
697705 then true
698706 else (sts == PoolShutdown))
699707 then throw(("Blocked:" + toString(sts)))
700708 else r
701709 }
702710
703711
704712 func calcPutOneTkn (pmtAmtRaw,pmtAssetId,userAddress,txId,withTakeFee) = {
705713 let amId = toBase58String(value(cfgAmountAssetId))
706714 let prId = toBase58String(value(cfgPriceAssetId))
707715 let lpId = cfgLpAssetId
708716 let amtDcm = cfgAmountAssetDecimals
709717 let priceDcm = cfgPriceAssetDecimals
710718 let lpAssetEmission = toBigInt(valueOrErrorMessage(assetInfo(lpId), "invalid lp asset").quantity)
711719 let chechEmission = if ((lpAssetEmission > big0))
712720 then true
713721 else throw("initial deposit requires all coins")
714722 if ((chechEmission == chechEmission))
715723 then {
716724 let amBalance = getAccBalance(amId)
717725 let prBalance = getAccBalance(prId)
718- let $t02841528877 = if ((txId == ""))
726+ let $t02853128993 = if ((txId == ""))
719727 then $Tuple2(amBalance, prBalance)
720728 else if ((pmtAssetId == amId))
721729 then if ((pmtAmtRaw > amBalance))
722730 then throw("invalid payment amount")
723731 else $Tuple2((amBalance - pmtAmtRaw), prBalance)
724732 else if ((pmtAssetId == prId))
725733 then if ((pmtAmtRaw > prBalance))
726734 then throw("invalid payment amount")
727735 else $Tuple2(amBalance, (prBalance - pmtAmtRaw))
728736 else throw("wrong pmtAssetId")
729- let amBalanceOld = $t02841528877._1
730- let prBalanceOld = $t02841528877._2
731- let $t02888329059 = if ((pmtAssetId == amId))
737+ let amBalanceOld = $t02853128993._1
738+ let prBalanceOld = $t02853128993._2
739+ let $t02899929175 = if ((pmtAssetId == amId))
732740 then $Tuple2(pmtAmtRaw, 0)
733741 else if ((pmtAssetId == prId))
734742 then $Tuple2(0, pmtAmtRaw)
735743 else throw("invalid payment")
736- let amAmountRaw = $t02888329059._1
737- let prAmountRaw = $t02888329059._2
738- let $t02906329317 = if (withTakeFee)
744+ let amAmountRaw = $t02899929175._1
745+ let prAmountRaw = $t02899929175._2
746+ let $t02917929433 = if (withTakeFee)
739747 then $Tuple3(takeFee(amAmountRaw, inFee)._1, takeFee(prAmountRaw, inFee)._1, takeFee(pmtAmtRaw, inFee)._2)
740748 else $Tuple3(amAmountRaw, prAmountRaw, 0)
741- let amAmount = $t02906329317._1
742- let prAmount = $t02906329317._2
743- let feeAmount = $t02906329317._3
749+ let amAmount = $t02917929433._1
750+ let prAmount = $t02917929433._2
751+ let feeAmount = $t02917929433._3
744752 let amBalanceNew = (amBalanceOld + amAmount)
745753 let prBalanceNew = (prBalanceOld + prAmount)
746754 let D0 = getD([t1(amBalanceOld, cfgAmountAssetDecimals), t1(prBalanceOld, cfgPriceAssetDecimals)])
747755 let D1 = getD([t1(amBalanceNew, cfgAmountAssetDecimals), t1(prBalanceNew, cfgPriceAssetDecimals)])
748756 let checkD = if ((D1 > D0))
749757 then true
750758 else throw()
751759 if ((checkD == checkD))
752760 then {
753761 let lpAmount = fraction(lpAssetEmission, (D1 - D0), D0, FLOOR)
754762 let curPrice = f1(cpbi(t1(prBalanceNew, priceDcm), t1(amBalanceNew, amtDcm)), scale8)
755763 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))]
756764 let poolProportion = fraction(prBalanceOld, scale8, amBalanceOld)
757765 let amountAssetPart = fraction(pmtAmtRaw, scale8, (poolProportion + scale8))
758766 let priceAssetPart = (pmtAmtRaw - amountAssetPart)
759767 let lpAmtBoth = fraction(lpAssetEmission, toBigInt(priceAssetPart), toBigInt(prBalanceOld))
760768 let bonus = toInt(fraction((lpAmount - lpAmtBoth), scale8BigInt, lpAmtBoth))
761769 $Tuple4(toInt(lpAmount), commonState, feeAmount, bonus)
762770 }
763771 else throw("Strict value is not equal to itself.")
764772 }
765773 else throw("Strict value is not equal to itself.")
766774 }
767775
768776
769777 func getOneTknV2Internal (outAssetId,minOutAmount,payments,caller,originCaller,transactionId) = {
770778 let lpId = toBase58String(value(cfgLpAssetId))
771779 let amId = toBase58String(value(cfgAmountAssetId))
772780 let prId = toBase58String(value(cfgPriceAssetId))
773781 let amDecimals = cfgAmountAssetDecimals
774782 let prDecimals = cfgPriceAssetDecimals
775783 let poolStatus = cfgPoolStatus
776784 let userAddress = if ((caller == restContract))
777785 then originCaller
778786 else caller
779787 let pmt = value(payments[0])
780788 let pmtAssetId = value(pmt.assetId)
781789 let pmtAmt = pmt.amount
782790 let currentDLp = calcCurrentDLp(big0, big0, big0)
783791 if ((currentDLp == currentDLp))
784792 then {
785793 let txId58 = toBase58String(transactionId)
786794 if ((lpId != toBase58String(pmtAssetId)))
787795 then throw("Wrong LP")
788796 else {
789797 let amBalance = getAccBalance(amId)
790798 let prBalance = getAccBalance(prId)
791- let $t03142931540 = {
799+ let $t03154531656 = {
792800 let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, pmtAmt], nil)
793801 if ($isInstanceOf(@, "(Int, Int)"))
794802 then @
795803 else throw(($getType(@) + " couldn't be cast to (Int, Int)"))
796804 }
797- if (($t03142931540 == $t03142931540))
805+ if (($t03154531656 == $t03154531656))
798806 then {
799- let feeAmount = $t03142931540._2
800- let totalGet = $t03142931540._1
807+ let feeAmount = $t03154531656._2
808+ let totalGet = $t03154531656._1
801809 let totalAmount = if (if ((minOutAmount > 0))
802810 then (minOutAmount > totalGet)
803811 else false)
804812 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
805813 else totalGet
806- let $t03173032037 = if ((outAssetId == amId))
814+ let $t03184632153 = if ((outAssetId == amId))
807815 then $Tuple4(totalAmount, 0, ((amBalance - totalAmount) - feeAmount), prBalance)
808816 else if ((outAssetId == prId))
809817 then $Tuple4(0, totalAmount, amBalance, ((prBalance - totalAmount) - feeAmount))
810818 else throw("invalid out asset id")
811- let outAm = $t03173032037._1
812- let outPr = $t03173032037._2
813- let amBalanceNew = $t03173032037._3
814- let prBalanceNew = $t03173032037._4
819+ let outAm = $t03184632153._1
820+ let outPr = $t03184632153._2
821+ let amBalanceNew = $t03184632153._3
822+ let prBalanceNew = $t03184632153._4
815823 let curPrX18 = cpbi(t1(prBalanceNew, prDecimals), t1(amBalanceNew, amDecimals))
816824 let curPr = f1(curPrX18, scale8)
817825 let outAssetIdOrWaves = if ((outAssetId == "WAVES"))
818826 then unit
819827 else fromBase58String(outAssetId)
820828 let sendFeeToMatcher = if ((feeAmount > 0))
821829 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetIdOrWaves)]
822830 else nil
823831 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)
824832 if ((state == state))
825833 then {
826834 let burn = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
827835 if ((burn == burn))
828836 then {
829- let $t03282233172 = {
837+ let $t03293833288 = {
830838 let feeAmountForCalc = if ((this == feeCollectorAddress))
831839 then 0
832840 else feeAmount
833841 let outInAmountAsset = if ((parseAssetId(outAssetId) == cfgAmountAssetId))
834842 then true
835843 else false
836844 if (outInAmountAsset)
837845 then $Tuple2(-((totalGet + feeAmountForCalc)), 0)
838846 else $Tuple2(0, -((totalGet + feeAmountForCalc)))
839847 }
840- let amountAssetBalanceDelta = $t03282233172._1
841- let priceAssetBalanceDelta = $t03282233172._2
842- let $t03317533283 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
843- let refreshDLpActions = $t03317533283._1
844- let updatedDLp = $t03317533283._2
848+ let amountAssetBalanceDelta = $t03293833288._1
849+ let priceAssetBalanceDelta = $t03293833288._2
850+ let $t03329133399 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
851+ let refreshDLpActions = $t03329133399._1
852+ let updatedDLp = $t03329133399._2
845853 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
846854 if ((isUpdatedDLpValid == isUpdatedDLpValid))
847855 then $Tuple2((state ++ refreshDLpActions), totalAmount)
848856 else throw("Strict value is not equal to itself.")
849857 }
850858 else throw("Strict value is not equal to itself.")
851859 }
852860 else throw("Strict value is not equal to itself.")
853861 }
854862 else throw("Strict value is not equal to itself.")
855863 }
856864 }
857865 else throw("Strict value is not equal to itself.")
858866 }
859867
860868
861869 func managerPublicKeyOrUnit () = {
862870 let managerVaultAddress = getManagerVaultAddressOrThis()
863871 match getString(managerVaultAddress, keyManagerPublicKey()) {
864872 case s: String =>
865873 fromBase58String(s)
866874 case _: Unit =>
867875 unit
868876 case _ =>
869877 throw("Match error")
870878 }
871879 }
872880
873881
874882 let pd = throw("Permission denied")
875883
876884 func isManager (i) = match managerPublicKeyOrUnit() {
877885 case pk: ByteVector =>
878886 (i.callerPublicKey == pk)
879887 case _: Unit =>
880888 (i.caller == this)
881889 case _ =>
882890 throw("Match error")
883891 }
884892
885893
886894 func mustManager (i) = match managerPublicKeyOrUnit() {
887895 case pk: ByteVector =>
888896 if ((i.callerPublicKey == pk))
889897 then true
890898 else pd
891899 case _: Unit =>
892900 if ((i.caller == this))
893901 then true
894902 else pd
895903 case _ =>
896904 throw("Match error")
897905 }
898906
899907
900908 func getY (isReverse,D,poolAmountInBalance) = {
901909 let poolConfig = gpc()
902910 let amId = poolConfig[idxAmAsId]
903911 let prId = poolConfig[idxPrAsId]
904912 let n = big2
905913 let aPrecision = parseBigIntValue(Amult)
906914 let a = (parseBigIntValue(A) * aPrecision)
907915 let xp = if ((isReverse == false))
908916 then [(toBigInt(getAccBalance(amId)) + poolAmountInBalance), toBigInt(getAccBalance(prId))]
909917 else [(toBigInt(getAccBalance(prId)) + poolAmountInBalance), toBigInt(getAccBalance(amId))]
910918 let x = xp[0]
911919 let s = x
912920 let ann = (a * n)
913921 let c = (((((D * D) / (x * n)) * D) * aPrecision) / (ann * n))
914922 let b = ((s + ((D * aPrecision) / ann)) - D)
915923 func calc (acc,cur) = {
916- let $t03477034790 = acc
917- let y = $t03477034790._1
918- let found = $t03477034790._2
924+ let $t03488634906 = acc
925+ let y = $t03488634906._1
926+ let found = $t03488634906._2
919927 if ((found != unit))
920928 then acc
921929 else {
922930 let yNext = (((y * y) + c) / ((big2 * y) + b))
923931 let yDiff = absBigInt((yNext - value(y)))
924932 if ((big1 >= yDiff))
925933 then $Tuple2(yNext, cur)
926934 else $Tuple2(yNext, unit)
927935 }
928936 }
929937
930938 let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
931- let $t03512135168 = {
939+ let $t03523735284 = {
932940 let $l = arr
933941 let $s = size($l)
934942 let $acc0 = $Tuple2(D, unit)
935943 func $f0_1 ($a,$i) = if (($i >= $s))
936944 then $a
937945 else calc($a, $l[$i])
938946
939947 func $f0_2 ($a,$i) = if (($i >= $s))
940948 then $a
941949 else throw("List size exceeds 15")
942950
943951 $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)
944952 }
945- let y = $t03512135168._1
946- let found = $t03512135168._2
953+ let y = $t03523735284._1
954+ let found = $t03523735284._2
947955 if ((found != unit))
948956 then y
949957 else throw(("Y calculation error, Y = " + toString(y)))
950958 }
951959
952960
953961 func skipOrderValidation () = valueOrElse(getBoolean(fca, keySkipOrderValidation(toString(this))), false)
954962
955963
956964 @Callable(i)
957965 func calculateAmountOutForSwapREADONLY (cleanAmountIn,isReverse,feePoolAmount) = {
958- let $t03552035944 = if ((isReverse == false))
966+ let $t03563636060 = if ((isReverse == false))
959967 then {
960968 let assetOut = strf(this, pa())
961969 let poolAmountInBalance = (toBigInt(getAccBalance(strf(this, aa()))) + toBigInt(cleanAmountIn))
962970 $Tuple2(assetOut, poolAmountInBalance)
963971 }
964972 else {
965973 let assetOut = strf(this, aa())
966974 let poolAmountInBalance = (toBigInt(getAccBalance(strf(this, pa()))) + toBigInt(cleanAmountIn))
967975 $Tuple2(assetOut, poolAmountInBalance)
968976 }
969- let assetOut = $t03552035944._1
970- let poolAmountInBalance = $t03552035944._2
977+ let assetOut = $t03563636060._1
978+ let poolAmountInBalance = $t03563636060._2
971979 let poolConfig = gpc()
972980 let amId = poolConfig[idxAmAsId]
973981 let prId = poolConfig[idxPrAsId]
974982 let xp = [toBigInt(getAccBalance(amId)), toBigInt(getAccBalance(prId))]
975983 let D = getD(xp)
976984 let y = getY(isReverse, D, toBigInt(cleanAmountIn))
977985 let dy = ((toBigInt(getAccBalance(assetOut)) - y) - toBigInt(1))
978986 let totalGetRaw = max([0, toInt(dy)])
979987 let newXp = if ((isReverse == false))
980988 then [((toBigInt(getAccBalance(amId)) + toBigInt(cleanAmountIn)) + toBigInt(feePoolAmount)), (toBigInt(getAccBalance(prId)) - dy)]
981989 else [(toBigInt(getAccBalance(amId)) - dy), ((toBigInt(getAccBalance(prId)) + toBigInt(cleanAmountIn)) + toBigInt(feePoolAmount))]
982990 let newD = getD(newXp)
983991 let checkD = if ((newD >= D))
984992 then true
985993 else throw(makeString(["new D is fewer error", toString(D), toString(newD)], "__"))
986994 if ((checkD == checkD))
987995 then $Tuple2(nil, totalGetRaw)
988996 else throw("Strict value is not equal to itself.")
989997 }
990998
991999
9921000
9931001 @Callable(i)
9941002 func calculateAmountOutForSwapAndSendTokens (cleanAmountIn,isReverse,amountOutMin,addressTo,feePoolAmount) = {
9951003 let swapContact = {
9961004 let @ = invoke(fca, "getSwapContractREADONLY", nil, nil)
9971005 if ($isInstanceOf(@, "String"))
9981006 then @
9991007 else throw(($getType(@) + " couldn't be cast to String"))
10001008 }
10011009 let isPoolSwapDisabled = {
10021010 let @ = invoke(fca, "isPoolSwapDisabledREADONLY", [toString(this)], nil)
10031011 if ($isInstanceOf(@, "Boolean"))
10041012 then @
10051013 else throw(($getType(@) + " couldn't be cast to Boolean"))
10061014 }
10071015 let isSwapDisabled = if (if (igs())
10081016 then true
10091017 else (cfgPoolStatus == PoolShutdown))
10101018 then true
10111019 else isPoolSwapDisabled
10121020 let checks = [if (if (!(isSwapDisabled))
10131021 then true
10141022 else isManager(i))
10151023 then true
10161024 else throwErr("swap operation is blocked by admin"), if ((value(i.payments[0]).amount >= cleanAmountIn))
10171025 then true
10181026 else throwErr("Wrong amount"), if ((i.caller == addressFromStringValue(swapContact)))
10191027 then true
10201028 else throwErr("Permission denied")]
10211029 if ((checks == checks))
10221030 then {
10231031 let pmt = value(i.payments[0])
10241032 let assetIn = assetIdToString(pmt.assetId)
1025- let $t03767938073 = if ((isReverse == false))
1033+ let $t03779538189 = if ((isReverse == false))
10261034 then {
10271035 let assetOut = strf(this, pa())
10281036 let poolAmountInBalance = (getAccBalance(assetIn) - value(i.payments[0]).amount)
10291037 $Tuple2(assetOut, poolAmountInBalance)
10301038 }
10311039 else {
10321040 let assetOut = strf(this, aa())
10331041 let poolAmountInBalance = (getAccBalance(assetIn) - value(i.payments[0]).amount)
10341042 $Tuple2(assetOut, poolAmountInBalance)
10351043 }
1036- let assetOut = $t03767938073._1
1037- let poolAmountInBalance = $t03767938073._2
1044+ let assetOut = $t03779538189._1
1045+ let poolAmountInBalance = $t03779538189._2
10381046 let poolConfig = gpc()
10391047 let amId = poolConfig[idxAmAsId]
10401048 let prId = poolConfig[idxPrAsId]
10411049 let xp = if ((isReverse == false))
10421050 then [(toBigInt(getAccBalance(amId)) - toBigInt(value(i.payments[0]).amount)), toBigInt(getAccBalance(prId))]
10431051 else [toBigInt(getAccBalance(amId)), (toBigInt(getAccBalance(prId)) - toBigInt(value(i.payments[0]).amount))]
10441052 let D = getD(xp)
10451053 let y = getY(isReverse, D, toBigInt(0))
10461054 let dy = ((toBigInt(getAccBalance(assetOut)) - y) - toBigInt(1))
10471055 let totalGetRaw = max([0, toInt(dy)])
10481056 let checkMin = if ((totalGetRaw >= amountOutMin))
10491057 then true
10501058 else throw("Exchange result is fewer coins than expected")
10511059 if ((checkMin == checkMin))
10521060 then {
10531061 let newXp = if ((isReverse == false))
10541062 then [(toBigInt(getAccBalance(amId)) + toBigInt(feePoolAmount)), (toBigInt(getAccBalance(prId)) - dy)]
10551063 else [(toBigInt(getAccBalance(amId)) - dy), (toBigInt(getAccBalance(prId)) + toBigInt(feePoolAmount))]
10561064 let newD = getD(newXp)
10571065 let checkD = if ((newD >= D))
10581066 then true
10591067 else throw("new D is fewer error")
10601068 if ((checkD == checkD))
10611069 then {
10621070 let amountAssetBalanceDelta = if (isReverse)
10631071 then -(totalGetRaw)
10641072 else feePoolAmount
10651073 let priceAssetBalanceDelta = if (isReverse)
10661074 then feePoolAmount
10671075 else -(totalGetRaw)
10681076 let refreshDLpActions = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)._1
10691077 if ((refreshDLpActions == refreshDLpActions))
10701078 then $Tuple2([ScriptTransfer(addressFromStringValue(addressTo), totalGetRaw, parseAssetId(assetOut))], totalGetRaw)
10711079 else throw("Strict value is not equal to itself.")
10721080 }
10731081 else throw("Strict value is not equal to itself.")
10741082 }
10751083 else throw("Strict value is not equal to itself.")
10761084 }
10771085 else throw("Strict value is not equal to itself.")
10781086 }
10791087
10801088
10811089
10821090 @Callable(i)
10831091 func constructor (fc) = {
10841092 let c = mustManager(i)
10851093 if ((c == c))
10861094 then [StringEntry(fc(), fc)]
10871095 else throw("Strict value is not equal to itself.")
10881096 }
10891097
10901098
10911099
10921100 @Callable(i)
10931101 func put (slip,autoStake) = {
10941102 let factCfg = gfc()
10951103 let stakingCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactStakCntr]), "Wr st addr")
10961104 let slipCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactSlippCntr]), "Wr sl addr")
10971105 if ((0 > slip))
10981106 then throw("Wrong slippage")
10991107 else if ((size(i.payments) != 2))
11001108 then throw("2 pmnts expd")
11011109 else {
11021110 let amAssetPmt = toBigInt(value(i.payments[0]).amount)
11031111 let prAssetPmt = toBigInt(value(i.payments[1]).amount)
11041112 let amountAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) - amAssetPmt)
11051113 if ((amountAssetBalance == amountAssetBalance))
11061114 then {
11071115 let priceAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) - prAssetPmt)
11081116 if ((priceAssetBalance == priceAssetBalance))
11091117 then {
11101118 let lpAssetEmission = toBigInt(value(assetInfo(cfgLpAssetId)).quantity)
11111119 if ((lpAssetEmission == lpAssetEmission))
11121120 then {
11131121 let currentDLp = calcCurrentDLp(amAssetPmt, prAssetPmt, toBigInt(0))
11141122 if ((currentDLp == currentDLp))
11151123 then {
11161124 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, "")
11171125 let emitLpAmt = e._2
11181126 let lpAssetId = e._7
11191127 let state = e._9
11201128 let amDiff = e._10
11211129 let prDiff = e._11
11221130 let amId = e._12
11231131 let prId = e._13
11241132 let r = invoke(fca, "emit", [emitLpAmt], nil)
11251133 if ((r == r))
11261134 then {
11271135 let el = match r {
11281136 case legacy: Address =>
11291137 invoke(legacy, "emit", [emitLpAmt], nil)
11301138 case _ =>
11311139 unit
11321140 }
11331141 if ((el == el))
11341142 then {
11351143 let sa = if ((amDiff > 0))
11361144 then invoke(slipCntr, "put", nil, [AttachedPayment(amId, amDiff)])
11371145 else nil
11381146 if ((sa == sa))
11391147 then {
11401148 let sp = if ((prDiff > 0))
11411149 then invoke(slipCntr, "put", nil, [AttachedPayment(prId, prDiff)])
11421150 else nil
11431151 if ((sp == sp))
11441152 then {
11451153 let lpTrnsfr = if (autoStake)
11461154 then {
11471155 let ss = invoke(stakingCntr, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)])
11481156 if ((ss == ss))
11491157 then nil
11501158 else throw("Strict value is not equal to itself.")
11511159 }
11521160 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
1153- let $t04252842670 = refreshDLpInternal(0, 0, 0)
1154- let refreshDLpActions = $t04252842670._1
1155- let updatedDLp = $t04252842670._2
1161+ let $t04264442786 = refreshDLpInternal(0, 0, 0)
1162+ let refreshDLpActions = $t04264442786._1
1163+ let updatedDLp = $t04264442786._2
11561164 let check = if ((updatedDLp >= currentDLp))
11571165 then true
11581166 else throwErr(makeString(["updated DLp lower than current DLp", toString(amountAssetBalance), toString(priceAssetBalance), toString(lpAssetEmission), toString(currentDLp), toString(updatedDLp), toString(amDiff), toString(prDiff)], " "))
11591167 if ((check == check))
11601168 then {
11611169 let lpAssetEmissionAfter = value(assetInfo(cfgLpAssetId)).quantity
11621170 if ((lpAssetEmissionAfter == lpAssetEmissionAfter))
11631171 then ((state ++ lpTrnsfr) ++ refreshDLpActions)
11641172 else throw("Strict value is not equal to itself.")
11651173 }
11661174 else throw("Strict value is not equal to itself.")
11671175 }
11681176 else throw("Strict value is not equal to itself.")
11691177 }
11701178 else throw("Strict value is not equal to itself.")
11711179 }
11721180 else throw("Strict value is not equal to itself.")
11731181 }
11741182 else throw("Strict value is not equal to itself.")
11751183 }
11761184 else throw("Strict value is not equal to itself.")
11771185 }
11781186 else throw("Strict value is not equal to itself.")
11791187 }
11801188 else throw("Strict value is not equal to itself.")
11811189 }
11821190 else throw("Strict value is not equal to itself.")
11831191 }
11841192 }
11851193
11861194
11871195
11881196 @Callable(i)
11891197 func putOneTknV2 (minOutAmount,autoStake) = {
11901198 let isPoolOneTokenOperationsDisabled = {
11911199 let @ = invoke(fca, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
11921200 if ($isInstanceOf(@, "Boolean"))
11931201 then @
11941202 else throw(($getType(@) + " couldn't be cast to Boolean"))
11951203 }
11961204 let isPutDisabled = if (if (if (igs())
11971205 then true
11981206 else (cfgPoolStatus == PoolPutDis))
11991207 then true
12001208 else (cfgPoolStatus == PoolShutdown))
12011209 then true
12021210 else isPoolOneTokenOperationsDisabled
12031211 let checks = [if (if (!(isPutDisabled))
12041212 then true
12051213 else isManager(i))
12061214 then true
12071215 else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1))
12081216 then true
12091217 else throwErr("exactly 1 payment are expected")]
12101218 if ((checks == checks))
12111219 then {
12121220 let amId = toBase58String(value(cfgAmountAssetId))
12131221 let prId = toBase58String(value(cfgPriceAssetId))
12141222 let lpId = cfgLpAssetId
12151223 let amDecimals = cfgAmountAssetDecimals
12161224 let prDecimals = cfgPriceAssetDecimals
12171225 let userAddress = if ((i.caller == this))
12181226 then i.originCaller
12191227 else i.caller
12201228 let pmt = value(i.payments[0])
12211229 let pmtAssetId = toBase58String(value(pmt.assetId))
12221230 let pmtAmt = pmt.amount
12231231 let currentDLp = if ((pmt.assetId == cfgAmountAssetId))
12241232 then calcCurrentDLp(toBigInt(pmtAmt), toBigInt(0), toBigInt(0))
12251233 else calcCurrentDLp(toBigInt(0), toBigInt(pmtAmt), toBigInt(0))
12261234 if ((currentDLp == currentDLp))
12271235 then {
1228- let $t04431144469 = calcPutOneTkn(pmtAmt, pmtAssetId, toString(userAddress), toBase58String(i.transactionId), true)
1229- if (($t04431144469 == $t04431144469))
1236+ let $t04442744585 = calcPutOneTkn(pmtAmt, pmtAssetId, toString(userAddress), toBase58String(i.transactionId), true)
1237+ if (($t04442744585 == $t04442744585))
12301238 then {
1231- let feeAmount = $t04431144469._3
1232- let state = $t04431144469._2
1233- let estimLP = $t04431144469._1
1239+ let feeAmount = $t04442744585._3
1240+ let state = $t04442744585._2
1241+ let estimLP = $t04442744585._1
12341242 let emitLpAmt = if (if ((minOutAmount > 0))
12351243 then (minOutAmount > estimLP)
12361244 else false)
12371245 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
12381246 else estimLP
12391247 let e = invoke(fca, "emit", [emitLpAmt], nil)
12401248 if ((e == e))
12411249 then {
12421250 let el = match e {
12431251 case legacy: Address =>
12441252 invoke(legacy, "emit", [emitLpAmt], nil)
12451253 case _ =>
12461254 unit
12471255 }
12481256 if ((el == el))
12491257 then {
12501258 let lpTrnsfr = if (autoStake)
12511259 then {
12521260 let ss = invoke(stakingContract, "stakeFor", [toString(i.caller)], [AttachedPayment(lpId, emitLpAmt)])
12531261 if ((ss == ss))
12541262 then nil
12551263 else throw("Strict value is not equal to itself.")
12561264 }
12571265 else [ScriptTransfer(i.caller, emitLpAmt, lpId)]
12581266 let sendFeeToMatcher = if ((feeAmount > 0))
12591267 then [ScriptTransfer(feeCollectorAddress, feeAmount, fromBase58String(pmtAssetId))]
12601268 else nil
1261- let $t04535445703 = if ((this == feeCollectorAddress))
1269+ let $t04547045819 = if ((this == feeCollectorAddress))
12621270 then $Tuple2(0, 0)
12631271 else {
12641272 let paymentInAmountAsset = if ((pmt.assetId == cfgAmountAssetId))
12651273 then true
12661274 else false
12671275 if (paymentInAmountAsset)
12681276 then $Tuple2(-(feeAmount), 0)
12691277 else $Tuple2(0, -(feeAmount))
12701278 }
1271- let amountAssetBalanceDelta = $t04535445703._1
1272- let priceAssetBalanceDelta = $t04535445703._2
1273- let $t04570645814 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1274- let refreshDLpActions = $t04570645814._1
1275- let updatedDLp = $t04570645814._2
1279+ let amountAssetBalanceDelta = $t04547045819._1
1280+ let priceAssetBalanceDelta = $t04547045819._2
1281+ let $t04582245930 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1282+ let refreshDLpActions = $t04582245930._1
1283+ let updatedDLp = $t04582245930._2
12761284 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
12771285 if ((isUpdatedDLpValid == isUpdatedDLpValid))
12781286 then $Tuple2((((state ++ lpTrnsfr) ++ sendFeeToMatcher) ++ refreshDLpActions), emitLpAmt)
12791287 else throw("Strict value is not equal to itself.")
12801288 }
12811289 else throw("Strict value is not equal to itself.")
12821290 }
12831291 else throw("Strict value is not equal to itself.")
12841292 }
12851293 else throw("Strict value is not equal to itself.")
12861294 }
12871295 else throw("Strict value is not equal to itself.")
12881296 }
12891297 else throw("Strict value is not equal to itself.")
12901298 }
12911299
12921300
12931301
12941302 @Callable(i)
12951303 func putForFree (maxSlpg) = if ((0 > maxSlpg))
12961304 then throw("Wrong slpg")
12971305 else if ((size(i.payments) != 2))
12981306 then throw("2 pmnts expd")
12991307 else {
13001308 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, "")
13011309 let state = estPut._9
13021310 let amAssetPmt = toBigInt(value(i.payments[0]).amount)
13031311 let prAssetPmt = toBigInt(value(i.payments[1]).amount)
13041312 let currentDLp = calcCurrentDLp(amAssetPmt, prAssetPmt, toBigInt(0))
13051313 if ((currentDLp == currentDLp))
13061314 then {
1307- let $t04684446909 = refreshDLpInternal(0, 0, 0)
1308- let refreshDLpActions = $t04684446909._1
1309- let updatedDLp = $t04684446909._2
1315+ let $t04696047025 = refreshDLpInternal(0, 0, 0)
1316+ let refreshDLpActions = $t04696047025._1
1317+ let updatedDLp = $t04696047025._2
13101318 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
13111319 if ((isUpdatedDLpValid == isUpdatedDLpValid))
13121320 then (state ++ refreshDLpActions)
13131321 else throw("Strict value is not equal to itself.")
13141322 }
13151323 else throw("Strict value is not equal to itself.")
13161324 }
13171325
13181326
13191327
13201328 @Callable(i)
13211329 func get () = {
13221330 let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(0))
13231331 if ((currentDLp == currentDLp))
13241332 then {
13251333 let r = cg(i)
13261334 let outAmtAmt = r._1
13271335 let outPrAmt = r._2
13281336 let pmtAmt = r._3
13291337 let pmtAssetId = r._4
13301338 let state = r._5
13311339 let b = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
13321340 if ((b == b))
13331341 then {
1334- let $t04808248164 = refreshDLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1335- let refreshDLpActions = $t04808248164._1
1336- let updatedDLp = $t04808248164._2
1342+ let $t04819848280 = refreshDLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1343+ let refreshDLpActions = $t04819848280._1
1344+ let updatedDLp = $t04819848280._2
13371345 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
13381346 if ((isUpdatedDLpValid == isUpdatedDLpValid))
13391347 then (state ++ refreshDLpActions)
13401348 else throw("Strict value is not equal to itself.")
13411349 }
13421350 else throw("Strict value is not equal to itself.")
13431351 }
13441352 else throw("Strict value is not equal to itself.")
13451353 }
13461354
13471355
13481356
13491357 @Callable(i)
13501358 func getOneTknV2 (outAssetId,minOutAmount) = {
13511359 let isPoolOneTokenOperationsDisabled = {
13521360 let @ = invoke(fca, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
13531361 if ($isInstanceOf(@, "Boolean"))
13541362 then @
13551363 else throw(($getType(@) + " couldn't be cast to Boolean"))
13561364 }
13571365 let isGetDisabled = if (if (igs())
13581366 then true
13591367 else (cfgPoolStatus == PoolShutdown))
13601368 then true
13611369 else isPoolOneTokenOperationsDisabled
13621370 let checks = [if (if (!(isGetDisabled))
13631371 then true
13641372 else isManager(i))
13651373 then true
13661374 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1))
13671375 then true
13681376 else throwErr("exactly 1 payment are expected")]
13691377 if ((checks == checks))
13701378 then {
1371- let $t04878248937 = getOneTknV2Internal(outAssetId, minOutAmount, i.payments, i.caller, i.originCaller, i.transactionId)
1372- let state = $t04878248937._1
1373- let totalAmount = $t04878248937._2
1379+ let $t04889849053 = getOneTknV2Internal(outAssetId, minOutAmount, i.payments, i.caller, i.originCaller, i.transactionId)
1380+ let state = $t04889849053._1
1381+ let totalAmount = $t04889849053._2
13741382 $Tuple2(state, totalAmount)
13751383 }
13761384 else throw("Strict value is not equal to itself.")
13771385 }
13781386
13791387
13801388
13811389 @Callable(i)
13821390 func refreshDLp () = {
13831391 let lastRefreshedBlockHeight = valueOrElse(getInteger(keyDLpRefreshedHeight), 0)
13841392 let checkLastRefreshedBlockHeight = if (((height - lastRefreshedBlockHeight) >= dLpRefreshDelay))
13851393 then unit
13861394 else throwErr(makeString([toString(dLpRefreshDelay), " blocks have not passed since the previous call"], ""))
13871395 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
13881396 then {
13891397 let dLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyDLp), "0")), fmtErr("invalid dLp"))
1390- let $t04946149525 = refreshDLpInternal(0, 0, 0)
1391- let dLpUpdateActions = $t04946149525._1
1392- let updatedDLp = $t04946149525._2
1398+ let $t04957749641 = refreshDLpInternal(0, 0, 0)
1399+ let dLpUpdateActions = $t04957749641._1
1400+ let updatedDLp = $t04957749641._2
13931401 let actions = if ((dLp != updatedDLp))
13941402 then dLpUpdateActions
13951403 else throwErr("nothing to refresh")
13961404 $Tuple2(actions, toString(updatedDLp))
13971405 }
13981406 else throw("Strict value is not equal to itself.")
13991407 }
14001408
14011409
14021410
14031411 @Callable(i)
14041412 func getOneTknV2READONLY (outAssetId,lpAssetAmount) = {
14051413 let amId = toBase58String(value(cfgAmountAssetId))
14061414 let prId = toBase58String(value(cfgPriceAssetId))
14071415 let lpId = toBase58String(value(cfgLpAssetId))
14081416 let xp = [toBigInt(getAccBalance(amId)), toBigInt(getAccBalance(prId))]
14091417 let lpEmission = toBigInt(valueOrErrorMessage(assetInfo(fromBase58String(lpId)), "invalid lp asset").quantity)
14101418 let D0 = getD(xp)
14111419 let D1 = (D0 - fraction(toBigInt(lpAssetAmount), D0, lpEmission))
14121420 let index = if ((outAssetId == amId))
14131421 then 0
14141422 else if ((outAssetId == prId))
14151423 then 1
14161424 else throw("invalid out asset id")
14171425 let newY = getYD(xp, index, D1)
14181426 let dy = (xp[index] - newY)
14191427 let totalGetRaw = max([0, toInt((dy - big1))])
1420- let $t05053550590 = takeFee(totalGetRaw, outFee)
1421- let totalGet = $t05053550590._1
1422- let feeAmount = $t05053550590._2
1428+ let $t05065150706 = takeFee(totalGetRaw, outFee)
1429+ let totalGet = $t05065150706._1
1430+ let feeAmount = $t05065150706._2
14231431 $Tuple2(nil, $Tuple2(totalGet, feeAmount))
14241432 }
14251433
14261434
14271435
14281436 @Callable(i)
14291437 func getOneTknV2WithBonusREADONLY (outAssetId,lpAssetAmount) = {
14301438 let amId = toBase58String(value(cfgAmountAssetId))
14311439 let prId = toBase58String(value(cfgPriceAssetId))
14321440 let lpId = toBase58String(value(cfgLpAssetId))
14331441 let amBalance = getAccBalance(amId)
14341442 let prBalance = getAccBalance(prId)
1435- let $t05096551080 = {
1443+ let $t05108151196 = {
14361444 let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, lpAssetAmount], nil)
14371445 if ($isInstanceOf(@, "(Int, Int)"))
14381446 then @
14391447 else throw(($getType(@) + " couldn't be cast to (Int, Int)"))
14401448 }
1441- let totalGet = $t05096551080._1
1442- let feeAmount = $t05096551080._2
1449+ let totalGet = $t05108151196._1
1450+ let feeAmount = $t05108151196._2
14431451 let r = ego("", lpId, lpAssetAmount, this)
14441452 let outAmAmt = r._1
14451453 let outPrAmt = r._2
14461454 let sumOfGetAssets = (outAmAmt + outPrAmt)
14471455 let bonus = if ((sumOfGetAssets == 0))
14481456 then if ((totalGet == 0))
14491457 then 0
14501458 else throw("bonus calculation error")
14511459 else fraction((totalGet - sumOfGetAssets), scale8, sumOfGetAssets)
14521460 $Tuple2(nil, $Tuple3(totalGet, feeAmount, bonus))
14531461 }
14541462
14551463
14561464
14571465 @Callable(i)
14581466 func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = {
14591467 let r = cg(i)
14601468 let outAmAmt = r._1
14611469 let outPrAmt = r._2
14621470 let pmtAmt = r._3
14631471 let pmtAssetId = r._4
14641472 let state = r._5
14651473 if ((noLessThenAmtAsset > outAmAmt))
14661474 then throw(((("Failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset)))
14671475 else if ((noLessThenPriceAsset > outPrAmt))
14681476 then throw(((("Failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset)))
14691477 else {
14701478 let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(0))
14711479 if ((currentDLp == currentDLp))
14721480 then {
14731481 let burnLPAssetOnFactory = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
14741482 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
14751483 then {
1476- let $t05224652327 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1477- let refreshDLpActions = $t05224652327._1
1478- let updatedDLp = $t05224652327._2
1484+ let $t05236252443 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1485+ let refreshDLpActions = $t05236252443._1
1486+ let updatedDLp = $t05236252443._2
14791487 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
14801488 if ((isUpdatedDLpValid == isUpdatedDLpValid))
14811489 then (state ++ refreshDLpActions)
14821490 else throw("Strict value is not equal to itself.")
14831491 }
14841492 else throw("Strict value is not equal to itself.")
14851493 }
14861494 else throw("Strict value is not equal to itself.")
14871495 }
14881496 }
14891497
14901498
14911499
14921500 @Callable(i)
14931501 func unstakeAndGet (amount) = {
14941502 let checkPayments = if ((size(i.payments) != 0))
14951503 then throw("No pmnts expd")
14961504 else true
14971505 if ((checkPayments == checkPayments))
14981506 then {
14991507 let factoryCfg = gfc()
15001508 let lpAssetId = cfgLpAssetId
15011509 let staking = valueOrErrorMessage(addressFromString(factoryCfg[idxFactStakCntr]), "Wr st addr")
15021510 let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(0))
15031511 if ((currentDLp == currentDLp))
15041512 then {
15051513 let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), amount], nil)
15061514 if ((unstakeInv == unstakeInv))
15071515 then {
15081516 let r = ego(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller)
15091517 let outAmAmt = r._1
15101518 let outPrAmt = r._2
15111519 let sts = parseIntValue(r._9)
15121520 let state = r._10
15131521 let v = if (if (igs())
15141522 then true
15151523 else (sts == PoolShutdown))
15161524 then throw(("Blocked: " + toString(sts)))
15171525 else true
15181526 if ((v == v))
15191527 then {
15201528 let burnA = invoke(fca, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
15211529 if ((burnA == burnA))
15221530 then {
1523- let $t05335453435 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1524- let refreshDLpActions = $t05335453435._1
1525- let updatedDLp = $t05335453435._2
1531+ let $t05347053551 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1532+ let refreshDLpActions = $t05347053551._1
1533+ let updatedDLp = $t05347053551._2
15261534 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
15271535 if ((isUpdatedDLpValid == isUpdatedDLpValid))
15281536 then (state ++ refreshDLpActions)
15291537 else throw("Strict value is not equal to itself.")
15301538 }
15311539 else throw("Strict value is not equal to itself.")
15321540 }
15331541 else throw("Strict value is not equal to itself.")
15341542 }
15351543 else throw("Strict value is not equal to itself.")
15361544 }
15371545 else throw("Strict value is not equal to itself.")
15381546 }
15391547 else throw("Strict value is not equal to itself.")
15401548 }
15411549
15421550
15431551
15441552 @Callable(i)
15451553 func unstakeAndGetNoLess (unstakeAmount,noLessThenAmountAsset,noLessThenPriceAsset) = {
15461554 let isGetDisabled = if (igs())
15471555 then true
15481556 else (cfgPoolStatus == PoolShutdown)
15491557 let checks = [if (!(isGetDisabled))
15501558 then true
15511559 else throw("get operation is blocked by admin"), if ((size(i.payments) == 0))
15521560 then true
15531561 else throw("no payments are expected")]
15541562 if ((checks == checks))
15551563 then {
15561564 let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(0))
15571565 if ((currentDLp == currentDLp))
15581566 then {
15591567 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
15601568 if ((unstakeInv == unstakeInv))
15611569 then {
15621570 let res = ego(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller)
15631571 let outAmAmt = res._1
15641572 let outPrAmt = res._2
15651573 let state = res._10
15661574 let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset))
15671575 then true
15681576 else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset))
15691577 then true
15701578 else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))]
15711579 if ((checkAmounts == checkAmounts))
15721580 then {
15731581 let burnLPAssetOnFactory = invoke(fca, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
15741582 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
15751583 then {
1576- let $t05468654767 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1577- let refreshDLpActions = $t05468654767._1
1578- let updatedDLp = $t05468654767._2
1584+ let $t05480254883 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1585+ let refreshDLpActions = $t05480254883._1
1586+ let updatedDLp = $t05480254883._2
15791587 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
15801588 if ((isUpdatedDLpValid == isUpdatedDLpValid))
15811589 then (state ++ refreshDLpActions)
15821590 else throw("Strict value is not equal to itself.")
15831591 }
15841592 else throw("Strict value is not equal to itself.")
15851593 }
15861594 else throw("Strict value is not equal to itself.")
15871595 }
15881596 else throw("Strict value is not equal to itself.")
15891597 }
15901598 else throw("Strict value is not equal to itself.")
15911599 }
15921600 else throw("Strict value is not equal to itself.")
15931601 }
15941602
15951603
15961604
15971605 @Callable(i)
15981606 func unstakeAndGetOneTknV2 (unstakeAmount,outAssetId,minOutAmount) = {
15991607 let isPoolOneTokenOperationsDisabled = {
16001608 let @ = invoke(fca, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
16011609 if ($isInstanceOf(@, "Boolean"))
16021610 then @
16031611 else throw(($getType(@) + " couldn't be cast to Boolean"))
16041612 }
16051613 let isGetDisabled = if (if (igs())
16061614 then true
16071615 else (cfgPoolStatus == PoolShutdown))
16081616 then true
16091617 else isPoolOneTokenOperationsDisabled
16101618 let checks = [if (if (!(isGetDisabled))
16111619 then true
16121620 else isManager(i))
16131621 then true
16141622 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 0))
16151623 then true
16161624 else throwErr("no payments are expected")]
16171625 if ((checks == checks))
16181626 then {
16191627 let factoryCfg = gfc()
16201628 let lpAssetId = cfgLpAssetId
16211629 let staking = valueOrErrorMessage(addressFromString(factoryCfg[idxFactStakCntr]), "Wr st addr")
16221630 let userAddress = i.caller
16231631 let lpAssetRecipientAddress = this
16241632 let unstakeInv = invoke(staking, "unstakeINTERNAL", [lpAssetId, unstakeAmount, userAddress.bytes, lpAssetRecipientAddress.bytes], nil)
16251633 if ((unstakeInv == unstakeInv))
16261634 then {
1627- let $t05578955977 = getOneTknV2Internal(outAssetId, minOutAmount, [AttachedPayment(lpAssetId, unstakeAmount)], i.caller, i.originCaller, i.transactionId)
1628- let state = $t05578955977._1
1629- let totalAmount = $t05578955977._2
1635+ let $t05590556093 = getOneTknV2Internal(outAssetId, minOutAmount, [AttachedPayment(lpAssetId, unstakeAmount)], i.caller, i.originCaller, i.transactionId)
1636+ let state = $t05590556093._1
1637+ let totalAmount = $t05590556093._2
16301638 $Tuple2(state, totalAmount)
16311639 }
16321640 else throw("Strict value is not equal to itself.")
16331641 }
16341642 else throw("Strict value is not equal to itself.")
16351643 }
16361644
16371645
16381646
16391647 @Callable(i)
16401648 func putOneTknV2WithBonusREADONLY (paymentAmountRaw,paymentAssetId) = {
1641- let $t05610556208 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", true)
1642- let lpAmount = $t05610556208._1
1643- let state = $t05610556208._2
1644- let feeAmount = $t05610556208._3
1645- let bonus = $t05610556208._4
1649+ let $t05622156324 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", true)
1650+ let lpAmount = $t05622156324._1
1651+ let state = $t05622156324._2
1652+ let feeAmount = $t05622156324._3
1653+ let bonus = $t05622156324._4
16461654 $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus))
16471655 }
16481656
16491657
16501658
16511659 @Callable(i)
16521660 func putOneTknV2WithoutTakeFeeREADONLY (paymentAmountRaw,paymentAssetId) = {
1653- let $t05635656460 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", false)
1654- let lpAmount = $t05635656460._1
1655- let state = $t05635656460._2
1656- let feeAmount = $t05635656460._3
1657- let bonus = $t05635656460._4
1661+ let $t05647256576 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", false)
1662+ let lpAmount = $t05647256576._1
1663+ let state = $t05647256576._2
1664+ let feeAmount = $t05647256576._3
1665+ let bonus = $t05647256576._4
16581666 $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus))
16591667 }
16601668
16611669
16621670
16631671 @Callable(i)
16641672 func activate (amtAsStr,prAsStr) = if ((toString(i.caller) != toString(fca)))
16651673 then throw("denied")
1666- else $Tuple2([StringEntry(aa(), amtAsStr), StringEntry(pa(), prAsStr)], "success")
1674+ else $Tuple2([StringEntry(aa(), amtAsStr), StringEntry(pa(), prAsStr), StringEntry(amp(), toString(ampInitial)), StringEntry(keyAmpHistory(height), toString(ampInitial))], "success")
16671675
16681676
16691677
16701678 @Callable(i)
16711679 func getPoolConfigWrapperREADONLY () = $Tuple2(nil, gpc())
16721680
16731681
16741682
16751683 @Callable(i)
16761684 func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId))
16771685
16781686
16791687
16801688 @Callable(i)
16811689 func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = {
16821690 let pr = calcPrices(amAmt, prAmt, lpAmt)
16831691 $Tuple2(nil, [toString(pr[0]), toString(pr[1]), toString(pr[2])])
16841692 }
16851693
16861694
16871695
16881696 @Callable(i)
16891697 func fromX18WrapperREADONLY (val,resScaleMult) = $Tuple2(nil, f1(parseBigIntValue(val), resScaleMult))
16901698
16911699
16921700
16931701 @Callable(i)
16941702 func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(t1(origVal, origScaleMult)))
16951703
16961704
16971705
16981706 @Callable(i)
16991707 func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(cpbi(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18))))
17001708
17011709
17021710
17031711 @Callable(i)
17041712 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, ""))
17051713
17061714
17071715
17081716 @Callable(i)
17091717 func estimateGetOperationWrapperREADONLY (txId58,pmtAsId,pmtLpAmt,usrAddr) = {
17101718 let r = ego(txId58, pmtAsId, pmtLpAmt, addressFromStringValue(usrAddr))
17111719 $Tuple2(nil, $Tuple10(r._1, r._2, r._3, r._4, r._5, r._6, r._7, toString(r._8), r._9, r._10))
17121720 }
17131721
17141722
17151723
17161724 @Callable(i)
17171725 func changeAmp () = {
1718- let fcaInv = invoke(fca, "changeAmp", [toString(this)], nil)
1719- if ((fcaInv == fcaInv))
1720- then nil
1726+ let cfg = invoke(fca, "getChangeAmpConfigREADONLY", [toString(this)], nil)
1727+ let $t05905659255 = match cfg {
1728+ case list: List[Any] =>
1729+ $Tuple3({
1730+ let @ = list[0]
1731+ if ($isInstanceOf(@, "Int"))
1732+ then @
1733+ else throw(($getType(@) + " couldn't be cast to Int"))
1734+ }, {
1735+ let @ = list[1]
1736+ if ($isInstanceOf(@, "Int"))
1737+ then @
1738+ else throw(($getType(@) + " couldn't be cast to Int"))
1739+ }, {
1740+ let @ = list[2]
1741+ if ($isInstanceOf(@, "Int"))
1742+ then @
1743+ else throw(($getType(@) + " couldn't be cast to Int"))
1744+ })
1745+ case _ =>
1746+ throwErr("invalid entry type")
1747+ }
1748+ let delay = $t05905659255._1
1749+ let delta = $t05905659255._2
1750+ let target = $t05905659255._3
1751+ let curAmp = parseIntValue(getStringValue(amp()))
1752+ let newAmpRaw = (curAmp + delta)
1753+ let newAmp = if ((0 > delta))
1754+ then if ((target > newAmpRaw))
1755+ then target
1756+ else newAmpRaw
1757+ else if ((newAmpRaw > target))
1758+ then target
1759+ else newAmpRaw
1760+ let lastCall = valueOrElse(getInteger(keyChangeAmpLastCall()), 0)
1761+ let wait = (lastCall + delay)
1762+ let checks = [if ((height > wait))
1763+ then true
1764+ else throwErr("try again in few blocks"), if ((curAmp != newAmp))
1765+ then true
1766+ else throwErr("already reached target")]
1767+ if ((checks == checks))
1768+ then [IntegerEntry(keyChangeAmpLastCall(), height), StringEntry(amp(), toString(newAmp)), StringEntry(keyAmpHistory(height), toString(newAmp))]
17211769 else throw("Strict value is not equal to itself.")
17221770 }
17231771
17241772
17251773 @Verifier(tx)
17261774 func verify () = {
17271775 let targetPublicKey = match managerPublicKeyOrUnit() {
17281776 case pk: ByteVector =>
17291777 pk
17301778 case _: Unit =>
17311779 tx.senderPublicKey
17321780 case _ =>
17331781 throw("Match error")
17341782 }
17351783 match tx {
17361784 case order: Order =>
17371785 let matcherPub = mp()
1738- let $t05904859165 = if (skipOrderValidation())
1786+ let $t06018860305 = if (skipOrderValidation())
17391787 then $Tuple2(true, "")
17401788 else validateMatcherOrderAllowed(order)
1741- let orderValid = $t05904859165._1
1742- let orderValidInfo = $t05904859165._2
1789+ let orderValid = $t06018860305._1
1790+ let orderValidInfo = $t06018860305._2
17431791 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
17441792 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
17451793 if (if (if (orderValid)
17461794 then senderValid
17471795 else false)
17481796 then matcherValid
17491797 else false)
17501798 then true
17511799 else throwOrderError(orderValid, orderValidInfo, senderValid, matcherValid)
17521800 case s: SetScriptTransaction =>
17531801 if (sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey))
17541802 then true
17551803 else {
17561804 let newHash = blake2b256(value(s.script))
17571805 let allowedHash = fromBase64String(value(getString(fca, keyAllowedLpStableScriptHash())))
17581806 let currentHash = scriptHash(this)
17591807 if ((allowedHash == newHash))
17601808 then (currentHash != newHash)
17611809 else false
17621810 }
17631811 case _ =>
17641812 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
17651813 }
17661814 }
17671815

github/deemru/w8io/026f985 
253.39 ms