tx · EJDCo42Hy2Z7HxLctAaJkeW8znhnSznqfYg5qwSf9NrC

3N6wAa7PMFZJu4Zrmp3avXmMnRTrRpMM9Lh:  -0.03500000 Waves

2022.12.07 11:53 [2349708] smart account 3N6wAa7PMFZJu4Zrmp3avXmMnRTrRpMM9Lh > SELF 0.00000000 Waves

{ "type": 13, "id": "EJDCo42Hy2Z7HxLctAaJkeW8znhnSznqfYg5qwSf9NrC", "fee": 3500000, "feeAssetId": null, "timestamp": 1670403108936, "version": 1, "sender": "3N6wAa7PMFZJu4Zrmp3avXmMnRTrRpMM9Lh", "senderPublicKey": "Cr8D7eozSzJh7XHsYTjBinPpo3SS83BrCGiBAJsjGxBo", "proofs": [ "46v33xTmYADAcxk1NkzLZFNBa5N2RT622g5CA8AnTMbGqaKL49Cgpg3eiqPtF4LAVD5prnkN1FCC4SWRN29JNek4" ], "script": "base64:BgLfLAgCEgMKAQgSABIECgIBBBIDCgEBEgQKAgEEEgQKAggBEgQKAggBEgQKAggBEgUKAwEIARIAEgQKAgEBEgMKAQESBQoDAQEBEgQKAggIEgASABIDCgEIEgUKAwEBARIECgIBARIECgIIARIECgIICBILCgkIAQECAQIIBAQSBgoECAgBCBIAEgMKAQESAwoBARIECgIIASIKbFBkZWNpbWFscyIGc2NhbGU4IgxzY2FsZThCaWdJbnQiB3NjYWxlMTgiCnplcm9CaWdJbnQiBGJpZzAiBGJpZzEiBGJpZzIiC3dhdmVzU3RyaW5nIgNTRVAiClBvb2xBY3RpdmUiD1Bvb2xQdXREaXNhYmxlZCITUG9vbE1hdGNoZXJEaXNhYmxlZCIMUG9vbFNodXRkb3duIg5pZHhQb29sQWRkcmVzcyINaWR4UG9vbFN0YXR1cyIQaWR4UG9vbExQQXNzZXRJZCINaWR4QW10QXNzZXRJZCIPaWR4UHJpY2VBc3NldElkIg5pZHhBbXRBc3NldERjbSIQaWR4UHJpY2VBc3NldERjbSIOaWR4SUFtdEFzc2V0SWQiEGlkeElQcmljZUFzc2V0SWQiDWlk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cGCQECYXkDBQJhegUCYUEFAmFCAwkAAQIFAmRLAhRTZXRTY3JpcHRUcmFuc2FjdGlvbgQCZU4FAmRLBAJnQwkA9gMBCQEFdmFsdWUBCAUCZU4Gc2NyaXB0BAJnRAkA2wQBCQEFdmFsdWUBCQCdCAIFAmFKCQECYXcABAJnRQkA8QcBBQR0aGlzAwMJAAACBQJnRAUCZ0MJAQIhPQIFAmdFBQJnQwcGCQD0AwMIBQJneQlib2R5Qnl0ZXMJAJEDAggFAmd5BnByb29mcwAABQJnQQkA9AMDCAUCZ3kJYm9keUJ5dGVzCQCRAwIIBQJneQZwcm9vZnMAAAUCZ0EJxIri", "chainId": 84, "height": 2349708, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4ZTUFd8ukDvbmoaAiTAU7Scbq6iLjEu18qJdVDXAYJgd Next: 6WQ9NcgiS6WLbNDgbG33mpvTEQ3Gw5bVF7ViZ95HjTso Diff:
OldNewDifferences
849849 let $t03489034998 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
850850 let refreshKLpActions = $t03489034998._1
851851 let updatedKLp = $t03489034998._2
852- let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
853- if ((isUpdatedKLpValid == isUpdatedKLpValid))
854- then $Tuple2((((commonState ++ lpTransfer) ++ sendFee) ++ refreshKLpActions), emitAmount)
852+ let kLp = value(getString(keyKLp))
853+ let error = throwErr(makeString([toString(amountAssetBalanceDelta), toString(priceAssetBalanceDelta), kLp, toString(currentKLp), toString(updatedKLp)], " "))
854+ if ((error == error))
855+ then {
856+ let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
857+ if ((isUpdatedKLpValid == isUpdatedKLpValid))
858+ then $Tuple2((((commonState ++ lpTransfer) ++ sendFee) ++ refreshKLpActions), emitAmount)
859+ else throw("Strict value is not equal to itself.")
860+ }
855861 else throw("Strict value is not equal to itself.")
856862 }
857863 else throw("Strict value is not equal to itself.")
865871
866872 @Callable(i)
867873 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
868- let $t03526435421 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
869- let emitAmountEstimated = $t03526435421._1
870- let commonState = $t03526435421._2
871- let feeAmount = $t03526435421._3
872- let bonus = $t03526435421._4
873- let paymentInAmountAsset = $t03526435421._5
874+ let $t03549635653 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
875+ let emitAmountEstimated = $t03549635653._1
876+ let commonState = $t03549635653._2
877+ let feeAmount = $t03549635653._3
878+ let bonus = $t03549635653._4
879+ let paymentInAmountAsset = $t03549635653._5
874880 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
875881 }
876882
905911 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(paymentAmount))
906912 let userAddress = i.caller
907913 let txId = i.transactionId
908- let $t03631536468 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
909- if (($t03631536468 == $t03631536468))
914+ let $t03654736700 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
915+ if (($t03654736700 == $t03654736700))
910916 then {
911- let outInAmountAsset = $t03631536468._5
912- let bonus = $t03631536468._4
913- let feeAmount = $t03631536468._3
914- let commonState = $t03631536468._2
915- let amountEstimated = $t03631536468._1
917+ let outInAmountAsset = $t03654736700._5
918+ let bonus = $t03654736700._4
919+ let feeAmount = $t03654736700._3
920+ let commonState = $t03654736700._2
921+ let amountEstimated = $t03654736700._1
916922 let amount = if (if ((minOutAmount > 0))
917923 then (minOutAmount > amountEstimated)
918924 else false)
925931 let sendFee = if ((feeAmount > 0))
926932 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
927933 else nil
928- let $t03696837215 = {
934+ let $t03720037447 = {
929935 let feeAmountForCalc = if ((this == feeCollectorAddress))
930936 then 0
931937 else feeAmount
933939 then $Tuple2(-((amount + feeAmountForCalc)), 0)
934940 else $Tuple2(0, -((amount + feeAmountForCalc)))
935941 }
936- let amountAssetBalanceDelta = $t03696837215._1
937- let priceAssetBalanceDelta = $t03696837215._2
938- let $t03721837326 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
939- let refreshKLpActions = $t03721837326._1
940- let updatedKLp = $t03721837326._2
942+ let amountAssetBalanceDelta = $t03720037447._1
943+ let priceAssetBalanceDelta = $t03720037447._2
944+ let $t03745037558 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
945+ let refreshKLpActions = $t03745037558._1
946+ let updatedKLp = $t03745037558._2
941947 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
942948 if ((isUpdatedKLpValid == isUpdatedKLpValid))
943949 then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
954960
955961 @Callable(i)
956962 func getOneTknREADONLY (outAssetId,paymentAmount) = {
957- let $t03758337739 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
958- let amountEstimated = $t03758337739._1
959- let commonState = $t03758337739._2
960- let feeAmount = $t03758337739._3
961- let bonus = $t03758337739._4
962- let outInAmountAsset = $t03758337739._5
963+ let $t03781537971 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
964+ let amountEstimated = $t03781537971._1
965+ let commonState = $t03781537971._2
966+ let feeAmount = $t03781537971._3
967+ let bonus = $t03781537971._4
968+ let outInAmountAsset = $t03781537971._5
963969 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
964970 }
965971
9941000 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
9951001 if ((unstakeInv == unstakeInv))
9961002 then {
997- let $t03864138792 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
998- if (($t03864138792 == $t03864138792))
1003+ let $t03887339024 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1004+ if (($t03887339024 == $t03887339024))
9991005 then {
1000- let outInAmountAsset = $t03864138792._5
1001- let bonus = $t03864138792._4
1002- let feeAmount = $t03864138792._3
1003- let commonState = $t03864138792._2
1004- let amountEstimated = $t03864138792._1
1006+ let outInAmountAsset = $t03887339024._5
1007+ let bonus = $t03887339024._4
1008+ let feeAmount = $t03887339024._3
1009+ let commonState = $t03887339024._2
1010+ let amountEstimated = $t03887339024._1
10051011 let amount = if (if ((minOutAmount > 0))
10061012 then (minOutAmount > amountEstimated)
10071013 else false)
10141020 let sendFee = if ((feeAmount > 0))
10151021 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
10161022 else nil
1017- let $t03928739534 = {
1023+ let $t03951939766 = {
10181024 let feeAmountForCalc = if ((this == feeCollectorAddress))
10191025 then 0
10201026 else feeAmount
10221028 then $Tuple2(-((amount + feeAmountForCalc)), 0)
10231029 else $Tuple2(0, -((amount + feeAmountForCalc)))
10241030 }
1025- let amountAssetBalanceDelta = $t03928739534._1
1026- let priceAssetBalanceDelta = $t03928739534._2
1027- let $t03953739645 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1028- let refreshKLpActions = $t03953739645._1
1029- let updatedKLp = $t03953739645._2
1031+ let amountAssetBalanceDelta = $t03951939766._1
1032+ let priceAssetBalanceDelta = $t03951939766._2
1033+ let $t03976939877 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1034+ let refreshKLpActions = $t03976939877._1
1035+ let updatedKLp = $t03976939877._2
10301036 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10311037 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10321038 then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
10551061 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
10561062 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
10571063 then {
1058- let $t04059340675 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1059- let refreshKLpActions = $t04059340675._1
1060- let updatedKLp = $t04059340675._2
1064+ let $t04082540907 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1065+ let refreshKLpActions = $t04082540907._1
1066+ let updatedKLp = $t04082540907._2
10611067 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10621068 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10631069 then (state ++ refreshKLpActions)
10851091 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
10861092 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
10871093 then {
1088- let $t04162641707 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1089- let refreshKLpActions = $t04162641707._1
1090- let updatedKLp = $t04162641707._2
1094+ let $t04185841939 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1095+ let refreshKLpActions = $t04185841939._1
1096+ let updatedKLp = $t04185841939._2
10911097 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10921098 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10931099 then (state ++ refreshKLpActions)
11271133 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
11281134 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
11291135 then {
1130- let $t04283042911 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1131- let refreshKLpActions = $t04283042911._1
1132- let updatedKLp = $t04283042911._2
1136+ let $t04306243143 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1137+ let refreshKLpActions = $t04306243143._1
1138+ let updatedKLp = $t04306243143._2
11331139 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11341140 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11351141 then (state ++ refreshKLpActions)
11761182 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
11771183 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
11781184 then {
1179- let $t04420344284 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1180- let refreshKLpActions = $t04420344284._1
1181- let updatedKLp = $t04420344284._2
1185+ let $t04443544516 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1186+ let refreshKLpActions = $t04443544516._1
1187+ let updatedKLp = $t04443544516._2
11821188 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11831189 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11841190 then (state ++ refreshKLpActions)
12111217 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
12121218 then {
12131219 let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
1214- let $t04547145535 = refreshKLpInternal(0, 0, 0)
1215- let kLpUpdateActions = $t04547145535._1
1216- let updatedKLp = $t04547145535._2
1220+ let $t04570345767 = refreshKLpInternal(0, 0, 0)
1221+ let kLpUpdateActions = $t04570345767._1
1222+ let updatedKLp = $t04570345767._2
12171223 let actions = if ((kLp != updatedKLp))
12181224 then kLpUpdateActions
12191225 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
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, 18, DOWN), big1, lpEmission)
378378 updatedKLp
379379 }
380380
381381
382382 func calcCurrentKLp (amountAssetDelta,priceAssetDelta,lpAssetEmissionDelta) = {
383383 let amountAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) - amountAssetDelta)
384384 let priceAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) - priceAssetDelta)
385385 let lpAssetEmission = (toBigInt(value(assetInfo(cfgLpAssetId)).quantity) - lpAssetEmissionDelta)
386386 let currentKLp = calcKLp(amountAssetBalance, priceAssetBalance, lpAssetEmission)
387387 currentKLp
388388 }
389389
390390
391391 func refreshKLpInternal (amountAssetBalanceDelta,priceAssetBalanceDelta,lpAssetEmissionDelta) = {
392392 let amountAssetBalance = (getAccBalance(assetIdToString(cfgAmountAssetId)) + amountAssetBalanceDelta)
393393 let priceAssetBalance = (getAccBalance(assetIdToString(cfgPriceAssetId)) + priceAssetBalanceDelta)
394394 let lpAssetEmission = (value(assetInfo(cfgLpAssetId)).quantity + lpAssetEmissionDelta)
395395 let updatedKLp = calcKLp(toBigInt(amountAssetBalance), toBigInt(priceAssetBalance), toBigInt(lpAssetEmission))
396396 let actions = [IntegerEntry(keyKLpRefreshedHeight, height), StringEntry(keyKLp, toString(updatedKLp))]
397397 $Tuple2(actions, updatedKLp)
398398 }
399399
400400
401401 func validateUpdatedKLp (oldKLp,updatedKLp) = if ((updatedKLp >= oldKLp))
402402 then true
403403 else throwErr(makeString(["updated KLp lower than current KLp", toString(oldKLp), toString(updatedKLp)], " "))
404404
405405
406406 func validateMatcherOrderAllowed (order) = {
407407 let amountAssetAmount = order.amount
408408 let priceAssetAmount = fraction(order.amount, order.price, scale8, FLOOR)
409409 let $t02030220514 = if ((order.orderType == Buy))
410410 then $Tuple2(amountAssetAmount, -(priceAssetAmount))
411411 else $Tuple2(-(amountAssetAmount), priceAssetAmount)
412412 let amountAssetBalanceDelta = $t02030220514._1
413413 let priceAssetBalanceDelta = $t02030220514._2
414414 if (if (if (isGlobalShutdown())
415415 then true
416416 else (cfgPoolStatus == PoolMatcherDisabled))
417417 then true
418418 else (cfgPoolStatus == PoolShutdown))
419419 then throw("Exchange operations disabled")
420420 else if (if ((order.assetPair.amountAsset != cfgAmountAssetId))
421421 then true
422422 else (order.assetPair.priceAsset != cfgPriceAssetId))
423423 then throw("Wrong order assets.")
424424 else {
425425 let kLp = valueOrErrorMessage(parseBigInt(valueOrErrorMessage(getString(this, keyKLp), fmtErr("kLp is required"))), fmtErr("invalid kLp"))
426426 let $t02098521085 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
427427 let unusedActions = $t02098521085._1
428428 let kLpNew = $t02098521085._2
429429 let isOrderValid = (kLpNew >= kLp)
430430 isOrderValid
431431 }
432432 }
433433
434434
435435 func commonGet (i) = if ((size(i.payments) != 1))
436436 then throw("exactly 1 payment is expected")
437437 else {
438438 let pmt = value(i.payments[0])
439439 let pmtAssetId = value(pmt.assetId)
440440 let pmtAmt = pmt.amount
441441 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller)
442442 let outAmAmt = res._1
443443 let outPrAmt = res._2
444444 let poolStatus = parseIntValue(res._9)
445445 let state = res._10
446446 if (if (isGlobalShutdown())
447447 then true
448448 else (poolStatus == PoolShutdown))
449449 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
450450 else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state)
451451 }
452452
453453
454454 func commonPut (i,slippageTolerance,emitLp) = if ((size(i.payments) != 2))
455455 then throw("exactly 2 payments are expected")
456456 else {
457457 let amAssetPmt = value(i.payments[0])
458458 let prAssetPmt = value(i.payments[1])
459459 let estPut = estimatePutOperation(toBase58String(i.transactionId), slippageTolerance, amAssetPmt.amount, amAssetPmt.assetId, prAssetPmt.amount, prAssetPmt.assetId, toString(i.caller), false, emitLp)
460460 let poolStatus = parseIntValue(estPut._8)
461461 if (if (if (isGlobalShutdown())
462462 then true
463463 else (poolStatus == PoolPutDisabled))
464464 then true
465465 else (poolStatus == PoolShutdown))
466466 then throw(("Put operation is blocked by admin. Status = " + toString(poolStatus)))
467467 else estPut
468468 }
469469
470470
471471 func emit (amount) = {
472472 let emitInv = invoke(factoryContract, "emit", [amount], nil)
473473 if ((emitInv == emitInv))
474474 then {
475475 let emitInvLegacy = match emitInv {
476476 case legacyFactoryContract: Address =>
477477 invoke(legacyFactoryContract, "emit", [amount], nil)
478478 case _ =>
479479 unit
480480 }
481481 if ((emitInvLegacy == emitInvLegacy))
482482 then amount
483483 else throw("Strict value is not equal to itself.")
484484 }
485485 else throw("Strict value is not equal to itself.")
486486 }
487487
488488
489489 func takeFee (amount) = {
490490 let feeAmount = fraction(amount, fee, scale8)
491491 $Tuple2((amount - feeAmount), feeAmount)
492492 }
493493
494494
495495 func calcPutOneToken (paymentAmountRaw,paymentAssetId,userAddress,txId) = {
496496 let isEval = (txId == unit)
497497 let amountBalanceRaw = getAccBalance(assetIdToString(cfgAmountAssetId))
498498 let priceBalanceRaw = getAccBalance(assetIdToString(cfgPriceAssetId))
499499 let paymentInAmountAsset = if ((paymentAssetId == cfgAmountAssetId))
500500 then true
501501 else if ((paymentAssetId == cfgPriceAssetId))
502502 then false
503503 else throwErr("invalid asset")
504504 let $t02377024063 = if (isEval)
505505 then $Tuple2(amountBalanceRaw, priceBalanceRaw)
506506 else if (paymentInAmountAsset)
507507 then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw)
508508 else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw))
509509 let amountBalanceOld = $t02377024063._1
510510 let priceBalanceOld = $t02377024063._2
511511 let $t02406724216 = if (paymentInAmountAsset)
512512 then $Tuple2(paymentAmountRaw, 0)
513513 else $Tuple2(0, paymentAmountRaw)
514514 let amountAssetAmountRaw = $t02406724216._1
515515 let priceAssetAmountRaw = $t02406724216._2
516516 let amountAssetAmount = takeFee(amountAssetAmountRaw)._1
517517 let priceAssetAmount = takeFee(priceAssetAmountRaw)._1
518518 let $t02433824397 = takeFee(paymentAmountRaw)
519519 let paymentAmount = $t02433824397._1
520520 let feeAmount = $t02433824397._2
521521 let amountBalanceNew = (amountBalanceOld + amountAssetAmount)
522522 let priceBalanceNew = (priceBalanceOld + priceAssetAmount)
523523 let priceNewX18 = calcPriceBigInt(toX18(priceBalanceNew, cfgPriceAssetDecimals), toX18(amountBalanceNew, cfgAmountAssetDecimals))
524524 let priceNew = fromX18(priceNewX18, scale8)
525525 let paymentBalance = if (paymentInAmountAsset)
526526 then amountBalanceOld
527527 else priceBalanceOld
528528 let paymentBalanceBigInt = toBigInt(paymentBalance)
529529 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
530530 let chechSupply = if ((supplyBigInt > big0))
531531 then true
532532 else throwErr("initial deposit requires all coins")
533533 if ((chechSupply == chechSupply))
534534 then {
535535 let depositBigInt = toBigInt(paymentAmount)
536536 let issueAmount = max([0, toInt(((supplyBigInt * (sqrtBigInt((scale18 + ((depositBigInt * scale18) / paymentBalanceBigInt)), 18, 18, DOWN) - scale18)) / scale18))])
537537 let commonState = if (isEval)
538538 then nil
539539 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))]
540540 let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, cfgPriceAssetDecimals), toX18(amountBalanceOld, cfgAmountAssetDecimals))
541541 let priceOld = fromX18(priceOldX18, scale8)
542542 let loss = {
543543 let $t02587426041 = if (paymentInAmountAsset)
544544 then $Tuple2(amountAssetAmountRaw, amountBalanceOld)
545545 else $Tuple2(priceAssetAmountRaw, priceBalanceOld)
546546 let amount = $t02587426041._1
547547 let balance = $t02587426041._2
548548 let issueAmountBoth = toInt(fraction(supplyBigInt, toBigInt((amount / 2)), toBigInt(balance)))
549549 fraction((issueAmount - issueAmountBoth), scale8, issueAmountBoth)
550550 }
551551 $Tuple5(issueAmount, commonState, feeAmount, loss, paymentInAmountAsset)
552552 }
553553 else throw("Strict value is not equal to itself.")
554554 }
555555
556556
557557 func calcGetOneToken (outAssetId,paymentAmount,paymentAssetId,userAddress,txId) = {
558558 let isEval = (txId == unit)
559559 let checks = [if ((paymentAssetId == cfgLpAssetId))
560560 then true
561561 else throwErr("invalid lp asset")]
562562 if ((checks == checks))
563563 then {
564564 let outInAmountAsset = if ((outAssetId == cfgAmountAssetId))
565565 then true
566566 else if ((outAssetId == cfgPriceAssetId))
567567 then false
568568 else throwErr("invalid asset")
569569 let balanceBigInt = if (outInAmountAsset)
570570 then toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId)))
571571 else toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId)))
572572 let amBalanceOld = getAccBalance(assetIdToString(cfgAmountAssetId))
573573 let prBalanceOld = getAccBalance(assetIdToString(cfgPriceAssetId))
574574 let outBalance = if (outInAmountAsset)
575575 then amBalanceOld
576576 else prBalanceOld
577577 let outBalanceBigInt = toBigInt(outBalance)
578578 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
579579 let redeemedBigInt = toBigInt(paymentAmount)
580580 let amountRaw = max([0, toInt(((balanceBigInt * (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN))) / scale18))])
581581 let $t02764327693 = takeFee(amountRaw)
582582 let totalAmount = $t02764327693._1
583583 let feeAmount = $t02764327693._2
584584 let $t02769727923 = if (outInAmountAsset)
585585 then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld)
586586 else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw))
587587 let outAmAmount = $t02769727923._1
588588 let outPrAmount = $t02769727923._2
589589 let amBalanceNew = $t02769727923._3
590590 let prBalanceNew = $t02769727923._4
591591 let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, cfgPriceAssetDecimals), toX18(amBalanceNew, cfgAmountAssetDecimals))
592592 let priceNew = fromX18(priceNewX18, scale8)
593593 let commonState = if (isEval)
594594 then nil
595595 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)]
596596 let priceOldX18 = calcPriceBigInt(toX18(prBalanceOld, cfgPriceAssetDecimals), toX18(amBalanceOld, cfgAmountAssetDecimals))
597597 let priceOld = fromX18(priceOldX18, scale8)
598598 let loss = {
599599 let amountBothInPaymentAsset = (toInt(fraction(balanceBigInt, redeemedBigInt, supplyBigInt)) * 2)
600600 fraction((totalAmount - amountBothInPaymentAsset), scale8, amountBothInPaymentAsset)
601601 }
602602 $Tuple5(totalAmount, commonState, feeAmount, loss, outInAmountAsset)
603603 }
604604 else throw("Strict value is not equal to itself.")
605605 }
606606
607607
608608 func managerPublicKeyOrUnit () = match getString(mpk()) {
609609 case s: String =>
610610 fromBase58String(s)
611611 case _: Unit =>
612612 unit
613613 case _ =>
614614 throw("Match error")
615615 }
616616
617617
618618 func pendingManagerPublicKeyOrUnit () = match getString(pmpk()) {
619619 case s: String =>
620620 fromBase58String(s)
621621 case _: Unit =>
622622 unit
623623 case _ =>
624624 throw("Match error")
625625 }
626626
627627
628628 func isManager (i) = match managerPublicKeyOrUnit() {
629629 case pk: ByteVector =>
630630 (i.callerPublicKey == pk)
631631 case _: Unit =>
632632 (i.caller == this)
633633 case _ =>
634634 throw("Match error")
635635 }
636636
637637
638638 func mustManager (i) = {
639639 let pd = throw("Permission denied")
640640 match managerPublicKeyOrUnit() {
641641 case pk: ByteVector =>
642642 if ((i.callerPublicKey == pk))
643643 then true
644644 else pd
645645 case _: Unit =>
646646 if ((i.caller == this))
647647 then true
648648 else pd
649649 case _ =>
650650 throw("Match error")
651651 }
652652 }
653653
654654
655655 @Callable(i)
656656 func setManager (pendingManagerPublicKey) = {
657657 let checkCaller = mustManager(i)
658658 if ((checkCaller == checkCaller))
659659 then {
660660 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
661661 if ((checkManagerPublicKey == checkManagerPublicKey))
662662 then [StringEntry(pmpk(), pendingManagerPublicKey)]
663663 else throw("Strict value is not equal to itself.")
664664 }
665665 else throw("Strict value is not equal to itself.")
666666 }
667667
668668
669669
670670 @Callable(i)
671671 func confirmManager () = {
672672 let pm = pendingManagerPublicKeyOrUnit()
673673 let hasPM = if (isDefined(pm))
674674 then true
675675 else throw("No pending manager")
676676 if ((hasPM == hasPM))
677677 then {
678678 let checkPM = if ((i.callerPublicKey == value(pm)))
679679 then true
680680 else throw("You are not pending manager")
681681 if ((checkPM == checkPM))
682682 then [StringEntry(mpk(), toBase58String(value(pm))), DeleteEntry(pmpk())]
683683 else throw("Strict value is not equal to itself.")
684684 }
685685 else throw("Strict value is not equal to itself.")
686686 }
687687
688688
689689
690690 @Callable(i)
691691 func put (slippageTolerance,shouldAutoStake) = if ((0 > slippageTolerance))
692692 then throw("Invalid slippageTolerance passed")
693693 else {
694694 let estPut = commonPut(i, slippageTolerance, true)
695695 let emitLpAmt = estPut._2
696696 let lpAssetId = estPut._7
697697 let state = estPut._9
698698 let amDiff = estPut._10
699699 let prDiff = estPut._11
700700 let amId = estPut._12
701701 let prId = estPut._13
702702 let amAssetPmt = toBigInt(value(i.payments[0]).amount)
703703 let prAssetPmt = toBigInt(value(i.payments[1]).amount)
704704 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
705705 if ((currentKLp == currentKLp))
706706 then {
707707 let emitInv = invoke(factoryContract, "emit", [emitLpAmt], nil)
708708 if ((emitInv == emitInv))
709709 then {
710710 let emitInvLegacy = match emitInv {
711711 case legacyFactoryContract: Address =>
712712 invoke(legacyFactoryContract, "emit", [emitLpAmt], nil)
713713 case _ =>
714714 unit
715715 }
716716 if ((emitInvLegacy == emitInvLegacy))
717717 then {
718718 let slippageAInv = if ((amDiff > 0))
719719 then invoke(slippageContract, "put", nil, [AttachedPayment(amId, amDiff)])
720720 else nil
721721 if ((slippageAInv == slippageAInv))
722722 then {
723723 let slippagePInv = if ((prDiff > 0))
724724 then invoke(slippageContract, "put", nil, [AttachedPayment(prId, prDiff)])
725725 else nil
726726 if ((slippagePInv == slippagePInv))
727727 then {
728728 let lpTransfer = if (shouldAutoStake)
729729 then {
730730 let slpStakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)])
731731 if ((slpStakeInv == slpStakeInv))
732732 then nil
733733 else throw("Strict value is not equal to itself.")
734734 }
735735 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
736736 let $t03207532140 = refreshKLpInternal(0, 0, 0)
737737 let refreshKLpActions = $t03207532140._1
738738 let updatedKLp = $t03207532140._2
739739 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
740740 if ((isUpdatedKLpValid == isUpdatedKLpValid))
741741 then ((state ++ lpTransfer) ++ refreshKLpActions)
742742 else throw("Strict value is not equal to itself.")
743743 }
744744 else throw("Strict value is not equal to itself.")
745745 }
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
755755
756756
757757 @Callable(i)
758758 func putForFree (maxSlippage) = if ((0 > maxSlippage))
759759 then throw("Invalid value passed")
760760 else {
761761 let estPut = commonPut(i, maxSlippage, false)
762762 let state = estPut._9
763763 let amAssetPmt = toBigInt(value(i.payments[0]).amount)
764764 let prAssetPmt = toBigInt(value(i.payments[1]).amount)
765765 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
766766 if ((currentKLp == currentKLp))
767767 then {
768768 let $t03270232767 = refreshKLpInternal(0, 0, 0)
769769 let refreshKLpActions = $t03270232767._1
770770 let updatedKLp = $t03270232767._2
771771 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
772772 if ((isUpdatedKLpValid == isUpdatedKLpValid))
773773 then (state ++ refreshKLpActions)
774774 else throw("Strict value is not equal to itself.")
775775 }
776776 else throw("Strict value is not equal to itself.")
777777 }
778778
779779
780780
781781 @Callable(i)
782782 func putOneTkn (minOutAmount,autoStake) = {
783783 let isPoolOneTokenOperationsDisabled = {
784784 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
785785 if ($isInstanceOf(@, "Boolean"))
786786 then @
787787 else throw(($getType(@) + " couldn't be cast to Boolean"))
788788 }
789789 let isPutDisabled = if (if (if (isGlobalShutdown())
790790 then true
791791 else (cfgPoolStatus == PoolPutDisabled))
792792 then true
793793 else (cfgPoolStatus == PoolShutdown))
794794 then true
795795 else isPoolOneTokenOperationsDisabled
796796 let checks = [if (if (!(isPutDisabled))
797797 then true
798798 else isManager(i))
799799 then true
800800 else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1))
801801 then true
802802 else throwErr("exactly 1 payment are expected")]
803803 if ((checks == checks))
804804 then {
805805 let payment = i.payments[0]
806806 let paymentAssetId = payment.assetId
807807 let paymentAmountRaw = payment.amount
808808 let currentKLp = if ((paymentAssetId == cfgAmountAssetId))
809809 then calcCurrentKLp(toBigInt(paymentAmountRaw), toBigInt(0), toBigInt(0))
810810 else if ((paymentAssetId == cfgPriceAssetId))
811811 then calcCurrentKLp(toBigInt(0), toBigInt(paymentAmountRaw), toBigInt(0))
812812 else throwErr("payment asset is not supported")
813813 let userAddress = i.caller
814814 let txId = i.transactionId
815815 let $t03395234104 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
816816 if (($t03395234104 == $t03395234104))
817817 then {
818818 let paymentInAmountAsset = $t03395234104._5
819819 let bonus = $t03395234104._4
820820 let feeAmount = $t03395234104._3
821821 let commonState = $t03395234104._2
822822 let emitAmountEstimated = $t03395234104._1
823823 let emitAmount = if (if ((minOutAmount > 0))
824824 then (minOutAmount > emitAmountEstimated)
825825 else false)
826826 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
827827 else emitAmountEstimated
828828 let emitInv = emit(emitAmount)
829829 if ((emitInv == emitInv))
830830 then {
831831 let lpTransfer = if (autoStake)
832832 then {
833833 let stakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(cfgLpAssetId, emitAmount)])
834834 if ((stakeInv == stakeInv))
835835 then nil
836836 else throw("Strict value is not equal to itself.")
837837 }
838838 else [ScriptTransfer(i.caller, emitAmount, cfgLpAssetId)]
839839 let sendFee = if ((feeAmount > 0))
840840 then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
841841 else nil
842842 let $t03469034887 = if ((this == feeCollectorAddress))
843843 then $Tuple2(0, 0)
844844 else if (paymentInAmountAsset)
845845 then $Tuple2(-(feeAmount), 0)
846846 else $Tuple2(0, -(feeAmount))
847847 let amountAssetBalanceDelta = $t03469034887._1
848848 let priceAssetBalanceDelta = $t03469034887._2
849849 let $t03489034998 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
850850 let refreshKLpActions = $t03489034998._1
851851 let updatedKLp = $t03489034998._2
852- let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
853- if ((isUpdatedKLpValid == isUpdatedKLpValid))
854- then $Tuple2((((commonState ++ lpTransfer) ++ sendFee) ++ refreshKLpActions), emitAmount)
852+ let kLp = value(getString(keyKLp))
853+ let error = throwErr(makeString([toString(amountAssetBalanceDelta), toString(priceAssetBalanceDelta), kLp, toString(currentKLp), toString(updatedKLp)], " "))
854+ if ((error == error))
855+ then {
856+ let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
857+ if ((isUpdatedKLpValid == isUpdatedKLpValid))
858+ then $Tuple2((((commonState ++ lpTransfer) ++ sendFee) ++ refreshKLpActions), emitAmount)
859+ else throw("Strict value is not equal to itself.")
860+ }
855861 else throw("Strict value is not equal to itself.")
856862 }
857863 else throw("Strict value is not equal to itself.")
858864 }
859865 else throw("Strict value is not equal to itself.")
860866 }
861867 else throw("Strict value is not equal to itself.")
862868 }
863869
864870
865871
866872 @Callable(i)
867873 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
868- let $t03526435421 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
869- let emitAmountEstimated = $t03526435421._1
870- let commonState = $t03526435421._2
871- let feeAmount = $t03526435421._3
872- let bonus = $t03526435421._4
873- let paymentInAmountAsset = $t03526435421._5
874+ let $t03549635653 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
875+ let emitAmountEstimated = $t03549635653._1
876+ let commonState = $t03549635653._2
877+ let feeAmount = $t03549635653._3
878+ let bonus = $t03549635653._4
879+ let paymentInAmountAsset = $t03549635653._5
874880 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
875881 }
876882
877883
878884
879885 @Callable(i)
880886 func getOneTkn (outAssetIdStr,minOutAmount) = {
881887 let isPoolOneTokenOperationsDisabled = {
882888 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
883889 if ($isInstanceOf(@, "Boolean"))
884890 then @
885891 else throw(($getType(@) + " couldn't be cast to Boolean"))
886892 }
887893 let isGetDisabled = if (if (isGlobalShutdown())
888894 then true
889895 else (cfgPoolStatus == PoolShutdown))
890896 then true
891897 else isPoolOneTokenOperationsDisabled
892898 let checks = [if (if (!(isGetDisabled))
893899 then true
894900 else isManager(i))
895901 then true
896902 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1))
897903 then true
898904 else throwErr("exactly 1 payment are expected")]
899905 if ((checks == checks))
900906 then {
901907 let outAssetId = parseAssetId(outAssetIdStr)
902908 let payment = i.payments[0]
903909 let paymentAssetId = payment.assetId
904910 let paymentAmount = payment.amount
905911 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(paymentAmount))
906912 let userAddress = i.caller
907913 let txId = i.transactionId
908- let $t03631536468 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
909- if (($t03631536468 == $t03631536468))
914+ let $t03654736700 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
915+ if (($t03654736700 == $t03654736700))
910916 then {
911- let outInAmountAsset = $t03631536468._5
912- let bonus = $t03631536468._4
913- let feeAmount = $t03631536468._3
914- let commonState = $t03631536468._2
915- let amountEstimated = $t03631536468._1
917+ let outInAmountAsset = $t03654736700._5
918+ let bonus = $t03654736700._4
919+ let feeAmount = $t03654736700._3
920+ let commonState = $t03654736700._2
921+ let amountEstimated = $t03654736700._1
916922 let amount = if (if ((minOutAmount > 0))
917923 then (minOutAmount > amountEstimated)
918924 else false)
919925 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
920926 else amountEstimated
921927 let burnInv = invoke(factoryContract, "burn", [paymentAmount], [AttachedPayment(paymentAssetId, paymentAmount)])
922928 if ((burnInv == burnInv))
923929 then {
924930 let assetTransfer = [ScriptTransfer(userAddress, amount, outAssetId)]
925931 let sendFee = if ((feeAmount > 0))
926932 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
927933 else nil
928- let $t03696837215 = {
934+ let $t03720037447 = {
929935 let feeAmountForCalc = if ((this == feeCollectorAddress))
930936 then 0
931937 else feeAmount
932938 if (outInAmountAsset)
933939 then $Tuple2(-((amount + feeAmountForCalc)), 0)
934940 else $Tuple2(0, -((amount + feeAmountForCalc)))
935941 }
936- let amountAssetBalanceDelta = $t03696837215._1
937- let priceAssetBalanceDelta = $t03696837215._2
938- let $t03721837326 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
939- let refreshKLpActions = $t03721837326._1
940- let updatedKLp = $t03721837326._2
942+ let amountAssetBalanceDelta = $t03720037447._1
943+ let priceAssetBalanceDelta = $t03720037447._2
944+ let $t03745037558 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
945+ let refreshKLpActions = $t03745037558._1
946+ let updatedKLp = $t03745037558._2
941947 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
942948 if ((isUpdatedKLpValid == isUpdatedKLpValid))
943949 then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
944950 else throw("Strict value is not equal to itself.")
945951 }
946952 else throw("Strict value is not equal to itself.")
947953 }
948954 else throw("Strict value is not equal to itself.")
949955 }
950956 else throw("Strict value is not equal to itself.")
951957 }
952958
953959
954960
955961 @Callable(i)
956962 func getOneTknREADONLY (outAssetId,paymentAmount) = {
957- let $t03758337739 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
958- let amountEstimated = $t03758337739._1
959- let commonState = $t03758337739._2
960- let feeAmount = $t03758337739._3
961- let bonus = $t03758337739._4
962- let outInAmountAsset = $t03758337739._5
963+ let $t03781537971 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
964+ let amountEstimated = $t03781537971._1
965+ let commonState = $t03781537971._2
966+ let feeAmount = $t03781537971._3
967+ let bonus = $t03781537971._4
968+ let outInAmountAsset = $t03781537971._5
963969 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
964970 }
965971
966972
967973
968974 @Callable(i)
969975 func unstakeAndGetOneTkn (unstakeAmount,outAssetIdStr,minOutAmount) = {
970976 let isPoolOneTokenOperationsDisabled = {
971977 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
972978 if ($isInstanceOf(@, "Boolean"))
973979 then @
974980 else throw(($getType(@) + " couldn't be cast to Boolean"))
975981 }
976982 let isGetDisabled = if (if (isGlobalShutdown())
977983 then true
978984 else (cfgPoolStatus == PoolShutdown))
979985 then true
980986 else isPoolOneTokenOperationsDisabled
981987 let checks = [if (if (!(isGetDisabled))
982988 then true
983989 else isManager(i))
984990 then true
985991 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 0))
986992 then true
987993 else throwErr("no payments are expected")]
988994 if ((checks == checks))
989995 then {
990996 let outAssetId = parseAssetId(outAssetIdStr)
991997 let userAddress = i.caller
992998 let txId = i.transactionId
993999 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
9941000 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
9951001 if ((unstakeInv == unstakeInv))
9961002 then {
997- let $t03864138792 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
998- if (($t03864138792 == $t03864138792))
1003+ let $t03887339024 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1004+ if (($t03887339024 == $t03887339024))
9991005 then {
1000- let outInAmountAsset = $t03864138792._5
1001- let bonus = $t03864138792._4
1002- let feeAmount = $t03864138792._3
1003- let commonState = $t03864138792._2
1004- let amountEstimated = $t03864138792._1
1006+ let outInAmountAsset = $t03887339024._5
1007+ let bonus = $t03887339024._4
1008+ let feeAmount = $t03887339024._3
1009+ let commonState = $t03887339024._2
1010+ let amountEstimated = $t03887339024._1
10051011 let amount = if (if ((minOutAmount > 0))
10061012 then (minOutAmount > amountEstimated)
10071013 else false)
10081014 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
10091015 else amountEstimated
10101016 let burnInv = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
10111017 if ((burnInv == burnInv))
10121018 then {
10131019 let assetTransfer = [ScriptTransfer(i.caller, amount, outAssetId)]
10141020 let sendFee = if ((feeAmount > 0))
10151021 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
10161022 else nil
1017- let $t03928739534 = {
1023+ let $t03951939766 = {
10181024 let feeAmountForCalc = if ((this == feeCollectorAddress))
10191025 then 0
10201026 else feeAmount
10211027 if (outInAmountAsset)
10221028 then $Tuple2(-((amount + feeAmountForCalc)), 0)
10231029 else $Tuple2(0, -((amount + feeAmountForCalc)))
10241030 }
1025- let amountAssetBalanceDelta = $t03928739534._1
1026- let priceAssetBalanceDelta = $t03928739534._2
1027- let $t03953739645 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1028- let refreshKLpActions = $t03953739645._1
1029- let updatedKLp = $t03953739645._2
1031+ let amountAssetBalanceDelta = $t03951939766._1
1032+ let priceAssetBalanceDelta = $t03951939766._2
1033+ let $t03976939877 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1034+ let refreshKLpActions = $t03976939877._1
1035+ let updatedKLp = $t03976939877._2
10301036 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10311037 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10321038 then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
10331039 else throw("Strict value is not equal to itself.")
10341040 }
10351041 else throw("Strict value is not equal to itself.")
10361042 }
10371043 else throw("Strict value is not equal to itself.")
10381044 }
10391045 else throw("Strict value is not equal to itself.")
10401046 }
10411047 else throw("Strict value is not equal to itself.")
10421048 }
10431049
10441050
10451051
10461052 @Callable(i)
10471053 func get () = {
10481054 let res = commonGet(i)
10491055 let outAmtAmt = res._1
10501056 let outPrAmt = res._2
10511057 let pmtAmt = res._3
10521058 let pmtAssetId = res._4
10531059 let state = res._5
10541060 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(pmtAmt))
10551061 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
10561062 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
10571063 then {
1058- let $t04059340675 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1059- let refreshKLpActions = $t04059340675._1
1060- let updatedKLp = $t04059340675._2
1064+ let $t04082540907 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1065+ let refreshKLpActions = $t04082540907._1
1066+ let updatedKLp = $t04082540907._2
10611067 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10621068 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10631069 then (state ++ refreshKLpActions)
10641070 else throw("Strict value is not equal to itself.")
10651071 }
10661072 else throw("Strict value is not equal to itself.")
10671073 }
10681074
10691075
10701076
10711077 @Callable(i)
10721078 func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = {
10731079 let res = commonGet(i)
10741080 let outAmAmt = res._1
10751081 let outPrAmt = res._2
10761082 let pmtAmt = res._3
10771083 let pmtAssetId = res._4
10781084 let state = res._5
10791085 if ((noLessThenAmtAsset > outAmAmt))
10801086 then throw(((("noLessThenAmtAsset failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset)))
10811087 else if ((noLessThenPriceAsset > outPrAmt))
10821088 then throw(((("noLessThenPriceAsset failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset)))
10831089 else {
10841090 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(pmtAmt))
10851091 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
10861092 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
10871093 then {
1088- let $t04162641707 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1089- let refreshKLpActions = $t04162641707._1
1090- let updatedKLp = $t04162641707._2
1094+ let $t04185841939 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1095+ let refreshKLpActions = $t04185841939._1
1096+ let updatedKLp = $t04185841939._2
10911097 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10921098 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10931099 then (state ++ refreshKLpActions)
10941100 else throw("Strict value is not equal to itself.")
10951101 }
10961102 else throw("Strict value is not equal to itself.")
10971103 }
10981104 }
10991105
11001106
11011107
11021108 @Callable(i)
11031109 func unstakeAndGet (amount) = {
11041110 let checkPayments = if ((size(i.payments) != 0))
11051111 then throw("No payments are expected")
11061112 else true
11071113 if ((checkPayments == checkPayments))
11081114 then {
11091115 let cfg = getPoolConfig()
11101116 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
11111117 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
11121118 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(lpAssetId), amount], nil)
11131119 if ((unstakeInv == unstakeInv))
11141120 then {
11151121 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller)
11161122 let outAmAmt = res._1
11171123 let outPrAmt = res._2
11181124 let poolStatus = parseIntValue(res._9)
11191125 let state = res._10
11201126 let checkPoolStatus = if (if (isGlobalShutdown())
11211127 then true
11221128 else (poolStatus == PoolShutdown))
11231129 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
11241130 else true
11251131 if ((checkPoolStatus == checkPoolStatus))
11261132 then {
11271133 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
11281134 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
11291135 then {
1130- let $t04283042911 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1131- let refreshKLpActions = $t04283042911._1
1132- let updatedKLp = $t04283042911._2
1136+ let $t04306243143 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1137+ let refreshKLpActions = $t04306243143._1
1138+ let updatedKLp = $t04306243143._2
11331139 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11341140 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11351141 then (state ++ refreshKLpActions)
11361142 else throw("Strict value is not equal to itself.")
11371143 }
11381144 else throw("Strict value is not equal to itself.")
11391145 }
11401146 else throw("Strict value is not equal to itself.")
11411147 }
11421148 else throw("Strict value is not equal to itself.")
11431149 }
11441150 else throw("Strict value is not equal to itself.")
11451151 }
11461152
11471153
11481154
11491155 @Callable(i)
11501156 func unstakeAndGetNoLess (unstakeAmount,noLessThenAmountAsset,noLessThenPriceAsset) = {
11511157 let isGetDisabled = if (isGlobalShutdown())
11521158 then true
11531159 else (cfgPoolStatus == PoolShutdown)
11541160 let checks = [if (!(isGetDisabled))
11551161 then true
11561162 else throw("get operation is blocked by admin"), if ((size(i.payments) == 0))
11571163 then true
11581164 else throw("no payments are expected")]
11591165 if ((checks == checks))
11601166 then {
11611167 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
11621168 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
11631169 if ((unstakeInv == unstakeInv))
11641170 then {
11651171 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller)
11661172 let outAmAmt = res._1
11671173 let outPrAmt = res._2
11681174 let state = res._10
11691175 let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset))
11701176 then true
11711177 else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset))
11721178 then true
11731179 else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))]
11741180 if ((checkAmounts == checkAmounts))
11751181 then {
11761182 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
11771183 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
11781184 then {
1179- let $t04420344284 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1180- let refreshKLpActions = $t04420344284._1
1181- let updatedKLp = $t04420344284._2
1185+ let $t04443544516 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1186+ let refreshKLpActions = $t04443544516._1
1187+ let updatedKLp = $t04443544516._2
11821188 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11831189 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11841190 then (state ++ refreshKLpActions)
11851191 else throw("Strict value is not equal to itself.")
11861192 }
11871193 else throw("Strict value is not equal to itself.")
11881194 }
11891195 else throw("Strict value is not equal to itself.")
11901196 }
11911197 else throw("Strict value is not equal to itself.")
11921198 }
11931199 else throw("Strict value is not equal to itself.")
11941200 }
11951201
11961202
11971203
11981204 @Callable(i)
11991205 func activate (amtAssetStr,priceAssetStr) = if ((toString(i.caller) != toString(factoryContract)))
12001206 then throw("permissions denied")
12011207 else $Tuple2([StringEntry(aa(), amtAssetStr), StringEntry(pa(), priceAssetStr)], "success")
12021208
12031209
12041210
12051211 @Callable(i)
12061212 func refreshKLp () = {
12071213 let lastRefreshedBlockHeight = valueOrElse(getInteger(keyKLpRefreshedHeight), 0)
12081214 let checkLastRefreshedBlockHeight = if (((height - lastRefreshedBlockHeight) >= kLpRefreshDelay))
12091215 then unit
12101216 else throwErr(makeString([toString(kLpRefreshDelay), " blocks have not passed since the previous call"], ""))
12111217 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
12121218 then {
12131219 let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
1214- let $t04547145535 = refreshKLpInternal(0, 0, 0)
1215- let kLpUpdateActions = $t04547145535._1
1216- let updatedKLp = $t04547145535._2
1220+ let $t04570345767 = refreshKLpInternal(0, 0, 0)
1221+ let kLpUpdateActions = $t04570345767._1
1222+ let updatedKLp = $t04570345767._2
12171223 let actions = if ((kLp != updatedKLp))
12181224 then kLpUpdateActions
12191225 else throwErr("nothing to refresh")
12201226 $Tuple2(actions, toString(updatedKLp))
12211227 }
12221228 else throw("Strict value is not equal to itself.")
12231229 }
12241230
12251231
12261232
12271233 @Callable(i)
12281234 func getPoolConfigWrapperREADONLY () = $Tuple2(nil, getPoolConfig())
12291235
12301236
12311237
12321238 @Callable(i)
12331239 func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId))
12341240
12351241
12361242
12371243 @Callable(i)
12381244 func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = {
12391245 let prices = calcPrices(amAmt, prAmt, lpAmt)
12401246 $Tuple2(nil, [toString(prices[0]), toString(prices[1]), toString(prices[2])])
12411247 }
12421248
12431249
12441250
12451251 @Callable(i)
12461252 func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(toX18(origVal, origScaleMult)))
12471253
12481254
12491255
12501256 @Callable(i)
12511257 func fromX18WrapperREADONLY (val,resultScaleMult) = $Tuple2(nil, fromX18(parseBigIntValue(val), resultScaleMult))
12521258
12531259
12541260
12551261 @Callable(i)
12561262 func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(calcPriceBigInt(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18))))
12571263
12581264
12591265
12601266 @Callable(i)
12611267 func estimatePutOperationWrapperREADONLY (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = $Tuple2(nil, estimatePutOperation(txId58, slippageTolerance, inAmAssetAmt, inAmAssetId, inPrAssetAmt, inPrAssetId, userAddress, isEvaluate, emitLp))
12621268
12631269
12641270
12651271 @Callable(i)
12661272 func estimateGetOperationWrapperREADONLY (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
12671273 let res = estimateGetOperation(txId58, pmtAssetId, pmtLpAmt, addressFromStringValue(userAddress))
12681274 $Tuple2(nil, $Tuple10(res._1, res._2, res._3, res._4, res._5, res._6, res._7, toString(res._8), res._9, res._10))
12691275 }
12701276
12711277
12721278
12731279 @Callable(i)
12741280 func statsREADONLY () = {
12751281 let cfg = getPoolConfig()
12761282 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
12771283 let amtAssetId = cfg[idxAmtAssetId]
12781284 let priceAssetId = cfg[idxPriceAssetId]
12791285 let iAmtAssetId = cfg[idxIAmtAssetId]
12801286 let iPriceAssetId = cfg[idxIPriceAssetId]
12811287 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
12821288 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
12831289 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
12841290 let accAmtAssetBalance = getAccBalance(amtAssetId)
12851291 let accPriceAssetBalance = getAccBalance(priceAssetId)
12861292 let pricesList = if ((poolLPBalance == 0))
12871293 then [zeroBigInt, zeroBigInt, zeroBigInt]
12881294 else calcPrices(accAmtAssetBalance, accPriceAssetBalance, poolLPBalance)
12891295 let curPrice = 0
12901296 let lpAmtAssetShare = fromX18(pricesList[1], scale8)
12911297 let lpPriceAssetShare = fromX18(pricesList[2], scale8)
12921298 let poolWeight = value(getInteger(factoryContract, keyPoolWeight(toString(this))))
12931299 $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))
12941300 }
12951301
12961302
12971303
12981304 @Callable(i)
12991305 func evaluatePutByAmountAssetREADONLY (inAmAssetAmt) = {
13001306 let cfg = getPoolConfig()
13011307 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
13021308 let amAssetIdStr = cfg[idxAmtAssetId]
13031309 let amAssetId = fromBase58String(amAssetIdStr)
13041310 let prAssetIdStr = cfg[idxPriceAssetId]
13051311 let prAssetId = fromBase58String(prAssetIdStr)
13061312 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
13071313 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
13081314 let poolStatus = cfg[idxPoolStatus]
13091315 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
13101316 let accAmtAssetBalance = getAccBalance(amAssetIdStr)
13111317 let accPriceAssetBalance = getAccBalance(prAssetIdStr)
13121318 let amtAssetAmtX18 = toX18(accAmtAssetBalance, amtAssetDcm)
13131319 let priceAssetAmtX18 = toX18(accPriceAssetBalance, priceAssetDcm)
13141320 let curPriceX18 = if ((poolLPBalance == 0))
13151321 then zeroBigInt
13161322 else calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
13171323 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
13181324 let inPrAssetAmtX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18)
13191325 let inPrAssetAmt = fromX18(inPrAssetAmtX18, priceAssetDcm)
13201326 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
13211327 let calcLpAmt = estPut._1
13221328 let curPriceCalc = estPut._3
13231329 let amBalance = estPut._4
13241330 let prBalance = estPut._5
13251331 let lpEmission = estPut._6
13261332 $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))
13271333 }
13281334
13291335
13301336
13311337 @Callable(i)
13321338 func evaluatePutByPriceAssetREADONLY (inPrAssetAmt) = {
13331339 let cfg = getPoolConfig()
13341340 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
13351341 let amAssetIdStr = cfg[idxAmtAssetId]
13361342 let amAssetId = fromBase58String(amAssetIdStr)
13371343 let prAssetIdStr = cfg[idxPriceAssetId]
13381344 let prAssetId = fromBase58String(prAssetIdStr)
13391345 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
13401346 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
13411347 let poolStatus = cfg[idxPoolStatus]
13421348 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
13431349 let amBalanceRaw = getAccBalance(amAssetIdStr)
13441350 let prBalanceRaw = getAccBalance(prAssetIdStr)
13451351 let amBalanceRawX18 = toX18(amBalanceRaw, amtAssetDcm)
13461352 let prBalanceRawX18 = toX18(prBalanceRaw, priceAssetDcm)
13471353 let curPriceX18 = if ((poolLPBalance == 0))
13481354 then zeroBigInt
13491355 else calcPriceBigInt(prBalanceRawX18, amBalanceRawX18)
13501356 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
13511357 let inAmAssetAmtX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
13521358 let inAmAssetAmt = fromX18(inAmAssetAmtX18, amtAssetDcm)
13531359 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
13541360 let calcLpAmt = estPut._1
13551361 let curPriceCalc = estPut._3
13561362 let amBalance = estPut._4
13571363 let prBalance = estPut._5
13581364 let lpEmission = estPut._6
13591365 $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))
13601366 }
13611367
13621368
13631369
13641370 @Callable(i)
13651371 func evaluateGetREADONLY (paymentLpAssetId,paymentLpAmt) = {
13661372 let res = estimateGetOperation("", paymentLpAssetId, paymentLpAmt, this)
13671373 let outAmAmt = res._1
13681374 let outPrAmt = res._2
13691375 let amBalance = res._5
13701376 let prBalance = res._6
13711377 let lpEmission = res._7
13721378 let curPrice = res._8
13731379 let poolStatus = parseIntValue(res._9)
13741380 $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))
13751381 }
13761382
13771383
13781384 @Verifier(tx)
13791385 func verify () = {
13801386 let targetPublicKey = match managerPublicKeyOrUnit() {
13811387 case pk: ByteVector =>
13821388 pk
13831389 case _: Unit =>
13841390 tx.senderPublicKey
13851391 case _ =>
13861392 throw("Match error")
13871393 }
13881394 match tx {
13891395 case order: Order =>
13901396 let matcherPub = getMatcherPubOrFail()
13911397 let orderValid = validateMatcherOrderAllowed(order)
13921398 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
13931399 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
13941400 if (if (if (orderValid)
13951401 then senderValid
13961402 else false)
13971403 then matcherValid
13981404 else false)
13991405 then true
14001406 else throwOrderError(orderValid, senderValid, matcherValid)
14011407 case s: SetScriptTransaction =>
14021408 let newHash = blake2b256(value(s.script))
14031409 let allowedHash = fromBase64String(value(getString(factoryContract, keyAllowedLpScriptHash())))
14041410 let currentHash = scriptHash(this)
14051411 if (if ((allowedHash == newHash))
14061412 then (currentHash != newHash)
14071413 else false)
14081414 then true
14091415 else sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
14101416 case _ =>
14111417 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
14121418 }
14131419 }
14141420

github/deemru/w8io/026f985 
422.39 ms