tx · 5VLq4zWFrJZMiCCrahiyZ3E2dsTyCzz2KNxWrcW7RnmC

3MrULQRLc52GWrJF1tMcAm4M78fPe57o9Kt:  -0.04200000 Waves

2023.04.05 12:19 [2521053] smart account 3MrULQRLc52GWrJF1tMcAm4M78fPe57o9Kt > SELF 0.00000000 Waves

{ "type": 13, "id": "5VLq4zWFrJZMiCCrahiyZ3E2dsTyCzz2KNxWrcW7RnmC", "fee": 4200000, "feeAssetId": null, "timestamp": 1680686365617, "version": 2, "chainId": 84, "sender": "3MrULQRLc52GWrJF1tMcAm4M78fPe57o9Kt", "senderPublicKey": "Aig94J3pRT3J41eXw33rJrs67gTCECiMVRZrbtuoARit", "proofs": [ "dsbsY246CdTPCunntJcjyybF4NnEWehhwqmDSU245vjxsVcyrQ2W8UcAXvLnu5mkNQYFmM5TZMAUNHm2VQ1x3B8" ], "script": "base64:BgL8NggCEgASBQoDAQQBEgcKBQEEAQgBEgMKAQgSABIECgIBBBIDCgEBEgQKAgEEEgQKAggBEgQKAggBEgQKAggBEgUKAwEIARIAEgQKAgEBEgMKAQESBQoDAQEBEgQKAggIEgASABIDCgEIEgUKAwEBARIECgIBARIECgIIARIECgIICBILCgkIAQECAQIIBAQSBgoECAgBCBIAEgMKAQESAwoBARIECgIIASIKbFBkZWNpbWFscyIGc2NhbGU4IgxzY2FsZThCaWdJbnQiB3NjYWxlMTgiCnplcm9CaWdJbnQiBGJpZzAiBGJpZzEiBGJpZzIiC3dhdmVzU3RyaW5nIgNTRVAiClBvb2xBY3RpdmUiD1Bvb2xQdXREaXNhYmxlZCITUG9vbE1hdGNoZXJEaXNhYmxlZCIMUG9vbFNodXRkb3duIg5pZHhQb29sQWRkcmVzcyINaWR4UG9vbFN0YXR1cyIQaWR4UG9vbExQQXNzZXRJZCINaWR4QW10QXNzZXRJZCIPaWR4UHJpY2VBc3NldElkIg5pZHhBbXRBc3NldERjbSIQaWR4UHJpY2VBc3NldERjbSIOaWR4SUFtdEFzc2V0SWQiEGlkeElQ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D0AwMIBQJpZwlib2R5Qnl0ZXMJAJEDAggFAmlnBnByb29mcwAABQJpaQYEAmlsCQD2AwEJAQV2YWx1ZQEIBQJnZgZzY3JpcHQEAmltCQDbBAEJAQV2YWx1ZQEJAJ0IAgUCYVQJAQJhRgAEAmluCQDxBwEFBHRoaXMDCQAAAgUCaW0FAmlsCQECIT0CBQJpbgUCaWwHCQD0AwMIBQJpZwlib2R5Qnl0ZXMJAJEDAggFAmlnBnByb29mcwAABQJpaSaPx1A=", "height": 2521053, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: GrHZ4cfkLfXobMgWSizqFsZApU3cjhehrPz1Z5ZKGSzh Next: G5vBozyZJPVVC4kfZvCJeZYq7hzZfyaox9Rpwummn3wL Diff:
OldNewDifferences
130130
131131 let kLpRefreshDelay = valueOrElse(getInteger(this, keyKLpRefreshDelay), kLpRefreshDelayDefault)
132132
133-func keySWavesAssetId () = "%s__sWavesAssetId"
133+func keyAdditionalBalance (assetId) = makeString(["%s%s", "stakedBalance", assetId], SEP)
134134
135135
136-func keySWavesProxyAddress () = "%s__sWavesProxyAddress"
137-
138-
139-func keyAdditionalBalance (assetId) = makeString(["%s%s", "additionalBalance", assetId], SEP)
140-
141-
142-func keyStakingAssetBalance (assetId) = makeString(["%s%s", "stakingAssetBalance", assetId], SEP)
136+func keyStakingAssetBalance (assetId) = makeString(["%s%s", "shareAssetBalance", assetId], SEP)
143137
144138
145139 func getAdditionalBalanceOrZero (assetId) = valueOrElse(getInteger(this, keyAdditionalBalance(assetId)), 0)
207201 else throw(($getType(@) + " couldn't be cast to Int"))
208202 }
209203
210-func sWavesId () = getStringOrFail(factoryContract, keySWavesAssetId())
211-
212-
213-func sWavesProxy () = getStringOrFail(factoryContract, keySWavesProxyAddress())
214-
215-
216204 func isGlobalShutdown () = valueOrElse(getBoolean(factoryContract, keyAllPoolsShutdown()), false)
217205
218206
243231
244232 let poolConfigParsed = parsePoolConfig(getPoolConfig())
245233
246-let $t092979463 = poolConfigParsed
234+let $t089629128 = poolConfigParsed
247235
248-let cfgPoolAddress = $t092979463._1
236+let cfgPoolAddress = $t089629128._1
249237
250-let cfgPoolStatus = $t092979463._2
238+let cfgPoolStatus = $t089629128._2
251239
252-let cfgLpAssetId = $t092979463._3
240+let cfgLpAssetId = $t089629128._3
253241
254-let cfgAmountAssetId = $t092979463._4
242+let cfgAmountAssetId = $t089629128._4
255243
256-let cfgPriceAssetId = $t092979463._5
244+let cfgPriceAssetId = $t089629128._5
257245
258-let cfgAmountAssetDecimals = $t092979463._6
246+let cfgAmountAssetDecimals = $t089629128._6
259247
260-let cfgPriceAssetDecimals = $t092979463._7
248+let cfgPriceAssetDecimals = $t089629128._7
261249
262250 func getFactoryConfig () = split(getStringOrFail(factoryContract, keyFactoryConfig()), SEP)
263251
414402
415403 func rebalanceAsset (assetId) = match getLeaseProxyConfig(assetId) {
416404 case a: (Boolean, Int, Int, String, String, Int, String) =>
417- let $t01581415923 = a
418- let isLeasable = $t01581415923._1
419- let leasedRatio = $t01581415923._2
420- let minBalance = $t01581415923._3
421- let proxyAddress = $t01581415923._4
422- let proxyAssetId = $t01581415923._5
423- let proxyRateMul = $t01581415923._6
424- let stakingProfitAddress = $t01581415923._7
405+ let $t01547915588 = a
406+ let isLeasable = $t01547915588._1
407+ let leasedRatio = $t01547915588._2
408+ let minBalance = $t01547915588._3
409+ let proxyAddress = $t01547915588._4
410+ let proxyAssetId = $t01547915588._5
411+ let proxyRateMul = $t01547915588._6
412+ let stakingProfitAddress = $t01547915588._7
425413 if (isLeasable)
426414 then rebalanceInternal(leasedRatio, assetId, proxyAssetId, minBalance, addressFromStringValue(proxyAddress), proxyRateMul, addressFromStringValue(stakingProfitAddress))
427415 else nil
432420
433421 func getWithdrawAssetState (assetId,getAmount) = match getLeaseProxyConfig(assetId) {
434422 case a: (Boolean, Int, Int, String, String, Int, String) =>
435- let $t01651616625 = a
436- let isLeasable = $t01651616625._1
437- let leasedRatio = $t01651616625._2
438- let minBalance = $t01651616625._3
439- let proxyAddress = $t01651616625._4
440- let proxyAssetId = $t01651616625._5
441- let proxyRateMul = $t01651616625._6
442- let stakingProfitAddress = $t01651616625._7
423+ let $t01618116290 = a
424+ let isLeasable = $t01618116290._1
425+ let leasedRatio = $t01618116290._2
426+ let minBalance = $t01618116290._3
427+ let proxyAddress = $t01618116290._4
428+ let proxyAssetId = $t01618116290._5
429+ let proxyRateMul = $t01618116290._6
430+ let stakingProfitAddress = $t01618116290._7
443431 if (isLeasable)
444432 then {
445433 let newTotalCalcBalance = max([0, ((getAccBalance(assetId) - getAmount) - minBalance)])
652640 let priceAssetBalance = getAccBalance(assetIdToString(cfgPriceAssetId))
653641 let amountAssetAmount = order.amount
654642 let priceAssetAmount = fraction(order.amount, order.price, scale8, FLOOR)
655- let $t02870728919 = if ((order.orderType == Buy))
643+ let $t02837228584 = if ((order.orderType == Buy))
656644 then $Tuple2(amountAssetAmount, -(priceAssetAmount))
657645 else $Tuple2(-(amountAssetAmount), priceAssetAmount)
658- let amountAssetBalanceDelta = $t02870728919._1
659- let priceAssetBalanceDelta = $t02870728919._2
646+ let amountAssetBalanceDelta = $t02837228584._1
647+ let priceAssetBalanceDelta = $t02837228584._2
660648 if (if (if (isGlobalShutdown())
661649 then true
662650 else (cfgPoolStatus == PoolMatcherDisabled))
669657 then throw("Wrong order assets.")
670658 else {
671659 let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
672- let $t02935929459 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
673- let unusedActions = $t02935929459._1
674- let kLpNew = $t02935929459._2
660+ let $t02902429124 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
661+ let unusedActions = $t02902429124._1
662+ let kLpNew = $t02902429124._2
675663 let isOrderValid = (kLpNew >= kLp)
676664 let info = makeString(["kLp=", toString(kLp), " kLpNew=", toString(kLpNew), " amountAssetBalance=", toString(amountAssetBalance), " priceAssetBalance=", toString(priceAssetBalance), " amountAssetBalanceDelta=", toString(amountAssetBalanceDelta), " priceAssetBalanceDelta=", toString(priceAssetBalanceDelta), " height=", toString(height)], "")
677665 $Tuple2(isOrderValid, info)
750738 else if ((paymentAssetId == cfgPriceAssetId))
751739 then false
752740 else throwErr("invalid asset")
753- let $t03257232865 = if (isEval)
741+ let $t03223732530 = if (isEval)
754742 then $Tuple2(amountBalanceRaw, priceBalanceRaw)
755743 else if (paymentInAmountAsset)
756744 then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw)
757745 else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw))
758- let amountBalanceOld = $t03257232865._1
759- let priceBalanceOld = $t03257232865._2
760- let $t03286933018 = if (paymentInAmountAsset)
746+ let amountBalanceOld = $t03223732530._1
747+ let priceBalanceOld = $t03223732530._2
748+ let $t03253432683 = if (paymentInAmountAsset)
761749 then $Tuple2(paymentAmountRaw, 0)
762750 else $Tuple2(0, paymentAmountRaw)
763- let amountAssetAmountRaw = $t03286933018._1
764- let priceAssetAmountRaw = $t03286933018._2
751+ let amountAssetAmountRaw = $t03253432683._1
752+ let priceAssetAmountRaw = $t03253432683._2
765753 let amountAssetAmount = takeFee(amountAssetAmountRaw, inFee)._1
766754 let priceAssetAmount = takeFee(priceAssetAmountRaw, inFee)._1
767- let $t03315033214 = takeFee(paymentAmountRaw, inFee)
768- let paymentAmount = $t03315033214._1
769- let feeAmount = $t03315033214._2
755+ let $t03281532879 = takeFee(paymentAmountRaw, inFee)
756+ let paymentAmount = $t03281532879._1
757+ let feeAmount = $t03281532879._2
770758 let amountBalanceNew = (amountBalanceOld + amountAssetAmount)
771759 let priceBalanceNew = (priceBalanceOld + priceAssetAmount)
772760 let priceNewX18 = calcPriceBigInt(toX18(priceBalanceNew, cfgPriceAssetDecimals), toX18(amountBalanceNew, cfgAmountAssetDecimals))
789777 let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, cfgPriceAssetDecimals), toX18(amountBalanceOld, cfgAmountAssetDecimals))
790778 let priceOld = fromX18(priceOldX18, scale8)
791779 let loss = {
792- let $t03489535062 = if (paymentInAmountAsset)
780+ let $t03456034727 = if (paymentInAmountAsset)
793781 then $Tuple2(amountAssetAmountRaw, amountBalanceOld)
794782 else $Tuple2(priceAssetAmountRaw, priceBalanceOld)
795- let amount = $t03489535062._1
796- let balance = $t03489535062._2
783+ let amount = $t03456034727._1
784+ let balance = $t03456034727._2
797785 let issueAmountBoth = toInt(fraction(supplyBigInt, toBigInt((amount / 2)), toBigInt(balance)))
798786 fraction((issueAmount - issueAmountBoth), scale8, issueAmountBoth)
799787 }
833821 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
834822 let redeemedBigInt = toBigInt(paymentAmount)
835823 let amountRaw = max([0, toInt(((balanceBigInt * (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN))) / scale18))])
836- let $t03714037196 = takeFee(amountRaw, outFee)
837- let totalAmount = $t03714037196._1
838- let feeAmount = $t03714037196._2
839- let $t03720037426 = if (outInAmountAsset)
824+ let $t03680536861 = takeFee(amountRaw, outFee)
825+ let totalAmount = $t03680536861._1
826+ let feeAmount = $t03680536861._2
827+ let $t03686537091 = if (outInAmountAsset)
840828 then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld)
841829 else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw))
842- let outAmAmount = $t03720037426._1
843- let outPrAmount = $t03720037426._2
844- let amBalanceNew = $t03720037426._3
845- let prBalanceNew = $t03720037426._4
830+ let outAmAmount = $t03686537091._1
831+ let outPrAmount = $t03686537091._2
832+ let amBalanceNew = $t03686537091._3
833+ let prBalanceNew = $t03686537091._4
846834 let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, cfgPriceAssetDecimals), toX18(amBalanceNew, cfgAmountAssetDecimals))
847835 let priceNew = fromX18(priceNewX18, scale8)
848836 let commonState = if (isEval)
914902
915903 @Callable(i)
916904 func calculateAmountOutForSwapREADONLY (cleanAmountIn,isReverse,feePoolAmount) = {
917- let $t03931239617 = if ((isReverse == false))
905+ let $t03897739282 = if ((isReverse == false))
918906 then {
919907 let assetOut = getStringOrFail(this, pa())
920908 let assetIn = getStringOrFail(this, aa())
925913 let assetIn = getStringOrFail(this, pa())
926914 $Tuple2(assetOut, assetIn)
927915 }
928- let assetOut = $t03931239617._1
929- let assetIn = $t03931239617._2
916+ let assetOut = $t03897739282._1
917+ let assetIn = $t03897739282._2
930918 let poolAssetInBalance = getAccBalance(assetIn)
931919 let poolAssetOutBalance = getAccBalance(assetOut)
932920 let amountOut = fraction(poolAssetOutBalance, cleanAmountIn, (poolAssetInBalance + cleanAmountIn))
10721060 else throw("Strict value is not equal to itself.")
10731061 }
10741062 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
1075- let $t04459045052 = refreshKLpInternal(0, 0, 0)
1076- if (($t04459045052 == $t04459045052))
1063+ let $t04425544717 = refreshKLpInternal(0, 0, 0)
1064+ if (($t04425544717 == $t04425544717))
10771065 then {
1078- let updatedKLp = $t04459045052._2
1079- let refreshKLpActions = $t04459045052._1
1066+ let updatedKLp = $t04425544717._2
1067+ let refreshKLpActions = $t04425544717._1
10801068 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10811069 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10821070 then {
11131101 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
11141102 if ((currentKLp == currentKLp))
11151103 then {
1116- let $t04566445729 = refreshKLpInternal(0, 0, 0)
1117- let refreshKLpActions = $t04566445729._1
1118- let updatedKLp = $t04566445729._2
1104+ let $t04532945394 = refreshKLpInternal(0, 0, 0)
1105+ let refreshKLpActions = $t04532945394._1
1106+ let updatedKLp = $t04532945394._2
11191107 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11201108 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11211109 then (state ++ refreshKLpActions)
11621150 then {
11631151 let userAddress = i.caller
11641152 let txId = i.transactionId
1165- let $t04691747069 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
1166- if (($t04691747069 == $t04691747069))
1153+ let $t04658246734 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
1154+ if (($t04658246734 == $t04658246734))
11671155 then {
1168- let paymentInAmountAsset = $t04691747069._5
1169- let bonus = $t04691747069._4
1170- let feeAmount = $t04691747069._3
1171- let commonState = $t04691747069._2
1172- let emitAmountEstimated = $t04691747069._1
1156+ let paymentInAmountAsset = $t04658246734._5
1157+ let bonus = $t04658246734._4
1158+ let feeAmount = $t04658246734._3
1159+ let commonState = $t04658246734._2
1160+ let emitAmountEstimated = $t04658246734._1
11731161 let emitAmount = if (if ((minOutAmount > 0))
11741162 then (minOutAmount > emitAmountEstimated)
11751163 else false)
11891177 let sendFee = if ((feeAmount > 0))
11901178 then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
11911179 else nil
1192- let $t04765547852 = if ((this == feeCollectorAddress))
1180+ let $t04732047517 = if ((this == feeCollectorAddress))
11931181 then $Tuple2(0, 0)
11941182 else if (paymentInAmountAsset)
11951183 then $Tuple2(-(feeAmount), 0)
11961184 else $Tuple2(0, -(feeAmount))
1197- let amountAssetBalanceDelta = $t04765547852._1
1198- let priceAssetBalanceDelta = $t04765547852._2
1199- let $t04785547963 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1200- let refreshKLpActions = $t04785547963._1
1201- let updatedKLp = $t04785547963._2
1185+ let amountAssetBalanceDelta = $t04732047517._1
1186+ let priceAssetBalanceDelta = $t04732047517._2
1187+ let $t04752047628 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1188+ let refreshKLpActions = $t04752047628._1
1189+ let updatedKLp = $t04752047628._2
12021190 let kLp = value(getString(keyKLp))
12031191 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
12041192 if ((isUpdatedKLpValid == isUpdatedKLpValid))
12231211
12241212 @Callable(i)
12251213 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
1226- let $t04831848475 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
1227- let emitAmountEstimated = $t04831848475._1
1228- let commonState = $t04831848475._2
1229- let feeAmount = $t04831848475._3
1230- let bonus = $t04831848475._4
1231- let paymentInAmountAsset = $t04831848475._5
1214+ let $t04798348140 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
1215+ let emitAmountEstimated = $t04798348140._1
1216+ let commonState = $t04798348140._2
1217+ let feeAmount = $t04798348140._3
1218+ let bonus = $t04798348140._4
1219+ let paymentInAmountAsset = $t04798348140._5
12321220 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
12331221 }
12341222
12651253 then {
12661254 let userAddress = i.caller
12671255 let txId = i.transactionId
1268- let $t04936049513 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
1269- if (($t04936049513 == $t04936049513))
1256+ let $t04902549178 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
1257+ if (($t04902549178 == $t04902549178))
12701258 then {
1271- let outInAmountAsset = $t04936049513._5
1272- let bonus = $t04936049513._4
1273- let feeAmount = $t04936049513._3
1274- let commonState = $t04936049513._2
1275- let amountEstimated = $t04936049513._1
1259+ let outInAmountAsset = $t04902549178._5
1260+ let bonus = $t04902549178._4
1261+ let feeAmount = $t04902549178._3
1262+ let commonState = $t04902549178._2
1263+ let amountEstimated = $t04902549178._1
12761264 let amount = if (if ((minOutAmount > 0))
12771265 then (minOutAmount > amountEstimated)
12781266 else false)
12881276 let sendFee = if ((feeAmount > 0))
12891277 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
12901278 else nil
1291- let $t05008350330 = {
1279+ let $t04974849995 = {
12921280 let feeAmountForCalc = if ((this == feeCollectorAddress))
12931281 then 0
12941282 else feeAmount
12961284 then $Tuple2(-((amount + feeAmountForCalc)), 0)
12971285 else $Tuple2(0, -((amount + feeAmountForCalc)))
12981286 }
1299- let amountAssetBalanceDelta = $t05008350330._1
1300- let priceAssetBalanceDelta = $t05008350330._2
1301- let $t05033350441 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1302- let refreshKLpActions = $t05033350441._1
1303- let updatedKLp = $t05033350441._2
1287+ let amountAssetBalanceDelta = $t04974849995._1
1288+ let priceAssetBalanceDelta = $t04974849995._2
1289+ let $t04999850106 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1290+ let refreshKLpActions = $t04999850106._1
1291+ let updatedKLp = $t04999850106._2
13041292 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
13051293 if ((isUpdatedKLpValid == isUpdatedKLpValid))
13061294 then $Tuple2(((((commonState ++ withdrawState) ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
13211309
13221310 @Callable(i)
13231311 func getOneTknREADONLY (outAssetId,paymentAmount) = {
1324- let $t05071950875 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
1325- let amountEstimated = $t05071950875._1
1326- let commonState = $t05071950875._2
1327- let feeAmount = $t05071950875._3
1328- let bonus = $t05071950875._4
1329- let outInAmountAsset = $t05071950875._5
1312+ let $t05038450540 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
1313+ let amountEstimated = $t05038450540._1
1314+ let commonState = $t05038450540._2
1315+ let feeAmount = $t05038450540._3
1316+ let bonus = $t05038450540._4
1317+ let outInAmountAsset = $t05038450540._5
13301318 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
13311319 }
13321320
13631351 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
13641352 if ((unstakeInv == unstakeInv))
13651353 then {
1366- let $t05178051931 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1367- if (($t05178051931 == $t05178051931))
1354+ let $t05144551596 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1355+ if (($t05144551596 == $t05144551596))
13681356 then {
1369- let outInAmountAsset = $t05178051931._5
1370- let bonus = $t05178051931._4
1371- let feeAmount = $t05178051931._3
1372- let commonState = $t05178051931._2
1373- let amountEstimated = $t05178051931._1
1357+ let outInAmountAsset = $t05144551596._5
1358+ let bonus = $t05144551596._4
1359+ let feeAmount = $t05144551596._3
1360+ let commonState = $t05144551596._2
1361+ let amountEstimated = $t05144551596._1
13741362 let amount = if (if ((minOutAmount > 0))
13751363 then (minOutAmount > amountEstimated)
13761364 else false)
13861374 let sendFee = if ((feeAmount > 0))
13871375 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
13881376 else nil
1389- let $t05249652743 = {
1377+ let $t05216152408 = {
13901378 let feeAmountForCalc = if ((this == feeCollectorAddress))
13911379 then 0
13921380 else feeAmount
13941382 then $Tuple2(-((amount + feeAmountForCalc)), 0)
13951383 else $Tuple2(0, -((amount + feeAmountForCalc)))
13961384 }
1397- let amountAssetBalanceDelta = $t05249652743._1
1398- let priceAssetBalanceDelta = $t05249652743._2
1399- let $t05274652854 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1400- let refreshKLpActions = $t05274652854._1
1401- let updatedKLp = $t05274652854._2
1385+ let amountAssetBalanceDelta = $t05216152408._1
1386+ let priceAssetBalanceDelta = $t05216152408._2
1387+ let $t05241152519 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1388+ let refreshKLpActions = $t05241152519._1
1389+ let updatedKLp = $t05241152519._2
14021390 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
14031391 if ((isUpdatedKLpValid == isUpdatedKLpValid))
14041392 then $Tuple2(((((commonState ++ withdrawState) ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
14331421 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
14341422 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
14351423 then {
1436- let $t05382153903 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1437- let refreshKLpActions = $t05382153903._1
1438- let updatedKLp = $t05382153903._2
1424+ let $t05348653568 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1425+ let refreshKLpActions = $t05348653568._1
1426+ let updatedKLp = $t05348653568._2
14391427 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
14401428 if ((isUpdatedKLpValid == isUpdatedKLpValid))
14411429 then (state ++ refreshKLpActions)
14671455 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
14681456 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
14691457 then {
1470- let $t05485254933 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1471- let refreshKLpActions = $t05485254933._1
1472- let updatedKLp = $t05485254933._2
1458+ let $t05451754598 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1459+ let refreshKLpActions = $t05451754598._1
1460+ let updatedKLp = $t05451754598._2
14731461 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
14741462 if ((isUpdatedKLpValid == isUpdatedKLpValid))
14751463 then (state ++ refreshKLpActions)
15131501 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
15141502 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
15151503 then {
1516- let $t05605956140 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1517- let refreshKLpActions = $t05605956140._1
1518- let updatedKLp = $t05605956140._2
1504+ let $t05572455805 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1505+ let refreshKLpActions = $t05572455805._1
1506+ let updatedKLp = $t05572455805._2
15191507 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
15201508 if ((isUpdatedKLpValid == isUpdatedKLpValid))
15211509 then (state ++ refreshKLpActions)
15661554 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
15671555 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
15681556 then {
1569- let $t05743557516 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1570- let refreshKLpActions = $t05743557516._1
1571- let updatedKLp = $t05743557516._2
1557+ let $t05710057181 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1558+ let refreshKLpActions = $t05710057181._1
1559+ let updatedKLp = $t05710057181._2
15721560 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
15731561 if ((isUpdatedKLpValid == isUpdatedKLpValid))
15741562 then (state ++ refreshKLpActions)
16031591 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
16041592 then {
16051593 let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
1606- let $t05870358767 = refreshKLpInternal(0, 0, 0)
1607- let kLpUpdateActions = $t05870358767._1
1608- let updatedKLp = $t05870358767._2
1594+ let $t05836858432 = refreshKLpInternal(0, 0, 0)
1595+ let kLpUpdateActions = $t05836858432._1
1596+ let updatedKLp = $t05836858432._2
16091597 let actions = if ((kLp != updatedKLp))
16101598 then kLpUpdateActions
16111599 else throwErr("nothing to refresh")
17801768 match tx {
17811769 case order: Order =>
17821770 let matcherPub = getMatcherPubOrFail()
1783- let $t06742967498 = validateMatcherOrderAllowed(order)
1784- let orderValid = $t06742967498._1
1785- let orderValidInfo = $t06742967498._2
1771+ let $t06709467163 = validateMatcherOrderAllowed(order)
1772+ let orderValid = $t06709467163._1
1773+ let orderValidInfo = $t06709467163._2
17861774 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
17871775 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
17881776 if (if (if (orderValid)
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 toX18BigInt (origVal,origScaleMult) = fraction(origVal, scale18, origScaleMult)
6666
6767
6868 func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), scale18))
6969
7070
7171 func fromX18Round (val,resultScaleMult,round) = toInt(fraction(val, toBigInt(resultScaleMult), scale18, round))
7272
7373
7474 func toScale (amt,resScale,curScale) = fraction(amt, resScale, curScale)
7575
7676
7777 func abs (val) = if ((0 > val))
7878 then -(val)
7979 else val
8080
8181
8282 func absBigInt (val) = if ((zeroBigInt > val))
8383 then -(val)
8484 else val
8585
8686
8787 func swapContract () = "%s__swapContract"
8888
8989
9090 func fc () = "%s__factoryContract"
9191
9292
9393 func mpk () = "%s__managerPublicKey"
9494
9595
9696 func pmpk () = "%s__pendingManagerPublicKey"
9797
9898
9999 func pl () = "%s%s__price__last"
100100
101101
102102 func ph (h,timestamp) = makeString(["%s%s%d%d__price__history", toString(h), toString(timestamp)], SEP)
103103
104104
105105 func pau (userAddress,txId) = ((("%s%s%s__P__" + userAddress) + "__") + txId)
106106
107107
108108 func gau (userAddress,txId) = ((("%s%s%s__G__" + userAddress) + "__") + txId)
109109
110110
111111 func aa () = "%s__amountAsset"
112112
113113
114114 func pa () = "%s__priceAsset"
115115
116116
117117 let keyFee = "%s__fee"
118118
119119 let feeDefault = fraction(10, scale8, 10000)
120120
121121 let fee = valueOrElse(getInteger(this, keyFee), feeDefault)
122122
123123 let keyKLp = makeString(["%s", "kLp"], SEP)
124124
125125 let keyKLpRefreshedHeight = makeString(["%s", "kLpRefreshedHeight"], SEP)
126126
127127 let keyKLpRefreshDelay = makeString(["%s", "refreshKLpDelay"], SEP)
128128
129129 let kLpRefreshDelayDefault = 30
130130
131131 let kLpRefreshDelay = valueOrElse(getInteger(this, keyKLpRefreshDelay), kLpRefreshDelayDefault)
132132
133-func keySWavesAssetId () = "%s__sWavesAssetId"
133+func keyAdditionalBalance (assetId) = makeString(["%s%s", "stakedBalance", assetId], SEP)
134134
135135
136-func keySWavesProxyAddress () = "%s__sWavesProxyAddress"
137-
138-
139-func keyAdditionalBalance (assetId) = makeString(["%s%s", "additionalBalance", assetId], SEP)
140-
141-
142-func keyStakingAssetBalance (assetId) = makeString(["%s%s", "stakingAssetBalance", assetId], SEP)
136+func keyStakingAssetBalance (assetId) = makeString(["%s%s", "shareAssetBalance", assetId], SEP)
143137
144138
145139 func getAdditionalBalanceOrZero (assetId) = valueOrElse(getInteger(this, keyAdditionalBalance(assetId)), 0)
146140
147141
148142 func getStakingAssetBalanceOrZero (assetId) = valueOrElse(getInteger(this, keyStakingAssetBalance(assetId)), 0)
149143
150144
151145 func keyFactoryConfig () = "%s__factoryConfig"
152146
153147
154148 func keyMatcherPub () = "%s%s__matcher__publicKey"
155149
156150
157151 func keyMappingPoolContractAddressToPoolAssets (poolContractAddress) = (("%s%s%s__" + poolContractAddress) + "__mappings__poolContract2LpAsset")
158152
159153
160154 func keyPoolConfig (iAmtAsset,iPriceAsset) = (((("%d%d%s__" + iAmtAsset) + "__") + iPriceAsset) + "__config")
161155
162156
163157 func keyMappingsBaseAsset2internalId (baseAssetStr) = ("%s%s%s__mappings__baseAsset2internalId__" + baseAssetStr)
164158
165159
166160 func keyAllPoolsShutdown () = "%s__shutdown"
167161
168162
169163 func keyPoolWeight (contractAddress) = ("%s%s__poolWeight__" + contractAddress)
170164
171165
172166 func keyAllowedLpScriptHash () = "%s__allowedLpScriptHash"
173167
174168
175169 let keyFeeCollectorAddress = "%s__feeCollectorAddress"
176170
177171 func throwOrderError (orderValid,orderValidInfo,senderValid,matcherValid) = throw((((((((("order validation failed: orderValid=" + toString(orderValid)) + " (") + orderValidInfo) + ")") + " senderValid=") + toString(senderValid)) + " matcherValid=") + toString(matcherValid)))
178172
179173
180174 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
181175
182176
183177 func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
184178
185179
186180 func throwErr (msg) = throw(makeString(["lp.ride:", msg], " "))
187181
188182
189183 func fmtErr (msg) = makeString(["lp.ride:", msg], " ")
190184
191185
192186 let factoryContract = addressFromStringValue(getStringOrFail(this, fc()))
193187
194188 let feeCollectorAddress = addressFromStringValue(getStringOrFail(factoryContract, keyFeeCollectorAddress))
195189
196190 let inFee = {
197191 let @ = invoke(factoryContract, "getInFeeREADONLY", [toString(this)], nil)
198192 if ($isInstanceOf(@, "Int"))
199193 then @
200194 else throw(($getType(@) + " couldn't be cast to Int"))
201195 }
202196
203197 let outFee = {
204198 let @ = invoke(factoryContract, "getOutFeeREADONLY", [toString(this)], nil)
205199 if ($isInstanceOf(@, "Int"))
206200 then @
207201 else throw(($getType(@) + " couldn't be cast to Int"))
208202 }
209203
210-func sWavesId () = getStringOrFail(factoryContract, keySWavesAssetId())
211-
212-
213-func sWavesProxy () = getStringOrFail(factoryContract, keySWavesProxyAddress())
214-
215-
216204 func isGlobalShutdown () = valueOrElse(getBoolean(factoryContract, keyAllPoolsShutdown()), false)
217205
218206
219207 func getMatcherPubOrFail () = fromBase58String(getStringOrFail(factoryContract, keyMatcherPub()))
220208
221209
222210 func getPoolConfig () = {
223211 let amtAsset = getStringOrFail(this, aa())
224212 let priceAsset = getStringOrFail(this, pa())
225213 let iPriceAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(priceAsset))
226214 let iAmtAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(amtAsset))
227215 split(getStringOrFail(factoryContract, keyPoolConfig(toString(iAmtAsset), toString(iPriceAsset))), SEP)
228216 }
229217
230218
231219 func parseAssetId (input) = if ((input == wavesString))
232220 then unit
233221 else fromBase58String(input)
234222
235223
236224 func assetIdToString (input) = if ((input == unit))
237225 then wavesString
238226 else toBase58String(value(input))
239227
240228
241229 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]))
242230
243231
244232 let poolConfigParsed = parsePoolConfig(getPoolConfig())
245233
246-let $t092979463 = poolConfigParsed
234+let $t089629128 = poolConfigParsed
247235
248-let cfgPoolAddress = $t092979463._1
236+let cfgPoolAddress = $t089629128._1
249237
250-let cfgPoolStatus = $t092979463._2
238+let cfgPoolStatus = $t089629128._2
251239
252-let cfgLpAssetId = $t092979463._3
240+let cfgLpAssetId = $t089629128._3
253241
254-let cfgAmountAssetId = $t092979463._4
242+let cfgAmountAssetId = $t089629128._4
255243
256-let cfgPriceAssetId = $t092979463._5
244+let cfgPriceAssetId = $t089629128._5
257245
258-let cfgAmountAssetDecimals = $t092979463._6
246+let cfgAmountAssetDecimals = $t089629128._6
259247
260-let cfgPriceAssetDecimals = $t092979463._7
248+let cfgPriceAssetDecimals = $t089629128._7
261249
262250 func getFactoryConfig () = split(getStringOrFail(factoryContract, keyFactoryConfig()), SEP)
263251
264252
265253 let stakingContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactoryStakingContract]), "incorrect staking address")
266254
267255 let slippageContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactorySlippageContract]), "incorrect staking address")
268256
269257 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)
270258
271259
272260 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)
273261
274262
275263 func getAccBalance (assetId) = {
276264 let balanceOnPool = if ((assetId == "WAVES"))
277265 then wavesBalance(this).available
278266 else assetBalance(this, fromBase58String(assetId))
279267 let totalBalance = ((balanceOnPool + getAdditionalBalanceOrZero(assetId)) - getStakingAssetBalanceOrZero(assetId))
280268 max([0, totalBalance])
281269 }
282270
283271
284272 func calcPriceBigInt (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18)
285273
286274
287275 func calcPriceBigIntRound (prAmtX18,amAmtX18,round) = fraction(prAmtX18, scale18, amAmtX18, round)
288276
289277
290278 func getRate (proxy) = {
291279 let inv = invoke(proxy, "getRate", nil, nil)
292280 if ((inv == inv))
293281 then match inv {
294282 case r: Int =>
295283 r
296284 case _ =>
297285 throwErr("proxy.getRate() unexpected value")
298286 }
299287 else throw("Strict value is not equal to itself.")
300288 }
301289
302290
303291 func deposit (assetId,amount,stakingAssetId,proxy) = {
304292 let currentAdditionalBalance = getAdditionalBalanceOrZero(assetId)
305293 if ((currentAdditionalBalance == currentAdditionalBalance))
306294 then {
307295 let currentStakingAssetBalance = getStakingAssetBalanceOrZero(stakingAssetId)
308296 if ((currentStakingAssetBalance == currentStakingAssetBalance))
309297 then {
310298 let asset = parseAssetId(assetId)
311299 if ((amount > 0))
312300 then {
313301 let depositInvoke = invoke(proxy, "deposit", nil, [AttachedPayment(asset, amount)])
314302 if ((depositInvoke == depositInvoke))
315303 then match depositInvoke {
316304 case receivedStakingAsset: Int =>
317305 let newAdditionalBalance = (currentAdditionalBalance + amount)
318306 let newStakingAssetBalance = (currentStakingAssetBalance + receivedStakingAsset)
319307 [IntegerEntry(keyAdditionalBalance(assetId), newAdditionalBalance), IntegerEntry(keyStakingAssetBalance(stakingAssetId), newStakingAssetBalance)]
320308 case _ =>
321309 nil
322310 }
323311 else throw("Strict value is not equal to itself.")
324312 }
325313 else nil
326314 }
327315 else throw("Strict value is not equal to itself.")
328316 }
329317 else throw("Strict value is not equal to itself.")
330318 }
331319
332320
333321 func withdraw (assetId,amount,stakingAssetId,proxy,proxyRateMul,profitAddress) = {
334322 let currentAdditionalBalance = getAdditionalBalanceOrZero(assetId)
335323 if ((currentAdditionalBalance == currentAdditionalBalance))
336324 then {
337325 let currentStakingAssetBalance = getStakingAssetBalanceOrZero(stakingAssetId)
338326 if ((currentStakingAssetBalance == currentStakingAssetBalance))
339327 then {
340328 let currentProxyRate = getRate(proxy)
341329 if ((currentProxyRate == currentProxyRate))
342330 then {
343331 let oldRate = fraction(proxyRateMul, currentAdditionalBalance, currentStakingAssetBalance)
344332 let stakingAsset = parseAssetId(stakingAssetId)
345333 let oldSendStakingAmount = fraction(proxyRateMul, amount, oldRate)
346334 let sendStakingAssetAmount = fraction(proxyRateMul, amount, currentProxyRate)
347335 let profitAmount = max([0, (oldSendStakingAmount - sendStakingAssetAmount)])
348336 if ((sendStakingAssetAmount > 0))
349337 then {
350338 let withdrawInvoke = invoke(proxy, "withdraw", nil, [AttachedPayment(stakingAsset, sendStakingAssetAmount)])
351339 if ((withdrawInvoke == withdrawInvoke))
352340 then match withdrawInvoke {
353341 case receivedAssets: Int =>
354342 let newAdditionalBalance = (currentAdditionalBalance - receivedAssets)
355343 let newStakingAssetBalance = ((currentStakingAssetBalance - sendStakingAssetAmount) - profitAmount)
356344 [IntegerEntry(keyAdditionalBalance(assetId), newAdditionalBalance), IntegerEntry(keyStakingAssetBalance(stakingAssetId), newStakingAssetBalance), ScriptTransfer(profitAddress, profitAmount, parseAssetId(stakingAssetId))]
357345 case _ =>
358346 nil
359347 }
360348 else throw("Strict value is not equal to itself.")
361349 }
362350 else nil
363351 }
364352 else throw("Strict value is not equal to itself.")
365353 }
366354 else throw("Strict value is not equal to itself.")
367355 }
368356 else throw("Strict value is not equal to itself.")
369357 }
370358
371359
372360 func getLeaseProxyConfig (assetId) = invoke(factoryContract, "getPoolLeaseConfigREADONLY", [toString(this), assetId], nil)
373361
374362
375363 func rebalanceInternal (targetRatio,assetId,stakingAssetId,minBalance,proxy,proxyRateMul,profitAddress) = {
376364 let currentAdditionalBalance = getAdditionalBalanceOrZero(assetId)
377365 if ((currentAdditionalBalance == currentAdditionalBalance))
378366 then {
379367 let currentStakingAssetBalance = getStakingAssetBalanceOrZero(stakingAssetId)
380368 if ((currentStakingAssetBalance == currentStakingAssetBalance))
381369 then {
382370 let availableBalance = match parseAssetId(assetId) {
383371 case b: ByteVector =>
384372 assetBalance(this, b)
385373 case u: Unit =>
386374 wavesBalance(this).available
387375 case _ =>
388376 throw("Match error")
389377 }
390378 if ((availableBalance == availableBalance))
391379 then {
392380 let wholeBalance = max([0, ((availableBalance + currentAdditionalBalance) - minBalance)])
393381 let targetAdditionalBalance = fraction(targetRatio, wholeBalance, 100)
394382 let diff = (currentAdditionalBalance - targetAdditionalBalance)
395383 if ((diff == 0))
396384 then nil
397385 else if ((0 > diff))
398386 then {
399387 let sendAssetAmount = -(diff)
400388 deposit(assetId, sendAssetAmount, stakingAssetId, proxy)
401389 }
402390 else {
403391 let getAssetAmount = diff
404392 withdraw(assetId, getAssetAmount, stakingAssetId, proxy, proxyRateMul, profitAddress)
405393 }
406394 }
407395 else throw("Strict value is not equal to itself.")
408396 }
409397 else throw("Strict value is not equal to itself.")
410398 }
411399 else throw("Strict value is not equal to itself.")
412400 }
413401
414402
415403 func rebalanceAsset (assetId) = match getLeaseProxyConfig(assetId) {
416404 case a: (Boolean, Int, Int, String, String, Int, String) =>
417- let $t01581415923 = a
418- let isLeasable = $t01581415923._1
419- let leasedRatio = $t01581415923._2
420- let minBalance = $t01581415923._3
421- let proxyAddress = $t01581415923._4
422- let proxyAssetId = $t01581415923._5
423- let proxyRateMul = $t01581415923._6
424- let stakingProfitAddress = $t01581415923._7
405+ let $t01547915588 = a
406+ let isLeasable = $t01547915588._1
407+ let leasedRatio = $t01547915588._2
408+ let minBalance = $t01547915588._3
409+ let proxyAddress = $t01547915588._4
410+ let proxyAssetId = $t01547915588._5
411+ let proxyRateMul = $t01547915588._6
412+ let stakingProfitAddress = $t01547915588._7
425413 if (isLeasable)
426414 then rebalanceInternal(leasedRatio, assetId, proxyAssetId, minBalance, addressFromStringValue(proxyAddress), proxyRateMul, addressFromStringValue(stakingProfitAddress))
427415 else nil
428416 case _ =>
429417 throwErr((("[" + assetId) + "] Rebalance error"))
430418 }
431419
432420
433421 func getWithdrawAssetState (assetId,getAmount) = match getLeaseProxyConfig(assetId) {
434422 case a: (Boolean, Int, Int, String, String, Int, String) =>
435- let $t01651616625 = a
436- let isLeasable = $t01651616625._1
437- let leasedRatio = $t01651616625._2
438- let minBalance = $t01651616625._3
439- let proxyAddress = $t01651616625._4
440- let proxyAssetId = $t01651616625._5
441- let proxyRateMul = $t01651616625._6
442- let stakingProfitAddress = $t01651616625._7
423+ let $t01618116290 = a
424+ let isLeasable = $t01618116290._1
425+ let leasedRatio = $t01618116290._2
426+ let minBalance = $t01618116290._3
427+ let proxyAddress = $t01618116290._4
428+ let proxyAssetId = $t01618116290._5
429+ let proxyRateMul = $t01618116290._6
430+ let stakingProfitAddress = $t01618116290._7
443431 if (isLeasable)
444432 then {
445433 let newTotalCalcBalance = max([0, ((getAccBalance(assetId) - getAmount) - minBalance)])
446434 if ((newTotalCalcBalance == newTotalCalcBalance))
447435 then {
448436 let newAdditionalBalance = fraction(leasedRatio, newTotalCalcBalance, 100)
449437 if ((newAdditionalBalance == newAdditionalBalance))
450438 then {
451439 let withdrawAmount = max([0, (getAdditionalBalanceOrZero(assetId) - newAdditionalBalance)])
452440 if ((withdrawAmount == withdrawAmount))
453441 then withdraw(assetId, withdrawAmount, proxyAssetId, addressFromStringValue(proxyAddress), proxyRateMul, addressFromStringValue(stakingProfitAddress))
454442 else throw("Strict value is not equal to itself.")
455443 }
456444 else throw("Strict value is not equal to itself.")
457445 }
458446 else throw("Strict value is not equal to itself.")
459447 }
460448 else nil
461449 case _ =>
462450 throwErr((("[" + assetId) + "] getWithdrawAssetState() error"))
463451 }
464452
465453
466454 func privateCalcPrice (amAssetDcm,prAssetDcm,amAmt,prAmt) = {
467455 let amtAssetAmtX18 = toX18(amAmt, amAssetDcm)
468456 let priceAssetAmtX18 = toX18(prAmt, prAssetDcm)
469457 calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
470458 }
471459
472460
473461 func calcPrices (amAmt,prAmt,lpAmt) = {
474462 let cfg = getPoolConfig()
475463 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
476464 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
477465 let priceX18 = privateCalcPrice(amtAssetDcm, priceAssetDcm, amAmt, prAmt)
478466 let amAmtX18 = toX18(amAmt, amtAssetDcm)
479467 let prAmtX18 = toX18(prAmt, priceAssetDcm)
480468 let lpAmtX18 = toX18(lpAmt, scale8)
481469 let lpPriceInAmAssetX18 = calcPriceBigInt(amAmtX18, lpAmtX18)
482470 let lpPriceInPrAssetX18 = calcPriceBigInt(prAmtX18, lpAmtX18)
483471 [priceX18, lpPriceInAmAssetX18, lpPriceInPrAssetX18]
484472 }
485473
486474
487475 func calculatePrices (amAmt,prAmt,lpAmt) = {
488476 let prices = calcPrices(amAmt, prAmt, lpAmt)
489477 [fromX18(prices[0], scale8), fromX18(prices[1], scale8), fromX18(prices[2], scale8)]
490478 }
491479
492480
493481 func estimateGetOperation (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
494482 let cfg = getPoolConfig()
495483 let lpAssetId = cfg[idxPoolLPAssetId]
496484 let amAssetId = cfg[idxAmtAssetId]
497485 let prAssetId = cfg[idxPriceAssetId]
498486 let amAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
499487 let prAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
500488 let poolStatus = cfg[idxPoolStatus]
501489 let lpEmission = valueOrErrorMessage(assetInfo(fromBase58String(lpAssetId)), (("Asset " + lpAssetId) + " doesn't exist")).quantity
502490 if ((lpAssetId != pmtAssetId))
503491 then throw("Invalid asset passed.")
504492 else {
505493 let amBalance = getAccBalance(amAssetId)
506494 let amBalanceX18 = toX18(amBalance, amAssetDcm)
507495 let prBalance = getAccBalance(prAssetId)
508496 let prBalanceX18 = toX18(prBalance, prAssetDcm)
509497 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
510498 let curPrice = fromX18(curPriceX18, scale8)
511499 let pmtLpAmtX18 = toX18(pmtLpAmt, scale8)
512500 let lpEmissionX18 = toX18(lpEmission, scale8)
513501 let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissionX18)
514502 let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissionX18)
515503 let outAmAmt = fromX18Round(outAmAmtX18, amAssetDcm, FLOOR)
516504 let outPrAmt = fromX18Round(outPrAmtX18, prAssetDcm, FLOOR)
517505 let AmAmtWithdrawState = getWithdrawAssetState(amAssetId, outAmAmt)
518506 if ((AmAmtWithdrawState == AmAmtWithdrawState))
519507 then {
520508 let PrAmtWithdrawState = getWithdrawAssetState(prAssetId, outPrAmt)
521509 if ((PrAmtWithdrawState == PrAmtWithdrawState))
522510 then {
523511 let state = if ((txId58 == ""))
524512 then nil
525513 else ((AmAmtWithdrawState ++ PrAmtWithdrawState) ++ [ScriptTransfer(userAddress, outAmAmt, if ((amAssetId == "WAVES"))
526514 then unit
527515 else fromBase58String(amAssetId)), ScriptTransfer(userAddress, outPrAmt, if ((prAssetId == "WAVES"))
528516 then unit
529517 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)])
530518 $Tuple10(outAmAmt, outPrAmt, amAssetId, prAssetId, amBalance, prBalance, lpEmission, curPriceX18, poolStatus, state)
531519 }
532520 else throw("Strict value is not equal to itself.")
533521 }
534522 else throw("Strict value is not equal to itself.")
535523 }
536524 }
537525
538526
539527 func estimatePutOperation (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = {
540528 let cfg = getPoolConfig()
541529 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
542530 let amAssetIdStr = cfg[idxAmtAssetId]
543531 let prAssetIdStr = cfg[idxPriceAssetId]
544532 let iAmtAssetId = cfg[idxIAmtAssetId]
545533 let iPriceAssetId = cfg[idxIPriceAssetId]
546534 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
547535 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
548536 let poolStatus = cfg[idxPoolStatus]
549537 let lpEmission = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
550538 let inAmAssetIdStr = toBase58String(valueOrElse(inAmAssetId, fromBase58String("WAVES")))
551539 let inPrAssetIdStr = toBase58String(valueOrElse(inPrAssetId, fromBase58String("WAVES")))
552540 if (if ((amAssetIdStr != inAmAssetIdStr))
553541 then true
554542 else (prAssetIdStr != inPrAssetIdStr))
555543 then throw("Invalid amt or price asset passed.")
556544 else {
557545 let amBalance = if (isEvaluate)
558546 then getAccBalance(amAssetIdStr)
559547 else (getAccBalance(amAssetIdStr) - inAmAssetAmt)
560548 let prBalance = if (isEvaluate)
561549 then getAccBalance(prAssetIdStr)
562550 else (getAccBalance(prAssetIdStr) - inPrAssetAmt)
563551 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
564552 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
565553 let userPriceX18 = calcPriceBigInt(inPrAssetAmtX18, inAmAssetAmtX18)
566554 let amBalanceX18 = toX18(amBalance, amtAssetDcm)
567555 let prBalanceX18 = toX18(prBalance, priceAssetDcm)
568556 let res = if ((lpEmission == 0))
569557 then {
570558 let curPriceX18 = zeroBigInt
571559 let slippageX18 = zeroBigInt
572560 let lpAmtX18 = pow((inAmAssetAmtX18 * inPrAssetAmtX18), 0, toBigInt(5), 1, 0, DOWN)
573561 $Tuple5(fromX18(lpAmtX18, scale8), fromX18(inAmAssetAmtX18, amtAssetDcm), fromX18(inPrAssetAmtX18, priceAssetDcm), calcPriceBigInt((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18)
574562 }
575563 else {
576564 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
577565 let slippageX18 = fraction(absBigInt((curPriceX18 - userPriceX18)), scale18, curPriceX18)
578566 let slippageToleranceX18 = toX18(slippageTolerance, scale8)
579567 if (if ((curPriceX18 != zeroBigInt))
580568 then (slippageX18 > slippageToleranceX18)
581569 else false)
582570 then throw(((("Price slippage " + toString(slippageX18)) + " exceeded the passed limit of ") + toString(slippageToleranceX18)))
583571 else {
584572 let lpEmissionX18 = toX18(lpEmission, scale8)
585573 let prViaAmX18 = fraction(inAmAssetAmtX18, calcPriceBigIntRound(prBalanceX18, amBalanceX18, CEILING), scale18, CEILING)
586574 let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, calcPriceBigIntRound(prBalanceX18, amBalanceX18, FLOOR), CEILING)
587575 let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18))
588576 then $Tuple2(amViaPrX18, inPrAssetAmtX18)
589577 else $Tuple2(inAmAssetAmtX18, prViaAmX18)
590578 let expAmtAssetAmtX18 = expectedAmts._1
591579 let expPriceAssetAmtX18 = expectedAmts._2
592580 let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18, FLOOR)
593581 $Tuple5(fromX18Round(lpAmtX18, scale8, FLOOR), fromX18Round(expAmtAssetAmtX18, amtAssetDcm, CEILING), fromX18Round(expPriceAssetAmtX18, priceAssetDcm, CEILING), curPriceX18, slippageX18)
594582 }
595583 }
596584 let calcLpAmt = res._1
597585 let calcAmAssetPmt = res._2
598586 let calcPrAssetPmt = res._3
599587 let curPrice = fromX18(res._4, scale8)
600588 let slippageCalc = fromX18(res._5, scale8)
601589 if ((0 >= calcLpAmt))
602590 then throw("Invalid calculations. LP calculated is less than zero.")
603591 else {
604592 let emitLpAmt = if (!(emitLp))
605593 then 0
606594 else calcLpAmt
607595 let amDiff = (inAmAssetAmt - calcAmAssetPmt)
608596 let prDiff = (inPrAssetAmt - calcPrAssetPmt)
609597 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))]
610598 $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEmission, lpAssetId, poolStatus, commonState, amDiff, prDiff, inAmAssetId, inPrAssetId)
611599 }
612600 }
613601 }
614602
615603
616604 func calcKLp (amountBalance,priceBalance,lpEmission) = {
617605 let amountBalanceX18 = toX18BigInt(amountBalance, toBigInt(cfgAmountAssetDecimals))
618606 let priceBalanceX18 = toX18BigInt(priceBalance, toBigInt(cfgPriceAssetDecimals))
619607 let updatedKLp = fraction(pow((amountBalanceX18 * priceBalanceX18), 0, toBigInt(5), 1, 18, DOWN), big1, lpEmission)
620608 if ((lpEmission == big0))
621609 then big0
622610 else updatedKLp
623611 }
624612
625613
626614 func calcCurrentKLp (amountAssetDelta,priceAssetDelta,lpAssetEmissionDelta) = {
627615 let amountAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) - amountAssetDelta)
628616 let priceAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) - priceAssetDelta)
629617 let lpAssetEmission = (toBigInt(value(assetInfo(cfgLpAssetId)).quantity) - lpAssetEmissionDelta)
630618 let currentKLp = calcKLp(amountAssetBalance, priceAssetBalance, lpAssetEmission)
631619 currentKLp
632620 }
633621
634622
635623 func refreshKLpInternal (amountAssetBalanceDelta,priceAssetBalanceDelta,lpAssetEmissionDelta) = {
636624 let amountAssetBalance = (getAccBalance(assetIdToString(cfgAmountAssetId)) + amountAssetBalanceDelta)
637625 let priceAssetBalance = (getAccBalance(assetIdToString(cfgPriceAssetId)) + priceAssetBalanceDelta)
638626 let lpAssetEmission = (value(assetInfo(cfgLpAssetId)).quantity + lpAssetEmissionDelta)
639627 let updatedKLp = calcKLp(toBigInt(amountAssetBalance), toBigInt(priceAssetBalance), toBigInt(lpAssetEmission))
640628 let actions = [IntegerEntry(keyKLpRefreshedHeight, height), StringEntry(keyKLp, toString(updatedKLp))]
641629 $Tuple2(actions, updatedKLp)
642630 }
643631
644632
645633 func validateUpdatedKLp (oldKLp,updatedKLp) = if ((updatedKLp >= oldKLp))
646634 then true
647635 else throwErr(makeString(["updated KLp lower than current KLp", toString(oldKLp), toString(updatedKLp)], " "))
648636
649637
650638 func validateMatcherOrderAllowed (order) = {
651639 let amountAssetBalance = getAccBalance(assetIdToString(cfgAmountAssetId))
652640 let priceAssetBalance = getAccBalance(assetIdToString(cfgPriceAssetId))
653641 let amountAssetAmount = order.amount
654642 let priceAssetAmount = fraction(order.amount, order.price, scale8, FLOOR)
655- let $t02870728919 = if ((order.orderType == Buy))
643+ let $t02837228584 = if ((order.orderType == Buy))
656644 then $Tuple2(amountAssetAmount, -(priceAssetAmount))
657645 else $Tuple2(-(amountAssetAmount), priceAssetAmount)
658- let amountAssetBalanceDelta = $t02870728919._1
659- let priceAssetBalanceDelta = $t02870728919._2
646+ let amountAssetBalanceDelta = $t02837228584._1
647+ let priceAssetBalanceDelta = $t02837228584._2
660648 if (if (if (isGlobalShutdown())
661649 then true
662650 else (cfgPoolStatus == PoolMatcherDisabled))
663651 then true
664652 else (cfgPoolStatus == PoolShutdown))
665653 then throw("Exchange operations disabled")
666654 else if (if ((order.assetPair.amountAsset != cfgAmountAssetId))
667655 then true
668656 else (order.assetPair.priceAsset != cfgPriceAssetId))
669657 then throw("Wrong order assets.")
670658 else {
671659 let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
672- let $t02935929459 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
673- let unusedActions = $t02935929459._1
674- let kLpNew = $t02935929459._2
660+ let $t02902429124 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
661+ let unusedActions = $t02902429124._1
662+ let kLpNew = $t02902429124._2
675663 let isOrderValid = (kLpNew >= kLp)
676664 let info = makeString(["kLp=", toString(kLp), " kLpNew=", toString(kLpNew), " amountAssetBalance=", toString(amountAssetBalance), " priceAssetBalance=", toString(priceAssetBalance), " amountAssetBalanceDelta=", toString(amountAssetBalanceDelta), " priceAssetBalanceDelta=", toString(priceAssetBalanceDelta), " height=", toString(height)], "")
677665 $Tuple2(isOrderValid, info)
678666 }
679667 }
680668
681669
682670 func commonGet (i) = if ((size(i.payments) != 1))
683671 then throw("exactly 1 payment is expected")
684672 else {
685673 let pmt = value(i.payments[0])
686674 let pmtAssetId = value(pmt.assetId)
687675 let pmtAmt = pmt.amount
688676 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller)
689677 let outAmAmt = res._1
690678 let outPrAmt = res._2
691679 let poolStatus = parseIntValue(res._9)
692680 let state = res._10
693681 if (if (isGlobalShutdown())
694682 then true
695683 else (poolStatus == PoolShutdown))
696684 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
697685 else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state)
698686 }
699687
700688
701689 func commonPut (i,slippageTolerance,emitLp) = if ((size(i.payments) != 2))
702690 then throw("exactly 2 payments are expected")
703691 else {
704692 let amAssetPmt = value(i.payments[0])
705693 let prAssetPmt = value(i.payments[1])
706694 let estPut = estimatePutOperation(toBase58String(i.transactionId), slippageTolerance, amAssetPmt.amount, amAssetPmt.assetId, prAssetPmt.amount, prAssetPmt.assetId, toString(i.caller), false, emitLp)
707695 let poolStatus = parseIntValue(estPut._8)
708696 if (if (if (isGlobalShutdown())
709697 then true
710698 else (poolStatus == PoolPutDisabled))
711699 then true
712700 else (poolStatus == PoolShutdown))
713701 then throw(("Put operation is blocked by admin. Status = " + toString(poolStatus)))
714702 else estPut
715703 }
716704
717705
718706 func emit (amount) = {
719707 let emitInv = invoke(factoryContract, "emit", [amount], nil)
720708 if ((emitInv == emitInv))
721709 then {
722710 let emitInvLegacy = match emitInv {
723711 case legacyFactoryContract: Address =>
724712 invoke(legacyFactoryContract, "emit", [amount], nil)
725713 case _ =>
726714 unit
727715 }
728716 if ((emitInvLegacy == emitInvLegacy))
729717 then amount
730718 else throw("Strict value is not equal to itself.")
731719 }
732720 else throw("Strict value is not equal to itself.")
733721 }
734722
735723
736724 func takeFee (amount,fee) = {
737725 let feeAmount = if ((fee == 0))
738726 then 0
739727 else fraction(amount, fee, scale8)
740728 $Tuple2((amount - feeAmount), feeAmount)
741729 }
742730
743731
744732 func calcPutOneToken (paymentAmountRaw,paymentAssetId,userAddress,txId) = {
745733 let isEval = (txId == unit)
746734 let amountBalanceRaw = getAccBalance(assetIdToString(cfgAmountAssetId))
747735 let priceBalanceRaw = getAccBalance(assetIdToString(cfgPriceAssetId))
748736 let paymentInAmountAsset = if ((paymentAssetId == cfgAmountAssetId))
749737 then true
750738 else if ((paymentAssetId == cfgPriceAssetId))
751739 then false
752740 else throwErr("invalid asset")
753- let $t03257232865 = if (isEval)
741+ let $t03223732530 = if (isEval)
754742 then $Tuple2(amountBalanceRaw, priceBalanceRaw)
755743 else if (paymentInAmountAsset)
756744 then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw)
757745 else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw))
758- let amountBalanceOld = $t03257232865._1
759- let priceBalanceOld = $t03257232865._2
760- let $t03286933018 = if (paymentInAmountAsset)
746+ let amountBalanceOld = $t03223732530._1
747+ let priceBalanceOld = $t03223732530._2
748+ let $t03253432683 = if (paymentInAmountAsset)
761749 then $Tuple2(paymentAmountRaw, 0)
762750 else $Tuple2(0, paymentAmountRaw)
763- let amountAssetAmountRaw = $t03286933018._1
764- let priceAssetAmountRaw = $t03286933018._2
751+ let amountAssetAmountRaw = $t03253432683._1
752+ let priceAssetAmountRaw = $t03253432683._2
765753 let amountAssetAmount = takeFee(amountAssetAmountRaw, inFee)._1
766754 let priceAssetAmount = takeFee(priceAssetAmountRaw, inFee)._1
767- let $t03315033214 = takeFee(paymentAmountRaw, inFee)
768- let paymentAmount = $t03315033214._1
769- let feeAmount = $t03315033214._2
755+ let $t03281532879 = takeFee(paymentAmountRaw, inFee)
756+ let paymentAmount = $t03281532879._1
757+ let feeAmount = $t03281532879._2
770758 let amountBalanceNew = (amountBalanceOld + amountAssetAmount)
771759 let priceBalanceNew = (priceBalanceOld + priceAssetAmount)
772760 let priceNewX18 = calcPriceBigInt(toX18(priceBalanceNew, cfgPriceAssetDecimals), toX18(amountBalanceNew, cfgAmountAssetDecimals))
773761 let priceNew = fromX18(priceNewX18, scale8)
774762 let paymentBalance = if (paymentInAmountAsset)
775763 then amountBalanceOld
776764 else priceBalanceOld
777765 let paymentBalanceBigInt = toBigInt(paymentBalance)
778766 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
779767 let chechSupply = if ((supplyBigInt > big0))
780768 then true
781769 else throwErr("initial deposit requires all coins")
782770 if ((chechSupply == chechSupply))
783771 then {
784772 let depositBigInt = toBigInt(paymentAmount)
785773 let issueAmount = max([0, toInt(((supplyBigInt * (sqrtBigInt((scale18 + ((depositBigInt * scale18) / paymentBalanceBigInt)), 18, 18, DOWN) - scale18)) / scale18))])
786774 let commonState = if (isEval)
787775 then nil
788776 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))]
789777 let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, cfgPriceAssetDecimals), toX18(amountBalanceOld, cfgAmountAssetDecimals))
790778 let priceOld = fromX18(priceOldX18, scale8)
791779 let loss = {
792- let $t03489535062 = if (paymentInAmountAsset)
780+ let $t03456034727 = if (paymentInAmountAsset)
793781 then $Tuple2(amountAssetAmountRaw, amountBalanceOld)
794782 else $Tuple2(priceAssetAmountRaw, priceBalanceOld)
795- let amount = $t03489535062._1
796- let balance = $t03489535062._2
783+ let amount = $t03456034727._1
784+ let balance = $t03456034727._2
797785 let issueAmountBoth = toInt(fraction(supplyBigInt, toBigInt((amount / 2)), toBigInt(balance)))
798786 fraction((issueAmount - issueAmountBoth), scale8, issueAmountBoth)
799787 }
800788 $Tuple5(issueAmount, commonState, feeAmount, loss, paymentInAmountAsset)
801789 }
802790 else throw("Strict value is not equal to itself.")
803791 }
804792
805793
806794 func calcGetOneToken (outAssetId,paymentAmount,paymentAssetId,userAddress,txId) = {
807795 let isEval = (txId == unit)
808796 let cfg = getPoolConfig()
809797 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
810798 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
811799 let checks = [if ((paymentAssetId == cfgLpAssetId))
812800 then true
813801 else throwErr("invalid lp asset")]
814802 if ((checks == checks))
815803 then {
816804 let outInAmountAsset = if ((outAssetId == cfgAmountAssetId))
817805 then true
818806 else if ((outAssetId == cfgPriceAssetId))
819807 then false
820808 else throwErr("invalid asset")
821809 let balanceBigInt = if (outInAmountAsset)
822810 then toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId)))
823811 else toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId)))
824812 let outInAmountAssetDecimals = if (outInAmountAsset)
825813 then amtAssetDcm
826814 else priceAssetDcm
827815 let amBalanceOld = getAccBalance(assetIdToString(cfgAmountAssetId))
828816 let prBalanceOld = getAccBalance(assetIdToString(cfgPriceAssetId))
829817 let outBalance = if (outInAmountAsset)
830818 then amBalanceOld
831819 else prBalanceOld
832820 let outBalanceBigInt = toBigInt(outBalance)
833821 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
834822 let redeemedBigInt = toBigInt(paymentAmount)
835823 let amountRaw = max([0, toInt(((balanceBigInt * (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN))) / scale18))])
836- let $t03714037196 = takeFee(amountRaw, outFee)
837- let totalAmount = $t03714037196._1
838- let feeAmount = $t03714037196._2
839- let $t03720037426 = if (outInAmountAsset)
824+ let $t03680536861 = takeFee(amountRaw, outFee)
825+ let totalAmount = $t03680536861._1
826+ let feeAmount = $t03680536861._2
827+ let $t03686537091 = if (outInAmountAsset)
840828 then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld)
841829 else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw))
842- let outAmAmount = $t03720037426._1
843- let outPrAmount = $t03720037426._2
844- let amBalanceNew = $t03720037426._3
845- let prBalanceNew = $t03720037426._4
830+ let outAmAmount = $t03686537091._1
831+ let outPrAmount = $t03686537091._2
832+ let amBalanceNew = $t03686537091._3
833+ let prBalanceNew = $t03686537091._4
846834 let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, cfgPriceAssetDecimals), toX18(amBalanceNew, cfgAmountAssetDecimals))
847835 let priceNew = fromX18(priceNewX18, scale8)
848836 let commonState = if (isEval)
849837 then nil
850838 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)]
851839 let priceOldX18 = calcPriceBigInt(toX18(prBalanceOld, cfgPriceAssetDecimals), toX18(amBalanceOld, cfgAmountAssetDecimals))
852840 let priceOld = fromX18(priceOldX18, scale8)
853841 let loss = {
854842 let amountBothInPaymentAsset = (toInt(fraction(balanceBigInt, redeemedBigInt, supplyBigInt)) * 2)
855843 fraction((totalAmount - amountBothInPaymentAsset), scale8, amountBothInPaymentAsset)
856844 }
857845 $Tuple5(totalAmount, commonState, feeAmount, loss, outInAmountAsset)
858846 }
859847 else throw("Strict value is not equal to itself.")
860848 }
861849
862850
863851 func managerPublicKeyOrUnit () = match getString(mpk()) {
864852 case s: String =>
865853 fromBase58String(s)
866854 case _: Unit =>
867855 unit
868856 case _ =>
869857 throw("Match error")
870858 }
871859
872860
873861 func pendingManagerPublicKeyOrUnit () = match getString(pmpk()) {
874862 case s: String =>
875863 fromBase58String(s)
876864 case _: Unit =>
877865 unit
878866 case _ =>
879867 throw("Match error")
880868 }
881869
882870
883871 func isManager (i) = match managerPublicKeyOrUnit() {
884872 case pk: ByteVector =>
885873 (i.callerPublicKey == pk)
886874 case _: Unit =>
887875 (i.caller == this)
888876 case _ =>
889877 throw("Match error")
890878 }
891879
892880
893881 func mustManager (i) = {
894882 let pd = throw("Permission denied")
895883 match managerPublicKeyOrUnit() {
896884 case pk: ByteVector =>
897885 if ((i.callerPublicKey == pk))
898886 then true
899887 else pd
900888 case _: Unit =>
901889 if ((i.caller == this))
902890 then true
903891 else pd
904892 case _ =>
905893 throw("Match error")
906894 }
907895 }
908896
909897
910898 @Callable(i)
911899 func rebalance () = (rebalanceAsset(getStringOrFail(this, aa())) ++ rebalanceAsset(getStringOrFail(this, pa())))
912900
913901
914902
915903 @Callable(i)
916904 func calculateAmountOutForSwapREADONLY (cleanAmountIn,isReverse,feePoolAmount) = {
917- let $t03931239617 = if ((isReverse == false))
905+ let $t03897739282 = if ((isReverse == false))
918906 then {
919907 let assetOut = getStringOrFail(this, pa())
920908 let assetIn = getStringOrFail(this, aa())
921909 $Tuple2(assetOut, assetIn)
922910 }
923911 else {
924912 let assetOut = getStringOrFail(this, aa())
925913 let assetIn = getStringOrFail(this, pa())
926914 $Tuple2(assetOut, assetIn)
927915 }
928- let assetOut = $t03931239617._1
929- let assetIn = $t03931239617._2
916+ let assetOut = $t03897739282._1
917+ let assetIn = $t03897739282._2
930918 let poolAssetInBalance = getAccBalance(assetIn)
931919 let poolAssetOutBalance = getAccBalance(assetOut)
932920 let amountOut = fraction(poolAssetOutBalance, cleanAmountIn, (poolAssetInBalance + cleanAmountIn))
933921 let oldK = (toBigInt(poolAssetInBalance) * toBigInt(poolAssetOutBalance))
934922 let newK = (((toBigInt(getAccBalance(assetIn)) + toBigInt(cleanAmountIn)) + toBigInt(feePoolAmount)) * (toBigInt(getAccBalance(assetOut)) - toBigInt(amountOut)))
935923 let checkK = if ((newK >= oldK))
936924 then true
937925 else throw("new K is fewer error")
938926 if ((checkK == checkK))
939927 then $Tuple2(nil, amountOut)
940928 else throw("Strict value is not equal to itself.")
941929 }
942930
943931
944932
945933 @Callable(i)
946934 func calculateAmountOutForSwapAndSendTokens (cleanAmountIn,isReverse,amountOutMin,addressTo,feePoolAmount) = {
947935 let swapContact = {
948936 let @ = invoke(factoryContract, "getSwapContractREADONLY", nil, nil)
949937 if ($isInstanceOf(@, "String"))
950938 then @
951939 else throw(($getType(@) + " couldn't be cast to String"))
952940 }
953941 let checks = [if ((value(i.payments[0]).amount >= cleanAmountIn))
954942 then true
955943 else throwErr("Wrong amount"), if ((i.caller == addressFromStringValue(swapContact)))
956944 then true
957945 else throwErr("Permission denied")]
958946 if ((checks == checks))
959947 then {
960948 let pmt = value(i.payments[0])
961949 let assetIn = assetIdToString(pmt.assetId)
962950 let assetOut = if ((isReverse == false))
963951 then getStringOrFail(this, pa())
964952 else getStringOrFail(this, aa())
965953 let poolAssetInBalance = (getAccBalance(assetIn) - value(i.payments[0]).amount)
966954 let poolAssetOutBalance = getAccBalance(assetOut)
967955 let amountOut = fraction(poolAssetOutBalance, cleanAmountIn, (poolAssetInBalance + cleanAmountIn))
968956 let oldK = (toBigInt(poolAssetInBalance) * toBigInt(poolAssetOutBalance))
969957 let newK = ((toBigInt(getAccBalance(assetIn)) + toBigInt(feePoolAmount)) * (toBigInt(getAccBalance(assetOut)) - toBigInt(amountOut)))
970958 let checkK = if ((newK >= oldK))
971959 then true
972960 else throw("new K is fewer error")
973961 if ((checkK == checkK))
974962 then {
975963 let checkMin = if ((amountOut >= amountOutMin))
976964 then true
977965 else throw("Exchange result is fewer coins than expected")
978966 if ((checkMin == checkMin))
979967 then {
980968 let withdrawState = getWithdrawAssetState(assetOut, amountOut)
981969 if ((withdrawState == withdrawState))
982970 then $Tuple2((withdrawState ++ [ScriptTransfer(addressFromStringValue(addressTo), amountOut, parseAssetId(assetOut))]), amountOut)
983971 else throw("Strict value is not equal to itself.")
984972 }
985973 else throw("Strict value is not equal to itself.")
986974 }
987975 else throw("Strict value is not equal to itself.")
988976 }
989977 else throw("Strict value is not equal to itself.")
990978 }
991979
992980
993981
994982 @Callable(i)
995983 func setManager (pendingManagerPublicKey) = {
996984 let checkCaller = mustManager(i)
997985 if ((checkCaller == checkCaller))
998986 then {
999987 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
1000988 if ((checkManagerPublicKey == checkManagerPublicKey))
1001989 then [StringEntry(pmpk(), pendingManagerPublicKey)]
1002990 else throw("Strict value is not equal to itself.")
1003991 }
1004992 else throw("Strict value is not equal to itself.")
1005993 }
1006994
1007995
1008996
1009997 @Callable(i)
1010998 func confirmManager () = {
1011999 let pm = pendingManagerPublicKeyOrUnit()
10121000 let hasPM = if (isDefined(pm))
10131001 then true
10141002 else throw("No pending manager")
10151003 if ((hasPM == hasPM))
10161004 then {
10171005 let checkPM = if ((i.callerPublicKey == value(pm)))
10181006 then true
10191007 else throw("You are not pending manager")
10201008 if ((checkPM == checkPM))
10211009 then [StringEntry(mpk(), toBase58String(value(pm))), DeleteEntry(pmpk())]
10221010 else throw("Strict value is not equal to itself.")
10231011 }
10241012 else throw("Strict value is not equal to itself.")
10251013 }
10261014
10271015
10281016
10291017 @Callable(i)
10301018 func put (slippageTolerance,shouldAutoStake) = if ((0 > slippageTolerance))
10311019 then throw("Invalid slippageTolerance passed")
10321020 else {
10331021 let estPut = commonPut(i, slippageTolerance, true)
10341022 let emitLpAmt = estPut._2
10351023 let lpAssetId = estPut._7
10361024 let state = estPut._9
10371025 let amDiff = estPut._10
10381026 let prDiff = estPut._11
10391027 let amId = estPut._12
10401028 let prId = estPut._13
10411029 let amAssetPmt = toBigInt(value(i.payments[0]).amount)
10421030 let prAssetPmt = toBigInt(value(i.payments[1]).amount)
10431031 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
10441032 if ((currentKLp == currentKLp))
10451033 then {
10461034 let emitInv = invoke(factoryContract, "emit", [emitLpAmt], nil)
10471035 if ((emitInv == emitInv))
10481036 then {
10491037 let emitInvLegacy = match emitInv {
10501038 case legacyFactoryContract: Address =>
10511039 invoke(legacyFactoryContract, "emit", [emitLpAmt], nil)
10521040 case _ =>
10531041 unit
10541042 }
10551043 if ((emitInvLegacy == emitInvLegacy))
10561044 then {
10571045 let slippageAInv = if ((amDiff > 0))
10581046 then invoke(slippageContract, "put", nil, [AttachedPayment(amId, amDiff)])
10591047 else nil
10601048 if ((slippageAInv == slippageAInv))
10611049 then {
10621050 let slippagePInv = if ((prDiff > 0))
10631051 then invoke(slippageContract, "put", nil, [AttachedPayment(prId, prDiff)])
10641052 else nil
10651053 if ((slippagePInv == slippagePInv))
10661054 then {
10671055 let lpTransfer = if (shouldAutoStake)
10681056 then {
10691057 let slpStakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)])
10701058 if ((slpStakeInv == slpStakeInv))
10711059 then nil
10721060 else throw("Strict value is not equal to itself.")
10731061 }
10741062 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
1075- let $t04459045052 = refreshKLpInternal(0, 0, 0)
1076- if (($t04459045052 == $t04459045052))
1063+ let $t04425544717 = refreshKLpInternal(0, 0, 0)
1064+ if (($t04425544717 == $t04425544717))
10771065 then {
1078- let updatedKLp = $t04459045052._2
1079- let refreshKLpActions = $t04459045052._1
1066+ let updatedKLp = $t04425544717._2
1067+ let refreshKLpActions = $t04425544717._1
10801068 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10811069 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10821070 then {
10831071 let reb = invoke(this, "rebalance", nil, nil)
10841072 if ((reb == reb))
10851073 then ((state ++ lpTransfer) ++ refreshKLpActions)
10861074 else throw("Strict value is not equal to itself.")
10871075 }
10881076 else throw("Strict value is not equal to itself.")
10891077 }
10901078 else throw("Strict value is not equal to itself.")
10911079 }
10921080 else throw("Strict value is not equal to itself.")
10931081 }
10941082 else throw("Strict value is not equal to itself.")
10951083 }
10961084 else throw("Strict value is not equal to itself.")
10971085 }
10981086 else throw("Strict value is not equal to itself.")
10991087 }
11001088 else throw("Strict value is not equal to itself.")
11011089 }
11021090
11031091
11041092
11051093 @Callable(i)
11061094 func putForFree (maxSlippage) = if ((0 > maxSlippage))
11071095 then throw("Invalid value passed")
11081096 else {
11091097 let estPut = commonPut(i, maxSlippage, false)
11101098 let state = estPut._9
11111099 let amAssetPmt = toBigInt(value(i.payments[0]).amount)
11121100 let prAssetPmt = toBigInt(value(i.payments[1]).amount)
11131101 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
11141102 if ((currentKLp == currentKLp))
11151103 then {
1116- let $t04566445729 = refreshKLpInternal(0, 0, 0)
1117- let refreshKLpActions = $t04566445729._1
1118- let updatedKLp = $t04566445729._2
1104+ let $t04532945394 = refreshKLpInternal(0, 0, 0)
1105+ let refreshKLpActions = $t04532945394._1
1106+ let updatedKLp = $t04532945394._2
11191107 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11201108 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11211109 then (state ++ refreshKLpActions)
11221110 else throw("Strict value is not equal to itself.")
11231111 }
11241112 else throw("Strict value is not equal to itself.")
11251113 }
11261114
11271115
11281116
11291117 @Callable(i)
11301118 func putOneTkn (minOutAmount,autoStake) = {
11311119 let isPoolOneTokenOperationsDisabled = {
11321120 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
11331121 if ($isInstanceOf(@, "Boolean"))
11341122 then @
11351123 else throw(($getType(@) + " couldn't be cast to Boolean"))
11361124 }
11371125 let isPutDisabled = if (if (if (isGlobalShutdown())
11381126 then true
11391127 else (cfgPoolStatus == PoolPutDisabled))
11401128 then true
11411129 else (cfgPoolStatus == PoolShutdown))
11421130 then true
11431131 else isPoolOneTokenOperationsDisabled
11441132 let checks = [if (if (!(isPutDisabled))
11451133 then true
11461134 else isManager(i))
11471135 then true
11481136 else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1))
11491137 then true
11501138 else throwErr("exactly 1 payment are expected")]
11511139 if ((checks == checks))
11521140 then {
11531141 let payment = i.payments[0]
11541142 let paymentAssetId = payment.assetId
11551143 let paymentAmountRaw = payment.amount
11561144 let currentKLp = if ((paymentAssetId == cfgAmountAssetId))
11571145 then calcCurrentKLp(toBigInt(paymentAmountRaw), toBigInt(0), toBigInt(0))
11581146 else if ((paymentAssetId == cfgPriceAssetId))
11591147 then calcCurrentKLp(toBigInt(0), toBigInt(paymentAmountRaw), toBigInt(0))
11601148 else throwErr("payment asset is not supported")
11611149 if ((currentKLp == currentKLp))
11621150 then {
11631151 let userAddress = i.caller
11641152 let txId = i.transactionId
1165- let $t04691747069 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
1166- if (($t04691747069 == $t04691747069))
1153+ let $t04658246734 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
1154+ if (($t04658246734 == $t04658246734))
11671155 then {
1168- let paymentInAmountAsset = $t04691747069._5
1169- let bonus = $t04691747069._4
1170- let feeAmount = $t04691747069._3
1171- let commonState = $t04691747069._2
1172- let emitAmountEstimated = $t04691747069._1
1156+ let paymentInAmountAsset = $t04658246734._5
1157+ let bonus = $t04658246734._4
1158+ let feeAmount = $t04658246734._3
1159+ let commonState = $t04658246734._2
1160+ let emitAmountEstimated = $t04658246734._1
11731161 let emitAmount = if (if ((minOutAmount > 0))
11741162 then (minOutAmount > emitAmountEstimated)
11751163 else false)
11761164 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
11771165 else emitAmountEstimated
11781166 let emitInv = emit(emitAmount)
11791167 if ((emitInv == emitInv))
11801168 then {
11811169 let lpTransfer = if (autoStake)
11821170 then {
11831171 let stakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(cfgLpAssetId, emitAmount)])
11841172 if ((stakeInv == stakeInv))
11851173 then nil
11861174 else throw("Strict value is not equal to itself.")
11871175 }
11881176 else [ScriptTransfer(i.caller, emitAmount, cfgLpAssetId)]
11891177 let sendFee = if ((feeAmount > 0))
11901178 then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
11911179 else nil
1192- let $t04765547852 = if ((this == feeCollectorAddress))
1180+ let $t04732047517 = if ((this == feeCollectorAddress))
11931181 then $Tuple2(0, 0)
11941182 else if (paymentInAmountAsset)
11951183 then $Tuple2(-(feeAmount), 0)
11961184 else $Tuple2(0, -(feeAmount))
1197- let amountAssetBalanceDelta = $t04765547852._1
1198- let priceAssetBalanceDelta = $t04765547852._2
1199- let $t04785547963 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1200- let refreshKLpActions = $t04785547963._1
1201- let updatedKLp = $t04785547963._2
1185+ let amountAssetBalanceDelta = $t04732047517._1
1186+ let priceAssetBalanceDelta = $t04732047517._2
1187+ let $t04752047628 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1188+ let refreshKLpActions = $t04752047628._1
1189+ let updatedKLp = $t04752047628._2
12021190 let kLp = value(getString(keyKLp))
12031191 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
12041192 if ((isUpdatedKLpValid == isUpdatedKLpValid))
12051193 then {
12061194 let reb = invoke(this, "rebalance", nil, nil)
12071195 if ((reb == reb))
12081196 then $Tuple2((((commonState ++ lpTransfer) ++ sendFee) ++ refreshKLpActions), emitAmount)
12091197 else throw("Strict value is not equal to itself.")
12101198 }
12111199 else throw("Strict value is not equal to itself.")
12121200 }
12131201 else throw("Strict value is not equal to itself.")
12141202 }
12151203 else throw("Strict value is not equal to itself.")
12161204 }
12171205 else throw("Strict value is not equal to itself.")
12181206 }
12191207 else throw("Strict value is not equal to itself.")
12201208 }
12211209
12221210
12231211
12241212 @Callable(i)
12251213 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
1226- let $t04831848475 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
1227- let emitAmountEstimated = $t04831848475._1
1228- let commonState = $t04831848475._2
1229- let feeAmount = $t04831848475._3
1230- let bonus = $t04831848475._4
1231- let paymentInAmountAsset = $t04831848475._5
1214+ let $t04798348140 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
1215+ let emitAmountEstimated = $t04798348140._1
1216+ let commonState = $t04798348140._2
1217+ let feeAmount = $t04798348140._3
1218+ let bonus = $t04798348140._4
1219+ let paymentInAmountAsset = $t04798348140._5
12321220 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
12331221 }
12341222
12351223
12361224
12371225 @Callable(i)
12381226 func getOneTkn (outAssetIdStr,minOutAmount) = {
12391227 let isPoolOneTokenOperationsDisabled = {
12401228 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
12411229 if ($isInstanceOf(@, "Boolean"))
12421230 then @
12431231 else throw(($getType(@) + " couldn't be cast to Boolean"))
12441232 }
12451233 let isGetDisabled = if (if (isGlobalShutdown())
12461234 then true
12471235 else (cfgPoolStatus == PoolShutdown))
12481236 then true
12491237 else isPoolOneTokenOperationsDisabled
12501238 let checks = [if (if (!(isGetDisabled))
12511239 then true
12521240 else isManager(i))
12531241 then true
12541242 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1))
12551243 then true
12561244 else throwErr("exactly 1 payment are expected")]
12571245 if ((checks == checks))
12581246 then {
12591247 let outAssetId = parseAssetId(outAssetIdStr)
12601248 let payment = i.payments[0]
12611249 let paymentAssetId = payment.assetId
12621250 let paymentAmount = payment.amount
12631251 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
12641252 if ((currentKLp == currentKLp))
12651253 then {
12661254 let userAddress = i.caller
12671255 let txId = i.transactionId
1268- let $t04936049513 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
1269- if (($t04936049513 == $t04936049513))
1256+ let $t04902549178 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
1257+ if (($t04902549178 == $t04902549178))
12701258 then {
1271- let outInAmountAsset = $t04936049513._5
1272- let bonus = $t04936049513._4
1273- let feeAmount = $t04936049513._3
1274- let commonState = $t04936049513._2
1275- let amountEstimated = $t04936049513._1
1259+ let outInAmountAsset = $t04902549178._5
1260+ let bonus = $t04902549178._4
1261+ let feeAmount = $t04902549178._3
1262+ let commonState = $t04902549178._2
1263+ let amountEstimated = $t04902549178._1
12761264 let amount = if (if ((minOutAmount > 0))
12771265 then (minOutAmount > amountEstimated)
12781266 else false)
12791267 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
12801268 else amountEstimated
12811269 let burnInv = invoke(factoryContract, "burn", [paymentAmount], [AttachedPayment(paymentAssetId, paymentAmount)])
12821270 if ((burnInv == burnInv))
12831271 then {
12841272 let withdrawState = getWithdrawAssetState(outAssetIdStr, amount)
12851273 if ((withdrawState == withdrawState))
12861274 then {
12871275 let assetTransfer = [ScriptTransfer(userAddress, amount, outAssetId)]
12881276 let sendFee = if ((feeAmount > 0))
12891277 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
12901278 else nil
1291- let $t05008350330 = {
1279+ let $t04974849995 = {
12921280 let feeAmountForCalc = if ((this == feeCollectorAddress))
12931281 then 0
12941282 else feeAmount
12951283 if (outInAmountAsset)
12961284 then $Tuple2(-((amount + feeAmountForCalc)), 0)
12971285 else $Tuple2(0, -((amount + feeAmountForCalc)))
12981286 }
1299- let amountAssetBalanceDelta = $t05008350330._1
1300- let priceAssetBalanceDelta = $t05008350330._2
1301- let $t05033350441 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1302- let refreshKLpActions = $t05033350441._1
1303- let updatedKLp = $t05033350441._2
1287+ let amountAssetBalanceDelta = $t04974849995._1
1288+ let priceAssetBalanceDelta = $t04974849995._2
1289+ let $t04999850106 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1290+ let refreshKLpActions = $t04999850106._1
1291+ let updatedKLp = $t04999850106._2
13041292 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
13051293 if ((isUpdatedKLpValid == isUpdatedKLpValid))
13061294 then $Tuple2(((((commonState ++ withdrawState) ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
13071295 else throw("Strict value is not equal to itself.")
13081296 }
13091297 else throw("Strict value is not equal to itself.")
13101298 }
13111299 else throw("Strict value is not equal to itself.")
13121300 }
13131301 else throw("Strict value is not equal to itself.")
13141302 }
13151303 else throw("Strict value is not equal to itself.")
13161304 }
13171305 else throw("Strict value is not equal to itself.")
13181306 }
13191307
13201308
13211309
13221310 @Callable(i)
13231311 func getOneTknREADONLY (outAssetId,paymentAmount) = {
1324- let $t05071950875 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
1325- let amountEstimated = $t05071950875._1
1326- let commonState = $t05071950875._2
1327- let feeAmount = $t05071950875._3
1328- let bonus = $t05071950875._4
1329- let outInAmountAsset = $t05071950875._5
1312+ let $t05038450540 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
1313+ let amountEstimated = $t05038450540._1
1314+ let commonState = $t05038450540._2
1315+ let feeAmount = $t05038450540._3
1316+ let bonus = $t05038450540._4
1317+ let outInAmountAsset = $t05038450540._5
13301318 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
13311319 }
13321320
13331321
13341322
13351323 @Callable(i)
13361324 func unstakeAndGetOneTkn (unstakeAmount,outAssetIdStr,minOutAmount) = {
13371325 let isPoolOneTokenOperationsDisabled = {
13381326 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
13391327 if ($isInstanceOf(@, "Boolean"))
13401328 then @
13411329 else throw(($getType(@) + " couldn't be cast to Boolean"))
13421330 }
13431331 let isGetDisabled = if (if (isGlobalShutdown())
13441332 then true
13451333 else (cfgPoolStatus == PoolShutdown))
13461334 then true
13471335 else isPoolOneTokenOperationsDisabled
13481336 let checks = [if (if (!(isGetDisabled))
13491337 then true
13501338 else isManager(i))
13511339 then true
13521340 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 0))
13531341 then true
13541342 else throwErr("no payments are expected")]
13551343 if ((checks == checks))
13561344 then {
13571345 let outAssetId = parseAssetId(outAssetIdStr)
13581346 let userAddress = i.caller
13591347 let txId = i.transactionId
13601348 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
13611349 if ((currentKLp == currentKLp))
13621350 then {
13631351 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
13641352 if ((unstakeInv == unstakeInv))
13651353 then {
1366- let $t05178051931 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1367- if (($t05178051931 == $t05178051931))
1354+ let $t05144551596 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1355+ if (($t05144551596 == $t05144551596))
13681356 then {
1369- let outInAmountAsset = $t05178051931._5
1370- let bonus = $t05178051931._4
1371- let feeAmount = $t05178051931._3
1372- let commonState = $t05178051931._2
1373- let amountEstimated = $t05178051931._1
1357+ let outInAmountAsset = $t05144551596._5
1358+ let bonus = $t05144551596._4
1359+ let feeAmount = $t05144551596._3
1360+ let commonState = $t05144551596._2
1361+ let amountEstimated = $t05144551596._1
13741362 let amount = if (if ((minOutAmount > 0))
13751363 then (minOutAmount > amountEstimated)
13761364 else false)
13771365 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
13781366 else amountEstimated
13791367 let burnInv = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
13801368 if ((burnInv == burnInv))
13811369 then {
13821370 let withdrawState = getWithdrawAssetState(outAssetIdStr, amount)
13831371 if ((withdrawState == withdrawState))
13841372 then {
13851373 let assetTransfer = [ScriptTransfer(i.caller, amount, outAssetId)]
13861374 let sendFee = if ((feeAmount > 0))
13871375 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
13881376 else nil
1389- let $t05249652743 = {
1377+ let $t05216152408 = {
13901378 let feeAmountForCalc = if ((this == feeCollectorAddress))
13911379 then 0
13921380 else feeAmount
13931381 if (outInAmountAsset)
13941382 then $Tuple2(-((amount + feeAmountForCalc)), 0)
13951383 else $Tuple2(0, -((amount + feeAmountForCalc)))
13961384 }
1397- let amountAssetBalanceDelta = $t05249652743._1
1398- let priceAssetBalanceDelta = $t05249652743._2
1399- let $t05274652854 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1400- let refreshKLpActions = $t05274652854._1
1401- let updatedKLp = $t05274652854._2
1385+ let amountAssetBalanceDelta = $t05216152408._1
1386+ let priceAssetBalanceDelta = $t05216152408._2
1387+ let $t05241152519 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1388+ let refreshKLpActions = $t05241152519._1
1389+ let updatedKLp = $t05241152519._2
14021390 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
14031391 if ((isUpdatedKLpValid == isUpdatedKLpValid))
14041392 then $Tuple2(((((commonState ++ withdrawState) ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
14051393 else throw("Strict value is not equal to itself.")
14061394 }
14071395 else throw("Strict value is not equal to itself.")
14081396 }
14091397 else throw("Strict value is not equal to itself.")
14101398 }
14111399 else throw("Strict value is not equal to itself.")
14121400 }
14131401 else throw("Strict value is not equal to itself.")
14141402 }
14151403 else throw("Strict value is not equal to itself.")
14161404 }
14171405 else throw("Strict value is not equal to itself.")
14181406 }
14191407
14201408
14211409
14221410 @Callable(i)
14231411 func get () = {
14241412 let res = commonGet(i)
14251413 let outAmtAmt = res._1
14261414 let outPrAmt = res._2
14271415 let pmtAmt = res._3
14281416 let pmtAssetId = res._4
14291417 let state = res._5
14301418 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
14311419 if ((currentKLp == currentKLp))
14321420 then {
14331421 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
14341422 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
14351423 then {
1436- let $t05382153903 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1437- let refreshKLpActions = $t05382153903._1
1438- let updatedKLp = $t05382153903._2
1424+ let $t05348653568 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1425+ let refreshKLpActions = $t05348653568._1
1426+ let updatedKLp = $t05348653568._2
14391427 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
14401428 if ((isUpdatedKLpValid == isUpdatedKLpValid))
14411429 then (state ++ refreshKLpActions)
14421430 else throw("Strict value is not equal to itself.")
14431431 }
14441432 else throw("Strict value is not equal to itself.")
14451433 }
14461434 else throw("Strict value is not equal to itself.")
14471435 }
14481436
14491437
14501438
14511439 @Callable(i)
14521440 func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = {
14531441 let res = commonGet(i)
14541442 let outAmAmt = res._1
14551443 let outPrAmt = res._2
14561444 let pmtAmt = res._3
14571445 let pmtAssetId = res._4
14581446 let state = res._5
14591447 if ((noLessThenAmtAsset > outAmAmt))
14601448 then throw(((("noLessThenAmtAsset failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset)))
14611449 else if ((noLessThenPriceAsset > outPrAmt))
14621450 then throw(((("noLessThenPriceAsset failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset)))
14631451 else {
14641452 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
14651453 if ((currentKLp == currentKLp))
14661454 then {
14671455 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
14681456 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
14691457 then {
1470- let $t05485254933 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1471- let refreshKLpActions = $t05485254933._1
1472- let updatedKLp = $t05485254933._2
1458+ let $t05451754598 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1459+ let refreshKLpActions = $t05451754598._1
1460+ let updatedKLp = $t05451754598._2
14731461 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
14741462 if ((isUpdatedKLpValid == isUpdatedKLpValid))
14751463 then (state ++ refreshKLpActions)
14761464 else throw("Strict value is not equal to itself.")
14771465 }
14781466 else throw("Strict value is not equal to itself.")
14791467 }
14801468 else throw("Strict value is not equal to itself.")
14811469 }
14821470 }
14831471
14841472
14851473
14861474 @Callable(i)
14871475 func unstakeAndGet (amount) = {
14881476 let checkPayments = if ((size(i.payments) != 0))
14891477 then throw("No payments are expected")
14901478 else true
14911479 if ((checkPayments == checkPayments))
14921480 then {
14931481 let cfg = getPoolConfig()
14941482 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
14951483 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
14961484 if ((currentKLp == currentKLp))
14971485 then {
14981486 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(lpAssetId), amount], nil)
14991487 if ((unstakeInv == unstakeInv))
15001488 then {
15011489 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller)
15021490 let outAmAmt = res._1
15031491 let outPrAmt = res._2
15041492 let poolStatus = parseIntValue(res._9)
15051493 let state = res._10
15061494 let checkPoolStatus = if (if (isGlobalShutdown())
15071495 then true
15081496 else (poolStatus == PoolShutdown))
15091497 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
15101498 else true
15111499 if ((checkPoolStatus == checkPoolStatus))
15121500 then {
15131501 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
15141502 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
15151503 then {
1516- let $t05605956140 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1517- let refreshKLpActions = $t05605956140._1
1518- let updatedKLp = $t05605956140._2
1504+ let $t05572455805 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1505+ let refreshKLpActions = $t05572455805._1
1506+ let updatedKLp = $t05572455805._2
15191507 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
15201508 if ((isUpdatedKLpValid == isUpdatedKLpValid))
15211509 then (state ++ refreshKLpActions)
15221510 else throw("Strict value is not equal to itself.")
15231511 }
15241512 else throw("Strict value is not equal to itself.")
15251513 }
15261514 else throw("Strict value is not equal to itself.")
15271515 }
15281516 else throw("Strict value is not equal to itself.")
15291517 }
15301518 else throw("Strict value is not equal to itself.")
15311519 }
15321520 else throw("Strict value is not equal to itself.")
15331521 }
15341522
15351523
15361524
15371525 @Callable(i)
15381526 func unstakeAndGetNoLess (unstakeAmount,noLessThenAmountAsset,noLessThenPriceAsset) = {
15391527 let isGetDisabled = if (isGlobalShutdown())
15401528 then true
15411529 else (cfgPoolStatus == PoolShutdown)
15421530 let checks = [if (!(isGetDisabled))
15431531 then true
15441532 else throw("get operation is blocked by admin"), if ((size(i.payments) == 0))
15451533 then true
15461534 else throw("no payments are expected")]
15471535 if ((checks == checks))
15481536 then {
15491537 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
15501538 if ((currentKLp == currentKLp))
15511539 then {
15521540 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
15531541 if ((unstakeInv == unstakeInv))
15541542 then {
15551543 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller)
15561544 let outAmAmt = res._1
15571545 let outPrAmt = res._2
15581546 let state = res._10
15591547 let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset))
15601548 then true
15611549 else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset))
15621550 then true
15631551 else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))]
15641552 if ((checkAmounts == checkAmounts))
15651553 then {
15661554 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
15671555 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
15681556 then {
1569- let $t05743557516 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1570- let refreshKLpActions = $t05743557516._1
1571- let updatedKLp = $t05743557516._2
1557+ let $t05710057181 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1558+ let refreshKLpActions = $t05710057181._1
1559+ let updatedKLp = $t05710057181._2
15721560 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
15731561 if ((isUpdatedKLpValid == isUpdatedKLpValid))
15741562 then (state ++ refreshKLpActions)
15751563 else throw("Strict value is not equal to itself.")
15761564 }
15771565 else throw("Strict value is not equal to itself.")
15781566 }
15791567 else throw("Strict value is not equal to itself.")
15801568 }
15811569 else throw("Strict value is not equal to itself.")
15821570 }
15831571 else throw("Strict value is not equal to itself.")
15841572 }
15851573 else throw("Strict value is not equal to itself.")
15861574 }
15871575
15881576
15891577
15901578 @Callable(i)
15911579 func activate (amtAssetStr,priceAssetStr) = if ((toString(i.caller) != toString(factoryContract)))
15921580 then throw("permissions denied")
15931581 else $Tuple2([StringEntry(aa(), amtAssetStr), StringEntry(pa(), priceAssetStr)], "success")
15941582
15951583
15961584
15971585 @Callable(i)
15981586 func refreshKLp () = {
15991587 let lastRefreshedBlockHeight = valueOrElse(getInteger(keyKLpRefreshedHeight), 0)
16001588 let checkLastRefreshedBlockHeight = if (((height - lastRefreshedBlockHeight) >= kLpRefreshDelay))
16011589 then unit
16021590 else throwErr(makeString([toString(kLpRefreshDelay), " blocks have not passed since the previous call"], ""))
16031591 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
16041592 then {
16051593 let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
1606- let $t05870358767 = refreshKLpInternal(0, 0, 0)
1607- let kLpUpdateActions = $t05870358767._1
1608- let updatedKLp = $t05870358767._2
1594+ let $t05836858432 = refreshKLpInternal(0, 0, 0)
1595+ let kLpUpdateActions = $t05836858432._1
1596+ let updatedKLp = $t05836858432._2
16091597 let actions = if ((kLp != updatedKLp))
16101598 then kLpUpdateActions
16111599 else throwErr("nothing to refresh")
16121600 $Tuple2(actions, toString(updatedKLp))
16131601 }
16141602 else throw("Strict value is not equal to itself.")
16151603 }
16161604
16171605
16181606
16191607 @Callable(i)
16201608 func getPoolConfigWrapperREADONLY () = $Tuple2(nil, getPoolConfig())
16211609
16221610
16231611
16241612 @Callable(i)
16251613 func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId))
16261614
16271615
16281616
16291617 @Callable(i)
16301618 func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = {
16311619 let prices = calcPrices(amAmt, prAmt, lpAmt)
16321620 $Tuple2(nil, [toString(prices[0]), toString(prices[1]), toString(prices[2])])
16331621 }
16341622
16351623
16361624
16371625 @Callable(i)
16381626 func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(toX18(origVal, origScaleMult)))
16391627
16401628
16411629
16421630 @Callable(i)
16431631 func fromX18WrapperREADONLY (val,resultScaleMult) = $Tuple2(nil, fromX18(parseBigIntValue(val), resultScaleMult))
16441632
16451633
16461634
16471635 @Callable(i)
16481636 func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(calcPriceBigInt(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18))))
16491637
16501638
16511639
16521640 @Callable(i)
16531641 func estimatePutOperationWrapperREADONLY (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = $Tuple2(nil, estimatePutOperation(txId58, slippageTolerance, inAmAssetAmt, inAmAssetId, inPrAssetAmt, inPrAssetId, userAddress, isEvaluate, emitLp))
16541642
16551643
16561644
16571645 @Callable(i)
16581646 func estimateGetOperationWrapperREADONLY (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
16591647 let res = estimateGetOperation(txId58, pmtAssetId, pmtLpAmt, addressFromStringValue(userAddress))
16601648 $Tuple2(nil, $Tuple10(res._1, res._2, res._3, res._4, res._5, res._6, res._7, toString(res._8), res._9, res._10))
16611649 }
16621650
16631651
16641652
16651653 @Callable(i)
16661654 func statsREADONLY () = {
16671655 let cfg = getPoolConfig()
16681656 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
16691657 let amtAssetId = cfg[idxAmtAssetId]
16701658 let priceAssetId = cfg[idxPriceAssetId]
16711659 let iAmtAssetId = cfg[idxIAmtAssetId]
16721660 let iPriceAssetId = cfg[idxIPriceAssetId]
16731661 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
16741662 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
16751663 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
16761664 let accAmtAssetBalance = getAccBalance(amtAssetId)
16771665 let accPriceAssetBalance = getAccBalance(priceAssetId)
16781666 let pricesList = if ((poolLPBalance == 0))
16791667 then [zeroBigInt, zeroBigInt, zeroBigInt]
16801668 else calcPrices(accAmtAssetBalance, accPriceAssetBalance, poolLPBalance)
16811669 let curPrice = 0
16821670 let lpAmtAssetShare = fromX18(pricesList[1], scale8)
16831671 let lpPriceAssetShare = fromX18(pricesList[2], scale8)
16841672 let poolWeight = value(getInteger(factoryContract, keyPoolWeight(toString(this))))
16851673 $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))
16861674 }
16871675
16881676
16891677
16901678 @Callable(i)
16911679 func evaluatePutByAmountAssetREADONLY (inAmAssetAmt) = {
16921680 let cfg = getPoolConfig()
16931681 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
16941682 let amAssetIdStr = cfg[idxAmtAssetId]
16951683 let amAssetId = fromBase58String(amAssetIdStr)
16961684 let prAssetIdStr = cfg[idxPriceAssetId]
16971685 let prAssetId = fromBase58String(prAssetIdStr)
16981686 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
16991687 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
17001688 let poolStatus = cfg[idxPoolStatus]
17011689 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
17021690 let accAmtAssetBalance = getAccBalance(amAssetIdStr)
17031691 let accPriceAssetBalance = getAccBalance(prAssetIdStr)
17041692 let amtAssetAmtX18 = toX18(accAmtAssetBalance, amtAssetDcm)
17051693 let priceAssetAmtX18 = toX18(accPriceAssetBalance, priceAssetDcm)
17061694 let curPriceX18 = if ((poolLPBalance == 0))
17071695 then zeroBigInt
17081696 else calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
17091697 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
17101698 let inPrAssetAmtX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18)
17111699 let inPrAssetAmt = fromX18(inPrAssetAmtX18, priceAssetDcm)
17121700 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
17131701 let calcLpAmt = estPut._1
17141702 let curPriceCalc = estPut._3
17151703 let amBalance = estPut._4
17161704 let prBalance = estPut._5
17171705 let lpEmission = estPut._6
17181706 $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))
17191707 }
17201708
17211709
17221710
17231711 @Callable(i)
17241712 func evaluatePutByPriceAssetREADONLY (inPrAssetAmt) = {
17251713 let cfg = getPoolConfig()
17261714 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
17271715 let amAssetIdStr = cfg[idxAmtAssetId]
17281716 let amAssetId = fromBase58String(amAssetIdStr)
17291717 let prAssetIdStr = cfg[idxPriceAssetId]
17301718 let prAssetId = fromBase58String(prAssetIdStr)
17311719 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
17321720 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
17331721 let poolStatus = cfg[idxPoolStatus]
17341722 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
17351723 let amBalanceRaw = getAccBalance(amAssetIdStr)
17361724 let prBalanceRaw = getAccBalance(prAssetIdStr)
17371725 let amBalanceRawX18 = toX18(amBalanceRaw, amtAssetDcm)
17381726 let prBalanceRawX18 = toX18(prBalanceRaw, priceAssetDcm)
17391727 let curPriceX18 = if ((poolLPBalance == 0))
17401728 then zeroBigInt
17411729 else calcPriceBigInt(prBalanceRawX18, amBalanceRawX18)
17421730 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
17431731 let inAmAssetAmtX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
17441732 let inAmAssetAmt = fromX18(inAmAssetAmtX18, amtAssetDcm)
17451733 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
17461734 let calcLpAmt = estPut._1
17471735 let curPriceCalc = estPut._3
17481736 let amBalance = estPut._4
17491737 let prBalance = estPut._5
17501738 let lpEmission = estPut._6
17511739 $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))
17521740 }
17531741
17541742
17551743
17561744 @Callable(i)
17571745 func evaluateGetREADONLY (paymentLpAssetId,paymentLpAmt) = {
17581746 let res = estimateGetOperation("", paymentLpAssetId, paymentLpAmt, this)
17591747 let outAmAmt = res._1
17601748 let outPrAmt = res._2
17611749 let amBalance = res._5
17621750 let prBalance = res._6
17631751 let lpEmission = res._7
17641752 let curPrice = res._8
17651753 let poolStatus = parseIntValue(res._9)
17661754 $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))
17671755 }
17681756
17691757
17701758 @Verifier(tx)
17711759 func verify () = {
17721760 let targetPublicKey = match managerPublicKeyOrUnit() {
17731761 case pk: ByteVector =>
17741762 pk
17751763 case _: Unit =>
17761764 tx.senderPublicKey
17771765 case _ =>
17781766 throw("Match error")
17791767 }
17801768 match tx {
17811769 case order: Order =>
17821770 let matcherPub = getMatcherPubOrFail()
1783- let $t06742967498 = validateMatcherOrderAllowed(order)
1784- let orderValid = $t06742967498._1
1785- let orderValidInfo = $t06742967498._2
1771+ let $t06709467163 = validateMatcherOrderAllowed(order)
1772+ let orderValid = $t06709467163._1
1773+ let orderValidInfo = $t06709467163._2
17861774 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
17871775 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
17881776 if (if (if (orderValid)
17891777 then senderValid
17901778 else false)
17911779 then matcherValid
17921780 else false)
17931781 then true
17941782 else throwOrderError(orderValid, orderValidInfo, senderValid, matcherValid)
17951783 case s: SetScriptTransaction =>
17961784 if (sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey))
17971785 then true
17981786 else {
17991787 let newHash = blake2b256(value(s.script))
18001788 let allowedHash = fromBase64String(value(getString(factoryContract, keyAllowedLpScriptHash())))
18011789 let currentHash = scriptHash(this)
18021790 if ((allowedHash == newHash))
18031791 then (currentHash != newHash)
18041792 else false
18051793 }
18061794 case _ =>
18071795 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
18081796 }
18091797 }
18101798

github/deemru/w8io/026f985 
240.49 ms