tx · 3e6bvMNuYHEy6zBhzzsE7w89A1u5crTWYNMqwWspyHsg 3NAefciWv6f9fWvEXdGgpHfanJFG8HqfjuT: -0.01400000 Waves 2021.12.23 02:34 [1846139] smart account 3NAefciWv6f9fWvEXdGgpHfanJFG8HqfjuT > SELF 0.00000000 Waves
{ "type": 13, "id": "3e6bvMNuYHEy6zBhzzsE7w89A1u5crTWYNMqwWspyHsg", "fee": 1400000, "feeAssetId": null, "timestamp": 1640216066358, "version": 1, "sender": "3NAefciWv6f9fWvEXdGgpHfanJFG8HqfjuT", "senderPublicKey": "D1BL65meykxFZTCuq7jq9HSGLLnWvQamQPUNrguW5w39", "proofs": [ "4qNQBLV9YK86TQaCWuznro8tbgapNWmBQhX55MXgR4aQNw7tLvW85EiLM9x5KsDA3H3jH5MUQn7Sjw92PGVRfeac" ], "script": "base64:AAIFAAAAAAAAAGoIAhIECgIICBIECgIBBBIFCgMBAQQSAwoBARIAEgYKBAEBAQgSBAoCAQESAwoBARIECgIICBIAEgMKAQgSBQoDAQEBEgQKAggBEgQKAgEBEgQKAggIEgsKCQgBAQIBAggEBBIGCgQICAEIAAAAPwAAAAAKbFBkZWNpbWFscwAAAAAAAAAACAAAAAAGc2NhbGU4AAAAAAAF9eEAAAAAAAxzY2FsZThCaWdJbnQJAAE2AAAAAQAAAAAABfXhAAAAAAAJY2FsY0Vycm9yCQABNgAAAAEAAAAAAAAPQkAAAAAAB3NjYWxlMTgJAAE2AAAAAQAN4Lazp2QAAAAAAAAKemVyb0JpZ0ludAkAATYAAAABAAAAAAAAAAAAAAAAAAlvbmVCaWdJbnQJAAE2AAAAAQAAAAAAAAAAAQAAAAADU0VQAgAAAAJfXwAAAAAFRU1QVFkCAAAAAAAAAAAKUG9vbEFjdGl2ZQAAAAAAAAAAAQAAAAAPUG9vbFB1dERpc2FibGVkAAAAAAAAAAACAAAAABNQb29sTWF0Y2hlckRpc2FibGVkAAAAAAAAAAADAAAAAAxQb29sU2h1dGRvd24AAAAAAAAAAA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EAAAAbdmFsaWRhdGVNYXRjaGVyT3JkZXJBbGxvd2VkAAAAAQUAAAAFb3JkZXIEAAAAC3NlbmRlclZhbGlkCQAB9AAAAAMIBQAAAAVvcmRlcgAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAABW9yZGVyAAAABnByb29mcwAAAAAAAAAAAAgFAAAABW9yZGVyAAAAD3NlbmRlclB1YmxpY0tleQQAAAAMbWF0Y2hlclZhbGlkCQAB9AAAAAMIBQAAAAVvcmRlcgAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAABW9yZGVyAAAABnByb29mcwAAAAAAAAAAAQUAAAAKbWF0Y2hlclB1YgMDAwUAAAAKb3JkZXJWYWxpZAUAAAALc2VuZGVyVmFsaWQHBQAAAAxtYXRjaGVyVmFsaWQHBgkBAAAAD3Rocm93T3JkZXJFcnJvcgAAAAMFAAAACm9yZGVyVmFsaWQFAAAAC3NlbmRlclZhbGlkBQAAAAxtYXRjaGVyVmFsaWQEAAAADW1hbmFnZXJQdWJsaWMJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAAQdAAAAAgUAAAAEdGhpcwkBAAAAE2tleU1hbmFnZXJQdWJsaWNLZXkAAAAABQAAAAVFTVBUWQMJAAAAAAAAAgUAAAANbWFuYWdlclB1YmxpYwUAAAAFRU1QVFkJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5CQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAkAAlkAAAABBQAAAA1tYW5hZ2VyUHVibGlj+4FFmA==", "chainId": 84, "height": 1846139, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4zEtJ4QrBCgeQkeD2FZDKZh3yeF9brTEiqjjmRWuXtLd Next: EtZRbQc5CoNTa5athsaSXetL4PMzkzZXmMAg6BMW2bCT Diff:
Old | New | Differences | |
---|---|---|---|
211 | 211 | } | |
212 | 212 | ||
213 | 213 | ||
214 | - | func estimatePutOperation (txId58, | |
214 | + | func estimatePutOperation (txId58,slippage,inAmAmt,inAmId,inPrAmt,inPrId,userAddress,isEvaluate,emitLp) = { | |
215 | 215 | let cfg = getPoolConfig() | |
216 | 216 | let lpId = fromBase58String(cfg[idxLPAsId]) | |
217 | 217 | let amIdStr = cfg[idxAmAsId] | |
221 | 221 | let amtDcm = parseIntValue(cfg[idxAmtAsDcm]) | |
222 | 222 | let priceDcm = parseIntValue(cfg[idxPriceAsDcm]) | |
223 | 223 | let poolStatus = cfg[idxPoolStatus] | |
224 | - | let lpEmission = valueOrErrorMessage(assetInfo(lpId), | |
224 | + | let lpEmission = valueOrErrorMessage(assetInfo(lpId), "Wrong lp asset.").quantity | |
225 | 225 | let amBalance = if (isEvaluate) | |
226 | 226 | then getAccBalance(amIdStr) | |
227 | 227 | else (getAccBalance(amIdStr) - inAmAmt) | |
241 | 241 | $Tuple5(fromX18(lpAmtX18, scale8), fromX18(inAmAssetAmtX18, amtDcm), fromX18(inPrAssetAmtX18, priceDcm), calcPriceBigInt((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18) | |
242 | 242 | } | |
243 | 243 | else { | |
244 | - | let tRes = if (isOneAsset) | |
245 | - | then { | |
244 | + | let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18) | |
245 | + | let slippageRealX18 = fraction(abs((curPriceX18 - userPriceX18)), scale18, curPriceX18) | |
246 | + | let slippageX18 = toX18(slippage, scale8) | |
247 | + | if (if ((curPriceX18 != zeroBigInt)) | |
248 | + | then (slippageRealX18 > slippageX18) | |
249 | + | else false) | |
250 | + | then throw(((("Price slippage " + toString(slippageRealX18)) + " exceeded ") + toString(slippageX18))) | |
251 | + | else { | |
246 | 252 | let lpEmissionX18 = toX18(lpEmission, scale8) | |
247 | - | let sumInAssets = (inAmAssetAmtX18 + inPrAssetAmtX18) | |
248 | - | let sumPoolBalances = (amBalanceX18 + prBalanceX18) | |
249 | - | let lpAmtX18 = fraction(lpEmissionX18, sumInAssets, sumPoolBalances) | |
250 | - | let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18) | |
251 | - | $Tuple5(fromX18(lpAmtX18, scale8), inAmAmt, inPrAmt, curPriceX18, toBigInt(0)) | |
253 | + | let prViaAmX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18) | |
254 | + | let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18) | |
255 | + | let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18)) | |
256 | + | then $Tuple2(amViaPrX18, inPrAssetAmtX18) | |
257 | + | else $Tuple2(inAmAssetAmtX18, prViaAmX18) | |
258 | + | let expAmtAssetAmtX18 = expectedAmts._1 | |
259 | + | let expPriceAssetAmtX18 = expectedAmts._2 | |
260 | + | let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18) | |
261 | + | $Tuple5(fromX18(lpAmtX18, scale8), fromX18(expAmtAssetAmtX18, amtDcm), fromX18(expPriceAssetAmtX18, priceDcm), curPriceX18, slippageX18) | |
252 | 262 | } | |
253 | - | else { | |
254 | - | let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18) | |
255 | - | let slippageX18 = fraction(abs((curPriceX18 - userPriceX18)), scale18, curPriceX18) | |
256 | - | let slippageToleranceX18 = toX18(slippageTolerance, scale8) | |
257 | - | if (if ((curPriceX18 != zeroBigInt)) | |
258 | - | then (slippageX18 > slippageToleranceX18) | |
259 | - | else false) | |
260 | - | then throw(((("Price slippage " + toString(slippageX18)) + " exceeded the passed limit of ") + toString(slippageToleranceX18))) | |
261 | - | else { | |
262 | - | let lpEmissionX18 = toX18(lpEmission, scale8) | |
263 | - | let prViaAmX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18) | |
264 | - | let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18) | |
265 | - | let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18)) | |
266 | - | then $Tuple2(amViaPrX18, inPrAssetAmtX18) | |
267 | - | else $Tuple2(inAmAssetAmtX18, prViaAmX18) | |
268 | - | let expAmtAssetAmtX18 = expectedAmts._1 | |
269 | - | let expPriceAssetAmtX18 = expectedAmts._2 | |
270 | - | let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18) | |
271 | - | $Tuple5(fromX18(lpAmtX18, scale8), fromX18(expAmtAssetAmtX18, amtDcm), fromX18(expPriceAssetAmtX18, priceDcm), curPriceX18, slippageX18) | |
272 | - | } | |
273 | - | } | |
274 | - | tRes | |
275 | 263 | } | |
276 | 264 | let calcLpAmt = res._1 | |
277 | 265 | let calcAmAssetPmt = res._2 | |
279 | 267 | let curPrice = fromX18(res._4, scale8) | |
280 | 268 | let slippageCalc = fromX18(res._5, scale8) | |
281 | 269 | if ((0 >= calcLpAmt)) | |
282 | - | then throw(" | |
270 | + | then throw("LP is less than zero.") | |
283 | 271 | else { | |
284 | 272 | let emitLpAmt = if (!(emitLp)) | |
285 | 273 | then 0 | |
286 | 274 | else calcLpAmt | |
287 | 275 | let amDiff = (inAmAmt - calcAmAssetPmt) | |
288 | 276 | let prDiff = (inPrAmt - calcPrAssetPmt) | |
289 | - | let commonState = [IntegerEntry(keyPriceLast(), curPrice), IntegerEntry(keyPriceHistory(height, lastBlock.timestamp), curPrice), StringEntry(keyPutActionByUser(userAddress, txId58), dataPutActionInfo(calcAmAssetPmt, calcPrAssetPmt, emitLpAmt, curPrice, | |
277 | + | let commonState = [IntegerEntry(keyPriceLast(), curPrice), IntegerEntry(keyPriceHistory(height, lastBlock.timestamp), curPrice), StringEntry(keyPutActionByUser(userAddress, txId58), dataPutActionInfo(calcAmAssetPmt, calcPrAssetPmt, emitLpAmt, curPrice, slippage, slippageCalc, height, lastBlock.timestamp, amDiff, prDiff))] | |
290 | 278 | $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEmission, lpId, poolStatus, commonState, amDiff, prDiff, inAmId, inPrId) | |
291 | 279 | } | |
292 | 280 | } | |
356 | 344 | } | |
357 | 345 | ||
358 | 346 | ||
359 | - | func commonPut (i,slippageTolerance,emitLp) = if ((size(i.payments) != 2)) | |
360 | - | then throw("exactly 2 payments are expected") | |
361 | - | else { | |
362 | - | let amAssetPmt = value(i.payments[0]) | |
363 | - | let prAssetPmt = value(i.payments[1]) | |
364 | - | let estPut = estimatePutOperation(toBase58String(i.transactionId), slippageTolerance, amAssetPmt.amount, amAssetPmt.assetId, prAssetPmt.amount, prAssetPmt.assetId, toString(i.caller), false, emitLp, false) | |
365 | - | let status = parseIntValue(estPut._8) | |
366 | - | if (if (if (isGlobalShutdown()) | |
367 | - | then true | |
368 | - | else (status == PoolPutDisabled)) | |
369 | - | then true | |
370 | - | else (status == PoolShutdown)) | |
371 | - | then throw(("Put operation is blocked by admin. Status = " + toString(status))) | |
372 | - | else estPut | |
373 | - | } | |
347 | + | func commonPut (caller,txId,amAsPmt,prAsPmt,slippage,emitLp) = { | |
348 | + | let estPut = estimatePutOperation(txId, slippage, value(amAsPmt).amount, value(amAsPmt).assetId, value(prAsPmt).amount, value(prAsPmt).assetId, caller, false, emitLp) | |
349 | + | let status = parseIntValue(estPut._8) | |
350 | + | if (if (if (isGlobalShutdown()) | |
351 | + | then true | |
352 | + | else (status == PoolPutDisabled)) | |
353 | + | then true | |
354 | + | else (status == PoolShutdown)) | |
355 | + | then throw(("Put operation is blocked by admin. Status = " + toString(status))) | |
356 | + | else estPut | |
357 | + | } | |
374 | 358 | ||
375 | 359 | ||
376 | 360 | func calcD (a,b,lVal) = { | |
399 | 383 | ||
400 | 384 | ||
401 | 385 | @Callable(i) | |
402 | - | func put ( | |
386 | + | func put (slip,autoStake) = { | |
403 | 387 | let factCfg = getFactoryConfig() | |
404 | - | let stakingCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactStakCntr]), "Error. Incorrect staking address.") | |
405 | - | let slipCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactSlippCntr]), "Error. Incorrect slippage contract address.") | |
406 | - | if ((0 > slippage)) | |
407 | - | then throw("Invalid slippageTolerance passed") | |
408 | - | else { | |
409 | - | let estPut = commonPut(i, slippage, true) | |
410 | - | let emitLpAmt = estPut._2 | |
411 | - | let lpAssetId = estPut._7 | |
412 | - | let state = estPut._9 | |
413 | - | let amDiff = estPut._10 | |
414 | - | let prDiff = estPut._11 | |
415 | - | let amId = estPut._12 | |
416 | - | let prId = estPut._13 | |
417 | - | let emitInv = invoke(factoryContract, "emit", [emitLpAmt], nil) | |
418 | - | if ((emitInv == emitInv)) | |
419 | - | then { | |
420 | - | let slippageAInv = if ((amDiff > 0)) | |
421 | - | then invoke(slipCntr, "put", nil, [AttachedPayment(amId, amDiff)]) | |
422 | - | else nil | |
423 | - | if ((slippageAInv == slippageAInv)) | |
424 | - | then { | |
425 | - | let slippagePInv = if ((prDiff > 0)) | |
426 | - | then invoke(slipCntr, "put", nil, [AttachedPayment(prId, prDiff)]) | |
427 | - | else nil | |
428 | - | if ((slippagePInv == slippagePInv)) | |
429 | - | then { | |
430 | - | let lpTrnsfr = if (autoStake) | |
431 | - | then { | |
432 | - | let slpStakeInv = invoke(stakingCntr, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)]) | |
433 | - | if ((slpStakeInv == slpStakeInv)) | |
434 | - | then nil | |
435 | - | else throw("Strict value is not equal to itself.") | |
436 | - | } | |
437 | - | else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)] | |
438 | - | (state ++ lpTrnsfr) | |
439 | - | } | |
440 | - | else throw("Strict value is not equal to itself.") | |
441 | - | } | |
442 | - | else throw("Strict value is not equal to itself.") | |
443 | - | } | |
444 | - | else throw("Strict value is not equal to itself.") | |
445 | - | } | |
388 | + | let stakingCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactStakCntr]), "Incorrect staking address.") | |
389 | + | let slipCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactSlippCntr]), "Incorrect slippage address.") | |
390 | + | if ((0 > slip)) | |
391 | + | then throw("Invalid slippage.") | |
392 | + | else if ((size(i.payments) != 2)) | |
393 | + | then throw("2 payments are expected") | |
394 | + | else { | |
395 | + | let estPut = commonPut(toString(i.caller), toBase58String(i.transactionId), AttachedPayment(value(i.payments[0]).assetId, value(i.payments[0]).amount), i.payments[1], slip, true) | |
396 | + | let emitLpAmt = estPut._2 | |
397 | + | let lpAssetId = estPut._7 | |
398 | + | let state = estPut._9 | |
399 | + | let amDiff = estPut._10 | |
400 | + | let prDiff = estPut._11 | |
401 | + | let amId = estPut._12 | |
402 | + | let prId = estPut._13 | |
403 | + | let emitInv = invoke(factoryContract, "emit", [emitLpAmt], nil) | |
404 | + | if ((emitInv == emitInv)) | |
405 | + | then { | |
406 | + | let slippageAInv = if ((amDiff > 0)) | |
407 | + | then invoke(slipCntr, "put", nil, [AttachedPayment(amId, amDiff)]) | |
408 | + | else nil | |
409 | + | if ((slippageAInv == slippageAInv)) | |
410 | + | then { | |
411 | + | let slippagePInv = if ((prDiff > 0)) | |
412 | + | then invoke(slipCntr, "put", nil, [AttachedPayment(prId, prDiff)]) | |
413 | + | else nil | |
414 | + | if ((slippagePInv == slippagePInv)) | |
415 | + | then { | |
416 | + | let lpTrnsfr = if (autoStake) | |
417 | + | then { | |
418 | + | let slpStakeInv = invoke(stakingCntr, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)]) | |
419 | + | if ((slpStakeInv == slpStakeInv)) | |
420 | + | then nil | |
421 | + | else throw("Strict value is not equal to itself.") | |
422 | + | } | |
423 | + | else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)] | |
424 | + | (state ++ lpTrnsfr) | |
425 | + | } | |
426 | + | else throw("Strict value is not equal to itself.") | |
427 | + | } | |
428 | + | else throw("Strict value is not equal to itself.") | |
429 | + | } | |
430 | + | else throw("Strict value is not equal to itself.") | |
431 | + | } | |
446 | 432 | } | |
447 | 433 | ||
448 | 434 | ||
450 | 436 | @Callable(i) | |
451 | 437 | func putOneTkn (inAmtAmount,inPrAmount,autoStake) = { | |
452 | 438 | let cfg = getFactoryConfig() | |
453 | - | let stakingContract = valueOrErrorMessage(addressFromString(cfg[idxFactStakCntr]), "Error. Incorrect staking address.") | |
439 | + | let stakingCntr = valueOrErrorMessage(addressFromString(cfg[idxFactStakCntr]), "Wrong staking address") | |
440 | + | let slipCntr = valueOrErrorMessage(addressFromString(cfg[idxFactSlippCntr]), "Wrong slippage address") | |
454 | 441 | let poolCfg = getPoolConfig() | |
455 | 442 | let amId = poolCfg[idxAmAsId] | |
456 | 443 | let prId = poolCfg[idxPrAsId] | |
464 | 451 | let pmtAmt = pmt.amount | |
465 | 452 | let amAssetSwapX18 = toX18(inAmtAmount, amDcm) | |
466 | 453 | let prAssetSwapX18 = toX18(inPrAmount, prDcm) | |
467 | - | let inPrice = calcPriceBigInt(prAssetSwapX18, amAssetSwapX18) | |
468 | 454 | let amBalance = getAccBalance(amId) | |
469 | - | let amBalanceX18 = toX18(amBalance, amDcm) | |
470 | 455 | let prBalance = getAccBalance(prId) | |
471 | - | let prBalanceX18 = toX18(prBalance, prDcm) | |
472 | 456 | let dCur = calcD(toBigInt(amBalance), toBigInt(prBalance), 50) | |
473 | 457 | let isValid = if ((pmtAssetId == amId)) | |
474 | 458 | then { | |
475 | 459 | let pmtAmtX18 = toX18(pmtAmt, amDcm) | |
476 | 460 | let prAdiff = prAssetSwapX18 | |
477 | 461 | let amAdiff = (pmtAmtX18 - amAssetSwapX18) | |
478 | - | let dNew = calcD((toBigInt(amBalance) - toBigInt(fromX18(amAdiff, amDcm))), (toBigInt(prBalance) + toBigInt(fromX18(prAdiff, prDcm))), 50) | |
479 | - | true | |
462 | + | let dSwap = calcD((toBigInt(amBalance) + toBigInt(fromX18(amAdiff, amDcm))), (toBigInt(prBalance) - toBigInt(fromX18(prAdiff, prDcm))), 50) | |
463 | + | if ((dSwap > dCur)) | |
464 | + | then throw("Incorrect argiments passed. Deposit lead to D decrease.") | |
465 | + | else true | |
480 | 466 | } | |
481 | 467 | else { | |
482 | 468 | let pmtPrX18 = toX18(pmtAmt, prDcm) | |
483 | 469 | let prAdiff = (prAssetSwapX18 - pmtPrX18) | |
484 | 470 | let amAdiff = amAssetSwapX18 | |
485 | - | let dNew = calcD((toBigInt(amBalance) + toBigInt(fromX18(amAdiff, amDcm))), (toBigInt(prBalance) - toBigInt(fromX18(prAdiff, prDcm))), 50) | |
486 | - | true | |
471 | + | let dNew = calcD((toBigInt(amBalance) - toBigInt(fromX18(amAdiff, amDcm))), (toBigInt(prBalance) + toBigInt(fromX18(prAdiff, prDcm))), 50) | |
472 | + | if ((dNew > dCur)) | |
473 | + | then throw("Wrong arguments passed. D decreased.") | |
474 | + | else true | |
487 | 475 | } | |
488 | 476 | if (!(isValid)) | |
489 | 477 | then throw("Errors.") | |
490 | 478 | else { | |
491 | - | let estPut = | |
479 | + | let estPut = commonPut(toString(i.caller), toBase58String(i.transactionId), AttachedPayment(fromBase58String(amId), inAmtAmount), AttachedPayment(fromBase58String(prId), inPrAmount), 50000000000, true) | |
492 | 480 | let emitLpAmt = estPut._2 | |
493 | 481 | let lpAssetId = estPut._7 | |
494 | - | let | |
495 | - | | |
496 | - | | |
497 | - | | |
498 | - | | |
499 | - | | |
500 | - | | |
501 | - | | |
502 | - | | |
503 | - | if (( | |
482 | + | let state = estPut._9 | |
483 | + | let amDiff = estPut._10 | |
484 | + | let prDiff = estPut._11 | |
485 | + | let emitInv = invoke(factoryContract, "emit", [emitLpAmt], nil) | |
486 | + | if ((emitInv == emitInv)) | |
487 | + | then { | |
488 | + | let slippageAInv = if ((amDiff > 0)) | |
489 | + | then invoke(slipCntr, "put", nil, [AttachedPayment(fromBase58String(amId), amDiff)]) | |
490 | + | else nil | |
491 | + | if ((slippageAInv == slippageAInv)) | |
504 | 492 | then { | |
505 | - | let lpTrnsfr = if (autoStake) | |
493 | + | let slippagePInv = if ((prDiff > 0)) | |
494 | + | then invoke(slipCntr, "put", nil, [AttachedPayment(fromBase58String(prId), prDiff)]) | |
495 | + | else nil | |
496 | + | if ((slippagePInv == slippagePInv)) | |
506 | 497 | then { | |
507 | - | let stakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)]) | |
508 | - | if ((stakeInv == stakeInv)) | |
509 | - | then nil | |
510 | - | else throw("Strict value is not equal to itself.") | |
498 | + | let lpTrnsfr = if (autoStake) | |
499 | + | then { | |
500 | + | let slpStakeInv = invoke(stakingCntr, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)]) | |
501 | + | if ((slpStakeInv == slpStakeInv)) | |
502 | + | then nil | |
503 | + | else throw("Strict value is not equal to itself.") | |
504 | + | } | |
505 | + | else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)] | |
506 | + | (state ++ lpTrnsfr) | |
511 | 507 | } | |
512 | - | else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)] | |
513 | - | (estPut._9 ++ lpTrnsfr) | |
508 | + | else throw("Strict value is not equal to itself.") | |
514 | 509 | } | |
515 | 510 | else throw("Strict value is not equal to itself.") | |
516 | 511 | } | |
512 | + | else throw("Strict value is not equal to itself.") | |
517 | 513 | } | |
518 | 514 | } | |
519 | 515 | } | |
523 | 519 | @Callable(i) | |
524 | 520 | func putForFree (maxSlippage) = if ((0 > maxSlippage)) | |
525 | 521 | then throw("Invalid value passed") | |
526 | - | else { | |
527 | - | let estPut = commonPut(i, maxSlippage, false) | |
528 | - | estPut._9 | |
529 | - | } | |
522 | + | else if ((size(i.payments) != 2)) | |
523 | + | then throw("exactly 2 payments are expected") | |
524 | + | else { | |
525 | + | let estPut = commonPut(toString(i.caller), toBase58String(i.transactionId), AttachedPayment(value(i.payments[0]).assetId, value(i.payments[0]).amount), i.payments[1], maxSlippage, false) | |
526 | + | estPut._9 | |
527 | + | } | |
530 | 528 | ||
531 | 529 | ||
532 | 530 | ||
728 | 726 | ||
729 | 727 | ||
730 | 728 | @Callable(i) | |
731 | - | func estimatePutOperationWrapperREADONLY (txId58,slippage,inAmAmt,inAmId,inPrAmt,inPrId,userAddress,isEvaluate,emitLp | |
729 | + | func estimatePutOperationWrapperREADONLY (txId58,slippage,inAmAmt,inAmId,inPrAmt,inPrId,userAddress,isEvaluate,emitLp) = $Tuple2(nil, estimatePutOperation(txId58, slippage, inAmAmt, inAmId, inPrAmt, inPrId, userAddress, isEvaluate, emitLp)) | |
732 | 730 | ||
733 | 731 | ||
734 | 732 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let lPdecimals = 8 | |
5 | 5 | ||
6 | 6 | let scale8 = 100000000 | |
7 | 7 | ||
8 | 8 | let scale8BigInt = toBigInt(100000000) | |
9 | 9 | ||
10 | 10 | let calcError = toBigInt(1000000) | |
11 | 11 | ||
12 | 12 | let scale18 = toBigInt(1000000000000000000) | |
13 | 13 | ||
14 | 14 | let zeroBigInt = toBigInt(0) | |
15 | 15 | ||
16 | 16 | let oneBigInt = toBigInt(1) | |
17 | 17 | ||
18 | 18 | let SEP = "__" | |
19 | 19 | ||
20 | 20 | let EMPTY = "" | |
21 | 21 | ||
22 | 22 | let PoolActive = 1 | |
23 | 23 | ||
24 | 24 | let PoolPutDisabled = 2 | |
25 | 25 | ||
26 | 26 | let PoolMatcherDisabled = 3 | |
27 | 27 | ||
28 | 28 | let PoolShutdown = 4 | |
29 | 29 | ||
30 | 30 | let idxPoolAddress = 1 | |
31 | 31 | ||
32 | 32 | let idxPoolStatus = 2 | |
33 | 33 | ||
34 | 34 | let idxLPAsId = 3 | |
35 | 35 | ||
36 | 36 | let idxAmAsId = 4 | |
37 | 37 | ||
38 | 38 | let idxPrAsId = 5 | |
39 | 39 | ||
40 | 40 | let idxAmtAsDcm = 6 | |
41 | 41 | ||
42 | 42 | let idxPriceAsDcm = 7 | |
43 | 43 | ||
44 | 44 | let idxIAmtAsId = 8 | |
45 | 45 | ||
46 | 46 | let idxIPriceAsId = 9 | |
47 | 47 | ||
48 | 48 | let idxFactStakCntr = 1 | |
49 | 49 | ||
50 | 50 | let idxFactSlippCntr = 7 | |
51 | 51 | ||
52 | 52 | func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), scale18, toBigInt(origScaleMult)) | |
53 | 53 | ||
54 | 54 | ||
55 | 55 | func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), scale18)) | |
56 | 56 | ||
57 | 57 | ||
58 | 58 | func toScale (amt,resScale,curScale) = fraction(amt, resScale, curScale) | |
59 | 59 | ||
60 | 60 | ||
61 | 61 | func abs (val) = if ((zeroBigInt > val)) | |
62 | 62 | then -(val) | |
63 | 63 | else val | |
64 | 64 | ||
65 | 65 | ||
66 | 66 | func keyFactCntr () = "%s__factoryContract" | |
67 | 67 | ||
68 | 68 | ||
69 | 69 | func keyManagerPublicKey () = "%s__managerPublicKey" | |
70 | 70 | ||
71 | 71 | ||
72 | 72 | func keyPriceLast () = "%s%s__price__last" | |
73 | 73 | ||
74 | 74 | ||
75 | 75 | func keyPriceHistory (h,timestamp) = makeString(["%s%s%d%d__price__history", toString(h), toString(timestamp)], SEP) | |
76 | 76 | ||
77 | 77 | ||
78 | 78 | func keyPutActionByUser (userAddress,txId) = ((("%s%s%s__P__" + userAddress) + "__") + txId) | |
79 | 79 | ||
80 | 80 | ||
81 | 81 | func keyGetActionByUser (userAddress,txId) = ((("%s%s%s__G__" + userAddress) + "__") + txId) | |
82 | 82 | ||
83 | 83 | ||
84 | 84 | func keyAmtAsset () = "%s__amountAsset" | |
85 | 85 | ||
86 | 86 | ||
87 | 87 | func keyPriceAsset () = "%s__priceAsset" | |
88 | 88 | ||
89 | 89 | ||
90 | 90 | func keyFactoryConfig () = "%s__factoryConfig" | |
91 | 91 | ||
92 | 92 | ||
93 | 93 | func keyMatcherPub () = "%s%s__matcher__publicKey" | |
94 | 94 | ||
95 | 95 | ||
96 | 96 | func keyPoolConfig (iAmtAsset,iPriceAsset) = (((("%d%d%s__" + iAmtAsset) + "__") + iPriceAsset) + "__config") | |
97 | 97 | ||
98 | 98 | ||
99 | 99 | func keyMappingsBaseAsset2internalId (baseAssetStr) = ("%s%s%s__mappings__baseAsset2internalId__" + baseAssetStr) | |
100 | 100 | ||
101 | 101 | ||
102 | 102 | func keyAllPoolsShutdown () = "%s__shutdown" | |
103 | 103 | ||
104 | 104 | ||
105 | 105 | func keyPoolWeight (contractAddress) = ("%s%s__poolWeight__" + contractAddress) | |
106 | 106 | ||
107 | 107 | ||
108 | 108 | func throwOrderError (orderValid,senderValid,matcherValid) = throw(((((("order validation failed: orderValid=" + toString(orderValid)) + " senderValid=") + toString(senderValid)) + " matcherValid=") + toString(matcherValid))) | |
109 | 109 | ||
110 | 110 | ||
111 | 111 | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
112 | 112 | ||
113 | 113 | ||
114 | 114 | func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
115 | 115 | ||
116 | 116 | ||
117 | 117 | let factoryContract = addressFromStringValue(getStringOrFail(this, keyFactCntr())) | |
118 | 118 | ||
119 | 119 | func isGlobalShutdown () = valueOrElse(getBoolean(factoryContract, keyAllPoolsShutdown()), false) | |
120 | 120 | ||
121 | 121 | ||
122 | 122 | func getMatcherPubOrFail () = fromBase58String(getStringOrFail(factoryContract, keyMatcherPub())) | |
123 | 123 | ||
124 | 124 | ||
125 | 125 | func getPoolConfig () = { | |
126 | 126 | let amtAs = getStringOrFail(this, keyAmtAsset()) | |
127 | 127 | let priceAs = getStringOrFail(this, keyPriceAsset()) | |
128 | 128 | let iPriceAs = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(priceAs)) | |
129 | 129 | let iAmtAs = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(amtAs)) | |
130 | 130 | split(getStringOrFail(factoryContract, keyPoolConfig(toString(iAmtAs), toString(iPriceAs))), SEP) | |
131 | 131 | } | |
132 | 132 | ||
133 | 133 | ||
134 | 134 | func getFactoryConfig () = split(getStringOrFail(factoryContract, keyFactoryConfig()), SEP) | |
135 | 135 | ||
136 | 136 | ||
137 | 137 | func dataPutActionInfo (inAmtAssetAmt,inPriceAssetAmt,outLpAmt,price,slippageByUser,slippageReal,txHeight,txTimestamp,slipageAmAmt,slipagePrAmt) = makeString(["%d%d%d%d%d%d%d%d%d%d", toString(inAmtAssetAmt), toString(inPriceAssetAmt), toString(outLpAmt), toString(price), toString(slippageByUser), toString(slippageReal), toString(txHeight), toString(txTimestamp), toString(slipageAmAmt), toString(slipagePrAmt)], SEP) | |
138 | 138 | ||
139 | 139 | ||
140 | 140 | 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) | |
141 | 141 | ||
142 | 142 | ||
143 | 143 | func getAccBalance (assetId) = if ((assetId == "WAVES")) | |
144 | 144 | then wavesBalance(this).available | |
145 | 145 | else assetBalance(this, fromBase58String(assetId)) | |
146 | 146 | ||
147 | 147 | ||
148 | 148 | func calcPriceBigInt (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18) | |
149 | 149 | ||
150 | 150 | ||
151 | 151 | func privateCalcPrice (amAssetDcm,prAssetDcm,amAmt,prAmt) = { | |
152 | 152 | let amtAsAmtX18 = toX18(amAmt, amAssetDcm) | |
153 | 153 | let prAsAmtX18 = toX18(prAmt, prAssetDcm) | |
154 | 154 | calcPriceBigInt(prAsAmtX18, amtAsAmtX18) | |
155 | 155 | } | |
156 | 156 | ||
157 | 157 | ||
158 | 158 | func calcPrices (amAmt,prAmt,lpAmt) = { | |
159 | 159 | let cfg = getPoolConfig() | |
160 | 160 | let amtAsDcm = parseIntValue(cfg[idxAmtAsDcm]) | |
161 | 161 | let prAsDcm = parseIntValue(cfg[idxPriceAsDcm]) | |
162 | 162 | let priceX18 = privateCalcPrice(amtAsDcm, prAsDcm, amAmt, prAmt) | |
163 | 163 | let amAmtX18 = toX18(amAmt, amtAsDcm) | |
164 | 164 | let prAmtX18 = toX18(prAmt, prAsDcm) | |
165 | 165 | let lpAmtX18 = toX18(lpAmt, scale8) | |
166 | 166 | let lpPrInAmAsX18 = calcPriceBigInt(amAmtX18, lpAmtX18) | |
167 | 167 | let lpPrInPrAsX18 = calcPriceBigInt(prAmtX18, lpAmtX18) | |
168 | 168 | [priceX18, lpPrInAmAsX18, lpPrInPrAsX18] | |
169 | 169 | } | |
170 | 170 | ||
171 | 171 | ||
172 | 172 | func calculatePrices (amAmt,prAmt,lpAmt) = { | |
173 | 173 | let prices = calcPrices(amAmt, prAmt, lpAmt) | |
174 | 174 | [fromX18(prices[0], scale8), fromX18(prices[1], scale8), fromX18(prices[2], scale8)] | |
175 | 175 | } | |
176 | 176 | ||
177 | 177 | ||
178 | 178 | func estimateGetOperation (txId58,pmtAssetId,pmtLpAmt,userAddress) = { | |
179 | 179 | let cfg = getPoolConfig() | |
180 | 180 | let lpId = cfg[idxLPAsId] | |
181 | 181 | let amId = cfg[idxAmAsId] | |
182 | 182 | let prId = cfg[idxPrAsId] | |
183 | 183 | let amDcm = parseIntValue(cfg[idxAmtAsDcm]) | |
184 | 184 | let prDcm = parseIntValue(cfg[idxPriceAsDcm]) | |
185 | 185 | let poolStatus = cfg[idxPoolStatus] | |
186 | 186 | let lpEmission = valueOrErrorMessage(assetInfo(fromBase58String(lpId)), (("Asset " + lpId) + " doesn't exist")).quantity | |
187 | 187 | if ((lpId != pmtAssetId)) | |
188 | 188 | then throw("Invalid asset passed.") | |
189 | 189 | else { | |
190 | 190 | let amBalance = getAccBalance(amId) | |
191 | 191 | let amBalanceX18 = toX18(amBalance, amDcm) | |
192 | 192 | let prBalance = getAccBalance(prId) | |
193 | 193 | let prBalanceX18 = toX18(prBalance, prDcm) | |
194 | 194 | let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18) | |
195 | 195 | let curPrice = fromX18(curPriceX18, scale8) | |
196 | 196 | let pmtLpAmtX18 = toX18(pmtLpAmt, scale8) | |
197 | 197 | let lpEmissionX18 = toX18(lpEmission, scale8) | |
198 | 198 | let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissionX18) | |
199 | 199 | let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissionX18) | |
200 | 200 | let outAmAmt = fromX18(outAmAmtX18, amDcm) | |
201 | 201 | let outPrAmt = fromX18(outPrAmtX18, prDcm) | |
202 | 202 | let state = if ((txId58 == "")) | |
203 | 203 | then nil | |
204 | 204 | else [ScriptTransfer(userAddress, outAmAmt, if ((amId == "WAVES")) | |
205 | 205 | then unit | |
206 | 206 | else fromBase58String(amId)), ScriptTransfer(userAddress, outPrAmt, if ((prId == "WAVES")) | |
207 | 207 | then unit | |
208 | 208 | else fromBase58String(prId)), StringEntry(keyGetActionByUser(toString(userAddress), txId58), dataGetActionInfo(outAmAmt, outPrAmt, pmtLpAmt, curPrice, height, lastBlock.timestamp)), IntegerEntry(keyPriceLast(), curPrice), IntegerEntry(keyPriceHistory(height, lastBlock.timestamp), curPrice)] | |
209 | 209 | $Tuple10(outAmAmt, outPrAmt, amId, prId, amBalance, prBalance, lpEmission, curPriceX18, poolStatus, state) | |
210 | 210 | } | |
211 | 211 | } | |
212 | 212 | ||
213 | 213 | ||
214 | - | func estimatePutOperation (txId58, | |
214 | + | func estimatePutOperation (txId58,slippage,inAmAmt,inAmId,inPrAmt,inPrId,userAddress,isEvaluate,emitLp) = { | |
215 | 215 | let cfg = getPoolConfig() | |
216 | 216 | let lpId = fromBase58String(cfg[idxLPAsId]) | |
217 | 217 | let amIdStr = cfg[idxAmAsId] | |
218 | 218 | let prIdStr = cfg[idxPrAsId] | |
219 | 219 | let inAmIdStr = cfg[idxIAmtAsId] | |
220 | 220 | let inPrIdStr = cfg[idxIPriceAsId] | |
221 | 221 | let amtDcm = parseIntValue(cfg[idxAmtAsDcm]) | |
222 | 222 | let priceDcm = parseIntValue(cfg[idxPriceAsDcm]) | |
223 | 223 | let poolStatus = cfg[idxPoolStatus] | |
224 | - | let lpEmission = valueOrErrorMessage(assetInfo(lpId), | |
224 | + | let lpEmission = valueOrErrorMessage(assetInfo(lpId), "Wrong lp asset.").quantity | |
225 | 225 | let amBalance = if (isEvaluate) | |
226 | 226 | then getAccBalance(amIdStr) | |
227 | 227 | else (getAccBalance(amIdStr) - inAmAmt) | |
228 | 228 | let prBalance = if (isEvaluate) | |
229 | 229 | then getAccBalance(prIdStr) | |
230 | 230 | else (getAccBalance(prIdStr) - inPrAmt) | |
231 | 231 | let inAmAssetAmtX18 = toX18(inAmAmt, amtDcm) | |
232 | 232 | let inPrAssetAmtX18 = toX18(inPrAmt, priceDcm) | |
233 | 233 | let userPriceX18 = calcPriceBigInt(inPrAssetAmtX18, inAmAssetAmtX18) | |
234 | 234 | let amBalanceX18 = toX18(amBalance, amtDcm) | |
235 | 235 | let prBalanceX18 = toX18(prBalance, priceDcm) | |
236 | 236 | let res = if ((lpEmission == 0)) | |
237 | 237 | then { | |
238 | 238 | let curPriceX18 = zeroBigInt | |
239 | 239 | let slippageX18 = zeroBigInt | |
240 | 240 | let lpAmtX18 = pow((inAmAssetAmtX18 * inPrAssetAmtX18), 0, toBigInt(5), 1, 0, DOWN) | |
241 | 241 | $Tuple5(fromX18(lpAmtX18, scale8), fromX18(inAmAssetAmtX18, amtDcm), fromX18(inPrAssetAmtX18, priceDcm), calcPriceBigInt((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18) | |
242 | 242 | } | |
243 | 243 | else { | |
244 | - | let tRes = if (isOneAsset) | |
245 | - | then { | |
244 | + | let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18) | |
245 | + | let slippageRealX18 = fraction(abs((curPriceX18 - userPriceX18)), scale18, curPriceX18) | |
246 | + | let slippageX18 = toX18(slippage, scale8) | |
247 | + | if (if ((curPriceX18 != zeroBigInt)) | |
248 | + | then (slippageRealX18 > slippageX18) | |
249 | + | else false) | |
250 | + | then throw(((("Price slippage " + toString(slippageRealX18)) + " exceeded ") + toString(slippageX18))) | |
251 | + | else { | |
246 | 252 | let lpEmissionX18 = toX18(lpEmission, scale8) | |
247 | - | let sumInAssets = (inAmAssetAmtX18 + inPrAssetAmtX18) | |
248 | - | let sumPoolBalances = (amBalanceX18 + prBalanceX18) | |
249 | - | let lpAmtX18 = fraction(lpEmissionX18, sumInAssets, sumPoolBalances) | |
250 | - | let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18) | |
251 | - | $Tuple5(fromX18(lpAmtX18, scale8), inAmAmt, inPrAmt, curPriceX18, toBigInt(0)) | |
253 | + | let prViaAmX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18) | |
254 | + | let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18) | |
255 | + | let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18)) | |
256 | + | then $Tuple2(amViaPrX18, inPrAssetAmtX18) | |
257 | + | else $Tuple2(inAmAssetAmtX18, prViaAmX18) | |
258 | + | let expAmtAssetAmtX18 = expectedAmts._1 | |
259 | + | let expPriceAssetAmtX18 = expectedAmts._2 | |
260 | + | let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18) | |
261 | + | $Tuple5(fromX18(lpAmtX18, scale8), fromX18(expAmtAssetAmtX18, amtDcm), fromX18(expPriceAssetAmtX18, priceDcm), curPriceX18, slippageX18) | |
252 | 262 | } | |
253 | - | else { | |
254 | - | let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18) | |
255 | - | let slippageX18 = fraction(abs((curPriceX18 - userPriceX18)), scale18, curPriceX18) | |
256 | - | let slippageToleranceX18 = toX18(slippageTolerance, scale8) | |
257 | - | if (if ((curPriceX18 != zeroBigInt)) | |
258 | - | then (slippageX18 > slippageToleranceX18) | |
259 | - | else false) | |
260 | - | then throw(((("Price slippage " + toString(slippageX18)) + " exceeded the passed limit of ") + toString(slippageToleranceX18))) | |
261 | - | else { | |
262 | - | let lpEmissionX18 = toX18(lpEmission, scale8) | |
263 | - | let prViaAmX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18) | |
264 | - | let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18) | |
265 | - | let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18)) | |
266 | - | then $Tuple2(amViaPrX18, inPrAssetAmtX18) | |
267 | - | else $Tuple2(inAmAssetAmtX18, prViaAmX18) | |
268 | - | let expAmtAssetAmtX18 = expectedAmts._1 | |
269 | - | let expPriceAssetAmtX18 = expectedAmts._2 | |
270 | - | let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18) | |
271 | - | $Tuple5(fromX18(lpAmtX18, scale8), fromX18(expAmtAssetAmtX18, amtDcm), fromX18(expPriceAssetAmtX18, priceDcm), curPriceX18, slippageX18) | |
272 | - | } | |
273 | - | } | |
274 | - | tRes | |
275 | 263 | } | |
276 | 264 | let calcLpAmt = res._1 | |
277 | 265 | let calcAmAssetPmt = res._2 | |
278 | 266 | let calcPrAssetPmt = res._3 | |
279 | 267 | let curPrice = fromX18(res._4, scale8) | |
280 | 268 | let slippageCalc = fromX18(res._5, scale8) | |
281 | 269 | if ((0 >= calcLpAmt)) | |
282 | - | then throw(" | |
270 | + | then throw("LP is less than zero.") | |
283 | 271 | else { | |
284 | 272 | let emitLpAmt = if (!(emitLp)) | |
285 | 273 | then 0 | |
286 | 274 | else calcLpAmt | |
287 | 275 | let amDiff = (inAmAmt - calcAmAssetPmt) | |
288 | 276 | let prDiff = (inPrAmt - calcPrAssetPmt) | |
289 | - | let commonState = [IntegerEntry(keyPriceLast(), curPrice), IntegerEntry(keyPriceHistory(height, lastBlock.timestamp), curPrice), StringEntry(keyPutActionByUser(userAddress, txId58), dataPutActionInfo(calcAmAssetPmt, calcPrAssetPmt, emitLpAmt, curPrice, | |
277 | + | let commonState = [IntegerEntry(keyPriceLast(), curPrice), IntegerEntry(keyPriceHistory(height, lastBlock.timestamp), curPrice), StringEntry(keyPutActionByUser(userAddress, txId58), dataPutActionInfo(calcAmAssetPmt, calcPrAssetPmt, emitLpAmt, curPrice, slippage, slippageCalc, height, lastBlock.timestamp, amDiff, prDiff))] | |
290 | 278 | $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEmission, lpId, poolStatus, commonState, amDiff, prDiff, inAmId, inPrId) | |
291 | 279 | } | |
292 | 280 | } | |
293 | 281 | ||
294 | 282 | ||
295 | 283 | func validateMatcherOrderAllowed (order) = { | |
296 | 284 | let cfg = getPoolConfig() | |
297 | 285 | let amtAssetId = cfg[idxAmAsId] | |
298 | 286 | let priceAssetId = cfg[idxPrAsId] | |
299 | 287 | let poolStatus = parseIntValue(cfg[idxPoolStatus]) | |
300 | 288 | let amtAssetDcm = parseIntValue(cfg[idxAmtAsDcm]) | |
301 | 289 | let priceAssetDcm = parseIntValue(cfg[idxPriceAsDcm]) | |
302 | 290 | let accAmtAssetBalance = getAccBalance(amtAssetId) | |
303 | 291 | let accPriceAssetBalance = getAccBalance(priceAssetId) | |
304 | 292 | let curPriceX18 = if ((order.orderType == Buy)) | |
305 | 293 | then privateCalcPrice(amtAssetDcm, priceAssetDcm, (accAmtAssetBalance + order.amount), accPriceAssetBalance) | |
306 | 294 | else privateCalcPrice(amtAssetDcm, priceAssetDcm, (accAmtAssetBalance - order.amount), accPriceAssetBalance) | |
307 | 295 | let curPrice = fromX18(curPriceX18, scale8) | |
308 | 296 | if (if (if (isGlobalShutdown()) | |
309 | 297 | then true | |
310 | 298 | else (poolStatus == PoolMatcherDisabled)) | |
311 | 299 | then true | |
312 | 300 | else (poolStatus == PoolShutdown)) | |
313 | 301 | then throw("Exchange operations disabled") | |
314 | 302 | else { | |
315 | 303 | let orderAmtAsset = order.assetPair.amountAsset | |
316 | 304 | let orderAmtAssetStr = if ((orderAmtAsset == unit)) | |
317 | 305 | then "WAVES" | |
318 | 306 | else toBase58String(value(orderAmtAsset)) | |
319 | 307 | let orderPriceAsset = order.assetPair.priceAsset | |
320 | 308 | let orderPriceAssetStr = if ((orderPriceAsset == unit)) | |
321 | 309 | then "WAVES" | |
322 | 310 | else toBase58String(value(orderPriceAsset)) | |
323 | 311 | if (if ((orderAmtAssetStr != amtAssetId)) | |
324 | 312 | then true | |
325 | 313 | else (orderPriceAssetStr != priceAssetId)) | |
326 | 314 | then throw("Wrong order assets.") | |
327 | 315 | else { | |
328 | 316 | let orderPrice = order.price | |
329 | 317 | let priceDcm = fraction(scale8, priceAssetDcm, amtAssetDcm) | |
330 | 318 | let castedOrderPrice = toScale(orderPrice, scale8, priceDcm) | |
331 | 319 | let isOrderPriceValid = if ((order.orderType == Buy)) | |
332 | 320 | then (curPrice >= castedOrderPrice) | |
333 | 321 | else (castedOrderPrice >= curPrice) | |
334 | 322 | true | |
335 | 323 | } | |
336 | 324 | } | |
337 | 325 | } | |
338 | 326 | ||
339 | 327 | ||
340 | 328 | func commonGet (i) = if ((size(i.payments) != 1)) | |
341 | 329 | then throw("exactly 1 payment is expected") | |
342 | 330 | else { | |
343 | 331 | let pmt = value(i.payments[0]) | |
344 | 332 | let pmtAssetId = value(pmt.assetId) | |
345 | 333 | let pmtAmt = pmt.amount | |
346 | 334 | let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller) | |
347 | 335 | let outAmAmt = res._1 | |
348 | 336 | let outPrAmt = res._2 | |
349 | 337 | let poolStatus = parseIntValue(res._9) | |
350 | 338 | let state = res._10 | |
351 | 339 | if (if (isGlobalShutdown()) | |
352 | 340 | then true | |
353 | 341 | else (poolStatus == PoolShutdown)) | |
354 | 342 | then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus))) | |
355 | 343 | else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state) | |
356 | 344 | } | |
357 | 345 | ||
358 | 346 | ||
359 | - | func commonPut (i,slippageTolerance,emitLp) = if ((size(i.payments) != 2)) | |
360 | - | then throw("exactly 2 payments are expected") | |
361 | - | else { | |
362 | - | let amAssetPmt = value(i.payments[0]) | |
363 | - | let prAssetPmt = value(i.payments[1]) | |
364 | - | let estPut = estimatePutOperation(toBase58String(i.transactionId), slippageTolerance, amAssetPmt.amount, amAssetPmt.assetId, prAssetPmt.amount, prAssetPmt.assetId, toString(i.caller), false, emitLp, false) | |
365 | - | let status = parseIntValue(estPut._8) | |
366 | - | if (if (if (isGlobalShutdown()) | |
367 | - | then true | |
368 | - | else (status == PoolPutDisabled)) | |
369 | - | then true | |
370 | - | else (status == PoolShutdown)) | |
371 | - | then throw(("Put operation is blocked by admin. Status = " + toString(status))) | |
372 | - | else estPut | |
373 | - | } | |
347 | + | func commonPut (caller,txId,amAsPmt,prAsPmt,slippage,emitLp) = { | |
348 | + | let estPut = estimatePutOperation(txId, slippage, value(amAsPmt).amount, value(amAsPmt).assetId, value(prAsPmt).amount, value(prAsPmt).assetId, caller, false, emitLp) | |
349 | + | let status = parseIntValue(estPut._8) | |
350 | + | if (if (if (isGlobalShutdown()) | |
351 | + | then true | |
352 | + | else (status == PoolPutDisabled)) | |
353 | + | then true | |
354 | + | else (status == PoolShutdown)) | |
355 | + | then throw(("Put operation is blocked by admin. Status = " + toString(status))) | |
356 | + | else estPut | |
357 | + | } | |
374 | 358 | ||
375 | 359 | ||
376 | 360 | func calcD (a,b,lVal) = { | |
377 | 361 | let l = toBigInt(lVal) | |
378 | 362 | let val4 = toBigInt(4) | |
379 | 363 | let val2 = toBigInt(2) | |
380 | 364 | let val3 = toBigInt(3) | |
381 | 365 | let ApB = (a + b) | |
382 | 366 | let AmB = (a * b) | |
383 | 367 | let l41 = ((val4 * l) - oneBigInt) | |
384 | 368 | let lApBpow = pow((l * ApB), 0, val2, 0, 0, DOWN) | |
385 | 369 | let AmbL41pow = (AmB * pow((l41 / val3), 0, val3, 0, 0, DOWN)) | |
386 | 370 | let lAmpApb = ((l * AmB) * ApB) | |
387 | 371 | let rPart = (AmB * pow((AmbL41pow + lApBpow), 0, toBigInt(5), 1, 0, DOWN)) | |
388 | 372 | let M = (val2 * pow((lAmpApb + rPart), 0, toBigInt(333333), 6, 0, DOWN)) | |
389 | 373 | let divPart = (l41 / (val3 * M)) | |
390 | 374 | (((toBigInt(-4) * AmB) * divPart) + M) | |
391 | 375 | } | |
392 | 376 | ||
393 | 377 | ||
394 | 378 | @Callable(i) | |
395 | 379 | func constructor (factoryContract,managerPublicKey) = if ((i.caller != this)) | |
396 | 380 | then throw("permissions denied") | |
397 | 381 | else [StringEntry(keyFactCntr(), factoryContract), StringEntry(keyManagerPublicKey(), managerPublicKey)] | |
398 | 382 | ||
399 | 383 | ||
400 | 384 | ||
401 | 385 | @Callable(i) | |
402 | - | func put ( | |
386 | + | func put (slip,autoStake) = { | |
403 | 387 | let factCfg = getFactoryConfig() | |
404 | - | let stakingCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactStakCntr]), "Error. Incorrect staking address.") | |
405 | - | let slipCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactSlippCntr]), "Error. Incorrect slippage contract address.") | |
406 | - | if ((0 > slippage)) | |
407 | - | then throw("Invalid slippageTolerance passed") | |
408 | - | else { | |
409 | - | let estPut = commonPut(i, slippage, true) | |
410 | - | let emitLpAmt = estPut._2 | |
411 | - | let lpAssetId = estPut._7 | |
412 | - | let state = estPut._9 | |
413 | - | let amDiff = estPut._10 | |
414 | - | let prDiff = estPut._11 | |
415 | - | let amId = estPut._12 | |
416 | - | let prId = estPut._13 | |
417 | - | let emitInv = invoke(factoryContract, "emit", [emitLpAmt], nil) | |
418 | - | if ((emitInv == emitInv)) | |
419 | - | then { | |
420 | - | let slippageAInv = if ((amDiff > 0)) | |
421 | - | then invoke(slipCntr, "put", nil, [AttachedPayment(amId, amDiff)]) | |
422 | - | else nil | |
423 | - | if ((slippageAInv == slippageAInv)) | |
424 | - | then { | |
425 | - | let slippagePInv = if ((prDiff > 0)) | |
426 | - | then invoke(slipCntr, "put", nil, [AttachedPayment(prId, prDiff)]) | |
427 | - | else nil | |
428 | - | if ((slippagePInv == slippagePInv)) | |
429 | - | then { | |
430 | - | let lpTrnsfr = if (autoStake) | |
431 | - | then { | |
432 | - | let slpStakeInv = invoke(stakingCntr, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)]) | |
433 | - | if ((slpStakeInv == slpStakeInv)) | |
434 | - | then nil | |
435 | - | else throw("Strict value is not equal to itself.") | |
436 | - | } | |
437 | - | else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)] | |
438 | - | (state ++ lpTrnsfr) | |
439 | - | } | |
440 | - | else throw("Strict value is not equal to itself.") | |
441 | - | } | |
442 | - | else throw("Strict value is not equal to itself.") | |
443 | - | } | |
444 | - | else throw("Strict value is not equal to itself.") | |
445 | - | } | |
388 | + | let stakingCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactStakCntr]), "Incorrect staking address.") | |
389 | + | let slipCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactSlippCntr]), "Incorrect slippage address.") | |
390 | + | if ((0 > slip)) | |
391 | + | then throw("Invalid slippage.") | |
392 | + | else if ((size(i.payments) != 2)) | |
393 | + | then throw("2 payments are expected") | |
394 | + | else { | |
395 | + | let estPut = commonPut(toString(i.caller), toBase58String(i.transactionId), AttachedPayment(value(i.payments[0]).assetId, value(i.payments[0]).amount), i.payments[1], slip, true) | |
396 | + | let emitLpAmt = estPut._2 | |
397 | + | let lpAssetId = estPut._7 | |
398 | + | let state = estPut._9 | |
399 | + | let amDiff = estPut._10 | |
400 | + | let prDiff = estPut._11 | |
401 | + | let amId = estPut._12 | |
402 | + | let prId = estPut._13 | |
403 | + | let emitInv = invoke(factoryContract, "emit", [emitLpAmt], nil) | |
404 | + | if ((emitInv == emitInv)) | |
405 | + | then { | |
406 | + | let slippageAInv = if ((amDiff > 0)) | |
407 | + | then invoke(slipCntr, "put", nil, [AttachedPayment(amId, amDiff)]) | |
408 | + | else nil | |
409 | + | if ((slippageAInv == slippageAInv)) | |
410 | + | then { | |
411 | + | let slippagePInv = if ((prDiff > 0)) | |
412 | + | then invoke(slipCntr, "put", nil, [AttachedPayment(prId, prDiff)]) | |
413 | + | else nil | |
414 | + | if ((slippagePInv == slippagePInv)) | |
415 | + | then { | |
416 | + | let lpTrnsfr = if (autoStake) | |
417 | + | then { | |
418 | + | let slpStakeInv = invoke(stakingCntr, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)]) | |
419 | + | if ((slpStakeInv == slpStakeInv)) | |
420 | + | then nil | |
421 | + | else throw("Strict value is not equal to itself.") | |
422 | + | } | |
423 | + | else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)] | |
424 | + | (state ++ lpTrnsfr) | |
425 | + | } | |
426 | + | else throw("Strict value is not equal to itself.") | |
427 | + | } | |
428 | + | else throw("Strict value is not equal to itself.") | |
429 | + | } | |
430 | + | else throw("Strict value is not equal to itself.") | |
431 | + | } | |
446 | 432 | } | |
447 | 433 | ||
448 | 434 | ||
449 | 435 | ||
450 | 436 | @Callable(i) | |
451 | 437 | func putOneTkn (inAmtAmount,inPrAmount,autoStake) = { | |
452 | 438 | let cfg = getFactoryConfig() | |
453 | - | let stakingContract = valueOrErrorMessage(addressFromString(cfg[idxFactStakCntr]), "Error. Incorrect staking address.") | |
439 | + | let stakingCntr = valueOrErrorMessage(addressFromString(cfg[idxFactStakCntr]), "Wrong staking address") | |
440 | + | let slipCntr = valueOrErrorMessage(addressFromString(cfg[idxFactSlippCntr]), "Wrong slippage address") | |
454 | 441 | let poolCfg = getPoolConfig() | |
455 | 442 | let amId = poolCfg[idxAmAsId] | |
456 | 443 | let prId = poolCfg[idxPrAsId] | |
457 | 444 | let amDcm = parseIntValue(poolCfg[idxAmtAsDcm]) | |
458 | 445 | let prDcm = parseIntValue(poolCfg[idxPriceAsDcm]) | |
459 | 446 | if ((size(i.payments) != 1)) | |
460 | 447 | then throw("exactly 1 payment is expected") | |
461 | 448 | else { | |
462 | 449 | let pmt = value(i.payments[0]) | |
463 | 450 | let pmtAssetId = toBase58String(value(pmt.assetId)) | |
464 | 451 | let pmtAmt = pmt.amount | |
465 | 452 | let amAssetSwapX18 = toX18(inAmtAmount, amDcm) | |
466 | 453 | let prAssetSwapX18 = toX18(inPrAmount, prDcm) | |
467 | - | let inPrice = calcPriceBigInt(prAssetSwapX18, amAssetSwapX18) | |
468 | 454 | let amBalance = getAccBalance(amId) | |
469 | - | let amBalanceX18 = toX18(amBalance, amDcm) | |
470 | 455 | let prBalance = getAccBalance(prId) | |
471 | - | let prBalanceX18 = toX18(prBalance, prDcm) | |
472 | 456 | let dCur = calcD(toBigInt(amBalance), toBigInt(prBalance), 50) | |
473 | 457 | let isValid = if ((pmtAssetId == amId)) | |
474 | 458 | then { | |
475 | 459 | let pmtAmtX18 = toX18(pmtAmt, amDcm) | |
476 | 460 | let prAdiff = prAssetSwapX18 | |
477 | 461 | let amAdiff = (pmtAmtX18 - amAssetSwapX18) | |
478 | - | let dNew = calcD((toBigInt(amBalance) - toBigInt(fromX18(amAdiff, amDcm))), (toBigInt(prBalance) + toBigInt(fromX18(prAdiff, prDcm))), 50) | |
479 | - | true | |
462 | + | let dSwap = calcD((toBigInt(amBalance) + toBigInt(fromX18(amAdiff, amDcm))), (toBigInt(prBalance) - toBigInt(fromX18(prAdiff, prDcm))), 50) | |
463 | + | if ((dSwap > dCur)) | |
464 | + | then throw("Incorrect argiments passed. Deposit lead to D decrease.") | |
465 | + | else true | |
480 | 466 | } | |
481 | 467 | else { | |
482 | 468 | let pmtPrX18 = toX18(pmtAmt, prDcm) | |
483 | 469 | let prAdiff = (prAssetSwapX18 - pmtPrX18) | |
484 | 470 | let amAdiff = amAssetSwapX18 | |
485 | - | let dNew = calcD((toBigInt(amBalance) + toBigInt(fromX18(amAdiff, amDcm))), (toBigInt(prBalance) - toBigInt(fromX18(prAdiff, prDcm))), 50) | |
486 | - | true | |
471 | + | let dNew = calcD((toBigInt(amBalance) - toBigInt(fromX18(amAdiff, amDcm))), (toBigInt(prBalance) + toBigInt(fromX18(prAdiff, prDcm))), 50) | |
472 | + | if ((dNew > dCur)) | |
473 | + | then throw("Wrong arguments passed. D decreased.") | |
474 | + | else true | |
487 | 475 | } | |
488 | 476 | if (!(isValid)) | |
489 | 477 | then throw("Errors.") | |
490 | 478 | else { | |
491 | - | let estPut = | |
479 | + | let estPut = commonPut(toString(i.caller), toBase58String(i.transactionId), AttachedPayment(fromBase58String(amId), inAmtAmount), AttachedPayment(fromBase58String(prId), inPrAmount), 50000000000, true) | |
492 | 480 | let emitLpAmt = estPut._2 | |
493 | 481 | let lpAssetId = estPut._7 | |
494 | - | let | |
495 | - | | |
496 | - | | |
497 | - | | |
498 | - | | |
499 | - | | |
500 | - | | |
501 | - | | |
502 | - | | |
503 | - | if (( | |
482 | + | let state = estPut._9 | |
483 | + | let amDiff = estPut._10 | |
484 | + | let prDiff = estPut._11 | |
485 | + | let emitInv = invoke(factoryContract, "emit", [emitLpAmt], nil) | |
486 | + | if ((emitInv == emitInv)) | |
487 | + | then { | |
488 | + | let slippageAInv = if ((amDiff > 0)) | |
489 | + | then invoke(slipCntr, "put", nil, [AttachedPayment(fromBase58String(amId), amDiff)]) | |
490 | + | else nil | |
491 | + | if ((slippageAInv == slippageAInv)) | |
504 | 492 | then { | |
505 | - | let lpTrnsfr = if (autoStake) | |
493 | + | let slippagePInv = if ((prDiff > 0)) | |
494 | + | then invoke(slipCntr, "put", nil, [AttachedPayment(fromBase58String(prId), prDiff)]) | |
495 | + | else nil | |
496 | + | if ((slippagePInv == slippagePInv)) | |
506 | 497 | then { | |
507 | - | let stakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)]) | |
508 | - | if ((stakeInv == stakeInv)) | |
509 | - | then nil | |
510 | - | else throw("Strict value is not equal to itself.") | |
498 | + | let lpTrnsfr = if (autoStake) | |
499 | + | then { | |
500 | + | let slpStakeInv = invoke(stakingCntr, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)]) | |
501 | + | if ((slpStakeInv == slpStakeInv)) | |
502 | + | then nil | |
503 | + | else throw("Strict value is not equal to itself.") | |
504 | + | } | |
505 | + | else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)] | |
506 | + | (state ++ lpTrnsfr) | |
511 | 507 | } | |
512 | - | else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)] | |
513 | - | (estPut._9 ++ lpTrnsfr) | |
508 | + | else throw("Strict value is not equal to itself.") | |
514 | 509 | } | |
515 | 510 | else throw("Strict value is not equal to itself.") | |
516 | 511 | } | |
512 | + | else throw("Strict value is not equal to itself.") | |
517 | 513 | } | |
518 | 514 | } | |
519 | 515 | } | |
520 | 516 | ||
521 | 517 | ||
522 | 518 | ||
523 | 519 | @Callable(i) | |
524 | 520 | func putForFree (maxSlippage) = if ((0 > maxSlippage)) | |
525 | 521 | then throw("Invalid value passed") | |
526 | - | else { | |
527 | - | let estPut = commonPut(i, maxSlippage, false) | |
528 | - | estPut._9 | |
529 | - | } | |
522 | + | else if ((size(i.payments) != 2)) | |
523 | + | then throw("exactly 2 payments are expected") | |
524 | + | else { | |
525 | + | let estPut = commonPut(toString(i.caller), toBase58String(i.transactionId), AttachedPayment(value(i.payments[0]).assetId, value(i.payments[0]).amount), i.payments[1], maxSlippage, false) | |
526 | + | estPut._9 | |
527 | + | } | |
530 | 528 | ||
531 | 529 | ||
532 | 530 | ||
533 | 531 | @Callable(i) | |
534 | 532 | func get () = { | |
535 | 533 | let res = commonGet(i) | |
536 | 534 | let outAmtAmt = res._1 | |
537 | 535 | let outPrAmt = res._2 | |
538 | 536 | let pmtAmt = res._3 | |
539 | 537 | let pmtAssetId = res._4 | |
540 | 538 | let state = res._5 | |
541 | 539 | let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
542 | 540 | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
543 | 541 | then state | |
544 | 542 | else throw("Strict value is not equal to itself.") | |
545 | 543 | } | |
546 | 544 | ||
547 | 545 | ||
548 | 546 | ||
549 | 547 | @Callable(i) | |
550 | 548 | func getOneTkn (amAssetSwap,prAssetSwap,outAmount,outAssetId) = if ((size(i.payments) != 1)) | |
551 | 549 | then throw("exactly 1 payment is expected") | |
552 | 550 | else { | |
553 | 551 | let cfg = getPoolConfig() | |
554 | 552 | let lpId = cfg[idxLPAsId] | |
555 | 553 | let amId = cfg[idxAmAsId] | |
556 | 554 | let prId = cfg[idxPrAsId] | |
557 | 555 | let amDcm = parseIntValue(cfg[idxAmtAsDcm]) | |
558 | 556 | let prDcm = parseIntValue(cfg[idxPriceAsDcm]) | |
559 | 557 | let poolStatus = cfg[idxPoolStatus] | |
560 | 558 | if (if ((outAssetId != amId)) | |
561 | 559 | then (outAssetId != prId) | |
562 | 560 | else false) | |
563 | 561 | then throw(("Incorrect out asset id passed: " + outAssetId)) | |
564 | 562 | else { | |
565 | 563 | let resultAssetId = if ((outAssetId == amId)) | |
566 | 564 | then amId | |
567 | 565 | else prId | |
568 | 566 | let resultAmtAmount = if ((outAssetId == amId)) | |
569 | 567 | then outAmount | |
570 | 568 | else 0 | |
571 | 569 | let resultPrAmount = if ((outAssetId == prId)) | |
572 | 570 | then outAmount | |
573 | 571 | else 0 | |
574 | 572 | let pmt = value(i.payments[0]) | |
575 | 573 | let userAddress = i.caller | |
576 | 574 | let txId58 = toBase58String(i.transactionId) | |
577 | 575 | let pmtAssetId = value(pmt.assetId) | |
578 | 576 | let pmtAmt = pmt.amount | |
579 | 577 | if ((lpId != toBase58String(pmtAssetId))) | |
580 | 578 | then throw("Invalid asset passed.") | |
581 | 579 | else { | |
582 | 580 | let amAssetSwapX18 = toX18(amAssetSwap, amDcm) | |
583 | 581 | let prAssetSwapX18 = toX18(prAssetSwap, prDcm) | |
584 | 582 | let swapPriceX18 = calcPriceBigInt(prAssetSwapX18, amAssetSwapX18) | |
585 | 583 | let r = estimateGetOperation(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller) | |
586 | 584 | let outAmAmt = r._1 | |
587 | 585 | let outPrAmt = r._2 | |
588 | 586 | let totalR = if ((outAssetId == amId)) | |
589 | 587 | then { | |
590 | 588 | let prSwopPartInAmountAsset = (resultAmtAmount - outAmAmt) | |
591 | 589 | let convRes = fraction(toX18(prSwopPartInAmountAsset, amDcm), swapPriceX18, scale18) | |
592 | 590 | let prAssetDiff = fraction((convRes - prAssetSwapX18), scale8BigInt, prAssetSwapX18) | |
593 | 591 | let amtAsRes = fromX18(fraction(toX18(outPrAmt, prDcm), scale18, swapPriceX18), amDcm) | |
594 | 592 | if (if ((prAssetDiff > calcError)) | |
595 | 593 | then true | |
596 | 594 | else (-(calcError) > prAssetDiff)) | |
597 | 595 | then throw(((("Slippage exeeded the value " + toString(calcError)) + " and equal to ") + toString(prAssetDiff))) | |
598 | 596 | else (amtAsRes + outAmAmt) | |
599 | 597 | } | |
600 | 598 | else { | |
601 | 599 | let amSwopPartInPriceAsset = (resultPrAmount - outPrAmt) | |
602 | 600 | let convRes = fraction(toX18(amSwopPartInPriceAsset, amDcm), scale18, swapPriceX18) | |
603 | 601 | let prAsRes = fromX18(fraction(toX18(outAmAmt, amDcm), swapPriceX18, scale18), prDcm) | |
604 | 602 | let amAssetDiff = fraction((convRes - amAssetSwapX18), scale8BigInt, amAssetSwapX18) | |
605 | 603 | if (if ((amAssetDiff > calcError)) | |
606 | 604 | then true | |
607 | 605 | else (-(calcError) > amAssetDiff)) | |
608 | 606 | then throw(((("Slippage exeeded the value " + toString(calcError)) + " and equal to ") + toString(amAssetDiff))) | |
609 | 607 | else (prAsRes + outPrAmt) | |
610 | 608 | } | |
611 | 609 | let amBalance = getAccBalance(amId) | |
612 | 610 | let amBalanceX18 = toX18(amBalance, amDcm) | |
613 | 611 | let prBalance = getAccBalance(prId) | |
614 | 612 | let prBalanceX18 = toX18(prBalance, prDcm) | |
615 | 613 | let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18) | |
616 | 614 | let curPrice = fromX18(curPriceX18, scale8) | |
617 | 615 | let state = [ScriptTransfer(userAddress, totalR, if ((resultAssetId == "WAVES")) | |
618 | 616 | then unit | |
619 | 617 | else fromBase58String(resultAssetId)), StringEntry(keyGetActionByUser(toString(userAddress), txId58), dataGetActionInfo(resultAmtAmount, resultPrAmount, pmtAmt, curPrice, height, lastBlock.timestamp)), IntegerEntry(keyPriceLast(), curPrice), IntegerEntry(keyPriceHistory(height, lastBlock.timestamp), curPrice)] | |
620 | 618 | let burn = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
621 | 619 | if ((burn == burn)) | |
622 | 620 | then state | |
623 | 621 | else throw("Strict value is not equal to itself.") | |
624 | 622 | } | |
625 | 623 | } | |
626 | 624 | } | |
627 | 625 | ||
628 | 626 | ||
629 | 627 | ||
630 | 628 | @Callable(i) | |
631 | 629 | func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = { | |
632 | 630 | let res = commonGet(i) | |
633 | 631 | let outAmAmt = res._1 | |
634 | 632 | let outPrAmt = res._2 | |
635 | 633 | let pmtAmt = res._3 | |
636 | 634 | let pmtAssetId = res._4 | |
637 | 635 | let state = res._5 | |
638 | 636 | if ((noLessThenAmtAsset > outAmAmt)) | |
639 | 637 | then throw(((("noLessThenAmtAsset failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset))) | |
640 | 638 | else if ((noLessThenPriceAsset > outPrAmt)) | |
641 | 639 | then throw(((("noLessThenPriceAsset failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset))) | |
642 | 640 | else { | |
643 | 641 | let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
644 | 642 | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
645 | 643 | then state | |
646 | 644 | else throw("Strict value is not equal to itself.") | |
647 | 645 | } | |
648 | 646 | } | |
649 | 647 | ||
650 | 648 | ||
651 | 649 | ||
652 | 650 | @Callable(i) | |
653 | 651 | func unstakeAndGet (amount) = { | |
654 | 652 | let checkPayments = if ((size(i.payments) != 0)) | |
655 | 653 | then throw("No payments are expected") | |
656 | 654 | else true | |
657 | 655 | if ((checkPayments == checkPayments)) | |
658 | 656 | then { | |
659 | 657 | let cfg = getPoolConfig() | |
660 | 658 | let factoryCfg = getFactoryConfig() | |
661 | 659 | let lpAssetId = fromBase58String(cfg[idxLPAsId]) | |
662 | 660 | let stakingContract = valueOrErrorMessage(addressFromString(factoryCfg[idxFactStakCntr]), "Error. Incorrect staking address.") | |
663 | 661 | let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(lpAssetId), amount], nil) | |
664 | 662 | if ((unstakeInv == unstakeInv)) | |
665 | 663 | then { | |
666 | 664 | let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller) | |
667 | 665 | let poolStatus = parseIntValue(res._9) | |
668 | 666 | let state = res._10 | |
669 | 667 | let checkPoolStatus = if (if (isGlobalShutdown()) | |
670 | 668 | then true | |
671 | 669 | else (poolStatus == PoolShutdown)) | |
672 | 670 | then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus))) | |
673 | 671 | else true | |
674 | 672 | if ((checkPoolStatus == checkPoolStatus)) | |
675 | 673 | then { | |
676 | 674 | let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)]) | |
677 | 675 | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
678 | 676 | then state | |
679 | 677 | else throw("Strict value is not equal to itself.") | |
680 | 678 | } | |
681 | 679 | else throw("Strict value is not equal to itself.") | |
682 | 680 | } | |
683 | 681 | else throw("Strict value is not equal to itself.") | |
684 | 682 | } | |
685 | 683 | else throw("Strict value is not equal to itself.") | |
686 | 684 | } | |
687 | 685 | ||
688 | 686 | ||
689 | 687 | ||
690 | 688 | @Callable(i) | |
691 | 689 | func activate (amtAssetStr,priceAssetStr) = if ((toString(i.caller) != toString(factoryContract))) | |
692 | 690 | then throw("permissions denied") | |
693 | 691 | else $Tuple2([StringEntry(keyAmtAsset(), amtAssetStr), StringEntry(keyPriceAsset(), priceAssetStr)], "success") | |
694 | 692 | ||
695 | 693 | ||
696 | 694 | ||
697 | 695 | @Callable(i) | |
698 | 696 | func getPoolConfigWrapperREADONLY () = $Tuple2(nil, getPoolConfig()) | |
699 | 697 | ||
700 | 698 | ||
701 | 699 | ||
702 | 700 | @Callable(i) | |
703 | 701 | func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId)) | |
704 | 702 | ||
705 | 703 | ||
706 | 704 | ||
707 | 705 | @Callable(i) | |
708 | 706 | func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = { | |
709 | 707 | let prices = calcPrices(amAmt, prAmt, lpAmt) | |
710 | 708 | $Tuple2(nil, [toString(prices[0]), toString(prices[1]), toString(prices[2])]) | |
711 | 709 | } | |
712 | 710 | ||
713 | 711 | ||
714 | 712 | ||
715 | 713 | @Callable(i) | |
716 | 714 | func fromX18WrapperREADONLY (val,resultScaleMult) = $Tuple2(nil, fromX18(parseBigIntValue(val), resultScaleMult)) | |
717 | 715 | ||
718 | 716 | ||
719 | 717 | ||
720 | 718 | @Callable(i) | |
721 | 719 | func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(toX18(origVal, origScaleMult))) | |
722 | 720 | ||
723 | 721 | ||
724 | 722 | ||
725 | 723 | @Callable(i) | |
726 | 724 | func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(calcPriceBigInt(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18)))) | |
727 | 725 | ||
728 | 726 | ||
729 | 727 | ||
730 | 728 | @Callable(i) | |
731 | - | func estimatePutOperationWrapperREADONLY (txId58,slippage,inAmAmt,inAmId,inPrAmt,inPrId,userAddress,isEvaluate,emitLp | |
729 | + | func estimatePutOperationWrapperREADONLY (txId58,slippage,inAmAmt,inAmId,inPrAmt,inPrId,userAddress,isEvaluate,emitLp) = $Tuple2(nil, estimatePutOperation(txId58, slippage, inAmAmt, inAmId, inPrAmt, inPrId, userAddress, isEvaluate, emitLp)) | |
732 | 730 | ||
733 | 731 | ||
734 | 732 | ||
735 | 733 | @Callable(i) | |
736 | 734 | func estimateGetOperationWrapperREADONLY (txId58,pmtAssetId,pmtLpAmt,userAddress) = { | |
737 | 735 | let res = estimateGetOperation(txId58, pmtAssetId, pmtLpAmt, addressFromStringValue(userAddress)) | |
738 | 736 | $Tuple2(nil, $Tuple10(res._1, res._2, res._3, res._4, res._5, res._6, res._7, toString(res._8), res._9, res._10)) | |
739 | 737 | } | |
740 | 738 | ||
741 | 739 | ||
742 | 740 | @Verifier(tx) | |
743 | 741 | func verify () = match tx { | |
744 | 742 | case order: Order => | |
745 | 743 | let matcherPub = getMatcherPubOrFail() | |
746 | 744 | let orderValid = validateMatcherOrderAllowed(order) | |
747 | 745 | let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey) | |
748 | 746 | let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub) | |
749 | 747 | if (if (if (orderValid) | |
750 | 748 | then senderValid | |
751 | 749 | else false) | |
752 | 750 | then matcherValid | |
753 | 751 | else false) | |
754 | 752 | then true | |
755 | 753 | else throwOrderError(orderValid, senderValid, matcherValid) | |
756 | 754 | case _ => | |
757 | 755 | let managerPublic = valueOrElse(getString(this, keyManagerPublicKey()), EMPTY) | |
758 | 756 | if ((managerPublic == EMPTY)) | |
759 | 757 | then sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
760 | 758 | else sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(managerPublic)) | |
761 | 759 | } | |
762 | 760 |
github/deemru/w8io/169f3d6 108.38 ms ◑