tx · BmmGTp5t8ZnVsDvUuKSPYGNZ8EaVJN5C7xCiiTrsfCDf

3MqGtuaL3yJbKHqUxnSihJmYroyPf6QDp1x:  -0.04300000 Waves

2024.07.10 11:15 [3187675] smart account 3MqGtuaL3yJbKHqUxnSihJmYroyPf6QDp1x > SELF 0.00000000 Waves

{ "type": 13, "id": "BmmGTp5t8ZnVsDvUuKSPYGNZ8EaVJN5C7xCiiTrsfCDf", "fee": 4300000, "feeAssetId": null, "timestamp": 1720599402782, "version": 2, "chainId": 84, "sender": "3MqGtuaL3yJbKHqUxnSihJmYroyPf6QDp1x", "senderPublicKey": "HNMWjb4Vq8JwETf7kHV57gaKXLvsdCS5KPTaHKa4XKa6", "proofs": [ "g4LAuAKv7E36zBqxhGuexUKKwzBdAB8qTzKhDJqhfCpVYeBsRKPwBSw7k5dtFHcZRiLXfYVmuV8Q8TDHT4EJk67" ], "script": "base64:BgLWOAgCEgASBQoDAQQBEgcKBQEEAQgBEgQKAgEEEgMKAQESBAoCAQQSBAoCCAESBAoCCAESBAoCCAESBQoDAQgBEgASBAoCAQESAwoBARIFCgMBAQESBAoCCAgSABIAEgMKAQgSBQoDAQEBEgQKAgEBEgQKAggBEgQKAggIEgsKCQgBAQIBAggEBBIGCgQICAEIEgASAwoBARIDCgEBEgQKAggBIgpsUGRlY2ltYWxzIgZzY2FsZTgiDHNjYWxlOEJpZ0ludCIHc2NhbGUxOCIKemVyb0JpZ0ludCIEYmlnMCIEYmlnMSIEYmlnMiILd2F2ZXNTdHJpbmciA1NFUCIKUG9vbEFjdGl2ZSIPUG9vbFB1dERpc2FibGVkIhNQb29sTWF0Y2hlckRpc2FibGVkIgxQb29sU2h1dGRvd24iDmlkeFBvb2xBZGRyZXNzIg1pZHhQb29sU3RhdHVzIhBpZHhQb29sTFBBc3NldElkIg1pZHhBbXRBc3NldElkIg9pZHhQcmljZUFzc2V0SWQiDmlkeEFtdEFzc2V0RGNtIhBpZHhQcmljZUFzc2V0RGNtIg5pZHhJQW10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ewDifferences
171171 func keySkipOrderValidation (poolAddress) = ("%s%s__skipOrderValidation__" + poolAddress)
172172
173173
174-func throwOrderError (orderValid,orderValidInfo,senderValid,matcherValid) = throw((((((((("order validation failed: orderValid=" + toString(orderValid)) + " (") + orderValidInfo) + ")") + " senderValid=") + toString(senderValid)) + " matcherValid=") + toString(matcherValid)))
174+func throwOrderError (orderValid,orderValidInfo,matcherValid) = throw((((((("order validation failed: orderValid=" + toString(orderValid)) + " (") + orderValidInfo) + ")") + " matcherValid=") + toString(matcherValid)))
175175
176176
177177 func addressFromStringOrThis (addressString) = match addressFromString(addressString) {
264264
265265 let poolConfigParsed = parsePoolConfig(getPoolConfig())
266266
267-let $t097699935 = poolConfigParsed
267+let $t097029868 = poolConfigParsed
268268
269-let cfgPoolAddress = $t097699935._1
269+let cfgPoolAddress = $t097029868._1
270270
271-let cfgPoolStatus = $t097699935._2
271+let cfgPoolStatus = $t097029868._2
272272
273-let cfgLpAssetId = $t097699935._3
273+let cfgLpAssetId = $t097029868._3
274274
275-let cfgAmountAssetId = $t097699935._4
275+let cfgAmountAssetId = $t097029868._4
276276
277-let cfgPriceAssetId = $t097699935._5
277+let cfgPriceAssetId = $t097029868._5
278278
279-let cfgAmountAssetDecimals = $t097699935._6
279+let cfgAmountAssetDecimals = $t097029868._6
280280
281-let cfgPriceAssetDecimals = $t097699935._7
281+let cfgPriceAssetDecimals = $t097029868._7
282282
283283 func getFactoryConfig () = split(getStringOrFail(factoryContract, keyFactoryConfig()), SEP)
284284
429429
430430
431431 func rebalanceAsset (assetId) = {
432- let $t01622016356 = getLeaseProxyConfig(assetId)
433- let isLeasable = $t01622016356._1
434- let leasedRatio = $t01622016356._2
435- let minBalance = $t01622016356._3
436- let proxyAddress = $t01622016356._4
437- let proxyAssetId = $t01622016356._5
438- let proxyRateMul = $t01622016356._6
439- let stakingProfitAddress = $t01622016356._7
432+ let $t01615316289 = getLeaseProxyConfig(assetId)
433+ let isLeasable = $t01615316289._1
434+ let leasedRatio = $t01615316289._2
435+ let minBalance = $t01615316289._3
436+ let proxyAddress = $t01615316289._4
437+ let proxyAssetId = $t01615316289._5
438+ let proxyRateMul = $t01615316289._6
439+ let stakingProfitAddress = $t01615316289._7
440440 if (isLeasable)
441441 then rebalanceInternal(leasedRatio, assetId, proxyAssetId, minBalance, addressFromStringValue(proxyAddress), proxyRateMul, addressFromStringValue(stakingProfitAddress))
442442 else nil
444444
445445
446446 func withdrawAndRebalanceAsset (assetId,getAmount) = {
447- let $t01675516891 = getLeaseProxyConfig(assetId)
448- let isLeasable = $t01675516891._1
449- let leasedRatio = $t01675516891._2
450- let minBalance = $t01675516891._3
451- let proxyAddress = $t01675516891._4
452- let proxyAssetId = $t01675516891._5
453- let proxyRateMul = $t01675516891._6
454- let stakingProfitAddress = $t01675516891._7
447+ let $t01668816824 = getLeaseProxyConfig(assetId)
448+ let isLeasable = $t01668816824._1
449+ let leasedRatio = $t01668816824._2
450+ let minBalance = $t01668816824._3
451+ let proxyAddress = $t01668816824._4
452+ let proxyAssetId = $t01668816824._5
453+ let proxyRateMul = $t01668816824._6
454+ let stakingProfitAddress = $t01668816824._7
455455 if (isLeasable)
456456 then {
457457 let currentStakingAssetBalance = getStakingAssetBalanceOrZero(proxyAssetId)
678678 let priceAssetBalance = getAccBalance(assetIdToString(cfgPriceAssetId))
679679 let amountAssetAmount = order.amount
680680 let priceAssetAmount = fraction(order.amount, order.price, scale8, FLOOR)
681- let $t02951729729 = if ((order.orderType == Buy))
681+ let $t02945029662 = if ((order.orderType == Buy))
682682 then $Tuple2(amountAssetAmount, -(priceAssetAmount))
683683 else $Tuple2(-(amountAssetAmount), priceAssetAmount)
684- let amountAssetBalanceDelta = $t02951729729._1
685- let priceAssetBalanceDelta = $t02951729729._2
684+ let amountAssetBalanceDelta = $t02945029662._1
685+ let priceAssetBalanceDelta = $t02945029662._2
686686 if (if (if (isGlobalShutdown())
687687 then true
688688 else (cfgPoolStatus == PoolMatcherDisabled))
695695 then throw("Wrong order assets.")
696696 else {
697697 let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
698- let $t03016930269 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
699- let unusedActions = $t03016930269._1
700- let kLpNew = $t03016930269._2
698+ let $t03010230202 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
699+ let unusedActions = $t03010230202._1
700+ let kLpNew = $t03010230202._2
701701 let isOrderValid = (kLpNew >= kLp)
702702 let info = makeString(["kLp=", toString(kLp), " kLpNew=", toString(kLpNew), " amountAssetBalance=", toString(amountAssetBalance), " priceAssetBalance=", toString(priceAssetBalance), " amountAssetBalanceDelta=", toString(amountAssetBalanceDelta), " priceAssetBalanceDelta=", toString(priceAssetBalanceDelta), " height=", toString(height)], "")
703703 $Tuple2(isOrderValid, info)
780780 else if ((paymentAssetId == cfgPriceAssetId))
781781 then false
782782 else throwErr("invalid asset")
783- let $t03345533748 = if (isEval)
783+ let $t03338833681 = if (isEval)
784784 then $Tuple2(amountBalanceRaw, priceBalanceRaw)
785785 else if (paymentInAmountAsset)
786786 then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw)
787787 else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw))
788- let amountBalanceOld = $t03345533748._1
789- let priceBalanceOld = $t03345533748._2
790- let $t03375233901 = if (paymentInAmountAsset)
788+ let amountBalanceOld = $t03338833681._1
789+ let priceBalanceOld = $t03338833681._2
790+ let $t03368533834 = if (paymentInAmountAsset)
791791 then $Tuple2(paymentAmountRaw, 0)
792792 else $Tuple2(0, paymentAmountRaw)
793- let amountAssetAmountRaw = $t03375233901._1
794- let priceAssetAmountRaw = $t03375233901._2
793+ let amountAssetAmountRaw = $t03368533834._1
794+ let priceAssetAmountRaw = $t03368533834._2
795795 let amountAssetAmount = takeFee(amountAssetAmountRaw, inFee)._1
796796 let priceAssetAmount = takeFee(priceAssetAmountRaw, inFee)._1
797- let $t03403334097 = takeFee(paymentAmountRaw, inFee)
798- let paymentAmount = $t03403334097._1
799- let feeAmount = $t03403334097._2
797+ let $t03396634030 = takeFee(paymentAmountRaw, inFee)
798+ let paymentAmount = $t03396634030._1
799+ let feeAmount = $t03396634030._2
800800 let amountBalanceNew = (amountBalanceOld + amountAssetAmount)
801801 let priceBalanceNew = (priceBalanceOld + priceAssetAmount)
802802 let priceNewX18 = calcPriceBigInt(toX18(priceBalanceNew, cfgPriceAssetDecimals), toX18(amountBalanceNew, cfgAmountAssetDecimals))
819819 let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, cfgPriceAssetDecimals), toX18(amountBalanceOld, cfgAmountAssetDecimals))
820820 let priceOld = fromX18(priceOldX18, scale8)
821821 let loss = {
822- let $t03577835945 = if (paymentInAmountAsset)
822+ let $t03571135878 = if (paymentInAmountAsset)
823823 then $Tuple2(amountAssetAmountRaw, amountBalanceOld)
824824 else $Tuple2(priceAssetAmountRaw, priceBalanceOld)
825- let amount = $t03577835945._1
826- let balance = $t03577835945._2
825+ let amount = $t03571135878._1
826+ let balance = $t03571135878._2
827827 let issueAmountBoth = toInt(fraction(supplyBigInt, toBigInt((amount / 2)), toBigInt(balance)))
828828 fraction((issueAmount - issueAmountBoth), scale8, issueAmountBoth)
829829 }
863863 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
864864 let redeemedBigInt = toBigInt(paymentAmount)
865865 let amountRaw = max([0, toInt(((balanceBigInt * (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN))) / scale18))])
866- let $t03802338079 = takeFee(amountRaw, outFee)
867- let totalAmount = $t03802338079._1
868- let feeAmount = $t03802338079._2
869- let $t03808338309 = if (outInAmountAsset)
866+ let $t03795638012 = takeFee(amountRaw, outFee)
867+ let totalAmount = $t03795638012._1
868+ let feeAmount = $t03795638012._2
869+ let $t03801638242 = if (outInAmountAsset)
870870 then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld)
871871 else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw))
872- let outAmAmount = $t03808338309._1
873- let outPrAmount = $t03808338309._2
874- let amBalanceNew = $t03808338309._3
875- let prBalanceNew = $t03808338309._4
872+ let outAmAmount = $t03801638242._1
873+ let outPrAmount = $t03801638242._2
874+ let amBalanceNew = $t03801638242._3
875+ let prBalanceNew = $t03801638242._4
876876 let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, cfgPriceAssetDecimals), toX18(amBalanceNew, cfgAmountAssetDecimals))
877877 let priceNew = fromX18(priceNewX18, scale8)
878878 let commonState = if (isEval)
937937
938938 @Callable(i)
939939 func calculateAmountOutForSwapREADONLY (cleanAmountIn,isReverse,feePoolAmount) = {
940- let $t04016740472 = if ((isReverse == false))
940+ let $t04010040405 = if ((isReverse == false))
941941 then {
942942 let assetOut = getStringOrFail(this, pa())
943943 let assetIn = getStringOrFail(this, aa())
948948 let assetIn = getStringOrFail(this, pa())
949949 $Tuple2(assetOut, assetIn)
950950 }
951- let assetOut = $t04016740472._1
952- let assetIn = $t04016740472._2
951+ let assetOut = $t04010040405._1
952+ let assetIn = $t04010040405._2
953953 let poolAssetInBalance = getAccBalance(assetIn)
954954 let poolAssetOutBalance = getAccBalance(assetOut)
955955 let amountOut = fraction(poolAssetOutBalance, cleanAmountIn, (poolAssetInBalance + cleanAmountIn))
10021002 let assetOut = if ((isReverse == false))
10031003 then getStringOrFail(this, pa())
10041004 else getStringOrFail(this, aa())
1005- let poolAssetInBalance = (getAccBalance(assetIn) - value(i.payments[0]).amount)
1005+ let poolAssetInBalance = ((getAccBalance(assetIn) - value(i.payments[0]).amount) - feePoolAmount)
10061006 let poolAssetOutBalance = getAccBalance(assetOut)
10071007 let amountOut = fraction(poolAssetOutBalance, cleanAmountIn, (poolAssetInBalance + cleanAmountIn))
10081008 let oldK = (toBigInt(poolAssetInBalance) * toBigInt(poolAssetOutBalance))
1009- let newK = (toBigInt(getAccBalance(assetIn)) * (toBigInt(getAccBalance(assetOut)) - toBigInt(amountOut)))
1009+ let newK = ((toBigInt(getAccBalance(assetIn)) + toBigInt(feePoolAmount)) * (toBigInt(getAccBalance(assetOut)) - toBigInt(amountOut)))
10101010 let checkK = if ((newK >= oldK))
10111011 then true
10121012 else throw("new K is fewer error")
10171017 else throw("Exchange result is fewer coins than expected")
10181018 if ((checkMin == checkMin))
10191019 then {
1020- let priceAssetId = getStringOrFail(this, pa())
1021- let feeAssetId = fromBase58String(priceAssetId)
1022- let feeAmount = fraction(cleanAmountIn, feePoolAmount, 100)
1023- let rebalanceState = rebalanceAsset(assetIn)
1024- if ((rebalanceState == rebalanceState))
1020+ let amountAssetBalanceDelta = if (isReverse)
1021+ then -(amountOut)
1022+ else feePoolAmount
1023+ let priceAssetBalanceDelta = if (isReverse)
1024+ then feePoolAmount
1025+ else -(amountOut)
1026+ let refreshKLpActions = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)._1
1027+ if ((refreshKLpActions == refreshKLpActions))
10251028 then {
1026- let withdrawState = withdrawAndRebalanceAsset(assetOut, (amountOut + feeAmount))
1027- if ((withdrawState == withdrawState))
1029+ let rebalanceState = rebalanceAsset(assetIn)
1030+ if ((rebalanceState == rebalanceState))
10281031 then {
1029- let feeTransfer = ScriptTransfer(feeCollectorAddress, feeAmount, feeAssetId)
1030- $Tuple2(((withdrawState ++ rebalanceState) ++ [ScriptTransfer(addressFromStringValue(addressTo), (amountOut - feeAmount), parseAssetId(assetOut)), feeTransfer]), amountOut)
1032+ let withdrawState = withdrawAndRebalanceAsset(assetOut, amountOut)
1033+ if ((withdrawState == withdrawState))
1034+ then $Tuple2(((withdrawState ++ rebalanceState) ++ [ScriptTransfer(addressFromStringValue(addressTo), amountOut, parseAssetId(assetOut))]), amountOut)
1035+ else throw("Strict value is not equal to itself.")
10311036 }
10321037 else throw("Strict value is not equal to itself.")
10331038 }
10881093 else throw("Strict value is not equal to itself.")
10891094 }
10901095 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
1091- let $t04559246054 = refreshKLpInternal(0, 0, 0)
1092- if (($t04559246054 == $t04559246054))
1096+ let $t04558146043 = refreshKLpInternal(0, 0, 0)
1097+ if (($t04558146043 == $t04558146043))
10931098 then {
1094- let updatedKLp = $t04559246054._2
1095- let refreshKLpActions = $t04559246054._1
1099+ let updatedKLp = $t04558146043._2
1100+ let refreshKLpActions = $t04558146043._1
10961101 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10971102 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10981103 then {
11291134 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
11301135 if ((currentKLp == currentKLp))
11311136 then {
1132- let $t04666646731 = refreshKLpInternal(0, 0, 0)
1133- let refreshKLpActions = $t04666646731._1
1134- let updatedKLp = $t04666646731._2
1137+ let $t04665546720 = refreshKLpInternal(0, 0, 0)
1138+ let refreshKLpActions = $t04665546720._1
1139+ let updatedKLp = $t04665546720._2
11351140 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11361141 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11371142 then (state ++ refreshKLpActions)
11801185 then {
11811186 let userAddress = i.caller
11821187 let txId = i.transactionId
1183- let $t04796048112 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
1184- if (($t04796048112 == $t04796048112))
1188+ let $t04794948101 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
1189+ if (($t04794948101 == $t04794948101))
11851190 then {
1186- let paymentInAmountAsset = $t04796048112._5
1187- let bonus = $t04796048112._4
1188- let feeAmount = $t04796048112._3
1189- let commonState = $t04796048112._2
1190- let emitAmountEstimated = $t04796048112._1
1191+ let paymentInAmountAsset = $t04794948101._5
1192+ let bonus = $t04794948101._4
1193+ let feeAmount = $t04794948101._3
1194+ let commonState = $t04794948101._2
1195+ let emitAmountEstimated = $t04794948101._1
11911196 let emitAmount = if (if ((minOutAmount > 0))
11921197 then (minOutAmount > emitAmountEstimated)
11931198 else false)
12071212 let sendFee = if ((feeAmount > 0))
12081213 then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
12091214 else nil
1210- let $t04869848895 = if ((this == feeCollectorAddress))
1215+ let $t04868748884 = if ((this == feeCollectorAddress))
12111216 then $Tuple2(0, 0)
12121217 else if (paymentInAmountAsset)
12131218 then $Tuple2(-(feeAmount), 0)
12141219 else $Tuple2(0, -(feeAmount))
1215- let amountAssetBalanceDelta = $t04869848895._1
1216- let priceAssetBalanceDelta = $t04869848895._2
1217- let $t04889849006 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1218- let refreshKLpActions = $t04889849006._1
1219- let updatedKLp = $t04889849006._2
1220+ let amountAssetBalanceDelta = $t04868748884._1
1221+ let priceAssetBalanceDelta = $t04868748884._2
1222+ let $t04888748995 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1223+ let refreshKLpActions = $t04888748995._1
1224+ let updatedKLp = $t04888748995._2
12201225 let kLp = value(getString(keyKLp))
12211226 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
12221227 if ((isUpdatedKLpValid == isUpdatedKLpValid))
12411246
12421247 @Callable(i)
12431248 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
1244- let $t04936149518 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
1245- let emitAmountEstimated = $t04936149518._1
1246- let commonState = $t04936149518._2
1247- let feeAmount = $t04936149518._3
1248- let bonus = $t04936149518._4
1249- let paymentInAmountAsset = $t04936149518._5
1249+ let $t04935049507 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
1250+ let emitAmountEstimated = $t04935049507._1
1251+ let commonState = $t04935049507._2
1252+ let feeAmount = $t04935049507._3
1253+ let bonus = $t04935049507._4
1254+ let paymentInAmountAsset = $t04935049507._5
12501255 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
12511256 }
12521257
12851290 then {
12861291 let userAddress = i.caller
12871292 let txId = i.transactionId
1288- let $t05044050593 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
1289- if (($t05044050593 == $t05044050593))
1293+ let $t05042950582 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
1294+ if (($t05042950582 == $t05042950582))
12901295 then {
1291- let outInAmountAsset = $t05044050593._5
1292- let bonus = $t05044050593._4
1293- let feeAmount = $t05044050593._3
1294- let commonState = $t05044050593._2
1295- let amountEstimated = $t05044050593._1
1296+ let outInAmountAsset = $t05042950582._5
1297+ let bonus = $t05042950582._4
1298+ let feeAmount = $t05042950582._3
1299+ let commonState = $t05042950582._2
1300+ let amountEstimated = $t05042950582._1
12961301 let amount = if (if ((minOutAmount > 0))
12971302 then (minOutAmount > amountEstimated)
12981303 else false)
13061311 let sendFee = if ((feeAmount > 0))
13071312 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
13081313 else nil
1309- let $t05125751504 = {
1314+ let $t05124651493 = {
13101315 let feeAmountForCalc = if ((this == feeCollectorAddress))
13111316 then 0
13121317 else feeAmount
13141319 then $Tuple2(-((amount + feeAmountForCalc)), 0)
13151320 else $Tuple2(0, -((amount + feeAmountForCalc)))
13161321 }
1317- let amountAssetBalanceDelta = $t05125751504._1
1318- let priceAssetBalanceDelta = $t05125751504._2
1319- let $t05150751615 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1320- let refreshKLpActions = $t05150751615._1
1321- let updatedKLp = $t05150751615._2
1322+ let amountAssetBalanceDelta = $t05124651493._1
1323+ let priceAssetBalanceDelta = $t05124651493._2
1324+ let $t05149651604 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1325+ let refreshKLpActions = $t05149651604._1
1326+ let updatedKLp = $t05149651604._2
13221327 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
13231328 if ((isUpdatedKLpValid == isUpdatedKLpValid))
13241329 then $Tuple2(((((commonState ++ withdrawState) ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
13371342
13381343 @Callable(i)
13391344 func getOneTknREADONLY (outAssetId,paymentAmount) = {
1340- let $t05189352049 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
1341- let amountEstimated = $t05189352049._1
1342- let commonState = $t05189352049._2
1343- let feeAmount = $t05189352049._3
1344- let bonus = $t05189352049._4
1345- let outInAmountAsset = $t05189352049._5
1345+ let $t05188252038 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
1346+ let amountEstimated = $t05188252038._1
1347+ let commonState = $t05188252038._2
1348+ let feeAmount = $t05188252038._3
1349+ let bonus = $t05188252038._4
1350+ let outInAmountAsset = $t05188252038._5
13461351 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
13471352 }
13481353
13811386 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
13821387 if ((unstakeInv == unstakeInv))
13831388 then {
1384- let $t05299153142 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1385- if (($t05299153142 == $t05299153142))
1389+ let $t05298053131 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1390+ if (($t05298053131 == $t05298053131))
13861391 then {
1387- let outInAmountAsset = $t05299153142._5
1388- let bonus = $t05299153142._4
1389- let feeAmount = $t05299153142._3
1390- let commonState = $t05299153142._2
1391- let amountEstimated = $t05299153142._1
1392+ let outInAmountAsset = $t05298053131._5
1393+ let bonus = $t05298053131._4
1394+ let feeAmount = $t05298053131._3
1395+ let commonState = $t05298053131._2
1396+ let amountEstimated = $t05298053131._1
13921397 let amount = if (if ((minOutAmount > 0))
13931398 then (minOutAmount > amountEstimated)
13941399 else false)
14021407 let sendFee = if ((feeAmount > 0))
14031408 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
14041409 else nil
1405- let $t05380154048 = {
1410+ let $t05379054037 = {
14061411 let feeAmountForCalc = if ((this == feeCollectorAddress))
14071412 then 0
14081413 else feeAmount
14101415 then $Tuple2(-((amount + feeAmountForCalc)), 0)
14111416 else $Tuple2(0, -((amount + feeAmountForCalc)))
14121417 }
1413- let amountAssetBalanceDelta = $t05380154048._1
1414- let priceAssetBalanceDelta = $t05380154048._2
1415- let $t05405154159 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1416- let refreshKLpActions = $t05405154159._1
1417- let updatedKLp = $t05405154159._2
1418+ let amountAssetBalanceDelta = $t05379054037._1
1419+ let priceAssetBalanceDelta = $t05379054037._2
1420+ let $t05404054148 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1421+ let refreshKLpActions = $t05404054148._1
1422+ let updatedKLp = $t05404054148._2
14181423 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
14191424 if ((isUpdatedKLpValid == isUpdatedKLpValid))
14201425 then $Tuple2(((((commonState ++ withdrawState) ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
14481453 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
14491454 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
14501455 then {
1451- let $t05525455335 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1452- let refreshKLpActions = $t05525455335._1
1453- let updatedKLp = $t05525455335._2
1456+ let $t05524355324 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1457+ let refreshKLpActions = $t05524355324._1
1458+ let updatedKLp = $t05524355324._2
14541459 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
14551460 if ((isUpdatedKLpValid == isUpdatedKLpValid))
14561461 then ((withdrawState ++ state) ++ refreshKLpActions)
14831488 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
14841489 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
14851490 then {
1486- let $t05643056511 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1487- let refreshKLpActions = $t05643056511._1
1488- let updatedKLp = $t05643056511._2
1491+ let $t05641956500 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1492+ let refreshKLpActions = $t05641956500._1
1493+ let updatedKLp = $t05641956500._2
14891494 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
14901495 if ((isUpdatedKLpValid == isUpdatedKLpValid))
14911496 then ((withdrawState ++ state) ++ refreshKLpActions)
15331538 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
15341539 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
15351540 then {
1536- let $t05785957940 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1537- let refreshKLpActions = $t05785957940._1
1538- let updatedKLp = $t05785957940._2
1541+ let $t05784857929 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1542+ let refreshKLpActions = $t05784857929._1
1543+ let updatedKLp = $t05784857929._2
15391544 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
15401545 if ((isUpdatedKLpValid == isUpdatedKLpValid))
15411546 then ((withdrawState ++ state) ++ refreshKLpActions)
15891594 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
15901595 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
15911596 then {
1592- let $t05941859499 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1593- let refreshKLpActions = $t05941859499._1
1594- let updatedKLp = $t05941859499._2
1597+ let $t05940759488 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1598+ let refreshKLpActions = $t05940759488._1
1599+ let updatedKLp = $t05940759488._2
15951600 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
15961601 if ((isUpdatedKLpValid == isUpdatedKLpValid))
15971602 then ((withdrawState ++ state) ++ refreshKLpActions)
16261631 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
16271632 then {
16281633 let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
1629- let $t06070360767 = refreshKLpInternal(0, 0, 0)
1630- let kLpUpdateActions = $t06070360767._1
1631- let updatedKLp = $t06070360767._2
1634+ let $t06069260756 = refreshKLpInternal(0, 0, 0)
1635+ let kLpUpdateActions = $t06069260756._1
1636+ let updatedKLp = $t06069260756._2
16321637 let actions = if ((kLp != updatedKLp))
16331638 then kLpUpdateActions
16341639 else throwErr("nothing to refresh")
18031808 match tx {
18041809 case order: Order =>
18051810 let matcherPub = getMatcherPubOrFail()
1806- let $t06942969546 = if (skipOrderValidation())
1811+ let $t06941869646 = if (skipOrderValidation())
18071812 then $Tuple2(true, "")
18081813 else validateMatcherOrderAllowed(order)
1809- let orderValid = $t06942969546._1
1810- let orderValidInfo = $t06942969546._2
1811- let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
1814+ let orderValid = $t06941869646._1
1815+ let orderValidInfo = $t06941869646._2
18121816 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
1813- if (if (if (orderValid)
1814- then senderValid
1815- else false)
1817+ if (if (orderValid)
18161818 then matcherValid
18171819 else false)
18181820 then true
1819- else throwOrderError(orderValid, orderValidInfo, senderValid, matcherValid)
1821+ else throwOrderError(orderValid, orderValidInfo, matcherValid)
18201822 case s: SetScriptTransaction =>
18211823 if (sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey))
18221824 then true
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 keyManagerPublicKey () = "%s__managerPublicKey"
9494
9595
9696 func keyManagerVaultAddress () = "%s__managerVaultAddress"
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 keyAdditionalBalance (assetId) = makeString(["%s%s", "stakedBalance", assetId], SEP)
134134
135135
136136 func keyStakingAssetBalance (assetId) = makeString(["%s%s", "shareAssetBalance", assetId], SEP)
137137
138138
139139 func getAdditionalBalanceOrZero (assetId) = valueOrElse(getInteger(this, keyAdditionalBalance(assetId)), 0)
140140
141141
142142 func getStakingAssetBalanceOrZero (assetId) = valueOrElse(getInteger(this, keyStakingAssetBalance(assetId)), 0)
143143
144144
145145 func keyFactoryConfig () = "%s__factoryConfig"
146146
147147
148148 func keyMatcherPub () = "%s%s__matcher__publicKey"
149149
150150
151151 func keyMappingPoolContractAddressToPoolAssets (poolContractAddress) = (("%s%s%s__" + poolContractAddress) + "__mappings__poolContract2LpAsset")
152152
153153
154154 func keyPoolConfig (iAmtAsset,iPriceAsset) = (((("%d%d%s__" + iAmtAsset) + "__") + iPriceAsset) + "__config")
155155
156156
157157 func keyMappingsBaseAsset2internalId (baseAssetStr) = ("%s%s%s__mappings__baseAsset2internalId__" + baseAssetStr)
158158
159159
160160 func keyAllPoolsShutdown () = "%s__shutdown"
161161
162162
163163 func keyPoolWeight (contractAddress) = ("%s%s__poolWeight__" + contractAddress)
164164
165165
166166 func keyAllowedLpScriptHash () = "%s__allowedLpScriptHash"
167167
168168
169169 let keyFeeCollectorAddress = "%s__feeCollectorAddress"
170170
171171 func keySkipOrderValidation (poolAddress) = ("%s%s__skipOrderValidation__" + poolAddress)
172172
173173
174-func throwOrderError (orderValid,orderValidInfo,senderValid,matcherValid) = throw((((((((("order validation failed: orderValid=" + toString(orderValid)) + " (") + orderValidInfo) + ")") + " senderValid=") + toString(senderValid)) + " matcherValid=") + toString(matcherValid)))
174+func throwOrderError (orderValid,orderValidInfo,matcherValid) = throw((((((("order validation failed: orderValid=" + toString(orderValid)) + " (") + orderValidInfo) + ")") + " matcherValid=") + toString(matcherValid)))
175175
176176
177177 func addressFromStringOrThis (addressString) = match addressFromString(addressString) {
178178 case a: Address =>
179179 a
180180 case _ =>
181181 this
182182 }
183183
184184
185185 func getManagerVaultAddressOrThis () = {
186186 let factoryAddress = match getString(fc()) {
187187 case fca: String =>
188188 addressFromStringOrThis(fca)
189189 case _ =>
190190 this
191191 }
192192 match getString(factoryAddress, keyManagerVaultAddress()) {
193193 case s: String =>
194194 addressFromStringOrThis(s)
195195 case _ =>
196196 this
197197 }
198198 }
199199
200200
201201 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
202202
203203
204204 func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
205205
206206
207207 func throwErr (msg) = throw(makeString(["lp.ride:", msg], " "))
208208
209209
210210 func fmtErr (msg) = makeString(["lp.ride:", msg], " ")
211211
212212
213213 let factoryContract = addressFromStringValue(getStringOrFail(this, fc()))
214214
215215 let feeCollectorAddress = addressFromStringValue(getStringOrFail(factoryContract, keyFeeCollectorAddress))
216216
217217 let inFee = {
218218 let @ = invoke(factoryContract, "getInFeeREADONLY", [toString(this)], nil)
219219 if ($isInstanceOf(@, "Int"))
220220 then @
221221 else throw(($getType(@) + " couldn't be cast to Int"))
222222 }
223223
224224 let outFee = {
225225 let @ = invoke(factoryContract, "getOutFeeREADONLY", [toString(this)], nil)
226226 if ($isInstanceOf(@, "Int"))
227227 then @
228228 else throw(($getType(@) + " couldn't be cast to Int"))
229229 }
230230
231231 func keyAddressWhitelisted (address) = makeString(["%s%s", "whitelisted", toString(address)], SEP)
232232
233233
234234 func isAddressWhitelisted (address) = valueOrElse(getBoolean(factoryContract, keyAddressWhitelisted(address)), false)
235235
236236
237237 func isGlobalShutdown () = valueOrElse(getBoolean(factoryContract, keyAllPoolsShutdown()), false)
238238
239239
240240 func getMatcherPubOrFail () = fromBase58String(getStringOrFail(factoryContract, keyMatcherPub()))
241241
242242
243243 func getPoolConfig () = {
244244 let amtAsset = getStringOrFail(this, aa())
245245 let priceAsset = getStringOrFail(this, pa())
246246 let iPriceAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(priceAsset))
247247 let iAmtAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(amtAsset))
248248 split(getStringOrFail(factoryContract, keyPoolConfig(toString(iAmtAsset), toString(iPriceAsset))), SEP)
249249 }
250250
251251
252252 func parseAssetId (input) = if ((input == wavesString))
253253 then unit
254254 else fromBase58String(input)
255255
256256
257257 func assetIdToString (input) = if ((input == unit))
258258 then wavesString
259259 else toBase58String(value(input))
260260
261261
262262 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]))
263263
264264
265265 let poolConfigParsed = parsePoolConfig(getPoolConfig())
266266
267-let $t097699935 = poolConfigParsed
267+let $t097029868 = poolConfigParsed
268268
269-let cfgPoolAddress = $t097699935._1
269+let cfgPoolAddress = $t097029868._1
270270
271-let cfgPoolStatus = $t097699935._2
271+let cfgPoolStatus = $t097029868._2
272272
273-let cfgLpAssetId = $t097699935._3
273+let cfgLpAssetId = $t097029868._3
274274
275-let cfgAmountAssetId = $t097699935._4
275+let cfgAmountAssetId = $t097029868._4
276276
277-let cfgPriceAssetId = $t097699935._5
277+let cfgPriceAssetId = $t097029868._5
278278
279-let cfgAmountAssetDecimals = $t097699935._6
279+let cfgAmountAssetDecimals = $t097029868._6
280280
281-let cfgPriceAssetDecimals = $t097699935._7
281+let cfgPriceAssetDecimals = $t097029868._7
282282
283283 func getFactoryConfig () = split(getStringOrFail(factoryContract, keyFactoryConfig()), SEP)
284284
285285
286286 let stakingContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactoryStakingContract]), "incorrect staking address")
287287
288288 let slippageContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactorySlippageContract]), "incorrect staking address")
289289
290290 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)
291291
292292
293293 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)
294294
295295
296296 func getAccBalance (assetId) = {
297297 let balanceOnPool = if ((assetId == "WAVES"))
298298 then wavesBalance(this).available
299299 else assetBalance(this, fromBase58String(assetId))
300300 let totalBalance = ((balanceOnPool + getAdditionalBalanceOrZero(assetId)) - getStakingAssetBalanceOrZero(assetId))
301301 max([0, totalBalance])
302302 }
303303
304304
305305 func calcPriceBigInt (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18)
306306
307307
308308 func calcPriceBigIntRound (prAmtX18,amAmtX18,round) = fraction(prAmtX18, scale18, amAmtX18, round)
309309
310310
311311 func getRate (proxy) = {
312312 let inv = invoke(proxy, "getRate", nil, nil)
313313 if ((inv == inv))
314314 then match inv {
315315 case r: Int =>
316316 r
317317 case _ =>
318318 throwErr("proxy.getRate() unexpected value")
319319 }
320320 else throw("Strict value is not equal to itself.")
321321 }
322322
323323
324324 func deposit (assetId,amount,stakingAssetId,proxy) = {
325325 let currentAdditionalBalance = getAdditionalBalanceOrZero(assetId)
326326 if ((currentAdditionalBalance == currentAdditionalBalance))
327327 then {
328328 let currentStakingAssetBalance = getStakingAssetBalanceOrZero(stakingAssetId)
329329 if ((currentStakingAssetBalance == currentStakingAssetBalance))
330330 then {
331331 let asset = parseAssetId(assetId)
332332 if ((amount > 0))
333333 then {
334334 let depositInvoke = invoke(proxy, "deposit", nil, [AttachedPayment(asset, amount)])
335335 if ((depositInvoke == depositInvoke))
336336 then match depositInvoke {
337337 case receivedStakingAsset: Int =>
338338 let newAdditionalBalance = (currentAdditionalBalance + amount)
339339 let newStakingAssetBalance = (currentStakingAssetBalance + receivedStakingAsset)
340340 [IntegerEntry(keyAdditionalBalance(assetId), newAdditionalBalance), IntegerEntry(keyStakingAssetBalance(stakingAssetId), newStakingAssetBalance)]
341341 case _ =>
342342 nil
343343 }
344344 else throw("Strict value is not equal to itself.")
345345 }
346346 else nil
347347 }
348348 else throw("Strict value is not equal to itself.")
349349 }
350350 else throw("Strict value is not equal to itself.")
351351 }
352352
353353
354354 func withdraw (assetId,amount,stakingAssetId,proxy,proxyRateMul,profitAddress) = {
355355 let currentAdditionalBalance = getAdditionalBalanceOrZero(assetId)
356356 if ((currentAdditionalBalance == currentAdditionalBalance))
357357 then {
358358 let currentStakingAssetBalance = getStakingAssetBalanceOrZero(stakingAssetId)
359359 if ((currentStakingAssetBalance == currentStakingAssetBalance))
360360 then {
361361 let currentProxyRate = getRate(proxy)
362362 if ((currentProxyRate == currentProxyRate))
363363 then {
364364 let oldRate = fraction(proxyRateMul, currentAdditionalBalance, currentStakingAssetBalance)
365365 let stakingAsset = parseAssetId(stakingAssetId)
366366 let oldSendStakingAmount = fraction(proxyRateMul, amount, oldRate)
367367 let sendStakingAssetAmount = fraction(proxyRateMul, amount, currentProxyRate)
368368 let profitAmount = max([0, (oldSendStakingAmount - sendStakingAssetAmount)])
369369 if ((sendStakingAssetAmount > 0))
370370 then {
371371 let withdrawInvoke = invoke(proxy, "withdraw", nil, [AttachedPayment(stakingAsset, sendStakingAssetAmount)])
372372 if ((withdrawInvoke == withdrawInvoke))
373373 then match withdrawInvoke {
374374 case receivedAssets: Int =>
375375 let newAdditionalBalance = (currentAdditionalBalance - receivedAssets)
376376 let newStakingAssetBalance = ((currentStakingAssetBalance - sendStakingAssetAmount) - profitAmount)
377377 [IntegerEntry(keyAdditionalBalance(assetId), newAdditionalBalance), IntegerEntry(keyStakingAssetBalance(stakingAssetId), newStakingAssetBalance), ScriptTransfer(profitAddress, profitAmount, parseAssetId(stakingAssetId))]
378378 case _ =>
379379 nil
380380 }
381381 else throw("Strict value is not equal to itself.")
382382 }
383383 else nil
384384 }
385385 else throw("Strict value is not equal to itself.")
386386 }
387387 else throw("Strict value is not equal to itself.")
388388 }
389389 else throw("Strict value is not equal to itself.")
390390 }
391391
392392
393393 func getLeaseProxyConfig (assetId) = match invoke(factoryContract, "getPoolLeaseConfigREADONLY", [toString(this), assetId], nil) {
394394 case a: (Boolean, Int, Int, String, String, Int, String) =>
395395 a
396396 case _ =>
397397 throwErr((("[" + assetId) + "] getLeaseProxyConfig() error"))
398398 }
399399
400400
401401 func rebalanceInternal (targetRatio,assetId,stakingAssetId,minBalance,proxy,proxyRateMul,profitAddress) = {
402402 let currentStakingAssetBalance = getStakingAssetBalanceOrZero(stakingAssetId)
403403 if ((currentStakingAssetBalance == currentStakingAssetBalance))
404404 then {
405405 let currentAdditionalBalance = if ((currentStakingAssetBalance != 0))
406406 then getAdditionalBalanceOrZero(assetId)
407407 else 0
408408 if ((currentAdditionalBalance == currentAdditionalBalance))
409409 then {
410410 let leasableTotalBalance = max([0, (getAccBalance(assetId) - minBalance)])
411411 let targetAdditionalBalance = fraction(targetRatio, leasableTotalBalance, 100)
412412 let diff = (currentAdditionalBalance - targetAdditionalBalance)
413413 if ((diff == 0))
414414 then nil
415415 else if ((0 > diff))
416416 then {
417417 let sendAssetAmount = -(diff)
418418 deposit(assetId, sendAssetAmount, stakingAssetId, proxy)
419419 }
420420 else {
421421 let getAssetAmount = diff
422422 withdraw(assetId, getAssetAmount, stakingAssetId, proxy, proxyRateMul, profitAddress)
423423 }
424424 }
425425 else throw("Strict value is not equal to itself.")
426426 }
427427 else throw("Strict value is not equal to itself.")
428428 }
429429
430430
431431 func rebalanceAsset (assetId) = {
432- let $t01622016356 = getLeaseProxyConfig(assetId)
433- let isLeasable = $t01622016356._1
434- let leasedRatio = $t01622016356._2
435- let minBalance = $t01622016356._3
436- let proxyAddress = $t01622016356._4
437- let proxyAssetId = $t01622016356._5
438- let proxyRateMul = $t01622016356._6
439- let stakingProfitAddress = $t01622016356._7
432+ let $t01615316289 = getLeaseProxyConfig(assetId)
433+ let isLeasable = $t01615316289._1
434+ let leasedRatio = $t01615316289._2
435+ let minBalance = $t01615316289._3
436+ let proxyAddress = $t01615316289._4
437+ let proxyAssetId = $t01615316289._5
438+ let proxyRateMul = $t01615316289._6
439+ let stakingProfitAddress = $t01615316289._7
440440 if (isLeasable)
441441 then rebalanceInternal(leasedRatio, assetId, proxyAssetId, minBalance, addressFromStringValue(proxyAddress), proxyRateMul, addressFromStringValue(stakingProfitAddress))
442442 else nil
443443 }
444444
445445
446446 func withdrawAndRebalanceAsset (assetId,getAmount) = {
447- let $t01675516891 = getLeaseProxyConfig(assetId)
448- let isLeasable = $t01675516891._1
449- let leasedRatio = $t01675516891._2
450- let minBalance = $t01675516891._3
451- let proxyAddress = $t01675516891._4
452- let proxyAssetId = $t01675516891._5
453- let proxyRateMul = $t01675516891._6
454- let stakingProfitAddress = $t01675516891._7
447+ let $t01668816824 = getLeaseProxyConfig(assetId)
448+ let isLeasable = $t01668816824._1
449+ let leasedRatio = $t01668816824._2
450+ let minBalance = $t01668816824._3
451+ let proxyAddress = $t01668816824._4
452+ let proxyAssetId = $t01668816824._5
453+ let proxyRateMul = $t01668816824._6
454+ let stakingProfitAddress = $t01668816824._7
455455 if (isLeasable)
456456 then {
457457 let currentStakingAssetBalance = getStakingAssetBalanceOrZero(proxyAssetId)
458458 if ((currentStakingAssetBalance == currentStakingAssetBalance))
459459 then {
460460 let currentAdditionalBalance = if ((currentStakingAssetBalance != 0))
461461 then getAdditionalBalanceOrZero(assetId)
462462 else 0
463463 if ((currentAdditionalBalance == currentAdditionalBalance))
464464 then {
465465 let newTotalLeasableBalance = max([0, ((getAccBalance(assetId) - getAmount) - minBalance)])
466466 if ((newTotalLeasableBalance == newTotalLeasableBalance))
467467 then {
468468 let newAdditionalBalance = fraction(leasedRatio, newTotalLeasableBalance, 100)
469469 if ((newAdditionalBalance == newAdditionalBalance))
470470 then {
471471 let withdrawAmount = (currentAdditionalBalance - newAdditionalBalance)
472472 if ((withdrawAmount == withdrawAmount))
473473 then if ((withdrawAmount == 0))
474474 then nil
475475 else if ((0 > withdrawAmount))
476476 then deposit(assetId, -(withdrawAmount), proxyAssetId, addressFromStringValue(proxyAddress))
477477 else withdraw(assetId, withdrawAmount, proxyAssetId, addressFromStringValue(proxyAddress), proxyRateMul, addressFromStringValue(stakingProfitAddress))
478478 else throw("Strict value is not equal to itself.")
479479 }
480480 else throw("Strict value is not equal to itself.")
481481 }
482482 else throw("Strict value is not equal to itself.")
483483 }
484484 else throw("Strict value is not equal to itself.")
485485 }
486486 else throw("Strict value is not equal to itself.")
487487 }
488488 else nil
489489 }
490490
491491
492492 func withdrawAndRebalanceAll (amountAssetOutAmount,priceAssetOutAmount) = {
493493 let AmAmtWithdrawState = withdrawAndRebalanceAsset(getStringOrFail(this, aa()), amountAssetOutAmount)
494494 let PrAmtWithdrawState = withdrawAndRebalanceAsset(getStringOrFail(this, pa()), priceAssetOutAmount)
495495 (AmAmtWithdrawState ++ PrAmtWithdrawState)
496496 }
497497
498498
499499 func privateCalcPrice (amAssetDcm,prAssetDcm,amAmt,prAmt) = {
500500 let amtAssetAmtX18 = toX18(amAmt, amAssetDcm)
501501 let priceAssetAmtX18 = toX18(prAmt, prAssetDcm)
502502 calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
503503 }
504504
505505
506506 func calcPrices (amAmt,prAmt,lpAmt) = {
507507 let cfg = getPoolConfig()
508508 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
509509 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
510510 let priceX18 = privateCalcPrice(amtAssetDcm, priceAssetDcm, amAmt, prAmt)
511511 let amAmtX18 = toX18(amAmt, amtAssetDcm)
512512 let prAmtX18 = toX18(prAmt, priceAssetDcm)
513513 let lpAmtX18 = toX18(lpAmt, scale8)
514514 let lpPriceInAmAssetX18 = calcPriceBigInt(amAmtX18, lpAmtX18)
515515 let lpPriceInPrAssetX18 = calcPriceBigInt(prAmtX18, lpAmtX18)
516516 [priceX18, lpPriceInAmAssetX18, lpPriceInPrAssetX18]
517517 }
518518
519519
520520 func calculatePrices (amAmt,prAmt,lpAmt) = {
521521 let prices = calcPrices(amAmt, prAmt, lpAmt)
522522 [fromX18(prices[0], scale8), fromX18(prices[1], scale8), fromX18(prices[2], scale8)]
523523 }
524524
525525
526526 func estimateGetOperation (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
527527 let cfg = getPoolConfig()
528528 let lpAssetId = cfg[idxPoolLPAssetId]
529529 let amAssetId = cfg[idxAmtAssetId]
530530 let prAssetId = cfg[idxPriceAssetId]
531531 let amAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
532532 let prAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
533533 let poolStatus = cfg[idxPoolStatus]
534534 let lpEmission = valueOrErrorMessage(assetInfo(fromBase58String(lpAssetId)), (("Asset " + lpAssetId) + " doesn't exist")).quantity
535535 if ((lpAssetId != pmtAssetId))
536536 then throw("Invalid asset passed.")
537537 else {
538538 let amBalance = getAccBalance(amAssetId)
539539 let amBalanceX18 = toX18(amBalance, amAssetDcm)
540540 let prBalance = getAccBalance(prAssetId)
541541 let prBalanceX18 = toX18(prBalance, prAssetDcm)
542542 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
543543 let curPrice = fromX18(curPriceX18, scale8)
544544 let pmtLpAmtX18 = toX18(pmtLpAmt, scale8)
545545 let lpEmissionX18 = toX18(lpEmission, scale8)
546546 let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissionX18)
547547 let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissionX18)
548548 let outAmAmt = fromX18Round(outAmAmtX18, amAssetDcm, FLOOR)
549549 let outPrAmt = fromX18Round(outPrAmtX18, prAssetDcm, FLOOR)
550550 let state = if ((txId58 == ""))
551551 then nil
552552 else [ScriptTransfer(userAddress, outAmAmt, if ((amAssetId == "WAVES"))
553553 then unit
554554 else fromBase58String(amAssetId)), ScriptTransfer(userAddress, outPrAmt, if ((prAssetId == "WAVES"))
555555 then unit
556556 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)]
557557 $Tuple10(outAmAmt, outPrAmt, amAssetId, prAssetId, amBalance, prBalance, lpEmission, curPriceX18, poolStatus, state)
558558 }
559559 }
560560
561561
562562 func estimatePutOperation (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = {
563563 let cfg = getPoolConfig()
564564 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
565565 let amAssetIdStr = cfg[idxAmtAssetId]
566566 let prAssetIdStr = cfg[idxPriceAssetId]
567567 let iAmtAssetId = cfg[idxIAmtAssetId]
568568 let iPriceAssetId = cfg[idxIPriceAssetId]
569569 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
570570 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
571571 let poolStatus = cfg[idxPoolStatus]
572572 let lpEmission = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
573573 let inAmAssetIdStr = toBase58String(valueOrElse(inAmAssetId, fromBase58String("WAVES")))
574574 let inPrAssetIdStr = toBase58String(valueOrElse(inPrAssetId, fromBase58String("WAVES")))
575575 if (if ((amAssetIdStr != inAmAssetIdStr))
576576 then true
577577 else (prAssetIdStr != inPrAssetIdStr))
578578 then throw("Invalid amt or price asset passed.")
579579 else {
580580 let amBalance = if (isEvaluate)
581581 then getAccBalance(amAssetIdStr)
582582 else (getAccBalance(amAssetIdStr) - inAmAssetAmt)
583583 let prBalance = if (isEvaluate)
584584 then getAccBalance(prAssetIdStr)
585585 else (getAccBalance(prAssetIdStr) - inPrAssetAmt)
586586 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
587587 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
588588 let userPriceX18 = calcPriceBigInt(inPrAssetAmtX18, inAmAssetAmtX18)
589589 let amBalanceX18 = toX18(amBalance, amtAssetDcm)
590590 let prBalanceX18 = toX18(prBalance, priceAssetDcm)
591591 let res = if ((lpEmission == 0))
592592 then {
593593 let curPriceX18 = zeroBigInt
594594 let slippageX18 = zeroBigInt
595595 let lpAmtX18 = pow((inAmAssetAmtX18 * inPrAssetAmtX18), 0, toBigInt(5), 1, 0, DOWN)
596596 $Tuple5(fromX18(lpAmtX18, scale8), fromX18(inAmAssetAmtX18, amtAssetDcm), fromX18(inPrAssetAmtX18, priceAssetDcm), calcPriceBigInt((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18)
597597 }
598598 else {
599599 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
600600 let slippageX18 = fraction(absBigInt((curPriceX18 - userPriceX18)), scale18, curPriceX18)
601601 let slippageToleranceX18 = toX18(slippageTolerance, scale8)
602602 if (if ((curPriceX18 != zeroBigInt))
603603 then (slippageX18 > slippageToleranceX18)
604604 else false)
605605 then throw(((("Price slippage " + toString(slippageX18)) + " exceeded the passed limit of ") + toString(slippageToleranceX18)))
606606 else {
607607 let lpEmissionX18 = toX18(lpEmission, scale8)
608608 let prViaAmX18 = fraction(inAmAssetAmtX18, calcPriceBigIntRound(prBalanceX18, amBalanceX18, CEILING), scale18, CEILING)
609609 let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, calcPriceBigIntRound(prBalanceX18, amBalanceX18, FLOOR), CEILING)
610610 let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18))
611611 then $Tuple2(amViaPrX18, inPrAssetAmtX18)
612612 else $Tuple2(inAmAssetAmtX18, prViaAmX18)
613613 let expAmtAssetAmtX18 = expectedAmts._1
614614 let expPriceAssetAmtX18 = expectedAmts._2
615615 let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18, FLOOR)
616616 $Tuple5(fromX18Round(lpAmtX18, scale8, FLOOR), fromX18Round(expAmtAssetAmtX18, amtAssetDcm, CEILING), fromX18Round(expPriceAssetAmtX18, priceAssetDcm, CEILING), curPriceX18, slippageX18)
617617 }
618618 }
619619 let calcLpAmt = res._1
620620 let calcAmAssetPmt = res._2
621621 let calcPrAssetPmt = res._3
622622 let curPrice = fromX18(res._4, scale8)
623623 let slippageCalc = fromX18(res._5, scale8)
624624 if ((0 >= calcLpAmt))
625625 then throw("Invalid calculations. LP calculated is less than zero.")
626626 else {
627627 let emitLpAmt = if (!(emitLp))
628628 then 0
629629 else calcLpAmt
630630 let amDiff = (inAmAssetAmt - calcAmAssetPmt)
631631 let prDiff = (inPrAssetAmt - calcPrAssetPmt)
632632 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))]
633633 $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEmission, lpAssetId, poolStatus, commonState, amDiff, prDiff, inAmAssetId, inPrAssetId)
634634 }
635635 }
636636 }
637637
638638
639639 func calcKLp (amountBalance,priceBalance,lpEmission) = {
640640 let amountBalanceX18 = toX18BigInt(amountBalance, toBigInt(cfgAmountAssetDecimals))
641641 let priceBalanceX18 = toX18BigInt(priceBalance, toBigInt(cfgPriceAssetDecimals))
642642 let updatedKLp = fraction(pow((amountBalanceX18 * priceBalanceX18), 0, toBigInt(5), 1, 18, DOWN), big1, lpEmission)
643643 if ((lpEmission == big0))
644644 then big0
645645 else updatedKLp
646646 }
647647
648648
649649 func calcCurrentKLp (amountAssetDelta,priceAssetDelta,lpAssetEmissionDelta) = {
650650 let amountAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) - amountAssetDelta)
651651 let priceAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) - priceAssetDelta)
652652 let lpAssetEmission = (toBigInt(value(assetInfo(cfgLpAssetId)).quantity) - lpAssetEmissionDelta)
653653 let currentKLp = calcKLp(amountAssetBalance, priceAssetBalance, lpAssetEmission)
654654 currentKLp
655655 }
656656
657657
658658 func refreshKLpInternal (amountAssetBalanceDelta,priceAssetBalanceDelta,lpAssetEmissionDelta) = {
659659 let amountAssetBalance = (getAccBalance(assetIdToString(cfgAmountAssetId)) + amountAssetBalanceDelta)
660660 let priceAssetBalance = (getAccBalance(assetIdToString(cfgPriceAssetId)) + priceAssetBalanceDelta)
661661 let lpAssetEmission = (value(assetInfo(cfgLpAssetId)).quantity + lpAssetEmissionDelta)
662662 let updatedKLp = calcKLp(toBigInt(amountAssetBalance), toBigInt(priceAssetBalance), toBigInt(lpAssetEmission))
663663 let actions = [IntegerEntry(keyKLpRefreshedHeight, height), StringEntry(keyKLp, toString(updatedKLp))]
664664 $Tuple2(actions, updatedKLp)
665665 }
666666
667667
668668 func skipOrderValidation () = valueOrElse(getBoolean(factoryContract, keySkipOrderValidation(toString(this))), false)
669669
670670
671671 func validateUpdatedKLp (oldKLp,updatedKLp) = if ((updatedKLp >= oldKLp))
672672 then true
673673 else throwErr(makeString(["updated KLp lower than current KLp", toString(oldKLp), toString(updatedKLp)], " "))
674674
675675
676676 func validateMatcherOrderAllowed (order) = {
677677 let amountAssetBalance = getAccBalance(assetIdToString(cfgAmountAssetId))
678678 let priceAssetBalance = getAccBalance(assetIdToString(cfgPriceAssetId))
679679 let amountAssetAmount = order.amount
680680 let priceAssetAmount = fraction(order.amount, order.price, scale8, FLOOR)
681- let $t02951729729 = if ((order.orderType == Buy))
681+ let $t02945029662 = if ((order.orderType == Buy))
682682 then $Tuple2(amountAssetAmount, -(priceAssetAmount))
683683 else $Tuple2(-(amountAssetAmount), priceAssetAmount)
684- let amountAssetBalanceDelta = $t02951729729._1
685- let priceAssetBalanceDelta = $t02951729729._2
684+ let amountAssetBalanceDelta = $t02945029662._1
685+ let priceAssetBalanceDelta = $t02945029662._2
686686 if (if (if (isGlobalShutdown())
687687 then true
688688 else (cfgPoolStatus == PoolMatcherDisabled))
689689 then true
690690 else (cfgPoolStatus == PoolShutdown))
691691 then throw("Exchange operations disabled")
692692 else if (if ((order.assetPair.amountAsset != cfgAmountAssetId))
693693 then true
694694 else (order.assetPair.priceAsset != cfgPriceAssetId))
695695 then throw("Wrong order assets.")
696696 else {
697697 let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
698- let $t03016930269 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
699- let unusedActions = $t03016930269._1
700- let kLpNew = $t03016930269._2
698+ let $t03010230202 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
699+ let unusedActions = $t03010230202._1
700+ let kLpNew = $t03010230202._2
701701 let isOrderValid = (kLpNew >= kLp)
702702 let info = makeString(["kLp=", toString(kLp), " kLpNew=", toString(kLpNew), " amountAssetBalance=", toString(amountAssetBalance), " priceAssetBalance=", toString(priceAssetBalance), " amountAssetBalanceDelta=", toString(amountAssetBalanceDelta), " priceAssetBalanceDelta=", toString(priceAssetBalanceDelta), " height=", toString(height)], "")
703703 $Tuple2(isOrderValid, info)
704704 }
705705 }
706706
707707
708708 func commonGet (i) = if ((size(i.payments) != 1))
709709 then throw("exactly 1 payment is expected")
710710 else {
711711 let pmt = value(i.payments[0])
712712 let pmtAssetId = value(pmt.assetId)
713713 let pmtAmt = pmt.amount
714714 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller)
715715 let outAmAmt = res._1
716716 let outPrAmt = res._2
717717 let state = res._10
718718 let isGetDisabled = if (!(isAddressWhitelisted(i.caller)))
719719 then if (isGlobalShutdown())
720720 then true
721721 else (cfgPoolStatus == PoolShutdown)
722722 else false
723723 if (isGetDisabled)
724724 then throw(("Get operation is blocked by admin. Status = " + toString(cfgPoolStatus)))
725725 else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state)
726726 }
727727
728728
729729 func commonPut (i,slippageTolerance,emitLp) = if ((size(i.payments) != 2))
730730 then throw("exactly 2 payments are expected")
731731 else {
732732 let amAssetPmt = value(i.payments[0])
733733 let prAssetPmt = value(i.payments[1])
734734 let estPut = estimatePutOperation(toBase58String(i.transactionId), slippageTolerance, amAssetPmt.amount, amAssetPmt.assetId, prAssetPmt.amount, prAssetPmt.assetId, toString(i.caller), false, emitLp)
735735 let isPutDisabled = if (!(isAddressWhitelisted(i.caller)))
736736 then if (if (isGlobalShutdown())
737737 then true
738738 else (cfgPoolStatus == PoolPutDisabled))
739739 then true
740740 else (cfgPoolStatus == PoolShutdown)
741741 else false
742742 if (isPutDisabled)
743743 then throw(("Put operation is blocked by admin. Status = " + toString(cfgPoolStatus)))
744744 else estPut
745745 }
746746
747747
748748 func emit (amount) = {
749749 let emitInv = invoke(factoryContract, "emit", [amount], nil)
750750 if ((emitInv == emitInv))
751751 then {
752752 let emitInvLegacy = match emitInv {
753753 case legacyFactoryContract: Address =>
754754 invoke(legacyFactoryContract, "emit", [amount], nil)
755755 case _ =>
756756 unit
757757 }
758758 if ((emitInvLegacy == emitInvLegacy))
759759 then amount
760760 else throw("Strict value is not equal to itself.")
761761 }
762762 else throw("Strict value is not equal to itself.")
763763 }
764764
765765
766766 func takeFee (amount,fee) = {
767767 let feeAmount = if ((fee == 0))
768768 then 0
769769 else fraction(amount, fee, scale8)
770770 $Tuple2((amount - feeAmount), feeAmount)
771771 }
772772
773773
774774 func calcPutOneToken (paymentAmountRaw,paymentAssetId,userAddress,txId) = {
775775 let isEval = (txId == unit)
776776 let amountBalanceRaw = getAccBalance(assetIdToString(cfgAmountAssetId))
777777 let priceBalanceRaw = getAccBalance(assetIdToString(cfgPriceAssetId))
778778 let paymentInAmountAsset = if ((paymentAssetId == cfgAmountAssetId))
779779 then true
780780 else if ((paymentAssetId == cfgPriceAssetId))
781781 then false
782782 else throwErr("invalid asset")
783- let $t03345533748 = if (isEval)
783+ let $t03338833681 = if (isEval)
784784 then $Tuple2(amountBalanceRaw, priceBalanceRaw)
785785 else if (paymentInAmountAsset)
786786 then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw)
787787 else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw))
788- let amountBalanceOld = $t03345533748._1
789- let priceBalanceOld = $t03345533748._2
790- let $t03375233901 = if (paymentInAmountAsset)
788+ let amountBalanceOld = $t03338833681._1
789+ let priceBalanceOld = $t03338833681._2
790+ let $t03368533834 = if (paymentInAmountAsset)
791791 then $Tuple2(paymentAmountRaw, 0)
792792 else $Tuple2(0, paymentAmountRaw)
793- let amountAssetAmountRaw = $t03375233901._1
794- let priceAssetAmountRaw = $t03375233901._2
793+ let amountAssetAmountRaw = $t03368533834._1
794+ let priceAssetAmountRaw = $t03368533834._2
795795 let amountAssetAmount = takeFee(amountAssetAmountRaw, inFee)._1
796796 let priceAssetAmount = takeFee(priceAssetAmountRaw, inFee)._1
797- let $t03403334097 = takeFee(paymentAmountRaw, inFee)
798- let paymentAmount = $t03403334097._1
799- let feeAmount = $t03403334097._2
797+ let $t03396634030 = takeFee(paymentAmountRaw, inFee)
798+ let paymentAmount = $t03396634030._1
799+ let feeAmount = $t03396634030._2
800800 let amountBalanceNew = (amountBalanceOld + amountAssetAmount)
801801 let priceBalanceNew = (priceBalanceOld + priceAssetAmount)
802802 let priceNewX18 = calcPriceBigInt(toX18(priceBalanceNew, cfgPriceAssetDecimals), toX18(amountBalanceNew, cfgAmountAssetDecimals))
803803 let priceNew = fromX18(priceNewX18, scale8)
804804 let paymentBalance = if (paymentInAmountAsset)
805805 then amountBalanceOld
806806 else priceBalanceOld
807807 let paymentBalanceBigInt = toBigInt(paymentBalance)
808808 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
809809 let chechSupply = if ((supplyBigInt > big0))
810810 then true
811811 else throwErr("initial deposit requires all coins")
812812 if ((chechSupply == chechSupply))
813813 then {
814814 let depositBigInt = toBigInt(paymentAmount)
815815 let issueAmount = max([0, toInt(((supplyBigInt * (sqrtBigInt((scale18 + ((depositBigInt * scale18) / paymentBalanceBigInt)), 18, 18, DOWN) - scale18)) / scale18))])
816816 let commonState = if (isEval)
817817 then nil
818818 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))]
819819 let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, cfgPriceAssetDecimals), toX18(amountBalanceOld, cfgAmountAssetDecimals))
820820 let priceOld = fromX18(priceOldX18, scale8)
821821 let loss = {
822- let $t03577835945 = if (paymentInAmountAsset)
822+ let $t03571135878 = if (paymentInAmountAsset)
823823 then $Tuple2(amountAssetAmountRaw, amountBalanceOld)
824824 else $Tuple2(priceAssetAmountRaw, priceBalanceOld)
825- let amount = $t03577835945._1
826- let balance = $t03577835945._2
825+ let amount = $t03571135878._1
826+ let balance = $t03571135878._2
827827 let issueAmountBoth = toInt(fraction(supplyBigInt, toBigInt((amount / 2)), toBigInt(balance)))
828828 fraction((issueAmount - issueAmountBoth), scale8, issueAmountBoth)
829829 }
830830 $Tuple5(issueAmount, commonState, feeAmount, loss, paymentInAmountAsset)
831831 }
832832 else throw("Strict value is not equal to itself.")
833833 }
834834
835835
836836 func calcGetOneToken (outAssetId,paymentAmount,paymentAssetId,userAddress,txId) = {
837837 let isEval = (txId == unit)
838838 let cfg = getPoolConfig()
839839 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
840840 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
841841 let checks = [if ((paymentAssetId == cfgLpAssetId))
842842 then true
843843 else throwErr("invalid lp asset")]
844844 if ((checks == checks))
845845 then {
846846 let outInAmountAsset = if ((outAssetId == cfgAmountAssetId))
847847 then true
848848 else if ((outAssetId == cfgPriceAssetId))
849849 then false
850850 else throwErr("invalid asset")
851851 let balanceBigInt = if (outInAmountAsset)
852852 then toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId)))
853853 else toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId)))
854854 let outInAmountAssetDecimals = if (outInAmountAsset)
855855 then amtAssetDcm
856856 else priceAssetDcm
857857 let amBalanceOld = getAccBalance(assetIdToString(cfgAmountAssetId))
858858 let prBalanceOld = getAccBalance(assetIdToString(cfgPriceAssetId))
859859 let outBalance = if (outInAmountAsset)
860860 then amBalanceOld
861861 else prBalanceOld
862862 let outBalanceBigInt = toBigInt(outBalance)
863863 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
864864 let redeemedBigInt = toBigInt(paymentAmount)
865865 let amountRaw = max([0, toInt(((balanceBigInt * (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN))) / scale18))])
866- let $t03802338079 = takeFee(amountRaw, outFee)
867- let totalAmount = $t03802338079._1
868- let feeAmount = $t03802338079._2
869- let $t03808338309 = if (outInAmountAsset)
866+ let $t03795638012 = takeFee(amountRaw, outFee)
867+ let totalAmount = $t03795638012._1
868+ let feeAmount = $t03795638012._2
869+ let $t03801638242 = if (outInAmountAsset)
870870 then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld)
871871 else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw))
872- let outAmAmount = $t03808338309._1
873- let outPrAmount = $t03808338309._2
874- let amBalanceNew = $t03808338309._3
875- let prBalanceNew = $t03808338309._4
872+ let outAmAmount = $t03801638242._1
873+ let outPrAmount = $t03801638242._2
874+ let amBalanceNew = $t03801638242._3
875+ let prBalanceNew = $t03801638242._4
876876 let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, cfgPriceAssetDecimals), toX18(amBalanceNew, cfgAmountAssetDecimals))
877877 let priceNew = fromX18(priceNewX18, scale8)
878878 let commonState = if (isEval)
879879 then nil
880880 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)]
881881 let priceOldX18 = calcPriceBigInt(toX18(prBalanceOld, cfgPriceAssetDecimals), toX18(amBalanceOld, cfgAmountAssetDecimals))
882882 let priceOld = fromX18(priceOldX18, scale8)
883883 let loss = {
884884 let amountBothInPaymentAsset = (toInt(fraction(balanceBigInt, redeemedBigInt, supplyBigInt)) * 2)
885885 fraction((totalAmount - amountBothInPaymentAsset), scale8, amountBothInPaymentAsset)
886886 }
887887 $Tuple5(totalAmount, commonState, feeAmount, loss, outInAmountAsset)
888888 }
889889 else throw("Strict value is not equal to itself.")
890890 }
891891
892892
893893 func managerPublicKeyOrUnit () = {
894894 let managerVaultAddress = getManagerVaultAddressOrThis()
895895 match getString(managerVaultAddress, keyManagerPublicKey()) {
896896 case s: String =>
897897 fromBase58String(s)
898898 case _: Unit =>
899899 unit
900900 case _ =>
901901 throw("Match error")
902902 }
903903 }
904904
905905
906906 func isManager (i) = match managerPublicKeyOrUnit() {
907907 case pk: ByteVector =>
908908 (i.callerPublicKey == pk)
909909 case _: Unit =>
910910 (i.caller == this)
911911 case _ =>
912912 throw("Match error")
913913 }
914914
915915
916916 func mustManager (i) = {
917917 let pd = throw("Permission denied")
918918 match managerPublicKeyOrUnit() {
919919 case pk: ByteVector =>
920920 if ((i.callerPublicKey == pk))
921921 then true
922922 else pd
923923 case _: Unit =>
924924 if ((i.caller == this))
925925 then true
926926 else pd
927927 case _ =>
928928 throw("Match error")
929929 }
930930 }
931931
932932
933933 @Callable(i)
934934 func rebalance () = (rebalanceAsset(getStringOrFail(this, aa())) ++ rebalanceAsset(getStringOrFail(this, pa())))
935935
936936
937937
938938 @Callable(i)
939939 func calculateAmountOutForSwapREADONLY (cleanAmountIn,isReverse,feePoolAmount) = {
940- let $t04016740472 = if ((isReverse == false))
940+ let $t04010040405 = if ((isReverse == false))
941941 then {
942942 let assetOut = getStringOrFail(this, pa())
943943 let assetIn = getStringOrFail(this, aa())
944944 $Tuple2(assetOut, assetIn)
945945 }
946946 else {
947947 let assetOut = getStringOrFail(this, aa())
948948 let assetIn = getStringOrFail(this, pa())
949949 $Tuple2(assetOut, assetIn)
950950 }
951- let assetOut = $t04016740472._1
952- let assetIn = $t04016740472._2
951+ let assetOut = $t04010040405._1
952+ let assetIn = $t04010040405._2
953953 let poolAssetInBalance = getAccBalance(assetIn)
954954 let poolAssetOutBalance = getAccBalance(assetOut)
955955 let amountOut = fraction(poolAssetOutBalance, cleanAmountIn, (poolAssetInBalance + cleanAmountIn))
956956 let oldK = (toBigInt(poolAssetInBalance) * toBigInt(poolAssetOutBalance))
957957 let newK = (((toBigInt(getAccBalance(assetIn)) + toBigInt(cleanAmountIn)) + toBigInt(feePoolAmount)) * (toBigInt(getAccBalance(assetOut)) - toBigInt(amountOut)))
958958 let checkK = if ((newK >= oldK))
959959 then true
960960 else throw("new K is fewer error")
961961 if ((checkK == checkK))
962962 then $Tuple2(nil, amountOut)
963963 else throw("Strict value is not equal to itself.")
964964 }
965965
966966
967967
968968 @Callable(i)
969969 func calculateAmountOutForSwapAndSendTokens (cleanAmountIn,isReverse,amountOutMin,addressTo,feePoolAmount) = {
970970 let swapContact = {
971971 let @ = invoke(factoryContract, "getSwapContractREADONLY", nil, nil)
972972 if ($isInstanceOf(@, "String"))
973973 then @
974974 else throw(($getType(@) + " couldn't be cast to String"))
975975 }
976976 let isPoolSwapDisabled = {
977977 let @ = invoke(factoryContract, "isPoolSwapDisabledREADONLY", [toString(this)], nil)
978978 if ($isInstanceOf(@, "Boolean"))
979979 then @
980980 else throw(($getType(@) + " couldn't be cast to Boolean"))
981981 }
982982 let isSwapDisabled = if (!(isAddressWhitelisted(i.caller)))
983983 then if (if (isGlobalShutdown())
984984 then true
985985 else (cfgPoolStatus == PoolShutdown))
986986 then true
987987 else isPoolSwapDisabled
988988 else false
989989 let checks = [if (if (!(isSwapDisabled))
990990 then true
991991 else isManager(i))
992992 then true
993993 else throwErr("swap operation is blocked by admin"), if ((value(i.payments[0]).amount >= cleanAmountIn))
994994 then true
995995 else throwErr("Wrong amount"), if ((i.caller == addressFromStringValue(swapContact)))
996996 then true
997997 else throwErr("Permission denied")]
998998 if ((checks == checks))
999999 then {
10001000 let pmt = value(i.payments[0])
10011001 let assetIn = assetIdToString(pmt.assetId)
10021002 let assetOut = if ((isReverse == false))
10031003 then getStringOrFail(this, pa())
10041004 else getStringOrFail(this, aa())
1005- let poolAssetInBalance = (getAccBalance(assetIn) - value(i.payments[0]).amount)
1005+ let poolAssetInBalance = ((getAccBalance(assetIn) - value(i.payments[0]).amount) - feePoolAmount)
10061006 let poolAssetOutBalance = getAccBalance(assetOut)
10071007 let amountOut = fraction(poolAssetOutBalance, cleanAmountIn, (poolAssetInBalance + cleanAmountIn))
10081008 let oldK = (toBigInt(poolAssetInBalance) * toBigInt(poolAssetOutBalance))
1009- let newK = (toBigInt(getAccBalance(assetIn)) * (toBigInt(getAccBalance(assetOut)) - toBigInt(amountOut)))
1009+ let newK = ((toBigInt(getAccBalance(assetIn)) + toBigInt(feePoolAmount)) * (toBigInt(getAccBalance(assetOut)) - toBigInt(amountOut)))
10101010 let checkK = if ((newK >= oldK))
10111011 then true
10121012 else throw("new K is fewer error")
10131013 if ((checkK == checkK))
10141014 then {
10151015 let checkMin = if ((amountOut >= amountOutMin))
10161016 then true
10171017 else throw("Exchange result is fewer coins than expected")
10181018 if ((checkMin == checkMin))
10191019 then {
1020- let priceAssetId = getStringOrFail(this, pa())
1021- let feeAssetId = fromBase58String(priceAssetId)
1022- let feeAmount = fraction(cleanAmountIn, feePoolAmount, 100)
1023- let rebalanceState = rebalanceAsset(assetIn)
1024- if ((rebalanceState == rebalanceState))
1020+ let amountAssetBalanceDelta = if (isReverse)
1021+ then -(amountOut)
1022+ else feePoolAmount
1023+ let priceAssetBalanceDelta = if (isReverse)
1024+ then feePoolAmount
1025+ else -(amountOut)
1026+ let refreshKLpActions = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)._1
1027+ if ((refreshKLpActions == refreshKLpActions))
10251028 then {
1026- let withdrawState = withdrawAndRebalanceAsset(assetOut, (amountOut + feeAmount))
1027- if ((withdrawState == withdrawState))
1029+ let rebalanceState = rebalanceAsset(assetIn)
1030+ if ((rebalanceState == rebalanceState))
10281031 then {
1029- let feeTransfer = ScriptTransfer(feeCollectorAddress, feeAmount, feeAssetId)
1030- $Tuple2(((withdrawState ++ rebalanceState) ++ [ScriptTransfer(addressFromStringValue(addressTo), (amountOut - feeAmount), parseAssetId(assetOut)), feeTransfer]), amountOut)
1032+ let withdrawState = withdrawAndRebalanceAsset(assetOut, amountOut)
1033+ if ((withdrawState == withdrawState))
1034+ then $Tuple2(((withdrawState ++ rebalanceState) ++ [ScriptTransfer(addressFromStringValue(addressTo), amountOut, parseAssetId(assetOut))]), amountOut)
1035+ else throw("Strict value is not equal to itself.")
10311036 }
10321037 else throw("Strict value is not equal to itself.")
10331038 }
10341039 else throw("Strict value is not equal to itself.")
10351040 }
10361041 else throw("Strict value is not equal to itself.")
10371042 }
10381043 else throw("Strict value is not equal to itself.")
10391044 }
10401045 else throw("Strict value is not equal to itself.")
10411046 }
10421047
10431048
10441049
10451050 @Callable(i)
10461051 func put (slippageTolerance,shouldAutoStake) = if ((0 > slippageTolerance))
10471052 then throw("Invalid slippageTolerance passed")
10481053 else {
10491054 let estPut = commonPut(i, slippageTolerance, true)
10501055 let emitLpAmt = estPut._2
10511056 let lpAssetId = estPut._7
10521057 let state = estPut._9
10531058 let amDiff = estPut._10
10541059 let prDiff = estPut._11
10551060 let amId = estPut._12
10561061 let prId = estPut._13
10571062 let amAssetPmt = toBigInt(value(i.payments[0]).amount)
10581063 let prAssetPmt = toBigInt(value(i.payments[1]).amount)
10591064 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
10601065 if ((currentKLp == currentKLp))
10611066 then {
10621067 let emitInv = invoke(factoryContract, "emit", [emitLpAmt], nil)
10631068 if ((emitInv == emitInv))
10641069 then {
10651070 let emitInvLegacy = match emitInv {
10661071 case legacyFactoryContract: Address =>
10671072 invoke(legacyFactoryContract, "emit", [emitLpAmt], nil)
10681073 case _ =>
10691074 unit
10701075 }
10711076 if ((emitInvLegacy == emitInvLegacy))
10721077 then {
10731078 let slippageAInv = if ((amDiff > 0))
10741079 then invoke(slippageContract, "put", nil, [AttachedPayment(amId, amDiff)])
10751080 else nil
10761081 if ((slippageAInv == slippageAInv))
10771082 then {
10781083 let slippagePInv = if ((prDiff > 0))
10791084 then invoke(slippageContract, "put", nil, [AttachedPayment(prId, prDiff)])
10801085 else nil
10811086 if ((slippagePInv == slippagePInv))
10821087 then {
10831088 let lpTransfer = if (shouldAutoStake)
10841089 then {
10851090 let slpStakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)])
10861091 if ((slpStakeInv == slpStakeInv))
10871092 then nil
10881093 else throw("Strict value is not equal to itself.")
10891094 }
10901095 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
1091- let $t04559246054 = refreshKLpInternal(0, 0, 0)
1092- if (($t04559246054 == $t04559246054))
1096+ let $t04558146043 = refreshKLpInternal(0, 0, 0)
1097+ if (($t04558146043 == $t04558146043))
10931098 then {
1094- let updatedKLp = $t04559246054._2
1095- let refreshKLpActions = $t04559246054._1
1099+ let updatedKLp = $t04558146043._2
1100+ let refreshKLpActions = $t04558146043._1
10961101 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10971102 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10981103 then {
10991104 let reb = invoke(this, "rebalance", nil, nil)
11001105 if ((reb == reb))
11011106 then ((state ++ lpTransfer) ++ refreshKLpActions)
11021107 else throw("Strict value is not equal to itself.")
11031108 }
11041109 else throw("Strict value is not equal to itself.")
11051110 }
11061111 else throw("Strict value is not equal to itself.")
11071112 }
11081113 else throw("Strict value is not equal to itself.")
11091114 }
11101115 else throw("Strict value is not equal to itself.")
11111116 }
11121117 else throw("Strict value is not equal to itself.")
11131118 }
11141119 else throw("Strict value is not equal to itself.")
11151120 }
11161121 else throw("Strict value is not equal to itself.")
11171122 }
11181123
11191124
11201125
11211126 @Callable(i)
11221127 func putForFree (maxSlippage) = if ((0 > maxSlippage))
11231128 then throw("Invalid value passed")
11241129 else {
11251130 let estPut = commonPut(i, maxSlippage, false)
11261131 let state = estPut._9
11271132 let amAssetPmt = toBigInt(value(i.payments[0]).amount)
11281133 let prAssetPmt = toBigInt(value(i.payments[1]).amount)
11291134 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
11301135 if ((currentKLp == currentKLp))
11311136 then {
1132- let $t04666646731 = refreshKLpInternal(0, 0, 0)
1133- let refreshKLpActions = $t04666646731._1
1134- let updatedKLp = $t04666646731._2
1137+ let $t04665546720 = refreshKLpInternal(0, 0, 0)
1138+ let refreshKLpActions = $t04665546720._1
1139+ let updatedKLp = $t04665546720._2
11351140 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11361141 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11371142 then (state ++ refreshKLpActions)
11381143 else throw("Strict value is not equal to itself.")
11391144 }
11401145 else throw("Strict value is not equal to itself.")
11411146 }
11421147
11431148
11441149
11451150 @Callable(i)
11461151 func putOneTkn (minOutAmount,autoStake) = {
11471152 let isPoolOneTokenOperationsDisabled = {
11481153 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
11491154 if ($isInstanceOf(@, "Boolean"))
11501155 then @
11511156 else throw(($getType(@) + " couldn't be cast to Boolean"))
11521157 }
11531158 let isPutDisabled = if (!(isAddressWhitelisted(i.caller)))
11541159 then if (if (if (isGlobalShutdown())
11551160 then true
11561161 else (cfgPoolStatus == PoolPutDisabled))
11571162 then true
11581163 else (cfgPoolStatus == PoolShutdown))
11591164 then true
11601165 else isPoolOneTokenOperationsDisabled
11611166 else false
11621167 let checks = [if (if (!(isPutDisabled))
11631168 then true
11641169 else isManager(i))
11651170 then true
11661171 else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1))
11671172 then true
11681173 else throwErr("exactly 1 payment are expected")]
11691174 if ((checks == checks))
11701175 then {
11711176 let payment = i.payments[0]
11721177 let paymentAssetId = payment.assetId
11731178 let paymentAmountRaw = payment.amount
11741179 let currentKLp = if ((paymentAssetId == cfgAmountAssetId))
11751180 then calcCurrentKLp(toBigInt(paymentAmountRaw), toBigInt(0), toBigInt(0))
11761181 else if ((paymentAssetId == cfgPriceAssetId))
11771182 then calcCurrentKLp(toBigInt(0), toBigInt(paymentAmountRaw), toBigInt(0))
11781183 else throwErr("payment asset is not supported")
11791184 if ((currentKLp == currentKLp))
11801185 then {
11811186 let userAddress = i.caller
11821187 let txId = i.transactionId
1183- let $t04796048112 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
1184- if (($t04796048112 == $t04796048112))
1188+ let $t04794948101 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
1189+ if (($t04794948101 == $t04794948101))
11851190 then {
1186- let paymentInAmountAsset = $t04796048112._5
1187- let bonus = $t04796048112._4
1188- let feeAmount = $t04796048112._3
1189- let commonState = $t04796048112._2
1190- let emitAmountEstimated = $t04796048112._1
1191+ let paymentInAmountAsset = $t04794948101._5
1192+ let bonus = $t04794948101._4
1193+ let feeAmount = $t04794948101._3
1194+ let commonState = $t04794948101._2
1195+ let emitAmountEstimated = $t04794948101._1
11911196 let emitAmount = if (if ((minOutAmount > 0))
11921197 then (minOutAmount > emitAmountEstimated)
11931198 else false)
11941199 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
11951200 else emitAmountEstimated
11961201 let emitInv = emit(emitAmount)
11971202 if ((emitInv == emitInv))
11981203 then {
11991204 let lpTransfer = if (autoStake)
12001205 then {
12011206 let stakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(cfgLpAssetId, emitAmount)])
12021207 if ((stakeInv == stakeInv))
12031208 then nil
12041209 else throw("Strict value is not equal to itself.")
12051210 }
12061211 else [ScriptTransfer(i.caller, emitAmount, cfgLpAssetId)]
12071212 let sendFee = if ((feeAmount > 0))
12081213 then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
12091214 else nil
1210- let $t04869848895 = if ((this == feeCollectorAddress))
1215+ let $t04868748884 = if ((this == feeCollectorAddress))
12111216 then $Tuple2(0, 0)
12121217 else if (paymentInAmountAsset)
12131218 then $Tuple2(-(feeAmount), 0)
12141219 else $Tuple2(0, -(feeAmount))
1215- let amountAssetBalanceDelta = $t04869848895._1
1216- let priceAssetBalanceDelta = $t04869848895._2
1217- let $t04889849006 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1218- let refreshKLpActions = $t04889849006._1
1219- let updatedKLp = $t04889849006._2
1220+ let amountAssetBalanceDelta = $t04868748884._1
1221+ let priceAssetBalanceDelta = $t04868748884._2
1222+ let $t04888748995 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1223+ let refreshKLpActions = $t04888748995._1
1224+ let updatedKLp = $t04888748995._2
12201225 let kLp = value(getString(keyKLp))
12211226 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
12221227 if ((isUpdatedKLpValid == isUpdatedKLpValid))
12231228 then {
12241229 let reb = invoke(this, "rebalance", nil, nil)
12251230 if ((reb == reb))
12261231 then $Tuple2((((commonState ++ lpTransfer) ++ sendFee) ++ refreshKLpActions), emitAmount)
12271232 else throw("Strict value is not equal to itself.")
12281233 }
12291234 else throw("Strict value is not equal to itself.")
12301235 }
12311236 else throw("Strict value is not equal to itself.")
12321237 }
12331238 else throw("Strict value is not equal to itself.")
12341239 }
12351240 else throw("Strict value is not equal to itself.")
12361241 }
12371242 else throw("Strict value is not equal to itself.")
12381243 }
12391244
12401245
12411246
12421247 @Callable(i)
12431248 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
1244- let $t04936149518 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
1245- let emitAmountEstimated = $t04936149518._1
1246- let commonState = $t04936149518._2
1247- let feeAmount = $t04936149518._3
1248- let bonus = $t04936149518._4
1249- let paymentInAmountAsset = $t04936149518._5
1249+ let $t04935049507 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
1250+ let emitAmountEstimated = $t04935049507._1
1251+ let commonState = $t04935049507._2
1252+ let feeAmount = $t04935049507._3
1253+ let bonus = $t04935049507._4
1254+ let paymentInAmountAsset = $t04935049507._5
12501255 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
12511256 }
12521257
12531258
12541259
12551260 @Callable(i)
12561261 func getOneTkn (outAssetIdStr,minOutAmount) = {
12571262 let isPoolOneTokenOperationsDisabled = {
12581263 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
12591264 if ($isInstanceOf(@, "Boolean"))
12601265 then @
12611266 else throw(($getType(@) + " couldn't be cast to Boolean"))
12621267 }
12631268 let isGetDisabled = if (!(isAddressWhitelisted(i.caller)))
12641269 then if (if (isGlobalShutdown())
12651270 then true
12661271 else (cfgPoolStatus == PoolShutdown))
12671272 then true
12681273 else isPoolOneTokenOperationsDisabled
12691274 else false
12701275 let checks = [if (if (!(isGetDisabled))
12711276 then true
12721277 else isManager(i))
12731278 then true
12741279 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1))
12751280 then true
12761281 else throwErr("exactly 1 payment are expected")]
12771282 if ((checks == checks))
12781283 then {
12791284 let outAssetId = parseAssetId(outAssetIdStr)
12801285 let payment = i.payments[0]
12811286 let paymentAssetId = payment.assetId
12821287 let paymentAmount = payment.amount
12831288 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
12841289 if ((currentKLp == currentKLp))
12851290 then {
12861291 let userAddress = i.caller
12871292 let txId = i.transactionId
1288- let $t05044050593 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
1289- if (($t05044050593 == $t05044050593))
1293+ let $t05042950582 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
1294+ if (($t05042950582 == $t05042950582))
12901295 then {
1291- let outInAmountAsset = $t05044050593._5
1292- let bonus = $t05044050593._4
1293- let feeAmount = $t05044050593._3
1294- let commonState = $t05044050593._2
1295- let amountEstimated = $t05044050593._1
1296+ let outInAmountAsset = $t05042950582._5
1297+ let bonus = $t05042950582._4
1298+ let feeAmount = $t05042950582._3
1299+ let commonState = $t05042950582._2
1300+ let amountEstimated = $t05042950582._1
12961301 let amount = if (if ((minOutAmount > 0))
12971302 then (minOutAmount > amountEstimated)
12981303 else false)
12991304 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
13001305 else amountEstimated
13011306 let burnInv = invoke(factoryContract, "burn", [paymentAmount], [AttachedPayment(paymentAssetId, paymentAmount)])
13021307 if ((burnInv == burnInv))
13031308 then {
13041309 let withdrawState = withdrawAndRebalanceAsset(outAssetIdStr, (amount + max([0, feeAmount])))
13051310 let assetTransfer = [ScriptTransfer(userAddress, amount, outAssetId)]
13061311 let sendFee = if ((feeAmount > 0))
13071312 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
13081313 else nil
1309- let $t05125751504 = {
1314+ let $t05124651493 = {
13101315 let feeAmountForCalc = if ((this == feeCollectorAddress))
13111316 then 0
13121317 else feeAmount
13131318 if (outInAmountAsset)
13141319 then $Tuple2(-((amount + feeAmountForCalc)), 0)
13151320 else $Tuple2(0, -((amount + feeAmountForCalc)))
13161321 }
1317- let amountAssetBalanceDelta = $t05125751504._1
1318- let priceAssetBalanceDelta = $t05125751504._2
1319- let $t05150751615 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1320- let refreshKLpActions = $t05150751615._1
1321- let updatedKLp = $t05150751615._2
1322+ let amountAssetBalanceDelta = $t05124651493._1
1323+ let priceAssetBalanceDelta = $t05124651493._2
1324+ let $t05149651604 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1325+ let refreshKLpActions = $t05149651604._1
1326+ let updatedKLp = $t05149651604._2
13221327 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
13231328 if ((isUpdatedKLpValid == isUpdatedKLpValid))
13241329 then $Tuple2(((((commonState ++ withdrawState) ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
13251330 else throw("Strict value is not equal to itself.")
13261331 }
13271332 else throw("Strict value is not equal to itself.")
13281333 }
13291334 else throw("Strict value is not equal to itself.")
13301335 }
13311336 else throw("Strict value is not equal to itself.")
13321337 }
13331338 else throw("Strict value is not equal to itself.")
13341339 }
13351340
13361341
13371342
13381343 @Callable(i)
13391344 func getOneTknREADONLY (outAssetId,paymentAmount) = {
1340- let $t05189352049 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
1341- let amountEstimated = $t05189352049._1
1342- let commonState = $t05189352049._2
1343- let feeAmount = $t05189352049._3
1344- let bonus = $t05189352049._4
1345- let outInAmountAsset = $t05189352049._5
1345+ let $t05188252038 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
1346+ let amountEstimated = $t05188252038._1
1347+ let commonState = $t05188252038._2
1348+ let feeAmount = $t05188252038._3
1349+ let bonus = $t05188252038._4
1350+ let outInAmountAsset = $t05188252038._5
13461351 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
13471352 }
13481353
13491354
13501355
13511356 @Callable(i)
13521357 func unstakeAndGetOneTkn (unstakeAmount,outAssetIdStr,minOutAmount) = {
13531358 let isPoolOneTokenOperationsDisabled = {
13541359 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
13551360 if ($isInstanceOf(@, "Boolean"))
13561361 then @
13571362 else throw(($getType(@) + " couldn't be cast to Boolean"))
13581363 }
13591364 let isGetDisabled = if (!(isAddressWhitelisted(i.caller)))
13601365 then if (if (isGlobalShutdown())
13611366 then true
13621367 else (cfgPoolStatus == PoolShutdown))
13631368 then true
13641369 else isPoolOneTokenOperationsDisabled
13651370 else false
13661371 let checks = [if (if (!(isGetDisabled))
13671372 then true
13681373 else isManager(i))
13691374 then true
13701375 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 0))
13711376 then true
13721377 else throwErr("no payments are expected")]
13731378 if ((checks == checks))
13741379 then {
13751380 let outAssetId = parseAssetId(outAssetIdStr)
13761381 let userAddress = i.caller
13771382 let txId = i.transactionId
13781383 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
13791384 if ((currentKLp == currentKLp))
13801385 then {
13811386 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
13821387 if ((unstakeInv == unstakeInv))
13831388 then {
1384- let $t05299153142 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1385- if (($t05299153142 == $t05299153142))
1389+ let $t05298053131 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1390+ if (($t05298053131 == $t05298053131))
13861391 then {
1387- let outInAmountAsset = $t05299153142._5
1388- let bonus = $t05299153142._4
1389- let feeAmount = $t05299153142._3
1390- let commonState = $t05299153142._2
1391- let amountEstimated = $t05299153142._1
1392+ let outInAmountAsset = $t05298053131._5
1393+ let bonus = $t05298053131._4
1394+ let feeAmount = $t05298053131._3
1395+ let commonState = $t05298053131._2
1396+ let amountEstimated = $t05298053131._1
13921397 let amount = if (if ((minOutAmount > 0))
13931398 then (minOutAmount > amountEstimated)
13941399 else false)
13951400 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
13961401 else amountEstimated
13971402 let burnInv = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
13981403 if ((burnInv == burnInv))
13991404 then {
14001405 let withdrawState = withdrawAndRebalanceAsset(outAssetIdStr, (amount + max([0, feeAmount])))
14011406 let assetTransfer = [ScriptTransfer(i.caller, amount, outAssetId)]
14021407 let sendFee = if ((feeAmount > 0))
14031408 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
14041409 else nil
1405- let $t05380154048 = {
1410+ let $t05379054037 = {
14061411 let feeAmountForCalc = if ((this == feeCollectorAddress))
14071412 then 0
14081413 else feeAmount
14091414 if (outInAmountAsset)
14101415 then $Tuple2(-((amount + feeAmountForCalc)), 0)
14111416 else $Tuple2(0, -((amount + feeAmountForCalc)))
14121417 }
1413- let amountAssetBalanceDelta = $t05380154048._1
1414- let priceAssetBalanceDelta = $t05380154048._2
1415- let $t05405154159 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1416- let refreshKLpActions = $t05405154159._1
1417- let updatedKLp = $t05405154159._2
1418+ let amountAssetBalanceDelta = $t05379054037._1
1419+ let priceAssetBalanceDelta = $t05379054037._2
1420+ let $t05404054148 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1421+ let refreshKLpActions = $t05404054148._1
1422+ let updatedKLp = $t05404054148._2
14181423 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
14191424 if ((isUpdatedKLpValid == isUpdatedKLpValid))
14201425 then $Tuple2(((((commonState ++ withdrawState) ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
14211426 else throw("Strict value is not equal to itself.")
14221427 }
14231428 else throw("Strict value is not equal to itself.")
14241429 }
14251430 else throw("Strict value is not equal to itself.")
14261431 }
14271432 else throw("Strict value is not equal to itself.")
14281433 }
14291434 else throw("Strict value is not equal to itself.")
14301435 }
14311436 else throw("Strict value is not equal to itself.")
14321437 }
14331438
14341439
14351440
14361441 @Callable(i)
14371442 func get () = {
14381443 let res = commonGet(i)
14391444 let outAmAmt = res._1
14401445 let outPrAmt = res._2
14411446 let pmtAmt = res._3
14421447 let pmtAssetId = res._4
14431448 let state = res._5
14441449 let withdrawState = withdrawAndRebalanceAll(outAmAmt, outPrAmt)
14451450 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
14461451 if ((currentKLp == currentKLp))
14471452 then {
14481453 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
14491454 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
14501455 then {
1451- let $t05525455335 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1452- let refreshKLpActions = $t05525455335._1
1453- let updatedKLp = $t05525455335._2
1456+ let $t05524355324 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1457+ let refreshKLpActions = $t05524355324._1
1458+ let updatedKLp = $t05524355324._2
14541459 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
14551460 if ((isUpdatedKLpValid == isUpdatedKLpValid))
14561461 then ((withdrawState ++ state) ++ refreshKLpActions)
14571462 else throw("Strict value is not equal to itself.")
14581463 }
14591464 else throw("Strict value is not equal to itself.")
14601465 }
14611466 else throw("Strict value is not equal to itself.")
14621467 }
14631468
14641469
14651470
14661471 @Callable(i)
14671472 func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = {
14681473 let res = commonGet(i)
14691474 let outAmAmt = res._1
14701475 let outPrAmt = res._2
14711476 let pmtAmt = res._3
14721477 let pmtAssetId = res._4
14731478 let state = res._5
14741479 if ((noLessThenAmtAsset > outAmAmt))
14751480 then throw(((("noLessThenAmtAsset failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset)))
14761481 else if ((noLessThenPriceAsset > outPrAmt))
14771482 then throw(((("noLessThenPriceAsset failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset)))
14781483 else {
14791484 let withdrawState = withdrawAndRebalanceAll(outAmAmt, outPrAmt)
14801485 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
14811486 if ((currentKLp == currentKLp))
14821487 then {
14831488 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
14841489 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
14851490 then {
1486- let $t05643056511 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1487- let refreshKLpActions = $t05643056511._1
1488- let updatedKLp = $t05643056511._2
1491+ let $t05641956500 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1492+ let refreshKLpActions = $t05641956500._1
1493+ let updatedKLp = $t05641956500._2
14891494 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
14901495 if ((isUpdatedKLpValid == isUpdatedKLpValid))
14911496 then ((withdrawState ++ state) ++ refreshKLpActions)
14921497 else throw("Strict value is not equal to itself.")
14931498 }
14941499 else throw("Strict value is not equal to itself.")
14951500 }
14961501 else throw("Strict value is not equal to itself.")
14971502 }
14981503 }
14991504
15001505
15011506
15021507 @Callable(i)
15031508 func unstakeAndGet (amount) = {
15041509 let checkPayments = if ((size(i.payments) != 0))
15051510 then throw("No payments are expected")
15061511 else true
15071512 if ((checkPayments == checkPayments))
15081513 then {
15091514 let cfg = getPoolConfig()
15101515 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
15111516 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
15121517 if ((currentKLp == currentKLp))
15131518 then {
15141519 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(lpAssetId), amount], nil)
15151520 if ((unstakeInv == unstakeInv))
15161521 then {
15171522 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller)
15181523 let outAmAmt = res._1
15191524 let outPrAmt = res._2
15201525 let poolStatus = parseIntValue(res._9)
15211526 let state = res._10
15221527 let withdrawState = withdrawAndRebalanceAll(outAmAmt, outPrAmt)
15231528 let isGetDisabled = if (!(isAddressWhitelisted(i.caller)))
15241529 then if (isGlobalShutdown())
15251530 then true
15261531 else (cfgPoolStatus == PoolShutdown)
15271532 else false
15281533 let checkPoolStatus = if (isGetDisabled)
15291534 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
15301535 else true
15311536 if ((checkPoolStatus == checkPoolStatus))
15321537 then {
15331538 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
15341539 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
15351540 then {
1536- let $t05785957940 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1537- let refreshKLpActions = $t05785957940._1
1538- let updatedKLp = $t05785957940._2
1541+ let $t05784857929 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1542+ let refreshKLpActions = $t05784857929._1
1543+ let updatedKLp = $t05784857929._2
15391544 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
15401545 if ((isUpdatedKLpValid == isUpdatedKLpValid))
15411546 then ((withdrawState ++ state) ++ refreshKLpActions)
15421547 else throw("Strict value is not equal to itself.")
15431548 }
15441549 else throw("Strict value is not equal to itself.")
15451550 }
15461551 else throw("Strict value is not equal to itself.")
15471552 }
15481553 else throw("Strict value is not equal to itself.")
15491554 }
15501555 else throw("Strict value is not equal to itself.")
15511556 }
15521557 else throw("Strict value is not equal to itself.")
15531558 }
15541559
15551560
15561561
15571562 @Callable(i)
15581563 func unstakeAndGetNoLess (unstakeAmount,noLessThenAmountAsset,noLessThenPriceAsset) = {
15591564 let isGetDisabled = if (!(isAddressWhitelisted(i.caller)))
15601565 then if (isGlobalShutdown())
15611566 then true
15621567 else (cfgPoolStatus == PoolShutdown)
15631568 else false
15641569 let checks = [if (!(isGetDisabled))
15651570 then true
15661571 else throw("get operation is blocked by admin"), if ((size(i.payments) == 0))
15671572 then true
15681573 else throw("no payments are expected")]
15691574 if ((checks == checks))
15701575 then {
15711576 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
15721577 if ((currentKLp == currentKLp))
15731578 then {
15741579 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
15751580 if ((unstakeInv == unstakeInv))
15761581 then {
15771582 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller)
15781583 let outAmAmt = res._1
15791584 let outPrAmt = res._2
15801585 let state = res._10
15811586 let withdrawState = withdrawAndRebalanceAll(outAmAmt, outPrAmt)
15821587 let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset))
15831588 then true
15841589 else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset))
15851590 then true
15861591 else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))]
15871592 if ((checkAmounts == checkAmounts))
15881593 then {
15891594 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
15901595 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
15911596 then {
1592- let $t05941859499 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1593- let refreshKLpActions = $t05941859499._1
1594- let updatedKLp = $t05941859499._2
1597+ let $t05940759488 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1598+ let refreshKLpActions = $t05940759488._1
1599+ let updatedKLp = $t05940759488._2
15951600 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
15961601 if ((isUpdatedKLpValid == isUpdatedKLpValid))
15971602 then ((withdrawState ++ state) ++ refreshKLpActions)
15981603 else throw("Strict value is not equal to itself.")
15991604 }
16001605 else throw("Strict value is not equal to itself.")
16011606 }
16021607 else throw("Strict value is not equal to itself.")
16031608 }
16041609 else throw("Strict value is not equal to itself.")
16051610 }
16061611 else throw("Strict value is not equal to itself.")
16071612 }
16081613 else throw("Strict value is not equal to itself.")
16091614 }
16101615
16111616
16121617
16131618 @Callable(i)
16141619 func activate (amtAssetStr,priceAssetStr) = if ((toString(i.caller) != toString(factoryContract)))
16151620 then throw("permissions denied")
16161621 else $Tuple2([StringEntry(aa(), amtAssetStr), StringEntry(pa(), priceAssetStr)], "success")
16171622
16181623
16191624
16201625 @Callable(i)
16211626 func refreshKLp () = {
16221627 let lastRefreshedBlockHeight = valueOrElse(getInteger(keyKLpRefreshedHeight), 0)
16231628 let checkLastRefreshedBlockHeight = if (((height - lastRefreshedBlockHeight) >= kLpRefreshDelay))
16241629 then unit
16251630 else throwErr(makeString([toString(kLpRefreshDelay), " blocks have not passed since the previous call"], ""))
16261631 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
16271632 then {
16281633 let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
1629- let $t06070360767 = refreshKLpInternal(0, 0, 0)
1630- let kLpUpdateActions = $t06070360767._1
1631- let updatedKLp = $t06070360767._2
1634+ let $t06069260756 = refreshKLpInternal(0, 0, 0)
1635+ let kLpUpdateActions = $t06069260756._1
1636+ let updatedKLp = $t06069260756._2
16321637 let actions = if ((kLp != updatedKLp))
16331638 then kLpUpdateActions
16341639 else throwErr("nothing to refresh")
16351640 $Tuple2(actions, toString(updatedKLp))
16361641 }
16371642 else throw("Strict value is not equal to itself.")
16381643 }
16391644
16401645
16411646
16421647 @Callable(i)
16431648 func getPoolConfigWrapperREADONLY () = $Tuple2(nil, getPoolConfig())
16441649
16451650
16461651
16471652 @Callable(i)
16481653 func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId))
16491654
16501655
16511656
16521657 @Callable(i)
16531658 func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = {
16541659 let prices = calcPrices(amAmt, prAmt, lpAmt)
16551660 $Tuple2(nil, [toString(prices[0]), toString(prices[1]), toString(prices[2])])
16561661 }
16571662
16581663
16591664
16601665 @Callable(i)
16611666 func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(toX18(origVal, origScaleMult)))
16621667
16631668
16641669
16651670 @Callable(i)
16661671 func fromX18WrapperREADONLY (val,resultScaleMult) = $Tuple2(nil, fromX18(parseBigIntValue(val), resultScaleMult))
16671672
16681673
16691674
16701675 @Callable(i)
16711676 func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(calcPriceBigInt(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18))))
16721677
16731678
16741679
16751680 @Callable(i)
16761681 func estimatePutOperationWrapperREADONLY (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = $Tuple2(nil, estimatePutOperation(txId58, slippageTolerance, inAmAssetAmt, inAmAssetId, inPrAssetAmt, inPrAssetId, userAddress, isEvaluate, emitLp))
16771682
16781683
16791684
16801685 @Callable(i)
16811686 func estimateGetOperationWrapperREADONLY (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
16821687 let res = estimateGetOperation(txId58, pmtAssetId, pmtLpAmt, addressFromStringValue(userAddress))
16831688 $Tuple2(nil, $Tuple10(res._1, res._2, res._3, res._4, res._5, res._6, res._7, toString(res._8), res._9, res._10))
16841689 }
16851690
16861691
16871692
16881693 @Callable(i)
16891694 func statsREADONLY () = {
16901695 let cfg = getPoolConfig()
16911696 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
16921697 let amtAssetId = cfg[idxAmtAssetId]
16931698 let priceAssetId = cfg[idxPriceAssetId]
16941699 let iAmtAssetId = cfg[idxIAmtAssetId]
16951700 let iPriceAssetId = cfg[idxIPriceAssetId]
16961701 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
16971702 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
16981703 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
16991704 let accAmtAssetBalance = getAccBalance(amtAssetId)
17001705 let accPriceAssetBalance = getAccBalance(priceAssetId)
17011706 let pricesList = if ((poolLPBalance == 0))
17021707 then [zeroBigInt, zeroBigInt, zeroBigInt]
17031708 else calcPrices(accAmtAssetBalance, accPriceAssetBalance, poolLPBalance)
17041709 let curPrice = 0
17051710 let lpAmtAssetShare = fromX18(pricesList[1], scale8)
17061711 let lpPriceAssetShare = fromX18(pricesList[2], scale8)
17071712 let poolWeight = value(getInteger(factoryContract, keyPoolWeight(toString(this))))
17081713 $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))
17091714 }
17101715
17111716
17121717
17131718 @Callable(i)
17141719 func evaluatePutByAmountAssetREADONLY (inAmAssetAmt) = {
17151720 let cfg = getPoolConfig()
17161721 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
17171722 let amAssetIdStr = cfg[idxAmtAssetId]
17181723 let amAssetId = fromBase58String(amAssetIdStr)
17191724 let prAssetIdStr = cfg[idxPriceAssetId]
17201725 let prAssetId = fromBase58String(prAssetIdStr)
17211726 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
17221727 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
17231728 let poolStatus = cfg[idxPoolStatus]
17241729 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
17251730 let accAmtAssetBalance = getAccBalance(amAssetIdStr)
17261731 let accPriceAssetBalance = getAccBalance(prAssetIdStr)
17271732 let amtAssetAmtX18 = toX18(accAmtAssetBalance, amtAssetDcm)
17281733 let priceAssetAmtX18 = toX18(accPriceAssetBalance, priceAssetDcm)
17291734 let curPriceX18 = if ((poolLPBalance == 0))
17301735 then zeroBigInt
17311736 else calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
17321737 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
17331738 let inPrAssetAmtX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18)
17341739 let inPrAssetAmt = fromX18(inPrAssetAmtX18, priceAssetDcm)
17351740 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
17361741 let calcLpAmt = estPut._1
17371742 let curPriceCalc = estPut._3
17381743 let amBalance = estPut._4
17391744 let prBalance = estPut._5
17401745 let lpEmission = estPut._6
17411746 $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))
17421747 }
17431748
17441749
17451750
17461751 @Callable(i)
17471752 func evaluatePutByPriceAssetREADONLY (inPrAssetAmt) = {
17481753 let cfg = getPoolConfig()
17491754 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
17501755 let amAssetIdStr = cfg[idxAmtAssetId]
17511756 let amAssetId = fromBase58String(amAssetIdStr)
17521757 let prAssetIdStr = cfg[idxPriceAssetId]
17531758 let prAssetId = fromBase58String(prAssetIdStr)
17541759 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
17551760 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
17561761 let poolStatus = cfg[idxPoolStatus]
17571762 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
17581763 let amBalanceRaw = getAccBalance(amAssetIdStr)
17591764 let prBalanceRaw = getAccBalance(prAssetIdStr)
17601765 let amBalanceRawX18 = toX18(amBalanceRaw, amtAssetDcm)
17611766 let prBalanceRawX18 = toX18(prBalanceRaw, priceAssetDcm)
17621767 let curPriceX18 = if ((poolLPBalance == 0))
17631768 then zeroBigInt
17641769 else calcPriceBigInt(prBalanceRawX18, amBalanceRawX18)
17651770 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
17661771 let inAmAssetAmtX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
17671772 let inAmAssetAmt = fromX18(inAmAssetAmtX18, amtAssetDcm)
17681773 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
17691774 let calcLpAmt = estPut._1
17701775 let curPriceCalc = estPut._3
17711776 let amBalance = estPut._4
17721777 let prBalance = estPut._5
17731778 let lpEmission = estPut._6
17741779 $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))
17751780 }
17761781
17771782
17781783
17791784 @Callable(i)
17801785 func evaluateGetREADONLY (paymentLpAssetId,paymentLpAmt) = {
17811786 let res = estimateGetOperation("", paymentLpAssetId, paymentLpAmt, this)
17821787 let outAmAmt = res._1
17831788 let outPrAmt = res._2
17841789 let amBalance = res._5
17851790 let prBalance = res._6
17861791 let lpEmission = res._7
17871792 let curPrice = res._8
17881793 let poolStatus = parseIntValue(res._9)
17891794 $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))
17901795 }
17911796
17921797
17931798 @Verifier(tx)
17941799 func verify () = {
17951800 let targetPublicKey = match managerPublicKeyOrUnit() {
17961801 case pk: ByteVector =>
17971802 pk
17981803 case _: Unit =>
17991804 tx.senderPublicKey
18001805 case _ =>
18011806 throw("Match error")
18021807 }
18031808 match tx {
18041809 case order: Order =>
18051810 let matcherPub = getMatcherPubOrFail()
1806- let $t06942969546 = if (skipOrderValidation())
1811+ let $t06941869646 = if (skipOrderValidation())
18071812 then $Tuple2(true, "")
18081813 else validateMatcherOrderAllowed(order)
1809- let orderValid = $t06942969546._1
1810- let orderValidInfo = $t06942969546._2
1811- let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
1814+ let orderValid = $t06941869646._1
1815+ let orderValidInfo = $t06941869646._2
18121816 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
1813- if (if (if (orderValid)
1814- then senderValid
1815- else false)
1817+ if (if (orderValid)
18161818 then matcherValid
18171819 else false)
18181820 then true
1819- else throwOrderError(orderValid, orderValidInfo, senderValid, matcherValid)
1821+ else throwOrderError(orderValid, orderValidInfo, matcherValid)
18201822 case s: SetScriptTransaction =>
18211823 if (sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey))
18221824 then true
18231825 else {
18241826 let newHash = blake2b256(value(s.script))
18251827 let allowedHash = fromBase64String(value(getString(factoryContract, keyAllowedLpScriptHash())))
18261828 let currentHash = scriptHash(this)
18271829 if ((allowedHash == newHash))
18281830 then (currentHash != newHash)
18291831 else false
18301832 }
18311833 case _ =>
18321834 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
18331835 }
18341836 }
18351837

github/deemru/w8io/026f985 
252.80 ms