tx · DR97rVALMKjHvxriJ24zcaQuVY7HD9jfEgL2ec1pg4z3

3N1dMZiRHyPfV3HE1UP73tMqZyrajT8s7Gd:  -0.03500000 Waves

2022.12.07 16:37 [2349987] smart account 3N1dMZiRHyPfV3HE1UP73tMqZyrajT8s7Gd > SELF 0.00000000 Waves

{ "type": 13, "id": "DR97rVALMKjHvxriJ24zcaQuVY7HD9jfEgL2ec1pg4z3", "fee": 3500000, "feeAssetId": null, "timestamp": 1670420350771, "version": 1, "sender": "3N1dMZiRHyPfV3HE1UP73tMqZyrajT8s7Gd", "senderPublicKey": "5nXNn4nUrku3ormf7LVLKqY9doTY1LZWZ3uDiDHre72C", "proofs": [ "3Z7GnMEXjBVDyDxbVa5TVCr2CJ7FwqXf9ZViHikYC1ngaQjcg1Ph9nKJj4AayDnijg8kCX3ovuFDaP5APmd82V5Q" ], "script": "base64:BgLYLAgCEgMKAQgSABIECgIBBBIDCgEBEgQKAgEEEgQKAggBEgQKAggBEgQKAggBEgUKAwEIARIAEgQKAgEBEgMKAQESBQoDAQEBEgQKAggIEgASABIDCgEIEgUKAwEBARIECgIBARIECgIIARIECgIICBILCgkIAQECAQIIBAQSBgoECAgBCBIAEgMKAQESAwoBARIECgIIASIKbFBkZWNpbWFscyIGc2NhbGU4IgxzY2FsZThCaWdJbnQiB3NjYWxlMTgiCnplcm9CaWdJbnQiBGJpZzAiBGJpZzEiBGJpZzIiC3dhdmVzU3RyaW5nIgNTRVAiClBvb2xBY3RpdmUiD1Bvb2xQdXREaXNhYmxlZCITUG9vbE1hdGNoZXJEaXNhYmxlZCIMUG9vbFNodXRkb3duIg5pZHhQb29sQWRkcmVzcyINaWR4UG9vbFN0YXR1cyIQaWR4UG9vbExQQXNzZXRJZCINaWR4QW10QXNzZXRJZCIPaWR4UHJpY2VBc3NldElkIg5pZHhBbXRBc3NldERjbSIQaWR4UHJpY2VBc3NldERjbSIOaWR4SUFtdEFzc2V0SWQiEGlkeElQcmljZUFzc2V0SWQiDWlkeExQ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BBQJhQgMJAAECBQJkSwIUU2V0U2NyaXB0VHJhbnNhY3Rpb24EAmVOBQJkSwQCZ0IJAPYDAQkBBXZhbHVlAQgFAmVOBnNjcmlwdAQCZ0MJANsEAQkBBXZhbHVlAQkAnQgCBQJhSgkBAmF3AAQCZ0QJAPEHAQUEdGhpcwMDCQAAAgUCZ0MFAmdCCQECIT0CBQJnRAUCZ0IHBgkA9AMDCAUCZ3gJYm9keUJ5dGVzCQCRAwIIBQJneAZwcm9vZnMAAAUCZ3oJAPQDAwgFAmd4CWJvZHlCeXRlcwkAkQMCCAUCZ3gGcHJvb2ZzAAAFAmd6mxUTAw==", "chainId": 84, "height": 2349987, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CrvQTp4zXfh3qWoLSXnnBXeuxL7WaB2DdWrkNWg2qXuR Next: CScqdkDmcijfjEP7KShS1ydSAwwbpXbG6JDSb6Qq8ck Diff:
OldNewDifferences
230230 else assetBalance(this, fromBase58String(assetId))
231231
232232
233-func calcPriceBigInt (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18, HALFUP)
233+func calcPriceBigInt (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18)
234234
235235
236236 func privateCalcPrice (amAssetDcm,prAssetDcm,amAmt,prAmt) = {
408408 func validateMatcherOrderAllowed (order) = {
409409 let amountAssetAmount = order.amount
410410 let priceAssetAmount = fraction(order.amount, order.price, scale8, FLOOR)
411- let $t02036720579 = if ((order.orderType == Buy))
411+ let $t02035920571 = if ((order.orderType == Buy))
412412 then $Tuple2(amountAssetAmount, -(priceAssetAmount))
413413 else $Tuple2(-(amountAssetAmount), priceAssetAmount)
414- let amountAssetBalanceDelta = $t02036720579._1
415- let priceAssetBalanceDelta = $t02036720579._2
414+ let amountAssetBalanceDelta = $t02035920571._1
415+ let priceAssetBalanceDelta = $t02035920571._2
416416 if (if (if (isGlobalShutdown())
417417 then true
418418 else (cfgPoolStatus == PoolMatcherDisabled))
425425 then throw("Wrong order assets.")
426426 else {
427427 let kLp = valueOrErrorMessage(parseBigInt(valueOrErrorMessage(getString(this, keyKLp), fmtErr("kLp is required"))), fmtErr("invalid kLp"))
428- let $t02105021150 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
429- let unusedActions = $t02105021150._1
430- let kLpNew = $t02105021150._2
428+ let $t02104221142 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
429+ let unusedActions = $t02104221142._1
430+ let kLpNew = $t02104221142._2
431431 let isOrderValid = (kLpNew >= kLp)
432432 isOrderValid
433433 }
503503 else if ((paymentAssetId == cfgPriceAssetId))
504504 then false
505505 else throwErr("invalid asset")
506- let $t02383524128 = if (isEval)
506+ let $t02382724120 = if (isEval)
507507 then $Tuple2(amountBalanceRaw, priceBalanceRaw)
508508 else if (paymentInAmountAsset)
509509 then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw)
510510 else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw))
511- let amountBalanceOld = $t02383524128._1
512- let priceBalanceOld = $t02383524128._2
513- let $t02413224281 = if (paymentInAmountAsset)
511+ let amountBalanceOld = $t02382724120._1
512+ let priceBalanceOld = $t02382724120._2
513+ let $t02412424273 = if (paymentInAmountAsset)
514514 then $Tuple2(paymentAmountRaw, 0)
515515 else $Tuple2(0, paymentAmountRaw)
516- let amountAssetAmountRaw = $t02413224281._1
517- let priceAssetAmountRaw = $t02413224281._2
516+ let amountAssetAmountRaw = $t02412424273._1
517+ let priceAssetAmountRaw = $t02412424273._2
518518 let amountAssetAmount = takeFee(amountAssetAmountRaw)._1
519519 let priceAssetAmount = takeFee(priceAssetAmountRaw)._1
520- let $t02440324462 = takeFee(paymentAmountRaw)
521- let paymentAmount = $t02440324462._1
522- let feeAmount = $t02440324462._2
520+ let $t02439524454 = takeFee(paymentAmountRaw)
521+ let paymentAmount = $t02439524454._1
522+ let feeAmount = $t02439524454._2
523523 let amountBalanceNew = (amountBalanceOld + amountAssetAmount)
524524 let priceBalanceNew = (priceBalanceOld + priceAssetAmount)
525525 let priceNewX18 = calcPriceBigInt(toX18(priceBalanceNew, cfgPriceAssetDecimals), toX18(amountBalanceNew, cfgAmountAssetDecimals))
542542 let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, cfgPriceAssetDecimals), toX18(amountBalanceOld, cfgAmountAssetDecimals))
543543 let priceOld = fromX18(priceOldX18, scale8)
544544 let loss = {
545- let $t02593926106 = if (paymentInAmountAsset)
545+ let $t02593126098 = if (paymentInAmountAsset)
546546 then $Tuple2(amountAssetAmountRaw, amountBalanceOld)
547547 else $Tuple2(priceAssetAmountRaw, priceBalanceOld)
548- let amount = $t02593926106._1
549- let balance = $t02593926106._2
548+ let amount = $t02593126098._1
549+ let balance = $t02593126098._2
550550 let issueAmountBoth = toInt(fraction(supplyBigInt, toBigInt((amount / 2)), toBigInt(balance)))
551551 fraction((issueAmount - issueAmountBoth), scale8, issueAmountBoth)
552552 }
580580 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
581581 let redeemedBigInt = toBigInt(paymentAmount)
582582 let amountRaw = max([0, toInt(((balanceBigInt * (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN))) / scale18))])
583- let $t02770827758 = takeFee(amountRaw)
584- let totalAmount = $t02770827758._1
585- let feeAmount = $t02770827758._2
586- let $t02776227988 = if (outInAmountAsset)
583+ let $t02770027750 = takeFee(amountRaw)
584+ let totalAmount = $t02770027750._1
585+ let feeAmount = $t02770027750._2
586+ let $t02775427980 = if (outInAmountAsset)
587587 then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld)
588588 else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw))
589- let outAmAmount = $t02776227988._1
590- let outPrAmount = $t02776227988._2
591- let amBalanceNew = $t02776227988._3
592- let prBalanceNew = $t02776227988._4
589+ let outAmAmount = $t02775427980._1
590+ let outPrAmount = $t02775427980._2
591+ let amBalanceNew = $t02775427980._3
592+ let prBalanceNew = $t02775427980._4
593593 let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, cfgPriceAssetDecimals), toX18(amBalanceNew, cfgAmountAssetDecimals))
594594 let priceNew = fromX18(priceNewX18, scale8)
595595 let commonState = if (isEval)
735735 else throw("Strict value is not equal to itself.")
736736 }
737737 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
738- let $t03251632978 = refreshKLpInternal(0, 0, 0)
739- if (($t03251632978 == $t03251632978))
738+ let $t03250832970 = refreshKLpInternal(0, 0, 0)
739+ if (($t03250832970 == $t03250832970))
740740 then {
741- let updatedKLp = $t03251632978._2
742- let refreshKLpActions = $t03251632978._1
741+ let updatedKLp = $t03250832970._2
742+ let refreshKLpActions = $t03250832970._1
743743 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
744744 if ((isUpdatedKLpValid == isUpdatedKLpValid))
745745 then ((state ++ lpTransfer) ++ refreshKLpActions)
771771 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
772772 if ((currentKLp == currentKLp))
773773 then {
774- let $t03354033605 = refreshKLpInternal(0, 0, 0)
775- let refreshKLpActions = $t03354033605._1
776- let updatedKLp = $t03354033605._2
774+ let $t03353233597 = refreshKLpInternal(0, 0, 0)
775+ let refreshKLpActions = $t03353233597._1
776+ let updatedKLp = $t03353233597._2
777777 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
778778 if ((isUpdatedKLpValid == isUpdatedKLpValid))
779779 then (state ++ refreshKLpActions)
818818 else throwErr("payment asset is not supported")
819819 let userAddress = i.caller
820820 let txId = i.transactionId
821- let $t03479034942 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
822- if (($t03479034942 == $t03479034942))
821+ let $t03478234934 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
822+ if (($t03478234934 == $t03478234934))
823823 then {
824- let paymentInAmountAsset = $t03479034942._5
825- let bonus = $t03479034942._4
826- let feeAmount = $t03479034942._3
827- let commonState = $t03479034942._2
828- let emitAmountEstimated = $t03479034942._1
824+ let paymentInAmountAsset = $t03478234934._5
825+ let bonus = $t03478234934._4
826+ let feeAmount = $t03478234934._3
827+ let commonState = $t03478234934._2
828+ let emitAmountEstimated = $t03478234934._1
829829 let emitAmount = if (if ((minOutAmount > 0))
830830 then (minOutAmount > emitAmountEstimated)
831831 else false)
845845 let sendFee = if ((feeAmount > 0))
846846 then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
847847 else nil
848- let $t03552835725 = if ((this == feeCollectorAddress))
848+ let $t03552035717 = if ((this == feeCollectorAddress))
849849 then $Tuple2(0, 0)
850850 else if (paymentInAmountAsset)
851851 then $Tuple2(-(feeAmount), 0)
852852 else $Tuple2(0, -(feeAmount))
853- let amountAssetBalanceDelta = $t03552835725._1
854- let priceAssetBalanceDelta = $t03552835725._2
855- let $t03572835836 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
856- let refreshKLpActions = $t03572835836._1
857- let updatedKLp = $t03572835836._2
853+ let amountAssetBalanceDelta = $t03552035717._1
854+ let priceAssetBalanceDelta = $t03552035717._2
855+ let $t03572035828 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
856+ let refreshKLpActions = $t03572035828._1
857+ let updatedKLp = $t03572035828._2
858858 let kLp = value(getString(keyKLp))
859859 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
860860 if ((isUpdatedKLpValid == isUpdatedKLpValid))
872872
873873 @Callable(i)
874874 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
875- let $t03614236299 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
876- let emitAmountEstimated = $t03614236299._1
877- let commonState = $t03614236299._2
878- let feeAmount = $t03614236299._3
879- let bonus = $t03614236299._4
880- let paymentInAmountAsset = $t03614236299._5
875+ let $t03613436291 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
876+ let emitAmountEstimated = $t03613436291._1
877+ let commonState = $t03613436291._2
878+ let feeAmount = $t03613436291._3
879+ let bonus = $t03613436291._4
880+ let paymentInAmountAsset = $t03613436291._5
881881 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
882882 }
883883
912912 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(paymentAmount))
913913 let userAddress = i.caller
914914 let txId = i.transactionId
915- let $t03719337346 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
916- if (($t03719337346 == $t03719337346))
915+ let $t03718537338 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
916+ if (($t03718537338 == $t03718537338))
917917 then {
918- let outInAmountAsset = $t03719337346._5
919- let bonus = $t03719337346._4
920- let feeAmount = $t03719337346._3
921- let commonState = $t03719337346._2
922- let amountEstimated = $t03719337346._1
918+ let outInAmountAsset = $t03718537338._5
919+ let bonus = $t03718537338._4
920+ let feeAmount = $t03718537338._3
921+ let commonState = $t03718537338._2
922+ let amountEstimated = $t03718537338._1
923923 let amount = if (if ((minOutAmount > 0))
924924 then (minOutAmount > amountEstimated)
925925 else false)
932932 let sendFee = if ((feeAmount > 0))
933933 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
934934 else nil
935- let $t03784638093 = {
935+ let $t03783838085 = {
936936 let feeAmountForCalc = if ((this == feeCollectorAddress))
937937 then 0
938938 else feeAmount
940940 then $Tuple2(-((amount + feeAmountForCalc)), 0)
941941 else $Tuple2(0, -((amount + feeAmountForCalc)))
942942 }
943- let amountAssetBalanceDelta = $t03784638093._1
944- let priceAssetBalanceDelta = $t03784638093._2
945- let $t03809638204 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
946- let refreshKLpActions = $t03809638204._1
947- let updatedKLp = $t03809638204._2
943+ let amountAssetBalanceDelta = $t03783838085._1
944+ let priceAssetBalanceDelta = $t03783838085._2
945+ let $t03808838196 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
946+ let refreshKLpActions = $t03808838196._1
947+ let updatedKLp = $t03808838196._2
948948 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
949949 if ((isUpdatedKLpValid == isUpdatedKLpValid))
950950 then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
961961
962962 @Callable(i)
963963 func getOneTknREADONLY (outAssetId,paymentAmount) = {
964- let $t03846138617 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
965- let amountEstimated = $t03846138617._1
966- let commonState = $t03846138617._2
967- let feeAmount = $t03846138617._3
968- let bonus = $t03846138617._4
969- let outInAmountAsset = $t03846138617._5
964+ let $t03845338609 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
965+ let amountEstimated = $t03845338609._1
966+ let commonState = $t03845338609._2
967+ let feeAmount = $t03845338609._3
968+ let bonus = $t03845338609._4
969+ let outInAmountAsset = $t03845338609._5
970970 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
971971 }
972972
10011001 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
10021002 if ((unstakeInv == unstakeInv))
10031003 then {
1004- let $t03951939670 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1005- if (($t03951939670 == $t03951939670))
1004+ let $t03951139662 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1005+ if (($t03951139662 == $t03951139662))
10061006 then {
1007- let outInAmountAsset = $t03951939670._5
1008- let bonus = $t03951939670._4
1009- let feeAmount = $t03951939670._3
1010- let commonState = $t03951939670._2
1011- let amountEstimated = $t03951939670._1
1007+ let outInAmountAsset = $t03951139662._5
1008+ let bonus = $t03951139662._4
1009+ let feeAmount = $t03951139662._3
1010+ let commonState = $t03951139662._2
1011+ let amountEstimated = $t03951139662._1
10121012 let amount = if (if ((minOutAmount > 0))
10131013 then (minOutAmount > amountEstimated)
10141014 else false)
10211021 let sendFee = if ((feeAmount > 0))
10221022 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
10231023 else nil
1024- let $t04016540412 = {
1024+ let $t04015740404 = {
10251025 let feeAmountForCalc = if ((this == feeCollectorAddress))
10261026 then 0
10271027 else feeAmount
10291029 then $Tuple2(-((amount + feeAmountForCalc)), 0)
10301030 else $Tuple2(0, -((amount + feeAmountForCalc)))
10311031 }
1032- let amountAssetBalanceDelta = $t04016540412._1
1033- let priceAssetBalanceDelta = $t04016540412._2
1034- let $t04041540523 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1035- let refreshKLpActions = $t04041540523._1
1036- let updatedKLp = $t04041540523._2
1032+ let amountAssetBalanceDelta = $t04015740404._1
1033+ let priceAssetBalanceDelta = $t04015740404._2
1034+ let $t04040740515 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1035+ let refreshKLpActions = $t04040740515._1
1036+ let updatedKLp = $t04040740515._2
10371037 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10381038 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10391039 then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
10621062 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
10631063 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
10641064 then {
1065- let $t04147141553 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1066- let refreshKLpActions = $t04147141553._1
1067- let updatedKLp = $t04147141553._2
1065+ let $t04146341545 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1066+ let refreshKLpActions = $t04146341545._1
1067+ let updatedKLp = $t04146341545._2
10681068 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10691069 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10701070 then (state ++ refreshKLpActions)
10921092 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
10931093 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
10941094 then {
1095- let $t04250442585 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1096- let refreshKLpActions = $t04250442585._1
1097- let updatedKLp = $t04250442585._2
1095+ let $t04249642577 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1096+ let refreshKLpActions = $t04249642577._1
1097+ let updatedKLp = $t04249642577._2
10981098 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10991099 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11001100 then (state ++ refreshKLpActions)
11341134 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
11351135 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
11361136 then {
1137- let $t04370843789 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1138- let refreshKLpActions = $t04370843789._1
1139- let updatedKLp = $t04370843789._2
1137+ let $t04370043781 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1138+ let refreshKLpActions = $t04370043781._1
1139+ let updatedKLp = $t04370043781._2
11401140 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11411141 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11421142 then (state ++ refreshKLpActions)
11831183 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
11841184 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
11851185 then {
1186- let $t04508145162 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1187- let refreshKLpActions = $t04508145162._1
1188- let updatedKLp = $t04508145162._2
1186+ let $t04507345154 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1187+ let refreshKLpActions = $t04507345154._1
1188+ let updatedKLp = $t04507345154._2
11891189 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11901190 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11911191 then (state ++ refreshKLpActions)
12181218 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
12191219 then {
12201220 let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
1221- let $t04634946413 = refreshKLpInternal(0, 0, 0)
1222- let kLpUpdateActions = $t04634946413._1
1223- let updatedKLp = $t04634946413._2
1221+ let $t04634146405 = refreshKLpInternal(0, 0, 0)
1222+ let kLpUpdateActions = $t04634146405._1
1223+ let updatedKLp = $t04634146405._2
12241224 let actions = if ((kLp != updatedKLp))
12251225 then kLpUpdateActions
12261226 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))
6363
6464
6565 func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), scale18))
6666
6767
6868 func toScale (amt,resScale,curScale) = fraction(amt, resScale, curScale)
6969
7070
7171 func abs (val) = if ((0 > val))
7272 then -(val)
7373 else val
7474
7575
7676 func absBigInt (val) = if ((zeroBigInt > val))
7777 then -(val)
7878 else val
7979
8080
8181 func fc () = "%s__factoryContract"
8282
8383
8484 func mpk () = "%s__managerPublicKey"
8585
8686
8787 func pmpk () = "%s__pendingManagerPublicKey"
8888
8989
9090 func pl () = "%s%s__price__last"
9191
9292
9393 func ph (h,timestamp) = makeString(["%s%s%d%d__price__history", toString(h), toString(timestamp)], SEP)
9494
9595
9696 func pau (userAddress,txId) = ((("%s%s%s__P__" + userAddress) + "__") + txId)
9797
9898
9999 func gau (userAddress,txId) = ((("%s%s%s__G__" + userAddress) + "__") + txId)
100100
101101
102102 func aa () = "%s__amountAsset"
103103
104104
105105 func pa () = "%s__priceAsset"
106106
107107
108108 let keyFee = "%s__fee"
109109
110110 let feeDefault = fraction(10, scale8, 10000)
111111
112112 let fee = valueOrElse(getInteger(this, keyFee), feeDefault)
113113
114114 let keyKLp = makeString(["%s", "kLp"], SEP)
115115
116116 let keyKLpRefreshedHeight = makeString(["%s", "kLpRefreshedHeight"], SEP)
117117
118118 let keyKLpRefreshDelay = makeString(["%s", "refreshKLpDelay"], SEP)
119119
120120 let kLpRefreshDelayDefault = 30
121121
122122 let kLpRefreshDelay = valueOrElse(getInteger(this, keyKLpRefreshDelay), kLpRefreshDelayDefault)
123123
124124 func keyFactoryConfig () = "%s__factoryConfig"
125125
126126
127127 func keyMatcherPub () = "%s%s__matcher__publicKey"
128128
129129
130130 func keyMappingPoolContractAddressToPoolAssets (poolContractAddress) = (("%s%s%s__" + poolContractAddress) + "__mappings__poolContract2LpAsset")
131131
132132
133133 func keyPoolConfig (iAmtAsset,iPriceAsset) = (((("%d%d%s__" + iAmtAsset) + "__") + iPriceAsset) + "__config")
134134
135135
136136 func keyMappingsBaseAsset2internalId (baseAssetStr) = ("%s%s%s__mappings__baseAsset2internalId__" + baseAssetStr)
137137
138138
139139 func keyAllPoolsShutdown () = "%s__shutdown"
140140
141141
142142 func keyPoolWeight (contractAddress) = ("%s%s__poolWeight__" + contractAddress)
143143
144144
145145 func keyAllowedLpScriptHash () = "%s__allowedLpScriptHash"
146146
147147
148148 let keyFeeCollectorAddress = "%s__feeCollectorAddress"
149149
150150 func throwOrderError (orderValid,senderValid,matcherValid) = throw(((((("order validation failed: orderValid=" + toString(orderValid)) + " senderValid=") + toString(senderValid)) + " matcherValid=") + toString(matcherValid)))
151151
152152
153153 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
154154
155155
156156 func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
157157
158158
159159 func throwErr (msg) = throw(makeString(["lp.ride:", msg], " "))
160160
161161
162162 func fmtErr (msg) = makeString(["lp.ride:", msg], " ")
163163
164164
165165 let factoryContract = addressFromStringValue(getStringOrFail(this, fc()))
166166
167167 let feeCollectorAddress = addressFromStringValue(getStringOrFail(factoryContract, keyFeeCollectorAddress))
168168
169169 func isGlobalShutdown () = valueOrElse(getBoolean(factoryContract, keyAllPoolsShutdown()), false)
170170
171171
172172 func getMatcherPubOrFail () = fromBase58String(getStringOrFail(factoryContract, keyMatcherPub()))
173173
174174
175175 func getPoolConfig () = {
176176 let amtAsset = getStringOrFail(this, aa())
177177 let priceAsset = getStringOrFail(this, pa())
178178 let iPriceAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(priceAsset))
179179 let iAmtAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(amtAsset))
180180 split(getStringOrFail(factoryContract, keyPoolConfig(toString(iAmtAsset), toString(iPriceAsset))), SEP)
181181 }
182182
183183
184184 func parseAssetId (input) = if ((input == wavesString))
185185 then unit
186186 else fromBase58String(input)
187187
188188
189189 func assetIdToString (input) = if ((input == unit))
190190 then wavesString
191191 else toBase58String(value(input))
192192
193193
194194 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]))
195195
196196
197197 let poolConfigParsed = parsePoolConfig(getPoolConfig())
198198
199199 let $t079158081 = poolConfigParsed
200200
201201 let cfgPoolAddress = $t079158081._1
202202
203203 let cfgPoolStatus = $t079158081._2
204204
205205 let cfgLpAssetId = $t079158081._3
206206
207207 let cfgAmountAssetId = $t079158081._4
208208
209209 let cfgPriceAssetId = $t079158081._5
210210
211211 let cfgAmountAssetDecimals = $t079158081._6
212212
213213 let cfgPriceAssetDecimals = $t079158081._7
214214
215215 func getFactoryConfig () = split(getStringOrFail(factoryContract, keyFactoryConfig()), SEP)
216216
217217
218218 let stakingContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactoryStakingContract]), "incorrect staking address")
219219
220220 let slippageContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactorySlippageContract]), "incorrect staking address")
221221
222222 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)
223223
224224
225225 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)
226226
227227
228228 func getAccBalance (assetId) = if ((assetId == "WAVES"))
229229 then wavesBalance(this).available
230230 else assetBalance(this, fromBase58String(assetId))
231231
232232
233-func calcPriceBigInt (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18, HALFUP)
233+func calcPriceBigInt (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18)
234234
235235
236236 func privateCalcPrice (amAssetDcm,prAssetDcm,amAmt,prAmt) = {
237237 let amtAssetAmtX18 = toX18(amAmt, amAssetDcm)
238238 let priceAssetAmtX18 = toX18(prAmt, prAssetDcm)
239239 calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
240240 }
241241
242242
243243 func calcPrices (amAmt,prAmt,lpAmt) = {
244244 let cfg = getPoolConfig()
245245 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
246246 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
247247 let priceX18 = privateCalcPrice(amtAssetDcm, priceAssetDcm, amAmt, prAmt)
248248 let amAmtX18 = toX18(amAmt, amtAssetDcm)
249249 let prAmtX18 = toX18(prAmt, priceAssetDcm)
250250 let lpAmtX18 = toX18(lpAmt, scale8)
251251 let lpPriceInAmAssetX18 = calcPriceBigInt(amAmtX18, lpAmtX18)
252252 let lpPriceInPrAssetX18 = calcPriceBigInt(prAmtX18, lpAmtX18)
253253 [priceX18, lpPriceInAmAssetX18, lpPriceInPrAssetX18]
254254 }
255255
256256
257257 func calculatePrices (amAmt,prAmt,lpAmt) = {
258258 let prices = calcPrices(amAmt, prAmt, lpAmt)
259259 [fromX18(prices[0], scale8), fromX18(prices[1], scale8), fromX18(prices[2], scale8)]
260260 }
261261
262262
263263 func estimateGetOperation (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
264264 let cfg = getPoolConfig()
265265 let lpAssetId = cfg[idxPoolLPAssetId]
266266 let amAssetId = cfg[idxAmtAssetId]
267267 let prAssetId = cfg[idxPriceAssetId]
268268 let amAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
269269 let prAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
270270 let poolStatus = cfg[idxPoolStatus]
271271 let lpEmission = valueOrErrorMessage(assetInfo(fromBase58String(lpAssetId)), (("Asset " + lpAssetId) + " doesn't exist")).quantity
272272 if ((lpAssetId != pmtAssetId))
273273 then throw("Invalid asset passed.")
274274 else {
275275 let amBalance = getAccBalance(amAssetId)
276276 let amBalanceX18 = toX18(amBalance, amAssetDcm)
277277 let prBalance = getAccBalance(prAssetId)
278278 let prBalanceX18 = toX18(prBalance, prAssetDcm)
279279 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
280280 let curPrice = fromX18(curPriceX18, scale8)
281281 let pmtLpAmtX18 = toX18(pmtLpAmt, scale8)
282282 let lpEmissionX18 = toX18(lpEmission, scale8)
283283 let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissionX18)
284284 let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissionX18)
285285 let outAmAmt = fromX18(outAmAmtX18, amAssetDcm)
286286 let outPrAmt = fromX18(outPrAmtX18, prAssetDcm)
287287 let state = if ((txId58 == ""))
288288 then nil
289289 else [ScriptTransfer(userAddress, outAmAmt, if ((amAssetId == "WAVES"))
290290 then unit
291291 else fromBase58String(amAssetId)), ScriptTransfer(userAddress, outPrAmt, if ((prAssetId == "WAVES"))
292292 then unit
293293 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)]
294294 $Tuple10(outAmAmt, outPrAmt, amAssetId, prAssetId, amBalance, prBalance, lpEmission, curPriceX18, poolStatus, state)
295295 }
296296 }
297297
298298
299299 func estimatePutOperation (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = {
300300 let cfg = getPoolConfig()
301301 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
302302 let amAssetIdStr = cfg[idxAmtAssetId]
303303 let prAssetIdStr = cfg[idxPriceAssetId]
304304 let iAmtAssetId = cfg[idxIAmtAssetId]
305305 let iPriceAssetId = cfg[idxIPriceAssetId]
306306 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
307307 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
308308 let poolStatus = cfg[idxPoolStatus]
309309 let lpEmission = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
310310 let inAmAssetIdStr = toBase58String(valueOrElse(inAmAssetId, fromBase58String("WAVES")))
311311 let inPrAssetIdStr = toBase58String(valueOrElse(inPrAssetId, fromBase58String("WAVES")))
312312 if (if ((amAssetIdStr != inAmAssetIdStr))
313313 then true
314314 else (prAssetIdStr != inPrAssetIdStr))
315315 then throw("Invalid amt or price asset passed.")
316316 else {
317317 let amBalance = if (isEvaluate)
318318 then getAccBalance(amAssetIdStr)
319319 else (getAccBalance(amAssetIdStr) - inAmAssetAmt)
320320 let prBalance = if (isEvaluate)
321321 then getAccBalance(prAssetIdStr)
322322 else (getAccBalance(prAssetIdStr) - inPrAssetAmt)
323323 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
324324 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
325325 let userPriceX18 = calcPriceBigInt(inPrAssetAmtX18, inAmAssetAmtX18)
326326 let amBalanceX18 = toX18(amBalance, amtAssetDcm)
327327 let prBalanceX18 = toX18(prBalance, priceAssetDcm)
328328 let res = if ((lpEmission == 0))
329329 then {
330330 let curPriceX18 = zeroBigInt
331331 let slippageX18 = zeroBigInt
332332 let lpAmtX18 = pow((inAmAssetAmtX18 * inPrAssetAmtX18), 0, toBigInt(5), 1, 0, DOWN)
333333 $Tuple5(fromX18(lpAmtX18, scale8), fromX18(inAmAssetAmtX18, amtAssetDcm), fromX18(inPrAssetAmtX18, priceAssetDcm), calcPriceBigInt((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18)
334334 }
335335 else {
336336 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
337337 let slippageX18 = fraction(absBigInt((curPriceX18 - userPriceX18)), scale18, curPriceX18)
338338 let slippageToleranceX18 = toX18(slippageTolerance, scale8)
339339 if (if ((curPriceX18 != zeroBigInt))
340340 then (slippageX18 > slippageToleranceX18)
341341 else false)
342342 then throw(((("Price slippage " + toString(slippageX18)) + " exceeded the passed limit of ") + toString(slippageToleranceX18)))
343343 else {
344344 let lpEmissionX18 = toX18(lpEmission, scale8)
345345 let prViaAmX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18, CEILING)
346346 let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18, CEILING)
347347 let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18))
348348 then $Tuple2(amViaPrX18, inPrAssetAmtX18)
349349 else $Tuple2(inAmAssetAmtX18, prViaAmX18)
350350 let expAmtAssetAmtX18 = expectedAmts._1
351351 let expPriceAssetAmtX18 = expectedAmts._2
352352 let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18)
353353 $Tuple5(fromX18(lpAmtX18, scale8), fromX18(expAmtAssetAmtX18, amtAssetDcm), fromX18(expPriceAssetAmtX18, priceAssetDcm), curPriceX18, slippageX18)
354354 }
355355 }
356356 let calcLpAmt = res._1
357357 let calcAmAssetPmt = res._2
358358 let calcPrAssetPmt = res._3
359359 let curPrice = fromX18(res._4, scale8)
360360 let slippageCalc = fromX18(res._5, scale8)
361361 if ((0 >= calcLpAmt))
362362 then throw("Invalid calculations. LP calculated is less than zero.")
363363 else {
364364 let emitLpAmt = if (!(emitLp))
365365 then 0
366366 else calcLpAmt
367367 let amDiff = (inAmAssetAmt - calcAmAssetPmt)
368368 let prDiff = (inPrAssetAmt - calcPrAssetPmt)
369369 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))]
370370 $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEmission, lpAssetId, poolStatus, commonState, amDiff, prDiff, inAmAssetId, inPrAssetId)
371371 }
372372 }
373373 }
374374
375375
376376 func calcKLp (amountBalance,priceBalance,lpEmission) = {
377377 let updatedKLp = fraction(pow((amountBalance * priceBalance), 0, toBigInt(5), 1, 18, DOWN), big1, lpEmission)
378378 if ((lpEmission == big0))
379379 then big0
380380 else updatedKLp
381381 }
382382
383383
384384 func calcCurrentKLp (amountAssetDelta,priceAssetDelta,lpAssetEmissionDelta) = {
385385 let amountAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) - amountAssetDelta)
386386 let priceAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) - priceAssetDelta)
387387 let lpAssetEmission = (toBigInt(value(assetInfo(cfgLpAssetId)).quantity) - lpAssetEmissionDelta)
388388 let currentKLp = calcKLp(amountAssetBalance, priceAssetBalance, lpAssetEmission)
389389 currentKLp
390390 }
391391
392392
393393 func refreshKLpInternal (amountAssetBalanceDelta,priceAssetBalanceDelta,lpAssetEmissionDelta) = {
394394 let amountAssetBalance = (getAccBalance(assetIdToString(cfgAmountAssetId)) + amountAssetBalanceDelta)
395395 let priceAssetBalance = (getAccBalance(assetIdToString(cfgPriceAssetId)) + priceAssetBalanceDelta)
396396 let lpAssetEmission = (value(assetInfo(cfgLpAssetId)).quantity + lpAssetEmissionDelta)
397397 let updatedKLp = calcKLp(toBigInt(amountAssetBalance), toBigInt(priceAssetBalance), toBigInt(lpAssetEmission))
398398 let actions = [IntegerEntry(keyKLpRefreshedHeight, height), StringEntry(keyKLp, toString(updatedKLp))]
399399 $Tuple2(actions, updatedKLp)
400400 }
401401
402402
403403 func validateUpdatedKLp (oldKLp,updatedKLp) = if ((updatedKLp >= oldKLp))
404404 then true
405405 else throwErr(makeString(["updated KLp lower than current KLp", toString(oldKLp), toString(updatedKLp)], " "))
406406
407407
408408 func validateMatcherOrderAllowed (order) = {
409409 let amountAssetAmount = order.amount
410410 let priceAssetAmount = fraction(order.amount, order.price, scale8, FLOOR)
411- let $t02036720579 = if ((order.orderType == Buy))
411+ let $t02035920571 = if ((order.orderType == Buy))
412412 then $Tuple2(amountAssetAmount, -(priceAssetAmount))
413413 else $Tuple2(-(amountAssetAmount), priceAssetAmount)
414- let amountAssetBalanceDelta = $t02036720579._1
415- let priceAssetBalanceDelta = $t02036720579._2
414+ let amountAssetBalanceDelta = $t02035920571._1
415+ let priceAssetBalanceDelta = $t02035920571._2
416416 if (if (if (isGlobalShutdown())
417417 then true
418418 else (cfgPoolStatus == PoolMatcherDisabled))
419419 then true
420420 else (cfgPoolStatus == PoolShutdown))
421421 then throw("Exchange operations disabled")
422422 else if (if ((order.assetPair.amountAsset != cfgAmountAssetId))
423423 then true
424424 else (order.assetPair.priceAsset != cfgPriceAssetId))
425425 then throw("Wrong order assets.")
426426 else {
427427 let kLp = valueOrErrorMessage(parseBigInt(valueOrErrorMessage(getString(this, keyKLp), fmtErr("kLp is required"))), fmtErr("invalid kLp"))
428- let $t02105021150 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
429- let unusedActions = $t02105021150._1
430- let kLpNew = $t02105021150._2
428+ let $t02104221142 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
429+ let unusedActions = $t02104221142._1
430+ let kLpNew = $t02104221142._2
431431 let isOrderValid = (kLpNew >= kLp)
432432 isOrderValid
433433 }
434434 }
435435
436436
437437 func commonGet (i) = if ((size(i.payments) != 1))
438438 then throw("exactly 1 payment is expected")
439439 else {
440440 let pmt = value(i.payments[0])
441441 let pmtAssetId = value(pmt.assetId)
442442 let pmtAmt = pmt.amount
443443 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller)
444444 let outAmAmt = res._1
445445 let outPrAmt = res._2
446446 let poolStatus = parseIntValue(res._9)
447447 let state = res._10
448448 if (if (isGlobalShutdown())
449449 then true
450450 else (poolStatus == PoolShutdown))
451451 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
452452 else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state)
453453 }
454454
455455
456456 func commonPut (i,slippageTolerance,emitLp) = if ((size(i.payments) != 2))
457457 then throw("exactly 2 payments are expected")
458458 else {
459459 let amAssetPmt = value(i.payments[0])
460460 let prAssetPmt = value(i.payments[1])
461461 let estPut = estimatePutOperation(toBase58String(i.transactionId), slippageTolerance, amAssetPmt.amount, amAssetPmt.assetId, prAssetPmt.amount, prAssetPmt.assetId, toString(i.caller), false, emitLp)
462462 let poolStatus = parseIntValue(estPut._8)
463463 if (if (if (isGlobalShutdown())
464464 then true
465465 else (poolStatus == PoolPutDisabled))
466466 then true
467467 else (poolStatus == PoolShutdown))
468468 then throw(("Put operation is blocked by admin. Status = " + toString(poolStatus)))
469469 else estPut
470470 }
471471
472472
473473 func emit (amount) = {
474474 let emitInv = invoke(factoryContract, "emit", [amount], nil)
475475 if ((emitInv == emitInv))
476476 then {
477477 let emitInvLegacy = match emitInv {
478478 case legacyFactoryContract: Address =>
479479 invoke(legacyFactoryContract, "emit", [amount], nil)
480480 case _ =>
481481 unit
482482 }
483483 if ((emitInvLegacy == emitInvLegacy))
484484 then amount
485485 else throw("Strict value is not equal to itself.")
486486 }
487487 else throw("Strict value is not equal to itself.")
488488 }
489489
490490
491491 func takeFee (amount) = {
492492 let feeAmount = fraction(amount, fee, scale8)
493493 $Tuple2((amount - feeAmount), feeAmount)
494494 }
495495
496496
497497 func calcPutOneToken (paymentAmountRaw,paymentAssetId,userAddress,txId) = {
498498 let isEval = (txId == unit)
499499 let amountBalanceRaw = getAccBalance(assetIdToString(cfgAmountAssetId))
500500 let priceBalanceRaw = getAccBalance(assetIdToString(cfgPriceAssetId))
501501 let paymentInAmountAsset = if ((paymentAssetId == cfgAmountAssetId))
502502 then true
503503 else if ((paymentAssetId == cfgPriceAssetId))
504504 then false
505505 else throwErr("invalid asset")
506- let $t02383524128 = if (isEval)
506+ let $t02382724120 = if (isEval)
507507 then $Tuple2(amountBalanceRaw, priceBalanceRaw)
508508 else if (paymentInAmountAsset)
509509 then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw)
510510 else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw))
511- let amountBalanceOld = $t02383524128._1
512- let priceBalanceOld = $t02383524128._2
513- let $t02413224281 = if (paymentInAmountAsset)
511+ let amountBalanceOld = $t02382724120._1
512+ let priceBalanceOld = $t02382724120._2
513+ let $t02412424273 = if (paymentInAmountAsset)
514514 then $Tuple2(paymentAmountRaw, 0)
515515 else $Tuple2(0, paymentAmountRaw)
516- let amountAssetAmountRaw = $t02413224281._1
517- let priceAssetAmountRaw = $t02413224281._2
516+ let amountAssetAmountRaw = $t02412424273._1
517+ let priceAssetAmountRaw = $t02412424273._2
518518 let amountAssetAmount = takeFee(amountAssetAmountRaw)._1
519519 let priceAssetAmount = takeFee(priceAssetAmountRaw)._1
520- let $t02440324462 = takeFee(paymentAmountRaw)
521- let paymentAmount = $t02440324462._1
522- let feeAmount = $t02440324462._2
520+ let $t02439524454 = takeFee(paymentAmountRaw)
521+ let paymentAmount = $t02439524454._1
522+ let feeAmount = $t02439524454._2
523523 let amountBalanceNew = (amountBalanceOld + amountAssetAmount)
524524 let priceBalanceNew = (priceBalanceOld + priceAssetAmount)
525525 let priceNewX18 = calcPriceBigInt(toX18(priceBalanceNew, cfgPriceAssetDecimals), toX18(amountBalanceNew, cfgAmountAssetDecimals))
526526 let priceNew = fromX18(priceNewX18, scale8)
527527 let paymentBalance = if (paymentInAmountAsset)
528528 then amountBalanceOld
529529 else priceBalanceOld
530530 let paymentBalanceBigInt = toBigInt(paymentBalance)
531531 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
532532 let chechSupply = if ((supplyBigInt > big0))
533533 then true
534534 else throwErr("initial deposit requires all coins")
535535 if ((chechSupply == chechSupply))
536536 then {
537537 let depositBigInt = toBigInt(paymentAmount)
538538 let issueAmount = max([0, toInt(((supplyBigInt * (sqrtBigInt((scale18 + ((depositBigInt * scale18) / paymentBalanceBigInt)), 18, 18, DOWN) - scale18)) / scale18))])
539539 let commonState = if (isEval)
540540 then nil
541541 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))]
542542 let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, cfgPriceAssetDecimals), toX18(amountBalanceOld, cfgAmountAssetDecimals))
543543 let priceOld = fromX18(priceOldX18, scale8)
544544 let loss = {
545- let $t02593926106 = if (paymentInAmountAsset)
545+ let $t02593126098 = if (paymentInAmountAsset)
546546 then $Tuple2(amountAssetAmountRaw, amountBalanceOld)
547547 else $Tuple2(priceAssetAmountRaw, priceBalanceOld)
548- let amount = $t02593926106._1
549- let balance = $t02593926106._2
548+ let amount = $t02593126098._1
549+ let balance = $t02593126098._2
550550 let issueAmountBoth = toInt(fraction(supplyBigInt, toBigInt((amount / 2)), toBigInt(balance)))
551551 fraction((issueAmount - issueAmountBoth), scale8, issueAmountBoth)
552552 }
553553 $Tuple5(issueAmount, commonState, feeAmount, loss, paymentInAmountAsset)
554554 }
555555 else throw("Strict value is not equal to itself.")
556556 }
557557
558558
559559 func calcGetOneToken (outAssetId,paymentAmount,paymentAssetId,userAddress,txId) = {
560560 let isEval = (txId == unit)
561561 let checks = [if ((paymentAssetId == cfgLpAssetId))
562562 then true
563563 else throwErr("invalid lp asset")]
564564 if ((checks == checks))
565565 then {
566566 let outInAmountAsset = if ((outAssetId == cfgAmountAssetId))
567567 then true
568568 else if ((outAssetId == cfgPriceAssetId))
569569 then false
570570 else throwErr("invalid asset")
571571 let balanceBigInt = if (outInAmountAsset)
572572 then toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId)))
573573 else toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId)))
574574 let amBalanceOld = getAccBalance(assetIdToString(cfgAmountAssetId))
575575 let prBalanceOld = getAccBalance(assetIdToString(cfgPriceAssetId))
576576 let outBalance = if (outInAmountAsset)
577577 then amBalanceOld
578578 else prBalanceOld
579579 let outBalanceBigInt = toBigInt(outBalance)
580580 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
581581 let redeemedBigInt = toBigInt(paymentAmount)
582582 let amountRaw = max([0, toInt(((balanceBigInt * (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN))) / scale18))])
583- let $t02770827758 = takeFee(amountRaw)
584- let totalAmount = $t02770827758._1
585- let feeAmount = $t02770827758._2
586- let $t02776227988 = if (outInAmountAsset)
583+ let $t02770027750 = takeFee(amountRaw)
584+ let totalAmount = $t02770027750._1
585+ let feeAmount = $t02770027750._2
586+ let $t02775427980 = if (outInAmountAsset)
587587 then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld)
588588 else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw))
589- let outAmAmount = $t02776227988._1
590- let outPrAmount = $t02776227988._2
591- let amBalanceNew = $t02776227988._3
592- let prBalanceNew = $t02776227988._4
589+ let outAmAmount = $t02775427980._1
590+ let outPrAmount = $t02775427980._2
591+ let amBalanceNew = $t02775427980._3
592+ let prBalanceNew = $t02775427980._4
593593 let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, cfgPriceAssetDecimals), toX18(amBalanceNew, cfgAmountAssetDecimals))
594594 let priceNew = fromX18(priceNewX18, scale8)
595595 let commonState = if (isEval)
596596 then nil
597597 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)]
598598 let priceOldX18 = calcPriceBigInt(toX18(prBalanceOld, cfgPriceAssetDecimals), toX18(amBalanceOld, cfgAmountAssetDecimals))
599599 let priceOld = fromX18(priceOldX18, scale8)
600600 let loss = {
601601 let amountBothInPaymentAsset = (toInt(fraction(balanceBigInt, redeemedBigInt, supplyBigInt)) * 2)
602602 fraction((totalAmount - amountBothInPaymentAsset), scale8, amountBothInPaymentAsset)
603603 }
604604 $Tuple5(totalAmount, commonState, feeAmount, loss, outInAmountAsset)
605605 }
606606 else throw("Strict value is not equal to itself.")
607607 }
608608
609609
610610 func managerPublicKeyOrUnit () = match getString(mpk()) {
611611 case s: String =>
612612 fromBase58String(s)
613613 case _: Unit =>
614614 unit
615615 case _ =>
616616 throw("Match error")
617617 }
618618
619619
620620 func pendingManagerPublicKeyOrUnit () = match getString(pmpk()) {
621621 case s: String =>
622622 fromBase58String(s)
623623 case _: Unit =>
624624 unit
625625 case _ =>
626626 throw("Match error")
627627 }
628628
629629
630630 func isManager (i) = match managerPublicKeyOrUnit() {
631631 case pk: ByteVector =>
632632 (i.callerPublicKey == pk)
633633 case _: Unit =>
634634 (i.caller == this)
635635 case _ =>
636636 throw("Match error")
637637 }
638638
639639
640640 func mustManager (i) = {
641641 let pd = throw("Permission denied")
642642 match managerPublicKeyOrUnit() {
643643 case pk: ByteVector =>
644644 if ((i.callerPublicKey == pk))
645645 then true
646646 else pd
647647 case _: Unit =>
648648 if ((i.caller == this))
649649 then true
650650 else pd
651651 case _ =>
652652 throw("Match error")
653653 }
654654 }
655655
656656
657657 @Callable(i)
658658 func setManager (pendingManagerPublicKey) = {
659659 let checkCaller = mustManager(i)
660660 if ((checkCaller == checkCaller))
661661 then {
662662 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
663663 if ((checkManagerPublicKey == checkManagerPublicKey))
664664 then [StringEntry(pmpk(), pendingManagerPublicKey)]
665665 else throw("Strict value is not equal to itself.")
666666 }
667667 else throw("Strict value is not equal to itself.")
668668 }
669669
670670
671671
672672 @Callable(i)
673673 func confirmManager () = {
674674 let pm = pendingManagerPublicKeyOrUnit()
675675 let hasPM = if (isDefined(pm))
676676 then true
677677 else throw("No pending manager")
678678 if ((hasPM == hasPM))
679679 then {
680680 let checkPM = if ((i.callerPublicKey == value(pm)))
681681 then true
682682 else throw("You are not pending manager")
683683 if ((checkPM == checkPM))
684684 then [StringEntry(mpk(), toBase58String(value(pm))), DeleteEntry(pmpk())]
685685 else throw("Strict value is not equal to itself.")
686686 }
687687 else throw("Strict value is not equal to itself.")
688688 }
689689
690690
691691
692692 @Callable(i)
693693 func put (slippageTolerance,shouldAutoStake) = if ((0 > slippageTolerance))
694694 then throw("Invalid slippageTolerance passed")
695695 else {
696696 let estPut = commonPut(i, slippageTolerance, true)
697697 let emitLpAmt = estPut._2
698698 let lpAssetId = estPut._7
699699 let state = estPut._9
700700 let amDiff = estPut._10
701701 let prDiff = estPut._11
702702 let amId = estPut._12
703703 let prId = estPut._13
704704 let amAssetPmt = toBigInt(value(i.payments[0]).amount)
705705 let prAssetPmt = toBigInt(value(i.payments[1]).amount)
706706 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
707707 if ((currentKLp == currentKLp))
708708 then {
709709 let emitInv = invoke(factoryContract, "emit", [emitLpAmt], nil)
710710 if ((emitInv == emitInv))
711711 then {
712712 let emitInvLegacy = match emitInv {
713713 case legacyFactoryContract: Address =>
714714 invoke(legacyFactoryContract, "emit", [emitLpAmt], nil)
715715 case _ =>
716716 unit
717717 }
718718 if ((emitInvLegacy == emitInvLegacy))
719719 then {
720720 let slippageAInv = if ((amDiff > 0))
721721 then invoke(slippageContract, "put", nil, [AttachedPayment(amId, amDiff)])
722722 else nil
723723 if ((slippageAInv == slippageAInv))
724724 then {
725725 let slippagePInv = if ((prDiff > 0))
726726 then invoke(slippageContract, "put", nil, [AttachedPayment(prId, prDiff)])
727727 else nil
728728 if ((slippagePInv == slippagePInv))
729729 then {
730730 let lpTransfer = if (shouldAutoStake)
731731 then {
732732 let slpStakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)])
733733 if ((slpStakeInv == slpStakeInv))
734734 then nil
735735 else throw("Strict value is not equal to itself.")
736736 }
737737 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
738- let $t03251632978 = refreshKLpInternal(0, 0, 0)
739- if (($t03251632978 == $t03251632978))
738+ let $t03250832970 = refreshKLpInternal(0, 0, 0)
739+ if (($t03250832970 == $t03250832970))
740740 then {
741- let updatedKLp = $t03251632978._2
742- let refreshKLpActions = $t03251632978._1
741+ let updatedKLp = $t03250832970._2
742+ let refreshKLpActions = $t03250832970._1
743743 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
744744 if ((isUpdatedKLpValid == isUpdatedKLpValid))
745745 then ((state ++ lpTransfer) ++ refreshKLpActions)
746746 else throw("Strict value is not equal to itself.")
747747 }
748748 else throw("Strict value is not equal to itself.")
749749 }
750750 else throw("Strict value is not equal to itself.")
751751 }
752752 else throw("Strict value is not equal to itself.")
753753 }
754754 else throw("Strict value is not equal to itself.")
755755 }
756756 else throw("Strict value is not equal to itself.")
757757 }
758758 else throw("Strict value is not equal to itself.")
759759 }
760760
761761
762762
763763 @Callable(i)
764764 func putForFree (maxSlippage) = if ((0 > maxSlippage))
765765 then throw("Invalid value passed")
766766 else {
767767 let estPut = commonPut(i, maxSlippage, false)
768768 let state = estPut._9
769769 let amAssetPmt = toBigInt(value(i.payments[0]).amount)
770770 let prAssetPmt = toBigInt(value(i.payments[1]).amount)
771771 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
772772 if ((currentKLp == currentKLp))
773773 then {
774- let $t03354033605 = refreshKLpInternal(0, 0, 0)
775- let refreshKLpActions = $t03354033605._1
776- let updatedKLp = $t03354033605._2
774+ let $t03353233597 = refreshKLpInternal(0, 0, 0)
775+ let refreshKLpActions = $t03353233597._1
776+ let updatedKLp = $t03353233597._2
777777 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
778778 if ((isUpdatedKLpValid == isUpdatedKLpValid))
779779 then (state ++ refreshKLpActions)
780780 else throw("Strict value is not equal to itself.")
781781 }
782782 else throw("Strict value is not equal to itself.")
783783 }
784784
785785
786786
787787 @Callable(i)
788788 func putOneTkn (minOutAmount,autoStake) = {
789789 let isPoolOneTokenOperationsDisabled = {
790790 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
791791 if ($isInstanceOf(@, "Boolean"))
792792 then @
793793 else throw(($getType(@) + " couldn't be cast to Boolean"))
794794 }
795795 let isPutDisabled = if (if (if (isGlobalShutdown())
796796 then true
797797 else (cfgPoolStatus == PoolPutDisabled))
798798 then true
799799 else (cfgPoolStatus == PoolShutdown))
800800 then true
801801 else isPoolOneTokenOperationsDisabled
802802 let checks = [if (if (!(isPutDisabled))
803803 then true
804804 else isManager(i))
805805 then true
806806 else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1))
807807 then true
808808 else throwErr("exactly 1 payment are expected")]
809809 if ((checks == checks))
810810 then {
811811 let payment = i.payments[0]
812812 let paymentAssetId = payment.assetId
813813 let paymentAmountRaw = payment.amount
814814 let currentKLp = if ((paymentAssetId == cfgAmountAssetId))
815815 then calcCurrentKLp(toBigInt(paymentAmountRaw), toBigInt(0), toBigInt(0))
816816 else if ((paymentAssetId == cfgPriceAssetId))
817817 then calcCurrentKLp(toBigInt(0), toBigInt(paymentAmountRaw), toBigInt(0))
818818 else throwErr("payment asset is not supported")
819819 let userAddress = i.caller
820820 let txId = i.transactionId
821- let $t03479034942 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
822- if (($t03479034942 == $t03479034942))
821+ let $t03478234934 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
822+ if (($t03478234934 == $t03478234934))
823823 then {
824- let paymentInAmountAsset = $t03479034942._5
825- let bonus = $t03479034942._4
826- let feeAmount = $t03479034942._3
827- let commonState = $t03479034942._2
828- let emitAmountEstimated = $t03479034942._1
824+ let paymentInAmountAsset = $t03478234934._5
825+ let bonus = $t03478234934._4
826+ let feeAmount = $t03478234934._3
827+ let commonState = $t03478234934._2
828+ let emitAmountEstimated = $t03478234934._1
829829 let emitAmount = if (if ((minOutAmount > 0))
830830 then (minOutAmount > emitAmountEstimated)
831831 else false)
832832 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
833833 else emitAmountEstimated
834834 let emitInv = emit(emitAmount)
835835 if ((emitInv == emitInv))
836836 then {
837837 let lpTransfer = if (autoStake)
838838 then {
839839 let stakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(cfgLpAssetId, emitAmount)])
840840 if ((stakeInv == stakeInv))
841841 then nil
842842 else throw("Strict value is not equal to itself.")
843843 }
844844 else [ScriptTransfer(i.caller, emitAmount, cfgLpAssetId)]
845845 let sendFee = if ((feeAmount > 0))
846846 then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
847847 else nil
848- let $t03552835725 = if ((this == feeCollectorAddress))
848+ let $t03552035717 = if ((this == feeCollectorAddress))
849849 then $Tuple2(0, 0)
850850 else if (paymentInAmountAsset)
851851 then $Tuple2(-(feeAmount), 0)
852852 else $Tuple2(0, -(feeAmount))
853- let amountAssetBalanceDelta = $t03552835725._1
854- let priceAssetBalanceDelta = $t03552835725._2
855- let $t03572835836 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
856- let refreshKLpActions = $t03572835836._1
857- let updatedKLp = $t03572835836._2
853+ let amountAssetBalanceDelta = $t03552035717._1
854+ let priceAssetBalanceDelta = $t03552035717._2
855+ let $t03572035828 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
856+ let refreshKLpActions = $t03572035828._1
857+ let updatedKLp = $t03572035828._2
858858 let kLp = value(getString(keyKLp))
859859 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
860860 if ((isUpdatedKLpValid == isUpdatedKLpValid))
861861 then $Tuple2((((commonState ++ lpTransfer) ++ sendFee) ++ refreshKLpActions), emitAmount)
862862 else throw("Strict value is not equal to itself.")
863863 }
864864 else throw("Strict value is not equal to itself.")
865865 }
866866 else throw("Strict value is not equal to itself.")
867867 }
868868 else throw("Strict value is not equal to itself.")
869869 }
870870
871871
872872
873873 @Callable(i)
874874 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
875- let $t03614236299 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
876- let emitAmountEstimated = $t03614236299._1
877- let commonState = $t03614236299._2
878- let feeAmount = $t03614236299._3
879- let bonus = $t03614236299._4
880- let paymentInAmountAsset = $t03614236299._5
875+ let $t03613436291 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
876+ let emitAmountEstimated = $t03613436291._1
877+ let commonState = $t03613436291._2
878+ let feeAmount = $t03613436291._3
879+ let bonus = $t03613436291._4
880+ let paymentInAmountAsset = $t03613436291._5
881881 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
882882 }
883883
884884
885885
886886 @Callable(i)
887887 func getOneTkn (outAssetIdStr,minOutAmount) = {
888888 let isPoolOneTokenOperationsDisabled = {
889889 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
890890 if ($isInstanceOf(@, "Boolean"))
891891 then @
892892 else throw(($getType(@) + " couldn't be cast to Boolean"))
893893 }
894894 let isGetDisabled = if (if (isGlobalShutdown())
895895 then true
896896 else (cfgPoolStatus == PoolShutdown))
897897 then true
898898 else isPoolOneTokenOperationsDisabled
899899 let checks = [if (if (!(isGetDisabled))
900900 then true
901901 else isManager(i))
902902 then true
903903 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1))
904904 then true
905905 else throwErr("exactly 1 payment are expected")]
906906 if ((checks == checks))
907907 then {
908908 let outAssetId = parseAssetId(outAssetIdStr)
909909 let payment = i.payments[0]
910910 let paymentAssetId = payment.assetId
911911 let paymentAmount = payment.amount
912912 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(paymentAmount))
913913 let userAddress = i.caller
914914 let txId = i.transactionId
915- let $t03719337346 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
916- if (($t03719337346 == $t03719337346))
915+ let $t03718537338 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
916+ if (($t03718537338 == $t03718537338))
917917 then {
918- let outInAmountAsset = $t03719337346._5
919- let bonus = $t03719337346._4
920- let feeAmount = $t03719337346._3
921- let commonState = $t03719337346._2
922- let amountEstimated = $t03719337346._1
918+ let outInAmountAsset = $t03718537338._5
919+ let bonus = $t03718537338._4
920+ let feeAmount = $t03718537338._3
921+ let commonState = $t03718537338._2
922+ let amountEstimated = $t03718537338._1
923923 let amount = if (if ((minOutAmount > 0))
924924 then (minOutAmount > amountEstimated)
925925 else false)
926926 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
927927 else amountEstimated
928928 let burnInv = invoke(factoryContract, "burn", [paymentAmount], [AttachedPayment(paymentAssetId, paymentAmount)])
929929 if ((burnInv == burnInv))
930930 then {
931931 let assetTransfer = [ScriptTransfer(userAddress, amount, outAssetId)]
932932 let sendFee = if ((feeAmount > 0))
933933 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
934934 else nil
935- let $t03784638093 = {
935+ let $t03783838085 = {
936936 let feeAmountForCalc = if ((this == feeCollectorAddress))
937937 then 0
938938 else feeAmount
939939 if (outInAmountAsset)
940940 then $Tuple2(-((amount + feeAmountForCalc)), 0)
941941 else $Tuple2(0, -((amount + feeAmountForCalc)))
942942 }
943- let amountAssetBalanceDelta = $t03784638093._1
944- let priceAssetBalanceDelta = $t03784638093._2
945- let $t03809638204 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
946- let refreshKLpActions = $t03809638204._1
947- let updatedKLp = $t03809638204._2
943+ let amountAssetBalanceDelta = $t03783838085._1
944+ let priceAssetBalanceDelta = $t03783838085._2
945+ let $t03808838196 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
946+ let refreshKLpActions = $t03808838196._1
947+ let updatedKLp = $t03808838196._2
948948 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
949949 if ((isUpdatedKLpValid == isUpdatedKLpValid))
950950 then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
951951 else throw("Strict value is not equal to itself.")
952952 }
953953 else throw("Strict value is not equal to itself.")
954954 }
955955 else throw("Strict value is not equal to itself.")
956956 }
957957 else throw("Strict value is not equal to itself.")
958958 }
959959
960960
961961
962962 @Callable(i)
963963 func getOneTknREADONLY (outAssetId,paymentAmount) = {
964- let $t03846138617 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
965- let amountEstimated = $t03846138617._1
966- let commonState = $t03846138617._2
967- let feeAmount = $t03846138617._3
968- let bonus = $t03846138617._4
969- let outInAmountAsset = $t03846138617._5
964+ let $t03845338609 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
965+ let amountEstimated = $t03845338609._1
966+ let commonState = $t03845338609._2
967+ let feeAmount = $t03845338609._3
968+ let bonus = $t03845338609._4
969+ let outInAmountAsset = $t03845338609._5
970970 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
971971 }
972972
973973
974974
975975 @Callable(i)
976976 func unstakeAndGetOneTkn (unstakeAmount,outAssetIdStr,minOutAmount) = {
977977 let isPoolOneTokenOperationsDisabled = {
978978 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
979979 if ($isInstanceOf(@, "Boolean"))
980980 then @
981981 else throw(($getType(@) + " couldn't be cast to Boolean"))
982982 }
983983 let isGetDisabled = if (if (isGlobalShutdown())
984984 then true
985985 else (cfgPoolStatus == PoolShutdown))
986986 then true
987987 else isPoolOneTokenOperationsDisabled
988988 let checks = [if (if (!(isGetDisabled))
989989 then true
990990 else isManager(i))
991991 then true
992992 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 0))
993993 then true
994994 else throwErr("no payments are expected")]
995995 if ((checks == checks))
996996 then {
997997 let outAssetId = parseAssetId(outAssetIdStr)
998998 let userAddress = i.caller
999999 let txId = i.transactionId
10001000 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
10011001 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
10021002 if ((unstakeInv == unstakeInv))
10031003 then {
1004- let $t03951939670 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1005- if (($t03951939670 == $t03951939670))
1004+ let $t03951139662 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1005+ if (($t03951139662 == $t03951139662))
10061006 then {
1007- let outInAmountAsset = $t03951939670._5
1008- let bonus = $t03951939670._4
1009- let feeAmount = $t03951939670._3
1010- let commonState = $t03951939670._2
1011- let amountEstimated = $t03951939670._1
1007+ let outInAmountAsset = $t03951139662._5
1008+ let bonus = $t03951139662._4
1009+ let feeAmount = $t03951139662._3
1010+ let commonState = $t03951139662._2
1011+ let amountEstimated = $t03951139662._1
10121012 let amount = if (if ((minOutAmount > 0))
10131013 then (minOutAmount > amountEstimated)
10141014 else false)
10151015 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
10161016 else amountEstimated
10171017 let burnInv = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
10181018 if ((burnInv == burnInv))
10191019 then {
10201020 let assetTransfer = [ScriptTransfer(i.caller, amount, outAssetId)]
10211021 let sendFee = if ((feeAmount > 0))
10221022 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
10231023 else nil
1024- let $t04016540412 = {
1024+ let $t04015740404 = {
10251025 let feeAmountForCalc = if ((this == feeCollectorAddress))
10261026 then 0
10271027 else feeAmount
10281028 if (outInAmountAsset)
10291029 then $Tuple2(-((amount + feeAmountForCalc)), 0)
10301030 else $Tuple2(0, -((amount + feeAmountForCalc)))
10311031 }
1032- let amountAssetBalanceDelta = $t04016540412._1
1033- let priceAssetBalanceDelta = $t04016540412._2
1034- let $t04041540523 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1035- let refreshKLpActions = $t04041540523._1
1036- let updatedKLp = $t04041540523._2
1032+ let amountAssetBalanceDelta = $t04015740404._1
1033+ let priceAssetBalanceDelta = $t04015740404._2
1034+ let $t04040740515 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1035+ let refreshKLpActions = $t04040740515._1
1036+ let updatedKLp = $t04040740515._2
10371037 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10381038 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10391039 then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
10401040 else throw("Strict value is not equal to itself.")
10411041 }
10421042 else throw("Strict value is not equal to itself.")
10431043 }
10441044 else throw("Strict value is not equal to itself.")
10451045 }
10461046 else throw("Strict value is not equal to itself.")
10471047 }
10481048 else throw("Strict value is not equal to itself.")
10491049 }
10501050
10511051
10521052
10531053 @Callable(i)
10541054 func get () = {
10551055 let res = commonGet(i)
10561056 let outAmtAmt = res._1
10571057 let outPrAmt = res._2
10581058 let pmtAmt = res._3
10591059 let pmtAssetId = res._4
10601060 let state = res._5
10611061 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(pmtAmt))
10621062 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
10631063 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
10641064 then {
1065- let $t04147141553 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1066- let refreshKLpActions = $t04147141553._1
1067- let updatedKLp = $t04147141553._2
1065+ let $t04146341545 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1066+ let refreshKLpActions = $t04146341545._1
1067+ let updatedKLp = $t04146341545._2
10681068 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10691069 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10701070 then (state ++ refreshKLpActions)
10711071 else throw("Strict value is not equal to itself.")
10721072 }
10731073 else throw("Strict value is not equal to itself.")
10741074 }
10751075
10761076
10771077
10781078 @Callable(i)
10791079 func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = {
10801080 let res = commonGet(i)
10811081 let outAmAmt = res._1
10821082 let outPrAmt = res._2
10831083 let pmtAmt = res._3
10841084 let pmtAssetId = res._4
10851085 let state = res._5
10861086 if ((noLessThenAmtAsset > outAmAmt))
10871087 then throw(((("noLessThenAmtAsset failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset)))
10881088 else if ((noLessThenPriceAsset > outPrAmt))
10891089 then throw(((("noLessThenPriceAsset failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset)))
10901090 else {
10911091 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(pmtAmt))
10921092 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
10931093 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
10941094 then {
1095- let $t04250442585 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1096- let refreshKLpActions = $t04250442585._1
1097- let updatedKLp = $t04250442585._2
1095+ let $t04249642577 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1096+ let refreshKLpActions = $t04249642577._1
1097+ let updatedKLp = $t04249642577._2
10981098 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10991099 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11001100 then (state ++ refreshKLpActions)
11011101 else throw("Strict value is not equal to itself.")
11021102 }
11031103 else throw("Strict value is not equal to itself.")
11041104 }
11051105 }
11061106
11071107
11081108
11091109 @Callable(i)
11101110 func unstakeAndGet (amount) = {
11111111 let checkPayments = if ((size(i.payments) != 0))
11121112 then throw("No payments are expected")
11131113 else true
11141114 if ((checkPayments == checkPayments))
11151115 then {
11161116 let cfg = getPoolConfig()
11171117 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
11181118 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
11191119 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(lpAssetId), amount], nil)
11201120 if ((unstakeInv == unstakeInv))
11211121 then {
11221122 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller)
11231123 let outAmAmt = res._1
11241124 let outPrAmt = res._2
11251125 let poolStatus = parseIntValue(res._9)
11261126 let state = res._10
11271127 let checkPoolStatus = if (if (isGlobalShutdown())
11281128 then true
11291129 else (poolStatus == PoolShutdown))
11301130 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
11311131 else true
11321132 if ((checkPoolStatus == checkPoolStatus))
11331133 then {
11341134 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
11351135 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
11361136 then {
1137- let $t04370843789 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1138- let refreshKLpActions = $t04370843789._1
1139- let updatedKLp = $t04370843789._2
1137+ let $t04370043781 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1138+ let refreshKLpActions = $t04370043781._1
1139+ let updatedKLp = $t04370043781._2
11401140 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11411141 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11421142 then (state ++ refreshKLpActions)
11431143 else throw("Strict value is not equal to itself.")
11441144 }
11451145 else throw("Strict value is not equal to itself.")
11461146 }
11471147 else throw("Strict value is not equal to itself.")
11481148 }
11491149 else throw("Strict value is not equal to itself.")
11501150 }
11511151 else throw("Strict value is not equal to itself.")
11521152 }
11531153
11541154
11551155
11561156 @Callable(i)
11571157 func unstakeAndGetNoLess (unstakeAmount,noLessThenAmountAsset,noLessThenPriceAsset) = {
11581158 let isGetDisabled = if (isGlobalShutdown())
11591159 then true
11601160 else (cfgPoolStatus == PoolShutdown)
11611161 let checks = [if (!(isGetDisabled))
11621162 then true
11631163 else throw("get operation is blocked by admin"), if ((size(i.payments) == 0))
11641164 then true
11651165 else throw("no payments are expected")]
11661166 if ((checks == checks))
11671167 then {
11681168 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
11691169 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
11701170 if ((unstakeInv == unstakeInv))
11711171 then {
11721172 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller)
11731173 let outAmAmt = res._1
11741174 let outPrAmt = res._2
11751175 let state = res._10
11761176 let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset))
11771177 then true
11781178 else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset))
11791179 then true
11801180 else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))]
11811181 if ((checkAmounts == checkAmounts))
11821182 then {
11831183 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
11841184 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
11851185 then {
1186- let $t04508145162 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1187- let refreshKLpActions = $t04508145162._1
1188- let updatedKLp = $t04508145162._2
1186+ let $t04507345154 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1187+ let refreshKLpActions = $t04507345154._1
1188+ let updatedKLp = $t04507345154._2
11891189 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11901190 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11911191 then (state ++ refreshKLpActions)
11921192 else throw("Strict value is not equal to itself.")
11931193 }
11941194 else throw("Strict value is not equal to itself.")
11951195 }
11961196 else throw("Strict value is not equal to itself.")
11971197 }
11981198 else throw("Strict value is not equal to itself.")
11991199 }
12001200 else throw("Strict value is not equal to itself.")
12011201 }
12021202
12031203
12041204
12051205 @Callable(i)
12061206 func activate (amtAssetStr,priceAssetStr) = if ((toString(i.caller) != toString(factoryContract)))
12071207 then throw("permissions denied")
12081208 else $Tuple2([StringEntry(aa(), amtAssetStr), StringEntry(pa(), priceAssetStr)], "success")
12091209
12101210
12111211
12121212 @Callable(i)
12131213 func refreshKLp () = {
12141214 let lastRefreshedBlockHeight = valueOrElse(getInteger(keyKLpRefreshedHeight), 0)
12151215 let checkLastRefreshedBlockHeight = if (((height - lastRefreshedBlockHeight) >= kLpRefreshDelay))
12161216 then unit
12171217 else throwErr(makeString([toString(kLpRefreshDelay), " blocks have not passed since the previous call"], ""))
12181218 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
12191219 then {
12201220 let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
1221- let $t04634946413 = refreshKLpInternal(0, 0, 0)
1222- let kLpUpdateActions = $t04634946413._1
1223- let updatedKLp = $t04634946413._2
1221+ let $t04634146405 = refreshKLpInternal(0, 0, 0)
1222+ let kLpUpdateActions = $t04634146405._1
1223+ let updatedKLp = $t04634146405._2
12241224 let actions = if ((kLp != updatedKLp))
12251225 then kLpUpdateActions
12261226 else throwErr("nothing to refresh")
12271227 $Tuple2(actions, toString(updatedKLp))
12281228 }
12291229 else throw("Strict value is not equal to itself.")
12301230 }
12311231
12321232
12331233
12341234 @Callable(i)
12351235 func getPoolConfigWrapperREADONLY () = $Tuple2(nil, getPoolConfig())
12361236
12371237
12381238
12391239 @Callable(i)
12401240 func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId))
12411241
12421242
12431243
12441244 @Callable(i)
12451245 func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = {
12461246 let prices = calcPrices(amAmt, prAmt, lpAmt)
12471247 $Tuple2(nil, [toString(prices[0]), toString(prices[1]), toString(prices[2])])
12481248 }
12491249
12501250
12511251
12521252 @Callable(i)
12531253 func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(toX18(origVal, origScaleMult)))
12541254
12551255
12561256
12571257 @Callable(i)
12581258 func fromX18WrapperREADONLY (val,resultScaleMult) = $Tuple2(nil, fromX18(parseBigIntValue(val), resultScaleMult))
12591259
12601260
12611261
12621262 @Callable(i)
12631263 func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(calcPriceBigInt(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18))))
12641264
12651265
12661266
12671267 @Callable(i)
12681268 func estimatePutOperationWrapperREADONLY (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = $Tuple2(nil, estimatePutOperation(txId58, slippageTolerance, inAmAssetAmt, inAmAssetId, inPrAssetAmt, inPrAssetId, userAddress, isEvaluate, emitLp))
12691269
12701270
12711271
12721272 @Callable(i)
12731273 func estimateGetOperationWrapperREADONLY (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
12741274 let res = estimateGetOperation(txId58, pmtAssetId, pmtLpAmt, addressFromStringValue(userAddress))
12751275 $Tuple2(nil, $Tuple10(res._1, res._2, res._3, res._4, res._5, res._6, res._7, toString(res._8), res._9, res._10))
12761276 }
12771277
12781278
12791279
12801280 @Callable(i)
12811281 func statsREADONLY () = {
12821282 let cfg = getPoolConfig()
12831283 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
12841284 let amtAssetId = cfg[idxAmtAssetId]
12851285 let priceAssetId = cfg[idxPriceAssetId]
12861286 let iAmtAssetId = cfg[idxIAmtAssetId]
12871287 let iPriceAssetId = cfg[idxIPriceAssetId]
12881288 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
12891289 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
12901290 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
12911291 let accAmtAssetBalance = getAccBalance(amtAssetId)
12921292 let accPriceAssetBalance = getAccBalance(priceAssetId)
12931293 let pricesList = if ((poolLPBalance == 0))
12941294 then [zeroBigInt, zeroBigInt, zeroBigInt]
12951295 else calcPrices(accAmtAssetBalance, accPriceAssetBalance, poolLPBalance)
12961296 let curPrice = 0
12971297 let lpAmtAssetShare = fromX18(pricesList[1], scale8)
12981298 let lpPriceAssetShare = fromX18(pricesList[2], scale8)
12991299 let poolWeight = value(getInteger(factoryContract, keyPoolWeight(toString(this))))
13001300 $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))
13011301 }
13021302
13031303
13041304
13051305 @Callable(i)
13061306 func evaluatePutByAmountAssetREADONLY (inAmAssetAmt) = {
13071307 let cfg = getPoolConfig()
13081308 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
13091309 let amAssetIdStr = cfg[idxAmtAssetId]
13101310 let amAssetId = fromBase58String(amAssetIdStr)
13111311 let prAssetIdStr = cfg[idxPriceAssetId]
13121312 let prAssetId = fromBase58String(prAssetIdStr)
13131313 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
13141314 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
13151315 let poolStatus = cfg[idxPoolStatus]
13161316 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
13171317 let accAmtAssetBalance = getAccBalance(amAssetIdStr)
13181318 let accPriceAssetBalance = getAccBalance(prAssetIdStr)
13191319 let amtAssetAmtX18 = toX18(accAmtAssetBalance, amtAssetDcm)
13201320 let priceAssetAmtX18 = toX18(accPriceAssetBalance, priceAssetDcm)
13211321 let curPriceX18 = if ((poolLPBalance == 0))
13221322 then zeroBigInt
13231323 else calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
13241324 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
13251325 let inPrAssetAmtX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18)
13261326 let inPrAssetAmt = fromX18(inPrAssetAmtX18, priceAssetDcm)
13271327 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
13281328 let calcLpAmt = estPut._1
13291329 let curPriceCalc = estPut._3
13301330 let amBalance = estPut._4
13311331 let prBalance = estPut._5
13321332 let lpEmission = estPut._6
13331333 $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))
13341334 }
13351335
13361336
13371337
13381338 @Callable(i)
13391339 func evaluatePutByPriceAssetREADONLY (inPrAssetAmt) = {
13401340 let cfg = getPoolConfig()
13411341 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
13421342 let amAssetIdStr = cfg[idxAmtAssetId]
13431343 let amAssetId = fromBase58String(amAssetIdStr)
13441344 let prAssetIdStr = cfg[idxPriceAssetId]
13451345 let prAssetId = fromBase58String(prAssetIdStr)
13461346 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
13471347 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
13481348 let poolStatus = cfg[idxPoolStatus]
13491349 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
13501350 let amBalanceRaw = getAccBalance(amAssetIdStr)
13511351 let prBalanceRaw = getAccBalance(prAssetIdStr)
13521352 let amBalanceRawX18 = toX18(amBalanceRaw, amtAssetDcm)
13531353 let prBalanceRawX18 = toX18(prBalanceRaw, priceAssetDcm)
13541354 let curPriceX18 = if ((poolLPBalance == 0))
13551355 then zeroBigInt
13561356 else calcPriceBigInt(prBalanceRawX18, amBalanceRawX18)
13571357 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
13581358 let inAmAssetAmtX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
13591359 let inAmAssetAmt = fromX18(inAmAssetAmtX18, amtAssetDcm)
13601360 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
13611361 let calcLpAmt = estPut._1
13621362 let curPriceCalc = estPut._3
13631363 let amBalance = estPut._4
13641364 let prBalance = estPut._5
13651365 let lpEmission = estPut._6
13661366 $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))
13671367 }
13681368
13691369
13701370
13711371 @Callable(i)
13721372 func evaluateGetREADONLY (paymentLpAssetId,paymentLpAmt) = {
13731373 let res = estimateGetOperation("", paymentLpAssetId, paymentLpAmt, this)
13741374 let outAmAmt = res._1
13751375 let outPrAmt = res._2
13761376 let amBalance = res._5
13771377 let prBalance = res._6
13781378 let lpEmission = res._7
13791379 let curPrice = res._8
13801380 let poolStatus = parseIntValue(res._9)
13811381 $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))
13821382 }
13831383
13841384
13851385 @Verifier(tx)
13861386 func verify () = {
13871387 let targetPublicKey = match managerPublicKeyOrUnit() {
13881388 case pk: ByteVector =>
13891389 pk
13901390 case _: Unit =>
13911391 tx.senderPublicKey
13921392 case _ =>
13931393 throw("Match error")
13941394 }
13951395 match tx {
13961396 case order: Order =>
13971397 let matcherPub = getMatcherPubOrFail()
13981398 let orderValid = validateMatcherOrderAllowed(order)
13991399 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
14001400 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
14011401 if (if (if (orderValid)
14021402 then senderValid
14031403 else false)
14041404 then matcherValid
14051405 else false)
14061406 then true
14071407 else throwOrderError(orderValid, senderValid, matcherValid)
14081408 case s: SetScriptTransaction =>
14091409 let newHash = blake2b256(value(s.script))
14101410 let allowedHash = fromBase64String(value(getString(factoryContract, keyAllowedLpScriptHash())))
14111411 let currentHash = scriptHash(this)
14121412 if (if ((allowedHash == newHash))
14131413 then (currentHash != newHash)
14141414 else false)
14151415 then true
14161416 else sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
14171417 case _ =>
14181418 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
14191419 }
14201420 }
14211421

github/deemru/w8io/026f985 
184.08 ms