tx · HACr3PyueoBws4VGaZm7gPkT1Z5Y4DAvQHsCXkYF2ydT

3NCUrmBwKvfQDkfTg1gL8BPKZid8fC4YDx3:  -0.03600000 Waves

2023.01.19 17:11 [2411912] smart account 3NCUrmBwKvfQDkfTg1gL8BPKZid8fC4YDx3 > SELF 0.00000000 Waves

{ "type": 13, "id": "HACr3PyueoBws4VGaZm7gPkT1Z5Y4DAvQHsCXkYF2ydT", "fee": 3600000, "feeAssetId": null, "timestamp": 1674137506678, "version": 1, "sender": "3NCUrmBwKvfQDkfTg1gL8BPKZid8fC4YDx3", "senderPublicKey": "DnbhDz6GvchfLCy83fxyPKD7SoAmXD6DrJ5ubi3LXtgM", "proofs": [ "5L146cTY2hUh2uEUgp7WnajjNLB9GiRSzySLj8yWmcLWq7ErTSi8q63RzHigqsZQvSBWj4NRQ6PoRcfDzCKVouKn" ], "script": "base64:BgLcLQgCEgMKAQgSABIECgIBBBIDCgEBEgQKAgEEEgQKAggBEgQKAggBEgQKAggBEgUKAwEIARIAEgQKAgEBEgMKAQESBQoDAQEBEgQKAggIEgASABIDCgEIEgUKAwEBARIECgIBARIECgIIARIECgIICBILCgkIAQECAQIIBAQSBgoECAgBCBIAEgMKAQESAwoBARIECgIIASIKbFBkZWNpbWFscyIGc2NhbGU4IgxzY2FsZThCaWdJbnQiB3NjYWxlMTgiCnplcm9CaWdJbnQiBGJpZzAiBGJpZzEiBGJpZzIiC3dhdmVzU3RyaW5nIgNTRVAiClBvb2xBY3RpdmUiD1Bvb2xQdXREaXNhYmxlZCITUG9vbE1hdGNoZXJEaXNhYmxlZCIMUG9vbFNodXRkb3duIg5pZHhQb29sQWRkcmVzcyINaWR4UG9vbFN0YXR1cyIQaWR4UG9vbExQQXNzZXRJZCINaWR4QW10QXNzZXRJZCIPaWR4UHJpY2VBc3NldElkIg5pZHhBbXRBc3NldERjbSIQaWR4UHJpY2VBc3NldERjbSIOaWR4SUFtdEFzc2V0SWQiEGlkeElQcmljZUFzc2V0SWQiDWlk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AzAgCCQCkAwEFAmNsCQDMCAIJAKQDAQUCY2kJAMwIAgkApgMBBQJjbwkAzAgCCQCkAwEFAmNoBQNuaWwFAWoBAmdHAQJnSAAEAmdJBAJkVAkBAmVXAAMJAAECBQJkVAIKQnl0ZVZlY3RvcgQCZmEFAmRUBQJmYQMJAAECBQJkVAIEVW5pdAgFAmdHD3NlbmRlclB1YmxpY0tleQkAAgECC01hdGNoIGVycm9yBAJkVAUCZ0cDCQABAgUCZFQCBU9yZGVyBAJkeQUCZFQEAmdKCQECYVMABAJhQwkBAmR4AQUCZHkEAmFECQD0AwMIBQJkeQlib2R5Qnl0ZXMJAJEDAggFAmR5BnByb29mcwAACAUCZHkPc2VuZGVyUHVibGljS2V5BAJhRQkA9AMDCAUCZHkJYm9keUJ5dGVzCQCRAwIIBQJkeQZwcm9vZnMAAQUCZ0oDAwMFAmFDBQJhRAcFAmFFBwYJAQJhQgMFAmFDBQJhRAUCYUUDCQABAgUCZFQCFFNldFNjcmlwdFRyYW5zYWN0aW9uBAJlWAUCZFQEAmdLCQD2AwEJAQV2YWx1ZQEIBQJlWAZzY3JpcHQEAmdMCQDbBAEJAQV2YWx1ZQEJAJ0IAgUCYU0JAQJhegAEAmdNCQDxBwEFBHRoaXMDAwkAAAIFAmdMBQJnSwkBAiE9AgUCZ00FAmdLBwYJAPQDAwgFAmdHCWJvZHlCeXRlcwkAkQMCCAUCZ0cGcHJvb2ZzAAAFAmdJCQD0AwMIBQJnRwlib2R5Qnl0ZXMJAJEDAggFAmdHBnByb29mcwAABQJnSYeWoQs=", "chainId": 84, "height": 2411912, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Aa25n69WQrF59xaBMbGiRwfm94nZf8djvQKuLBMy97Eq Next: none Diff:
OldNewDifferences
6060 let idxFactorySlippageContract = 7
6161
6262 func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), scale18, toBigInt(origScaleMult))
63+
64+
65+func toX18BigInt (origVal,origScaleMult) = fraction(origVal, scale18, origScaleMult)
6366
6467
6568 func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), scale18))
213216
214217 let poolConfigParsed = parsePoolConfig(getPoolConfig())
215218
216-let $t082438409 = poolConfigParsed
219+let $t083448510 = poolConfigParsed
217220
218-let cfgPoolAddress = $t082438409._1
221+let cfgPoolAddress = $t083448510._1
219222
220-let cfgPoolStatus = $t082438409._2
223+let cfgPoolStatus = $t083448510._2
221224
222-let cfgLpAssetId = $t082438409._3
225+let cfgLpAssetId = $t083448510._3
223226
224-let cfgAmountAssetId = $t082438409._4
227+let cfgAmountAssetId = $t083448510._4
225228
226-let cfgPriceAssetId = $t082438409._5
229+let cfgPriceAssetId = $t083448510._5
227230
228-let cfgAmountAssetDecimals = $t082438409._6
231+let cfgAmountAssetDecimals = $t083448510._6
229232
230-let cfgPriceAssetDecimals = $t082438409._7
233+let cfgPriceAssetDecimals = $t083448510._7
231234
232235 func getFactoryConfig () = split(getStringOrFail(factoryContract, keyFactoryConfig()), SEP)
233236
394397
395398
396399 func calcKLp (amountBalance,priceBalance,lpEmission) = {
397- let updatedKLp = fraction(pow((amountBalance * priceBalance), 0, toBigInt(5), 1, 18, DOWN), big1, lpEmission)
400+ let amountBalanceX18 = toX18BigInt(amountBalance, toBigInt(cfgAmountAssetDecimals))
401+ let priceBalanceX18 = toX18BigInt(priceBalance, toBigInt(cfgPriceAssetDecimals))
402+ let updatedKLp = fraction(pow((amountBalanceX18 * priceBalanceX18), 0, toBigInt(5), 1, 18, DOWN), big1, lpEmission)
398403 if ((lpEmission == big0))
399404 then big0
400405 else updatedKLp
428433 func validateMatcherOrderAllowed (order) = {
429434 let amountAssetAmount = order.amount
430435 let priceAssetAmount = fraction(order.amount, order.price, scale8, FLOOR)
431- let $t02098621198 = if ((order.orderType == Buy))
436+ let $t02126221474 = if ((order.orderType == Buy))
432437 then $Tuple2(amountAssetAmount, -(priceAssetAmount))
433438 else $Tuple2(-(amountAssetAmount), priceAssetAmount)
434- let amountAssetBalanceDelta = $t02098621198._1
435- let priceAssetBalanceDelta = $t02098621198._2
439+ let amountAssetBalanceDelta = $t02126221474._1
440+ let priceAssetBalanceDelta = $t02126221474._2
436441 if (if (if (isGlobalShutdown())
437442 then true
438443 else (cfgPoolStatus == PoolMatcherDisabled))
445450 then throw("Wrong order assets.")
446451 else {
447452 let kLp = valueOrErrorMessage(parseBigInt(valueOrErrorMessage(getString(this, keyKLp), fmtErr("kLp is required"))), fmtErr("invalid kLp"))
448- let $t02166921769 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
449- let unusedActions = $t02166921769._1
450- let kLpNew = $t02166921769._2
453+ let $t02194522045 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
454+ let unusedActions = $t02194522045._1
455+ let kLpNew = $t02194522045._2
451456 let isOrderValid = (kLpNew >= kLp)
452457 isOrderValid
453458 }
525530 else if ((paymentAssetId == cfgPriceAssetId))
526531 then false
527532 else throwErr("invalid asset")
528- let $t02449024783 = if (isEval)
533+ let $t02476625059 = if (isEval)
529534 then $Tuple2(amountBalanceRaw, priceBalanceRaw)
530535 else if (paymentInAmountAsset)
531536 then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw)
532537 else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw))
533- let amountBalanceOld = $t02449024783._1
534- let priceBalanceOld = $t02449024783._2
535- let $t02478724936 = if (paymentInAmountAsset)
538+ let amountBalanceOld = $t02476625059._1
539+ let priceBalanceOld = $t02476625059._2
540+ let $t02506325212 = if (paymentInAmountAsset)
536541 then $Tuple2(paymentAmountRaw, 0)
537542 else $Tuple2(0, paymentAmountRaw)
538- let amountAssetAmountRaw = $t02478724936._1
539- let priceAssetAmountRaw = $t02478724936._2
543+ let amountAssetAmountRaw = $t02506325212._1
544+ let priceAssetAmountRaw = $t02506325212._2
540545 let amountAssetAmount = takeFee(amountAssetAmountRaw, inFee)._1
541546 let priceAssetAmount = takeFee(priceAssetAmountRaw, inFee)._1
542- let $t02506825132 = takeFee(paymentAmountRaw, inFee)
543- let paymentAmount = $t02506825132._1
544- let feeAmount = $t02506825132._2
547+ let $t02534425408 = takeFee(paymentAmountRaw, inFee)
548+ let paymentAmount = $t02534425408._1
549+ let feeAmount = $t02534425408._2
545550 let amountBalanceNew = (amountBalanceOld + amountAssetAmount)
546551 let priceBalanceNew = (priceBalanceOld + priceAssetAmount)
547552 let priceNewX18 = calcPriceBigInt(toX18(priceBalanceNew, cfgPriceAssetDecimals), toX18(amountBalanceNew, cfgAmountAssetDecimals))
564569 let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, cfgPriceAssetDecimals), toX18(amountBalanceOld, cfgAmountAssetDecimals))
565570 let priceOld = fromX18(priceOldX18, scale8)
566571 let loss = {
567- let $t02681326980 = if (paymentInAmountAsset)
572+ let $t02708927256 = if (paymentInAmountAsset)
568573 then $Tuple2(amountAssetAmountRaw, amountBalanceOld)
569574 else $Tuple2(priceAssetAmountRaw, priceBalanceOld)
570- let amount = $t02681326980._1
571- let balance = $t02681326980._2
575+ let amount = $t02708927256._1
576+ let balance = $t02708927256._2
572577 let issueAmountBoth = toInt(fraction(supplyBigInt, toBigInt((amount / 2)), toBigInt(balance)))
573578 fraction((issueAmount - issueAmountBoth), scale8, issueAmountBoth)
574579 }
608613 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
609614 let redeemedBigInt = toBigInt(paymentAmount)
610615 let amountRaw = max([0, toInt(((balanceBigInt * (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN))) / scale18))])
611- let $t02905829114 = takeFee(amountRaw, outFee)
612- let totalAmount = $t02905829114._1
613- let feeAmount = $t02905829114._2
614- let $t02911829344 = if (outInAmountAsset)
616+ let $t02933429390 = takeFee(amountRaw, outFee)
617+ let totalAmount = $t02933429390._1
618+ let feeAmount = $t02933429390._2
619+ let $t02939429620 = if (outInAmountAsset)
615620 then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld)
616621 else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw))
617- let outAmAmount = $t02911829344._1
618- let outPrAmount = $t02911829344._2
619- let amBalanceNew = $t02911829344._3
620- let prBalanceNew = $t02911829344._4
622+ let outAmAmount = $t02939429620._1
623+ let outPrAmount = $t02939429620._2
624+ let amBalanceNew = $t02939429620._3
625+ let prBalanceNew = $t02939429620._4
621626 let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, cfgPriceAssetDecimals), toX18(amBalanceNew, cfgAmountAssetDecimals))
622627 let priceNew = fromX18(priceNewX18, scale8)
623628 let commonState = if (isEval)
763768 else throw("Strict value is not equal to itself.")
764769 }
765770 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
766- let $t03387234334 = refreshKLpInternal(0, 0, 0)
767- if (($t03387234334 == $t03387234334))
771+ let $t03414834610 = refreshKLpInternal(0, 0, 0)
772+ if (($t03414834610 == $t03414834610))
768773 then {
769- let updatedKLp = $t03387234334._2
770- let refreshKLpActions = $t03387234334._1
774+ let updatedKLp = $t03414834610._2
775+ let refreshKLpActions = $t03414834610._1
771776 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
772777 if ((isUpdatedKLpValid == isUpdatedKLpValid))
773778 then ((state ++ lpTransfer) ++ refreshKLpActions)
799804 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
800805 if ((currentKLp == currentKLp))
801806 then {
802- let $t03489634961 = refreshKLpInternal(0, 0, 0)
803- let refreshKLpActions = $t03489634961._1
804- let updatedKLp = $t03489634961._2
807+ let $t03517235237 = refreshKLpInternal(0, 0, 0)
808+ let refreshKLpActions = $t03517235237._1
809+ let updatedKLp = $t03517235237._2
805810 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
806811 if ((isUpdatedKLpValid == isUpdatedKLpValid))
807812 then (state ++ refreshKLpActions)
848853 then {
849854 let userAddress = i.caller
850855 let txId = i.transactionId
851- let $t03614936301 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
852- if (($t03614936301 == $t03614936301))
856+ let $t03642536577 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
857+ if (($t03642536577 == $t03642536577))
853858 then {
854- let paymentInAmountAsset = $t03614936301._5
855- let bonus = $t03614936301._4
856- let feeAmount = $t03614936301._3
857- let commonState = $t03614936301._2
858- let emitAmountEstimated = $t03614936301._1
859+ let paymentInAmountAsset = $t03642536577._5
860+ let bonus = $t03642536577._4
861+ let feeAmount = $t03642536577._3
862+ let commonState = $t03642536577._2
863+ let emitAmountEstimated = $t03642536577._1
859864 let emitAmount = if (if ((minOutAmount > 0))
860865 then (minOutAmount > emitAmountEstimated)
861866 else false)
875880 let sendFee = if ((feeAmount > 0))
876881 then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
877882 else nil
878- let $t03688737084 = if ((this == feeCollectorAddress))
883+ let $t03716337360 = if ((this == feeCollectorAddress))
879884 then $Tuple2(0, 0)
880885 else if (paymentInAmountAsset)
881886 then $Tuple2(-(feeAmount), 0)
882887 else $Tuple2(0, -(feeAmount))
883- let amountAssetBalanceDelta = $t03688737084._1
884- let priceAssetBalanceDelta = $t03688737084._2
885- let $t03708737195 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
886- let refreshKLpActions = $t03708737195._1
887- let updatedKLp = $t03708737195._2
888+ let amountAssetBalanceDelta = $t03716337360._1
889+ let priceAssetBalanceDelta = $t03716337360._2
890+ let $t03736337471 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
891+ let refreshKLpActions = $t03736337471._1
892+ let updatedKLp = $t03736337471._2
888893 let kLp = value(getString(keyKLp))
889894 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
890895 if ((isUpdatedKLpValid == isUpdatedKLpValid))
904909
905910 @Callable(i)
906911 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
907- let $t03750137658 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
908- let emitAmountEstimated = $t03750137658._1
909- let commonState = $t03750137658._2
910- let feeAmount = $t03750137658._3
911- let bonus = $t03750137658._4
912- let paymentInAmountAsset = $t03750137658._5
912+ let $t03777737934 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
913+ let emitAmountEstimated = $t03777737934._1
914+ let commonState = $t03777737934._2
915+ let feeAmount = $t03777737934._3
916+ let bonus = $t03777737934._4
917+ let paymentInAmountAsset = $t03777737934._5
913918 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
914919 }
915920
946951 then {
947952 let userAddress = i.caller
948953 let txId = i.transactionId
949- let $t03854338696 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
950- if (($t03854338696 == $t03854338696))
954+ let $t03881938972 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
955+ if (($t03881938972 == $t03881938972))
951956 then {
952- let outInAmountAsset = $t03854338696._5
953- let bonus = $t03854338696._4
954- let feeAmount = $t03854338696._3
955- let commonState = $t03854338696._2
956- let amountEstimated = $t03854338696._1
957+ let outInAmountAsset = $t03881938972._5
958+ let bonus = $t03881938972._4
959+ let feeAmount = $t03881938972._3
960+ let commonState = $t03881938972._2
961+ let amountEstimated = $t03881938972._1
957962 let amount = if (if ((minOutAmount > 0))
958963 then (minOutAmount > amountEstimated)
959964 else false)
966971 let sendFee = if ((feeAmount > 0))
967972 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
968973 else nil
969- let $t03919639443 = {
974+ let $t03947239719 = {
970975 let feeAmountForCalc = if ((this == feeCollectorAddress))
971976 then 0
972977 else feeAmount
974979 then $Tuple2(-((amount + feeAmountForCalc)), 0)
975980 else $Tuple2(0, -((amount + feeAmountForCalc)))
976981 }
977- let amountAssetBalanceDelta = $t03919639443._1
978- let priceAssetBalanceDelta = $t03919639443._2
979- let $t03944639554 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
980- let refreshKLpActions = $t03944639554._1
981- let updatedKLp = $t03944639554._2
982+ let amountAssetBalanceDelta = $t03947239719._1
983+ let priceAssetBalanceDelta = $t03947239719._2
984+ let $t03972239830 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
985+ let refreshKLpActions = $t03972239830._1
986+ let updatedKLp = $t03972239830._2
982987 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
983988 if ((isUpdatedKLpValid == isUpdatedKLpValid))
984989 then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
9971002
9981003 @Callable(i)
9991004 func getOneTknREADONLY (outAssetId,paymentAmount) = {
1000- let $t03981139967 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
1001- let amountEstimated = $t03981139967._1
1002- let commonState = $t03981139967._2
1003- let feeAmount = $t03981139967._3
1004- let bonus = $t03981139967._4
1005- let outInAmountAsset = $t03981139967._5
1005+ let $t04008740243 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
1006+ let amountEstimated = $t04008740243._1
1007+ let commonState = $t04008740243._2
1008+ let feeAmount = $t04008740243._3
1009+ let bonus = $t04008740243._4
1010+ let outInAmountAsset = $t04008740243._5
10061011 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
10071012 }
10081013
10391044 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
10401045 if ((unstakeInv == unstakeInv))
10411046 then {
1042- let $t04087241023 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1043- if (($t04087241023 == $t04087241023))
1047+ let $t04114841299 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1048+ if (($t04114841299 == $t04114841299))
10441049 then {
1045- let outInAmountAsset = $t04087241023._5
1046- let bonus = $t04087241023._4
1047- let feeAmount = $t04087241023._3
1048- let commonState = $t04087241023._2
1049- let amountEstimated = $t04087241023._1
1050+ let outInAmountAsset = $t04114841299._5
1051+ let bonus = $t04114841299._4
1052+ let feeAmount = $t04114841299._3
1053+ let commonState = $t04114841299._2
1054+ let amountEstimated = $t04114841299._1
10501055 let amount = if (if ((minOutAmount > 0))
10511056 then (minOutAmount > amountEstimated)
10521057 else false)
10591064 let sendFee = if ((feeAmount > 0))
10601065 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
10611066 else nil
1062- let $t04151841765 = {
1067+ let $t04179442041 = {
10631068 let feeAmountForCalc = if ((this == feeCollectorAddress))
10641069 then 0
10651070 else feeAmount
10671072 then $Tuple2(-((amount + feeAmountForCalc)), 0)
10681073 else $Tuple2(0, -((amount + feeAmountForCalc)))
10691074 }
1070- let amountAssetBalanceDelta = $t04151841765._1
1071- let priceAssetBalanceDelta = $t04151841765._2
1072- let $t04176841876 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1073- let refreshKLpActions = $t04176841876._1
1074- let updatedKLp = $t04176841876._2
1075+ let amountAssetBalanceDelta = $t04179442041._1
1076+ let priceAssetBalanceDelta = $t04179442041._2
1077+ let $t04204442152 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1078+ let refreshKLpActions = $t04204442152._1
1079+ let updatedKLp = $t04204442152._2
10751080 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10761081 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10771082 then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
11041109 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
11051110 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
11061111 then {
1107- let $t04282242904 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1108- let refreshKLpActions = $t04282242904._1
1109- let updatedKLp = $t04282242904._2
1112+ let $t04309843180 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1113+ let refreshKLpActions = $t04309843180._1
1114+ let updatedKLp = $t04309843180._2
11101115 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11111116 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11121117 then (state ++ refreshKLpActions)
11381143 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
11391144 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
11401145 then {
1141- let $t04385343934 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1142- let refreshKLpActions = $t04385343934._1
1143- let updatedKLp = $t04385343934._2
1146+ let $t04412944210 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1147+ let refreshKLpActions = $t04412944210._1
1148+ let updatedKLp = $t04412944210._2
11441149 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11451150 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11461151 then (state ++ refreshKLpActions)
11841189 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
11851190 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
11861191 then {
1187- let $t04506045141 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1188- let refreshKLpActions = $t04506045141._1
1189- let updatedKLp = $t04506045141._2
1192+ let $t04533645417 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1193+ let refreshKLpActions = $t04533645417._1
1194+ let updatedKLp = $t04533645417._2
11901195 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11911196 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11921197 then (state ++ refreshKLpActions)
12371242 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
12381243 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
12391244 then {
1240- let $t04643646517 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1241- let refreshKLpActions = $t04643646517._1
1242- let updatedKLp = $t04643646517._2
1245+ let $t04671246793 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1246+ let refreshKLpActions = $t04671246793._1
1247+ let updatedKLp = $t04671246793._2
12431248 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
12441249 if ((isUpdatedKLpValid == isUpdatedKLpValid))
12451250 then (state ++ refreshKLpActions)
12741279 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
12751280 then {
12761281 let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
1277- let $t04770447768 = refreshKLpInternal(0, 0, 0)
1278- let kLpUpdateActions = $t04770447768._1
1279- let updatedKLp = $t04770447768._2
1282+ let $t04798048044 = refreshKLpInternal(0, 0, 0)
1283+ let kLpUpdateActions = $t04798048044._1
1284+ let updatedKLp = $t04798048044._2
12801285 let actions = if ((kLp != updatedKLp))
12811286 then kLpUpdateActions
12821287 else throwErr("nothing to refresh")
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let lPdecimals = 8
55
66 let scale8 = 100000000
77
88 let scale8BigInt = toBigInt(100000000)
99
1010 let scale18 = toBigInt(1000000000000000000)
1111
1212 let zeroBigInt = toBigInt(0)
1313
1414 let big0 = toBigInt(0)
1515
1616 let big1 = toBigInt(1)
1717
1818 let big2 = toBigInt(2)
1919
2020 let wavesString = "WAVES"
2121
2222 let SEP = "__"
2323
2424 let PoolActive = 1
2525
2626 let PoolPutDisabled = 2
2727
2828 let PoolMatcherDisabled = 3
2929
3030 let PoolShutdown = 4
3131
3232 let idxPoolAddress = 1
3333
3434 let idxPoolStatus = 2
3535
3636 let idxPoolLPAssetId = 3
3737
3838 let idxAmtAssetId = 4
3939
4040 let idxPriceAssetId = 5
4141
4242 let idxAmtAssetDcm = 6
4343
4444 let idxPriceAssetDcm = 7
4545
4646 let idxIAmtAssetId = 8
4747
4848 let idxIPriceAssetId = 9
4949
5050 let idxLPAssetDcm = 10
5151
5252 let idxPoolAmtAssetAmt = 1
5353
5454 let idxPoolPriceAssetAmt = 2
5555
5656 let idxPoolLPAssetAmt = 3
5757
5858 let idxFactoryStakingContract = 1
5959
6060 let idxFactorySlippageContract = 7
6161
6262 func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), scale18, toBigInt(origScaleMult))
63+
64+
65+func toX18BigInt (origVal,origScaleMult) = fraction(origVal, scale18, origScaleMult)
6366
6467
6568 func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), scale18))
6669
6770
6871 func fromX18Round (val,resultScaleMult,round) = toInt(fraction(val, toBigInt(resultScaleMult), scale18, round))
6972
7073
7174 func toScale (amt,resScale,curScale) = fraction(amt, resScale, curScale)
7275
7376
7477 func abs (val) = if ((0 > val))
7578 then -(val)
7679 else val
7780
7881
7982 func absBigInt (val) = if ((zeroBigInt > val))
8083 then -(val)
8184 else val
8285
8386
8487 func fc () = "%s__factoryContract"
8588
8689
8790 func mpk () = "%s__managerPublicKey"
8891
8992
9093 func pmpk () = "%s__pendingManagerPublicKey"
9194
9295
9396 func pl () = "%s%s__price__last"
9497
9598
9699 func ph (h,timestamp) = makeString(["%s%s%d%d__price__history", toString(h), toString(timestamp)], SEP)
97100
98101
99102 func pau (userAddress,txId) = ((("%s%s%s__P__" + userAddress) + "__") + txId)
100103
101104
102105 func gau (userAddress,txId) = ((("%s%s%s__G__" + userAddress) + "__") + txId)
103106
104107
105108 func aa () = "%s__amountAsset"
106109
107110
108111 func pa () = "%s__priceAsset"
109112
110113
111114 let keyFee = "%s__fee"
112115
113116 let feeDefault = fraction(10, scale8, 10000)
114117
115118 let fee = valueOrElse(getInteger(this, keyFee), feeDefault)
116119
117120 let keyKLp = makeString(["%s", "kLp"], SEP)
118121
119122 let keyKLpRefreshedHeight = makeString(["%s", "kLpRefreshedHeight"], SEP)
120123
121124 let keyKLpRefreshDelay = makeString(["%s", "refreshKLpDelay"], SEP)
122125
123126 let kLpRefreshDelayDefault = 30
124127
125128 let kLpRefreshDelay = valueOrElse(getInteger(this, keyKLpRefreshDelay), kLpRefreshDelayDefault)
126129
127130 func keyFactoryConfig () = "%s__factoryConfig"
128131
129132
130133 func keyMatcherPub () = "%s%s__matcher__publicKey"
131134
132135
133136 func keyMappingPoolContractAddressToPoolAssets (poolContractAddress) = (("%s%s%s__" + poolContractAddress) + "__mappings__poolContract2LpAsset")
134137
135138
136139 func keyPoolConfig (iAmtAsset,iPriceAsset) = (((("%d%d%s__" + iAmtAsset) + "__") + iPriceAsset) + "__config")
137140
138141
139142 func keyMappingsBaseAsset2internalId (baseAssetStr) = ("%s%s%s__mappings__baseAsset2internalId__" + baseAssetStr)
140143
141144
142145 func keyAllPoolsShutdown () = "%s__shutdown"
143146
144147
145148 func keyPoolWeight (contractAddress) = ("%s%s__poolWeight__" + contractAddress)
146149
147150
148151 func keyAllowedLpScriptHash () = "%s__allowedLpScriptHash"
149152
150153
151154 let keyFeeCollectorAddress = "%s__feeCollectorAddress"
152155
153156 func throwOrderError (orderValid,senderValid,matcherValid) = throw(((((("order validation failed: orderValid=" + toString(orderValid)) + " senderValid=") + toString(senderValid)) + " matcherValid=") + toString(matcherValid)))
154157
155158
156159 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
157160
158161
159162 func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
160163
161164
162165 func throwErr (msg) = throw(makeString(["lp.ride:", msg], " "))
163166
164167
165168 func fmtErr (msg) = makeString(["lp.ride:", msg], " ")
166169
167170
168171 let factoryContract = addressFromStringValue(getStringOrFail(this, fc()))
169172
170173 let feeCollectorAddress = addressFromStringValue(getStringOrFail(factoryContract, keyFeeCollectorAddress))
171174
172175 let inFee = {
173176 let @ = invoke(factoryContract, "getInFeeREADONLY", [toString(this)], nil)
174177 if ($isInstanceOf(@, "Int"))
175178 then @
176179 else throw(($getType(@) + " couldn't be cast to Int"))
177180 }
178181
179182 let outFee = {
180183 let @ = invoke(factoryContract, "getOutFeeREADONLY", [toString(this)], nil)
181184 if ($isInstanceOf(@, "Int"))
182185 then @
183186 else throw(($getType(@) + " couldn't be cast to Int"))
184187 }
185188
186189 func isGlobalShutdown () = valueOrElse(getBoolean(factoryContract, keyAllPoolsShutdown()), false)
187190
188191
189192 func getMatcherPubOrFail () = fromBase58String(getStringOrFail(factoryContract, keyMatcherPub()))
190193
191194
192195 func getPoolConfig () = {
193196 let amtAsset = getStringOrFail(this, aa())
194197 let priceAsset = getStringOrFail(this, pa())
195198 let iPriceAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(priceAsset))
196199 let iAmtAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(amtAsset))
197200 split(getStringOrFail(factoryContract, keyPoolConfig(toString(iAmtAsset), toString(iPriceAsset))), SEP)
198201 }
199202
200203
201204 func parseAssetId (input) = if ((input == wavesString))
202205 then unit
203206 else fromBase58String(input)
204207
205208
206209 func assetIdToString (input) = if ((input == unit))
207210 then wavesString
208211 else toBase58String(value(input))
209212
210213
211214 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]))
212215
213216
214217 let poolConfigParsed = parsePoolConfig(getPoolConfig())
215218
216-let $t082438409 = poolConfigParsed
219+let $t083448510 = poolConfigParsed
217220
218-let cfgPoolAddress = $t082438409._1
221+let cfgPoolAddress = $t083448510._1
219222
220-let cfgPoolStatus = $t082438409._2
223+let cfgPoolStatus = $t083448510._2
221224
222-let cfgLpAssetId = $t082438409._3
225+let cfgLpAssetId = $t083448510._3
223226
224-let cfgAmountAssetId = $t082438409._4
227+let cfgAmountAssetId = $t083448510._4
225228
226-let cfgPriceAssetId = $t082438409._5
229+let cfgPriceAssetId = $t083448510._5
227230
228-let cfgAmountAssetDecimals = $t082438409._6
231+let cfgAmountAssetDecimals = $t083448510._6
229232
230-let cfgPriceAssetDecimals = $t082438409._7
233+let cfgPriceAssetDecimals = $t083448510._7
231234
232235 func getFactoryConfig () = split(getStringOrFail(factoryContract, keyFactoryConfig()), SEP)
233236
234237
235238 let stakingContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactoryStakingContract]), "incorrect staking address")
236239
237240 let slippageContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactorySlippageContract]), "incorrect staking address")
238241
239242 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)
240243
241244
242245 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)
243246
244247
245248 func getAccBalance (assetId) = if ((assetId == "WAVES"))
246249 then wavesBalance(this).available
247250 else assetBalance(this, fromBase58String(assetId))
248251
249252
250253 func calcPriceBigInt (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18)
251254
252255
253256 func calcPriceBigIntRound (prAmtX18,amAmtX18,round) = fraction(prAmtX18, scale18, amAmtX18, round)
254257
255258
256259 func privateCalcPrice (amAssetDcm,prAssetDcm,amAmt,prAmt) = {
257260 let amtAssetAmtX18 = toX18(amAmt, amAssetDcm)
258261 let priceAssetAmtX18 = toX18(prAmt, prAssetDcm)
259262 calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
260263 }
261264
262265
263266 func calcPrices (amAmt,prAmt,lpAmt) = {
264267 let cfg = getPoolConfig()
265268 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
266269 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
267270 let priceX18 = privateCalcPrice(amtAssetDcm, priceAssetDcm, amAmt, prAmt)
268271 let amAmtX18 = toX18(amAmt, amtAssetDcm)
269272 let prAmtX18 = toX18(prAmt, priceAssetDcm)
270273 let lpAmtX18 = toX18(lpAmt, scale8)
271274 let lpPriceInAmAssetX18 = calcPriceBigInt(amAmtX18, lpAmtX18)
272275 let lpPriceInPrAssetX18 = calcPriceBigInt(prAmtX18, lpAmtX18)
273276 [priceX18, lpPriceInAmAssetX18, lpPriceInPrAssetX18]
274277 }
275278
276279
277280 func calculatePrices (amAmt,prAmt,lpAmt) = {
278281 let prices = calcPrices(amAmt, prAmt, lpAmt)
279282 [fromX18(prices[0], scale8), fromX18(prices[1], scale8), fromX18(prices[2], scale8)]
280283 }
281284
282285
283286 func estimateGetOperation (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
284287 let cfg = getPoolConfig()
285288 let lpAssetId = cfg[idxPoolLPAssetId]
286289 let amAssetId = cfg[idxAmtAssetId]
287290 let prAssetId = cfg[idxPriceAssetId]
288291 let amAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
289292 let prAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
290293 let poolStatus = cfg[idxPoolStatus]
291294 let lpEmission = valueOrErrorMessage(assetInfo(fromBase58String(lpAssetId)), (("Asset " + lpAssetId) + " doesn't exist")).quantity
292295 if ((lpAssetId != pmtAssetId))
293296 then throw("Invalid asset passed.")
294297 else {
295298 let amBalance = getAccBalance(amAssetId)
296299 let amBalanceX18 = toX18(amBalance, amAssetDcm)
297300 let prBalance = getAccBalance(prAssetId)
298301 let prBalanceX18 = toX18(prBalance, prAssetDcm)
299302 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
300303 let curPrice = fromX18(curPriceX18, scale8)
301304 let pmtLpAmtX18 = toX18(pmtLpAmt, scale8)
302305 let lpEmissionX18 = toX18(lpEmission, scale8)
303306 let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissionX18)
304307 let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissionX18)
305308 let outAmAmt = fromX18Round(outAmAmtX18, amAssetDcm, FLOOR)
306309 let outPrAmt = fromX18Round(outPrAmtX18, prAssetDcm, FLOOR)
307310 let state = if ((txId58 == ""))
308311 then nil
309312 else [ScriptTransfer(userAddress, outAmAmt, if ((amAssetId == "WAVES"))
310313 then unit
311314 else fromBase58String(amAssetId)), ScriptTransfer(userAddress, outPrAmt, if ((prAssetId == "WAVES"))
312315 then unit
313316 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)]
314317 $Tuple10(outAmAmt, outPrAmt, amAssetId, prAssetId, amBalance, prBalance, lpEmission, curPriceX18, poolStatus, state)
315318 }
316319 }
317320
318321
319322 func estimatePutOperation (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = {
320323 let cfg = getPoolConfig()
321324 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
322325 let amAssetIdStr = cfg[idxAmtAssetId]
323326 let prAssetIdStr = cfg[idxPriceAssetId]
324327 let iAmtAssetId = cfg[idxIAmtAssetId]
325328 let iPriceAssetId = cfg[idxIPriceAssetId]
326329 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
327330 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
328331 let poolStatus = cfg[idxPoolStatus]
329332 let lpEmission = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
330333 let inAmAssetIdStr = toBase58String(valueOrElse(inAmAssetId, fromBase58String("WAVES")))
331334 let inPrAssetIdStr = toBase58String(valueOrElse(inPrAssetId, fromBase58String("WAVES")))
332335 if (if ((amAssetIdStr != inAmAssetIdStr))
333336 then true
334337 else (prAssetIdStr != inPrAssetIdStr))
335338 then throw("Invalid amt or price asset passed.")
336339 else {
337340 let amBalance = if (isEvaluate)
338341 then getAccBalance(amAssetIdStr)
339342 else (getAccBalance(amAssetIdStr) - inAmAssetAmt)
340343 let prBalance = if (isEvaluate)
341344 then getAccBalance(prAssetIdStr)
342345 else (getAccBalance(prAssetIdStr) - inPrAssetAmt)
343346 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
344347 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
345348 let userPriceX18 = calcPriceBigInt(inPrAssetAmtX18, inAmAssetAmtX18)
346349 let amBalanceX18 = toX18(amBalance, amtAssetDcm)
347350 let prBalanceX18 = toX18(prBalance, priceAssetDcm)
348351 let res = if ((lpEmission == 0))
349352 then {
350353 let curPriceX18 = zeroBigInt
351354 let slippageX18 = zeroBigInt
352355 let lpAmtX18 = pow((inAmAssetAmtX18 * inPrAssetAmtX18), 0, toBigInt(5), 1, 0, DOWN)
353356 $Tuple5(fromX18(lpAmtX18, scale8), fromX18(inAmAssetAmtX18, amtAssetDcm), fromX18(inPrAssetAmtX18, priceAssetDcm), calcPriceBigInt((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18)
354357 }
355358 else {
356359 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
357360 let slippageX18 = fraction(absBigInt((curPriceX18 - userPriceX18)), scale18, curPriceX18)
358361 let slippageToleranceX18 = toX18(slippageTolerance, scale8)
359362 if (if ((curPriceX18 != zeroBigInt))
360363 then (slippageX18 > slippageToleranceX18)
361364 else false)
362365 then throw(((("Price slippage " + toString(slippageX18)) + " exceeded the passed limit of ") + toString(slippageToleranceX18)))
363366 else {
364367 let lpEmissionX18 = toX18(lpEmission, scale8)
365368 let prViaAmX18 = fraction(inAmAssetAmtX18, calcPriceBigIntRound(prBalanceX18, amBalanceX18, CEILING), scale18, CEILING)
366369 let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, calcPriceBigIntRound(prBalanceX18, amBalanceX18, FLOOR), CEILING)
367370 let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18))
368371 then $Tuple2(amViaPrX18, inPrAssetAmtX18)
369372 else $Tuple2(inAmAssetAmtX18, prViaAmX18)
370373 let expAmtAssetAmtX18 = expectedAmts._1
371374 let expPriceAssetAmtX18 = expectedAmts._2
372375 let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18, FLOOR)
373376 $Tuple5(fromX18Round(lpAmtX18, scale8, FLOOR), fromX18Round(expAmtAssetAmtX18, amtAssetDcm, CEILING), fromX18Round(expPriceAssetAmtX18, priceAssetDcm, CEILING), curPriceX18, slippageX18)
374377 }
375378 }
376379 let calcLpAmt = res._1
377380 let calcAmAssetPmt = res._2
378381 let calcPrAssetPmt = res._3
379382 let curPrice = fromX18(res._4, scale8)
380383 let slippageCalc = fromX18(res._5, scale8)
381384 if ((0 >= calcLpAmt))
382385 then throw("Invalid calculations. LP calculated is less than zero.")
383386 else {
384387 let emitLpAmt = if (!(emitLp))
385388 then 0
386389 else calcLpAmt
387390 let amDiff = (inAmAssetAmt - calcAmAssetPmt)
388391 let prDiff = (inPrAssetAmt - calcPrAssetPmt)
389392 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))]
390393 $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEmission, lpAssetId, poolStatus, commonState, amDiff, prDiff, inAmAssetId, inPrAssetId)
391394 }
392395 }
393396 }
394397
395398
396399 func calcKLp (amountBalance,priceBalance,lpEmission) = {
397- let updatedKLp = fraction(pow((amountBalance * priceBalance), 0, toBigInt(5), 1, 18, DOWN), big1, lpEmission)
400+ let amountBalanceX18 = toX18BigInt(amountBalance, toBigInt(cfgAmountAssetDecimals))
401+ let priceBalanceX18 = toX18BigInt(priceBalance, toBigInt(cfgPriceAssetDecimals))
402+ let updatedKLp = fraction(pow((amountBalanceX18 * priceBalanceX18), 0, toBigInt(5), 1, 18, DOWN), big1, lpEmission)
398403 if ((lpEmission == big0))
399404 then big0
400405 else updatedKLp
401406 }
402407
403408
404409 func calcCurrentKLp (amountAssetDelta,priceAssetDelta,lpAssetEmissionDelta) = {
405410 let amountAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) - amountAssetDelta)
406411 let priceAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) - priceAssetDelta)
407412 let lpAssetEmission = (toBigInt(value(assetInfo(cfgLpAssetId)).quantity) - lpAssetEmissionDelta)
408413 let currentKLp = calcKLp(amountAssetBalance, priceAssetBalance, lpAssetEmission)
409414 currentKLp
410415 }
411416
412417
413418 func refreshKLpInternal (amountAssetBalanceDelta,priceAssetBalanceDelta,lpAssetEmissionDelta) = {
414419 let amountAssetBalance = (getAccBalance(assetIdToString(cfgAmountAssetId)) + amountAssetBalanceDelta)
415420 let priceAssetBalance = (getAccBalance(assetIdToString(cfgPriceAssetId)) + priceAssetBalanceDelta)
416421 let lpAssetEmission = (value(assetInfo(cfgLpAssetId)).quantity + lpAssetEmissionDelta)
417422 let updatedKLp = calcKLp(toBigInt(amountAssetBalance), toBigInt(priceAssetBalance), toBigInt(lpAssetEmission))
418423 let actions = [IntegerEntry(keyKLpRefreshedHeight, height), StringEntry(keyKLp, toString(updatedKLp))]
419424 $Tuple2(actions, updatedKLp)
420425 }
421426
422427
423428 func validateUpdatedKLp (oldKLp,updatedKLp) = if ((updatedKLp >= oldKLp))
424429 then true
425430 else throwErr(makeString(["updated KLp lower than current KLp", toString(oldKLp), toString(updatedKLp)], " "))
426431
427432
428433 func validateMatcherOrderAllowed (order) = {
429434 let amountAssetAmount = order.amount
430435 let priceAssetAmount = fraction(order.amount, order.price, scale8, FLOOR)
431- let $t02098621198 = if ((order.orderType == Buy))
436+ let $t02126221474 = if ((order.orderType == Buy))
432437 then $Tuple2(amountAssetAmount, -(priceAssetAmount))
433438 else $Tuple2(-(amountAssetAmount), priceAssetAmount)
434- let amountAssetBalanceDelta = $t02098621198._1
435- let priceAssetBalanceDelta = $t02098621198._2
439+ let amountAssetBalanceDelta = $t02126221474._1
440+ let priceAssetBalanceDelta = $t02126221474._2
436441 if (if (if (isGlobalShutdown())
437442 then true
438443 else (cfgPoolStatus == PoolMatcherDisabled))
439444 then true
440445 else (cfgPoolStatus == PoolShutdown))
441446 then throw("Exchange operations disabled")
442447 else if (if ((order.assetPair.amountAsset != cfgAmountAssetId))
443448 then true
444449 else (order.assetPair.priceAsset != cfgPriceAssetId))
445450 then throw("Wrong order assets.")
446451 else {
447452 let kLp = valueOrErrorMessage(parseBigInt(valueOrErrorMessage(getString(this, keyKLp), fmtErr("kLp is required"))), fmtErr("invalid kLp"))
448- let $t02166921769 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
449- let unusedActions = $t02166921769._1
450- let kLpNew = $t02166921769._2
453+ let $t02194522045 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
454+ let unusedActions = $t02194522045._1
455+ let kLpNew = $t02194522045._2
451456 let isOrderValid = (kLpNew >= kLp)
452457 isOrderValid
453458 }
454459 }
455460
456461
457462 func commonGet (i) = if ((size(i.payments) != 1))
458463 then throw("exactly 1 payment is expected")
459464 else {
460465 let pmt = value(i.payments[0])
461466 let pmtAssetId = value(pmt.assetId)
462467 let pmtAmt = pmt.amount
463468 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller)
464469 let outAmAmt = res._1
465470 let outPrAmt = res._2
466471 let poolStatus = parseIntValue(res._9)
467472 let state = res._10
468473 if (if (isGlobalShutdown())
469474 then true
470475 else (poolStatus == PoolShutdown))
471476 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
472477 else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state)
473478 }
474479
475480
476481 func commonPut (i,slippageTolerance,emitLp) = if ((size(i.payments) != 2))
477482 then throw("exactly 2 payments are expected")
478483 else {
479484 let amAssetPmt = value(i.payments[0])
480485 let prAssetPmt = value(i.payments[1])
481486 let estPut = estimatePutOperation(toBase58String(i.transactionId), slippageTolerance, amAssetPmt.amount, amAssetPmt.assetId, prAssetPmt.amount, prAssetPmt.assetId, toString(i.caller), false, emitLp)
482487 let poolStatus = parseIntValue(estPut._8)
483488 if (if (if (isGlobalShutdown())
484489 then true
485490 else (poolStatus == PoolPutDisabled))
486491 then true
487492 else (poolStatus == PoolShutdown))
488493 then throw(("Put operation is blocked by admin. Status = " + toString(poolStatus)))
489494 else estPut
490495 }
491496
492497
493498 func emit (amount) = {
494499 let emitInv = invoke(factoryContract, "emit", [amount], nil)
495500 if ((emitInv == emitInv))
496501 then {
497502 let emitInvLegacy = match emitInv {
498503 case legacyFactoryContract: Address =>
499504 invoke(legacyFactoryContract, "emit", [amount], nil)
500505 case _ =>
501506 unit
502507 }
503508 if ((emitInvLegacy == emitInvLegacy))
504509 then amount
505510 else throw("Strict value is not equal to itself.")
506511 }
507512 else throw("Strict value is not equal to itself.")
508513 }
509514
510515
511516 func takeFee (amount,fee) = {
512517 let feeAmount = if ((fee == 0))
513518 then 0
514519 else fraction(amount, fee, scale8)
515520 $Tuple2((amount - feeAmount), feeAmount)
516521 }
517522
518523
519524 func calcPutOneToken (paymentAmountRaw,paymentAssetId,userAddress,txId) = {
520525 let isEval = (txId == unit)
521526 let amountBalanceRaw = getAccBalance(assetIdToString(cfgAmountAssetId))
522527 let priceBalanceRaw = getAccBalance(assetIdToString(cfgPriceAssetId))
523528 let paymentInAmountAsset = if ((paymentAssetId == cfgAmountAssetId))
524529 then true
525530 else if ((paymentAssetId == cfgPriceAssetId))
526531 then false
527532 else throwErr("invalid asset")
528- let $t02449024783 = if (isEval)
533+ let $t02476625059 = if (isEval)
529534 then $Tuple2(amountBalanceRaw, priceBalanceRaw)
530535 else if (paymentInAmountAsset)
531536 then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw)
532537 else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw))
533- let amountBalanceOld = $t02449024783._1
534- let priceBalanceOld = $t02449024783._2
535- let $t02478724936 = if (paymentInAmountAsset)
538+ let amountBalanceOld = $t02476625059._1
539+ let priceBalanceOld = $t02476625059._2
540+ let $t02506325212 = if (paymentInAmountAsset)
536541 then $Tuple2(paymentAmountRaw, 0)
537542 else $Tuple2(0, paymentAmountRaw)
538- let amountAssetAmountRaw = $t02478724936._1
539- let priceAssetAmountRaw = $t02478724936._2
543+ let amountAssetAmountRaw = $t02506325212._1
544+ let priceAssetAmountRaw = $t02506325212._2
540545 let amountAssetAmount = takeFee(amountAssetAmountRaw, inFee)._1
541546 let priceAssetAmount = takeFee(priceAssetAmountRaw, inFee)._1
542- let $t02506825132 = takeFee(paymentAmountRaw, inFee)
543- let paymentAmount = $t02506825132._1
544- let feeAmount = $t02506825132._2
547+ let $t02534425408 = takeFee(paymentAmountRaw, inFee)
548+ let paymentAmount = $t02534425408._1
549+ let feeAmount = $t02534425408._2
545550 let amountBalanceNew = (amountBalanceOld + amountAssetAmount)
546551 let priceBalanceNew = (priceBalanceOld + priceAssetAmount)
547552 let priceNewX18 = calcPriceBigInt(toX18(priceBalanceNew, cfgPriceAssetDecimals), toX18(amountBalanceNew, cfgAmountAssetDecimals))
548553 let priceNew = fromX18(priceNewX18, scale8)
549554 let paymentBalance = if (paymentInAmountAsset)
550555 then amountBalanceOld
551556 else priceBalanceOld
552557 let paymentBalanceBigInt = toBigInt(paymentBalance)
553558 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
554559 let chechSupply = if ((supplyBigInt > big0))
555560 then true
556561 else throwErr("initial deposit requires all coins")
557562 if ((chechSupply == chechSupply))
558563 then {
559564 let depositBigInt = toBigInt(paymentAmount)
560565 let issueAmount = max([0, toInt(((supplyBigInt * (sqrtBigInt((scale18 + ((depositBigInt * scale18) / paymentBalanceBigInt)), 18, 18, DOWN) - scale18)) / scale18))])
561566 let commonState = if (isEval)
562567 then nil
563568 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))]
564569 let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, cfgPriceAssetDecimals), toX18(amountBalanceOld, cfgAmountAssetDecimals))
565570 let priceOld = fromX18(priceOldX18, scale8)
566571 let loss = {
567- let $t02681326980 = if (paymentInAmountAsset)
572+ let $t02708927256 = if (paymentInAmountAsset)
568573 then $Tuple2(amountAssetAmountRaw, amountBalanceOld)
569574 else $Tuple2(priceAssetAmountRaw, priceBalanceOld)
570- let amount = $t02681326980._1
571- let balance = $t02681326980._2
575+ let amount = $t02708927256._1
576+ let balance = $t02708927256._2
572577 let issueAmountBoth = toInt(fraction(supplyBigInt, toBigInt((amount / 2)), toBigInt(balance)))
573578 fraction((issueAmount - issueAmountBoth), scale8, issueAmountBoth)
574579 }
575580 $Tuple5(issueAmount, commonState, feeAmount, loss, paymentInAmountAsset)
576581 }
577582 else throw("Strict value is not equal to itself.")
578583 }
579584
580585
581586 func calcGetOneToken (outAssetId,paymentAmount,paymentAssetId,userAddress,txId) = {
582587 let isEval = (txId == unit)
583588 let cfg = getPoolConfig()
584589 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
585590 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
586591 let checks = [if ((paymentAssetId == cfgLpAssetId))
587592 then true
588593 else throwErr("invalid lp asset")]
589594 if ((checks == checks))
590595 then {
591596 let outInAmountAsset = if ((outAssetId == cfgAmountAssetId))
592597 then true
593598 else if ((outAssetId == cfgPriceAssetId))
594599 then false
595600 else throwErr("invalid asset")
596601 let balanceBigInt = if (outInAmountAsset)
597602 then toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId)))
598603 else toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId)))
599604 let outInAmountAssetDecimals = if (outInAmountAsset)
600605 then amtAssetDcm
601606 else priceAssetDcm
602607 let amBalanceOld = getAccBalance(assetIdToString(cfgAmountAssetId))
603608 let prBalanceOld = getAccBalance(assetIdToString(cfgPriceAssetId))
604609 let outBalance = if (outInAmountAsset)
605610 then amBalanceOld
606611 else prBalanceOld
607612 let outBalanceBigInt = toBigInt(outBalance)
608613 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
609614 let redeemedBigInt = toBigInt(paymentAmount)
610615 let amountRaw = max([0, toInt(((balanceBigInt * (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN))) / scale18))])
611- let $t02905829114 = takeFee(amountRaw, outFee)
612- let totalAmount = $t02905829114._1
613- let feeAmount = $t02905829114._2
614- let $t02911829344 = if (outInAmountAsset)
616+ let $t02933429390 = takeFee(amountRaw, outFee)
617+ let totalAmount = $t02933429390._1
618+ let feeAmount = $t02933429390._2
619+ let $t02939429620 = if (outInAmountAsset)
615620 then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld)
616621 else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw))
617- let outAmAmount = $t02911829344._1
618- let outPrAmount = $t02911829344._2
619- let amBalanceNew = $t02911829344._3
620- let prBalanceNew = $t02911829344._4
622+ let outAmAmount = $t02939429620._1
623+ let outPrAmount = $t02939429620._2
624+ let amBalanceNew = $t02939429620._3
625+ let prBalanceNew = $t02939429620._4
621626 let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, cfgPriceAssetDecimals), toX18(amBalanceNew, cfgAmountAssetDecimals))
622627 let priceNew = fromX18(priceNewX18, scale8)
623628 let commonState = if (isEval)
624629 then nil
625630 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)]
626631 let priceOldX18 = calcPriceBigInt(toX18(prBalanceOld, cfgPriceAssetDecimals), toX18(amBalanceOld, cfgAmountAssetDecimals))
627632 let priceOld = fromX18(priceOldX18, scale8)
628633 let loss = {
629634 let amountBothInPaymentAsset = (toInt(fraction(balanceBigInt, redeemedBigInt, supplyBigInt)) * 2)
630635 fraction((totalAmount - amountBothInPaymentAsset), scale8, amountBothInPaymentAsset)
631636 }
632637 $Tuple5(totalAmount, commonState, feeAmount, loss, outInAmountAsset)
633638 }
634639 else throw("Strict value is not equal to itself.")
635640 }
636641
637642
638643 func managerPublicKeyOrUnit () = match getString(mpk()) {
639644 case s: String =>
640645 fromBase58String(s)
641646 case _: Unit =>
642647 unit
643648 case _ =>
644649 throw("Match error")
645650 }
646651
647652
648653 func pendingManagerPublicKeyOrUnit () = match getString(pmpk()) {
649654 case s: String =>
650655 fromBase58String(s)
651656 case _: Unit =>
652657 unit
653658 case _ =>
654659 throw("Match error")
655660 }
656661
657662
658663 func isManager (i) = match managerPublicKeyOrUnit() {
659664 case pk: ByteVector =>
660665 (i.callerPublicKey == pk)
661666 case _: Unit =>
662667 (i.caller == this)
663668 case _ =>
664669 throw("Match error")
665670 }
666671
667672
668673 func mustManager (i) = {
669674 let pd = throw("Permission denied")
670675 match managerPublicKeyOrUnit() {
671676 case pk: ByteVector =>
672677 if ((i.callerPublicKey == pk))
673678 then true
674679 else pd
675680 case _: Unit =>
676681 if ((i.caller == this))
677682 then true
678683 else pd
679684 case _ =>
680685 throw("Match error")
681686 }
682687 }
683688
684689
685690 @Callable(i)
686691 func setManager (pendingManagerPublicKey) = {
687692 let checkCaller = mustManager(i)
688693 if ((checkCaller == checkCaller))
689694 then {
690695 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
691696 if ((checkManagerPublicKey == checkManagerPublicKey))
692697 then [StringEntry(pmpk(), pendingManagerPublicKey)]
693698 else throw("Strict value is not equal to itself.")
694699 }
695700 else throw("Strict value is not equal to itself.")
696701 }
697702
698703
699704
700705 @Callable(i)
701706 func confirmManager () = {
702707 let pm = pendingManagerPublicKeyOrUnit()
703708 let hasPM = if (isDefined(pm))
704709 then true
705710 else throw("No pending manager")
706711 if ((hasPM == hasPM))
707712 then {
708713 let checkPM = if ((i.callerPublicKey == value(pm)))
709714 then true
710715 else throw("You are not pending manager")
711716 if ((checkPM == checkPM))
712717 then [StringEntry(mpk(), toBase58String(value(pm))), DeleteEntry(pmpk())]
713718 else throw("Strict value is not equal to itself.")
714719 }
715720 else throw("Strict value is not equal to itself.")
716721 }
717722
718723
719724
720725 @Callable(i)
721726 func put (slippageTolerance,shouldAutoStake) = if ((0 > slippageTolerance))
722727 then throw("Invalid slippageTolerance passed")
723728 else {
724729 let estPut = commonPut(i, slippageTolerance, true)
725730 let emitLpAmt = estPut._2
726731 let lpAssetId = estPut._7
727732 let state = estPut._9
728733 let amDiff = estPut._10
729734 let prDiff = estPut._11
730735 let amId = estPut._12
731736 let prId = estPut._13
732737 let amAssetPmt = toBigInt(value(i.payments[0]).amount)
733738 let prAssetPmt = toBigInt(value(i.payments[1]).amount)
734739 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
735740 if ((currentKLp == currentKLp))
736741 then {
737742 let emitInv = invoke(factoryContract, "emit", [emitLpAmt], nil)
738743 if ((emitInv == emitInv))
739744 then {
740745 let emitInvLegacy = match emitInv {
741746 case legacyFactoryContract: Address =>
742747 invoke(legacyFactoryContract, "emit", [emitLpAmt], nil)
743748 case _ =>
744749 unit
745750 }
746751 if ((emitInvLegacy == emitInvLegacy))
747752 then {
748753 let slippageAInv = if ((amDiff > 0))
749754 then invoke(slippageContract, "put", nil, [AttachedPayment(amId, amDiff)])
750755 else nil
751756 if ((slippageAInv == slippageAInv))
752757 then {
753758 let slippagePInv = if ((prDiff > 0))
754759 then invoke(slippageContract, "put", nil, [AttachedPayment(prId, prDiff)])
755760 else nil
756761 if ((slippagePInv == slippagePInv))
757762 then {
758763 let lpTransfer = if (shouldAutoStake)
759764 then {
760765 let slpStakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)])
761766 if ((slpStakeInv == slpStakeInv))
762767 then nil
763768 else throw("Strict value is not equal to itself.")
764769 }
765770 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
766- let $t03387234334 = refreshKLpInternal(0, 0, 0)
767- if (($t03387234334 == $t03387234334))
771+ let $t03414834610 = refreshKLpInternal(0, 0, 0)
772+ if (($t03414834610 == $t03414834610))
768773 then {
769- let updatedKLp = $t03387234334._2
770- let refreshKLpActions = $t03387234334._1
774+ let updatedKLp = $t03414834610._2
775+ let refreshKLpActions = $t03414834610._1
771776 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
772777 if ((isUpdatedKLpValid == isUpdatedKLpValid))
773778 then ((state ++ lpTransfer) ++ refreshKLpActions)
774779 else throw("Strict value is not equal to itself.")
775780 }
776781 else throw("Strict value is not equal to itself.")
777782 }
778783 else throw("Strict value is not equal to itself.")
779784 }
780785 else throw("Strict value is not equal to itself.")
781786 }
782787 else throw("Strict value is not equal to itself.")
783788 }
784789 else throw("Strict value is not equal to itself.")
785790 }
786791 else throw("Strict value is not equal to itself.")
787792 }
788793
789794
790795
791796 @Callable(i)
792797 func putForFree (maxSlippage) = if ((0 > maxSlippage))
793798 then throw("Invalid value passed")
794799 else {
795800 let estPut = commonPut(i, maxSlippage, false)
796801 let state = estPut._9
797802 let amAssetPmt = toBigInt(value(i.payments[0]).amount)
798803 let prAssetPmt = toBigInt(value(i.payments[1]).amount)
799804 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
800805 if ((currentKLp == currentKLp))
801806 then {
802- let $t03489634961 = refreshKLpInternal(0, 0, 0)
803- let refreshKLpActions = $t03489634961._1
804- let updatedKLp = $t03489634961._2
807+ let $t03517235237 = refreshKLpInternal(0, 0, 0)
808+ let refreshKLpActions = $t03517235237._1
809+ let updatedKLp = $t03517235237._2
805810 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
806811 if ((isUpdatedKLpValid == isUpdatedKLpValid))
807812 then (state ++ refreshKLpActions)
808813 else throw("Strict value is not equal to itself.")
809814 }
810815 else throw("Strict value is not equal to itself.")
811816 }
812817
813818
814819
815820 @Callable(i)
816821 func putOneTkn (minOutAmount,autoStake) = {
817822 let isPoolOneTokenOperationsDisabled = {
818823 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
819824 if ($isInstanceOf(@, "Boolean"))
820825 then @
821826 else throw(($getType(@) + " couldn't be cast to Boolean"))
822827 }
823828 let isPutDisabled = if (if (if (isGlobalShutdown())
824829 then true
825830 else (cfgPoolStatus == PoolPutDisabled))
826831 then true
827832 else (cfgPoolStatus == PoolShutdown))
828833 then true
829834 else isPoolOneTokenOperationsDisabled
830835 let checks = [if (if (!(isPutDisabled))
831836 then true
832837 else isManager(i))
833838 then true
834839 else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1))
835840 then true
836841 else throwErr("exactly 1 payment are expected")]
837842 if ((checks == checks))
838843 then {
839844 let payment = i.payments[0]
840845 let paymentAssetId = payment.assetId
841846 let paymentAmountRaw = payment.amount
842847 let currentKLp = if ((paymentAssetId == cfgAmountAssetId))
843848 then calcCurrentKLp(toBigInt(paymentAmountRaw), toBigInt(0), toBigInt(0))
844849 else if ((paymentAssetId == cfgPriceAssetId))
845850 then calcCurrentKLp(toBigInt(0), toBigInt(paymentAmountRaw), toBigInt(0))
846851 else throwErr("payment asset is not supported")
847852 if ((currentKLp == currentKLp))
848853 then {
849854 let userAddress = i.caller
850855 let txId = i.transactionId
851- let $t03614936301 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
852- if (($t03614936301 == $t03614936301))
856+ let $t03642536577 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
857+ if (($t03642536577 == $t03642536577))
853858 then {
854- let paymentInAmountAsset = $t03614936301._5
855- let bonus = $t03614936301._4
856- let feeAmount = $t03614936301._3
857- let commonState = $t03614936301._2
858- let emitAmountEstimated = $t03614936301._1
859+ let paymentInAmountAsset = $t03642536577._5
860+ let bonus = $t03642536577._4
861+ let feeAmount = $t03642536577._3
862+ let commonState = $t03642536577._2
863+ let emitAmountEstimated = $t03642536577._1
859864 let emitAmount = if (if ((minOutAmount > 0))
860865 then (minOutAmount > emitAmountEstimated)
861866 else false)
862867 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
863868 else emitAmountEstimated
864869 let emitInv = emit(emitAmount)
865870 if ((emitInv == emitInv))
866871 then {
867872 let lpTransfer = if (autoStake)
868873 then {
869874 let stakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(cfgLpAssetId, emitAmount)])
870875 if ((stakeInv == stakeInv))
871876 then nil
872877 else throw("Strict value is not equal to itself.")
873878 }
874879 else [ScriptTransfer(i.caller, emitAmount, cfgLpAssetId)]
875880 let sendFee = if ((feeAmount > 0))
876881 then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
877882 else nil
878- let $t03688737084 = if ((this == feeCollectorAddress))
883+ let $t03716337360 = if ((this == feeCollectorAddress))
879884 then $Tuple2(0, 0)
880885 else if (paymentInAmountAsset)
881886 then $Tuple2(-(feeAmount), 0)
882887 else $Tuple2(0, -(feeAmount))
883- let amountAssetBalanceDelta = $t03688737084._1
884- let priceAssetBalanceDelta = $t03688737084._2
885- let $t03708737195 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
886- let refreshKLpActions = $t03708737195._1
887- let updatedKLp = $t03708737195._2
888+ let amountAssetBalanceDelta = $t03716337360._1
889+ let priceAssetBalanceDelta = $t03716337360._2
890+ let $t03736337471 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
891+ let refreshKLpActions = $t03736337471._1
892+ let updatedKLp = $t03736337471._2
888893 let kLp = value(getString(keyKLp))
889894 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
890895 if ((isUpdatedKLpValid == isUpdatedKLpValid))
891896 then $Tuple2((((commonState ++ lpTransfer) ++ sendFee) ++ refreshKLpActions), emitAmount)
892897 else throw("Strict value is not equal to itself.")
893898 }
894899 else throw("Strict value is not equal to itself.")
895900 }
896901 else throw("Strict value is not equal to itself.")
897902 }
898903 else throw("Strict value is not equal to itself.")
899904 }
900905 else throw("Strict value is not equal to itself.")
901906 }
902907
903908
904909
905910 @Callable(i)
906911 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
907- let $t03750137658 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
908- let emitAmountEstimated = $t03750137658._1
909- let commonState = $t03750137658._2
910- let feeAmount = $t03750137658._3
911- let bonus = $t03750137658._4
912- let paymentInAmountAsset = $t03750137658._5
912+ let $t03777737934 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
913+ let emitAmountEstimated = $t03777737934._1
914+ let commonState = $t03777737934._2
915+ let feeAmount = $t03777737934._3
916+ let bonus = $t03777737934._4
917+ let paymentInAmountAsset = $t03777737934._5
913918 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
914919 }
915920
916921
917922
918923 @Callable(i)
919924 func getOneTkn (outAssetIdStr,minOutAmount) = {
920925 let isPoolOneTokenOperationsDisabled = {
921926 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
922927 if ($isInstanceOf(@, "Boolean"))
923928 then @
924929 else throw(($getType(@) + " couldn't be cast to Boolean"))
925930 }
926931 let isGetDisabled = if (if (isGlobalShutdown())
927932 then true
928933 else (cfgPoolStatus == PoolShutdown))
929934 then true
930935 else isPoolOneTokenOperationsDisabled
931936 let checks = [if (if (!(isGetDisabled))
932937 then true
933938 else isManager(i))
934939 then true
935940 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1))
936941 then true
937942 else throwErr("exactly 1 payment are expected")]
938943 if ((checks == checks))
939944 then {
940945 let outAssetId = parseAssetId(outAssetIdStr)
941946 let payment = i.payments[0]
942947 let paymentAssetId = payment.assetId
943948 let paymentAmount = payment.amount
944949 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
945950 if ((currentKLp == currentKLp))
946951 then {
947952 let userAddress = i.caller
948953 let txId = i.transactionId
949- let $t03854338696 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
950- if (($t03854338696 == $t03854338696))
954+ let $t03881938972 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
955+ if (($t03881938972 == $t03881938972))
951956 then {
952- let outInAmountAsset = $t03854338696._5
953- let bonus = $t03854338696._4
954- let feeAmount = $t03854338696._3
955- let commonState = $t03854338696._2
956- let amountEstimated = $t03854338696._1
957+ let outInAmountAsset = $t03881938972._5
958+ let bonus = $t03881938972._4
959+ let feeAmount = $t03881938972._3
960+ let commonState = $t03881938972._2
961+ let amountEstimated = $t03881938972._1
957962 let amount = if (if ((minOutAmount > 0))
958963 then (minOutAmount > amountEstimated)
959964 else false)
960965 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
961966 else amountEstimated
962967 let burnInv = invoke(factoryContract, "burn", [paymentAmount], [AttachedPayment(paymentAssetId, paymentAmount)])
963968 if ((burnInv == burnInv))
964969 then {
965970 let assetTransfer = [ScriptTransfer(userAddress, amount, outAssetId)]
966971 let sendFee = if ((feeAmount > 0))
967972 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
968973 else nil
969- let $t03919639443 = {
974+ let $t03947239719 = {
970975 let feeAmountForCalc = if ((this == feeCollectorAddress))
971976 then 0
972977 else feeAmount
973978 if (outInAmountAsset)
974979 then $Tuple2(-((amount + feeAmountForCalc)), 0)
975980 else $Tuple2(0, -((amount + feeAmountForCalc)))
976981 }
977- let amountAssetBalanceDelta = $t03919639443._1
978- let priceAssetBalanceDelta = $t03919639443._2
979- let $t03944639554 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
980- let refreshKLpActions = $t03944639554._1
981- let updatedKLp = $t03944639554._2
982+ let amountAssetBalanceDelta = $t03947239719._1
983+ let priceAssetBalanceDelta = $t03947239719._2
984+ let $t03972239830 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
985+ let refreshKLpActions = $t03972239830._1
986+ let updatedKLp = $t03972239830._2
982987 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
983988 if ((isUpdatedKLpValid == isUpdatedKLpValid))
984989 then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
985990 else throw("Strict value is not equal to itself.")
986991 }
987992 else throw("Strict value is not equal to itself.")
988993 }
989994 else throw("Strict value is not equal to itself.")
990995 }
991996 else throw("Strict value is not equal to itself.")
992997 }
993998 else throw("Strict value is not equal to itself.")
994999 }
9951000
9961001
9971002
9981003 @Callable(i)
9991004 func getOneTknREADONLY (outAssetId,paymentAmount) = {
1000- let $t03981139967 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
1001- let amountEstimated = $t03981139967._1
1002- let commonState = $t03981139967._2
1003- let feeAmount = $t03981139967._3
1004- let bonus = $t03981139967._4
1005- let outInAmountAsset = $t03981139967._5
1005+ let $t04008740243 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
1006+ let amountEstimated = $t04008740243._1
1007+ let commonState = $t04008740243._2
1008+ let feeAmount = $t04008740243._3
1009+ let bonus = $t04008740243._4
1010+ let outInAmountAsset = $t04008740243._5
10061011 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
10071012 }
10081013
10091014
10101015
10111016 @Callable(i)
10121017 func unstakeAndGetOneTkn (unstakeAmount,outAssetIdStr,minOutAmount) = {
10131018 let isPoolOneTokenOperationsDisabled = {
10141019 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
10151020 if ($isInstanceOf(@, "Boolean"))
10161021 then @
10171022 else throw(($getType(@) + " couldn't be cast to Boolean"))
10181023 }
10191024 let isGetDisabled = if (if (isGlobalShutdown())
10201025 then true
10211026 else (cfgPoolStatus == PoolShutdown))
10221027 then true
10231028 else isPoolOneTokenOperationsDisabled
10241029 let checks = [if (if (!(isGetDisabled))
10251030 then true
10261031 else isManager(i))
10271032 then true
10281033 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 0))
10291034 then true
10301035 else throwErr("no payments are expected")]
10311036 if ((checks == checks))
10321037 then {
10331038 let outAssetId = parseAssetId(outAssetIdStr)
10341039 let userAddress = i.caller
10351040 let txId = i.transactionId
10361041 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
10371042 if ((currentKLp == currentKLp))
10381043 then {
10391044 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
10401045 if ((unstakeInv == unstakeInv))
10411046 then {
1042- let $t04087241023 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1043- if (($t04087241023 == $t04087241023))
1047+ let $t04114841299 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1048+ if (($t04114841299 == $t04114841299))
10441049 then {
1045- let outInAmountAsset = $t04087241023._5
1046- let bonus = $t04087241023._4
1047- let feeAmount = $t04087241023._3
1048- let commonState = $t04087241023._2
1049- let amountEstimated = $t04087241023._1
1050+ let outInAmountAsset = $t04114841299._5
1051+ let bonus = $t04114841299._4
1052+ let feeAmount = $t04114841299._3
1053+ let commonState = $t04114841299._2
1054+ let amountEstimated = $t04114841299._1
10501055 let amount = if (if ((minOutAmount > 0))
10511056 then (minOutAmount > amountEstimated)
10521057 else false)
10531058 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
10541059 else amountEstimated
10551060 let burnInv = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
10561061 if ((burnInv == burnInv))
10571062 then {
10581063 let assetTransfer = [ScriptTransfer(i.caller, amount, outAssetId)]
10591064 let sendFee = if ((feeAmount > 0))
10601065 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
10611066 else nil
1062- let $t04151841765 = {
1067+ let $t04179442041 = {
10631068 let feeAmountForCalc = if ((this == feeCollectorAddress))
10641069 then 0
10651070 else feeAmount
10661071 if (outInAmountAsset)
10671072 then $Tuple2(-((amount + feeAmountForCalc)), 0)
10681073 else $Tuple2(0, -((amount + feeAmountForCalc)))
10691074 }
1070- let amountAssetBalanceDelta = $t04151841765._1
1071- let priceAssetBalanceDelta = $t04151841765._2
1072- let $t04176841876 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1073- let refreshKLpActions = $t04176841876._1
1074- let updatedKLp = $t04176841876._2
1075+ let amountAssetBalanceDelta = $t04179442041._1
1076+ let priceAssetBalanceDelta = $t04179442041._2
1077+ let $t04204442152 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1078+ let refreshKLpActions = $t04204442152._1
1079+ let updatedKLp = $t04204442152._2
10751080 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10761081 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10771082 then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
10781083 else throw("Strict value is not equal to itself.")
10791084 }
10801085 else throw("Strict value is not equal to itself.")
10811086 }
10821087 else throw("Strict value is not equal to itself.")
10831088 }
10841089 else throw("Strict value is not equal to itself.")
10851090 }
10861091 else throw("Strict value is not equal to itself.")
10871092 }
10881093 else throw("Strict value is not equal to itself.")
10891094 }
10901095
10911096
10921097
10931098 @Callable(i)
10941099 func get () = {
10951100 let res = commonGet(i)
10961101 let outAmtAmt = res._1
10971102 let outPrAmt = res._2
10981103 let pmtAmt = res._3
10991104 let pmtAssetId = res._4
11001105 let state = res._5
11011106 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
11021107 if ((currentKLp == currentKLp))
11031108 then {
11041109 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
11051110 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
11061111 then {
1107- let $t04282242904 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1108- let refreshKLpActions = $t04282242904._1
1109- let updatedKLp = $t04282242904._2
1112+ let $t04309843180 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1113+ let refreshKLpActions = $t04309843180._1
1114+ let updatedKLp = $t04309843180._2
11101115 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11111116 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11121117 then (state ++ refreshKLpActions)
11131118 else throw("Strict value is not equal to itself.")
11141119 }
11151120 else throw("Strict value is not equal to itself.")
11161121 }
11171122 else throw("Strict value is not equal to itself.")
11181123 }
11191124
11201125
11211126
11221127 @Callable(i)
11231128 func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = {
11241129 let res = commonGet(i)
11251130 let outAmAmt = res._1
11261131 let outPrAmt = res._2
11271132 let pmtAmt = res._3
11281133 let pmtAssetId = res._4
11291134 let state = res._5
11301135 if ((noLessThenAmtAsset > outAmAmt))
11311136 then throw(((("noLessThenAmtAsset failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset)))
11321137 else if ((noLessThenPriceAsset > outPrAmt))
11331138 then throw(((("noLessThenPriceAsset failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset)))
11341139 else {
11351140 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
11361141 if ((currentKLp == currentKLp))
11371142 then {
11381143 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
11391144 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
11401145 then {
1141- let $t04385343934 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1142- let refreshKLpActions = $t04385343934._1
1143- let updatedKLp = $t04385343934._2
1146+ let $t04412944210 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1147+ let refreshKLpActions = $t04412944210._1
1148+ let updatedKLp = $t04412944210._2
11441149 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11451150 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11461151 then (state ++ refreshKLpActions)
11471152 else throw("Strict value is not equal to itself.")
11481153 }
11491154 else throw("Strict value is not equal to itself.")
11501155 }
11511156 else throw("Strict value is not equal to itself.")
11521157 }
11531158 }
11541159
11551160
11561161
11571162 @Callable(i)
11581163 func unstakeAndGet (amount) = {
11591164 let checkPayments = if ((size(i.payments) != 0))
11601165 then throw("No payments are expected")
11611166 else true
11621167 if ((checkPayments == checkPayments))
11631168 then {
11641169 let cfg = getPoolConfig()
11651170 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
11661171 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
11671172 if ((currentKLp == currentKLp))
11681173 then {
11691174 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(lpAssetId), amount], nil)
11701175 if ((unstakeInv == unstakeInv))
11711176 then {
11721177 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller)
11731178 let outAmAmt = res._1
11741179 let outPrAmt = res._2
11751180 let poolStatus = parseIntValue(res._9)
11761181 let state = res._10
11771182 let checkPoolStatus = if (if (isGlobalShutdown())
11781183 then true
11791184 else (poolStatus == PoolShutdown))
11801185 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
11811186 else true
11821187 if ((checkPoolStatus == checkPoolStatus))
11831188 then {
11841189 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
11851190 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
11861191 then {
1187- let $t04506045141 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1188- let refreshKLpActions = $t04506045141._1
1189- let updatedKLp = $t04506045141._2
1192+ let $t04533645417 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1193+ let refreshKLpActions = $t04533645417._1
1194+ let updatedKLp = $t04533645417._2
11901195 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11911196 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11921197 then (state ++ refreshKLpActions)
11931198 else throw("Strict value is not equal to itself.")
11941199 }
11951200 else throw("Strict value is not equal to itself.")
11961201 }
11971202 else throw("Strict value is not equal to itself.")
11981203 }
11991204 else throw("Strict value is not equal to itself.")
12001205 }
12011206 else throw("Strict value is not equal to itself.")
12021207 }
12031208 else throw("Strict value is not equal to itself.")
12041209 }
12051210
12061211
12071212
12081213 @Callable(i)
12091214 func unstakeAndGetNoLess (unstakeAmount,noLessThenAmountAsset,noLessThenPriceAsset) = {
12101215 let isGetDisabled = if (isGlobalShutdown())
12111216 then true
12121217 else (cfgPoolStatus == PoolShutdown)
12131218 let checks = [if (!(isGetDisabled))
12141219 then true
12151220 else throw("get operation is blocked by admin"), if ((size(i.payments) == 0))
12161221 then true
12171222 else throw("no payments are expected")]
12181223 if ((checks == checks))
12191224 then {
12201225 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
12211226 if ((currentKLp == currentKLp))
12221227 then {
12231228 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
12241229 if ((unstakeInv == unstakeInv))
12251230 then {
12261231 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller)
12271232 let outAmAmt = res._1
12281233 let outPrAmt = res._2
12291234 let state = res._10
12301235 let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset))
12311236 then true
12321237 else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset))
12331238 then true
12341239 else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))]
12351240 if ((checkAmounts == checkAmounts))
12361241 then {
12371242 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
12381243 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
12391244 then {
1240- let $t04643646517 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1241- let refreshKLpActions = $t04643646517._1
1242- let updatedKLp = $t04643646517._2
1245+ let $t04671246793 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1246+ let refreshKLpActions = $t04671246793._1
1247+ let updatedKLp = $t04671246793._2
12431248 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
12441249 if ((isUpdatedKLpValid == isUpdatedKLpValid))
12451250 then (state ++ refreshKLpActions)
12461251 else throw("Strict value is not equal to itself.")
12471252 }
12481253 else throw("Strict value is not equal to itself.")
12491254 }
12501255 else throw("Strict value is not equal to itself.")
12511256 }
12521257 else throw("Strict value is not equal to itself.")
12531258 }
12541259 else throw("Strict value is not equal to itself.")
12551260 }
12561261 else throw("Strict value is not equal to itself.")
12571262 }
12581263
12591264
12601265
12611266 @Callable(i)
12621267 func activate (amtAssetStr,priceAssetStr) = if ((toString(i.caller) != toString(factoryContract)))
12631268 then throw("permissions denied")
12641269 else $Tuple2([StringEntry(aa(), amtAssetStr), StringEntry(pa(), priceAssetStr)], "success")
12651270
12661271
12671272
12681273 @Callable(i)
12691274 func refreshKLp () = {
12701275 let lastRefreshedBlockHeight = valueOrElse(getInteger(keyKLpRefreshedHeight), 0)
12711276 let checkLastRefreshedBlockHeight = if (((height - lastRefreshedBlockHeight) >= kLpRefreshDelay))
12721277 then unit
12731278 else throwErr(makeString([toString(kLpRefreshDelay), " blocks have not passed since the previous call"], ""))
12741279 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
12751280 then {
12761281 let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
1277- let $t04770447768 = refreshKLpInternal(0, 0, 0)
1278- let kLpUpdateActions = $t04770447768._1
1279- let updatedKLp = $t04770447768._2
1282+ let $t04798048044 = refreshKLpInternal(0, 0, 0)
1283+ let kLpUpdateActions = $t04798048044._1
1284+ let updatedKLp = $t04798048044._2
12801285 let actions = if ((kLp != updatedKLp))
12811286 then kLpUpdateActions
12821287 else throwErr("nothing to refresh")
12831288 $Tuple2(actions, toString(updatedKLp))
12841289 }
12851290 else throw("Strict value is not equal to itself.")
12861291 }
12871292
12881293
12891294
12901295 @Callable(i)
12911296 func getPoolConfigWrapperREADONLY () = $Tuple2(nil, getPoolConfig())
12921297
12931298
12941299
12951300 @Callable(i)
12961301 func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId))
12971302
12981303
12991304
13001305 @Callable(i)
13011306 func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = {
13021307 let prices = calcPrices(amAmt, prAmt, lpAmt)
13031308 $Tuple2(nil, [toString(prices[0]), toString(prices[1]), toString(prices[2])])
13041309 }
13051310
13061311
13071312
13081313 @Callable(i)
13091314 func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(toX18(origVal, origScaleMult)))
13101315
13111316
13121317
13131318 @Callable(i)
13141319 func fromX18WrapperREADONLY (val,resultScaleMult) = $Tuple2(nil, fromX18(parseBigIntValue(val), resultScaleMult))
13151320
13161321
13171322
13181323 @Callable(i)
13191324 func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(calcPriceBigInt(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18))))
13201325
13211326
13221327
13231328 @Callable(i)
13241329 func estimatePutOperationWrapperREADONLY (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = $Tuple2(nil, estimatePutOperation(txId58, slippageTolerance, inAmAssetAmt, inAmAssetId, inPrAssetAmt, inPrAssetId, userAddress, isEvaluate, emitLp))
13251330
13261331
13271332
13281333 @Callable(i)
13291334 func estimateGetOperationWrapperREADONLY (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
13301335 let res = estimateGetOperation(txId58, pmtAssetId, pmtLpAmt, addressFromStringValue(userAddress))
13311336 $Tuple2(nil, $Tuple10(res._1, res._2, res._3, res._4, res._5, res._6, res._7, toString(res._8), res._9, res._10))
13321337 }
13331338
13341339
13351340
13361341 @Callable(i)
13371342 func statsREADONLY () = {
13381343 let cfg = getPoolConfig()
13391344 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
13401345 let amtAssetId = cfg[idxAmtAssetId]
13411346 let priceAssetId = cfg[idxPriceAssetId]
13421347 let iAmtAssetId = cfg[idxIAmtAssetId]
13431348 let iPriceAssetId = cfg[idxIPriceAssetId]
13441349 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
13451350 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
13461351 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
13471352 let accAmtAssetBalance = getAccBalance(amtAssetId)
13481353 let accPriceAssetBalance = getAccBalance(priceAssetId)
13491354 let pricesList = if ((poolLPBalance == 0))
13501355 then [zeroBigInt, zeroBigInt, zeroBigInt]
13511356 else calcPrices(accAmtAssetBalance, accPriceAssetBalance, poolLPBalance)
13521357 let curPrice = 0
13531358 let lpAmtAssetShare = fromX18(pricesList[1], scale8)
13541359 let lpPriceAssetShare = fromX18(pricesList[2], scale8)
13551360 let poolWeight = value(getInteger(factoryContract, keyPoolWeight(toString(this))))
13561361 $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))
13571362 }
13581363
13591364
13601365
13611366 @Callable(i)
13621367 func evaluatePutByAmountAssetREADONLY (inAmAssetAmt) = {
13631368 let cfg = getPoolConfig()
13641369 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
13651370 let amAssetIdStr = cfg[idxAmtAssetId]
13661371 let amAssetId = fromBase58String(amAssetIdStr)
13671372 let prAssetIdStr = cfg[idxPriceAssetId]
13681373 let prAssetId = fromBase58String(prAssetIdStr)
13691374 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
13701375 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
13711376 let poolStatus = cfg[idxPoolStatus]
13721377 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
13731378 let accAmtAssetBalance = getAccBalance(amAssetIdStr)
13741379 let accPriceAssetBalance = getAccBalance(prAssetIdStr)
13751380 let amtAssetAmtX18 = toX18(accAmtAssetBalance, amtAssetDcm)
13761381 let priceAssetAmtX18 = toX18(accPriceAssetBalance, priceAssetDcm)
13771382 let curPriceX18 = if ((poolLPBalance == 0))
13781383 then zeroBigInt
13791384 else calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
13801385 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
13811386 let inPrAssetAmtX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18)
13821387 let inPrAssetAmt = fromX18(inPrAssetAmtX18, priceAssetDcm)
13831388 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
13841389 let calcLpAmt = estPut._1
13851390 let curPriceCalc = estPut._3
13861391 let amBalance = estPut._4
13871392 let prBalance = estPut._5
13881393 let lpEmission = estPut._6
13891394 $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))
13901395 }
13911396
13921397
13931398
13941399 @Callable(i)
13951400 func evaluatePutByPriceAssetREADONLY (inPrAssetAmt) = {
13961401 let cfg = getPoolConfig()
13971402 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
13981403 let amAssetIdStr = cfg[idxAmtAssetId]
13991404 let amAssetId = fromBase58String(amAssetIdStr)
14001405 let prAssetIdStr = cfg[idxPriceAssetId]
14011406 let prAssetId = fromBase58String(prAssetIdStr)
14021407 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
14031408 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
14041409 let poolStatus = cfg[idxPoolStatus]
14051410 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
14061411 let amBalanceRaw = getAccBalance(amAssetIdStr)
14071412 let prBalanceRaw = getAccBalance(prAssetIdStr)
14081413 let amBalanceRawX18 = toX18(amBalanceRaw, amtAssetDcm)
14091414 let prBalanceRawX18 = toX18(prBalanceRaw, priceAssetDcm)
14101415 let curPriceX18 = if ((poolLPBalance == 0))
14111416 then zeroBigInt
14121417 else calcPriceBigInt(prBalanceRawX18, amBalanceRawX18)
14131418 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
14141419 let inAmAssetAmtX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
14151420 let inAmAssetAmt = fromX18(inAmAssetAmtX18, amtAssetDcm)
14161421 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
14171422 let calcLpAmt = estPut._1
14181423 let curPriceCalc = estPut._3
14191424 let amBalance = estPut._4
14201425 let prBalance = estPut._5
14211426 let lpEmission = estPut._6
14221427 $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))
14231428 }
14241429
14251430
14261431
14271432 @Callable(i)
14281433 func evaluateGetREADONLY (paymentLpAssetId,paymentLpAmt) = {
14291434 let res = estimateGetOperation("", paymentLpAssetId, paymentLpAmt, this)
14301435 let outAmAmt = res._1
14311436 let outPrAmt = res._2
14321437 let amBalance = res._5
14331438 let prBalance = res._6
14341439 let lpEmission = res._7
14351440 let curPrice = res._8
14361441 let poolStatus = parseIntValue(res._9)
14371442 $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))
14381443 }
14391444
14401445
14411446 @Verifier(tx)
14421447 func verify () = {
14431448 let targetPublicKey = match managerPublicKeyOrUnit() {
14441449 case pk: ByteVector =>
14451450 pk
14461451 case _: Unit =>
14471452 tx.senderPublicKey
14481453 case _ =>
14491454 throw("Match error")
14501455 }
14511456 match tx {
14521457 case order: Order =>
14531458 let matcherPub = getMatcherPubOrFail()
14541459 let orderValid = validateMatcherOrderAllowed(order)
14551460 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
14561461 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
14571462 if (if (if (orderValid)
14581463 then senderValid
14591464 else false)
14601465 then matcherValid
14611466 else false)
14621467 then true
14631468 else throwOrderError(orderValid, senderValid, matcherValid)
14641469 case s: SetScriptTransaction =>
14651470 let newHash = blake2b256(value(s.script))
14661471 let allowedHash = fromBase64String(value(getString(factoryContract, keyAllowedLpScriptHash())))
14671472 let currentHash = scriptHash(this)
14681473 if (if ((allowedHash == newHash))
14691474 then (currentHash != newHash)
14701475 else false)
14711476 then true
14721477 else sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
14731478 case _ =>
14741479 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
14751480 }
14761481 }
14771482

github/deemru/w8io/026f985 
220.44 ms