tx · 9XhT84BzULwi49zMT7Df8nvpnJsy92CkWeuiQnxjCt3w

3N8xhCqhby2FuAxqMfNmJcoVYrkkJiVE1Jr:  -0.02800000 Waves

2022.10.13 18:30 [2270766] smart account 3N8xhCqhby2FuAxqMfNmJcoVYrkkJiVE1Jr > SELF 0.00000000 Waves

{ "type": 13, "id": "9XhT84BzULwi49zMT7Df8nvpnJsy92CkWeuiQnxjCt3w", "fee": 2800000, "feeAssetId": null, "timestamp": 1665674978761, "version": 1, "sender": "3N8xhCqhby2FuAxqMfNmJcoVYrkkJiVE1Jr", "senderPublicKey": "5tCEcjM69HsRh7dRpSZ51WjznVLspnZVwPFARKC33MkF", "proofs": [ "4PMxkUzudcWJ47tuevTufZLhmvTxgTEE8K4LsZH3nHJ2x81oXquFcy4zZVo52LiYQ1cH6KfASsta1QLfiXFN9ABx" ], "script": "base64:BgLkJQgCEgMKAQgSABIECgIBBBIDCgEBEgQKAgEEEgUKAwgBARIAEgQKAgEBEgMKAQESBAoCCAgSABIDCgEIEgUKAwEBARIECgIBARIECgIIARIECgIICBILCgkIAQECAQIIBAQSBgoECAgBCBIAEgMKAQESAwoBARIECgIIASIKbFBkZWNpbWFscyIGc2NhbGU4IgxzY2FsZThCaWdJbnQiB3NjYWxlMTgiCnplcm9CaWdJbnQiBGJpZzAiBGJpZzEiBGJpZzIiC3dhdmVzU3RyaW5nIgNTRVAiClBvb2xBY3RpdmUiD1Bvb2xQdXREaXNhYmxlZCITUG9vbE1hdGNoZXJEaXNhYmxlZCIMUG9vbFNodXRkb3duIg5pZHhQb29sQWRkcmVzcyINaWR4UG9vbFN0YXR1cyIQaWR4UG9vbExQQXNzZXRJZCINaWR4QW10QXNzZXRJZCIPaWR4UHJpY2VBc3NldElkIg5pZHhBbXRBc3NldERjbSIQaWR4UHJpY2VBc3NldERjbSIOaWR4SUFtdEFzc2V0SWQiEGlkeElQcmljZUFzc2V0SWQiDWlkeExQQXNzZXREY20iEmlkeFBvb2xBbXRBc3NldEFtdC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DAggFAmNIBnByb29mcwAACAUCY0gPc2VuZGVyUHVibGljS2V5BAJhdgkA9AMDCAUCY0gJYm9keUJ5dGVzCQCRAwIIBQJjSAZwcm9vZnMAAQUCZkEDAwMFAmF0BQJhdQcFAmF2BwYJAQJhcwMFAmF0BQJhdQUCYXYDCQABAgUCZGcCFFNldFNjcmlwdFRyYW5zYWN0aW9uBAJlcwUCZGcEAmZCCQD2AwEJAQV2YWx1ZQEIBQJlcwZzY3JpcHQEAmZDCQDbBAEJAQV2YWx1ZQEJAJ0IAgUCYUMJAQJhcQAEAmZECQDxBwEFBHRoaXMDAwkAAAIFAmZDBQJmQgkBAiE9AgUCZkQFAmZCBwYJAPQDAwgFAmZ4CWJvZHlCeXRlcwkAkQMCCAUCZngGcHJvb2ZzAAAFAmZ6CQD0AwMIBQJmeAlib2R5Qnl0ZXMJAJEDAggFAmZ4BnByb29mcwAABQJmeg3+3sM=", "chainId": 84, "height": 2270766, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: EMr8bKnNkhp9BmLbbyHsNcX1yM5JxN61C9P21gRmNb8h Next: EDf7PUcwvYRM6ZyzP8pLCNEjqDXzmjoQ9GUdiadjaz7u Diff:
OldNewDifferences
1515
1616 let big1 = toBigInt(1)
1717
18-let big2 = toBigInt(1)
18+let big2 = toBigInt(2)
1919
2020 let wavesString = "WAVES"
2121
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
18-let big2 = toBigInt(1)
18+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 ((zeroBigInt > val))
7272 then -(val)
7373 else val
7474
7575
7676 func fc () = "%s__factoryContract"
7777
7878
7979 func mpk () = "%s__managerPublicKey"
8080
8181
8282 func pmpk () = "%s__pendingManagerPublicKey"
8383
8484
8585 func pl () = "%s%s__price__last"
8686
8787
8888 func ph (h,timestamp) = makeString(["%s%s%d%d__price__history", toString(h), toString(timestamp)], SEP)
8989
9090
9191 func pau (userAddress,txId) = ((("%s%s%s__P__" + userAddress) + "__") + txId)
9292
9393
9494 func gau (userAddress,txId) = ((("%s%s%s__G__" + userAddress) + "__") + txId)
9595
9696
9797 func aa () = "%s__amountAsset"
9898
9999
100100 func pa () = "%s__priceAsset"
101101
102102
103103 let keyFee = "%s__fee"
104104
105105 let feeDefault = fraction(5, scale8, 10000)
106106
107107 let fee = valueOrElse(getInteger(this, keyFee), feeDefault)
108108
109109 func keyFactoryConfig () = "%s__factoryConfig"
110110
111111
112112 func keyMatcherPub () = "%s%s__matcher__publicKey"
113113
114114
115115 func keyMappingPoolContractAddressToPoolAssets (poolContractAddress) = (("%s%s%s__" + poolContractAddress) + "__mappings__poolContract2LpAsset")
116116
117117
118118 func keyPoolConfig (iAmtAsset,iPriceAsset) = (((("%d%d%s__" + iAmtAsset) + "__") + iPriceAsset) + "__config")
119119
120120
121121 func keyMappingsBaseAsset2internalId (baseAssetStr) = ("%s%s%s__mappings__baseAsset2internalId__" + baseAssetStr)
122122
123123
124124 func keyAllPoolsShutdown () = "%s__shutdown"
125125
126126
127127 func keyPoolWeight (contractAddress) = ("%s%s__poolWeight__" + contractAddress)
128128
129129
130130 func keyAllowedLpScriptHash () = "%s__allowedLpScriptHash"
131131
132132
133133 let keyFeeCollectorAddress = "%s__feeCollectorAddress"
134134
135135 func throwOrderError (orderValid,senderValid,matcherValid) = throw(((((("order validation failed: orderValid=" + toString(orderValid)) + " senderValid=") + toString(senderValid)) + " matcherValid=") + toString(matcherValid)))
136136
137137
138138 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
139139
140140
141141 func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
142142
143143
144144 func throwErr (msg) = throw(makeString(["lp.ride:", msg], " "))
145145
146146
147147 let factoryContract = addressFromStringValue(getStringOrFail(this, fc()))
148148
149149 let feeCollectorAddress = addressFromStringValue(getStringOrFail(factoryContract, keyFeeCollectorAddress))
150150
151151 func isGlobalShutdown () = valueOrElse(getBoolean(factoryContract, keyAllPoolsShutdown()), false)
152152
153153
154154 func getMatcherPubOrFail () = fromBase58String(getStringOrFail(factoryContract, keyMatcherPub()))
155155
156156
157157 func getPoolConfig () = {
158158 let amtAsset = getStringOrFail(this, aa())
159159 let priceAsset = getStringOrFail(this, pa())
160160 let iPriceAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(priceAsset))
161161 let iAmtAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(amtAsset))
162162 split(getStringOrFail(factoryContract, keyPoolConfig(toString(iAmtAsset), toString(iPriceAsset))), SEP)
163163 }
164164
165165
166166 func parseAssetId (input) = if ((input == wavesString))
167167 then unit
168168 else fromBase58String(input)
169169
170170
171171 func assetIdToString (input) = if ((input == unit))
172172 then wavesString
173173 else toBase58String(value(input))
174174
175175
176176 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]))
177177
178178
179179 func getFactoryConfig () = split(getStringOrFail(factoryContract, keyFactoryConfig()), SEP)
180180
181181
182182 let stakingContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactoryStakingContract]), "incorrect staking address")
183183
184184 let slippageContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactorySlippageContract]), "incorrect staking address")
185185
186186 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)
187187
188188
189189 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)
190190
191191
192192 func getAccBalance (assetId) = if ((assetId == "WAVES"))
193193 then wavesBalance(this).available
194194 else assetBalance(this, fromBase58String(assetId))
195195
196196
197197 func calcPriceBigInt (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18)
198198
199199
200200 func privateCalcPrice (amAssetDcm,prAssetDcm,amAmt,prAmt) = {
201201 let amtAssetAmtX18 = toX18(amAmt, amAssetDcm)
202202 let priceAssetAmtX18 = toX18(prAmt, prAssetDcm)
203203 calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
204204 }
205205
206206
207207 func calcPrices (amAmt,prAmt,lpAmt) = {
208208 let cfg = getPoolConfig()
209209 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
210210 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
211211 let priceX18 = privateCalcPrice(amtAssetDcm, priceAssetDcm, amAmt, prAmt)
212212 let amAmtX18 = toX18(amAmt, amtAssetDcm)
213213 let prAmtX18 = toX18(prAmt, priceAssetDcm)
214214 let lpAmtX18 = toX18(lpAmt, scale8)
215215 let lpPriceInAmAssetX18 = calcPriceBigInt(amAmtX18, lpAmtX18)
216216 let lpPriceInPrAssetX18 = calcPriceBigInt(prAmtX18, lpAmtX18)
217217 [priceX18, lpPriceInAmAssetX18, lpPriceInPrAssetX18]
218218 }
219219
220220
221221 func calculatePrices (amAmt,prAmt,lpAmt) = {
222222 let prices = calcPrices(amAmt, prAmt, lpAmt)
223223 [fromX18(prices[0], scale8), fromX18(prices[1], scale8), fromX18(prices[2], scale8)]
224224 }
225225
226226
227227 func estimateGetOperation (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
228228 let cfg = getPoolConfig()
229229 let lpAssetId = cfg[idxPoolLPAssetId]
230230 let amAssetId = cfg[idxAmtAssetId]
231231 let prAssetId = cfg[idxPriceAssetId]
232232 let amAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
233233 let prAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
234234 let poolStatus = cfg[idxPoolStatus]
235235 let lpEmission = valueOrErrorMessage(assetInfo(fromBase58String(lpAssetId)), (("Asset " + lpAssetId) + " doesn't exist")).quantity
236236 if ((lpAssetId != pmtAssetId))
237237 then throw("Invalid asset passed.")
238238 else {
239239 let amBalance = getAccBalance(amAssetId)
240240 let amBalanceX18 = toX18(amBalance, amAssetDcm)
241241 let prBalance = getAccBalance(prAssetId)
242242 let prBalanceX18 = toX18(prBalance, prAssetDcm)
243243 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
244244 let curPrice = fromX18(curPriceX18, scale8)
245245 let pmtLpAmtX18 = toX18(pmtLpAmt, scale8)
246246 let lpEmissionX18 = toX18(lpEmission, scale8)
247247 let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissionX18)
248248 let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissionX18)
249249 let outAmAmt = fromX18(outAmAmtX18, amAssetDcm)
250250 let outPrAmt = fromX18(outPrAmtX18, prAssetDcm)
251251 let state = if ((txId58 == ""))
252252 then nil
253253 else [ScriptTransfer(userAddress, outAmAmt, if ((amAssetId == "WAVES"))
254254 then unit
255255 else fromBase58String(amAssetId)), ScriptTransfer(userAddress, outPrAmt, if ((prAssetId == "WAVES"))
256256 then unit
257257 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)]
258258 $Tuple10(outAmAmt, outPrAmt, amAssetId, prAssetId, amBalance, prBalance, lpEmission, curPriceX18, poolStatus, state)
259259 }
260260 }
261261
262262
263263 func estimatePutOperation (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = {
264264 let cfg = getPoolConfig()
265265 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
266266 let amAssetIdStr = cfg[idxAmtAssetId]
267267 let prAssetIdStr = cfg[idxPriceAssetId]
268268 let iAmtAssetId = cfg[idxIAmtAssetId]
269269 let iPriceAssetId = cfg[idxIPriceAssetId]
270270 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
271271 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
272272 let poolStatus = cfg[idxPoolStatus]
273273 let lpEmission = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
274274 let inAmAssetIdStr = toBase58String(valueOrElse(inAmAssetId, fromBase58String("WAVES")))
275275 let inPrAssetIdStr = toBase58String(valueOrElse(inPrAssetId, fromBase58String("WAVES")))
276276 if (if ((amAssetIdStr != inAmAssetIdStr))
277277 then true
278278 else (prAssetIdStr != inPrAssetIdStr))
279279 then throw("Invalid amt or price asset passed.")
280280 else {
281281 let amBalance = if (isEvaluate)
282282 then getAccBalance(amAssetIdStr)
283283 else (getAccBalance(amAssetIdStr) - inAmAssetAmt)
284284 let prBalance = if (isEvaluate)
285285 then getAccBalance(prAssetIdStr)
286286 else (getAccBalance(prAssetIdStr) - inPrAssetAmt)
287287 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
288288 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
289289 let userPriceX18 = calcPriceBigInt(inPrAssetAmtX18, inAmAssetAmtX18)
290290 let amBalanceX18 = toX18(amBalance, amtAssetDcm)
291291 let prBalanceX18 = toX18(prBalance, priceAssetDcm)
292292 let res = if ((lpEmission == 0))
293293 then {
294294 let curPriceX18 = zeroBigInt
295295 let slippageX18 = zeroBigInt
296296 let lpAmtX18 = pow((inAmAssetAmtX18 * inPrAssetAmtX18), 0, toBigInt(5), 1, 0, DOWN)
297297 $Tuple5(fromX18(lpAmtX18, scale8), fromX18(inAmAssetAmtX18, amtAssetDcm), fromX18(inPrAssetAmtX18, priceAssetDcm), calcPriceBigInt((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18)
298298 }
299299 else {
300300 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
301301 let slippageX18 = fraction(abs((curPriceX18 - userPriceX18)), scale18, curPriceX18)
302302 let slippageToleranceX18 = toX18(slippageTolerance, scale8)
303303 if (if ((curPriceX18 != zeroBigInt))
304304 then (slippageX18 > slippageToleranceX18)
305305 else false)
306306 then throw(((("Price slippage " + toString(slippageX18)) + " exceeded the passed limit of ") + toString(slippageToleranceX18)))
307307 else {
308308 let lpEmissionX18 = toX18(lpEmission, scale8)
309309 let prViaAmX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18)
310310 let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
311311 let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18))
312312 then $Tuple2(amViaPrX18, inPrAssetAmtX18)
313313 else $Tuple2(inAmAssetAmtX18, prViaAmX18)
314314 let expAmtAssetAmtX18 = expectedAmts._1
315315 let expPriceAssetAmtX18 = expectedAmts._2
316316 let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18)
317317 $Tuple5(fromX18(lpAmtX18, scale8), fromX18(expAmtAssetAmtX18, amtAssetDcm), fromX18(expPriceAssetAmtX18, priceAssetDcm), curPriceX18, slippageX18)
318318 }
319319 }
320320 let calcLpAmt = res._1
321321 let calcAmAssetPmt = res._2
322322 let calcPrAssetPmt = res._3
323323 let curPrice = fromX18(res._4, scale8)
324324 let slippageCalc = fromX18(res._5, scale8)
325325 if ((0 >= calcLpAmt))
326326 then throw("Invalid calculations. LP calculated is less than zero.")
327327 else {
328328 let emitLpAmt = if (!(emitLp))
329329 then 0
330330 else calcLpAmt
331331 let amDiff = (inAmAssetAmt - calcAmAssetPmt)
332332 let prDiff = (inPrAssetAmt - calcPrAssetPmt)
333333 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))]
334334 $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEmission, lpAssetId, poolStatus, commonState, amDiff, prDiff, inAmAssetId, inPrAssetId)
335335 }
336336 }
337337 }
338338
339339
340340 func validateMatcherOrderAllowed (order) = {
341341 let cfg = getPoolConfig()
342342 let amtAssetId = cfg[idxAmtAssetId]
343343 let priceAssetId = cfg[idxPriceAssetId]
344344 let poolStatus = parseIntValue(cfg[idxPoolStatus])
345345 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
346346 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
347347 let accAmtAssetBalance = getAccBalance(amtAssetId)
348348 let accPriceAssetBalance = getAccBalance(priceAssetId)
349349 let curPriceX18 = if ((order.orderType == Buy))
350350 then privateCalcPrice(amtAssetDcm, priceAssetDcm, (accAmtAssetBalance + order.amount), accPriceAssetBalance)
351351 else privateCalcPrice(amtAssetDcm, priceAssetDcm, (accAmtAssetBalance - order.amount), accPriceAssetBalance)
352352 let curPrice = fromX18(curPriceX18, scale8)
353353 if (if (if (isGlobalShutdown())
354354 then true
355355 else (poolStatus == PoolMatcherDisabled))
356356 then true
357357 else (poolStatus == PoolShutdown))
358358 then throw("Exchange operations disabled")
359359 else {
360360 let orderAmtAsset = order.assetPair.amountAsset
361361 let orderAmtAssetStr = if ((orderAmtAsset == unit))
362362 then "WAVES"
363363 else toBase58String(value(orderAmtAsset))
364364 let orderPriceAsset = order.assetPair.priceAsset
365365 let orderPriceAssetStr = if ((orderPriceAsset == unit))
366366 then "WAVES"
367367 else toBase58String(value(orderPriceAsset))
368368 if (if ((orderAmtAssetStr != amtAssetId))
369369 then true
370370 else (orderPriceAssetStr != priceAssetId))
371371 then throw("Wrong order assets.")
372372 else {
373373 let orderPrice = order.price
374374 let priceDcm = fraction(scale8, priceAssetDcm, amtAssetDcm)
375375 let castedOrderPrice = toScale(orderPrice, scale8, priceDcm)
376376 let isOrderPriceValid = if ((order.orderType == Buy))
377377 then (curPrice >= castedOrderPrice)
378378 else (castedOrderPrice >= curPrice)
379379 true
380380 }
381381 }
382382 }
383383
384384
385385 func commonGet (i) = if ((size(i.payments) != 1))
386386 then throw("exactly 1 payment is expected")
387387 else {
388388 let pmt = value(i.payments[0])
389389 let pmtAssetId = value(pmt.assetId)
390390 let pmtAmt = pmt.amount
391391 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller)
392392 let outAmAmt = res._1
393393 let outPrAmt = res._2
394394 let poolStatus = parseIntValue(res._9)
395395 let state = res._10
396396 if (if (isGlobalShutdown())
397397 then true
398398 else (poolStatus == PoolShutdown))
399399 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
400400 else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state)
401401 }
402402
403403
404404 func commonPut (i,slippageTolerance,emitLp) = if ((size(i.payments) != 2))
405405 then throw("exactly 2 payments are expected")
406406 else {
407407 let amAssetPmt = value(i.payments[0])
408408 let prAssetPmt = value(i.payments[1])
409409 let estPut = estimatePutOperation(toBase58String(i.transactionId), slippageTolerance, amAssetPmt.amount, amAssetPmt.assetId, prAssetPmt.amount, prAssetPmt.assetId, toString(i.caller), false, emitLp)
410410 let poolStatus = parseIntValue(estPut._8)
411411 if (if (if (isGlobalShutdown())
412412 then true
413413 else (poolStatus == PoolPutDisabled))
414414 then true
415415 else (poolStatus == PoolShutdown))
416416 then throw(("Put operation is blocked by admin. Status = " + toString(poolStatus)))
417417 else estPut
418418 }
419419
420420
421421 func emit (amount) = {
422422 let emitInv = invoke(factoryContract, "emit", [amount], nil)
423423 if ((emitInv == emitInv))
424424 then {
425425 let emitInvLegacy = match emitInv {
426426 case legacyFactoryContract: Address =>
427427 invoke(legacyFactoryContract, "emit", [amount], nil)
428428 case _ =>
429429 unit
430430 }
431431 if ((emitInvLegacy == emitInvLegacy))
432432 then amount
433433 else throw("Strict value is not equal to itself.")
434434 }
435435 else throw("Strict value is not equal to itself.")
436436 }
437437
438438
439439 func takeFee (amount) = {
440440 let feeAmount = fraction(amount, fee, scale8)
441441 $Tuple2((amount - feeAmount), feeAmount)
442442 }
443443
444444
445445 func calcPutOneToken (paymentAmountRaw,paymentAssetId,userAddress,txId) = {
446446 let isEval = (txId == unit)
447447 let $t02194222120 = parsePoolConfig(getPoolConfig())
448448 let poolAddress = $t02194222120._1
449449 let poolStatus = $t02194222120._2
450450 let lpAssetId = $t02194222120._3
451451 let amountAssetId = $t02194222120._4
452452 let priceAssetId = $t02194222120._5
453453 let amountAssetDecimals = $t02194222120._6
454454 let priceAssetDecimals = $t02194222120._7
455455 let amountBalanceRaw = getAccBalance(assetIdToString(amountAssetId))
456456 let priceBalanceRaw = getAccBalance(assetIdToString(priceAssetId))
457457 let paymentInAmountAsset = if ((paymentAssetId == amountAssetId))
458458 then true
459459 else if ((paymentAssetId == priceAssetId))
460460 then false
461461 else throwErr("invalid asset")
462462 let $t02245022743 = if (isEval)
463463 then $Tuple2(amountBalanceRaw, priceBalanceRaw)
464464 else if (paymentInAmountAsset)
465465 then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw)
466466 else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw))
467467 let amountBalanceOld = $t02245022743._1
468468 let priceBalanceOld = $t02245022743._2
469469 let $t02274722896 = if (paymentInAmountAsset)
470470 then $Tuple2(paymentAmountRaw, 0)
471471 else $Tuple2(0, paymentAmountRaw)
472472 let amountAssetAmountRaw = $t02274722896._1
473473 let priceAssetAmountRaw = $t02274722896._2
474474 let amountAssetAmount = takeFee(amountAssetAmountRaw)._1
475475 let priceAssetAmount = takeFee(priceAssetAmountRaw)._1
476476 let $t02301823077 = takeFee(paymentAmountRaw)
477477 let paymentAmount = $t02301823077._1
478478 let feeAmount = $t02301823077._2
479479 let amountBalanceNew = (amountBalanceOld + amountAssetAmount)
480480 let priceBalanceNew = (priceBalanceOld + priceAssetAmount)
481481 let curPrice = fromX18(calcPriceBigInt(toX18(priceBalanceNew, priceAssetDecimals), toX18(amountBalanceNew, amountAssetDecimals)), scale8)
482482 let paymentBalance = if (paymentInAmountAsset)
483483 then amountBalanceOld
484484 else priceBalanceOld
485485 let paymentBalanceBigInt = toBigInt(paymentBalance)
486486 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(lpAssetId), (("asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity)
487487 let chechSupply = if ((supplyBigInt > big0))
488488 then true
489489 else throw("initial deposit requires all coins")
490490 if ((chechSupply == chechSupply))
491491 then {
492492 let depositBigInt = toBigInt(paymentAmount)
493493 let issueAmount = toInt(((supplyBigInt * (sqrtBigInt((scale8BigInt + ((depositBigInt * scale8BigInt) / paymentBalanceBigInt)), 8, 8, DOWN) - scale8BigInt)) / scale8BigInt))
494494 let commonState = if (isEval)
495495 then nil
496496 else [IntegerEntry(pl(), curPrice), IntegerEntry(ph(height, lastBlock.timestamp), curPrice), StringEntry(pau(toString(value(userAddress)), toBase58String(value(txId))), dataPutActionInfo(amountAssetAmountRaw, priceAssetAmountRaw, issueAmount, curPrice, 0, 0, height, lastBlock.timestamp, 0, 0))]
497497 let poolProportion = fraction(priceBalanceOld, scale8, amountBalanceOld)
498498 let amountAssetPart = fraction(paymentAmountRaw, scale8, (poolProportion + scale8))
499499 let priceAssetPart = (paymentAmountRaw - amountAssetPart)
500500 let lpAmtBoth = fraction(supplyBigInt, toBigInt(priceAssetPart), toBigInt(priceBalanceOld))
501501 let bonus = toInt(fraction((toBigInt(issueAmount) - lpAmtBoth), scale8BigInt, lpAmtBoth))
502502 $Tuple4(issueAmount, commonState, feeAmount, bonus)
503503 }
504504 else throw("Strict value is not equal to itself.")
505505 }
506506
507507
508508 func calcGetOneToken (outAssetId,paymentAmount,paymentAssetId,userAddress,txId) = {
509509 let isEval = (txId == unit)
510510 let $t02502725188 = parsePoolConfig(getPoolConfig())
511511 let poolAddress = $t02502725188._1
512512 let poolStatus = $t02502725188._2
513513 let lpAssetId = $t02502725188._3
514514 let amountAssetId = $t02502725188._4
515515 let priceAssetId = $t02502725188._5
516516 let amDecimals = $t02502725188._6
517517 let prDecimals = $t02502725188._7
518518 let checks = [if ((paymentAssetId == lpAssetId))
519519 then true
520520 else throw("invalid lp asset")]
521521 if ((checks == checks))
522522 then {
523523 let outInAmountAsset = if ((outAssetId == amountAssetId))
524524 then true
525525 else if ((outAssetId == priceAssetId))
526526 then false
527527 else throwErr("invalid asset")
528528 let balanceBigInt = if (outInAmountAsset)
529529 then toBigInt(getAccBalance(assetIdToString(amountAssetId)))
530530 else toBigInt(getAccBalance(assetIdToString(priceAssetId)))
531531 let amBalanceOld = getAccBalance(assetIdToString(amountAssetId))
532532 let prBalanceOld = getAccBalance(assetIdToString(priceAssetId))
533533 let outBalance = if (outInAmountAsset)
534534 then amBalanceOld
535535 else prBalanceOld
536536 let outBalanceBigInt = toBigInt(outBalance)
537537 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(lpAssetId), (("asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity)
538538 let redeemedBigInt = toBigInt(paymentAmount)
539539 let amountRaw = toInt(((balanceBigInt * (scale8BigInt - pow((scale8BigInt - ((redeemedBigInt * scale8BigInt) / supplyBigInt)), 8, big2, 0, 8, DOWN))) / scale8BigInt))
540540 let $t02625526305 = takeFee(amountRaw)
541541 let totalAmount = $t02625526305._1
542542 let feeAmount = $t02625526305._2
543543 let $t02630926535 = if (outInAmountAsset)
544544 then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld)
545545 else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw))
546546 let outAmAmount = $t02630926535._1
547547 let outPrAmount = $t02630926535._2
548548 let amBalanceNew = $t02630926535._3
549549 let prBalanceNew = $t02630926535._4
550550 let curPrX18 = calcPriceBigInt(toX18(prBalanceNew, prDecimals), toX18(amBalanceNew, amDecimals))
551551 let curPrice = fromX18(curPrX18, scale8)
552552 let commonState = if (isEval)
553553 then nil
554554 else [StringEntry(gau(toString(value(userAddress)), toBase58String(value(txId))), dataGetActionInfo(outAmAmount, outPrAmount, paymentAmount, curPrice, height, lastBlock.timestamp)), IntegerEntry(pl(), curPrice), IntegerEntry(ph(height, lastBlock.timestamp), curPrice)]
555555 let r = estimateGetOperation("", assetIdToString(lpAssetId), paymentAmount, this)
556556 let sumOfGetAssets = (r._1 + r._2)
557557 let bonus = fraction((totalAmount - sumOfGetAssets), scale8, sumOfGetAssets)
558558 $Tuple4(totalAmount, commonState, feeAmount, bonus)
559559 }
560560 else throw("Strict value is not equal to itself.")
561561 }
562562
563563
564564 func managerPublicKeyOrUnit () = match getString(mpk()) {
565565 case s: String =>
566566 fromBase58String(s)
567567 case _: Unit =>
568568 unit
569569 case _ =>
570570 throw("Match error")
571571 }
572572
573573
574574 func pendingManagerPublicKeyOrUnit () = match getString(pmpk()) {
575575 case s: String =>
576576 fromBase58String(s)
577577 case _: Unit =>
578578 unit
579579 case _ =>
580580 throw("Match error")
581581 }
582582
583583
584584 func mustManager (i) = {
585585 let pd = throw("Permission denied")
586586 match managerPublicKeyOrUnit() {
587587 case pk: ByteVector =>
588588 if ((i.callerPublicKey == pk))
589589 then true
590590 else pd
591591 case _: Unit =>
592592 if ((i.caller == this))
593593 then true
594594 else pd
595595 case _ =>
596596 throw("Match error")
597597 }
598598 }
599599
600600
601601 @Callable(i)
602602 func setManager (pendingManagerPublicKey) = {
603603 let checkCaller = mustManager(i)
604604 if ((checkCaller == checkCaller))
605605 then {
606606 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
607607 if ((checkManagerPublicKey == checkManagerPublicKey))
608608 then [StringEntry(pmpk(), pendingManagerPublicKey)]
609609 else throw("Strict value is not equal to itself.")
610610 }
611611 else throw("Strict value is not equal to itself.")
612612 }
613613
614614
615615
616616 @Callable(i)
617617 func confirmManager () = {
618618 let pm = pendingManagerPublicKeyOrUnit()
619619 let hasPM = if (isDefined(pm))
620620 then true
621621 else throw("No pending manager")
622622 if ((hasPM == hasPM))
623623 then {
624624 let checkPM = if ((i.callerPublicKey == value(pm)))
625625 then true
626626 else throw("You are not pending manager")
627627 if ((checkPM == checkPM))
628628 then [StringEntry(mpk(), toBase58String(value(pm))), DeleteEntry(pmpk())]
629629 else throw("Strict value is not equal to itself.")
630630 }
631631 else throw("Strict value is not equal to itself.")
632632 }
633633
634634
635635
636636 @Callable(i)
637637 func put (slippageTolerance,shouldAutoStake) = if ((0 > slippageTolerance))
638638 then throw("Invalid slippageTolerance passed")
639639 else {
640640 let estPut = commonPut(i, slippageTolerance, true)
641641 let emitLpAmt = estPut._2
642642 let lpAssetId = estPut._7
643643 let state = estPut._9
644644 let amDiff = estPut._10
645645 let prDiff = estPut._11
646646 let amId = estPut._12
647647 let prId = estPut._13
648648 let emitInv = invoke(factoryContract, "emit", [emitLpAmt], nil)
649649 if ((emitInv == emitInv))
650650 then {
651651 let emitInvLegacy = match emitInv {
652652 case legacyFactoryContract: Address =>
653653 invoke(legacyFactoryContract, "emit", [emitLpAmt], nil)
654654 case _ =>
655655 unit
656656 }
657657 if ((emitInvLegacy == emitInvLegacy))
658658 then {
659659 let slippageAInv = if ((amDiff > 0))
660660 then invoke(slippageContract, "put", nil, [AttachedPayment(amId, amDiff)])
661661 else nil
662662 if ((slippageAInv == slippageAInv))
663663 then {
664664 let slippagePInv = if ((prDiff > 0))
665665 then invoke(slippageContract, "put", nil, [AttachedPayment(prId, prDiff)])
666666 else nil
667667 if ((slippagePInv == slippagePInv))
668668 then {
669669 let lpTransfer = if (shouldAutoStake)
670670 then {
671671 let slpStakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)])
672672 if ((slpStakeInv == slpStakeInv))
673673 then nil
674674 else throw("Strict value is not equal to itself.")
675675 }
676676 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
677677 (state ++ lpTransfer)
678678 }
679679 else throw("Strict value is not equal to itself.")
680680 }
681681 else throw("Strict value is not equal to itself.")
682682 }
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 putForFree (maxSlippage) = if ((0 > maxSlippage))
692692 then throw("Invalid value passed")
693693 else {
694694 let estPut = commonPut(i, maxSlippage, false)
695695 estPut._9
696696 }
697697
698698
699699
700700 @Callable(i)
701701 func putOneTkn (minOutAmount,autoStake) = {
702702 let $t03042630604 = parsePoolConfig(getPoolConfig())
703703 let poolAddress = $t03042630604._1
704704 let poolStatus = $t03042630604._2
705705 let lpAssetId = $t03042630604._3
706706 let amountAssetId = $t03042630604._4
707707 let priceAssetId = $t03042630604._5
708708 let amountAssetDecimals = $t03042630604._6
709709 let priceAssetDecimals = $t03042630604._7
710710 let isPutDisabled = if (if (isGlobalShutdown())
711711 then true
712712 else (poolStatus == PoolPutDisabled))
713713 then true
714714 else (poolStatus == PoolShutdown)
715715 let checks = [if (!(isPutDisabled))
716716 then true
717717 else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1))
718718 then true
719719 else throwErr("exactly 1 payment are expected")]
720720 if ((checks == checks))
721721 then {
722722 let payment = i.payments[0]
723723 let paymentAssetId = payment.assetId
724724 let paymentAmountRaw = payment.amount
725725 let paymentAmount = paymentAmountRaw
726726 let userAddress = i.caller
727727 let txId = i.transactionId
728728 let $t03109131218 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
729729 let emitAmountEstimated = $t03109131218._1
730730 let commonState = $t03109131218._2
731731 let feeAmount = $t03109131218._3
732732 let bonus = $t03109131218._4
733733 let emitAmount = if (if ((minOutAmount > 0))
734734 then (minOutAmount > emitAmountEstimated)
735735 else false)
736736 then throw(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
737737 else emitAmountEstimated
738738 let emitInv = emit(emitAmount)
739739 if ((emitInv == emitInv))
740740 then {
741741 let lpTransfer = if (autoStake)
742742 then {
743743 let stakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(lpAssetId, emitAmount)])
744744 if ((stakeInv == stakeInv))
745745 then nil
746746 else throw("Strict value is not equal to itself.")
747747 }
748748 else [ScriptTransfer(i.caller, emitAmount, lpAssetId)]
749749 let sendFee = if ((feeAmount > 0))
750750 then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
751751 else nil
752752 $Tuple2(((commonState ++ lpTransfer) ++ sendFee), emitAmount)
753753 }
754754 else throw("Strict value is not equal to itself.")
755755 }
756756 else throw("Strict value is not equal to itself.")
757757 }
758758
759759
760760
761761 @Callable(i)
762762 func getOneTkn (outAssetId,minOutAmount,unstakeAmount) = {
763763 let $t03194232120 = parsePoolConfig(getPoolConfig())
764764 let poolAddress = $t03194232120._1
765765 let poolStatus = $t03194232120._2
766766 let lpAssetId = $t03194232120._3
767767 let amountAssetId = $t03194232120._4
768768 let priceAssetId = $t03194232120._5
769769 let amountAssetDecimals = $t03194232120._6
770770 let priceAssetDecimals = $t03194232120._7
771771 let isGetDisabled = if (isGlobalShutdown())
772772 then true
773773 else (poolStatus == PoolShutdown)
774774 let checks = [if (!(isGetDisabled))
775775 then true
776776 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1))
777777 then true
778778 else throwErr("exactly 1 payment are expected")]
779779 if ((checks == checks))
780780 then {
781781 let payment = i.payments[0]
782782 let paymentAssetId = payment.assetId
783783 let paymentAmount = payment.amount
784784 let userAddress = i.caller
785785 let txId = i.transactionId
786786 let $t03253132678 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, paymentAssetId, userAddress, txId)
787787 let amountEstimated = $t03253132678._1
788788 let commonState = $t03253132678._2
789789 let feeAmount = $t03253132678._3
790790 let bonus = $t03253132678._4
791791 let amount = if (if ((minOutAmount > 0))
792792 then (minOutAmount > amountEstimated)
793793 else false)
794794 then throw(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
795795 else amountEstimated
796796 let burnInv = invoke(factoryContract, "burn", [paymentAmount], [AttachedPayment(paymentAssetId, paymentAmount)])
797797 if ((burnInv == burnInv))
798798 then {
799799 let assetTransfer = [ScriptTransfer(userAddress, amount, parseAssetId(outAssetId))]
800800 $Tuple2(assetTransfer, amount)
801801 }
802802 else throw("Strict value is not equal to itself.")
803803 }
804804 else throw("Strict value is not equal to itself.")
805805 }
806806
807807
808808
809809 @Callable(i)
810810 func get () = {
811811 let res = commonGet(i)
812812 let outAmtAmt = res._1
813813 let outPrAmt = res._2
814814 let pmtAmt = res._3
815815 let pmtAssetId = res._4
816816 let state = res._5
817817 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
818818 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
819819 then state
820820 else throw("Strict value is not equal to itself.")
821821 }
822822
823823
824824
825825 @Callable(i)
826826 func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = {
827827 let res = commonGet(i)
828828 let outAmAmt = res._1
829829 let outPrAmt = res._2
830830 let pmtAmt = res._3
831831 let pmtAssetId = res._4
832832 let state = res._5
833833 if ((noLessThenAmtAsset > outAmAmt))
834834 then throw(((("noLessThenAmtAsset failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset)))
835835 else if ((noLessThenPriceAsset > outPrAmt))
836836 then throw(((("noLessThenPriceAsset failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset)))
837837 else {
838838 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
839839 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
840840 then state
841841 else throw("Strict value is not equal to itself.")
842842 }
843843 }
844844
845845
846846
847847 @Callable(i)
848848 func unstakeAndGet (amount) = {
849849 let checkPayments = if ((size(i.payments) != 0))
850850 then throw("No payments are expected")
851851 else true
852852 if ((checkPayments == checkPayments))
853853 then {
854854 let cfg = getPoolConfig()
855855 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
856856 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(lpAssetId), amount], nil)
857857 if ((unstakeInv == unstakeInv))
858858 then {
859859 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller)
860860 let poolStatus = parseIntValue(res._9)
861861 let state = res._10
862862 let checkPoolStatus = if (if (isGlobalShutdown())
863863 then true
864864 else (poolStatus == PoolShutdown))
865865 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
866866 else true
867867 if ((checkPoolStatus == checkPoolStatus))
868868 then {
869869 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
870870 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
871871 then state
872872 else throw("Strict value is not equal to itself.")
873873 }
874874 else throw("Strict value is not equal to itself.")
875875 }
876876 else throw("Strict value is not equal to itself.")
877877 }
878878 else throw("Strict value is not equal to itself.")
879879 }
880880
881881
882882
883883 @Callable(i)
884884 func activate (amtAssetStr,priceAssetStr) = if ((toString(i.caller) != toString(factoryContract)))
885885 then throw("permissions denied")
886886 else $Tuple2([StringEntry(aa(), amtAssetStr), StringEntry(pa(), priceAssetStr)], "success")
887887
888888
889889
890890 @Callable(i)
891891 func getPoolConfigWrapperREADONLY () = $Tuple2(nil, getPoolConfig())
892892
893893
894894
895895 @Callable(i)
896896 func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId))
897897
898898
899899
900900 @Callable(i)
901901 func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = {
902902 let prices = calcPrices(amAmt, prAmt, lpAmt)
903903 $Tuple2(nil, [toString(prices[0]), toString(prices[1]), toString(prices[2])])
904904 }
905905
906906
907907
908908 @Callable(i)
909909 func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(toX18(origVal, origScaleMult)))
910910
911911
912912
913913 @Callable(i)
914914 func fromX18WrapperREADONLY (val,resultScaleMult) = $Tuple2(nil, fromX18(parseBigIntValue(val), resultScaleMult))
915915
916916
917917
918918 @Callable(i)
919919 func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(calcPriceBigInt(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18))))
920920
921921
922922
923923 @Callable(i)
924924 func estimatePutOperationWrapperREADONLY (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = $Tuple2(nil, estimatePutOperation(txId58, slippageTolerance, inAmAssetAmt, inAmAssetId, inPrAssetAmt, inPrAssetId, userAddress, isEvaluate, emitLp))
925925
926926
927927
928928 @Callable(i)
929929 func estimateGetOperationWrapperREADONLY (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
930930 let res = estimateGetOperation(txId58, pmtAssetId, pmtLpAmt, addressFromStringValue(userAddress))
931931 $Tuple2(nil, $Tuple10(res._1, res._2, res._3, res._4, res._5, res._6, res._7, toString(res._8), res._9, res._10))
932932 }
933933
934934
935935
936936 @Callable(i)
937937 func statsREADONLY () = {
938938 let cfg = getPoolConfig()
939939 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
940940 let amtAssetId = cfg[idxAmtAssetId]
941941 let priceAssetId = cfg[idxPriceAssetId]
942942 let iAmtAssetId = cfg[idxIAmtAssetId]
943943 let iPriceAssetId = cfg[idxIPriceAssetId]
944944 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
945945 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
946946 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
947947 let accAmtAssetBalance = getAccBalance(amtAssetId)
948948 let accPriceAssetBalance = getAccBalance(priceAssetId)
949949 let pricesList = if ((poolLPBalance == 0))
950950 then [zeroBigInt, zeroBigInt, zeroBigInt]
951951 else calcPrices(accAmtAssetBalance, accPriceAssetBalance, poolLPBalance)
952952 let curPrice = 0
953953 let lpAmtAssetShare = fromX18(pricesList[1], scale8)
954954 let lpPriceAssetShare = fromX18(pricesList[2], scale8)
955955 let poolWeight = value(getInteger(factoryContract, keyPoolWeight(toString(this))))
956956 $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))
957957 }
958958
959959
960960
961961 @Callable(i)
962962 func evaluatePutByAmountAssetREADONLY (inAmAssetAmt) = {
963963 let cfg = getPoolConfig()
964964 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
965965 let amAssetIdStr = cfg[idxAmtAssetId]
966966 let amAssetId = fromBase58String(amAssetIdStr)
967967 let prAssetIdStr = cfg[idxPriceAssetId]
968968 let prAssetId = fromBase58String(prAssetIdStr)
969969 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
970970 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
971971 let poolStatus = cfg[idxPoolStatus]
972972 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
973973 let accAmtAssetBalance = getAccBalance(amAssetIdStr)
974974 let accPriceAssetBalance = getAccBalance(prAssetIdStr)
975975 let amtAssetAmtX18 = toX18(accAmtAssetBalance, amtAssetDcm)
976976 let priceAssetAmtX18 = toX18(accPriceAssetBalance, priceAssetDcm)
977977 let curPriceX18 = if ((poolLPBalance == 0))
978978 then zeroBigInt
979979 else calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
980980 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
981981 let inPrAssetAmtX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18)
982982 let inPrAssetAmt = fromX18(inPrAssetAmtX18, priceAssetDcm)
983983 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
984984 let calcLpAmt = estPut._1
985985 let curPriceCalc = estPut._3
986986 let amBalance = estPut._4
987987 let prBalance = estPut._5
988988 let lpEmission = estPut._6
989989 $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))
990990 }
991991
992992
993993
994994 @Callable(i)
995995 func evaluatePutByPriceAssetREADONLY (inPrAssetAmt) = {
996996 let cfg = getPoolConfig()
997997 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
998998 let amAssetIdStr = cfg[idxAmtAssetId]
999999 let amAssetId = fromBase58String(amAssetIdStr)
10001000 let prAssetIdStr = cfg[idxPriceAssetId]
10011001 let prAssetId = fromBase58String(prAssetIdStr)
10021002 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
10031003 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
10041004 let poolStatus = cfg[idxPoolStatus]
10051005 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
10061006 let amBalanceRaw = getAccBalance(amAssetIdStr)
10071007 let prBalanceRaw = getAccBalance(prAssetIdStr)
10081008 let amBalanceRawX18 = toX18(amBalanceRaw, amtAssetDcm)
10091009 let prBalanceRawX18 = toX18(prBalanceRaw, priceAssetDcm)
10101010 let curPriceX18 = if ((poolLPBalance == 0))
10111011 then zeroBigInt
10121012 else calcPriceBigInt(prBalanceRawX18, amBalanceRawX18)
10131013 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
10141014 let inAmAssetAmtX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
10151015 let inAmAssetAmt = fromX18(inAmAssetAmtX18, amtAssetDcm)
10161016 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
10171017 let calcLpAmt = estPut._1
10181018 let curPriceCalc = estPut._3
10191019 let amBalance = estPut._4
10201020 let prBalance = estPut._5
10211021 let lpEmission = estPut._6
10221022 $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))
10231023 }
10241024
10251025
10261026
10271027 @Callable(i)
10281028 func evaluateGetREADONLY (paymentLpAssetId,paymentLpAmt) = {
10291029 let res = estimateGetOperation("", paymentLpAssetId, paymentLpAmt, this)
10301030 let outAmAmt = res._1
10311031 let outPrAmt = res._2
10321032 let amBalance = res._5
10331033 let prBalance = res._6
10341034 let lpEmission = res._7
10351035 let curPrice = res._8
10361036 let poolStatus = parseIntValue(res._9)
10371037 $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))
10381038 }
10391039
10401040
10411041 @Verifier(tx)
10421042 func verify () = {
10431043 let targetPublicKey = match managerPublicKeyOrUnit() {
10441044 case pk: ByteVector =>
10451045 pk
10461046 case _: Unit =>
10471047 tx.senderPublicKey
10481048 case _ =>
10491049 throw("Match error")
10501050 }
10511051 match tx {
10521052 case order: Order =>
10531053 let matcherPub = getMatcherPubOrFail()
10541054 let orderValid = validateMatcherOrderAllowed(order)
10551055 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
10561056 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
10571057 if (if (if (orderValid)
10581058 then senderValid
10591059 else false)
10601060 then matcherValid
10611061 else false)
10621062 then true
10631063 else throwOrderError(orderValid, senderValid, matcherValid)
10641064 case s: SetScriptTransaction =>
10651065 let newHash = blake2b256(value(s.script))
10661066 let allowedHash = fromBase64String(value(getString(factoryContract, keyAllowedLpScriptHash())))
10671067 let currentHash = scriptHash(this)
10681068 if (if ((allowedHash == newHash))
10691069 then (currentHash != newHash)
10701070 else false)
10711071 then true
10721072 else sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
10731073 case _ =>
10741074 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
10751075 }
10761076 }
10771077

github/deemru/w8io/026f985 
93.30 ms