tx · 3sHjbRCnxfoyff4hm4u9EKjkVNbqmsmAXu2za7EfZFaK

3N8xVsHSfRk1kVs9qDaRy8EW2vGAckYBWYg:  -0.02800000 Waves

2022.10.13 16:43 [2270659] smart account 3N8xVsHSfRk1kVs9qDaRy8EW2vGAckYBWYg > SELF 0.00000000 Waves

{ "type": 13, "id": "3sHjbRCnxfoyff4hm4u9EKjkVNbqmsmAXu2za7EfZFaK", "fee": 2800000, "feeAssetId": null, "timestamp": 1665668592214, "version": 1, "sender": "3N8xVsHSfRk1kVs9qDaRy8EW2vGAckYBWYg", "senderPublicKey": "5rAjX8jUZYc66owGPJ8QsVfavrMFqXKnkxj3puK23eyi", "proofs": [ "3u9VuWFVJXDuYQEHmCedVgnzk5tgSySinFgyxA3Wu6ka5CEdWRFueKCFYbwTq9x3LqQdVNgMewMYmCTJ28fBJ6EK" ], "script": "base64:BgLkJQgCEgMKAQgSABIECgIBBBIDCgEBEgQKAgEEEgUKAwgBARIAEgQKAgEBEgMKAQESBAoCCAgSABIDCgEIEgUKAwEBARIECgIBARIECgIIARIECgIICBILCgkIAQECAQIIBAQSBgoECAgBCBIAEgMKAQESAwoBARIECgIIASIKbFBkZWNpbWFscyIGc2NhbGU4IgxzY2FsZThCaWdJbnQiB3NjYWxlMTgiCnplcm9CaWdJbnQiBGJpZzAiBGJpZzEiBGJpZzIiC3dhdmVzU3RyaW5nIgNTRVAiClBvb2xBY3RpdmUiD1Bvb2xQdXREaXNhYmxlZCITUG9vbE1hdGNoZXJEaXNhYmxlZCIMUG9vbFNodXRkb3duIg5pZHhQb29sQWRkcmVzcyINaWR4UG9vbFN0YXR1cyIQaWR4UG9vbExQQXNzZXRJZCINaWR4QW10QXNzZXRJZCIPaWR4UHJpY2VBc3NldElkIg5pZHhBbXRBc3NldERjbSIQaWR4UHJpY2VBc3NldERjbSIOaWR4SUFtdEFzc2V0SWQiEGlkeElQcmljZUFzc2V0SWQiDWlkeExQQXNzZXREY20iEmlkeFBvb2xBbXRBc3Nld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MJAJEDAggFAmNIBnByb29mcwAACAUCY0gPc2VuZGVyUHVibGljS2V5BAJhdgkA9AMDCAUCY0gJYm9keUJ5dGVzCQCRAwIIBQJjSAZwcm9vZnMAAQUCZkEDAwMFAmF0BQJhdQcFAmF2BwYJAQJhcwMFAmF0BQJhdQUCYXYDCQABAgUCZGcCFFNldFNjcmlwdFRyYW5zYWN0aW9uBAJlcwUCZGcEAmZCCQD2AwEJAQV2YWx1ZQEIBQJlcwZzY3JpcHQEAmZDCQDbBAEJAQV2YWx1ZQEJAJ0IAgUCYUMJAQJhcQAEAmZECQDxBwEFBHRoaXMDAwkAAAIFAmZDBQJmQgkBAiE9AgUCZkQFAmZCBwYJAPQDAwgFAmZ4CWJvZHlCeXRlcwkAkQMCCAUCZngGcHJvb2ZzAAAFAmZ6CQD0AwMIBQJmeAlib2R5Qnl0ZXMJAJEDAggFAmZ4BnByb29mcwAABQJmerlLhmU=", "chainId": 84, "height": 2270659, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CQycKbaBhvNbaRjH3miKJLZxZVkoA49ZQY1Cervic1UW Next: 5GZssD77MwaAP6rJAJnRXaikhckGFC75x61qNvT8Nh6D Diff:
OldNewDifferences
100100 func pa () = "%s__priceAsset"
101101
102102
103+let keyFee = "%s__fee"
104+
105+let feeDefault = fraction(5, scale8, 10000)
106+
107+let fee = valueOrElse(getInteger(this, keyFee), feeDefault)
108+
103109 func keyFactoryConfig () = "%s__factoryConfig"
104110
105111
124130 func keyAllowedLpScriptHash () = "%s__allowedLpScriptHash"
125131
126132
133+let keyFeeCollectorAddress = "%s__feeCollectorAddress"
134+
127135 func throwOrderError (orderValid,senderValid,matcherValid) = throw(((((("order validation failed: orderValid=" + toString(orderValid)) + " senderValid=") + toString(senderValid)) + " matcherValid=") + toString(matcherValid)))
128136
129137
137145
138146
139147 let factoryContract = addressFromStringValue(getStringOrFail(this, fc()))
148+
149+let feeCollectorAddress = addressFromStringValue(getStringOrFail(factoryContract, keyFeeCollectorAddress))
140150
141151 func isGlobalShutdown () = valueOrElse(getBoolean(factoryContract, keyAllPoolsShutdown()), false)
142152
426436 }
427437
428438
439+func takeFee (amount) = {
440+ let feeAmount = fraction(amount, fee, scale8)
441+ $Tuple2((amount - feeAmount), feeAmount)
442+ }
443+
444+
429445 func calcPutOneToken (paymentAmountRaw,paymentAssetId,userAddress,txId) = {
430446 let isEval = (txId == unit)
431- let $t02148521663 = parsePoolConfig(getPoolConfig())
432- let poolAddress = $t02148521663._1
433- let poolStatus = $t02148521663._2
434- let lpAssetId = $t02148521663._3
435- let amountAssetId = $t02148521663._4
436- let priceAssetId = $t02148521663._5
437- let amountAssetDecimals = $t02148521663._6
438- let priceAssetDecimals = $t02148521663._7
439- let paymentAmount = paymentAmountRaw
440- let balanceRaw = if ((paymentAssetId == amountAssetId))
441- then getAccBalance(assetIdToString(amountAssetId))
447+ let $t02194222120 = parsePoolConfig(getPoolConfig())
448+ let poolAddress = $t02194222120._1
449+ let poolStatus = $t02194222120._2
450+ let lpAssetId = $t02194222120._3
451+ let amountAssetId = $t02194222120._4
452+ let priceAssetId = $t02194222120._5
453+ let amountAssetDecimals = $t02194222120._6
454+ let priceAssetDecimals = $t02194222120._7
455+ let amountBalanceRaw = getAccBalance(assetIdToString(amountAssetId))
456+ let priceBalanceRaw = getAccBalance(assetIdToString(priceAssetId))
457+ let paymentInAmountAsset = if ((paymentAssetId == amountAssetId))
458+ then true
442459 else if ((paymentAssetId == priceAssetId))
443- then getAccBalance(assetIdToString(priceAssetId))
460+ then false
444461 else throwErr("invalid asset")
445- let amountToSubtract = if (isEval)
446- then 0
447- else paymentAmount
448- let balance = (balanceRaw - amountToSubtract)
449- let balanceBigInt = toBigInt(balance)
462+ let $t02245022743 = if (isEval)
463+ then $Tuple2(amountBalanceRaw, priceBalanceRaw)
464+ else if (paymentInAmountAsset)
465+ then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw)
466+ else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw))
467+ let amountBalanceOld = $t02245022743._1
468+ let priceBalanceOld = $t02245022743._2
469+ let $t02274722896 = if (paymentInAmountAsset)
470+ then $Tuple2(paymentAmountRaw, 0)
471+ else $Tuple2(0, paymentAmountRaw)
472+ let amountAssetAmountRaw = $t02274722896._1
473+ let priceAssetAmountRaw = $t02274722896._2
474+ let amountAssetAmount = takeFee(amountAssetAmountRaw)._1
475+ let priceAssetAmount = takeFee(priceAssetAmountRaw)._1
476+ let $t02301823077 = takeFee(paymentAmountRaw)
477+ let paymentAmount = $t02301823077._1
478+ let feeAmount = $t02301823077._2
479+ let amountBalanceNew = (amountBalanceOld + amountAssetAmount)
480+ let priceBalanceNew = (priceBalanceOld + priceAssetAmount)
481+ let curPrice = fromX18(calcPriceBigInt(toX18(priceBalanceNew, priceAssetDecimals), toX18(amountBalanceNew, amountAssetDecimals)), scale8)
482+ let paymentBalance = if (paymentInAmountAsset)
483+ then amountBalanceOld
484+ else priceBalanceOld
485+ let paymentBalanceBigInt = toBigInt(paymentBalance)
450486 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(lpAssetId), (("asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity)
451- let depositBigInt = toBigInt(paymentAmount)
452- let issueAmount = ((supplyBigInt * (sqrtBigInt((scale8BigInt + ((depositBigInt * scale8BigInt) / balanceBigInt)), 8, 8, DOWN) - scale8BigInt)) / scale8BigInt)
453- toInt(issueAmount)
487+ let chechSupply = if ((supplyBigInt > big0))
488+ then true
489+ else throw("initial deposit requires all coins")
490+ if ((chechSupply == chechSupply))
491+ then {
492+ let depositBigInt = toBigInt(paymentAmount)
493+ let issueAmount = toInt(((supplyBigInt * (sqrtBigInt((scale8BigInt + ((depositBigInt * scale8BigInt) / paymentBalanceBigInt)), 8, 8, DOWN) - scale8BigInt)) / scale8BigInt))
494+ let commonState = if (isEval)
495+ then nil
496+ else [IntegerEntry(pl(), curPrice), IntegerEntry(ph(height, lastBlock.timestamp), curPrice), StringEntry(pau(toString(value(userAddress)), toBase58String(value(txId))), dataPutActionInfo(amountAssetAmountRaw, priceAssetAmountRaw, issueAmount, curPrice, 0, 0, height, lastBlock.timestamp, 0, 0))]
497+ let poolProportion = fraction(priceBalanceOld, scale8, amountBalanceOld)
498+ let amountAssetPart = fraction(paymentAmountRaw, scale8, (poolProportion + scale8))
499+ let priceAssetPart = (paymentAmountRaw - amountAssetPart)
500+ let lpAmtBoth = fraction(supplyBigInt, toBigInt(priceAssetPart), toBigInt(priceBalanceOld))
501+ let bonus = toInt(fraction((toBigInt(issueAmount) - lpAmtBoth), scale8BigInt, lpAmtBoth))
502+ $Tuple4(issueAmount, commonState, feeAmount, bonus)
503+ }
504+ else throw("Strict value is not equal to itself.")
454505 }
455506
456507
457508 func calcGetOneToken (outAssetId,paymentAmount,paymentAssetId,userAddress,txId) = {
458509 let isEval = (txId == unit)
459- let $t02267122849 = parsePoolConfig(getPoolConfig())
460- let poolAddress = $t02267122849._1
461- let poolStatus = $t02267122849._2
462- let lpAssetId = $t02267122849._3
463- let amountAssetId = $t02267122849._4
464- let priceAssetId = $t02267122849._5
465- let amountAssetDecimals = $t02267122849._6
466- let priceAssetDecimals = $t02267122849._7
510+ let $t02502725188 = parsePoolConfig(getPoolConfig())
511+ let poolAddress = $t02502725188._1
512+ let poolStatus = $t02502725188._2
513+ let lpAssetId = $t02502725188._3
514+ let amountAssetId = $t02502725188._4
515+ let priceAssetId = $t02502725188._5
516+ let amDecimals = $t02502725188._6
517+ let prDecimals = $t02502725188._7
467518 let checks = [if ((paymentAssetId == lpAssetId))
468519 then true
469520 else throw("invalid lp asset")]
470521 if ((checks == checks))
471522 then {
472- let balanceBigInt = if ((outAssetId == amountAssetId))
523+ let outInAmountAsset = if ((outAssetId == amountAssetId))
524+ then true
525+ else if ((outAssetId == priceAssetId))
526+ then false
527+ else throwErr("invalid asset")
528+ let balanceBigInt = if (outInAmountAsset)
473529 then toBigInt(getAccBalance(assetIdToString(amountAssetId)))
474- else if ((outAssetId == priceAssetId))
475- then toBigInt(getAccBalance(assetIdToString(priceAssetId)))
476- else throwErr("invalid asset")
530+ else toBigInt(getAccBalance(assetIdToString(priceAssetId)))
531+ let amBalanceOld = getAccBalance(assetIdToString(amountAssetId))
532+ let prBalanceOld = getAccBalance(assetIdToString(priceAssetId))
533+ let outBalance = if (outInAmountAsset)
534+ then amBalanceOld
535+ else prBalanceOld
536+ let outBalanceBigInt = toBigInt(outBalance)
477537 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(lpAssetId), (("asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity)
478538 let redeemedBigInt = toBigInt(paymentAmount)
479- let amount = ((balanceBigInt * (scale8BigInt - pow((scale8BigInt - ((redeemedBigInt * scale8BigInt) / supplyBigInt)), 8, big2, 0, 8, DOWN))) / scale8BigInt)
480- toInt(amount)
539+ let amountRaw = toInt(((balanceBigInt * (scale8BigInt - pow((scale8BigInt - ((redeemedBigInt * scale8BigInt) / supplyBigInt)), 8, big2, 0, 8, DOWN))) / scale8BigInt))
540+ let $t02625526305 = takeFee(amountRaw)
541+ let totalAmount = $t02625526305._1
542+ let feeAmount = $t02625526305._2
543+ let $t02630926535 = if (outInAmountAsset)
544+ then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld)
545+ else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw))
546+ let outAmAmount = $t02630926535._1
547+ let outPrAmount = $t02630926535._2
548+ let amBalanceNew = $t02630926535._3
549+ let prBalanceNew = $t02630926535._4
550+ let curPrX18 = calcPriceBigInt(toX18(prBalanceNew, prDecimals), toX18(amBalanceNew, amDecimals))
551+ let curPrice = fromX18(curPrX18, scale8)
552+ let commonState = if (isEval)
553+ then nil
554+ else [StringEntry(gau(toString(value(userAddress)), toBase58String(value(txId))), dataGetActionInfo(outAmAmount, outPrAmount, paymentAmount, curPrice, height, lastBlock.timestamp)), IntegerEntry(pl(), curPrice), IntegerEntry(ph(height, lastBlock.timestamp), curPrice)]
555+ let r = estimateGetOperation("", assetIdToString(lpAssetId), paymentAmount, this)
556+ let sumOfGetAssets = (r._1 + r._2)
557+ let bonus = fraction((totalAmount - sumOfGetAssets), scale8, sumOfGetAssets)
558+ $Tuple4(totalAmount, commonState, feeAmount, bonus)
481559 }
482560 else throw("Strict value is not equal to itself.")
483561 }
621699
622700 @Callable(i)
623701 func putOneTkn (minOutAmount,autoStake) = {
624- let $t02675626934 = parsePoolConfig(getPoolConfig())
625- let poolAddress = $t02675626934._1
626- let poolStatus = $t02675626934._2
627- let lpAssetId = $t02675626934._3
628- let amountAssetId = $t02675626934._4
629- let priceAssetId = $t02675626934._5
630- let amountAssetDecimals = $t02675626934._6
631- let priceAssetDecimals = $t02675626934._7
702+ let $t03042630604 = parsePoolConfig(getPoolConfig())
703+ let poolAddress = $t03042630604._1
704+ let poolStatus = $t03042630604._2
705+ let lpAssetId = $t03042630604._3
706+ let amountAssetId = $t03042630604._4
707+ let priceAssetId = $t03042630604._5
708+ let amountAssetDecimals = $t03042630604._6
709+ let priceAssetDecimals = $t03042630604._7
632710 let isPutDisabled = if (if (isGlobalShutdown())
633711 then true
634712 else (poolStatus == PoolPutDisabled))
647725 let paymentAmount = paymentAmountRaw
648726 let userAddress = i.caller
649727 let txId = i.transactionId
650- let emitAmount = {
651- let emitAmountEstimated = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
652- if (if ((minOutAmount > 0))
653- then (minOutAmount > emitAmountEstimated)
654- else false)
655- then throw(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
656- else emitAmountEstimated
657- }
728+ let $t03109131218 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
729+ let emitAmountEstimated = $t03109131218._1
730+ let commonState = $t03109131218._2
731+ let feeAmount = $t03109131218._3
732+ let bonus = $t03109131218._4
733+ let emitAmount = if (if ((minOutAmount > 0))
734+ then (minOutAmount > emitAmountEstimated)
735+ else false)
736+ then throw(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
737+ else emitAmountEstimated
658738 let emitInv = emit(emitAmount)
659739 if ((emitInv == emitInv))
660740 then {
666746 else throw("Strict value is not equal to itself.")
667747 }
668748 else [ScriptTransfer(i.caller, emitAmount, lpAssetId)]
669- $Tuple2(lpTransfer, emitAmount)
749+ let sendFee = if ((feeAmount > 0))
750+ then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
751+ else nil
752+ $Tuple2(((commonState ++ lpTransfer) ++ sendFee), emitAmount)
670753 }
671754 else throw("Strict value is not equal to itself.")
672755 }
677760
678761 @Callable(i)
679762 func getOneTkn (outAssetId,minOutAmount,unstakeAmount) = {
680- let $t02816728345 = parsePoolConfig(getPoolConfig())
681- let poolAddress = $t02816728345._1
682- let poolStatus = $t02816728345._2
683- let lpAssetId = $t02816728345._3
684- let amountAssetId = $t02816728345._4
685- let priceAssetId = $t02816728345._5
686- let amountAssetDecimals = $t02816728345._6
687- let priceAssetDecimals = $t02816728345._7
763+ let $t03194232120 = parsePoolConfig(getPoolConfig())
764+ let poolAddress = $t03194232120._1
765+ let poolStatus = $t03194232120._2
766+ let lpAssetId = $t03194232120._3
767+ let amountAssetId = $t03194232120._4
768+ let priceAssetId = $t03194232120._5
769+ let amountAssetDecimals = $t03194232120._6
770+ let priceAssetDecimals = $t03194232120._7
688771 let isGetDisabled = if (isGlobalShutdown())
689772 then true
690773 else (poolStatus == PoolShutdown)
700783 let paymentAmount = payment.amount
701784 let userAddress = i.caller
702785 let txId = i.transactionId
703- let amount = {
704- let amountEstimated = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, paymentAssetId, userAddress, txId)
705- if (if ((minOutAmount > 0))
706- then (minOutAmount > amountEstimated)
707- else false)
708- then throw(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
709- else amountEstimated
710- }
786+ let $t03253132678 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, paymentAssetId, userAddress, txId)
787+ let amountEstimated = $t03253132678._1
788+ let commonState = $t03253132678._2
789+ let feeAmount = $t03253132678._3
790+ let bonus = $t03253132678._4
791+ let amount = if (if ((minOutAmount > 0))
792+ then (minOutAmount > amountEstimated)
793+ else false)
794+ then throw(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
795+ else amountEstimated
711796 let burnInv = invoke(factoryContract, "burn", [paymentAmount], [AttachedPayment(paymentAssetId, paymentAmount)])
712797 if ((burnInv == burnInv))
713798 then {
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(1)
1919
2020 let wavesString = "WAVES"
2121
2222 let SEP = "__"
2323
2424 let PoolActive = 1
2525
2626 let PoolPutDisabled = 2
2727
2828 let PoolMatcherDisabled = 3
2929
3030 let PoolShutdown = 4
3131
3232 let idxPoolAddress = 1
3333
3434 let idxPoolStatus = 2
3535
3636 let idxPoolLPAssetId = 3
3737
3838 let idxAmtAssetId = 4
3939
4040 let idxPriceAssetId = 5
4141
4242 let idxAmtAssetDcm = 6
4343
4444 let idxPriceAssetDcm = 7
4545
4646 let idxIAmtAssetId = 8
4747
4848 let idxIPriceAssetId = 9
4949
5050 let idxLPAssetDcm = 10
5151
5252 let idxPoolAmtAssetAmt = 1
5353
5454 let idxPoolPriceAssetAmt = 2
5555
5656 let idxPoolLPAssetAmt = 3
5757
5858 let idxFactoryStakingContract = 1
5959
6060 let idxFactorySlippageContract = 7
6161
6262 func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), scale18, toBigInt(origScaleMult))
6363
6464
6565 func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), scale18))
6666
6767
6868 func toScale (amt,resScale,curScale) = fraction(amt, resScale, curScale)
6969
7070
7171 func abs (val) = if ((zeroBigInt > val))
7272 then -(val)
7373 else val
7474
7575
7676 func fc () = "%s__factoryContract"
7777
7878
7979 func mpk () = "%s__managerPublicKey"
8080
8181
8282 func pmpk () = "%s__pendingManagerPublicKey"
8383
8484
8585 func pl () = "%s%s__price__last"
8686
8787
8888 func ph (h,timestamp) = makeString(["%s%s%d%d__price__history", toString(h), toString(timestamp)], SEP)
8989
9090
9191 func pau (userAddress,txId) = ((("%s%s%s__P__" + userAddress) + "__") + txId)
9292
9393
9494 func gau (userAddress,txId) = ((("%s%s%s__G__" + userAddress) + "__") + txId)
9595
9696
9797 func aa () = "%s__amountAsset"
9898
9999
100100 func pa () = "%s__priceAsset"
101101
102102
103+let keyFee = "%s__fee"
104+
105+let feeDefault = fraction(5, scale8, 10000)
106+
107+let fee = valueOrElse(getInteger(this, keyFee), feeDefault)
108+
103109 func keyFactoryConfig () = "%s__factoryConfig"
104110
105111
106112 func keyMatcherPub () = "%s%s__matcher__publicKey"
107113
108114
109115 func keyMappingPoolContractAddressToPoolAssets (poolContractAddress) = (("%s%s%s__" + poolContractAddress) + "__mappings__poolContract2LpAsset")
110116
111117
112118 func keyPoolConfig (iAmtAsset,iPriceAsset) = (((("%d%d%s__" + iAmtAsset) + "__") + iPriceAsset) + "__config")
113119
114120
115121 func keyMappingsBaseAsset2internalId (baseAssetStr) = ("%s%s%s__mappings__baseAsset2internalId__" + baseAssetStr)
116122
117123
118124 func keyAllPoolsShutdown () = "%s__shutdown"
119125
120126
121127 func keyPoolWeight (contractAddress) = ("%s%s__poolWeight__" + contractAddress)
122128
123129
124130 func keyAllowedLpScriptHash () = "%s__allowedLpScriptHash"
125131
126132
133+let keyFeeCollectorAddress = "%s__feeCollectorAddress"
134+
127135 func throwOrderError (orderValid,senderValid,matcherValid) = throw(((((("order validation failed: orderValid=" + toString(orderValid)) + " senderValid=") + toString(senderValid)) + " matcherValid=") + toString(matcherValid)))
128136
129137
130138 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
131139
132140
133141 func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
134142
135143
136144 func throwErr (msg) = throw(makeString(["lp.ride:", msg], " "))
137145
138146
139147 let factoryContract = addressFromStringValue(getStringOrFail(this, fc()))
148+
149+let feeCollectorAddress = addressFromStringValue(getStringOrFail(factoryContract, keyFeeCollectorAddress))
140150
141151 func isGlobalShutdown () = valueOrElse(getBoolean(factoryContract, keyAllPoolsShutdown()), false)
142152
143153
144154 func getMatcherPubOrFail () = fromBase58String(getStringOrFail(factoryContract, keyMatcherPub()))
145155
146156
147157 func getPoolConfig () = {
148158 let amtAsset = getStringOrFail(this, aa())
149159 let priceAsset = getStringOrFail(this, pa())
150160 let iPriceAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(priceAsset))
151161 let iAmtAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(amtAsset))
152162 split(getStringOrFail(factoryContract, keyPoolConfig(toString(iAmtAsset), toString(iPriceAsset))), SEP)
153163 }
154164
155165
156166 func parseAssetId (input) = if ((input == wavesString))
157167 then unit
158168 else fromBase58String(input)
159169
160170
161171 func assetIdToString (input) = if ((input == unit))
162172 then wavesString
163173 else toBase58String(value(input))
164174
165175
166176 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]))
167177
168178
169179 func getFactoryConfig () = split(getStringOrFail(factoryContract, keyFactoryConfig()), SEP)
170180
171181
172182 let stakingContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactoryStakingContract]), "incorrect staking address")
173183
174184 let slippageContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactorySlippageContract]), "incorrect staking address")
175185
176186 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)
177187
178188
179189 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)
180190
181191
182192 func getAccBalance (assetId) = if ((assetId == "WAVES"))
183193 then wavesBalance(this).available
184194 else assetBalance(this, fromBase58String(assetId))
185195
186196
187197 func calcPriceBigInt (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18)
188198
189199
190200 func privateCalcPrice (amAssetDcm,prAssetDcm,amAmt,prAmt) = {
191201 let amtAssetAmtX18 = toX18(amAmt, amAssetDcm)
192202 let priceAssetAmtX18 = toX18(prAmt, prAssetDcm)
193203 calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
194204 }
195205
196206
197207 func calcPrices (amAmt,prAmt,lpAmt) = {
198208 let cfg = getPoolConfig()
199209 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
200210 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
201211 let priceX18 = privateCalcPrice(amtAssetDcm, priceAssetDcm, amAmt, prAmt)
202212 let amAmtX18 = toX18(amAmt, amtAssetDcm)
203213 let prAmtX18 = toX18(prAmt, priceAssetDcm)
204214 let lpAmtX18 = toX18(lpAmt, scale8)
205215 let lpPriceInAmAssetX18 = calcPriceBigInt(amAmtX18, lpAmtX18)
206216 let lpPriceInPrAssetX18 = calcPriceBigInt(prAmtX18, lpAmtX18)
207217 [priceX18, lpPriceInAmAssetX18, lpPriceInPrAssetX18]
208218 }
209219
210220
211221 func calculatePrices (amAmt,prAmt,lpAmt) = {
212222 let prices = calcPrices(amAmt, prAmt, lpAmt)
213223 [fromX18(prices[0], scale8), fromX18(prices[1], scale8), fromX18(prices[2], scale8)]
214224 }
215225
216226
217227 func estimateGetOperation (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
218228 let cfg = getPoolConfig()
219229 let lpAssetId = cfg[idxPoolLPAssetId]
220230 let amAssetId = cfg[idxAmtAssetId]
221231 let prAssetId = cfg[idxPriceAssetId]
222232 let amAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
223233 let prAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
224234 let poolStatus = cfg[idxPoolStatus]
225235 let lpEmission = valueOrErrorMessage(assetInfo(fromBase58String(lpAssetId)), (("Asset " + lpAssetId) + " doesn't exist")).quantity
226236 if ((lpAssetId != pmtAssetId))
227237 then throw("Invalid asset passed.")
228238 else {
229239 let amBalance = getAccBalance(amAssetId)
230240 let amBalanceX18 = toX18(amBalance, amAssetDcm)
231241 let prBalance = getAccBalance(prAssetId)
232242 let prBalanceX18 = toX18(prBalance, prAssetDcm)
233243 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
234244 let curPrice = fromX18(curPriceX18, scale8)
235245 let pmtLpAmtX18 = toX18(pmtLpAmt, scale8)
236246 let lpEmissionX18 = toX18(lpEmission, scale8)
237247 let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissionX18)
238248 let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissionX18)
239249 let outAmAmt = fromX18(outAmAmtX18, amAssetDcm)
240250 let outPrAmt = fromX18(outPrAmtX18, prAssetDcm)
241251 let state = if ((txId58 == ""))
242252 then nil
243253 else [ScriptTransfer(userAddress, outAmAmt, if ((amAssetId == "WAVES"))
244254 then unit
245255 else fromBase58String(amAssetId)), ScriptTransfer(userAddress, outPrAmt, if ((prAssetId == "WAVES"))
246256 then unit
247257 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)]
248258 $Tuple10(outAmAmt, outPrAmt, amAssetId, prAssetId, amBalance, prBalance, lpEmission, curPriceX18, poolStatus, state)
249259 }
250260 }
251261
252262
253263 func estimatePutOperation (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = {
254264 let cfg = getPoolConfig()
255265 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
256266 let amAssetIdStr = cfg[idxAmtAssetId]
257267 let prAssetIdStr = cfg[idxPriceAssetId]
258268 let iAmtAssetId = cfg[idxIAmtAssetId]
259269 let iPriceAssetId = cfg[idxIPriceAssetId]
260270 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
261271 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
262272 let poolStatus = cfg[idxPoolStatus]
263273 let lpEmission = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
264274 let inAmAssetIdStr = toBase58String(valueOrElse(inAmAssetId, fromBase58String("WAVES")))
265275 let inPrAssetIdStr = toBase58String(valueOrElse(inPrAssetId, fromBase58String("WAVES")))
266276 if (if ((amAssetIdStr != inAmAssetIdStr))
267277 then true
268278 else (prAssetIdStr != inPrAssetIdStr))
269279 then throw("Invalid amt or price asset passed.")
270280 else {
271281 let amBalance = if (isEvaluate)
272282 then getAccBalance(amAssetIdStr)
273283 else (getAccBalance(amAssetIdStr) - inAmAssetAmt)
274284 let prBalance = if (isEvaluate)
275285 then getAccBalance(prAssetIdStr)
276286 else (getAccBalance(prAssetIdStr) - inPrAssetAmt)
277287 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
278288 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
279289 let userPriceX18 = calcPriceBigInt(inPrAssetAmtX18, inAmAssetAmtX18)
280290 let amBalanceX18 = toX18(amBalance, amtAssetDcm)
281291 let prBalanceX18 = toX18(prBalance, priceAssetDcm)
282292 let res = if ((lpEmission == 0))
283293 then {
284294 let curPriceX18 = zeroBigInt
285295 let slippageX18 = zeroBigInt
286296 let lpAmtX18 = pow((inAmAssetAmtX18 * inPrAssetAmtX18), 0, toBigInt(5), 1, 0, DOWN)
287297 $Tuple5(fromX18(lpAmtX18, scale8), fromX18(inAmAssetAmtX18, amtAssetDcm), fromX18(inPrAssetAmtX18, priceAssetDcm), calcPriceBigInt((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18)
288298 }
289299 else {
290300 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
291301 let slippageX18 = fraction(abs((curPriceX18 - userPriceX18)), scale18, curPriceX18)
292302 let slippageToleranceX18 = toX18(slippageTolerance, scale8)
293303 if (if ((curPriceX18 != zeroBigInt))
294304 then (slippageX18 > slippageToleranceX18)
295305 else false)
296306 then throw(((("Price slippage " + toString(slippageX18)) + " exceeded the passed limit of ") + toString(slippageToleranceX18)))
297307 else {
298308 let lpEmissionX18 = toX18(lpEmission, scale8)
299309 let prViaAmX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18)
300310 let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
301311 let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18))
302312 then $Tuple2(amViaPrX18, inPrAssetAmtX18)
303313 else $Tuple2(inAmAssetAmtX18, prViaAmX18)
304314 let expAmtAssetAmtX18 = expectedAmts._1
305315 let expPriceAssetAmtX18 = expectedAmts._2
306316 let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18)
307317 $Tuple5(fromX18(lpAmtX18, scale8), fromX18(expAmtAssetAmtX18, amtAssetDcm), fromX18(expPriceAssetAmtX18, priceAssetDcm), curPriceX18, slippageX18)
308318 }
309319 }
310320 let calcLpAmt = res._1
311321 let calcAmAssetPmt = res._2
312322 let calcPrAssetPmt = res._3
313323 let curPrice = fromX18(res._4, scale8)
314324 let slippageCalc = fromX18(res._5, scale8)
315325 if ((0 >= calcLpAmt))
316326 then throw("Invalid calculations. LP calculated is less than zero.")
317327 else {
318328 let emitLpAmt = if (!(emitLp))
319329 then 0
320330 else calcLpAmt
321331 let amDiff = (inAmAssetAmt - calcAmAssetPmt)
322332 let prDiff = (inPrAssetAmt - calcPrAssetPmt)
323333 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))]
324334 $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEmission, lpAssetId, poolStatus, commonState, amDiff, prDiff, inAmAssetId, inPrAssetId)
325335 }
326336 }
327337 }
328338
329339
330340 func validateMatcherOrderAllowed (order) = {
331341 let cfg = getPoolConfig()
332342 let amtAssetId = cfg[idxAmtAssetId]
333343 let priceAssetId = cfg[idxPriceAssetId]
334344 let poolStatus = parseIntValue(cfg[idxPoolStatus])
335345 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
336346 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
337347 let accAmtAssetBalance = getAccBalance(amtAssetId)
338348 let accPriceAssetBalance = getAccBalance(priceAssetId)
339349 let curPriceX18 = if ((order.orderType == Buy))
340350 then privateCalcPrice(amtAssetDcm, priceAssetDcm, (accAmtAssetBalance + order.amount), accPriceAssetBalance)
341351 else privateCalcPrice(amtAssetDcm, priceAssetDcm, (accAmtAssetBalance - order.amount), accPriceAssetBalance)
342352 let curPrice = fromX18(curPriceX18, scale8)
343353 if (if (if (isGlobalShutdown())
344354 then true
345355 else (poolStatus == PoolMatcherDisabled))
346356 then true
347357 else (poolStatus == PoolShutdown))
348358 then throw("Exchange operations disabled")
349359 else {
350360 let orderAmtAsset = order.assetPair.amountAsset
351361 let orderAmtAssetStr = if ((orderAmtAsset == unit))
352362 then "WAVES"
353363 else toBase58String(value(orderAmtAsset))
354364 let orderPriceAsset = order.assetPair.priceAsset
355365 let orderPriceAssetStr = if ((orderPriceAsset == unit))
356366 then "WAVES"
357367 else toBase58String(value(orderPriceAsset))
358368 if (if ((orderAmtAssetStr != amtAssetId))
359369 then true
360370 else (orderPriceAssetStr != priceAssetId))
361371 then throw("Wrong order assets.")
362372 else {
363373 let orderPrice = order.price
364374 let priceDcm = fraction(scale8, priceAssetDcm, amtAssetDcm)
365375 let castedOrderPrice = toScale(orderPrice, scale8, priceDcm)
366376 let isOrderPriceValid = if ((order.orderType == Buy))
367377 then (curPrice >= castedOrderPrice)
368378 else (castedOrderPrice >= curPrice)
369379 true
370380 }
371381 }
372382 }
373383
374384
375385 func commonGet (i) = if ((size(i.payments) != 1))
376386 then throw("exactly 1 payment is expected")
377387 else {
378388 let pmt = value(i.payments[0])
379389 let pmtAssetId = value(pmt.assetId)
380390 let pmtAmt = pmt.amount
381391 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller)
382392 let outAmAmt = res._1
383393 let outPrAmt = res._2
384394 let poolStatus = parseIntValue(res._9)
385395 let state = res._10
386396 if (if (isGlobalShutdown())
387397 then true
388398 else (poolStatus == PoolShutdown))
389399 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
390400 else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state)
391401 }
392402
393403
394404 func commonPut (i,slippageTolerance,emitLp) = if ((size(i.payments) != 2))
395405 then throw("exactly 2 payments are expected")
396406 else {
397407 let amAssetPmt = value(i.payments[0])
398408 let prAssetPmt = value(i.payments[1])
399409 let estPut = estimatePutOperation(toBase58String(i.transactionId), slippageTolerance, amAssetPmt.amount, amAssetPmt.assetId, prAssetPmt.amount, prAssetPmt.assetId, toString(i.caller), false, emitLp)
400410 let poolStatus = parseIntValue(estPut._8)
401411 if (if (if (isGlobalShutdown())
402412 then true
403413 else (poolStatus == PoolPutDisabled))
404414 then true
405415 else (poolStatus == PoolShutdown))
406416 then throw(("Put operation is blocked by admin. Status = " + toString(poolStatus)))
407417 else estPut
408418 }
409419
410420
411421 func emit (amount) = {
412422 let emitInv = invoke(factoryContract, "emit", [amount], nil)
413423 if ((emitInv == emitInv))
414424 then {
415425 let emitInvLegacy = match emitInv {
416426 case legacyFactoryContract: Address =>
417427 invoke(legacyFactoryContract, "emit", [amount], nil)
418428 case _ =>
419429 unit
420430 }
421431 if ((emitInvLegacy == emitInvLegacy))
422432 then amount
423433 else throw("Strict value is not equal to itself.")
424434 }
425435 else throw("Strict value is not equal to itself.")
426436 }
427437
428438
439+func takeFee (amount) = {
440+ let feeAmount = fraction(amount, fee, scale8)
441+ $Tuple2((amount - feeAmount), feeAmount)
442+ }
443+
444+
429445 func calcPutOneToken (paymentAmountRaw,paymentAssetId,userAddress,txId) = {
430446 let isEval = (txId == unit)
431- let $t02148521663 = parsePoolConfig(getPoolConfig())
432- let poolAddress = $t02148521663._1
433- let poolStatus = $t02148521663._2
434- let lpAssetId = $t02148521663._3
435- let amountAssetId = $t02148521663._4
436- let priceAssetId = $t02148521663._5
437- let amountAssetDecimals = $t02148521663._6
438- let priceAssetDecimals = $t02148521663._7
439- let paymentAmount = paymentAmountRaw
440- let balanceRaw = if ((paymentAssetId == amountAssetId))
441- then getAccBalance(assetIdToString(amountAssetId))
447+ let $t02194222120 = parsePoolConfig(getPoolConfig())
448+ let poolAddress = $t02194222120._1
449+ let poolStatus = $t02194222120._2
450+ let lpAssetId = $t02194222120._3
451+ let amountAssetId = $t02194222120._4
452+ let priceAssetId = $t02194222120._5
453+ let amountAssetDecimals = $t02194222120._6
454+ let priceAssetDecimals = $t02194222120._7
455+ let amountBalanceRaw = getAccBalance(assetIdToString(amountAssetId))
456+ let priceBalanceRaw = getAccBalance(assetIdToString(priceAssetId))
457+ let paymentInAmountAsset = if ((paymentAssetId == amountAssetId))
458+ then true
442459 else if ((paymentAssetId == priceAssetId))
443- then getAccBalance(assetIdToString(priceAssetId))
460+ then false
444461 else throwErr("invalid asset")
445- let amountToSubtract = if (isEval)
446- then 0
447- else paymentAmount
448- let balance = (balanceRaw - amountToSubtract)
449- let balanceBigInt = toBigInt(balance)
462+ let $t02245022743 = if (isEval)
463+ then $Tuple2(amountBalanceRaw, priceBalanceRaw)
464+ else if (paymentInAmountAsset)
465+ then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw)
466+ else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw))
467+ let amountBalanceOld = $t02245022743._1
468+ let priceBalanceOld = $t02245022743._2
469+ let $t02274722896 = if (paymentInAmountAsset)
470+ then $Tuple2(paymentAmountRaw, 0)
471+ else $Tuple2(0, paymentAmountRaw)
472+ let amountAssetAmountRaw = $t02274722896._1
473+ let priceAssetAmountRaw = $t02274722896._2
474+ let amountAssetAmount = takeFee(amountAssetAmountRaw)._1
475+ let priceAssetAmount = takeFee(priceAssetAmountRaw)._1
476+ let $t02301823077 = takeFee(paymentAmountRaw)
477+ let paymentAmount = $t02301823077._1
478+ let feeAmount = $t02301823077._2
479+ let amountBalanceNew = (amountBalanceOld + amountAssetAmount)
480+ let priceBalanceNew = (priceBalanceOld + priceAssetAmount)
481+ let curPrice = fromX18(calcPriceBigInt(toX18(priceBalanceNew, priceAssetDecimals), toX18(amountBalanceNew, amountAssetDecimals)), scale8)
482+ let paymentBalance = if (paymentInAmountAsset)
483+ then amountBalanceOld
484+ else priceBalanceOld
485+ let paymentBalanceBigInt = toBigInt(paymentBalance)
450486 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(lpAssetId), (("asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity)
451- let depositBigInt = toBigInt(paymentAmount)
452- let issueAmount = ((supplyBigInt * (sqrtBigInt((scale8BigInt + ((depositBigInt * scale8BigInt) / balanceBigInt)), 8, 8, DOWN) - scale8BigInt)) / scale8BigInt)
453- toInt(issueAmount)
487+ let chechSupply = if ((supplyBigInt > big0))
488+ then true
489+ else throw("initial deposit requires all coins")
490+ if ((chechSupply == chechSupply))
491+ then {
492+ let depositBigInt = toBigInt(paymentAmount)
493+ let issueAmount = toInt(((supplyBigInt * (sqrtBigInt((scale8BigInt + ((depositBigInt * scale8BigInt) / paymentBalanceBigInt)), 8, 8, DOWN) - scale8BigInt)) / scale8BigInt))
494+ let commonState = if (isEval)
495+ then nil
496+ else [IntegerEntry(pl(), curPrice), IntegerEntry(ph(height, lastBlock.timestamp), curPrice), StringEntry(pau(toString(value(userAddress)), toBase58String(value(txId))), dataPutActionInfo(amountAssetAmountRaw, priceAssetAmountRaw, issueAmount, curPrice, 0, 0, height, lastBlock.timestamp, 0, 0))]
497+ let poolProportion = fraction(priceBalanceOld, scale8, amountBalanceOld)
498+ let amountAssetPart = fraction(paymentAmountRaw, scale8, (poolProportion + scale8))
499+ let priceAssetPart = (paymentAmountRaw - amountAssetPart)
500+ let lpAmtBoth = fraction(supplyBigInt, toBigInt(priceAssetPart), toBigInt(priceBalanceOld))
501+ let bonus = toInt(fraction((toBigInt(issueAmount) - lpAmtBoth), scale8BigInt, lpAmtBoth))
502+ $Tuple4(issueAmount, commonState, feeAmount, bonus)
503+ }
504+ else throw("Strict value is not equal to itself.")
454505 }
455506
456507
457508 func calcGetOneToken (outAssetId,paymentAmount,paymentAssetId,userAddress,txId) = {
458509 let isEval = (txId == unit)
459- let $t02267122849 = parsePoolConfig(getPoolConfig())
460- let poolAddress = $t02267122849._1
461- let poolStatus = $t02267122849._2
462- let lpAssetId = $t02267122849._3
463- let amountAssetId = $t02267122849._4
464- let priceAssetId = $t02267122849._5
465- let amountAssetDecimals = $t02267122849._6
466- let priceAssetDecimals = $t02267122849._7
510+ let $t02502725188 = parsePoolConfig(getPoolConfig())
511+ let poolAddress = $t02502725188._1
512+ let poolStatus = $t02502725188._2
513+ let lpAssetId = $t02502725188._3
514+ let amountAssetId = $t02502725188._4
515+ let priceAssetId = $t02502725188._5
516+ let amDecimals = $t02502725188._6
517+ let prDecimals = $t02502725188._7
467518 let checks = [if ((paymentAssetId == lpAssetId))
468519 then true
469520 else throw("invalid lp asset")]
470521 if ((checks == checks))
471522 then {
472- let balanceBigInt = if ((outAssetId == amountAssetId))
523+ let outInAmountAsset = if ((outAssetId == amountAssetId))
524+ then true
525+ else if ((outAssetId == priceAssetId))
526+ then false
527+ else throwErr("invalid asset")
528+ let balanceBigInt = if (outInAmountAsset)
473529 then toBigInt(getAccBalance(assetIdToString(amountAssetId)))
474- else if ((outAssetId == priceAssetId))
475- then toBigInt(getAccBalance(assetIdToString(priceAssetId)))
476- else throwErr("invalid asset")
530+ else toBigInt(getAccBalance(assetIdToString(priceAssetId)))
531+ let amBalanceOld = getAccBalance(assetIdToString(amountAssetId))
532+ let prBalanceOld = getAccBalance(assetIdToString(priceAssetId))
533+ let outBalance = if (outInAmountAsset)
534+ then amBalanceOld
535+ else prBalanceOld
536+ let outBalanceBigInt = toBigInt(outBalance)
477537 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(lpAssetId), (("asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity)
478538 let redeemedBigInt = toBigInt(paymentAmount)
479- let amount = ((balanceBigInt * (scale8BigInt - pow((scale8BigInt - ((redeemedBigInt * scale8BigInt) / supplyBigInt)), 8, big2, 0, 8, DOWN))) / scale8BigInt)
480- toInt(amount)
539+ let amountRaw = toInt(((balanceBigInt * (scale8BigInt - pow((scale8BigInt - ((redeemedBigInt * scale8BigInt) / supplyBigInt)), 8, big2, 0, 8, DOWN))) / scale8BigInt))
540+ let $t02625526305 = takeFee(amountRaw)
541+ let totalAmount = $t02625526305._1
542+ let feeAmount = $t02625526305._2
543+ let $t02630926535 = if (outInAmountAsset)
544+ then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld)
545+ else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw))
546+ let outAmAmount = $t02630926535._1
547+ let outPrAmount = $t02630926535._2
548+ let amBalanceNew = $t02630926535._3
549+ let prBalanceNew = $t02630926535._4
550+ let curPrX18 = calcPriceBigInt(toX18(prBalanceNew, prDecimals), toX18(amBalanceNew, amDecimals))
551+ let curPrice = fromX18(curPrX18, scale8)
552+ let commonState = if (isEval)
553+ then nil
554+ else [StringEntry(gau(toString(value(userAddress)), toBase58String(value(txId))), dataGetActionInfo(outAmAmount, outPrAmount, paymentAmount, curPrice, height, lastBlock.timestamp)), IntegerEntry(pl(), curPrice), IntegerEntry(ph(height, lastBlock.timestamp), curPrice)]
555+ let r = estimateGetOperation("", assetIdToString(lpAssetId), paymentAmount, this)
556+ let sumOfGetAssets = (r._1 + r._2)
557+ let bonus = fraction((totalAmount - sumOfGetAssets), scale8, sumOfGetAssets)
558+ $Tuple4(totalAmount, commonState, feeAmount, bonus)
481559 }
482560 else throw("Strict value is not equal to itself.")
483561 }
484562
485563
486564 func managerPublicKeyOrUnit () = match getString(mpk()) {
487565 case s: String =>
488566 fromBase58String(s)
489567 case _: Unit =>
490568 unit
491569 case _ =>
492570 throw("Match error")
493571 }
494572
495573
496574 func pendingManagerPublicKeyOrUnit () = match getString(pmpk()) {
497575 case s: String =>
498576 fromBase58String(s)
499577 case _: Unit =>
500578 unit
501579 case _ =>
502580 throw("Match error")
503581 }
504582
505583
506584 func mustManager (i) = {
507585 let pd = throw("Permission denied")
508586 match managerPublicKeyOrUnit() {
509587 case pk: ByteVector =>
510588 if ((i.callerPublicKey == pk))
511589 then true
512590 else pd
513591 case _: Unit =>
514592 if ((i.caller == this))
515593 then true
516594 else pd
517595 case _ =>
518596 throw("Match error")
519597 }
520598 }
521599
522600
523601 @Callable(i)
524602 func setManager (pendingManagerPublicKey) = {
525603 let checkCaller = mustManager(i)
526604 if ((checkCaller == checkCaller))
527605 then {
528606 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
529607 if ((checkManagerPublicKey == checkManagerPublicKey))
530608 then [StringEntry(pmpk(), pendingManagerPublicKey)]
531609 else throw("Strict value is not equal to itself.")
532610 }
533611 else throw("Strict value is not equal to itself.")
534612 }
535613
536614
537615
538616 @Callable(i)
539617 func confirmManager () = {
540618 let pm = pendingManagerPublicKeyOrUnit()
541619 let hasPM = if (isDefined(pm))
542620 then true
543621 else throw("No pending manager")
544622 if ((hasPM == hasPM))
545623 then {
546624 let checkPM = if ((i.callerPublicKey == value(pm)))
547625 then true
548626 else throw("You are not pending manager")
549627 if ((checkPM == checkPM))
550628 then [StringEntry(mpk(), toBase58String(value(pm))), DeleteEntry(pmpk())]
551629 else throw("Strict value is not equal to itself.")
552630 }
553631 else throw("Strict value is not equal to itself.")
554632 }
555633
556634
557635
558636 @Callable(i)
559637 func put (slippageTolerance,shouldAutoStake) = if ((0 > slippageTolerance))
560638 then throw("Invalid slippageTolerance passed")
561639 else {
562640 let estPut = commonPut(i, slippageTolerance, true)
563641 let emitLpAmt = estPut._2
564642 let lpAssetId = estPut._7
565643 let state = estPut._9
566644 let amDiff = estPut._10
567645 let prDiff = estPut._11
568646 let amId = estPut._12
569647 let prId = estPut._13
570648 let emitInv = invoke(factoryContract, "emit", [emitLpAmt], nil)
571649 if ((emitInv == emitInv))
572650 then {
573651 let emitInvLegacy = match emitInv {
574652 case legacyFactoryContract: Address =>
575653 invoke(legacyFactoryContract, "emit", [emitLpAmt], nil)
576654 case _ =>
577655 unit
578656 }
579657 if ((emitInvLegacy == emitInvLegacy))
580658 then {
581659 let slippageAInv = if ((amDiff > 0))
582660 then invoke(slippageContract, "put", nil, [AttachedPayment(amId, amDiff)])
583661 else nil
584662 if ((slippageAInv == slippageAInv))
585663 then {
586664 let slippagePInv = if ((prDiff > 0))
587665 then invoke(slippageContract, "put", nil, [AttachedPayment(prId, prDiff)])
588666 else nil
589667 if ((slippagePInv == slippagePInv))
590668 then {
591669 let lpTransfer = if (shouldAutoStake)
592670 then {
593671 let slpStakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)])
594672 if ((slpStakeInv == slpStakeInv))
595673 then nil
596674 else throw("Strict value is not equal to itself.")
597675 }
598676 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
599677 (state ++ lpTransfer)
600678 }
601679 else throw("Strict value is not equal to itself.")
602680 }
603681 else throw("Strict value is not equal to itself.")
604682 }
605683 else throw("Strict value is not equal to itself.")
606684 }
607685 else throw("Strict value is not equal to itself.")
608686 }
609687
610688
611689
612690 @Callable(i)
613691 func putForFree (maxSlippage) = if ((0 > maxSlippage))
614692 then throw("Invalid value passed")
615693 else {
616694 let estPut = commonPut(i, maxSlippage, false)
617695 estPut._9
618696 }
619697
620698
621699
622700 @Callable(i)
623701 func putOneTkn (minOutAmount,autoStake) = {
624- let $t02675626934 = parsePoolConfig(getPoolConfig())
625- let poolAddress = $t02675626934._1
626- let poolStatus = $t02675626934._2
627- let lpAssetId = $t02675626934._3
628- let amountAssetId = $t02675626934._4
629- let priceAssetId = $t02675626934._5
630- let amountAssetDecimals = $t02675626934._6
631- let priceAssetDecimals = $t02675626934._7
702+ let $t03042630604 = parsePoolConfig(getPoolConfig())
703+ let poolAddress = $t03042630604._1
704+ let poolStatus = $t03042630604._2
705+ let lpAssetId = $t03042630604._3
706+ let amountAssetId = $t03042630604._4
707+ let priceAssetId = $t03042630604._5
708+ let amountAssetDecimals = $t03042630604._6
709+ let priceAssetDecimals = $t03042630604._7
632710 let isPutDisabled = if (if (isGlobalShutdown())
633711 then true
634712 else (poolStatus == PoolPutDisabled))
635713 then true
636714 else (poolStatus == PoolShutdown)
637715 let checks = [if (!(isPutDisabled))
638716 then true
639717 else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1))
640718 then true
641719 else throwErr("exactly 1 payment are expected")]
642720 if ((checks == checks))
643721 then {
644722 let payment = i.payments[0]
645723 let paymentAssetId = payment.assetId
646724 let paymentAmountRaw = payment.amount
647725 let paymentAmount = paymentAmountRaw
648726 let userAddress = i.caller
649727 let txId = i.transactionId
650- let emitAmount = {
651- let emitAmountEstimated = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
652- if (if ((minOutAmount > 0))
653- then (minOutAmount > emitAmountEstimated)
654- else false)
655- then throw(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
656- else emitAmountEstimated
657- }
728+ let $t03109131218 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
729+ let emitAmountEstimated = $t03109131218._1
730+ let commonState = $t03109131218._2
731+ let feeAmount = $t03109131218._3
732+ let bonus = $t03109131218._4
733+ let emitAmount = if (if ((minOutAmount > 0))
734+ then (minOutAmount > emitAmountEstimated)
735+ else false)
736+ then throw(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
737+ else emitAmountEstimated
658738 let emitInv = emit(emitAmount)
659739 if ((emitInv == emitInv))
660740 then {
661741 let lpTransfer = if (autoStake)
662742 then {
663743 let stakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(lpAssetId, emitAmount)])
664744 if ((stakeInv == stakeInv))
665745 then nil
666746 else throw("Strict value is not equal to itself.")
667747 }
668748 else [ScriptTransfer(i.caller, emitAmount, lpAssetId)]
669- $Tuple2(lpTransfer, emitAmount)
749+ let sendFee = if ((feeAmount > 0))
750+ then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
751+ else nil
752+ $Tuple2(((commonState ++ lpTransfer) ++ sendFee), emitAmount)
670753 }
671754 else throw("Strict value is not equal to itself.")
672755 }
673756 else throw("Strict value is not equal to itself.")
674757 }
675758
676759
677760
678761 @Callable(i)
679762 func getOneTkn (outAssetId,minOutAmount,unstakeAmount) = {
680- let $t02816728345 = parsePoolConfig(getPoolConfig())
681- let poolAddress = $t02816728345._1
682- let poolStatus = $t02816728345._2
683- let lpAssetId = $t02816728345._3
684- let amountAssetId = $t02816728345._4
685- let priceAssetId = $t02816728345._5
686- let amountAssetDecimals = $t02816728345._6
687- let priceAssetDecimals = $t02816728345._7
763+ let $t03194232120 = parsePoolConfig(getPoolConfig())
764+ let poolAddress = $t03194232120._1
765+ let poolStatus = $t03194232120._2
766+ let lpAssetId = $t03194232120._3
767+ let amountAssetId = $t03194232120._4
768+ let priceAssetId = $t03194232120._5
769+ let amountAssetDecimals = $t03194232120._6
770+ let priceAssetDecimals = $t03194232120._7
688771 let isGetDisabled = if (isGlobalShutdown())
689772 then true
690773 else (poolStatus == PoolShutdown)
691774 let checks = [if (!(isGetDisabled))
692775 then true
693776 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1))
694777 then true
695778 else throwErr("exactly 1 payment are expected")]
696779 if ((checks == checks))
697780 then {
698781 let payment = i.payments[0]
699782 let paymentAssetId = payment.assetId
700783 let paymentAmount = payment.amount
701784 let userAddress = i.caller
702785 let txId = i.transactionId
703- let amount = {
704- let amountEstimated = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, paymentAssetId, userAddress, txId)
705- if (if ((minOutAmount > 0))
706- then (minOutAmount > amountEstimated)
707- else false)
708- then throw(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
709- else amountEstimated
710- }
786+ let $t03253132678 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, paymentAssetId, userAddress, txId)
787+ let amountEstimated = $t03253132678._1
788+ let commonState = $t03253132678._2
789+ let feeAmount = $t03253132678._3
790+ let bonus = $t03253132678._4
791+ let amount = if (if ((minOutAmount > 0))
792+ then (minOutAmount > amountEstimated)
793+ else false)
794+ then throw(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
795+ else amountEstimated
711796 let burnInv = invoke(factoryContract, "burn", [paymentAmount], [AttachedPayment(paymentAssetId, paymentAmount)])
712797 if ((burnInv == burnInv))
713798 then {
714799 let assetTransfer = [ScriptTransfer(userAddress, amount, parseAssetId(outAssetId))]
715800 $Tuple2(assetTransfer, amount)
716801 }
717802 else throw("Strict value is not equal to itself.")
718803 }
719804 else throw("Strict value is not equal to itself.")
720805 }
721806
722807
723808
724809 @Callable(i)
725810 func get () = {
726811 let res = commonGet(i)
727812 let outAmtAmt = res._1
728813 let outPrAmt = res._2
729814 let pmtAmt = res._3
730815 let pmtAssetId = res._4
731816 let state = res._5
732817 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
733818 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
734819 then state
735820 else throw("Strict value is not equal to itself.")
736821 }
737822
738823
739824
740825 @Callable(i)
741826 func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = {
742827 let res = commonGet(i)
743828 let outAmAmt = res._1
744829 let outPrAmt = res._2
745830 let pmtAmt = res._3
746831 let pmtAssetId = res._4
747832 let state = res._5
748833 if ((noLessThenAmtAsset > outAmAmt))
749834 then throw(((("noLessThenAmtAsset failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset)))
750835 else if ((noLessThenPriceAsset > outPrAmt))
751836 then throw(((("noLessThenPriceAsset failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset)))
752837 else {
753838 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
754839 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
755840 then state
756841 else throw("Strict value is not equal to itself.")
757842 }
758843 }
759844
760845
761846
762847 @Callable(i)
763848 func unstakeAndGet (amount) = {
764849 let checkPayments = if ((size(i.payments) != 0))
765850 then throw("No payments are expected")
766851 else true
767852 if ((checkPayments == checkPayments))
768853 then {
769854 let cfg = getPoolConfig()
770855 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
771856 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(lpAssetId), amount], nil)
772857 if ((unstakeInv == unstakeInv))
773858 then {
774859 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller)
775860 let poolStatus = parseIntValue(res._9)
776861 let state = res._10
777862 let checkPoolStatus = if (if (isGlobalShutdown())
778863 then true
779864 else (poolStatus == PoolShutdown))
780865 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
781866 else true
782867 if ((checkPoolStatus == checkPoolStatus))
783868 then {
784869 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
785870 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
786871 then state
787872 else throw("Strict value is not equal to itself.")
788873 }
789874 else throw("Strict value is not equal to itself.")
790875 }
791876 else throw("Strict value is not equal to itself.")
792877 }
793878 else throw("Strict value is not equal to itself.")
794879 }
795880
796881
797882
798883 @Callable(i)
799884 func activate (amtAssetStr,priceAssetStr) = if ((toString(i.caller) != toString(factoryContract)))
800885 then throw("permissions denied")
801886 else $Tuple2([StringEntry(aa(), amtAssetStr), StringEntry(pa(), priceAssetStr)], "success")
802887
803888
804889
805890 @Callable(i)
806891 func getPoolConfigWrapperREADONLY () = $Tuple2(nil, getPoolConfig())
807892
808893
809894
810895 @Callable(i)
811896 func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId))
812897
813898
814899
815900 @Callable(i)
816901 func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = {
817902 let prices = calcPrices(amAmt, prAmt, lpAmt)
818903 $Tuple2(nil, [toString(prices[0]), toString(prices[1]), toString(prices[2])])
819904 }
820905
821906
822907
823908 @Callable(i)
824909 func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(toX18(origVal, origScaleMult)))
825910
826911
827912
828913 @Callable(i)
829914 func fromX18WrapperREADONLY (val,resultScaleMult) = $Tuple2(nil, fromX18(parseBigIntValue(val), resultScaleMult))
830915
831916
832917
833918 @Callable(i)
834919 func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(calcPriceBigInt(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18))))
835920
836921
837922
838923 @Callable(i)
839924 func estimatePutOperationWrapperREADONLY (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = $Tuple2(nil, estimatePutOperation(txId58, slippageTolerance, inAmAssetAmt, inAmAssetId, inPrAssetAmt, inPrAssetId, userAddress, isEvaluate, emitLp))
840925
841926
842927
843928 @Callable(i)
844929 func estimateGetOperationWrapperREADONLY (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
845930 let res = estimateGetOperation(txId58, pmtAssetId, pmtLpAmt, addressFromStringValue(userAddress))
846931 $Tuple2(nil, $Tuple10(res._1, res._2, res._3, res._4, res._5, res._6, res._7, toString(res._8), res._9, res._10))
847932 }
848933
849934
850935
851936 @Callable(i)
852937 func statsREADONLY () = {
853938 let cfg = getPoolConfig()
854939 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
855940 let amtAssetId = cfg[idxAmtAssetId]
856941 let priceAssetId = cfg[idxPriceAssetId]
857942 let iAmtAssetId = cfg[idxIAmtAssetId]
858943 let iPriceAssetId = cfg[idxIPriceAssetId]
859944 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
860945 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
861946 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
862947 let accAmtAssetBalance = getAccBalance(amtAssetId)
863948 let accPriceAssetBalance = getAccBalance(priceAssetId)
864949 let pricesList = if ((poolLPBalance == 0))
865950 then [zeroBigInt, zeroBigInt, zeroBigInt]
866951 else calcPrices(accAmtAssetBalance, accPriceAssetBalance, poolLPBalance)
867952 let curPrice = 0
868953 let lpAmtAssetShare = fromX18(pricesList[1], scale8)
869954 let lpPriceAssetShare = fromX18(pricesList[2], scale8)
870955 let poolWeight = value(getInteger(factoryContract, keyPoolWeight(toString(this))))
871956 $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))
872957 }
873958
874959
875960
876961 @Callable(i)
877962 func evaluatePutByAmountAssetREADONLY (inAmAssetAmt) = {
878963 let cfg = getPoolConfig()
879964 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
880965 let amAssetIdStr = cfg[idxAmtAssetId]
881966 let amAssetId = fromBase58String(amAssetIdStr)
882967 let prAssetIdStr = cfg[idxPriceAssetId]
883968 let prAssetId = fromBase58String(prAssetIdStr)
884969 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
885970 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
886971 let poolStatus = cfg[idxPoolStatus]
887972 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
888973 let accAmtAssetBalance = getAccBalance(amAssetIdStr)
889974 let accPriceAssetBalance = getAccBalance(prAssetIdStr)
890975 let amtAssetAmtX18 = toX18(accAmtAssetBalance, amtAssetDcm)
891976 let priceAssetAmtX18 = toX18(accPriceAssetBalance, priceAssetDcm)
892977 let curPriceX18 = if ((poolLPBalance == 0))
893978 then zeroBigInt
894979 else calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
895980 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
896981 let inPrAssetAmtX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18)
897982 let inPrAssetAmt = fromX18(inPrAssetAmtX18, priceAssetDcm)
898983 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
899984 let calcLpAmt = estPut._1
900985 let curPriceCalc = estPut._3
901986 let amBalance = estPut._4
902987 let prBalance = estPut._5
903988 let lpEmission = estPut._6
904989 $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))
905990 }
906991
907992
908993
909994 @Callable(i)
910995 func evaluatePutByPriceAssetREADONLY (inPrAssetAmt) = {
911996 let cfg = getPoolConfig()
912997 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
913998 let amAssetIdStr = cfg[idxAmtAssetId]
914999 let amAssetId = fromBase58String(amAssetIdStr)
9151000 let prAssetIdStr = cfg[idxPriceAssetId]
9161001 let prAssetId = fromBase58String(prAssetIdStr)
9171002 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
9181003 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
9191004 let poolStatus = cfg[idxPoolStatus]
9201005 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
9211006 let amBalanceRaw = getAccBalance(amAssetIdStr)
9221007 let prBalanceRaw = getAccBalance(prAssetIdStr)
9231008 let amBalanceRawX18 = toX18(amBalanceRaw, amtAssetDcm)
9241009 let prBalanceRawX18 = toX18(prBalanceRaw, priceAssetDcm)
9251010 let curPriceX18 = if ((poolLPBalance == 0))
9261011 then zeroBigInt
9271012 else calcPriceBigInt(prBalanceRawX18, amBalanceRawX18)
9281013 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
9291014 let inAmAssetAmtX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
9301015 let inAmAssetAmt = fromX18(inAmAssetAmtX18, amtAssetDcm)
9311016 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
9321017 let calcLpAmt = estPut._1
9331018 let curPriceCalc = estPut._3
9341019 let amBalance = estPut._4
9351020 let prBalance = estPut._5
9361021 let lpEmission = estPut._6
9371022 $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))
9381023 }
9391024
9401025
9411026
9421027 @Callable(i)
9431028 func evaluateGetREADONLY (paymentLpAssetId,paymentLpAmt) = {
9441029 let res = estimateGetOperation("", paymentLpAssetId, paymentLpAmt, this)
9451030 let outAmAmt = res._1
9461031 let outPrAmt = res._2
9471032 let amBalance = res._5
9481033 let prBalance = res._6
9491034 let lpEmission = res._7
9501035 let curPrice = res._8
9511036 let poolStatus = parseIntValue(res._9)
9521037 $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))
9531038 }
9541039
9551040
9561041 @Verifier(tx)
9571042 func verify () = {
9581043 let targetPublicKey = match managerPublicKeyOrUnit() {
9591044 case pk: ByteVector =>
9601045 pk
9611046 case _: Unit =>
9621047 tx.senderPublicKey
9631048 case _ =>
9641049 throw("Match error")
9651050 }
9661051 match tx {
9671052 case order: Order =>
9681053 let matcherPub = getMatcherPubOrFail()
9691054 let orderValid = validateMatcherOrderAllowed(order)
9701055 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
9711056 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
9721057 if (if (if (orderValid)
9731058 then senderValid
9741059 else false)
9751060 then matcherValid
9761061 else false)
9771062 then true
9781063 else throwOrderError(orderValid, senderValid, matcherValid)
9791064 case s: SetScriptTransaction =>
9801065 let newHash = blake2b256(value(s.script))
9811066 let allowedHash = fromBase64String(value(getString(factoryContract, keyAllowedLpScriptHash())))
9821067 let currentHash = scriptHash(this)
9831068 if (if ((allowedHash == newHash))
9841069 then (currentHash != newHash)
9851070 else false)
9861071 then true
9871072 else sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
9881073 case _ =>
9891074 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
9901075 }
9911076 }
9921077

github/deemru/w8io/026f985 
120.26 ms