tx · 31P5YtQukrJKwuLQCzAFYFQAQ11Ra44ZcWzgy926mKte

3N1UzzyDKhjKyRH3eZ8ZNf1j9Uo4gJjFxor:  -0.03300000 Waves

2022.11.28 15:29 [2336958] smart account 3N1UzzyDKhjKyRH3eZ8ZNf1j9Uo4gJjFxor > SELF 0.00000000 Waves

{ "type": 13, "id": "31P5YtQukrJKwuLQCzAFYFQAQ11Ra44ZcWzgy926mKte", "fee": 3300000, "feeAssetId": null, "timestamp": 1669638527522, "version": 1, "sender": "3N1UzzyDKhjKyRH3eZ8ZNf1j9Uo4gJjFxor", "senderPublicKey": "CVCizwVtaT9i3E82rNofS5vLyaXDwddyUhjsNF3EoCeV", "proofs": [ "2Te4Hi2rfJXdSHz5gRQ3WNYQwVCkzds1SgiA7WcfcqMxEUaz2pYNiqV5v4JW5WPBEABxrQvAxjNQHuGWrR8QrsY7" ], "script": "base64:BgKsLAgCEgMKAQgSABIECgIBBBIDCgEBEgQKAgEEEgQKAggBEgQKAggBEgQKAggBEgUKAwEIARIAEgQKAgEBEgMKAQESBQoDAQEBEgQKAggIEgASABIDCgEIEgUKAwEBARIECgIBARIECgIIARIECgIICBILCgkIAQECAQIIBAQSBgoECAgBCBIAEgMKAQESAwoBARIECgIIASIKbFBkZWNpbWFscyIGc2NhbGU4IgxzY2FsZThCaWdJbnQiB3NjYWxlMTgiCnplcm9CaWdJbnQiBGJpZzAiBGJpZzEiBGJpZzIiC3dhdmVzU3RyaW5nIgNTRVAiClBvb2xBY3RpdmUiD1Bvb2xQdXREaXNhYmxlZCITUG9vbE1hdGNoZXJEaXNhYmxlZCIMUG9vbFNodXRkb3duIg5pZHhQb29sQWRkcmVzcyINaWR4UG9vbFN0YXR1cyIQaWR4UG9vbExQQXNzZXRJZCINaWR4QW10QXNzZXRJZCIPaWR4UHJpY2VBc3NldElkIg5pZHhBbXRBc3NldERjbSIQaWR4UHJpY2VBc3NldERjbSIOaWR4SUFtdEFzc2V0SWQiEGlkeElQcmljZUFzc2V0SW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R5Qnl0ZXMJAJEDAggFAmd1BnByb29mcwAABQJndwkA9AMDCAUCZ3UJYm9keUJ5dGVzCQCRAwIIBQJndQZwcm9vZnMAAAUCZ3ew/TAY", "chainId": 84, "height": 2336958, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2ZeBtpMsUVJYWAaKpqeJWtyszdxb9Usv1nPKsTh9Ld2h Next: 3MaV78JAsXwZShWoJvGTTkPLtfVv2qCf3pHpMkZAVmom Diff:
OldNewDifferences
412412 let isOrderPriceValid = if ((order.orderType == Buy))
413413 then (curPrice >= castedOrderPrice)
414414 else (castedOrderPrice >= curPrice)
415- true
415+ let kLp = valueOrErrorMessage(getInteger(this, keyKLp), fmtErr("kLp is required"))
416+ let kLpNew = 0
417+ let isOrderValid = (kLpNew > kLp)
418+ isOrderValid
416419 }
417420 }
418421 }
487490 else if ((paymentAssetId == cfgPriceAssetId))
488491 then false
489492 else throwErr("invalid asset")
490- let $t02294223235 = if (isEval)
493+ let $t02309923392 = if (isEval)
491494 then $Tuple2(amountBalanceRaw, priceBalanceRaw)
492495 else if (paymentInAmountAsset)
493496 then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw)
494497 else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw))
495- let amountBalanceOld = $t02294223235._1
496- let priceBalanceOld = $t02294223235._2
497- let $t02323923388 = if (paymentInAmountAsset)
498+ let amountBalanceOld = $t02309923392._1
499+ let priceBalanceOld = $t02309923392._2
500+ let $t02339623545 = if (paymentInAmountAsset)
498501 then $Tuple2(paymentAmountRaw, 0)
499502 else $Tuple2(0, paymentAmountRaw)
500- let amountAssetAmountRaw = $t02323923388._1
501- let priceAssetAmountRaw = $t02323923388._2
503+ let amountAssetAmountRaw = $t02339623545._1
504+ let priceAssetAmountRaw = $t02339623545._2
502505 let amountAssetAmount = takeFee(amountAssetAmountRaw)._1
503506 let priceAssetAmount = takeFee(priceAssetAmountRaw)._1
504- let $t02351023569 = takeFee(paymentAmountRaw)
505- let paymentAmount = $t02351023569._1
506- let feeAmount = $t02351023569._2
507+ let $t02366723726 = takeFee(paymentAmountRaw)
508+ let paymentAmount = $t02366723726._1
509+ let feeAmount = $t02366723726._2
507510 let amountBalanceNew = (amountBalanceOld + amountAssetAmount)
508511 let priceBalanceNew = (priceBalanceOld + priceAssetAmount)
509512 let priceNewX18 = calcPriceBigInt(toX18(priceBalanceNew, cfgPriceAssetDecimals), toX18(amountBalanceNew, cfgAmountAssetDecimals))
526529 let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, cfgPriceAssetDecimals), toX18(amountBalanceOld, cfgAmountAssetDecimals))
527530 let priceOld = fromX18(priceOldX18, scale8)
528531 let loss = {
529- let $t02504625213 = if (paymentInAmountAsset)
532+ let $t02520325370 = if (paymentInAmountAsset)
530533 then $Tuple2(amountAssetAmountRaw, amountBalanceOld)
531534 else $Tuple2(priceAssetAmountRaw, priceBalanceOld)
532- let amount = $t02504625213._1
533- let balance = $t02504625213._2
535+ let amount = $t02520325370._1
536+ let balance = $t02520325370._2
534537 let issueAmountBoth = toInt(fraction(supplyBigInt, toBigInt((amount / 2)), toBigInt(balance)))
535538 fraction((issueAmount - issueAmountBoth), scale8, issueAmountBoth)
536539 }
564567 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
565568 let redeemedBigInt = toBigInt(paymentAmount)
566569 let amountRaw = max([0, toInt(((balanceBigInt * (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN))) / scale18))])
567- let $t02681526865 = takeFee(amountRaw)
568- let totalAmount = $t02681526865._1
569- let feeAmount = $t02681526865._2
570- let $t02686927095 = if (outInAmountAsset)
570+ let $t02697227022 = takeFee(amountRaw)
571+ let totalAmount = $t02697227022._1
572+ let feeAmount = $t02697227022._2
573+ let $t02702627252 = if (outInAmountAsset)
571574 then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld)
572575 else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw))
573- let outAmAmount = $t02686927095._1
574- let outPrAmount = $t02686927095._2
575- let amBalanceNew = $t02686927095._3
576- let prBalanceNew = $t02686927095._4
576+ let outAmAmount = $t02702627252._1
577+ let outPrAmount = $t02702627252._2
578+ let amBalanceNew = $t02702627252._3
579+ let prBalanceNew = $t02702627252._4
577580 let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, cfgPriceAssetDecimals), toX18(amBalanceNew, cfgAmountAssetDecimals))
578581 let priceNew = fromX18(priceNewX18, scale8)
579582 let commonState = if (isEval)
730733 else throw("Strict value is not equal to itself.")
731734 }
732735 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
733- let $t03199632061 = refreshKLpInternal(0, 0, 0)
734- let refreshKLpActions = $t03199632061._1
735- let updatedKLp = $t03199632061._2
736+ let $t03215332218 = refreshKLpInternal(0, 0, 0)
737+ let refreshKLpActions = $t03215332218._1
738+ let updatedKLp = $t03215332218._2
736739 ((state ++ lpTransfer) ++ refreshKLpActions)
737740 }
738741 else throw("Strict value is not equal to itself.")
752755 else {
753756 let estPut = commonPut(i, maxSlippage, false)
754757 let state = estPut._9
755- let $t03234732412 = refreshKLpInternal(0, 0, 0)
756- let refreshKLpActions = $t03234732412._1
757- let updatedKLp = $t03234732412._2
758+ let $t03250432569 = refreshKLpInternal(0, 0, 0)
759+ let refreshKLpActions = $t03250432569._1
760+ let updatedKLp = $t03250432569._2
758761 (state ++ refreshKLpActions)
759762 }
760763
789792 let paymentAmountRaw = payment.amount
790793 let userAddress = i.caller
791794 let txId = i.transactionId
792- let $t03318833337 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
793- let emitAmountEstimated = $t03318833337._1
794- let commonState = $t03318833337._2
795- let feeAmount = $t03318833337._3
796- let bonus = $t03318833337._4
797- let paymentInAmountAsset = $t03318833337._5
795+ let $t03334533494 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
796+ let emitAmountEstimated = $t03334533494._1
797+ let commonState = $t03334533494._2
798+ let feeAmount = $t03334533494._3
799+ let bonus = $t03334533494._4
800+ let paymentInAmountAsset = $t03334533494._5
798801 let emitAmount = if (if ((minOutAmount > 0))
799802 then (minOutAmount > emitAmountEstimated)
800803 else false)
814817 let sendFee = if ((feeAmount > 0))
815818 then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
816819 else nil
817- let $t03392334120 = if ((this == feeCollectorAddress))
820+ let $t03408034277 = if ((this == feeCollectorAddress))
818821 then $Tuple2(0, 0)
819822 else if (paymentInAmountAsset)
820823 then $Tuple2(-(feeAmount), 0)
821824 else $Tuple2(0, -(feeAmount))
822- let amountAssetBalanceDelta = $t03392334120._1
823- let priceAssetBalanceDelta = $t03392334120._2
824- let $t03412334231 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
825- let refreshKLpActions = $t03412334231._1
826- let updatedKLp = $t03412334231._2
825+ let amountAssetBalanceDelta = $t03408034277._1
826+ let priceAssetBalanceDelta = $t03408034277._2
827+ let $t03428034388 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
828+ let refreshKLpActions = $t03428034388._1
829+ let updatedKLp = $t03428034388._2
827830 $Tuple2((((commonState ++ lpTransfer) ++ sendFee) ++ refreshKLpActions), emitAmount)
828831 }
829832 else throw("Strict value is not equal to itself.")
835838
836839 @Callable(i)
837840 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
838- let $t03442434581 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
839- let emitAmountEstimated = $t03442434581._1
840- let commonState = $t03442434581._2
841- let feeAmount = $t03442434581._3
842- let bonus = $t03442434581._4
843- let paymentInAmountAsset = $t03442434581._5
841+ let $t03458134738 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
842+ let emitAmountEstimated = $t03458134738._1
843+ let commonState = $t03458134738._2
844+ let feeAmount = $t03458134738._3
845+ let bonus = $t03458134738._4
846+ let paymentInAmountAsset = $t03458134738._5
844847 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
845848 }
846849
874877 let paymentAmount = payment.amount
875878 let userAddress = i.caller
876879 let txId = i.transactionId
877- let $t03538635536 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
878- let amountEstimated = $t03538635536._1
879- let commonState = $t03538635536._2
880- let feeAmount = $t03538635536._3
881- let bonus = $t03538635536._4
882- let outInAmountAsset = $t03538635536._5
880+ let $t03554335693 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
881+ let amountEstimated = $t03554335693._1
882+ let commonState = $t03554335693._2
883+ let feeAmount = $t03554335693._3
884+ let bonus = $t03554335693._4
885+ let outInAmountAsset = $t03554335693._5
883886 let amount = if (if ((minOutAmount > 0))
884887 then (minOutAmount > amountEstimated)
885888 else false)
892895 let sendFee = if ((feeAmount > 0))
893896 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
894897 else nil
895- let $t03603636283 = {
898+ let $t03619336440 = {
896899 let feeAmountForCalc = if ((this == feeCollectorAddress))
897900 then 0
898901 else feeAmount
900903 then $Tuple2(-((amount + feeAmountForCalc)), 0)
901904 else $Tuple2(0, -((amount + feeAmountForCalc)))
902905 }
903- let amountAssetBalanceDelta = $t03603636283._1
904- let priceAssetBalanceDelta = $t03603636283._2
905- let $t03628636394 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
906- let refreshKLpActions = $t03628636394._1
907- let updatedKLp = $t03628636394._2
906+ let amountAssetBalanceDelta = $t03619336440._1
907+ let priceAssetBalanceDelta = $t03619336440._2
908+ let $t03644336551 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
909+ let refreshKLpActions = $t03644336551._1
910+ let updatedKLp = $t03644336551._2
908911 $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
909912 }
910913 else throw("Strict value is not equal to itself.")
916919
917920 @Callable(i)
918921 func getOneTknREADONLY (outAssetId,paymentAmount) = {
919- let $t03657836734 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
920- let amountEstimated = $t03657836734._1
921- let commonState = $t03657836734._2
922- let feeAmount = $t03657836734._3
923- let bonus = $t03657836734._4
924- let outInAmountAsset = $t03657836734._5
922+ let $t03673536891 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
923+ let amountEstimated = $t03673536891._1
924+ let commonState = $t03673536891._2
925+ let feeAmount = $t03673536891._3
926+ let bonus = $t03673536891._4
927+ let outInAmountAsset = $t03673536891._5
925928 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
926929 }
927930
955958 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
956959 if ((unstakeInv == unstakeInv))
957960 then {
958- let $t03755937707 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
959- let amountEstimated = $t03755937707._1
960- let commonState = $t03755937707._2
961- let feeAmount = $t03755937707._3
962- let bonus = $t03755937707._4
963- let outInAmountAsset = $t03755937707._5
961+ let $t03771637864 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
962+ let amountEstimated = $t03771637864._1
963+ let commonState = $t03771637864._2
964+ let feeAmount = $t03771637864._3
965+ let bonus = $t03771637864._4
966+ let outInAmountAsset = $t03771637864._5
964967 let amount = if (if ((minOutAmount > 0))
965968 then (minOutAmount > amountEstimated)
966969 else false)
973976 let sendFee = if ((feeAmount > 0))
974977 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
975978 else nil
976- let $t03820238449 = {
979+ let $t03835938606 = {
977980 let feeAmountForCalc = if ((this == feeCollectorAddress))
978981 then 0
979982 else feeAmount
981984 then $Tuple2(-((amount + feeAmountForCalc)), 0)
982985 else $Tuple2(0, -((amount + feeAmountForCalc)))
983986 }
984- let amountAssetBalanceDelta = $t03820238449._1
985- let priceAssetBalanceDelta = $t03820238449._2
986- let $t03845238560 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
987- let refreshKLpActions = $t03845238560._1
988- let updatedKLp = $t03845238560._2
987+ let amountAssetBalanceDelta = $t03835938606._1
988+ let priceAssetBalanceDelta = $t03835938606._2
989+ let $t03860938717 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
990+ let refreshKLpActions = $t03860938717._1
991+ let updatedKLp = $t03860938717._2
989992 $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
990993 }
991994 else throw("Strict value is not equal to itself.")
10081011 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
10091012 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
10101013 then {
1011- let $t03935239434 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1012- let refreshKLpActions = $t03935239434._1
1013- let updatedKLp = $t03935239434._2
1014+ let $t03950939591 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1015+ let refreshKLpActions = $t03950939591._1
1016+ let updatedKLp = $t03950939591._2
10141017 (state ++ refreshKLpActions)
10151018 }
10161019 else throw("Strict value is not equal to itself.")
10341037 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
10351038 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
10361039 then {
1037- let $t04023040311 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1038- let refreshKLpActions = $t04023040311._1
1039- let updatedKLp = $t04023040311._2
1040+ let $t04038740468 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1041+ let refreshKLpActions = $t04038740468._1
1042+ let updatedKLp = $t04038740468._2
10401043 (state ++ refreshKLpActions)
10411044 }
10421045 else throw("Strict value is not equal to itself.")
10721075 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
10731076 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
10741077 then {
1075- let $t04128441365 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1076- let refreshKLpActions = $t04128441365._1
1077- let updatedKLp = $t04128441365._2
1078+ let $t04144141522 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1079+ let refreshKLpActions = $t04144141522._1
1080+ let updatedKLp = $t04144141522._2
10781081 (state ++ refreshKLpActions)
10791082 }
10801083 else throw("Strict value is not equal to itself.")
11171120 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
11181121 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
11191122 then {
1120- let $t04250542586 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1121- let refreshKLpActions = $t04250542586._1
1122- let updatedKLp = $t04250542586._2
1123+ let $t04266242743 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1124+ let refreshKLpActions = $t04266242743._1
1125+ let updatedKLp = $t04266242743._2
11231126 (state ++ refreshKLpActions)
11241127 }
11251128 else throw("Strict value is not equal to itself.")
11481151 else throwErr(makeString([toString(kLpRefreshDelay), " blocks have not passed since the previous call"], ""))
11491152 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
11501153 then {
1151- let $t04357443629 = refreshKLpInternal(0, 0, 0)
1152- let actions = $t04357443629._1
1153- let updatedKLp = $t04357443629._2
1154+ let $t04373143786 = refreshKLpInternal(0, 0, 0)
1155+ let actions = $t04373143786._1
1156+ let updatedKLp = $t04373143786._2
11541157 $Tuple2(actions, toString(updatedKLp))
11551158 }
11561159 else throw("Strict value is not equal to itself.")
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let lPdecimals = 8
55
66 let scale8 = 100000000
77
88 let scale8BigInt = toBigInt(100000000)
99
1010 let scale18 = toBigInt(1000000000000000000)
1111
1212 let zeroBigInt = toBigInt(0)
1313
1414 let big0 = toBigInt(0)
1515
1616 let big1 = toBigInt(1)
1717
1818 let big2 = toBigInt(2)
1919
2020 let wavesString = "WAVES"
2121
2222 let SEP = "__"
2323
2424 let PoolActive = 1
2525
2626 let PoolPutDisabled = 2
2727
2828 let PoolMatcherDisabled = 3
2929
3030 let PoolShutdown = 4
3131
3232 let idxPoolAddress = 1
3333
3434 let idxPoolStatus = 2
3535
3636 let idxPoolLPAssetId = 3
3737
3838 let idxAmtAssetId = 4
3939
4040 let idxPriceAssetId = 5
4141
4242 let idxAmtAssetDcm = 6
4343
4444 let idxPriceAssetDcm = 7
4545
4646 let idxIAmtAssetId = 8
4747
4848 let idxIPriceAssetId = 9
4949
5050 let idxLPAssetDcm = 10
5151
5252 let idxPoolAmtAssetAmt = 1
5353
5454 let idxPoolPriceAssetAmt = 2
5555
5656 let idxPoolLPAssetAmt = 3
5757
5858 let idxFactoryStakingContract = 1
5959
6060 let idxFactorySlippageContract = 7
6161
6262 func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), scale18, toBigInt(origScaleMult))
6363
6464
6565 func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), scale18))
6666
6767
6868 func toScale (amt,resScale,curScale) = fraction(amt, resScale, curScale)
6969
7070
7171 func abs (val) = if ((0 > val))
7272 then -(val)
7373 else val
7474
7575
7676 func absBigInt (val) = if ((zeroBigInt > val))
7777 then -(val)
7878 else val
7979
8080
8181 func fc () = "%s__factoryContract"
8282
8383
8484 func mpk () = "%s__managerPublicKey"
8585
8686
8787 func pmpk () = "%s__pendingManagerPublicKey"
8888
8989
9090 func pl () = "%s%s__price__last"
9191
9292
9393 func ph (h,timestamp) = makeString(["%s%s%d%d__price__history", toString(h), toString(timestamp)], SEP)
9494
9595
9696 func pau (userAddress,txId) = ((("%s%s%s__P__" + userAddress) + "__") + txId)
9797
9898
9999 func gau (userAddress,txId) = ((("%s%s%s__G__" + userAddress) + "__") + txId)
100100
101101
102102 func aa () = "%s__amountAsset"
103103
104104
105105 func pa () = "%s__priceAsset"
106106
107107
108108 let keyFee = "%s__fee"
109109
110110 let feeDefault = fraction(10, scale8, 10000)
111111
112112 let fee = valueOrElse(getInteger(this, keyFee), feeDefault)
113113
114114 let keyKLp = makeString(["%s", "kLp"], SEP)
115115
116116 let keyKLpRefreshedHeight = makeString(["%s", "kLpRefreshedHeight"], SEP)
117117
118118 let keyKLpRefreshDelay = makeString(["%s", "refreshKLpDelay"], SEP)
119119
120120 let kLpRefreshDelayDefault = 30
121121
122122 let kLpRefreshDelay = valueOrElse(getInteger(this, keyKLpRefreshDelay), kLpRefreshDelayDefault)
123123
124124 func keyFactoryConfig () = "%s__factoryConfig"
125125
126126
127127 func keyMatcherPub () = "%s%s__matcher__publicKey"
128128
129129
130130 func keyMappingPoolContractAddressToPoolAssets (poolContractAddress) = (("%s%s%s__" + poolContractAddress) + "__mappings__poolContract2LpAsset")
131131
132132
133133 func keyPoolConfig (iAmtAsset,iPriceAsset) = (((("%d%d%s__" + iAmtAsset) + "__") + iPriceAsset) + "__config")
134134
135135
136136 func keyMappingsBaseAsset2internalId (baseAssetStr) = ("%s%s%s__mappings__baseAsset2internalId__" + baseAssetStr)
137137
138138
139139 func keyAllPoolsShutdown () = "%s__shutdown"
140140
141141
142142 func keyPoolWeight (contractAddress) = ("%s%s__poolWeight__" + contractAddress)
143143
144144
145145 func keyAllowedLpScriptHash () = "%s__allowedLpScriptHash"
146146
147147
148148 let keyFeeCollectorAddress = "%s__feeCollectorAddress"
149149
150150 func throwOrderError (orderValid,senderValid,matcherValid) = throw(((((("order validation failed: orderValid=" + toString(orderValid)) + " senderValid=") + toString(senderValid)) + " matcherValid=") + toString(matcherValid)))
151151
152152
153153 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
154154
155155
156156 func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
157157
158158
159159 func throwErr (msg) = throw(makeString(["lp.ride:", msg], " "))
160160
161161
162162 func fmtErr (msg) = makeString(["lp.ride:", msg], " ")
163163
164164
165165 let factoryContract = addressFromStringValue(getStringOrFail(this, fc()))
166166
167167 let feeCollectorAddress = addressFromStringValue(getStringOrFail(factoryContract, keyFeeCollectorAddress))
168168
169169 func isGlobalShutdown () = valueOrElse(getBoolean(factoryContract, keyAllPoolsShutdown()), false)
170170
171171
172172 func getMatcherPubOrFail () = fromBase58String(getStringOrFail(factoryContract, keyMatcherPub()))
173173
174174
175175 func getPoolConfig () = {
176176 let amtAsset = getStringOrFail(this, aa())
177177 let priceAsset = getStringOrFail(this, pa())
178178 let iPriceAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(priceAsset))
179179 let iAmtAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(amtAsset))
180180 split(getStringOrFail(factoryContract, keyPoolConfig(toString(iAmtAsset), toString(iPriceAsset))), SEP)
181181 }
182182
183183
184184 func parseAssetId (input) = if ((input == wavesString))
185185 then unit
186186 else fromBase58String(input)
187187
188188
189189 func assetIdToString (input) = if ((input == unit))
190190 then wavesString
191191 else toBase58String(value(input))
192192
193193
194194 func parsePoolConfig (poolConfig) = $Tuple7(addressFromStringValue(poolConfig[idxPoolAddress]), parseIntValue(poolConfig[idxPoolStatus]), fromBase58String(poolConfig[idxPoolLPAssetId]), parseAssetId(poolConfig[idxAmtAssetId]), parseAssetId(poolConfig[idxPriceAssetId]), parseIntValue(poolConfig[idxAmtAssetDcm]), parseIntValue(poolConfig[idxPriceAssetDcm]))
195195
196196
197197 let poolConfigParsed = parsePoolConfig(getPoolConfig())
198198
199199 let $t079158081 = poolConfigParsed
200200
201201 let cfgPoolAddress = $t079158081._1
202202
203203 let cfgPoolStatus = $t079158081._2
204204
205205 let cfgLpAssetId = $t079158081._3
206206
207207 let cfgAmountAssetId = $t079158081._4
208208
209209 let cfgPriceAssetId = $t079158081._5
210210
211211 let cfgAmountAssetDecimals = $t079158081._6
212212
213213 let cfgPriceAssetDecimals = $t079158081._7
214214
215215 func getFactoryConfig () = split(getStringOrFail(factoryContract, keyFactoryConfig()), SEP)
216216
217217
218218 let stakingContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactoryStakingContract]), "incorrect staking address")
219219
220220 let slippageContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactorySlippageContract]), "incorrect staking address")
221221
222222 func dataPutActionInfo (inAmtAssetAmt,inPriceAssetAmt,outLpAmt,price,slippageTolerancePassedByUser,slippageToleranceReal,txHeight,txTimestamp,slipageAmtAssetAmt,slipagePriceAssetAmt) = makeString(["%d%d%d%d%d%d%d%d%d%d", toString(inAmtAssetAmt), toString(inPriceAssetAmt), toString(outLpAmt), toString(price), toString(slippageTolerancePassedByUser), toString(slippageToleranceReal), toString(txHeight), toString(txTimestamp), toString(slipageAmtAssetAmt), toString(slipagePriceAssetAmt)], SEP)
223223
224224
225225 func dataGetActionInfo (outAmtAssetAmt,outPriceAssetAmt,inLpAmt,price,txHeight,txTimestamp) = makeString(["%d%d%d%d%d%d", toString(outAmtAssetAmt), toString(outPriceAssetAmt), toString(inLpAmt), toString(price), toString(txHeight), toString(txTimestamp)], SEP)
226226
227227
228228 func getAccBalance (assetId) = if ((assetId == "WAVES"))
229229 then wavesBalance(this).available
230230 else assetBalance(this, fromBase58String(assetId))
231231
232232
233233 func calcPriceBigInt (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18)
234234
235235
236236 func privateCalcPrice (amAssetDcm,prAssetDcm,amAmt,prAmt) = {
237237 let amtAssetAmtX18 = toX18(amAmt, amAssetDcm)
238238 let priceAssetAmtX18 = toX18(prAmt, prAssetDcm)
239239 calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
240240 }
241241
242242
243243 func calcPrices (amAmt,prAmt,lpAmt) = {
244244 let cfg = getPoolConfig()
245245 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
246246 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
247247 let priceX18 = privateCalcPrice(amtAssetDcm, priceAssetDcm, amAmt, prAmt)
248248 let amAmtX18 = toX18(amAmt, amtAssetDcm)
249249 let prAmtX18 = toX18(prAmt, priceAssetDcm)
250250 let lpAmtX18 = toX18(lpAmt, scale8)
251251 let lpPriceInAmAssetX18 = calcPriceBigInt(amAmtX18, lpAmtX18)
252252 let lpPriceInPrAssetX18 = calcPriceBigInt(prAmtX18, lpAmtX18)
253253 [priceX18, lpPriceInAmAssetX18, lpPriceInPrAssetX18]
254254 }
255255
256256
257257 func calculatePrices (amAmt,prAmt,lpAmt) = {
258258 let prices = calcPrices(amAmt, prAmt, lpAmt)
259259 [fromX18(prices[0], scale8), fromX18(prices[1], scale8), fromX18(prices[2], scale8)]
260260 }
261261
262262
263263 func estimateGetOperation (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
264264 let cfg = getPoolConfig()
265265 let lpAssetId = cfg[idxPoolLPAssetId]
266266 let amAssetId = cfg[idxAmtAssetId]
267267 let prAssetId = cfg[idxPriceAssetId]
268268 let amAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
269269 let prAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
270270 let poolStatus = cfg[idxPoolStatus]
271271 let lpEmission = valueOrErrorMessage(assetInfo(fromBase58String(lpAssetId)), (("Asset " + lpAssetId) + " doesn't exist")).quantity
272272 if ((lpAssetId != pmtAssetId))
273273 then throw("Invalid asset passed.")
274274 else {
275275 let amBalance = getAccBalance(amAssetId)
276276 let amBalanceX18 = toX18(amBalance, amAssetDcm)
277277 let prBalance = getAccBalance(prAssetId)
278278 let prBalanceX18 = toX18(prBalance, prAssetDcm)
279279 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
280280 let curPrice = fromX18(curPriceX18, scale8)
281281 let pmtLpAmtX18 = toX18(pmtLpAmt, scale8)
282282 let lpEmissionX18 = toX18(lpEmission, scale8)
283283 let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissionX18)
284284 let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissionX18)
285285 let outAmAmt = fromX18(outAmAmtX18, amAssetDcm)
286286 let outPrAmt = fromX18(outPrAmtX18, prAssetDcm)
287287 let state = if ((txId58 == ""))
288288 then nil
289289 else [ScriptTransfer(userAddress, outAmAmt, if ((amAssetId == "WAVES"))
290290 then unit
291291 else fromBase58String(amAssetId)), ScriptTransfer(userAddress, outPrAmt, if ((prAssetId == "WAVES"))
292292 then unit
293293 else fromBase58String(prAssetId)), StringEntry(gau(toString(userAddress), txId58), dataGetActionInfo(outAmAmt, outPrAmt, pmtLpAmt, curPrice, height, lastBlock.timestamp)), IntegerEntry(pl(), curPrice), IntegerEntry(ph(height, lastBlock.timestamp), curPrice)]
294294 $Tuple10(outAmAmt, outPrAmt, amAssetId, prAssetId, amBalance, prBalance, lpEmission, curPriceX18, poolStatus, state)
295295 }
296296 }
297297
298298
299299 func estimatePutOperation (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = {
300300 let cfg = getPoolConfig()
301301 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
302302 let amAssetIdStr = cfg[idxAmtAssetId]
303303 let prAssetIdStr = cfg[idxPriceAssetId]
304304 let iAmtAssetId = cfg[idxIAmtAssetId]
305305 let iPriceAssetId = cfg[idxIPriceAssetId]
306306 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
307307 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
308308 let poolStatus = cfg[idxPoolStatus]
309309 let lpEmission = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
310310 let inAmAssetIdStr = toBase58String(valueOrElse(inAmAssetId, fromBase58String("WAVES")))
311311 let inPrAssetIdStr = toBase58String(valueOrElse(inPrAssetId, fromBase58String("WAVES")))
312312 if (if ((amAssetIdStr != inAmAssetIdStr))
313313 then true
314314 else (prAssetIdStr != inPrAssetIdStr))
315315 then throw("Invalid amt or price asset passed.")
316316 else {
317317 let amBalance = if (isEvaluate)
318318 then getAccBalance(amAssetIdStr)
319319 else (getAccBalance(amAssetIdStr) - inAmAssetAmt)
320320 let prBalance = if (isEvaluate)
321321 then getAccBalance(prAssetIdStr)
322322 else (getAccBalance(prAssetIdStr) - inPrAssetAmt)
323323 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
324324 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
325325 let userPriceX18 = calcPriceBigInt(inPrAssetAmtX18, inAmAssetAmtX18)
326326 let amBalanceX18 = toX18(amBalance, amtAssetDcm)
327327 let prBalanceX18 = toX18(prBalance, priceAssetDcm)
328328 let res = if ((lpEmission == 0))
329329 then {
330330 let curPriceX18 = zeroBigInt
331331 let slippageX18 = zeroBigInt
332332 let lpAmtX18 = pow((inAmAssetAmtX18 * inPrAssetAmtX18), 0, toBigInt(5), 1, 0, DOWN)
333333 $Tuple5(fromX18(lpAmtX18, scale8), fromX18(inAmAssetAmtX18, amtAssetDcm), fromX18(inPrAssetAmtX18, priceAssetDcm), calcPriceBigInt((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18)
334334 }
335335 else {
336336 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
337337 let slippageX18 = fraction(absBigInt((curPriceX18 - userPriceX18)), scale18, curPriceX18)
338338 let slippageToleranceX18 = toX18(slippageTolerance, scale8)
339339 if (if ((curPriceX18 != zeroBigInt))
340340 then (slippageX18 > slippageToleranceX18)
341341 else false)
342342 then throw(((("Price slippage " + toString(slippageX18)) + " exceeded the passed limit of ") + toString(slippageToleranceX18)))
343343 else {
344344 let lpEmissionX18 = toX18(lpEmission, scale8)
345345 let prViaAmX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18)
346346 let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
347347 let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18))
348348 then $Tuple2(amViaPrX18, inPrAssetAmtX18)
349349 else $Tuple2(inAmAssetAmtX18, prViaAmX18)
350350 let expAmtAssetAmtX18 = expectedAmts._1
351351 let expPriceAssetAmtX18 = expectedAmts._2
352352 let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18)
353353 $Tuple5(fromX18(lpAmtX18, scale8), fromX18(expAmtAssetAmtX18, amtAssetDcm), fromX18(expPriceAssetAmtX18, priceAssetDcm), curPriceX18, slippageX18)
354354 }
355355 }
356356 let calcLpAmt = res._1
357357 let calcAmAssetPmt = res._2
358358 let calcPrAssetPmt = res._3
359359 let curPrice = fromX18(res._4, scale8)
360360 let slippageCalc = fromX18(res._5, scale8)
361361 if ((0 >= calcLpAmt))
362362 then throw("Invalid calculations. LP calculated is less than zero.")
363363 else {
364364 let emitLpAmt = if (!(emitLp))
365365 then 0
366366 else calcLpAmt
367367 let amDiff = (inAmAssetAmt - calcAmAssetPmt)
368368 let prDiff = (inPrAssetAmt - calcPrAssetPmt)
369369 let commonState = [IntegerEntry(pl(), curPrice), IntegerEntry(ph(height, lastBlock.timestamp), curPrice), StringEntry(pau(userAddress, txId58), dataPutActionInfo(calcAmAssetPmt, calcPrAssetPmt, emitLpAmt, curPrice, slippageTolerance, slippageCalc, height, lastBlock.timestamp, amDiff, prDiff))]
370370 $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEmission, lpAssetId, poolStatus, commonState, amDiff, prDiff, inAmAssetId, inPrAssetId)
371371 }
372372 }
373373 }
374374
375375
376376 func validateMatcherOrderAllowed (order) = {
377377 let cfg = getPoolConfig()
378378 let amtAssetId = cfg[idxAmtAssetId]
379379 let priceAssetId = cfg[idxPriceAssetId]
380380 let poolStatus = parseIntValue(cfg[idxPoolStatus])
381381 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
382382 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
383383 let accAmtAssetBalance = getAccBalance(amtAssetId)
384384 let accPriceAssetBalance = getAccBalance(priceAssetId)
385385 let curPriceX18 = if ((order.orderType == Buy))
386386 then privateCalcPrice(amtAssetDcm, priceAssetDcm, (accAmtAssetBalance + order.amount), accPriceAssetBalance)
387387 else privateCalcPrice(amtAssetDcm, priceAssetDcm, (accAmtAssetBalance - order.amount), accPriceAssetBalance)
388388 let curPrice = fromX18(curPriceX18, scale8)
389389 if (if (if (isGlobalShutdown())
390390 then true
391391 else (poolStatus == PoolMatcherDisabled))
392392 then true
393393 else (poolStatus == PoolShutdown))
394394 then throw("Exchange operations disabled")
395395 else {
396396 let orderAmtAsset = order.assetPair.amountAsset
397397 let orderAmtAssetStr = if ((orderAmtAsset == unit))
398398 then "WAVES"
399399 else toBase58String(value(orderAmtAsset))
400400 let orderPriceAsset = order.assetPair.priceAsset
401401 let orderPriceAssetStr = if ((orderPriceAsset == unit))
402402 then "WAVES"
403403 else toBase58String(value(orderPriceAsset))
404404 if (if ((orderAmtAssetStr != amtAssetId))
405405 then true
406406 else (orderPriceAssetStr != priceAssetId))
407407 then throw("Wrong order assets.")
408408 else {
409409 let orderPrice = order.price
410410 let priceDcm = fraction(scale8, priceAssetDcm, amtAssetDcm)
411411 let castedOrderPrice = toScale(orderPrice, scale8, priceDcm)
412412 let isOrderPriceValid = if ((order.orderType == Buy))
413413 then (curPrice >= castedOrderPrice)
414414 else (castedOrderPrice >= curPrice)
415- true
415+ let kLp = valueOrErrorMessage(getInteger(this, keyKLp), fmtErr("kLp is required"))
416+ let kLpNew = 0
417+ let isOrderValid = (kLpNew > kLp)
418+ isOrderValid
416419 }
417420 }
418421 }
419422
420423
421424 func commonGet (i) = if ((size(i.payments) != 1))
422425 then throw("exactly 1 payment is expected")
423426 else {
424427 let pmt = value(i.payments[0])
425428 let pmtAssetId = value(pmt.assetId)
426429 let pmtAmt = pmt.amount
427430 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller)
428431 let outAmAmt = res._1
429432 let outPrAmt = res._2
430433 let poolStatus = parseIntValue(res._9)
431434 let state = res._10
432435 if (if (isGlobalShutdown())
433436 then true
434437 else (poolStatus == PoolShutdown))
435438 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
436439 else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state)
437440 }
438441
439442
440443 func commonPut (i,slippageTolerance,emitLp) = if ((size(i.payments) != 2))
441444 then throw("exactly 2 payments are expected")
442445 else {
443446 let amAssetPmt = value(i.payments[0])
444447 let prAssetPmt = value(i.payments[1])
445448 let estPut = estimatePutOperation(toBase58String(i.transactionId), slippageTolerance, amAssetPmt.amount, amAssetPmt.assetId, prAssetPmt.amount, prAssetPmt.assetId, toString(i.caller), false, emitLp)
446449 let poolStatus = parseIntValue(estPut._8)
447450 if (if (if (isGlobalShutdown())
448451 then true
449452 else (poolStatus == PoolPutDisabled))
450453 then true
451454 else (poolStatus == PoolShutdown))
452455 then throw(("Put operation is blocked by admin. Status = " + toString(poolStatus)))
453456 else estPut
454457 }
455458
456459
457460 func emit (amount) = {
458461 let emitInv = invoke(factoryContract, "emit", [amount], nil)
459462 if ((emitInv == emitInv))
460463 then {
461464 let emitInvLegacy = match emitInv {
462465 case legacyFactoryContract: Address =>
463466 invoke(legacyFactoryContract, "emit", [amount], nil)
464467 case _ =>
465468 unit
466469 }
467470 if ((emitInvLegacy == emitInvLegacy))
468471 then amount
469472 else throw("Strict value is not equal to itself.")
470473 }
471474 else throw("Strict value is not equal to itself.")
472475 }
473476
474477
475478 func takeFee (amount) = {
476479 let feeAmount = fraction(amount, fee, scale8)
477480 $Tuple2((amount - feeAmount), feeAmount)
478481 }
479482
480483
481484 func calcPutOneToken (paymentAmountRaw,paymentAssetId,userAddress,txId) = {
482485 let isEval = (txId == unit)
483486 let amountBalanceRaw = getAccBalance(assetIdToString(cfgAmountAssetId))
484487 let priceBalanceRaw = getAccBalance(assetIdToString(cfgPriceAssetId))
485488 let paymentInAmountAsset = if ((paymentAssetId == cfgAmountAssetId))
486489 then true
487490 else if ((paymentAssetId == cfgPriceAssetId))
488491 then false
489492 else throwErr("invalid asset")
490- let $t02294223235 = if (isEval)
493+ let $t02309923392 = if (isEval)
491494 then $Tuple2(amountBalanceRaw, priceBalanceRaw)
492495 else if (paymentInAmountAsset)
493496 then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw)
494497 else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw))
495- let amountBalanceOld = $t02294223235._1
496- let priceBalanceOld = $t02294223235._2
497- let $t02323923388 = if (paymentInAmountAsset)
498+ let amountBalanceOld = $t02309923392._1
499+ let priceBalanceOld = $t02309923392._2
500+ let $t02339623545 = if (paymentInAmountAsset)
498501 then $Tuple2(paymentAmountRaw, 0)
499502 else $Tuple2(0, paymentAmountRaw)
500- let amountAssetAmountRaw = $t02323923388._1
501- let priceAssetAmountRaw = $t02323923388._2
503+ let amountAssetAmountRaw = $t02339623545._1
504+ let priceAssetAmountRaw = $t02339623545._2
502505 let amountAssetAmount = takeFee(amountAssetAmountRaw)._1
503506 let priceAssetAmount = takeFee(priceAssetAmountRaw)._1
504- let $t02351023569 = takeFee(paymentAmountRaw)
505- let paymentAmount = $t02351023569._1
506- let feeAmount = $t02351023569._2
507+ let $t02366723726 = takeFee(paymentAmountRaw)
508+ let paymentAmount = $t02366723726._1
509+ let feeAmount = $t02366723726._2
507510 let amountBalanceNew = (amountBalanceOld + amountAssetAmount)
508511 let priceBalanceNew = (priceBalanceOld + priceAssetAmount)
509512 let priceNewX18 = calcPriceBigInt(toX18(priceBalanceNew, cfgPriceAssetDecimals), toX18(amountBalanceNew, cfgAmountAssetDecimals))
510513 let priceNew = fromX18(priceNewX18, scale8)
511514 let paymentBalance = if (paymentInAmountAsset)
512515 then amountBalanceOld
513516 else priceBalanceOld
514517 let paymentBalanceBigInt = toBigInt(paymentBalance)
515518 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
516519 let chechSupply = if ((supplyBigInt > big0))
517520 then true
518521 else throwErr("initial deposit requires all coins")
519522 if ((chechSupply == chechSupply))
520523 then {
521524 let depositBigInt = toBigInt(paymentAmount)
522525 let issueAmount = max([0, toInt(((supplyBigInt * (sqrtBigInt((scale18 + ((depositBigInt * scale18) / paymentBalanceBigInt)), 18, 18, DOWN) - scale18)) / scale18))])
523526 let commonState = if (isEval)
524527 then nil
525528 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))]
526529 let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, cfgPriceAssetDecimals), toX18(amountBalanceOld, cfgAmountAssetDecimals))
527530 let priceOld = fromX18(priceOldX18, scale8)
528531 let loss = {
529- let $t02504625213 = if (paymentInAmountAsset)
532+ let $t02520325370 = if (paymentInAmountAsset)
530533 then $Tuple2(amountAssetAmountRaw, amountBalanceOld)
531534 else $Tuple2(priceAssetAmountRaw, priceBalanceOld)
532- let amount = $t02504625213._1
533- let balance = $t02504625213._2
535+ let amount = $t02520325370._1
536+ let balance = $t02520325370._2
534537 let issueAmountBoth = toInt(fraction(supplyBigInt, toBigInt((amount / 2)), toBigInt(balance)))
535538 fraction((issueAmount - issueAmountBoth), scale8, issueAmountBoth)
536539 }
537540 $Tuple5(issueAmount, commonState, feeAmount, loss, paymentInAmountAsset)
538541 }
539542 else throw("Strict value is not equal to itself.")
540543 }
541544
542545
543546 func calcGetOneToken (outAssetId,paymentAmount,paymentAssetId,userAddress,txId) = {
544547 let isEval = (txId == unit)
545548 let checks = [if ((paymentAssetId == cfgLpAssetId))
546549 then true
547550 else throwErr("invalid lp asset")]
548551 if ((checks == checks))
549552 then {
550553 let outInAmountAsset = if ((outAssetId == cfgAmountAssetId))
551554 then true
552555 else if ((outAssetId == cfgPriceAssetId))
553556 then false
554557 else throwErr("invalid asset")
555558 let balanceBigInt = if (outInAmountAsset)
556559 then toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId)))
557560 else toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId)))
558561 let amBalanceOld = getAccBalance(assetIdToString(cfgAmountAssetId))
559562 let prBalanceOld = getAccBalance(assetIdToString(cfgPriceAssetId))
560563 let outBalance = if (outInAmountAsset)
561564 then amBalanceOld
562565 else prBalanceOld
563566 let outBalanceBigInt = toBigInt(outBalance)
564567 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
565568 let redeemedBigInt = toBigInt(paymentAmount)
566569 let amountRaw = max([0, toInt(((balanceBigInt * (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN))) / scale18))])
567- let $t02681526865 = takeFee(amountRaw)
568- let totalAmount = $t02681526865._1
569- let feeAmount = $t02681526865._2
570- let $t02686927095 = if (outInAmountAsset)
570+ let $t02697227022 = takeFee(amountRaw)
571+ let totalAmount = $t02697227022._1
572+ let feeAmount = $t02697227022._2
573+ let $t02702627252 = if (outInAmountAsset)
571574 then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld)
572575 else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw))
573- let outAmAmount = $t02686927095._1
574- let outPrAmount = $t02686927095._2
575- let amBalanceNew = $t02686927095._3
576- let prBalanceNew = $t02686927095._4
576+ let outAmAmount = $t02702627252._1
577+ let outPrAmount = $t02702627252._2
578+ let amBalanceNew = $t02702627252._3
579+ let prBalanceNew = $t02702627252._4
577580 let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, cfgPriceAssetDecimals), toX18(amBalanceNew, cfgAmountAssetDecimals))
578581 let priceNew = fromX18(priceNewX18, scale8)
579582 let commonState = if (isEval)
580583 then nil
581584 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)]
582585 let priceOldX18 = calcPriceBigInt(toX18(prBalanceOld, cfgPriceAssetDecimals), toX18(amBalanceOld, cfgAmountAssetDecimals))
583586 let priceOld = fromX18(priceOldX18, scale8)
584587 let loss = {
585588 let amountBothInPaymentAsset = (toInt(fraction(balanceBigInt, redeemedBigInt, supplyBigInt)) * 2)
586589 fraction((totalAmount - amountBothInPaymentAsset), scale8, amountBothInPaymentAsset)
587590 }
588591 $Tuple5(totalAmount, commonState, feeAmount, loss, outInAmountAsset)
589592 }
590593 else throw("Strict value is not equal to itself.")
591594 }
592595
593596
594597 func calcKLp (amountBalance,priceBalance,lpEmission) = {
595598 let updatedKLp = fraction(pow((amountBalance * priceBalance), 0, toBigInt(5), 1, 0, DOWN), scale18, lpEmission)
596599 updatedKLp
597600 }
598601
599602
600603 func refreshKLpInternal (amountAssetBalanceDelta,priceAssetBalanceDelta,lpAssetEmissionDelta) = {
601604 let amountAssetBalance = (getAccBalance(assetIdToString(cfgAmountAssetId)) + amountAssetBalanceDelta)
602605 let priceAssetBalance = (getAccBalance(assetIdToString(cfgPriceAssetId)) + priceAssetBalanceDelta)
603606 let lpAssetEmission = (value(assetInfo(cfgLpAssetId)).quantity + lpAssetEmissionDelta)
604607 let updatedKLp = calcKLp(toBigInt(amountAssetBalance), toBigInt(priceAssetBalance), toBigInt(lpAssetEmission))
605608 let actions = [IntegerEntry(keyKLpRefreshedHeight, height), StringEntry(keyKLp, toString(updatedKLp))]
606609 $Tuple2(actions, updatedKLp)
607610 }
608611
609612
610613 func managerPublicKeyOrUnit () = match getString(mpk()) {
611614 case s: String =>
612615 fromBase58String(s)
613616 case _: Unit =>
614617 unit
615618 case _ =>
616619 throw("Match error")
617620 }
618621
619622
620623 func pendingManagerPublicKeyOrUnit () = match getString(pmpk()) {
621624 case s: String =>
622625 fromBase58String(s)
623626 case _: Unit =>
624627 unit
625628 case _ =>
626629 throw("Match error")
627630 }
628631
629632
630633 func isManager (i) = match managerPublicKeyOrUnit() {
631634 case pk: ByteVector =>
632635 (i.callerPublicKey == pk)
633636 case _: Unit =>
634637 (i.caller == this)
635638 case _ =>
636639 throw("Match error")
637640 }
638641
639642
640643 func mustManager (i) = {
641644 let pd = throw("Permission denied")
642645 match managerPublicKeyOrUnit() {
643646 case pk: ByteVector =>
644647 if ((i.callerPublicKey == pk))
645648 then true
646649 else pd
647650 case _: Unit =>
648651 if ((i.caller == this))
649652 then true
650653 else pd
651654 case _ =>
652655 throw("Match error")
653656 }
654657 }
655658
656659
657660 @Callable(i)
658661 func setManager (pendingManagerPublicKey) = {
659662 let checkCaller = mustManager(i)
660663 if ((checkCaller == checkCaller))
661664 then {
662665 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
663666 if ((checkManagerPublicKey == checkManagerPublicKey))
664667 then [StringEntry(pmpk(), pendingManagerPublicKey)]
665668 else throw("Strict value is not equal to itself.")
666669 }
667670 else throw("Strict value is not equal to itself.")
668671 }
669672
670673
671674
672675 @Callable(i)
673676 func confirmManager () = {
674677 let pm = pendingManagerPublicKeyOrUnit()
675678 let hasPM = if (isDefined(pm))
676679 then true
677680 else throw("No pending manager")
678681 if ((hasPM == hasPM))
679682 then {
680683 let checkPM = if ((i.callerPublicKey == value(pm)))
681684 then true
682685 else throw("You are not pending manager")
683686 if ((checkPM == checkPM))
684687 then [StringEntry(mpk(), toBase58String(value(pm))), DeleteEntry(pmpk())]
685688 else throw("Strict value is not equal to itself.")
686689 }
687690 else throw("Strict value is not equal to itself.")
688691 }
689692
690693
691694
692695 @Callable(i)
693696 func put (slippageTolerance,shouldAutoStake) = if ((0 > slippageTolerance))
694697 then throw("Invalid slippageTolerance passed")
695698 else {
696699 let estPut = commonPut(i, slippageTolerance, true)
697700 let emitLpAmt = estPut._2
698701 let lpAssetId = estPut._7
699702 let state = estPut._9
700703 let amDiff = estPut._10
701704 let prDiff = estPut._11
702705 let amId = estPut._12
703706 let prId = estPut._13
704707 let emitInv = invoke(factoryContract, "emit", [emitLpAmt], nil)
705708 if ((emitInv == emitInv))
706709 then {
707710 let emitInvLegacy = match emitInv {
708711 case legacyFactoryContract: Address =>
709712 invoke(legacyFactoryContract, "emit", [emitLpAmt], nil)
710713 case _ =>
711714 unit
712715 }
713716 if ((emitInvLegacy == emitInvLegacy))
714717 then {
715718 let slippageAInv = if ((amDiff > 0))
716719 then invoke(slippageContract, "put", nil, [AttachedPayment(amId, amDiff)])
717720 else nil
718721 if ((slippageAInv == slippageAInv))
719722 then {
720723 let slippagePInv = if ((prDiff > 0))
721724 then invoke(slippageContract, "put", nil, [AttachedPayment(prId, prDiff)])
722725 else nil
723726 if ((slippagePInv == slippagePInv))
724727 then {
725728 let lpTransfer = if (shouldAutoStake)
726729 then {
727730 let slpStakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)])
728731 if ((slpStakeInv == slpStakeInv))
729732 then nil
730733 else throw("Strict value is not equal to itself.")
731734 }
732735 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
733- let $t03199632061 = refreshKLpInternal(0, 0, 0)
734- let refreshKLpActions = $t03199632061._1
735- let updatedKLp = $t03199632061._2
736+ let $t03215332218 = refreshKLpInternal(0, 0, 0)
737+ let refreshKLpActions = $t03215332218._1
738+ let updatedKLp = $t03215332218._2
736739 ((state ++ lpTransfer) ++ refreshKLpActions)
737740 }
738741 else throw("Strict value is not equal to itself.")
739742 }
740743 else throw("Strict value is not equal to itself.")
741744 }
742745 else throw("Strict value is not equal to itself.")
743746 }
744747 else throw("Strict value is not equal to itself.")
745748 }
746749
747750
748751
749752 @Callable(i)
750753 func putForFree (maxSlippage) = if ((0 > maxSlippage))
751754 then throw("Invalid value passed")
752755 else {
753756 let estPut = commonPut(i, maxSlippage, false)
754757 let state = estPut._9
755- let $t03234732412 = refreshKLpInternal(0, 0, 0)
756- let refreshKLpActions = $t03234732412._1
757- let updatedKLp = $t03234732412._2
758+ let $t03250432569 = refreshKLpInternal(0, 0, 0)
759+ let refreshKLpActions = $t03250432569._1
760+ let updatedKLp = $t03250432569._2
758761 (state ++ refreshKLpActions)
759762 }
760763
761764
762765
763766 @Callable(i)
764767 func putOneTkn (minOutAmount,autoStake) = {
765768 let isPoolOneTokenOperationsDisabled = {
766769 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
767770 if ($isInstanceOf(@, "Boolean"))
768771 then @
769772 else throw(($getType(@) + " couldn't be cast to Boolean"))
770773 }
771774 let isPutDisabled = if (if (if (isGlobalShutdown())
772775 then true
773776 else (cfgPoolStatus == PoolPutDisabled))
774777 then true
775778 else (cfgPoolStatus == PoolShutdown))
776779 then true
777780 else isPoolOneTokenOperationsDisabled
778781 let checks = [if (if (!(isPutDisabled))
779782 then true
780783 else isManager(i))
781784 then true
782785 else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1))
783786 then true
784787 else throwErr("exactly 1 payment are expected")]
785788 if ((checks == checks))
786789 then {
787790 let payment = i.payments[0]
788791 let paymentAssetId = payment.assetId
789792 let paymentAmountRaw = payment.amount
790793 let userAddress = i.caller
791794 let txId = i.transactionId
792- let $t03318833337 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
793- let emitAmountEstimated = $t03318833337._1
794- let commonState = $t03318833337._2
795- let feeAmount = $t03318833337._3
796- let bonus = $t03318833337._4
797- let paymentInAmountAsset = $t03318833337._5
795+ let $t03334533494 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
796+ let emitAmountEstimated = $t03334533494._1
797+ let commonState = $t03334533494._2
798+ let feeAmount = $t03334533494._3
799+ let bonus = $t03334533494._4
800+ let paymentInAmountAsset = $t03334533494._5
798801 let emitAmount = if (if ((minOutAmount > 0))
799802 then (minOutAmount > emitAmountEstimated)
800803 else false)
801804 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
802805 else emitAmountEstimated
803806 let emitInv = emit(emitAmount)
804807 if ((emitInv == emitInv))
805808 then {
806809 let lpTransfer = if (autoStake)
807810 then {
808811 let stakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(cfgLpAssetId, emitAmount)])
809812 if ((stakeInv == stakeInv))
810813 then nil
811814 else throw("Strict value is not equal to itself.")
812815 }
813816 else [ScriptTransfer(i.caller, emitAmount, cfgLpAssetId)]
814817 let sendFee = if ((feeAmount > 0))
815818 then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
816819 else nil
817- let $t03392334120 = if ((this == feeCollectorAddress))
820+ let $t03408034277 = if ((this == feeCollectorAddress))
818821 then $Tuple2(0, 0)
819822 else if (paymentInAmountAsset)
820823 then $Tuple2(-(feeAmount), 0)
821824 else $Tuple2(0, -(feeAmount))
822- let amountAssetBalanceDelta = $t03392334120._1
823- let priceAssetBalanceDelta = $t03392334120._2
824- let $t03412334231 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
825- let refreshKLpActions = $t03412334231._1
826- let updatedKLp = $t03412334231._2
825+ let amountAssetBalanceDelta = $t03408034277._1
826+ let priceAssetBalanceDelta = $t03408034277._2
827+ let $t03428034388 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
828+ let refreshKLpActions = $t03428034388._1
829+ let updatedKLp = $t03428034388._2
827830 $Tuple2((((commonState ++ lpTransfer) ++ sendFee) ++ refreshKLpActions), emitAmount)
828831 }
829832 else throw("Strict value is not equal to itself.")
830833 }
831834 else throw("Strict value is not equal to itself.")
832835 }
833836
834837
835838
836839 @Callable(i)
837840 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
838- let $t03442434581 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
839- let emitAmountEstimated = $t03442434581._1
840- let commonState = $t03442434581._2
841- let feeAmount = $t03442434581._3
842- let bonus = $t03442434581._4
843- let paymentInAmountAsset = $t03442434581._5
841+ let $t03458134738 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
842+ let emitAmountEstimated = $t03458134738._1
843+ let commonState = $t03458134738._2
844+ let feeAmount = $t03458134738._3
845+ let bonus = $t03458134738._4
846+ let paymentInAmountAsset = $t03458134738._5
844847 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
845848 }
846849
847850
848851
849852 @Callable(i)
850853 func getOneTkn (outAssetIdStr,minOutAmount) = {
851854 let isPoolOneTokenOperationsDisabled = {
852855 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
853856 if ($isInstanceOf(@, "Boolean"))
854857 then @
855858 else throw(($getType(@) + " couldn't be cast to Boolean"))
856859 }
857860 let isGetDisabled = if (if (isGlobalShutdown())
858861 then true
859862 else (cfgPoolStatus == PoolShutdown))
860863 then true
861864 else isPoolOneTokenOperationsDisabled
862865 let checks = [if (if (!(isGetDisabled))
863866 then true
864867 else isManager(i))
865868 then true
866869 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1))
867870 then true
868871 else throwErr("exactly 1 payment are expected")]
869872 if ((checks == checks))
870873 then {
871874 let outAssetId = parseAssetId(outAssetIdStr)
872875 let payment = i.payments[0]
873876 let paymentAssetId = payment.assetId
874877 let paymentAmount = payment.amount
875878 let userAddress = i.caller
876879 let txId = i.transactionId
877- let $t03538635536 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
878- let amountEstimated = $t03538635536._1
879- let commonState = $t03538635536._2
880- let feeAmount = $t03538635536._3
881- let bonus = $t03538635536._4
882- let outInAmountAsset = $t03538635536._5
880+ let $t03554335693 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
881+ let amountEstimated = $t03554335693._1
882+ let commonState = $t03554335693._2
883+ let feeAmount = $t03554335693._3
884+ let bonus = $t03554335693._4
885+ let outInAmountAsset = $t03554335693._5
883886 let amount = if (if ((minOutAmount > 0))
884887 then (minOutAmount > amountEstimated)
885888 else false)
886889 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
887890 else amountEstimated
888891 let burnInv = invoke(factoryContract, "burn", [paymentAmount], [AttachedPayment(paymentAssetId, paymentAmount)])
889892 if ((burnInv == burnInv))
890893 then {
891894 let assetTransfer = [ScriptTransfer(userAddress, amount, outAssetId)]
892895 let sendFee = if ((feeAmount > 0))
893896 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
894897 else nil
895- let $t03603636283 = {
898+ let $t03619336440 = {
896899 let feeAmountForCalc = if ((this == feeCollectorAddress))
897900 then 0
898901 else feeAmount
899902 if (outInAmountAsset)
900903 then $Tuple2(-((amount + feeAmountForCalc)), 0)
901904 else $Tuple2(0, -((amount + feeAmountForCalc)))
902905 }
903- let amountAssetBalanceDelta = $t03603636283._1
904- let priceAssetBalanceDelta = $t03603636283._2
905- let $t03628636394 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
906- let refreshKLpActions = $t03628636394._1
907- let updatedKLp = $t03628636394._2
906+ let amountAssetBalanceDelta = $t03619336440._1
907+ let priceAssetBalanceDelta = $t03619336440._2
908+ let $t03644336551 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
909+ let refreshKLpActions = $t03644336551._1
910+ let updatedKLp = $t03644336551._2
908911 $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
909912 }
910913 else throw("Strict value is not equal to itself.")
911914 }
912915 else throw("Strict value is not equal to itself.")
913916 }
914917
915918
916919
917920 @Callable(i)
918921 func getOneTknREADONLY (outAssetId,paymentAmount) = {
919- let $t03657836734 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
920- let amountEstimated = $t03657836734._1
921- let commonState = $t03657836734._2
922- let feeAmount = $t03657836734._3
923- let bonus = $t03657836734._4
924- let outInAmountAsset = $t03657836734._5
922+ let $t03673536891 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
923+ let amountEstimated = $t03673536891._1
924+ let commonState = $t03673536891._2
925+ let feeAmount = $t03673536891._3
926+ let bonus = $t03673536891._4
927+ let outInAmountAsset = $t03673536891._5
925928 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
926929 }
927930
928931
929932
930933 @Callable(i)
931934 func unstakeAndGetOneTkn (unstakeAmount,outAssetIdStr,minOutAmount) = {
932935 let isPoolOneTokenOperationsDisabled = {
933936 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
934937 if ($isInstanceOf(@, "Boolean"))
935938 then @
936939 else throw(($getType(@) + " couldn't be cast to Boolean"))
937940 }
938941 let isGetDisabled = if (if (isGlobalShutdown())
939942 then true
940943 else (cfgPoolStatus == PoolShutdown))
941944 then true
942945 else isPoolOneTokenOperationsDisabled
943946 let checks = [if (if (!(isGetDisabled))
944947 then true
945948 else isManager(i))
946949 then true
947950 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 0))
948951 then true
949952 else throwErr("no payments are expected")]
950953 if ((checks == checks))
951954 then {
952955 let outAssetId = parseAssetId(outAssetIdStr)
953956 let userAddress = i.caller
954957 let txId = i.transactionId
955958 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
956959 if ((unstakeInv == unstakeInv))
957960 then {
958- let $t03755937707 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
959- let amountEstimated = $t03755937707._1
960- let commonState = $t03755937707._2
961- let feeAmount = $t03755937707._3
962- let bonus = $t03755937707._4
963- let outInAmountAsset = $t03755937707._5
961+ let $t03771637864 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
962+ let amountEstimated = $t03771637864._1
963+ let commonState = $t03771637864._2
964+ let feeAmount = $t03771637864._3
965+ let bonus = $t03771637864._4
966+ let outInAmountAsset = $t03771637864._5
964967 let amount = if (if ((minOutAmount > 0))
965968 then (minOutAmount > amountEstimated)
966969 else false)
967970 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
968971 else amountEstimated
969972 let burnInv = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
970973 if ((burnInv == burnInv))
971974 then {
972975 let assetTransfer = [ScriptTransfer(i.caller, amount, outAssetId)]
973976 let sendFee = if ((feeAmount > 0))
974977 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
975978 else nil
976- let $t03820238449 = {
979+ let $t03835938606 = {
977980 let feeAmountForCalc = if ((this == feeCollectorAddress))
978981 then 0
979982 else feeAmount
980983 if (outInAmountAsset)
981984 then $Tuple2(-((amount + feeAmountForCalc)), 0)
982985 else $Tuple2(0, -((amount + feeAmountForCalc)))
983986 }
984- let amountAssetBalanceDelta = $t03820238449._1
985- let priceAssetBalanceDelta = $t03820238449._2
986- let $t03845238560 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
987- let refreshKLpActions = $t03845238560._1
988- let updatedKLp = $t03845238560._2
987+ let amountAssetBalanceDelta = $t03835938606._1
988+ let priceAssetBalanceDelta = $t03835938606._2
989+ let $t03860938717 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
990+ let refreshKLpActions = $t03860938717._1
991+ let updatedKLp = $t03860938717._2
989992 $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
990993 }
991994 else throw("Strict value is not equal to itself.")
992995 }
993996 else throw("Strict value is not equal to itself.")
994997 }
995998 else throw("Strict value is not equal to itself.")
996999 }
9971000
9981001
9991002
10001003 @Callable(i)
10011004 func get () = {
10021005 let res = commonGet(i)
10031006 let outAmtAmt = res._1
10041007 let outPrAmt = res._2
10051008 let pmtAmt = res._3
10061009 let pmtAssetId = res._4
10071010 let state = res._5
10081011 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
10091012 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
10101013 then {
1011- let $t03935239434 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1012- let refreshKLpActions = $t03935239434._1
1013- let updatedKLp = $t03935239434._2
1014+ let $t03950939591 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1015+ let refreshKLpActions = $t03950939591._1
1016+ let updatedKLp = $t03950939591._2
10141017 (state ++ refreshKLpActions)
10151018 }
10161019 else throw("Strict value is not equal to itself.")
10171020 }
10181021
10191022
10201023
10211024 @Callable(i)
10221025 func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = {
10231026 let res = commonGet(i)
10241027 let outAmAmt = res._1
10251028 let outPrAmt = res._2
10261029 let pmtAmt = res._3
10271030 let pmtAssetId = res._4
10281031 let state = res._5
10291032 if ((noLessThenAmtAsset > outAmAmt))
10301033 then throw(((("noLessThenAmtAsset failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset)))
10311034 else if ((noLessThenPriceAsset > outPrAmt))
10321035 then throw(((("noLessThenPriceAsset failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset)))
10331036 else {
10341037 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
10351038 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
10361039 then {
1037- let $t04023040311 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1038- let refreshKLpActions = $t04023040311._1
1039- let updatedKLp = $t04023040311._2
1040+ let $t04038740468 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1041+ let refreshKLpActions = $t04038740468._1
1042+ let updatedKLp = $t04038740468._2
10401043 (state ++ refreshKLpActions)
10411044 }
10421045 else throw("Strict value is not equal to itself.")
10431046 }
10441047 }
10451048
10461049
10471050
10481051 @Callable(i)
10491052 func unstakeAndGet (amount) = {
10501053 let checkPayments = if ((size(i.payments) != 0))
10511054 then throw("No payments are expected")
10521055 else true
10531056 if ((checkPayments == checkPayments))
10541057 then {
10551058 let cfg = getPoolConfig()
10561059 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
10571060 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(lpAssetId), amount], nil)
10581061 if ((unstakeInv == unstakeInv))
10591062 then {
10601063 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller)
10611064 let outAmAmt = res._1
10621065 let outPrAmt = res._2
10631066 let poolStatus = parseIntValue(res._9)
10641067 let state = res._10
10651068 let checkPoolStatus = if (if (isGlobalShutdown())
10661069 then true
10671070 else (poolStatus == PoolShutdown))
10681071 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
10691072 else true
10701073 if ((checkPoolStatus == checkPoolStatus))
10711074 then {
10721075 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
10731076 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
10741077 then {
1075- let $t04128441365 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1076- let refreshKLpActions = $t04128441365._1
1077- let updatedKLp = $t04128441365._2
1078+ let $t04144141522 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1079+ let refreshKLpActions = $t04144141522._1
1080+ let updatedKLp = $t04144141522._2
10781081 (state ++ refreshKLpActions)
10791082 }
10801083 else throw("Strict value is not equal to itself.")
10811084 }
10821085 else throw("Strict value is not equal to itself.")
10831086 }
10841087 else throw("Strict value is not equal to itself.")
10851088 }
10861089 else throw("Strict value is not equal to itself.")
10871090 }
10881091
10891092
10901093
10911094 @Callable(i)
10921095 func unstakeAndGetNoLess (unstakeAmount,noLessThenAmountAsset,noLessThenPriceAsset) = {
10931096 let isGetDisabled = if (isGlobalShutdown())
10941097 then true
10951098 else (cfgPoolStatus == PoolShutdown)
10961099 let checks = [if (!(isGetDisabled))
10971100 then true
10981101 else throw("get operation is blocked by admin"), if ((size(i.payments) == 0))
10991102 then true
11001103 else throw("no payments are expected")]
11011104 if ((checks == checks))
11021105 then {
11031106 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
11041107 if ((unstakeInv == unstakeInv))
11051108 then {
11061109 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller)
11071110 let outAmAmt = res._1
11081111 let outPrAmt = res._2
11091112 let state = res._10
11101113 let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset))
11111114 then true
11121115 else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset))
11131116 then true
11141117 else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))]
11151118 if ((checkAmounts == checkAmounts))
11161119 then {
11171120 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
11181121 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
11191122 then {
1120- let $t04250542586 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1121- let refreshKLpActions = $t04250542586._1
1122- let updatedKLp = $t04250542586._2
1123+ let $t04266242743 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1124+ let refreshKLpActions = $t04266242743._1
1125+ let updatedKLp = $t04266242743._2
11231126 (state ++ refreshKLpActions)
11241127 }
11251128 else throw("Strict value is not equal to itself.")
11261129 }
11271130 else throw("Strict value is not equal to itself.")
11281131 }
11291132 else throw("Strict value is not equal to itself.")
11301133 }
11311134 else throw("Strict value is not equal to itself.")
11321135 }
11331136
11341137
11351138
11361139 @Callable(i)
11371140 func activate (amtAssetStr,priceAssetStr) = if ((toString(i.caller) != toString(factoryContract)))
11381141 then throw("permissions denied")
11391142 else $Tuple2([StringEntry(aa(), amtAssetStr), StringEntry(pa(), priceAssetStr)], "success")
11401143
11411144
11421145
11431146 @Callable(i)
11441147 func refreshKLp () = {
11451148 let lastRefreshedBlockHeight = valueOrElse(getInteger(keyKLpRefreshedHeight), 0)
11461149 let checkLastRefreshedBlockHeight = if (((height - lastRefreshedBlockHeight) >= kLpRefreshDelay))
11471150 then unit
11481151 else throwErr(makeString([toString(kLpRefreshDelay), " blocks have not passed since the previous call"], ""))
11491152 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
11501153 then {
1151- let $t04357443629 = refreshKLpInternal(0, 0, 0)
1152- let actions = $t04357443629._1
1153- let updatedKLp = $t04357443629._2
1154+ let $t04373143786 = refreshKLpInternal(0, 0, 0)
1155+ let actions = $t04373143786._1
1156+ let updatedKLp = $t04373143786._2
11541157 $Tuple2(actions, toString(updatedKLp))
11551158 }
11561159 else throw("Strict value is not equal to itself.")
11571160 }
11581161
11591162
11601163
11611164 @Callable(i)
11621165 func getPoolConfigWrapperREADONLY () = $Tuple2(nil, getPoolConfig())
11631166
11641167
11651168
11661169 @Callable(i)
11671170 func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId))
11681171
11691172
11701173
11711174 @Callable(i)
11721175 func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = {
11731176 let prices = calcPrices(amAmt, prAmt, lpAmt)
11741177 $Tuple2(nil, [toString(prices[0]), toString(prices[1]), toString(prices[2])])
11751178 }
11761179
11771180
11781181
11791182 @Callable(i)
11801183 func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(toX18(origVal, origScaleMult)))
11811184
11821185
11831186
11841187 @Callable(i)
11851188 func fromX18WrapperREADONLY (val,resultScaleMult) = $Tuple2(nil, fromX18(parseBigIntValue(val), resultScaleMult))
11861189
11871190
11881191
11891192 @Callable(i)
11901193 func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(calcPriceBigInt(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18))))
11911194
11921195
11931196
11941197 @Callable(i)
11951198 func estimatePutOperationWrapperREADONLY (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = $Tuple2(nil, estimatePutOperation(txId58, slippageTolerance, inAmAssetAmt, inAmAssetId, inPrAssetAmt, inPrAssetId, userAddress, isEvaluate, emitLp))
11961199
11971200
11981201
11991202 @Callable(i)
12001203 func estimateGetOperationWrapperREADONLY (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
12011204 let res = estimateGetOperation(txId58, pmtAssetId, pmtLpAmt, addressFromStringValue(userAddress))
12021205 $Tuple2(nil, $Tuple10(res._1, res._2, res._3, res._4, res._5, res._6, res._7, toString(res._8), res._9, res._10))
12031206 }
12041207
12051208
12061209
12071210 @Callable(i)
12081211 func statsREADONLY () = {
12091212 let cfg = getPoolConfig()
12101213 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
12111214 let amtAssetId = cfg[idxAmtAssetId]
12121215 let priceAssetId = cfg[idxPriceAssetId]
12131216 let iAmtAssetId = cfg[idxIAmtAssetId]
12141217 let iPriceAssetId = cfg[idxIPriceAssetId]
12151218 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
12161219 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
12171220 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
12181221 let accAmtAssetBalance = getAccBalance(amtAssetId)
12191222 let accPriceAssetBalance = getAccBalance(priceAssetId)
12201223 let pricesList = if ((poolLPBalance == 0))
12211224 then [zeroBigInt, zeroBigInt, zeroBigInt]
12221225 else calcPrices(accAmtAssetBalance, accPriceAssetBalance, poolLPBalance)
12231226 let curPrice = 0
12241227 let lpAmtAssetShare = fromX18(pricesList[1], scale8)
12251228 let lpPriceAssetShare = fromX18(pricesList[2], scale8)
12261229 let poolWeight = value(getInteger(factoryContract, keyPoolWeight(toString(this))))
12271230 $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))
12281231 }
12291232
12301233
12311234
12321235 @Callable(i)
12331236 func evaluatePutByAmountAssetREADONLY (inAmAssetAmt) = {
12341237 let cfg = getPoolConfig()
12351238 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
12361239 let amAssetIdStr = cfg[idxAmtAssetId]
12371240 let amAssetId = fromBase58String(amAssetIdStr)
12381241 let prAssetIdStr = cfg[idxPriceAssetId]
12391242 let prAssetId = fromBase58String(prAssetIdStr)
12401243 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
12411244 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
12421245 let poolStatus = cfg[idxPoolStatus]
12431246 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
12441247 let accAmtAssetBalance = getAccBalance(amAssetIdStr)
12451248 let accPriceAssetBalance = getAccBalance(prAssetIdStr)
12461249 let amtAssetAmtX18 = toX18(accAmtAssetBalance, amtAssetDcm)
12471250 let priceAssetAmtX18 = toX18(accPriceAssetBalance, priceAssetDcm)
12481251 let curPriceX18 = if ((poolLPBalance == 0))
12491252 then zeroBigInt
12501253 else calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
12511254 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
12521255 let inPrAssetAmtX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18)
12531256 let inPrAssetAmt = fromX18(inPrAssetAmtX18, priceAssetDcm)
12541257 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
12551258 let calcLpAmt = estPut._1
12561259 let curPriceCalc = estPut._3
12571260 let amBalance = estPut._4
12581261 let prBalance = estPut._5
12591262 let lpEmission = estPut._6
12601263 $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))
12611264 }
12621265
12631266
12641267
12651268 @Callable(i)
12661269 func evaluatePutByPriceAssetREADONLY (inPrAssetAmt) = {
12671270 let cfg = getPoolConfig()
12681271 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
12691272 let amAssetIdStr = cfg[idxAmtAssetId]
12701273 let amAssetId = fromBase58String(amAssetIdStr)
12711274 let prAssetIdStr = cfg[idxPriceAssetId]
12721275 let prAssetId = fromBase58String(prAssetIdStr)
12731276 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
12741277 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
12751278 let poolStatus = cfg[idxPoolStatus]
12761279 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
12771280 let amBalanceRaw = getAccBalance(amAssetIdStr)
12781281 let prBalanceRaw = getAccBalance(prAssetIdStr)
12791282 let amBalanceRawX18 = toX18(amBalanceRaw, amtAssetDcm)
12801283 let prBalanceRawX18 = toX18(prBalanceRaw, priceAssetDcm)
12811284 let curPriceX18 = if ((poolLPBalance == 0))
12821285 then zeroBigInt
12831286 else calcPriceBigInt(prBalanceRawX18, amBalanceRawX18)
12841287 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
12851288 let inAmAssetAmtX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
12861289 let inAmAssetAmt = fromX18(inAmAssetAmtX18, amtAssetDcm)
12871290 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
12881291 let calcLpAmt = estPut._1
12891292 let curPriceCalc = estPut._3
12901293 let amBalance = estPut._4
12911294 let prBalance = estPut._5
12921295 let lpEmission = estPut._6
12931296 $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))
12941297 }
12951298
12961299
12971300
12981301 @Callable(i)
12991302 func evaluateGetREADONLY (paymentLpAssetId,paymentLpAmt) = {
13001303 let res = estimateGetOperation("", paymentLpAssetId, paymentLpAmt, this)
13011304 let outAmAmt = res._1
13021305 let outPrAmt = res._2
13031306 let amBalance = res._5
13041307 let prBalance = res._6
13051308 let lpEmission = res._7
13061309 let curPrice = res._8
13071310 let poolStatus = parseIntValue(res._9)
13081311 $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))
13091312 }
13101313
13111314
13121315 @Verifier(tx)
13131316 func verify () = {
13141317 let targetPublicKey = match managerPublicKeyOrUnit() {
13151318 case pk: ByteVector =>
13161319 pk
13171320 case _: Unit =>
13181321 tx.senderPublicKey
13191322 case _ =>
13201323 throw("Match error")
13211324 }
13221325 match tx {
13231326 case order: Order =>
13241327 let matcherPub = getMatcherPubOrFail()
13251328 let orderValid = validateMatcherOrderAllowed(order)
13261329 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
13271330 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
13281331 if (if (if (orderValid)
13291332 then senderValid
13301333 else false)
13311334 then matcherValid
13321335 else false)
13331336 then true
13341337 else throwOrderError(orderValid, senderValid, matcherValid)
13351338 case s: SetScriptTransaction =>
13361339 let newHash = blake2b256(value(s.script))
13371340 let allowedHash = fromBase64String(value(getString(factoryContract, keyAllowedLpScriptHash())))
13381341 let currentHash = scriptHash(this)
13391342 if (if ((allowedHash == newHash))
13401343 then (currentHash != newHash)
13411344 else false)
13421345 then true
13431346 else sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
13441347 case _ =>
13451348 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
13461349 }
13471350 }
13481351

github/deemru/w8io/026f985 
152.30 ms