tx · 2EoxcrTVqJqfntFkghiR9TShd9DqVQgCh6kzZ1BYL1Z9

3MsXwm6KeMva32skLvFrFfYYmcxT2ZDc4fD:  -0.03400000 Waves

2022.12.06 18:25 [2348663] smart account 3MsXwm6KeMva32skLvFrFfYYmcxT2ZDc4fD > SELF 0.00000000 Waves

{ "type": 13, "id": "2EoxcrTVqJqfntFkghiR9TShd9DqVQgCh6kzZ1BYL1Z9", "fee": 3400000, "feeAssetId": null, "timestamp": 1670340143273, "version": 1, "sender": "3MsXwm6KeMva32skLvFrFfYYmcxT2ZDc4fD", "senderPublicKey": "33aHdznSeq5cGxgbnLJ54tzNfiqS5SCQYHgFGMFsNQzs", "proofs": [ "3xJGij85SRKfQrFQ33hTEPkWFDhxkh168FQxLcnNZ1TcXe65TQWyPPeHmtRsreX8jXsrJ1ju1DDWD6YThWsLSy3W" ], "script": "base64:BgLYLAgCEgMKAQgSABIECgIBBBIDCgEBEgQKAgEEEgQKAggBEgQKAggBEgQKAggBEgUKAwEIARIAEgQKAgEBEgMKAQESBQoDAQEBEgQKAggIEgASABIDCgEIEgUKAwEBARIECgIBARIECgIIARIECgIICBILCgkIAQECAQIIBAQSBgoECAgBCBIAEgMKAQESAwoBARIECgIIASIKbFBkZWNpbWFscyIGc2NhbGU4IgxzY2FsZThCaWdJbnQiB3NjYWxlMTgiCnplcm9CaWdJbnQiBGJpZzAiBGJpZzEiBGJpZzIiC3dhdmVzU3RyaW5nIgNTRVAiClBvb2xBY3RpdmUiD1Bvb2xQdXREaXNhYmxlZCITUG9vbE1hdGNoZXJEaXNhYmxlZCIMUG9vbFNodXRkb3duIg5pZHhQb29sQWRkcmVzcyINaWR4UG9vbFN0YXR1cyIQaWR4UG9vbExQQXNzZXRJZCINaWR4QW10QXNzZXRJZCIPaWR4UHJpY2VBc3NldElkIg5pZHhBbXRBc3NldERjbSIQaWR4UHJpY2VBc3NldERjbSIOaWR4SUFtdEFzc2V0SWQiEGlkeElQcmljZUFzc2V0SWQiDWlkeExQ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CRAwIIBQJneAZwcm9vZnMAAAUCZ3pEIjhO", "chainId": 84, "height": 2348663, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3dk5ktJ7VC5ZhX8M8zwtW1vAfh7CuUbHxQjCMumiMag8 Next: 8GxKvA4tnqP9Umd2PXHj91ET4FHUkp6PqHaSgq6pkez5 Diff:
OldNewDifferences
426426 let $t02090121001 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
427427 let unusedActions = $t02090121001._1
428428 let kLpNew = $t02090121001._2
429- let isOrderValid = (kLpNew > kLp)
429+ let isOrderValid = (kLpNew >= kLp)
430430 isOrderValid
431431 }
432432 }
501501 else if ((paymentAssetId == cfgPriceAssetId))
502502 then false
503503 else throwErr("invalid asset")
504- let $t02368523978 = if (isEval)
504+ let $t02368623979 = if (isEval)
505505 then $Tuple2(amountBalanceRaw, priceBalanceRaw)
506506 else if (paymentInAmountAsset)
507507 then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw)
508508 else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw))
509- let amountBalanceOld = $t02368523978._1
510- let priceBalanceOld = $t02368523978._2
511- let $t02398224131 = if (paymentInAmountAsset)
509+ let amountBalanceOld = $t02368623979._1
510+ let priceBalanceOld = $t02368623979._2
511+ let $t02398324132 = if (paymentInAmountAsset)
512512 then $Tuple2(paymentAmountRaw, 0)
513513 else $Tuple2(0, paymentAmountRaw)
514- let amountAssetAmountRaw = $t02398224131._1
515- let priceAssetAmountRaw = $t02398224131._2
514+ let amountAssetAmountRaw = $t02398324132._1
515+ let priceAssetAmountRaw = $t02398324132._2
516516 let amountAssetAmount = takeFee(amountAssetAmountRaw)._1
517517 let priceAssetAmount = takeFee(priceAssetAmountRaw)._1
518- let $t02425324312 = takeFee(paymentAmountRaw)
519- let paymentAmount = $t02425324312._1
520- let feeAmount = $t02425324312._2
518+ let $t02425424313 = takeFee(paymentAmountRaw)
519+ let paymentAmount = $t02425424313._1
520+ let feeAmount = $t02425424313._2
521521 let amountBalanceNew = (amountBalanceOld + amountAssetAmount)
522522 let priceBalanceNew = (priceBalanceOld + priceAssetAmount)
523523 let priceNewX18 = calcPriceBigInt(toX18(priceBalanceNew, cfgPriceAssetDecimals), toX18(amountBalanceNew, cfgAmountAssetDecimals))
540540 let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, cfgPriceAssetDecimals), toX18(amountBalanceOld, cfgAmountAssetDecimals))
541541 let priceOld = fromX18(priceOldX18, scale8)
542542 let loss = {
543- let $t02578925956 = if (paymentInAmountAsset)
543+ let $t02579025957 = if (paymentInAmountAsset)
544544 then $Tuple2(amountAssetAmountRaw, amountBalanceOld)
545545 else $Tuple2(priceAssetAmountRaw, priceBalanceOld)
546- let amount = $t02578925956._1
547- let balance = $t02578925956._2
546+ let amount = $t02579025957._1
547+ let balance = $t02579025957._2
548548 let issueAmountBoth = toInt(fraction(supplyBigInt, toBigInt((amount / 2)), toBigInt(balance)))
549549 fraction((issueAmount - issueAmountBoth), scale8, issueAmountBoth)
550550 }
578578 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
579579 let redeemedBigInt = toBigInt(paymentAmount)
580580 let amountRaw = max([0, toInt(((balanceBigInt * (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN))) / scale18))])
581- let $t02755827608 = takeFee(amountRaw)
582- let totalAmount = $t02755827608._1
583- let feeAmount = $t02755827608._2
584- let $t02761227838 = if (outInAmountAsset)
581+ let $t02755927609 = takeFee(amountRaw)
582+ let totalAmount = $t02755927609._1
583+ let feeAmount = $t02755927609._2
584+ let $t02761327839 = if (outInAmountAsset)
585585 then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld)
586586 else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw))
587- let outAmAmount = $t02761227838._1
588- let outPrAmount = $t02761227838._2
589- let amBalanceNew = $t02761227838._3
590- let prBalanceNew = $t02761227838._4
587+ let outAmAmount = $t02761327839._1
588+ let outPrAmount = $t02761327839._2
589+ let amBalanceNew = $t02761327839._3
590+ let prBalanceNew = $t02761327839._4
591591 let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, cfgPriceAssetDecimals), toX18(amBalanceNew, cfgAmountAssetDecimals))
592592 let priceNew = fromX18(priceNewX18, scale8)
593593 let commonState = if (isEval)
733733 else throw("Strict value is not equal to itself.")
734734 }
735735 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
736- let $t03199032055 = refreshKLpInternal(0, 0, 0)
737- let refreshKLpActions = $t03199032055._1
738- let updatedKLp = $t03199032055._2
736+ let $t03199132056 = refreshKLpInternal(0, 0, 0)
737+ let refreshKLpActions = $t03199132056._1
738+ let updatedKLp = $t03199132056._2
739739 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
740740 if ((isUpdatedKLpValid == isUpdatedKLpValid))
741741 then ((state ++ lpTransfer) ++ refreshKLpActions)
765765 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
766766 if ((currentKLp == currentKLp))
767767 then {
768- let $t03261732682 = refreshKLpInternal(0, 0, 0)
769- let refreshKLpActions = $t03261732682._1
770- let updatedKLp = $t03261732682._2
768+ let $t03261832683 = refreshKLpInternal(0, 0, 0)
769+ let refreshKLpActions = $t03261832683._1
770+ let updatedKLp = $t03261832683._2
771771 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
772772 if ((isUpdatedKLpValid == isUpdatedKLpValid))
773773 then (state ++ refreshKLpActions)
812812 else throwErr("payment asset is not supported")
813813 let userAddress = i.caller
814814 let txId = i.transactionId
815- let $t03386734019 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
816- if (($t03386734019 == $t03386734019))
815+ let $t03386834020 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
816+ if (($t03386834020 == $t03386834020))
817817 then {
818- let paymentInAmountAsset = $t03386734019._5
819- let bonus = $t03386734019._4
820- let feeAmount = $t03386734019._3
821- let commonState = $t03386734019._2
822- let emitAmountEstimated = $t03386734019._1
818+ let paymentInAmountAsset = $t03386834020._5
819+ let bonus = $t03386834020._4
820+ let feeAmount = $t03386834020._3
821+ let commonState = $t03386834020._2
822+ let emitAmountEstimated = $t03386834020._1
823823 let emitAmount = if (if ((minOutAmount > 0))
824824 then (minOutAmount > emitAmountEstimated)
825825 else false)
839839 let sendFee = if ((feeAmount > 0))
840840 then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
841841 else nil
842- let $t03460534802 = if ((this == feeCollectorAddress))
842+ let $t03460634803 = if ((this == feeCollectorAddress))
843843 then $Tuple2(0, 0)
844844 else if (paymentInAmountAsset)
845845 then $Tuple2(-(feeAmount), 0)
846846 else $Tuple2(0, -(feeAmount))
847- let amountAssetBalanceDelta = $t03460534802._1
848- let priceAssetBalanceDelta = $t03460534802._2
849- let $t03480534913 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
850- let refreshKLpActions = $t03480534913._1
851- let updatedKLp = $t03480534913._2
847+ let amountAssetBalanceDelta = $t03460634803._1
848+ let priceAssetBalanceDelta = $t03460634803._2
849+ let $t03480634914 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
850+ let refreshKLpActions = $t03480634914._1
851+ let updatedKLp = $t03480634914._2
852852 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
853853 if ((isUpdatedKLpValid == isUpdatedKLpValid))
854854 then $Tuple2((((commonState ++ lpTransfer) ++ sendFee) ++ refreshKLpActions), emitAmount)
865865
866866 @Callable(i)
867867 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
868- let $t03517935336 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
869- let emitAmountEstimated = $t03517935336._1
870- let commonState = $t03517935336._2
871- let feeAmount = $t03517935336._3
872- let bonus = $t03517935336._4
873- let paymentInAmountAsset = $t03517935336._5
868+ let $t03518035337 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
869+ let emitAmountEstimated = $t03518035337._1
870+ let commonState = $t03518035337._2
871+ let feeAmount = $t03518035337._3
872+ let bonus = $t03518035337._4
873+ let paymentInAmountAsset = $t03518035337._5
874874 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
875875 }
876876
905905 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(paymentAmount))
906906 let userAddress = i.caller
907907 let txId = i.transactionId
908- let $t03623036383 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
909- if (($t03623036383 == $t03623036383))
908+ let $t03623136384 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
909+ if (($t03623136384 == $t03623136384))
910910 then {
911- let outInAmountAsset = $t03623036383._5
912- let bonus = $t03623036383._4
913- let feeAmount = $t03623036383._3
914- let commonState = $t03623036383._2
915- let amountEstimated = $t03623036383._1
911+ let outInAmountAsset = $t03623136384._5
912+ let bonus = $t03623136384._4
913+ let feeAmount = $t03623136384._3
914+ let commonState = $t03623136384._2
915+ let amountEstimated = $t03623136384._1
916916 let amount = if (if ((minOutAmount > 0))
917917 then (minOutAmount > amountEstimated)
918918 else false)
925925 let sendFee = if ((feeAmount > 0))
926926 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
927927 else nil
928- let $t03688337130 = {
928+ let $t03688437131 = {
929929 let feeAmountForCalc = if ((this == feeCollectorAddress))
930930 then 0
931931 else feeAmount
933933 then $Tuple2(-((amount + feeAmountForCalc)), 0)
934934 else $Tuple2(0, -((amount + feeAmountForCalc)))
935935 }
936- let amountAssetBalanceDelta = $t03688337130._1
937- let priceAssetBalanceDelta = $t03688337130._2
938- let $t03713337241 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
939- let refreshKLpActions = $t03713337241._1
940- let updatedKLp = $t03713337241._2
936+ let amountAssetBalanceDelta = $t03688437131._1
937+ let priceAssetBalanceDelta = $t03688437131._2
938+ let $t03713437242 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
939+ let refreshKLpActions = $t03713437242._1
940+ let updatedKLp = $t03713437242._2
941941 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
942942 if ((isUpdatedKLpValid == isUpdatedKLpValid))
943943 then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
954954
955955 @Callable(i)
956956 func getOneTknREADONLY (outAssetId,paymentAmount) = {
957- let $t03749837654 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
958- let amountEstimated = $t03749837654._1
959- let commonState = $t03749837654._2
960- let feeAmount = $t03749837654._3
961- let bonus = $t03749837654._4
962- let outInAmountAsset = $t03749837654._5
957+ let $t03749937655 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
958+ let amountEstimated = $t03749937655._1
959+ let commonState = $t03749937655._2
960+ let feeAmount = $t03749937655._3
961+ let bonus = $t03749937655._4
962+ let outInAmountAsset = $t03749937655._5
963963 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
964964 }
965965
994994 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
995995 if ((unstakeInv == unstakeInv))
996996 then {
997- let $t03855638707 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
998- if (($t03855638707 == $t03855638707))
997+ let $t03855738708 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
998+ if (($t03855738708 == $t03855738708))
999999 then {
1000- let outInAmountAsset = $t03855638707._5
1001- let bonus = $t03855638707._4
1002- let feeAmount = $t03855638707._3
1003- let commonState = $t03855638707._2
1004- let amountEstimated = $t03855638707._1
1000+ let outInAmountAsset = $t03855738708._5
1001+ let bonus = $t03855738708._4
1002+ let feeAmount = $t03855738708._3
1003+ let commonState = $t03855738708._2
1004+ let amountEstimated = $t03855738708._1
10051005 let amount = if (if ((minOutAmount > 0))
10061006 then (minOutAmount > amountEstimated)
10071007 else false)
10141014 let sendFee = if ((feeAmount > 0))
10151015 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
10161016 else nil
1017- let $t03920239449 = {
1017+ let $t03920339450 = {
10181018 let feeAmountForCalc = if ((this == feeCollectorAddress))
10191019 then 0
10201020 else feeAmount
10221022 then $Tuple2(-((amount + feeAmountForCalc)), 0)
10231023 else $Tuple2(0, -((amount + feeAmountForCalc)))
10241024 }
1025- let amountAssetBalanceDelta = $t03920239449._1
1026- let priceAssetBalanceDelta = $t03920239449._2
1027- let $t03945239560 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1028- let refreshKLpActions = $t03945239560._1
1029- let updatedKLp = $t03945239560._2
1025+ let amountAssetBalanceDelta = $t03920339450._1
1026+ let priceAssetBalanceDelta = $t03920339450._2
1027+ let $t03945339561 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1028+ let refreshKLpActions = $t03945339561._1
1029+ let updatedKLp = $t03945339561._2
10301030 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10311031 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10321032 then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
10551055 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
10561056 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
10571057 then {
1058- let $t04050840590 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1059- let refreshKLpActions = $t04050840590._1
1060- let updatedKLp = $t04050840590._2
1058+ let $t04050940591 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1059+ let refreshKLpActions = $t04050940591._1
1060+ let updatedKLp = $t04050940591._2
10611061 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10621062 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10631063 then (state ++ refreshKLpActions)
10851085 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
10861086 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
10871087 then {
1088- let $t04154141622 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1089- let refreshKLpActions = $t04154141622._1
1090- let updatedKLp = $t04154141622._2
1088+ let $t04154241623 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1089+ let refreshKLpActions = $t04154241623._1
1090+ let updatedKLp = $t04154241623._2
10911091 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10921092 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10931093 then (state ++ refreshKLpActions)
11271127 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
11281128 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
11291129 then {
1130- let $t04274542826 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1131- let refreshKLpActions = $t04274542826._1
1132- let updatedKLp = $t04274542826._2
1130+ let $t04274642827 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1131+ let refreshKLpActions = $t04274642827._1
1132+ let updatedKLp = $t04274642827._2
11331133 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11341134 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11351135 then (state ++ refreshKLpActions)
11761176 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
11771177 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
11781178 then {
1179- let $t04411844199 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1180- let refreshKLpActions = $t04411844199._1
1181- let updatedKLp = $t04411844199._2
1179+ let $t04411944200 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1180+ let refreshKLpActions = $t04411944200._1
1181+ let updatedKLp = $t04411944200._2
11821182 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11831183 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11841184 then (state ++ refreshKLpActions)
12111211 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
12121212 then {
12131213 let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
1214- let $t04538645450 = refreshKLpInternal(0, 0, 0)
1215- let kLpUpdateActions = $t04538645450._1
1216- let updatedKLp = $t04538645450._2
1214+ let $t04538745451 = refreshKLpInternal(0, 0, 0)
1215+ let kLpUpdateActions = $t04538745451._1
1216+ let updatedKLp = $t04538745451._2
12171217 let actions = if ((kLp != updatedKLp))
12181218 then kLpUpdateActions
12191219 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, 0, DOWN), scale18, lpEmission)
378378 updatedKLp
379379 }
380380
381381
382382 func calcCurrentKLp (amountAssetDelta,priceAssetDelta,lpAssetEmissionDelta) = {
383383 let amountAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) - amountAssetDelta)
384384 let priceAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) - priceAssetDelta)
385385 let lpAssetEmission = (toBigInt(value(assetInfo(cfgLpAssetId)).quantity) - lpAssetEmissionDelta)
386386 let currentKLp = calcKLp(amountAssetBalance, priceAssetBalance, lpAssetEmission)
387387 currentKLp
388388 }
389389
390390
391391 func refreshKLpInternal (amountAssetBalanceDelta,priceAssetBalanceDelta,lpAssetEmissionDelta) = {
392392 let amountAssetBalance = (getAccBalance(assetIdToString(cfgAmountAssetId)) + amountAssetBalanceDelta)
393393 let priceAssetBalance = (getAccBalance(assetIdToString(cfgPriceAssetId)) + priceAssetBalanceDelta)
394394 let lpAssetEmission = (value(assetInfo(cfgLpAssetId)).quantity + lpAssetEmissionDelta)
395395 let updatedKLp = calcKLp(toBigInt(amountAssetBalance), toBigInt(priceAssetBalance), toBigInt(lpAssetEmission))
396396 let actions = [IntegerEntry(keyKLpRefreshedHeight, height), StringEntry(keyKLp, toString(updatedKLp))]
397397 $Tuple2(actions, updatedKLp)
398398 }
399399
400400
401401 func validateUpdatedKLp (oldKLp,updatedKLp) = if ((updatedKLp >= oldKLp))
402402 then true
403403 else throwErr("updated KLp lower than current KLp")
404404
405405
406406 func validateMatcherOrderAllowed (order) = {
407407 let amountAssetAmount = order.amount
408408 let priceAssetAmount = fraction(order.amount, order.price, scale8)
409409 let $t02021820430 = if ((order.orderType == Buy))
410410 then $Tuple2(amountAssetAmount, -(priceAssetAmount))
411411 else $Tuple2(-(amountAssetAmount), priceAssetAmount)
412412 let amountAssetBalanceDelta = $t02021820430._1
413413 let priceAssetBalanceDelta = $t02021820430._2
414414 if (if (if (isGlobalShutdown())
415415 then true
416416 else (cfgPoolStatus == PoolMatcherDisabled))
417417 then true
418418 else (cfgPoolStatus == PoolShutdown))
419419 then throw("Exchange operations disabled")
420420 else if (if ((order.assetPair.amountAsset != cfgAmountAssetId))
421421 then true
422422 else (order.assetPair.priceAsset != cfgPriceAssetId))
423423 then throw("Wrong order assets.")
424424 else {
425425 let kLp = valueOrErrorMessage(parseBigInt(valueOrErrorMessage(getString(this, keyKLp), fmtErr("kLp is required"))), fmtErr("invalid kLp"))
426426 let $t02090121001 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
427427 let unusedActions = $t02090121001._1
428428 let kLpNew = $t02090121001._2
429- let isOrderValid = (kLpNew > kLp)
429+ let isOrderValid = (kLpNew >= kLp)
430430 isOrderValid
431431 }
432432 }
433433
434434
435435 func commonGet (i) = if ((size(i.payments) != 1))
436436 then throw("exactly 1 payment is expected")
437437 else {
438438 let pmt = value(i.payments[0])
439439 let pmtAssetId = value(pmt.assetId)
440440 let pmtAmt = pmt.amount
441441 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller)
442442 let outAmAmt = res._1
443443 let outPrAmt = res._2
444444 let poolStatus = parseIntValue(res._9)
445445 let state = res._10
446446 if (if (isGlobalShutdown())
447447 then true
448448 else (poolStatus == PoolShutdown))
449449 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
450450 else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state)
451451 }
452452
453453
454454 func commonPut (i,slippageTolerance,emitLp) = if ((size(i.payments) != 2))
455455 then throw("exactly 2 payments are expected")
456456 else {
457457 let amAssetPmt = value(i.payments[0])
458458 let prAssetPmt = value(i.payments[1])
459459 let estPut = estimatePutOperation(toBase58String(i.transactionId), slippageTolerance, amAssetPmt.amount, amAssetPmt.assetId, prAssetPmt.amount, prAssetPmt.assetId, toString(i.caller), false, emitLp)
460460 let poolStatus = parseIntValue(estPut._8)
461461 if (if (if (isGlobalShutdown())
462462 then true
463463 else (poolStatus == PoolPutDisabled))
464464 then true
465465 else (poolStatus == PoolShutdown))
466466 then throw(("Put operation is blocked by admin. Status = " + toString(poolStatus)))
467467 else estPut
468468 }
469469
470470
471471 func emit (amount) = {
472472 let emitInv = invoke(factoryContract, "emit", [amount], nil)
473473 if ((emitInv == emitInv))
474474 then {
475475 let emitInvLegacy = match emitInv {
476476 case legacyFactoryContract: Address =>
477477 invoke(legacyFactoryContract, "emit", [amount], nil)
478478 case _ =>
479479 unit
480480 }
481481 if ((emitInvLegacy == emitInvLegacy))
482482 then amount
483483 else throw("Strict value is not equal to itself.")
484484 }
485485 else throw("Strict value is not equal to itself.")
486486 }
487487
488488
489489 func takeFee (amount) = {
490490 let feeAmount = fraction(amount, fee, scale8)
491491 $Tuple2((amount - feeAmount), feeAmount)
492492 }
493493
494494
495495 func calcPutOneToken (paymentAmountRaw,paymentAssetId,userAddress,txId) = {
496496 let isEval = (txId == unit)
497497 let amountBalanceRaw = getAccBalance(assetIdToString(cfgAmountAssetId))
498498 let priceBalanceRaw = getAccBalance(assetIdToString(cfgPriceAssetId))
499499 let paymentInAmountAsset = if ((paymentAssetId == cfgAmountAssetId))
500500 then true
501501 else if ((paymentAssetId == cfgPriceAssetId))
502502 then false
503503 else throwErr("invalid asset")
504- let $t02368523978 = if (isEval)
504+ let $t02368623979 = if (isEval)
505505 then $Tuple2(amountBalanceRaw, priceBalanceRaw)
506506 else if (paymentInAmountAsset)
507507 then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw)
508508 else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw))
509- let amountBalanceOld = $t02368523978._1
510- let priceBalanceOld = $t02368523978._2
511- let $t02398224131 = if (paymentInAmountAsset)
509+ let amountBalanceOld = $t02368623979._1
510+ let priceBalanceOld = $t02368623979._2
511+ let $t02398324132 = if (paymentInAmountAsset)
512512 then $Tuple2(paymentAmountRaw, 0)
513513 else $Tuple2(0, paymentAmountRaw)
514- let amountAssetAmountRaw = $t02398224131._1
515- let priceAssetAmountRaw = $t02398224131._2
514+ let amountAssetAmountRaw = $t02398324132._1
515+ let priceAssetAmountRaw = $t02398324132._2
516516 let amountAssetAmount = takeFee(amountAssetAmountRaw)._1
517517 let priceAssetAmount = takeFee(priceAssetAmountRaw)._1
518- let $t02425324312 = takeFee(paymentAmountRaw)
519- let paymentAmount = $t02425324312._1
520- let feeAmount = $t02425324312._2
518+ let $t02425424313 = takeFee(paymentAmountRaw)
519+ let paymentAmount = $t02425424313._1
520+ let feeAmount = $t02425424313._2
521521 let amountBalanceNew = (amountBalanceOld + amountAssetAmount)
522522 let priceBalanceNew = (priceBalanceOld + priceAssetAmount)
523523 let priceNewX18 = calcPriceBigInt(toX18(priceBalanceNew, cfgPriceAssetDecimals), toX18(amountBalanceNew, cfgAmountAssetDecimals))
524524 let priceNew = fromX18(priceNewX18, scale8)
525525 let paymentBalance = if (paymentInAmountAsset)
526526 then amountBalanceOld
527527 else priceBalanceOld
528528 let paymentBalanceBigInt = toBigInt(paymentBalance)
529529 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
530530 let chechSupply = if ((supplyBigInt > big0))
531531 then true
532532 else throwErr("initial deposit requires all coins")
533533 if ((chechSupply == chechSupply))
534534 then {
535535 let depositBigInt = toBigInt(paymentAmount)
536536 let issueAmount = max([0, toInt(((supplyBigInt * (sqrtBigInt((scale18 + ((depositBigInt * scale18) / paymentBalanceBigInt)), 18, 18, DOWN) - scale18)) / scale18))])
537537 let commonState = if (isEval)
538538 then nil
539539 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))]
540540 let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, cfgPriceAssetDecimals), toX18(amountBalanceOld, cfgAmountAssetDecimals))
541541 let priceOld = fromX18(priceOldX18, scale8)
542542 let loss = {
543- let $t02578925956 = if (paymentInAmountAsset)
543+ let $t02579025957 = if (paymentInAmountAsset)
544544 then $Tuple2(amountAssetAmountRaw, amountBalanceOld)
545545 else $Tuple2(priceAssetAmountRaw, priceBalanceOld)
546- let amount = $t02578925956._1
547- let balance = $t02578925956._2
546+ let amount = $t02579025957._1
547+ let balance = $t02579025957._2
548548 let issueAmountBoth = toInt(fraction(supplyBigInt, toBigInt((amount / 2)), toBigInt(balance)))
549549 fraction((issueAmount - issueAmountBoth), scale8, issueAmountBoth)
550550 }
551551 $Tuple5(issueAmount, commonState, feeAmount, loss, paymentInAmountAsset)
552552 }
553553 else throw("Strict value is not equal to itself.")
554554 }
555555
556556
557557 func calcGetOneToken (outAssetId,paymentAmount,paymentAssetId,userAddress,txId) = {
558558 let isEval = (txId == unit)
559559 let checks = [if ((paymentAssetId == cfgLpAssetId))
560560 then true
561561 else throwErr("invalid lp asset")]
562562 if ((checks == checks))
563563 then {
564564 let outInAmountAsset = if ((outAssetId == cfgAmountAssetId))
565565 then true
566566 else if ((outAssetId == cfgPriceAssetId))
567567 then false
568568 else throwErr("invalid asset")
569569 let balanceBigInt = if (outInAmountAsset)
570570 then toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId)))
571571 else toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId)))
572572 let amBalanceOld = getAccBalance(assetIdToString(cfgAmountAssetId))
573573 let prBalanceOld = getAccBalance(assetIdToString(cfgPriceAssetId))
574574 let outBalance = if (outInAmountAsset)
575575 then amBalanceOld
576576 else prBalanceOld
577577 let outBalanceBigInt = toBigInt(outBalance)
578578 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
579579 let redeemedBigInt = toBigInt(paymentAmount)
580580 let amountRaw = max([0, toInt(((balanceBigInt * (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN))) / scale18))])
581- let $t02755827608 = takeFee(amountRaw)
582- let totalAmount = $t02755827608._1
583- let feeAmount = $t02755827608._2
584- let $t02761227838 = if (outInAmountAsset)
581+ let $t02755927609 = takeFee(amountRaw)
582+ let totalAmount = $t02755927609._1
583+ let feeAmount = $t02755927609._2
584+ let $t02761327839 = if (outInAmountAsset)
585585 then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld)
586586 else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw))
587- let outAmAmount = $t02761227838._1
588- let outPrAmount = $t02761227838._2
589- let amBalanceNew = $t02761227838._3
590- let prBalanceNew = $t02761227838._4
587+ let outAmAmount = $t02761327839._1
588+ let outPrAmount = $t02761327839._2
589+ let amBalanceNew = $t02761327839._3
590+ let prBalanceNew = $t02761327839._4
591591 let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, cfgPriceAssetDecimals), toX18(amBalanceNew, cfgAmountAssetDecimals))
592592 let priceNew = fromX18(priceNewX18, scale8)
593593 let commonState = if (isEval)
594594 then nil
595595 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)]
596596 let priceOldX18 = calcPriceBigInt(toX18(prBalanceOld, cfgPriceAssetDecimals), toX18(amBalanceOld, cfgAmountAssetDecimals))
597597 let priceOld = fromX18(priceOldX18, scale8)
598598 let loss = {
599599 let amountBothInPaymentAsset = (toInt(fraction(balanceBigInt, redeemedBigInt, supplyBigInt)) * 2)
600600 fraction((totalAmount - amountBothInPaymentAsset), scale8, amountBothInPaymentAsset)
601601 }
602602 $Tuple5(totalAmount, commonState, feeAmount, loss, outInAmountAsset)
603603 }
604604 else throw("Strict value is not equal to itself.")
605605 }
606606
607607
608608 func managerPublicKeyOrUnit () = match getString(mpk()) {
609609 case s: String =>
610610 fromBase58String(s)
611611 case _: Unit =>
612612 unit
613613 case _ =>
614614 throw("Match error")
615615 }
616616
617617
618618 func pendingManagerPublicKeyOrUnit () = match getString(pmpk()) {
619619 case s: String =>
620620 fromBase58String(s)
621621 case _: Unit =>
622622 unit
623623 case _ =>
624624 throw("Match error")
625625 }
626626
627627
628628 func isManager (i) = match managerPublicKeyOrUnit() {
629629 case pk: ByteVector =>
630630 (i.callerPublicKey == pk)
631631 case _: Unit =>
632632 (i.caller == this)
633633 case _ =>
634634 throw("Match error")
635635 }
636636
637637
638638 func mustManager (i) = {
639639 let pd = throw("Permission denied")
640640 match managerPublicKeyOrUnit() {
641641 case pk: ByteVector =>
642642 if ((i.callerPublicKey == pk))
643643 then true
644644 else pd
645645 case _: Unit =>
646646 if ((i.caller == this))
647647 then true
648648 else pd
649649 case _ =>
650650 throw("Match error")
651651 }
652652 }
653653
654654
655655 @Callable(i)
656656 func setManager (pendingManagerPublicKey) = {
657657 let checkCaller = mustManager(i)
658658 if ((checkCaller == checkCaller))
659659 then {
660660 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
661661 if ((checkManagerPublicKey == checkManagerPublicKey))
662662 then [StringEntry(pmpk(), pendingManagerPublicKey)]
663663 else throw("Strict value is not equal to itself.")
664664 }
665665 else throw("Strict value is not equal to itself.")
666666 }
667667
668668
669669
670670 @Callable(i)
671671 func confirmManager () = {
672672 let pm = pendingManagerPublicKeyOrUnit()
673673 let hasPM = if (isDefined(pm))
674674 then true
675675 else throw("No pending manager")
676676 if ((hasPM == hasPM))
677677 then {
678678 let checkPM = if ((i.callerPublicKey == value(pm)))
679679 then true
680680 else throw("You are not pending manager")
681681 if ((checkPM == checkPM))
682682 then [StringEntry(mpk(), toBase58String(value(pm))), DeleteEntry(pmpk())]
683683 else throw("Strict value is not equal to itself.")
684684 }
685685 else throw("Strict value is not equal to itself.")
686686 }
687687
688688
689689
690690 @Callable(i)
691691 func put (slippageTolerance,shouldAutoStake) = if ((0 > slippageTolerance))
692692 then throw("Invalid slippageTolerance passed")
693693 else {
694694 let estPut = commonPut(i, slippageTolerance, true)
695695 let emitLpAmt = estPut._2
696696 let lpAssetId = estPut._7
697697 let state = estPut._9
698698 let amDiff = estPut._10
699699 let prDiff = estPut._11
700700 let amId = estPut._12
701701 let prId = estPut._13
702702 let amAssetPmt = toBigInt(value(i.payments[0]).amount)
703703 let prAssetPmt = toBigInt(value(i.payments[1]).amount)
704704 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
705705 if ((currentKLp == currentKLp))
706706 then {
707707 let emitInv = invoke(factoryContract, "emit", [emitLpAmt], nil)
708708 if ((emitInv == emitInv))
709709 then {
710710 let emitInvLegacy = match emitInv {
711711 case legacyFactoryContract: Address =>
712712 invoke(legacyFactoryContract, "emit", [emitLpAmt], nil)
713713 case _ =>
714714 unit
715715 }
716716 if ((emitInvLegacy == emitInvLegacy))
717717 then {
718718 let slippageAInv = if ((amDiff > 0))
719719 then invoke(slippageContract, "put", nil, [AttachedPayment(amId, amDiff)])
720720 else nil
721721 if ((slippageAInv == slippageAInv))
722722 then {
723723 let slippagePInv = if ((prDiff > 0))
724724 then invoke(slippageContract, "put", nil, [AttachedPayment(prId, prDiff)])
725725 else nil
726726 if ((slippagePInv == slippagePInv))
727727 then {
728728 let lpTransfer = if (shouldAutoStake)
729729 then {
730730 let slpStakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)])
731731 if ((slpStakeInv == slpStakeInv))
732732 then nil
733733 else throw("Strict value is not equal to itself.")
734734 }
735735 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
736- let $t03199032055 = refreshKLpInternal(0, 0, 0)
737- let refreshKLpActions = $t03199032055._1
738- let updatedKLp = $t03199032055._2
736+ let $t03199132056 = refreshKLpInternal(0, 0, 0)
737+ let refreshKLpActions = $t03199132056._1
738+ let updatedKLp = $t03199132056._2
739739 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
740740 if ((isUpdatedKLpValid == isUpdatedKLpValid))
741741 then ((state ++ lpTransfer) ++ refreshKLpActions)
742742 else throw("Strict value is not equal to itself.")
743743 }
744744 else throw("Strict value is not equal to itself.")
745745 }
746746 else throw("Strict value is not equal to itself.")
747747 }
748748 else throw("Strict value is not equal to itself.")
749749 }
750750 else throw("Strict value is not equal to itself.")
751751 }
752752 else throw("Strict value is not equal to itself.")
753753 }
754754
755755
756756
757757 @Callable(i)
758758 func putForFree (maxSlippage) = if ((0 > maxSlippage))
759759 then throw("Invalid value passed")
760760 else {
761761 let estPut = commonPut(i, maxSlippage, false)
762762 let state = estPut._9
763763 let amAssetPmt = toBigInt(value(i.payments[0]).amount)
764764 let prAssetPmt = toBigInt(value(i.payments[1]).amount)
765765 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
766766 if ((currentKLp == currentKLp))
767767 then {
768- let $t03261732682 = refreshKLpInternal(0, 0, 0)
769- let refreshKLpActions = $t03261732682._1
770- let updatedKLp = $t03261732682._2
768+ let $t03261832683 = refreshKLpInternal(0, 0, 0)
769+ let refreshKLpActions = $t03261832683._1
770+ let updatedKLp = $t03261832683._2
771771 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
772772 if ((isUpdatedKLpValid == isUpdatedKLpValid))
773773 then (state ++ refreshKLpActions)
774774 else throw("Strict value is not equal to itself.")
775775 }
776776 else throw("Strict value is not equal to itself.")
777777 }
778778
779779
780780
781781 @Callable(i)
782782 func putOneTkn (minOutAmount,autoStake) = {
783783 let isPoolOneTokenOperationsDisabled = {
784784 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
785785 if ($isInstanceOf(@, "Boolean"))
786786 then @
787787 else throw(($getType(@) + " couldn't be cast to Boolean"))
788788 }
789789 let isPutDisabled = if (if (if (isGlobalShutdown())
790790 then true
791791 else (cfgPoolStatus == PoolPutDisabled))
792792 then true
793793 else (cfgPoolStatus == PoolShutdown))
794794 then true
795795 else isPoolOneTokenOperationsDisabled
796796 let checks = [if (if (!(isPutDisabled))
797797 then true
798798 else isManager(i))
799799 then true
800800 else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1))
801801 then true
802802 else throwErr("exactly 1 payment are expected")]
803803 if ((checks == checks))
804804 then {
805805 let payment = i.payments[0]
806806 let paymentAssetId = payment.assetId
807807 let paymentAmountRaw = payment.amount
808808 let currentKLp = if ((paymentAssetId == cfgAmountAssetId))
809809 then calcCurrentKLp(toBigInt(paymentAmountRaw), toBigInt(0), toBigInt(0))
810810 else if ((paymentAssetId == cfgPriceAssetId))
811811 then calcCurrentKLp(toBigInt(0), toBigInt(paymentAmountRaw), toBigInt(0))
812812 else throwErr("payment asset is not supported")
813813 let userAddress = i.caller
814814 let txId = i.transactionId
815- let $t03386734019 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
816- if (($t03386734019 == $t03386734019))
815+ let $t03386834020 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
816+ if (($t03386834020 == $t03386834020))
817817 then {
818- let paymentInAmountAsset = $t03386734019._5
819- let bonus = $t03386734019._4
820- let feeAmount = $t03386734019._3
821- let commonState = $t03386734019._2
822- let emitAmountEstimated = $t03386734019._1
818+ let paymentInAmountAsset = $t03386834020._5
819+ let bonus = $t03386834020._4
820+ let feeAmount = $t03386834020._3
821+ let commonState = $t03386834020._2
822+ let emitAmountEstimated = $t03386834020._1
823823 let emitAmount = if (if ((minOutAmount > 0))
824824 then (minOutAmount > emitAmountEstimated)
825825 else false)
826826 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
827827 else emitAmountEstimated
828828 let emitInv = emit(emitAmount)
829829 if ((emitInv == emitInv))
830830 then {
831831 let lpTransfer = if (autoStake)
832832 then {
833833 let stakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(cfgLpAssetId, emitAmount)])
834834 if ((stakeInv == stakeInv))
835835 then nil
836836 else throw("Strict value is not equal to itself.")
837837 }
838838 else [ScriptTransfer(i.caller, emitAmount, cfgLpAssetId)]
839839 let sendFee = if ((feeAmount > 0))
840840 then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
841841 else nil
842- let $t03460534802 = if ((this == feeCollectorAddress))
842+ let $t03460634803 = if ((this == feeCollectorAddress))
843843 then $Tuple2(0, 0)
844844 else if (paymentInAmountAsset)
845845 then $Tuple2(-(feeAmount), 0)
846846 else $Tuple2(0, -(feeAmount))
847- let amountAssetBalanceDelta = $t03460534802._1
848- let priceAssetBalanceDelta = $t03460534802._2
849- let $t03480534913 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
850- let refreshKLpActions = $t03480534913._1
851- let updatedKLp = $t03480534913._2
847+ let amountAssetBalanceDelta = $t03460634803._1
848+ let priceAssetBalanceDelta = $t03460634803._2
849+ let $t03480634914 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
850+ let refreshKLpActions = $t03480634914._1
851+ let updatedKLp = $t03480634914._2
852852 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
853853 if ((isUpdatedKLpValid == isUpdatedKLpValid))
854854 then $Tuple2((((commonState ++ lpTransfer) ++ sendFee) ++ refreshKLpActions), emitAmount)
855855 else throw("Strict value is not equal to itself.")
856856 }
857857 else throw("Strict value is not equal to itself.")
858858 }
859859 else throw("Strict value is not equal to itself.")
860860 }
861861 else throw("Strict value is not equal to itself.")
862862 }
863863
864864
865865
866866 @Callable(i)
867867 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
868- let $t03517935336 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
869- let emitAmountEstimated = $t03517935336._1
870- let commonState = $t03517935336._2
871- let feeAmount = $t03517935336._3
872- let bonus = $t03517935336._4
873- let paymentInAmountAsset = $t03517935336._5
868+ let $t03518035337 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
869+ let emitAmountEstimated = $t03518035337._1
870+ let commonState = $t03518035337._2
871+ let feeAmount = $t03518035337._3
872+ let bonus = $t03518035337._4
873+ let paymentInAmountAsset = $t03518035337._5
874874 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
875875 }
876876
877877
878878
879879 @Callable(i)
880880 func getOneTkn (outAssetIdStr,minOutAmount) = {
881881 let isPoolOneTokenOperationsDisabled = {
882882 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
883883 if ($isInstanceOf(@, "Boolean"))
884884 then @
885885 else throw(($getType(@) + " couldn't be cast to Boolean"))
886886 }
887887 let isGetDisabled = if (if (isGlobalShutdown())
888888 then true
889889 else (cfgPoolStatus == PoolShutdown))
890890 then true
891891 else isPoolOneTokenOperationsDisabled
892892 let checks = [if (if (!(isGetDisabled))
893893 then true
894894 else isManager(i))
895895 then true
896896 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1))
897897 then true
898898 else throwErr("exactly 1 payment are expected")]
899899 if ((checks == checks))
900900 then {
901901 let outAssetId = parseAssetId(outAssetIdStr)
902902 let payment = i.payments[0]
903903 let paymentAssetId = payment.assetId
904904 let paymentAmount = payment.amount
905905 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(paymentAmount))
906906 let userAddress = i.caller
907907 let txId = i.transactionId
908- let $t03623036383 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
909- if (($t03623036383 == $t03623036383))
908+ let $t03623136384 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
909+ if (($t03623136384 == $t03623136384))
910910 then {
911- let outInAmountAsset = $t03623036383._5
912- let bonus = $t03623036383._4
913- let feeAmount = $t03623036383._3
914- let commonState = $t03623036383._2
915- let amountEstimated = $t03623036383._1
911+ let outInAmountAsset = $t03623136384._5
912+ let bonus = $t03623136384._4
913+ let feeAmount = $t03623136384._3
914+ let commonState = $t03623136384._2
915+ let amountEstimated = $t03623136384._1
916916 let amount = if (if ((minOutAmount > 0))
917917 then (minOutAmount > amountEstimated)
918918 else false)
919919 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
920920 else amountEstimated
921921 let burnInv = invoke(factoryContract, "burn", [paymentAmount], [AttachedPayment(paymentAssetId, paymentAmount)])
922922 if ((burnInv == burnInv))
923923 then {
924924 let assetTransfer = [ScriptTransfer(userAddress, amount, outAssetId)]
925925 let sendFee = if ((feeAmount > 0))
926926 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
927927 else nil
928- let $t03688337130 = {
928+ let $t03688437131 = {
929929 let feeAmountForCalc = if ((this == feeCollectorAddress))
930930 then 0
931931 else feeAmount
932932 if (outInAmountAsset)
933933 then $Tuple2(-((amount + feeAmountForCalc)), 0)
934934 else $Tuple2(0, -((amount + feeAmountForCalc)))
935935 }
936- let amountAssetBalanceDelta = $t03688337130._1
937- let priceAssetBalanceDelta = $t03688337130._2
938- let $t03713337241 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
939- let refreshKLpActions = $t03713337241._1
940- let updatedKLp = $t03713337241._2
936+ let amountAssetBalanceDelta = $t03688437131._1
937+ let priceAssetBalanceDelta = $t03688437131._2
938+ let $t03713437242 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
939+ let refreshKLpActions = $t03713437242._1
940+ let updatedKLp = $t03713437242._2
941941 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
942942 if ((isUpdatedKLpValid == isUpdatedKLpValid))
943943 then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
944944 else throw("Strict value is not equal to itself.")
945945 }
946946 else throw("Strict value is not equal to itself.")
947947 }
948948 else throw("Strict value is not equal to itself.")
949949 }
950950 else throw("Strict value is not equal to itself.")
951951 }
952952
953953
954954
955955 @Callable(i)
956956 func getOneTknREADONLY (outAssetId,paymentAmount) = {
957- let $t03749837654 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
958- let amountEstimated = $t03749837654._1
959- let commonState = $t03749837654._2
960- let feeAmount = $t03749837654._3
961- let bonus = $t03749837654._4
962- let outInAmountAsset = $t03749837654._5
957+ let $t03749937655 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
958+ let amountEstimated = $t03749937655._1
959+ let commonState = $t03749937655._2
960+ let feeAmount = $t03749937655._3
961+ let bonus = $t03749937655._4
962+ let outInAmountAsset = $t03749937655._5
963963 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
964964 }
965965
966966
967967
968968 @Callable(i)
969969 func unstakeAndGetOneTkn (unstakeAmount,outAssetIdStr,minOutAmount) = {
970970 let isPoolOneTokenOperationsDisabled = {
971971 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
972972 if ($isInstanceOf(@, "Boolean"))
973973 then @
974974 else throw(($getType(@) + " couldn't be cast to Boolean"))
975975 }
976976 let isGetDisabled = if (if (isGlobalShutdown())
977977 then true
978978 else (cfgPoolStatus == PoolShutdown))
979979 then true
980980 else isPoolOneTokenOperationsDisabled
981981 let checks = [if (if (!(isGetDisabled))
982982 then true
983983 else isManager(i))
984984 then true
985985 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 0))
986986 then true
987987 else throwErr("no payments are expected")]
988988 if ((checks == checks))
989989 then {
990990 let outAssetId = parseAssetId(outAssetIdStr)
991991 let userAddress = i.caller
992992 let txId = i.transactionId
993993 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
994994 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
995995 if ((unstakeInv == unstakeInv))
996996 then {
997- let $t03855638707 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
998- if (($t03855638707 == $t03855638707))
997+ let $t03855738708 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
998+ if (($t03855738708 == $t03855738708))
999999 then {
1000- let outInAmountAsset = $t03855638707._5
1001- let bonus = $t03855638707._4
1002- let feeAmount = $t03855638707._3
1003- let commonState = $t03855638707._2
1004- let amountEstimated = $t03855638707._1
1000+ let outInAmountAsset = $t03855738708._5
1001+ let bonus = $t03855738708._4
1002+ let feeAmount = $t03855738708._3
1003+ let commonState = $t03855738708._2
1004+ let amountEstimated = $t03855738708._1
10051005 let amount = if (if ((minOutAmount > 0))
10061006 then (minOutAmount > amountEstimated)
10071007 else false)
10081008 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
10091009 else amountEstimated
10101010 let burnInv = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
10111011 if ((burnInv == burnInv))
10121012 then {
10131013 let assetTransfer = [ScriptTransfer(i.caller, amount, outAssetId)]
10141014 let sendFee = if ((feeAmount > 0))
10151015 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
10161016 else nil
1017- let $t03920239449 = {
1017+ let $t03920339450 = {
10181018 let feeAmountForCalc = if ((this == feeCollectorAddress))
10191019 then 0
10201020 else feeAmount
10211021 if (outInAmountAsset)
10221022 then $Tuple2(-((amount + feeAmountForCalc)), 0)
10231023 else $Tuple2(0, -((amount + feeAmountForCalc)))
10241024 }
1025- let amountAssetBalanceDelta = $t03920239449._1
1026- let priceAssetBalanceDelta = $t03920239449._2
1027- let $t03945239560 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1028- let refreshKLpActions = $t03945239560._1
1029- let updatedKLp = $t03945239560._2
1025+ let amountAssetBalanceDelta = $t03920339450._1
1026+ let priceAssetBalanceDelta = $t03920339450._2
1027+ let $t03945339561 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1028+ let refreshKLpActions = $t03945339561._1
1029+ let updatedKLp = $t03945339561._2
10301030 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10311031 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10321032 then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
10331033 else throw("Strict value is not equal to itself.")
10341034 }
10351035 else throw("Strict value is not equal to itself.")
10361036 }
10371037 else throw("Strict value is not equal to itself.")
10381038 }
10391039 else throw("Strict value is not equal to itself.")
10401040 }
10411041 else throw("Strict value is not equal to itself.")
10421042 }
10431043
10441044
10451045
10461046 @Callable(i)
10471047 func get () = {
10481048 let res = commonGet(i)
10491049 let outAmtAmt = res._1
10501050 let outPrAmt = res._2
10511051 let pmtAmt = res._3
10521052 let pmtAssetId = res._4
10531053 let state = res._5
10541054 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(pmtAmt))
10551055 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
10561056 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
10571057 then {
1058- let $t04050840590 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1059- let refreshKLpActions = $t04050840590._1
1060- let updatedKLp = $t04050840590._2
1058+ let $t04050940591 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1059+ let refreshKLpActions = $t04050940591._1
1060+ let updatedKLp = $t04050940591._2
10611061 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10621062 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10631063 then (state ++ refreshKLpActions)
10641064 else throw("Strict value is not equal to itself.")
10651065 }
10661066 else throw("Strict value is not equal to itself.")
10671067 }
10681068
10691069
10701070
10711071 @Callable(i)
10721072 func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = {
10731073 let res = commonGet(i)
10741074 let outAmAmt = res._1
10751075 let outPrAmt = res._2
10761076 let pmtAmt = res._3
10771077 let pmtAssetId = res._4
10781078 let state = res._5
10791079 if ((noLessThenAmtAsset > outAmAmt))
10801080 then throw(((("noLessThenAmtAsset failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset)))
10811081 else if ((noLessThenPriceAsset > outPrAmt))
10821082 then throw(((("noLessThenPriceAsset failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset)))
10831083 else {
10841084 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(pmtAmt))
10851085 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
10861086 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
10871087 then {
1088- let $t04154141622 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1089- let refreshKLpActions = $t04154141622._1
1090- let updatedKLp = $t04154141622._2
1088+ let $t04154241623 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1089+ let refreshKLpActions = $t04154241623._1
1090+ let updatedKLp = $t04154241623._2
10911091 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10921092 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10931093 then (state ++ refreshKLpActions)
10941094 else throw("Strict value is not equal to itself.")
10951095 }
10961096 else throw("Strict value is not equal to itself.")
10971097 }
10981098 }
10991099
11001100
11011101
11021102 @Callable(i)
11031103 func unstakeAndGet (amount) = {
11041104 let checkPayments = if ((size(i.payments) != 0))
11051105 then throw("No payments are expected")
11061106 else true
11071107 if ((checkPayments == checkPayments))
11081108 then {
11091109 let cfg = getPoolConfig()
11101110 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
11111111 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
11121112 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(lpAssetId), amount], nil)
11131113 if ((unstakeInv == unstakeInv))
11141114 then {
11151115 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller)
11161116 let outAmAmt = res._1
11171117 let outPrAmt = res._2
11181118 let poolStatus = parseIntValue(res._9)
11191119 let state = res._10
11201120 let checkPoolStatus = if (if (isGlobalShutdown())
11211121 then true
11221122 else (poolStatus == PoolShutdown))
11231123 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
11241124 else true
11251125 if ((checkPoolStatus == checkPoolStatus))
11261126 then {
11271127 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
11281128 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
11291129 then {
1130- let $t04274542826 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1131- let refreshKLpActions = $t04274542826._1
1132- let updatedKLp = $t04274542826._2
1130+ let $t04274642827 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1131+ let refreshKLpActions = $t04274642827._1
1132+ let updatedKLp = $t04274642827._2
11331133 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11341134 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11351135 then (state ++ refreshKLpActions)
11361136 else throw("Strict value is not equal to itself.")
11371137 }
11381138 else throw("Strict value is not equal to itself.")
11391139 }
11401140 else throw("Strict value is not equal to itself.")
11411141 }
11421142 else throw("Strict value is not equal to itself.")
11431143 }
11441144 else throw("Strict value is not equal to itself.")
11451145 }
11461146
11471147
11481148
11491149 @Callable(i)
11501150 func unstakeAndGetNoLess (unstakeAmount,noLessThenAmountAsset,noLessThenPriceAsset) = {
11511151 let isGetDisabled = if (isGlobalShutdown())
11521152 then true
11531153 else (cfgPoolStatus == PoolShutdown)
11541154 let checks = [if (!(isGetDisabled))
11551155 then true
11561156 else throw("get operation is blocked by admin"), if ((size(i.payments) == 0))
11571157 then true
11581158 else throw("no payments are expected")]
11591159 if ((checks == checks))
11601160 then {
11611161 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
11621162 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
11631163 if ((unstakeInv == unstakeInv))
11641164 then {
11651165 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller)
11661166 let outAmAmt = res._1
11671167 let outPrAmt = res._2
11681168 let state = res._10
11691169 let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset))
11701170 then true
11711171 else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset))
11721172 then true
11731173 else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))]
11741174 if ((checkAmounts == checkAmounts))
11751175 then {
11761176 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
11771177 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
11781178 then {
1179- let $t04411844199 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1180- let refreshKLpActions = $t04411844199._1
1181- let updatedKLp = $t04411844199._2
1179+ let $t04411944200 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1180+ let refreshKLpActions = $t04411944200._1
1181+ let updatedKLp = $t04411944200._2
11821182 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11831183 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11841184 then (state ++ refreshKLpActions)
11851185 else throw("Strict value is not equal to itself.")
11861186 }
11871187 else throw("Strict value is not equal to itself.")
11881188 }
11891189 else throw("Strict value is not equal to itself.")
11901190 }
11911191 else throw("Strict value is not equal to itself.")
11921192 }
11931193 else throw("Strict value is not equal to itself.")
11941194 }
11951195
11961196
11971197
11981198 @Callable(i)
11991199 func activate (amtAssetStr,priceAssetStr) = if ((toString(i.caller) != toString(factoryContract)))
12001200 then throw("permissions denied")
12011201 else $Tuple2([StringEntry(aa(), amtAssetStr), StringEntry(pa(), priceAssetStr)], "success")
12021202
12031203
12041204
12051205 @Callable(i)
12061206 func refreshKLp () = {
12071207 let lastRefreshedBlockHeight = valueOrElse(getInteger(keyKLpRefreshedHeight), 0)
12081208 let checkLastRefreshedBlockHeight = if (((height - lastRefreshedBlockHeight) >= kLpRefreshDelay))
12091209 then unit
12101210 else throwErr(makeString([toString(kLpRefreshDelay), " blocks have not passed since the previous call"], ""))
12111211 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
12121212 then {
12131213 let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
1214- let $t04538645450 = refreshKLpInternal(0, 0, 0)
1215- let kLpUpdateActions = $t04538645450._1
1216- let updatedKLp = $t04538645450._2
1214+ let $t04538745451 = refreshKLpInternal(0, 0, 0)
1215+ let kLpUpdateActions = $t04538745451._1
1216+ let updatedKLp = $t04538745451._2
12171217 let actions = if ((kLp != updatedKLp))
12181218 then kLpUpdateActions
12191219 else throwErr("nothing to refresh")
12201220 $Tuple2(actions, toString(updatedKLp))
12211221 }
12221222 else throw("Strict value is not equal to itself.")
12231223 }
12241224
12251225
12261226
12271227 @Callable(i)
12281228 func getPoolConfigWrapperREADONLY () = $Tuple2(nil, getPoolConfig())
12291229
12301230
12311231
12321232 @Callable(i)
12331233 func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId))
12341234
12351235
12361236
12371237 @Callable(i)
12381238 func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = {
12391239 let prices = calcPrices(amAmt, prAmt, lpAmt)
12401240 $Tuple2(nil, [toString(prices[0]), toString(prices[1]), toString(prices[2])])
12411241 }
12421242
12431243
12441244
12451245 @Callable(i)
12461246 func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(toX18(origVal, origScaleMult)))
12471247
12481248
12491249
12501250 @Callable(i)
12511251 func fromX18WrapperREADONLY (val,resultScaleMult) = $Tuple2(nil, fromX18(parseBigIntValue(val), resultScaleMult))
12521252
12531253
12541254
12551255 @Callable(i)
12561256 func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(calcPriceBigInt(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18))))
12571257
12581258
12591259
12601260 @Callable(i)
12611261 func estimatePutOperationWrapperREADONLY (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = $Tuple2(nil, estimatePutOperation(txId58, slippageTolerance, inAmAssetAmt, inAmAssetId, inPrAssetAmt, inPrAssetId, userAddress, isEvaluate, emitLp))
12621262
12631263
12641264
12651265 @Callable(i)
12661266 func estimateGetOperationWrapperREADONLY (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
12671267 let res = estimateGetOperation(txId58, pmtAssetId, pmtLpAmt, addressFromStringValue(userAddress))
12681268 $Tuple2(nil, $Tuple10(res._1, res._2, res._3, res._4, res._5, res._6, res._7, toString(res._8), res._9, res._10))
12691269 }
12701270
12711271
12721272
12731273 @Callable(i)
12741274 func statsREADONLY () = {
12751275 let cfg = getPoolConfig()
12761276 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
12771277 let amtAssetId = cfg[idxAmtAssetId]
12781278 let priceAssetId = cfg[idxPriceAssetId]
12791279 let iAmtAssetId = cfg[idxIAmtAssetId]
12801280 let iPriceAssetId = cfg[idxIPriceAssetId]
12811281 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
12821282 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
12831283 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
12841284 let accAmtAssetBalance = getAccBalance(amtAssetId)
12851285 let accPriceAssetBalance = getAccBalance(priceAssetId)
12861286 let pricesList = if ((poolLPBalance == 0))
12871287 then [zeroBigInt, zeroBigInt, zeroBigInt]
12881288 else calcPrices(accAmtAssetBalance, accPriceAssetBalance, poolLPBalance)
12891289 let curPrice = 0
12901290 let lpAmtAssetShare = fromX18(pricesList[1], scale8)
12911291 let lpPriceAssetShare = fromX18(pricesList[2], scale8)
12921292 let poolWeight = value(getInteger(factoryContract, keyPoolWeight(toString(this))))
12931293 $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))
12941294 }
12951295
12961296
12971297
12981298 @Callable(i)
12991299 func evaluatePutByAmountAssetREADONLY (inAmAssetAmt) = {
13001300 let cfg = getPoolConfig()
13011301 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
13021302 let amAssetIdStr = cfg[idxAmtAssetId]
13031303 let amAssetId = fromBase58String(amAssetIdStr)
13041304 let prAssetIdStr = cfg[idxPriceAssetId]
13051305 let prAssetId = fromBase58String(prAssetIdStr)
13061306 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
13071307 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
13081308 let poolStatus = cfg[idxPoolStatus]
13091309 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
13101310 let accAmtAssetBalance = getAccBalance(amAssetIdStr)
13111311 let accPriceAssetBalance = getAccBalance(prAssetIdStr)
13121312 let amtAssetAmtX18 = toX18(accAmtAssetBalance, amtAssetDcm)
13131313 let priceAssetAmtX18 = toX18(accPriceAssetBalance, priceAssetDcm)
13141314 let curPriceX18 = if ((poolLPBalance == 0))
13151315 then zeroBigInt
13161316 else calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
13171317 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
13181318 let inPrAssetAmtX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18)
13191319 let inPrAssetAmt = fromX18(inPrAssetAmtX18, priceAssetDcm)
13201320 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
13211321 let calcLpAmt = estPut._1
13221322 let curPriceCalc = estPut._3
13231323 let amBalance = estPut._4
13241324 let prBalance = estPut._5
13251325 let lpEmission = estPut._6
13261326 $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))
13271327 }
13281328
13291329
13301330
13311331 @Callable(i)
13321332 func evaluatePutByPriceAssetREADONLY (inPrAssetAmt) = {
13331333 let cfg = getPoolConfig()
13341334 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
13351335 let amAssetIdStr = cfg[idxAmtAssetId]
13361336 let amAssetId = fromBase58String(amAssetIdStr)
13371337 let prAssetIdStr = cfg[idxPriceAssetId]
13381338 let prAssetId = fromBase58String(prAssetIdStr)
13391339 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
13401340 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
13411341 let poolStatus = cfg[idxPoolStatus]
13421342 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
13431343 let amBalanceRaw = getAccBalance(amAssetIdStr)
13441344 let prBalanceRaw = getAccBalance(prAssetIdStr)
13451345 let amBalanceRawX18 = toX18(amBalanceRaw, amtAssetDcm)
13461346 let prBalanceRawX18 = toX18(prBalanceRaw, priceAssetDcm)
13471347 let curPriceX18 = if ((poolLPBalance == 0))
13481348 then zeroBigInt
13491349 else calcPriceBigInt(prBalanceRawX18, amBalanceRawX18)
13501350 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
13511351 let inAmAssetAmtX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
13521352 let inAmAssetAmt = fromX18(inAmAssetAmtX18, amtAssetDcm)
13531353 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
13541354 let calcLpAmt = estPut._1
13551355 let curPriceCalc = estPut._3
13561356 let amBalance = estPut._4
13571357 let prBalance = estPut._5
13581358 let lpEmission = estPut._6
13591359 $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))
13601360 }
13611361
13621362
13631363
13641364 @Callable(i)
13651365 func evaluateGetREADONLY (paymentLpAssetId,paymentLpAmt) = {
13661366 let res = estimateGetOperation("", paymentLpAssetId, paymentLpAmt, this)
13671367 let outAmAmt = res._1
13681368 let outPrAmt = res._2
13691369 let amBalance = res._5
13701370 let prBalance = res._6
13711371 let lpEmission = res._7
13721372 let curPrice = res._8
13731373 let poolStatus = parseIntValue(res._9)
13741374 $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))
13751375 }
13761376
13771377
13781378 @Verifier(tx)
13791379 func verify () = {
13801380 let targetPublicKey = match managerPublicKeyOrUnit() {
13811381 case pk: ByteVector =>
13821382 pk
13831383 case _: Unit =>
13841384 tx.senderPublicKey
13851385 case _ =>
13861386 throw("Match error")
13871387 }
13881388 match tx {
13891389 case order: Order =>
13901390 let matcherPub = getMatcherPubOrFail()
13911391 let orderValid = validateMatcherOrderAllowed(order)
13921392 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
13931393 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
13941394 if (if (if (orderValid)
13951395 then senderValid
13961396 else false)
13971397 then matcherValid
13981398 else false)
13991399 then true
14001400 else throwOrderError(orderValid, senderValid, matcherValid)
14011401 case s: SetScriptTransaction =>
14021402 let newHash = blake2b256(value(s.script))
14031403 let allowedHash = fromBase64String(value(getString(factoryContract, keyAllowedLpScriptHash())))
14041404 let currentHash = scriptHash(this)
14051405 if (if ((allowedHash == newHash))
14061406 then (currentHash != newHash)
14071407 else false)
14081408 then true
14091409 else sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
14101410 case _ =>
14111411 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
14121412 }
14131413 }
14141414

github/deemru/w8io/026f985 
173.21 ms