tx · 78MdKB3tdPXmciaxeiJdfZF2x4Un5WqfApqB1MthVkfD

3N5K5VzfGVL95ab63CZZFRjbqTpXv7V3nYS:  -0.03500000 Waves

2022.12.07 12:08 [2349724] smart account 3N5K5VzfGVL95ab63CZZFRjbqTpXv7V3nYS > SELF 0.00000000 Waves

{ "type": 13, "id": "78MdKB3tdPXmciaxeiJdfZF2x4Un5WqfApqB1MthVkfD", "fee": 3500000, "feeAssetId": null, "timestamp": 1670404012181, "version": 1, "sender": "3N5K5VzfGVL95ab63CZZFRjbqTpXv7V3nYS", "senderPublicKey": "H9GMW1X9VyRrHRgoAEDZ9qBa6aMQUri2tWGovf8ozTQC", "proofs": [ "4vgzFdm5iUVWNAfry8M9z9oX2FzusgFZ4d4m5sYzCAqRGxevrg3WmTqekLgmrXMAJJc7dt3Crn9e7u1DXjrCJVaf" ], "script": "base64:BgLfLAgCEgMKAQgSABIECgIBBBIDCgEBEgQKAgEEEgQKAggBEgQKAggBEgQKAggBEgUKAwEIARIAEgQKAgEBEgMKAQESBQoDAQEBEgQKAggIEgASABIDCgEIEgUKAwEBARIECgIBARIECgIIARIECgIICBILCgkIAQECAQIIBAQSBgoECAgBCBIAEgMKAQESAwoBARIECgIIASIKbFBkZWNpbWFscyIGc2NhbGU4IgxzY2FsZThCaWdJbnQiB3NjYWxlMTgiCnplcm9CaWdJbnQiBGJpZzAiBGJpZzEiBGJpZzIiC3dhdmVzU3RyaW5nIgNTRVAiClBvb2xBY3RpdmUiD1Bvb2xQdXREaXNhYmxlZCITUG9vbE1hdGNoZXJEaXNhYmxlZCIMUG9vbFNodXRkb3duIg5pZHhQb29sQWRkcmVzcyINaWR4UG9vbFN0YXR1cyIQaWR4UG9vbExQQXNzZXRJZCINaWR4QW10QXNzZXRJZCIPaWR4UHJpY2VBc3NldElkIg5pZHhBbXRBc3NldERjbSIQaWR4UHJpY2VBc3NldERjbSIOaWR4SUFtdEFzc2V0SWQiEGlkeElQcmljZUFzc2V0SWQiDWlkeExQQXN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UCYUEHBQJhQgcGCQECYXkDBQJhegUCYUEFAmFCAwkAAQIFAmRLAhRTZXRTY3JpcHRUcmFuc2FjdGlvbgQCZU4FAmRLBAJnQwkA9gMBCQEFdmFsdWUBCAUCZU4Gc2NyaXB0BAJnRAkA2wQBCQEFdmFsdWUBCQCdCAIFAmFKCQECYXcABAJnRQkA8QcBBQR0aGlzAwMJAAACBQJnRAUCZ0MJAQIhPQIFAmdFBQJnQwcGCQD0AwMIBQJneQlib2R5Qnl0ZXMJAJEDAggFAmd5BnByb29mcwAABQJnQQkA9AMDCAUCZ3kJYm9keUJ5dGVzCQCRAwIIBQJneQZwcm9vZnMAAAUCZ0FYfdnL", "chainId": 84, "height": 2349724, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2udCXgtnHqa7LNw5QesS6SSn2mXwqnPz1RwqTqrjibUf Next: HGQXeRHi4q5uxzRyHkjScxBfUJcKMdTyLZz9wJNc7KyA Diff:
OldNewDifferences
375375
376376 func calcKLp (amountBalance,priceBalance,lpEmission) = {
377377 let updatedKLp = fraction(pow((amountBalance * priceBalance), 0, toBigInt(5), 1, 18, DOWN), big1, lpEmission)
378- updatedKLp
378+ if ((lpEmission == big0))
379+ then big0
380+ else updatedKLp
379381 }
380382
381383
406408 func validateMatcherOrderAllowed (order) = {
407409 let amountAssetAmount = order.amount
408410 let priceAssetAmount = fraction(order.amount, order.price, scale8, FLOOR)
409- let $t02030220514 = if ((order.orderType == Buy))
411+ let $t02034120553 = if ((order.orderType == Buy))
410412 then $Tuple2(amountAssetAmount, -(priceAssetAmount))
411413 else $Tuple2(-(amountAssetAmount), priceAssetAmount)
412- let amountAssetBalanceDelta = $t02030220514._1
413- let priceAssetBalanceDelta = $t02030220514._2
414+ let amountAssetBalanceDelta = $t02034120553._1
415+ let priceAssetBalanceDelta = $t02034120553._2
414416 if (if (if (isGlobalShutdown())
415417 then true
416418 else (cfgPoolStatus == PoolMatcherDisabled))
423425 then throw("Wrong order assets.")
424426 else {
425427 let kLp = valueOrErrorMessage(parseBigInt(valueOrErrorMessage(getString(this, keyKLp), fmtErr("kLp is required"))), fmtErr("invalid kLp"))
426- let $t02098521085 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
427- let unusedActions = $t02098521085._1
428- let kLpNew = $t02098521085._2
428+ let $t02102421124 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
429+ let unusedActions = $t02102421124._1
430+ let kLpNew = $t02102421124._2
429431 let isOrderValid = (kLpNew >= kLp)
430432 isOrderValid
431433 }
501503 else if ((paymentAssetId == cfgPriceAssetId))
502504 then false
503505 else throwErr("invalid asset")
504- let $t02377024063 = if (isEval)
506+ let $t02380924102 = if (isEval)
505507 then $Tuple2(amountBalanceRaw, priceBalanceRaw)
506508 else if (paymentInAmountAsset)
507509 then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw)
508510 else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw))
509- let amountBalanceOld = $t02377024063._1
510- let priceBalanceOld = $t02377024063._2
511- let $t02406724216 = if (paymentInAmountAsset)
511+ let amountBalanceOld = $t02380924102._1
512+ let priceBalanceOld = $t02380924102._2
513+ let $t02410624255 = if (paymentInAmountAsset)
512514 then $Tuple2(paymentAmountRaw, 0)
513515 else $Tuple2(0, paymentAmountRaw)
514- let amountAssetAmountRaw = $t02406724216._1
515- let priceAssetAmountRaw = $t02406724216._2
516+ let amountAssetAmountRaw = $t02410624255._1
517+ let priceAssetAmountRaw = $t02410624255._2
516518 let amountAssetAmount = takeFee(amountAssetAmountRaw)._1
517519 let priceAssetAmount = takeFee(priceAssetAmountRaw)._1
518- let $t02433824397 = takeFee(paymentAmountRaw)
519- let paymentAmount = $t02433824397._1
520- let feeAmount = $t02433824397._2
520+ let $t02437724436 = takeFee(paymentAmountRaw)
521+ let paymentAmount = $t02437724436._1
522+ let feeAmount = $t02437724436._2
521523 let amountBalanceNew = (amountBalanceOld + amountAssetAmount)
522524 let priceBalanceNew = (priceBalanceOld + priceAssetAmount)
523525 let priceNewX18 = calcPriceBigInt(toX18(priceBalanceNew, cfgPriceAssetDecimals), toX18(amountBalanceNew, cfgAmountAssetDecimals))
540542 let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, cfgPriceAssetDecimals), toX18(amountBalanceOld, cfgAmountAssetDecimals))
541543 let priceOld = fromX18(priceOldX18, scale8)
542544 let loss = {
543- let $t02587426041 = if (paymentInAmountAsset)
545+ let $t02591326080 = if (paymentInAmountAsset)
544546 then $Tuple2(amountAssetAmountRaw, amountBalanceOld)
545547 else $Tuple2(priceAssetAmountRaw, priceBalanceOld)
546- let amount = $t02587426041._1
547- let balance = $t02587426041._2
548+ let amount = $t02591326080._1
549+ let balance = $t02591326080._2
548550 let issueAmountBoth = toInt(fraction(supplyBigInt, toBigInt((amount / 2)), toBigInt(balance)))
549551 fraction((issueAmount - issueAmountBoth), scale8, issueAmountBoth)
550552 }
578580 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
579581 let redeemedBigInt = toBigInt(paymentAmount)
580582 let amountRaw = max([0, toInt(((balanceBigInt * (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN))) / scale18))])
581- let $t02764327693 = takeFee(amountRaw)
582- let totalAmount = $t02764327693._1
583- let feeAmount = $t02764327693._2
584- let $t02769727923 = if (outInAmountAsset)
583+ let $t02768227732 = takeFee(amountRaw)
584+ let totalAmount = $t02768227732._1
585+ let feeAmount = $t02768227732._2
586+ let $t02773627962 = if (outInAmountAsset)
585587 then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld)
586588 else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw))
587- let outAmAmount = $t02769727923._1
588- let outPrAmount = $t02769727923._2
589- let amBalanceNew = $t02769727923._3
590- let prBalanceNew = $t02769727923._4
589+ let outAmAmount = $t02773627962._1
590+ let outPrAmount = $t02773627962._2
591+ let amBalanceNew = $t02773627962._3
592+ let prBalanceNew = $t02773627962._4
591593 let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, cfgPriceAssetDecimals), toX18(amBalanceNew, cfgAmountAssetDecimals))
592594 let priceNew = fromX18(priceNewX18, scale8)
593595 let commonState = if (isEval)
733735 else throw("Strict value is not equal to itself.")
734736 }
735737 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
736- let $t03207532140 = refreshKLpInternal(0, 0, 0)
737- let refreshKLpActions = $t03207532140._1
738- let updatedKLp = $t03207532140._2
738+ let $t03211432179 = refreshKLpInternal(0, 0, 0)
739+ let refreshKLpActions = $t03211432179._1
740+ let updatedKLp = $t03211432179._2
739741 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
740742 if ((isUpdatedKLpValid == isUpdatedKLpValid))
741743 then ((state ++ lpTransfer) ++ refreshKLpActions)
765767 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
766768 if ((currentKLp == currentKLp))
767769 then {
768- let $t03270232767 = refreshKLpInternal(0, 0, 0)
769- let refreshKLpActions = $t03270232767._1
770- let updatedKLp = $t03270232767._2
770+ let $t03274132806 = refreshKLpInternal(0, 0, 0)
771+ let refreshKLpActions = $t03274132806._1
772+ let updatedKLp = $t03274132806._2
771773 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
772774 if ((isUpdatedKLpValid == isUpdatedKLpValid))
773775 then (state ++ refreshKLpActions)
812814 else throwErr("payment asset is not supported")
813815 let userAddress = i.caller
814816 let txId = i.transactionId
815- let $t03395234104 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
816- if (($t03395234104 == $t03395234104))
817+ let $t03399134143 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
818+ if (($t03399134143 == $t03399134143))
817819 then {
818- let paymentInAmountAsset = $t03395234104._5
819- let bonus = $t03395234104._4
820- let feeAmount = $t03395234104._3
821- let commonState = $t03395234104._2
822- let emitAmountEstimated = $t03395234104._1
820+ let paymentInAmountAsset = $t03399134143._5
821+ let bonus = $t03399134143._4
822+ let feeAmount = $t03399134143._3
823+ let commonState = $t03399134143._2
824+ let emitAmountEstimated = $t03399134143._1
823825 let emitAmount = if (if ((minOutAmount > 0))
824826 then (minOutAmount > emitAmountEstimated)
825827 else false)
839841 let sendFee = if ((feeAmount > 0))
840842 then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
841843 else nil
842- let $t03469034887 = if ((this == feeCollectorAddress))
844+ let $t03472934926 = if ((this == feeCollectorAddress))
843845 then $Tuple2(0, 0)
844846 else if (paymentInAmountAsset)
845847 then $Tuple2(-(feeAmount), 0)
846848 else $Tuple2(0, -(feeAmount))
847- let amountAssetBalanceDelta = $t03469034887._1
848- let priceAssetBalanceDelta = $t03469034887._2
849- let $t03489034998 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
850- let refreshKLpActions = $t03489034998._1
851- let updatedKLp = $t03489034998._2
849+ let amountAssetBalanceDelta = $t03472934926._1
850+ let priceAssetBalanceDelta = $t03472934926._2
851+ let $t03492935037 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
852+ let refreshKLpActions = $t03492935037._1
853+ let updatedKLp = $t03492935037._2
852854 let kLp = value(getString(keyKLp))
853855 let error = throwErr(makeString([toString(amountAssetBalanceDelta), toString(priceAssetBalanceDelta), kLp, toString(currentKLp), toString(updatedKLp)], " "))
854856 if ((error == error))
871873
872874 @Callable(i)
873875 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
874- let $t03549635653 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
875- let emitAmountEstimated = $t03549635653._1
876- let commonState = $t03549635653._2
877- let feeAmount = $t03549635653._3
878- let bonus = $t03549635653._4
879- let paymentInAmountAsset = $t03549635653._5
876+ let $t03553535692 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
877+ let emitAmountEstimated = $t03553535692._1
878+ let commonState = $t03553535692._2
879+ let feeAmount = $t03553535692._3
880+ let bonus = $t03553535692._4
881+ let paymentInAmountAsset = $t03553535692._5
880882 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
881883 }
882884
911913 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(paymentAmount))
912914 let userAddress = i.caller
913915 let txId = i.transactionId
914- let $t03654736700 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
915- if (($t03654736700 == $t03654736700))
916+ let $t03658636739 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
917+ if (($t03658636739 == $t03658636739))
916918 then {
917- let outInAmountAsset = $t03654736700._5
918- let bonus = $t03654736700._4
919- let feeAmount = $t03654736700._3
920- let commonState = $t03654736700._2
921- let amountEstimated = $t03654736700._1
919+ let outInAmountAsset = $t03658636739._5
920+ let bonus = $t03658636739._4
921+ let feeAmount = $t03658636739._3
922+ let commonState = $t03658636739._2
923+ let amountEstimated = $t03658636739._1
922924 let amount = if (if ((minOutAmount > 0))
923925 then (minOutAmount > amountEstimated)
924926 else false)
931933 let sendFee = if ((feeAmount > 0))
932934 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
933935 else nil
934- let $t03720037447 = {
936+ let $t03723937486 = {
935937 let feeAmountForCalc = if ((this == feeCollectorAddress))
936938 then 0
937939 else feeAmount
939941 then $Tuple2(-((amount + feeAmountForCalc)), 0)
940942 else $Tuple2(0, -((amount + feeAmountForCalc)))
941943 }
942- let amountAssetBalanceDelta = $t03720037447._1
943- let priceAssetBalanceDelta = $t03720037447._2
944- let $t03745037558 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
945- let refreshKLpActions = $t03745037558._1
946- let updatedKLp = $t03745037558._2
944+ let amountAssetBalanceDelta = $t03723937486._1
945+ let priceAssetBalanceDelta = $t03723937486._2
946+ let $t03748937597 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
947+ let refreshKLpActions = $t03748937597._1
948+ let updatedKLp = $t03748937597._2
947949 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
948950 if ((isUpdatedKLpValid == isUpdatedKLpValid))
949951 then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
960962
961963 @Callable(i)
962964 func getOneTknREADONLY (outAssetId,paymentAmount) = {
963- let $t03781537971 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
964- let amountEstimated = $t03781537971._1
965- let commonState = $t03781537971._2
966- let feeAmount = $t03781537971._3
967- let bonus = $t03781537971._4
968- let outInAmountAsset = $t03781537971._5
965+ let $t03785438010 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
966+ let amountEstimated = $t03785438010._1
967+ let commonState = $t03785438010._2
968+ let feeAmount = $t03785438010._3
969+ let bonus = $t03785438010._4
970+ let outInAmountAsset = $t03785438010._5
969971 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
970972 }
971973
10001002 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
10011003 if ((unstakeInv == unstakeInv))
10021004 then {
1003- let $t03887339024 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1004- if (($t03887339024 == $t03887339024))
1005+ let $t03891239063 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1006+ if (($t03891239063 == $t03891239063))
10051007 then {
1006- let outInAmountAsset = $t03887339024._5
1007- let bonus = $t03887339024._4
1008- let feeAmount = $t03887339024._3
1009- let commonState = $t03887339024._2
1010- let amountEstimated = $t03887339024._1
1008+ let outInAmountAsset = $t03891239063._5
1009+ let bonus = $t03891239063._4
1010+ let feeAmount = $t03891239063._3
1011+ let commonState = $t03891239063._2
1012+ let amountEstimated = $t03891239063._1
10111013 let amount = if (if ((minOutAmount > 0))
10121014 then (minOutAmount > amountEstimated)
10131015 else false)
10201022 let sendFee = if ((feeAmount > 0))
10211023 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
10221024 else nil
1023- let $t03951939766 = {
1025+ let $t03955839805 = {
10241026 let feeAmountForCalc = if ((this == feeCollectorAddress))
10251027 then 0
10261028 else feeAmount
10281030 then $Tuple2(-((amount + feeAmountForCalc)), 0)
10291031 else $Tuple2(0, -((amount + feeAmountForCalc)))
10301032 }
1031- let amountAssetBalanceDelta = $t03951939766._1
1032- let priceAssetBalanceDelta = $t03951939766._2
1033- let $t03976939877 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1034- let refreshKLpActions = $t03976939877._1
1035- let updatedKLp = $t03976939877._2
1033+ let amountAssetBalanceDelta = $t03955839805._1
1034+ let priceAssetBalanceDelta = $t03955839805._2
1035+ let $t03980839916 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1036+ let refreshKLpActions = $t03980839916._1
1037+ let updatedKLp = $t03980839916._2
10361038 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10371039 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10381040 then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
10611063 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
10621064 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
10631065 then {
1064- let $t04082540907 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1065- let refreshKLpActions = $t04082540907._1
1066- let updatedKLp = $t04082540907._2
1066+ let $t04086440946 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1067+ let refreshKLpActions = $t04086440946._1
1068+ let updatedKLp = $t04086440946._2
10671069 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10681070 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10691071 then (state ++ refreshKLpActions)
10911093 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
10921094 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
10931095 then {
1094- let $t04185841939 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1095- let refreshKLpActions = $t04185841939._1
1096- let updatedKLp = $t04185841939._2
1096+ let $t04189741978 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1097+ let refreshKLpActions = $t04189741978._1
1098+ let updatedKLp = $t04189741978._2
10971099 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10981100 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10991101 then (state ++ refreshKLpActions)
11331135 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
11341136 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
11351137 then {
1136- let $t04306243143 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1137- let refreshKLpActions = $t04306243143._1
1138- let updatedKLp = $t04306243143._2
1138+ let $t04310143182 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1139+ let refreshKLpActions = $t04310143182._1
1140+ let updatedKLp = $t04310143182._2
11391141 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11401142 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11411143 then (state ++ refreshKLpActions)
11821184 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
11831185 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
11841186 then {
1185- let $t04443544516 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1186- let refreshKLpActions = $t04443544516._1
1187- let updatedKLp = $t04443544516._2
1187+ let $t04447444555 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1188+ let refreshKLpActions = $t04447444555._1
1189+ let updatedKLp = $t04447444555._2
11881190 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11891191 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11901192 then (state ++ refreshKLpActions)
12171219 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
12181220 then {
12191221 let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
1220- let $t04570345767 = refreshKLpInternal(0, 0, 0)
1221- let kLpUpdateActions = $t04570345767._1
1222- let updatedKLp = $t04570345767._2
1222+ let $t04574245806 = refreshKLpInternal(0, 0, 0)
1223+ let kLpUpdateActions = $t04574245806._1
1224+ let updatedKLp = $t04574245806._2
12231225 let actions = if ((kLp != updatedKLp))
12241226 then kLpUpdateActions
12251227 else throwErr("nothing to refresh")
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let lPdecimals = 8
55
66 let scale8 = 100000000
77
88 let scale8BigInt = toBigInt(100000000)
99
1010 let scale18 = toBigInt(1000000000000000000)
1111
1212 let zeroBigInt = toBigInt(0)
1313
1414 let big0 = toBigInt(0)
1515
1616 let big1 = toBigInt(1)
1717
1818 let big2 = toBigInt(2)
1919
2020 let wavesString = "WAVES"
2121
2222 let SEP = "__"
2323
2424 let PoolActive = 1
2525
2626 let PoolPutDisabled = 2
2727
2828 let PoolMatcherDisabled = 3
2929
3030 let PoolShutdown = 4
3131
3232 let idxPoolAddress = 1
3333
3434 let idxPoolStatus = 2
3535
3636 let idxPoolLPAssetId = 3
3737
3838 let idxAmtAssetId = 4
3939
4040 let idxPriceAssetId = 5
4141
4242 let idxAmtAssetDcm = 6
4343
4444 let idxPriceAssetDcm = 7
4545
4646 let idxIAmtAssetId = 8
4747
4848 let idxIPriceAssetId = 9
4949
5050 let idxLPAssetDcm = 10
5151
5252 let idxPoolAmtAssetAmt = 1
5353
5454 let idxPoolPriceAssetAmt = 2
5555
5656 let idxPoolLPAssetAmt = 3
5757
5858 let idxFactoryStakingContract = 1
5959
6060 let idxFactorySlippageContract = 7
6161
6262 func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), scale18, toBigInt(origScaleMult))
6363
6464
6565 func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), scale18))
6666
6767
6868 func toScale (amt,resScale,curScale) = fraction(amt, resScale, curScale)
6969
7070
7171 func abs (val) = if ((0 > val))
7272 then -(val)
7373 else val
7474
7575
7676 func absBigInt (val) = if ((zeroBigInt > val))
7777 then -(val)
7878 else val
7979
8080
8181 func fc () = "%s__factoryContract"
8282
8383
8484 func mpk () = "%s__managerPublicKey"
8585
8686
8787 func pmpk () = "%s__pendingManagerPublicKey"
8888
8989
9090 func pl () = "%s%s__price__last"
9191
9292
9393 func ph (h,timestamp) = makeString(["%s%s%d%d__price__history", toString(h), toString(timestamp)], SEP)
9494
9595
9696 func pau (userAddress,txId) = ((("%s%s%s__P__" + userAddress) + "__") + txId)
9797
9898
9999 func gau (userAddress,txId) = ((("%s%s%s__G__" + userAddress) + "__") + txId)
100100
101101
102102 func aa () = "%s__amountAsset"
103103
104104
105105 func pa () = "%s__priceAsset"
106106
107107
108108 let keyFee = "%s__fee"
109109
110110 let feeDefault = fraction(10, scale8, 10000)
111111
112112 let fee = valueOrElse(getInteger(this, keyFee), feeDefault)
113113
114114 let keyKLp = makeString(["%s", "kLp"], SEP)
115115
116116 let keyKLpRefreshedHeight = makeString(["%s", "kLpRefreshedHeight"], SEP)
117117
118118 let keyKLpRefreshDelay = makeString(["%s", "refreshKLpDelay"], SEP)
119119
120120 let kLpRefreshDelayDefault = 30
121121
122122 let kLpRefreshDelay = valueOrElse(getInteger(this, keyKLpRefreshDelay), kLpRefreshDelayDefault)
123123
124124 func keyFactoryConfig () = "%s__factoryConfig"
125125
126126
127127 func keyMatcherPub () = "%s%s__matcher__publicKey"
128128
129129
130130 func keyMappingPoolContractAddressToPoolAssets (poolContractAddress) = (("%s%s%s__" + poolContractAddress) + "__mappings__poolContract2LpAsset")
131131
132132
133133 func keyPoolConfig (iAmtAsset,iPriceAsset) = (((("%d%d%s__" + iAmtAsset) + "__") + iPriceAsset) + "__config")
134134
135135
136136 func keyMappingsBaseAsset2internalId (baseAssetStr) = ("%s%s%s__mappings__baseAsset2internalId__" + baseAssetStr)
137137
138138
139139 func keyAllPoolsShutdown () = "%s__shutdown"
140140
141141
142142 func keyPoolWeight (contractAddress) = ("%s%s__poolWeight__" + contractAddress)
143143
144144
145145 func keyAllowedLpScriptHash () = "%s__allowedLpScriptHash"
146146
147147
148148 let keyFeeCollectorAddress = "%s__feeCollectorAddress"
149149
150150 func throwOrderError (orderValid,senderValid,matcherValid) = throw(((((("order validation failed: orderValid=" + toString(orderValid)) + " senderValid=") + toString(senderValid)) + " matcherValid=") + toString(matcherValid)))
151151
152152
153153 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
154154
155155
156156 func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
157157
158158
159159 func throwErr (msg) = throw(makeString(["lp.ride:", msg], " "))
160160
161161
162162 func fmtErr (msg) = makeString(["lp.ride:", msg], " ")
163163
164164
165165 let factoryContract = addressFromStringValue(getStringOrFail(this, fc()))
166166
167167 let feeCollectorAddress = addressFromStringValue(getStringOrFail(factoryContract, keyFeeCollectorAddress))
168168
169169 func isGlobalShutdown () = valueOrElse(getBoolean(factoryContract, keyAllPoolsShutdown()), false)
170170
171171
172172 func getMatcherPubOrFail () = fromBase58String(getStringOrFail(factoryContract, keyMatcherPub()))
173173
174174
175175 func getPoolConfig () = {
176176 let amtAsset = getStringOrFail(this, aa())
177177 let priceAsset = getStringOrFail(this, pa())
178178 let iPriceAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(priceAsset))
179179 let iAmtAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(amtAsset))
180180 split(getStringOrFail(factoryContract, keyPoolConfig(toString(iAmtAsset), toString(iPriceAsset))), SEP)
181181 }
182182
183183
184184 func parseAssetId (input) = if ((input == wavesString))
185185 then unit
186186 else fromBase58String(input)
187187
188188
189189 func assetIdToString (input) = if ((input == unit))
190190 then wavesString
191191 else toBase58String(value(input))
192192
193193
194194 func parsePoolConfig (poolConfig) = $Tuple7(addressFromStringValue(poolConfig[idxPoolAddress]), parseIntValue(poolConfig[idxPoolStatus]), fromBase58String(poolConfig[idxPoolLPAssetId]), parseAssetId(poolConfig[idxAmtAssetId]), parseAssetId(poolConfig[idxPriceAssetId]), parseIntValue(poolConfig[idxAmtAssetDcm]), parseIntValue(poolConfig[idxPriceAssetDcm]))
195195
196196
197197 let poolConfigParsed = parsePoolConfig(getPoolConfig())
198198
199199 let $t079158081 = poolConfigParsed
200200
201201 let cfgPoolAddress = $t079158081._1
202202
203203 let cfgPoolStatus = $t079158081._2
204204
205205 let cfgLpAssetId = $t079158081._3
206206
207207 let cfgAmountAssetId = $t079158081._4
208208
209209 let cfgPriceAssetId = $t079158081._5
210210
211211 let cfgAmountAssetDecimals = $t079158081._6
212212
213213 let cfgPriceAssetDecimals = $t079158081._7
214214
215215 func getFactoryConfig () = split(getStringOrFail(factoryContract, keyFactoryConfig()), SEP)
216216
217217
218218 let stakingContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactoryStakingContract]), "incorrect staking address")
219219
220220 let slippageContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactorySlippageContract]), "incorrect staking address")
221221
222222 func dataPutActionInfo (inAmtAssetAmt,inPriceAssetAmt,outLpAmt,price,slippageTolerancePassedByUser,slippageToleranceReal,txHeight,txTimestamp,slipageAmtAssetAmt,slipagePriceAssetAmt) = makeString(["%d%d%d%d%d%d%d%d%d%d", toString(inAmtAssetAmt), toString(inPriceAssetAmt), toString(outLpAmt), toString(price), toString(slippageTolerancePassedByUser), toString(slippageToleranceReal), toString(txHeight), toString(txTimestamp), toString(slipageAmtAssetAmt), toString(slipagePriceAssetAmt)], SEP)
223223
224224
225225 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)
226226
227227
228228 func getAccBalance (assetId) = if ((assetId == "WAVES"))
229229 then wavesBalance(this).available
230230 else assetBalance(this, fromBase58String(assetId))
231231
232232
233233 func calcPriceBigInt (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18)
234234
235235
236236 func privateCalcPrice (amAssetDcm,prAssetDcm,amAmt,prAmt) = {
237237 let amtAssetAmtX18 = toX18(amAmt, amAssetDcm)
238238 let priceAssetAmtX18 = toX18(prAmt, prAssetDcm)
239239 calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
240240 }
241241
242242
243243 func calcPrices (amAmt,prAmt,lpAmt) = {
244244 let cfg = getPoolConfig()
245245 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
246246 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
247247 let priceX18 = privateCalcPrice(amtAssetDcm, priceAssetDcm, amAmt, prAmt)
248248 let amAmtX18 = toX18(amAmt, amtAssetDcm)
249249 let prAmtX18 = toX18(prAmt, priceAssetDcm)
250250 let lpAmtX18 = toX18(lpAmt, scale8)
251251 let lpPriceInAmAssetX18 = calcPriceBigInt(amAmtX18, lpAmtX18)
252252 let lpPriceInPrAssetX18 = calcPriceBigInt(prAmtX18, lpAmtX18)
253253 [priceX18, lpPriceInAmAssetX18, lpPriceInPrAssetX18]
254254 }
255255
256256
257257 func calculatePrices (amAmt,prAmt,lpAmt) = {
258258 let prices = calcPrices(amAmt, prAmt, lpAmt)
259259 [fromX18(prices[0], scale8), fromX18(prices[1], scale8), fromX18(prices[2], scale8)]
260260 }
261261
262262
263263 func estimateGetOperation (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
264264 let cfg = getPoolConfig()
265265 let lpAssetId = cfg[idxPoolLPAssetId]
266266 let amAssetId = cfg[idxAmtAssetId]
267267 let prAssetId = cfg[idxPriceAssetId]
268268 let amAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
269269 let prAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
270270 let poolStatus = cfg[idxPoolStatus]
271271 let lpEmission = valueOrErrorMessage(assetInfo(fromBase58String(lpAssetId)), (("Asset " + lpAssetId) + " doesn't exist")).quantity
272272 if ((lpAssetId != pmtAssetId))
273273 then throw("Invalid asset passed.")
274274 else {
275275 let amBalance = getAccBalance(amAssetId)
276276 let amBalanceX18 = toX18(amBalance, amAssetDcm)
277277 let prBalance = getAccBalance(prAssetId)
278278 let prBalanceX18 = toX18(prBalance, prAssetDcm)
279279 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
280280 let curPrice = fromX18(curPriceX18, scale8)
281281 let pmtLpAmtX18 = toX18(pmtLpAmt, scale8)
282282 let lpEmissionX18 = toX18(lpEmission, scale8)
283283 let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissionX18)
284284 let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissionX18)
285285 let outAmAmt = fromX18(outAmAmtX18, amAssetDcm)
286286 let outPrAmt = fromX18(outPrAmtX18, prAssetDcm)
287287 let state = if ((txId58 == ""))
288288 then nil
289289 else [ScriptTransfer(userAddress, outAmAmt, if ((amAssetId == "WAVES"))
290290 then unit
291291 else fromBase58String(amAssetId)), ScriptTransfer(userAddress, outPrAmt, if ((prAssetId == "WAVES"))
292292 then unit
293293 else fromBase58String(prAssetId)), StringEntry(gau(toString(userAddress), txId58), dataGetActionInfo(outAmAmt, outPrAmt, pmtLpAmt, curPrice, height, lastBlock.timestamp)), IntegerEntry(pl(), curPrice), IntegerEntry(ph(height, lastBlock.timestamp), curPrice)]
294294 $Tuple10(outAmAmt, outPrAmt, amAssetId, prAssetId, amBalance, prBalance, lpEmission, curPriceX18, poolStatus, state)
295295 }
296296 }
297297
298298
299299 func estimatePutOperation (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = {
300300 let cfg = getPoolConfig()
301301 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
302302 let amAssetIdStr = cfg[idxAmtAssetId]
303303 let prAssetIdStr = cfg[idxPriceAssetId]
304304 let iAmtAssetId = cfg[idxIAmtAssetId]
305305 let iPriceAssetId = cfg[idxIPriceAssetId]
306306 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
307307 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
308308 let poolStatus = cfg[idxPoolStatus]
309309 let lpEmission = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
310310 let inAmAssetIdStr = toBase58String(valueOrElse(inAmAssetId, fromBase58String("WAVES")))
311311 let inPrAssetIdStr = toBase58String(valueOrElse(inPrAssetId, fromBase58String("WAVES")))
312312 if (if ((amAssetIdStr != inAmAssetIdStr))
313313 then true
314314 else (prAssetIdStr != inPrAssetIdStr))
315315 then throw("Invalid amt or price asset passed.")
316316 else {
317317 let amBalance = if (isEvaluate)
318318 then getAccBalance(amAssetIdStr)
319319 else (getAccBalance(amAssetIdStr) - inAmAssetAmt)
320320 let prBalance = if (isEvaluate)
321321 then getAccBalance(prAssetIdStr)
322322 else (getAccBalance(prAssetIdStr) - inPrAssetAmt)
323323 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
324324 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
325325 let userPriceX18 = calcPriceBigInt(inPrAssetAmtX18, inAmAssetAmtX18)
326326 let amBalanceX18 = toX18(amBalance, amtAssetDcm)
327327 let prBalanceX18 = toX18(prBalance, priceAssetDcm)
328328 let res = if ((lpEmission == 0))
329329 then {
330330 let curPriceX18 = zeroBigInt
331331 let slippageX18 = zeroBigInt
332332 let lpAmtX18 = pow((inAmAssetAmtX18 * inPrAssetAmtX18), 0, toBigInt(5), 1, 0, DOWN)
333333 $Tuple5(fromX18(lpAmtX18, scale8), fromX18(inAmAssetAmtX18, amtAssetDcm), fromX18(inPrAssetAmtX18, priceAssetDcm), calcPriceBigInt((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18)
334334 }
335335 else {
336336 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
337337 let slippageX18 = fraction(absBigInt((curPriceX18 - userPriceX18)), scale18, curPriceX18)
338338 let slippageToleranceX18 = toX18(slippageTolerance, scale8)
339339 if (if ((curPriceX18 != zeroBigInt))
340340 then (slippageX18 > slippageToleranceX18)
341341 else false)
342342 then throw(((("Price slippage " + toString(slippageX18)) + " exceeded the passed limit of ") + toString(slippageToleranceX18)))
343343 else {
344344 let lpEmissionX18 = toX18(lpEmission, scale8)
345345 let prViaAmX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18)
346346 let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
347347 let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18))
348348 then $Tuple2(amViaPrX18, inPrAssetAmtX18)
349349 else $Tuple2(inAmAssetAmtX18, prViaAmX18)
350350 let expAmtAssetAmtX18 = expectedAmts._1
351351 let expPriceAssetAmtX18 = expectedAmts._2
352352 let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18)
353353 $Tuple5(fromX18(lpAmtX18, scale8), fromX18(expAmtAssetAmtX18, amtAssetDcm), fromX18(expPriceAssetAmtX18, priceAssetDcm), curPriceX18, slippageX18)
354354 }
355355 }
356356 let calcLpAmt = res._1
357357 let calcAmAssetPmt = res._2
358358 let calcPrAssetPmt = res._3
359359 let curPrice = fromX18(res._4, scale8)
360360 let slippageCalc = fromX18(res._5, scale8)
361361 if ((0 >= calcLpAmt))
362362 then throw("Invalid calculations. LP calculated is less than zero.")
363363 else {
364364 let emitLpAmt = if (!(emitLp))
365365 then 0
366366 else calcLpAmt
367367 let amDiff = (inAmAssetAmt - calcAmAssetPmt)
368368 let prDiff = (inPrAssetAmt - calcPrAssetPmt)
369369 let commonState = [IntegerEntry(pl(), curPrice), IntegerEntry(ph(height, lastBlock.timestamp), curPrice), StringEntry(pau(userAddress, txId58), dataPutActionInfo(calcAmAssetPmt, calcPrAssetPmt, emitLpAmt, curPrice, slippageTolerance, slippageCalc, height, lastBlock.timestamp, amDiff, prDiff))]
370370 $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEmission, lpAssetId, poolStatus, commonState, amDiff, prDiff, inAmAssetId, inPrAssetId)
371371 }
372372 }
373373 }
374374
375375
376376 func calcKLp (amountBalance,priceBalance,lpEmission) = {
377377 let updatedKLp = fraction(pow((amountBalance * priceBalance), 0, toBigInt(5), 1, 18, DOWN), big1, lpEmission)
378- updatedKLp
378+ if ((lpEmission == big0))
379+ then big0
380+ else updatedKLp
379381 }
380382
381383
382384 func calcCurrentKLp (amountAssetDelta,priceAssetDelta,lpAssetEmissionDelta) = {
383385 let amountAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) - amountAssetDelta)
384386 let priceAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) - priceAssetDelta)
385387 let lpAssetEmission = (toBigInt(value(assetInfo(cfgLpAssetId)).quantity) - lpAssetEmissionDelta)
386388 let currentKLp = calcKLp(amountAssetBalance, priceAssetBalance, lpAssetEmission)
387389 currentKLp
388390 }
389391
390392
391393 func refreshKLpInternal (amountAssetBalanceDelta,priceAssetBalanceDelta,lpAssetEmissionDelta) = {
392394 let amountAssetBalance = (getAccBalance(assetIdToString(cfgAmountAssetId)) + amountAssetBalanceDelta)
393395 let priceAssetBalance = (getAccBalance(assetIdToString(cfgPriceAssetId)) + priceAssetBalanceDelta)
394396 let lpAssetEmission = (value(assetInfo(cfgLpAssetId)).quantity + lpAssetEmissionDelta)
395397 let updatedKLp = calcKLp(toBigInt(amountAssetBalance), toBigInt(priceAssetBalance), toBigInt(lpAssetEmission))
396398 let actions = [IntegerEntry(keyKLpRefreshedHeight, height), StringEntry(keyKLp, toString(updatedKLp))]
397399 $Tuple2(actions, updatedKLp)
398400 }
399401
400402
401403 func validateUpdatedKLp (oldKLp,updatedKLp) = if ((updatedKLp >= oldKLp))
402404 then true
403405 else throwErr(makeString(["updated KLp lower than current KLp", toString(oldKLp), toString(updatedKLp)], " "))
404406
405407
406408 func validateMatcherOrderAllowed (order) = {
407409 let amountAssetAmount = order.amount
408410 let priceAssetAmount = fraction(order.amount, order.price, scale8, FLOOR)
409- let $t02030220514 = if ((order.orderType == Buy))
411+ let $t02034120553 = if ((order.orderType == Buy))
410412 then $Tuple2(amountAssetAmount, -(priceAssetAmount))
411413 else $Tuple2(-(amountAssetAmount), priceAssetAmount)
412- let amountAssetBalanceDelta = $t02030220514._1
413- let priceAssetBalanceDelta = $t02030220514._2
414+ let amountAssetBalanceDelta = $t02034120553._1
415+ let priceAssetBalanceDelta = $t02034120553._2
414416 if (if (if (isGlobalShutdown())
415417 then true
416418 else (cfgPoolStatus == PoolMatcherDisabled))
417419 then true
418420 else (cfgPoolStatus == PoolShutdown))
419421 then throw("Exchange operations disabled")
420422 else if (if ((order.assetPair.amountAsset != cfgAmountAssetId))
421423 then true
422424 else (order.assetPair.priceAsset != cfgPriceAssetId))
423425 then throw("Wrong order assets.")
424426 else {
425427 let kLp = valueOrErrorMessage(parseBigInt(valueOrErrorMessage(getString(this, keyKLp), fmtErr("kLp is required"))), fmtErr("invalid kLp"))
426- let $t02098521085 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
427- let unusedActions = $t02098521085._1
428- let kLpNew = $t02098521085._2
428+ let $t02102421124 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
429+ let unusedActions = $t02102421124._1
430+ let kLpNew = $t02102421124._2
429431 let isOrderValid = (kLpNew >= kLp)
430432 isOrderValid
431433 }
432434 }
433435
434436
435437 func commonGet (i) = if ((size(i.payments) != 1))
436438 then throw("exactly 1 payment is expected")
437439 else {
438440 let pmt = value(i.payments[0])
439441 let pmtAssetId = value(pmt.assetId)
440442 let pmtAmt = pmt.amount
441443 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller)
442444 let outAmAmt = res._1
443445 let outPrAmt = res._2
444446 let poolStatus = parseIntValue(res._9)
445447 let state = res._10
446448 if (if (isGlobalShutdown())
447449 then true
448450 else (poolStatus == PoolShutdown))
449451 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
450452 else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state)
451453 }
452454
453455
454456 func commonPut (i,slippageTolerance,emitLp) = if ((size(i.payments) != 2))
455457 then throw("exactly 2 payments are expected")
456458 else {
457459 let amAssetPmt = value(i.payments[0])
458460 let prAssetPmt = value(i.payments[1])
459461 let estPut = estimatePutOperation(toBase58String(i.transactionId), slippageTolerance, amAssetPmt.amount, amAssetPmt.assetId, prAssetPmt.amount, prAssetPmt.assetId, toString(i.caller), false, emitLp)
460462 let poolStatus = parseIntValue(estPut._8)
461463 if (if (if (isGlobalShutdown())
462464 then true
463465 else (poolStatus == PoolPutDisabled))
464466 then true
465467 else (poolStatus == PoolShutdown))
466468 then throw(("Put operation is blocked by admin. Status = " + toString(poolStatus)))
467469 else estPut
468470 }
469471
470472
471473 func emit (amount) = {
472474 let emitInv = invoke(factoryContract, "emit", [amount], nil)
473475 if ((emitInv == emitInv))
474476 then {
475477 let emitInvLegacy = match emitInv {
476478 case legacyFactoryContract: Address =>
477479 invoke(legacyFactoryContract, "emit", [amount], nil)
478480 case _ =>
479481 unit
480482 }
481483 if ((emitInvLegacy == emitInvLegacy))
482484 then amount
483485 else throw("Strict value is not equal to itself.")
484486 }
485487 else throw("Strict value is not equal to itself.")
486488 }
487489
488490
489491 func takeFee (amount) = {
490492 let feeAmount = fraction(amount, fee, scale8)
491493 $Tuple2((amount - feeAmount), feeAmount)
492494 }
493495
494496
495497 func calcPutOneToken (paymentAmountRaw,paymentAssetId,userAddress,txId) = {
496498 let isEval = (txId == unit)
497499 let amountBalanceRaw = getAccBalance(assetIdToString(cfgAmountAssetId))
498500 let priceBalanceRaw = getAccBalance(assetIdToString(cfgPriceAssetId))
499501 let paymentInAmountAsset = if ((paymentAssetId == cfgAmountAssetId))
500502 then true
501503 else if ((paymentAssetId == cfgPriceAssetId))
502504 then false
503505 else throwErr("invalid asset")
504- let $t02377024063 = if (isEval)
506+ let $t02380924102 = if (isEval)
505507 then $Tuple2(amountBalanceRaw, priceBalanceRaw)
506508 else if (paymentInAmountAsset)
507509 then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw)
508510 else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw))
509- let amountBalanceOld = $t02377024063._1
510- let priceBalanceOld = $t02377024063._2
511- let $t02406724216 = if (paymentInAmountAsset)
511+ let amountBalanceOld = $t02380924102._1
512+ let priceBalanceOld = $t02380924102._2
513+ let $t02410624255 = if (paymentInAmountAsset)
512514 then $Tuple2(paymentAmountRaw, 0)
513515 else $Tuple2(0, paymentAmountRaw)
514- let amountAssetAmountRaw = $t02406724216._1
515- let priceAssetAmountRaw = $t02406724216._2
516+ let amountAssetAmountRaw = $t02410624255._1
517+ let priceAssetAmountRaw = $t02410624255._2
516518 let amountAssetAmount = takeFee(amountAssetAmountRaw)._1
517519 let priceAssetAmount = takeFee(priceAssetAmountRaw)._1
518- let $t02433824397 = takeFee(paymentAmountRaw)
519- let paymentAmount = $t02433824397._1
520- let feeAmount = $t02433824397._2
520+ let $t02437724436 = takeFee(paymentAmountRaw)
521+ let paymentAmount = $t02437724436._1
522+ let feeAmount = $t02437724436._2
521523 let amountBalanceNew = (amountBalanceOld + amountAssetAmount)
522524 let priceBalanceNew = (priceBalanceOld + priceAssetAmount)
523525 let priceNewX18 = calcPriceBigInt(toX18(priceBalanceNew, cfgPriceAssetDecimals), toX18(amountBalanceNew, cfgAmountAssetDecimals))
524526 let priceNew = fromX18(priceNewX18, scale8)
525527 let paymentBalance = if (paymentInAmountAsset)
526528 then amountBalanceOld
527529 else priceBalanceOld
528530 let paymentBalanceBigInt = toBigInt(paymentBalance)
529531 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
530532 let chechSupply = if ((supplyBigInt > big0))
531533 then true
532534 else throwErr("initial deposit requires all coins")
533535 if ((chechSupply == chechSupply))
534536 then {
535537 let depositBigInt = toBigInt(paymentAmount)
536538 let issueAmount = max([0, toInt(((supplyBigInt * (sqrtBigInt((scale18 + ((depositBigInt * scale18) / paymentBalanceBigInt)), 18, 18, DOWN) - scale18)) / scale18))])
537539 let commonState = if (isEval)
538540 then nil
539541 else [IntegerEntry(pl(), priceNew), IntegerEntry(ph(height, lastBlock.timestamp), priceNew), StringEntry(pau(toString(value(userAddress)), toBase58String(value(txId))), dataPutActionInfo(amountAssetAmountRaw, priceAssetAmountRaw, issueAmount, priceNew, 0, 0, height, lastBlock.timestamp, 0, 0))]
540542 let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, cfgPriceAssetDecimals), toX18(amountBalanceOld, cfgAmountAssetDecimals))
541543 let priceOld = fromX18(priceOldX18, scale8)
542544 let loss = {
543- let $t02587426041 = if (paymentInAmountAsset)
545+ let $t02591326080 = if (paymentInAmountAsset)
544546 then $Tuple2(amountAssetAmountRaw, amountBalanceOld)
545547 else $Tuple2(priceAssetAmountRaw, priceBalanceOld)
546- let amount = $t02587426041._1
547- let balance = $t02587426041._2
548+ let amount = $t02591326080._1
549+ let balance = $t02591326080._2
548550 let issueAmountBoth = toInt(fraction(supplyBigInt, toBigInt((amount / 2)), toBigInt(balance)))
549551 fraction((issueAmount - issueAmountBoth), scale8, issueAmountBoth)
550552 }
551553 $Tuple5(issueAmount, commonState, feeAmount, loss, paymentInAmountAsset)
552554 }
553555 else throw("Strict value is not equal to itself.")
554556 }
555557
556558
557559 func calcGetOneToken (outAssetId,paymentAmount,paymentAssetId,userAddress,txId) = {
558560 let isEval = (txId == unit)
559561 let checks = [if ((paymentAssetId == cfgLpAssetId))
560562 then true
561563 else throwErr("invalid lp asset")]
562564 if ((checks == checks))
563565 then {
564566 let outInAmountAsset = if ((outAssetId == cfgAmountAssetId))
565567 then true
566568 else if ((outAssetId == cfgPriceAssetId))
567569 then false
568570 else throwErr("invalid asset")
569571 let balanceBigInt = if (outInAmountAsset)
570572 then toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId)))
571573 else toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId)))
572574 let amBalanceOld = getAccBalance(assetIdToString(cfgAmountAssetId))
573575 let prBalanceOld = getAccBalance(assetIdToString(cfgPriceAssetId))
574576 let outBalance = if (outInAmountAsset)
575577 then amBalanceOld
576578 else prBalanceOld
577579 let outBalanceBigInt = toBigInt(outBalance)
578580 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
579581 let redeemedBigInt = toBigInt(paymentAmount)
580582 let amountRaw = max([0, toInt(((balanceBigInt * (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN))) / scale18))])
581- let $t02764327693 = takeFee(amountRaw)
582- let totalAmount = $t02764327693._1
583- let feeAmount = $t02764327693._2
584- let $t02769727923 = if (outInAmountAsset)
583+ let $t02768227732 = takeFee(amountRaw)
584+ let totalAmount = $t02768227732._1
585+ let feeAmount = $t02768227732._2
586+ let $t02773627962 = if (outInAmountAsset)
585587 then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld)
586588 else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw))
587- let outAmAmount = $t02769727923._1
588- let outPrAmount = $t02769727923._2
589- let amBalanceNew = $t02769727923._3
590- let prBalanceNew = $t02769727923._4
589+ let outAmAmount = $t02773627962._1
590+ let outPrAmount = $t02773627962._2
591+ let amBalanceNew = $t02773627962._3
592+ let prBalanceNew = $t02773627962._4
591593 let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, cfgPriceAssetDecimals), toX18(amBalanceNew, cfgAmountAssetDecimals))
592594 let priceNew = fromX18(priceNewX18, scale8)
593595 let commonState = if (isEval)
594596 then nil
595597 else [StringEntry(gau(toString(value(userAddress)), toBase58String(value(txId))), dataGetActionInfo(outAmAmount, outPrAmount, paymentAmount, priceNew, height, lastBlock.timestamp)), IntegerEntry(pl(), priceNew), IntegerEntry(ph(height, lastBlock.timestamp), priceNew)]
596598 let priceOldX18 = calcPriceBigInt(toX18(prBalanceOld, cfgPriceAssetDecimals), toX18(amBalanceOld, cfgAmountAssetDecimals))
597599 let priceOld = fromX18(priceOldX18, scale8)
598600 let loss = {
599601 let amountBothInPaymentAsset = (toInt(fraction(balanceBigInt, redeemedBigInt, supplyBigInt)) * 2)
600602 fraction((totalAmount - amountBothInPaymentAsset), scale8, amountBothInPaymentAsset)
601603 }
602604 $Tuple5(totalAmount, commonState, feeAmount, loss, outInAmountAsset)
603605 }
604606 else throw("Strict value is not equal to itself.")
605607 }
606608
607609
608610 func managerPublicKeyOrUnit () = match getString(mpk()) {
609611 case s: String =>
610612 fromBase58String(s)
611613 case _: Unit =>
612614 unit
613615 case _ =>
614616 throw("Match error")
615617 }
616618
617619
618620 func pendingManagerPublicKeyOrUnit () = match getString(pmpk()) {
619621 case s: String =>
620622 fromBase58String(s)
621623 case _: Unit =>
622624 unit
623625 case _ =>
624626 throw("Match error")
625627 }
626628
627629
628630 func isManager (i) = match managerPublicKeyOrUnit() {
629631 case pk: ByteVector =>
630632 (i.callerPublicKey == pk)
631633 case _: Unit =>
632634 (i.caller == this)
633635 case _ =>
634636 throw("Match error")
635637 }
636638
637639
638640 func mustManager (i) = {
639641 let pd = throw("Permission denied")
640642 match managerPublicKeyOrUnit() {
641643 case pk: ByteVector =>
642644 if ((i.callerPublicKey == pk))
643645 then true
644646 else pd
645647 case _: Unit =>
646648 if ((i.caller == this))
647649 then true
648650 else pd
649651 case _ =>
650652 throw("Match error")
651653 }
652654 }
653655
654656
655657 @Callable(i)
656658 func setManager (pendingManagerPublicKey) = {
657659 let checkCaller = mustManager(i)
658660 if ((checkCaller == checkCaller))
659661 then {
660662 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
661663 if ((checkManagerPublicKey == checkManagerPublicKey))
662664 then [StringEntry(pmpk(), pendingManagerPublicKey)]
663665 else throw("Strict value is not equal to itself.")
664666 }
665667 else throw("Strict value is not equal to itself.")
666668 }
667669
668670
669671
670672 @Callable(i)
671673 func confirmManager () = {
672674 let pm = pendingManagerPublicKeyOrUnit()
673675 let hasPM = if (isDefined(pm))
674676 then true
675677 else throw("No pending manager")
676678 if ((hasPM == hasPM))
677679 then {
678680 let checkPM = if ((i.callerPublicKey == value(pm)))
679681 then true
680682 else throw("You are not pending manager")
681683 if ((checkPM == checkPM))
682684 then [StringEntry(mpk(), toBase58String(value(pm))), DeleteEntry(pmpk())]
683685 else throw("Strict value is not equal to itself.")
684686 }
685687 else throw("Strict value is not equal to itself.")
686688 }
687689
688690
689691
690692 @Callable(i)
691693 func put (slippageTolerance,shouldAutoStake) = if ((0 > slippageTolerance))
692694 then throw("Invalid slippageTolerance passed")
693695 else {
694696 let estPut = commonPut(i, slippageTolerance, true)
695697 let emitLpAmt = estPut._2
696698 let lpAssetId = estPut._7
697699 let state = estPut._9
698700 let amDiff = estPut._10
699701 let prDiff = estPut._11
700702 let amId = estPut._12
701703 let prId = estPut._13
702704 let amAssetPmt = toBigInt(value(i.payments[0]).amount)
703705 let prAssetPmt = toBigInt(value(i.payments[1]).amount)
704706 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
705707 if ((currentKLp == currentKLp))
706708 then {
707709 let emitInv = invoke(factoryContract, "emit", [emitLpAmt], nil)
708710 if ((emitInv == emitInv))
709711 then {
710712 let emitInvLegacy = match emitInv {
711713 case legacyFactoryContract: Address =>
712714 invoke(legacyFactoryContract, "emit", [emitLpAmt], nil)
713715 case _ =>
714716 unit
715717 }
716718 if ((emitInvLegacy == emitInvLegacy))
717719 then {
718720 let slippageAInv = if ((amDiff > 0))
719721 then invoke(slippageContract, "put", nil, [AttachedPayment(amId, amDiff)])
720722 else nil
721723 if ((slippageAInv == slippageAInv))
722724 then {
723725 let slippagePInv = if ((prDiff > 0))
724726 then invoke(slippageContract, "put", nil, [AttachedPayment(prId, prDiff)])
725727 else nil
726728 if ((slippagePInv == slippagePInv))
727729 then {
728730 let lpTransfer = if (shouldAutoStake)
729731 then {
730732 let slpStakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)])
731733 if ((slpStakeInv == slpStakeInv))
732734 then nil
733735 else throw("Strict value is not equal to itself.")
734736 }
735737 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
736- let $t03207532140 = refreshKLpInternal(0, 0, 0)
737- let refreshKLpActions = $t03207532140._1
738- let updatedKLp = $t03207532140._2
738+ let $t03211432179 = refreshKLpInternal(0, 0, 0)
739+ let refreshKLpActions = $t03211432179._1
740+ let updatedKLp = $t03211432179._2
739741 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
740742 if ((isUpdatedKLpValid == isUpdatedKLpValid))
741743 then ((state ++ lpTransfer) ++ refreshKLpActions)
742744 else throw("Strict value is not equal to itself.")
743745 }
744746 else throw("Strict value is not equal to itself.")
745747 }
746748 else throw("Strict value is not equal to itself.")
747749 }
748750 else throw("Strict value is not equal to itself.")
749751 }
750752 else throw("Strict value is not equal to itself.")
751753 }
752754 else throw("Strict value is not equal to itself.")
753755 }
754756
755757
756758
757759 @Callable(i)
758760 func putForFree (maxSlippage) = if ((0 > maxSlippage))
759761 then throw("Invalid value passed")
760762 else {
761763 let estPut = commonPut(i, maxSlippage, false)
762764 let state = estPut._9
763765 let amAssetPmt = toBigInt(value(i.payments[0]).amount)
764766 let prAssetPmt = toBigInt(value(i.payments[1]).amount)
765767 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
766768 if ((currentKLp == currentKLp))
767769 then {
768- let $t03270232767 = refreshKLpInternal(0, 0, 0)
769- let refreshKLpActions = $t03270232767._1
770- let updatedKLp = $t03270232767._2
770+ let $t03274132806 = refreshKLpInternal(0, 0, 0)
771+ let refreshKLpActions = $t03274132806._1
772+ let updatedKLp = $t03274132806._2
771773 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
772774 if ((isUpdatedKLpValid == isUpdatedKLpValid))
773775 then (state ++ refreshKLpActions)
774776 else throw("Strict value is not equal to itself.")
775777 }
776778 else throw("Strict value is not equal to itself.")
777779 }
778780
779781
780782
781783 @Callable(i)
782784 func putOneTkn (minOutAmount,autoStake) = {
783785 let isPoolOneTokenOperationsDisabled = {
784786 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
785787 if ($isInstanceOf(@, "Boolean"))
786788 then @
787789 else throw(($getType(@) + " couldn't be cast to Boolean"))
788790 }
789791 let isPutDisabled = if (if (if (isGlobalShutdown())
790792 then true
791793 else (cfgPoolStatus == PoolPutDisabled))
792794 then true
793795 else (cfgPoolStatus == PoolShutdown))
794796 then true
795797 else isPoolOneTokenOperationsDisabled
796798 let checks = [if (if (!(isPutDisabled))
797799 then true
798800 else isManager(i))
799801 then true
800802 else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1))
801803 then true
802804 else throwErr("exactly 1 payment are expected")]
803805 if ((checks == checks))
804806 then {
805807 let payment = i.payments[0]
806808 let paymentAssetId = payment.assetId
807809 let paymentAmountRaw = payment.amount
808810 let currentKLp = if ((paymentAssetId == cfgAmountAssetId))
809811 then calcCurrentKLp(toBigInt(paymentAmountRaw), toBigInt(0), toBigInt(0))
810812 else if ((paymentAssetId == cfgPriceAssetId))
811813 then calcCurrentKLp(toBigInt(0), toBigInt(paymentAmountRaw), toBigInt(0))
812814 else throwErr("payment asset is not supported")
813815 let userAddress = i.caller
814816 let txId = i.transactionId
815- let $t03395234104 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
816- if (($t03395234104 == $t03395234104))
817+ let $t03399134143 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
818+ if (($t03399134143 == $t03399134143))
817819 then {
818- let paymentInAmountAsset = $t03395234104._5
819- let bonus = $t03395234104._4
820- let feeAmount = $t03395234104._3
821- let commonState = $t03395234104._2
822- let emitAmountEstimated = $t03395234104._1
820+ let paymentInAmountAsset = $t03399134143._5
821+ let bonus = $t03399134143._4
822+ let feeAmount = $t03399134143._3
823+ let commonState = $t03399134143._2
824+ let emitAmountEstimated = $t03399134143._1
823825 let emitAmount = if (if ((minOutAmount > 0))
824826 then (minOutAmount > emitAmountEstimated)
825827 else false)
826828 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
827829 else emitAmountEstimated
828830 let emitInv = emit(emitAmount)
829831 if ((emitInv == emitInv))
830832 then {
831833 let lpTransfer = if (autoStake)
832834 then {
833835 let stakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(cfgLpAssetId, emitAmount)])
834836 if ((stakeInv == stakeInv))
835837 then nil
836838 else throw("Strict value is not equal to itself.")
837839 }
838840 else [ScriptTransfer(i.caller, emitAmount, cfgLpAssetId)]
839841 let sendFee = if ((feeAmount > 0))
840842 then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
841843 else nil
842- let $t03469034887 = if ((this == feeCollectorAddress))
844+ let $t03472934926 = if ((this == feeCollectorAddress))
843845 then $Tuple2(0, 0)
844846 else if (paymentInAmountAsset)
845847 then $Tuple2(-(feeAmount), 0)
846848 else $Tuple2(0, -(feeAmount))
847- let amountAssetBalanceDelta = $t03469034887._1
848- let priceAssetBalanceDelta = $t03469034887._2
849- let $t03489034998 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
850- let refreshKLpActions = $t03489034998._1
851- let updatedKLp = $t03489034998._2
849+ let amountAssetBalanceDelta = $t03472934926._1
850+ let priceAssetBalanceDelta = $t03472934926._2
851+ let $t03492935037 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
852+ let refreshKLpActions = $t03492935037._1
853+ let updatedKLp = $t03492935037._2
852854 let kLp = value(getString(keyKLp))
853855 let error = throwErr(makeString([toString(amountAssetBalanceDelta), toString(priceAssetBalanceDelta), kLp, toString(currentKLp), toString(updatedKLp)], " "))
854856 if ((error == error))
855857 then {
856858 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
857859 if ((isUpdatedKLpValid == isUpdatedKLpValid))
858860 then $Tuple2((((commonState ++ lpTransfer) ++ sendFee) ++ refreshKLpActions), emitAmount)
859861 else throw("Strict value is not equal to itself.")
860862 }
861863 else throw("Strict value is not equal to itself.")
862864 }
863865 else throw("Strict value is not equal to itself.")
864866 }
865867 else throw("Strict value is not equal to itself.")
866868 }
867869 else throw("Strict value is not equal to itself.")
868870 }
869871
870872
871873
872874 @Callable(i)
873875 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
874- let $t03549635653 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
875- let emitAmountEstimated = $t03549635653._1
876- let commonState = $t03549635653._2
877- let feeAmount = $t03549635653._3
878- let bonus = $t03549635653._4
879- let paymentInAmountAsset = $t03549635653._5
876+ let $t03553535692 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
877+ let emitAmountEstimated = $t03553535692._1
878+ let commonState = $t03553535692._2
879+ let feeAmount = $t03553535692._3
880+ let bonus = $t03553535692._4
881+ let paymentInAmountAsset = $t03553535692._5
880882 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
881883 }
882884
883885
884886
885887 @Callable(i)
886888 func getOneTkn (outAssetIdStr,minOutAmount) = {
887889 let isPoolOneTokenOperationsDisabled = {
888890 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
889891 if ($isInstanceOf(@, "Boolean"))
890892 then @
891893 else throw(($getType(@) + " couldn't be cast to Boolean"))
892894 }
893895 let isGetDisabled = if (if (isGlobalShutdown())
894896 then true
895897 else (cfgPoolStatus == PoolShutdown))
896898 then true
897899 else isPoolOneTokenOperationsDisabled
898900 let checks = [if (if (!(isGetDisabled))
899901 then true
900902 else isManager(i))
901903 then true
902904 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1))
903905 then true
904906 else throwErr("exactly 1 payment are expected")]
905907 if ((checks == checks))
906908 then {
907909 let outAssetId = parseAssetId(outAssetIdStr)
908910 let payment = i.payments[0]
909911 let paymentAssetId = payment.assetId
910912 let paymentAmount = payment.amount
911913 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(paymentAmount))
912914 let userAddress = i.caller
913915 let txId = i.transactionId
914- let $t03654736700 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
915- if (($t03654736700 == $t03654736700))
916+ let $t03658636739 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
917+ if (($t03658636739 == $t03658636739))
916918 then {
917- let outInAmountAsset = $t03654736700._5
918- let bonus = $t03654736700._4
919- let feeAmount = $t03654736700._3
920- let commonState = $t03654736700._2
921- let amountEstimated = $t03654736700._1
919+ let outInAmountAsset = $t03658636739._5
920+ let bonus = $t03658636739._4
921+ let feeAmount = $t03658636739._3
922+ let commonState = $t03658636739._2
923+ let amountEstimated = $t03658636739._1
922924 let amount = if (if ((minOutAmount > 0))
923925 then (minOutAmount > amountEstimated)
924926 else false)
925927 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
926928 else amountEstimated
927929 let burnInv = invoke(factoryContract, "burn", [paymentAmount], [AttachedPayment(paymentAssetId, paymentAmount)])
928930 if ((burnInv == burnInv))
929931 then {
930932 let assetTransfer = [ScriptTransfer(userAddress, amount, outAssetId)]
931933 let sendFee = if ((feeAmount > 0))
932934 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
933935 else nil
934- let $t03720037447 = {
936+ let $t03723937486 = {
935937 let feeAmountForCalc = if ((this == feeCollectorAddress))
936938 then 0
937939 else feeAmount
938940 if (outInAmountAsset)
939941 then $Tuple2(-((amount + feeAmountForCalc)), 0)
940942 else $Tuple2(0, -((amount + feeAmountForCalc)))
941943 }
942- let amountAssetBalanceDelta = $t03720037447._1
943- let priceAssetBalanceDelta = $t03720037447._2
944- let $t03745037558 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
945- let refreshKLpActions = $t03745037558._1
946- let updatedKLp = $t03745037558._2
944+ let amountAssetBalanceDelta = $t03723937486._1
945+ let priceAssetBalanceDelta = $t03723937486._2
946+ let $t03748937597 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
947+ let refreshKLpActions = $t03748937597._1
948+ let updatedKLp = $t03748937597._2
947949 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
948950 if ((isUpdatedKLpValid == isUpdatedKLpValid))
949951 then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
950952 else throw("Strict value is not equal to itself.")
951953 }
952954 else throw("Strict value is not equal to itself.")
953955 }
954956 else throw("Strict value is not equal to itself.")
955957 }
956958 else throw("Strict value is not equal to itself.")
957959 }
958960
959961
960962
961963 @Callable(i)
962964 func getOneTknREADONLY (outAssetId,paymentAmount) = {
963- let $t03781537971 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
964- let amountEstimated = $t03781537971._1
965- let commonState = $t03781537971._2
966- let feeAmount = $t03781537971._3
967- let bonus = $t03781537971._4
968- let outInAmountAsset = $t03781537971._5
965+ let $t03785438010 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
966+ let amountEstimated = $t03785438010._1
967+ let commonState = $t03785438010._2
968+ let feeAmount = $t03785438010._3
969+ let bonus = $t03785438010._4
970+ let outInAmountAsset = $t03785438010._5
969971 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
970972 }
971973
972974
973975
974976 @Callable(i)
975977 func unstakeAndGetOneTkn (unstakeAmount,outAssetIdStr,minOutAmount) = {
976978 let isPoolOneTokenOperationsDisabled = {
977979 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
978980 if ($isInstanceOf(@, "Boolean"))
979981 then @
980982 else throw(($getType(@) + " couldn't be cast to Boolean"))
981983 }
982984 let isGetDisabled = if (if (isGlobalShutdown())
983985 then true
984986 else (cfgPoolStatus == PoolShutdown))
985987 then true
986988 else isPoolOneTokenOperationsDisabled
987989 let checks = [if (if (!(isGetDisabled))
988990 then true
989991 else isManager(i))
990992 then true
991993 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 0))
992994 then true
993995 else throwErr("no payments are expected")]
994996 if ((checks == checks))
995997 then {
996998 let outAssetId = parseAssetId(outAssetIdStr)
997999 let userAddress = i.caller
9981000 let txId = i.transactionId
9991001 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
10001002 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
10011003 if ((unstakeInv == unstakeInv))
10021004 then {
1003- let $t03887339024 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1004- if (($t03887339024 == $t03887339024))
1005+ let $t03891239063 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1006+ if (($t03891239063 == $t03891239063))
10051007 then {
1006- let outInAmountAsset = $t03887339024._5
1007- let bonus = $t03887339024._4
1008- let feeAmount = $t03887339024._3
1009- let commonState = $t03887339024._2
1010- let amountEstimated = $t03887339024._1
1008+ let outInAmountAsset = $t03891239063._5
1009+ let bonus = $t03891239063._4
1010+ let feeAmount = $t03891239063._3
1011+ let commonState = $t03891239063._2
1012+ let amountEstimated = $t03891239063._1
10111013 let amount = if (if ((minOutAmount > 0))
10121014 then (minOutAmount > amountEstimated)
10131015 else false)
10141016 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
10151017 else amountEstimated
10161018 let burnInv = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
10171019 if ((burnInv == burnInv))
10181020 then {
10191021 let assetTransfer = [ScriptTransfer(i.caller, amount, outAssetId)]
10201022 let sendFee = if ((feeAmount > 0))
10211023 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
10221024 else nil
1023- let $t03951939766 = {
1025+ let $t03955839805 = {
10241026 let feeAmountForCalc = if ((this == feeCollectorAddress))
10251027 then 0
10261028 else feeAmount
10271029 if (outInAmountAsset)
10281030 then $Tuple2(-((amount + feeAmountForCalc)), 0)
10291031 else $Tuple2(0, -((amount + feeAmountForCalc)))
10301032 }
1031- let amountAssetBalanceDelta = $t03951939766._1
1032- let priceAssetBalanceDelta = $t03951939766._2
1033- let $t03976939877 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1034- let refreshKLpActions = $t03976939877._1
1035- let updatedKLp = $t03976939877._2
1033+ let amountAssetBalanceDelta = $t03955839805._1
1034+ let priceAssetBalanceDelta = $t03955839805._2
1035+ let $t03980839916 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1036+ let refreshKLpActions = $t03980839916._1
1037+ let updatedKLp = $t03980839916._2
10361038 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10371039 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10381040 then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
10391041 else throw("Strict value is not equal to itself.")
10401042 }
10411043 else throw("Strict value is not equal to itself.")
10421044 }
10431045 else throw("Strict value is not equal to itself.")
10441046 }
10451047 else throw("Strict value is not equal to itself.")
10461048 }
10471049 else throw("Strict value is not equal to itself.")
10481050 }
10491051
10501052
10511053
10521054 @Callable(i)
10531055 func get () = {
10541056 let res = commonGet(i)
10551057 let outAmtAmt = res._1
10561058 let outPrAmt = res._2
10571059 let pmtAmt = res._3
10581060 let pmtAssetId = res._4
10591061 let state = res._5
10601062 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(pmtAmt))
10611063 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
10621064 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
10631065 then {
1064- let $t04082540907 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1065- let refreshKLpActions = $t04082540907._1
1066- let updatedKLp = $t04082540907._2
1066+ let $t04086440946 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1067+ let refreshKLpActions = $t04086440946._1
1068+ let updatedKLp = $t04086440946._2
10671069 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10681070 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10691071 then (state ++ refreshKLpActions)
10701072 else throw("Strict value is not equal to itself.")
10711073 }
10721074 else throw("Strict value is not equal to itself.")
10731075 }
10741076
10751077
10761078
10771079 @Callable(i)
10781080 func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = {
10791081 let res = commonGet(i)
10801082 let outAmAmt = res._1
10811083 let outPrAmt = res._2
10821084 let pmtAmt = res._3
10831085 let pmtAssetId = res._4
10841086 let state = res._5
10851087 if ((noLessThenAmtAsset > outAmAmt))
10861088 then throw(((("noLessThenAmtAsset failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset)))
10871089 else if ((noLessThenPriceAsset > outPrAmt))
10881090 then throw(((("noLessThenPriceAsset failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset)))
10891091 else {
10901092 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(pmtAmt))
10911093 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
10921094 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
10931095 then {
1094- let $t04185841939 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1095- let refreshKLpActions = $t04185841939._1
1096- let updatedKLp = $t04185841939._2
1096+ let $t04189741978 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1097+ let refreshKLpActions = $t04189741978._1
1098+ let updatedKLp = $t04189741978._2
10971099 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10981100 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10991101 then (state ++ refreshKLpActions)
11001102 else throw("Strict value is not equal to itself.")
11011103 }
11021104 else throw("Strict value is not equal to itself.")
11031105 }
11041106 }
11051107
11061108
11071109
11081110 @Callable(i)
11091111 func unstakeAndGet (amount) = {
11101112 let checkPayments = if ((size(i.payments) != 0))
11111113 then throw("No payments are expected")
11121114 else true
11131115 if ((checkPayments == checkPayments))
11141116 then {
11151117 let cfg = getPoolConfig()
11161118 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
11171119 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
11181120 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(lpAssetId), amount], nil)
11191121 if ((unstakeInv == unstakeInv))
11201122 then {
11211123 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller)
11221124 let outAmAmt = res._1
11231125 let outPrAmt = res._2
11241126 let poolStatus = parseIntValue(res._9)
11251127 let state = res._10
11261128 let checkPoolStatus = if (if (isGlobalShutdown())
11271129 then true
11281130 else (poolStatus == PoolShutdown))
11291131 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
11301132 else true
11311133 if ((checkPoolStatus == checkPoolStatus))
11321134 then {
11331135 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
11341136 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
11351137 then {
1136- let $t04306243143 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1137- let refreshKLpActions = $t04306243143._1
1138- let updatedKLp = $t04306243143._2
1138+ let $t04310143182 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1139+ let refreshKLpActions = $t04310143182._1
1140+ let updatedKLp = $t04310143182._2
11391141 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11401142 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11411143 then (state ++ refreshKLpActions)
11421144 else throw("Strict value is not equal to itself.")
11431145 }
11441146 else throw("Strict value is not equal to itself.")
11451147 }
11461148 else throw("Strict value is not equal to itself.")
11471149 }
11481150 else throw("Strict value is not equal to itself.")
11491151 }
11501152 else throw("Strict value is not equal to itself.")
11511153 }
11521154
11531155
11541156
11551157 @Callable(i)
11561158 func unstakeAndGetNoLess (unstakeAmount,noLessThenAmountAsset,noLessThenPriceAsset) = {
11571159 let isGetDisabled = if (isGlobalShutdown())
11581160 then true
11591161 else (cfgPoolStatus == PoolShutdown)
11601162 let checks = [if (!(isGetDisabled))
11611163 then true
11621164 else throw("get operation is blocked by admin"), if ((size(i.payments) == 0))
11631165 then true
11641166 else throw("no payments are expected")]
11651167 if ((checks == checks))
11661168 then {
11671169 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
11681170 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
11691171 if ((unstakeInv == unstakeInv))
11701172 then {
11711173 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller)
11721174 let outAmAmt = res._1
11731175 let outPrAmt = res._2
11741176 let state = res._10
11751177 let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset))
11761178 then true
11771179 else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset))
11781180 then true
11791181 else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))]
11801182 if ((checkAmounts == checkAmounts))
11811183 then {
11821184 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
11831185 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
11841186 then {
1185- let $t04443544516 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1186- let refreshKLpActions = $t04443544516._1
1187- let updatedKLp = $t04443544516._2
1187+ let $t04447444555 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1188+ let refreshKLpActions = $t04447444555._1
1189+ let updatedKLp = $t04447444555._2
11881190 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11891191 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11901192 then (state ++ refreshKLpActions)
11911193 else throw("Strict value is not equal to itself.")
11921194 }
11931195 else throw("Strict value is not equal to itself.")
11941196 }
11951197 else throw("Strict value is not equal to itself.")
11961198 }
11971199 else throw("Strict value is not equal to itself.")
11981200 }
11991201 else throw("Strict value is not equal to itself.")
12001202 }
12011203
12021204
12031205
12041206 @Callable(i)
12051207 func activate (amtAssetStr,priceAssetStr) = if ((toString(i.caller) != toString(factoryContract)))
12061208 then throw("permissions denied")
12071209 else $Tuple2([StringEntry(aa(), amtAssetStr), StringEntry(pa(), priceAssetStr)], "success")
12081210
12091211
12101212
12111213 @Callable(i)
12121214 func refreshKLp () = {
12131215 let lastRefreshedBlockHeight = valueOrElse(getInteger(keyKLpRefreshedHeight), 0)
12141216 let checkLastRefreshedBlockHeight = if (((height - lastRefreshedBlockHeight) >= kLpRefreshDelay))
12151217 then unit
12161218 else throwErr(makeString([toString(kLpRefreshDelay), " blocks have not passed since the previous call"], ""))
12171219 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
12181220 then {
12191221 let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
1220- let $t04570345767 = refreshKLpInternal(0, 0, 0)
1221- let kLpUpdateActions = $t04570345767._1
1222- let updatedKLp = $t04570345767._2
1222+ let $t04574245806 = refreshKLpInternal(0, 0, 0)
1223+ let kLpUpdateActions = $t04574245806._1
1224+ let updatedKLp = $t04574245806._2
12231225 let actions = if ((kLp != updatedKLp))
12241226 then kLpUpdateActions
12251227 else throwErr("nothing to refresh")
12261228 $Tuple2(actions, toString(updatedKLp))
12271229 }
12281230 else throw("Strict value is not equal to itself.")
12291231 }
12301232
12311233
12321234
12331235 @Callable(i)
12341236 func getPoolConfigWrapperREADONLY () = $Tuple2(nil, getPoolConfig())
12351237
12361238
12371239
12381240 @Callable(i)
12391241 func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId))
12401242
12411243
12421244
12431245 @Callable(i)
12441246 func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = {
12451247 let prices = calcPrices(amAmt, prAmt, lpAmt)
12461248 $Tuple2(nil, [toString(prices[0]), toString(prices[1]), toString(prices[2])])
12471249 }
12481250
12491251
12501252
12511253 @Callable(i)
12521254 func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(toX18(origVal, origScaleMult)))
12531255
12541256
12551257
12561258 @Callable(i)
12571259 func fromX18WrapperREADONLY (val,resultScaleMult) = $Tuple2(nil, fromX18(parseBigIntValue(val), resultScaleMult))
12581260
12591261
12601262
12611263 @Callable(i)
12621264 func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(calcPriceBigInt(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18))))
12631265
12641266
12651267
12661268 @Callable(i)
12671269 func estimatePutOperationWrapperREADONLY (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = $Tuple2(nil, estimatePutOperation(txId58, slippageTolerance, inAmAssetAmt, inAmAssetId, inPrAssetAmt, inPrAssetId, userAddress, isEvaluate, emitLp))
12681270
12691271
12701272
12711273 @Callable(i)
12721274 func estimateGetOperationWrapperREADONLY (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
12731275 let res = estimateGetOperation(txId58, pmtAssetId, pmtLpAmt, addressFromStringValue(userAddress))
12741276 $Tuple2(nil, $Tuple10(res._1, res._2, res._3, res._4, res._5, res._6, res._7, toString(res._8), res._9, res._10))
12751277 }
12761278
12771279
12781280
12791281 @Callable(i)
12801282 func statsREADONLY () = {
12811283 let cfg = getPoolConfig()
12821284 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
12831285 let amtAssetId = cfg[idxAmtAssetId]
12841286 let priceAssetId = cfg[idxPriceAssetId]
12851287 let iAmtAssetId = cfg[idxIAmtAssetId]
12861288 let iPriceAssetId = cfg[idxIPriceAssetId]
12871289 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
12881290 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
12891291 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
12901292 let accAmtAssetBalance = getAccBalance(amtAssetId)
12911293 let accPriceAssetBalance = getAccBalance(priceAssetId)
12921294 let pricesList = if ((poolLPBalance == 0))
12931295 then [zeroBigInt, zeroBigInt, zeroBigInt]
12941296 else calcPrices(accAmtAssetBalance, accPriceAssetBalance, poolLPBalance)
12951297 let curPrice = 0
12961298 let lpAmtAssetShare = fromX18(pricesList[1], scale8)
12971299 let lpPriceAssetShare = fromX18(pricesList[2], scale8)
12981300 let poolWeight = value(getInteger(factoryContract, keyPoolWeight(toString(this))))
12991301 $Tuple2(nil, makeString(["%d%d%d%d%d%d%d", toString(accAmtAssetBalance), toString(accPriceAssetBalance), toString(poolLPBalance), toString(curPrice), toString(lpAmtAssetShare), toString(lpPriceAssetShare), toString(poolWeight)], SEP))
13001302 }
13011303
13021304
13031305
13041306 @Callable(i)
13051307 func evaluatePutByAmountAssetREADONLY (inAmAssetAmt) = {
13061308 let cfg = getPoolConfig()
13071309 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
13081310 let amAssetIdStr = cfg[idxAmtAssetId]
13091311 let amAssetId = fromBase58String(amAssetIdStr)
13101312 let prAssetIdStr = cfg[idxPriceAssetId]
13111313 let prAssetId = fromBase58String(prAssetIdStr)
13121314 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
13131315 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
13141316 let poolStatus = cfg[idxPoolStatus]
13151317 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
13161318 let accAmtAssetBalance = getAccBalance(amAssetIdStr)
13171319 let accPriceAssetBalance = getAccBalance(prAssetIdStr)
13181320 let amtAssetAmtX18 = toX18(accAmtAssetBalance, amtAssetDcm)
13191321 let priceAssetAmtX18 = toX18(accPriceAssetBalance, priceAssetDcm)
13201322 let curPriceX18 = if ((poolLPBalance == 0))
13211323 then zeroBigInt
13221324 else calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
13231325 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
13241326 let inPrAssetAmtX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18)
13251327 let inPrAssetAmt = fromX18(inPrAssetAmtX18, priceAssetDcm)
13261328 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
13271329 let calcLpAmt = estPut._1
13281330 let curPriceCalc = estPut._3
13291331 let amBalance = estPut._4
13301332 let prBalance = estPut._5
13311333 let lpEmission = estPut._6
13321334 $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d", toString(calcLpAmt), toString(fromX18(curPriceX18, scale8)), toString(amBalance), toString(prBalance), toString(lpEmission), poolStatus, toString(inAmAssetAmt), toString(inPrAssetAmt)], SEP))
13331335 }
13341336
13351337
13361338
13371339 @Callable(i)
13381340 func evaluatePutByPriceAssetREADONLY (inPrAssetAmt) = {
13391341 let cfg = getPoolConfig()
13401342 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
13411343 let amAssetIdStr = cfg[idxAmtAssetId]
13421344 let amAssetId = fromBase58String(amAssetIdStr)
13431345 let prAssetIdStr = cfg[idxPriceAssetId]
13441346 let prAssetId = fromBase58String(prAssetIdStr)
13451347 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
13461348 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
13471349 let poolStatus = cfg[idxPoolStatus]
13481350 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
13491351 let amBalanceRaw = getAccBalance(amAssetIdStr)
13501352 let prBalanceRaw = getAccBalance(prAssetIdStr)
13511353 let amBalanceRawX18 = toX18(amBalanceRaw, amtAssetDcm)
13521354 let prBalanceRawX18 = toX18(prBalanceRaw, priceAssetDcm)
13531355 let curPriceX18 = if ((poolLPBalance == 0))
13541356 then zeroBigInt
13551357 else calcPriceBigInt(prBalanceRawX18, amBalanceRawX18)
13561358 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
13571359 let inAmAssetAmtX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
13581360 let inAmAssetAmt = fromX18(inAmAssetAmtX18, amtAssetDcm)
13591361 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
13601362 let calcLpAmt = estPut._1
13611363 let curPriceCalc = estPut._3
13621364 let amBalance = estPut._4
13631365 let prBalance = estPut._5
13641366 let lpEmission = estPut._6
13651367 $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d", toString(calcLpAmt), toString(fromX18(curPriceX18, scale8)), toString(amBalance), toString(prBalance), toString(lpEmission), poolStatus, toString(inAmAssetAmt), toString(inPrAssetAmt)], SEP))
13661368 }
13671369
13681370
13691371
13701372 @Callable(i)
13711373 func evaluateGetREADONLY (paymentLpAssetId,paymentLpAmt) = {
13721374 let res = estimateGetOperation("", paymentLpAssetId, paymentLpAmt, this)
13731375 let outAmAmt = res._1
13741376 let outPrAmt = res._2
13751377 let amBalance = res._5
13761378 let prBalance = res._6
13771379 let lpEmission = res._7
13781380 let curPrice = res._8
13791381 let poolStatus = parseIntValue(res._9)
13801382 $Tuple2(nil, makeString(["%d%d%d%d%d%d%d", toString(outAmAmt), toString(outPrAmt), toString(amBalance), toString(prBalance), toString(lpEmission), toString(curPrice), toString(poolStatus)], SEP))
13811383 }
13821384
13831385
13841386 @Verifier(tx)
13851387 func verify () = {
13861388 let targetPublicKey = match managerPublicKeyOrUnit() {
13871389 case pk: ByteVector =>
13881390 pk
13891391 case _: Unit =>
13901392 tx.senderPublicKey
13911393 case _ =>
13921394 throw("Match error")
13931395 }
13941396 match tx {
13951397 case order: Order =>
13961398 let matcherPub = getMatcherPubOrFail()
13971399 let orderValid = validateMatcherOrderAllowed(order)
13981400 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
13991401 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
14001402 if (if (if (orderValid)
14011403 then senderValid
14021404 else false)
14031405 then matcherValid
14041406 else false)
14051407 then true
14061408 else throwOrderError(orderValid, senderValid, matcherValid)
14071409 case s: SetScriptTransaction =>
14081410 let newHash = blake2b256(value(s.script))
14091411 let allowedHash = fromBase64String(value(getString(factoryContract, keyAllowedLpScriptHash())))
14101412 let currentHash = scriptHash(this)
14111413 if (if ((allowedHash == newHash))
14121414 then (currentHash != newHash)
14131415 else false)
14141416 then true
14151417 else sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
14161418 case _ =>
14171419 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
14181420 }
14191421 }
14201422

github/deemru/w8io/026f985 
173.85 ms