tx · 79LADoxXsFaXz7rTQDTqghpKxrsYNqA8LD1UNbL98FQY

3MsXwm6KeMva32skLvFrFfYYmcxT2ZDc4fD:  -0.03500000 Waves

2022.12.07 16:01 [2349956] smart account 3MsXwm6KeMva32skLvFrFfYYmcxT2ZDc4fD > SELF 0.00000000 Waves

{ "type": 13, "id": "79LADoxXsFaXz7rTQDTqghpKxrsYNqA8LD1UNbL98FQY", "fee": 3500000, "feeAssetId": null, "timestamp": 1670417909386, "version": 1, "sender": "3MsXwm6KeMva32skLvFrFfYYmcxT2ZDc4fD", "senderPublicKey": "33aHdznSeq5cGxgbnLJ54tzNfiqS5SCQYHgFGMFsNQzs", "proofs": [ "57sYJ1TteeE4kDFf415PFR5a99R8DAyCnJ7wc7TAc6kew27CHbwJWeeUUn8vVM6frGV4Jh2ChHD3vQ7Cs9Vt4xcv" ], "script": "base64:BgL1LAgCEgMKAQgSABIECgIBBBIDCgEBEgQKAgEEEgQKAggBEgQKAggBEgQKAggBEgUKAwEIARIAEgQKAgEBEgMKAQESBQoDAQEBEgQKAggIEgASABIDCgEIEgUKAwEBARIECgIBARIECgIIARIECgIICBILCgkIAQECAQIIBAQSBgoECAgBCBIAEgMKAQESAwoBARIECgIIASIKbFBkZWNpbWFscyIGc2NhbGU4IgxzY2FsZThCaWdJbnQiB3NjYWxlMTgiCnplcm9CaWdJbnQiBGJpZzAiBGJpZzEiBGJpZzIiC3dhdmVzU3RyaW5nIgNTRVAiClBvb2xBY3RpdmUiD1Bvb2xQdXREaXNhYmxlZCITUG9vbE1hdGNoZXJEaXNhYmxlZCIMUG9vbFNodXRkb3duIg5pZHhQb29sQWRkcmVzcyINaWR4UG9vbFN0YXR1cyIQaWR4UG9vbExQQXNzZXRJZCINaWR4QW10QXNzZXRJZCIPaWR4UHJpY2VBc3NldElkIg5pZHhBbXRBc3NldERjbSIQaWR4UHJpY2VBc3NldERjbSIOaWR4SUFtdEFzc2V0SWQiEGlkeElQcmljZUFzc2V0SWQiDWlkeExQQXN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l0ZXMJAJEDAggFAmd6BnByb29mcwAABQJnQkW6zQo=", "chainId": 84, "height": 2349956, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: A2fdihdySW1PiP2UCBFjNFRSezX3fApvi5JRU7F7gQcp Next: 246VTTXJZiSaVsGcPJtzL9kFE9Uv6rg6iMG3zSc5bB2j Diff:
OldNewDifferences
342342 then throw(((("Price slippage " + toString(slippageX18)) + " exceeded the passed limit of ") + toString(slippageToleranceX18)))
343343 else {
344344 let lpEmissionX18 = toX18(lpEmission, scale8)
345- let prViaAmX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18)
346- let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
345+ let prViaAmX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18, CEILING)
346+ let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18, CEILING)
347347 let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18))
348348 then $Tuple2(amViaPrX18, inPrAssetAmtX18)
349349 else $Tuple2(inAmAssetAmtX18, prViaAmX18)
374374
375375
376376 func calcKLp (amountBalance,priceBalance,lpEmission) = {
377- let updatedKLp = fraction(pow((amountBalance * priceBalance), 0, toBigInt(5), 1, 12, DOWN), big1, lpEmission)
377+ let updatedKLp = fraction(pow((amountBalance * priceBalance), 0, toBigInt(5), 1, 18, DOWN), big1, lpEmission)
378378 if ((lpEmission == big0))
379379 then big0
380380 else updatedKLp
408408 func validateMatcherOrderAllowed (order) = {
409409 let amountAssetAmount = order.amount
410410 let priceAssetAmount = fraction(order.amount, order.price, scale8, FLOOR)
411- let $t02034120553 = if ((order.orderType == Buy))
411+ let $t02035920571 = if ((order.orderType == Buy))
412412 then $Tuple2(amountAssetAmount, -(priceAssetAmount))
413413 else $Tuple2(-(amountAssetAmount), priceAssetAmount)
414- let amountAssetBalanceDelta = $t02034120553._1
415- let priceAssetBalanceDelta = $t02034120553._2
414+ let amountAssetBalanceDelta = $t02035920571._1
415+ let priceAssetBalanceDelta = $t02035920571._2
416416 if (if (if (isGlobalShutdown())
417417 then true
418418 else (cfgPoolStatus == PoolMatcherDisabled))
425425 then throw("Wrong order assets.")
426426 else {
427427 let kLp = valueOrErrorMessage(parseBigInt(valueOrErrorMessage(getString(this, keyKLp), fmtErr("kLp is required"))), fmtErr("invalid kLp"))
428- let $t02102421124 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
429- let unusedActions = $t02102421124._1
430- let kLpNew = $t02102421124._2
428+ let $t02104221142 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
429+ let unusedActions = $t02104221142._1
430+ let kLpNew = $t02104221142._2
431431 let isOrderValid = (kLpNew >= kLp)
432432 isOrderValid
433433 }
503503 else if ((paymentAssetId == cfgPriceAssetId))
504504 then false
505505 else throwErr("invalid asset")
506- let $t02380924102 = if (isEval)
506+ let $t02382724120 = if (isEval)
507507 then $Tuple2(amountBalanceRaw, priceBalanceRaw)
508508 else if (paymentInAmountAsset)
509509 then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw)
510510 else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw))
511- let amountBalanceOld = $t02380924102._1
512- let priceBalanceOld = $t02380924102._2
513- let $t02410624255 = if (paymentInAmountAsset)
511+ let amountBalanceOld = $t02382724120._1
512+ let priceBalanceOld = $t02382724120._2
513+ let $t02412424273 = if (paymentInAmountAsset)
514514 then $Tuple2(paymentAmountRaw, 0)
515515 else $Tuple2(0, paymentAmountRaw)
516- let amountAssetAmountRaw = $t02410624255._1
517- let priceAssetAmountRaw = $t02410624255._2
516+ let amountAssetAmountRaw = $t02412424273._1
517+ let priceAssetAmountRaw = $t02412424273._2
518518 let amountAssetAmount = takeFee(amountAssetAmountRaw)._1
519519 let priceAssetAmount = takeFee(priceAssetAmountRaw)._1
520- let $t02437724436 = takeFee(paymentAmountRaw)
521- let paymentAmount = $t02437724436._1
522- let feeAmount = $t02437724436._2
520+ let $t02439524454 = takeFee(paymentAmountRaw)
521+ let paymentAmount = $t02439524454._1
522+ let feeAmount = $t02439524454._2
523523 let amountBalanceNew = (amountBalanceOld + amountAssetAmount)
524524 let priceBalanceNew = (priceBalanceOld + priceAssetAmount)
525525 let priceNewX18 = calcPriceBigInt(toX18(priceBalanceNew, cfgPriceAssetDecimals), toX18(amountBalanceNew, cfgAmountAssetDecimals))
542542 let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, cfgPriceAssetDecimals), toX18(amountBalanceOld, cfgAmountAssetDecimals))
543543 let priceOld = fromX18(priceOldX18, scale8)
544544 let loss = {
545- let $t02591326080 = if (paymentInAmountAsset)
545+ let $t02593126098 = if (paymentInAmountAsset)
546546 then $Tuple2(amountAssetAmountRaw, amountBalanceOld)
547547 else $Tuple2(priceAssetAmountRaw, priceBalanceOld)
548- let amount = $t02591326080._1
549- let balance = $t02591326080._2
548+ let amount = $t02593126098._1
549+ let balance = $t02593126098._2
550550 let issueAmountBoth = toInt(fraction(supplyBigInt, toBigInt((amount / 2)), toBigInt(balance)))
551551 fraction((issueAmount - issueAmountBoth), scale8, issueAmountBoth)
552552 }
580580 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
581581 let redeemedBigInt = toBigInt(paymentAmount)
582582 let amountRaw = max([0, toInt(((balanceBigInt * (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN))) / scale18))])
583- let $t02768227732 = takeFee(amountRaw)
584- let totalAmount = $t02768227732._1
585- let feeAmount = $t02768227732._2
586- let $t02773627962 = if (outInAmountAsset)
583+ let $t02770027750 = takeFee(amountRaw)
584+ let totalAmount = $t02770027750._1
585+ let feeAmount = $t02770027750._2
586+ let $t02775427980 = if (outInAmountAsset)
587587 then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld)
588588 else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw))
589- let outAmAmount = $t02773627962._1
590- let outPrAmount = $t02773627962._2
591- let amBalanceNew = $t02773627962._3
592- let prBalanceNew = $t02773627962._4
589+ let outAmAmount = $t02775427980._1
590+ let outPrAmount = $t02775427980._2
591+ let amBalanceNew = $t02775427980._3
592+ let prBalanceNew = $t02775427980._4
593593 let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, cfgPriceAssetDecimals), toX18(amBalanceNew, cfgAmountAssetDecimals))
594594 let priceNew = fromX18(priceNewX18, scale8)
595595 let commonState = if (isEval)
747747 let lpAssetEmissionAfter = value(assetInfo(cfgLpAssetId)).quantity
748748 if ((lpAssetEmissionAfter == lpAssetEmissionAfter))
749749 then {
750- let $t03248232550 = refreshKLpInternal(0, 0, 0)
751- if (($t03248232550 == $t03248232550))
750+ let $t03250032568 = refreshKLpInternal(0, 0, 0)
751+ if (($t03250032568 == $t03250032568))
752752 then {
753- let updatedKLp = $t03248232550._2
754- let refreshKLpActions = $t03248232550._1
753+ let updatedKLp = $t03250032568._2
754+ let refreshKLpActions = $t03250032568._1
755755 let error = throwErr(makeString([toString(amountAssetBalance), toString(priceAssetBalance), toString(lpAssetEmission), toString(currentKLp), toString(updatedKLp), toString(emitLpAmt), toString(amDiff), toString(prDiff), toString(lpAssetEmission), toString(lpAssetEmissionAfter)], " "))
756756 if ((error == error))
757757 then {
796796 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
797797 if ((currentKLp == currentKLp))
798798 then {
799- let $t03348233547 = refreshKLpInternal(0, 0, 0)
800- let refreshKLpActions = $t03348233547._1
801- let updatedKLp = $t03348233547._2
799+ let $t03350033565 = refreshKLpInternal(0, 0, 0)
800+ let refreshKLpActions = $t03350033565._1
801+ let updatedKLp = $t03350033565._2
802802 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
803803 if ((isUpdatedKLpValid == isUpdatedKLpValid))
804804 then (state ++ refreshKLpActions)
843843 else throwErr("payment asset is not supported")
844844 let userAddress = i.caller
845845 let txId = i.transactionId
846- let $t03473234884 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
847- if (($t03473234884 == $t03473234884))
846+ let $t03475034902 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
847+ if (($t03475034902 == $t03475034902))
848848 then {
849- let paymentInAmountAsset = $t03473234884._5
850- let bonus = $t03473234884._4
851- let feeAmount = $t03473234884._3
852- let commonState = $t03473234884._2
853- let emitAmountEstimated = $t03473234884._1
849+ let paymentInAmountAsset = $t03475034902._5
850+ let bonus = $t03475034902._4
851+ let feeAmount = $t03475034902._3
852+ let commonState = $t03475034902._2
853+ let emitAmountEstimated = $t03475034902._1
854854 let emitAmount = if (if ((minOutAmount > 0))
855855 then (minOutAmount > emitAmountEstimated)
856856 else false)
870870 let sendFee = if ((feeAmount > 0))
871871 then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
872872 else nil
873- let $t03547035667 = if ((this == feeCollectorAddress))
873+ let $t03548835685 = if ((this == feeCollectorAddress))
874874 then $Tuple2(0, 0)
875875 else if (paymentInAmountAsset)
876876 then $Tuple2(-(feeAmount), 0)
877877 else $Tuple2(0, -(feeAmount))
878- let amountAssetBalanceDelta = $t03547035667._1
879- let priceAssetBalanceDelta = $t03547035667._2
880- let $t03567035778 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
881- let refreshKLpActions = $t03567035778._1
882- let updatedKLp = $t03567035778._2
878+ let amountAssetBalanceDelta = $t03548835685._1
879+ let priceAssetBalanceDelta = $t03548835685._2
880+ let $t03568835796 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
881+ let refreshKLpActions = $t03568835796._1
882+ let updatedKLp = $t03568835796._2
883883 let kLp = value(getString(keyKLp))
884884 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
885885 if ((isUpdatedKLpValid == isUpdatedKLpValid))
897897
898898 @Callable(i)
899899 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
900- let $t03608436241 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
901- let emitAmountEstimated = $t03608436241._1
902- let commonState = $t03608436241._2
903- let feeAmount = $t03608436241._3
904- let bonus = $t03608436241._4
905- let paymentInAmountAsset = $t03608436241._5
900+ let $t03610236259 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
901+ let emitAmountEstimated = $t03610236259._1
902+ let commonState = $t03610236259._2
903+ let feeAmount = $t03610236259._3
904+ let bonus = $t03610236259._4
905+ let paymentInAmountAsset = $t03610236259._5
906906 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
907907 }
908908
937937 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(paymentAmount))
938938 let userAddress = i.caller
939939 let txId = i.transactionId
940- let $t03713537288 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
941- if (($t03713537288 == $t03713537288))
940+ let $t03715337306 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
941+ if (($t03715337306 == $t03715337306))
942942 then {
943- let outInAmountAsset = $t03713537288._5
944- let bonus = $t03713537288._4
945- let feeAmount = $t03713537288._3
946- let commonState = $t03713537288._2
947- let amountEstimated = $t03713537288._1
943+ let outInAmountAsset = $t03715337306._5
944+ let bonus = $t03715337306._4
945+ let feeAmount = $t03715337306._3
946+ let commonState = $t03715337306._2
947+ let amountEstimated = $t03715337306._1
948948 let amount = if (if ((minOutAmount > 0))
949949 then (minOutAmount > amountEstimated)
950950 else false)
957957 let sendFee = if ((feeAmount > 0))
958958 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
959959 else nil
960- let $t03778838035 = {
960+ let $t03780638053 = {
961961 let feeAmountForCalc = if ((this == feeCollectorAddress))
962962 then 0
963963 else feeAmount
965965 then $Tuple2(-((amount + feeAmountForCalc)), 0)
966966 else $Tuple2(0, -((amount + feeAmountForCalc)))
967967 }
968- let amountAssetBalanceDelta = $t03778838035._1
969- let priceAssetBalanceDelta = $t03778838035._2
970- let $t03803838146 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
971- let refreshKLpActions = $t03803838146._1
972- let updatedKLp = $t03803838146._2
968+ let amountAssetBalanceDelta = $t03780638053._1
969+ let priceAssetBalanceDelta = $t03780638053._2
970+ let $t03805638164 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
971+ let refreshKLpActions = $t03805638164._1
972+ let updatedKLp = $t03805638164._2
973973 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
974974 if ((isUpdatedKLpValid == isUpdatedKLpValid))
975975 then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
986986
987987 @Callable(i)
988988 func getOneTknREADONLY (outAssetId,paymentAmount) = {
989- let $t03840338559 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
990- let amountEstimated = $t03840338559._1
991- let commonState = $t03840338559._2
992- let feeAmount = $t03840338559._3
993- let bonus = $t03840338559._4
994- let outInAmountAsset = $t03840338559._5
989+ let $t03842138577 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
990+ let amountEstimated = $t03842138577._1
991+ let commonState = $t03842138577._2
992+ let feeAmount = $t03842138577._3
993+ let bonus = $t03842138577._4
994+ let outInAmountAsset = $t03842138577._5
995995 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
996996 }
997997
10261026 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
10271027 if ((unstakeInv == unstakeInv))
10281028 then {
1029- let $t03946139612 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1030- if (($t03946139612 == $t03946139612))
1029+ let $t03947939630 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1030+ if (($t03947939630 == $t03947939630))
10311031 then {
1032- let outInAmountAsset = $t03946139612._5
1033- let bonus = $t03946139612._4
1034- let feeAmount = $t03946139612._3
1035- let commonState = $t03946139612._2
1036- let amountEstimated = $t03946139612._1
1032+ let outInAmountAsset = $t03947939630._5
1033+ let bonus = $t03947939630._4
1034+ let feeAmount = $t03947939630._3
1035+ let commonState = $t03947939630._2
1036+ let amountEstimated = $t03947939630._1
10371037 let amount = if (if ((minOutAmount > 0))
10381038 then (minOutAmount > amountEstimated)
10391039 else false)
10461046 let sendFee = if ((feeAmount > 0))
10471047 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
10481048 else nil
1049- let $t04010740354 = {
1049+ let $t04012540372 = {
10501050 let feeAmountForCalc = if ((this == feeCollectorAddress))
10511051 then 0
10521052 else feeAmount
10541054 then $Tuple2(-((amount + feeAmountForCalc)), 0)
10551055 else $Tuple2(0, -((amount + feeAmountForCalc)))
10561056 }
1057- let amountAssetBalanceDelta = $t04010740354._1
1058- let priceAssetBalanceDelta = $t04010740354._2
1059- let $t04035740465 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1060- let refreshKLpActions = $t04035740465._1
1061- let updatedKLp = $t04035740465._2
1057+ let amountAssetBalanceDelta = $t04012540372._1
1058+ let priceAssetBalanceDelta = $t04012540372._2
1059+ let $t04037540483 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1060+ let refreshKLpActions = $t04037540483._1
1061+ let updatedKLp = $t04037540483._2
10621062 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10631063 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10641064 then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
10871087 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
10881088 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
10891089 then {
1090- let $t04141341495 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1091- let refreshKLpActions = $t04141341495._1
1092- let updatedKLp = $t04141341495._2
1090+ let $t04143141513 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1091+ let refreshKLpActions = $t04143141513._1
1092+ let updatedKLp = $t04143141513._2
10931093 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10941094 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10951095 then (state ++ refreshKLpActions)
11171117 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
11181118 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
11191119 then {
1120- let $t04244642527 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1121- let refreshKLpActions = $t04244642527._1
1122- let updatedKLp = $t04244642527._2
1120+ let $t04246442545 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1121+ let refreshKLpActions = $t04246442545._1
1122+ let updatedKLp = $t04246442545._2
11231123 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11241124 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11251125 then (state ++ refreshKLpActions)
11591159 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
11601160 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
11611161 then {
1162- let $t04365043731 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1163- let refreshKLpActions = $t04365043731._1
1164- let updatedKLp = $t04365043731._2
1162+ let $t04366843749 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1163+ let refreshKLpActions = $t04366843749._1
1164+ let updatedKLp = $t04366843749._2
11651165 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11661166 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11671167 then (state ++ refreshKLpActions)
12081208 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
12091209 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
12101210 then {
1211- let $t04502345104 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1212- let refreshKLpActions = $t04502345104._1
1213- let updatedKLp = $t04502345104._2
1211+ let $t04504145122 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1212+ let refreshKLpActions = $t04504145122._1
1213+ let updatedKLp = $t04504145122._2
12141214 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
12151215 if ((isUpdatedKLpValid == isUpdatedKLpValid))
12161216 then (state ++ refreshKLpActions)
12431243 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
12441244 then {
12451245 let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
1246- let $t04629146355 = refreshKLpInternal(0, 0, 0)
1247- let kLpUpdateActions = $t04629146355._1
1248- let updatedKLp = $t04629146355._2
1246+ let $t04630946373 = refreshKLpInternal(0, 0, 0)
1247+ let kLpUpdateActions = $t04630946373._1
1248+ let updatedKLp = $t04630946373._2
12491249 let actions = if ((kLp != updatedKLp))
12501250 then kLpUpdateActions
12511251 else throwErr("nothing to refresh")
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let lPdecimals = 8
55
66 let scale8 = 100000000
77
88 let scale8BigInt = toBigInt(100000000)
99
1010 let scale18 = toBigInt(1000000000000000000)
1111
1212 let zeroBigInt = toBigInt(0)
1313
1414 let big0 = toBigInt(0)
1515
1616 let big1 = toBigInt(1)
1717
1818 let big2 = toBigInt(2)
1919
2020 let wavesString = "WAVES"
2121
2222 let SEP = "__"
2323
2424 let PoolActive = 1
2525
2626 let PoolPutDisabled = 2
2727
2828 let PoolMatcherDisabled = 3
2929
3030 let PoolShutdown = 4
3131
3232 let idxPoolAddress = 1
3333
3434 let idxPoolStatus = 2
3535
3636 let idxPoolLPAssetId = 3
3737
3838 let idxAmtAssetId = 4
3939
4040 let idxPriceAssetId = 5
4141
4242 let idxAmtAssetDcm = 6
4343
4444 let idxPriceAssetDcm = 7
4545
4646 let idxIAmtAssetId = 8
4747
4848 let idxIPriceAssetId = 9
4949
5050 let idxLPAssetDcm = 10
5151
5252 let idxPoolAmtAssetAmt = 1
5353
5454 let idxPoolPriceAssetAmt = 2
5555
5656 let idxPoolLPAssetAmt = 3
5757
5858 let idxFactoryStakingContract = 1
5959
6060 let idxFactorySlippageContract = 7
6161
6262 func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), scale18, toBigInt(origScaleMult))
6363
6464
6565 func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), scale18))
6666
6767
6868 func toScale (amt,resScale,curScale) = fraction(amt, resScale, curScale)
6969
7070
7171 func abs (val) = if ((0 > val))
7272 then -(val)
7373 else val
7474
7575
7676 func absBigInt (val) = if ((zeroBigInt > val))
7777 then -(val)
7878 else val
7979
8080
8181 func fc () = "%s__factoryContract"
8282
8383
8484 func mpk () = "%s__managerPublicKey"
8585
8686
8787 func pmpk () = "%s__pendingManagerPublicKey"
8888
8989
9090 func pl () = "%s%s__price__last"
9191
9292
9393 func ph (h,timestamp) = makeString(["%s%s%d%d__price__history", toString(h), toString(timestamp)], SEP)
9494
9595
9696 func pau (userAddress,txId) = ((("%s%s%s__P__" + userAddress) + "__") + txId)
9797
9898
9999 func gau (userAddress,txId) = ((("%s%s%s__G__" + userAddress) + "__") + txId)
100100
101101
102102 func aa () = "%s__amountAsset"
103103
104104
105105 func pa () = "%s__priceAsset"
106106
107107
108108 let keyFee = "%s__fee"
109109
110110 let feeDefault = fraction(10, scale8, 10000)
111111
112112 let fee = valueOrElse(getInteger(this, keyFee), feeDefault)
113113
114114 let keyKLp = makeString(["%s", "kLp"], SEP)
115115
116116 let keyKLpRefreshedHeight = makeString(["%s", "kLpRefreshedHeight"], SEP)
117117
118118 let keyKLpRefreshDelay = makeString(["%s", "refreshKLpDelay"], SEP)
119119
120120 let kLpRefreshDelayDefault = 30
121121
122122 let kLpRefreshDelay = valueOrElse(getInteger(this, keyKLpRefreshDelay), kLpRefreshDelayDefault)
123123
124124 func keyFactoryConfig () = "%s__factoryConfig"
125125
126126
127127 func keyMatcherPub () = "%s%s__matcher__publicKey"
128128
129129
130130 func keyMappingPoolContractAddressToPoolAssets (poolContractAddress) = (("%s%s%s__" + poolContractAddress) + "__mappings__poolContract2LpAsset")
131131
132132
133133 func keyPoolConfig (iAmtAsset,iPriceAsset) = (((("%d%d%s__" + iAmtAsset) + "__") + iPriceAsset) + "__config")
134134
135135
136136 func keyMappingsBaseAsset2internalId (baseAssetStr) = ("%s%s%s__mappings__baseAsset2internalId__" + baseAssetStr)
137137
138138
139139 func keyAllPoolsShutdown () = "%s__shutdown"
140140
141141
142142 func keyPoolWeight (contractAddress) = ("%s%s__poolWeight__" + contractAddress)
143143
144144
145145 func keyAllowedLpScriptHash () = "%s__allowedLpScriptHash"
146146
147147
148148 let keyFeeCollectorAddress = "%s__feeCollectorAddress"
149149
150150 func throwOrderError (orderValid,senderValid,matcherValid) = throw(((((("order validation failed: orderValid=" + toString(orderValid)) + " senderValid=") + toString(senderValid)) + " matcherValid=") + toString(matcherValid)))
151151
152152
153153 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
154154
155155
156156 func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
157157
158158
159159 func throwErr (msg) = throw(makeString(["lp.ride:", msg], " "))
160160
161161
162162 func fmtErr (msg) = makeString(["lp.ride:", msg], " ")
163163
164164
165165 let factoryContract = addressFromStringValue(getStringOrFail(this, fc()))
166166
167167 let feeCollectorAddress = addressFromStringValue(getStringOrFail(factoryContract, keyFeeCollectorAddress))
168168
169169 func isGlobalShutdown () = valueOrElse(getBoolean(factoryContract, keyAllPoolsShutdown()), false)
170170
171171
172172 func getMatcherPubOrFail () = fromBase58String(getStringOrFail(factoryContract, keyMatcherPub()))
173173
174174
175175 func getPoolConfig () = {
176176 let amtAsset = getStringOrFail(this, aa())
177177 let priceAsset = getStringOrFail(this, pa())
178178 let iPriceAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(priceAsset))
179179 let iAmtAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(amtAsset))
180180 split(getStringOrFail(factoryContract, keyPoolConfig(toString(iAmtAsset), toString(iPriceAsset))), SEP)
181181 }
182182
183183
184184 func parseAssetId (input) = if ((input == wavesString))
185185 then unit
186186 else fromBase58String(input)
187187
188188
189189 func assetIdToString (input) = if ((input == unit))
190190 then wavesString
191191 else toBase58String(value(input))
192192
193193
194194 func parsePoolConfig (poolConfig) = $Tuple7(addressFromStringValue(poolConfig[idxPoolAddress]), parseIntValue(poolConfig[idxPoolStatus]), fromBase58String(poolConfig[idxPoolLPAssetId]), parseAssetId(poolConfig[idxAmtAssetId]), parseAssetId(poolConfig[idxPriceAssetId]), parseIntValue(poolConfig[idxAmtAssetDcm]), parseIntValue(poolConfig[idxPriceAssetDcm]))
195195
196196
197197 let poolConfigParsed = parsePoolConfig(getPoolConfig())
198198
199199 let $t079158081 = poolConfigParsed
200200
201201 let cfgPoolAddress = $t079158081._1
202202
203203 let cfgPoolStatus = $t079158081._2
204204
205205 let cfgLpAssetId = $t079158081._3
206206
207207 let cfgAmountAssetId = $t079158081._4
208208
209209 let cfgPriceAssetId = $t079158081._5
210210
211211 let cfgAmountAssetDecimals = $t079158081._6
212212
213213 let cfgPriceAssetDecimals = $t079158081._7
214214
215215 func getFactoryConfig () = split(getStringOrFail(factoryContract, keyFactoryConfig()), SEP)
216216
217217
218218 let stakingContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactoryStakingContract]), "incorrect staking address")
219219
220220 let slippageContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactorySlippageContract]), "incorrect staking address")
221221
222222 func dataPutActionInfo (inAmtAssetAmt,inPriceAssetAmt,outLpAmt,price,slippageTolerancePassedByUser,slippageToleranceReal,txHeight,txTimestamp,slipageAmtAssetAmt,slipagePriceAssetAmt) = makeString(["%d%d%d%d%d%d%d%d%d%d", toString(inAmtAssetAmt), toString(inPriceAssetAmt), toString(outLpAmt), toString(price), toString(slippageTolerancePassedByUser), toString(slippageToleranceReal), toString(txHeight), toString(txTimestamp), toString(slipageAmtAssetAmt), toString(slipagePriceAssetAmt)], SEP)
223223
224224
225225 func dataGetActionInfo (outAmtAssetAmt,outPriceAssetAmt,inLpAmt,price,txHeight,txTimestamp) = makeString(["%d%d%d%d%d%d", toString(outAmtAssetAmt), toString(outPriceAssetAmt), toString(inLpAmt), toString(price), toString(txHeight), toString(txTimestamp)], SEP)
226226
227227
228228 func getAccBalance (assetId) = if ((assetId == "WAVES"))
229229 then wavesBalance(this).available
230230 else assetBalance(this, fromBase58String(assetId))
231231
232232
233233 func calcPriceBigInt (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18)
234234
235235
236236 func privateCalcPrice (amAssetDcm,prAssetDcm,amAmt,prAmt) = {
237237 let amtAssetAmtX18 = toX18(amAmt, amAssetDcm)
238238 let priceAssetAmtX18 = toX18(prAmt, prAssetDcm)
239239 calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
240240 }
241241
242242
243243 func calcPrices (amAmt,prAmt,lpAmt) = {
244244 let cfg = getPoolConfig()
245245 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
246246 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
247247 let priceX18 = privateCalcPrice(amtAssetDcm, priceAssetDcm, amAmt, prAmt)
248248 let amAmtX18 = toX18(amAmt, amtAssetDcm)
249249 let prAmtX18 = toX18(prAmt, priceAssetDcm)
250250 let lpAmtX18 = toX18(lpAmt, scale8)
251251 let lpPriceInAmAssetX18 = calcPriceBigInt(amAmtX18, lpAmtX18)
252252 let lpPriceInPrAssetX18 = calcPriceBigInt(prAmtX18, lpAmtX18)
253253 [priceX18, lpPriceInAmAssetX18, lpPriceInPrAssetX18]
254254 }
255255
256256
257257 func calculatePrices (amAmt,prAmt,lpAmt) = {
258258 let prices = calcPrices(amAmt, prAmt, lpAmt)
259259 [fromX18(prices[0], scale8), fromX18(prices[1], scale8), fromX18(prices[2], scale8)]
260260 }
261261
262262
263263 func estimateGetOperation (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
264264 let cfg = getPoolConfig()
265265 let lpAssetId = cfg[idxPoolLPAssetId]
266266 let amAssetId = cfg[idxAmtAssetId]
267267 let prAssetId = cfg[idxPriceAssetId]
268268 let amAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
269269 let prAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
270270 let poolStatus = cfg[idxPoolStatus]
271271 let lpEmission = valueOrErrorMessage(assetInfo(fromBase58String(lpAssetId)), (("Asset " + lpAssetId) + " doesn't exist")).quantity
272272 if ((lpAssetId != pmtAssetId))
273273 then throw("Invalid asset passed.")
274274 else {
275275 let amBalance = getAccBalance(amAssetId)
276276 let amBalanceX18 = toX18(amBalance, amAssetDcm)
277277 let prBalance = getAccBalance(prAssetId)
278278 let prBalanceX18 = toX18(prBalance, prAssetDcm)
279279 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
280280 let curPrice = fromX18(curPriceX18, scale8)
281281 let pmtLpAmtX18 = toX18(pmtLpAmt, scale8)
282282 let lpEmissionX18 = toX18(lpEmission, scale8)
283283 let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissionX18)
284284 let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissionX18)
285285 let outAmAmt = fromX18(outAmAmtX18, amAssetDcm)
286286 let outPrAmt = fromX18(outPrAmtX18, prAssetDcm)
287287 let state = if ((txId58 == ""))
288288 then nil
289289 else [ScriptTransfer(userAddress, outAmAmt, if ((amAssetId == "WAVES"))
290290 then unit
291291 else fromBase58String(amAssetId)), ScriptTransfer(userAddress, outPrAmt, if ((prAssetId == "WAVES"))
292292 then unit
293293 else fromBase58String(prAssetId)), StringEntry(gau(toString(userAddress), txId58), dataGetActionInfo(outAmAmt, outPrAmt, pmtLpAmt, curPrice, height, lastBlock.timestamp)), IntegerEntry(pl(), curPrice), IntegerEntry(ph(height, lastBlock.timestamp), curPrice)]
294294 $Tuple10(outAmAmt, outPrAmt, amAssetId, prAssetId, amBalance, prBalance, lpEmission, curPriceX18, poolStatus, state)
295295 }
296296 }
297297
298298
299299 func estimatePutOperation (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = {
300300 let cfg = getPoolConfig()
301301 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
302302 let amAssetIdStr = cfg[idxAmtAssetId]
303303 let prAssetIdStr = cfg[idxPriceAssetId]
304304 let iAmtAssetId = cfg[idxIAmtAssetId]
305305 let iPriceAssetId = cfg[idxIPriceAssetId]
306306 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
307307 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
308308 let poolStatus = cfg[idxPoolStatus]
309309 let lpEmission = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
310310 let inAmAssetIdStr = toBase58String(valueOrElse(inAmAssetId, fromBase58String("WAVES")))
311311 let inPrAssetIdStr = toBase58String(valueOrElse(inPrAssetId, fromBase58String("WAVES")))
312312 if (if ((amAssetIdStr != inAmAssetIdStr))
313313 then true
314314 else (prAssetIdStr != inPrAssetIdStr))
315315 then throw("Invalid amt or price asset passed.")
316316 else {
317317 let amBalance = if (isEvaluate)
318318 then getAccBalance(amAssetIdStr)
319319 else (getAccBalance(amAssetIdStr) - inAmAssetAmt)
320320 let prBalance = if (isEvaluate)
321321 then getAccBalance(prAssetIdStr)
322322 else (getAccBalance(prAssetIdStr) - inPrAssetAmt)
323323 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
324324 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
325325 let userPriceX18 = calcPriceBigInt(inPrAssetAmtX18, inAmAssetAmtX18)
326326 let amBalanceX18 = toX18(amBalance, amtAssetDcm)
327327 let prBalanceX18 = toX18(prBalance, priceAssetDcm)
328328 let res = if ((lpEmission == 0))
329329 then {
330330 let curPriceX18 = zeroBigInt
331331 let slippageX18 = zeroBigInt
332332 let lpAmtX18 = pow((inAmAssetAmtX18 * inPrAssetAmtX18), 0, toBigInt(5), 1, 0, DOWN)
333333 $Tuple5(fromX18(lpAmtX18, scale8), fromX18(inAmAssetAmtX18, amtAssetDcm), fromX18(inPrAssetAmtX18, priceAssetDcm), calcPriceBigInt((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18)
334334 }
335335 else {
336336 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
337337 let slippageX18 = fraction(absBigInt((curPriceX18 - userPriceX18)), scale18, curPriceX18)
338338 let slippageToleranceX18 = toX18(slippageTolerance, scale8)
339339 if (if ((curPriceX18 != zeroBigInt))
340340 then (slippageX18 > slippageToleranceX18)
341341 else false)
342342 then throw(((("Price slippage " + toString(slippageX18)) + " exceeded the passed limit of ") + toString(slippageToleranceX18)))
343343 else {
344344 let lpEmissionX18 = toX18(lpEmission, scale8)
345- let prViaAmX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18)
346- let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
345+ let prViaAmX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18, CEILING)
346+ let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18, CEILING)
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) = {
377- let updatedKLp = fraction(pow((amountBalance * priceBalance), 0, toBigInt(5), 1, 12, DOWN), big1, lpEmission)
377+ let updatedKLp = fraction(pow((amountBalance * priceBalance), 0, toBigInt(5), 1, 18, DOWN), big1, lpEmission)
378378 if ((lpEmission == big0))
379379 then big0
380380 else updatedKLp
381381 }
382382
383383
384384 func calcCurrentKLp (amountAssetDelta,priceAssetDelta,lpAssetEmissionDelta) = {
385385 let amountAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) - amountAssetDelta)
386386 let priceAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) - priceAssetDelta)
387387 let lpAssetEmission = (toBigInt(value(assetInfo(cfgLpAssetId)).quantity) - lpAssetEmissionDelta)
388388 let currentKLp = calcKLp(amountAssetBalance, priceAssetBalance, lpAssetEmission)
389389 currentKLp
390390 }
391391
392392
393393 func refreshKLpInternal (amountAssetBalanceDelta,priceAssetBalanceDelta,lpAssetEmissionDelta) = {
394394 let amountAssetBalance = (getAccBalance(assetIdToString(cfgAmountAssetId)) + amountAssetBalanceDelta)
395395 let priceAssetBalance = (getAccBalance(assetIdToString(cfgPriceAssetId)) + priceAssetBalanceDelta)
396396 let lpAssetEmission = (value(assetInfo(cfgLpAssetId)).quantity + lpAssetEmissionDelta)
397397 let updatedKLp = calcKLp(toBigInt(amountAssetBalance), toBigInt(priceAssetBalance), toBigInt(lpAssetEmission))
398398 let actions = [IntegerEntry(keyKLpRefreshedHeight, height), StringEntry(keyKLp, toString(updatedKLp))]
399399 $Tuple2(actions, updatedKLp)
400400 }
401401
402402
403403 func validateUpdatedKLp (oldKLp,updatedKLp) = if ((updatedKLp >= oldKLp))
404404 then true
405405 else throwErr(makeString(["updated KLp lower than current KLp", toString(oldKLp), toString(updatedKLp)], " "))
406406
407407
408408 func validateMatcherOrderAllowed (order) = {
409409 let amountAssetAmount = order.amount
410410 let priceAssetAmount = fraction(order.amount, order.price, scale8, FLOOR)
411- let $t02034120553 = if ((order.orderType == Buy))
411+ let $t02035920571 = if ((order.orderType == Buy))
412412 then $Tuple2(amountAssetAmount, -(priceAssetAmount))
413413 else $Tuple2(-(amountAssetAmount), priceAssetAmount)
414- let amountAssetBalanceDelta = $t02034120553._1
415- let priceAssetBalanceDelta = $t02034120553._2
414+ let amountAssetBalanceDelta = $t02035920571._1
415+ let priceAssetBalanceDelta = $t02035920571._2
416416 if (if (if (isGlobalShutdown())
417417 then true
418418 else (cfgPoolStatus == PoolMatcherDisabled))
419419 then true
420420 else (cfgPoolStatus == PoolShutdown))
421421 then throw("Exchange operations disabled")
422422 else if (if ((order.assetPair.amountAsset != cfgAmountAssetId))
423423 then true
424424 else (order.assetPair.priceAsset != cfgPriceAssetId))
425425 then throw("Wrong order assets.")
426426 else {
427427 let kLp = valueOrErrorMessage(parseBigInt(valueOrErrorMessage(getString(this, keyKLp), fmtErr("kLp is required"))), fmtErr("invalid kLp"))
428- let $t02102421124 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
429- let unusedActions = $t02102421124._1
430- let kLpNew = $t02102421124._2
428+ let $t02104221142 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
429+ let unusedActions = $t02104221142._1
430+ let kLpNew = $t02104221142._2
431431 let isOrderValid = (kLpNew >= kLp)
432432 isOrderValid
433433 }
434434 }
435435
436436
437437 func commonGet (i) = if ((size(i.payments) != 1))
438438 then throw("exactly 1 payment is expected")
439439 else {
440440 let pmt = value(i.payments[0])
441441 let pmtAssetId = value(pmt.assetId)
442442 let pmtAmt = pmt.amount
443443 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller)
444444 let outAmAmt = res._1
445445 let outPrAmt = res._2
446446 let poolStatus = parseIntValue(res._9)
447447 let state = res._10
448448 if (if (isGlobalShutdown())
449449 then true
450450 else (poolStatus == PoolShutdown))
451451 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
452452 else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state)
453453 }
454454
455455
456456 func commonPut (i,slippageTolerance,emitLp) = if ((size(i.payments) != 2))
457457 then throw("exactly 2 payments are expected")
458458 else {
459459 let amAssetPmt = value(i.payments[0])
460460 let prAssetPmt = value(i.payments[1])
461461 let estPut = estimatePutOperation(toBase58String(i.transactionId), slippageTolerance, amAssetPmt.amount, amAssetPmt.assetId, prAssetPmt.amount, prAssetPmt.assetId, toString(i.caller), false, emitLp)
462462 let poolStatus = parseIntValue(estPut._8)
463463 if (if (if (isGlobalShutdown())
464464 then true
465465 else (poolStatus == PoolPutDisabled))
466466 then true
467467 else (poolStatus == PoolShutdown))
468468 then throw(("Put operation is blocked by admin. Status = " + toString(poolStatus)))
469469 else estPut
470470 }
471471
472472
473473 func emit (amount) = {
474474 let emitInv = invoke(factoryContract, "emit", [amount], nil)
475475 if ((emitInv == emitInv))
476476 then {
477477 let emitInvLegacy = match emitInv {
478478 case legacyFactoryContract: Address =>
479479 invoke(legacyFactoryContract, "emit", [amount], nil)
480480 case _ =>
481481 unit
482482 }
483483 if ((emitInvLegacy == emitInvLegacy))
484484 then amount
485485 else throw("Strict value is not equal to itself.")
486486 }
487487 else throw("Strict value is not equal to itself.")
488488 }
489489
490490
491491 func takeFee (amount) = {
492492 let feeAmount = fraction(amount, fee, scale8)
493493 $Tuple2((amount - feeAmount), feeAmount)
494494 }
495495
496496
497497 func calcPutOneToken (paymentAmountRaw,paymentAssetId,userAddress,txId) = {
498498 let isEval = (txId == unit)
499499 let amountBalanceRaw = getAccBalance(assetIdToString(cfgAmountAssetId))
500500 let priceBalanceRaw = getAccBalance(assetIdToString(cfgPriceAssetId))
501501 let paymentInAmountAsset = if ((paymentAssetId == cfgAmountAssetId))
502502 then true
503503 else if ((paymentAssetId == cfgPriceAssetId))
504504 then false
505505 else throwErr("invalid asset")
506- let $t02380924102 = if (isEval)
506+ let $t02382724120 = if (isEval)
507507 then $Tuple2(amountBalanceRaw, priceBalanceRaw)
508508 else if (paymentInAmountAsset)
509509 then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw)
510510 else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw))
511- let amountBalanceOld = $t02380924102._1
512- let priceBalanceOld = $t02380924102._2
513- let $t02410624255 = if (paymentInAmountAsset)
511+ let amountBalanceOld = $t02382724120._1
512+ let priceBalanceOld = $t02382724120._2
513+ let $t02412424273 = if (paymentInAmountAsset)
514514 then $Tuple2(paymentAmountRaw, 0)
515515 else $Tuple2(0, paymentAmountRaw)
516- let amountAssetAmountRaw = $t02410624255._1
517- let priceAssetAmountRaw = $t02410624255._2
516+ let amountAssetAmountRaw = $t02412424273._1
517+ let priceAssetAmountRaw = $t02412424273._2
518518 let amountAssetAmount = takeFee(amountAssetAmountRaw)._1
519519 let priceAssetAmount = takeFee(priceAssetAmountRaw)._1
520- let $t02437724436 = takeFee(paymentAmountRaw)
521- let paymentAmount = $t02437724436._1
522- let feeAmount = $t02437724436._2
520+ let $t02439524454 = takeFee(paymentAmountRaw)
521+ let paymentAmount = $t02439524454._1
522+ let feeAmount = $t02439524454._2
523523 let amountBalanceNew = (amountBalanceOld + amountAssetAmount)
524524 let priceBalanceNew = (priceBalanceOld + priceAssetAmount)
525525 let priceNewX18 = calcPriceBigInt(toX18(priceBalanceNew, cfgPriceAssetDecimals), toX18(amountBalanceNew, cfgAmountAssetDecimals))
526526 let priceNew = fromX18(priceNewX18, scale8)
527527 let paymentBalance = if (paymentInAmountAsset)
528528 then amountBalanceOld
529529 else priceBalanceOld
530530 let paymentBalanceBigInt = toBigInt(paymentBalance)
531531 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
532532 let chechSupply = if ((supplyBigInt > big0))
533533 then true
534534 else throwErr("initial deposit requires all coins")
535535 if ((chechSupply == chechSupply))
536536 then {
537537 let depositBigInt = toBigInt(paymentAmount)
538538 let issueAmount = max([0, toInt(((supplyBigInt * (sqrtBigInt((scale18 + ((depositBigInt * scale18) / paymentBalanceBigInt)), 18, 18, DOWN) - scale18)) / scale18))])
539539 let commonState = if (isEval)
540540 then nil
541541 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))]
542542 let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, cfgPriceAssetDecimals), toX18(amountBalanceOld, cfgAmountAssetDecimals))
543543 let priceOld = fromX18(priceOldX18, scale8)
544544 let loss = {
545- let $t02591326080 = if (paymentInAmountAsset)
545+ let $t02593126098 = if (paymentInAmountAsset)
546546 then $Tuple2(amountAssetAmountRaw, amountBalanceOld)
547547 else $Tuple2(priceAssetAmountRaw, priceBalanceOld)
548- let amount = $t02591326080._1
549- let balance = $t02591326080._2
548+ let amount = $t02593126098._1
549+ let balance = $t02593126098._2
550550 let issueAmountBoth = toInt(fraction(supplyBigInt, toBigInt((amount / 2)), toBigInt(balance)))
551551 fraction((issueAmount - issueAmountBoth), scale8, issueAmountBoth)
552552 }
553553 $Tuple5(issueAmount, commonState, feeAmount, loss, paymentInAmountAsset)
554554 }
555555 else throw("Strict value is not equal to itself.")
556556 }
557557
558558
559559 func calcGetOneToken (outAssetId,paymentAmount,paymentAssetId,userAddress,txId) = {
560560 let isEval = (txId == unit)
561561 let checks = [if ((paymentAssetId == cfgLpAssetId))
562562 then true
563563 else throwErr("invalid lp asset")]
564564 if ((checks == checks))
565565 then {
566566 let outInAmountAsset = if ((outAssetId == cfgAmountAssetId))
567567 then true
568568 else if ((outAssetId == cfgPriceAssetId))
569569 then false
570570 else throwErr("invalid asset")
571571 let balanceBigInt = if (outInAmountAsset)
572572 then toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId)))
573573 else toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId)))
574574 let amBalanceOld = getAccBalance(assetIdToString(cfgAmountAssetId))
575575 let prBalanceOld = getAccBalance(assetIdToString(cfgPriceAssetId))
576576 let outBalance = if (outInAmountAsset)
577577 then amBalanceOld
578578 else prBalanceOld
579579 let outBalanceBigInt = toBigInt(outBalance)
580580 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
581581 let redeemedBigInt = toBigInt(paymentAmount)
582582 let amountRaw = max([0, toInt(((balanceBigInt * (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN))) / scale18))])
583- let $t02768227732 = takeFee(amountRaw)
584- let totalAmount = $t02768227732._1
585- let feeAmount = $t02768227732._2
586- let $t02773627962 = if (outInAmountAsset)
583+ let $t02770027750 = takeFee(amountRaw)
584+ let totalAmount = $t02770027750._1
585+ let feeAmount = $t02770027750._2
586+ let $t02775427980 = if (outInAmountAsset)
587587 then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld)
588588 else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw))
589- let outAmAmount = $t02773627962._1
590- let outPrAmount = $t02773627962._2
591- let amBalanceNew = $t02773627962._3
592- let prBalanceNew = $t02773627962._4
589+ let outAmAmount = $t02775427980._1
590+ let outPrAmount = $t02775427980._2
591+ let amBalanceNew = $t02775427980._3
592+ let prBalanceNew = $t02775427980._4
593593 let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, cfgPriceAssetDecimals), toX18(amBalanceNew, cfgAmountAssetDecimals))
594594 let priceNew = fromX18(priceNewX18, scale8)
595595 let commonState = if (isEval)
596596 then nil
597597 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)]
598598 let priceOldX18 = calcPriceBigInt(toX18(prBalanceOld, cfgPriceAssetDecimals), toX18(amBalanceOld, cfgAmountAssetDecimals))
599599 let priceOld = fromX18(priceOldX18, scale8)
600600 let loss = {
601601 let amountBothInPaymentAsset = (toInt(fraction(balanceBigInt, redeemedBigInt, supplyBigInt)) * 2)
602602 fraction((totalAmount - amountBothInPaymentAsset), scale8, amountBothInPaymentAsset)
603603 }
604604 $Tuple5(totalAmount, commonState, feeAmount, loss, outInAmountAsset)
605605 }
606606 else throw("Strict value is not equal to itself.")
607607 }
608608
609609
610610 func managerPublicKeyOrUnit () = match getString(mpk()) {
611611 case s: String =>
612612 fromBase58String(s)
613613 case _: Unit =>
614614 unit
615615 case _ =>
616616 throw("Match error")
617617 }
618618
619619
620620 func pendingManagerPublicKeyOrUnit () = match getString(pmpk()) {
621621 case s: String =>
622622 fromBase58String(s)
623623 case _: Unit =>
624624 unit
625625 case _ =>
626626 throw("Match error")
627627 }
628628
629629
630630 func isManager (i) = match managerPublicKeyOrUnit() {
631631 case pk: ByteVector =>
632632 (i.callerPublicKey == pk)
633633 case _: Unit =>
634634 (i.caller == this)
635635 case _ =>
636636 throw("Match error")
637637 }
638638
639639
640640 func mustManager (i) = {
641641 let pd = throw("Permission denied")
642642 match managerPublicKeyOrUnit() {
643643 case pk: ByteVector =>
644644 if ((i.callerPublicKey == pk))
645645 then true
646646 else pd
647647 case _: Unit =>
648648 if ((i.caller == this))
649649 then true
650650 else pd
651651 case _ =>
652652 throw("Match error")
653653 }
654654 }
655655
656656
657657 @Callable(i)
658658 func setManager (pendingManagerPublicKey) = {
659659 let checkCaller = mustManager(i)
660660 if ((checkCaller == checkCaller))
661661 then {
662662 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
663663 if ((checkManagerPublicKey == checkManagerPublicKey))
664664 then [StringEntry(pmpk(), pendingManagerPublicKey)]
665665 else throw("Strict value is not equal to itself.")
666666 }
667667 else throw("Strict value is not equal to itself.")
668668 }
669669
670670
671671
672672 @Callable(i)
673673 func confirmManager () = {
674674 let pm = pendingManagerPublicKeyOrUnit()
675675 let hasPM = if (isDefined(pm))
676676 then true
677677 else throw("No pending manager")
678678 if ((hasPM == hasPM))
679679 then {
680680 let checkPM = if ((i.callerPublicKey == value(pm)))
681681 then true
682682 else throw("You are not pending manager")
683683 if ((checkPM == checkPM))
684684 then [StringEntry(mpk(), toBase58String(value(pm))), DeleteEntry(pmpk())]
685685 else throw("Strict value is not equal to itself.")
686686 }
687687 else throw("Strict value is not equal to itself.")
688688 }
689689
690690
691691
692692 @Callable(i)
693693 func put (slippageTolerance,shouldAutoStake) = if ((0 > slippageTolerance))
694694 then throw("Invalid slippageTolerance passed")
695695 else {
696696 let estPut = commonPut(i, slippageTolerance, true)
697697 let emitLpAmt = estPut._2
698698 let lpAssetId = estPut._7
699699 let state = estPut._9
700700 let amDiff = estPut._10
701701 let prDiff = estPut._11
702702 let amId = estPut._12
703703 let prId = estPut._13
704704 let amAssetPmt = toBigInt(value(i.payments[0]).amount)
705705 let prAssetPmt = toBigInt(value(i.payments[1]).amount)
706706 let amountAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) - amAssetPmt)
707707 if ((amountAssetBalance == amountAssetBalance))
708708 then {
709709 let priceAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) - prAssetPmt)
710710 if ((priceAssetBalance == priceAssetBalance))
711711 then {
712712 let lpAssetEmission = toBigInt(value(assetInfo(cfgLpAssetId)).quantity)
713713 if ((lpAssetEmission == lpAssetEmission))
714714 then {
715715 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
716716 if ((currentKLp == currentKLp))
717717 then {
718718 let emitInv = invoke(factoryContract, "emit", [emitLpAmt], nil)
719719 if ((emitInv == emitInv))
720720 then {
721721 let emitInvLegacy = match emitInv {
722722 case legacyFactoryContract: Address =>
723723 invoke(legacyFactoryContract, "emit", [emitLpAmt], nil)
724724 case _ =>
725725 unit
726726 }
727727 if ((emitInvLegacy == emitInvLegacy))
728728 then {
729729 let slippageAInv = if ((amDiff > 0))
730730 then invoke(slippageContract, "put", nil, [AttachedPayment(amId, amDiff)])
731731 else nil
732732 if ((slippageAInv == slippageAInv))
733733 then {
734734 let slippagePInv = if ((prDiff > 0))
735735 then invoke(slippageContract, "put", nil, [AttachedPayment(prId, prDiff)])
736736 else nil
737737 if ((slippagePInv == slippagePInv))
738738 then {
739739 let lpTransfer = if (shouldAutoStake)
740740 then {
741741 let slpStakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)])
742742 if ((slpStakeInv == slpStakeInv))
743743 then nil
744744 else throw("Strict value is not equal to itself.")
745745 }
746746 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
747747 let lpAssetEmissionAfter = value(assetInfo(cfgLpAssetId)).quantity
748748 if ((lpAssetEmissionAfter == lpAssetEmissionAfter))
749749 then {
750- let $t03248232550 = refreshKLpInternal(0, 0, 0)
751- if (($t03248232550 == $t03248232550))
750+ let $t03250032568 = refreshKLpInternal(0, 0, 0)
751+ if (($t03250032568 == $t03250032568))
752752 then {
753- let updatedKLp = $t03248232550._2
754- let refreshKLpActions = $t03248232550._1
753+ let updatedKLp = $t03250032568._2
754+ let refreshKLpActions = $t03250032568._1
755755 let error = throwErr(makeString([toString(amountAssetBalance), toString(priceAssetBalance), toString(lpAssetEmission), toString(currentKLp), toString(updatedKLp), toString(emitLpAmt), toString(amDiff), toString(prDiff), toString(lpAssetEmission), toString(lpAssetEmissionAfter)], " "))
756756 if ((error == error))
757757 then {
758758 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
759759 if ((isUpdatedKLpValid == isUpdatedKLpValid))
760760 then ((state ++ lpTransfer) ++ refreshKLpActions)
761761 else throw("Strict value is not equal to itself.")
762762 }
763763 else throw("Strict value is not equal to itself.")
764764 }
765765 else throw("Strict value is not equal to itself.")
766766 }
767767 else throw("Strict value is not equal to itself.")
768768 }
769769 else throw("Strict value is not equal to itself.")
770770 }
771771 else throw("Strict value is not equal to itself.")
772772 }
773773 else throw("Strict value is not equal to itself.")
774774 }
775775 else throw("Strict value is not equal to itself.")
776776 }
777777 else throw("Strict value is not equal to itself.")
778778 }
779779 else throw("Strict value is not equal to itself.")
780780 }
781781 else throw("Strict value is not equal to itself.")
782782 }
783783 else throw("Strict value is not equal to itself.")
784784 }
785785
786786
787787
788788 @Callable(i)
789789 func putForFree (maxSlippage) = if ((0 > maxSlippage))
790790 then throw("Invalid value passed")
791791 else {
792792 let estPut = commonPut(i, maxSlippage, false)
793793 let state = estPut._9
794794 let amAssetPmt = toBigInt(value(i.payments[0]).amount)
795795 let prAssetPmt = toBigInt(value(i.payments[1]).amount)
796796 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
797797 if ((currentKLp == currentKLp))
798798 then {
799- let $t03348233547 = refreshKLpInternal(0, 0, 0)
800- let refreshKLpActions = $t03348233547._1
801- let updatedKLp = $t03348233547._2
799+ let $t03350033565 = refreshKLpInternal(0, 0, 0)
800+ let refreshKLpActions = $t03350033565._1
801+ let updatedKLp = $t03350033565._2
802802 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
803803 if ((isUpdatedKLpValid == isUpdatedKLpValid))
804804 then (state ++ refreshKLpActions)
805805 else throw("Strict value is not equal to itself.")
806806 }
807807 else throw("Strict value is not equal to itself.")
808808 }
809809
810810
811811
812812 @Callable(i)
813813 func putOneTkn (minOutAmount,autoStake) = {
814814 let isPoolOneTokenOperationsDisabled = {
815815 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
816816 if ($isInstanceOf(@, "Boolean"))
817817 then @
818818 else throw(($getType(@) + " couldn't be cast to Boolean"))
819819 }
820820 let isPutDisabled = if (if (if (isGlobalShutdown())
821821 then true
822822 else (cfgPoolStatus == PoolPutDisabled))
823823 then true
824824 else (cfgPoolStatus == PoolShutdown))
825825 then true
826826 else isPoolOneTokenOperationsDisabled
827827 let checks = [if (if (!(isPutDisabled))
828828 then true
829829 else isManager(i))
830830 then true
831831 else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1))
832832 then true
833833 else throwErr("exactly 1 payment are expected")]
834834 if ((checks == checks))
835835 then {
836836 let payment = i.payments[0]
837837 let paymentAssetId = payment.assetId
838838 let paymentAmountRaw = payment.amount
839839 let currentKLp = if ((paymentAssetId == cfgAmountAssetId))
840840 then calcCurrentKLp(toBigInt(paymentAmountRaw), toBigInt(0), toBigInt(0))
841841 else if ((paymentAssetId == cfgPriceAssetId))
842842 then calcCurrentKLp(toBigInt(0), toBigInt(paymentAmountRaw), toBigInt(0))
843843 else throwErr("payment asset is not supported")
844844 let userAddress = i.caller
845845 let txId = i.transactionId
846- let $t03473234884 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
847- if (($t03473234884 == $t03473234884))
846+ let $t03475034902 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
847+ if (($t03475034902 == $t03475034902))
848848 then {
849- let paymentInAmountAsset = $t03473234884._5
850- let bonus = $t03473234884._4
851- let feeAmount = $t03473234884._3
852- let commonState = $t03473234884._2
853- let emitAmountEstimated = $t03473234884._1
849+ let paymentInAmountAsset = $t03475034902._5
850+ let bonus = $t03475034902._4
851+ let feeAmount = $t03475034902._3
852+ let commonState = $t03475034902._2
853+ let emitAmountEstimated = $t03475034902._1
854854 let emitAmount = if (if ((minOutAmount > 0))
855855 then (minOutAmount > emitAmountEstimated)
856856 else false)
857857 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
858858 else emitAmountEstimated
859859 let emitInv = emit(emitAmount)
860860 if ((emitInv == emitInv))
861861 then {
862862 let lpTransfer = if (autoStake)
863863 then {
864864 let stakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(cfgLpAssetId, emitAmount)])
865865 if ((stakeInv == stakeInv))
866866 then nil
867867 else throw("Strict value is not equal to itself.")
868868 }
869869 else [ScriptTransfer(i.caller, emitAmount, cfgLpAssetId)]
870870 let sendFee = if ((feeAmount > 0))
871871 then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
872872 else nil
873- let $t03547035667 = if ((this == feeCollectorAddress))
873+ let $t03548835685 = if ((this == feeCollectorAddress))
874874 then $Tuple2(0, 0)
875875 else if (paymentInAmountAsset)
876876 then $Tuple2(-(feeAmount), 0)
877877 else $Tuple2(0, -(feeAmount))
878- let amountAssetBalanceDelta = $t03547035667._1
879- let priceAssetBalanceDelta = $t03547035667._2
880- let $t03567035778 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
881- let refreshKLpActions = $t03567035778._1
882- let updatedKLp = $t03567035778._2
878+ let amountAssetBalanceDelta = $t03548835685._1
879+ let priceAssetBalanceDelta = $t03548835685._2
880+ let $t03568835796 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
881+ let refreshKLpActions = $t03568835796._1
882+ let updatedKLp = $t03568835796._2
883883 let kLp = value(getString(keyKLp))
884884 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
885885 if ((isUpdatedKLpValid == isUpdatedKLpValid))
886886 then $Tuple2((((commonState ++ lpTransfer) ++ sendFee) ++ refreshKLpActions), emitAmount)
887887 else throw("Strict value is not equal to itself.")
888888 }
889889 else throw("Strict value is not equal to itself.")
890890 }
891891 else throw("Strict value is not equal to itself.")
892892 }
893893 else throw("Strict value is not equal to itself.")
894894 }
895895
896896
897897
898898 @Callable(i)
899899 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
900- let $t03608436241 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
901- let emitAmountEstimated = $t03608436241._1
902- let commonState = $t03608436241._2
903- let feeAmount = $t03608436241._3
904- let bonus = $t03608436241._4
905- let paymentInAmountAsset = $t03608436241._5
900+ let $t03610236259 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
901+ let emitAmountEstimated = $t03610236259._1
902+ let commonState = $t03610236259._2
903+ let feeAmount = $t03610236259._3
904+ let bonus = $t03610236259._4
905+ let paymentInAmountAsset = $t03610236259._5
906906 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
907907 }
908908
909909
910910
911911 @Callable(i)
912912 func getOneTkn (outAssetIdStr,minOutAmount) = {
913913 let isPoolOneTokenOperationsDisabled = {
914914 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
915915 if ($isInstanceOf(@, "Boolean"))
916916 then @
917917 else throw(($getType(@) + " couldn't be cast to Boolean"))
918918 }
919919 let isGetDisabled = if (if (isGlobalShutdown())
920920 then true
921921 else (cfgPoolStatus == PoolShutdown))
922922 then true
923923 else isPoolOneTokenOperationsDisabled
924924 let checks = [if (if (!(isGetDisabled))
925925 then true
926926 else isManager(i))
927927 then true
928928 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1))
929929 then true
930930 else throwErr("exactly 1 payment are expected")]
931931 if ((checks == checks))
932932 then {
933933 let outAssetId = parseAssetId(outAssetIdStr)
934934 let payment = i.payments[0]
935935 let paymentAssetId = payment.assetId
936936 let paymentAmount = payment.amount
937937 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(paymentAmount))
938938 let userAddress = i.caller
939939 let txId = i.transactionId
940- let $t03713537288 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
941- if (($t03713537288 == $t03713537288))
940+ let $t03715337306 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
941+ if (($t03715337306 == $t03715337306))
942942 then {
943- let outInAmountAsset = $t03713537288._5
944- let bonus = $t03713537288._4
945- let feeAmount = $t03713537288._3
946- let commonState = $t03713537288._2
947- let amountEstimated = $t03713537288._1
943+ let outInAmountAsset = $t03715337306._5
944+ let bonus = $t03715337306._4
945+ let feeAmount = $t03715337306._3
946+ let commonState = $t03715337306._2
947+ let amountEstimated = $t03715337306._1
948948 let amount = if (if ((minOutAmount > 0))
949949 then (minOutAmount > amountEstimated)
950950 else false)
951951 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
952952 else amountEstimated
953953 let burnInv = invoke(factoryContract, "burn", [paymentAmount], [AttachedPayment(paymentAssetId, paymentAmount)])
954954 if ((burnInv == burnInv))
955955 then {
956956 let assetTransfer = [ScriptTransfer(userAddress, amount, outAssetId)]
957957 let sendFee = if ((feeAmount > 0))
958958 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
959959 else nil
960- let $t03778838035 = {
960+ let $t03780638053 = {
961961 let feeAmountForCalc = if ((this == feeCollectorAddress))
962962 then 0
963963 else feeAmount
964964 if (outInAmountAsset)
965965 then $Tuple2(-((amount + feeAmountForCalc)), 0)
966966 else $Tuple2(0, -((amount + feeAmountForCalc)))
967967 }
968- let amountAssetBalanceDelta = $t03778838035._1
969- let priceAssetBalanceDelta = $t03778838035._2
970- let $t03803838146 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
971- let refreshKLpActions = $t03803838146._1
972- let updatedKLp = $t03803838146._2
968+ let amountAssetBalanceDelta = $t03780638053._1
969+ let priceAssetBalanceDelta = $t03780638053._2
970+ let $t03805638164 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
971+ let refreshKLpActions = $t03805638164._1
972+ let updatedKLp = $t03805638164._2
973973 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
974974 if ((isUpdatedKLpValid == isUpdatedKLpValid))
975975 then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
976976 else throw("Strict value is not equal to itself.")
977977 }
978978 else throw("Strict value is not equal to itself.")
979979 }
980980 else throw("Strict value is not equal to itself.")
981981 }
982982 else throw("Strict value is not equal to itself.")
983983 }
984984
985985
986986
987987 @Callable(i)
988988 func getOneTknREADONLY (outAssetId,paymentAmount) = {
989- let $t03840338559 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
990- let amountEstimated = $t03840338559._1
991- let commonState = $t03840338559._2
992- let feeAmount = $t03840338559._3
993- let bonus = $t03840338559._4
994- let outInAmountAsset = $t03840338559._5
989+ let $t03842138577 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
990+ let amountEstimated = $t03842138577._1
991+ let commonState = $t03842138577._2
992+ let feeAmount = $t03842138577._3
993+ let bonus = $t03842138577._4
994+ let outInAmountAsset = $t03842138577._5
995995 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
996996 }
997997
998998
999999
10001000 @Callable(i)
10011001 func unstakeAndGetOneTkn (unstakeAmount,outAssetIdStr,minOutAmount) = {
10021002 let isPoolOneTokenOperationsDisabled = {
10031003 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
10041004 if ($isInstanceOf(@, "Boolean"))
10051005 then @
10061006 else throw(($getType(@) + " couldn't be cast to Boolean"))
10071007 }
10081008 let isGetDisabled = if (if (isGlobalShutdown())
10091009 then true
10101010 else (cfgPoolStatus == PoolShutdown))
10111011 then true
10121012 else isPoolOneTokenOperationsDisabled
10131013 let checks = [if (if (!(isGetDisabled))
10141014 then true
10151015 else isManager(i))
10161016 then true
10171017 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 0))
10181018 then true
10191019 else throwErr("no payments are expected")]
10201020 if ((checks == checks))
10211021 then {
10221022 let outAssetId = parseAssetId(outAssetIdStr)
10231023 let userAddress = i.caller
10241024 let txId = i.transactionId
10251025 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
10261026 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
10271027 if ((unstakeInv == unstakeInv))
10281028 then {
1029- let $t03946139612 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1030- if (($t03946139612 == $t03946139612))
1029+ let $t03947939630 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1030+ if (($t03947939630 == $t03947939630))
10311031 then {
1032- let outInAmountAsset = $t03946139612._5
1033- let bonus = $t03946139612._4
1034- let feeAmount = $t03946139612._3
1035- let commonState = $t03946139612._2
1036- let amountEstimated = $t03946139612._1
1032+ let outInAmountAsset = $t03947939630._5
1033+ let bonus = $t03947939630._4
1034+ let feeAmount = $t03947939630._3
1035+ let commonState = $t03947939630._2
1036+ let amountEstimated = $t03947939630._1
10371037 let amount = if (if ((minOutAmount > 0))
10381038 then (minOutAmount > amountEstimated)
10391039 else false)
10401040 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
10411041 else amountEstimated
10421042 let burnInv = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
10431043 if ((burnInv == burnInv))
10441044 then {
10451045 let assetTransfer = [ScriptTransfer(i.caller, amount, outAssetId)]
10461046 let sendFee = if ((feeAmount > 0))
10471047 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
10481048 else nil
1049- let $t04010740354 = {
1049+ let $t04012540372 = {
10501050 let feeAmountForCalc = if ((this == feeCollectorAddress))
10511051 then 0
10521052 else feeAmount
10531053 if (outInAmountAsset)
10541054 then $Tuple2(-((amount + feeAmountForCalc)), 0)
10551055 else $Tuple2(0, -((amount + feeAmountForCalc)))
10561056 }
1057- let amountAssetBalanceDelta = $t04010740354._1
1058- let priceAssetBalanceDelta = $t04010740354._2
1059- let $t04035740465 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1060- let refreshKLpActions = $t04035740465._1
1061- let updatedKLp = $t04035740465._2
1057+ let amountAssetBalanceDelta = $t04012540372._1
1058+ let priceAssetBalanceDelta = $t04012540372._2
1059+ let $t04037540483 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1060+ let refreshKLpActions = $t04037540483._1
1061+ let updatedKLp = $t04037540483._2
10621062 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10631063 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10641064 then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
10651065 else throw("Strict value is not equal to itself.")
10661066 }
10671067 else throw("Strict value is not equal to itself.")
10681068 }
10691069 else throw("Strict value is not equal to itself.")
10701070 }
10711071 else throw("Strict value is not equal to itself.")
10721072 }
10731073 else throw("Strict value is not equal to itself.")
10741074 }
10751075
10761076
10771077
10781078 @Callable(i)
10791079 func get () = {
10801080 let res = commonGet(i)
10811081 let outAmtAmt = res._1
10821082 let outPrAmt = res._2
10831083 let pmtAmt = res._3
10841084 let pmtAssetId = res._4
10851085 let state = res._5
10861086 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(pmtAmt))
10871087 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
10881088 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
10891089 then {
1090- let $t04141341495 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1091- let refreshKLpActions = $t04141341495._1
1092- let updatedKLp = $t04141341495._2
1090+ let $t04143141513 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1091+ let refreshKLpActions = $t04143141513._1
1092+ let updatedKLp = $t04143141513._2
10931093 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10941094 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10951095 then (state ++ refreshKLpActions)
10961096 else throw("Strict value is not equal to itself.")
10971097 }
10981098 else throw("Strict value is not equal to itself.")
10991099 }
11001100
11011101
11021102
11031103 @Callable(i)
11041104 func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = {
11051105 let res = commonGet(i)
11061106 let outAmAmt = res._1
11071107 let outPrAmt = res._2
11081108 let pmtAmt = res._3
11091109 let pmtAssetId = res._4
11101110 let state = res._5
11111111 if ((noLessThenAmtAsset > outAmAmt))
11121112 then throw(((("noLessThenAmtAsset failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset)))
11131113 else if ((noLessThenPriceAsset > outPrAmt))
11141114 then throw(((("noLessThenPriceAsset failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset)))
11151115 else {
11161116 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(pmtAmt))
11171117 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
11181118 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
11191119 then {
1120- let $t04244642527 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1121- let refreshKLpActions = $t04244642527._1
1122- let updatedKLp = $t04244642527._2
1120+ let $t04246442545 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1121+ let refreshKLpActions = $t04246442545._1
1122+ let updatedKLp = $t04246442545._2
11231123 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11241124 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11251125 then (state ++ refreshKLpActions)
11261126 else throw("Strict value is not equal to itself.")
11271127 }
11281128 else throw("Strict value is not equal to itself.")
11291129 }
11301130 }
11311131
11321132
11331133
11341134 @Callable(i)
11351135 func unstakeAndGet (amount) = {
11361136 let checkPayments = if ((size(i.payments) != 0))
11371137 then throw("No payments are expected")
11381138 else true
11391139 if ((checkPayments == checkPayments))
11401140 then {
11411141 let cfg = getPoolConfig()
11421142 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
11431143 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
11441144 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(lpAssetId), amount], nil)
11451145 if ((unstakeInv == unstakeInv))
11461146 then {
11471147 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller)
11481148 let outAmAmt = res._1
11491149 let outPrAmt = res._2
11501150 let poolStatus = parseIntValue(res._9)
11511151 let state = res._10
11521152 let checkPoolStatus = if (if (isGlobalShutdown())
11531153 then true
11541154 else (poolStatus == PoolShutdown))
11551155 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
11561156 else true
11571157 if ((checkPoolStatus == checkPoolStatus))
11581158 then {
11591159 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
11601160 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
11611161 then {
1162- let $t04365043731 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1163- let refreshKLpActions = $t04365043731._1
1164- let updatedKLp = $t04365043731._2
1162+ let $t04366843749 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1163+ let refreshKLpActions = $t04366843749._1
1164+ let updatedKLp = $t04366843749._2
11651165 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11661166 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11671167 then (state ++ refreshKLpActions)
11681168 else throw("Strict value is not equal to itself.")
11691169 }
11701170 else throw("Strict value is not equal to itself.")
11711171 }
11721172 else throw("Strict value is not equal to itself.")
11731173 }
11741174 else throw("Strict value is not equal to itself.")
11751175 }
11761176 else throw("Strict value is not equal to itself.")
11771177 }
11781178
11791179
11801180
11811181 @Callable(i)
11821182 func unstakeAndGetNoLess (unstakeAmount,noLessThenAmountAsset,noLessThenPriceAsset) = {
11831183 let isGetDisabled = if (isGlobalShutdown())
11841184 then true
11851185 else (cfgPoolStatus == PoolShutdown)
11861186 let checks = [if (!(isGetDisabled))
11871187 then true
11881188 else throw("get operation is blocked by admin"), if ((size(i.payments) == 0))
11891189 then true
11901190 else throw("no payments are expected")]
11911191 if ((checks == checks))
11921192 then {
11931193 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
11941194 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
11951195 if ((unstakeInv == unstakeInv))
11961196 then {
11971197 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller)
11981198 let outAmAmt = res._1
11991199 let outPrAmt = res._2
12001200 let state = res._10
12011201 let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset))
12021202 then true
12031203 else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset))
12041204 then true
12051205 else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))]
12061206 if ((checkAmounts == checkAmounts))
12071207 then {
12081208 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
12091209 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
12101210 then {
1211- let $t04502345104 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1212- let refreshKLpActions = $t04502345104._1
1213- let updatedKLp = $t04502345104._2
1211+ let $t04504145122 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1212+ let refreshKLpActions = $t04504145122._1
1213+ let updatedKLp = $t04504145122._2
12141214 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
12151215 if ((isUpdatedKLpValid == isUpdatedKLpValid))
12161216 then (state ++ refreshKLpActions)
12171217 else throw("Strict value is not equal to itself.")
12181218 }
12191219 else throw("Strict value is not equal to itself.")
12201220 }
12211221 else throw("Strict value is not equal to itself.")
12221222 }
12231223 else throw("Strict value is not equal to itself.")
12241224 }
12251225 else throw("Strict value is not equal to itself.")
12261226 }
12271227
12281228
12291229
12301230 @Callable(i)
12311231 func activate (amtAssetStr,priceAssetStr) = if ((toString(i.caller) != toString(factoryContract)))
12321232 then throw("permissions denied")
12331233 else $Tuple2([StringEntry(aa(), amtAssetStr), StringEntry(pa(), priceAssetStr)], "success")
12341234
12351235
12361236
12371237 @Callable(i)
12381238 func refreshKLp () = {
12391239 let lastRefreshedBlockHeight = valueOrElse(getInteger(keyKLpRefreshedHeight), 0)
12401240 let checkLastRefreshedBlockHeight = if (((height - lastRefreshedBlockHeight) >= kLpRefreshDelay))
12411241 then unit
12421242 else throwErr(makeString([toString(kLpRefreshDelay), " blocks have not passed since the previous call"], ""))
12431243 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
12441244 then {
12451245 let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
1246- let $t04629146355 = refreshKLpInternal(0, 0, 0)
1247- let kLpUpdateActions = $t04629146355._1
1248- let updatedKLp = $t04629146355._2
1246+ let $t04630946373 = refreshKLpInternal(0, 0, 0)
1247+ let kLpUpdateActions = $t04630946373._1
1248+ let updatedKLp = $t04630946373._2
12491249 let actions = if ((kLp != updatedKLp))
12501250 then kLpUpdateActions
12511251 else throwErr("nothing to refresh")
12521252 $Tuple2(actions, toString(updatedKLp))
12531253 }
12541254 else throw("Strict value is not equal to itself.")
12551255 }
12561256
12571257
12581258
12591259 @Callable(i)
12601260 func getPoolConfigWrapperREADONLY () = $Tuple2(nil, getPoolConfig())
12611261
12621262
12631263
12641264 @Callable(i)
12651265 func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId))
12661266
12671267
12681268
12691269 @Callable(i)
12701270 func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = {
12711271 let prices = calcPrices(amAmt, prAmt, lpAmt)
12721272 $Tuple2(nil, [toString(prices[0]), toString(prices[1]), toString(prices[2])])
12731273 }
12741274
12751275
12761276
12771277 @Callable(i)
12781278 func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(toX18(origVal, origScaleMult)))
12791279
12801280
12811281
12821282 @Callable(i)
12831283 func fromX18WrapperREADONLY (val,resultScaleMult) = $Tuple2(nil, fromX18(parseBigIntValue(val), resultScaleMult))
12841284
12851285
12861286
12871287 @Callable(i)
12881288 func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(calcPriceBigInt(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18))))
12891289
12901290
12911291
12921292 @Callable(i)
12931293 func estimatePutOperationWrapperREADONLY (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = $Tuple2(nil, estimatePutOperation(txId58, slippageTolerance, inAmAssetAmt, inAmAssetId, inPrAssetAmt, inPrAssetId, userAddress, isEvaluate, emitLp))
12941294
12951295
12961296
12971297 @Callable(i)
12981298 func estimateGetOperationWrapperREADONLY (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
12991299 let res = estimateGetOperation(txId58, pmtAssetId, pmtLpAmt, addressFromStringValue(userAddress))
13001300 $Tuple2(nil, $Tuple10(res._1, res._2, res._3, res._4, res._5, res._6, res._7, toString(res._8), res._9, res._10))
13011301 }
13021302
13031303
13041304
13051305 @Callable(i)
13061306 func statsREADONLY () = {
13071307 let cfg = getPoolConfig()
13081308 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
13091309 let amtAssetId = cfg[idxAmtAssetId]
13101310 let priceAssetId = cfg[idxPriceAssetId]
13111311 let iAmtAssetId = cfg[idxIAmtAssetId]
13121312 let iPriceAssetId = cfg[idxIPriceAssetId]
13131313 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
13141314 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
13151315 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
13161316 let accAmtAssetBalance = getAccBalance(amtAssetId)
13171317 let accPriceAssetBalance = getAccBalance(priceAssetId)
13181318 let pricesList = if ((poolLPBalance == 0))
13191319 then [zeroBigInt, zeroBigInt, zeroBigInt]
13201320 else calcPrices(accAmtAssetBalance, accPriceAssetBalance, poolLPBalance)
13211321 let curPrice = 0
13221322 let lpAmtAssetShare = fromX18(pricesList[1], scale8)
13231323 let lpPriceAssetShare = fromX18(pricesList[2], scale8)
13241324 let poolWeight = value(getInteger(factoryContract, keyPoolWeight(toString(this))))
13251325 $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))
13261326 }
13271327
13281328
13291329
13301330 @Callable(i)
13311331 func evaluatePutByAmountAssetREADONLY (inAmAssetAmt) = {
13321332 let cfg = getPoolConfig()
13331333 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
13341334 let amAssetIdStr = cfg[idxAmtAssetId]
13351335 let amAssetId = fromBase58String(amAssetIdStr)
13361336 let prAssetIdStr = cfg[idxPriceAssetId]
13371337 let prAssetId = fromBase58String(prAssetIdStr)
13381338 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
13391339 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
13401340 let poolStatus = cfg[idxPoolStatus]
13411341 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
13421342 let accAmtAssetBalance = getAccBalance(amAssetIdStr)
13431343 let accPriceAssetBalance = getAccBalance(prAssetIdStr)
13441344 let amtAssetAmtX18 = toX18(accAmtAssetBalance, amtAssetDcm)
13451345 let priceAssetAmtX18 = toX18(accPriceAssetBalance, priceAssetDcm)
13461346 let curPriceX18 = if ((poolLPBalance == 0))
13471347 then zeroBigInt
13481348 else calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
13491349 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
13501350 let inPrAssetAmtX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18)
13511351 let inPrAssetAmt = fromX18(inPrAssetAmtX18, priceAssetDcm)
13521352 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
13531353 let calcLpAmt = estPut._1
13541354 let curPriceCalc = estPut._3
13551355 let amBalance = estPut._4
13561356 let prBalance = estPut._5
13571357 let lpEmission = estPut._6
13581358 $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))
13591359 }
13601360
13611361
13621362
13631363 @Callable(i)
13641364 func evaluatePutByPriceAssetREADONLY (inPrAssetAmt) = {
13651365 let cfg = getPoolConfig()
13661366 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
13671367 let amAssetIdStr = cfg[idxAmtAssetId]
13681368 let amAssetId = fromBase58String(amAssetIdStr)
13691369 let prAssetIdStr = cfg[idxPriceAssetId]
13701370 let prAssetId = fromBase58String(prAssetIdStr)
13711371 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
13721372 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
13731373 let poolStatus = cfg[idxPoolStatus]
13741374 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
13751375 let amBalanceRaw = getAccBalance(amAssetIdStr)
13761376 let prBalanceRaw = getAccBalance(prAssetIdStr)
13771377 let amBalanceRawX18 = toX18(amBalanceRaw, amtAssetDcm)
13781378 let prBalanceRawX18 = toX18(prBalanceRaw, priceAssetDcm)
13791379 let curPriceX18 = if ((poolLPBalance == 0))
13801380 then zeroBigInt
13811381 else calcPriceBigInt(prBalanceRawX18, amBalanceRawX18)
13821382 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
13831383 let inAmAssetAmtX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
13841384 let inAmAssetAmt = fromX18(inAmAssetAmtX18, amtAssetDcm)
13851385 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
13861386 let calcLpAmt = estPut._1
13871387 let curPriceCalc = estPut._3
13881388 let amBalance = estPut._4
13891389 let prBalance = estPut._5
13901390 let lpEmission = estPut._6
13911391 $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))
13921392 }
13931393
13941394
13951395
13961396 @Callable(i)
13971397 func evaluateGetREADONLY (paymentLpAssetId,paymentLpAmt) = {
13981398 let res = estimateGetOperation("", paymentLpAssetId, paymentLpAmt, this)
13991399 let outAmAmt = res._1
14001400 let outPrAmt = res._2
14011401 let amBalance = res._5
14021402 let prBalance = res._6
14031403 let lpEmission = res._7
14041404 let curPrice = res._8
14051405 let poolStatus = parseIntValue(res._9)
14061406 $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))
14071407 }
14081408
14091409
14101410 @Verifier(tx)
14111411 func verify () = {
14121412 let targetPublicKey = match managerPublicKeyOrUnit() {
14131413 case pk: ByteVector =>
14141414 pk
14151415 case _: Unit =>
14161416 tx.senderPublicKey
14171417 case _ =>
14181418 throw("Match error")
14191419 }
14201420 match tx {
14211421 case order: Order =>
14221422 let matcherPub = getMatcherPubOrFail()
14231423 let orderValid = validateMatcherOrderAllowed(order)
14241424 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
14251425 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
14261426 if (if (if (orderValid)
14271427 then senderValid
14281428 else false)
14291429 then matcherValid
14301430 else false)
14311431 then true
14321432 else throwOrderError(orderValid, senderValid, matcherValid)
14331433 case s: SetScriptTransaction =>
14341434 let newHash = blake2b256(value(s.script))
14351435 let allowedHash = fromBase64String(value(getString(factoryContract, keyAllowedLpScriptHash())))
14361436 let currentHash = scriptHash(this)
14371437 if (if ((allowedHash == newHash))
14381438 then (currentHash != newHash)
14391439 else false)
14401440 then true
14411441 else sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
14421442 case _ =>
14431443 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
14441444 }
14451445 }
14461446

github/deemru/w8io/026f985 
185.05 ms