tx · HFvoyhykb9fQ6bDf2UBaDQz5mezzBqJi11FyxxrycYKz

3N7b3kPunHUXhZp1vMG9NhPMARNEprCMWxT:  -0.03500000 Waves

2022.12.22 18:13 [2371666] smart account 3N7b3kPunHUXhZp1vMG9NhPMARNEprCMWxT > SELF 0.00000000 Waves

{ "type": 13, "id": "HFvoyhykb9fQ6bDf2UBaDQz5mezzBqJi11FyxxrycYKz", "fee": 3500000, "feeAssetId": null, "timestamp": 1671722035290, "version": 1, "sender": "3N7b3kPunHUXhZp1vMG9NhPMARNEprCMWxT", "senderPublicKey": "AYbpHveq7zviKTDV7SGTB1pZGFbkumgfq3jSwVv6BznT", "proofs": [ "5NSA2zkb9dWqze5pqfV4RUgQh5eN3JjEQCi9hor1XZGPcxKk4CYAq5t6WefkSzFrt3gvHQhphkNGiFtwdHxnfKg" ], "script": "base64:BgKdLQgCEgMKAQgSABIECgIBBBIDCgEBEgQKAgEEEgQKAggBEgQKAggBEgQKAggBEgUKAwEIARIAEgQKAgEBEgMKAQESBQoDAQEBEgQKAggIEgASABIDCgEIEgUKAwEBARIECgIBARIECgIIARIECgIICBILCgkIAQECAQIIBAQSBgoECAgBCBIAEgMKAQESAwoBARIECgIIASIKbFBkZWNpbWFscyIGc2NhbGU4IgxzY2FsZThCaWdJbnQiB3NjYWxlMTgiCnplcm9CaWdJbnQiBGJpZzAiBGJpZzEiBGJpZzIiC3dhdmVzU3RyaW5nIgNTRVAiClBvb2xBY3RpdmUiD1Bvb2xQdXREaXNhYmxlZCITUG9vbE1hdGNoZXJEaXNhYmxlZCIMUG9vbFNodXRkb3duIg5pZHhQb29sQWRkcmVzcyINaWR4UG9vbFN0YXR1cyIQaWR4UG9vbExQQXNzZXRJZCINaWR4QW10QXNzZXRJZCIPaWR4UHJpY2VBc3NldElkIg5pZHhBbXRBc3NldERjbSIQaWR4UHJpY2VBc3NldERjbSIOaWR4SUFtdEFzc2V0SWQiEGlkeElQcmljZUFzc2V0SWQiDWlkeExQQXNzZXREY20i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BBQR0aGlzAwMJAAACBQJnRwUCZ0YJAQIhPQIFAmdIBQJnRgcGCQD0AwMIBQJnQglib2R5Qnl0ZXMJAJEDAggFAmdCBnByb29mcwAABQJnRAkA9AMDCAUCZ0IJYm9keUJ5dGVzCQCRAwIIBQJnQgZwcm9vZnMAAAUCZ0SyBPum", "chainId": 84, "height": 2371666, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9u3WnvJ2EpefuKDaYkB3bDYiEk9mYusqs94aADRhyoJM Next: 4bzqXSXCH5n36zEXh8uwmHVuTHmr92xRFt6yKN4LzJV9 Diff:
OldNewDifferences
541541 if ((chechSupply == chechSupply))
542542 then {
543543 let depositBigInt = toBigInt(paymentAmount)
544- let issueAmount = max([0, fromX18Round(fraction(supplyBigInt, (sqrtBigInt((scale18 + ((depositBigInt * scale18) / paymentBalanceBigInt)), 18, 18, DOWN) - scale18), scale18), scale8, FLOOR)])
544+ let issueAmount = max([0, toInt(((supplyBigInt * (sqrtBigInt((scale18 + ((depositBigInt * scale18) / paymentBalanceBigInt)), 18, 18, DOWN) - scale18)) / scale18))])
545545 let commonState = if (isEval)
546546 then nil
547547 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))]
548548 let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, cfgPriceAssetDecimals), toX18(amountBalanceOld, cfgAmountAssetDecimals))
549549 let priceOld = fromX18(priceOldX18, scale8)
550550 let loss = {
551- let $t02639726564 = if (paymentInAmountAsset)
551+ let $t02657726744 = if (paymentInAmountAsset)
552552 then $Tuple2(amountAssetAmountRaw, amountBalanceOld)
553553 else $Tuple2(priceAssetAmountRaw, priceBalanceOld)
554- let amount = $t02639726564._1
555- let balance = $t02639726564._2
554+ let amount = $t02657726744._1
555+ let balance = $t02657726744._2
556556 let issueAmountBoth = toInt(fraction(supplyBigInt, toBigInt((amount / 2)), toBigInt(balance)))
557557 fraction((issueAmount - issueAmountBoth), scale8, issueAmountBoth)
558558 }
591591 let outBalanceBigInt = toBigInt(outBalance)
592592 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
593593 let redeemedBigInt = toBigInt(paymentAmount)
594- let amountRaw = max([0, fromX18Round(fraction(balanceBigInt, (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN)), scale18), outInAmountAssetDecimals, FLOOR)])
595- let $t02846528515 = takeFee(amountRaw)
596- let totalAmount = $t02846528515._1
597- let feeAmount = $t02846528515._2
598- let $t02851928745 = if (outInAmountAsset)
594+ let amountRaw = max([0, toInt(((balanceBigInt * (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN))) / scale18))])
595+ let $t02882328873 = takeFee(amountRaw)
596+ let totalAmount = $t02882328873._1
597+ let feeAmount = $t02882328873._2
598+ let $t02887729103 = if (outInAmountAsset)
599599 then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld)
600600 else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw))
601- let outAmAmount = $t02851928745._1
602- let outPrAmount = $t02851928745._2
603- let amBalanceNew = $t02851928745._3
604- let prBalanceNew = $t02851928745._4
601+ let outAmAmount = $t02887729103._1
602+ let outPrAmount = $t02887729103._2
603+ let amBalanceNew = $t02887729103._3
604+ let prBalanceNew = $t02887729103._4
605605 let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, cfgPriceAssetDecimals), toX18(amBalanceNew, cfgAmountAssetDecimals))
606606 let priceNew = fromX18(priceNewX18, scale8)
607607 let commonState = if (isEval)
747747 else throw("Strict value is not equal to itself.")
748748 }
749749 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
750- let $t03327333735 = refreshKLpInternal(0, 0, 0)
751- if (($t03327333735 == $t03327333735))
750+ let $t03363134093 = refreshKLpInternal(0, 0, 0)
751+ if (($t03363134093 == $t03363134093))
752752 then {
753- let updatedKLp = $t03327333735._2
754- let refreshKLpActions = $t03327333735._1
753+ let updatedKLp = $t03363134093._2
754+ let refreshKLpActions = $t03363134093._1
755755 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
756756 if ((isUpdatedKLpValid == isUpdatedKLpValid))
757757 then ((state ++ lpTransfer) ++ refreshKLpActions)
783783 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
784784 if ((currentKLp == currentKLp))
785785 then {
786- let $t03429734362 = refreshKLpInternal(0, 0, 0)
787- let refreshKLpActions = $t03429734362._1
788- let updatedKLp = $t03429734362._2
786+ let $t03465534720 = refreshKLpInternal(0, 0, 0)
787+ let refreshKLpActions = $t03465534720._1
788+ let updatedKLp = $t03465534720._2
789789 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
790790 if ((isUpdatedKLpValid == isUpdatedKLpValid))
791791 then (state ++ refreshKLpActions)
832832 then {
833833 let userAddress = i.caller
834834 let txId = i.transactionId
835- let $t03555035702 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
836- if (($t03555035702 == $t03555035702))
835+ let $t03590836060 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
836+ if (($t03590836060 == $t03590836060))
837837 then {
838- let paymentInAmountAsset = $t03555035702._5
839- let bonus = $t03555035702._4
840- let feeAmount = $t03555035702._3
841- let commonState = $t03555035702._2
842- let emitAmountEstimated = $t03555035702._1
838+ let paymentInAmountAsset = $t03590836060._5
839+ let bonus = $t03590836060._4
840+ let feeAmount = $t03590836060._3
841+ let commonState = $t03590836060._2
842+ let emitAmountEstimated = $t03590836060._1
843843 let emitAmount = if (if ((minOutAmount > 0))
844844 then (minOutAmount > emitAmountEstimated)
845845 else false)
859859 let sendFee = if ((feeAmount > 0))
860860 then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
861861 else nil
862- let $t03628836485 = if ((this == feeCollectorAddress))
862+ let $t03664636843 = if ((this == feeCollectorAddress))
863863 then $Tuple2(0, 0)
864864 else if (paymentInAmountAsset)
865865 then $Tuple2(-(feeAmount), 0)
866866 else $Tuple2(0, -(feeAmount))
867- let amountAssetBalanceDelta = $t03628836485._1
868- let priceAssetBalanceDelta = $t03628836485._2
869- let $t03648836596 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
870- let refreshKLpActions = $t03648836596._1
871- let updatedKLp = $t03648836596._2
867+ let amountAssetBalanceDelta = $t03664636843._1
868+ let priceAssetBalanceDelta = $t03664636843._2
869+ let $t03684636954 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
870+ let refreshKLpActions = $t03684636954._1
871+ let updatedKLp = $t03684636954._2
872872 let kLp = value(getString(keyKLp))
873873 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
874874 if ((isUpdatedKLpValid == isUpdatedKLpValid))
888888
889889 @Callable(i)
890890 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
891- let $t03690237059 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
892- let emitAmountEstimated = $t03690237059._1
893- let commonState = $t03690237059._2
894- let feeAmount = $t03690237059._3
895- let bonus = $t03690237059._4
896- let paymentInAmountAsset = $t03690237059._5
891+ let $t03726037417 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
892+ let emitAmountEstimated = $t03726037417._1
893+ let commonState = $t03726037417._2
894+ let feeAmount = $t03726037417._3
895+ let bonus = $t03726037417._4
896+ let paymentInAmountAsset = $t03726037417._5
897897 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
898898 }
899899
930930 then {
931931 let userAddress = i.caller
932932 let txId = i.transactionId
933- let $t03794438097 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
934- if (($t03794438097 == $t03794438097))
933+ let $t03830238455 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
934+ if (($t03830238455 == $t03830238455))
935935 then {
936- let outInAmountAsset = $t03794438097._5
937- let bonus = $t03794438097._4
938- let feeAmount = $t03794438097._3
939- let commonState = $t03794438097._2
940- let amountEstimated = $t03794438097._1
936+ let outInAmountAsset = $t03830238455._5
937+ let bonus = $t03830238455._4
938+ let feeAmount = $t03830238455._3
939+ let commonState = $t03830238455._2
940+ let amountEstimated = $t03830238455._1
941941 let amount = if (if ((minOutAmount > 0))
942942 then (minOutAmount > amountEstimated)
943943 else false)
950950 let sendFee = if ((feeAmount > 0))
951951 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
952952 else nil
953- let $t03859738844 = {
953+ let $t03895539202 = {
954954 let feeAmountForCalc = if ((this == feeCollectorAddress))
955955 then 0
956956 else feeAmount
958958 then $Tuple2(-((amount + feeAmountForCalc)), 0)
959959 else $Tuple2(0, -((amount + feeAmountForCalc)))
960960 }
961- let amountAssetBalanceDelta = $t03859738844._1
962- let priceAssetBalanceDelta = $t03859738844._2
963- let $t03884738955 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
964- let refreshKLpActions = $t03884738955._1
965- let updatedKLp = $t03884738955._2
961+ let amountAssetBalanceDelta = $t03895539202._1
962+ let priceAssetBalanceDelta = $t03895539202._2
963+ let $t03920539313 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
964+ let refreshKLpActions = $t03920539313._1
965+ let updatedKLp = $t03920539313._2
966966 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
967967 if ((isUpdatedKLpValid == isUpdatedKLpValid))
968968 then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
981981
982982 @Callable(i)
983983 func getOneTknREADONLY (outAssetId,paymentAmount) = {
984- let $t03921239368 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
985- let amountEstimated = $t03921239368._1
986- let commonState = $t03921239368._2
987- let feeAmount = $t03921239368._3
988- let bonus = $t03921239368._4
989- let outInAmountAsset = $t03921239368._5
984+ let $t03957039726 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
985+ let amountEstimated = $t03957039726._1
986+ let commonState = $t03957039726._2
987+ let feeAmount = $t03957039726._3
988+ let bonus = $t03957039726._4
989+ let outInAmountAsset = $t03957039726._5
990990 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
991991 }
992992
10211021 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
10221022 if ((unstakeInv == unstakeInv))
10231023 then {
1024- let $t04027040421 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1025- if (($t04027040421 == $t04027040421))
1024+ let $t04062840779 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1025+ if (($t04062840779 == $t04062840779))
10261026 then {
1027- let outInAmountAsset = $t04027040421._5
1028- let bonus = $t04027040421._4
1029- let feeAmount = $t04027040421._3
1030- let commonState = $t04027040421._2
1031- let amountEstimated = $t04027040421._1
1027+ let outInAmountAsset = $t04062840779._5
1028+ let bonus = $t04062840779._4
1029+ let feeAmount = $t04062840779._3
1030+ let commonState = $t04062840779._2
1031+ let amountEstimated = $t04062840779._1
10321032 let amount = if (if ((minOutAmount > 0))
10331033 then (minOutAmount > amountEstimated)
10341034 else false)
10411041 let sendFee = if ((feeAmount > 0))
10421042 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
10431043 else nil
1044- let $t04091641163 = {
1044+ let $t04127441521 = {
10451045 let feeAmountForCalc = if ((this == feeCollectorAddress))
10461046 then 0
10471047 else feeAmount
10491049 then $Tuple2(-((amount + feeAmountForCalc)), 0)
10501050 else $Tuple2(0, -((amount + feeAmountForCalc)))
10511051 }
1052- let amountAssetBalanceDelta = $t04091641163._1
1053- let priceAssetBalanceDelta = $t04091641163._2
1054- let $t04116641274 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1055- let refreshKLpActions = $t04116641274._1
1056- let updatedKLp = $t04116641274._2
1052+ let amountAssetBalanceDelta = $t04127441521._1
1053+ let priceAssetBalanceDelta = $t04127441521._2
1054+ let $t04152441632 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1055+ let refreshKLpActions = $t04152441632._1
1056+ let updatedKLp = $t04152441632._2
10571057 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10581058 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10591059 then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
10841084 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
10851085 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
10861086 then {
1087- let $t04222042302 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1088- let refreshKLpActions = $t04222042302._1
1089- let updatedKLp = $t04222042302._2
1087+ let $t04257842660 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1088+ let refreshKLpActions = $t04257842660._1
1089+ let updatedKLp = $t04257842660._2
10901090 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10911091 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10921092 then (state ++ refreshKLpActions)
11181118 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
11191119 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
11201120 then {
1121- let $t04325143332 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1122- let refreshKLpActions = $t04325143332._1
1123- let updatedKLp = $t04325143332._2
1121+ let $t04360943690 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1122+ let refreshKLpActions = $t04360943690._1
1123+ let updatedKLp = $t04360943690._2
11241124 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11251125 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11261126 then (state ++ refreshKLpActions)
11641164 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
11651165 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
11661166 then {
1167- let $t04445844539 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1168- let refreshKLpActions = $t04445844539._1
1169- let updatedKLp = $t04445844539._2
1167+ let $t04481644897 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1168+ let refreshKLpActions = $t04481644897._1
1169+ let updatedKLp = $t04481644897._2
11701170 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11711171 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11721172 then (state ++ refreshKLpActions)
12171217 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
12181218 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
12191219 then {
1220- let $t04583445915 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1221- let refreshKLpActions = $t04583445915._1
1222- let updatedKLp = $t04583445915._2
1220+ let $t04619246273 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1221+ let refreshKLpActions = $t04619246273._1
1222+ let updatedKLp = $t04619246273._2
12231223 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
12241224 if ((isUpdatedKLpValid == isUpdatedKLpValid))
12251225 then (state ++ refreshKLpActions)
12541254 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
12551255 then {
12561256 let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
1257- let $t04710247166 = refreshKLpInternal(0, 0, 0)
1258- let kLpUpdateActions = $t04710247166._1
1259- let updatedKLp = $t04710247166._2
1257+ let $t04746047524 = refreshKLpInternal(0, 0, 0)
1258+ let kLpUpdateActions = $t04746047524._1
1259+ let updatedKLp = $t04746047524._2
12601260 let actions = if ((kLp != updatedKLp))
12611261 then kLpUpdateActions
12621262 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 fromX18Round (val,resultScaleMult,round) = toInt(fraction(val, toBigInt(resultScaleMult), scale18, round))
6969
7070
7171 func toScale (amt,resScale,curScale) = fraction(amt, resScale, curScale)
7272
7373
7474 func abs (val) = if ((0 > val))
7575 then -(val)
7676 else val
7777
7878
7979 func absBigInt (val) = if ((zeroBigInt > val))
8080 then -(val)
8181 else val
8282
8383
8484 func fc () = "%s__factoryContract"
8585
8686
8787 func mpk () = "%s__managerPublicKey"
8888
8989
9090 func pmpk () = "%s__pendingManagerPublicKey"
9191
9292
9393 func pl () = "%s%s__price__last"
9494
9595
9696 func ph (h,timestamp) = makeString(["%s%s%d%d__price__history", toString(h), toString(timestamp)], SEP)
9797
9898
9999 func pau (userAddress,txId) = ((("%s%s%s__P__" + userAddress) + "__") + txId)
100100
101101
102102 func gau (userAddress,txId) = ((("%s%s%s__G__" + userAddress) + "__") + txId)
103103
104104
105105 func aa () = "%s__amountAsset"
106106
107107
108108 func pa () = "%s__priceAsset"
109109
110110
111111 let keyFee = "%s__fee"
112112
113113 let feeDefault = fraction(10, scale8, 10000)
114114
115115 let fee = valueOrElse(getInteger(this, keyFee), feeDefault)
116116
117117 let keyKLp = makeString(["%s", "kLp"], SEP)
118118
119119 let keyKLpRefreshedHeight = makeString(["%s", "kLpRefreshedHeight"], SEP)
120120
121121 let keyKLpRefreshDelay = makeString(["%s", "refreshKLpDelay"], SEP)
122122
123123 let kLpRefreshDelayDefault = 30
124124
125125 let kLpRefreshDelay = valueOrElse(getInteger(this, keyKLpRefreshDelay), kLpRefreshDelayDefault)
126126
127127 func keyFactoryConfig () = "%s__factoryConfig"
128128
129129
130130 func keyMatcherPub () = "%s%s__matcher__publicKey"
131131
132132
133133 func keyMappingPoolContractAddressToPoolAssets (poolContractAddress) = (("%s%s%s__" + poolContractAddress) + "__mappings__poolContract2LpAsset")
134134
135135
136136 func keyPoolConfig (iAmtAsset,iPriceAsset) = (((("%d%d%s__" + iAmtAsset) + "__") + iPriceAsset) + "__config")
137137
138138
139139 func keyMappingsBaseAsset2internalId (baseAssetStr) = ("%s%s%s__mappings__baseAsset2internalId__" + baseAssetStr)
140140
141141
142142 func keyAllPoolsShutdown () = "%s__shutdown"
143143
144144
145145 func keyPoolWeight (contractAddress) = ("%s%s__poolWeight__" + contractAddress)
146146
147147
148148 func keyAllowedLpScriptHash () = "%s__allowedLpScriptHash"
149149
150150
151151 let keyFeeCollectorAddress = "%s__feeCollectorAddress"
152152
153153 func throwOrderError (orderValid,senderValid,matcherValid) = throw(((((("order validation failed: orderValid=" + toString(orderValid)) + " senderValid=") + toString(senderValid)) + " matcherValid=") + toString(matcherValid)))
154154
155155
156156 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
157157
158158
159159 func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
160160
161161
162162 func throwErr (msg) = throw(makeString(["lp.ride:", msg], " "))
163163
164164
165165 func fmtErr (msg) = makeString(["lp.ride:", msg], " ")
166166
167167
168168 let factoryContract = addressFromStringValue(getStringOrFail(this, fc()))
169169
170170 let feeCollectorAddress = addressFromStringValue(getStringOrFail(factoryContract, keyFeeCollectorAddress))
171171
172172 func isGlobalShutdown () = valueOrElse(getBoolean(factoryContract, keyAllPoolsShutdown()), false)
173173
174174
175175 func getMatcherPubOrFail () = fromBase58String(getStringOrFail(factoryContract, keyMatcherPub()))
176176
177177
178178 func getPoolConfig () = {
179179 let amtAsset = getStringOrFail(this, aa())
180180 let priceAsset = getStringOrFail(this, pa())
181181 let iPriceAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(priceAsset))
182182 let iAmtAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(amtAsset))
183183 split(getStringOrFail(factoryContract, keyPoolConfig(toString(iAmtAsset), toString(iPriceAsset))), SEP)
184184 }
185185
186186
187187 func parseAssetId (input) = if ((input == wavesString))
188188 then unit
189189 else fromBase58String(input)
190190
191191
192192 func assetIdToString (input) = if ((input == unit))
193193 then wavesString
194194 else toBase58String(value(input))
195195
196196
197197 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]))
198198
199199
200200 let poolConfigParsed = parsePoolConfig(getPoolConfig())
201201
202202 let $t080588224 = poolConfigParsed
203203
204204 let cfgPoolAddress = $t080588224._1
205205
206206 let cfgPoolStatus = $t080588224._2
207207
208208 let cfgLpAssetId = $t080588224._3
209209
210210 let cfgAmountAssetId = $t080588224._4
211211
212212 let cfgPriceAssetId = $t080588224._5
213213
214214 let cfgAmountAssetDecimals = $t080588224._6
215215
216216 let cfgPriceAssetDecimals = $t080588224._7
217217
218218 func getFactoryConfig () = split(getStringOrFail(factoryContract, keyFactoryConfig()), SEP)
219219
220220
221221 let stakingContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactoryStakingContract]), "incorrect staking address")
222222
223223 let slippageContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactorySlippageContract]), "incorrect staking address")
224224
225225 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)
226226
227227
228228 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)
229229
230230
231231 func getAccBalance (assetId) = if ((assetId == "WAVES"))
232232 then wavesBalance(this).available
233233 else assetBalance(this, fromBase58String(assetId))
234234
235235
236236 func calcPriceBigInt (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18)
237237
238238
239239 func calcPriceBigIntRound (prAmtX18,amAmtX18,round) = fraction(prAmtX18, scale18, amAmtX18, round)
240240
241241
242242 func privateCalcPrice (amAssetDcm,prAssetDcm,amAmt,prAmt) = {
243243 let amtAssetAmtX18 = toX18(amAmt, amAssetDcm)
244244 let priceAssetAmtX18 = toX18(prAmt, prAssetDcm)
245245 calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
246246 }
247247
248248
249249 func calcPrices (amAmt,prAmt,lpAmt) = {
250250 let cfg = getPoolConfig()
251251 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
252252 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
253253 let priceX18 = privateCalcPrice(amtAssetDcm, priceAssetDcm, amAmt, prAmt)
254254 let amAmtX18 = toX18(amAmt, amtAssetDcm)
255255 let prAmtX18 = toX18(prAmt, priceAssetDcm)
256256 let lpAmtX18 = toX18(lpAmt, scale8)
257257 let lpPriceInAmAssetX18 = calcPriceBigInt(amAmtX18, lpAmtX18)
258258 let lpPriceInPrAssetX18 = calcPriceBigInt(prAmtX18, lpAmtX18)
259259 [priceX18, lpPriceInAmAssetX18, lpPriceInPrAssetX18]
260260 }
261261
262262
263263 func calculatePrices (amAmt,prAmt,lpAmt) = {
264264 let prices = calcPrices(amAmt, prAmt, lpAmt)
265265 [fromX18(prices[0], scale8), fromX18(prices[1], scale8), fromX18(prices[2], scale8)]
266266 }
267267
268268
269269 func estimateGetOperation (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
270270 let cfg = getPoolConfig()
271271 let lpAssetId = cfg[idxPoolLPAssetId]
272272 let amAssetId = cfg[idxAmtAssetId]
273273 let prAssetId = cfg[idxPriceAssetId]
274274 let amAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
275275 let prAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
276276 let poolStatus = cfg[idxPoolStatus]
277277 let lpEmission = valueOrErrorMessage(assetInfo(fromBase58String(lpAssetId)), (("Asset " + lpAssetId) + " doesn't exist")).quantity
278278 if ((lpAssetId != pmtAssetId))
279279 then throw("Invalid asset passed.")
280280 else {
281281 let amBalance = getAccBalance(amAssetId)
282282 let amBalanceX18 = toX18(amBalance, amAssetDcm)
283283 let prBalance = getAccBalance(prAssetId)
284284 let prBalanceX18 = toX18(prBalance, prAssetDcm)
285285 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
286286 let curPrice = fromX18(curPriceX18, scale8)
287287 let pmtLpAmtX18 = toX18(pmtLpAmt, scale8)
288288 let lpEmissionX18 = toX18(lpEmission, scale8)
289289 let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissionX18)
290290 let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissionX18)
291291 let outAmAmt = fromX18Round(outAmAmtX18, amAssetDcm, FLOOR)
292292 let outPrAmt = fromX18Round(outPrAmtX18, prAssetDcm, FLOOR)
293293 let state = if ((txId58 == ""))
294294 then nil
295295 else [ScriptTransfer(userAddress, outAmAmt, if ((amAssetId == "WAVES"))
296296 then unit
297297 else fromBase58String(amAssetId)), ScriptTransfer(userAddress, outPrAmt, if ((prAssetId == "WAVES"))
298298 then unit
299299 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)]
300300 $Tuple10(outAmAmt, outPrAmt, amAssetId, prAssetId, amBalance, prBalance, lpEmission, curPriceX18, poolStatus, state)
301301 }
302302 }
303303
304304
305305 func estimatePutOperation (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = {
306306 let cfg = getPoolConfig()
307307 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
308308 let amAssetIdStr = cfg[idxAmtAssetId]
309309 let prAssetIdStr = cfg[idxPriceAssetId]
310310 let iAmtAssetId = cfg[idxIAmtAssetId]
311311 let iPriceAssetId = cfg[idxIPriceAssetId]
312312 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
313313 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
314314 let poolStatus = cfg[idxPoolStatus]
315315 let lpEmission = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
316316 let inAmAssetIdStr = toBase58String(valueOrElse(inAmAssetId, fromBase58String("WAVES")))
317317 let inPrAssetIdStr = toBase58String(valueOrElse(inPrAssetId, fromBase58String("WAVES")))
318318 if (if ((amAssetIdStr != inAmAssetIdStr))
319319 then true
320320 else (prAssetIdStr != inPrAssetIdStr))
321321 then throw("Invalid amt or price asset passed.")
322322 else {
323323 let amBalance = if (isEvaluate)
324324 then getAccBalance(amAssetIdStr)
325325 else (getAccBalance(amAssetIdStr) - inAmAssetAmt)
326326 let prBalance = if (isEvaluate)
327327 then getAccBalance(prAssetIdStr)
328328 else (getAccBalance(prAssetIdStr) - inPrAssetAmt)
329329 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
330330 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
331331 let userPriceX18 = calcPriceBigInt(inPrAssetAmtX18, inAmAssetAmtX18)
332332 let amBalanceX18 = toX18(amBalance, amtAssetDcm)
333333 let prBalanceX18 = toX18(prBalance, priceAssetDcm)
334334 let res = if ((lpEmission == 0))
335335 then {
336336 let curPriceX18 = zeroBigInt
337337 let slippageX18 = zeroBigInt
338338 let lpAmtX18 = pow((inAmAssetAmtX18 * inPrAssetAmtX18), 0, toBigInt(5), 1, 0, DOWN)
339339 $Tuple5(fromX18(lpAmtX18, scale8), fromX18(inAmAssetAmtX18, amtAssetDcm), fromX18(inPrAssetAmtX18, priceAssetDcm), calcPriceBigInt((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18)
340340 }
341341 else {
342342 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
343343 let slippageX18 = fraction(absBigInt((curPriceX18 - userPriceX18)), scale18, curPriceX18)
344344 let slippageToleranceX18 = toX18(slippageTolerance, scale8)
345345 if (if ((curPriceX18 != zeroBigInt))
346346 then (slippageX18 > slippageToleranceX18)
347347 else false)
348348 then throw(((("Price slippage " + toString(slippageX18)) + " exceeded the passed limit of ") + toString(slippageToleranceX18)))
349349 else {
350350 let lpEmissionX18 = toX18(lpEmission, scale8)
351351 let prViaAmX18 = fraction(inAmAssetAmtX18, calcPriceBigIntRound(prBalanceX18, amBalanceX18, CEILING), scale18, CEILING)
352352 let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, calcPriceBigIntRound(prBalanceX18, amBalanceX18, FLOOR), CEILING)
353353 let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18))
354354 then $Tuple2(amViaPrX18, inPrAssetAmtX18)
355355 else $Tuple2(inAmAssetAmtX18, prViaAmX18)
356356 let expAmtAssetAmtX18 = expectedAmts._1
357357 let expPriceAssetAmtX18 = expectedAmts._2
358358 let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18, FLOOR)
359359 $Tuple5(fromX18Round(lpAmtX18, scale8, FLOOR), fromX18Round(expAmtAssetAmtX18, amtAssetDcm, CEILING), fromX18Round(expPriceAssetAmtX18, priceAssetDcm, CEILING), curPriceX18, slippageX18)
360360 }
361361 }
362362 let calcLpAmt = res._1
363363 let calcAmAssetPmt = res._2
364364 let calcPrAssetPmt = res._3
365365 let curPrice = fromX18(res._4, scale8)
366366 let slippageCalc = fromX18(res._5, scale8)
367367 if ((0 >= calcLpAmt))
368368 then throw("Invalid calculations. LP calculated is less than zero.")
369369 else {
370370 let emitLpAmt = if (!(emitLp))
371371 then 0
372372 else calcLpAmt
373373 let amDiff = (inAmAssetAmt - calcAmAssetPmt)
374374 let prDiff = (inPrAssetAmt - calcPrAssetPmt)
375375 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))]
376376 $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEmission, lpAssetId, poolStatus, commonState, amDiff, prDiff, inAmAssetId, inPrAssetId)
377377 }
378378 }
379379 }
380380
381381
382382 func calcKLp (amountBalance,priceBalance,lpEmission) = {
383383 let updatedKLp = fraction(pow((amountBalance * priceBalance), 0, toBigInt(5), 1, 18, DOWN), big1, lpEmission)
384384 if ((lpEmission == big0))
385385 then big0
386386 else updatedKLp
387387 }
388388
389389
390390 func calcCurrentKLp (amountAssetDelta,priceAssetDelta,lpAssetEmissionDelta) = {
391391 let amountAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) - amountAssetDelta)
392392 let priceAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) - priceAssetDelta)
393393 let lpAssetEmission = (toBigInt(value(assetInfo(cfgLpAssetId)).quantity) - lpAssetEmissionDelta)
394394 let currentKLp = calcKLp(amountAssetBalance, priceAssetBalance, lpAssetEmission)
395395 currentKLp
396396 }
397397
398398
399399 func refreshKLpInternal (amountAssetBalanceDelta,priceAssetBalanceDelta,lpAssetEmissionDelta) = {
400400 let amountAssetBalance = (getAccBalance(assetIdToString(cfgAmountAssetId)) + amountAssetBalanceDelta)
401401 let priceAssetBalance = (getAccBalance(assetIdToString(cfgPriceAssetId)) + priceAssetBalanceDelta)
402402 let lpAssetEmission = (value(assetInfo(cfgLpAssetId)).quantity + lpAssetEmissionDelta)
403403 let updatedKLp = calcKLp(toBigInt(amountAssetBalance), toBigInt(priceAssetBalance), toBigInt(lpAssetEmission))
404404 let actions = [IntegerEntry(keyKLpRefreshedHeight, height), StringEntry(keyKLp, toString(updatedKLp))]
405405 $Tuple2(actions, updatedKLp)
406406 }
407407
408408
409409 func validateUpdatedKLp (oldKLp,updatedKLp) = if ((updatedKLp >= oldKLp))
410410 then true
411411 else throwErr(makeString(["updated KLp lower than current KLp", toString(oldKLp), toString(updatedKLp)], " "))
412412
413413
414414 func validateMatcherOrderAllowed (order) = {
415415 let amountAssetAmount = order.amount
416416 let priceAssetAmount = fraction(order.amount, order.price, scale8, FLOOR)
417417 let $t02080121013 = if ((order.orderType == Buy))
418418 then $Tuple2(amountAssetAmount, -(priceAssetAmount))
419419 else $Tuple2(-(amountAssetAmount), priceAssetAmount)
420420 let amountAssetBalanceDelta = $t02080121013._1
421421 let priceAssetBalanceDelta = $t02080121013._2
422422 if (if (if (isGlobalShutdown())
423423 then true
424424 else (cfgPoolStatus == PoolMatcherDisabled))
425425 then true
426426 else (cfgPoolStatus == PoolShutdown))
427427 then throw("Exchange operations disabled")
428428 else if (if ((order.assetPair.amountAsset != cfgAmountAssetId))
429429 then true
430430 else (order.assetPair.priceAsset != cfgPriceAssetId))
431431 then throw("Wrong order assets.")
432432 else {
433433 let kLp = valueOrErrorMessage(parseBigInt(valueOrErrorMessage(getString(this, keyKLp), fmtErr("kLp is required"))), fmtErr("invalid kLp"))
434434 let $t02148421584 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
435435 let unusedActions = $t02148421584._1
436436 let kLpNew = $t02148421584._2
437437 let isOrderValid = (kLpNew >= kLp)
438438 isOrderValid
439439 }
440440 }
441441
442442
443443 func commonGet (i) = if ((size(i.payments) != 1))
444444 then throw("exactly 1 payment is expected")
445445 else {
446446 let pmt = value(i.payments[0])
447447 let pmtAssetId = value(pmt.assetId)
448448 let pmtAmt = pmt.amount
449449 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller)
450450 let outAmAmt = res._1
451451 let outPrAmt = res._2
452452 let poolStatus = parseIntValue(res._9)
453453 let state = res._10
454454 if (if (isGlobalShutdown())
455455 then true
456456 else (poolStatus == PoolShutdown))
457457 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
458458 else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state)
459459 }
460460
461461
462462 func commonPut (i,slippageTolerance,emitLp) = if ((size(i.payments) != 2))
463463 then throw("exactly 2 payments are expected")
464464 else {
465465 let amAssetPmt = value(i.payments[0])
466466 let prAssetPmt = value(i.payments[1])
467467 let estPut = estimatePutOperation(toBase58String(i.transactionId), slippageTolerance, amAssetPmt.amount, amAssetPmt.assetId, prAssetPmt.amount, prAssetPmt.assetId, toString(i.caller), false, emitLp)
468468 let poolStatus = parseIntValue(estPut._8)
469469 if (if (if (isGlobalShutdown())
470470 then true
471471 else (poolStatus == PoolPutDisabled))
472472 then true
473473 else (poolStatus == PoolShutdown))
474474 then throw(("Put operation is blocked by admin. Status = " + toString(poolStatus)))
475475 else estPut
476476 }
477477
478478
479479 func emit (amount) = {
480480 let emitInv = invoke(factoryContract, "emit", [amount], nil)
481481 if ((emitInv == emitInv))
482482 then {
483483 let emitInvLegacy = match emitInv {
484484 case legacyFactoryContract: Address =>
485485 invoke(legacyFactoryContract, "emit", [amount], nil)
486486 case _ =>
487487 unit
488488 }
489489 if ((emitInvLegacy == emitInvLegacy))
490490 then amount
491491 else throw("Strict value is not equal to itself.")
492492 }
493493 else throw("Strict value is not equal to itself.")
494494 }
495495
496496
497497 func takeFee (amount) = {
498498 let feeAmount = fraction(amount, fee, scale8)
499499 $Tuple2((amount - feeAmount), feeAmount)
500500 }
501501
502502
503503 func calcPutOneToken (paymentAmountRaw,paymentAssetId,userAddress,txId) = {
504504 let isEval = (txId == unit)
505505 let amountBalanceRaw = getAccBalance(assetIdToString(cfgAmountAssetId))
506506 let priceBalanceRaw = getAccBalance(assetIdToString(cfgPriceAssetId))
507507 let paymentInAmountAsset = if ((paymentAssetId == cfgAmountAssetId))
508508 then true
509509 else if ((paymentAssetId == cfgPriceAssetId))
510510 then false
511511 else throwErr("invalid asset")
512512 let $t02426924562 = if (isEval)
513513 then $Tuple2(amountBalanceRaw, priceBalanceRaw)
514514 else if (paymentInAmountAsset)
515515 then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw)
516516 else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw))
517517 let amountBalanceOld = $t02426924562._1
518518 let priceBalanceOld = $t02426924562._2
519519 let $t02456624715 = if (paymentInAmountAsset)
520520 then $Tuple2(paymentAmountRaw, 0)
521521 else $Tuple2(0, paymentAmountRaw)
522522 let amountAssetAmountRaw = $t02456624715._1
523523 let priceAssetAmountRaw = $t02456624715._2
524524 let amountAssetAmount = takeFee(amountAssetAmountRaw)._1
525525 let priceAssetAmount = takeFee(priceAssetAmountRaw)._1
526526 let $t02483724896 = takeFee(paymentAmountRaw)
527527 let paymentAmount = $t02483724896._1
528528 let feeAmount = $t02483724896._2
529529 let amountBalanceNew = (amountBalanceOld + amountAssetAmount)
530530 let priceBalanceNew = (priceBalanceOld + priceAssetAmount)
531531 let priceNewX18 = calcPriceBigInt(toX18(priceBalanceNew, cfgPriceAssetDecimals), toX18(amountBalanceNew, cfgAmountAssetDecimals))
532532 let priceNew = fromX18(priceNewX18, scale8)
533533 let paymentBalance = if (paymentInAmountAsset)
534534 then amountBalanceOld
535535 else priceBalanceOld
536536 let paymentBalanceBigInt = toBigInt(paymentBalance)
537537 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
538538 let chechSupply = if ((supplyBigInt > big0))
539539 then true
540540 else throwErr("initial deposit requires all coins")
541541 if ((chechSupply == chechSupply))
542542 then {
543543 let depositBigInt = toBigInt(paymentAmount)
544- let issueAmount = max([0, fromX18Round(fraction(supplyBigInt, (sqrtBigInt((scale18 + ((depositBigInt * scale18) / paymentBalanceBigInt)), 18, 18, DOWN) - scale18), scale18), scale8, FLOOR)])
544+ let issueAmount = max([0, toInt(((supplyBigInt * (sqrtBigInt((scale18 + ((depositBigInt * scale18) / paymentBalanceBigInt)), 18, 18, DOWN) - scale18)) / scale18))])
545545 let commonState = if (isEval)
546546 then nil
547547 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))]
548548 let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, cfgPriceAssetDecimals), toX18(amountBalanceOld, cfgAmountAssetDecimals))
549549 let priceOld = fromX18(priceOldX18, scale8)
550550 let loss = {
551- let $t02639726564 = if (paymentInAmountAsset)
551+ let $t02657726744 = if (paymentInAmountAsset)
552552 then $Tuple2(amountAssetAmountRaw, amountBalanceOld)
553553 else $Tuple2(priceAssetAmountRaw, priceBalanceOld)
554- let amount = $t02639726564._1
555- let balance = $t02639726564._2
554+ let amount = $t02657726744._1
555+ let balance = $t02657726744._2
556556 let issueAmountBoth = toInt(fraction(supplyBigInt, toBigInt((amount / 2)), toBigInt(balance)))
557557 fraction((issueAmount - issueAmountBoth), scale8, issueAmountBoth)
558558 }
559559 $Tuple5(issueAmount, commonState, feeAmount, loss, paymentInAmountAsset)
560560 }
561561 else throw("Strict value is not equal to itself.")
562562 }
563563
564564
565565 func calcGetOneToken (outAssetId,paymentAmount,paymentAssetId,userAddress,txId) = {
566566 let isEval = (txId == unit)
567567 let cfg = getPoolConfig()
568568 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
569569 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
570570 let checks = [if ((paymentAssetId == cfgLpAssetId))
571571 then true
572572 else throwErr("invalid lp asset")]
573573 if ((checks == checks))
574574 then {
575575 let outInAmountAsset = if ((outAssetId == cfgAmountAssetId))
576576 then true
577577 else if ((outAssetId == cfgPriceAssetId))
578578 then false
579579 else throwErr("invalid asset")
580580 let balanceBigInt = if (outInAmountAsset)
581581 then toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId)))
582582 else toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId)))
583583 let outInAmountAssetDecimals = if (outInAmountAsset)
584584 then amtAssetDcm
585585 else priceAssetDcm
586586 let amBalanceOld = getAccBalance(assetIdToString(cfgAmountAssetId))
587587 let prBalanceOld = getAccBalance(assetIdToString(cfgPriceAssetId))
588588 let outBalance = if (outInAmountAsset)
589589 then amBalanceOld
590590 else prBalanceOld
591591 let outBalanceBigInt = toBigInt(outBalance)
592592 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
593593 let redeemedBigInt = toBigInt(paymentAmount)
594- let amountRaw = max([0, fromX18Round(fraction(balanceBigInt, (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN)), scale18), outInAmountAssetDecimals, FLOOR)])
595- let $t02846528515 = takeFee(amountRaw)
596- let totalAmount = $t02846528515._1
597- let feeAmount = $t02846528515._2
598- let $t02851928745 = if (outInAmountAsset)
594+ let amountRaw = max([0, toInt(((balanceBigInt * (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN))) / scale18))])
595+ let $t02882328873 = takeFee(amountRaw)
596+ let totalAmount = $t02882328873._1
597+ let feeAmount = $t02882328873._2
598+ let $t02887729103 = if (outInAmountAsset)
599599 then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld)
600600 else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw))
601- let outAmAmount = $t02851928745._1
602- let outPrAmount = $t02851928745._2
603- let amBalanceNew = $t02851928745._3
604- let prBalanceNew = $t02851928745._4
601+ let outAmAmount = $t02887729103._1
602+ let outPrAmount = $t02887729103._2
603+ let amBalanceNew = $t02887729103._3
604+ let prBalanceNew = $t02887729103._4
605605 let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, cfgPriceAssetDecimals), toX18(amBalanceNew, cfgAmountAssetDecimals))
606606 let priceNew = fromX18(priceNewX18, scale8)
607607 let commonState = if (isEval)
608608 then nil
609609 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)]
610610 let priceOldX18 = calcPriceBigInt(toX18(prBalanceOld, cfgPriceAssetDecimals), toX18(amBalanceOld, cfgAmountAssetDecimals))
611611 let priceOld = fromX18(priceOldX18, scale8)
612612 let loss = {
613613 let amountBothInPaymentAsset = (toInt(fraction(balanceBigInt, redeemedBigInt, supplyBigInt)) * 2)
614614 fraction((totalAmount - amountBothInPaymentAsset), scale8, amountBothInPaymentAsset)
615615 }
616616 $Tuple5(totalAmount, commonState, feeAmount, loss, outInAmountAsset)
617617 }
618618 else throw("Strict value is not equal to itself.")
619619 }
620620
621621
622622 func managerPublicKeyOrUnit () = match getString(mpk()) {
623623 case s: String =>
624624 fromBase58String(s)
625625 case _: Unit =>
626626 unit
627627 case _ =>
628628 throw("Match error")
629629 }
630630
631631
632632 func pendingManagerPublicKeyOrUnit () = match getString(pmpk()) {
633633 case s: String =>
634634 fromBase58String(s)
635635 case _: Unit =>
636636 unit
637637 case _ =>
638638 throw("Match error")
639639 }
640640
641641
642642 func isManager (i) = match managerPublicKeyOrUnit() {
643643 case pk: ByteVector =>
644644 (i.callerPublicKey == pk)
645645 case _: Unit =>
646646 (i.caller == this)
647647 case _ =>
648648 throw("Match error")
649649 }
650650
651651
652652 func mustManager (i) = {
653653 let pd = throw("Permission denied")
654654 match managerPublicKeyOrUnit() {
655655 case pk: ByteVector =>
656656 if ((i.callerPublicKey == pk))
657657 then true
658658 else pd
659659 case _: Unit =>
660660 if ((i.caller == this))
661661 then true
662662 else pd
663663 case _ =>
664664 throw("Match error")
665665 }
666666 }
667667
668668
669669 @Callable(i)
670670 func setManager (pendingManagerPublicKey) = {
671671 let checkCaller = mustManager(i)
672672 if ((checkCaller == checkCaller))
673673 then {
674674 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
675675 if ((checkManagerPublicKey == checkManagerPublicKey))
676676 then [StringEntry(pmpk(), pendingManagerPublicKey)]
677677 else throw("Strict value is not equal to itself.")
678678 }
679679 else throw("Strict value is not equal to itself.")
680680 }
681681
682682
683683
684684 @Callable(i)
685685 func confirmManager () = {
686686 let pm = pendingManagerPublicKeyOrUnit()
687687 let hasPM = if (isDefined(pm))
688688 then true
689689 else throw("No pending manager")
690690 if ((hasPM == hasPM))
691691 then {
692692 let checkPM = if ((i.callerPublicKey == value(pm)))
693693 then true
694694 else throw("You are not pending manager")
695695 if ((checkPM == checkPM))
696696 then [StringEntry(mpk(), toBase58String(value(pm))), DeleteEntry(pmpk())]
697697 else throw("Strict value is not equal to itself.")
698698 }
699699 else throw("Strict value is not equal to itself.")
700700 }
701701
702702
703703
704704 @Callable(i)
705705 func put (slippageTolerance,shouldAutoStake) = if ((0 > slippageTolerance))
706706 then throw("Invalid slippageTolerance passed")
707707 else {
708708 let estPut = commonPut(i, slippageTolerance, true)
709709 let emitLpAmt = estPut._2
710710 let lpAssetId = estPut._7
711711 let state = estPut._9
712712 let amDiff = estPut._10
713713 let prDiff = estPut._11
714714 let amId = estPut._12
715715 let prId = estPut._13
716716 let amAssetPmt = toBigInt(value(i.payments[0]).amount)
717717 let prAssetPmt = toBigInt(value(i.payments[1]).amount)
718718 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
719719 if ((currentKLp == currentKLp))
720720 then {
721721 let emitInv = invoke(factoryContract, "emit", [emitLpAmt], nil)
722722 if ((emitInv == emitInv))
723723 then {
724724 let emitInvLegacy = match emitInv {
725725 case legacyFactoryContract: Address =>
726726 invoke(legacyFactoryContract, "emit", [emitLpAmt], nil)
727727 case _ =>
728728 unit
729729 }
730730 if ((emitInvLegacy == emitInvLegacy))
731731 then {
732732 let slippageAInv = if ((amDiff > 0))
733733 then invoke(slippageContract, "put", nil, [AttachedPayment(amId, amDiff)])
734734 else nil
735735 if ((slippageAInv == slippageAInv))
736736 then {
737737 let slippagePInv = if ((prDiff > 0))
738738 then invoke(slippageContract, "put", nil, [AttachedPayment(prId, prDiff)])
739739 else nil
740740 if ((slippagePInv == slippagePInv))
741741 then {
742742 let lpTransfer = if (shouldAutoStake)
743743 then {
744744 let slpStakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)])
745745 if ((slpStakeInv == slpStakeInv))
746746 then nil
747747 else throw("Strict value is not equal to itself.")
748748 }
749749 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
750- let $t03327333735 = refreshKLpInternal(0, 0, 0)
751- if (($t03327333735 == $t03327333735))
750+ let $t03363134093 = refreshKLpInternal(0, 0, 0)
751+ if (($t03363134093 == $t03363134093))
752752 then {
753- let updatedKLp = $t03327333735._2
754- let refreshKLpActions = $t03327333735._1
753+ let updatedKLp = $t03363134093._2
754+ let refreshKLpActions = $t03363134093._1
755755 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
756756 if ((isUpdatedKLpValid == isUpdatedKLpValid))
757757 then ((state ++ lpTransfer) ++ refreshKLpActions)
758758 else throw("Strict value is not equal to itself.")
759759 }
760760 else throw("Strict value is not equal to itself.")
761761 }
762762 else throw("Strict value is not equal to itself.")
763763 }
764764 else throw("Strict value is not equal to itself.")
765765 }
766766 else throw("Strict value is not equal to itself.")
767767 }
768768 else throw("Strict value is not equal to itself.")
769769 }
770770 else throw("Strict value is not equal to itself.")
771771 }
772772
773773
774774
775775 @Callable(i)
776776 func putForFree (maxSlippage) = if ((0 > maxSlippage))
777777 then throw("Invalid value passed")
778778 else {
779779 let estPut = commonPut(i, maxSlippage, false)
780780 let state = estPut._9
781781 let amAssetPmt = toBigInt(value(i.payments[0]).amount)
782782 let prAssetPmt = toBigInt(value(i.payments[1]).amount)
783783 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
784784 if ((currentKLp == currentKLp))
785785 then {
786- let $t03429734362 = refreshKLpInternal(0, 0, 0)
787- let refreshKLpActions = $t03429734362._1
788- let updatedKLp = $t03429734362._2
786+ let $t03465534720 = refreshKLpInternal(0, 0, 0)
787+ let refreshKLpActions = $t03465534720._1
788+ let updatedKLp = $t03465534720._2
789789 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
790790 if ((isUpdatedKLpValid == isUpdatedKLpValid))
791791 then (state ++ refreshKLpActions)
792792 else throw("Strict value is not equal to itself.")
793793 }
794794 else throw("Strict value is not equal to itself.")
795795 }
796796
797797
798798
799799 @Callable(i)
800800 func putOneTkn (minOutAmount,autoStake) = {
801801 let isPoolOneTokenOperationsDisabled = {
802802 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
803803 if ($isInstanceOf(@, "Boolean"))
804804 then @
805805 else throw(($getType(@) + " couldn't be cast to Boolean"))
806806 }
807807 let isPutDisabled = if (if (if (isGlobalShutdown())
808808 then true
809809 else (cfgPoolStatus == PoolPutDisabled))
810810 then true
811811 else (cfgPoolStatus == PoolShutdown))
812812 then true
813813 else isPoolOneTokenOperationsDisabled
814814 let checks = [if (if (!(isPutDisabled))
815815 then true
816816 else isManager(i))
817817 then true
818818 else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1))
819819 then true
820820 else throwErr("exactly 1 payment are expected")]
821821 if ((checks == checks))
822822 then {
823823 let payment = i.payments[0]
824824 let paymentAssetId = payment.assetId
825825 let paymentAmountRaw = payment.amount
826826 let currentKLp = if ((paymentAssetId == cfgAmountAssetId))
827827 then calcCurrentKLp(toBigInt(paymentAmountRaw), toBigInt(0), toBigInt(0))
828828 else if ((paymentAssetId == cfgPriceAssetId))
829829 then calcCurrentKLp(toBigInt(0), toBigInt(paymentAmountRaw), toBigInt(0))
830830 else throwErr("payment asset is not supported")
831831 if ((currentKLp == currentKLp))
832832 then {
833833 let userAddress = i.caller
834834 let txId = i.transactionId
835- let $t03555035702 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
836- if (($t03555035702 == $t03555035702))
835+ let $t03590836060 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
836+ if (($t03590836060 == $t03590836060))
837837 then {
838- let paymentInAmountAsset = $t03555035702._5
839- let bonus = $t03555035702._4
840- let feeAmount = $t03555035702._3
841- let commonState = $t03555035702._2
842- let emitAmountEstimated = $t03555035702._1
838+ let paymentInAmountAsset = $t03590836060._5
839+ let bonus = $t03590836060._4
840+ let feeAmount = $t03590836060._3
841+ let commonState = $t03590836060._2
842+ let emitAmountEstimated = $t03590836060._1
843843 let emitAmount = if (if ((minOutAmount > 0))
844844 then (minOutAmount > emitAmountEstimated)
845845 else false)
846846 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
847847 else emitAmountEstimated
848848 let emitInv = emit(emitAmount)
849849 if ((emitInv == emitInv))
850850 then {
851851 let lpTransfer = if (autoStake)
852852 then {
853853 let stakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(cfgLpAssetId, emitAmount)])
854854 if ((stakeInv == stakeInv))
855855 then nil
856856 else throw("Strict value is not equal to itself.")
857857 }
858858 else [ScriptTransfer(i.caller, emitAmount, cfgLpAssetId)]
859859 let sendFee = if ((feeAmount > 0))
860860 then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
861861 else nil
862- let $t03628836485 = if ((this == feeCollectorAddress))
862+ let $t03664636843 = if ((this == feeCollectorAddress))
863863 then $Tuple2(0, 0)
864864 else if (paymentInAmountAsset)
865865 then $Tuple2(-(feeAmount), 0)
866866 else $Tuple2(0, -(feeAmount))
867- let amountAssetBalanceDelta = $t03628836485._1
868- let priceAssetBalanceDelta = $t03628836485._2
869- let $t03648836596 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
870- let refreshKLpActions = $t03648836596._1
871- let updatedKLp = $t03648836596._2
867+ let amountAssetBalanceDelta = $t03664636843._1
868+ let priceAssetBalanceDelta = $t03664636843._2
869+ let $t03684636954 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
870+ let refreshKLpActions = $t03684636954._1
871+ let updatedKLp = $t03684636954._2
872872 let kLp = value(getString(keyKLp))
873873 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
874874 if ((isUpdatedKLpValid == isUpdatedKLpValid))
875875 then $Tuple2((((commonState ++ lpTransfer) ++ sendFee) ++ refreshKLpActions), emitAmount)
876876 else throw("Strict value is not equal to itself.")
877877 }
878878 else throw("Strict value is not equal to itself.")
879879 }
880880 else throw("Strict value is not equal to itself.")
881881 }
882882 else throw("Strict value is not equal to itself.")
883883 }
884884 else throw("Strict value is not equal to itself.")
885885 }
886886
887887
888888
889889 @Callable(i)
890890 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
891- let $t03690237059 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
892- let emitAmountEstimated = $t03690237059._1
893- let commonState = $t03690237059._2
894- let feeAmount = $t03690237059._3
895- let bonus = $t03690237059._4
896- let paymentInAmountAsset = $t03690237059._5
891+ let $t03726037417 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
892+ let emitAmountEstimated = $t03726037417._1
893+ let commonState = $t03726037417._2
894+ let feeAmount = $t03726037417._3
895+ let bonus = $t03726037417._4
896+ let paymentInAmountAsset = $t03726037417._5
897897 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
898898 }
899899
900900
901901
902902 @Callable(i)
903903 func getOneTkn (outAssetIdStr,minOutAmount) = {
904904 let isPoolOneTokenOperationsDisabled = {
905905 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
906906 if ($isInstanceOf(@, "Boolean"))
907907 then @
908908 else throw(($getType(@) + " couldn't be cast to Boolean"))
909909 }
910910 let isGetDisabled = if (if (isGlobalShutdown())
911911 then true
912912 else (cfgPoolStatus == PoolShutdown))
913913 then true
914914 else isPoolOneTokenOperationsDisabled
915915 let checks = [if (if (!(isGetDisabled))
916916 then true
917917 else isManager(i))
918918 then true
919919 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1))
920920 then true
921921 else throwErr("exactly 1 payment are expected")]
922922 if ((checks == checks))
923923 then {
924924 let outAssetId = parseAssetId(outAssetIdStr)
925925 let payment = i.payments[0]
926926 let paymentAssetId = payment.assetId
927927 let paymentAmount = payment.amount
928928 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
929929 if ((currentKLp == currentKLp))
930930 then {
931931 let userAddress = i.caller
932932 let txId = i.transactionId
933- let $t03794438097 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
934- if (($t03794438097 == $t03794438097))
933+ let $t03830238455 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
934+ if (($t03830238455 == $t03830238455))
935935 then {
936- let outInAmountAsset = $t03794438097._5
937- let bonus = $t03794438097._4
938- let feeAmount = $t03794438097._3
939- let commonState = $t03794438097._2
940- let amountEstimated = $t03794438097._1
936+ let outInAmountAsset = $t03830238455._5
937+ let bonus = $t03830238455._4
938+ let feeAmount = $t03830238455._3
939+ let commonState = $t03830238455._2
940+ let amountEstimated = $t03830238455._1
941941 let amount = if (if ((minOutAmount > 0))
942942 then (minOutAmount > amountEstimated)
943943 else false)
944944 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
945945 else amountEstimated
946946 let burnInv = invoke(factoryContract, "burn", [paymentAmount], [AttachedPayment(paymentAssetId, paymentAmount)])
947947 if ((burnInv == burnInv))
948948 then {
949949 let assetTransfer = [ScriptTransfer(userAddress, amount, outAssetId)]
950950 let sendFee = if ((feeAmount > 0))
951951 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
952952 else nil
953- let $t03859738844 = {
953+ let $t03895539202 = {
954954 let feeAmountForCalc = if ((this == feeCollectorAddress))
955955 then 0
956956 else feeAmount
957957 if (outInAmountAsset)
958958 then $Tuple2(-((amount + feeAmountForCalc)), 0)
959959 else $Tuple2(0, -((amount + feeAmountForCalc)))
960960 }
961- let amountAssetBalanceDelta = $t03859738844._1
962- let priceAssetBalanceDelta = $t03859738844._2
963- let $t03884738955 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
964- let refreshKLpActions = $t03884738955._1
965- let updatedKLp = $t03884738955._2
961+ let amountAssetBalanceDelta = $t03895539202._1
962+ let priceAssetBalanceDelta = $t03895539202._2
963+ let $t03920539313 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
964+ let refreshKLpActions = $t03920539313._1
965+ let updatedKLp = $t03920539313._2
966966 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
967967 if ((isUpdatedKLpValid == isUpdatedKLpValid))
968968 then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
969969 else throw("Strict value is not equal to itself.")
970970 }
971971 else throw("Strict value is not equal to itself.")
972972 }
973973 else throw("Strict value is not equal to itself.")
974974 }
975975 else throw("Strict value is not equal to itself.")
976976 }
977977 else throw("Strict value is not equal to itself.")
978978 }
979979
980980
981981
982982 @Callable(i)
983983 func getOneTknREADONLY (outAssetId,paymentAmount) = {
984- let $t03921239368 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
985- let amountEstimated = $t03921239368._1
986- let commonState = $t03921239368._2
987- let feeAmount = $t03921239368._3
988- let bonus = $t03921239368._4
989- let outInAmountAsset = $t03921239368._5
984+ let $t03957039726 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
985+ let amountEstimated = $t03957039726._1
986+ let commonState = $t03957039726._2
987+ let feeAmount = $t03957039726._3
988+ let bonus = $t03957039726._4
989+ let outInAmountAsset = $t03957039726._5
990990 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
991991 }
992992
993993
994994
995995 @Callable(i)
996996 func unstakeAndGetOneTkn (unstakeAmount,outAssetIdStr,minOutAmount) = {
997997 let isPoolOneTokenOperationsDisabled = {
998998 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
999999 if ($isInstanceOf(@, "Boolean"))
10001000 then @
10011001 else throw(($getType(@) + " couldn't be cast to Boolean"))
10021002 }
10031003 let isGetDisabled = if (if (isGlobalShutdown())
10041004 then true
10051005 else (cfgPoolStatus == PoolShutdown))
10061006 then true
10071007 else isPoolOneTokenOperationsDisabled
10081008 let checks = [if (if (!(isGetDisabled))
10091009 then true
10101010 else isManager(i))
10111011 then true
10121012 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 0))
10131013 then true
10141014 else throwErr("no payments are expected")]
10151015 if ((checks == checks))
10161016 then {
10171017 let outAssetId = parseAssetId(outAssetIdStr)
10181018 let userAddress = i.caller
10191019 let txId = i.transactionId
10201020 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
10211021 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
10221022 if ((unstakeInv == unstakeInv))
10231023 then {
1024- let $t04027040421 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1025- if (($t04027040421 == $t04027040421))
1024+ let $t04062840779 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1025+ if (($t04062840779 == $t04062840779))
10261026 then {
1027- let outInAmountAsset = $t04027040421._5
1028- let bonus = $t04027040421._4
1029- let feeAmount = $t04027040421._3
1030- let commonState = $t04027040421._2
1031- let amountEstimated = $t04027040421._1
1027+ let outInAmountAsset = $t04062840779._5
1028+ let bonus = $t04062840779._4
1029+ let feeAmount = $t04062840779._3
1030+ let commonState = $t04062840779._2
1031+ let amountEstimated = $t04062840779._1
10321032 let amount = if (if ((minOutAmount > 0))
10331033 then (minOutAmount > amountEstimated)
10341034 else false)
10351035 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
10361036 else amountEstimated
10371037 let burnInv = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
10381038 if ((burnInv == burnInv))
10391039 then {
10401040 let assetTransfer = [ScriptTransfer(i.caller, amount, outAssetId)]
10411041 let sendFee = if ((feeAmount > 0))
10421042 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
10431043 else nil
1044- let $t04091641163 = {
1044+ let $t04127441521 = {
10451045 let feeAmountForCalc = if ((this == feeCollectorAddress))
10461046 then 0
10471047 else feeAmount
10481048 if (outInAmountAsset)
10491049 then $Tuple2(-((amount + feeAmountForCalc)), 0)
10501050 else $Tuple2(0, -((amount + feeAmountForCalc)))
10511051 }
1052- let amountAssetBalanceDelta = $t04091641163._1
1053- let priceAssetBalanceDelta = $t04091641163._2
1054- let $t04116641274 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1055- let refreshKLpActions = $t04116641274._1
1056- let updatedKLp = $t04116641274._2
1052+ let amountAssetBalanceDelta = $t04127441521._1
1053+ let priceAssetBalanceDelta = $t04127441521._2
1054+ let $t04152441632 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1055+ let refreshKLpActions = $t04152441632._1
1056+ let updatedKLp = $t04152441632._2
10571057 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10581058 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10591059 then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
10601060 else throw("Strict value is not equal to itself.")
10611061 }
10621062 else throw("Strict value is not equal to itself.")
10631063 }
10641064 else throw("Strict value is not equal to itself.")
10651065 }
10661066 else throw("Strict value is not equal to itself.")
10671067 }
10681068 else throw("Strict value is not equal to itself.")
10691069 }
10701070
10711071
10721072
10731073 @Callable(i)
10741074 func get () = {
10751075 let res = commonGet(i)
10761076 let outAmtAmt = res._1
10771077 let outPrAmt = res._2
10781078 let pmtAmt = res._3
10791079 let pmtAssetId = res._4
10801080 let state = res._5
10811081 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
10821082 if ((currentKLp == currentKLp))
10831083 then {
10841084 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
10851085 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
10861086 then {
1087- let $t04222042302 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1088- let refreshKLpActions = $t04222042302._1
1089- let updatedKLp = $t04222042302._2
1087+ let $t04257842660 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1088+ let refreshKLpActions = $t04257842660._1
1089+ let updatedKLp = $t04257842660._2
10901090 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10911091 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10921092 then (state ++ refreshKLpActions)
10931093 else throw("Strict value is not equal to itself.")
10941094 }
10951095 else throw("Strict value is not equal to itself.")
10961096 }
10971097 else throw("Strict value is not equal to itself.")
10981098 }
10991099
11001100
11011101
11021102 @Callable(i)
11031103 func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = {
11041104 let res = commonGet(i)
11051105 let outAmAmt = res._1
11061106 let outPrAmt = res._2
11071107 let pmtAmt = res._3
11081108 let pmtAssetId = res._4
11091109 let state = res._5
11101110 if ((noLessThenAmtAsset > outAmAmt))
11111111 then throw(((("noLessThenAmtAsset failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset)))
11121112 else if ((noLessThenPriceAsset > outPrAmt))
11131113 then throw(((("noLessThenPriceAsset failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset)))
11141114 else {
11151115 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
11161116 if ((currentKLp == currentKLp))
11171117 then {
11181118 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
11191119 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
11201120 then {
1121- let $t04325143332 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1122- let refreshKLpActions = $t04325143332._1
1123- let updatedKLp = $t04325143332._2
1121+ let $t04360943690 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1122+ let refreshKLpActions = $t04360943690._1
1123+ let updatedKLp = $t04360943690._2
11241124 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11251125 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11261126 then (state ++ refreshKLpActions)
11271127 else throw("Strict value is not equal to itself.")
11281128 }
11291129 else throw("Strict value is not equal to itself.")
11301130 }
11311131 else throw("Strict value is not equal to itself.")
11321132 }
11331133 }
11341134
11351135
11361136
11371137 @Callable(i)
11381138 func unstakeAndGet (amount) = {
11391139 let checkPayments = if ((size(i.payments) != 0))
11401140 then throw("No payments are expected")
11411141 else true
11421142 if ((checkPayments == checkPayments))
11431143 then {
11441144 let cfg = getPoolConfig()
11451145 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
11461146 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
11471147 if ((currentKLp == currentKLp))
11481148 then {
11491149 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(lpAssetId), amount], nil)
11501150 if ((unstakeInv == unstakeInv))
11511151 then {
11521152 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller)
11531153 let outAmAmt = res._1
11541154 let outPrAmt = res._2
11551155 let poolStatus = parseIntValue(res._9)
11561156 let state = res._10
11571157 let checkPoolStatus = if (if (isGlobalShutdown())
11581158 then true
11591159 else (poolStatus == PoolShutdown))
11601160 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
11611161 else true
11621162 if ((checkPoolStatus == checkPoolStatus))
11631163 then {
11641164 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
11651165 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
11661166 then {
1167- let $t04445844539 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1168- let refreshKLpActions = $t04445844539._1
1169- let updatedKLp = $t04445844539._2
1167+ let $t04481644897 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1168+ let refreshKLpActions = $t04481644897._1
1169+ let updatedKLp = $t04481644897._2
11701170 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11711171 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11721172 then (state ++ refreshKLpActions)
11731173 else throw("Strict value is not equal to itself.")
11741174 }
11751175 else throw("Strict value is not equal to itself.")
11761176 }
11771177 else throw("Strict value is not equal to itself.")
11781178 }
11791179 else throw("Strict value is not equal to itself.")
11801180 }
11811181 else throw("Strict value is not equal to itself.")
11821182 }
11831183 else throw("Strict value is not equal to itself.")
11841184 }
11851185
11861186
11871187
11881188 @Callable(i)
11891189 func unstakeAndGetNoLess (unstakeAmount,noLessThenAmountAsset,noLessThenPriceAsset) = {
11901190 let isGetDisabled = if (isGlobalShutdown())
11911191 then true
11921192 else (cfgPoolStatus == PoolShutdown)
11931193 let checks = [if (!(isGetDisabled))
11941194 then true
11951195 else throw("get operation is blocked by admin"), if ((size(i.payments) == 0))
11961196 then true
11971197 else throw("no payments are expected")]
11981198 if ((checks == checks))
11991199 then {
12001200 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
12011201 if ((currentKLp == currentKLp))
12021202 then {
12031203 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
12041204 if ((unstakeInv == unstakeInv))
12051205 then {
12061206 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller)
12071207 let outAmAmt = res._1
12081208 let outPrAmt = res._2
12091209 let state = res._10
12101210 let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset))
12111211 then true
12121212 else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset))
12131213 then true
12141214 else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))]
12151215 if ((checkAmounts == checkAmounts))
12161216 then {
12171217 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
12181218 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
12191219 then {
1220- let $t04583445915 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1221- let refreshKLpActions = $t04583445915._1
1222- let updatedKLp = $t04583445915._2
1220+ let $t04619246273 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1221+ let refreshKLpActions = $t04619246273._1
1222+ let updatedKLp = $t04619246273._2
12231223 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
12241224 if ((isUpdatedKLpValid == isUpdatedKLpValid))
12251225 then (state ++ refreshKLpActions)
12261226 else throw("Strict value is not equal to itself.")
12271227 }
12281228 else throw("Strict value is not equal to itself.")
12291229 }
12301230 else throw("Strict value is not equal to itself.")
12311231 }
12321232 else throw("Strict value is not equal to itself.")
12331233 }
12341234 else throw("Strict value is not equal to itself.")
12351235 }
12361236 else throw("Strict value is not equal to itself.")
12371237 }
12381238
12391239
12401240
12411241 @Callable(i)
12421242 func activate (amtAssetStr,priceAssetStr) = if ((toString(i.caller) != toString(factoryContract)))
12431243 then throw("permissions denied")
12441244 else $Tuple2([StringEntry(aa(), amtAssetStr), StringEntry(pa(), priceAssetStr)], "success")
12451245
12461246
12471247
12481248 @Callable(i)
12491249 func refreshKLp () = {
12501250 let lastRefreshedBlockHeight = valueOrElse(getInteger(keyKLpRefreshedHeight), 0)
12511251 let checkLastRefreshedBlockHeight = if (((height - lastRefreshedBlockHeight) >= kLpRefreshDelay))
12521252 then unit
12531253 else throwErr(makeString([toString(kLpRefreshDelay), " blocks have not passed since the previous call"], ""))
12541254 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
12551255 then {
12561256 let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
1257- let $t04710247166 = refreshKLpInternal(0, 0, 0)
1258- let kLpUpdateActions = $t04710247166._1
1259- let updatedKLp = $t04710247166._2
1257+ let $t04746047524 = refreshKLpInternal(0, 0, 0)
1258+ let kLpUpdateActions = $t04746047524._1
1259+ let updatedKLp = $t04746047524._2
12601260 let actions = if ((kLp != updatedKLp))
12611261 then kLpUpdateActions
12621262 else throwErr("nothing to refresh")
12631263 $Tuple2(actions, toString(updatedKLp))
12641264 }
12651265 else throw("Strict value is not equal to itself.")
12661266 }
12671267
12681268
12691269
12701270 @Callable(i)
12711271 func getPoolConfigWrapperREADONLY () = $Tuple2(nil, getPoolConfig())
12721272
12731273
12741274
12751275 @Callable(i)
12761276 func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId))
12771277
12781278
12791279
12801280 @Callable(i)
12811281 func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = {
12821282 let prices = calcPrices(amAmt, prAmt, lpAmt)
12831283 $Tuple2(nil, [toString(prices[0]), toString(prices[1]), toString(prices[2])])
12841284 }
12851285
12861286
12871287
12881288 @Callable(i)
12891289 func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(toX18(origVal, origScaleMult)))
12901290
12911291
12921292
12931293 @Callable(i)
12941294 func fromX18WrapperREADONLY (val,resultScaleMult) = $Tuple2(nil, fromX18(parseBigIntValue(val), resultScaleMult))
12951295
12961296
12971297
12981298 @Callable(i)
12991299 func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(calcPriceBigInt(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18))))
13001300
13011301
13021302
13031303 @Callable(i)
13041304 func estimatePutOperationWrapperREADONLY (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = $Tuple2(nil, estimatePutOperation(txId58, slippageTolerance, inAmAssetAmt, inAmAssetId, inPrAssetAmt, inPrAssetId, userAddress, isEvaluate, emitLp))
13051305
13061306
13071307
13081308 @Callable(i)
13091309 func estimateGetOperationWrapperREADONLY (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
13101310 let res = estimateGetOperation(txId58, pmtAssetId, pmtLpAmt, addressFromStringValue(userAddress))
13111311 $Tuple2(nil, $Tuple10(res._1, res._2, res._3, res._4, res._5, res._6, res._7, toString(res._8), res._9, res._10))
13121312 }
13131313
13141314
13151315
13161316 @Callable(i)
13171317 func statsREADONLY () = {
13181318 let cfg = getPoolConfig()
13191319 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
13201320 let amtAssetId = cfg[idxAmtAssetId]
13211321 let priceAssetId = cfg[idxPriceAssetId]
13221322 let iAmtAssetId = cfg[idxIAmtAssetId]
13231323 let iPriceAssetId = cfg[idxIPriceAssetId]
13241324 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
13251325 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
13261326 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
13271327 let accAmtAssetBalance = getAccBalance(amtAssetId)
13281328 let accPriceAssetBalance = getAccBalance(priceAssetId)
13291329 let pricesList = if ((poolLPBalance == 0))
13301330 then [zeroBigInt, zeroBigInt, zeroBigInt]
13311331 else calcPrices(accAmtAssetBalance, accPriceAssetBalance, poolLPBalance)
13321332 let curPrice = 0
13331333 let lpAmtAssetShare = fromX18(pricesList[1], scale8)
13341334 let lpPriceAssetShare = fromX18(pricesList[2], scale8)
13351335 let poolWeight = value(getInteger(factoryContract, keyPoolWeight(toString(this))))
13361336 $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))
13371337 }
13381338
13391339
13401340
13411341 @Callable(i)
13421342 func evaluatePutByAmountAssetREADONLY (inAmAssetAmt) = {
13431343 let cfg = getPoolConfig()
13441344 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
13451345 let amAssetIdStr = cfg[idxAmtAssetId]
13461346 let amAssetId = fromBase58String(amAssetIdStr)
13471347 let prAssetIdStr = cfg[idxPriceAssetId]
13481348 let prAssetId = fromBase58String(prAssetIdStr)
13491349 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
13501350 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
13511351 let poolStatus = cfg[idxPoolStatus]
13521352 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
13531353 let accAmtAssetBalance = getAccBalance(amAssetIdStr)
13541354 let accPriceAssetBalance = getAccBalance(prAssetIdStr)
13551355 let amtAssetAmtX18 = toX18(accAmtAssetBalance, amtAssetDcm)
13561356 let priceAssetAmtX18 = toX18(accPriceAssetBalance, priceAssetDcm)
13571357 let curPriceX18 = if ((poolLPBalance == 0))
13581358 then zeroBigInt
13591359 else calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
13601360 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
13611361 let inPrAssetAmtX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18)
13621362 let inPrAssetAmt = fromX18(inPrAssetAmtX18, priceAssetDcm)
13631363 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
13641364 let calcLpAmt = estPut._1
13651365 let curPriceCalc = estPut._3
13661366 let amBalance = estPut._4
13671367 let prBalance = estPut._5
13681368 let lpEmission = estPut._6
13691369 $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))
13701370 }
13711371
13721372
13731373
13741374 @Callable(i)
13751375 func evaluatePutByPriceAssetREADONLY (inPrAssetAmt) = {
13761376 let cfg = getPoolConfig()
13771377 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
13781378 let amAssetIdStr = cfg[idxAmtAssetId]
13791379 let amAssetId = fromBase58String(amAssetIdStr)
13801380 let prAssetIdStr = cfg[idxPriceAssetId]
13811381 let prAssetId = fromBase58String(prAssetIdStr)
13821382 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
13831383 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
13841384 let poolStatus = cfg[idxPoolStatus]
13851385 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
13861386 let amBalanceRaw = getAccBalance(amAssetIdStr)
13871387 let prBalanceRaw = getAccBalance(prAssetIdStr)
13881388 let amBalanceRawX18 = toX18(amBalanceRaw, amtAssetDcm)
13891389 let prBalanceRawX18 = toX18(prBalanceRaw, priceAssetDcm)
13901390 let curPriceX18 = if ((poolLPBalance == 0))
13911391 then zeroBigInt
13921392 else calcPriceBigInt(prBalanceRawX18, amBalanceRawX18)
13931393 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
13941394 let inAmAssetAmtX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
13951395 let inAmAssetAmt = fromX18(inAmAssetAmtX18, amtAssetDcm)
13961396 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
13971397 let calcLpAmt = estPut._1
13981398 let curPriceCalc = estPut._3
13991399 let amBalance = estPut._4
14001400 let prBalance = estPut._5
14011401 let lpEmission = estPut._6
14021402 $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))
14031403 }
14041404
14051405
14061406
14071407 @Callable(i)
14081408 func evaluateGetREADONLY (paymentLpAssetId,paymentLpAmt) = {
14091409 let res = estimateGetOperation("", paymentLpAssetId, paymentLpAmt, this)
14101410 let outAmAmt = res._1
14111411 let outPrAmt = res._2
14121412 let amBalance = res._5
14131413 let prBalance = res._6
14141414 let lpEmission = res._7
14151415 let curPrice = res._8
14161416 let poolStatus = parseIntValue(res._9)
14171417 $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))
14181418 }
14191419
14201420
14211421 @Verifier(tx)
14221422 func verify () = {
14231423 let targetPublicKey = match managerPublicKeyOrUnit() {
14241424 case pk: ByteVector =>
14251425 pk
14261426 case _: Unit =>
14271427 tx.senderPublicKey
14281428 case _ =>
14291429 throw("Match error")
14301430 }
14311431 match tx {
14321432 case order: Order =>
14331433 let matcherPub = getMatcherPubOrFail()
14341434 let orderValid = validateMatcherOrderAllowed(order)
14351435 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
14361436 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
14371437 if (if (if (orderValid)
14381438 then senderValid
14391439 else false)
14401440 then matcherValid
14411441 else false)
14421442 then true
14431443 else throwOrderError(orderValid, senderValid, matcherValid)
14441444 case s: SetScriptTransaction =>
14451445 let newHash = blake2b256(value(s.script))
14461446 let allowedHash = fromBase64String(value(getString(factoryContract, keyAllowedLpScriptHash())))
14471447 let currentHash = scriptHash(this)
14481448 if (if ((allowedHash == newHash))
14491449 then (currentHash != newHash)
14501450 else false)
14511451 then true
14521452 else sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
14531453 case _ =>
14541454 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
14551455 }
14561456 }
14571457

github/deemru/w8io/026f985 
178.22 ms