tx · GKLLaqVpuUv2yxNYbafBEY5yTYh4jnn3P6UdKWMw6K4T

3N4ig26JgHMJuLfZ1cdm2Rvy7oWg7pMnxjy:  -0.03300000 Waves

2022.11.28 16:08 [2336998] smart account 3N4ig26JgHMJuLfZ1cdm2Rvy7oWg7pMnxjy > SELF 0.00000000 Waves

{ "type": 13, "id": "GKLLaqVpuUv2yxNYbafBEY5yTYh4jnn3P6UdKWMw6K4T", "fee": 3300000, "feeAssetId": null, "timestamp": 1669640853478, "version": 1, "sender": "3N4ig26JgHMJuLfZ1cdm2Rvy7oWg7pMnxjy", "senderPublicKey": "1Q1fBqTqxTRfxwxvQhDYXVLbyoJeM9hnAHUUhKLbQ3K", "proofs": [ "BeQoeTFZjq4XvSRHyzCE7mbah4q8oMDEuV7K1rP8zkYnMB2yfLdzbHqz6Eh4cKNrcCQwTkYeznDYpiTCAbN4AzB" ], "script": "base64:BgL+KwgCEgMKAQgSABIECgIBBBIDCgEBEgQKAgEEEgQKAggBEgQKAggBEgQKAggBEgUKAwEIARIAEgQKAgEBEgMKAQESBQoDAQEBEgQKAggIEgASABIDCgEIEgUKAwEBARIECgIBARIECgIIARIECgIICBILCgkIAQECAQIIBAQSBgoECAgBCBIAEgMKAQESAwoBARIECgIIASIKbFBkZWNpbWFscyIGc2NhbGU4IgxzY2FsZThCaWdJbnQiB3NjYWxlMTgiCnplcm9CaWdJbnQiBGJpZzAiBGJpZzEiBGJpZzIiC3dhdmVzU3RyaW5nIgNTRVAiClBvb2xBY3RpdmUiD1Bvb2xQdXREaXNhYmxlZCITUG9vbE1hdGNoZXJEaXNhYmxlZCIMUG9vbFNodXRkb3duIg5pZHhQb29sQWRkcmVzcyINaWR4UG9vbFN0YXR1cyIQaWR4UG9vbExQQXNzZXRJZCINaWR4QW10QXNzZXRJZCIPaWR4UHJpY2VBc3NldElkIg5pZHhBbXRBc3NldERjbSIQaWR4UHJpY2VBc3NldERjbSIOaWR4SUFtdEFzc2V0SWQiEGlkeElQcmljZUFzc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A9AMDCAUCZ3IJYm9keUJ5dGVzCQCRAwIIBQJncgZwcm9vZnMAAAUCZ3TgLAlD", "chainId": 84, "height": 2336998, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3P8A1fFomQcrvVzbRtdUv4Meea448hg7emZXAgKkeupB Next: 4wPxwzADhwrRDAugXdUQBiX2hJpfsMBm1xn7UcsszUA6 Diff:
OldNewDifferences
783783 let paymentAmountRaw = payment.amount
784784 let userAddress = i.caller
785785 let txId = i.transactionId
786- let $t03272532874 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
787- let emitAmountEstimated = $t03272532874._1
788- let commonState = $t03272532874._2
789- let feeAmount = $t03272532874._3
790- let bonus = $t03272532874._4
791- let paymentInAmountAsset = $t03272532874._5
792- let emitAmount = if (if ((minOutAmount > 0))
793- then (minOutAmount > emitAmountEstimated)
794- else false)
795- then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
796- else emitAmountEstimated
797- let emitInv = emit(emitAmount)
798- if ((emitInv == emitInv))
786+ let $t03272532877 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
787+ if (($t03272532877 == $t03272532877))
799788 then {
800- let lpTransfer = if (autoStake)
789+ let paymentInAmountAsset = $t03272532877._5
790+ let bonus = $t03272532877._4
791+ let feeAmount = $t03272532877._3
792+ let commonState = $t03272532877._2
793+ let emitAmountEstimated = $t03272532877._1
794+ let emitAmount = if (if ((minOutAmount > 0))
795+ then (minOutAmount > emitAmountEstimated)
796+ else false)
797+ then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
798+ else emitAmountEstimated
799+ let emitInv = emit(emitAmount)
800+ if ((emitInv == emitInv))
801801 then {
802- let stakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(cfgLpAssetId, emitAmount)])
803- if ((stakeInv == stakeInv))
804- then nil
805- else throw("Strict value is not equal to itself.")
802+ let lpTransfer = if (autoStake)
803+ then {
804+ let stakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(cfgLpAssetId, emitAmount)])
805+ if ((stakeInv == stakeInv))
806+ then nil
807+ else throw("Strict value is not equal to itself.")
808+ }
809+ else [ScriptTransfer(i.caller, emitAmount, cfgLpAssetId)]
810+ let sendFee = if ((feeAmount > 0))
811+ then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
812+ else nil
813+ let $t03346333660 = if ((this == feeCollectorAddress))
814+ then $Tuple2(0, 0)
815+ else if (paymentInAmountAsset)
816+ then $Tuple2(-(feeAmount), 0)
817+ else $Tuple2(0, -(feeAmount))
818+ let amountAssetBalanceDelta = $t03346333660._1
819+ let priceAssetBalanceDelta = $t03346333660._2
820+ let $t03366333771 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
821+ let refreshKLpActions = $t03366333771._1
822+ let updatedKLp = $t03366333771._2
823+ $Tuple2((((commonState ++ lpTransfer) ++ sendFee) ++ refreshKLpActions), emitAmount)
806824 }
807- else [ScriptTransfer(i.caller, emitAmount, cfgLpAssetId)]
808- let sendFee = if ((feeAmount > 0))
809- then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
810- else nil
811- let $t03346033657 = if ((this == feeCollectorAddress))
812- then $Tuple2(0, 0)
813- else if (paymentInAmountAsset)
814- then $Tuple2(-(feeAmount), 0)
815- else $Tuple2(0, -(feeAmount))
816- let amountAssetBalanceDelta = $t03346033657._1
817- let priceAssetBalanceDelta = $t03346033657._2
818- let $t03366033768 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
819- let refreshKLpActions = $t03366033768._1
820- let updatedKLp = $t03366033768._2
821- $Tuple2((((commonState ++ lpTransfer) ++ sendFee) ++ refreshKLpActions), emitAmount)
825+ else throw("Strict value is not equal to itself.")
822826 }
823827 else throw("Strict value is not equal to itself.")
824828 }
829833
830834 @Callable(i)
831835 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
832- let $t03396134118 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
833- let emitAmountEstimated = $t03396134118._1
834- let commonState = $t03396134118._2
835- let feeAmount = $t03396134118._3
836- let bonus = $t03396134118._4
837- let paymentInAmountAsset = $t03396134118._5
836+ let $t03396434121 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
837+ let emitAmountEstimated = $t03396434121._1
838+ let commonState = $t03396434121._2
839+ let feeAmount = $t03396434121._3
840+ let bonus = $t03396434121._4
841+ let paymentInAmountAsset = $t03396434121._5
838842 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
839843 }
840844
868872 let paymentAmount = payment.amount
869873 let userAddress = i.caller
870874 let txId = i.transactionId
871- let $t03492335073 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
872- let amountEstimated = $t03492335073._1
873- let commonState = $t03492335073._2
874- let feeAmount = $t03492335073._3
875- let bonus = $t03492335073._4
876- let outInAmountAsset = $t03492335073._5
877- let amount = if (if ((minOutAmount > 0))
878- then (minOutAmount > amountEstimated)
879- else false)
880- then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
881- else amountEstimated
882- let burnInv = invoke(factoryContract, "burn", [paymentAmount], [AttachedPayment(paymentAssetId, paymentAmount)])
883- if ((burnInv == burnInv))
875+ let $t03492635079 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
876+ if (($t03492635079 == $t03492635079))
884877 then {
885- let assetTransfer = [ScriptTransfer(userAddress, amount, outAssetId)]
886- let sendFee = if ((feeAmount > 0))
887- then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
888- else nil
889- let $t03557335820 = {
890- let feeAmountForCalc = if ((this == feeCollectorAddress))
891- then 0
892- else feeAmount
893- if (outInAmountAsset)
894- then $Tuple2(-((amount + feeAmountForCalc)), 0)
895- else $Tuple2(0, -((amount + feeAmountForCalc)))
896- }
897- let amountAssetBalanceDelta = $t03557335820._1
898- let priceAssetBalanceDelta = $t03557335820._2
899- let $t03582335931 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
900- let refreshKLpActions = $t03582335931._1
901- let updatedKLp = $t03582335931._2
902- $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
878+ let outInAmountAsset = $t03492635079._5
879+ let bonus = $t03492635079._4
880+ let feeAmount = $t03492635079._3
881+ let commonState = $t03492635079._2
882+ let amountEstimated = $t03492635079._1
883+ let amount = if (if ((minOutAmount > 0))
884+ then (minOutAmount > amountEstimated)
885+ else false)
886+ then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
887+ else amountEstimated
888+ let burnInv = invoke(factoryContract, "burn", [paymentAmount], [AttachedPayment(paymentAssetId, paymentAmount)])
889+ if ((burnInv == burnInv))
890+ then {
891+ let assetTransfer = [ScriptTransfer(userAddress, amount, outAssetId)]
892+ let sendFee = if ((feeAmount > 0))
893+ then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
894+ else nil
895+ let $t03557935826 = {
896+ let feeAmountForCalc = if ((this == feeCollectorAddress))
897+ then 0
898+ else feeAmount
899+ if (outInAmountAsset)
900+ then $Tuple2(-((amount + feeAmountForCalc)), 0)
901+ else $Tuple2(0, -((amount + feeAmountForCalc)))
902+ }
903+ let amountAssetBalanceDelta = $t03557935826._1
904+ let priceAssetBalanceDelta = $t03557935826._2
905+ let $t03582935937 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
906+ let refreshKLpActions = $t03582935937._1
907+ let updatedKLp = $t03582935937._2
908+ $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
909+ }
910+ else throw("Strict value is not equal to itself.")
903911 }
904912 else throw("Strict value is not equal to itself.")
905913 }
910918
911919 @Callable(i)
912920 func getOneTknREADONLY (outAssetId,paymentAmount) = {
913- let $t03611536271 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
914- let amountEstimated = $t03611536271._1
915- let commonState = $t03611536271._2
916- let feeAmount = $t03611536271._3
917- let bonus = $t03611536271._4
918- let outInAmountAsset = $t03611536271._5
921+ let $t03612136277 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
922+ let amountEstimated = $t03612136277._1
923+ let commonState = $t03612136277._2
924+ let feeAmount = $t03612136277._3
925+ let bonus = $t03612136277._4
926+ let outInAmountAsset = $t03612136277._5
919927 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
920928 }
921929
949957 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
950958 if ((unstakeInv == unstakeInv))
951959 then {
952- let $t03709637244 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
953- let amountEstimated = $t03709637244._1
954- let commonState = $t03709637244._2
955- let feeAmount = $t03709637244._3
956- let bonus = $t03709637244._4
957- let outInAmountAsset = $t03709637244._5
958- let amount = if (if ((minOutAmount > 0))
959- then (minOutAmount > amountEstimated)
960- else false)
961- then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
962- else amountEstimated
963- let burnInv = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
964- if ((burnInv == burnInv))
960+ let $t03710237253 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
961+ if (($t03710237253 == $t03710237253))
965962 then {
966- let assetTransfer = [ScriptTransfer(i.caller, amount, outAssetId)]
967- let sendFee = if ((feeAmount > 0))
968- then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
969- else nil
970- let $t03773937986 = {
971- let feeAmountForCalc = if ((this == feeCollectorAddress))
972- then 0
973- else feeAmount
974- if (outInAmountAsset)
975- then $Tuple2(-((amount + feeAmountForCalc)), 0)
976- else $Tuple2(0, -((amount + feeAmountForCalc)))
977- }
978- let amountAssetBalanceDelta = $t03773937986._1
979- let priceAssetBalanceDelta = $t03773937986._2
980- let $t03798938097 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
981- let refreshKLpActions = $t03798938097._1
982- let updatedKLp = $t03798938097._2
983- $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
963+ let outInAmountAsset = $t03710237253._5
964+ let bonus = $t03710237253._4
965+ let feeAmount = $t03710237253._3
966+ let commonState = $t03710237253._2
967+ let amountEstimated = $t03710237253._1
968+ let amount = if (if ((minOutAmount > 0))
969+ then (minOutAmount > amountEstimated)
970+ else false)
971+ then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
972+ else amountEstimated
973+ let burnInv = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
974+ if ((burnInv == burnInv))
975+ then {
976+ let assetTransfer = [ScriptTransfer(i.caller, amount, outAssetId)]
977+ let sendFee = if ((feeAmount > 0))
978+ then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
979+ else nil
980+ let $t03774837995 = {
981+ let feeAmountForCalc = if ((this == feeCollectorAddress))
982+ then 0
983+ else feeAmount
984+ if (outInAmountAsset)
985+ then $Tuple2(-((amount + feeAmountForCalc)), 0)
986+ else $Tuple2(0, -((amount + feeAmountForCalc)))
987+ }
988+ let amountAssetBalanceDelta = $t03774837995._1
989+ let priceAssetBalanceDelta = $t03774837995._2
990+ let $t03799838106 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
991+ let refreshKLpActions = $t03799838106._1
992+ let updatedKLp = $t03799838106._2
993+ $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
994+ }
995+ else throw("Strict value is not equal to itself.")
984996 }
985997 else throw("Strict value is not equal to itself.")
986998 }
10021014 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
10031015 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
10041016 then {
1005- let $t03888938971 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1006- let refreshKLpActions = $t03888938971._1
1007- let updatedKLp = $t03888938971._2
1017+ let $t03889838980 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1018+ let refreshKLpActions = $t03889838980._1
1019+ let updatedKLp = $t03889838980._2
10081020 (state ++ refreshKLpActions)
10091021 }
10101022 else throw("Strict value is not equal to itself.")
10281040 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
10291041 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
10301042 then {
1031- let $t03976739848 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1032- let refreshKLpActions = $t03976739848._1
1033- let updatedKLp = $t03976739848._2
1043+ let $t03977639857 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1044+ let refreshKLpActions = $t03977639857._1
1045+ let updatedKLp = $t03977639857._2
10341046 (state ++ refreshKLpActions)
10351047 }
10361048 else throw("Strict value is not equal to itself.")
10661078 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
10671079 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
10681080 then {
1069- let $t04082140902 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1070- let refreshKLpActions = $t04082140902._1
1071- let updatedKLp = $t04082140902._2
1081+ let $t04083040911 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1082+ let refreshKLpActions = $t04083040911._1
1083+ let updatedKLp = $t04083040911._2
10721084 (state ++ refreshKLpActions)
10731085 }
10741086 else throw("Strict value is not equal to itself.")
11111123 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
11121124 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
11131125 then {
1114- let $t04204242123 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1115- let refreshKLpActions = $t04204242123._1
1116- let updatedKLp = $t04204242123._2
1126+ let $t04205142132 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1127+ let refreshKLpActions = $t04205142132._1
1128+ let updatedKLp = $t04205142132._2
11171129 (state ++ refreshKLpActions)
11181130 }
11191131 else throw("Strict value is not equal to itself.")
11421154 else throwErr(makeString([toString(kLpRefreshDelay), " blocks have not passed since the previous call"], ""))
11431155 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
11441156 then {
1145- let $t04311143166 = refreshKLpInternal(0, 0, 0)
1146- let actions = $t04311143166._1
1147- let updatedKLp = $t04311143166._2
1157+ let $t04312043175 = refreshKLpInternal(0, 0, 0)
1158+ let actions = $t04312043175._1
1159+ let updatedKLp = $t04312043175._2
11481160 $Tuple2(actions, toString(updatedKLp))
11491161 }
11501162 else throw("Strict value is not equal to itself.")
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
233233 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)
346346 let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
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, 0, DOWN), scale18, lpEmission)
378378 updatedKLp
379379 }
380380
381381
382382 func refreshKLpInternal (amountAssetBalanceDelta,priceAssetBalanceDelta,lpAssetEmissionDelta) = {
383383 let amountAssetBalance = (getAccBalance(assetIdToString(cfgAmountAssetId)) + amountAssetBalanceDelta)
384384 let priceAssetBalance = (getAccBalance(assetIdToString(cfgPriceAssetId)) + priceAssetBalanceDelta)
385385 let lpAssetEmission = (value(assetInfo(cfgLpAssetId)).quantity + lpAssetEmissionDelta)
386386 let updatedKLp = calcKLp(toBigInt(amountAssetBalance), toBigInt(priceAssetBalance), toBigInt(lpAssetEmission))
387387 let actions = [IntegerEntry(keyKLpRefreshedHeight, height), StringEntry(keyKLp, toString(updatedKLp))]
388388 $Tuple2(actions, updatedKLp)
389389 }
390390
391391
392392 func validateMatcherOrderAllowed (order) = {
393393 let cfg = getPoolConfig()
394394 let amtAssetId = cfg[idxAmtAssetId]
395395 let priceAssetId = cfg[idxPriceAssetId]
396396 let poolStatus = parseIntValue(cfg[idxPoolStatus])
397397 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
398398 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
399399 let amountAssetAmount = order.amount
400400 let priceAssetAmount = fraction(order.amount, order.price, scale8)
401401 let $t01983820050 = if ((order.orderType == Buy))
402402 then $Tuple2(amountAssetAmount, -(priceAssetAmount))
403403 else $Tuple2(-(amountAssetAmount), priceAssetAmount)
404404 let amountAssetBalanceDelta = $t01983820050._1
405405 let priceAssetBalanceDelta = $t01983820050._2
406406 if (if (if (isGlobalShutdown())
407407 then true
408408 else (poolStatus == PoolMatcherDisabled))
409409 then true
410410 else (poolStatus == PoolShutdown))
411411 then throw("Exchange operations disabled")
412412 else {
413413 let orderAmtAssetStr = assetIdToString(value(order.assetPair.amountAsset))
414414 let orderPriceAssetStr = assetIdToString(value(order.assetPair.priceAsset))
415415 if (if ((orderAmtAssetStr != amtAssetId))
416416 then true
417417 else (orderPriceAssetStr != priceAssetId))
418418 then throw("Wrong order assets.")
419419 else {
420420 let kLp = valueOrErrorMessage(parseBigInt(valueOrErrorMessage(getString(this, keyKLp), fmtErr("kLp is required"))), fmtErr("invalid kLp"))
421421 let $t02064520745 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
422422 let unusedActions = $t02064520745._1
423423 let kLpNew = $t02064520745._2
424424 let isOrderValid = (kLpNew > kLp)
425425 isOrderValid
426426 }
427427 }
428428 }
429429
430430
431431 func commonGet (i) = if ((size(i.payments) != 1))
432432 then throw("exactly 1 payment is expected")
433433 else {
434434 let pmt = value(i.payments[0])
435435 let pmtAssetId = value(pmt.assetId)
436436 let pmtAmt = pmt.amount
437437 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller)
438438 let outAmAmt = res._1
439439 let outPrAmt = res._2
440440 let poolStatus = parseIntValue(res._9)
441441 let state = res._10
442442 if (if (isGlobalShutdown())
443443 then true
444444 else (poolStatus == PoolShutdown))
445445 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
446446 else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state)
447447 }
448448
449449
450450 func commonPut (i,slippageTolerance,emitLp) = if ((size(i.payments) != 2))
451451 then throw("exactly 2 payments are expected")
452452 else {
453453 let amAssetPmt = value(i.payments[0])
454454 let prAssetPmt = value(i.payments[1])
455455 let estPut = estimatePutOperation(toBase58String(i.transactionId), slippageTolerance, amAssetPmt.amount, amAssetPmt.assetId, prAssetPmt.amount, prAssetPmt.assetId, toString(i.caller), false, emitLp)
456456 let poolStatus = parseIntValue(estPut._8)
457457 if (if (if (isGlobalShutdown())
458458 then true
459459 else (poolStatus == PoolPutDisabled))
460460 then true
461461 else (poolStatus == PoolShutdown))
462462 then throw(("Put operation is blocked by admin. Status = " + toString(poolStatus)))
463463 else estPut
464464 }
465465
466466
467467 func emit (amount) = {
468468 let emitInv = invoke(factoryContract, "emit", [amount], nil)
469469 if ((emitInv == emitInv))
470470 then {
471471 let emitInvLegacy = match emitInv {
472472 case legacyFactoryContract: Address =>
473473 invoke(legacyFactoryContract, "emit", [amount], nil)
474474 case _ =>
475475 unit
476476 }
477477 if ((emitInvLegacy == emitInvLegacy))
478478 then amount
479479 else throw("Strict value is not equal to itself.")
480480 }
481481 else throw("Strict value is not equal to itself.")
482482 }
483483
484484
485485 func takeFee (amount) = {
486486 let feeAmount = fraction(amount, fee, scale8)
487487 $Tuple2((amount - feeAmount), feeAmount)
488488 }
489489
490490
491491 func calcPutOneToken (paymentAmountRaw,paymentAssetId,userAddress,txId) = {
492492 let isEval = (txId == unit)
493493 let amountBalanceRaw = getAccBalance(assetIdToString(cfgAmountAssetId))
494494 let priceBalanceRaw = getAccBalance(assetIdToString(cfgPriceAssetId))
495495 let paymentInAmountAsset = if ((paymentAssetId == cfgAmountAssetId))
496496 then true
497497 else if ((paymentAssetId == cfgPriceAssetId))
498498 then false
499499 else throwErr("invalid asset")
500500 let $t02342923722 = if (isEval)
501501 then $Tuple2(amountBalanceRaw, priceBalanceRaw)
502502 else if (paymentInAmountAsset)
503503 then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw)
504504 else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw))
505505 let amountBalanceOld = $t02342923722._1
506506 let priceBalanceOld = $t02342923722._2
507507 let $t02372623875 = if (paymentInAmountAsset)
508508 then $Tuple2(paymentAmountRaw, 0)
509509 else $Tuple2(0, paymentAmountRaw)
510510 let amountAssetAmountRaw = $t02372623875._1
511511 let priceAssetAmountRaw = $t02372623875._2
512512 let amountAssetAmount = takeFee(amountAssetAmountRaw)._1
513513 let priceAssetAmount = takeFee(priceAssetAmountRaw)._1
514514 let $t02399724056 = takeFee(paymentAmountRaw)
515515 let paymentAmount = $t02399724056._1
516516 let feeAmount = $t02399724056._2
517517 let amountBalanceNew = (amountBalanceOld + amountAssetAmount)
518518 let priceBalanceNew = (priceBalanceOld + priceAssetAmount)
519519 let priceNewX18 = calcPriceBigInt(toX18(priceBalanceNew, cfgPriceAssetDecimals), toX18(amountBalanceNew, cfgAmountAssetDecimals))
520520 let priceNew = fromX18(priceNewX18, scale8)
521521 let paymentBalance = if (paymentInAmountAsset)
522522 then amountBalanceOld
523523 else priceBalanceOld
524524 let paymentBalanceBigInt = toBigInt(paymentBalance)
525525 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
526526 let chechSupply = if ((supplyBigInt > big0))
527527 then true
528528 else throwErr("initial deposit requires all coins")
529529 if ((chechSupply == chechSupply))
530530 then {
531531 let depositBigInt = toBigInt(paymentAmount)
532532 let issueAmount = max([0, toInt(((supplyBigInt * (sqrtBigInt((scale18 + ((depositBigInt * scale18) / paymentBalanceBigInt)), 18, 18, DOWN) - scale18)) / scale18))])
533533 let commonState = if (isEval)
534534 then nil
535535 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))]
536536 let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, cfgPriceAssetDecimals), toX18(amountBalanceOld, cfgAmountAssetDecimals))
537537 let priceOld = fromX18(priceOldX18, scale8)
538538 let loss = {
539539 let $t02553325700 = if (paymentInAmountAsset)
540540 then $Tuple2(amountAssetAmountRaw, amountBalanceOld)
541541 else $Tuple2(priceAssetAmountRaw, priceBalanceOld)
542542 let amount = $t02553325700._1
543543 let balance = $t02553325700._2
544544 let issueAmountBoth = toInt(fraction(supplyBigInt, toBigInt((amount / 2)), toBigInt(balance)))
545545 fraction((issueAmount - issueAmountBoth), scale8, issueAmountBoth)
546546 }
547547 $Tuple5(issueAmount, commonState, feeAmount, loss, paymentInAmountAsset)
548548 }
549549 else throw("Strict value is not equal to itself.")
550550 }
551551
552552
553553 func calcGetOneToken (outAssetId,paymentAmount,paymentAssetId,userAddress,txId) = {
554554 let isEval = (txId == unit)
555555 let checks = [if ((paymentAssetId == cfgLpAssetId))
556556 then true
557557 else throwErr("invalid lp asset")]
558558 if ((checks == checks))
559559 then {
560560 let outInAmountAsset = if ((outAssetId == cfgAmountAssetId))
561561 then true
562562 else if ((outAssetId == cfgPriceAssetId))
563563 then false
564564 else throwErr("invalid asset")
565565 let balanceBigInt = if (outInAmountAsset)
566566 then toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId)))
567567 else toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId)))
568568 let amBalanceOld = getAccBalance(assetIdToString(cfgAmountAssetId))
569569 let prBalanceOld = getAccBalance(assetIdToString(cfgPriceAssetId))
570570 let outBalance = if (outInAmountAsset)
571571 then amBalanceOld
572572 else prBalanceOld
573573 let outBalanceBigInt = toBigInt(outBalance)
574574 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
575575 let redeemedBigInt = toBigInt(paymentAmount)
576576 let amountRaw = max([0, toInt(((balanceBigInt * (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN))) / scale18))])
577577 let $t02730227352 = takeFee(amountRaw)
578578 let totalAmount = $t02730227352._1
579579 let feeAmount = $t02730227352._2
580580 let $t02735627582 = if (outInAmountAsset)
581581 then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld)
582582 else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw))
583583 let outAmAmount = $t02735627582._1
584584 let outPrAmount = $t02735627582._2
585585 let amBalanceNew = $t02735627582._3
586586 let prBalanceNew = $t02735627582._4
587587 let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, cfgPriceAssetDecimals), toX18(amBalanceNew, cfgAmountAssetDecimals))
588588 let priceNew = fromX18(priceNewX18, scale8)
589589 let commonState = if (isEval)
590590 then nil
591591 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)]
592592 let priceOldX18 = calcPriceBigInt(toX18(prBalanceOld, cfgPriceAssetDecimals), toX18(amBalanceOld, cfgAmountAssetDecimals))
593593 let priceOld = fromX18(priceOldX18, scale8)
594594 let loss = {
595595 let amountBothInPaymentAsset = (toInt(fraction(balanceBigInt, redeemedBigInt, supplyBigInt)) * 2)
596596 fraction((totalAmount - amountBothInPaymentAsset), scale8, amountBothInPaymentAsset)
597597 }
598598 $Tuple5(totalAmount, commonState, feeAmount, loss, outInAmountAsset)
599599 }
600600 else throw("Strict value is not equal to itself.")
601601 }
602602
603603
604604 func managerPublicKeyOrUnit () = match getString(mpk()) {
605605 case s: String =>
606606 fromBase58String(s)
607607 case _: Unit =>
608608 unit
609609 case _ =>
610610 throw("Match error")
611611 }
612612
613613
614614 func pendingManagerPublicKeyOrUnit () = match getString(pmpk()) {
615615 case s: String =>
616616 fromBase58String(s)
617617 case _: Unit =>
618618 unit
619619 case _ =>
620620 throw("Match error")
621621 }
622622
623623
624624 func isManager (i) = match managerPublicKeyOrUnit() {
625625 case pk: ByteVector =>
626626 (i.callerPublicKey == pk)
627627 case _: Unit =>
628628 (i.caller == this)
629629 case _ =>
630630 throw("Match error")
631631 }
632632
633633
634634 func mustManager (i) = {
635635 let pd = throw("Permission denied")
636636 match managerPublicKeyOrUnit() {
637637 case pk: ByteVector =>
638638 if ((i.callerPublicKey == pk))
639639 then true
640640 else pd
641641 case _: Unit =>
642642 if ((i.caller == this))
643643 then true
644644 else pd
645645 case _ =>
646646 throw("Match error")
647647 }
648648 }
649649
650650
651651 @Callable(i)
652652 func setManager (pendingManagerPublicKey) = {
653653 let checkCaller = mustManager(i)
654654 if ((checkCaller == checkCaller))
655655 then {
656656 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
657657 if ((checkManagerPublicKey == checkManagerPublicKey))
658658 then [StringEntry(pmpk(), pendingManagerPublicKey)]
659659 else throw("Strict value is not equal to itself.")
660660 }
661661 else throw("Strict value is not equal to itself.")
662662 }
663663
664664
665665
666666 @Callable(i)
667667 func confirmManager () = {
668668 let pm = pendingManagerPublicKeyOrUnit()
669669 let hasPM = if (isDefined(pm))
670670 then true
671671 else throw("No pending manager")
672672 if ((hasPM == hasPM))
673673 then {
674674 let checkPM = if ((i.callerPublicKey == value(pm)))
675675 then true
676676 else throw("You are not pending manager")
677677 if ((checkPM == checkPM))
678678 then [StringEntry(mpk(), toBase58String(value(pm))), DeleteEntry(pmpk())]
679679 else throw("Strict value is not equal to itself.")
680680 }
681681 else throw("Strict value is not equal to itself.")
682682 }
683683
684684
685685
686686 @Callable(i)
687687 func put (slippageTolerance,shouldAutoStake) = if ((0 > slippageTolerance))
688688 then throw("Invalid slippageTolerance passed")
689689 else {
690690 let estPut = commonPut(i, slippageTolerance, true)
691691 let emitLpAmt = estPut._2
692692 let lpAssetId = estPut._7
693693 let state = estPut._9
694694 let amDiff = estPut._10
695695 let prDiff = estPut._11
696696 let amId = estPut._12
697697 let prId = estPut._13
698698 let emitInv = invoke(factoryContract, "emit", [emitLpAmt], nil)
699699 if ((emitInv == emitInv))
700700 then {
701701 let emitInvLegacy = match emitInv {
702702 case legacyFactoryContract: Address =>
703703 invoke(legacyFactoryContract, "emit", [emitLpAmt], nil)
704704 case _ =>
705705 unit
706706 }
707707 if ((emitInvLegacy == emitInvLegacy))
708708 then {
709709 let slippageAInv = if ((amDiff > 0))
710710 then invoke(slippageContract, "put", nil, [AttachedPayment(amId, amDiff)])
711711 else nil
712712 if ((slippageAInv == slippageAInv))
713713 then {
714714 let slippagePInv = if ((prDiff > 0))
715715 then invoke(slippageContract, "put", nil, [AttachedPayment(prId, prDiff)])
716716 else nil
717717 if ((slippagePInv == slippagePInv))
718718 then {
719719 let lpTransfer = if (shouldAutoStake)
720720 then {
721721 let slpStakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)])
722722 if ((slpStakeInv == slpStakeInv))
723723 then nil
724724 else throw("Strict value is not equal to itself.")
725725 }
726726 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
727727 let $t03153331598 = refreshKLpInternal(0, 0, 0)
728728 let refreshKLpActions = $t03153331598._1
729729 let updatedKLp = $t03153331598._2
730730 ((state ++ lpTransfer) ++ refreshKLpActions)
731731 }
732732 else throw("Strict value is not equal to itself.")
733733 }
734734 else throw("Strict value is not equal to itself.")
735735 }
736736 else throw("Strict value is not equal to itself.")
737737 }
738738 else throw("Strict value is not equal to itself.")
739739 }
740740
741741
742742
743743 @Callable(i)
744744 func putForFree (maxSlippage) = if ((0 > maxSlippage))
745745 then throw("Invalid value passed")
746746 else {
747747 let estPut = commonPut(i, maxSlippage, false)
748748 let state = estPut._9
749749 let $t03188431949 = refreshKLpInternal(0, 0, 0)
750750 let refreshKLpActions = $t03188431949._1
751751 let updatedKLp = $t03188431949._2
752752 (state ++ refreshKLpActions)
753753 }
754754
755755
756756
757757 @Callable(i)
758758 func putOneTkn (minOutAmount,autoStake) = {
759759 let isPoolOneTokenOperationsDisabled = {
760760 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
761761 if ($isInstanceOf(@, "Boolean"))
762762 then @
763763 else throw(($getType(@) + " couldn't be cast to Boolean"))
764764 }
765765 let isPutDisabled = if (if (if (isGlobalShutdown())
766766 then true
767767 else (cfgPoolStatus == PoolPutDisabled))
768768 then true
769769 else (cfgPoolStatus == PoolShutdown))
770770 then true
771771 else isPoolOneTokenOperationsDisabled
772772 let checks = [if (if (!(isPutDisabled))
773773 then true
774774 else isManager(i))
775775 then true
776776 else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1))
777777 then true
778778 else throwErr("exactly 1 payment are expected")]
779779 if ((checks == checks))
780780 then {
781781 let payment = i.payments[0]
782782 let paymentAssetId = payment.assetId
783783 let paymentAmountRaw = payment.amount
784784 let userAddress = i.caller
785785 let txId = i.transactionId
786- let $t03272532874 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
787- let emitAmountEstimated = $t03272532874._1
788- let commonState = $t03272532874._2
789- let feeAmount = $t03272532874._3
790- let bonus = $t03272532874._4
791- let paymentInAmountAsset = $t03272532874._5
792- let emitAmount = if (if ((minOutAmount > 0))
793- then (minOutAmount > emitAmountEstimated)
794- else false)
795- then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
796- else emitAmountEstimated
797- let emitInv = emit(emitAmount)
798- if ((emitInv == emitInv))
786+ let $t03272532877 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
787+ if (($t03272532877 == $t03272532877))
799788 then {
800- let lpTransfer = if (autoStake)
789+ let paymentInAmountAsset = $t03272532877._5
790+ let bonus = $t03272532877._4
791+ let feeAmount = $t03272532877._3
792+ let commonState = $t03272532877._2
793+ let emitAmountEstimated = $t03272532877._1
794+ let emitAmount = if (if ((minOutAmount > 0))
795+ then (minOutAmount > emitAmountEstimated)
796+ else false)
797+ then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
798+ else emitAmountEstimated
799+ let emitInv = emit(emitAmount)
800+ if ((emitInv == emitInv))
801801 then {
802- let stakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(cfgLpAssetId, emitAmount)])
803- if ((stakeInv == stakeInv))
804- then nil
805- else throw("Strict value is not equal to itself.")
802+ let lpTransfer = if (autoStake)
803+ then {
804+ let stakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(cfgLpAssetId, emitAmount)])
805+ if ((stakeInv == stakeInv))
806+ then nil
807+ else throw("Strict value is not equal to itself.")
808+ }
809+ else [ScriptTransfer(i.caller, emitAmount, cfgLpAssetId)]
810+ let sendFee = if ((feeAmount > 0))
811+ then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
812+ else nil
813+ let $t03346333660 = if ((this == feeCollectorAddress))
814+ then $Tuple2(0, 0)
815+ else if (paymentInAmountAsset)
816+ then $Tuple2(-(feeAmount), 0)
817+ else $Tuple2(0, -(feeAmount))
818+ let amountAssetBalanceDelta = $t03346333660._1
819+ let priceAssetBalanceDelta = $t03346333660._2
820+ let $t03366333771 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
821+ let refreshKLpActions = $t03366333771._1
822+ let updatedKLp = $t03366333771._2
823+ $Tuple2((((commonState ++ lpTransfer) ++ sendFee) ++ refreshKLpActions), emitAmount)
806824 }
807- else [ScriptTransfer(i.caller, emitAmount, cfgLpAssetId)]
808- let sendFee = if ((feeAmount > 0))
809- then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
810- else nil
811- let $t03346033657 = if ((this == feeCollectorAddress))
812- then $Tuple2(0, 0)
813- else if (paymentInAmountAsset)
814- then $Tuple2(-(feeAmount), 0)
815- else $Tuple2(0, -(feeAmount))
816- let amountAssetBalanceDelta = $t03346033657._1
817- let priceAssetBalanceDelta = $t03346033657._2
818- let $t03366033768 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
819- let refreshKLpActions = $t03366033768._1
820- let updatedKLp = $t03366033768._2
821- $Tuple2((((commonState ++ lpTransfer) ++ sendFee) ++ refreshKLpActions), emitAmount)
825+ else throw("Strict value is not equal to itself.")
822826 }
823827 else throw("Strict value is not equal to itself.")
824828 }
825829 else throw("Strict value is not equal to itself.")
826830 }
827831
828832
829833
830834 @Callable(i)
831835 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
832- let $t03396134118 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
833- let emitAmountEstimated = $t03396134118._1
834- let commonState = $t03396134118._2
835- let feeAmount = $t03396134118._3
836- let bonus = $t03396134118._4
837- let paymentInAmountAsset = $t03396134118._5
836+ let $t03396434121 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
837+ let emitAmountEstimated = $t03396434121._1
838+ let commonState = $t03396434121._2
839+ let feeAmount = $t03396434121._3
840+ let bonus = $t03396434121._4
841+ let paymentInAmountAsset = $t03396434121._5
838842 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
839843 }
840844
841845
842846
843847 @Callable(i)
844848 func getOneTkn (outAssetIdStr,minOutAmount) = {
845849 let isPoolOneTokenOperationsDisabled = {
846850 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
847851 if ($isInstanceOf(@, "Boolean"))
848852 then @
849853 else throw(($getType(@) + " couldn't be cast to Boolean"))
850854 }
851855 let isGetDisabled = if (if (isGlobalShutdown())
852856 then true
853857 else (cfgPoolStatus == PoolShutdown))
854858 then true
855859 else isPoolOneTokenOperationsDisabled
856860 let checks = [if (if (!(isGetDisabled))
857861 then true
858862 else isManager(i))
859863 then true
860864 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1))
861865 then true
862866 else throwErr("exactly 1 payment are expected")]
863867 if ((checks == checks))
864868 then {
865869 let outAssetId = parseAssetId(outAssetIdStr)
866870 let payment = i.payments[0]
867871 let paymentAssetId = payment.assetId
868872 let paymentAmount = payment.amount
869873 let userAddress = i.caller
870874 let txId = i.transactionId
871- let $t03492335073 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
872- let amountEstimated = $t03492335073._1
873- let commonState = $t03492335073._2
874- let feeAmount = $t03492335073._3
875- let bonus = $t03492335073._4
876- let outInAmountAsset = $t03492335073._5
877- let amount = if (if ((minOutAmount > 0))
878- then (minOutAmount > amountEstimated)
879- else false)
880- then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
881- else amountEstimated
882- let burnInv = invoke(factoryContract, "burn", [paymentAmount], [AttachedPayment(paymentAssetId, paymentAmount)])
883- if ((burnInv == burnInv))
875+ let $t03492635079 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
876+ if (($t03492635079 == $t03492635079))
884877 then {
885- let assetTransfer = [ScriptTransfer(userAddress, amount, outAssetId)]
886- let sendFee = if ((feeAmount > 0))
887- then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
888- else nil
889- let $t03557335820 = {
890- let feeAmountForCalc = if ((this == feeCollectorAddress))
891- then 0
892- else feeAmount
893- if (outInAmountAsset)
894- then $Tuple2(-((amount + feeAmountForCalc)), 0)
895- else $Tuple2(0, -((amount + feeAmountForCalc)))
896- }
897- let amountAssetBalanceDelta = $t03557335820._1
898- let priceAssetBalanceDelta = $t03557335820._2
899- let $t03582335931 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
900- let refreshKLpActions = $t03582335931._1
901- let updatedKLp = $t03582335931._2
902- $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
878+ let outInAmountAsset = $t03492635079._5
879+ let bonus = $t03492635079._4
880+ let feeAmount = $t03492635079._3
881+ let commonState = $t03492635079._2
882+ let amountEstimated = $t03492635079._1
883+ let amount = if (if ((minOutAmount > 0))
884+ then (minOutAmount > amountEstimated)
885+ else false)
886+ then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
887+ else amountEstimated
888+ let burnInv = invoke(factoryContract, "burn", [paymentAmount], [AttachedPayment(paymentAssetId, paymentAmount)])
889+ if ((burnInv == burnInv))
890+ then {
891+ let assetTransfer = [ScriptTransfer(userAddress, amount, outAssetId)]
892+ let sendFee = if ((feeAmount > 0))
893+ then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
894+ else nil
895+ let $t03557935826 = {
896+ let feeAmountForCalc = if ((this == feeCollectorAddress))
897+ then 0
898+ else feeAmount
899+ if (outInAmountAsset)
900+ then $Tuple2(-((amount + feeAmountForCalc)), 0)
901+ else $Tuple2(0, -((amount + feeAmountForCalc)))
902+ }
903+ let amountAssetBalanceDelta = $t03557935826._1
904+ let priceAssetBalanceDelta = $t03557935826._2
905+ let $t03582935937 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
906+ let refreshKLpActions = $t03582935937._1
907+ let updatedKLp = $t03582935937._2
908+ $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
909+ }
910+ else throw("Strict value is not equal to itself.")
903911 }
904912 else throw("Strict value is not equal to itself.")
905913 }
906914 else throw("Strict value is not equal to itself.")
907915 }
908916
909917
910918
911919 @Callable(i)
912920 func getOneTknREADONLY (outAssetId,paymentAmount) = {
913- let $t03611536271 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
914- let amountEstimated = $t03611536271._1
915- let commonState = $t03611536271._2
916- let feeAmount = $t03611536271._3
917- let bonus = $t03611536271._4
918- let outInAmountAsset = $t03611536271._5
921+ let $t03612136277 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
922+ let amountEstimated = $t03612136277._1
923+ let commonState = $t03612136277._2
924+ let feeAmount = $t03612136277._3
925+ let bonus = $t03612136277._4
926+ let outInAmountAsset = $t03612136277._5
919927 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
920928 }
921929
922930
923931
924932 @Callable(i)
925933 func unstakeAndGetOneTkn (unstakeAmount,outAssetIdStr,minOutAmount) = {
926934 let isPoolOneTokenOperationsDisabled = {
927935 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
928936 if ($isInstanceOf(@, "Boolean"))
929937 then @
930938 else throw(($getType(@) + " couldn't be cast to Boolean"))
931939 }
932940 let isGetDisabled = if (if (isGlobalShutdown())
933941 then true
934942 else (cfgPoolStatus == PoolShutdown))
935943 then true
936944 else isPoolOneTokenOperationsDisabled
937945 let checks = [if (if (!(isGetDisabled))
938946 then true
939947 else isManager(i))
940948 then true
941949 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 0))
942950 then true
943951 else throwErr("no payments are expected")]
944952 if ((checks == checks))
945953 then {
946954 let outAssetId = parseAssetId(outAssetIdStr)
947955 let userAddress = i.caller
948956 let txId = i.transactionId
949957 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
950958 if ((unstakeInv == unstakeInv))
951959 then {
952- let $t03709637244 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
953- let amountEstimated = $t03709637244._1
954- let commonState = $t03709637244._2
955- let feeAmount = $t03709637244._3
956- let bonus = $t03709637244._4
957- let outInAmountAsset = $t03709637244._5
958- let amount = if (if ((minOutAmount > 0))
959- then (minOutAmount > amountEstimated)
960- else false)
961- then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
962- else amountEstimated
963- let burnInv = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
964- if ((burnInv == burnInv))
960+ let $t03710237253 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
961+ if (($t03710237253 == $t03710237253))
965962 then {
966- let assetTransfer = [ScriptTransfer(i.caller, amount, outAssetId)]
967- let sendFee = if ((feeAmount > 0))
968- then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
969- else nil
970- let $t03773937986 = {
971- let feeAmountForCalc = if ((this == feeCollectorAddress))
972- then 0
973- else feeAmount
974- if (outInAmountAsset)
975- then $Tuple2(-((amount + feeAmountForCalc)), 0)
976- else $Tuple2(0, -((amount + feeAmountForCalc)))
977- }
978- let amountAssetBalanceDelta = $t03773937986._1
979- let priceAssetBalanceDelta = $t03773937986._2
980- let $t03798938097 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
981- let refreshKLpActions = $t03798938097._1
982- let updatedKLp = $t03798938097._2
983- $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
963+ let outInAmountAsset = $t03710237253._5
964+ let bonus = $t03710237253._4
965+ let feeAmount = $t03710237253._3
966+ let commonState = $t03710237253._2
967+ let amountEstimated = $t03710237253._1
968+ let amount = if (if ((minOutAmount > 0))
969+ then (minOutAmount > amountEstimated)
970+ else false)
971+ then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
972+ else amountEstimated
973+ let burnInv = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
974+ if ((burnInv == burnInv))
975+ then {
976+ let assetTransfer = [ScriptTransfer(i.caller, amount, outAssetId)]
977+ let sendFee = if ((feeAmount > 0))
978+ then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
979+ else nil
980+ let $t03774837995 = {
981+ let feeAmountForCalc = if ((this == feeCollectorAddress))
982+ then 0
983+ else feeAmount
984+ if (outInAmountAsset)
985+ then $Tuple2(-((amount + feeAmountForCalc)), 0)
986+ else $Tuple2(0, -((amount + feeAmountForCalc)))
987+ }
988+ let amountAssetBalanceDelta = $t03774837995._1
989+ let priceAssetBalanceDelta = $t03774837995._2
990+ let $t03799838106 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
991+ let refreshKLpActions = $t03799838106._1
992+ let updatedKLp = $t03799838106._2
993+ $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
994+ }
995+ else throw("Strict value is not equal to itself.")
984996 }
985997 else throw("Strict value is not equal to itself.")
986998 }
987999 else throw("Strict value is not equal to itself.")
9881000 }
9891001 else throw("Strict value is not equal to itself.")
9901002 }
9911003
9921004
9931005
9941006 @Callable(i)
9951007 func get () = {
9961008 let res = commonGet(i)
9971009 let outAmtAmt = res._1
9981010 let outPrAmt = res._2
9991011 let pmtAmt = res._3
10001012 let pmtAssetId = res._4
10011013 let state = res._5
10021014 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
10031015 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
10041016 then {
1005- let $t03888938971 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1006- let refreshKLpActions = $t03888938971._1
1007- let updatedKLp = $t03888938971._2
1017+ let $t03889838980 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1018+ let refreshKLpActions = $t03889838980._1
1019+ let updatedKLp = $t03889838980._2
10081020 (state ++ refreshKLpActions)
10091021 }
10101022 else throw("Strict value is not equal to itself.")
10111023 }
10121024
10131025
10141026
10151027 @Callable(i)
10161028 func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = {
10171029 let res = commonGet(i)
10181030 let outAmAmt = res._1
10191031 let outPrAmt = res._2
10201032 let pmtAmt = res._3
10211033 let pmtAssetId = res._4
10221034 let state = res._5
10231035 if ((noLessThenAmtAsset > outAmAmt))
10241036 then throw(((("noLessThenAmtAsset failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset)))
10251037 else if ((noLessThenPriceAsset > outPrAmt))
10261038 then throw(((("noLessThenPriceAsset failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset)))
10271039 else {
10281040 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
10291041 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
10301042 then {
1031- let $t03976739848 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1032- let refreshKLpActions = $t03976739848._1
1033- let updatedKLp = $t03976739848._2
1043+ let $t03977639857 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1044+ let refreshKLpActions = $t03977639857._1
1045+ let updatedKLp = $t03977639857._2
10341046 (state ++ refreshKLpActions)
10351047 }
10361048 else throw("Strict value is not equal to itself.")
10371049 }
10381050 }
10391051
10401052
10411053
10421054 @Callable(i)
10431055 func unstakeAndGet (amount) = {
10441056 let checkPayments = if ((size(i.payments) != 0))
10451057 then throw("No payments are expected")
10461058 else true
10471059 if ((checkPayments == checkPayments))
10481060 then {
10491061 let cfg = getPoolConfig()
10501062 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
10511063 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(lpAssetId), amount], nil)
10521064 if ((unstakeInv == unstakeInv))
10531065 then {
10541066 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller)
10551067 let outAmAmt = res._1
10561068 let outPrAmt = res._2
10571069 let poolStatus = parseIntValue(res._9)
10581070 let state = res._10
10591071 let checkPoolStatus = if (if (isGlobalShutdown())
10601072 then true
10611073 else (poolStatus == PoolShutdown))
10621074 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
10631075 else true
10641076 if ((checkPoolStatus == checkPoolStatus))
10651077 then {
10661078 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
10671079 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
10681080 then {
1069- let $t04082140902 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1070- let refreshKLpActions = $t04082140902._1
1071- let updatedKLp = $t04082140902._2
1081+ let $t04083040911 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1082+ let refreshKLpActions = $t04083040911._1
1083+ let updatedKLp = $t04083040911._2
10721084 (state ++ refreshKLpActions)
10731085 }
10741086 else throw("Strict value is not equal to itself.")
10751087 }
10761088 else throw("Strict value is not equal to itself.")
10771089 }
10781090 else throw("Strict value is not equal to itself.")
10791091 }
10801092 else throw("Strict value is not equal to itself.")
10811093 }
10821094
10831095
10841096
10851097 @Callable(i)
10861098 func unstakeAndGetNoLess (unstakeAmount,noLessThenAmountAsset,noLessThenPriceAsset) = {
10871099 let isGetDisabled = if (isGlobalShutdown())
10881100 then true
10891101 else (cfgPoolStatus == PoolShutdown)
10901102 let checks = [if (!(isGetDisabled))
10911103 then true
10921104 else throw("get operation is blocked by admin"), if ((size(i.payments) == 0))
10931105 then true
10941106 else throw("no payments are expected")]
10951107 if ((checks == checks))
10961108 then {
10971109 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
10981110 if ((unstakeInv == unstakeInv))
10991111 then {
11001112 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller)
11011113 let outAmAmt = res._1
11021114 let outPrAmt = res._2
11031115 let state = res._10
11041116 let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset))
11051117 then true
11061118 else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset))
11071119 then true
11081120 else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))]
11091121 if ((checkAmounts == checkAmounts))
11101122 then {
11111123 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
11121124 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
11131125 then {
1114- let $t04204242123 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1115- let refreshKLpActions = $t04204242123._1
1116- let updatedKLp = $t04204242123._2
1126+ let $t04205142132 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1127+ let refreshKLpActions = $t04205142132._1
1128+ let updatedKLp = $t04205142132._2
11171129 (state ++ refreshKLpActions)
11181130 }
11191131 else throw("Strict value is not equal to itself.")
11201132 }
11211133 else throw("Strict value is not equal to itself.")
11221134 }
11231135 else throw("Strict value is not equal to itself.")
11241136 }
11251137 else throw("Strict value is not equal to itself.")
11261138 }
11271139
11281140
11291141
11301142 @Callable(i)
11311143 func activate (amtAssetStr,priceAssetStr) = if ((toString(i.caller) != toString(factoryContract)))
11321144 then throw("permissions denied")
11331145 else $Tuple2([StringEntry(aa(), amtAssetStr), StringEntry(pa(), priceAssetStr)], "success")
11341146
11351147
11361148
11371149 @Callable(i)
11381150 func refreshKLp () = {
11391151 let lastRefreshedBlockHeight = valueOrElse(getInteger(keyKLpRefreshedHeight), 0)
11401152 let checkLastRefreshedBlockHeight = if (((height - lastRefreshedBlockHeight) >= kLpRefreshDelay))
11411153 then unit
11421154 else throwErr(makeString([toString(kLpRefreshDelay), " blocks have not passed since the previous call"], ""))
11431155 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
11441156 then {
1145- let $t04311143166 = refreshKLpInternal(0, 0, 0)
1146- let actions = $t04311143166._1
1147- let updatedKLp = $t04311143166._2
1157+ let $t04312043175 = refreshKLpInternal(0, 0, 0)
1158+ let actions = $t04312043175._1
1159+ let updatedKLp = $t04312043175._2
11481160 $Tuple2(actions, toString(updatedKLp))
11491161 }
11501162 else throw("Strict value is not equal to itself.")
11511163 }
11521164
11531165
11541166
11551167 @Callable(i)
11561168 func getPoolConfigWrapperREADONLY () = $Tuple2(nil, getPoolConfig())
11571169
11581170
11591171
11601172 @Callable(i)
11611173 func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId))
11621174
11631175
11641176
11651177 @Callable(i)
11661178 func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = {
11671179 let prices = calcPrices(amAmt, prAmt, lpAmt)
11681180 $Tuple2(nil, [toString(prices[0]), toString(prices[1]), toString(prices[2])])
11691181 }
11701182
11711183
11721184
11731185 @Callable(i)
11741186 func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(toX18(origVal, origScaleMult)))
11751187
11761188
11771189
11781190 @Callable(i)
11791191 func fromX18WrapperREADONLY (val,resultScaleMult) = $Tuple2(nil, fromX18(parseBigIntValue(val), resultScaleMult))
11801192
11811193
11821194
11831195 @Callable(i)
11841196 func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(calcPriceBigInt(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18))))
11851197
11861198
11871199
11881200 @Callable(i)
11891201 func estimatePutOperationWrapperREADONLY (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = $Tuple2(nil, estimatePutOperation(txId58, slippageTolerance, inAmAssetAmt, inAmAssetId, inPrAssetAmt, inPrAssetId, userAddress, isEvaluate, emitLp))
11901202
11911203
11921204
11931205 @Callable(i)
11941206 func estimateGetOperationWrapperREADONLY (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
11951207 let res = estimateGetOperation(txId58, pmtAssetId, pmtLpAmt, addressFromStringValue(userAddress))
11961208 $Tuple2(nil, $Tuple10(res._1, res._2, res._3, res._4, res._5, res._6, res._7, toString(res._8), res._9, res._10))
11971209 }
11981210
11991211
12001212
12011213 @Callable(i)
12021214 func statsREADONLY () = {
12031215 let cfg = getPoolConfig()
12041216 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
12051217 let amtAssetId = cfg[idxAmtAssetId]
12061218 let priceAssetId = cfg[idxPriceAssetId]
12071219 let iAmtAssetId = cfg[idxIAmtAssetId]
12081220 let iPriceAssetId = cfg[idxIPriceAssetId]
12091221 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
12101222 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
12111223 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
12121224 let accAmtAssetBalance = getAccBalance(amtAssetId)
12131225 let accPriceAssetBalance = getAccBalance(priceAssetId)
12141226 let pricesList = if ((poolLPBalance == 0))
12151227 then [zeroBigInt, zeroBigInt, zeroBigInt]
12161228 else calcPrices(accAmtAssetBalance, accPriceAssetBalance, poolLPBalance)
12171229 let curPrice = 0
12181230 let lpAmtAssetShare = fromX18(pricesList[1], scale8)
12191231 let lpPriceAssetShare = fromX18(pricesList[2], scale8)
12201232 let poolWeight = value(getInteger(factoryContract, keyPoolWeight(toString(this))))
12211233 $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))
12221234 }
12231235
12241236
12251237
12261238 @Callable(i)
12271239 func evaluatePutByAmountAssetREADONLY (inAmAssetAmt) = {
12281240 let cfg = getPoolConfig()
12291241 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
12301242 let amAssetIdStr = cfg[idxAmtAssetId]
12311243 let amAssetId = fromBase58String(amAssetIdStr)
12321244 let prAssetIdStr = cfg[idxPriceAssetId]
12331245 let prAssetId = fromBase58String(prAssetIdStr)
12341246 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
12351247 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
12361248 let poolStatus = cfg[idxPoolStatus]
12371249 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
12381250 let accAmtAssetBalance = getAccBalance(amAssetIdStr)
12391251 let accPriceAssetBalance = getAccBalance(prAssetIdStr)
12401252 let amtAssetAmtX18 = toX18(accAmtAssetBalance, amtAssetDcm)
12411253 let priceAssetAmtX18 = toX18(accPriceAssetBalance, priceAssetDcm)
12421254 let curPriceX18 = if ((poolLPBalance == 0))
12431255 then zeroBigInt
12441256 else calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
12451257 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
12461258 let inPrAssetAmtX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18)
12471259 let inPrAssetAmt = fromX18(inPrAssetAmtX18, priceAssetDcm)
12481260 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
12491261 let calcLpAmt = estPut._1
12501262 let curPriceCalc = estPut._3
12511263 let amBalance = estPut._4
12521264 let prBalance = estPut._5
12531265 let lpEmission = estPut._6
12541266 $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))
12551267 }
12561268
12571269
12581270
12591271 @Callable(i)
12601272 func evaluatePutByPriceAssetREADONLY (inPrAssetAmt) = {
12611273 let cfg = getPoolConfig()
12621274 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
12631275 let amAssetIdStr = cfg[idxAmtAssetId]
12641276 let amAssetId = fromBase58String(amAssetIdStr)
12651277 let prAssetIdStr = cfg[idxPriceAssetId]
12661278 let prAssetId = fromBase58String(prAssetIdStr)
12671279 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
12681280 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
12691281 let poolStatus = cfg[idxPoolStatus]
12701282 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
12711283 let amBalanceRaw = getAccBalance(amAssetIdStr)
12721284 let prBalanceRaw = getAccBalance(prAssetIdStr)
12731285 let amBalanceRawX18 = toX18(amBalanceRaw, amtAssetDcm)
12741286 let prBalanceRawX18 = toX18(prBalanceRaw, priceAssetDcm)
12751287 let curPriceX18 = if ((poolLPBalance == 0))
12761288 then zeroBigInt
12771289 else calcPriceBigInt(prBalanceRawX18, amBalanceRawX18)
12781290 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
12791291 let inAmAssetAmtX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
12801292 let inAmAssetAmt = fromX18(inAmAssetAmtX18, amtAssetDcm)
12811293 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
12821294 let calcLpAmt = estPut._1
12831295 let curPriceCalc = estPut._3
12841296 let amBalance = estPut._4
12851297 let prBalance = estPut._5
12861298 let lpEmission = estPut._6
12871299 $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))
12881300 }
12891301
12901302
12911303
12921304 @Callable(i)
12931305 func evaluateGetREADONLY (paymentLpAssetId,paymentLpAmt) = {
12941306 let res = estimateGetOperation("", paymentLpAssetId, paymentLpAmt, this)
12951307 let outAmAmt = res._1
12961308 let outPrAmt = res._2
12971309 let amBalance = res._5
12981310 let prBalance = res._6
12991311 let lpEmission = res._7
13001312 let curPrice = res._8
13011313 let poolStatus = parseIntValue(res._9)
13021314 $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))
13031315 }
13041316
13051317
13061318 @Verifier(tx)
13071319 func verify () = {
13081320 let targetPublicKey = match managerPublicKeyOrUnit() {
13091321 case pk: ByteVector =>
13101322 pk
13111323 case _: Unit =>
13121324 tx.senderPublicKey
13131325 case _ =>
13141326 throw("Match error")
13151327 }
13161328 match tx {
13171329 case order: Order =>
13181330 let matcherPub = getMatcherPubOrFail()
13191331 let orderValid = validateMatcherOrderAllowed(order)
13201332 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
13211333 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
13221334 if (if (if (orderValid)
13231335 then senderValid
13241336 else false)
13251337 then matcherValid
13261338 else false)
13271339 then true
13281340 else throwOrderError(orderValid, senderValid, matcherValid)
13291341 case s: SetScriptTransaction =>
13301342 let newHash = blake2b256(value(s.script))
13311343 let allowedHash = fromBase64String(value(getString(factoryContract, keyAllowedLpScriptHash())))
13321344 let currentHash = scriptHash(this)
13331345 if (if ((allowedHash == newHash))
13341346 then (currentHash != newHash)
13351347 else false)
13361348 then true
13371349 else sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
13381350 case _ =>
13391351 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
13401352 }
13411353 }
13421354

github/deemru/w8io/026f985 
121.81 ms