tx · H3JvzL9JwfmUNm7yqWx4xt75vTDfpUbX2g1p94P6Qvrx

3N6wAa7PMFZJu4Zrmp3avXmMnRTrRpMM9Lh:  -0.04300000 Waves

2023.04.04 14:20 [2519750] smart account 3N6wAa7PMFZJu4Zrmp3avXmMnRTrRpMM9Lh > SELF 0.00000000 Waves

{ "type": 13, "id": "H3JvzL9JwfmUNm7yqWx4xt75vTDfpUbX2g1p94P6Qvrx", "fee": 4300000, "feeAssetId": null, "timestamp": 1680607191190, "version": 2, "chainId": 84, "sender": "3N6wAa7PMFZJu4Zrmp3avXmMnRTrRpMM9Lh", "senderPublicKey": "Cr8D7eozSzJh7XHsYTjBinPpo3SS83BrCGiBAJsjGxBo", "proofs": [ "StVDbQNdvqaDTLBqy7VTTWX7P7NZzkc65yyjMfr2k9nGhPexV8wmDZq961N2mbZMwXm1SGGDdQRNxny7ipB3m6f" ], "script": "base64:BgLGNwgCEgASBQoDAQQBEgcKBQEEAQgBEgMKAQgSABIECgIBBBIDCgEBEgQKAgEEEgQKAggBEgQKAggBEgQKAggBEgUKAwEIARIAEgQKAgEBEgMKAQESBQoDAQEBEgQKAggIEgASABIDCgEIEgUKAwEBARIECgIBARIECgIIARIECgIICBILCgkIAQECAQIIBAQSBgoECAgBCBIAEgMKAQESAwoBARIECgIIASIKbFBkZWNpbWFscyIGc2NhbGU4IgxzY2FsZThCaWdJbnQiB3NjYWxlMTgiCnplcm9CaWdJbnQiBGJpZzAiBGJpZzEiBGJpZzIiC3dhdmVzU3RyaW5nIgNTRVAiClBvb2xBY3RpdmUiD1Bvb2xQdXREaXNhYmxlZCITUG9vbE1hdGNoZXJEaXNhYmxlZCIMUG9vbFNodXRkb3duIg5pZHhQb29sQWRkcmVzcyINaWR4UG9vbFN0YXR1cyIQaWR4UG9vbExQQXNzZXRJZCINaWR4QW10QXNzZXRJZCIPaWR4UHJpY2VBc3NldElkIg5pZHhBbXRBc3NldERjbSIQaWR4UHJpY2VBc3NldERjbSIOaWR4SUFtdEFz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XQJAPEHAQUEdGhpcwMJAAACBQJpcwUCaXIJAQIhPQIFAml0BQJpcgcJAPQDAwgFAmltCWJvZHlCeXRlcwkAkQMCCAUCaW0GcHJvb2ZzAAAFAmlvvVn3RA==", "height": 2519750, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: DmTF4tKBU57njZFnYSdkLxM7TWRLGN6DEoQPBn3R2cw4 Next: AA9S2DSnnMfn914syNFyppNj1dSKJVVXW1L3YdHishVJ Diff:
OldNewDifferences
142142 func keyStakingAssetBalance (assetId) = makeString(["%s%s", "stakingAssetBalance", assetId], SEP)
143143
144144
145-func getAdditionalBalance (assetId) = valueOrElse(getInteger(this, keyAdditionalBalance(assetId)), 0)
145+func getAdditionalBalanceOrZero (assetId) = valueOrElse(getInteger(this, keyAdditionalBalance(assetId)), 0)
146146
147147
148-func getStakingAssetBalance (assetId) = valueOrElse(getInteger(this, keyStakingAssetBalance(assetId)), 0)
148+func getStakingAssetBalanceOrZero (assetId) = valueOrElse(getInteger(this, keyStakingAssetBalance(assetId)), 0)
149149
150150
151151 func keyFactoryConfig () = "%s__factoryConfig"
243243
244244 let poolConfigParsed = parsePoolConfig(getPoolConfig())
245245
246-let $t092859451 = poolConfigParsed
246+let $t092979463 = poolConfigParsed
247247
248-let cfgPoolAddress = $t092859451._1
248+let cfgPoolAddress = $t092979463._1
249249
250-let cfgPoolStatus = $t092859451._2
250+let cfgPoolStatus = $t092979463._2
251251
252-let cfgLpAssetId = $t092859451._3
252+let cfgLpAssetId = $t092979463._3
253253
254-let cfgAmountAssetId = $t092859451._4
254+let cfgAmountAssetId = $t092979463._4
255255
256-let cfgPriceAssetId = $t092859451._5
256+let cfgPriceAssetId = $t092979463._5
257257
258-let cfgAmountAssetDecimals = $t092859451._6
258+let cfgAmountAssetDecimals = $t092979463._6
259259
260-let cfgPriceAssetDecimals = $t092859451._7
260+let cfgPriceAssetDecimals = $t092979463._7
261261
262262 func getFactoryConfig () = split(getStringOrFail(factoryContract, keyFactoryConfig()), SEP)
263263
272272 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)
273273
274274
275-func getAccBalance (assetId) = if ((assetId == "WAVES"))
276- then (wavesBalance(this).available + getAdditionalBalance(assetId))
277- else if ((assetId == sWavesId()))
278- then {
279- let amtAsset = getStringOrFail(this, aa())
280- let priceAsset = getStringOrFail(this, pa())
281- if (if (if ((amtAsset == "WAVES"))
282- then (priceAsset == sWavesId())
283- else false)
284- then true
285- else if ((priceAsset == "WAVES"))
286- then (amtAsset == sWavesId())
287- else false)
288- then assetBalance(this, fromBase58String(assetId))
289- else (assetBalance(this, fromBase58String(assetId)) + getStakingAssetBalance(assetId))
290- }
275+func getAccBalance (assetId) = {
276+ let balanceOnPool = if ((assetId == "WAVES"))
277+ then wavesBalance(this).available
291278 else assetBalance(this, fromBase58String(assetId))
279+ let totalBalance = ((balanceOnPool + getAdditionalBalanceOrZero(assetId)) - getStakingAssetBalanceOrZero(assetId))
280+ max([0, totalBalance])
281+ }
292282
293283
294284 func calcPriceBigInt (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18)
311301
312302
313303 func deposit (assetId,amount,stakingAssetId,proxy) = {
314- let currentAdditionalBalance = getAdditionalBalance(assetId)
304+ let currentAdditionalBalance = getAdditionalBalanceOrZero(assetId)
315305 if ((currentAdditionalBalance == currentAdditionalBalance))
316306 then {
317- let currentStakingAssetBalance = getStakingAssetBalance(stakingAssetId)
307+ let currentStakingAssetBalance = getStakingAssetBalanceOrZero(stakingAssetId)
318308 if ((currentStakingAssetBalance == currentStakingAssetBalance))
319309 then {
320310 let asset = parseAssetId(assetId)
341331
342332
343333 func withdraw (assetId,amount,stakingAssetId,proxy,proxyRateMul,profitAddress) = {
344- let currentAdditionalBalance = getAdditionalBalance(assetId)
334+ let currentAdditionalBalance = getAdditionalBalanceOrZero(assetId)
345335 if ((currentAdditionalBalance == currentAdditionalBalance))
346336 then {
347- let currentStakingAssetBalance = getStakingAssetBalance(stakingAssetId)
337+ let currentStakingAssetBalance = getStakingAssetBalanceOrZero(stakingAssetId)
348338 if ((currentStakingAssetBalance == currentStakingAssetBalance))
349339 then {
350340 let currentProxyRate = getRate(proxy)
383373
384374
385375 func rebalanceInternal (targetRatio,assetId,stakingAssetId,minBalance,proxy,proxyRateMul,profitAddress) = {
386- let currentAdditionalBalance = getAdditionalBalance(assetId)
376+ let currentAdditionalBalance = getAdditionalBalanceOrZero(assetId)
387377 if ((currentAdditionalBalance == currentAdditionalBalance))
388378 then {
389- let currentStakingAssetBalance = getStakingAssetBalance(stakingAssetId)
379+ let currentStakingAssetBalance = getStakingAssetBalanceOrZero(stakingAssetId)
390380 if ((currentStakingAssetBalance == currentStakingAssetBalance))
391381 then {
392382 let availableBalance = match parseAssetId(assetId) {
424414
425415 func rebalanceAsset (assetId) = match getLeaseProxyConfig(assetId) {
426416 case a: (Boolean, Int, Int, String, String, Int, String) =>
427- let $t01605416163 = a
428- let isLeasable = $t01605416163._1
429- let leasedRatio = $t01605416163._2
430- let minBalance = $t01605416163._3
431- let proxyAddress = $t01605416163._4
432- let proxyAssetId = $t01605416163._5
433- let proxyRateMul = $t01605416163._6
434- let stakingProfitAddress = $t01605416163._7
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
435425 if (isLeasable)
436426 then rebalanceInternal(leasedRatio, assetId, proxyAssetId, minBalance, addressFromStringValue(proxyAddress), proxyRateMul, addressFromStringValue(stakingProfitAddress))
437427 else nil
442432
443433 func withdrawAssetWrapper (assetId,amount) = match getLeaseProxyConfig(assetId) {
444434 case a: (Boolean, Int, Int, String, String, Int, String) =>
445- let $t01669316802 = a
446- let isLeasable = $t01669316802._1
447- let leasedRatio = $t01669316802._2
448- let minBalance = $t01669316802._3
449- let proxyAddress = $t01669316802._4
450- let proxyAssetId = $t01669316802._5
451- let proxyRateMul = $t01669316802._6
452- let stakingProfitAddress = $t01669316802._7
435+ let $t01645316562 = a
436+ let isLeasable = $t01645316562._1
437+ let leasedRatio = $t01645316562._2
438+ let minBalance = $t01645316562._3
439+ let proxyAddress = $t01645316562._4
440+ let proxyAssetId = $t01645316562._5
441+ let proxyRateMul = $t01645316562._6
442+ let stakingProfitAddress = $t01645316562._7
453443 if (isLeasable)
454444 then withdraw(assetId, amount, proxyAssetId, addressFromStringValue(proxyAddress), proxyRateMul, addressFromStringValue(stakingProfitAddress))
455445 else nil
670660 let priceAssetBalance = getAccBalance(assetIdToString(cfgPriceAssetId))
671661 let amountAssetAmount = order.amount
672662 let priceAssetAmount = fraction(order.amount, order.price, scale8, FLOOR)
673- let $t02904029252 = if ((order.orderType == Buy))
663+ let $t02880029012 = if ((order.orderType == Buy))
674664 then $Tuple2(amountAssetAmount, -(priceAssetAmount))
675665 else $Tuple2(-(amountAssetAmount), priceAssetAmount)
676- let amountAssetBalanceDelta = $t02904029252._1
677- let priceAssetBalanceDelta = $t02904029252._2
666+ let amountAssetBalanceDelta = $t02880029012._1
667+ let priceAssetBalanceDelta = $t02880029012._2
678668 if (if (if (isGlobalShutdown())
679669 then true
680670 else (cfgPoolStatus == PoolMatcherDisabled))
687677 then throw("Wrong order assets.")
688678 else {
689679 let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
690- let $t02969229792 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
691- let unusedActions = $t02969229792._1
692- let kLpNew = $t02969229792._2
680+ let $t02945229552 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
681+ let unusedActions = $t02945229552._1
682+ let kLpNew = $t02945229552._2
693683 let isOrderValid = (kLpNew >= kLp)
694684 let info = makeString(["kLp=", toString(kLp), " kLpNew=", toString(kLpNew), " amountAssetBalance=", toString(amountAssetBalance), " priceAssetBalance=", toString(priceAssetBalance), " amountAssetBalanceDelta=", toString(amountAssetBalanceDelta), " priceAssetBalanceDelta=", toString(priceAssetBalanceDelta), " height=", toString(height)], "")
695685 $Tuple2(isOrderValid, info)
768758 else if ((paymentAssetId == cfgPriceAssetId))
769759 then false
770760 else throwErr("invalid asset")
771- let $t03290533198 = if (isEval)
761+ let $t03266532958 = if (isEval)
772762 then $Tuple2(amountBalanceRaw, priceBalanceRaw)
773763 else if (paymentInAmountAsset)
774764 then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw)
775765 else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw))
776- let amountBalanceOld = $t03290533198._1
777- let priceBalanceOld = $t03290533198._2
778- let $t03320233351 = if (paymentInAmountAsset)
766+ let amountBalanceOld = $t03266532958._1
767+ let priceBalanceOld = $t03266532958._2
768+ let $t03296233111 = if (paymentInAmountAsset)
779769 then $Tuple2(paymentAmountRaw, 0)
780770 else $Tuple2(0, paymentAmountRaw)
781- let amountAssetAmountRaw = $t03320233351._1
782- let priceAssetAmountRaw = $t03320233351._2
771+ let amountAssetAmountRaw = $t03296233111._1
772+ let priceAssetAmountRaw = $t03296233111._2
783773 let amountAssetAmount = takeFee(amountAssetAmountRaw, inFee)._1
784774 let priceAssetAmount = takeFee(priceAssetAmountRaw, inFee)._1
785- let $t03348333547 = takeFee(paymentAmountRaw, inFee)
786- let paymentAmount = $t03348333547._1
787- let feeAmount = $t03348333547._2
775+ let $t03324333307 = takeFee(paymentAmountRaw, inFee)
776+ let paymentAmount = $t03324333307._1
777+ let feeAmount = $t03324333307._2
788778 let amountBalanceNew = (amountBalanceOld + amountAssetAmount)
789779 let priceBalanceNew = (priceBalanceOld + priceAssetAmount)
790780 let priceNewX18 = calcPriceBigInt(toX18(priceBalanceNew, cfgPriceAssetDecimals), toX18(amountBalanceNew, cfgAmountAssetDecimals))
807797 let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, cfgPriceAssetDecimals), toX18(amountBalanceOld, cfgAmountAssetDecimals))
808798 let priceOld = fromX18(priceOldX18, scale8)
809799 let loss = {
810- let $t03522835395 = if (paymentInAmountAsset)
800+ let $t03498835155 = if (paymentInAmountAsset)
811801 then $Tuple2(amountAssetAmountRaw, amountBalanceOld)
812802 else $Tuple2(priceAssetAmountRaw, priceBalanceOld)
813- let amount = $t03522835395._1
814- let balance = $t03522835395._2
803+ let amount = $t03498835155._1
804+ let balance = $t03498835155._2
815805 let issueAmountBoth = toInt(fraction(supplyBigInt, toBigInt((amount / 2)), toBigInt(balance)))
816806 fraction((issueAmount - issueAmountBoth), scale8, issueAmountBoth)
817807 }
851841 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
852842 let redeemedBigInt = toBigInt(paymentAmount)
853843 let amountRaw = max([0, toInt(((balanceBigInt * (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN))) / scale18))])
854- let $t03747337529 = takeFee(amountRaw, outFee)
855- let totalAmount = $t03747337529._1
856- let feeAmount = $t03747337529._2
857- let $t03753337759 = if (outInAmountAsset)
844+ let $t03723337289 = takeFee(amountRaw, outFee)
845+ let totalAmount = $t03723337289._1
846+ let feeAmount = $t03723337289._2
847+ let $t03729337519 = if (outInAmountAsset)
858848 then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld)
859849 else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw))
860- let outAmAmount = $t03753337759._1
861- let outPrAmount = $t03753337759._2
862- let amBalanceNew = $t03753337759._3
863- let prBalanceNew = $t03753337759._4
850+ let outAmAmount = $t03729337519._1
851+ let outPrAmount = $t03729337519._2
852+ let amBalanceNew = $t03729337519._3
853+ let prBalanceNew = $t03729337519._4
864854 let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, cfgPriceAssetDecimals), toX18(amBalanceNew, cfgAmountAssetDecimals))
865855 let priceNew = fromX18(priceNewX18, scale8)
866856 let commonState = if (isEval)
932922
933923 @Callable(i)
934924 func calculateAmountOutForSwapREADONLY (cleanAmountIn,isReverse,feePoolAmount) = {
935- let $t03964539950 = if ((isReverse == false))
925+ let $t03940539710 = if ((isReverse == false))
936926 then {
937927 let assetOut = getStringOrFail(this, pa())
938928 let assetIn = getStringOrFail(this, aa())
943933 let assetIn = getStringOrFail(this, pa())
944934 $Tuple2(assetOut, assetIn)
945935 }
946- let assetOut = $t03964539950._1
947- let assetIn = $t03964539950._2
936+ let assetOut = $t03940539710._1
937+ let assetIn = $t03940539710._2
948938 let poolAssetInBalance = getAccBalance(assetIn)
949939 let poolAssetOutBalance = getAccBalance(assetOut)
950940 let amountOut = fraction(poolAssetOutBalance, cleanAmountIn, (poolAssetInBalance + cleanAmountIn))
11011091 else throw("Strict value is not equal to itself.")
11021092 }
11031093 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
1104- let $t04515145613 = refreshKLpInternal(0, 0, 0)
1105- if (($t04515145613 == $t04515145613))
1094+ let $t04491145373 = refreshKLpInternal(0, 0, 0)
1095+ if (($t04491145373 == $t04491145373))
11061096 then {
1107- let updatedKLp = $t04515145613._2
1108- let refreshKLpActions = $t04515145613._1
1097+ let updatedKLp = $t04491145373._2
1098+ let refreshKLpActions = $t04491145373._1
11091099 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11101100 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11111101 then ((state ++ lpTransfer) ++ refreshKLpActions)
11371127 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
11381128 if ((currentKLp == currentKLp))
11391129 then {
1140- let $t04617546240 = refreshKLpInternal(0, 0, 0)
1141- let refreshKLpActions = $t04617546240._1
1142- let updatedKLp = $t04617546240._2
1130+ let $t04593546000 = refreshKLpInternal(0, 0, 0)
1131+ let refreshKLpActions = $t04593546000._1
1132+ let updatedKLp = $t04593546000._2
11431133 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11441134 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11451135 then (state ++ refreshKLpActions)
11861176 then {
11871177 let userAddress = i.caller
11881178 let txId = i.transactionId
1189- let $t04742847580 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
1190- if (($t04742847580 == $t04742847580))
1179+ let $t04718847340 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
1180+ if (($t04718847340 == $t04718847340))
11911181 then {
1192- let paymentInAmountAsset = $t04742847580._5
1193- let bonus = $t04742847580._4
1194- let feeAmount = $t04742847580._3
1195- let commonState = $t04742847580._2
1196- let emitAmountEstimated = $t04742847580._1
1182+ let paymentInAmountAsset = $t04718847340._5
1183+ let bonus = $t04718847340._4
1184+ let feeAmount = $t04718847340._3
1185+ let commonState = $t04718847340._2
1186+ let emitAmountEstimated = $t04718847340._1
11971187 let emitAmount = if (if ((minOutAmount > 0))
11981188 then (minOutAmount > emitAmountEstimated)
11991189 else false)
12131203 let sendFee = if ((feeAmount > 0))
12141204 then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
12151205 else nil
1216- let $t04816648363 = if ((this == feeCollectorAddress))
1206+ let $t04792648123 = if ((this == feeCollectorAddress))
12171207 then $Tuple2(0, 0)
12181208 else if (paymentInAmountAsset)
12191209 then $Tuple2(-(feeAmount), 0)
12201210 else $Tuple2(0, -(feeAmount))
1221- let amountAssetBalanceDelta = $t04816648363._1
1222- let priceAssetBalanceDelta = $t04816648363._2
1223- let $t04836648474 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1224- let refreshKLpActions = $t04836648474._1
1225- let updatedKLp = $t04836648474._2
1211+ let amountAssetBalanceDelta = $t04792648123._1
1212+ let priceAssetBalanceDelta = $t04792648123._2
1213+ let $t04812648234 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1214+ let refreshKLpActions = $t04812648234._1
1215+ let updatedKLp = $t04812648234._2
12261216 let kLp = value(getString(keyKLp))
12271217 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
12281218 if ((isUpdatedKLpValid == isUpdatedKLpValid))
12471237
12481238 @Callable(i)
12491239 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
1250- let $t04882948986 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
1251- let emitAmountEstimated = $t04882948986._1
1252- let commonState = $t04882948986._2
1253- let feeAmount = $t04882948986._3
1254- let bonus = $t04882948986._4
1255- let paymentInAmountAsset = $t04882948986._5
1240+ let $t04858948746 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
1241+ let emitAmountEstimated = $t04858948746._1
1242+ let commonState = $t04858948746._2
1243+ let feeAmount = $t04858948746._3
1244+ let bonus = $t04858948746._4
1245+ let paymentInAmountAsset = $t04858948746._5
12561246 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
12571247 }
12581248
12891279 then {
12901280 let userAddress = i.caller
12911281 let txId = i.transactionId
1292- let $t04987150024 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
1293- if (($t04987150024 == $t04987150024))
1282+ let $t04963149784 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
1283+ if (($t04963149784 == $t04963149784))
12941284 then {
1295- let outInAmountAsset = $t04987150024._5
1296- let bonus = $t04987150024._4
1297- let feeAmount = $t04987150024._3
1298- let commonState = $t04987150024._2
1299- let amountEstimated = $t04987150024._1
1285+ let outInAmountAsset = $t04963149784._5
1286+ let bonus = $t04963149784._4
1287+ let feeAmount = $t04963149784._3
1288+ let commonState = $t04963149784._2
1289+ let amountEstimated = $t04963149784._1
13001290 let amount = if (if ((minOutAmount > 0))
13011291 then (minOutAmount > amountEstimated)
13021292 else false)
13181308 let sendFee = if ((feeAmount > 0))
13191309 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
13201310 else nil
1321- let $t05078051027 = {
1311+ let $t05054050787 = {
13221312 let feeAmountForCalc = if ((this == feeCollectorAddress))
13231313 then 0
13241314 else feeAmount
13261316 then $Tuple2(-((amount + feeAmountForCalc)), 0)
13271317 else $Tuple2(0, -((amount + feeAmountForCalc)))
13281318 }
1329- let amountAssetBalanceDelta = $t05078051027._1
1330- let priceAssetBalanceDelta = $t05078051027._2
1331- let $t05103051138 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1332- let refreshKLpActions = $t05103051138._1
1333- let updatedKLp = $t05103051138._2
1319+ let amountAssetBalanceDelta = $t05054050787._1
1320+ let priceAssetBalanceDelta = $t05054050787._2
1321+ let $t05079050898 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1322+ let refreshKLpActions = $t05079050898._1
1323+ let updatedKLp = $t05079050898._2
13341324 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
13351325 if ((isUpdatedKLpValid == isUpdatedKLpValid))
13361326 then {
13371327 let reb = invoke(this, "rebalance", nil, nil)
13381328 if ((reb == reb))
1339- then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
1329+ then $Tuple2(((((commonState ++ withdrawState) ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
13401330 else throw("Strict value is not equal to itself.")
13411331 }
13421332 else throw("Strict value is not equal to itself.")
13561346
13571347 @Callable(i)
13581348 func getOneTknREADONLY (outAssetId,paymentAmount) = {
1359- let $t05144351599 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
1360- let amountEstimated = $t05144351599._1
1361- let commonState = $t05144351599._2
1362- let feeAmount = $t05144351599._3
1363- let bonus = $t05144351599._4
1364- let outInAmountAsset = $t05144351599._5
1349+ let $t05122451380 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
1350+ let amountEstimated = $t05122451380._1
1351+ let commonState = $t05122451380._2
1352+ let feeAmount = $t05122451380._3
1353+ let bonus = $t05122451380._4
1354+ let outInAmountAsset = $t05122451380._5
13651355 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
13661356 }
13671357
13981388 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
13991389 if ((unstakeInv == unstakeInv))
14001390 then {
1401- let $t05250452655 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1402- if (($t05250452655 == $t05250452655))
1391+ let $t05228552436 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1392+ if (($t05228552436 == $t05228552436))
14031393 then {
1404- let outInAmountAsset = $t05250452655._5
1405- let bonus = $t05250452655._4
1406- let feeAmount = $t05250452655._3
1407- let commonState = $t05250452655._2
1408- let amountEstimated = $t05250452655._1
1394+ let outInAmountAsset = $t05228552436._5
1395+ let bonus = $t05228552436._4
1396+ let feeAmount = $t05228552436._3
1397+ let commonState = $t05228552436._2
1398+ let amountEstimated = $t05228552436._1
14091399 let amount = if (if ((minOutAmount > 0))
14101400 then (minOutAmount > amountEstimated)
14111401 else false)
14211411 let sendFee = if ((feeAmount > 0))
14221412 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
14231413 else nil
1424- let $t05322053467 = {
1414+ let $t05300153248 = {
14251415 let feeAmountForCalc = if ((this == feeCollectorAddress))
14261416 then 0
14271417 else feeAmount
14291419 then $Tuple2(-((amount + feeAmountForCalc)), 0)
14301420 else $Tuple2(0, -((amount + feeAmountForCalc)))
14311421 }
1432- let amountAssetBalanceDelta = $t05322053467._1
1433- let priceAssetBalanceDelta = $t05322053467._2
1434- let $t05347053578 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1435- let refreshKLpActions = $t05347053578._1
1436- let updatedKLp = $t05347053578._2
1422+ let amountAssetBalanceDelta = $t05300153248._1
1423+ let priceAssetBalanceDelta = $t05300153248._2
1424+ let $t05325153359 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1425+ let refreshKLpActions = $t05325153359._1
1426+ let updatedKLp = $t05325153359._2
14371427 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
14381428 if ((isUpdatedKLpValid == isUpdatedKLpValid))
14391429 then {
14731463 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
14741464 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
14751465 then {
1476- let $t05459254674 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1477- let refreshKLpActions = $t05459254674._1
1478- let updatedKLp = $t05459254674._2
1466+ let $t05437354455 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1467+ let refreshKLpActions = $t05437354455._1
1468+ let updatedKLp = $t05437354455._2
14791469 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
14801470 if ((isUpdatedKLpValid == isUpdatedKLpValid))
14811471 then (state ++ refreshKLpActions)
15071497 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
15081498 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
15091499 then {
1510- let $t05562355704 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1511- let refreshKLpActions = $t05562355704._1
1512- let updatedKLp = $t05562355704._2
1500+ let $t05540455485 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1501+ let refreshKLpActions = $t05540455485._1
1502+ let updatedKLp = $t05540455485._2
15131503 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
15141504 if ((isUpdatedKLpValid == isUpdatedKLpValid))
15151505 then (state ++ refreshKLpActions)
15531543 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
15541544 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
15551545 then {
1556- let $t05683056911 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1557- let refreshKLpActions = $t05683056911._1
1558- let updatedKLp = $t05683056911._2
1546+ let $t05661156692 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1547+ let refreshKLpActions = $t05661156692._1
1548+ let updatedKLp = $t05661156692._2
15591549 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
15601550 if ((isUpdatedKLpValid == isUpdatedKLpValid))
15611551 then (state ++ refreshKLpActions)
16061596 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
16071597 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
16081598 then {
1609- let $t05820658287 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1610- let refreshKLpActions = $t05820658287._1
1611- let updatedKLp = $t05820658287._2
1599+ let $t05798758068 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1600+ let refreshKLpActions = $t05798758068._1
1601+ let updatedKLp = $t05798758068._2
16121602 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
16131603 if ((isUpdatedKLpValid == isUpdatedKLpValid))
16141604 then (state ++ refreshKLpActions)
16431633 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
16441634 then {
16451635 let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
1646- let $t05947459538 = refreshKLpInternal(0, 0, 0)
1647- let kLpUpdateActions = $t05947459538._1
1648- let updatedKLp = $t05947459538._2
1636+ let $t05925559319 = refreshKLpInternal(0, 0, 0)
1637+ let kLpUpdateActions = $t05925559319._1
1638+ let updatedKLp = $t05925559319._2
16491639 let actions = if ((kLp != updatedKLp))
16501640 then kLpUpdateActions
16511641 else throwErr("nothing to refresh")
18201810 match tx {
18211811 case order: Order =>
18221812 let matcherPub = getMatcherPubOrFail()
1823- let $t06820068269 = validateMatcherOrderAllowed(order)
1824- let orderValid = $t06820068269._1
1825- let orderValidInfo = $t06820068269._2
1813+ let $t06798168050 = validateMatcherOrderAllowed(order)
1814+ let orderValid = $t06798168050._1
1815+ let orderValidInfo = $t06798168050._2
18261816 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
18271817 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
18281818 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
133133 func keySWavesAssetId () = "%s__sWavesAssetId"
134134
135135
136136 func keySWavesProxyAddress () = "%s__sWavesProxyAddress"
137137
138138
139139 func keyAdditionalBalance (assetId) = makeString(["%s%s", "additionalBalance", assetId], SEP)
140140
141141
142142 func keyStakingAssetBalance (assetId) = makeString(["%s%s", "stakingAssetBalance", assetId], SEP)
143143
144144
145-func getAdditionalBalance (assetId) = valueOrElse(getInteger(this, keyAdditionalBalance(assetId)), 0)
145+func getAdditionalBalanceOrZero (assetId) = valueOrElse(getInteger(this, keyAdditionalBalance(assetId)), 0)
146146
147147
148-func getStakingAssetBalance (assetId) = valueOrElse(getInteger(this, keyStakingAssetBalance(assetId)), 0)
148+func getStakingAssetBalanceOrZero (assetId) = valueOrElse(getInteger(this, keyStakingAssetBalance(assetId)), 0)
149149
150150
151151 func keyFactoryConfig () = "%s__factoryConfig"
152152
153153
154154 func keyMatcherPub () = "%s%s__matcher__publicKey"
155155
156156
157157 func keyMappingPoolContractAddressToPoolAssets (poolContractAddress) = (("%s%s%s__" + poolContractAddress) + "__mappings__poolContract2LpAsset")
158158
159159
160160 func keyPoolConfig (iAmtAsset,iPriceAsset) = (((("%d%d%s__" + iAmtAsset) + "__") + iPriceAsset) + "__config")
161161
162162
163163 func keyMappingsBaseAsset2internalId (baseAssetStr) = ("%s%s%s__mappings__baseAsset2internalId__" + baseAssetStr)
164164
165165
166166 func keyAllPoolsShutdown () = "%s__shutdown"
167167
168168
169169 func keyPoolWeight (contractAddress) = ("%s%s__poolWeight__" + contractAddress)
170170
171171
172172 func keyAllowedLpScriptHash () = "%s__allowedLpScriptHash"
173173
174174
175175 let keyFeeCollectorAddress = "%s__feeCollectorAddress"
176176
177177 func throwOrderError (orderValid,orderValidInfo,senderValid,matcherValid) = throw((((((((("order validation failed: orderValid=" + toString(orderValid)) + " (") + orderValidInfo) + ")") + " senderValid=") + toString(senderValid)) + " matcherValid=") + toString(matcherValid)))
178178
179179
180180 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
181181
182182
183183 func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
184184
185185
186186 func throwErr (msg) = throw(makeString(["lp.ride:", msg], " "))
187187
188188
189189 func fmtErr (msg) = makeString(["lp.ride:", msg], " ")
190190
191191
192192 let factoryContract = addressFromStringValue(getStringOrFail(this, fc()))
193193
194194 let feeCollectorAddress = addressFromStringValue(getStringOrFail(factoryContract, keyFeeCollectorAddress))
195195
196196 let inFee = {
197197 let @ = invoke(factoryContract, "getInFeeREADONLY", [toString(this)], nil)
198198 if ($isInstanceOf(@, "Int"))
199199 then @
200200 else throw(($getType(@) + " couldn't be cast to Int"))
201201 }
202202
203203 let outFee = {
204204 let @ = invoke(factoryContract, "getOutFeeREADONLY", [toString(this)], nil)
205205 if ($isInstanceOf(@, "Int"))
206206 then @
207207 else throw(($getType(@) + " couldn't be cast to Int"))
208208 }
209209
210210 func sWavesId () = getStringOrFail(factoryContract, keySWavesAssetId())
211211
212212
213213 func sWavesProxy () = getStringOrFail(factoryContract, keySWavesProxyAddress())
214214
215215
216216 func isGlobalShutdown () = valueOrElse(getBoolean(factoryContract, keyAllPoolsShutdown()), false)
217217
218218
219219 func getMatcherPubOrFail () = fromBase58String(getStringOrFail(factoryContract, keyMatcherPub()))
220220
221221
222222 func getPoolConfig () = {
223223 let amtAsset = getStringOrFail(this, aa())
224224 let priceAsset = getStringOrFail(this, pa())
225225 let iPriceAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(priceAsset))
226226 let iAmtAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(amtAsset))
227227 split(getStringOrFail(factoryContract, keyPoolConfig(toString(iAmtAsset), toString(iPriceAsset))), SEP)
228228 }
229229
230230
231231 func parseAssetId (input) = if ((input == wavesString))
232232 then unit
233233 else fromBase58String(input)
234234
235235
236236 func assetIdToString (input) = if ((input == unit))
237237 then wavesString
238238 else toBase58String(value(input))
239239
240240
241241 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]))
242242
243243
244244 let poolConfigParsed = parsePoolConfig(getPoolConfig())
245245
246-let $t092859451 = poolConfigParsed
246+let $t092979463 = poolConfigParsed
247247
248-let cfgPoolAddress = $t092859451._1
248+let cfgPoolAddress = $t092979463._1
249249
250-let cfgPoolStatus = $t092859451._2
250+let cfgPoolStatus = $t092979463._2
251251
252-let cfgLpAssetId = $t092859451._3
252+let cfgLpAssetId = $t092979463._3
253253
254-let cfgAmountAssetId = $t092859451._4
254+let cfgAmountAssetId = $t092979463._4
255255
256-let cfgPriceAssetId = $t092859451._5
256+let cfgPriceAssetId = $t092979463._5
257257
258-let cfgAmountAssetDecimals = $t092859451._6
258+let cfgAmountAssetDecimals = $t092979463._6
259259
260-let cfgPriceAssetDecimals = $t092859451._7
260+let cfgPriceAssetDecimals = $t092979463._7
261261
262262 func getFactoryConfig () = split(getStringOrFail(factoryContract, keyFactoryConfig()), SEP)
263263
264264
265265 let stakingContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactoryStakingContract]), "incorrect staking address")
266266
267267 let slippageContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactorySlippageContract]), "incorrect staking address")
268268
269269 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)
270270
271271
272272 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)
273273
274274
275-func getAccBalance (assetId) = if ((assetId == "WAVES"))
276- then (wavesBalance(this).available + getAdditionalBalance(assetId))
277- else if ((assetId == sWavesId()))
278- then {
279- let amtAsset = getStringOrFail(this, aa())
280- let priceAsset = getStringOrFail(this, pa())
281- if (if (if ((amtAsset == "WAVES"))
282- then (priceAsset == sWavesId())
283- else false)
284- then true
285- else if ((priceAsset == "WAVES"))
286- then (amtAsset == sWavesId())
287- else false)
288- then assetBalance(this, fromBase58String(assetId))
289- else (assetBalance(this, fromBase58String(assetId)) + getStakingAssetBalance(assetId))
290- }
275+func getAccBalance (assetId) = {
276+ let balanceOnPool = if ((assetId == "WAVES"))
277+ then wavesBalance(this).available
291278 else assetBalance(this, fromBase58String(assetId))
279+ let totalBalance = ((balanceOnPool + getAdditionalBalanceOrZero(assetId)) - getStakingAssetBalanceOrZero(assetId))
280+ max([0, totalBalance])
281+ }
292282
293283
294284 func calcPriceBigInt (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18)
295285
296286
297287 func calcPriceBigIntRound (prAmtX18,amAmtX18,round) = fraction(prAmtX18, scale18, amAmtX18, round)
298288
299289
300290 func getRate (proxy) = {
301291 let inv = invoke(proxy, "getRate", nil, nil)
302292 if ((inv == inv))
303293 then match inv {
304294 case r: Int =>
305295 r
306296 case _ =>
307297 throwErr("proxy.getRate() unexpected value")
308298 }
309299 else throw("Strict value is not equal to itself.")
310300 }
311301
312302
313303 func deposit (assetId,amount,stakingAssetId,proxy) = {
314- let currentAdditionalBalance = getAdditionalBalance(assetId)
304+ let currentAdditionalBalance = getAdditionalBalanceOrZero(assetId)
315305 if ((currentAdditionalBalance == currentAdditionalBalance))
316306 then {
317- let currentStakingAssetBalance = getStakingAssetBalance(stakingAssetId)
307+ let currentStakingAssetBalance = getStakingAssetBalanceOrZero(stakingAssetId)
318308 if ((currentStakingAssetBalance == currentStakingAssetBalance))
319309 then {
320310 let asset = parseAssetId(assetId)
321311 if ((amount > 0))
322312 then {
323313 let depositInvoke = invoke(proxy, "deposit", nil, [AttachedPayment(asset, amount)])
324314 if ((depositInvoke == depositInvoke))
325315 then match depositInvoke {
326316 case receivedStakingAsset: Int =>
327317 let newAdditionalBalance = (currentAdditionalBalance + amount)
328318 let newStakingAssetBalance = (currentStakingAssetBalance + receivedStakingAsset)
329319 [IntegerEntry(keyAdditionalBalance(assetId), newAdditionalBalance), IntegerEntry(keyStakingAssetBalance(stakingAssetId), newStakingAssetBalance)]
330320 case _ =>
331321 nil
332322 }
333323 else throw("Strict value is not equal to itself.")
334324 }
335325 else nil
336326 }
337327 else throw("Strict value is not equal to itself.")
338328 }
339329 else throw("Strict value is not equal to itself.")
340330 }
341331
342332
343333 func withdraw (assetId,amount,stakingAssetId,proxy,proxyRateMul,profitAddress) = {
344- let currentAdditionalBalance = getAdditionalBalance(assetId)
334+ let currentAdditionalBalance = getAdditionalBalanceOrZero(assetId)
345335 if ((currentAdditionalBalance == currentAdditionalBalance))
346336 then {
347- let currentStakingAssetBalance = getStakingAssetBalance(stakingAssetId)
337+ let currentStakingAssetBalance = getStakingAssetBalanceOrZero(stakingAssetId)
348338 if ((currentStakingAssetBalance == currentStakingAssetBalance))
349339 then {
350340 let currentProxyRate = getRate(proxy)
351341 if ((currentProxyRate == currentProxyRate))
352342 then {
353343 let oldRate = fraction(proxyRateMul, currentAdditionalBalance, currentStakingAssetBalance)
354344 let stakingAsset = parseAssetId(stakingAssetId)
355345 let oldSendStakingAmount = fraction(proxyRateMul, amount, oldRate)
356346 let sendStakingAssetAmount = fraction(proxyRateMul, amount, currentProxyRate)
357347 let profitAmount = max([0, (oldSendStakingAmount - sendStakingAssetAmount)])
358348 if ((sendStakingAssetAmount > 0))
359349 then {
360350 let withdrawInvoke = invoke(proxy, "withdraw", nil, [AttachedPayment(stakingAsset, sendStakingAssetAmount)])
361351 if ((withdrawInvoke == withdrawInvoke))
362352 then match withdrawInvoke {
363353 case receivedAssets: Int =>
364354 let newAdditionalBalance = (currentAdditionalBalance - receivedAssets)
365355 let newStakingAssetBalance = ((currentStakingAssetBalance - sendStakingAssetAmount) - profitAmount)
366356 [IntegerEntry(keyAdditionalBalance(assetId), newAdditionalBalance), IntegerEntry(keyStakingAssetBalance(stakingAssetId), newStakingAssetBalance), ScriptTransfer(profitAddress, profitAmount, parseAssetId(stakingAssetId))]
367357 case _ =>
368358 nil
369359 }
370360 else throw("Strict value is not equal to itself.")
371361 }
372362 else nil
373363 }
374364 else throw("Strict value is not equal to itself.")
375365 }
376366 else throw("Strict value is not equal to itself.")
377367 }
378368 else throw("Strict value is not equal to itself.")
379369 }
380370
381371
382372 func getLeaseProxyConfig (assetId) = invoke(factoryContract, "getPoolLeaseConfigREADONLY", [toString(this), assetId], nil)
383373
384374
385375 func rebalanceInternal (targetRatio,assetId,stakingAssetId,minBalance,proxy,proxyRateMul,profitAddress) = {
386- let currentAdditionalBalance = getAdditionalBalance(assetId)
376+ let currentAdditionalBalance = getAdditionalBalanceOrZero(assetId)
387377 if ((currentAdditionalBalance == currentAdditionalBalance))
388378 then {
389- let currentStakingAssetBalance = getStakingAssetBalance(stakingAssetId)
379+ let currentStakingAssetBalance = getStakingAssetBalanceOrZero(stakingAssetId)
390380 if ((currentStakingAssetBalance == currentStakingAssetBalance))
391381 then {
392382 let availableBalance = match parseAssetId(assetId) {
393383 case b: ByteVector =>
394384 assetBalance(this, b)
395385 case u: Unit =>
396386 wavesBalance(this).available
397387 case _ =>
398388 throw("Match error")
399389 }
400390 if ((availableBalance == availableBalance))
401391 then {
402392 let wholeBalance = max([0, ((availableBalance + currentAdditionalBalance) - minBalance)])
403393 let targetAdditionalBalance = fraction(targetRatio, wholeBalance, 100)
404394 let diff = (currentAdditionalBalance - targetAdditionalBalance)
405395 if ((diff == 0))
406396 then nil
407397 else if ((0 > diff))
408398 then {
409399 let sendAssetAmount = -(diff)
410400 deposit(assetId, sendAssetAmount, stakingAssetId, proxy)
411401 }
412402 else {
413403 let getAssetAmount = diff
414404 withdraw(assetId, getAssetAmount, stakingAssetId, proxy, proxyRateMul, profitAddress)
415405 }
416406 }
417407 else throw("Strict value is not equal to itself.")
418408 }
419409 else throw("Strict value is not equal to itself.")
420410 }
421411 else throw("Strict value is not equal to itself.")
422412 }
423413
424414
425415 func rebalanceAsset (assetId) = match getLeaseProxyConfig(assetId) {
426416 case a: (Boolean, Int, Int, String, String, Int, String) =>
427- let $t01605416163 = a
428- let isLeasable = $t01605416163._1
429- let leasedRatio = $t01605416163._2
430- let minBalance = $t01605416163._3
431- let proxyAddress = $t01605416163._4
432- let proxyAssetId = $t01605416163._5
433- let proxyRateMul = $t01605416163._6
434- let stakingProfitAddress = $t01605416163._7
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
435425 if (isLeasable)
436426 then rebalanceInternal(leasedRatio, assetId, proxyAssetId, minBalance, addressFromStringValue(proxyAddress), proxyRateMul, addressFromStringValue(stakingProfitAddress))
437427 else nil
438428 case _ =>
439429 throwErr((("[" + assetId) + "] Rebalance error"))
440430 }
441431
442432
443433 func withdrawAssetWrapper (assetId,amount) = match getLeaseProxyConfig(assetId) {
444434 case a: (Boolean, Int, Int, String, String, Int, String) =>
445- let $t01669316802 = a
446- let isLeasable = $t01669316802._1
447- let leasedRatio = $t01669316802._2
448- let minBalance = $t01669316802._3
449- let proxyAddress = $t01669316802._4
450- let proxyAssetId = $t01669316802._5
451- let proxyRateMul = $t01669316802._6
452- let stakingProfitAddress = $t01669316802._7
435+ let $t01645316562 = a
436+ let isLeasable = $t01645316562._1
437+ let leasedRatio = $t01645316562._2
438+ let minBalance = $t01645316562._3
439+ let proxyAddress = $t01645316562._4
440+ let proxyAssetId = $t01645316562._5
441+ let proxyRateMul = $t01645316562._6
442+ let stakingProfitAddress = $t01645316562._7
453443 if (isLeasable)
454444 then withdraw(assetId, amount, proxyAssetId, addressFromStringValue(proxyAddress), proxyRateMul, addressFromStringValue(stakingProfitAddress))
455445 else nil
456446 case _ =>
457447 throwErr((("[" + assetId) + "] withdrawAssetWrapper() error"))
458448 }
459449
460450
461451 func getWithdrawAssetState (assetId,amount) = {
462452 let assetOnPool = match parseAssetId(assetId) {
463453 case b: ByteVector =>
464454 assetBalance(this, b)
465455 case w: Unit =>
466456 wavesBalance(this).available
467457 case _ =>
468458 throw("Match error")
469459 }
470460 if ((amount > assetOnPool))
471461 then {
472462 let amountDiff = (amount - assetOnPool)
473463 withdrawAssetWrapper(assetId, amountDiff)
474464 }
475465 else nil
476466 }
477467
478468
479469 func privateCalcPrice (amAssetDcm,prAssetDcm,amAmt,prAmt) = {
480470 let amtAssetAmtX18 = toX18(amAmt, amAssetDcm)
481471 let priceAssetAmtX18 = toX18(prAmt, prAssetDcm)
482472 calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
483473 }
484474
485475
486476 func calcPrices (amAmt,prAmt,lpAmt) = {
487477 let cfg = getPoolConfig()
488478 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
489479 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
490480 let priceX18 = privateCalcPrice(amtAssetDcm, priceAssetDcm, amAmt, prAmt)
491481 let amAmtX18 = toX18(amAmt, amtAssetDcm)
492482 let prAmtX18 = toX18(prAmt, priceAssetDcm)
493483 let lpAmtX18 = toX18(lpAmt, scale8)
494484 let lpPriceInAmAssetX18 = calcPriceBigInt(amAmtX18, lpAmtX18)
495485 let lpPriceInPrAssetX18 = calcPriceBigInt(prAmtX18, lpAmtX18)
496486 [priceX18, lpPriceInAmAssetX18, lpPriceInPrAssetX18]
497487 }
498488
499489
500490 func calculatePrices (amAmt,prAmt,lpAmt) = {
501491 let prices = calcPrices(amAmt, prAmt, lpAmt)
502492 [fromX18(prices[0], scale8), fromX18(prices[1], scale8), fromX18(prices[2], scale8)]
503493 }
504494
505495
506496 func estimateGetOperation (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
507497 let cfg = getPoolConfig()
508498 let lpAssetId = cfg[idxPoolLPAssetId]
509499 let amAssetId = cfg[idxAmtAssetId]
510500 let prAssetId = cfg[idxPriceAssetId]
511501 let amAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
512502 let prAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
513503 let poolStatus = cfg[idxPoolStatus]
514504 let lpEmission = valueOrErrorMessage(assetInfo(fromBase58String(lpAssetId)), (("Asset " + lpAssetId) + " doesn't exist")).quantity
515505 if ((lpAssetId != pmtAssetId))
516506 then throw("Invalid asset passed.")
517507 else {
518508 let amBalance = getAccBalance(amAssetId)
519509 let amBalanceX18 = toX18(amBalance, amAssetDcm)
520510 let prBalance = getAccBalance(prAssetId)
521511 let prBalanceX18 = toX18(prBalance, prAssetDcm)
522512 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
523513 let curPrice = fromX18(curPriceX18, scale8)
524514 let pmtLpAmtX18 = toX18(pmtLpAmt, scale8)
525515 let lpEmissionX18 = toX18(lpEmission, scale8)
526516 let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissionX18)
527517 let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissionX18)
528518 let outAmAmt = fromX18Round(outAmAmtX18, amAssetDcm, FLOOR)
529519 let outPrAmt = fromX18Round(outPrAmtX18, prAssetDcm, FLOOR)
530520 let AmAmtWithdrawState = getWithdrawAssetState(amAssetId, outAmAmt)
531521 if ((AmAmtWithdrawState == AmAmtWithdrawState))
532522 then {
533523 let PrAmtWithdrawState = getWithdrawAssetState(prAssetId, outPrAmt)
534524 if ((PrAmtWithdrawState == PrAmtWithdrawState))
535525 then {
536526 let reb = invoke(this, "rebalance", nil, nil)
537527 if ((reb == reb))
538528 then {
539529 let state = if ((txId58 == ""))
540530 then nil
541531 else ((AmAmtWithdrawState ++ PrAmtWithdrawState) ++ [ScriptTransfer(userAddress, outAmAmt, if ((amAssetId == "WAVES"))
542532 then unit
543533 else fromBase58String(amAssetId)), ScriptTransfer(userAddress, outPrAmt, if ((prAssetId == "WAVES"))
544534 then unit
545535 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)])
546536 $Tuple10(outAmAmt, outPrAmt, amAssetId, prAssetId, amBalance, prBalance, lpEmission, curPriceX18, poolStatus, state)
547537 }
548538 else throw("Strict value is not equal to itself.")
549539 }
550540 else throw("Strict value is not equal to itself.")
551541 }
552542 else throw("Strict value is not equal to itself.")
553543 }
554544 }
555545
556546
557547 func estimatePutOperation (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = {
558548 let cfg = getPoolConfig()
559549 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
560550 let amAssetIdStr = cfg[idxAmtAssetId]
561551 let prAssetIdStr = cfg[idxPriceAssetId]
562552 let iAmtAssetId = cfg[idxIAmtAssetId]
563553 let iPriceAssetId = cfg[idxIPriceAssetId]
564554 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
565555 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
566556 let poolStatus = cfg[idxPoolStatus]
567557 let lpEmission = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
568558 let inAmAssetIdStr = toBase58String(valueOrElse(inAmAssetId, fromBase58String("WAVES")))
569559 let inPrAssetIdStr = toBase58String(valueOrElse(inPrAssetId, fromBase58String("WAVES")))
570560 if (if ((amAssetIdStr != inAmAssetIdStr))
571561 then true
572562 else (prAssetIdStr != inPrAssetIdStr))
573563 then throw("Invalid amt or price asset passed.")
574564 else {
575565 let amBalance = if (isEvaluate)
576566 then getAccBalance(amAssetIdStr)
577567 else (getAccBalance(amAssetIdStr) - inAmAssetAmt)
578568 let prBalance = if (isEvaluate)
579569 then getAccBalance(prAssetIdStr)
580570 else (getAccBalance(prAssetIdStr) - inPrAssetAmt)
581571 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
582572 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
583573 let userPriceX18 = calcPriceBigInt(inPrAssetAmtX18, inAmAssetAmtX18)
584574 let amBalanceX18 = toX18(amBalance, amtAssetDcm)
585575 let prBalanceX18 = toX18(prBalance, priceAssetDcm)
586576 let res = if ((lpEmission == 0))
587577 then {
588578 let curPriceX18 = zeroBigInt
589579 let slippageX18 = zeroBigInt
590580 let lpAmtX18 = pow((inAmAssetAmtX18 * inPrAssetAmtX18), 0, toBigInt(5), 1, 0, DOWN)
591581 $Tuple5(fromX18(lpAmtX18, scale8), fromX18(inAmAssetAmtX18, amtAssetDcm), fromX18(inPrAssetAmtX18, priceAssetDcm), calcPriceBigInt((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18)
592582 }
593583 else {
594584 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
595585 let slippageX18 = fraction(absBigInt((curPriceX18 - userPriceX18)), scale18, curPriceX18)
596586 let slippageToleranceX18 = toX18(slippageTolerance, scale8)
597587 if (if ((curPriceX18 != zeroBigInt))
598588 then (slippageX18 > slippageToleranceX18)
599589 else false)
600590 then throw(((("Price slippage " + toString(slippageX18)) + " exceeded the passed limit of ") + toString(slippageToleranceX18)))
601591 else {
602592 let lpEmissionX18 = toX18(lpEmission, scale8)
603593 let prViaAmX18 = fraction(inAmAssetAmtX18, calcPriceBigIntRound(prBalanceX18, amBalanceX18, CEILING), scale18, CEILING)
604594 let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, calcPriceBigIntRound(prBalanceX18, amBalanceX18, FLOOR), CEILING)
605595 let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18))
606596 then $Tuple2(amViaPrX18, inPrAssetAmtX18)
607597 else $Tuple2(inAmAssetAmtX18, prViaAmX18)
608598 let expAmtAssetAmtX18 = expectedAmts._1
609599 let expPriceAssetAmtX18 = expectedAmts._2
610600 let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18, FLOOR)
611601 $Tuple5(fromX18Round(lpAmtX18, scale8, FLOOR), fromX18Round(expAmtAssetAmtX18, amtAssetDcm, CEILING), fromX18Round(expPriceAssetAmtX18, priceAssetDcm, CEILING), curPriceX18, slippageX18)
612602 }
613603 }
614604 let calcLpAmt = res._1
615605 let calcAmAssetPmt = res._2
616606 let calcPrAssetPmt = res._3
617607 let curPrice = fromX18(res._4, scale8)
618608 let slippageCalc = fromX18(res._5, scale8)
619609 if ((0 >= calcLpAmt))
620610 then throw("Invalid calculations. LP calculated is less than zero.")
621611 else {
622612 let emitLpAmt = if (!(emitLp))
623613 then 0
624614 else calcLpAmt
625615 let amDiff = (inAmAssetAmt - calcAmAssetPmt)
626616 let prDiff = (inPrAssetAmt - calcPrAssetPmt)
627617 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))]
628618 $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEmission, lpAssetId, poolStatus, commonState, amDiff, prDiff, inAmAssetId, inPrAssetId)
629619 }
630620 }
631621 }
632622
633623
634624 func calcKLp (amountBalance,priceBalance,lpEmission) = {
635625 let amountBalanceX18 = toX18BigInt(amountBalance, toBigInt(cfgAmountAssetDecimals))
636626 let priceBalanceX18 = toX18BigInt(priceBalance, toBigInt(cfgPriceAssetDecimals))
637627 let updatedKLp = fraction(pow((amountBalanceX18 * priceBalanceX18), 0, toBigInt(5), 1, 18, DOWN), big1, lpEmission)
638628 if ((lpEmission == big0))
639629 then big0
640630 else updatedKLp
641631 }
642632
643633
644634 func calcCurrentKLp (amountAssetDelta,priceAssetDelta,lpAssetEmissionDelta) = {
645635 let amountAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) - amountAssetDelta)
646636 let priceAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) - priceAssetDelta)
647637 let lpAssetEmission = (toBigInt(value(assetInfo(cfgLpAssetId)).quantity) - lpAssetEmissionDelta)
648638 let currentKLp = calcKLp(amountAssetBalance, priceAssetBalance, lpAssetEmission)
649639 currentKLp
650640 }
651641
652642
653643 func refreshKLpInternal (amountAssetBalanceDelta,priceAssetBalanceDelta,lpAssetEmissionDelta) = {
654644 let amountAssetBalance = (getAccBalance(assetIdToString(cfgAmountAssetId)) + amountAssetBalanceDelta)
655645 let priceAssetBalance = (getAccBalance(assetIdToString(cfgPriceAssetId)) + priceAssetBalanceDelta)
656646 let lpAssetEmission = (value(assetInfo(cfgLpAssetId)).quantity + lpAssetEmissionDelta)
657647 let updatedKLp = calcKLp(toBigInt(amountAssetBalance), toBigInt(priceAssetBalance), toBigInt(lpAssetEmission))
658648 let actions = [IntegerEntry(keyKLpRefreshedHeight, height), StringEntry(keyKLp, toString(updatedKLp))]
659649 $Tuple2(actions, updatedKLp)
660650 }
661651
662652
663653 func validateUpdatedKLp (oldKLp,updatedKLp) = if ((updatedKLp >= oldKLp))
664654 then true
665655 else throwErr(makeString(["updated KLp lower than current KLp", toString(oldKLp), toString(updatedKLp)], " "))
666656
667657
668658 func validateMatcherOrderAllowed (order) = {
669659 let amountAssetBalance = getAccBalance(assetIdToString(cfgAmountAssetId))
670660 let priceAssetBalance = getAccBalance(assetIdToString(cfgPriceAssetId))
671661 let amountAssetAmount = order.amount
672662 let priceAssetAmount = fraction(order.amount, order.price, scale8, FLOOR)
673- let $t02904029252 = if ((order.orderType == Buy))
663+ let $t02880029012 = if ((order.orderType == Buy))
674664 then $Tuple2(amountAssetAmount, -(priceAssetAmount))
675665 else $Tuple2(-(amountAssetAmount), priceAssetAmount)
676- let amountAssetBalanceDelta = $t02904029252._1
677- let priceAssetBalanceDelta = $t02904029252._2
666+ let amountAssetBalanceDelta = $t02880029012._1
667+ let priceAssetBalanceDelta = $t02880029012._2
678668 if (if (if (isGlobalShutdown())
679669 then true
680670 else (cfgPoolStatus == PoolMatcherDisabled))
681671 then true
682672 else (cfgPoolStatus == PoolShutdown))
683673 then throw("Exchange operations disabled")
684674 else if (if ((order.assetPair.amountAsset != cfgAmountAssetId))
685675 then true
686676 else (order.assetPair.priceAsset != cfgPriceAssetId))
687677 then throw("Wrong order assets.")
688678 else {
689679 let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
690- let $t02969229792 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
691- let unusedActions = $t02969229792._1
692- let kLpNew = $t02969229792._2
680+ let $t02945229552 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
681+ let unusedActions = $t02945229552._1
682+ let kLpNew = $t02945229552._2
693683 let isOrderValid = (kLpNew >= kLp)
694684 let info = makeString(["kLp=", toString(kLp), " kLpNew=", toString(kLpNew), " amountAssetBalance=", toString(amountAssetBalance), " priceAssetBalance=", toString(priceAssetBalance), " amountAssetBalanceDelta=", toString(amountAssetBalanceDelta), " priceAssetBalanceDelta=", toString(priceAssetBalanceDelta), " height=", toString(height)], "")
695685 $Tuple2(isOrderValid, info)
696686 }
697687 }
698688
699689
700690 func commonGet (i) = if ((size(i.payments) != 1))
701691 then throw("exactly 1 payment is expected")
702692 else {
703693 let pmt = value(i.payments[0])
704694 let pmtAssetId = value(pmt.assetId)
705695 let pmtAmt = pmt.amount
706696 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller)
707697 let outAmAmt = res._1
708698 let outPrAmt = res._2
709699 let poolStatus = parseIntValue(res._9)
710700 let state = res._10
711701 if (if (isGlobalShutdown())
712702 then true
713703 else (poolStatus == PoolShutdown))
714704 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
715705 else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state)
716706 }
717707
718708
719709 func commonPut (i,slippageTolerance,emitLp) = if ((size(i.payments) != 2))
720710 then throw("exactly 2 payments are expected")
721711 else {
722712 let amAssetPmt = value(i.payments[0])
723713 let prAssetPmt = value(i.payments[1])
724714 let estPut = estimatePutOperation(toBase58String(i.transactionId), slippageTolerance, amAssetPmt.amount, amAssetPmt.assetId, prAssetPmt.amount, prAssetPmt.assetId, toString(i.caller), false, emitLp)
725715 let poolStatus = parseIntValue(estPut._8)
726716 if (if (if (isGlobalShutdown())
727717 then true
728718 else (poolStatus == PoolPutDisabled))
729719 then true
730720 else (poolStatus == PoolShutdown))
731721 then throw(("Put operation is blocked by admin. Status = " + toString(poolStatus)))
732722 else estPut
733723 }
734724
735725
736726 func emit (amount) = {
737727 let emitInv = invoke(factoryContract, "emit", [amount], nil)
738728 if ((emitInv == emitInv))
739729 then {
740730 let emitInvLegacy = match emitInv {
741731 case legacyFactoryContract: Address =>
742732 invoke(legacyFactoryContract, "emit", [amount], nil)
743733 case _ =>
744734 unit
745735 }
746736 if ((emitInvLegacy == emitInvLegacy))
747737 then amount
748738 else throw("Strict value is not equal to itself.")
749739 }
750740 else throw("Strict value is not equal to itself.")
751741 }
752742
753743
754744 func takeFee (amount,fee) = {
755745 let feeAmount = if ((fee == 0))
756746 then 0
757747 else fraction(amount, fee, scale8)
758748 $Tuple2((amount - feeAmount), feeAmount)
759749 }
760750
761751
762752 func calcPutOneToken (paymentAmountRaw,paymentAssetId,userAddress,txId) = {
763753 let isEval = (txId == unit)
764754 let amountBalanceRaw = getAccBalance(assetIdToString(cfgAmountAssetId))
765755 let priceBalanceRaw = getAccBalance(assetIdToString(cfgPriceAssetId))
766756 let paymentInAmountAsset = if ((paymentAssetId == cfgAmountAssetId))
767757 then true
768758 else if ((paymentAssetId == cfgPriceAssetId))
769759 then false
770760 else throwErr("invalid asset")
771- let $t03290533198 = if (isEval)
761+ let $t03266532958 = if (isEval)
772762 then $Tuple2(amountBalanceRaw, priceBalanceRaw)
773763 else if (paymentInAmountAsset)
774764 then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw)
775765 else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw))
776- let amountBalanceOld = $t03290533198._1
777- let priceBalanceOld = $t03290533198._2
778- let $t03320233351 = if (paymentInAmountAsset)
766+ let amountBalanceOld = $t03266532958._1
767+ let priceBalanceOld = $t03266532958._2
768+ let $t03296233111 = if (paymentInAmountAsset)
779769 then $Tuple2(paymentAmountRaw, 0)
780770 else $Tuple2(0, paymentAmountRaw)
781- let amountAssetAmountRaw = $t03320233351._1
782- let priceAssetAmountRaw = $t03320233351._2
771+ let amountAssetAmountRaw = $t03296233111._1
772+ let priceAssetAmountRaw = $t03296233111._2
783773 let amountAssetAmount = takeFee(amountAssetAmountRaw, inFee)._1
784774 let priceAssetAmount = takeFee(priceAssetAmountRaw, inFee)._1
785- let $t03348333547 = takeFee(paymentAmountRaw, inFee)
786- let paymentAmount = $t03348333547._1
787- let feeAmount = $t03348333547._2
775+ let $t03324333307 = takeFee(paymentAmountRaw, inFee)
776+ let paymentAmount = $t03324333307._1
777+ let feeAmount = $t03324333307._2
788778 let amountBalanceNew = (amountBalanceOld + amountAssetAmount)
789779 let priceBalanceNew = (priceBalanceOld + priceAssetAmount)
790780 let priceNewX18 = calcPriceBigInt(toX18(priceBalanceNew, cfgPriceAssetDecimals), toX18(amountBalanceNew, cfgAmountAssetDecimals))
791781 let priceNew = fromX18(priceNewX18, scale8)
792782 let paymentBalance = if (paymentInAmountAsset)
793783 then amountBalanceOld
794784 else priceBalanceOld
795785 let paymentBalanceBigInt = toBigInt(paymentBalance)
796786 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
797787 let chechSupply = if ((supplyBigInt > big0))
798788 then true
799789 else throwErr("initial deposit requires all coins")
800790 if ((chechSupply == chechSupply))
801791 then {
802792 let depositBigInt = toBigInt(paymentAmount)
803793 let issueAmount = max([0, toInt(((supplyBigInt * (sqrtBigInt((scale18 + ((depositBigInt * scale18) / paymentBalanceBigInt)), 18, 18, DOWN) - scale18)) / scale18))])
804794 let commonState = if (isEval)
805795 then nil
806796 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))]
807797 let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, cfgPriceAssetDecimals), toX18(amountBalanceOld, cfgAmountAssetDecimals))
808798 let priceOld = fromX18(priceOldX18, scale8)
809799 let loss = {
810- let $t03522835395 = if (paymentInAmountAsset)
800+ let $t03498835155 = if (paymentInAmountAsset)
811801 then $Tuple2(amountAssetAmountRaw, amountBalanceOld)
812802 else $Tuple2(priceAssetAmountRaw, priceBalanceOld)
813- let amount = $t03522835395._1
814- let balance = $t03522835395._2
803+ let amount = $t03498835155._1
804+ let balance = $t03498835155._2
815805 let issueAmountBoth = toInt(fraction(supplyBigInt, toBigInt((amount / 2)), toBigInt(balance)))
816806 fraction((issueAmount - issueAmountBoth), scale8, issueAmountBoth)
817807 }
818808 $Tuple5(issueAmount, commonState, feeAmount, loss, paymentInAmountAsset)
819809 }
820810 else throw("Strict value is not equal to itself.")
821811 }
822812
823813
824814 func calcGetOneToken (outAssetId,paymentAmount,paymentAssetId,userAddress,txId) = {
825815 let isEval = (txId == unit)
826816 let cfg = getPoolConfig()
827817 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
828818 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
829819 let checks = [if ((paymentAssetId == cfgLpAssetId))
830820 then true
831821 else throwErr("invalid lp asset")]
832822 if ((checks == checks))
833823 then {
834824 let outInAmountAsset = if ((outAssetId == cfgAmountAssetId))
835825 then true
836826 else if ((outAssetId == cfgPriceAssetId))
837827 then false
838828 else throwErr("invalid asset")
839829 let balanceBigInt = if (outInAmountAsset)
840830 then toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId)))
841831 else toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId)))
842832 let outInAmountAssetDecimals = if (outInAmountAsset)
843833 then amtAssetDcm
844834 else priceAssetDcm
845835 let amBalanceOld = getAccBalance(assetIdToString(cfgAmountAssetId))
846836 let prBalanceOld = getAccBalance(assetIdToString(cfgPriceAssetId))
847837 let outBalance = if (outInAmountAsset)
848838 then amBalanceOld
849839 else prBalanceOld
850840 let outBalanceBigInt = toBigInt(outBalance)
851841 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
852842 let redeemedBigInt = toBigInt(paymentAmount)
853843 let amountRaw = max([0, toInt(((balanceBigInt * (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN))) / scale18))])
854- let $t03747337529 = takeFee(amountRaw, outFee)
855- let totalAmount = $t03747337529._1
856- let feeAmount = $t03747337529._2
857- let $t03753337759 = if (outInAmountAsset)
844+ let $t03723337289 = takeFee(amountRaw, outFee)
845+ let totalAmount = $t03723337289._1
846+ let feeAmount = $t03723337289._2
847+ let $t03729337519 = if (outInAmountAsset)
858848 then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld)
859849 else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw))
860- let outAmAmount = $t03753337759._1
861- let outPrAmount = $t03753337759._2
862- let amBalanceNew = $t03753337759._3
863- let prBalanceNew = $t03753337759._4
850+ let outAmAmount = $t03729337519._1
851+ let outPrAmount = $t03729337519._2
852+ let amBalanceNew = $t03729337519._3
853+ let prBalanceNew = $t03729337519._4
864854 let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, cfgPriceAssetDecimals), toX18(amBalanceNew, cfgAmountAssetDecimals))
865855 let priceNew = fromX18(priceNewX18, scale8)
866856 let commonState = if (isEval)
867857 then nil
868858 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)]
869859 let priceOldX18 = calcPriceBigInt(toX18(prBalanceOld, cfgPriceAssetDecimals), toX18(amBalanceOld, cfgAmountAssetDecimals))
870860 let priceOld = fromX18(priceOldX18, scale8)
871861 let loss = {
872862 let amountBothInPaymentAsset = (toInt(fraction(balanceBigInt, redeemedBigInt, supplyBigInt)) * 2)
873863 fraction((totalAmount - amountBothInPaymentAsset), scale8, amountBothInPaymentAsset)
874864 }
875865 $Tuple5(totalAmount, commonState, feeAmount, loss, outInAmountAsset)
876866 }
877867 else throw("Strict value is not equal to itself.")
878868 }
879869
880870
881871 func managerPublicKeyOrUnit () = match getString(mpk()) {
882872 case s: String =>
883873 fromBase58String(s)
884874 case _: Unit =>
885875 unit
886876 case _ =>
887877 throw("Match error")
888878 }
889879
890880
891881 func pendingManagerPublicKeyOrUnit () = match getString(pmpk()) {
892882 case s: String =>
893883 fromBase58String(s)
894884 case _: Unit =>
895885 unit
896886 case _ =>
897887 throw("Match error")
898888 }
899889
900890
901891 func isManager (i) = match managerPublicKeyOrUnit() {
902892 case pk: ByteVector =>
903893 (i.callerPublicKey == pk)
904894 case _: Unit =>
905895 (i.caller == this)
906896 case _ =>
907897 throw("Match error")
908898 }
909899
910900
911901 func mustManager (i) = {
912902 let pd = throw("Permission denied")
913903 match managerPublicKeyOrUnit() {
914904 case pk: ByteVector =>
915905 if ((i.callerPublicKey == pk))
916906 then true
917907 else pd
918908 case _: Unit =>
919909 if ((i.caller == this))
920910 then true
921911 else pd
922912 case _ =>
923913 throw("Match error")
924914 }
925915 }
926916
927917
928918 @Callable(i)
929919 func rebalance () = (rebalanceAsset(getStringOrFail(this, aa())) ++ rebalanceAsset(getStringOrFail(this, pa())))
930920
931921
932922
933923 @Callable(i)
934924 func calculateAmountOutForSwapREADONLY (cleanAmountIn,isReverse,feePoolAmount) = {
935- let $t03964539950 = if ((isReverse == false))
925+ let $t03940539710 = if ((isReverse == false))
936926 then {
937927 let assetOut = getStringOrFail(this, pa())
938928 let assetIn = getStringOrFail(this, aa())
939929 $Tuple2(assetOut, assetIn)
940930 }
941931 else {
942932 let assetOut = getStringOrFail(this, aa())
943933 let assetIn = getStringOrFail(this, pa())
944934 $Tuple2(assetOut, assetIn)
945935 }
946- let assetOut = $t03964539950._1
947- let assetIn = $t03964539950._2
936+ let assetOut = $t03940539710._1
937+ let assetIn = $t03940539710._2
948938 let poolAssetInBalance = getAccBalance(assetIn)
949939 let poolAssetOutBalance = getAccBalance(assetOut)
950940 let amountOut = fraction(poolAssetOutBalance, cleanAmountIn, (poolAssetInBalance + cleanAmountIn))
951941 let oldK = (toBigInt(poolAssetInBalance) * toBigInt(poolAssetOutBalance))
952942 let newK = (((toBigInt(getAccBalance(assetIn)) + toBigInt(cleanAmountIn)) + toBigInt(feePoolAmount)) * (toBigInt(getAccBalance(assetOut)) - toBigInt(amountOut)))
953943 let checkK = if ((newK >= oldK))
954944 then true
955945 else throw("new K is fewer error")
956946 if ((checkK == checkK))
957947 then $Tuple2(nil, amountOut)
958948 else throw("Strict value is not equal to itself.")
959949 }
960950
961951
962952
963953 @Callable(i)
964954 func calculateAmountOutForSwapAndSendTokens (cleanAmountIn,isReverse,amountOutMin,addressTo,feePoolAmount) = {
965955 let swapContact = {
966956 let @ = invoke(factoryContract, "getSwapContractREADONLY", nil, nil)
967957 if ($isInstanceOf(@, "String"))
968958 then @
969959 else throw(($getType(@) + " couldn't be cast to String"))
970960 }
971961 let checks = [if ((value(i.payments[0]).amount >= cleanAmountIn))
972962 then true
973963 else throwErr("Wrong amount"), if ((i.caller == addressFromStringValue(swapContact)))
974964 then true
975965 else throwErr("Permission denied")]
976966 if ((checks == checks))
977967 then {
978968 let pmt = value(i.payments[0])
979969 let assetIn = assetIdToString(pmt.assetId)
980970 let assetOut = if ((isReverse == false))
981971 then getStringOrFail(this, pa())
982972 else getStringOrFail(this, aa())
983973 let poolAssetInBalance = (getAccBalance(assetIn) - value(i.payments[0]).amount)
984974 let poolAssetOutBalance = getAccBalance(assetOut)
985975 let amountOut = fraction(poolAssetOutBalance, cleanAmountIn, (poolAssetInBalance + cleanAmountIn))
986976 let oldK = (toBigInt(poolAssetInBalance) * toBigInt(poolAssetOutBalance))
987977 let newK = ((toBigInt(getAccBalance(assetIn)) + toBigInt(feePoolAmount)) * (toBigInt(getAccBalance(assetOut)) - toBigInt(amountOut)))
988978 let checkK = if ((newK >= oldK))
989979 then true
990980 else throw("new K is fewer error")
991981 if ((checkK == checkK))
992982 then {
993983 let checkMin = if ((amountOut >= amountOutMin))
994984 then true
995985 else throw("Exchange result is fewer coins than expected")
996986 if ((checkMin == checkMin))
997987 then {
998988 let lsConf = match getLeaseProxyConfig(assetOut) {
999989 case a: (Boolean, Int, Int, String, String, Int, String) =>
1000990 a
1001991 case _ =>
1002992 throw("error lease config")
1003993 }
1004994 let withdrawState = getWithdrawAssetState(assetOut, amountOut)
1005995 if ((withdrawState == withdrawState))
1006996 then {
1007997 let reb = invoke(this, "rebalance", nil, nil)
1008998 if ((reb == reb))
1009999 then $Tuple2((withdrawState ++ [ScriptTransfer(addressFromStringValue(addressTo), amountOut, parseAssetId(assetOut))]), amountOut)
10101000 else throw("Strict value is not equal to itself.")
10111001 }
10121002 else throw("Strict value is not equal to itself.")
10131003 }
10141004 else throw("Strict value is not equal to itself.")
10151005 }
10161006 else throw("Strict value is not equal to itself.")
10171007 }
10181008 else throw("Strict value is not equal to itself.")
10191009 }
10201010
10211011
10221012
10231013 @Callable(i)
10241014 func setManager (pendingManagerPublicKey) = {
10251015 let checkCaller = mustManager(i)
10261016 if ((checkCaller == checkCaller))
10271017 then {
10281018 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
10291019 if ((checkManagerPublicKey == checkManagerPublicKey))
10301020 then [StringEntry(pmpk(), pendingManagerPublicKey)]
10311021 else throw("Strict value is not equal to itself.")
10321022 }
10331023 else throw("Strict value is not equal to itself.")
10341024 }
10351025
10361026
10371027
10381028 @Callable(i)
10391029 func confirmManager () = {
10401030 let pm = pendingManagerPublicKeyOrUnit()
10411031 let hasPM = if (isDefined(pm))
10421032 then true
10431033 else throw("No pending manager")
10441034 if ((hasPM == hasPM))
10451035 then {
10461036 let checkPM = if ((i.callerPublicKey == value(pm)))
10471037 then true
10481038 else throw("You are not pending manager")
10491039 if ((checkPM == checkPM))
10501040 then [StringEntry(mpk(), toBase58String(value(pm))), DeleteEntry(pmpk())]
10511041 else throw("Strict value is not equal to itself.")
10521042 }
10531043 else throw("Strict value is not equal to itself.")
10541044 }
10551045
10561046
10571047
10581048 @Callable(i)
10591049 func put (slippageTolerance,shouldAutoStake) = if ((0 > slippageTolerance))
10601050 then throw("Invalid slippageTolerance passed")
10611051 else {
10621052 let estPut = commonPut(i, slippageTolerance, true)
10631053 let emitLpAmt = estPut._2
10641054 let lpAssetId = estPut._7
10651055 let state = estPut._9
10661056 let amDiff = estPut._10
10671057 let prDiff = estPut._11
10681058 let amId = estPut._12
10691059 let prId = estPut._13
10701060 let amAssetPmt = toBigInt(value(i.payments[0]).amount)
10711061 let prAssetPmt = toBigInt(value(i.payments[1]).amount)
10721062 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
10731063 if ((currentKLp == currentKLp))
10741064 then {
10751065 let emitInv = invoke(factoryContract, "emit", [emitLpAmt], nil)
10761066 if ((emitInv == emitInv))
10771067 then {
10781068 let emitInvLegacy = match emitInv {
10791069 case legacyFactoryContract: Address =>
10801070 invoke(legacyFactoryContract, "emit", [emitLpAmt], nil)
10811071 case _ =>
10821072 unit
10831073 }
10841074 if ((emitInvLegacy == emitInvLegacy))
10851075 then {
10861076 let slippageAInv = if ((amDiff > 0))
10871077 then invoke(slippageContract, "put", nil, [AttachedPayment(amId, amDiff)])
10881078 else nil
10891079 if ((slippageAInv == slippageAInv))
10901080 then {
10911081 let slippagePInv = if ((prDiff > 0))
10921082 then invoke(slippageContract, "put", nil, [AttachedPayment(prId, prDiff)])
10931083 else nil
10941084 if ((slippagePInv == slippagePInv))
10951085 then {
10961086 let lpTransfer = if (shouldAutoStake)
10971087 then {
10981088 let slpStakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)])
10991089 if ((slpStakeInv == slpStakeInv))
11001090 then nil
11011091 else throw("Strict value is not equal to itself.")
11021092 }
11031093 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
1104- let $t04515145613 = refreshKLpInternal(0, 0, 0)
1105- if (($t04515145613 == $t04515145613))
1094+ let $t04491145373 = refreshKLpInternal(0, 0, 0)
1095+ if (($t04491145373 == $t04491145373))
11061096 then {
1107- let updatedKLp = $t04515145613._2
1108- let refreshKLpActions = $t04515145613._1
1097+ let updatedKLp = $t04491145373._2
1098+ let refreshKLpActions = $t04491145373._1
11091099 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11101100 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11111101 then ((state ++ lpTransfer) ++ refreshKLpActions)
11121102 else throw("Strict value is not equal to itself.")
11131103 }
11141104 else throw("Strict value is not equal to itself.")
11151105 }
11161106 else throw("Strict value is not equal to itself.")
11171107 }
11181108 else throw("Strict value is not equal to itself.")
11191109 }
11201110 else throw("Strict value is not equal to itself.")
11211111 }
11221112 else throw("Strict value is not equal to itself.")
11231113 }
11241114 else throw("Strict value is not equal to itself.")
11251115 }
11261116
11271117
11281118
11291119 @Callable(i)
11301120 func putForFree (maxSlippage) = if ((0 > maxSlippage))
11311121 then throw("Invalid value passed")
11321122 else {
11331123 let estPut = commonPut(i, maxSlippage, false)
11341124 let state = estPut._9
11351125 let amAssetPmt = toBigInt(value(i.payments[0]).amount)
11361126 let prAssetPmt = toBigInt(value(i.payments[1]).amount)
11371127 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
11381128 if ((currentKLp == currentKLp))
11391129 then {
1140- let $t04617546240 = refreshKLpInternal(0, 0, 0)
1141- let refreshKLpActions = $t04617546240._1
1142- let updatedKLp = $t04617546240._2
1130+ let $t04593546000 = refreshKLpInternal(0, 0, 0)
1131+ let refreshKLpActions = $t04593546000._1
1132+ let updatedKLp = $t04593546000._2
11431133 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11441134 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11451135 then (state ++ refreshKLpActions)
11461136 else throw("Strict value is not equal to itself.")
11471137 }
11481138 else throw("Strict value is not equal to itself.")
11491139 }
11501140
11511141
11521142
11531143 @Callable(i)
11541144 func putOneTkn (minOutAmount,autoStake) = {
11551145 let isPoolOneTokenOperationsDisabled = {
11561146 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
11571147 if ($isInstanceOf(@, "Boolean"))
11581148 then @
11591149 else throw(($getType(@) + " couldn't be cast to Boolean"))
11601150 }
11611151 let isPutDisabled = if (if (if (isGlobalShutdown())
11621152 then true
11631153 else (cfgPoolStatus == PoolPutDisabled))
11641154 then true
11651155 else (cfgPoolStatus == PoolShutdown))
11661156 then true
11671157 else isPoolOneTokenOperationsDisabled
11681158 let checks = [if (if (!(isPutDisabled))
11691159 then true
11701160 else isManager(i))
11711161 then true
11721162 else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1))
11731163 then true
11741164 else throwErr("exactly 1 payment are expected")]
11751165 if ((checks == checks))
11761166 then {
11771167 let payment = i.payments[0]
11781168 let paymentAssetId = payment.assetId
11791169 let paymentAmountRaw = payment.amount
11801170 let currentKLp = if ((paymentAssetId == cfgAmountAssetId))
11811171 then calcCurrentKLp(toBigInt(paymentAmountRaw), toBigInt(0), toBigInt(0))
11821172 else if ((paymentAssetId == cfgPriceAssetId))
11831173 then calcCurrentKLp(toBigInt(0), toBigInt(paymentAmountRaw), toBigInt(0))
11841174 else throwErr("payment asset is not supported")
11851175 if ((currentKLp == currentKLp))
11861176 then {
11871177 let userAddress = i.caller
11881178 let txId = i.transactionId
1189- let $t04742847580 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
1190- if (($t04742847580 == $t04742847580))
1179+ let $t04718847340 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
1180+ if (($t04718847340 == $t04718847340))
11911181 then {
1192- let paymentInAmountAsset = $t04742847580._5
1193- let bonus = $t04742847580._4
1194- let feeAmount = $t04742847580._3
1195- let commonState = $t04742847580._2
1196- let emitAmountEstimated = $t04742847580._1
1182+ let paymentInAmountAsset = $t04718847340._5
1183+ let bonus = $t04718847340._4
1184+ let feeAmount = $t04718847340._3
1185+ let commonState = $t04718847340._2
1186+ let emitAmountEstimated = $t04718847340._1
11971187 let emitAmount = if (if ((minOutAmount > 0))
11981188 then (minOutAmount > emitAmountEstimated)
11991189 else false)
12001190 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
12011191 else emitAmountEstimated
12021192 let emitInv = emit(emitAmount)
12031193 if ((emitInv == emitInv))
12041194 then {
12051195 let lpTransfer = if (autoStake)
12061196 then {
12071197 let stakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(cfgLpAssetId, emitAmount)])
12081198 if ((stakeInv == stakeInv))
12091199 then nil
12101200 else throw("Strict value is not equal to itself.")
12111201 }
12121202 else [ScriptTransfer(i.caller, emitAmount, cfgLpAssetId)]
12131203 let sendFee = if ((feeAmount > 0))
12141204 then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
12151205 else nil
1216- let $t04816648363 = if ((this == feeCollectorAddress))
1206+ let $t04792648123 = if ((this == feeCollectorAddress))
12171207 then $Tuple2(0, 0)
12181208 else if (paymentInAmountAsset)
12191209 then $Tuple2(-(feeAmount), 0)
12201210 else $Tuple2(0, -(feeAmount))
1221- let amountAssetBalanceDelta = $t04816648363._1
1222- let priceAssetBalanceDelta = $t04816648363._2
1223- let $t04836648474 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1224- let refreshKLpActions = $t04836648474._1
1225- let updatedKLp = $t04836648474._2
1211+ let amountAssetBalanceDelta = $t04792648123._1
1212+ let priceAssetBalanceDelta = $t04792648123._2
1213+ let $t04812648234 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1214+ let refreshKLpActions = $t04812648234._1
1215+ let updatedKLp = $t04812648234._2
12261216 let kLp = value(getString(keyKLp))
12271217 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
12281218 if ((isUpdatedKLpValid == isUpdatedKLpValid))
12291219 then {
12301220 let reb = invoke(this, "rebalance", nil, nil)
12311221 if ((reb == reb))
12321222 then $Tuple2((((commonState ++ lpTransfer) ++ sendFee) ++ refreshKLpActions), emitAmount)
12331223 else throw("Strict value is not equal to itself.")
12341224 }
12351225 else throw("Strict value is not equal to itself.")
12361226 }
12371227 else throw("Strict value is not equal to itself.")
12381228 }
12391229 else throw("Strict value is not equal to itself.")
12401230 }
12411231 else throw("Strict value is not equal to itself.")
12421232 }
12431233 else throw("Strict value is not equal to itself.")
12441234 }
12451235
12461236
12471237
12481238 @Callable(i)
12491239 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
1250- let $t04882948986 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
1251- let emitAmountEstimated = $t04882948986._1
1252- let commonState = $t04882948986._2
1253- let feeAmount = $t04882948986._3
1254- let bonus = $t04882948986._4
1255- let paymentInAmountAsset = $t04882948986._5
1240+ let $t04858948746 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
1241+ let emitAmountEstimated = $t04858948746._1
1242+ let commonState = $t04858948746._2
1243+ let feeAmount = $t04858948746._3
1244+ let bonus = $t04858948746._4
1245+ let paymentInAmountAsset = $t04858948746._5
12561246 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
12571247 }
12581248
12591249
12601250
12611251 @Callable(i)
12621252 func getOneTkn (outAssetIdStr,minOutAmount) = {
12631253 let isPoolOneTokenOperationsDisabled = {
12641254 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
12651255 if ($isInstanceOf(@, "Boolean"))
12661256 then @
12671257 else throw(($getType(@) + " couldn't be cast to Boolean"))
12681258 }
12691259 let isGetDisabled = if (if (isGlobalShutdown())
12701260 then true
12711261 else (cfgPoolStatus == PoolShutdown))
12721262 then true
12731263 else isPoolOneTokenOperationsDisabled
12741264 let checks = [if (if (!(isGetDisabled))
12751265 then true
12761266 else isManager(i))
12771267 then true
12781268 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1))
12791269 then true
12801270 else throwErr("exactly 1 payment are expected")]
12811271 if ((checks == checks))
12821272 then {
12831273 let outAssetId = parseAssetId(outAssetIdStr)
12841274 let payment = i.payments[0]
12851275 let paymentAssetId = payment.assetId
12861276 let paymentAmount = payment.amount
12871277 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
12881278 if ((currentKLp == currentKLp))
12891279 then {
12901280 let userAddress = i.caller
12911281 let txId = i.transactionId
1292- let $t04987150024 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
1293- if (($t04987150024 == $t04987150024))
1282+ let $t04963149784 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
1283+ if (($t04963149784 == $t04963149784))
12941284 then {
1295- let outInAmountAsset = $t04987150024._5
1296- let bonus = $t04987150024._4
1297- let feeAmount = $t04987150024._3
1298- let commonState = $t04987150024._2
1299- let amountEstimated = $t04987150024._1
1285+ let outInAmountAsset = $t04963149784._5
1286+ let bonus = $t04963149784._4
1287+ let feeAmount = $t04963149784._3
1288+ let commonState = $t04963149784._2
1289+ let amountEstimated = $t04963149784._1
13001290 let amount = if (if ((minOutAmount > 0))
13011291 then (minOutAmount > amountEstimated)
13021292 else false)
13031293 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
13041294 else amountEstimated
13051295 let lsConf = match getLeaseProxyConfig(outAssetIdStr) {
13061296 case a: (Boolean, Int, Int, String, String, Int, String) =>
13071297 a
13081298 case _ =>
13091299 throw("error lease config")
13101300 }
13111301 let burnInv = invoke(factoryContract, "burn", [paymentAmount], [AttachedPayment(paymentAssetId, paymentAmount)])
13121302 if ((burnInv == burnInv))
13131303 then {
13141304 let withdrawState = getWithdrawAssetState(outAssetIdStr, amount)
13151305 if ((withdrawState == withdrawState))
13161306 then {
13171307 let assetTransfer = [ScriptTransfer(userAddress, amount, outAssetId)]
13181308 let sendFee = if ((feeAmount > 0))
13191309 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
13201310 else nil
1321- let $t05078051027 = {
1311+ let $t05054050787 = {
13221312 let feeAmountForCalc = if ((this == feeCollectorAddress))
13231313 then 0
13241314 else feeAmount
13251315 if (outInAmountAsset)
13261316 then $Tuple2(-((amount + feeAmountForCalc)), 0)
13271317 else $Tuple2(0, -((amount + feeAmountForCalc)))
13281318 }
1329- let amountAssetBalanceDelta = $t05078051027._1
1330- let priceAssetBalanceDelta = $t05078051027._2
1331- let $t05103051138 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1332- let refreshKLpActions = $t05103051138._1
1333- let updatedKLp = $t05103051138._2
1319+ let amountAssetBalanceDelta = $t05054050787._1
1320+ let priceAssetBalanceDelta = $t05054050787._2
1321+ let $t05079050898 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1322+ let refreshKLpActions = $t05079050898._1
1323+ let updatedKLp = $t05079050898._2
13341324 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
13351325 if ((isUpdatedKLpValid == isUpdatedKLpValid))
13361326 then {
13371327 let reb = invoke(this, "rebalance", nil, nil)
13381328 if ((reb == reb))
1339- then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
1329+ then $Tuple2(((((commonState ++ withdrawState) ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
13401330 else throw("Strict value is not equal to itself.")
13411331 }
13421332 else throw("Strict value is not equal to itself.")
13431333 }
13441334 else throw("Strict value is not equal to itself.")
13451335 }
13461336 else throw("Strict value is not equal to itself.")
13471337 }
13481338 else throw("Strict value is not equal to itself.")
13491339 }
13501340 else throw("Strict value is not equal to itself.")
13511341 }
13521342 else throw("Strict value is not equal to itself.")
13531343 }
13541344
13551345
13561346
13571347 @Callable(i)
13581348 func getOneTknREADONLY (outAssetId,paymentAmount) = {
1359- let $t05144351599 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
1360- let amountEstimated = $t05144351599._1
1361- let commonState = $t05144351599._2
1362- let feeAmount = $t05144351599._3
1363- let bonus = $t05144351599._4
1364- let outInAmountAsset = $t05144351599._5
1349+ let $t05122451380 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
1350+ let amountEstimated = $t05122451380._1
1351+ let commonState = $t05122451380._2
1352+ let feeAmount = $t05122451380._3
1353+ let bonus = $t05122451380._4
1354+ let outInAmountAsset = $t05122451380._5
13651355 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
13661356 }
13671357
13681358
13691359
13701360 @Callable(i)
13711361 func unstakeAndGetOneTkn (unstakeAmount,outAssetIdStr,minOutAmount) = {
13721362 let isPoolOneTokenOperationsDisabled = {
13731363 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
13741364 if ($isInstanceOf(@, "Boolean"))
13751365 then @
13761366 else throw(($getType(@) + " couldn't be cast to Boolean"))
13771367 }
13781368 let isGetDisabled = if (if (isGlobalShutdown())
13791369 then true
13801370 else (cfgPoolStatus == PoolShutdown))
13811371 then true
13821372 else isPoolOneTokenOperationsDisabled
13831373 let checks = [if (if (!(isGetDisabled))
13841374 then true
13851375 else isManager(i))
13861376 then true
13871377 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 0))
13881378 then true
13891379 else throwErr("no payments are expected")]
13901380 if ((checks == checks))
13911381 then {
13921382 let outAssetId = parseAssetId(outAssetIdStr)
13931383 let userAddress = i.caller
13941384 let txId = i.transactionId
13951385 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
13961386 if ((currentKLp == currentKLp))
13971387 then {
13981388 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
13991389 if ((unstakeInv == unstakeInv))
14001390 then {
1401- let $t05250452655 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1402- if (($t05250452655 == $t05250452655))
1391+ let $t05228552436 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1392+ if (($t05228552436 == $t05228552436))
14031393 then {
1404- let outInAmountAsset = $t05250452655._5
1405- let bonus = $t05250452655._4
1406- let feeAmount = $t05250452655._3
1407- let commonState = $t05250452655._2
1408- let amountEstimated = $t05250452655._1
1394+ let outInAmountAsset = $t05228552436._5
1395+ let bonus = $t05228552436._4
1396+ let feeAmount = $t05228552436._3
1397+ let commonState = $t05228552436._2
1398+ let amountEstimated = $t05228552436._1
14091399 let amount = if (if ((minOutAmount > 0))
14101400 then (minOutAmount > amountEstimated)
14111401 else false)
14121402 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
14131403 else amountEstimated
14141404 let burnInv = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
14151405 if ((burnInv == burnInv))
14161406 then {
14171407 let withdrawState = getWithdrawAssetState(outAssetIdStr, amount)
14181408 if ((withdrawState == withdrawState))
14191409 then {
14201410 let assetTransfer = [ScriptTransfer(i.caller, amount, outAssetId)]
14211411 let sendFee = if ((feeAmount > 0))
14221412 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
14231413 else nil
1424- let $t05322053467 = {
1414+ let $t05300153248 = {
14251415 let feeAmountForCalc = if ((this == feeCollectorAddress))
14261416 then 0
14271417 else feeAmount
14281418 if (outInAmountAsset)
14291419 then $Tuple2(-((amount + feeAmountForCalc)), 0)
14301420 else $Tuple2(0, -((amount + feeAmountForCalc)))
14311421 }
1432- let amountAssetBalanceDelta = $t05322053467._1
1433- let priceAssetBalanceDelta = $t05322053467._2
1434- let $t05347053578 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1435- let refreshKLpActions = $t05347053578._1
1436- let updatedKLp = $t05347053578._2
1422+ let amountAssetBalanceDelta = $t05300153248._1
1423+ let priceAssetBalanceDelta = $t05300153248._2
1424+ let $t05325153359 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1425+ let refreshKLpActions = $t05325153359._1
1426+ let updatedKLp = $t05325153359._2
14371427 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
14381428 if ((isUpdatedKLpValid == isUpdatedKLpValid))
14391429 then {
14401430 let reb = invoke(this, "rebalance", nil, nil)
14411431 if ((reb == reb))
14421432 then $Tuple2(((((commonState ++ withdrawState) ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
14431433 else throw("Strict value is not equal to itself.")
14441434 }
14451435 else throw("Strict value is not equal to itself.")
14461436 }
14471437 else throw("Strict value is not equal to itself.")
14481438 }
14491439 else throw("Strict value is not equal to itself.")
14501440 }
14511441 else throw("Strict value is not equal to itself.")
14521442 }
14531443 else throw("Strict value is not equal to itself.")
14541444 }
14551445 else throw("Strict value is not equal to itself.")
14561446 }
14571447 else throw("Strict value is not equal to itself.")
14581448 }
14591449
14601450
14611451
14621452 @Callable(i)
14631453 func get () = {
14641454 let res = commonGet(i)
14651455 let outAmtAmt = res._1
14661456 let outPrAmt = res._2
14671457 let pmtAmt = res._3
14681458 let pmtAssetId = res._4
14691459 let state = res._5
14701460 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
14711461 if ((currentKLp == currentKLp))
14721462 then {
14731463 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
14741464 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
14751465 then {
1476- let $t05459254674 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1477- let refreshKLpActions = $t05459254674._1
1478- let updatedKLp = $t05459254674._2
1466+ let $t05437354455 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1467+ let refreshKLpActions = $t05437354455._1
1468+ let updatedKLp = $t05437354455._2
14791469 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
14801470 if ((isUpdatedKLpValid == isUpdatedKLpValid))
14811471 then (state ++ refreshKLpActions)
14821472 else throw("Strict value is not equal to itself.")
14831473 }
14841474 else throw("Strict value is not equal to itself.")
14851475 }
14861476 else throw("Strict value is not equal to itself.")
14871477 }
14881478
14891479
14901480
14911481 @Callable(i)
14921482 func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = {
14931483 let res = commonGet(i)
14941484 let outAmAmt = res._1
14951485 let outPrAmt = res._2
14961486 let pmtAmt = res._3
14971487 let pmtAssetId = res._4
14981488 let state = res._5
14991489 if ((noLessThenAmtAsset > outAmAmt))
15001490 then throw(((("noLessThenAmtAsset failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset)))
15011491 else if ((noLessThenPriceAsset > outPrAmt))
15021492 then throw(((("noLessThenPriceAsset failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset)))
15031493 else {
15041494 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
15051495 if ((currentKLp == currentKLp))
15061496 then {
15071497 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
15081498 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
15091499 then {
1510- let $t05562355704 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1511- let refreshKLpActions = $t05562355704._1
1512- let updatedKLp = $t05562355704._2
1500+ let $t05540455485 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1501+ let refreshKLpActions = $t05540455485._1
1502+ let updatedKLp = $t05540455485._2
15131503 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
15141504 if ((isUpdatedKLpValid == isUpdatedKLpValid))
15151505 then (state ++ refreshKLpActions)
15161506 else throw("Strict value is not equal to itself.")
15171507 }
15181508 else throw("Strict value is not equal to itself.")
15191509 }
15201510 else throw("Strict value is not equal to itself.")
15211511 }
15221512 }
15231513
15241514
15251515
15261516 @Callable(i)
15271517 func unstakeAndGet (amount) = {
15281518 let checkPayments = if ((size(i.payments) != 0))
15291519 then throw("No payments are expected")
15301520 else true
15311521 if ((checkPayments == checkPayments))
15321522 then {
15331523 let cfg = getPoolConfig()
15341524 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
15351525 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
15361526 if ((currentKLp == currentKLp))
15371527 then {
15381528 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(lpAssetId), amount], nil)
15391529 if ((unstakeInv == unstakeInv))
15401530 then {
15411531 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller)
15421532 let outAmAmt = res._1
15431533 let outPrAmt = res._2
15441534 let poolStatus = parseIntValue(res._9)
15451535 let state = res._10
15461536 let checkPoolStatus = if (if (isGlobalShutdown())
15471537 then true
15481538 else (poolStatus == PoolShutdown))
15491539 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
15501540 else true
15511541 if ((checkPoolStatus == checkPoolStatus))
15521542 then {
15531543 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
15541544 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
15551545 then {
1556- let $t05683056911 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1557- let refreshKLpActions = $t05683056911._1
1558- let updatedKLp = $t05683056911._2
1546+ let $t05661156692 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1547+ let refreshKLpActions = $t05661156692._1
1548+ let updatedKLp = $t05661156692._2
15591549 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
15601550 if ((isUpdatedKLpValid == isUpdatedKLpValid))
15611551 then (state ++ refreshKLpActions)
15621552 else throw("Strict value is not equal to itself.")
15631553 }
15641554 else throw("Strict value is not equal to itself.")
15651555 }
15661556 else throw("Strict value is not equal to itself.")
15671557 }
15681558 else throw("Strict value is not equal to itself.")
15691559 }
15701560 else throw("Strict value is not equal to itself.")
15711561 }
15721562 else throw("Strict value is not equal to itself.")
15731563 }
15741564
15751565
15761566
15771567 @Callable(i)
15781568 func unstakeAndGetNoLess (unstakeAmount,noLessThenAmountAsset,noLessThenPriceAsset) = {
15791569 let isGetDisabled = if (isGlobalShutdown())
15801570 then true
15811571 else (cfgPoolStatus == PoolShutdown)
15821572 let checks = [if (!(isGetDisabled))
15831573 then true
15841574 else throw("get operation is blocked by admin"), if ((size(i.payments) == 0))
15851575 then true
15861576 else throw("no payments are expected")]
15871577 if ((checks == checks))
15881578 then {
15891579 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
15901580 if ((currentKLp == currentKLp))
15911581 then {
15921582 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
15931583 if ((unstakeInv == unstakeInv))
15941584 then {
15951585 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller)
15961586 let outAmAmt = res._1
15971587 let outPrAmt = res._2
15981588 let state = res._10
15991589 let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset))
16001590 then true
16011591 else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset))
16021592 then true
16031593 else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))]
16041594 if ((checkAmounts == checkAmounts))
16051595 then {
16061596 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
16071597 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
16081598 then {
1609- let $t05820658287 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1610- let refreshKLpActions = $t05820658287._1
1611- let updatedKLp = $t05820658287._2
1599+ let $t05798758068 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1600+ let refreshKLpActions = $t05798758068._1
1601+ let updatedKLp = $t05798758068._2
16121602 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
16131603 if ((isUpdatedKLpValid == isUpdatedKLpValid))
16141604 then (state ++ refreshKLpActions)
16151605 else throw("Strict value is not equal to itself.")
16161606 }
16171607 else throw("Strict value is not equal to itself.")
16181608 }
16191609 else throw("Strict value is not equal to itself.")
16201610 }
16211611 else throw("Strict value is not equal to itself.")
16221612 }
16231613 else throw("Strict value is not equal to itself.")
16241614 }
16251615 else throw("Strict value is not equal to itself.")
16261616 }
16271617
16281618
16291619
16301620 @Callable(i)
16311621 func activate (amtAssetStr,priceAssetStr) = if ((toString(i.caller) != toString(factoryContract)))
16321622 then throw("permissions denied")
16331623 else $Tuple2([StringEntry(aa(), amtAssetStr), StringEntry(pa(), priceAssetStr)], "success")
16341624
16351625
16361626
16371627 @Callable(i)
16381628 func refreshKLp () = {
16391629 let lastRefreshedBlockHeight = valueOrElse(getInteger(keyKLpRefreshedHeight), 0)
16401630 let checkLastRefreshedBlockHeight = if (((height - lastRefreshedBlockHeight) >= kLpRefreshDelay))
16411631 then unit
16421632 else throwErr(makeString([toString(kLpRefreshDelay), " blocks have not passed since the previous call"], ""))
16431633 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
16441634 then {
16451635 let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
1646- let $t05947459538 = refreshKLpInternal(0, 0, 0)
1647- let kLpUpdateActions = $t05947459538._1
1648- let updatedKLp = $t05947459538._2
1636+ let $t05925559319 = refreshKLpInternal(0, 0, 0)
1637+ let kLpUpdateActions = $t05925559319._1
1638+ let updatedKLp = $t05925559319._2
16491639 let actions = if ((kLp != updatedKLp))
16501640 then kLpUpdateActions
16511641 else throwErr("nothing to refresh")
16521642 $Tuple2(actions, toString(updatedKLp))
16531643 }
16541644 else throw("Strict value is not equal to itself.")
16551645 }
16561646
16571647
16581648
16591649 @Callable(i)
16601650 func getPoolConfigWrapperREADONLY () = $Tuple2(nil, getPoolConfig())
16611651
16621652
16631653
16641654 @Callable(i)
16651655 func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId))
16661656
16671657
16681658
16691659 @Callable(i)
16701660 func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = {
16711661 let prices = calcPrices(amAmt, prAmt, lpAmt)
16721662 $Tuple2(nil, [toString(prices[0]), toString(prices[1]), toString(prices[2])])
16731663 }
16741664
16751665
16761666
16771667 @Callable(i)
16781668 func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(toX18(origVal, origScaleMult)))
16791669
16801670
16811671
16821672 @Callable(i)
16831673 func fromX18WrapperREADONLY (val,resultScaleMult) = $Tuple2(nil, fromX18(parseBigIntValue(val), resultScaleMult))
16841674
16851675
16861676
16871677 @Callable(i)
16881678 func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(calcPriceBigInt(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18))))
16891679
16901680
16911681
16921682 @Callable(i)
16931683 func estimatePutOperationWrapperREADONLY (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = $Tuple2(nil, estimatePutOperation(txId58, slippageTolerance, inAmAssetAmt, inAmAssetId, inPrAssetAmt, inPrAssetId, userAddress, isEvaluate, emitLp))
16941684
16951685
16961686
16971687 @Callable(i)
16981688 func estimateGetOperationWrapperREADONLY (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
16991689 let res = estimateGetOperation(txId58, pmtAssetId, pmtLpAmt, addressFromStringValue(userAddress))
17001690 $Tuple2(nil, $Tuple10(res._1, res._2, res._3, res._4, res._5, res._6, res._7, toString(res._8), res._9, res._10))
17011691 }
17021692
17031693
17041694
17051695 @Callable(i)
17061696 func statsREADONLY () = {
17071697 let cfg = getPoolConfig()
17081698 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
17091699 let amtAssetId = cfg[idxAmtAssetId]
17101700 let priceAssetId = cfg[idxPriceAssetId]
17111701 let iAmtAssetId = cfg[idxIAmtAssetId]
17121702 let iPriceAssetId = cfg[idxIPriceAssetId]
17131703 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
17141704 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
17151705 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
17161706 let accAmtAssetBalance = getAccBalance(amtAssetId)
17171707 let accPriceAssetBalance = getAccBalance(priceAssetId)
17181708 let pricesList = if ((poolLPBalance == 0))
17191709 then [zeroBigInt, zeroBigInt, zeroBigInt]
17201710 else calcPrices(accAmtAssetBalance, accPriceAssetBalance, poolLPBalance)
17211711 let curPrice = 0
17221712 let lpAmtAssetShare = fromX18(pricesList[1], scale8)
17231713 let lpPriceAssetShare = fromX18(pricesList[2], scale8)
17241714 let poolWeight = value(getInteger(factoryContract, keyPoolWeight(toString(this))))
17251715 $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))
17261716 }
17271717
17281718
17291719
17301720 @Callable(i)
17311721 func evaluatePutByAmountAssetREADONLY (inAmAssetAmt) = {
17321722 let cfg = getPoolConfig()
17331723 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
17341724 let amAssetIdStr = cfg[idxAmtAssetId]
17351725 let amAssetId = fromBase58String(amAssetIdStr)
17361726 let prAssetIdStr = cfg[idxPriceAssetId]
17371727 let prAssetId = fromBase58String(prAssetIdStr)
17381728 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
17391729 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
17401730 let poolStatus = cfg[idxPoolStatus]
17411731 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
17421732 let accAmtAssetBalance = getAccBalance(amAssetIdStr)
17431733 let accPriceAssetBalance = getAccBalance(prAssetIdStr)
17441734 let amtAssetAmtX18 = toX18(accAmtAssetBalance, amtAssetDcm)
17451735 let priceAssetAmtX18 = toX18(accPriceAssetBalance, priceAssetDcm)
17461736 let curPriceX18 = if ((poolLPBalance == 0))
17471737 then zeroBigInt
17481738 else calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
17491739 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
17501740 let inPrAssetAmtX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18)
17511741 let inPrAssetAmt = fromX18(inPrAssetAmtX18, priceAssetDcm)
17521742 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
17531743 let calcLpAmt = estPut._1
17541744 let curPriceCalc = estPut._3
17551745 let amBalance = estPut._4
17561746 let prBalance = estPut._5
17571747 let lpEmission = estPut._6
17581748 $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))
17591749 }
17601750
17611751
17621752
17631753 @Callable(i)
17641754 func evaluatePutByPriceAssetREADONLY (inPrAssetAmt) = {
17651755 let cfg = getPoolConfig()
17661756 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
17671757 let amAssetIdStr = cfg[idxAmtAssetId]
17681758 let amAssetId = fromBase58String(amAssetIdStr)
17691759 let prAssetIdStr = cfg[idxPriceAssetId]
17701760 let prAssetId = fromBase58String(prAssetIdStr)
17711761 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
17721762 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
17731763 let poolStatus = cfg[idxPoolStatus]
17741764 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
17751765 let amBalanceRaw = getAccBalance(amAssetIdStr)
17761766 let prBalanceRaw = getAccBalance(prAssetIdStr)
17771767 let amBalanceRawX18 = toX18(amBalanceRaw, amtAssetDcm)
17781768 let prBalanceRawX18 = toX18(prBalanceRaw, priceAssetDcm)
17791769 let curPriceX18 = if ((poolLPBalance == 0))
17801770 then zeroBigInt
17811771 else calcPriceBigInt(prBalanceRawX18, amBalanceRawX18)
17821772 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
17831773 let inAmAssetAmtX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
17841774 let inAmAssetAmt = fromX18(inAmAssetAmtX18, amtAssetDcm)
17851775 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
17861776 let calcLpAmt = estPut._1
17871777 let curPriceCalc = estPut._3
17881778 let amBalance = estPut._4
17891779 let prBalance = estPut._5
17901780 let lpEmission = estPut._6
17911781 $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))
17921782 }
17931783
17941784
17951785
17961786 @Callable(i)
17971787 func evaluateGetREADONLY (paymentLpAssetId,paymentLpAmt) = {
17981788 let res = estimateGetOperation("", paymentLpAssetId, paymentLpAmt, this)
17991789 let outAmAmt = res._1
18001790 let outPrAmt = res._2
18011791 let amBalance = res._5
18021792 let prBalance = res._6
18031793 let lpEmission = res._7
18041794 let curPrice = res._8
18051795 let poolStatus = parseIntValue(res._9)
18061796 $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))
18071797 }
18081798
18091799
18101800 @Verifier(tx)
18111801 func verify () = {
18121802 let targetPublicKey = match managerPublicKeyOrUnit() {
18131803 case pk: ByteVector =>
18141804 pk
18151805 case _: Unit =>
18161806 tx.senderPublicKey
18171807 case _ =>
18181808 throw("Match error")
18191809 }
18201810 match tx {
18211811 case order: Order =>
18221812 let matcherPub = getMatcherPubOrFail()
1823- let $t06820068269 = validateMatcherOrderAllowed(order)
1824- let orderValid = $t06820068269._1
1825- let orderValidInfo = $t06820068269._2
1813+ let $t06798168050 = validateMatcherOrderAllowed(order)
1814+ let orderValid = $t06798168050._1
1815+ let orderValidInfo = $t06798168050._2
18261816 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
18271817 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
18281818 if (if (if (orderValid)
18291819 then senderValid
18301820 else false)
18311821 then matcherValid
18321822 else false)
18331823 then true
18341824 else throwOrderError(orderValid, orderValidInfo, senderValid, matcherValid)
18351825 case s: SetScriptTransaction =>
18361826 if (sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey))
18371827 then true
18381828 else {
18391829 let newHash = blake2b256(value(s.script))
18401830 let allowedHash = fromBase64String(value(getString(factoryContract, keyAllowedLpScriptHash())))
18411831 let currentHash = scriptHash(this)
18421832 if ((allowedHash == newHash))
18431833 then (currentHash != newHash)
18441834 else false
18451835 }
18461836 case _ =>
18471837 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
18481838 }
18491839 }
18501840

github/deemru/w8io/026f985 
378.76 ms