tx · 3TqeRJrsmuvPMv2A5586n2QLyUJeMfCH9sr8Q1vdLAWk

3N23sqNJqpVXnHxv4nKXriWA8N6QLsPKd5K:  -0.03000000 Waves

2022.11.07 16:06 [2306771] smart account 3N23sqNJqpVXnHxv4nKXriWA8N6QLsPKd5K > SELF 0.00000000 Waves

{ "type": 13, "id": "3TqeRJrsmuvPMv2A5586n2QLyUJeMfCH9sr8Q1vdLAWk", "fee": 3000000, "feeAssetId": null, "timestamp": 1667826396871, "version": 1, "sender": "3N23sqNJqpVXnHxv4nKXriWA8N6QLsPKd5K", "senderPublicKey": "2fTQW76r4FCNaSvj5ycqdyqgJWWapZ2m25zmQLckTQwJ", "proofs": [ "5T7PmcbWpndgsYKrGhBAHoHbazvUqVztM9dnWHmyjCZ92xicP4Uj56c7pZi8pT3iDHqNWD5iFyRTa823v722x2xZ" ], "script": "base64:BgKxJwgCEgMKAQgSABIECgIBBBIDCgEBEgQKAgEEEgQKAggBEgQKAggBEgQKAggBEgUKAwEIARIAEgQKAgEBEgMKAQESBQoDAQEBEgQKAggIEgASAwoBCBIFCgMBAQESBAoCAQESBAoCCAESBAoCCAgSCwoJCAEBAgECCAQEEgYKBAgIAQgSABIDCgEBEgMKAQESBAoCCAEiCmxQZGVjaW1hbHMiBnNjYWxlOCIMc2NhbGU4QmlnSW50IgdzY2FsZTE4Igp6ZXJvQmlnSW50IgRiaWcwIgRiaWcxIgRiaWcyIgt3YXZlc1N0cmluZyIDU0VQIgpQb29sQWN0aXZlIg9Qb29sUHV0RGlzYWJsZWQiE1Bvb2xNYXRjaGVyRGlzYWJsZWQiDFBvb2xTaHV0ZG93biIOaWR4UG9vbEFkZHJlc3MiDWlkeFBvb2xTdGF0dXMiEGlkeFBvb2xMUEFzc2V0SWQiDWlkeEFtdEFzc2V0SWQiD2lkeFByaWNlQXNzZXRJZCIOaWR4QW10QXNzZXREY20iEGlkeFByaWNlQXNzZXREY20iDmlkeElBbXRBc3NldElkIhBpZHhJUHJpY2VBc3NldEl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IAgkApAMBBQJiVQUDbmlsBQFqAQJmSAECZkkABAJmSgQCZHEJAQJldQADCQABAgUCZHECCkJ5dGVWZWN0b3IEAmV6BQJkcQUCZXoDCQABAgUCZHECBFVuaXQIBQJmSA9zZW5kZXJQdWJsaWNLZXkJAAIBAgtNYXRjaCBlcnJvcgQCZHEFAmZIAwkAAQIFAmRxAgVPcmRlcgQCY1IFAmRxBAJmSwkBAmFHAAQCYXUJAQJjUQEFAmNSBAJhdgkA9AMDCAUCY1IJYm9keUJ5dGVzCQCRAwIIBQJjUgZwcm9vZnMAAAgFAmNSD3NlbmRlclB1YmxpY0tleQQCYXcJAPQDAwgFAmNSCWJvZHlCeXRlcwkAkQMCCAUCY1IGcHJvb2ZzAAEFAmZLAwMDBQJhdQUCYXYHBQJhdwcGCQECYXQDBQJhdQUCYXYFAmF3AwkAAQIFAmRxAhRTZXRTY3JpcHRUcmFuc2FjdGlvbgQCZXYFAmRxBAJmTAkA9gMBCQEFdmFsdWUBCAUCZXYGc2NyaXB0BAJmTQkA2wQBCQEFdmFsdWUBCQCdCAIFAmFECQECYXIABAJmTgkA8QcBBQR0aGlzAwMJAAACBQJmTQUCZkwJAQIhPQIFAmZOBQJmTAcGCQD0AwMIBQJmSAlib2R5Qnl0ZXMJAJEDAggFAmZIBnByb29mcwAABQJmSgkA9AMDCAUCZkgJYm9keUJ5dGVzCQCRAwIIBQJmSAZwcm9vZnMAAAUCZkrGvHs8", "chainId": 84, "height": 2306771, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: bcZqdFgJMxPy3auXBZEgnYZMfkrVGKB4n5voUjoQxDX Next: HVyXkivB1Lzo1SxQebErKoLRh6s459U6po44uHWpZ72i Diff:
OldNewDifferences
512512 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))]
513513 let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, cfgPriceAssetDecimals), toX18(amountBalanceOld, cfgAmountAssetDecimals))
514514 let priceOld = fromX18(priceOldX18, scale8)
515- let bonus = {
516- let $t02467624843 = if (paymentInAmountAsset)
515+ let loss = {
516+ let $t02467524842 = if (paymentInAmountAsset)
517517 then $Tuple2(amountAssetAmountRaw, amountBalanceOld)
518518 else $Tuple2(priceAssetAmountRaw, priceBalanceOld)
519- let amount = $t02467624843._1
520- let balance = $t02467624843._2
519+ let amount = $t02467524842._1
520+ let balance = $t02467524842._2
521521 let issueAmountBoth = toInt(fraction(supplyBigInt, toBigInt((amount / 2)), toBigInt(balance)))
522- (((issueAmount - issueAmountBoth) * scale8) / issueAmount)
522+ fraction((issueAmount - issueAmountBoth), scale8, issueAmountBoth)
523523 }
524- $Tuple4(issueAmount, commonState, feeAmount, bonus)
524+ $Tuple4(issueAmount, commonState, feeAmount, loss)
525525 }
526526 else throw("Strict value is not equal to itself.")
527527 }
551551 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
552552 let redeemedBigInt = toBigInt(paymentAmount)
553553 let amountRaw = max([0, toInt(((balanceBigInt * (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN))) / scale18))])
554- let $t02641426464 = takeFee(amountRaw)
555- let totalAmount = $t02641426464._1
556- let feeAmount = $t02641426464._2
557- let $t02646826694 = if (outInAmountAsset)
554+ let $t02642226472 = takeFee(amountRaw)
555+ let totalAmount = $t02642226472._1
556+ let feeAmount = $t02642226472._2
557+ let $t02647626702 = if (outInAmountAsset)
558558 then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld)
559559 else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw))
560- let outAmAmount = $t02646826694._1
561- let outPrAmount = $t02646826694._2
562- let amBalanceNew = $t02646826694._3
563- let prBalanceNew = $t02646826694._4
560+ let outAmAmount = $t02647626702._1
561+ let outPrAmount = $t02647626702._2
562+ let amBalanceNew = $t02647626702._3
563+ let prBalanceNew = $t02647626702._4
564564 let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, cfgPriceAssetDecimals), toX18(amBalanceNew, cfgAmountAssetDecimals))
565565 let priceNew = fromX18(priceNewX18, scale8)
566566 let commonState = if (isEval)
568568 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)]
569569 let priceOldX18 = calcPriceBigInt(toX18(prBalanceOld, cfgPriceAssetDecimals), toX18(amBalanceOld, cfgAmountAssetDecimals))
570570 let priceOld = fromX18(priceOldX18, scale8)
571- let bonus = {
571+ let loss = {
572572 let amountBothInPaymentAsset = (toInt(fraction(balanceBigInt, redeemedBigInt, supplyBigInt)) * 2)
573- (((totalAmount - amountBothInPaymentAsset) * scale8) / totalAmount)
573+ fraction((totalAmount - amountBothInPaymentAsset), scale8, amountBothInPaymentAsset)
574574 }
575- $Tuple4(totalAmount, commonState, feeAmount, bonus)
575+ $Tuple4(totalAmount, commonState, feeAmount, loss)
576576 }
577577 else throw("Strict value is not equal to itself.")
578578 }
741741 let paymentAmountRaw = payment.amount
742742 let userAddress = i.caller
743743 let txId = i.transactionId
744- let $t03138731514 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
745- let emitAmountEstimated = $t03138731514._1
746- let commonState = $t03138731514._2
747- let feeAmount = $t03138731514._3
748- let bonus = $t03138731514._4
744+ let $t03141231539 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
745+ let emitAmountEstimated = $t03141231539._1
746+ let commonState = $t03141231539._2
747+ let feeAmount = $t03141231539._3
748+ let bonus = $t03141231539._4
749749 let emitAmount = if (if ((minOutAmount > 0))
750750 then (minOutAmount > emitAmountEstimated)
751751 else false)
776776
777777 @Callable(i)
778778 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
779- let $t03224332378 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
780- let emitAmountEstimated = $t03224332378._1
781- let commonState = $t03224332378._2
782- let feeAmount = $t03224332378._3
783- let bonus = $t03224332378._4
779+ let $t03226832403 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
780+ let emitAmountEstimated = $t03226832403._1
781+ let commonState = $t03226832403._2
782+ let feeAmount = $t03226832403._3
783+ let bonus = $t03226832403._4
784784 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
785785 }
786786
812812 let paymentAmount = payment.amount
813813 let userAddress = i.caller
814814 let txId = i.transactionId
815- let $t03315033282 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
816- let amountEstimated = $t03315033282._1
817- let commonState = $t03315033282._2
818- let feeAmount = $t03315033282._3
819- let bonus = $t03315033282._4
815+ let $t03317533307 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
816+ let amountEstimated = $t03317533307._1
817+ let commonState = $t03317533307._2
818+ let feeAmount = $t03317533307._3
819+ let bonus = $t03317533307._4
820820 let amount = if (if ((minOutAmount > 0))
821821 then (minOutAmount > amountEstimated)
822822 else false)
840840
841841 @Callable(i)
842842 func getOneTknREADONLY (outAssetId,paymentAmount) = {
843- let $t03391734055 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
844- let amountEstimated = $t03391734055._1
845- let commonState = $t03391734055._2
846- let feeAmount = $t03391734055._3
847- let bonus = $t03391734055._4
843+ let $t03394234080 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
844+ let amountEstimated = $t03394234080._1
845+ let commonState = $t03394234080._2
846+ let feeAmount = $t03394234080._3
847+ let bonus = $t03394234080._4
848848 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
849849 }
850850
876876 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
877877 if ((unstakeInv == unstakeInv))
878878 then {
879- let $t03484734977 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
880- let amountEstimated = $t03484734977._1
881- let commonState = $t03484734977._2
882- let feeAmount = $t03484734977._3
883- let bonus = $t03484734977._4
879+ let $t03487235002 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
880+ let amountEstimated = $t03487235002._1
881+ let commonState = $t03487235002._2
882+ let feeAmount = $t03487235002._3
883+ let bonus = $t03487235002._4
884884 let amount = if (if ((minOutAmount > 0))
885885 then (minOutAmount > amountEstimated)
886886 else false)
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 func keyFactoryConfig () = "%s__factoryConfig"
115115
116116
117117 func keyMatcherPub () = "%s%s__matcher__publicKey"
118118
119119
120120 func keyMappingPoolContractAddressToPoolAssets (poolContractAddress) = (("%s%s%s__" + poolContractAddress) + "__mappings__poolContract2LpAsset")
121121
122122
123123 func keyPoolConfig (iAmtAsset,iPriceAsset) = (((("%d%d%s__" + iAmtAsset) + "__") + iPriceAsset) + "__config")
124124
125125
126126 func keyMappingsBaseAsset2internalId (baseAssetStr) = ("%s%s%s__mappings__baseAsset2internalId__" + baseAssetStr)
127127
128128
129129 func keyAllPoolsShutdown () = "%s__shutdown"
130130
131131
132132 func keyPoolWeight (contractAddress) = ("%s%s__poolWeight__" + contractAddress)
133133
134134
135135 func keyAllowedLpScriptHash () = "%s__allowedLpScriptHash"
136136
137137
138138 let keyFeeCollectorAddress = "%s__feeCollectorAddress"
139139
140140 func throwOrderError (orderValid,senderValid,matcherValid) = throw(((((("order validation failed: orderValid=" + toString(orderValid)) + " senderValid=") + toString(senderValid)) + " matcherValid=") + toString(matcherValid)))
141141
142142
143143 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
144144
145145
146146 func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
147147
148148
149149 func throwErr (msg) = throw(makeString(["lp.ride:", msg], " "))
150150
151151
152152 let factoryContract = addressFromStringValue(getStringOrFail(this, fc()))
153153
154154 let feeCollectorAddress = addressFromStringValue(getStringOrFail(factoryContract, keyFeeCollectorAddress))
155155
156156 func isGlobalShutdown () = valueOrElse(getBoolean(factoryContract, keyAllPoolsShutdown()), false)
157157
158158
159159 func getMatcherPubOrFail () = fromBase58String(getStringOrFail(factoryContract, keyMatcherPub()))
160160
161161
162162 func getPoolConfig () = {
163163 let amtAsset = getStringOrFail(this, aa())
164164 let priceAsset = getStringOrFail(this, pa())
165165 let iPriceAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(priceAsset))
166166 let iAmtAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(amtAsset))
167167 split(getStringOrFail(factoryContract, keyPoolConfig(toString(iAmtAsset), toString(iPriceAsset))), SEP)
168168 }
169169
170170
171171 func parseAssetId (input) = if ((input == wavesString))
172172 then unit
173173 else fromBase58String(input)
174174
175175
176176 func assetIdToString (input) = if ((input == unit))
177177 then wavesString
178178 else toBase58String(value(input))
179179
180180
181181 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]))
182182
183183
184184 let poolConfigParsed = parsePoolConfig(getPoolConfig())
185185
186186 let $t075447710 = poolConfigParsed
187187
188188 let cfgPoolAddress = $t075447710._1
189189
190190 let cfgPoolStatus = $t075447710._2
191191
192192 let cfgLpAssetId = $t075447710._3
193193
194194 let cfgAmountAssetId = $t075447710._4
195195
196196 let cfgPriceAssetId = $t075447710._5
197197
198198 let cfgAmountAssetDecimals = $t075447710._6
199199
200200 let cfgPriceAssetDecimals = $t075447710._7
201201
202202 func getFactoryConfig () = split(getStringOrFail(factoryContract, keyFactoryConfig()), SEP)
203203
204204
205205 let stakingContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactoryStakingContract]), "incorrect staking address")
206206
207207 let slippageContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactorySlippageContract]), "incorrect staking address")
208208
209209 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)
210210
211211
212212 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)
213213
214214
215215 func getAccBalance (assetId) = if ((assetId == "WAVES"))
216216 then wavesBalance(this).available
217217 else assetBalance(this, fromBase58String(assetId))
218218
219219
220220 func calcPriceBigInt (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18)
221221
222222
223223 func privateCalcPrice (amAssetDcm,prAssetDcm,amAmt,prAmt) = {
224224 let amtAssetAmtX18 = toX18(amAmt, amAssetDcm)
225225 let priceAssetAmtX18 = toX18(prAmt, prAssetDcm)
226226 calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
227227 }
228228
229229
230230 func calcPrices (amAmt,prAmt,lpAmt) = {
231231 let cfg = getPoolConfig()
232232 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
233233 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
234234 let priceX18 = privateCalcPrice(amtAssetDcm, priceAssetDcm, amAmt, prAmt)
235235 let amAmtX18 = toX18(amAmt, amtAssetDcm)
236236 let prAmtX18 = toX18(prAmt, priceAssetDcm)
237237 let lpAmtX18 = toX18(lpAmt, scale8)
238238 let lpPriceInAmAssetX18 = calcPriceBigInt(amAmtX18, lpAmtX18)
239239 let lpPriceInPrAssetX18 = calcPriceBigInt(prAmtX18, lpAmtX18)
240240 [priceX18, lpPriceInAmAssetX18, lpPriceInPrAssetX18]
241241 }
242242
243243
244244 func calculatePrices (amAmt,prAmt,lpAmt) = {
245245 let prices = calcPrices(amAmt, prAmt, lpAmt)
246246 [fromX18(prices[0], scale8), fromX18(prices[1], scale8), fromX18(prices[2], scale8)]
247247 }
248248
249249
250250 func estimateGetOperation (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
251251 let cfg = getPoolConfig()
252252 let lpAssetId = cfg[idxPoolLPAssetId]
253253 let amAssetId = cfg[idxAmtAssetId]
254254 let prAssetId = cfg[idxPriceAssetId]
255255 let amAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
256256 let prAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
257257 let poolStatus = cfg[idxPoolStatus]
258258 let lpEmission = valueOrErrorMessage(assetInfo(fromBase58String(lpAssetId)), (("Asset " + lpAssetId) + " doesn't exist")).quantity
259259 if ((lpAssetId != pmtAssetId))
260260 then throw("Invalid asset passed.")
261261 else {
262262 let amBalance = getAccBalance(amAssetId)
263263 let amBalanceX18 = toX18(amBalance, amAssetDcm)
264264 let prBalance = getAccBalance(prAssetId)
265265 let prBalanceX18 = toX18(prBalance, prAssetDcm)
266266 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
267267 let curPrice = fromX18(curPriceX18, scale8)
268268 let pmtLpAmtX18 = toX18(pmtLpAmt, scale8)
269269 let lpEmissionX18 = toX18(lpEmission, scale8)
270270 let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissionX18)
271271 let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissionX18)
272272 let outAmAmt = fromX18(outAmAmtX18, amAssetDcm)
273273 let outPrAmt = fromX18(outPrAmtX18, prAssetDcm)
274274 let state = if ((txId58 == ""))
275275 then nil
276276 else [ScriptTransfer(userAddress, outAmAmt, if ((amAssetId == "WAVES"))
277277 then unit
278278 else fromBase58String(amAssetId)), ScriptTransfer(userAddress, outPrAmt, if ((prAssetId == "WAVES"))
279279 then unit
280280 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)]
281281 $Tuple10(outAmAmt, outPrAmt, amAssetId, prAssetId, amBalance, prBalance, lpEmission, curPriceX18, poolStatus, state)
282282 }
283283 }
284284
285285
286286 func estimatePutOperation (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = {
287287 let cfg = getPoolConfig()
288288 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
289289 let amAssetIdStr = cfg[idxAmtAssetId]
290290 let prAssetIdStr = cfg[idxPriceAssetId]
291291 let iAmtAssetId = cfg[idxIAmtAssetId]
292292 let iPriceAssetId = cfg[idxIPriceAssetId]
293293 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
294294 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
295295 let poolStatus = cfg[idxPoolStatus]
296296 let lpEmission = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
297297 let inAmAssetIdStr = toBase58String(valueOrElse(inAmAssetId, fromBase58String("WAVES")))
298298 let inPrAssetIdStr = toBase58String(valueOrElse(inPrAssetId, fromBase58String("WAVES")))
299299 if (if ((amAssetIdStr != inAmAssetIdStr))
300300 then true
301301 else (prAssetIdStr != inPrAssetIdStr))
302302 then throw("Invalid amt or price asset passed.")
303303 else {
304304 let amBalance = if (isEvaluate)
305305 then getAccBalance(amAssetIdStr)
306306 else (getAccBalance(amAssetIdStr) - inAmAssetAmt)
307307 let prBalance = if (isEvaluate)
308308 then getAccBalance(prAssetIdStr)
309309 else (getAccBalance(prAssetIdStr) - inPrAssetAmt)
310310 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
311311 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
312312 let userPriceX18 = calcPriceBigInt(inPrAssetAmtX18, inAmAssetAmtX18)
313313 let amBalanceX18 = toX18(amBalance, amtAssetDcm)
314314 let prBalanceX18 = toX18(prBalance, priceAssetDcm)
315315 let res = if ((lpEmission == 0))
316316 then {
317317 let curPriceX18 = zeroBigInt
318318 let slippageX18 = zeroBigInt
319319 let lpAmtX18 = pow((inAmAssetAmtX18 * inPrAssetAmtX18), 0, toBigInt(5), 1, 0, DOWN)
320320 $Tuple5(fromX18(lpAmtX18, scale8), fromX18(inAmAssetAmtX18, amtAssetDcm), fromX18(inPrAssetAmtX18, priceAssetDcm), calcPriceBigInt((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18)
321321 }
322322 else {
323323 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
324324 let slippageX18 = fraction(absBigInt((curPriceX18 - userPriceX18)), scale18, curPriceX18)
325325 let slippageToleranceX18 = toX18(slippageTolerance, scale8)
326326 if (if ((curPriceX18 != zeroBigInt))
327327 then (slippageX18 > slippageToleranceX18)
328328 else false)
329329 then throw(((("Price slippage " + toString(slippageX18)) + " exceeded the passed limit of ") + toString(slippageToleranceX18)))
330330 else {
331331 let lpEmissionX18 = toX18(lpEmission, scale8)
332332 let prViaAmX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18)
333333 let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
334334 let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18))
335335 then $Tuple2(amViaPrX18, inPrAssetAmtX18)
336336 else $Tuple2(inAmAssetAmtX18, prViaAmX18)
337337 let expAmtAssetAmtX18 = expectedAmts._1
338338 let expPriceAssetAmtX18 = expectedAmts._2
339339 let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18)
340340 $Tuple5(fromX18(lpAmtX18, scale8), fromX18(expAmtAssetAmtX18, amtAssetDcm), fromX18(expPriceAssetAmtX18, priceAssetDcm), curPriceX18, slippageX18)
341341 }
342342 }
343343 let calcLpAmt = res._1
344344 let calcAmAssetPmt = res._2
345345 let calcPrAssetPmt = res._3
346346 let curPrice = fromX18(res._4, scale8)
347347 let slippageCalc = fromX18(res._5, scale8)
348348 if ((0 >= calcLpAmt))
349349 then throw("Invalid calculations. LP calculated is less than zero.")
350350 else {
351351 let emitLpAmt = if (!(emitLp))
352352 then 0
353353 else calcLpAmt
354354 let amDiff = (inAmAssetAmt - calcAmAssetPmt)
355355 let prDiff = (inPrAssetAmt - calcPrAssetPmt)
356356 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))]
357357 $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEmission, lpAssetId, poolStatus, commonState, amDiff, prDiff, inAmAssetId, inPrAssetId)
358358 }
359359 }
360360 }
361361
362362
363363 func validateMatcherOrderAllowed (order) = {
364364 let cfg = getPoolConfig()
365365 let amtAssetId = cfg[idxAmtAssetId]
366366 let priceAssetId = cfg[idxPriceAssetId]
367367 let poolStatus = parseIntValue(cfg[idxPoolStatus])
368368 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
369369 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
370370 let accAmtAssetBalance = getAccBalance(amtAssetId)
371371 let accPriceAssetBalance = getAccBalance(priceAssetId)
372372 let curPriceX18 = if ((order.orderType == Buy))
373373 then privateCalcPrice(amtAssetDcm, priceAssetDcm, (accAmtAssetBalance + order.amount), accPriceAssetBalance)
374374 else privateCalcPrice(amtAssetDcm, priceAssetDcm, (accAmtAssetBalance - order.amount), accPriceAssetBalance)
375375 let curPrice = fromX18(curPriceX18, scale8)
376376 if (if (if (isGlobalShutdown())
377377 then true
378378 else (poolStatus == PoolMatcherDisabled))
379379 then true
380380 else (poolStatus == PoolShutdown))
381381 then throw("Exchange operations disabled")
382382 else {
383383 let orderAmtAsset = order.assetPair.amountAsset
384384 let orderAmtAssetStr = if ((orderAmtAsset == unit))
385385 then "WAVES"
386386 else toBase58String(value(orderAmtAsset))
387387 let orderPriceAsset = order.assetPair.priceAsset
388388 let orderPriceAssetStr = if ((orderPriceAsset == unit))
389389 then "WAVES"
390390 else toBase58String(value(orderPriceAsset))
391391 if (if ((orderAmtAssetStr != amtAssetId))
392392 then true
393393 else (orderPriceAssetStr != priceAssetId))
394394 then throw("Wrong order assets.")
395395 else {
396396 let orderPrice = order.price
397397 let priceDcm = fraction(scale8, priceAssetDcm, amtAssetDcm)
398398 let castedOrderPrice = toScale(orderPrice, scale8, priceDcm)
399399 let isOrderPriceValid = if ((order.orderType == Buy))
400400 then (curPrice >= castedOrderPrice)
401401 else (castedOrderPrice >= curPrice)
402402 true
403403 }
404404 }
405405 }
406406
407407
408408 func commonGet (i) = if ((size(i.payments) != 1))
409409 then throw("exactly 1 payment is expected")
410410 else {
411411 let pmt = value(i.payments[0])
412412 let pmtAssetId = value(pmt.assetId)
413413 let pmtAmt = pmt.amount
414414 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller)
415415 let outAmAmt = res._1
416416 let outPrAmt = res._2
417417 let poolStatus = parseIntValue(res._9)
418418 let state = res._10
419419 if (if (isGlobalShutdown())
420420 then true
421421 else (poolStatus == PoolShutdown))
422422 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
423423 else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state)
424424 }
425425
426426
427427 func commonPut (i,slippageTolerance,emitLp) = if ((size(i.payments) != 2))
428428 then throw("exactly 2 payments are expected")
429429 else {
430430 let amAssetPmt = value(i.payments[0])
431431 let prAssetPmt = value(i.payments[1])
432432 let estPut = estimatePutOperation(toBase58String(i.transactionId), slippageTolerance, amAssetPmt.amount, amAssetPmt.assetId, prAssetPmt.amount, prAssetPmt.assetId, toString(i.caller), false, emitLp)
433433 let poolStatus = parseIntValue(estPut._8)
434434 if (if (if (isGlobalShutdown())
435435 then true
436436 else (poolStatus == PoolPutDisabled))
437437 then true
438438 else (poolStatus == PoolShutdown))
439439 then throw(("Put operation is blocked by admin. Status = " + toString(poolStatus)))
440440 else estPut
441441 }
442442
443443
444444 func emit (amount) = {
445445 let emitInv = invoke(factoryContract, "emit", [amount], nil)
446446 if ((emitInv == emitInv))
447447 then {
448448 let emitInvLegacy = match emitInv {
449449 case legacyFactoryContract: Address =>
450450 invoke(legacyFactoryContract, "emit", [amount], nil)
451451 case _ =>
452452 unit
453453 }
454454 if ((emitInvLegacy == emitInvLegacy))
455455 then amount
456456 else throw("Strict value is not equal to itself.")
457457 }
458458 else throw("Strict value is not equal to itself.")
459459 }
460460
461461
462462 func takeFee (amount) = {
463463 let feeAmount = fraction(amount, fee, scale8)
464464 $Tuple2((amount - feeAmount), feeAmount)
465465 }
466466
467467
468468 func calcPutOneToken (paymentAmountRaw,paymentAssetId,userAddress,txId) = {
469469 let isEval = (txId == unit)
470470 let amountBalanceRaw = getAccBalance(assetIdToString(cfgAmountAssetId))
471471 let priceBalanceRaw = getAccBalance(assetIdToString(cfgPriceAssetId))
472472 let paymentInAmountAsset = if ((paymentAssetId == cfgAmountAssetId))
473473 then true
474474 else if ((paymentAssetId == cfgPriceAssetId))
475475 then false
476476 else throwErr("invalid asset")
477477 let $t02257122864 = if (isEval)
478478 then $Tuple2(amountBalanceRaw, priceBalanceRaw)
479479 else if (paymentInAmountAsset)
480480 then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw)
481481 else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw))
482482 let amountBalanceOld = $t02257122864._1
483483 let priceBalanceOld = $t02257122864._2
484484 let $t02286823017 = if (paymentInAmountAsset)
485485 then $Tuple2(paymentAmountRaw, 0)
486486 else $Tuple2(0, paymentAmountRaw)
487487 let amountAssetAmountRaw = $t02286823017._1
488488 let priceAssetAmountRaw = $t02286823017._2
489489 let amountAssetAmount = takeFee(amountAssetAmountRaw)._1
490490 let priceAssetAmount = takeFee(priceAssetAmountRaw)._1
491491 let $t02313923198 = takeFee(paymentAmountRaw)
492492 let paymentAmount = $t02313923198._1
493493 let feeAmount = $t02313923198._2
494494 let amountBalanceNew = (amountBalanceOld + amountAssetAmount)
495495 let priceBalanceNew = (priceBalanceOld + priceAssetAmount)
496496 let priceNewX18 = calcPriceBigInt(toX18(priceBalanceNew, cfgPriceAssetDecimals), toX18(amountBalanceNew, cfgAmountAssetDecimals))
497497 let priceNew = fromX18(priceNewX18, scale8)
498498 let paymentBalance = if (paymentInAmountAsset)
499499 then amountBalanceOld
500500 else priceBalanceOld
501501 let paymentBalanceBigInt = toBigInt(paymentBalance)
502502 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
503503 let chechSupply = if ((supplyBigInt > big0))
504504 then true
505505 else throwErr("initial deposit requires all coins")
506506 if ((chechSupply == chechSupply))
507507 then {
508508 let depositBigInt = toBigInt(paymentAmount)
509509 let issueAmount = max([0, toInt(((supplyBigInt * (sqrtBigInt((scale18 + ((depositBigInt * scale18) / paymentBalanceBigInt)), 18, 18, DOWN) - scale18)) / scale18))])
510510 let commonState = if (isEval)
511511 then nil
512512 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))]
513513 let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, cfgPriceAssetDecimals), toX18(amountBalanceOld, cfgAmountAssetDecimals))
514514 let priceOld = fromX18(priceOldX18, scale8)
515- let bonus = {
516- let $t02467624843 = if (paymentInAmountAsset)
515+ let loss = {
516+ let $t02467524842 = if (paymentInAmountAsset)
517517 then $Tuple2(amountAssetAmountRaw, amountBalanceOld)
518518 else $Tuple2(priceAssetAmountRaw, priceBalanceOld)
519- let amount = $t02467624843._1
520- let balance = $t02467624843._2
519+ let amount = $t02467524842._1
520+ let balance = $t02467524842._2
521521 let issueAmountBoth = toInt(fraction(supplyBigInt, toBigInt((amount / 2)), toBigInt(balance)))
522- (((issueAmount - issueAmountBoth) * scale8) / issueAmount)
522+ fraction((issueAmount - issueAmountBoth), scale8, issueAmountBoth)
523523 }
524- $Tuple4(issueAmount, commonState, feeAmount, bonus)
524+ $Tuple4(issueAmount, commonState, feeAmount, loss)
525525 }
526526 else throw("Strict value is not equal to itself.")
527527 }
528528
529529
530530 func calcGetOneToken (outAssetId,paymentAmount,paymentAssetId,userAddress,txId) = {
531531 let isEval = (txId == unit)
532532 let checks = [if ((paymentAssetId == cfgLpAssetId))
533533 then true
534534 else throwErr("invalid lp asset")]
535535 if ((checks == checks))
536536 then {
537537 let outInAmountAsset = if ((outAssetId == cfgAmountAssetId))
538538 then true
539539 else if ((outAssetId == cfgPriceAssetId))
540540 then false
541541 else throwErr("invalid asset")
542542 let balanceBigInt = if (outInAmountAsset)
543543 then toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId)))
544544 else toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId)))
545545 let amBalanceOld = getAccBalance(assetIdToString(cfgAmountAssetId))
546546 let prBalanceOld = getAccBalance(assetIdToString(cfgPriceAssetId))
547547 let outBalance = if (outInAmountAsset)
548548 then amBalanceOld
549549 else prBalanceOld
550550 let outBalanceBigInt = toBigInt(outBalance)
551551 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
552552 let redeemedBigInt = toBigInt(paymentAmount)
553553 let amountRaw = max([0, toInt(((balanceBigInt * (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN))) / scale18))])
554- let $t02641426464 = takeFee(amountRaw)
555- let totalAmount = $t02641426464._1
556- let feeAmount = $t02641426464._2
557- let $t02646826694 = if (outInAmountAsset)
554+ let $t02642226472 = takeFee(amountRaw)
555+ let totalAmount = $t02642226472._1
556+ let feeAmount = $t02642226472._2
557+ let $t02647626702 = if (outInAmountAsset)
558558 then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld)
559559 else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw))
560- let outAmAmount = $t02646826694._1
561- let outPrAmount = $t02646826694._2
562- let amBalanceNew = $t02646826694._3
563- let prBalanceNew = $t02646826694._4
560+ let outAmAmount = $t02647626702._1
561+ let outPrAmount = $t02647626702._2
562+ let amBalanceNew = $t02647626702._3
563+ let prBalanceNew = $t02647626702._4
564564 let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, cfgPriceAssetDecimals), toX18(amBalanceNew, cfgAmountAssetDecimals))
565565 let priceNew = fromX18(priceNewX18, scale8)
566566 let commonState = if (isEval)
567567 then nil
568568 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)]
569569 let priceOldX18 = calcPriceBigInt(toX18(prBalanceOld, cfgPriceAssetDecimals), toX18(amBalanceOld, cfgAmountAssetDecimals))
570570 let priceOld = fromX18(priceOldX18, scale8)
571- let bonus = {
571+ let loss = {
572572 let amountBothInPaymentAsset = (toInt(fraction(balanceBigInt, redeemedBigInt, supplyBigInt)) * 2)
573- (((totalAmount - amountBothInPaymentAsset) * scale8) / totalAmount)
573+ fraction((totalAmount - amountBothInPaymentAsset), scale8, amountBothInPaymentAsset)
574574 }
575- $Tuple4(totalAmount, commonState, feeAmount, bonus)
575+ $Tuple4(totalAmount, commonState, feeAmount, loss)
576576 }
577577 else throw("Strict value is not equal to itself.")
578578 }
579579
580580
581581 func managerPublicKeyOrUnit () = match getString(mpk()) {
582582 case s: String =>
583583 fromBase58String(s)
584584 case _: Unit =>
585585 unit
586586 case _ =>
587587 throw("Match error")
588588 }
589589
590590
591591 func pendingManagerPublicKeyOrUnit () = match getString(pmpk()) {
592592 case s: String =>
593593 fromBase58String(s)
594594 case _: Unit =>
595595 unit
596596 case _ =>
597597 throw("Match error")
598598 }
599599
600600
601601 func mustManager (i) = {
602602 let pd = throw("Permission denied")
603603 match managerPublicKeyOrUnit() {
604604 case pk: ByteVector =>
605605 if ((i.callerPublicKey == pk))
606606 then true
607607 else pd
608608 case _: Unit =>
609609 if ((i.caller == this))
610610 then true
611611 else pd
612612 case _ =>
613613 throw("Match error")
614614 }
615615 }
616616
617617
618618 @Callable(i)
619619 func setManager (pendingManagerPublicKey) = {
620620 let checkCaller = mustManager(i)
621621 if ((checkCaller == checkCaller))
622622 then {
623623 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
624624 if ((checkManagerPublicKey == checkManagerPublicKey))
625625 then [StringEntry(pmpk(), pendingManagerPublicKey)]
626626 else throw("Strict value is not equal to itself.")
627627 }
628628 else throw("Strict value is not equal to itself.")
629629 }
630630
631631
632632
633633 @Callable(i)
634634 func confirmManager () = {
635635 let pm = pendingManagerPublicKeyOrUnit()
636636 let hasPM = if (isDefined(pm))
637637 then true
638638 else throw("No pending manager")
639639 if ((hasPM == hasPM))
640640 then {
641641 let checkPM = if ((i.callerPublicKey == value(pm)))
642642 then true
643643 else throw("You are not pending manager")
644644 if ((checkPM == checkPM))
645645 then [StringEntry(mpk(), toBase58String(value(pm))), DeleteEntry(pmpk())]
646646 else throw("Strict value is not equal to itself.")
647647 }
648648 else throw("Strict value is not equal to itself.")
649649 }
650650
651651
652652
653653 @Callable(i)
654654 func put (slippageTolerance,shouldAutoStake) = if ((0 > slippageTolerance))
655655 then throw("Invalid slippageTolerance passed")
656656 else {
657657 let estPut = commonPut(i, slippageTolerance, true)
658658 let emitLpAmt = estPut._2
659659 let lpAssetId = estPut._7
660660 let state = estPut._9
661661 let amDiff = estPut._10
662662 let prDiff = estPut._11
663663 let amId = estPut._12
664664 let prId = estPut._13
665665 let emitInv = invoke(factoryContract, "emit", [emitLpAmt], nil)
666666 if ((emitInv == emitInv))
667667 then {
668668 let emitInvLegacy = match emitInv {
669669 case legacyFactoryContract: Address =>
670670 invoke(legacyFactoryContract, "emit", [emitLpAmt], nil)
671671 case _ =>
672672 unit
673673 }
674674 if ((emitInvLegacy == emitInvLegacy))
675675 then {
676676 let slippageAInv = if ((amDiff > 0))
677677 then invoke(slippageContract, "put", nil, [AttachedPayment(amId, amDiff)])
678678 else nil
679679 if ((slippageAInv == slippageAInv))
680680 then {
681681 let slippagePInv = if ((prDiff > 0))
682682 then invoke(slippageContract, "put", nil, [AttachedPayment(prId, prDiff)])
683683 else nil
684684 if ((slippagePInv == slippagePInv))
685685 then {
686686 let lpTransfer = if (shouldAutoStake)
687687 then {
688688 let slpStakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)])
689689 if ((slpStakeInv == slpStakeInv))
690690 then nil
691691 else throw("Strict value is not equal to itself.")
692692 }
693693 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
694694 (state ++ lpTransfer)
695695 }
696696 else throw("Strict value is not equal to itself.")
697697 }
698698 else throw("Strict value is not equal to itself.")
699699 }
700700 else throw("Strict value is not equal to itself.")
701701 }
702702 else throw("Strict value is not equal to itself.")
703703 }
704704
705705
706706
707707 @Callable(i)
708708 func putForFree (maxSlippage) = if ((0 > maxSlippage))
709709 then throw("Invalid value passed")
710710 else {
711711 let estPut = commonPut(i, maxSlippage, false)
712712 estPut._9
713713 }
714714
715715
716716
717717 @Callable(i)
718718 func putOneTkn (minOutAmount,autoStake) = {
719719 let isPoolOneTokenOperationsDisabled = {
720720 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
721721 if ($isInstanceOf(@, "Boolean"))
722722 then @
723723 else throw(($getType(@) + " couldn't be cast to Boolean"))
724724 }
725725 let isPutDisabled = if (if (if (isGlobalShutdown())
726726 then true
727727 else (cfgPoolStatus == PoolPutDisabled))
728728 then true
729729 else (cfgPoolStatus == PoolShutdown))
730730 then true
731731 else isPoolOneTokenOperationsDisabled
732732 let checks = [if (!(isPutDisabled))
733733 then true
734734 else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1))
735735 then true
736736 else throwErr("exactly 1 payment are expected")]
737737 if ((checks == checks))
738738 then {
739739 let payment = i.payments[0]
740740 let paymentAssetId = payment.assetId
741741 let paymentAmountRaw = payment.amount
742742 let userAddress = i.caller
743743 let txId = i.transactionId
744- let $t03138731514 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
745- let emitAmountEstimated = $t03138731514._1
746- let commonState = $t03138731514._2
747- let feeAmount = $t03138731514._3
748- let bonus = $t03138731514._4
744+ let $t03141231539 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
745+ let emitAmountEstimated = $t03141231539._1
746+ let commonState = $t03141231539._2
747+ let feeAmount = $t03141231539._3
748+ let bonus = $t03141231539._4
749749 let emitAmount = if (if ((minOutAmount > 0))
750750 then (minOutAmount > emitAmountEstimated)
751751 else false)
752752 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
753753 else emitAmountEstimated
754754 let emitInv = emit(emitAmount)
755755 if ((emitInv == emitInv))
756756 then {
757757 let lpTransfer = if (autoStake)
758758 then {
759759 let stakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(cfgLpAssetId, emitAmount)])
760760 if ((stakeInv == stakeInv))
761761 then nil
762762 else throw("Strict value is not equal to itself.")
763763 }
764764 else [ScriptTransfer(i.caller, emitAmount, cfgLpAssetId)]
765765 let sendFee = if ((feeAmount > 0))
766766 then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
767767 else nil
768768 $Tuple2(((commonState ++ lpTransfer) ++ sendFee), emitAmount)
769769 }
770770 else throw("Strict value is not equal to itself.")
771771 }
772772 else throw("Strict value is not equal to itself.")
773773 }
774774
775775
776776
777777 @Callable(i)
778778 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
779- let $t03224332378 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
780- let emitAmountEstimated = $t03224332378._1
781- let commonState = $t03224332378._2
782- let feeAmount = $t03224332378._3
783- let bonus = $t03224332378._4
779+ let $t03226832403 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
780+ let emitAmountEstimated = $t03226832403._1
781+ let commonState = $t03226832403._2
782+ let feeAmount = $t03226832403._3
783+ let bonus = $t03226832403._4
784784 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
785785 }
786786
787787
788788
789789 @Callable(i)
790790 func getOneTkn (outAssetIdStr,minOutAmount) = {
791791 let isPoolOneTokenOperationsDisabled = {
792792 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
793793 if ($isInstanceOf(@, "Boolean"))
794794 then @
795795 else throw(($getType(@) + " couldn't be cast to Boolean"))
796796 }
797797 let isGetDisabled = if (if (isGlobalShutdown())
798798 then true
799799 else (cfgPoolStatus == PoolShutdown))
800800 then true
801801 else isPoolOneTokenOperationsDisabled
802802 let checks = [if (!(isGetDisabled))
803803 then true
804804 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1))
805805 then true
806806 else throwErr("exactly 1 payment are expected")]
807807 if ((checks == checks))
808808 then {
809809 let outAssetId = parseAssetId(outAssetIdStr)
810810 let payment = i.payments[0]
811811 let paymentAssetId = payment.assetId
812812 let paymentAmount = payment.amount
813813 let userAddress = i.caller
814814 let txId = i.transactionId
815- let $t03315033282 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
816- let amountEstimated = $t03315033282._1
817- let commonState = $t03315033282._2
818- let feeAmount = $t03315033282._3
819- let bonus = $t03315033282._4
815+ let $t03317533307 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
816+ let amountEstimated = $t03317533307._1
817+ let commonState = $t03317533307._2
818+ let feeAmount = $t03317533307._3
819+ let bonus = $t03317533307._4
820820 let amount = if (if ((minOutAmount > 0))
821821 then (minOutAmount > amountEstimated)
822822 else false)
823823 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
824824 else amountEstimated
825825 let burnInv = invoke(factoryContract, "burn", [paymentAmount], [AttachedPayment(paymentAssetId, paymentAmount)])
826826 if ((burnInv == burnInv))
827827 then {
828828 let assetTransfer = [ScriptTransfer(userAddress, amount, outAssetId)]
829829 let sendFee = if ((feeAmount > 0))
830830 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
831831 else nil
832832 $Tuple2(((commonState ++ assetTransfer) ++ sendFee), amount)
833833 }
834834 else throw("Strict value is not equal to itself.")
835835 }
836836 else throw("Strict value is not equal to itself.")
837837 }
838838
839839
840840
841841 @Callable(i)
842842 func getOneTknREADONLY (outAssetId,paymentAmount) = {
843- let $t03391734055 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
844- let amountEstimated = $t03391734055._1
845- let commonState = $t03391734055._2
846- let feeAmount = $t03391734055._3
847- let bonus = $t03391734055._4
843+ let $t03394234080 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
844+ let amountEstimated = $t03394234080._1
845+ let commonState = $t03394234080._2
846+ let feeAmount = $t03394234080._3
847+ let bonus = $t03394234080._4
848848 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
849849 }
850850
851851
852852
853853 @Callable(i)
854854 func unstakeAndGetOneTkn (unstakeAmount,outAssetIdStr,minOutAmount) = {
855855 let isPoolOneTokenOperationsDisabled = {
856856 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
857857 if ($isInstanceOf(@, "Boolean"))
858858 then @
859859 else throw(($getType(@) + " couldn't be cast to Boolean"))
860860 }
861861 let isGetDisabled = if (if (isGlobalShutdown())
862862 then true
863863 else (cfgPoolStatus == PoolShutdown))
864864 then true
865865 else isPoolOneTokenOperationsDisabled
866866 let checks = [if (!(isGetDisabled))
867867 then true
868868 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 0))
869869 then true
870870 else throwErr("no payments are expected")]
871871 if ((checks == checks))
872872 then {
873873 let outAssetId = parseAssetId(outAssetIdStr)
874874 let userAddress = i.caller
875875 let txId = i.transactionId
876876 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
877877 if ((unstakeInv == unstakeInv))
878878 then {
879- let $t03484734977 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
880- let amountEstimated = $t03484734977._1
881- let commonState = $t03484734977._2
882- let feeAmount = $t03484734977._3
883- let bonus = $t03484734977._4
879+ let $t03487235002 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
880+ let amountEstimated = $t03487235002._1
881+ let commonState = $t03487235002._2
882+ let feeAmount = $t03487235002._3
883+ let bonus = $t03487235002._4
884884 let amount = if (if ((minOutAmount > 0))
885885 then (minOutAmount > amountEstimated)
886886 else false)
887887 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
888888 else amountEstimated
889889 let burnInv = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
890890 if ((burnInv == burnInv))
891891 then {
892892 let assetTransfer = [ScriptTransfer(i.caller, amount, outAssetId)]
893893 let sendFee = if ((feeAmount > 0))
894894 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
895895 else nil
896896 $Tuple2(((commonState ++ assetTransfer) ++ sendFee), amount)
897897 }
898898 else throw("Strict value is not equal to itself.")
899899 }
900900 else throw("Strict value is not equal to itself.")
901901 }
902902 else throw("Strict value is not equal to itself.")
903903 }
904904
905905
906906
907907 @Callable(i)
908908 func get () = {
909909 let res = commonGet(i)
910910 let outAmtAmt = res._1
911911 let outPrAmt = res._2
912912 let pmtAmt = res._3
913913 let pmtAssetId = res._4
914914 let state = res._5
915915 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
916916 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
917917 then state
918918 else throw("Strict value is not equal to itself.")
919919 }
920920
921921
922922
923923 @Callable(i)
924924 func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = {
925925 let res = commonGet(i)
926926 let outAmAmt = res._1
927927 let outPrAmt = res._2
928928 let pmtAmt = res._3
929929 let pmtAssetId = res._4
930930 let state = res._5
931931 if ((noLessThenAmtAsset > outAmAmt))
932932 then throw(((("noLessThenAmtAsset failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset)))
933933 else if ((noLessThenPriceAsset > outPrAmt))
934934 then throw(((("noLessThenPriceAsset failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset)))
935935 else {
936936 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
937937 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
938938 then state
939939 else throw("Strict value is not equal to itself.")
940940 }
941941 }
942942
943943
944944
945945 @Callable(i)
946946 func unstakeAndGet (amount) = {
947947 let checkPayments = if ((size(i.payments) != 0))
948948 then throw("No payments are expected")
949949 else true
950950 if ((checkPayments == checkPayments))
951951 then {
952952 let cfg = getPoolConfig()
953953 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
954954 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(lpAssetId), amount], nil)
955955 if ((unstakeInv == unstakeInv))
956956 then {
957957 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller)
958958 let poolStatus = parseIntValue(res._9)
959959 let state = res._10
960960 let checkPoolStatus = if (if (isGlobalShutdown())
961961 then true
962962 else (poolStatus == PoolShutdown))
963963 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
964964 else true
965965 if ((checkPoolStatus == checkPoolStatus))
966966 then {
967967 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
968968 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
969969 then state
970970 else throw("Strict value is not equal to itself.")
971971 }
972972 else throw("Strict value is not equal to itself.")
973973 }
974974 else throw("Strict value is not equal to itself.")
975975 }
976976 else throw("Strict value is not equal to itself.")
977977 }
978978
979979
980980
981981 @Callable(i)
982982 func unstakeAndGetNoLess (unstakeAmount,noLessThenAmountAsset,noLessThenPriceAsset) = {
983983 let isGetDisabled = if (isGlobalShutdown())
984984 then true
985985 else (cfgPoolStatus == PoolShutdown)
986986 let checks = [if (!(isGetDisabled))
987987 then true
988988 else throw("get operation is blocked by admin"), if ((size(i.payments) == 0))
989989 then true
990990 else throw("no payments are expected")]
991991 if ((checks == checks))
992992 then {
993993 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
994994 if ((unstakeInv == unstakeInv))
995995 then {
996996 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller)
997997 let outAmAmt = res._1
998998 let outPrAmt = res._2
999999 let state = res._10
10001000 let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset))
10011001 then true
10021002 else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset))
10031003 then true
10041004 else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))]
10051005 if ((checkAmounts == checkAmounts))
10061006 then {
10071007 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
10081008 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
10091009 then state
10101010 else throw("Strict value is not equal to itself.")
10111011 }
10121012 else throw("Strict value is not equal to itself.")
10131013 }
10141014 else throw("Strict value is not equal to itself.")
10151015 }
10161016 else throw("Strict value is not equal to itself.")
10171017 }
10181018
10191019
10201020
10211021 @Callable(i)
10221022 func activate (amtAssetStr,priceAssetStr) = if ((toString(i.caller) != toString(factoryContract)))
10231023 then throw("permissions denied")
10241024 else $Tuple2([StringEntry(aa(), amtAssetStr), StringEntry(pa(), priceAssetStr)], "success")
10251025
10261026
10271027
10281028 @Callable(i)
10291029 func getPoolConfigWrapperREADONLY () = $Tuple2(nil, getPoolConfig())
10301030
10311031
10321032
10331033 @Callable(i)
10341034 func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId))
10351035
10361036
10371037
10381038 @Callable(i)
10391039 func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = {
10401040 let prices = calcPrices(amAmt, prAmt, lpAmt)
10411041 $Tuple2(nil, [toString(prices[0]), toString(prices[1]), toString(prices[2])])
10421042 }
10431043
10441044
10451045
10461046 @Callable(i)
10471047 func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(toX18(origVal, origScaleMult)))
10481048
10491049
10501050
10511051 @Callable(i)
10521052 func fromX18WrapperREADONLY (val,resultScaleMult) = $Tuple2(nil, fromX18(parseBigIntValue(val), resultScaleMult))
10531053
10541054
10551055
10561056 @Callable(i)
10571057 func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(calcPriceBigInt(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18))))
10581058
10591059
10601060
10611061 @Callable(i)
10621062 func estimatePutOperationWrapperREADONLY (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = $Tuple2(nil, estimatePutOperation(txId58, slippageTolerance, inAmAssetAmt, inAmAssetId, inPrAssetAmt, inPrAssetId, userAddress, isEvaluate, emitLp))
10631063
10641064
10651065
10661066 @Callable(i)
10671067 func estimateGetOperationWrapperREADONLY (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
10681068 let res = estimateGetOperation(txId58, pmtAssetId, pmtLpAmt, addressFromStringValue(userAddress))
10691069 $Tuple2(nil, $Tuple10(res._1, res._2, res._3, res._4, res._5, res._6, res._7, toString(res._8), res._9, res._10))
10701070 }
10711071
10721072
10731073
10741074 @Callable(i)
10751075 func statsREADONLY () = {
10761076 let cfg = getPoolConfig()
10771077 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
10781078 let amtAssetId = cfg[idxAmtAssetId]
10791079 let priceAssetId = cfg[idxPriceAssetId]
10801080 let iAmtAssetId = cfg[idxIAmtAssetId]
10811081 let iPriceAssetId = cfg[idxIPriceAssetId]
10821082 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
10831083 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
10841084 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
10851085 let accAmtAssetBalance = getAccBalance(amtAssetId)
10861086 let accPriceAssetBalance = getAccBalance(priceAssetId)
10871087 let pricesList = if ((poolLPBalance == 0))
10881088 then [zeroBigInt, zeroBigInt, zeroBigInt]
10891089 else calcPrices(accAmtAssetBalance, accPriceAssetBalance, poolLPBalance)
10901090 let curPrice = 0
10911091 let lpAmtAssetShare = fromX18(pricesList[1], scale8)
10921092 let lpPriceAssetShare = fromX18(pricesList[2], scale8)
10931093 let poolWeight = value(getInteger(factoryContract, keyPoolWeight(toString(this))))
10941094 $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))
10951095 }
10961096
10971097
10981098
10991099 @Callable(i)
11001100 func evaluatePutByAmountAssetREADONLY (inAmAssetAmt) = {
11011101 let cfg = getPoolConfig()
11021102 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
11031103 let amAssetIdStr = cfg[idxAmtAssetId]
11041104 let amAssetId = fromBase58String(amAssetIdStr)
11051105 let prAssetIdStr = cfg[idxPriceAssetId]
11061106 let prAssetId = fromBase58String(prAssetIdStr)
11071107 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
11081108 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
11091109 let poolStatus = cfg[idxPoolStatus]
11101110 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
11111111 let accAmtAssetBalance = getAccBalance(amAssetIdStr)
11121112 let accPriceAssetBalance = getAccBalance(prAssetIdStr)
11131113 let amtAssetAmtX18 = toX18(accAmtAssetBalance, amtAssetDcm)
11141114 let priceAssetAmtX18 = toX18(accPriceAssetBalance, priceAssetDcm)
11151115 let curPriceX18 = if ((poolLPBalance == 0))
11161116 then zeroBigInt
11171117 else calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
11181118 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
11191119 let inPrAssetAmtX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18)
11201120 let inPrAssetAmt = fromX18(inPrAssetAmtX18, priceAssetDcm)
11211121 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
11221122 let calcLpAmt = estPut._1
11231123 let curPriceCalc = estPut._3
11241124 let amBalance = estPut._4
11251125 let prBalance = estPut._5
11261126 let lpEmission = estPut._6
11271127 $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))
11281128 }
11291129
11301130
11311131
11321132 @Callable(i)
11331133 func evaluatePutByPriceAssetREADONLY (inPrAssetAmt) = {
11341134 let cfg = getPoolConfig()
11351135 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
11361136 let amAssetIdStr = cfg[idxAmtAssetId]
11371137 let amAssetId = fromBase58String(amAssetIdStr)
11381138 let prAssetIdStr = cfg[idxPriceAssetId]
11391139 let prAssetId = fromBase58String(prAssetIdStr)
11401140 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
11411141 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
11421142 let poolStatus = cfg[idxPoolStatus]
11431143 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
11441144 let amBalanceRaw = getAccBalance(amAssetIdStr)
11451145 let prBalanceRaw = getAccBalance(prAssetIdStr)
11461146 let amBalanceRawX18 = toX18(amBalanceRaw, amtAssetDcm)
11471147 let prBalanceRawX18 = toX18(prBalanceRaw, priceAssetDcm)
11481148 let curPriceX18 = if ((poolLPBalance == 0))
11491149 then zeroBigInt
11501150 else calcPriceBigInt(prBalanceRawX18, amBalanceRawX18)
11511151 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
11521152 let inAmAssetAmtX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
11531153 let inAmAssetAmt = fromX18(inAmAssetAmtX18, amtAssetDcm)
11541154 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
11551155 let calcLpAmt = estPut._1
11561156 let curPriceCalc = estPut._3
11571157 let amBalance = estPut._4
11581158 let prBalance = estPut._5
11591159 let lpEmission = estPut._6
11601160 $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))
11611161 }
11621162
11631163
11641164
11651165 @Callable(i)
11661166 func evaluateGetREADONLY (paymentLpAssetId,paymentLpAmt) = {
11671167 let res = estimateGetOperation("", paymentLpAssetId, paymentLpAmt, this)
11681168 let outAmAmt = res._1
11691169 let outPrAmt = res._2
11701170 let amBalance = res._5
11711171 let prBalance = res._6
11721172 let lpEmission = res._7
11731173 let curPrice = res._8
11741174 let poolStatus = parseIntValue(res._9)
11751175 $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))
11761176 }
11771177
11781178
11791179 @Verifier(tx)
11801180 func verify () = {
11811181 let targetPublicKey = match managerPublicKeyOrUnit() {
11821182 case pk: ByteVector =>
11831183 pk
11841184 case _: Unit =>
11851185 tx.senderPublicKey
11861186 case _ =>
11871187 throw("Match error")
11881188 }
11891189 match tx {
11901190 case order: Order =>
11911191 let matcherPub = getMatcherPubOrFail()
11921192 let orderValid = validateMatcherOrderAllowed(order)
11931193 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
11941194 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
11951195 if (if (if (orderValid)
11961196 then senderValid
11971197 else false)
11981198 then matcherValid
11991199 else false)
12001200 then true
12011201 else throwOrderError(orderValid, senderValid, matcherValid)
12021202 case s: SetScriptTransaction =>
12031203 let newHash = blake2b256(value(s.script))
12041204 let allowedHash = fromBase64String(value(getString(factoryContract, keyAllowedLpScriptHash())))
12051205 let currentHash = scriptHash(this)
12061206 if (if ((allowedHash == newHash))
12071207 then (currentHash != newHash)
12081208 else false)
12091209 then true
12101210 else sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
12111211 case _ =>
12121212 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
12131213 }
12141214 }
12151215

github/deemru/w8io/026f985 
145.97 ms