tx · fKs1ngbPLb2yorNM7Nj57P7U9rCV1QcyC1n8iWK9tDK

3MqczhSTuvkrfmVXHQ7F7FUBKGG4ujRiCVF:  -0.03300000 Waves

2022.12.05 14:30 [2347001] smart account 3MqczhSTuvkrfmVXHQ7F7FUBKGG4ujRiCVF > SELF 0.00000000 Waves

{ "type": 13, "id": "fKs1ngbPLb2yorNM7Nj57P7U9rCV1QcyC1n8iWK9tDK", "fee": 3300000, "feeAssetId": null, "timestamp": 1670239770684, "version": 1, "sender": "3MqczhSTuvkrfmVXHQ7F7FUBKGG4ujRiCVF", "senderPublicKey": "EQAgJZZPyCDpoMAzhZA7KEcgYnQYQw2R5rQGNZAnnywo", "proofs": [ "5fwP5CNqGRYVusCJ4SR54aTUaGxqZhgxuV3ifQLeqvDRyeaPqEoLRnGQ7hVRbLg8ypfqnr9s3Hrxt5K9q6Us6rvM" ], "script": "base64:BgLqKwgCEgMKAQgSABIECgIBBBIDCgEBEgQKAgEEEgQKAggBEgQKAggBEgQKAggBEgUKAwEIARIAEgQKAgEBEgMKAQESBQoDAQEBEgQKAggIEgASABIDCgEIEgUKAwEBARIECgIBARIECgIIARIECgIICBILCgkIAQECAQIIBAQSBgoECAgBCBIAEgMKAQESAwoBARIECgIIASIKbFBkZWNpbWFscyIGc2NhbGU4IgxzY2FsZThCaWdJbnQiB3NjYWxlMTgiCnplcm9CaWdJbnQiBGJpZzAiBGJpZzEiBGJpZzIiC3dhdmVzU3RyaW5nIgNTRVAiClBvb2xBY3RpdmUiD1Bvb2xQdXREaXNhYmxlZCITUG9vbE1hdGNoZXJEaXNhYmxlZCIMUG9vbFNodXRkb3duIg5pZHhQb29sQWRkcmVzcyINaWR4UG9vbFN0YXR1cyIQaWR4UG9vbExQQXNzZXRJZCINaWR4QW10QXNzZXRJZCIPaWR4UHJpY2VBc3NldElkIg5pZHhBbXRBc3NldERjbSIQaWR4UHJpY2VBc3NldERjbSIOaWR4SUFtdEFzc2V0SWQiEGlkeElQcmljZUFzc2V0S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 84, "height": 2347001, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BL1XTa6RV5C7SJFYJuxxp9YfqZcdZ1xg6ojdtNWZFBkd Next: 9qFAzcVcQJVTdw1Zm4yPm7gRnivhvq1mWV4zFmuqR2Tq Diff:
OldNewDifferences
11441144 else throwErr(makeString([toString(kLpRefreshDelay), " blocks have not passed since the previous call"], ""))
11451145 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
11461146 then {
1147- let $t04271742772 = refreshKLpInternal(0, 0, 0)
1148- let actions = $t04271742772._1
1149- let updatedKLp = $t04271742772._2
1147+ let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
1148+ let $t04284342907 = refreshKLpInternal(0, 0, 0)
1149+ let kLpUpdateActions = $t04284342907._1
1150+ let updatedKLp = $t04284342907._2
1151+ let actions = if ((kLp != updatedKLp))
1152+ then kLpUpdateActions
1153+ else throwErr("nothing to refresh")
11501154 $Tuple2(actions, toString(updatedKLp))
11511155 }
11521156 else throw("Strict value is not equal to itself.")
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let lPdecimals = 8
55
66 let scale8 = 100000000
77
88 let scale8BigInt = toBigInt(100000000)
99
1010 let scale18 = toBigInt(1000000000000000000)
1111
1212 let zeroBigInt = toBigInt(0)
1313
1414 let big0 = toBigInt(0)
1515
1616 let big1 = toBigInt(1)
1717
1818 let big2 = toBigInt(2)
1919
2020 let wavesString = "WAVES"
2121
2222 let SEP = "__"
2323
2424 let PoolActive = 1
2525
2626 let PoolPutDisabled = 2
2727
2828 let PoolMatcherDisabled = 3
2929
3030 let PoolShutdown = 4
3131
3232 let idxPoolAddress = 1
3333
3434 let idxPoolStatus = 2
3535
3636 let idxPoolLPAssetId = 3
3737
3838 let idxAmtAssetId = 4
3939
4040 let idxPriceAssetId = 5
4141
4242 let idxAmtAssetDcm = 6
4343
4444 let idxPriceAssetDcm = 7
4545
4646 let idxIAmtAssetId = 8
4747
4848 let idxIPriceAssetId = 9
4949
5050 let idxLPAssetDcm = 10
5151
5252 let idxPoolAmtAssetAmt = 1
5353
5454 let idxPoolPriceAssetAmt = 2
5555
5656 let idxPoolLPAssetAmt = 3
5757
5858 let idxFactoryStakingContract = 1
5959
6060 let idxFactorySlippageContract = 7
6161
6262 func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), scale18, toBigInt(origScaleMult))
6363
6464
6565 func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), scale18))
6666
6767
6868 func toScale (amt,resScale,curScale) = fraction(amt, resScale, curScale)
6969
7070
7171 func abs (val) = if ((0 > val))
7272 then -(val)
7373 else val
7474
7575
7676 func absBigInt (val) = if ((zeroBigInt > val))
7777 then -(val)
7878 else val
7979
8080
8181 func fc () = "%s__factoryContract"
8282
8383
8484 func mpk () = "%s__managerPublicKey"
8585
8686
8787 func pmpk () = "%s__pendingManagerPublicKey"
8888
8989
9090 func pl () = "%s%s__price__last"
9191
9292
9393 func ph (h,timestamp) = makeString(["%s%s%d%d__price__history", toString(h), toString(timestamp)], SEP)
9494
9595
9696 func pau (userAddress,txId) = ((("%s%s%s__P__" + userAddress) + "__") + txId)
9797
9898
9999 func gau (userAddress,txId) = ((("%s%s%s__G__" + userAddress) + "__") + txId)
100100
101101
102102 func aa () = "%s__amountAsset"
103103
104104
105105 func pa () = "%s__priceAsset"
106106
107107
108108 let keyFee = "%s__fee"
109109
110110 let feeDefault = fraction(10, scale8, 10000)
111111
112112 let fee = valueOrElse(getInteger(this, keyFee), feeDefault)
113113
114114 let keyKLp = makeString(["%s", "kLp"], SEP)
115115
116116 let keyKLpRefreshedHeight = makeString(["%s", "kLpRefreshedHeight"], SEP)
117117
118118 let keyKLpRefreshDelay = makeString(["%s", "refreshKLpDelay"], SEP)
119119
120120 let kLpRefreshDelayDefault = 30
121121
122122 let kLpRefreshDelay = valueOrElse(getInteger(this, keyKLpRefreshDelay), kLpRefreshDelayDefault)
123123
124124 func keyFactoryConfig () = "%s__factoryConfig"
125125
126126
127127 func keyMatcherPub () = "%s%s__matcher__publicKey"
128128
129129
130130 func keyMappingPoolContractAddressToPoolAssets (poolContractAddress) = (("%s%s%s__" + poolContractAddress) + "__mappings__poolContract2LpAsset")
131131
132132
133133 func keyPoolConfig (iAmtAsset,iPriceAsset) = (((("%d%d%s__" + iAmtAsset) + "__") + iPriceAsset) + "__config")
134134
135135
136136 func keyMappingsBaseAsset2internalId (baseAssetStr) = ("%s%s%s__mappings__baseAsset2internalId__" + baseAssetStr)
137137
138138
139139 func keyAllPoolsShutdown () = "%s__shutdown"
140140
141141
142142 func keyPoolWeight (contractAddress) = ("%s%s__poolWeight__" + contractAddress)
143143
144144
145145 func keyAllowedLpScriptHash () = "%s__allowedLpScriptHash"
146146
147147
148148 let keyFeeCollectorAddress = "%s__feeCollectorAddress"
149149
150150 func throwOrderError (orderValid,senderValid,matcherValid) = throw(((((("order validation failed: orderValid=" + toString(orderValid)) + " senderValid=") + toString(senderValid)) + " matcherValid=") + toString(matcherValid)))
151151
152152
153153 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
154154
155155
156156 func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
157157
158158
159159 func throwErr (msg) = throw(makeString(["lp.ride:", msg], " "))
160160
161161
162162 func fmtErr (msg) = makeString(["lp.ride:", msg], " ")
163163
164164
165165 let factoryContract = addressFromStringValue(getStringOrFail(this, fc()))
166166
167167 let feeCollectorAddress = addressFromStringValue(getStringOrFail(factoryContract, keyFeeCollectorAddress))
168168
169169 func isGlobalShutdown () = valueOrElse(getBoolean(factoryContract, keyAllPoolsShutdown()), false)
170170
171171
172172 func getMatcherPubOrFail () = fromBase58String(getStringOrFail(factoryContract, keyMatcherPub()))
173173
174174
175175 func getPoolConfig () = {
176176 let amtAsset = getStringOrFail(this, aa())
177177 let priceAsset = getStringOrFail(this, pa())
178178 let iPriceAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(priceAsset))
179179 let iAmtAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(amtAsset))
180180 split(getStringOrFail(factoryContract, keyPoolConfig(toString(iAmtAsset), toString(iPriceAsset))), SEP)
181181 }
182182
183183
184184 func parseAssetId (input) = if ((input == wavesString))
185185 then unit
186186 else fromBase58String(input)
187187
188188
189189 func assetIdToString (input) = if ((input == unit))
190190 then wavesString
191191 else toBase58String(value(input))
192192
193193
194194 func parsePoolConfig (poolConfig) = $Tuple7(addressFromStringValue(poolConfig[idxPoolAddress]), parseIntValue(poolConfig[idxPoolStatus]), fromBase58String(poolConfig[idxPoolLPAssetId]), parseAssetId(poolConfig[idxAmtAssetId]), parseAssetId(poolConfig[idxPriceAssetId]), parseIntValue(poolConfig[idxAmtAssetDcm]), parseIntValue(poolConfig[idxPriceAssetDcm]))
195195
196196
197197 let poolConfigParsed = parsePoolConfig(getPoolConfig())
198198
199199 let $t079158081 = poolConfigParsed
200200
201201 let cfgPoolAddress = $t079158081._1
202202
203203 let cfgPoolStatus = $t079158081._2
204204
205205 let cfgLpAssetId = $t079158081._3
206206
207207 let cfgAmountAssetId = $t079158081._4
208208
209209 let cfgPriceAssetId = $t079158081._5
210210
211211 let cfgAmountAssetDecimals = $t079158081._6
212212
213213 let cfgPriceAssetDecimals = $t079158081._7
214214
215215 func getFactoryConfig () = split(getStringOrFail(factoryContract, keyFactoryConfig()), SEP)
216216
217217
218218 let stakingContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactoryStakingContract]), "incorrect staking address")
219219
220220 let slippageContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactorySlippageContract]), "incorrect staking address")
221221
222222 func dataPutActionInfo (inAmtAssetAmt,inPriceAssetAmt,outLpAmt,price,slippageTolerancePassedByUser,slippageToleranceReal,txHeight,txTimestamp,slipageAmtAssetAmt,slipagePriceAssetAmt) = makeString(["%d%d%d%d%d%d%d%d%d%d", toString(inAmtAssetAmt), toString(inPriceAssetAmt), toString(outLpAmt), toString(price), toString(slippageTolerancePassedByUser), toString(slippageToleranceReal), toString(txHeight), toString(txTimestamp), toString(slipageAmtAssetAmt), toString(slipagePriceAssetAmt)], SEP)
223223
224224
225225 func dataGetActionInfo (outAmtAssetAmt,outPriceAssetAmt,inLpAmt,price,txHeight,txTimestamp) = makeString(["%d%d%d%d%d%d", toString(outAmtAssetAmt), toString(outPriceAssetAmt), toString(inLpAmt), toString(price), toString(txHeight), toString(txTimestamp)], SEP)
226226
227227
228228 func getAccBalance (assetId) = if ((assetId == "WAVES"))
229229 then wavesBalance(this).available
230230 else assetBalance(this, fromBase58String(assetId))
231231
232232
233233 func calcPriceBigInt (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18)
234234
235235
236236 func privateCalcPrice (amAssetDcm,prAssetDcm,amAmt,prAmt) = {
237237 let amtAssetAmtX18 = toX18(amAmt, amAssetDcm)
238238 let priceAssetAmtX18 = toX18(prAmt, prAssetDcm)
239239 calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
240240 }
241241
242242
243243 func calcPrices (amAmt,prAmt,lpAmt) = {
244244 let cfg = getPoolConfig()
245245 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
246246 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
247247 let priceX18 = privateCalcPrice(amtAssetDcm, priceAssetDcm, amAmt, prAmt)
248248 let amAmtX18 = toX18(amAmt, amtAssetDcm)
249249 let prAmtX18 = toX18(prAmt, priceAssetDcm)
250250 let lpAmtX18 = toX18(lpAmt, scale8)
251251 let lpPriceInAmAssetX18 = calcPriceBigInt(amAmtX18, lpAmtX18)
252252 let lpPriceInPrAssetX18 = calcPriceBigInt(prAmtX18, lpAmtX18)
253253 [priceX18, lpPriceInAmAssetX18, lpPriceInPrAssetX18]
254254 }
255255
256256
257257 func calculatePrices (amAmt,prAmt,lpAmt) = {
258258 let prices = calcPrices(amAmt, prAmt, lpAmt)
259259 [fromX18(prices[0], scale8), fromX18(prices[1], scale8), fromX18(prices[2], scale8)]
260260 }
261261
262262
263263 func estimateGetOperation (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
264264 let cfg = getPoolConfig()
265265 let lpAssetId = cfg[idxPoolLPAssetId]
266266 let amAssetId = cfg[idxAmtAssetId]
267267 let prAssetId = cfg[idxPriceAssetId]
268268 let amAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
269269 let prAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
270270 let poolStatus = cfg[idxPoolStatus]
271271 let lpEmission = valueOrErrorMessage(assetInfo(fromBase58String(lpAssetId)), (("Asset " + lpAssetId) + " doesn't exist")).quantity
272272 if ((lpAssetId != pmtAssetId))
273273 then throw("Invalid asset passed.")
274274 else {
275275 let amBalance = getAccBalance(amAssetId)
276276 let amBalanceX18 = toX18(amBalance, amAssetDcm)
277277 let prBalance = getAccBalance(prAssetId)
278278 let prBalanceX18 = toX18(prBalance, prAssetDcm)
279279 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
280280 let curPrice = fromX18(curPriceX18, scale8)
281281 let pmtLpAmtX18 = toX18(pmtLpAmt, scale8)
282282 let lpEmissionX18 = toX18(lpEmission, scale8)
283283 let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissionX18)
284284 let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissionX18)
285285 let outAmAmt = fromX18(outAmAmtX18, amAssetDcm)
286286 let outPrAmt = fromX18(outPrAmtX18, prAssetDcm)
287287 let state = if ((txId58 == ""))
288288 then nil
289289 else [ScriptTransfer(userAddress, outAmAmt, if ((amAssetId == "WAVES"))
290290 then unit
291291 else fromBase58String(amAssetId)), ScriptTransfer(userAddress, outPrAmt, if ((prAssetId == "WAVES"))
292292 then unit
293293 else fromBase58String(prAssetId)), StringEntry(gau(toString(userAddress), txId58), dataGetActionInfo(outAmAmt, outPrAmt, pmtLpAmt, curPrice, height, lastBlock.timestamp)), IntegerEntry(pl(), curPrice), IntegerEntry(ph(height, lastBlock.timestamp), curPrice)]
294294 $Tuple10(outAmAmt, outPrAmt, amAssetId, prAssetId, amBalance, prBalance, lpEmission, curPriceX18, poolStatus, state)
295295 }
296296 }
297297
298298
299299 func estimatePutOperation (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = {
300300 let cfg = getPoolConfig()
301301 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
302302 let amAssetIdStr = cfg[idxAmtAssetId]
303303 let prAssetIdStr = cfg[idxPriceAssetId]
304304 let iAmtAssetId = cfg[idxIAmtAssetId]
305305 let iPriceAssetId = cfg[idxIPriceAssetId]
306306 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
307307 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
308308 let poolStatus = cfg[idxPoolStatus]
309309 let lpEmission = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
310310 let inAmAssetIdStr = toBase58String(valueOrElse(inAmAssetId, fromBase58String("WAVES")))
311311 let inPrAssetIdStr = toBase58String(valueOrElse(inPrAssetId, fromBase58String("WAVES")))
312312 if (if ((amAssetIdStr != inAmAssetIdStr))
313313 then true
314314 else (prAssetIdStr != inPrAssetIdStr))
315315 then throw("Invalid amt or price asset passed.")
316316 else {
317317 let amBalance = if (isEvaluate)
318318 then getAccBalance(amAssetIdStr)
319319 else (getAccBalance(amAssetIdStr) - inAmAssetAmt)
320320 let prBalance = if (isEvaluate)
321321 then getAccBalance(prAssetIdStr)
322322 else (getAccBalance(prAssetIdStr) - inPrAssetAmt)
323323 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
324324 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
325325 let userPriceX18 = calcPriceBigInt(inPrAssetAmtX18, inAmAssetAmtX18)
326326 let amBalanceX18 = toX18(amBalance, amtAssetDcm)
327327 let prBalanceX18 = toX18(prBalance, priceAssetDcm)
328328 let res = if ((lpEmission == 0))
329329 then {
330330 let curPriceX18 = zeroBigInt
331331 let slippageX18 = zeroBigInt
332332 let lpAmtX18 = pow((inAmAssetAmtX18 * inPrAssetAmtX18), 0, toBigInt(5), 1, 0, DOWN)
333333 $Tuple5(fromX18(lpAmtX18, scale8), fromX18(inAmAssetAmtX18, amtAssetDcm), fromX18(inPrAssetAmtX18, priceAssetDcm), calcPriceBigInt((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18)
334334 }
335335 else {
336336 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
337337 let slippageX18 = fraction(absBigInt((curPriceX18 - userPriceX18)), scale18, curPriceX18)
338338 let slippageToleranceX18 = toX18(slippageTolerance, scale8)
339339 if (if ((curPriceX18 != zeroBigInt))
340340 then (slippageX18 > slippageToleranceX18)
341341 else false)
342342 then throw(((("Price slippage " + toString(slippageX18)) + " exceeded the passed limit of ") + toString(slippageToleranceX18)))
343343 else {
344344 let lpEmissionX18 = toX18(lpEmission, scale8)
345345 let prViaAmX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18)
346346 let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
347347 let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18))
348348 then $Tuple2(amViaPrX18, inPrAssetAmtX18)
349349 else $Tuple2(inAmAssetAmtX18, prViaAmX18)
350350 let expAmtAssetAmtX18 = expectedAmts._1
351351 let expPriceAssetAmtX18 = expectedAmts._2
352352 let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18)
353353 $Tuple5(fromX18(lpAmtX18, scale8), fromX18(expAmtAssetAmtX18, amtAssetDcm), fromX18(expPriceAssetAmtX18, priceAssetDcm), curPriceX18, slippageX18)
354354 }
355355 }
356356 let calcLpAmt = res._1
357357 let calcAmAssetPmt = res._2
358358 let calcPrAssetPmt = res._3
359359 let curPrice = fromX18(res._4, scale8)
360360 let slippageCalc = fromX18(res._5, scale8)
361361 if ((0 >= calcLpAmt))
362362 then throw("Invalid calculations. LP calculated is less than zero.")
363363 else {
364364 let emitLpAmt = if (!(emitLp))
365365 then 0
366366 else calcLpAmt
367367 let amDiff = (inAmAssetAmt - calcAmAssetPmt)
368368 let prDiff = (inPrAssetAmt - calcPrAssetPmt)
369369 let commonState = [IntegerEntry(pl(), curPrice), IntegerEntry(ph(height, lastBlock.timestamp), curPrice), StringEntry(pau(userAddress, txId58), dataPutActionInfo(calcAmAssetPmt, calcPrAssetPmt, emitLpAmt, curPrice, slippageTolerance, slippageCalc, height, lastBlock.timestamp, amDiff, prDiff))]
370370 $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEmission, lpAssetId, poolStatus, commonState, amDiff, prDiff, inAmAssetId, inPrAssetId)
371371 }
372372 }
373373 }
374374
375375
376376 func calcKLp (amountBalance,priceBalance,lpEmission) = {
377377 let updatedKLp = fraction(pow((amountBalance * priceBalance), 0, toBigInt(5), 1, 0, DOWN), scale18, lpEmission)
378378 updatedKLp
379379 }
380380
381381
382382 func refreshKLpInternal (amountAssetBalanceDelta,priceAssetBalanceDelta,lpAssetEmissionDelta) = {
383383 let amountAssetBalance = (getAccBalance(assetIdToString(cfgAmountAssetId)) + amountAssetBalanceDelta)
384384 let priceAssetBalance = (getAccBalance(assetIdToString(cfgPriceAssetId)) + priceAssetBalanceDelta)
385385 let lpAssetEmission = (value(assetInfo(cfgLpAssetId)).quantity + lpAssetEmissionDelta)
386386 let updatedKLp = calcKLp(toBigInt(amountAssetBalance), toBigInt(priceAssetBalance), toBigInt(lpAssetEmission))
387387 let actions = [IntegerEntry(keyKLpRefreshedHeight, height), StringEntry(keyKLp, toString(updatedKLp))]
388388 $Tuple2(actions, updatedKLp)
389389 }
390390
391391
392392 func validateMatcherOrderAllowed (order) = {
393393 let amountAssetAmount = order.amount
394394 let priceAssetAmount = fraction(order.amount, order.price, scale8)
395395 let $t01955919771 = if ((order.orderType == Buy))
396396 then $Tuple2(amountAssetAmount, -(priceAssetAmount))
397397 else $Tuple2(-(amountAssetAmount), priceAssetAmount)
398398 let amountAssetBalanceDelta = $t01955919771._1
399399 let priceAssetBalanceDelta = $t01955919771._2
400400 if (if (if (isGlobalShutdown())
401401 then true
402402 else (cfgPoolStatus == PoolMatcherDisabled))
403403 then true
404404 else (cfgPoolStatus == PoolShutdown))
405405 then throw("Exchange operations disabled")
406406 else if (if ((order.assetPair.amountAsset != cfgAmountAssetId))
407407 then true
408408 else (order.assetPair.priceAsset != cfgPriceAssetId))
409409 then throw("Wrong order assets.")
410410 else {
411411 let kLp = valueOrErrorMessage(parseBigInt(valueOrErrorMessage(getString(this, keyKLp), fmtErr("kLp is required"))), fmtErr("invalid kLp"))
412412 let $t02024220342 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
413413 let unusedActions = $t02024220342._1
414414 let kLpNew = $t02024220342._2
415415 let isOrderValid = (kLpNew > kLp)
416416 isOrderValid
417417 }
418418 }
419419
420420
421421 func commonGet (i) = if ((size(i.payments) != 1))
422422 then throw("exactly 1 payment is expected")
423423 else {
424424 let pmt = value(i.payments[0])
425425 let pmtAssetId = value(pmt.assetId)
426426 let pmtAmt = pmt.amount
427427 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller)
428428 let outAmAmt = res._1
429429 let outPrAmt = res._2
430430 let poolStatus = parseIntValue(res._9)
431431 let state = res._10
432432 if (if (isGlobalShutdown())
433433 then true
434434 else (poolStatus == PoolShutdown))
435435 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
436436 else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state)
437437 }
438438
439439
440440 func commonPut (i,slippageTolerance,emitLp) = if ((size(i.payments) != 2))
441441 then throw("exactly 2 payments are expected")
442442 else {
443443 let amAssetPmt = value(i.payments[0])
444444 let prAssetPmt = value(i.payments[1])
445445 let estPut = estimatePutOperation(toBase58String(i.transactionId), slippageTolerance, amAssetPmt.amount, amAssetPmt.assetId, prAssetPmt.amount, prAssetPmt.assetId, toString(i.caller), false, emitLp)
446446 let poolStatus = parseIntValue(estPut._8)
447447 if (if (if (isGlobalShutdown())
448448 then true
449449 else (poolStatus == PoolPutDisabled))
450450 then true
451451 else (poolStatus == PoolShutdown))
452452 then throw(("Put operation is blocked by admin. Status = " + toString(poolStatus)))
453453 else estPut
454454 }
455455
456456
457457 func emit (amount) = {
458458 let emitInv = invoke(factoryContract, "emit", [amount], nil)
459459 if ((emitInv == emitInv))
460460 then {
461461 let emitInvLegacy = match emitInv {
462462 case legacyFactoryContract: Address =>
463463 invoke(legacyFactoryContract, "emit", [amount], nil)
464464 case _ =>
465465 unit
466466 }
467467 if ((emitInvLegacy == emitInvLegacy))
468468 then amount
469469 else throw("Strict value is not equal to itself.")
470470 }
471471 else throw("Strict value is not equal to itself.")
472472 }
473473
474474
475475 func takeFee (amount) = {
476476 let feeAmount = fraction(amount, fee, scale8)
477477 $Tuple2((amount - feeAmount), feeAmount)
478478 }
479479
480480
481481 func calcPutOneToken (paymentAmountRaw,paymentAssetId,userAddress,txId) = {
482482 let isEval = (txId == unit)
483483 let amountBalanceRaw = getAccBalance(assetIdToString(cfgAmountAssetId))
484484 let priceBalanceRaw = getAccBalance(assetIdToString(cfgPriceAssetId))
485485 let paymentInAmountAsset = if ((paymentAssetId == cfgAmountAssetId))
486486 then true
487487 else if ((paymentAssetId == cfgPriceAssetId))
488488 then false
489489 else throwErr("invalid asset")
490490 let $t02302623319 = if (isEval)
491491 then $Tuple2(amountBalanceRaw, priceBalanceRaw)
492492 else if (paymentInAmountAsset)
493493 then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw)
494494 else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw))
495495 let amountBalanceOld = $t02302623319._1
496496 let priceBalanceOld = $t02302623319._2
497497 let $t02332323472 = if (paymentInAmountAsset)
498498 then $Tuple2(paymentAmountRaw, 0)
499499 else $Tuple2(0, paymentAmountRaw)
500500 let amountAssetAmountRaw = $t02332323472._1
501501 let priceAssetAmountRaw = $t02332323472._2
502502 let amountAssetAmount = takeFee(amountAssetAmountRaw)._1
503503 let priceAssetAmount = takeFee(priceAssetAmountRaw)._1
504504 let $t02359423653 = takeFee(paymentAmountRaw)
505505 let paymentAmount = $t02359423653._1
506506 let feeAmount = $t02359423653._2
507507 let amountBalanceNew = (amountBalanceOld + amountAssetAmount)
508508 let priceBalanceNew = (priceBalanceOld + priceAssetAmount)
509509 let priceNewX18 = calcPriceBigInt(toX18(priceBalanceNew, cfgPriceAssetDecimals), toX18(amountBalanceNew, cfgAmountAssetDecimals))
510510 let priceNew = fromX18(priceNewX18, scale8)
511511 let paymentBalance = if (paymentInAmountAsset)
512512 then amountBalanceOld
513513 else priceBalanceOld
514514 let paymentBalanceBigInt = toBigInt(paymentBalance)
515515 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
516516 let chechSupply = if ((supplyBigInt > big0))
517517 then true
518518 else throwErr("initial deposit requires all coins")
519519 if ((chechSupply == chechSupply))
520520 then {
521521 let depositBigInt = toBigInt(paymentAmount)
522522 let issueAmount = max([0, toInt(((supplyBigInt * (sqrtBigInt((scale18 + ((depositBigInt * scale18) / paymentBalanceBigInt)), 18, 18, DOWN) - scale18)) / scale18))])
523523 let commonState = if (isEval)
524524 then nil
525525 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))]
526526 let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, cfgPriceAssetDecimals), toX18(amountBalanceOld, cfgAmountAssetDecimals))
527527 let priceOld = fromX18(priceOldX18, scale8)
528528 let loss = {
529529 let $t02513025297 = if (paymentInAmountAsset)
530530 then $Tuple2(amountAssetAmountRaw, amountBalanceOld)
531531 else $Tuple2(priceAssetAmountRaw, priceBalanceOld)
532532 let amount = $t02513025297._1
533533 let balance = $t02513025297._2
534534 let issueAmountBoth = toInt(fraction(supplyBigInt, toBigInt((amount / 2)), toBigInt(balance)))
535535 fraction((issueAmount - issueAmountBoth), scale8, issueAmountBoth)
536536 }
537537 $Tuple5(issueAmount, commonState, feeAmount, loss, paymentInAmountAsset)
538538 }
539539 else throw("Strict value is not equal to itself.")
540540 }
541541
542542
543543 func calcGetOneToken (outAssetId,paymentAmount,paymentAssetId,userAddress,txId) = {
544544 let isEval = (txId == unit)
545545 let checks = [if ((paymentAssetId == cfgLpAssetId))
546546 then true
547547 else throwErr("invalid lp asset")]
548548 if ((checks == checks))
549549 then {
550550 let outInAmountAsset = if ((outAssetId == cfgAmountAssetId))
551551 then true
552552 else if ((outAssetId == cfgPriceAssetId))
553553 then false
554554 else throwErr("invalid asset")
555555 let balanceBigInt = if (outInAmountAsset)
556556 then toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId)))
557557 else toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId)))
558558 let amBalanceOld = getAccBalance(assetIdToString(cfgAmountAssetId))
559559 let prBalanceOld = getAccBalance(assetIdToString(cfgPriceAssetId))
560560 let outBalance = if (outInAmountAsset)
561561 then amBalanceOld
562562 else prBalanceOld
563563 let outBalanceBigInt = toBigInt(outBalance)
564564 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
565565 let redeemedBigInt = toBigInt(paymentAmount)
566566 let amountRaw = max([0, toInt(((balanceBigInt * (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN))) / scale18))])
567567 let $t02689926949 = takeFee(amountRaw)
568568 let totalAmount = $t02689926949._1
569569 let feeAmount = $t02689926949._2
570570 let $t02695327179 = if (outInAmountAsset)
571571 then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld)
572572 else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw))
573573 let outAmAmount = $t02695327179._1
574574 let outPrAmount = $t02695327179._2
575575 let amBalanceNew = $t02695327179._3
576576 let prBalanceNew = $t02695327179._4
577577 let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, cfgPriceAssetDecimals), toX18(amBalanceNew, cfgAmountAssetDecimals))
578578 let priceNew = fromX18(priceNewX18, scale8)
579579 let commonState = if (isEval)
580580 then nil
581581 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)]
582582 let priceOldX18 = calcPriceBigInt(toX18(prBalanceOld, cfgPriceAssetDecimals), toX18(amBalanceOld, cfgAmountAssetDecimals))
583583 let priceOld = fromX18(priceOldX18, scale8)
584584 let loss = {
585585 let amountBothInPaymentAsset = (toInt(fraction(balanceBigInt, redeemedBigInt, supplyBigInt)) * 2)
586586 fraction((totalAmount - amountBothInPaymentAsset), scale8, amountBothInPaymentAsset)
587587 }
588588 $Tuple5(totalAmount, commonState, feeAmount, loss, outInAmountAsset)
589589 }
590590 else throw("Strict value is not equal to itself.")
591591 }
592592
593593
594594 func managerPublicKeyOrUnit () = match getString(mpk()) {
595595 case s: String =>
596596 fromBase58String(s)
597597 case _: Unit =>
598598 unit
599599 case _ =>
600600 throw("Match error")
601601 }
602602
603603
604604 func pendingManagerPublicKeyOrUnit () = match getString(pmpk()) {
605605 case s: String =>
606606 fromBase58String(s)
607607 case _: Unit =>
608608 unit
609609 case _ =>
610610 throw("Match error")
611611 }
612612
613613
614614 func isManager (i) = match managerPublicKeyOrUnit() {
615615 case pk: ByteVector =>
616616 (i.callerPublicKey == pk)
617617 case _: Unit =>
618618 (i.caller == this)
619619 case _ =>
620620 throw("Match error")
621621 }
622622
623623
624624 func mustManager (i) = {
625625 let pd = throw("Permission denied")
626626 match managerPublicKeyOrUnit() {
627627 case pk: ByteVector =>
628628 if ((i.callerPublicKey == pk))
629629 then true
630630 else pd
631631 case _: Unit =>
632632 if ((i.caller == this))
633633 then true
634634 else pd
635635 case _ =>
636636 throw("Match error")
637637 }
638638 }
639639
640640
641641 @Callable(i)
642642 func setManager (pendingManagerPublicKey) = {
643643 let checkCaller = mustManager(i)
644644 if ((checkCaller == checkCaller))
645645 then {
646646 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
647647 if ((checkManagerPublicKey == checkManagerPublicKey))
648648 then [StringEntry(pmpk(), pendingManagerPublicKey)]
649649 else throw("Strict value is not equal to itself.")
650650 }
651651 else throw("Strict value is not equal to itself.")
652652 }
653653
654654
655655
656656 @Callable(i)
657657 func confirmManager () = {
658658 let pm = pendingManagerPublicKeyOrUnit()
659659 let hasPM = if (isDefined(pm))
660660 then true
661661 else throw("No pending manager")
662662 if ((hasPM == hasPM))
663663 then {
664664 let checkPM = if ((i.callerPublicKey == value(pm)))
665665 then true
666666 else throw("You are not pending manager")
667667 if ((checkPM == checkPM))
668668 then [StringEntry(mpk(), toBase58String(value(pm))), DeleteEntry(pmpk())]
669669 else throw("Strict value is not equal to itself.")
670670 }
671671 else throw("Strict value is not equal to itself.")
672672 }
673673
674674
675675
676676 @Callable(i)
677677 func put (slippageTolerance,shouldAutoStake) = if ((0 > slippageTolerance))
678678 then throw("Invalid slippageTolerance passed")
679679 else {
680680 let estPut = commonPut(i, slippageTolerance, true)
681681 let emitLpAmt = estPut._2
682682 let lpAssetId = estPut._7
683683 let state = estPut._9
684684 let amDiff = estPut._10
685685 let prDiff = estPut._11
686686 let amId = estPut._12
687687 let prId = estPut._13
688688 let emitInv = invoke(factoryContract, "emit", [emitLpAmt], nil)
689689 if ((emitInv == emitInv))
690690 then {
691691 let emitInvLegacy = match emitInv {
692692 case legacyFactoryContract: Address =>
693693 invoke(legacyFactoryContract, "emit", [emitLpAmt], nil)
694694 case _ =>
695695 unit
696696 }
697697 if ((emitInvLegacy == emitInvLegacy))
698698 then {
699699 let slippageAInv = if ((amDiff > 0))
700700 then invoke(slippageContract, "put", nil, [AttachedPayment(amId, amDiff)])
701701 else nil
702702 if ((slippageAInv == slippageAInv))
703703 then {
704704 let slippagePInv = if ((prDiff > 0))
705705 then invoke(slippageContract, "put", nil, [AttachedPayment(prId, prDiff)])
706706 else nil
707707 if ((slippagePInv == slippagePInv))
708708 then {
709709 let lpTransfer = if (shouldAutoStake)
710710 then {
711711 let slpStakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)])
712712 if ((slpStakeInv == slpStakeInv))
713713 then nil
714714 else throw("Strict value is not equal to itself.")
715715 }
716716 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
717717 let $t03113031195 = refreshKLpInternal(0, 0, 0)
718718 let refreshKLpActions = $t03113031195._1
719719 let updatedKLp = $t03113031195._2
720720 ((state ++ lpTransfer) ++ refreshKLpActions)
721721 }
722722 else throw("Strict value is not equal to itself.")
723723 }
724724 else throw("Strict value is not equal to itself.")
725725 }
726726 else throw("Strict value is not equal to itself.")
727727 }
728728 else throw("Strict value is not equal to itself.")
729729 }
730730
731731
732732
733733 @Callable(i)
734734 func putForFree (maxSlippage) = if ((0 > maxSlippage))
735735 then throw("Invalid value passed")
736736 else {
737737 let estPut = commonPut(i, maxSlippage, false)
738738 let state = estPut._9
739739 let $t03148131546 = refreshKLpInternal(0, 0, 0)
740740 let refreshKLpActions = $t03148131546._1
741741 let updatedKLp = $t03148131546._2
742742 (state ++ refreshKLpActions)
743743 }
744744
745745
746746
747747 @Callable(i)
748748 func putOneTkn (minOutAmount,autoStake) = {
749749 let isPoolOneTokenOperationsDisabled = {
750750 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
751751 if ($isInstanceOf(@, "Boolean"))
752752 then @
753753 else throw(($getType(@) + " couldn't be cast to Boolean"))
754754 }
755755 let isPutDisabled = if (if (if (isGlobalShutdown())
756756 then true
757757 else (cfgPoolStatus == PoolPutDisabled))
758758 then true
759759 else (cfgPoolStatus == PoolShutdown))
760760 then true
761761 else isPoolOneTokenOperationsDisabled
762762 let checks = [if (if (!(isPutDisabled))
763763 then true
764764 else isManager(i))
765765 then true
766766 else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1))
767767 then true
768768 else throwErr("exactly 1 payment are expected")]
769769 if ((checks == checks))
770770 then {
771771 let payment = i.payments[0]
772772 let paymentAssetId = payment.assetId
773773 let paymentAmountRaw = payment.amount
774774 let userAddress = i.caller
775775 let txId = i.transactionId
776776 let $t03232232474 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
777777 if (($t03232232474 == $t03232232474))
778778 then {
779779 let paymentInAmountAsset = $t03232232474._5
780780 let bonus = $t03232232474._4
781781 let feeAmount = $t03232232474._3
782782 let commonState = $t03232232474._2
783783 let emitAmountEstimated = $t03232232474._1
784784 let emitAmount = if (if ((minOutAmount > 0))
785785 then (minOutAmount > emitAmountEstimated)
786786 else false)
787787 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
788788 else emitAmountEstimated
789789 let emitInv = emit(emitAmount)
790790 if ((emitInv == emitInv))
791791 then {
792792 let lpTransfer = if (autoStake)
793793 then {
794794 let stakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(cfgLpAssetId, emitAmount)])
795795 if ((stakeInv == stakeInv))
796796 then nil
797797 else throw("Strict value is not equal to itself.")
798798 }
799799 else [ScriptTransfer(i.caller, emitAmount, cfgLpAssetId)]
800800 let sendFee = if ((feeAmount > 0))
801801 then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
802802 else nil
803803 let $t03306033257 = if ((this == feeCollectorAddress))
804804 then $Tuple2(0, 0)
805805 else if (paymentInAmountAsset)
806806 then $Tuple2(-(feeAmount), 0)
807807 else $Tuple2(0, -(feeAmount))
808808 let amountAssetBalanceDelta = $t03306033257._1
809809 let priceAssetBalanceDelta = $t03306033257._2
810810 let $t03326033368 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
811811 let refreshKLpActions = $t03326033368._1
812812 let updatedKLp = $t03326033368._2
813813 $Tuple2((((commonState ++ lpTransfer) ++ sendFee) ++ refreshKLpActions), emitAmount)
814814 }
815815 else throw("Strict value is not equal to itself.")
816816 }
817817 else throw("Strict value is not equal to itself.")
818818 }
819819 else throw("Strict value is not equal to itself.")
820820 }
821821
822822
823823
824824 @Callable(i)
825825 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
826826 let $t03356133718 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
827827 let emitAmountEstimated = $t03356133718._1
828828 let commonState = $t03356133718._2
829829 let feeAmount = $t03356133718._3
830830 let bonus = $t03356133718._4
831831 let paymentInAmountAsset = $t03356133718._5
832832 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
833833 }
834834
835835
836836
837837 @Callable(i)
838838 func getOneTkn (outAssetIdStr,minOutAmount) = {
839839 let isPoolOneTokenOperationsDisabled = {
840840 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
841841 if ($isInstanceOf(@, "Boolean"))
842842 then @
843843 else throw(($getType(@) + " couldn't be cast to Boolean"))
844844 }
845845 let isGetDisabled = if (if (isGlobalShutdown())
846846 then true
847847 else (cfgPoolStatus == PoolShutdown))
848848 then true
849849 else isPoolOneTokenOperationsDisabled
850850 let checks = [if (if (!(isGetDisabled))
851851 then true
852852 else isManager(i))
853853 then true
854854 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1))
855855 then true
856856 else throwErr("exactly 1 payment are expected")]
857857 if ((checks == checks))
858858 then {
859859 let outAssetId = parseAssetId(outAssetIdStr)
860860 let payment = i.payments[0]
861861 let paymentAssetId = payment.assetId
862862 let paymentAmount = payment.amount
863863 let userAddress = i.caller
864864 let txId = i.transactionId
865865 let $t03452334676 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
866866 if (($t03452334676 == $t03452334676))
867867 then {
868868 let outInAmountAsset = $t03452334676._5
869869 let bonus = $t03452334676._4
870870 let feeAmount = $t03452334676._3
871871 let commonState = $t03452334676._2
872872 let amountEstimated = $t03452334676._1
873873 let amount = if (if ((minOutAmount > 0))
874874 then (minOutAmount > amountEstimated)
875875 else false)
876876 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
877877 else amountEstimated
878878 let burnInv = invoke(factoryContract, "burn", [paymentAmount], [AttachedPayment(paymentAssetId, paymentAmount)])
879879 if ((burnInv == burnInv))
880880 then {
881881 let assetTransfer = [ScriptTransfer(userAddress, amount, outAssetId)]
882882 let sendFee = if ((feeAmount > 0))
883883 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
884884 else nil
885885 let $t03517635423 = {
886886 let feeAmountForCalc = if ((this == feeCollectorAddress))
887887 then 0
888888 else feeAmount
889889 if (outInAmountAsset)
890890 then $Tuple2(-((amount + feeAmountForCalc)), 0)
891891 else $Tuple2(0, -((amount + feeAmountForCalc)))
892892 }
893893 let amountAssetBalanceDelta = $t03517635423._1
894894 let priceAssetBalanceDelta = $t03517635423._2
895895 let $t03542635534 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
896896 let refreshKLpActions = $t03542635534._1
897897 let updatedKLp = $t03542635534._2
898898 $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
899899 }
900900 else throw("Strict value is not equal to itself.")
901901 }
902902 else throw("Strict value is not equal to itself.")
903903 }
904904 else throw("Strict value is not equal to itself.")
905905 }
906906
907907
908908
909909 @Callable(i)
910910 func getOneTknREADONLY (outAssetId,paymentAmount) = {
911911 let $t03571835874 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
912912 let amountEstimated = $t03571835874._1
913913 let commonState = $t03571835874._2
914914 let feeAmount = $t03571835874._3
915915 let bonus = $t03571835874._4
916916 let outInAmountAsset = $t03571835874._5
917917 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
918918 }
919919
920920
921921
922922 @Callable(i)
923923 func unstakeAndGetOneTkn (unstakeAmount,outAssetIdStr,minOutAmount) = {
924924 let isPoolOneTokenOperationsDisabled = {
925925 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
926926 if ($isInstanceOf(@, "Boolean"))
927927 then @
928928 else throw(($getType(@) + " couldn't be cast to Boolean"))
929929 }
930930 let isGetDisabled = if (if (isGlobalShutdown())
931931 then true
932932 else (cfgPoolStatus == PoolShutdown))
933933 then true
934934 else isPoolOneTokenOperationsDisabled
935935 let checks = [if (if (!(isGetDisabled))
936936 then true
937937 else isManager(i))
938938 then true
939939 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 0))
940940 then true
941941 else throwErr("no payments are expected")]
942942 if ((checks == checks))
943943 then {
944944 let outAssetId = parseAssetId(outAssetIdStr)
945945 let userAddress = i.caller
946946 let txId = i.transactionId
947947 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
948948 if ((unstakeInv == unstakeInv))
949949 then {
950950 let $t03669936850 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
951951 if (($t03669936850 == $t03669936850))
952952 then {
953953 let outInAmountAsset = $t03669936850._5
954954 let bonus = $t03669936850._4
955955 let feeAmount = $t03669936850._3
956956 let commonState = $t03669936850._2
957957 let amountEstimated = $t03669936850._1
958958 let amount = if (if ((minOutAmount > 0))
959959 then (minOutAmount > amountEstimated)
960960 else false)
961961 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
962962 else amountEstimated
963963 let burnInv = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
964964 if ((burnInv == burnInv))
965965 then {
966966 let assetTransfer = [ScriptTransfer(i.caller, amount, outAssetId)]
967967 let sendFee = if ((feeAmount > 0))
968968 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
969969 else nil
970970 let $t03734537592 = {
971971 let feeAmountForCalc = if ((this == feeCollectorAddress))
972972 then 0
973973 else feeAmount
974974 if (outInAmountAsset)
975975 then $Tuple2(-((amount + feeAmountForCalc)), 0)
976976 else $Tuple2(0, -((amount + feeAmountForCalc)))
977977 }
978978 let amountAssetBalanceDelta = $t03734537592._1
979979 let priceAssetBalanceDelta = $t03734537592._2
980980 let $t03759537703 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
981981 let refreshKLpActions = $t03759537703._1
982982 let updatedKLp = $t03759537703._2
983983 $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
984984 }
985985 else throw("Strict value is not equal to itself.")
986986 }
987987 else throw("Strict value is not equal to itself.")
988988 }
989989 else throw("Strict value is not equal to itself.")
990990 }
991991 else throw("Strict value is not equal to itself.")
992992 }
993993
994994
995995
996996 @Callable(i)
997997 func get () = {
998998 let res = commonGet(i)
999999 let outAmtAmt = res._1
10001000 let outPrAmt = res._2
10011001 let pmtAmt = res._3
10021002 let pmtAssetId = res._4
10031003 let state = res._5
10041004 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
10051005 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
10061006 then {
10071007 let $t03849538577 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
10081008 let refreshKLpActions = $t03849538577._1
10091009 let updatedKLp = $t03849538577._2
10101010 (state ++ refreshKLpActions)
10111011 }
10121012 else throw("Strict value is not equal to itself.")
10131013 }
10141014
10151015
10161016
10171017 @Callable(i)
10181018 func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = {
10191019 let res = commonGet(i)
10201020 let outAmAmt = res._1
10211021 let outPrAmt = res._2
10221022 let pmtAmt = res._3
10231023 let pmtAssetId = res._4
10241024 let state = res._5
10251025 if ((noLessThenAmtAsset > outAmAmt))
10261026 then throw(((("noLessThenAmtAsset failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset)))
10271027 else if ((noLessThenPriceAsset > outPrAmt))
10281028 then throw(((("noLessThenPriceAsset failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset)))
10291029 else {
10301030 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
10311031 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
10321032 then {
10331033 let $t03937339454 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
10341034 let refreshKLpActions = $t03937339454._1
10351035 let updatedKLp = $t03937339454._2
10361036 (state ++ refreshKLpActions)
10371037 }
10381038 else throw("Strict value is not equal to itself.")
10391039 }
10401040 }
10411041
10421042
10431043
10441044 @Callable(i)
10451045 func unstakeAndGet (amount) = {
10461046 let checkPayments = if ((size(i.payments) != 0))
10471047 then throw("No payments are expected")
10481048 else true
10491049 if ((checkPayments == checkPayments))
10501050 then {
10511051 let cfg = getPoolConfig()
10521052 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
10531053 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(lpAssetId), amount], nil)
10541054 if ((unstakeInv == unstakeInv))
10551055 then {
10561056 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller)
10571057 let outAmAmt = res._1
10581058 let outPrAmt = res._2
10591059 let poolStatus = parseIntValue(res._9)
10601060 let state = res._10
10611061 let checkPoolStatus = if (if (isGlobalShutdown())
10621062 then true
10631063 else (poolStatus == PoolShutdown))
10641064 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
10651065 else true
10661066 if ((checkPoolStatus == checkPoolStatus))
10671067 then {
10681068 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
10691069 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
10701070 then {
10711071 let $t04042740508 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
10721072 let refreshKLpActions = $t04042740508._1
10731073 let updatedKLp = $t04042740508._2
10741074 (state ++ refreshKLpActions)
10751075 }
10761076 else throw("Strict value is not equal to itself.")
10771077 }
10781078 else throw("Strict value is not equal to itself.")
10791079 }
10801080 else throw("Strict value is not equal to itself.")
10811081 }
10821082 else throw("Strict value is not equal to itself.")
10831083 }
10841084
10851085
10861086
10871087 @Callable(i)
10881088 func unstakeAndGetNoLess (unstakeAmount,noLessThenAmountAsset,noLessThenPriceAsset) = {
10891089 let isGetDisabled = if (isGlobalShutdown())
10901090 then true
10911091 else (cfgPoolStatus == PoolShutdown)
10921092 let checks = [if (!(isGetDisabled))
10931093 then true
10941094 else throw("get operation is blocked by admin"), if ((size(i.payments) == 0))
10951095 then true
10961096 else throw("no payments are expected")]
10971097 if ((checks == checks))
10981098 then {
10991099 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
11001100 if ((unstakeInv == unstakeInv))
11011101 then {
11021102 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller)
11031103 let outAmAmt = res._1
11041104 let outPrAmt = res._2
11051105 let state = res._10
11061106 let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset))
11071107 then true
11081108 else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset))
11091109 then true
11101110 else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))]
11111111 if ((checkAmounts == checkAmounts))
11121112 then {
11131113 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
11141114 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
11151115 then {
11161116 let $t04164841729 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
11171117 let refreshKLpActions = $t04164841729._1
11181118 let updatedKLp = $t04164841729._2
11191119 (state ++ refreshKLpActions)
11201120 }
11211121 else throw("Strict value is not equal to itself.")
11221122 }
11231123 else throw("Strict value is not equal to itself.")
11241124 }
11251125 else throw("Strict value is not equal to itself.")
11261126 }
11271127 else throw("Strict value is not equal to itself.")
11281128 }
11291129
11301130
11311131
11321132 @Callable(i)
11331133 func activate (amtAssetStr,priceAssetStr) = if ((toString(i.caller) != toString(factoryContract)))
11341134 then throw("permissions denied")
11351135 else $Tuple2([StringEntry(aa(), amtAssetStr), StringEntry(pa(), priceAssetStr)], "success")
11361136
11371137
11381138
11391139 @Callable(i)
11401140 func refreshKLp () = {
11411141 let lastRefreshedBlockHeight = valueOrElse(getInteger(keyKLpRefreshedHeight), 0)
11421142 let checkLastRefreshedBlockHeight = if (((height - lastRefreshedBlockHeight) >= kLpRefreshDelay))
11431143 then unit
11441144 else throwErr(makeString([toString(kLpRefreshDelay), " blocks have not passed since the previous call"], ""))
11451145 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
11461146 then {
1147- let $t04271742772 = refreshKLpInternal(0, 0, 0)
1148- let actions = $t04271742772._1
1149- let updatedKLp = $t04271742772._2
1147+ let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
1148+ let $t04284342907 = refreshKLpInternal(0, 0, 0)
1149+ let kLpUpdateActions = $t04284342907._1
1150+ let updatedKLp = $t04284342907._2
1151+ let actions = if ((kLp != updatedKLp))
1152+ then kLpUpdateActions
1153+ else throwErr("nothing to refresh")
11501154 $Tuple2(actions, toString(updatedKLp))
11511155 }
11521156 else throw("Strict value is not equal to itself.")
11531157 }
11541158
11551159
11561160
11571161 @Callable(i)
11581162 func getPoolConfigWrapperREADONLY () = $Tuple2(nil, getPoolConfig())
11591163
11601164
11611165
11621166 @Callable(i)
11631167 func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId))
11641168
11651169
11661170
11671171 @Callable(i)
11681172 func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = {
11691173 let prices = calcPrices(amAmt, prAmt, lpAmt)
11701174 $Tuple2(nil, [toString(prices[0]), toString(prices[1]), toString(prices[2])])
11711175 }
11721176
11731177
11741178
11751179 @Callable(i)
11761180 func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(toX18(origVal, origScaleMult)))
11771181
11781182
11791183
11801184 @Callable(i)
11811185 func fromX18WrapperREADONLY (val,resultScaleMult) = $Tuple2(nil, fromX18(parseBigIntValue(val), resultScaleMult))
11821186
11831187
11841188
11851189 @Callable(i)
11861190 func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(calcPriceBigInt(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18))))
11871191
11881192
11891193
11901194 @Callable(i)
11911195 func estimatePutOperationWrapperREADONLY (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = $Tuple2(nil, estimatePutOperation(txId58, slippageTolerance, inAmAssetAmt, inAmAssetId, inPrAssetAmt, inPrAssetId, userAddress, isEvaluate, emitLp))
11921196
11931197
11941198
11951199 @Callable(i)
11961200 func estimateGetOperationWrapperREADONLY (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
11971201 let res = estimateGetOperation(txId58, pmtAssetId, pmtLpAmt, addressFromStringValue(userAddress))
11981202 $Tuple2(nil, $Tuple10(res._1, res._2, res._3, res._4, res._5, res._6, res._7, toString(res._8), res._9, res._10))
11991203 }
12001204
12011205
12021206
12031207 @Callable(i)
12041208 func statsREADONLY () = {
12051209 let cfg = getPoolConfig()
12061210 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
12071211 let amtAssetId = cfg[idxAmtAssetId]
12081212 let priceAssetId = cfg[idxPriceAssetId]
12091213 let iAmtAssetId = cfg[idxIAmtAssetId]
12101214 let iPriceAssetId = cfg[idxIPriceAssetId]
12111215 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
12121216 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
12131217 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
12141218 let accAmtAssetBalance = getAccBalance(amtAssetId)
12151219 let accPriceAssetBalance = getAccBalance(priceAssetId)
12161220 let pricesList = if ((poolLPBalance == 0))
12171221 then [zeroBigInt, zeroBigInt, zeroBigInt]
12181222 else calcPrices(accAmtAssetBalance, accPriceAssetBalance, poolLPBalance)
12191223 let curPrice = 0
12201224 let lpAmtAssetShare = fromX18(pricesList[1], scale8)
12211225 let lpPriceAssetShare = fromX18(pricesList[2], scale8)
12221226 let poolWeight = value(getInteger(factoryContract, keyPoolWeight(toString(this))))
12231227 $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))
12241228 }
12251229
12261230
12271231
12281232 @Callable(i)
12291233 func evaluatePutByAmountAssetREADONLY (inAmAssetAmt) = {
12301234 let cfg = getPoolConfig()
12311235 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
12321236 let amAssetIdStr = cfg[idxAmtAssetId]
12331237 let amAssetId = fromBase58String(amAssetIdStr)
12341238 let prAssetIdStr = cfg[idxPriceAssetId]
12351239 let prAssetId = fromBase58String(prAssetIdStr)
12361240 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
12371241 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
12381242 let poolStatus = cfg[idxPoolStatus]
12391243 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
12401244 let accAmtAssetBalance = getAccBalance(amAssetIdStr)
12411245 let accPriceAssetBalance = getAccBalance(prAssetIdStr)
12421246 let amtAssetAmtX18 = toX18(accAmtAssetBalance, amtAssetDcm)
12431247 let priceAssetAmtX18 = toX18(accPriceAssetBalance, priceAssetDcm)
12441248 let curPriceX18 = if ((poolLPBalance == 0))
12451249 then zeroBigInt
12461250 else calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
12471251 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
12481252 let inPrAssetAmtX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18)
12491253 let inPrAssetAmt = fromX18(inPrAssetAmtX18, priceAssetDcm)
12501254 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
12511255 let calcLpAmt = estPut._1
12521256 let curPriceCalc = estPut._3
12531257 let amBalance = estPut._4
12541258 let prBalance = estPut._5
12551259 let lpEmission = estPut._6
12561260 $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))
12571261 }
12581262
12591263
12601264
12611265 @Callable(i)
12621266 func evaluatePutByPriceAssetREADONLY (inPrAssetAmt) = {
12631267 let cfg = getPoolConfig()
12641268 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
12651269 let amAssetIdStr = cfg[idxAmtAssetId]
12661270 let amAssetId = fromBase58String(amAssetIdStr)
12671271 let prAssetIdStr = cfg[idxPriceAssetId]
12681272 let prAssetId = fromBase58String(prAssetIdStr)
12691273 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
12701274 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
12711275 let poolStatus = cfg[idxPoolStatus]
12721276 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
12731277 let amBalanceRaw = getAccBalance(amAssetIdStr)
12741278 let prBalanceRaw = getAccBalance(prAssetIdStr)
12751279 let amBalanceRawX18 = toX18(amBalanceRaw, amtAssetDcm)
12761280 let prBalanceRawX18 = toX18(prBalanceRaw, priceAssetDcm)
12771281 let curPriceX18 = if ((poolLPBalance == 0))
12781282 then zeroBigInt
12791283 else calcPriceBigInt(prBalanceRawX18, amBalanceRawX18)
12801284 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
12811285 let inAmAssetAmtX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
12821286 let inAmAssetAmt = fromX18(inAmAssetAmtX18, amtAssetDcm)
12831287 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
12841288 let calcLpAmt = estPut._1
12851289 let curPriceCalc = estPut._3
12861290 let amBalance = estPut._4
12871291 let prBalance = estPut._5
12881292 let lpEmission = estPut._6
12891293 $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))
12901294 }
12911295
12921296
12931297
12941298 @Callable(i)
12951299 func evaluateGetREADONLY (paymentLpAssetId,paymentLpAmt) = {
12961300 let res = estimateGetOperation("", paymentLpAssetId, paymentLpAmt, this)
12971301 let outAmAmt = res._1
12981302 let outPrAmt = res._2
12991303 let amBalance = res._5
13001304 let prBalance = res._6
13011305 let lpEmission = res._7
13021306 let curPrice = res._8
13031307 let poolStatus = parseIntValue(res._9)
13041308 $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))
13051309 }
13061310
13071311
13081312 @Verifier(tx)
13091313 func verify () = {
13101314 let targetPublicKey = match managerPublicKeyOrUnit() {
13111315 case pk: ByteVector =>
13121316 pk
13131317 case _: Unit =>
13141318 tx.senderPublicKey
13151319 case _ =>
13161320 throw("Match error")
13171321 }
13181322 match tx {
13191323 case order: Order =>
13201324 let matcherPub = getMatcherPubOrFail()
13211325 let orderValid = validateMatcherOrderAllowed(order)
13221326 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
13231327 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
13241328 if (if (if (orderValid)
13251329 then senderValid
13261330 else false)
13271331 then matcherValid
13281332 else false)
13291333 then true
13301334 else throwOrderError(orderValid, senderValid, matcherValid)
13311335 case s: SetScriptTransaction =>
13321336 let newHash = blake2b256(value(s.script))
13331337 let allowedHash = fromBase64String(value(getString(factoryContract, keyAllowedLpScriptHash())))
13341338 let currentHash = scriptHash(this)
13351339 if (if ((allowedHash == newHash))
13361340 then (currentHash != newHash)
13371341 else false)
13381342 then true
13391343 else sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
13401344 case _ =>
13411345 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
13421346 }
13431347 }
13441348

github/deemru/w8io/026f985 
108.89 ms