tx · 8emu6oz3EztpFydtpXg7kZ2HtDuxMeukJzdio1muv39e

3MrULQRLc52GWrJF1tMcAm4M78fPe57o9Kt:  -0.04300000 Waves

2023.04.14 14:33 [2534153] smart account 3MrULQRLc52GWrJF1tMcAm4M78fPe57o9Kt > SELF 0.00000000 Waves

{ "type": 13, "id": "8emu6oz3EztpFydtpXg7kZ2HtDuxMeukJzdio1muv39e", "fee": 4300000, "feeAssetId": null, "timestamp": 1681472028505, "version": 2, "chainId": 84, "sender": "3MrULQRLc52GWrJF1tMcAm4M78fPe57o9Kt", "senderPublicKey": "Aig94J3pRT3J41eXw33rJrs67gTCECiMVRZrbtuoARit", "proofs": [ "67gqqmL5Gt2WicXjCEDdGDyYqKYAeozSukGKgTxZTutxpDTxzf1rL1fBouFi8Es7qxu4dcyc7rSYpKAWkTiovGcp" ], "script": "base64:BgL3NwgCEgASBQoDAQQBEgcKBQEEAQgBEgMKAQgSABIECgIBBBIDCgEBEgQKAgEEEgQKAggBEgQKAggBEgQKAggBEgUKAwEIARIAEgQKAgEBEgMKAQESBQoDAQEBEgQKAggIEgASABIDCgEIEgUKAwEBARIECgIBARIECgIIARIECgIICBILCgkIAQECAQIIBAQSBgoECAgBCBIAEgMKAQESAwoBARIECgIIASIKbFBkZWNpbWFscyIGc2NhbGU4IgxzY2FsZThCaWdJbnQiB3NjYWxlMTgiCnplcm9CaWdJbnQiBGJpZzAiBGJpZzEiBGJpZzIiC3dhdmVzU3RyaW5nIgNTRVAiClBvb2xBY3RpdmUiD1Bvb2xQdXREaXNhYmxlZCITUG9vbE1hdGNoZXJEaXNhYmxlZCIMUG9vbFNodXRkb3duIg5pZHhQb29sQWRkcmVzcyINaWR4UG9vbFN0YXR1cyIQaWR4UG9vbExQQXNzZXRJZCINaWR4QW10QXNzZXRJZCIPaWR4UHJpY2VBc3NldElkIg5pZHhBbXRBc3NldERjbSIQaWR4UHJpY2VBc3NldERjbSIOaWR4SUFtdEFzc2V0SWQiEGlkeElQcmljZUFzc2V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CYU0HBQJhTgcGCQECYUoEBQJhSwUCYUwFAmFNBQJhTgMJAAECBQJiVgIUU2V0U2NyaXB0VHJhbnNhY3Rpb24EAmdpBQJiVgMJAPQDAwgFAmlqCWJvZHlCeXRlcwkAkQMCCAUCaWoGcHJvb2ZzAAAFAmlsBgQCaW8JAPYDAQkBBXZhbHVlAQgFAmdpBnNjcmlwdAQCaXAJANsEAQkBBXZhbHVlAQkAnQgCBQJhVgkBAmFGAAQCaXEJAPEHAQUEdGhpcwMJAAACBQJpcAUCaW8JAQIhPQIFAmlxBQJpbwcJAPQDAwgFAmlqCWJvZHlCeXRlcwkAkQMCCAUCaWoGcHJvb2ZzAAAFAmlsLmY3kQ==", "height": 2534153, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CfefnKVKqYaiD2NhjymfAWA9ceujCuZsHh2u3a3hUqWM Next: DyBVQJ6To7x3npHYrqNWjiMFSumn3cBdxyuFHLjjySkj Diff:
OldNewDifferences
168168
169169 let keyFeeCollectorAddress = "%s__feeCollectorAddress"
170170
171+func keySkipOrderValidation (poolAddress) = ("%s%s__skipOrderValidation__" + poolAddress)
172+
173+
171174 func throwOrderError (orderValid,orderValidInfo,senderValid,matcherValid) = throw((((((((("order validation failed: orderValid=" + toString(orderValid)) + " (") + orderValidInfo) + ")") + " senderValid=") + toString(senderValid)) + " matcherValid=") + toString(matcherValid)))
172175
173176
231234
232235 let poolConfigParsed = parsePoolConfig(getPoolConfig())
233236
234-let $t089629128 = poolConfigParsed
237+let $t090589224 = poolConfigParsed
235238
236-let cfgPoolAddress = $t089629128._1
239+let cfgPoolAddress = $t090589224._1
237240
238-let cfgPoolStatus = $t089629128._2
241+let cfgPoolStatus = $t090589224._2
239242
240-let cfgLpAssetId = $t089629128._3
243+let cfgLpAssetId = $t090589224._3
241244
242-let cfgAmountAssetId = $t089629128._4
245+let cfgAmountAssetId = $t090589224._4
243246
244-let cfgPriceAssetId = $t089629128._5
247+let cfgPriceAssetId = $t090589224._5
245248
246-let cfgAmountAssetDecimals = $t089629128._6
249+let cfgAmountAssetDecimals = $t090589224._6
247250
248-let cfgPriceAssetDecimals = $t089629128._7
251+let cfgPriceAssetDecimals = $t090589224._7
249252
250253 func getFactoryConfig () = split(getStringOrFail(factoryContract, keyFactoryConfig()), SEP)
251254
394397
395398
396399 func rebalanceAsset (assetId) = {
397- let $t01536415500 = getLeaseProxyConfig(assetId)
398- let isLeasable = $t01536415500._1
399- let leasedRatio = $t01536415500._2
400- let minBalance = $t01536415500._3
401- let proxyAddress = $t01536415500._4
402- let proxyAssetId = $t01536415500._5
403- let proxyRateMul = $t01536415500._6
404- let stakingProfitAddress = $t01536415500._7
400+ let $t01546015596 = getLeaseProxyConfig(assetId)
401+ let isLeasable = $t01546015596._1
402+ let leasedRatio = $t01546015596._2
403+ let minBalance = $t01546015596._3
404+ let proxyAddress = $t01546015596._4
405+ let proxyAssetId = $t01546015596._5
406+ let proxyRateMul = $t01546015596._6
407+ let stakingProfitAddress = $t01546015596._7
405408 if (isLeasable)
406409 then rebalanceInternal(leasedRatio, assetId, proxyAssetId, minBalance, addressFromStringValue(proxyAddress), proxyRateMul, addressFromStringValue(stakingProfitAddress))
407410 else nil
409412
410413
411414 func withdrawAndRebalanceAsset (assetId,getAmount) = {
412- let $t01589916035 = getLeaseProxyConfig(assetId)
413- let isLeasable = $t01589916035._1
414- let leasedRatio = $t01589916035._2
415- let minBalance = $t01589916035._3
416- let proxyAddress = $t01589916035._4
417- let proxyAssetId = $t01589916035._5
418- let proxyRateMul = $t01589916035._6
419- let stakingProfitAddress = $t01589916035._7
415+ let $t01599516131 = getLeaseProxyConfig(assetId)
416+ let isLeasable = $t01599516131._1
417+ let leasedRatio = $t01599516131._2
418+ let minBalance = $t01599516131._3
419+ let proxyAddress = $t01599516131._4
420+ let proxyAssetId = $t01599516131._5
421+ let proxyRateMul = $t01599516131._6
422+ let stakingProfitAddress = $t01599516131._7
420423 if (isLeasable)
421424 then {
422425 let newTotalLeasableBalance = max([0, ((getAccBalance(assetId) - getAmount) - minBalance)])
616619 }
617620
618621
622+func skipOrderValidation () = valueOrElse(getBoolean(factoryContract, keySkipOrderValidation(toString(this))), false)
623+
624+
619625 func validateUpdatedKLp (oldKLp,updatedKLp) = if ((updatedKLp >= oldKLp))
620626 then true
621627 else throwErr(makeString(["updated KLp lower than current KLp", toString(oldKLp), toString(updatedKLp)], " "))
626632 let priceAssetBalance = getAccBalance(assetIdToString(cfgPriceAssetId))
627633 let amountAssetAmount = order.amount
628634 let priceAssetAmount = fraction(order.amount, order.price, scale8, FLOOR)
629- let $t02830128513 = if ((order.orderType == Buy))
635+ let $t02852028732 = if ((order.orderType == Buy))
630636 then $Tuple2(amountAssetAmount, -(priceAssetAmount))
631637 else $Tuple2(-(amountAssetAmount), priceAssetAmount)
632- let amountAssetBalanceDelta = $t02830128513._1
633- let priceAssetBalanceDelta = $t02830128513._2
638+ let amountAssetBalanceDelta = $t02852028732._1
639+ let priceAssetBalanceDelta = $t02852028732._2
634640 if (if (if (isGlobalShutdown())
635641 then true
636642 else (cfgPoolStatus == PoolMatcherDisabled))
643649 then throw("Wrong order assets.")
644650 else {
645651 let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
646- let $t02895329053 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
647- let unusedActions = $t02895329053._1
648- let kLpNew = $t02895329053._2
652+ let $t02917229272 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
653+ let unusedActions = $t02917229272._1
654+ let kLpNew = $t02917229272._2
649655 let isOrderValid = (kLpNew >= kLp)
650656 let info = makeString(["kLp=", toString(kLp), " kLpNew=", toString(kLpNew), " amountAssetBalance=", toString(amountAssetBalance), " priceAssetBalance=", toString(priceAssetBalance), " amountAssetBalanceDelta=", toString(amountAssetBalanceDelta), " priceAssetBalanceDelta=", toString(priceAssetBalanceDelta), " height=", toString(height)], "")
651657 $Tuple2(isOrderValid, info)
724730 else if ((paymentAssetId == cfgPriceAssetId))
725731 then false
726732 else throwErr("invalid asset")
727- let $t03216632459 = if (isEval)
733+ let $t03238532678 = if (isEval)
728734 then $Tuple2(amountBalanceRaw, priceBalanceRaw)
729735 else if (paymentInAmountAsset)
730736 then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw)
731737 else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw))
732- let amountBalanceOld = $t03216632459._1
733- let priceBalanceOld = $t03216632459._2
734- let $t03246332612 = if (paymentInAmountAsset)
738+ let amountBalanceOld = $t03238532678._1
739+ let priceBalanceOld = $t03238532678._2
740+ let $t03268232831 = if (paymentInAmountAsset)
735741 then $Tuple2(paymentAmountRaw, 0)
736742 else $Tuple2(0, paymentAmountRaw)
737- let amountAssetAmountRaw = $t03246332612._1
738- let priceAssetAmountRaw = $t03246332612._2
743+ let amountAssetAmountRaw = $t03268232831._1
744+ let priceAssetAmountRaw = $t03268232831._2
739745 let amountAssetAmount = takeFee(amountAssetAmountRaw, inFee)._1
740746 let priceAssetAmount = takeFee(priceAssetAmountRaw, inFee)._1
741- let $t03274432808 = takeFee(paymentAmountRaw, inFee)
742- let paymentAmount = $t03274432808._1
743- let feeAmount = $t03274432808._2
747+ let $t03296333027 = takeFee(paymentAmountRaw, inFee)
748+ let paymentAmount = $t03296333027._1
749+ let feeAmount = $t03296333027._2
744750 let amountBalanceNew = (amountBalanceOld + amountAssetAmount)
745751 let priceBalanceNew = (priceBalanceOld + priceAssetAmount)
746752 let priceNewX18 = calcPriceBigInt(toX18(priceBalanceNew, cfgPriceAssetDecimals), toX18(amountBalanceNew, cfgAmountAssetDecimals))
763769 let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, cfgPriceAssetDecimals), toX18(amountBalanceOld, cfgAmountAssetDecimals))
764770 let priceOld = fromX18(priceOldX18, scale8)
765771 let loss = {
766- let $t03448934656 = if (paymentInAmountAsset)
772+ let $t03470834875 = if (paymentInAmountAsset)
767773 then $Tuple2(amountAssetAmountRaw, amountBalanceOld)
768774 else $Tuple2(priceAssetAmountRaw, priceBalanceOld)
769- let amount = $t03448934656._1
770- let balance = $t03448934656._2
775+ let amount = $t03470834875._1
776+ let balance = $t03470834875._2
771777 let issueAmountBoth = toInt(fraction(supplyBigInt, toBigInt((amount / 2)), toBigInt(balance)))
772778 fraction((issueAmount - issueAmountBoth), scale8, issueAmountBoth)
773779 }
807813 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
808814 let redeemedBigInt = toBigInt(paymentAmount)
809815 let amountRaw = max([0, toInt(((balanceBigInt * (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN))) / scale18))])
810- let $t03673436790 = takeFee(amountRaw, outFee)
811- let totalAmount = $t03673436790._1
812- let feeAmount = $t03673436790._2
813- let $t03679437020 = if (outInAmountAsset)
816+ let $t03695337009 = takeFee(amountRaw, outFee)
817+ let totalAmount = $t03695337009._1
818+ let feeAmount = $t03695337009._2
819+ let $t03701337239 = if (outInAmountAsset)
814820 then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld)
815821 else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw))
816- let outAmAmount = $t03679437020._1
817- let outPrAmount = $t03679437020._2
818- let amBalanceNew = $t03679437020._3
819- let prBalanceNew = $t03679437020._4
822+ let outAmAmount = $t03701337239._1
823+ let outPrAmount = $t03701337239._2
824+ let amBalanceNew = $t03701337239._3
825+ let prBalanceNew = $t03701337239._4
820826 let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, cfgPriceAssetDecimals), toX18(amBalanceNew, cfgAmountAssetDecimals))
821827 let priceNew = fromX18(priceNewX18, scale8)
822828 let commonState = if (isEval)
888894
889895 @Callable(i)
890896 func calculateAmountOutForSwapREADONLY (cleanAmountIn,isReverse,feePoolAmount) = {
891- let $t03890639211 = if ((isReverse == false))
897+ let $t03912539430 = if ((isReverse == false))
892898 then {
893899 let assetOut = getStringOrFail(this, pa())
894900 let assetIn = getStringOrFail(this, aa())
899905 let assetIn = getStringOrFail(this, pa())
900906 $Tuple2(assetOut, assetIn)
901907 }
902- let assetOut = $t03890639211._1
903- let assetIn = $t03890639211._2
908+ let assetOut = $t03912539430._1
909+ let assetIn = $t03912539430._2
904910 let poolAssetInBalance = getAccBalance(assetIn)
905911 let poolAssetOutBalance = getAccBalance(assetOut)
906912 let amountOut = fraction(poolAssetOutBalance, cleanAmountIn, (poolAssetInBalance + cleanAmountIn))
10511057 else throw("Strict value is not equal to itself.")
10521058 }
10531059 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
1054- let $t04425744719 = refreshKLpInternal(0, 0, 0)
1055- if (($t04425744719 == $t04425744719))
1060+ let $t04447644938 = refreshKLpInternal(0, 0, 0)
1061+ if (($t04447644938 == $t04447644938))
10561062 then {
1057- let updatedKLp = $t04425744719._2
1058- let refreshKLpActions = $t04425744719._1
1063+ let updatedKLp = $t04447644938._2
1064+ let refreshKLpActions = $t04447644938._1
10591065 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10601066 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10611067 then {
10921098 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
10931099 if ((currentKLp == currentKLp))
10941100 then {
1095- let $t04533145396 = refreshKLpInternal(0, 0, 0)
1096- let refreshKLpActions = $t04533145396._1
1097- let updatedKLp = $t04533145396._2
1101+ let $t04555045615 = refreshKLpInternal(0, 0, 0)
1102+ let refreshKLpActions = $t04555045615._1
1103+ let updatedKLp = $t04555045615._2
10981104 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10991105 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11001106 then (state ++ refreshKLpActions)
11411147 then {
11421148 let userAddress = i.caller
11431149 let txId = i.transactionId
1144- let $t04658446736 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
1145- if (($t04658446736 == $t04658446736))
1150+ let $t04680346955 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
1151+ if (($t04680346955 == $t04680346955))
11461152 then {
1147- let paymentInAmountAsset = $t04658446736._5
1148- let bonus = $t04658446736._4
1149- let feeAmount = $t04658446736._3
1150- let commonState = $t04658446736._2
1151- let emitAmountEstimated = $t04658446736._1
1153+ let paymentInAmountAsset = $t04680346955._5
1154+ let bonus = $t04680346955._4
1155+ let feeAmount = $t04680346955._3
1156+ let commonState = $t04680346955._2
1157+ let emitAmountEstimated = $t04680346955._1
11521158 let emitAmount = if (if ((minOutAmount > 0))
11531159 then (minOutAmount > emitAmountEstimated)
11541160 else false)
11681174 let sendFee = if ((feeAmount > 0))
11691175 then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
11701176 else nil
1171- let $t04732247519 = if ((this == feeCollectorAddress))
1177+ let $t04754147738 = if ((this == feeCollectorAddress))
11721178 then $Tuple2(0, 0)
11731179 else if (paymentInAmountAsset)
11741180 then $Tuple2(-(feeAmount), 0)
11751181 else $Tuple2(0, -(feeAmount))
1176- let amountAssetBalanceDelta = $t04732247519._1
1177- let priceAssetBalanceDelta = $t04732247519._2
1178- let $t04752247630 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1179- let refreshKLpActions = $t04752247630._1
1180- let updatedKLp = $t04752247630._2
1182+ let amountAssetBalanceDelta = $t04754147738._1
1183+ let priceAssetBalanceDelta = $t04754147738._2
1184+ let $t04774147849 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1185+ let refreshKLpActions = $t04774147849._1
1186+ let updatedKLp = $t04774147849._2
11811187 let kLp = value(getString(keyKLp))
11821188 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11831189 if ((isUpdatedKLpValid == isUpdatedKLpValid))
12021208
12031209 @Callable(i)
12041210 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
1205- let $t04798548142 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
1206- let emitAmountEstimated = $t04798548142._1
1207- let commonState = $t04798548142._2
1208- let feeAmount = $t04798548142._3
1209- let bonus = $t04798548142._4
1210- let paymentInAmountAsset = $t04798548142._5
1211+ let $t04820448361 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
1212+ let emitAmountEstimated = $t04820448361._1
1213+ let commonState = $t04820448361._2
1214+ let feeAmount = $t04820448361._3
1215+ let bonus = $t04820448361._4
1216+ let paymentInAmountAsset = $t04820448361._5
12111217 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
12121218 }
12131219
12441250 then {
12451251 let userAddress = i.caller
12461252 let txId = i.transactionId
1247- let $t04902749180 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
1248- if (($t04902749180 == $t04902749180))
1253+ let $t04924649399 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
1254+ if (($t04924649399 == $t04924649399))
12491255 then {
1250- let outInAmountAsset = $t04902749180._5
1251- let bonus = $t04902749180._4
1252- let feeAmount = $t04902749180._3
1253- let commonState = $t04902749180._2
1254- let amountEstimated = $t04902749180._1
1256+ let outInAmountAsset = $t04924649399._5
1257+ let bonus = $t04924649399._4
1258+ let feeAmount = $t04924649399._3
1259+ let commonState = $t04924649399._2
1260+ let amountEstimated = $t04924649399._1
12551261 let amount = if (if ((minOutAmount > 0))
12561262 then (minOutAmount > amountEstimated)
12571263 else false)
12651271 let sendFee = if ((feeAmount > 0))
12661272 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
12671273 else nil
1268- let $t04984450091 = {
1274+ let $t05006350310 = {
12691275 let feeAmountForCalc = if ((this == feeCollectorAddress))
12701276 then 0
12711277 else feeAmount
12731279 then $Tuple2(-((amount + feeAmountForCalc)), 0)
12741280 else $Tuple2(0, -((amount + feeAmountForCalc)))
12751281 }
1276- let amountAssetBalanceDelta = $t04984450091._1
1277- let priceAssetBalanceDelta = $t04984450091._2
1278- let $t05009450202 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1279- let refreshKLpActions = $t05009450202._1
1280- let updatedKLp = $t05009450202._2
1282+ let amountAssetBalanceDelta = $t05006350310._1
1283+ let priceAssetBalanceDelta = $t05006350310._2
1284+ let $t05031350421 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1285+ let refreshKLpActions = $t05031350421._1
1286+ let updatedKLp = $t05031350421._2
12811287 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
12821288 if ((isUpdatedKLpValid == isUpdatedKLpValid))
12831289 then $Tuple2(((((commonState ++ withdrawState) ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
12961302
12971303 @Callable(i)
12981304 func getOneTknREADONLY (outAssetId,paymentAmount) = {
1299- let $t05048050636 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
1300- let amountEstimated = $t05048050636._1
1301- let commonState = $t05048050636._2
1302- let feeAmount = $t05048050636._3
1303- let bonus = $t05048050636._4
1304- let outInAmountAsset = $t05048050636._5
1305+ let $t05069950855 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
1306+ let amountEstimated = $t05069950855._1
1307+ let commonState = $t05069950855._2
1308+ let feeAmount = $t05069950855._3
1309+ let bonus = $t05069950855._4
1310+ let outInAmountAsset = $t05069950855._5
13051311 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
13061312 }
13071313
13381344 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
13391345 if ((unstakeInv == unstakeInv))
13401346 then {
1341- let $t05154151692 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1342- if (($t05154151692 == $t05154151692))
1347+ let $t05176051911 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1348+ if (($t05176051911 == $t05176051911))
13431349 then {
1344- let outInAmountAsset = $t05154151692._5
1345- let bonus = $t05154151692._4
1346- let feeAmount = $t05154151692._3
1347- let commonState = $t05154151692._2
1348- let amountEstimated = $t05154151692._1
1350+ let outInAmountAsset = $t05176051911._5
1351+ let bonus = $t05176051911._4
1352+ let feeAmount = $t05176051911._3
1353+ let commonState = $t05176051911._2
1354+ let amountEstimated = $t05176051911._1
13491355 let amount = if (if ((minOutAmount > 0))
13501356 then (minOutAmount > amountEstimated)
13511357 else false)
13591365 let sendFee = if ((feeAmount > 0))
13601366 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
13611367 else nil
1362- let $t05235152598 = {
1368+ let $t05257052817 = {
13631369 let feeAmountForCalc = if ((this == feeCollectorAddress))
13641370 then 0
13651371 else feeAmount
13671373 then $Tuple2(-((amount + feeAmountForCalc)), 0)
13681374 else $Tuple2(0, -((amount + feeAmountForCalc)))
13691375 }
1370- let amountAssetBalanceDelta = $t05235152598._1
1371- let priceAssetBalanceDelta = $t05235152598._2
1372- let $t05260152709 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1373- let refreshKLpActions = $t05260152709._1
1374- let updatedKLp = $t05260152709._2
1376+ let amountAssetBalanceDelta = $t05257052817._1
1377+ let priceAssetBalanceDelta = $t05257052817._2
1378+ let $t05282052928 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1379+ let refreshKLpActions = $t05282052928._1
1380+ let updatedKLp = $t05282052928._2
13751381 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
13761382 if ((isUpdatedKLpValid == isUpdatedKLpValid))
13771383 then $Tuple2(((((commonState ++ withdrawState) ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
14051411 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
14061412 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
14071413 then {
1408- let $t05380453885 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1409- let refreshKLpActions = $t05380453885._1
1410- let updatedKLp = $t05380453885._2
1414+ let $t05402354104 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1415+ let refreshKLpActions = $t05402354104._1
1416+ let updatedKLp = $t05402354104._2
14111417 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
14121418 if ((isUpdatedKLpValid == isUpdatedKLpValid))
14131419 then ((withdrawState ++ state) ++ refreshKLpActions)
14401446 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
14411447 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
14421448 then {
1443- let $t05498055061 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1444- let refreshKLpActions = $t05498055061._1
1445- let updatedKLp = $t05498055061._2
1449+ let $t05519955280 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1450+ let refreshKLpActions = $t05519955280._1
1451+ let updatedKLp = $t05519955280._2
14461452 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
14471453 if ((isUpdatedKLpValid == isUpdatedKLpValid))
14481454 then ((withdrawState ++ state) ++ refreshKLpActions)
14871493 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
14881494 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
14891495 then {
1490- let $t05633356414 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1491- let refreshKLpActions = $t05633356414._1
1492- let updatedKLp = $t05633356414._2
1496+ let $t05655256633 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1497+ let refreshKLpActions = $t05655256633._1
1498+ let updatedKLp = $t05655256633._2
14931499 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
14941500 if ((isUpdatedKLpValid == isUpdatedKLpValid))
14951501 then ((withdrawState ++ state) ++ refreshKLpActions)
15411547 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
15421548 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
15431549 then {
1544- let $t05785557936 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1545- let refreshKLpActions = $t05785557936._1
1546- let updatedKLp = $t05785557936._2
1550+ let $t05807458155 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1551+ let refreshKLpActions = $t05807458155._1
1552+ let updatedKLp = $t05807458155._2
15471553 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
15481554 if ((isUpdatedKLpValid == isUpdatedKLpValid))
15491555 then ((withdrawState ++ state) ++ refreshKLpActions)
15781584 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
15791585 then {
15801586 let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
1581- let $t05914059204 = refreshKLpInternal(0, 0, 0)
1582- let kLpUpdateActions = $t05914059204._1
1583- let updatedKLp = $t05914059204._2
1587+ let $t05935959423 = refreshKLpInternal(0, 0, 0)
1588+ let kLpUpdateActions = $t05935959423._1
1589+ let updatedKLp = $t05935959423._2
15841590 let actions = if ((kLp != updatedKLp))
15851591 then kLpUpdateActions
15861592 else throwErr("nothing to refresh")
17551761 match tx {
17561762 case order: Order =>
17571763 let matcherPub = getMatcherPubOrFail()
1758- let $t06786667935 = validateMatcherOrderAllowed(order)
1759- let orderValid = $t06786667935._1
1760- let orderValidInfo = $t06786667935._2
1764+ let $t06808568202 = if (skipOrderValidation())
1765+ then $Tuple2(true, "")
1766+ else validateMatcherOrderAllowed(order)
1767+ let orderValid = $t06808568202._1
1768+ let orderValidInfo = $t06808568202._2
17611769 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
17621770 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
17631771 if (if (if (orderValid)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let lPdecimals = 8
55
66 let scale8 = 100000000
77
88 let scale8BigInt = toBigInt(100000000)
99
1010 let scale18 = toBigInt(1000000000000000000)
1111
1212 let zeroBigInt = toBigInt(0)
1313
1414 let big0 = toBigInt(0)
1515
1616 let big1 = toBigInt(1)
1717
1818 let big2 = toBigInt(2)
1919
2020 let wavesString = "WAVES"
2121
2222 let SEP = "__"
2323
2424 let PoolActive = 1
2525
2626 let PoolPutDisabled = 2
2727
2828 let PoolMatcherDisabled = 3
2929
3030 let PoolShutdown = 4
3131
3232 let idxPoolAddress = 1
3333
3434 let idxPoolStatus = 2
3535
3636 let idxPoolLPAssetId = 3
3737
3838 let idxAmtAssetId = 4
3939
4040 let idxPriceAssetId = 5
4141
4242 let idxAmtAssetDcm = 6
4343
4444 let idxPriceAssetDcm = 7
4545
4646 let idxIAmtAssetId = 8
4747
4848 let idxIPriceAssetId = 9
4949
5050 let idxLPAssetDcm = 10
5151
5252 let idxPoolAmtAssetAmt = 1
5353
5454 let idxPoolPriceAssetAmt = 2
5555
5656 let idxPoolLPAssetAmt = 3
5757
5858 let idxFactoryStakingContract = 1
5959
6060 let idxFactorySlippageContract = 7
6161
6262 func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), scale18, toBigInt(origScaleMult))
6363
6464
6565 func toX18BigInt (origVal,origScaleMult) = fraction(origVal, scale18, origScaleMult)
6666
6767
6868 func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), scale18))
6969
7070
7171 func fromX18Round (val,resultScaleMult,round) = toInt(fraction(val, toBigInt(resultScaleMult), scale18, round))
7272
7373
7474 func toScale (amt,resScale,curScale) = fraction(amt, resScale, curScale)
7575
7676
7777 func abs (val) = if ((0 > val))
7878 then -(val)
7979 else val
8080
8181
8282 func absBigInt (val) = if ((zeroBigInt > val))
8383 then -(val)
8484 else val
8585
8686
8787 func swapContract () = "%s__swapContract"
8888
8989
9090 func fc () = "%s__factoryContract"
9191
9292
9393 func mpk () = "%s__managerPublicKey"
9494
9595
9696 func pmpk () = "%s__pendingManagerPublicKey"
9797
9898
9999 func pl () = "%s%s__price__last"
100100
101101
102102 func ph (h,timestamp) = makeString(["%s%s%d%d__price__history", toString(h), toString(timestamp)], SEP)
103103
104104
105105 func pau (userAddress,txId) = ((("%s%s%s__P__" + userAddress) + "__") + txId)
106106
107107
108108 func gau (userAddress,txId) = ((("%s%s%s__G__" + userAddress) + "__") + txId)
109109
110110
111111 func aa () = "%s__amountAsset"
112112
113113
114114 func pa () = "%s__priceAsset"
115115
116116
117117 let keyFee = "%s__fee"
118118
119119 let feeDefault = fraction(10, scale8, 10000)
120120
121121 let fee = valueOrElse(getInteger(this, keyFee), feeDefault)
122122
123123 let keyKLp = makeString(["%s", "kLp"], SEP)
124124
125125 let keyKLpRefreshedHeight = makeString(["%s", "kLpRefreshedHeight"], SEP)
126126
127127 let keyKLpRefreshDelay = makeString(["%s", "refreshKLpDelay"], SEP)
128128
129129 let kLpRefreshDelayDefault = 30
130130
131131 let kLpRefreshDelay = valueOrElse(getInteger(this, keyKLpRefreshDelay), kLpRefreshDelayDefault)
132132
133133 func 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
171+func keySkipOrderValidation (poolAddress) = ("%s%s__skipOrderValidation__" + poolAddress)
172+
173+
171174 func throwOrderError (orderValid,orderValidInfo,senderValid,matcherValid) = throw((((((((("order validation failed: orderValid=" + toString(orderValid)) + " (") + orderValidInfo) + ")") + " senderValid=") + toString(senderValid)) + " matcherValid=") + toString(matcherValid)))
172175
173176
174177 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
175178
176179
177180 func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
178181
179182
180183 func throwErr (msg) = throw(makeString(["lp.ride:", msg], " "))
181184
182185
183186 func fmtErr (msg) = makeString(["lp.ride:", msg], " ")
184187
185188
186189 let factoryContract = addressFromStringValue(getStringOrFail(this, fc()))
187190
188191 let feeCollectorAddress = addressFromStringValue(getStringOrFail(factoryContract, keyFeeCollectorAddress))
189192
190193 let inFee = {
191194 let @ = invoke(factoryContract, "getInFeeREADONLY", [toString(this)], nil)
192195 if ($isInstanceOf(@, "Int"))
193196 then @
194197 else throw(($getType(@) + " couldn't be cast to Int"))
195198 }
196199
197200 let outFee = {
198201 let @ = invoke(factoryContract, "getOutFeeREADONLY", [toString(this)], nil)
199202 if ($isInstanceOf(@, "Int"))
200203 then @
201204 else throw(($getType(@) + " couldn't be cast to Int"))
202205 }
203206
204207 func isGlobalShutdown () = valueOrElse(getBoolean(factoryContract, keyAllPoolsShutdown()), false)
205208
206209
207210 func getMatcherPubOrFail () = fromBase58String(getStringOrFail(factoryContract, keyMatcherPub()))
208211
209212
210213 func getPoolConfig () = {
211214 let amtAsset = getStringOrFail(this, aa())
212215 let priceAsset = getStringOrFail(this, pa())
213216 let iPriceAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(priceAsset))
214217 let iAmtAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(amtAsset))
215218 split(getStringOrFail(factoryContract, keyPoolConfig(toString(iAmtAsset), toString(iPriceAsset))), SEP)
216219 }
217220
218221
219222 func parseAssetId (input) = if ((input == wavesString))
220223 then unit
221224 else fromBase58String(input)
222225
223226
224227 func assetIdToString (input) = if ((input == unit))
225228 then wavesString
226229 else toBase58String(value(input))
227230
228231
229232 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]))
230233
231234
232235 let poolConfigParsed = parsePoolConfig(getPoolConfig())
233236
234-let $t089629128 = poolConfigParsed
237+let $t090589224 = poolConfigParsed
235238
236-let cfgPoolAddress = $t089629128._1
239+let cfgPoolAddress = $t090589224._1
237240
238-let cfgPoolStatus = $t089629128._2
241+let cfgPoolStatus = $t090589224._2
239242
240-let cfgLpAssetId = $t089629128._3
243+let cfgLpAssetId = $t090589224._3
241244
242-let cfgAmountAssetId = $t089629128._4
245+let cfgAmountAssetId = $t090589224._4
243246
244-let cfgPriceAssetId = $t089629128._5
247+let cfgPriceAssetId = $t090589224._5
245248
246-let cfgAmountAssetDecimals = $t089629128._6
249+let cfgAmountAssetDecimals = $t090589224._6
247250
248-let cfgPriceAssetDecimals = $t089629128._7
251+let cfgPriceAssetDecimals = $t090589224._7
249252
250253 func getFactoryConfig () = split(getStringOrFail(factoryContract, keyFactoryConfig()), SEP)
251254
252255
253256 let stakingContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactoryStakingContract]), "incorrect staking address")
254257
255258 let slippageContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactorySlippageContract]), "incorrect staking address")
256259
257260 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)
258261
259262
260263 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)
261264
262265
263266 func getAccBalance (assetId) = {
264267 let balanceOnPool = if ((assetId == "WAVES"))
265268 then wavesBalance(this).available
266269 else assetBalance(this, fromBase58String(assetId))
267270 let totalBalance = ((balanceOnPool + getAdditionalBalanceOrZero(assetId)) - getStakingAssetBalanceOrZero(assetId))
268271 max([0, totalBalance])
269272 }
270273
271274
272275 func calcPriceBigInt (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18)
273276
274277
275278 func calcPriceBigIntRound (prAmtX18,amAmtX18,round) = fraction(prAmtX18, scale18, amAmtX18, round)
276279
277280
278281 func getRate (proxy) = {
279282 let inv = invoke(proxy, "getRate", nil, nil)
280283 if ((inv == inv))
281284 then match inv {
282285 case r: Int =>
283286 r
284287 case _ =>
285288 throwErr("proxy.getRate() unexpected value")
286289 }
287290 else throw("Strict value is not equal to itself.")
288291 }
289292
290293
291294 func deposit (assetId,amount,stakingAssetId,proxy) = {
292295 let currentAdditionalBalance = getAdditionalBalanceOrZero(assetId)
293296 if ((currentAdditionalBalance == currentAdditionalBalance))
294297 then {
295298 let currentStakingAssetBalance = getStakingAssetBalanceOrZero(stakingAssetId)
296299 if ((currentStakingAssetBalance == currentStakingAssetBalance))
297300 then {
298301 let asset = parseAssetId(assetId)
299302 if ((amount > 0))
300303 then {
301304 let depositInvoke = invoke(proxy, "deposit", nil, [AttachedPayment(asset, amount)])
302305 if ((depositInvoke == depositInvoke))
303306 then match depositInvoke {
304307 case receivedStakingAsset: Int =>
305308 let newAdditionalBalance = (currentAdditionalBalance + amount)
306309 let newStakingAssetBalance = (currentStakingAssetBalance + receivedStakingAsset)
307310 [IntegerEntry(keyAdditionalBalance(assetId), newAdditionalBalance), IntegerEntry(keyStakingAssetBalance(stakingAssetId), newStakingAssetBalance)]
308311 case _ =>
309312 nil
310313 }
311314 else throw("Strict value is not equal to itself.")
312315 }
313316 else nil
314317 }
315318 else throw("Strict value is not equal to itself.")
316319 }
317320 else throw("Strict value is not equal to itself.")
318321 }
319322
320323
321324 func withdraw (assetId,amount,stakingAssetId,proxy,proxyRateMul,profitAddress) = {
322325 let currentAdditionalBalance = getAdditionalBalanceOrZero(assetId)
323326 if ((currentAdditionalBalance == currentAdditionalBalance))
324327 then {
325328 let currentStakingAssetBalance = getStakingAssetBalanceOrZero(stakingAssetId)
326329 if ((currentStakingAssetBalance == currentStakingAssetBalance))
327330 then {
328331 let currentProxyRate = getRate(proxy)
329332 if ((currentProxyRate == currentProxyRate))
330333 then {
331334 let oldRate = fraction(proxyRateMul, currentAdditionalBalance, currentStakingAssetBalance)
332335 let stakingAsset = parseAssetId(stakingAssetId)
333336 let oldSendStakingAmount = fraction(proxyRateMul, amount, oldRate)
334337 let sendStakingAssetAmount = fraction(proxyRateMul, amount, currentProxyRate)
335338 let profitAmount = max([0, (oldSendStakingAmount - sendStakingAssetAmount)])
336339 if ((sendStakingAssetAmount > 0))
337340 then {
338341 let withdrawInvoke = invoke(proxy, "withdraw", nil, [AttachedPayment(stakingAsset, sendStakingAssetAmount)])
339342 if ((withdrawInvoke == withdrawInvoke))
340343 then match withdrawInvoke {
341344 case receivedAssets: Int =>
342345 let newAdditionalBalance = (currentAdditionalBalance - receivedAssets)
343346 let newStakingAssetBalance = ((currentStakingAssetBalance - sendStakingAssetAmount) - profitAmount)
344347 [IntegerEntry(keyAdditionalBalance(assetId), newAdditionalBalance), IntegerEntry(keyStakingAssetBalance(stakingAssetId), newStakingAssetBalance), ScriptTransfer(profitAddress, profitAmount, parseAssetId(stakingAssetId))]
345348 case _ =>
346349 nil
347350 }
348351 else throw("Strict value is not equal to itself.")
349352 }
350353 else nil
351354 }
352355 else throw("Strict value is not equal to itself.")
353356 }
354357 else throw("Strict value is not equal to itself.")
355358 }
356359 else throw("Strict value is not equal to itself.")
357360 }
358361
359362
360363 func getLeaseProxyConfig (assetId) = match invoke(factoryContract, "getPoolLeaseConfigREADONLY", [toString(this), assetId], nil) {
361364 case a: (Boolean, Int, Int, String, String, Int, String) =>
362365 a
363366 case _ =>
364367 throwErr((("[" + assetId) + "] getLeaseProxyConfig() error"))
365368 }
366369
367370
368371 func rebalanceInternal (targetRatio,assetId,stakingAssetId,minBalance,proxy,proxyRateMul,profitAddress) = {
369372 let currentAdditionalBalance = getAdditionalBalanceOrZero(assetId)
370373 if ((currentAdditionalBalance == currentAdditionalBalance))
371374 then {
372375 let currentStakingAssetBalance = getStakingAssetBalanceOrZero(stakingAssetId)
373376 if ((currentStakingAssetBalance == currentStakingAssetBalance))
374377 then {
375378 let leasableTotalBalance = max([0, (getAccBalance(assetId) - minBalance)])
376379 let targetAdditionalBalance = fraction(targetRatio, leasableTotalBalance, 100)
377380 let diff = (currentAdditionalBalance - targetAdditionalBalance)
378381 if ((diff == 0))
379382 then nil
380383 else if ((0 > diff))
381384 then {
382385 let sendAssetAmount = -(diff)
383386 deposit(assetId, sendAssetAmount, stakingAssetId, proxy)
384387 }
385388 else {
386389 let getAssetAmount = diff
387390 withdraw(assetId, getAssetAmount, stakingAssetId, proxy, proxyRateMul, profitAddress)
388391 }
389392 }
390393 else throw("Strict value is not equal to itself.")
391394 }
392395 else throw("Strict value is not equal to itself.")
393396 }
394397
395398
396399 func rebalanceAsset (assetId) = {
397- let $t01536415500 = getLeaseProxyConfig(assetId)
398- let isLeasable = $t01536415500._1
399- let leasedRatio = $t01536415500._2
400- let minBalance = $t01536415500._3
401- let proxyAddress = $t01536415500._4
402- let proxyAssetId = $t01536415500._5
403- let proxyRateMul = $t01536415500._6
404- let stakingProfitAddress = $t01536415500._7
400+ let $t01546015596 = getLeaseProxyConfig(assetId)
401+ let isLeasable = $t01546015596._1
402+ let leasedRatio = $t01546015596._2
403+ let minBalance = $t01546015596._3
404+ let proxyAddress = $t01546015596._4
405+ let proxyAssetId = $t01546015596._5
406+ let proxyRateMul = $t01546015596._6
407+ let stakingProfitAddress = $t01546015596._7
405408 if (isLeasable)
406409 then rebalanceInternal(leasedRatio, assetId, proxyAssetId, minBalance, addressFromStringValue(proxyAddress), proxyRateMul, addressFromStringValue(stakingProfitAddress))
407410 else nil
408411 }
409412
410413
411414 func withdrawAndRebalanceAsset (assetId,getAmount) = {
412- let $t01589916035 = getLeaseProxyConfig(assetId)
413- let isLeasable = $t01589916035._1
414- let leasedRatio = $t01589916035._2
415- let minBalance = $t01589916035._3
416- let proxyAddress = $t01589916035._4
417- let proxyAssetId = $t01589916035._5
418- let proxyRateMul = $t01589916035._6
419- let stakingProfitAddress = $t01589916035._7
415+ let $t01599516131 = getLeaseProxyConfig(assetId)
416+ let isLeasable = $t01599516131._1
417+ let leasedRatio = $t01599516131._2
418+ let minBalance = $t01599516131._3
419+ let proxyAddress = $t01599516131._4
420+ let proxyAssetId = $t01599516131._5
421+ let proxyRateMul = $t01599516131._6
422+ let stakingProfitAddress = $t01599516131._7
420423 if (isLeasable)
421424 then {
422425 let newTotalLeasableBalance = max([0, ((getAccBalance(assetId) - getAmount) - minBalance)])
423426 if ((newTotalLeasableBalance == newTotalLeasableBalance))
424427 then {
425428 let newAdditionalBalance = fraction(leasedRatio, newTotalLeasableBalance, 100)
426429 if ((newAdditionalBalance == newAdditionalBalance))
427430 then {
428431 let withdrawAmount = (getAdditionalBalanceOrZero(assetId) - newAdditionalBalance)
429432 if ((withdrawAmount == withdrawAmount))
430433 then if ((0 > withdrawAmount))
431434 then deposit(assetId, -(withdrawAmount), proxyAssetId, addressFromStringValue(proxyAddress))
432435 else withdraw(assetId, withdrawAmount, proxyAssetId, addressFromStringValue(proxyAddress), proxyRateMul, addressFromStringValue(stakingProfitAddress))
433436 else throw("Strict value is not equal to itself.")
434437 }
435438 else throw("Strict value is not equal to itself.")
436439 }
437440 else throw("Strict value is not equal to itself.")
438441 }
439442 else nil
440443 }
441444
442445
443446 func withdrawAndRebalanceAll (amountAssetOutAmount,priceAssetOutAmount) = {
444447 let AmAmtWithdrawState = withdrawAndRebalanceAsset(getStringOrFail(this, aa()), amountAssetOutAmount)
445448 let PrAmtWithdrawState = withdrawAndRebalanceAsset(getStringOrFail(this, pa()), priceAssetOutAmount)
446449 (AmAmtWithdrawState ++ PrAmtWithdrawState)
447450 }
448451
449452
450453 func privateCalcPrice (amAssetDcm,prAssetDcm,amAmt,prAmt) = {
451454 let amtAssetAmtX18 = toX18(amAmt, amAssetDcm)
452455 let priceAssetAmtX18 = toX18(prAmt, prAssetDcm)
453456 calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
454457 }
455458
456459
457460 func calcPrices (amAmt,prAmt,lpAmt) = {
458461 let cfg = getPoolConfig()
459462 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
460463 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
461464 let priceX18 = privateCalcPrice(amtAssetDcm, priceAssetDcm, amAmt, prAmt)
462465 let amAmtX18 = toX18(amAmt, amtAssetDcm)
463466 let prAmtX18 = toX18(prAmt, priceAssetDcm)
464467 let lpAmtX18 = toX18(lpAmt, scale8)
465468 let lpPriceInAmAssetX18 = calcPriceBigInt(amAmtX18, lpAmtX18)
466469 let lpPriceInPrAssetX18 = calcPriceBigInt(prAmtX18, lpAmtX18)
467470 [priceX18, lpPriceInAmAssetX18, lpPriceInPrAssetX18]
468471 }
469472
470473
471474 func calculatePrices (amAmt,prAmt,lpAmt) = {
472475 let prices = calcPrices(amAmt, prAmt, lpAmt)
473476 [fromX18(prices[0], scale8), fromX18(prices[1], scale8), fromX18(prices[2], scale8)]
474477 }
475478
476479
477480 func estimateGetOperation (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
478481 let cfg = getPoolConfig()
479482 let lpAssetId = cfg[idxPoolLPAssetId]
480483 let amAssetId = cfg[idxAmtAssetId]
481484 let prAssetId = cfg[idxPriceAssetId]
482485 let amAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
483486 let prAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
484487 let poolStatus = cfg[idxPoolStatus]
485488 let lpEmission = valueOrErrorMessage(assetInfo(fromBase58String(lpAssetId)), (("Asset " + lpAssetId) + " doesn't exist")).quantity
486489 if ((lpAssetId != pmtAssetId))
487490 then throw("Invalid asset passed.")
488491 else {
489492 let amBalance = getAccBalance(amAssetId)
490493 let amBalanceX18 = toX18(amBalance, amAssetDcm)
491494 let prBalance = getAccBalance(prAssetId)
492495 let prBalanceX18 = toX18(prBalance, prAssetDcm)
493496 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
494497 let curPrice = fromX18(curPriceX18, scale8)
495498 let pmtLpAmtX18 = toX18(pmtLpAmt, scale8)
496499 let lpEmissionX18 = toX18(lpEmission, scale8)
497500 let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissionX18)
498501 let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissionX18)
499502 let outAmAmt = fromX18Round(outAmAmtX18, amAssetDcm, FLOOR)
500503 let outPrAmt = fromX18Round(outPrAmtX18, prAssetDcm, FLOOR)
501504 let state = if ((txId58 == ""))
502505 then nil
503506 else [ScriptTransfer(userAddress, outAmAmt, if ((amAssetId == "WAVES"))
504507 then unit
505508 else fromBase58String(amAssetId)), ScriptTransfer(userAddress, outPrAmt, if ((prAssetId == "WAVES"))
506509 then unit
507510 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)]
508511 $Tuple10(outAmAmt, outPrAmt, amAssetId, prAssetId, amBalance, prBalance, lpEmission, curPriceX18, poolStatus, state)
509512 }
510513 }
511514
512515
513516 func estimatePutOperation (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = {
514517 let cfg = getPoolConfig()
515518 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
516519 let amAssetIdStr = cfg[idxAmtAssetId]
517520 let prAssetIdStr = cfg[idxPriceAssetId]
518521 let iAmtAssetId = cfg[idxIAmtAssetId]
519522 let iPriceAssetId = cfg[idxIPriceAssetId]
520523 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
521524 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
522525 let poolStatus = cfg[idxPoolStatus]
523526 let lpEmission = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
524527 let inAmAssetIdStr = toBase58String(valueOrElse(inAmAssetId, fromBase58String("WAVES")))
525528 let inPrAssetIdStr = toBase58String(valueOrElse(inPrAssetId, fromBase58String("WAVES")))
526529 if (if ((amAssetIdStr != inAmAssetIdStr))
527530 then true
528531 else (prAssetIdStr != inPrAssetIdStr))
529532 then throw("Invalid amt or price asset passed.")
530533 else {
531534 let amBalance = if (isEvaluate)
532535 then getAccBalance(amAssetIdStr)
533536 else (getAccBalance(amAssetIdStr) - inAmAssetAmt)
534537 let prBalance = if (isEvaluate)
535538 then getAccBalance(prAssetIdStr)
536539 else (getAccBalance(prAssetIdStr) - inPrAssetAmt)
537540 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
538541 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
539542 let userPriceX18 = calcPriceBigInt(inPrAssetAmtX18, inAmAssetAmtX18)
540543 let amBalanceX18 = toX18(amBalance, amtAssetDcm)
541544 let prBalanceX18 = toX18(prBalance, priceAssetDcm)
542545 let res = if ((lpEmission == 0))
543546 then {
544547 let curPriceX18 = zeroBigInt
545548 let slippageX18 = zeroBigInt
546549 let lpAmtX18 = pow((inAmAssetAmtX18 * inPrAssetAmtX18), 0, toBigInt(5), 1, 0, DOWN)
547550 $Tuple5(fromX18(lpAmtX18, scale8), fromX18(inAmAssetAmtX18, amtAssetDcm), fromX18(inPrAssetAmtX18, priceAssetDcm), calcPriceBigInt((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18)
548551 }
549552 else {
550553 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
551554 let slippageX18 = fraction(absBigInt((curPriceX18 - userPriceX18)), scale18, curPriceX18)
552555 let slippageToleranceX18 = toX18(slippageTolerance, scale8)
553556 if (if ((curPriceX18 != zeroBigInt))
554557 then (slippageX18 > slippageToleranceX18)
555558 else false)
556559 then throw(((("Price slippage " + toString(slippageX18)) + " exceeded the passed limit of ") + toString(slippageToleranceX18)))
557560 else {
558561 let lpEmissionX18 = toX18(lpEmission, scale8)
559562 let prViaAmX18 = fraction(inAmAssetAmtX18, calcPriceBigIntRound(prBalanceX18, amBalanceX18, CEILING), scale18, CEILING)
560563 let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, calcPriceBigIntRound(prBalanceX18, amBalanceX18, FLOOR), CEILING)
561564 let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18))
562565 then $Tuple2(amViaPrX18, inPrAssetAmtX18)
563566 else $Tuple2(inAmAssetAmtX18, prViaAmX18)
564567 let expAmtAssetAmtX18 = expectedAmts._1
565568 let expPriceAssetAmtX18 = expectedAmts._2
566569 let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18, FLOOR)
567570 $Tuple5(fromX18Round(lpAmtX18, scale8, FLOOR), fromX18Round(expAmtAssetAmtX18, amtAssetDcm, CEILING), fromX18Round(expPriceAssetAmtX18, priceAssetDcm, CEILING), curPriceX18, slippageX18)
568571 }
569572 }
570573 let calcLpAmt = res._1
571574 let calcAmAssetPmt = res._2
572575 let calcPrAssetPmt = res._3
573576 let curPrice = fromX18(res._4, scale8)
574577 let slippageCalc = fromX18(res._5, scale8)
575578 if ((0 >= calcLpAmt))
576579 then throw("Invalid calculations. LP calculated is less than zero.")
577580 else {
578581 let emitLpAmt = if (!(emitLp))
579582 then 0
580583 else calcLpAmt
581584 let amDiff = (inAmAssetAmt - calcAmAssetPmt)
582585 let prDiff = (inPrAssetAmt - calcPrAssetPmt)
583586 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))]
584587 $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEmission, lpAssetId, poolStatus, commonState, amDiff, prDiff, inAmAssetId, inPrAssetId)
585588 }
586589 }
587590 }
588591
589592
590593 func calcKLp (amountBalance,priceBalance,lpEmission) = {
591594 let amountBalanceX18 = toX18BigInt(amountBalance, toBigInt(cfgAmountAssetDecimals))
592595 let priceBalanceX18 = toX18BigInt(priceBalance, toBigInt(cfgPriceAssetDecimals))
593596 let updatedKLp = fraction(pow((amountBalanceX18 * priceBalanceX18), 0, toBigInt(5), 1, 18, DOWN), big1, lpEmission)
594597 if ((lpEmission == big0))
595598 then big0
596599 else updatedKLp
597600 }
598601
599602
600603 func calcCurrentKLp (amountAssetDelta,priceAssetDelta,lpAssetEmissionDelta) = {
601604 let amountAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) - amountAssetDelta)
602605 let priceAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) - priceAssetDelta)
603606 let lpAssetEmission = (toBigInt(value(assetInfo(cfgLpAssetId)).quantity) - lpAssetEmissionDelta)
604607 let currentKLp = calcKLp(amountAssetBalance, priceAssetBalance, lpAssetEmission)
605608 currentKLp
606609 }
607610
608611
609612 func refreshKLpInternal (amountAssetBalanceDelta,priceAssetBalanceDelta,lpAssetEmissionDelta) = {
610613 let amountAssetBalance = (getAccBalance(assetIdToString(cfgAmountAssetId)) + amountAssetBalanceDelta)
611614 let priceAssetBalance = (getAccBalance(assetIdToString(cfgPriceAssetId)) + priceAssetBalanceDelta)
612615 let lpAssetEmission = (value(assetInfo(cfgLpAssetId)).quantity + lpAssetEmissionDelta)
613616 let updatedKLp = calcKLp(toBigInt(amountAssetBalance), toBigInt(priceAssetBalance), toBigInt(lpAssetEmission))
614617 let actions = [IntegerEntry(keyKLpRefreshedHeight, height), StringEntry(keyKLp, toString(updatedKLp))]
615618 $Tuple2(actions, updatedKLp)
616619 }
617620
618621
622+func skipOrderValidation () = valueOrElse(getBoolean(factoryContract, keySkipOrderValidation(toString(this))), false)
623+
624+
619625 func validateUpdatedKLp (oldKLp,updatedKLp) = if ((updatedKLp >= oldKLp))
620626 then true
621627 else throwErr(makeString(["updated KLp lower than current KLp", toString(oldKLp), toString(updatedKLp)], " "))
622628
623629
624630 func validateMatcherOrderAllowed (order) = {
625631 let amountAssetBalance = getAccBalance(assetIdToString(cfgAmountAssetId))
626632 let priceAssetBalance = getAccBalance(assetIdToString(cfgPriceAssetId))
627633 let amountAssetAmount = order.amount
628634 let priceAssetAmount = fraction(order.amount, order.price, scale8, FLOOR)
629- let $t02830128513 = if ((order.orderType == Buy))
635+ let $t02852028732 = if ((order.orderType == Buy))
630636 then $Tuple2(amountAssetAmount, -(priceAssetAmount))
631637 else $Tuple2(-(amountAssetAmount), priceAssetAmount)
632- let amountAssetBalanceDelta = $t02830128513._1
633- let priceAssetBalanceDelta = $t02830128513._2
638+ let amountAssetBalanceDelta = $t02852028732._1
639+ let priceAssetBalanceDelta = $t02852028732._2
634640 if (if (if (isGlobalShutdown())
635641 then true
636642 else (cfgPoolStatus == PoolMatcherDisabled))
637643 then true
638644 else (cfgPoolStatus == PoolShutdown))
639645 then throw("Exchange operations disabled")
640646 else if (if ((order.assetPair.amountAsset != cfgAmountAssetId))
641647 then true
642648 else (order.assetPair.priceAsset != cfgPriceAssetId))
643649 then throw("Wrong order assets.")
644650 else {
645651 let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
646- let $t02895329053 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
647- let unusedActions = $t02895329053._1
648- let kLpNew = $t02895329053._2
652+ let $t02917229272 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
653+ let unusedActions = $t02917229272._1
654+ let kLpNew = $t02917229272._2
649655 let isOrderValid = (kLpNew >= kLp)
650656 let info = makeString(["kLp=", toString(kLp), " kLpNew=", toString(kLpNew), " amountAssetBalance=", toString(amountAssetBalance), " priceAssetBalance=", toString(priceAssetBalance), " amountAssetBalanceDelta=", toString(amountAssetBalanceDelta), " priceAssetBalanceDelta=", toString(priceAssetBalanceDelta), " height=", toString(height)], "")
651657 $Tuple2(isOrderValid, info)
652658 }
653659 }
654660
655661
656662 func commonGet (i) = if ((size(i.payments) != 1))
657663 then throw("exactly 1 payment is expected")
658664 else {
659665 let pmt = value(i.payments[0])
660666 let pmtAssetId = value(pmt.assetId)
661667 let pmtAmt = pmt.amount
662668 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller)
663669 let outAmAmt = res._1
664670 let outPrAmt = res._2
665671 let poolStatus = parseIntValue(res._9)
666672 let state = res._10
667673 if (if (isGlobalShutdown())
668674 then true
669675 else (poolStatus == PoolShutdown))
670676 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
671677 else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state)
672678 }
673679
674680
675681 func commonPut (i,slippageTolerance,emitLp) = if ((size(i.payments) != 2))
676682 then throw("exactly 2 payments are expected")
677683 else {
678684 let amAssetPmt = value(i.payments[0])
679685 let prAssetPmt = value(i.payments[1])
680686 let estPut = estimatePutOperation(toBase58String(i.transactionId), slippageTolerance, amAssetPmt.amount, amAssetPmt.assetId, prAssetPmt.amount, prAssetPmt.assetId, toString(i.caller), false, emitLp)
681687 let poolStatus = parseIntValue(estPut._8)
682688 if (if (if (isGlobalShutdown())
683689 then true
684690 else (poolStatus == PoolPutDisabled))
685691 then true
686692 else (poolStatus == PoolShutdown))
687693 then throw(("Put operation is blocked by admin. Status = " + toString(poolStatus)))
688694 else estPut
689695 }
690696
691697
692698 func emit (amount) = {
693699 let emitInv = invoke(factoryContract, "emit", [amount], nil)
694700 if ((emitInv == emitInv))
695701 then {
696702 let emitInvLegacy = match emitInv {
697703 case legacyFactoryContract: Address =>
698704 invoke(legacyFactoryContract, "emit", [amount], nil)
699705 case _ =>
700706 unit
701707 }
702708 if ((emitInvLegacy == emitInvLegacy))
703709 then amount
704710 else throw("Strict value is not equal to itself.")
705711 }
706712 else throw("Strict value is not equal to itself.")
707713 }
708714
709715
710716 func takeFee (amount,fee) = {
711717 let feeAmount = if ((fee == 0))
712718 then 0
713719 else fraction(amount, fee, scale8)
714720 $Tuple2((amount - feeAmount), feeAmount)
715721 }
716722
717723
718724 func calcPutOneToken (paymentAmountRaw,paymentAssetId,userAddress,txId) = {
719725 let isEval = (txId == unit)
720726 let amountBalanceRaw = getAccBalance(assetIdToString(cfgAmountAssetId))
721727 let priceBalanceRaw = getAccBalance(assetIdToString(cfgPriceAssetId))
722728 let paymentInAmountAsset = if ((paymentAssetId == cfgAmountAssetId))
723729 then true
724730 else if ((paymentAssetId == cfgPriceAssetId))
725731 then false
726732 else throwErr("invalid asset")
727- let $t03216632459 = if (isEval)
733+ let $t03238532678 = if (isEval)
728734 then $Tuple2(amountBalanceRaw, priceBalanceRaw)
729735 else if (paymentInAmountAsset)
730736 then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw)
731737 else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw))
732- let amountBalanceOld = $t03216632459._1
733- let priceBalanceOld = $t03216632459._2
734- let $t03246332612 = if (paymentInAmountAsset)
738+ let amountBalanceOld = $t03238532678._1
739+ let priceBalanceOld = $t03238532678._2
740+ let $t03268232831 = if (paymentInAmountAsset)
735741 then $Tuple2(paymentAmountRaw, 0)
736742 else $Tuple2(0, paymentAmountRaw)
737- let amountAssetAmountRaw = $t03246332612._1
738- let priceAssetAmountRaw = $t03246332612._2
743+ let amountAssetAmountRaw = $t03268232831._1
744+ let priceAssetAmountRaw = $t03268232831._2
739745 let amountAssetAmount = takeFee(amountAssetAmountRaw, inFee)._1
740746 let priceAssetAmount = takeFee(priceAssetAmountRaw, inFee)._1
741- let $t03274432808 = takeFee(paymentAmountRaw, inFee)
742- let paymentAmount = $t03274432808._1
743- let feeAmount = $t03274432808._2
747+ let $t03296333027 = takeFee(paymentAmountRaw, inFee)
748+ let paymentAmount = $t03296333027._1
749+ let feeAmount = $t03296333027._2
744750 let amountBalanceNew = (amountBalanceOld + amountAssetAmount)
745751 let priceBalanceNew = (priceBalanceOld + priceAssetAmount)
746752 let priceNewX18 = calcPriceBigInt(toX18(priceBalanceNew, cfgPriceAssetDecimals), toX18(amountBalanceNew, cfgAmountAssetDecimals))
747753 let priceNew = fromX18(priceNewX18, scale8)
748754 let paymentBalance = if (paymentInAmountAsset)
749755 then amountBalanceOld
750756 else priceBalanceOld
751757 let paymentBalanceBigInt = toBigInt(paymentBalance)
752758 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
753759 let chechSupply = if ((supplyBigInt > big0))
754760 then true
755761 else throwErr("initial deposit requires all coins")
756762 if ((chechSupply == chechSupply))
757763 then {
758764 let depositBigInt = toBigInt(paymentAmount)
759765 let issueAmount = max([0, toInt(((supplyBigInt * (sqrtBigInt((scale18 + ((depositBigInt * scale18) / paymentBalanceBigInt)), 18, 18, DOWN) - scale18)) / scale18))])
760766 let commonState = if (isEval)
761767 then nil
762768 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))]
763769 let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, cfgPriceAssetDecimals), toX18(amountBalanceOld, cfgAmountAssetDecimals))
764770 let priceOld = fromX18(priceOldX18, scale8)
765771 let loss = {
766- let $t03448934656 = if (paymentInAmountAsset)
772+ let $t03470834875 = if (paymentInAmountAsset)
767773 then $Tuple2(amountAssetAmountRaw, amountBalanceOld)
768774 else $Tuple2(priceAssetAmountRaw, priceBalanceOld)
769- let amount = $t03448934656._1
770- let balance = $t03448934656._2
775+ let amount = $t03470834875._1
776+ let balance = $t03470834875._2
771777 let issueAmountBoth = toInt(fraction(supplyBigInt, toBigInt((amount / 2)), toBigInt(balance)))
772778 fraction((issueAmount - issueAmountBoth), scale8, issueAmountBoth)
773779 }
774780 $Tuple5(issueAmount, commonState, feeAmount, loss, paymentInAmountAsset)
775781 }
776782 else throw("Strict value is not equal to itself.")
777783 }
778784
779785
780786 func calcGetOneToken (outAssetId,paymentAmount,paymentAssetId,userAddress,txId) = {
781787 let isEval = (txId == unit)
782788 let cfg = getPoolConfig()
783789 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
784790 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
785791 let checks = [if ((paymentAssetId == cfgLpAssetId))
786792 then true
787793 else throwErr("invalid lp asset")]
788794 if ((checks == checks))
789795 then {
790796 let outInAmountAsset = if ((outAssetId == cfgAmountAssetId))
791797 then true
792798 else if ((outAssetId == cfgPriceAssetId))
793799 then false
794800 else throwErr("invalid asset")
795801 let balanceBigInt = if (outInAmountAsset)
796802 then toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId)))
797803 else toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId)))
798804 let outInAmountAssetDecimals = if (outInAmountAsset)
799805 then amtAssetDcm
800806 else priceAssetDcm
801807 let amBalanceOld = getAccBalance(assetIdToString(cfgAmountAssetId))
802808 let prBalanceOld = getAccBalance(assetIdToString(cfgPriceAssetId))
803809 let outBalance = if (outInAmountAsset)
804810 then amBalanceOld
805811 else prBalanceOld
806812 let outBalanceBigInt = toBigInt(outBalance)
807813 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
808814 let redeemedBigInt = toBigInt(paymentAmount)
809815 let amountRaw = max([0, toInt(((balanceBigInt * (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN))) / scale18))])
810- let $t03673436790 = takeFee(amountRaw, outFee)
811- let totalAmount = $t03673436790._1
812- let feeAmount = $t03673436790._2
813- let $t03679437020 = if (outInAmountAsset)
816+ let $t03695337009 = takeFee(amountRaw, outFee)
817+ let totalAmount = $t03695337009._1
818+ let feeAmount = $t03695337009._2
819+ let $t03701337239 = if (outInAmountAsset)
814820 then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld)
815821 else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw))
816- let outAmAmount = $t03679437020._1
817- let outPrAmount = $t03679437020._2
818- let amBalanceNew = $t03679437020._3
819- let prBalanceNew = $t03679437020._4
822+ let outAmAmount = $t03701337239._1
823+ let outPrAmount = $t03701337239._2
824+ let amBalanceNew = $t03701337239._3
825+ let prBalanceNew = $t03701337239._4
820826 let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, cfgPriceAssetDecimals), toX18(amBalanceNew, cfgAmountAssetDecimals))
821827 let priceNew = fromX18(priceNewX18, scale8)
822828 let commonState = if (isEval)
823829 then nil
824830 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)]
825831 let priceOldX18 = calcPriceBigInt(toX18(prBalanceOld, cfgPriceAssetDecimals), toX18(amBalanceOld, cfgAmountAssetDecimals))
826832 let priceOld = fromX18(priceOldX18, scale8)
827833 let loss = {
828834 let amountBothInPaymentAsset = (toInt(fraction(balanceBigInt, redeemedBigInt, supplyBigInt)) * 2)
829835 fraction((totalAmount - amountBothInPaymentAsset), scale8, amountBothInPaymentAsset)
830836 }
831837 $Tuple5(totalAmount, commonState, feeAmount, loss, outInAmountAsset)
832838 }
833839 else throw("Strict value is not equal to itself.")
834840 }
835841
836842
837843 func managerPublicKeyOrUnit () = match getString(mpk()) {
838844 case s: String =>
839845 fromBase58String(s)
840846 case _: Unit =>
841847 unit
842848 case _ =>
843849 throw("Match error")
844850 }
845851
846852
847853 func pendingManagerPublicKeyOrUnit () = match getString(pmpk()) {
848854 case s: String =>
849855 fromBase58String(s)
850856 case _: Unit =>
851857 unit
852858 case _ =>
853859 throw("Match error")
854860 }
855861
856862
857863 func isManager (i) = match managerPublicKeyOrUnit() {
858864 case pk: ByteVector =>
859865 (i.callerPublicKey == pk)
860866 case _: Unit =>
861867 (i.caller == this)
862868 case _ =>
863869 throw("Match error")
864870 }
865871
866872
867873 func mustManager (i) = {
868874 let pd = throw("Permission denied")
869875 match managerPublicKeyOrUnit() {
870876 case pk: ByteVector =>
871877 if ((i.callerPublicKey == pk))
872878 then true
873879 else pd
874880 case _: Unit =>
875881 if ((i.caller == this))
876882 then true
877883 else pd
878884 case _ =>
879885 throw("Match error")
880886 }
881887 }
882888
883889
884890 @Callable(i)
885891 func rebalance () = (rebalanceAsset(getStringOrFail(this, aa())) ++ rebalanceAsset(getStringOrFail(this, pa())))
886892
887893
888894
889895 @Callable(i)
890896 func calculateAmountOutForSwapREADONLY (cleanAmountIn,isReverse,feePoolAmount) = {
891- let $t03890639211 = if ((isReverse == false))
897+ let $t03912539430 = if ((isReverse == false))
892898 then {
893899 let assetOut = getStringOrFail(this, pa())
894900 let assetIn = getStringOrFail(this, aa())
895901 $Tuple2(assetOut, assetIn)
896902 }
897903 else {
898904 let assetOut = getStringOrFail(this, aa())
899905 let assetIn = getStringOrFail(this, pa())
900906 $Tuple2(assetOut, assetIn)
901907 }
902- let assetOut = $t03890639211._1
903- let assetIn = $t03890639211._2
908+ let assetOut = $t03912539430._1
909+ let assetIn = $t03912539430._2
904910 let poolAssetInBalance = getAccBalance(assetIn)
905911 let poolAssetOutBalance = getAccBalance(assetOut)
906912 let amountOut = fraction(poolAssetOutBalance, cleanAmountIn, (poolAssetInBalance + cleanAmountIn))
907913 let oldK = (toBigInt(poolAssetInBalance) * toBigInt(poolAssetOutBalance))
908914 let newK = (((toBigInt(getAccBalance(assetIn)) + toBigInt(cleanAmountIn)) + toBigInt(feePoolAmount)) * (toBigInt(getAccBalance(assetOut)) - toBigInt(amountOut)))
909915 let checkK = if ((newK >= oldK))
910916 then true
911917 else throw("new K is fewer error")
912918 if ((checkK == checkK))
913919 then $Tuple2(nil, amountOut)
914920 else throw("Strict value is not equal to itself.")
915921 }
916922
917923
918924
919925 @Callable(i)
920926 func calculateAmountOutForSwapAndSendTokens (cleanAmountIn,isReverse,amountOutMin,addressTo,feePoolAmount) = {
921927 let swapContact = {
922928 let @ = invoke(factoryContract, "getSwapContractREADONLY", nil, nil)
923929 if ($isInstanceOf(@, "String"))
924930 then @
925931 else throw(($getType(@) + " couldn't be cast to String"))
926932 }
927933 let checks = [if ((value(i.payments[0]).amount >= cleanAmountIn))
928934 then true
929935 else throwErr("Wrong amount"), if ((i.caller == addressFromStringValue(swapContact)))
930936 then true
931937 else throwErr("Permission denied")]
932938 if ((checks == checks))
933939 then {
934940 let pmt = value(i.payments[0])
935941 let assetIn = assetIdToString(pmt.assetId)
936942 let assetOut = if ((isReverse == false))
937943 then getStringOrFail(this, pa())
938944 else getStringOrFail(this, aa())
939945 let poolAssetInBalance = (getAccBalance(assetIn) - value(i.payments[0]).amount)
940946 let poolAssetOutBalance = getAccBalance(assetOut)
941947 let amountOut = fraction(poolAssetOutBalance, cleanAmountIn, (poolAssetInBalance + cleanAmountIn))
942948 let oldK = (toBigInt(poolAssetInBalance) * toBigInt(poolAssetOutBalance))
943949 let newK = ((toBigInt(getAccBalance(assetIn)) + toBigInt(feePoolAmount)) * (toBigInt(getAccBalance(assetOut)) - toBigInt(amountOut)))
944950 let checkK = if ((newK >= oldK))
945951 then true
946952 else throw("new K is fewer error")
947953 if ((checkK == checkK))
948954 then {
949955 let checkMin = if ((amountOut >= amountOutMin))
950956 then true
951957 else throw("Exchange result is fewer coins than expected")
952958 if ((checkMin == checkMin))
953959 then {
954960 let rebalanceState = rebalanceAsset(assetIn)
955961 if ((rebalanceState == rebalanceState))
956962 then {
957963 let withdrawState = withdrawAndRebalanceAsset(assetOut, amountOut)
958964 if ((withdrawState == withdrawState))
959965 then $Tuple2(((withdrawState ++ rebalanceState) ++ [ScriptTransfer(addressFromStringValue(addressTo), amountOut, parseAssetId(assetOut))]), amountOut)
960966 else throw("Strict value is not equal to itself.")
961967 }
962968 else throw("Strict value is not equal to itself.")
963969 }
964970 else throw("Strict value is not equal to itself.")
965971 }
966972 else throw("Strict value is not equal to itself.")
967973 }
968974 else throw("Strict value is not equal to itself.")
969975 }
970976
971977
972978
973979 @Callable(i)
974980 func setManager (pendingManagerPublicKey) = {
975981 let checkCaller = mustManager(i)
976982 if ((checkCaller == checkCaller))
977983 then {
978984 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
979985 if ((checkManagerPublicKey == checkManagerPublicKey))
980986 then [StringEntry(pmpk(), pendingManagerPublicKey)]
981987 else throw("Strict value is not equal to itself.")
982988 }
983989 else throw("Strict value is not equal to itself.")
984990 }
985991
986992
987993
988994 @Callable(i)
989995 func confirmManager () = {
990996 let pm = pendingManagerPublicKeyOrUnit()
991997 let hasPM = if (isDefined(pm))
992998 then true
993999 else throw("No pending manager")
9941000 if ((hasPM == hasPM))
9951001 then {
9961002 let checkPM = if ((i.callerPublicKey == value(pm)))
9971003 then true
9981004 else throw("You are not pending manager")
9991005 if ((checkPM == checkPM))
10001006 then [StringEntry(mpk(), toBase58String(value(pm))), DeleteEntry(pmpk())]
10011007 else throw("Strict value is not equal to itself.")
10021008 }
10031009 else throw("Strict value is not equal to itself.")
10041010 }
10051011
10061012
10071013
10081014 @Callable(i)
10091015 func put (slippageTolerance,shouldAutoStake) = if ((0 > slippageTolerance))
10101016 then throw("Invalid slippageTolerance passed")
10111017 else {
10121018 let estPut = commonPut(i, slippageTolerance, true)
10131019 let emitLpAmt = estPut._2
10141020 let lpAssetId = estPut._7
10151021 let state = estPut._9
10161022 let amDiff = estPut._10
10171023 let prDiff = estPut._11
10181024 let amId = estPut._12
10191025 let prId = estPut._13
10201026 let amAssetPmt = toBigInt(value(i.payments[0]).amount)
10211027 let prAssetPmt = toBigInt(value(i.payments[1]).amount)
10221028 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
10231029 if ((currentKLp == currentKLp))
10241030 then {
10251031 let emitInv = invoke(factoryContract, "emit", [emitLpAmt], nil)
10261032 if ((emitInv == emitInv))
10271033 then {
10281034 let emitInvLegacy = match emitInv {
10291035 case legacyFactoryContract: Address =>
10301036 invoke(legacyFactoryContract, "emit", [emitLpAmt], nil)
10311037 case _ =>
10321038 unit
10331039 }
10341040 if ((emitInvLegacy == emitInvLegacy))
10351041 then {
10361042 let slippageAInv = if ((amDiff > 0))
10371043 then invoke(slippageContract, "put", nil, [AttachedPayment(amId, amDiff)])
10381044 else nil
10391045 if ((slippageAInv == slippageAInv))
10401046 then {
10411047 let slippagePInv = if ((prDiff > 0))
10421048 then invoke(slippageContract, "put", nil, [AttachedPayment(prId, prDiff)])
10431049 else nil
10441050 if ((slippagePInv == slippagePInv))
10451051 then {
10461052 let lpTransfer = if (shouldAutoStake)
10471053 then {
10481054 let slpStakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)])
10491055 if ((slpStakeInv == slpStakeInv))
10501056 then nil
10511057 else throw("Strict value is not equal to itself.")
10521058 }
10531059 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
1054- let $t04425744719 = refreshKLpInternal(0, 0, 0)
1055- if (($t04425744719 == $t04425744719))
1060+ let $t04447644938 = refreshKLpInternal(0, 0, 0)
1061+ if (($t04447644938 == $t04447644938))
10561062 then {
1057- let updatedKLp = $t04425744719._2
1058- let refreshKLpActions = $t04425744719._1
1063+ let updatedKLp = $t04447644938._2
1064+ let refreshKLpActions = $t04447644938._1
10591065 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10601066 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10611067 then {
10621068 let reb = invoke(this, "rebalance", nil, nil)
10631069 if ((reb == reb))
10641070 then ((state ++ lpTransfer) ++ refreshKLpActions)
10651071 else throw("Strict value is not equal to itself.")
10661072 }
10671073 else throw("Strict value is not equal to itself.")
10681074 }
10691075 else throw("Strict value is not equal to itself.")
10701076 }
10711077 else throw("Strict value is not equal to itself.")
10721078 }
10731079 else throw("Strict value is not equal to itself.")
10741080 }
10751081 else throw("Strict value is not equal to itself.")
10761082 }
10771083 else throw("Strict value is not equal to itself.")
10781084 }
10791085 else throw("Strict value is not equal to itself.")
10801086 }
10811087
10821088
10831089
10841090 @Callable(i)
10851091 func putForFree (maxSlippage) = if ((0 > maxSlippage))
10861092 then throw("Invalid value passed")
10871093 else {
10881094 let estPut = commonPut(i, maxSlippage, false)
10891095 let state = estPut._9
10901096 let amAssetPmt = toBigInt(value(i.payments[0]).amount)
10911097 let prAssetPmt = toBigInt(value(i.payments[1]).amount)
10921098 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
10931099 if ((currentKLp == currentKLp))
10941100 then {
1095- let $t04533145396 = refreshKLpInternal(0, 0, 0)
1096- let refreshKLpActions = $t04533145396._1
1097- let updatedKLp = $t04533145396._2
1101+ let $t04555045615 = refreshKLpInternal(0, 0, 0)
1102+ let refreshKLpActions = $t04555045615._1
1103+ let updatedKLp = $t04555045615._2
10981104 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10991105 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11001106 then (state ++ refreshKLpActions)
11011107 else throw("Strict value is not equal to itself.")
11021108 }
11031109 else throw("Strict value is not equal to itself.")
11041110 }
11051111
11061112
11071113
11081114 @Callable(i)
11091115 func putOneTkn (minOutAmount,autoStake) = {
11101116 let isPoolOneTokenOperationsDisabled = {
11111117 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
11121118 if ($isInstanceOf(@, "Boolean"))
11131119 then @
11141120 else throw(($getType(@) + " couldn't be cast to Boolean"))
11151121 }
11161122 let isPutDisabled = if (if (if (isGlobalShutdown())
11171123 then true
11181124 else (cfgPoolStatus == PoolPutDisabled))
11191125 then true
11201126 else (cfgPoolStatus == PoolShutdown))
11211127 then true
11221128 else isPoolOneTokenOperationsDisabled
11231129 let checks = [if (if (!(isPutDisabled))
11241130 then true
11251131 else isManager(i))
11261132 then true
11271133 else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1))
11281134 then true
11291135 else throwErr("exactly 1 payment are expected")]
11301136 if ((checks == checks))
11311137 then {
11321138 let payment = i.payments[0]
11331139 let paymentAssetId = payment.assetId
11341140 let paymentAmountRaw = payment.amount
11351141 let currentKLp = if ((paymentAssetId == cfgAmountAssetId))
11361142 then calcCurrentKLp(toBigInt(paymentAmountRaw), toBigInt(0), toBigInt(0))
11371143 else if ((paymentAssetId == cfgPriceAssetId))
11381144 then calcCurrentKLp(toBigInt(0), toBigInt(paymentAmountRaw), toBigInt(0))
11391145 else throwErr("payment asset is not supported")
11401146 if ((currentKLp == currentKLp))
11411147 then {
11421148 let userAddress = i.caller
11431149 let txId = i.transactionId
1144- let $t04658446736 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
1145- if (($t04658446736 == $t04658446736))
1150+ let $t04680346955 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
1151+ if (($t04680346955 == $t04680346955))
11461152 then {
1147- let paymentInAmountAsset = $t04658446736._5
1148- let bonus = $t04658446736._4
1149- let feeAmount = $t04658446736._3
1150- let commonState = $t04658446736._2
1151- let emitAmountEstimated = $t04658446736._1
1153+ let paymentInAmountAsset = $t04680346955._5
1154+ let bonus = $t04680346955._4
1155+ let feeAmount = $t04680346955._3
1156+ let commonState = $t04680346955._2
1157+ let emitAmountEstimated = $t04680346955._1
11521158 let emitAmount = if (if ((minOutAmount > 0))
11531159 then (minOutAmount > emitAmountEstimated)
11541160 else false)
11551161 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
11561162 else emitAmountEstimated
11571163 let emitInv = emit(emitAmount)
11581164 if ((emitInv == emitInv))
11591165 then {
11601166 let lpTransfer = if (autoStake)
11611167 then {
11621168 let stakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(cfgLpAssetId, emitAmount)])
11631169 if ((stakeInv == stakeInv))
11641170 then nil
11651171 else throw("Strict value is not equal to itself.")
11661172 }
11671173 else [ScriptTransfer(i.caller, emitAmount, cfgLpAssetId)]
11681174 let sendFee = if ((feeAmount > 0))
11691175 then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
11701176 else nil
1171- let $t04732247519 = if ((this == feeCollectorAddress))
1177+ let $t04754147738 = if ((this == feeCollectorAddress))
11721178 then $Tuple2(0, 0)
11731179 else if (paymentInAmountAsset)
11741180 then $Tuple2(-(feeAmount), 0)
11751181 else $Tuple2(0, -(feeAmount))
1176- let amountAssetBalanceDelta = $t04732247519._1
1177- let priceAssetBalanceDelta = $t04732247519._2
1178- let $t04752247630 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1179- let refreshKLpActions = $t04752247630._1
1180- let updatedKLp = $t04752247630._2
1182+ let amountAssetBalanceDelta = $t04754147738._1
1183+ let priceAssetBalanceDelta = $t04754147738._2
1184+ let $t04774147849 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1185+ let refreshKLpActions = $t04774147849._1
1186+ let updatedKLp = $t04774147849._2
11811187 let kLp = value(getString(keyKLp))
11821188 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11831189 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11841190 then {
11851191 let reb = invoke(this, "rebalance", nil, nil)
11861192 if ((reb == reb))
11871193 then $Tuple2((((commonState ++ lpTransfer) ++ sendFee) ++ refreshKLpActions), emitAmount)
11881194 else throw("Strict value is not equal to itself.")
11891195 }
11901196 else throw("Strict value is not equal to itself.")
11911197 }
11921198 else throw("Strict value is not equal to itself.")
11931199 }
11941200 else throw("Strict value is not equal to itself.")
11951201 }
11961202 else throw("Strict value is not equal to itself.")
11971203 }
11981204 else throw("Strict value is not equal to itself.")
11991205 }
12001206
12011207
12021208
12031209 @Callable(i)
12041210 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
1205- let $t04798548142 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
1206- let emitAmountEstimated = $t04798548142._1
1207- let commonState = $t04798548142._2
1208- let feeAmount = $t04798548142._3
1209- let bonus = $t04798548142._4
1210- let paymentInAmountAsset = $t04798548142._5
1211+ let $t04820448361 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
1212+ let emitAmountEstimated = $t04820448361._1
1213+ let commonState = $t04820448361._2
1214+ let feeAmount = $t04820448361._3
1215+ let bonus = $t04820448361._4
1216+ let paymentInAmountAsset = $t04820448361._5
12111217 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
12121218 }
12131219
12141220
12151221
12161222 @Callable(i)
12171223 func getOneTkn (outAssetIdStr,minOutAmount) = {
12181224 let isPoolOneTokenOperationsDisabled = {
12191225 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
12201226 if ($isInstanceOf(@, "Boolean"))
12211227 then @
12221228 else throw(($getType(@) + " couldn't be cast to Boolean"))
12231229 }
12241230 let isGetDisabled = if (if (isGlobalShutdown())
12251231 then true
12261232 else (cfgPoolStatus == PoolShutdown))
12271233 then true
12281234 else isPoolOneTokenOperationsDisabled
12291235 let checks = [if (if (!(isGetDisabled))
12301236 then true
12311237 else isManager(i))
12321238 then true
12331239 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1))
12341240 then true
12351241 else throwErr("exactly 1 payment are expected")]
12361242 if ((checks == checks))
12371243 then {
12381244 let outAssetId = parseAssetId(outAssetIdStr)
12391245 let payment = i.payments[0]
12401246 let paymentAssetId = payment.assetId
12411247 let paymentAmount = payment.amount
12421248 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
12431249 if ((currentKLp == currentKLp))
12441250 then {
12451251 let userAddress = i.caller
12461252 let txId = i.transactionId
1247- let $t04902749180 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
1248- if (($t04902749180 == $t04902749180))
1253+ let $t04924649399 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
1254+ if (($t04924649399 == $t04924649399))
12491255 then {
1250- let outInAmountAsset = $t04902749180._5
1251- let bonus = $t04902749180._4
1252- let feeAmount = $t04902749180._3
1253- let commonState = $t04902749180._2
1254- let amountEstimated = $t04902749180._1
1256+ let outInAmountAsset = $t04924649399._5
1257+ let bonus = $t04924649399._4
1258+ let feeAmount = $t04924649399._3
1259+ let commonState = $t04924649399._2
1260+ let amountEstimated = $t04924649399._1
12551261 let amount = if (if ((minOutAmount > 0))
12561262 then (minOutAmount > amountEstimated)
12571263 else false)
12581264 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
12591265 else amountEstimated
12601266 let burnInv = invoke(factoryContract, "burn", [paymentAmount], [AttachedPayment(paymentAssetId, paymentAmount)])
12611267 if ((burnInv == burnInv))
12621268 then {
12631269 let withdrawState = withdrawAndRebalanceAsset(outAssetIdStr, (amount + max([0, feeAmount])))
12641270 let assetTransfer = [ScriptTransfer(userAddress, amount, outAssetId)]
12651271 let sendFee = if ((feeAmount > 0))
12661272 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
12671273 else nil
1268- let $t04984450091 = {
1274+ let $t05006350310 = {
12691275 let feeAmountForCalc = if ((this == feeCollectorAddress))
12701276 then 0
12711277 else feeAmount
12721278 if (outInAmountAsset)
12731279 then $Tuple2(-((amount + feeAmountForCalc)), 0)
12741280 else $Tuple2(0, -((amount + feeAmountForCalc)))
12751281 }
1276- let amountAssetBalanceDelta = $t04984450091._1
1277- let priceAssetBalanceDelta = $t04984450091._2
1278- let $t05009450202 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1279- let refreshKLpActions = $t05009450202._1
1280- let updatedKLp = $t05009450202._2
1282+ let amountAssetBalanceDelta = $t05006350310._1
1283+ let priceAssetBalanceDelta = $t05006350310._2
1284+ let $t05031350421 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1285+ let refreshKLpActions = $t05031350421._1
1286+ let updatedKLp = $t05031350421._2
12811287 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
12821288 if ((isUpdatedKLpValid == isUpdatedKLpValid))
12831289 then $Tuple2(((((commonState ++ withdrawState) ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
12841290 else throw("Strict value is not equal to itself.")
12851291 }
12861292 else throw("Strict value is not equal to itself.")
12871293 }
12881294 else throw("Strict value is not equal to itself.")
12891295 }
12901296 else throw("Strict value is not equal to itself.")
12911297 }
12921298 else throw("Strict value is not equal to itself.")
12931299 }
12941300
12951301
12961302
12971303 @Callable(i)
12981304 func getOneTknREADONLY (outAssetId,paymentAmount) = {
1299- let $t05048050636 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
1300- let amountEstimated = $t05048050636._1
1301- let commonState = $t05048050636._2
1302- let feeAmount = $t05048050636._3
1303- let bonus = $t05048050636._4
1304- let outInAmountAsset = $t05048050636._5
1305+ let $t05069950855 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
1306+ let amountEstimated = $t05069950855._1
1307+ let commonState = $t05069950855._2
1308+ let feeAmount = $t05069950855._3
1309+ let bonus = $t05069950855._4
1310+ let outInAmountAsset = $t05069950855._5
13051311 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
13061312 }
13071313
13081314
13091315
13101316 @Callable(i)
13111317 func unstakeAndGetOneTkn (unstakeAmount,outAssetIdStr,minOutAmount) = {
13121318 let isPoolOneTokenOperationsDisabled = {
13131319 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
13141320 if ($isInstanceOf(@, "Boolean"))
13151321 then @
13161322 else throw(($getType(@) + " couldn't be cast to Boolean"))
13171323 }
13181324 let isGetDisabled = if (if (isGlobalShutdown())
13191325 then true
13201326 else (cfgPoolStatus == PoolShutdown))
13211327 then true
13221328 else isPoolOneTokenOperationsDisabled
13231329 let checks = [if (if (!(isGetDisabled))
13241330 then true
13251331 else isManager(i))
13261332 then true
13271333 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 0))
13281334 then true
13291335 else throwErr("no payments are expected")]
13301336 if ((checks == checks))
13311337 then {
13321338 let outAssetId = parseAssetId(outAssetIdStr)
13331339 let userAddress = i.caller
13341340 let txId = i.transactionId
13351341 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
13361342 if ((currentKLp == currentKLp))
13371343 then {
13381344 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
13391345 if ((unstakeInv == unstakeInv))
13401346 then {
1341- let $t05154151692 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1342- if (($t05154151692 == $t05154151692))
1347+ let $t05176051911 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1348+ if (($t05176051911 == $t05176051911))
13431349 then {
1344- let outInAmountAsset = $t05154151692._5
1345- let bonus = $t05154151692._4
1346- let feeAmount = $t05154151692._3
1347- let commonState = $t05154151692._2
1348- let amountEstimated = $t05154151692._1
1350+ let outInAmountAsset = $t05176051911._5
1351+ let bonus = $t05176051911._4
1352+ let feeAmount = $t05176051911._3
1353+ let commonState = $t05176051911._2
1354+ let amountEstimated = $t05176051911._1
13491355 let amount = if (if ((minOutAmount > 0))
13501356 then (minOutAmount > amountEstimated)
13511357 else false)
13521358 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
13531359 else amountEstimated
13541360 let burnInv = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
13551361 if ((burnInv == burnInv))
13561362 then {
13571363 let withdrawState = withdrawAndRebalanceAsset(outAssetIdStr, (amount + max([0, feeAmount])))
13581364 let assetTransfer = [ScriptTransfer(i.caller, amount, outAssetId)]
13591365 let sendFee = if ((feeAmount > 0))
13601366 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
13611367 else nil
1362- let $t05235152598 = {
1368+ let $t05257052817 = {
13631369 let feeAmountForCalc = if ((this == feeCollectorAddress))
13641370 then 0
13651371 else feeAmount
13661372 if (outInAmountAsset)
13671373 then $Tuple2(-((amount + feeAmountForCalc)), 0)
13681374 else $Tuple2(0, -((amount + feeAmountForCalc)))
13691375 }
1370- let amountAssetBalanceDelta = $t05235152598._1
1371- let priceAssetBalanceDelta = $t05235152598._2
1372- let $t05260152709 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1373- let refreshKLpActions = $t05260152709._1
1374- let updatedKLp = $t05260152709._2
1376+ let amountAssetBalanceDelta = $t05257052817._1
1377+ let priceAssetBalanceDelta = $t05257052817._2
1378+ let $t05282052928 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1379+ let refreshKLpActions = $t05282052928._1
1380+ let updatedKLp = $t05282052928._2
13751381 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
13761382 if ((isUpdatedKLpValid == isUpdatedKLpValid))
13771383 then $Tuple2(((((commonState ++ withdrawState) ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
13781384 else throw("Strict value is not equal to itself.")
13791385 }
13801386 else throw("Strict value is not equal to itself.")
13811387 }
13821388 else throw("Strict value is not equal to itself.")
13831389 }
13841390 else throw("Strict value is not equal to itself.")
13851391 }
13861392 else throw("Strict value is not equal to itself.")
13871393 }
13881394 else throw("Strict value is not equal to itself.")
13891395 }
13901396
13911397
13921398
13931399 @Callable(i)
13941400 func get () = {
13951401 let res = commonGet(i)
13961402 let outAmAmt = res._1
13971403 let outPrAmt = res._2
13981404 let pmtAmt = res._3
13991405 let pmtAssetId = res._4
14001406 let state = res._5
14011407 let withdrawState = withdrawAndRebalanceAll(outAmAmt, outPrAmt)
14021408 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
14031409 if ((currentKLp == currentKLp))
14041410 then {
14051411 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
14061412 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
14071413 then {
1408- let $t05380453885 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1409- let refreshKLpActions = $t05380453885._1
1410- let updatedKLp = $t05380453885._2
1414+ let $t05402354104 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1415+ let refreshKLpActions = $t05402354104._1
1416+ let updatedKLp = $t05402354104._2
14111417 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
14121418 if ((isUpdatedKLpValid == isUpdatedKLpValid))
14131419 then ((withdrawState ++ state) ++ refreshKLpActions)
14141420 else throw("Strict value is not equal to itself.")
14151421 }
14161422 else throw("Strict value is not equal to itself.")
14171423 }
14181424 else throw("Strict value is not equal to itself.")
14191425 }
14201426
14211427
14221428
14231429 @Callable(i)
14241430 func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = {
14251431 let res = commonGet(i)
14261432 let outAmAmt = res._1
14271433 let outPrAmt = res._2
14281434 let pmtAmt = res._3
14291435 let pmtAssetId = res._4
14301436 let state = res._5
14311437 if ((noLessThenAmtAsset > outAmAmt))
14321438 then throw(((("noLessThenAmtAsset failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset)))
14331439 else if ((noLessThenPriceAsset > outPrAmt))
14341440 then throw(((("noLessThenPriceAsset failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset)))
14351441 else {
14361442 let withdrawState = withdrawAndRebalanceAll(outAmAmt, outPrAmt)
14371443 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
14381444 if ((currentKLp == currentKLp))
14391445 then {
14401446 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
14411447 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
14421448 then {
1443- let $t05498055061 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1444- let refreshKLpActions = $t05498055061._1
1445- let updatedKLp = $t05498055061._2
1449+ let $t05519955280 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1450+ let refreshKLpActions = $t05519955280._1
1451+ let updatedKLp = $t05519955280._2
14461452 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
14471453 if ((isUpdatedKLpValid == isUpdatedKLpValid))
14481454 then ((withdrawState ++ state) ++ refreshKLpActions)
14491455 else throw("Strict value is not equal to itself.")
14501456 }
14511457 else throw("Strict value is not equal to itself.")
14521458 }
14531459 else throw("Strict value is not equal to itself.")
14541460 }
14551461 }
14561462
14571463
14581464
14591465 @Callable(i)
14601466 func unstakeAndGet (amount) = {
14611467 let checkPayments = if ((size(i.payments) != 0))
14621468 then throw("No payments are expected")
14631469 else true
14641470 if ((checkPayments == checkPayments))
14651471 then {
14661472 let cfg = getPoolConfig()
14671473 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
14681474 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
14691475 if ((currentKLp == currentKLp))
14701476 then {
14711477 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(lpAssetId), amount], nil)
14721478 if ((unstakeInv == unstakeInv))
14731479 then {
14741480 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller)
14751481 let outAmAmt = res._1
14761482 let outPrAmt = res._2
14771483 let poolStatus = parseIntValue(res._9)
14781484 let state = res._10
14791485 let withdrawState = withdrawAndRebalanceAll(outAmAmt, outPrAmt)
14801486 let checkPoolStatus = if (if (isGlobalShutdown())
14811487 then true
14821488 else (poolStatus == PoolShutdown))
14831489 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
14841490 else true
14851491 if ((checkPoolStatus == checkPoolStatus))
14861492 then {
14871493 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
14881494 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
14891495 then {
1490- let $t05633356414 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1491- let refreshKLpActions = $t05633356414._1
1492- let updatedKLp = $t05633356414._2
1496+ let $t05655256633 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1497+ let refreshKLpActions = $t05655256633._1
1498+ let updatedKLp = $t05655256633._2
14931499 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
14941500 if ((isUpdatedKLpValid == isUpdatedKLpValid))
14951501 then ((withdrawState ++ state) ++ refreshKLpActions)
14961502 else throw("Strict value is not equal to itself.")
14971503 }
14981504 else throw("Strict value is not equal to itself.")
14991505 }
15001506 else throw("Strict value is not equal to itself.")
15011507 }
15021508 else throw("Strict value is not equal to itself.")
15031509 }
15041510 else throw("Strict value is not equal to itself.")
15051511 }
15061512 else throw("Strict value is not equal to itself.")
15071513 }
15081514
15091515
15101516
15111517 @Callable(i)
15121518 func unstakeAndGetNoLess (unstakeAmount,noLessThenAmountAsset,noLessThenPriceAsset) = {
15131519 let isGetDisabled = if (isGlobalShutdown())
15141520 then true
15151521 else (cfgPoolStatus == PoolShutdown)
15161522 let checks = [if (!(isGetDisabled))
15171523 then true
15181524 else throw("get operation is blocked by admin"), if ((size(i.payments) == 0))
15191525 then true
15201526 else throw("no payments are expected")]
15211527 if ((checks == checks))
15221528 then {
15231529 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
15241530 if ((currentKLp == currentKLp))
15251531 then {
15261532 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
15271533 if ((unstakeInv == unstakeInv))
15281534 then {
15291535 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller)
15301536 let outAmAmt = res._1
15311537 let outPrAmt = res._2
15321538 let state = res._10
15331539 let withdrawState = withdrawAndRebalanceAll(outAmAmt, outPrAmt)
15341540 let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset))
15351541 then true
15361542 else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset))
15371543 then true
15381544 else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))]
15391545 if ((checkAmounts == checkAmounts))
15401546 then {
15411547 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
15421548 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
15431549 then {
1544- let $t05785557936 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1545- let refreshKLpActions = $t05785557936._1
1546- let updatedKLp = $t05785557936._2
1550+ let $t05807458155 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1551+ let refreshKLpActions = $t05807458155._1
1552+ let updatedKLp = $t05807458155._2
15471553 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
15481554 if ((isUpdatedKLpValid == isUpdatedKLpValid))
15491555 then ((withdrawState ++ state) ++ refreshKLpActions)
15501556 else throw("Strict value is not equal to itself.")
15511557 }
15521558 else throw("Strict value is not equal to itself.")
15531559 }
15541560 else throw("Strict value is not equal to itself.")
15551561 }
15561562 else throw("Strict value is not equal to itself.")
15571563 }
15581564 else throw("Strict value is not equal to itself.")
15591565 }
15601566 else throw("Strict value is not equal to itself.")
15611567 }
15621568
15631569
15641570
15651571 @Callable(i)
15661572 func activate (amtAssetStr,priceAssetStr) = if ((toString(i.caller) != toString(factoryContract)))
15671573 then throw("permissions denied")
15681574 else $Tuple2([StringEntry(aa(), amtAssetStr), StringEntry(pa(), priceAssetStr)], "success")
15691575
15701576
15711577
15721578 @Callable(i)
15731579 func refreshKLp () = {
15741580 let lastRefreshedBlockHeight = valueOrElse(getInteger(keyKLpRefreshedHeight), 0)
15751581 let checkLastRefreshedBlockHeight = if (((height - lastRefreshedBlockHeight) >= kLpRefreshDelay))
15761582 then unit
15771583 else throwErr(makeString([toString(kLpRefreshDelay), " blocks have not passed since the previous call"], ""))
15781584 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
15791585 then {
15801586 let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
1581- let $t05914059204 = refreshKLpInternal(0, 0, 0)
1582- let kLpUpdateActions = $t05914059204._1
1583- let updatedKLp = $t05914059204._2
1587+ let $t05935959423 = refreshKLpInternal(0, 0, 0)
1588+ let kLpUpdateActions = $t05935959423._1
1589+ let updatedKLp = $t05935959423._2
15841590 let actions = if ((kLp != updatedKLp))
15851591 then kLpUpdateActions
15861592 else throwErr("nothing to refresh")
15871593 $Tuple2(actions, toString(updatedKLp))
15881594 }
15891595 else throw("Strict value is not equal to itself.")
15901596 }
15911597
15921598
15931599
15941600 @Callable(i)
15951601 func getPoolConfigWrapperREADONLY () = $Tuple2(nil, getPoolConfig())
15961602
15971603
15981604
15991605 @Callable(i)
16001606 func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId))
16011607
16021608
16031609
16041610 @Callable(i)
16051611 func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = {
16061612 let prices = calcPrices(amAmt, prAmt, lpAmt)
16071613 $Tuple2(nil, [toString(prices[0]), toString(prices[1]), toString(prices[2])])
16081614 }
16091615
16101616
16111617
16121618 @Callable(i)
16131619 func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(toX18(origVal, origScaleMult)))
16141620
16151621
16161622
16171623 @Callable(i)
16181624 func fromX18WrapperREADONLY (val,resultScaleMult) = $Tuple2(nil, fromX18(parseBigIntValue(val), resultScaleMult))
16191625
16201626
16211627
16221628 @Callable(i)
16231629 func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(calcPriceBigInt(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18))))
16241630
16251631
16261632
16271633 @Callable(i)
16281634 func estimatePutOperationWrapperREADONLY (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = $Tuple2(nil, estimatePutOperation(txId58, slippageTolerance, inAmAssetAmt, inAmAssetId, inPrAssetAmt, inPrAssetId, userAddress, isEvaluate, emitLp))
16291635
16301636
16311637
16321638 @Callable(i)
16331639 func estimateGetOperationWrapperREADONLY (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
16341640 let res = estimateGetOperation(txId58, pmtAssetId, pmtLpAmt, addressFromStringValue(userAddress))
16351641 $Tuple2(nil, $Tuple10(res._1, res._2, res._3, res._4, res._5, res._6, res._7, toString(res._8), res._9, res._10))
16361642 }
16371643
16381644
16391645
16401646 @Callable(i)
16411647 func statsREADONLY () = {
16421648 let cfg = getPoolConfig()
16431649 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
16441650 let amtAssetId = cfg[idxAmtAssetId]
16451651 let priceAssetId = cfg[idxPriceAssetId]
16461652 let iAmtAssetId = cfg[idxIAmtAssetId]
16471653 let iPriceAssetId = cfg[idxIPriceAssetId]
16481654 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
16491655 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
16501656 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
16511657 let accAmtAssetBalance = getAccBalance(amtAssetId)
16521658 let accPriceAssetBalance = getAccBalance(priceAssetId)
16531659 let pricesList = if ((poolLPBalance == 0))
16541660 then [zeroBigInt, zeroBigInt, zeroBigInt]
16551661 else calcPrices(accAmtAssetBalance, accPriceAssetBalance, poolLPBalance)
16561662 let curPrice = 0
16571663 let lpAmtAssetShare = fromX18(pricesList[1], scale8)
16581664 let lpPriceAssetShare = fromX18(pricesList[2], scale8)
16591665 let poolWeight = value(getInteger(factoryContract, keyPoolWeight(toString(this))))
16601666 $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))
16611667 }
16621668
16631669
16641670
16651671 @Callable(i)
16661672 func evaluatePutByAmountAssetREADONLY (inAmAssetAmt) = {
16671673 let cfg = getPoolConfig()
16681674 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
16691675 let amAssetIdStr = cfg[idxAmtAssetId]
16701676 let amAssetId = fromBase58String(amAssetIdStr)
16711677 let prAssetIdStr = cfg[idxPriceAssetId]
16721678 let prAssetId = fromBase58String(prAssetIdStr)
16731679 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
16741680 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
16751681 let poolStatus = cfg[idxPoolStatus]
16761682 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
16771683 let accAmtAssetBalance = getAccBalance(amAssetIdStr)
16781684 let accPriceAssetBalance = getAccBalance(prAssetIdStr)
16791685 let amtAssetAmtX18 = toX18(accAmtAssetBalance, amtAssetDcm)
16801686 let priceAssetAmtX18 = toX18(accPriceAssetBalance, priceAssetDcm)
16811687 let curPriceX18 = if ((poolLPBalance == 0))
16821688 then zeroBigInt
16831689 else calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
16841690 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
16851691 let inPrAssetAmtX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18)
16861692 let inPrAssetAmt = fromX18(inPrAssetAmtX18, priceAssetDcm)
16871693 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
16881694 let calcLpAmt = estPut._1
16891695 let curPriceCalc = estPut._3
16901696 let amBalance = estPut._4
16911697 let prBalance = estPut._5
16921698 let lpEmission = estPut._6
16931699 $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))
16941700 }
16951701
16961702
16971703
16981704 @Callable(i)
16991705 func evaluatePutByPriceAssetREADONLY (inPrAssetAmt) = {
17001706 let cfg = getPoolConfig()
17011707 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
17021708 let amAssetIdStr = cfg[idxAmtAssetId]
17031709 let amAssetId = fromBase58String(amAssetIdStr)
17041710 let prAssetIdStr = cfg[idxPriceAssetId]
17051711 let prAssetId = fromBase58String(prAssetIdStr)
17061712 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
17071713 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
17081714 let poolStatus = cfg[idxPoolStatus]
17091715 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
17101716 let amBalanceRaw = getAccBalance(amAssetIdStr)
17111717 let prBalanceRaw = getAccBalance(prAssetIdStr)
17121718 let amBalanceRawX18 = toX18(amBalanceRaw, amtAssetDcm)
17131719 let prBalanceRawX18 = toX18(prBalanceRaw, priceAssetDcm)
17141720 let curPriceX18 = if ((poolLPBalance == 0))
17151721 then zeroBigInt
17161722 else calcPriceBigInt(prBalanceRawX18, amBalanceRawX18)
17171723 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
17181724 let inAmAssetAmtX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
17191725 let inAmAssetAmt = fromX18(inAmAssetAmtX18, amtAssetDcm)
17201726 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
17211727 let calcLpAmt = estPut._1
17221728 let curPriceCalc = estPut._3
17231729 let amBalance = estPut._4
17241730 let prBalance = estPut._5
17251731 let lpEmission = estPut._6
17261732 $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))
17271733 }
17281734
17291735
17301736
17311737 @Callable(i)
17321738 func evaluateGetREADONLY (paymentLpAssetId,paymentLpAmt) = {
17331739 let res = estimateGetOperation("", paymentLpAssetId, paymentLpAmt, this)
17341740 let outAmAmt = res._1
17351741 let outPrAmt = res._2
17361742 let amBalance = res._5
17371743 let prBalance = res._6
17381744 let lpEmission = res._7
17391745 let curPrice = res._8
17401746 let poolStatus = parseIntValue(res._9)
17411747 $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))
17421748 }
17431749
17441750
17451751 @Verifier(tx)
17461752 func verify () = {
17471753 let targetPublicKey = match managerPublicKeyOrUnit() {
17481754 case pk: ByteVector =>
17491755 pk
17501756 case _: Unit =>
17511757 tx.senderPublicKey
17521758 case _ =>
17531759 throw("Match error")
17541760 }
17551761 match tx {
17561762 case order: Order =>
17571763 let matcherPub = getMatcherPubOrFail()
1758- let $t06786667935 = validateMatcherOrderAllowed(order)
1759- let orderValid = $t06786667935._1
1760- let orderValidInfo = $t06786667935._2
1764+ let $t06808568202 = if (skipOrderValidation())
1765+ then $Tuple2(true, "")
1766+ else validateMatcherOrderAllowed(order)
1767+ let orderValid = $t06808568202._1
1768+ let orderValidInfo = $t06808568202._2
17611769 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
17621770 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
17631771 if (if (if (orderValid)
17641772 then senderValid
17651773 else false)
17661774 then matcherValid
17671775 else false)
17681776 then true
17691777 else throwOrderError(orderValid, orderValidInfo, senderValid, matcherValid)
17701778 case s: SetScriptTransaction =>
17711779 if (sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey))
17721780 then true
17731781 else {
17741782 let newHash = blake2b256(value(s.script))
17751783 let allowedHash = fromBase64String(value(getString(factoryContract, keyAllowedLpScriptHash())))
17761784 let currentHash = scriptHash(this)
17771785 if ((allowedHash == newHash))
17781786 then (currentHash != newHash)
17791787 else false
17801788 }
17811789 case _ =>
17821790 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
17831791 }
17841792 }
17851793

github/deemru/w8io/169f3d6 
247.97 ms