tx · 5SWL5xoSztTZ4q59ESmcnx5GxxU1QTFPLoRm82Fmrz4P

3MxovuqBEhcF2ntmodWMkDdxAVnEAqujjT3:  -0.03100000 Waves

2022.12.14 13:38 [2359868] smart account 3MxovuqBEhcF2ntmodWMkDdxAVnEAqujjT3 > SELF 0.00000000 Waves

{ "type": 13, "id": "5SWL5xoSztTZ4q59ESmcnx5GxxU1QTFPLoRm82Fmrz4P", "fee": 3100000, "feeAssetId": null, "timestamp": 1671014102222, "version": 1, "sender": "3MxovuqBEhcF2ntmodWMkDdxAVnEAqujjT3", "senderPublicKey": "FAVJX2qy2zc6fCuKMe7HCeNh2jCUmbnvqzvsAY6nc7TB", "proofs": [ "mV834QFuXxUoh5Dyr2GwvGckktUgm5JD3z9BnYLPw3NgCQR2p15tHDxHN9YxVviaiNEmuVwjhskUiK2DhsmbDgq" ], "script": "base64:BgK3JwgCEgMKAQgSABIECgIBBBIDCgEBEgQKAgEEEgQKAggBEgQKAggBEgQKAggBEgUKAwEIARIAEgQKAgEBEgMKAQESBQoDAQEBEgQKAggIEgASAwoBCBIFCgMBAQESBAoCAQESBAoCCAESBAoCCAgSCwoJCAEBAgECCAQEEgYKBAgIAQgSABIDCgEBEgMKAQESBAoCCAEiCmxQZGVjaW1hbHMiBnNjYWxlOCIMc2NhbGU4QmlnSW50IgdzY2FsZTE4Igp6ZXJvQmlnSW50IgRiaWcwIgRiaWcxIgRiaWcyIgt3YXZlc1N0cmluZyIDU0VQIgpQb29sQWN0aXZlIg9Qb29sUHV0RGlzYWJsZWQiE1Bvb2xNYXRjaGVyRGlzYWJsZWQiDFBvb2xTaHV0ZG93biIOaWR4UG9vbEFkZHJlc3MiDWlkeFBvb2xTdGF0dXMiEGlkeFBvb2xMUEFzc2V0SWQiDWlkeEFtdEFzc2V0SWQiD2lkeFByaWNlQXNzZXRJZCIOaWR4QW10QXNzZXREY20iEGlkeFByaWNlQXNzZXREY20iDmlkeElBbXRBc3NldElkIhBpZHhJUHJpY2VBc3NldEl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J5dGVzCQCRAwIIBQJjUgZwcm9vZnMAAAgFAmNSD3NlbmRlclB1YmxpY0tleQQCYXQJAPQDAwgFAmNSCWJvZHlCeXRlcwkAkQMCCAUCY1IGcHJvb2ZzAAEFAmZMAwMDBQJhcgUCYXMHBQJhdAcGCQECYXEDBQJhcgUCYXMFAmF0AwkAAQIFAmRxAhRTZXRTY3JpcHRUcmFuc2FjdGlvbgQCZXcFAmRxBAJmTQkA9gMBCQEFdmFsdWUBCAUCZXcGc2NyaXB0BAJmTgkA2wQBCQEFdmFsdWUBCQCdCAIFAmFBCQECYW8ABAJmTwkA8QcBBQR0aGlzAwMJAAACBQJmTgUCZk0JAQIhPQIFAmZPBQJmTQcGCQD0AwMIBQJmSQlib2R5Qnl0ZXMJAJEDAggFAmZJBnByb29mcwAABQJmSwkA9AMDCAUCZkkJYm9keUJ5dGVzCQCRAwIIBQJmSQZwcm9vZnMAAAUCZkvBwFdz", "chainId": 84, "height": 2359868, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2TTxMY26fRcJ4UmdBRHkQX3RzZPNKwNzoheNYDexKXo9 Next: 5cDq4KLFfGZ6w58SW8987n58MySYh78DmYzL7L54ETMp Diff:
OldNewDifferences
105105 func pa () = "%s__priceAsset"
106106
107107
108-let keyFee = "%s__fee"
109-
110-let feeDefault = fraction(10, scale8, 10000)
111-
112-let fee = valueOrElse(getInteger(this, keyFee), feeDefault)
113-
114108 func keyFactoryConfig () = "%s__factoryConfig"
115109
116110
153147
154148 let feeCollectorAddress = addressFromStringValue(getStringOrFail(factoryContract, keyFeeCollectorAddress))
155149
150+let inFee = {
151+ let @ = invoke(factoryContract, "getInFeeREADONLY", [toString(this)], nil)
152+ if ($isInstanceOf(@, "Int"))
153+ then @
154+ else throw(($getType(@) + " couldn't be cast to Int"))
155+ }
156+
157+let outFee = {
158+ let @ = invoke(factoryContract, "getOutFeeREADONLY", [toString(this)], nil)
159+ if ($isInstanceOf(@, "Int"))
160+ then @
161+ else throw(($getType(@) + " couldn't be cast to Int"))
162+ }
163+
156164 func isGlobalShutdown () = valueOrElse(getBoolean(factoryContract, keyAllPoolsShutdown()), false)
157165
158166
183191
184192 let poolConfigParsed = parsePoolConfig(getPoolConfig())
185193
186-let $t075447710 = poolConfigParsed
194+let $t076017767 = poolConfigParsed
187195
188-let cfgPoolAddress = $t075447710._1
196+let cfgPoolAddress = $t076017767._1
189197
190-let cfgPoolStatus = $t075447710._2
198+let cfgPoolStatus = $t076017767._2
191199
192-let cfgLpAssetId = $t075447710._3
200+let cfgLpAssetId = $t076017767._3
193201
194-let cfgAmountAssetId = $t075447710._4
202+let cfgAmountAssetId = $t076017767._4
195203
196-let cfgPriceAssetId = $t075447710._5
204+let cfgPriceAssetId = $t076017767._5
197205
198-let cfgAmountAssetDecimals = $t075447710._6
206+let cfgAmountAssetDecimals = $t076017767._6
199207
200-let cfgPriceAssetDecimals = $t075447710._7
208+let cfgPriceAssetDecimals = $t076017767._7
201209
202210 func getFactoryConfig () = split(getStringOrFail(factoryContract, keyFactoryConfig()), SEP)
203211
459467 }
460468
461469
462-func takeFee (amount) = {
463- let feeAmount = fraction(amount, fee, scale8)
470+func takeFee (amount,fee) = {
471+ let feeAmount = if ((fee == 0))
472+ then 0
473+ else fraction(amount, fee, scale8)
464474 $Tuple2((amount - feeAmount), feeAmount)
465475 }
466476
474484 else if ((paymentAssetId == cfgPriceAssetId))
475485 then false
476486 else throwErr("invalid asset")
477- let $t02257122864 = if (isEval)
487+ let $t02266422957 = if (isEval)
478488 then $Tuple2(amountBalanceRaw, priceBalanceRaw)
479489 else if (paymentInAmountAsset)
480490 then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw)
481491 else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw))
482- let amountBalanceOld = $t02257122864._1
483- let priceBalanceOld = $t02257122864._2
484- let $t02286823017 = if (paymentInAmountAsset)
492+ let amountBalanceOld = $t02266422957._1
493+ let priceBalanceOld = $t02266422957._2
494+ let $t02296123110 = if (paymentInAmountAsset)
485495 then $Tuple2(paymentAmountRaw, 0)
486496 else $Tuple2(0, paymentAmountRaw)
487- let amountAssetAmountRaw = $t02286823017._1
488- let priceAssetAmountRaw = $t02286823017._2
489- let amountAssetAmount = takeFee(amountAssetAmountRaw)._1
490- let priceAssetAmount = takeFee(priceAssetAmountRaw)._1
491- let $t02313923198 = takeFee(paymentAmountRaw)
492- let paymentAmount = $t02313923198._1
493- let feeAmount = $t02313923198._2
497+ let amountAssetAmountRaw = $t02296123110._1
498+ let priceAssetAmountRaw = $t02296123110._2
499+ let amountAssetAmount = takeFee(amountAssetAmountRaw, inFee)._1
500+ let priceAssetAmount = takeFee(priceAssetAmountRaw, inFee)._1
501+ let $t02324223306 = takeFee(paymentAmountRaw, inFee)
502+ let paymentAmount = $t02324223306._1
503+ let feeAmount = $t02324223306._2
494504 let amountBalanceNew = (amountBalanceOld + amountAssetAmount)
495505 let priceBalanceNew = (priceBalanceOld + priceAssetAmount)
496506 let priceNewX18 = calcPriceBigInt(toX18(priceBalanceNew, cfgPriceAssetDecimals), toX18(amountBalanceNew, cfgAmountAssetDecimals))
513523 let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, cfgPriceAssetDecimals), toX18(amountBalanceOld, cfgAmountAssetDecimals))
514524 let priceOld = fromX18(priceOldX18, scale8)
515525 let loss = {
516- let $t02467524842 = if (paymentInAmountAsset)
526+ let $t02478324950 = if (paymentInAmountAsset)
517527 then $Tuple2(amountAssetAmountRaw, amountBalanceOld)
518528 else $Tuple2(priceAssetAmountRaw, priceBalanceOld)
519- let amount = $t02467524842._1
520- let balance = $t02467524842._2
529+ let amount = $t02478324950._1
530+ let balance = $t02478324950._2
521531 let issueAmountBoth = toInt(fraction(supplyBigInt, toBigInt((amount / 2)), toBigInt(balance)))
522532 fraction((issueAmount - issueAmountBoth), scale8, issueAmountBoth)
523533 }
551561 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
552562 let redeemedBigInt = toBigInt(paymentAmount)
553563 let amountRaw = max([0, toInt(((balanceBigInt * (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN))) / scale18))])
554- let $t02642226472 = takeFee(amountRaw)
555- let totalAmount = $t02642226472._1
556- let feeAmount = $t02642226472._2
557- let $t02647626702 = if (outInAmountAsset)
564+ let $t02653026586 = takeFee(amountRaw, outFee)
565+ let totalAmount = $t02653026586._1
566+ let feeAmount = $t02653026586._2
567+ let $t02659026816 = if (outInAmountAsset)
558568 then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld)
559569 else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw))
560- let outAmAmount = $t02647626702._1
561- let outPrAmount = $t02647626702._2
562- let amBalanceNew = $t02647626702._3
563- let prBalanceNew = $t02647626702._4
570+ let outAmAmount = $t02659026816._1
571+ let outPrAmount = $t02659026816._2
572+ let amBalanceNew = $t02659026816._3
573+ let prBalanceNew = $t02659026816._4
564574 let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, cfgPriceAssetDecimals), toX18(amBalanceNew, cfgAmountAssetDecimals))
565575 let priceNew = fromX18(priceNewX18, scale8)
566576 let commonState = if (isEval)
753763 let paymentAmountRaw = payment.amount
754764 let userAddress = i.caller
755765 let txId = i.transactionId
756- let $t03160931739 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
757- if (($t03160931739 == $t03160931739))
766+ let $t03172331853 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
767+ if (($t03172331853 == $t03172331853))
758768 then {
759- let bonus = $t03160931739._4
760- let feeAmount = $t03160931739._3
761- let commonState = $t03160931739._2
762- let emitAmountEstimated = $t03160931739._1
769+ let bonus = $t03172331853._4
770+ let feeAmount = $t03172331853._3
771+ let commonState = $t03172331853._2
772+ let emitAmountEstimated = $t03172331853._1
763773 let emitAmount = if (if ((minOutAmount > 0))
764774 then (minOutAmount > emitAmountEstimated)
765775 else false)
792802
793803 @Callable(i)
794804 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
795- let $t03246832603 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
796- let emitAmountEstimated = $t03246832603._1
797- let commonState = $t03246832603._2
798- let feeAmount = $t03246832603._3
799- let bonus = $t03246832603._4
805+ let $t03258232717 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
806+ let emitAmountEstimated = $t03258232717._1
807+ let commonState = $t03258232717._2
808+ let feeAmount = $t03258232717._3
809+ let bonus = $t03258232717._4
800810 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
801811 }
802812
830840 let paymentAmount = payment.amount
831841 let userAddress = i.caller
832842 let txId = i.transactionId
833- let $t03340833543 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
834- if (($t03340833543 == $t03340833543))
843+ let $t03352233657 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
844+ if (($t03352233657 == $t03352233657))
835845 then {
836- let bonus = $t03340833543._4
837- let feeAmount = $t03340833543._3
838- let commonState = $t03340833543._2
839- let amountEstimated = $t03340833543._1
846+ let bonus = $t03352233657._4
847+ let feeAmount = $t03352233657._3
848+ let commonState = $t03352233657._2
849+ let amountEstimated = $t03352233657._1
840850 let amount = if (if ((minOutAmount > 0))
841851 then (minOutAmount > amountEstimated)
842852 else false)
862872
863873 @Callable(i)
864874 func getOneTknREADONLY (outAssetId,paymentAmount) = {
865- let $t03417834316 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
866- let amountEstimated = $t03417834316._1
867- let commonState = $t03417834316._2
868- let feeAmount = $t03417834316._3
869- let bonus = $t03417834316._4
875+ let $t03429234430 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
876+ let amountEstimated = $t03429234430._1
877+ let commonState = $t03429234430._2
878+ let feeAmount = $t03429234430._3
879+ let bonus = $t03429234430._4
870880 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
871881 }
872882
900910 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
901911 if ((unstakeInv == unstakeInv))
902912 then {
903- let $t03514135274 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
904- if (($t03514135274 == $t03514135274))
913+ let $t03525535388 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
914+ if (($t03525535388 == $t03525535388))
905915 then {
906- let bonus = $t03514135274._4
907- let feeAmount = $t03514135274._3
908- let commonState = $t03514135274._2
909- let amountEstimated = $t03514135274._1
916+ let bonus = $t03525535388._4
917+ let feeAmount = $t03525535388._3
918+ let commonState = $t03525535388._2
919+ let amountEstimated = $t03525535388._1
910920 let amount = if (if ((minOutAmount > 0))
911921 then (minOutAmount > amountEstimated)
912922 else false)
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
108-let keyFee = "%s__fee"
109-
110-let feeDefault = fraction(10, scale8, 10000)
111-
112-let fee = valueOrElse(getInteger(this, keyFee), feeDefault)
113-
114108 func keyFactoryConfig () = "%s__factoryConfig"
115109
116110
117111 func keyMatcherPub () = "%s%s__matcher__publicKey"
118112
119113
120114 func keyMappingPoolContractAddressToPoolAssets (poolContractAddress) = (("%s%s%s__" + poolContractAddress) + "__mappings__poolContract2LpAsset")
121115
122116
123117 func keyPoolConfig (iAmtAsset,iPriceAsset) = (((("%d%d%s__" + iAmtAsset) + "__") + iPriceAsset) + "__config")
124118
125119
126120 func keyMappingsBaseAsset2internalId (baseAssetStr) = ("%s%s%s__mappings__baseAsset2internalId__" + baseAssetStr)
127121
128122
129123 func keyAllPoolsShutdown () = "%s__shutdown"
130124
131125
132126 func keyPoolWeight (contractAddress) = ("%s%s__poolWeight__" + contractAddress)
133127
134128
135129 func keyAllowedLpScriptHash () = "%s__allowedLpScriptHash"
136130
137131
138132 let keyFeeCollectorAddress = "%s__feeCollectorAddress"
139133
140134 func throwOrderError (orderValid,senderValid,matcherValid) = throw(((((("order validation failed: orderValid=" + toString(orderValid)) + " senderValid=") + toString(senderValid)) + " matcherValid=") + toString(matcherValid)))
141135
142136
143137 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
144138
145139
146140 func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
147141
148142
149143 func throwErr (msg) = throw(makeString(["lp.ride:", msg], " "))
150144
151145
152146 let factoryContract = addressFromStringValue(getStringOrFail(this, fc()))
153147
154148 let feeCollectorAddress = addressFromStringValue(getStringOrFail(factoryContract, keyFeeCollectorAddress))
155149
150+let inFee = {
151+ let @ = invoke(factoryContract, "getInFeeREADONLY", [toString(this)], nil)
152+ if ($isInstanceOf(@, "Int"))
153+ then @
154+ else throw(($getType(@) + " couldn't be cast to Int"))
155+ }
156+
157+let outFee = {
158+ let @ = invoke(factoryContract, "getOutFeeREADONLY", [toString(this)], nil)
159+ if ($isInstanceOf(@, "Int"))
160+ then @
161+ else throw(($getType(@) + " couldn't be cast to Int"))
162+ }
163+
156164 func isGlobalShutdown () = valueOrElse(getBoolean(factoryContract, keyAllPoolsShutdown()), false)
157165
158166
159167 func getMatcherPubOrFail () = fromBase58String(getStringOrFail(factoryContract, keyMatcherPub()))
160168
161169
162170 func getPoolConfig () = {
163171 let amtAsset = getStringOrFail(this, aa())
164172 let priceAsset = getStringOrFail(this, pa())
165173 let iPriceAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(priceAsset))
166174 let iAmtAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(amtAsset))
167175 split(getStringOrFail(factoryContract, keyPoolConfig(toString(iAmtAsset), toString(iPriceAsset))), SEP)
168176 }
169177
170178
171179 func parseAssetId (input) = if ((input == wavesString))
172180 then unit
173181 else fromBase58String(input)
174182
175183
176184 func assetIdToString (input) = if ((input == unit))
177185 then wavesString
178186 else toBase58String(value(input))
179187
180188
181189 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]))
182190
183191
184192 let poolConfigParsed = parsePoolConfig(getPoolConfig())
185193
186-let $t075447710 = poolConfigParsed
194+let $t076017767 = poolConfigParsed
187195
188-let cfgPoolAddress = $t075447710._1
196+let cfgPoolAddress = $t076017767._1
189197
190-let cfgPoolStatus = $t075447710._2
198+let cfgPoolStatus = $t076017767._2
191199
192-let cfgLpAssetId = $t075447710._3
200+let cfgLpAssetId = $t076017767._3
193201
194-let cfgAmountAssetId = $t075447710._4
202+let cfgAmountAssetId = $t076017767._4
195203
196-let cfgPriceAssetId = $t075447710._5
204+let cfgPriceAssetId = $t076017767._5
197205
198-let cfgAmountAssetDecimals = $t075447710._6
206+let cfgAmountAssetDecimals = $t076017767._6
199207
200-let cfgPriceAssetDecimals = $t075447710._7
208+let cfgPriceAssetDecimals = $t076017767._7
201209
202210 func getFactoryConfig () = split(getStringOrFail(factoryContract, keyFactoryConfig()), SEP)
203211
204212
205213 let stakingContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactoryStakingContract]), "incorrect staking address")
206214
207215 let slippageContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactorySlippageContract]), "incorrect staking address")
208216
209217 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)
210218
211219
212220 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)
213221
214222
215223 func getAccBalance (assetId) = if ((assetId == "WAVES"))
216224 then wavesBalance(this).available
217225 else assetBalance(this, fromBase58String(assetId))
218226
219227
220228 func calcPriceBigInt (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18)
221229
222230
223231 func privateCalcPrice (amAssetDcm,prAssetDcm,amAmt,prAmt) = {
224232 let amtAssetAmtX18 = toX18(amAmt, amAssetDcm)
225233 let priceAssetAmtX18 = toX18(prAmt, prAssetDcm)
226234 calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
227235 }
228236
229237
230238 func calcPrices (amAmt,prAmt,lpAmt) = {
231239 let cfg = getPoolConfig()
232240 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
233241 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
234242 let priceX18 = privateCalcPrice(amtAssetDcm, priceAssetDcm, amAmt, prAmt)
235243 let amAmtX18 = toX18(amAmt, amtAssetDcm)
236244 let prAmtX18 = toX18(prAmt, priceAssetDcm)
237245 let lpAmtX18 = toX18(lpAmt, scale8)
238246 let lpPriceInAmAssetX18 = calcPriceBigInt(amAmtX18, lpAmtX18)
239247 let lpPriceInPrAssetX18 = calcPriceBigInt(prAmtX18, lpAmtX18)
240248 [priceX18, lpPriceInAmAssetX18, lpPriceInPrAssetX18]
241249 }
242250
243251
244252 func calculatePrices (amAmt,prAmt,lpAmt) = {
245253 let prices = calcPrices(amAmt, prAmt, lpAmt)
246254 [fromX18(prices[0], scale8), fromX18(prices[1], scale8), fromX18(prices[2], scale8)]
247255 }
248256
249257
250258 func estimateGetOperation (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
251259 let cfg = getPoolConfig()
252260 let lpAssetId = cfg[idxPoolLPAssetId]
253261 let amAssetId = cfg[idxAmtAssetId]
254262 let prAssetId = cfg[idxPriceAssetId]
255263 let amAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
256264 let prAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
257265 let poolStatus = cfg[idxPoolStatus]
258266 let lpEmission = valueOrErrorMessage(assetInfo(fromBase58String(lpAssetId)), (("Asset " + lpAssetId) + " doesn't exist")).quantity
259267 if ((lpAssetId != pmtAssetId))
260268 then throw("Invalid asset passed.")
261269 else {
262270 let amBalance = getAccBalance(amAssetId)
263271 let amBalanceX18 = toX18(amBalance, amAssetDcm)
264272 let prBalance = getAccBalance(prAssetId)
265273 let prBalanceX18 = toX18(prBalance, prAssetDcm)
266274 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
267275 let curPrice = fromX18(curPriceX18, scale8)
268276 let pmtLpAmtX18 = toX18(pmtLpAmt, scale8)
269277 let lpEmissionX18 = toX18(lpEmission, scale8)
270278 let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissionX18)
271279 let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissionX18)
272280 let outAmAmt = fromX18(outAmAmtX18, amAssetDcm)
273281 let outPrAmt = fromX18(outPrAmtX18, prAssetDcm)
274282 let state = if ((txId58 == ""))
275283 then nil
276284 else [ScriptTransfer(userAddress, outAmAmt, if ((amAssetId == "WAVES"))
277285 then unit
278286 else fromBase58String(amAssetId)), ScriptTransfer(userAddress, outPrAmt, if ((prAssetId == "WAVES"))
279287 then unit
280288 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)]
281289 $Tuple10(outAmAmt, outPrAmt, amAssetId, prAssetId, amBalance, prBalance, lpEmission, curPriceX18, poolStatus, state)
282290 }
283291 }
284292
285293
286294 func estimatePutOperation (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = {
287295 let cfg = getPoolConfig()
288296 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
289297 let amAssetIdStr = cfg[idxAmtAssetId]
290298 let prAssetIdStr = cfg[idxPriceAssetId]
291299 let iAmtAssetId = cfg[idxIAmtAssetId]
292300 let iPriceAssetId = cfg[idxIPriceAssetId]
293301 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
294302 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
295303 let poolStatus = cfg[idxPoolStatus]
296304 let lpEmission = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
297305 let inAmAssetIdStr = toBase58String(valueOrElse(inAmAssetId, fromBase58String("WAVES")))
298306 let inPrAssetIdStr = toBase58String(valueOrElse(inPrAssetId, fromBase58String("WAVES")))
299307 if (if ((amAssetIdStr != inAmAssetIdStr))
300308 then true
301309 else (prAssetIdStr != inPrAssetIdStr))
302310 then throw("Invalid amt or price asset passed.")
303311 else {
304312 let amBalance = if (isEvaluate)
305313 then getAccBalance(amAssetIdStr)
306314 else (getAccBalance(amAssetIdStr) - inAmAssetAmt)
307315 let prBalance = if (isEvaluate)
308316 then getAccBalance(prAssetIdStr)
309317 else (getAccBalance(prAssetIdStr) - inPrAssetAmt)
310318 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
311319 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
312320 let userPriceX18 = calcPriceBigInt(inPrAssetAmtX18, inAmAssetAmtX18)
313321 let amBalanceX18 = toX18(amBalance, amtAssetDcm)
314322 let prBalanceX18 = toX18(prBalance, priceAssetDcm)
315323 let res = if ((lpEmission == 0))
316324 then {
317325 let curPriceX18 = zeroBigInt
318326 let slippageX18 = zeroBigInt
319327 let lpAmtX18 = pow((inAmAssetAmtX18 * inPrAssetAmtX18), 0, toBigInt(5), 1, 0, DOWN)
320328 $Tuple5(fromX18(lpAmtX18, scale8), fromX18(inAmAssetAmtX18, amtAssetDcm), fromX18(inPrAssetAmtX18, priceAssetDcm), calcPriceBigInt((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18)
321329 }
322330 else {
323331 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
324332 let slippageX18 = fraction(absBigInt((curPriceX18 - userPriceX18)), scale18, curPriceX18)
325333 let slippageToleranceX18 = toX18(slippageTolerance, scale8)
326334 if (if ((curPriceX18 != zeroBigInt))
327335 then (slippageX18 > slippageToleranceX18)
328336 else false)
329337 then throw(((("Price slippage " + toString(slippageX18)) + " exceeded the passed limit of ") + toString(slippageToleranceX18)))
330338 else {
331339 let lpEmissionX18 = toX18(lpEmission, scale8)
332340 let prViaAmX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18)
333341 let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
334342 let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18))
335343 then $Tuple2(amViaPrX18, inPrAssetAmtX18)
336344 else $Tuple2(inAmAssetAmtX18, prViaAmX18)
337345 let expAmtAssetAmtX18 = expectedAmts._1
338346 let expPriceAssetAmtX18 = expectedAmts._2
339347 let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18)
340348 $Tuple5(fromX18(lpAmtX18, scale8), fromX18(expAmtAssetAmtX18, amtAssetDcm), fromX18(expPriceAssetAmtX18, priceAssetDcm), curPriceX18, slippageX18)
341349 }
342350 }
343351 let calcLpAmt = res._1
344352 let calcAmAssetPmt = res._2
345353 let calcPrAssetPmt = res._3
346354 let curPrice = fromX18(res._4, scale8)
347355 let slippageCalc = fromX18(res._5, scale8)
348356 if ((0 >= calcLpAmt))
349357 then throw("Invalid calculations. LP calculated is less than zero.")
350358 else {
351359 let emitLpAmt = if (!(emitLp))
352360 then 0
353361 else calcLpAmt
354362 let amDiff = (inAmAssetAmt - calcAmAssetPmt)
355363 let prDiff = (inPrAssetAmt - calcPrAssetPmt)
356364 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))]
357365 $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEmission, lpAssetId, poolStatus, commonState, amDiff, prDiff, inAmAssetId, inPrAssetId)
358366 }
359367 }
360368 }
361369
362370
363371 func validateMatcherOrderAllowed (order) = {
364372 let cfg = getPoolConfig()
365373 let amtAssetId = cfg[idxAmtAssetId]
366374 let priceAssetId = cfg[idxPriceAssetId]
367375 let poolStatus = parseIntValue(cfg[idxPoolStatus])
368376 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
369377 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
370378 let accAmtAssetBalance = getAccBalance(amtAssetId)
371379 let accPriceAssetBalance = getAccBalance(priceAssetId)
372380 let curPriceX18 = if ((order.orderType == Buy))
373381 then privateCalcPrice(amtAssetDcm, priceAssetDcm, (accAmtAssetBalance + order.amount), accPriceAssetBalance)
374382 else privateCalcPrice(amtAssetDcm, priceAssetDcm, (accAmtAssetBalance - order.amount), accPriceAssetBalance)
375383 let curPrice = fromX18(curPriceX18, scale8)
376384 if (if (if (isGlobalShutdown())
377385 then true
378386 else (poolStatus == PoolMatcherDisabled))
379387 then true
380388 else (poolStatus == PoolShutdown))
381389 then throw("Exchange operations disabled")
382390 else {
383391 let orderAmtAsset = order.assetPair.amountAsset
384392 let orderAmtAssetStr = if ((orderAmtAsset == unit))
385393 then "WAVES"
386394 else toBase58String(value(orderAmtAsset))
387395 let orderPriceAsset = order.assetPair.priceAsset
388396 let orderPriceAssetStr = if ((orderPriceAsset == unit))
389397 then "WAVES"
390398 else toBase58String(value(orderPriceAsset))
391399 if (if ((orderAmtAssetStr != amtAssetId))
392400 then true
393401 else (orderPriceAssetStr != priceAssetId))
394402 then throw("Wrong order assets.")
395403 else {
396404 let orderPrice = order.price
397405 let priceDcm = fraction(scale8, priceAssetDcm, amtAssetDcm)
398406 let castedOrderPrice = toScale(orderPrice, scale8, priceDcm)
399407 let isOrderPriceValid = if ((order.orderType == Buy))
400408 then (curPrice >= castedOrderPrice)
401409 else (castedOrderPrice >= curPrice)
402410 true
403411 }
404412 }
405413 }
406414
407415
408416 func commonGet (i) = if ((size(i.payments) != 1))
409417 then throw("exactly 1 payment is expected")
410418 else {
411419 let pmt = value(i.payments[0])
412420 let pmtAssetId = value(pmt.assetId)
413421 let pmtAmt = pmt.amount
414422 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller)
415423 let outAmAmt = res._1
416424 let outPrAmt = res._2
417425 let poolStatus = parseIntValue(res._9)
418426 let state = res._10
419427 if (if (isGlobalShutdown())
420428 then true
421429 else (poolStatus == PoolShutdown))
422430 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
423431 else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state)
424432 }
425433
426434
427435 func commonPut (i,slippageTolerance,emitLp) = if ((size(i.payments) != 2))
428436 then throw("exactly 2 payments are expected")
429437 else {
430438 let amAssetPmt = value(i.payments[0])
431439 let prAssetPmt = value(i.payments[1])
432440 let estPut = estimatePutOperation(toBase58String(i.transactionId), slippageTolerance, amAssetPmt.amount, amAssetPmt.assetId, prAssetPmt.amount, prAssetPmt.assetId, toString(i.caller), false, emitLp)
433441 let poolStatus = parseIntValue(estPut._8)
434442 if (if (if (isGlobalShutdown())
435443 then true
436444 else (poolStatus == PoolPutDisabled))
437445 then true
438446 else (poolStatus == PoolShutdown))
439447 then throw(("Put operation is blocked by admin. Status = " + toString(poolStatus)))
440448 else estPut
441449 }
442450
443451
444452 func emit (amount) = {
445453 let emitInv = invoke(factoryContract, "emit", [amount], nil)
446454 if ((emitInv == emitInv))
447455 then {
448456 let emitInvLegacy = match emitInv {
449457 case legacyFactoryContract: Address =>
450458 invoke(legacyFactoryContract, "emit", [amount], nil)
451459 case _ =>
452460 unit
453461 }
454462 if ((emitInvLegacy == emitInvLegacy))
455463 then amount
456464 else throw("Strict value is not equal to itself.")
457465 }
458466 else throw("Strict value is not equal to itself.")
459467 }
460468
461469
462-func takeFee (amount) = {
463- let feeAmount = fraction(amount, fee, scale8)
470+func takeFee (amount,fee) = {
471+ let feeAmount = if ((fee == 0))
472+ then 0
473+ else fraction(amount, fee, scale8)
464474 $Tuple2((amount - feeAmount), feeAmount)
465475 }
466476
467477
468478 func calcPutOneToken (paymentAmountRaw,paymentAssetId,userAddress,txId) = {
469479 let isEval = (txId == unit)
470480 let amountBalanceRaw = getAccBalance(assetIdToString(cfgAmountAssetId))
471481 let priceBalanceRaw = getAccBalance(assetIdToString(cfgPriceAssetId))
472482 let paymentInAmountAsset = if ((paymentAssetId == cfgAmountAssetId))
473483 then true
474484 else if ((paymentAssetId == cfgPriceAssetId))
475485 then false
476486 else throwErr("invalid asset")
477- let $t02257122864 = if (isEval)
487+ let $t02266422957 = if (isEval)
478488 then $Tuple2(amountBalanceRaw, priceBalanceRaw)
479489 else if (paymentInAmountAsset)
480490 then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw)
481491 else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw))
482- let amountBalanceOld = $t02257122864._1
483- let priceBalanceOld = $t02257122864._2
484- let $t02286823017 = if (paymentInAmountAsset)
492+ let amountBalanceOld = $t02266422957._1
493+ let priceBalanceOld = $t02266422957._2
494+ let $t02296123110 = if (paymentInAmountAsset)
485495 then $Tuple2(paymentAmountRaw, 0)
486496 else $Tuple2(0, paymentAmountRaw)
487- let amountAssetAmountRaw = $t02286823017._1
488- let priceAssetAmountRaw = $t02286823017._2
489- let amountAssetAmount = takeFee(amountAssetAmountRaw)._1
490- let priceAssetAmount = takeFee(priceAssetAmountRaw)._1
491- let $t02313923198 = takeFee(paymentAmountRaw)
492- let paymentAmount = $t02313923198._1
493- let feeAmount = $t02313923198._2
497+ let amountAssetAmountRaw = $t02296123110._1
498+ let priceAssetAmountRaw = $t02296123110._2
499+ let amountAssetAmount = takeFee(amountAssetAmountRaw, inFee)._1
500+ let priceAssetAmount = takeFee(priceAssetAmountRaw, inFee)._1
501+ let $t02324223306 = takeFee(paymentAmountRaw, inFee)
502+ let paymentAmount = $t02324223306._1
503+ let feeAmount = $t02324223306._2
494504 let amountBalanceNew = (amountBalanceOld + amountAssetAmount)
495505 let priceBalanceNew = (priceBalanceOld + priceAssetAmount)
496506 let priceNewX18 = calcPriceBigInt(toX18(priceBalanceNew, cfgPriceAssetDecimals), toX18(amountBalanceNew, cfgAmountAssetDecimals))
497507 let priceNew = fromX18(priceNewX18, scale8)
498508 let paymentBalance = if (paymentInAmountAsset)
499509 then amountBalanceOld
500510 else priceBalanceOld
501511 let paymentBalanceBigInt = toBigInt(paymentBalance)
502512 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
503513 let chechSupply = if ((supplyBigInt > big0))
504514 then true
505515 else throwErr("initial deposit requires all coins")
506516 if ((chechSupply == chechSupply))
507517 then {
508518 let depositBigInt = toBigInt(paymentAmount)
509519 let issueAmount = max([0, toInt(((supplyBigInt * (sqrtBigInt((scale18 + ((depositBigInt * scale18) / paymentBalanceBigInt)), 18, 18, DOWN) - scale18)) / scale18))])
510520 let commonState = if (isEval)
511521 then nil
512522 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))]
513523 let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, cfgPriceAssetDecimals), toX18(amountBalanceOld, cfgAmountAssetDecimals))
514524 let priceOld = fromX18(priceOldX18, scale8)
515525 let loss = {
516- let $t02467524842 = if (paymentInAmountAsset)
526+ let $t02478324950 = if (paymentInAmountAsset)
517527 then $Tuple2(amountAssetAmountRaw, amountBalanceOld)
518528 else $Tuple2(priceAssetAmountRaw, priceBalanceOld)
519- let amount = $t02467524842._1
520- let balance = $t02467524842._2
529+ let amount = $t02478324950._1
530+ let balance = $t02478324950._2
521531 let issueAmountBoth = toInt(fraction(supplyBigInt, toBigInt((amount / 2)), toBigInt(balance)))
522532 fraction((issueAmount - issueAmountBoth), scale8, issueAmountBoth)
523533 }
524534 $Tuple4(issueAmount, commonState, feeAmount, loss)
525535 }
526536 else throw("Strict value is not equal to itself.")
527537 }
528538
529539
530540 func calcGetOneToken (outAssetId,paymentAmount,paymentAssetId,userAddress,txId) = {
531541 let isEval = (txId == unit)
532542 let checks = [if ((paymentAssetId == cfgLpAssetId))
533543 then true
534544 else throwErr("invalid lp asset")]
535545 if ((checks == checks))
536546 then {
537547 let outInAmountAsset = if ((outAssetId == cfgAmountAssetId))
538548 then true
539549 else if ((outAssetId == cfgPriceAssetId))
540550 then false
541551 else throwErr("invalid asset")
542552 let balanceBigInt = if (outInAmountAsset)
543553 then toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId)))
544554 else toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId)))
545555 let amBalanceOld = getAccBalance(assetIdToString(cfgAmountAssetId))
546556 let prBalanceOld = getAccBalance(assetIdToString(cfgPriceAssetId))
547557 let outBalance = if (outInAmountAsset)
548558 then amBalanceOld
549559 else prBalanceOld
550560 let outBalanceBigInt = toBigInt(outBalance)
551561 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
552562 let redeemedBigInt = toBigInt(paymentAmount)
553563 let amountRaw = max([0, toInt(((balanceBigInt * (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN))) / scale18))])
554- let $t02642226472 = takeFee(amountRaw)
555- let totalAmount = $t02642226472._1
556- let feeAmount = $t02642226472._2
557- let $t02647626702 = if (outInAmountAsset)
564+ let $t02653026586 = takeFee(amountRaw, outFee)
565+ let totalAmount = $t02653026586._1
566+ let feeAmount = $t02653026586._2
567+ let $t02659026816 = if (outInAmountAsset)
558568 then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld)
559569 else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw))
560- let outAmAmount = $t02647626702._1
561- let outPrAmount = $t02647626702._2
562- let amBalanceNew = $t02647626702._3
563- let prBalanceNew = $t02647626702._4
570+ let outAmAmount = $t02659026816._1
571+ let outPrAmount = $t02659026816._2
572+ let amBalanceNew = $t02659026816._3
573+ let prBalanceNew = $t02659026816._4
564574 let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, cfgPriceAssetDecimals), toX18(amBalanceNew, cfgAmountAssetDecimals))
565575 let priceNew = fromX18(priceNewX18, scale8)
566576 let commonState = if (isEval)
567577 then nil
568578 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)]
569579 let priceOldX18 = calcPriceBigInt(toX18(prBalanceOld, cfgPriceAssetDecimals), toX18(amBalanceOld, cfgAmountAssetDecimals))
570580 let priceOld = fromX18(priceOldX18, scale8)
571581 let loss = {
572582 let amountBothInPaymentAsset = (toInt(fraction(balanceBigInt, redeemedBigInt, supplyBigInt)) * 2)
573583 fraction((totalAmount - amountBothInPaymentAsset), scale8, amountBothInPaymentAsset)
574584 }
575585 $Tuple4(totalAmount, commonState, feeAmount, loss)
576586 }
577587 else throw("Strict value is not equal to itself.")
578588 }
579589
580590
581591 func managerPublicKeyOrUnit () = match getString(mpk()) {
582592 case s: String =>
583593 fromBase58String(s)
584594 case _: Unit =>
585595 unit
586596 case _ =>
587597 throw("Match error")
588598 }
589599
590600
591601 func pendingManagerPublicKeyOrUnit () = match getString(pmpk()) {
592602 case s: String =>
593603 fromBase58String(s)
594604 case _: Unit =>
595605 unit
596606 case _ =>
597607 throw("Match error")
598608 }
599609
600610
601611 func isManager (i) = match managerPublicKeyOrUnit() {
602612 case pk: ByteVector =>
603613 (i.callerPublicKey == pk)
604614 case _: Unit =>
605615 (i.caller == this)
606616 case _ =>
607617 throw("Match error")
608618 }
609619
610620
611621 func mustManager (i) = {
612622 let pd = throw("Permission denied")
613623 match managerPublicKeyOrUnit() {
614624 case pk: ByteVector =>
615625 if ((i.callerPublicKey == pk))
616626 then true
617627 else pd
618628 case _: Unit =>
619629 if ((i.caller == this))
620630 then true
621631 else pd
622632 case _ =>
623633 throw("Match error")
624634 }
625635 }
626636
627637
628638 @Callable(i)
629639 func setManager (pendingManagerPublicKey) = {
630640 let checkCaller = mustManager(i)
631641 if ((checkCaller == checkCaller))
632642 then {
633643 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
634644 if ((checkManagerPublicKey == checkManagerPublicKey))
635645 then [StringEntry(pmpk(), pendingManagerPublicKey)]
636646 else throw("Strict value is not equal to itself.")
637647 }
638648 else throw("Strict value is not equal to itself.")
639649 }
640650
641651
642652
643653 @Callable(i)
644654 func confirmManager () = {
645655 let pm = pendingManagerPublicKeyOrUnit()
646656 let hasPM = if (isDefined(pm))
647657 then true
648658 else throw("No pending manager")
649659 if ((hasPM == hasPM))
650660 then {
651661 let checkPM = if ((i.callerPublicKey == value(pm)))
652662 then true
653663 else throw("You are not pending manager")
654664 if ((checkPM == checkPM))
655665 then [StringEntry(mpk(), toBase58String(value(pm))), DeleteEntry(pmpk())]
656666 else throw("Strict value is not equal to itself.")
657667 }
658668 else throw("Strict value is not equal to itself.")
659669 }
660670
661671
662672
663673 @Callable(i)
664674 func put (slippageTolerance,shouldAutoStake) = if ((0 > slippageTolerance))
665675 then throw("Invalid slippageTolerance passed")
666676 else {
667677 let estPut = commonPut(i, slippageTolerance, true)
668678 let emitLpAmt = estPut._2
669679 let lpAssetId = estPut._7
670680 let state = estPut._9
671681 let amDiff = estPut._10
672682 let prDiff = estPut._11
673683 let amId = estPut._12
674684 let prId = estPut._13
675685 let emitInv = invoke(factoryContract, "emit", [emitLpAmt], nil)
676686 if ((emitInv == emitInv))
677687 then {
678688 let emitInvLegacy = match emitInv {
679689 case legacyFactoryContract: Address =>
680690 invoke(legacyFactoryContract, "emit", [emitLpAmt], nil)
681691 case _ =>
682692 unit
683693 }
684694 if ((emitInvLegacy == emitInvLegacy))
685695 then {
686696 let slippageAInv = if ((amDiff > 0))
687697 then invoke(slippageContract, "put", nil, [AttachedPayment(amId, amDiff)])
688698 else nil
689699 if ((slippageAInv == slippageAInv))
690700 then {
691701 let slippagePInv = if ((prDiff > 0))
692702 then invoke(slippageContract, "put", nil, [AttachedPayment(prId, prDiff)])
693703 else nil
694704 if ((slippagePInv == slippagePInv))
695705 then {
696706 let lpTransfer = if (shouldAutoStake)
697707 then {
698708 let slpStakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)])
699709 if ((slpStakeInv == slpStakeInv))
700710 then nil
701711 else throw("Strict value is not equal to itself.")
702712 }
703713 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
704714 (state ++ lpTransfer)
705715 }
706716 else throw("Strict value is not equal to itself.")
707717 }
708718 else throw("Strict value is not equal to itself.")
709719 }
710720 else throw("Strict value is not equal to itself.")
711721 }
712722 else throw("Strict value is not equal to itself.")
713723 }
714724
715725
716726
717727 @Callable(i)
718728 func putForFree (maxSlippage) = if ((0 > maxSlippage))
719729 then throw("Invalid value passed")
720730 else {
721731 let estPut = commonPut(i, maxSlippage, false)
722732 estPut._9
723733 }
724734
725735
726736
727737 @Callable(i)
728738 func putOneTkn (minOutAmount,autoStake) = {
729739 let isPoolOneTokenOperationsDisabled = {
730740 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
731741 if ($isInstanceOf(@, "Boolean"))
732742 then @
733743 else throw(($getType(@) + " couldn't be cast to Boolean"))
734744 }
735745 let isPutDisabled = if (if (if (isGlobalShutdown())
736746 then true
737747 else (cfgPoolStatus == PoolPutDisabled))
738748 then true
739749 else (cfgPoolStatus == PoolShutdown))
740750 then true
741751 else isPoolOneTokenOperationsDisabled
742752 let checks = [if (if (!(isPutDisabled))
743753 then true
744754 else isManager(i))
745755 then true
746756 else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1))
747757 then true
748758 else throwErr("exactly 1 payment are expected")]
749759 if ((checks == checks))
750760 then {
751761 let payment = i.payments[0]
752762 let paymentAssetId = payment.assetId
753763 let paymentAmountRaw = payment.amount
754764 let userAddress = i.caller
755765 let txId = i.transactionId
756- let $t03160931739 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
757- if (($t03160931739 == $t03160931739))
766+ let $t03172331853 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
767+ if (($t03172331853 == $t03172331853))
758768 then {
759- let bonus = $t03160931739._4
760- let feeAmount = $t03160931739._3
761- let commonState = $t03160931739._2
762- let emitAmountEstimated = $t03160931739._1
769+ let bonus = $t03172331853._4
770+ let feeAmount = $t03172331853._3
771+ let commonState = $t03172331853._2
772+ let emitAmountEstimated = $t03172331853._1
763773 let emitAmount = if (if ((minOutAmount > 0))
764774 then (minOutAmount > emitAmountEstimated)
765775 else false)
766776 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
767777 else emitAmountEstimated
768778 let emitInv = emit(emitAmount)
769779 if ((emitInv == emitInv))
770780 then {
771781 let lpTransfer = if (autoStake)
772782 then {
773783 let stakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(cfgLpAssetId, emitAmount)])
774784 if ((stakeInv == stakeInv))
775785 then nil
776786 else throw("Strict value is not equal to itself.")
777787 }
778788 else [ScriptTransfer(i.caller, emitAmount, cfgLpAssetId)]
779789 let sendFee = if ((feeAmount > 0))
780790 then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
781791 else nil
782792 $Tuple2(((commonState ++ lpTransfer) ++ sendFee), emitAmount)
783793 }
784794 else throw("Strict value is not equal to itself.")
785795 }
786796 else throw("Strict value is not equal to itself.")
787797 }
788798 else throw("Strict value is not equal to itself.")
789799 }
790800
791801
792802
793803 @Callable(i)
794804 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
795- let $t03246832603 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
796- let emitAmountEstimated = $t03246832603._1
797- let commonState = $t03246832603._2
798- let feeAmount = $t03246832603._3
799- let bonus = $t03246832603._4
805+ let $t03258232717 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
806+ let emitAmountEstimated = $t03258232717._1
807+ let commonState = $t03258232717._2
808+ let feeAmount = $t03258232717._3
809+ let bonus = $t03258232717._4
800810 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
801811 }
802812
803813
804814
805815 @Callable(i)
806816 func getOneTkn (outAssetIdStr,minOutAmount) = {
807817 let isPoolOneTokenOperationsDisabled = {
808818 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
809819 if ($isInstanceOf(@, "Boolean"))
810820 then @
811821 else throw(($getType(@) + " couldn't be cast to Boolean"))
812822 }
813823 let isGetDisabled = if (if (isGlobalShutdown())
814824 then true
815825 else (cfgPoolStatus == PoolShutdown))
816826 then true
817827 else isPoolOneTokenOperationsDisabled
818828 let checks = [if (if (!(isGetDisabled))
819829 then true
820830 else isManager(i))
821831 then true
822832 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1))
823833 then true
824834 else throwErr("exactly 1 payment are expected")]
825835 if ((checks == checks))
826836 then {
827837 let outAssetId = parseAssetId(outAssetIdStr)
828838 let payment = i.payments[0]
829839 let paymentAssetId = payment.assetId
830840 let paymentAmount = payment.amount
831841 let userAddress = i.caller
832842 let txId = i.transactionId
833- let $t03340833543 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
834- if (($t03340833543 == $t03340833543))
843+ let $t03352233657 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
844+ if (($t03352233657 == $t03352233657))
835845 then {
836- let bonus = $t03340833543._4
837- let feeAmount = $t03340833543._3
838- let commonState = $t03340833543._2
839- let amountEstimated = $t03340833543._1
846+ let bonus = $t03352233657._4
847+ let feeAmount = $t03352233657._3
848+ let commonState = $t03352233657._2
849+ let amountEstimated = $t03352233657._1
840850 let amount = if (if ((minOutAmount > 0))
841851 then (minOutAmount > amountEstimated)
842852 else false)
843853 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
844854 else amountEstimated
845855 let burnInv = invoke(factoryContract, "burn", [paymentAmount], [AttachedPayment(paymentAssetId, paymentAmount)])
846856 if ((burnInv == burnInv))
847857 then {
848858 let assetTransfer = [ScriptTransfer(userAddress, amount, outAssetId)]
849859 let sendFee = if ((feeAmount > 0))
850860 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
851861 else nil
852862 $Tuple2(((commonState ++ assetTransfer) ++ sendFee), amount)
853863 }
854864 else throw("Strict value is not equal to itself.")
855865 }
856866 else throw("Strict value is not equal to itself.")
857867 }
858868 else throw("Strict value is not equal to itself.")
859869 }
860870
861871
862872
863873 @Callable(i)
864874 func getOneTknREADONLY (outAssetId,paymentAmount) = {
865- let $t03417834316 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
866- let amountEstimated = $t03417834316._1
867- let commonState = $t03417834316._2
868- let feeAmount = $t03417834316._3
869- let bonus = $t03417834316._4
875+ let $t03429234430 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
876+ let amountEstimated = $t03429234430._1
877+ let commonState = $t03429234430._2
878+ let feeAmount = $t03429234430._3
879+ let bonus = $t03429234430._4
870880 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
871881 }
872882
873883
874884
875885 @Callable(i)
876886 func unstakeAndGetOneTkn (unstakeAmount,outAssetIdStr,minOutAmount) = {
877887 let isPoolOneTokenOperationsDisabled = {
878888 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
879889 if ($isInstanceOf(@, "Boolean"))
880890 then @
881891 else throw(($getType(@) + " couldn't be cast to Boolean"))
882892 }
883893 let isGetDisabled = if (if (isGlobalShutdown())
884894 then true
885895 else (cfgPoolStatus == PoolShutdown))
886896 then true
887897 else isPoolOneTokenOperationsDisabled
888898 let checks = [if (if (!(isGetDisabled))
889899 then true
890900 else isManager(i))
891901 then true
892902 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 0))
893903 then true
894904 else throwErr("no payments are expected")]
895905 if ((checks == checks))
896906 then {
897907 let outAssetId = parseAssetId(outAssetIdStr)
898908 let userAddress = i.caller
899909 let txId = i.transactionId
900910 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
901911 if ((unstakeInv == unstakeInv))
902912 then {
903- let $t03514135274 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
904- if (($t03514135274 == $t03514135274))
913+ let $t03525535388 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
914+ if (($t03525535388 == $t03525535388))
905915 then {
906- let bonus = $t03514135274._4
907- let feeAmount = $t03514135274._3
908- let commonState = $t03514135274._2
909- let amountEstimated = $t03514135274._1
916+ let bonus = $t03525535388._4
917+ let feeAmount = $t03525535388._3
918+ let commonState = $t03525535388._2
919+ let amountEstimated = $t03525535388._1
910920 let amount = if (if ((minOutAmount > 0))
911921 then (minOutAmount > amountEstimated)
912922 else false)
913923 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
914924 else amountEstimated
915925 let burnInv = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
916926 if ((burnInv == burnInv))
917927 then {
918928 let assetTransfer = [ScriptTransfer(i.caller, amount, outAssetId)]
919929 let sendFee = if ((feeAmount > 0))
920930 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
921931 else nil
922932 $Tuple2(((commonState ++ assetTransfer) ++ sendFee), amount)
923933 }
924934 else throw("Strict value is not equal to itself.")
925935 }
926936 else throw("Strict value is not equal to itself.")
927937 }
928938 else throw("Strict value is not equal to itself.")
929939 }
930940 else throw("Strict value is not equal to itself.")
931941 }
932942
933943
934944
935945 @Callable(i)
936946 func get () = {
937947 let res = commonGet(i)
938948 let outAmtAmt = res._1
939949 let outPrAmt = res._2
940950 let pmtAmt = res._3
941951 let pmtAssetId = res._4
942952 let state = res._5
943953 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
944954 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
945955 then state
946956 else throw("Strict value is not equal to itself.")
947957 }
948958
949959
950960
951961 @Callable(i)
952962 func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = {
953963 let res = commonGet(i)
954964 let outAmAmt = res._1
955965 let outPrAmt = res._2
956966 let pmtAmt = res._3
957967 let pmtAssetId = res._4
958968 let state = res._5
959969 if ((noLessThenAmtAsset > outAmAmt))
960970 then throw(((("noLessThenAmtAsset failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset)))
961971 else if ((noLessThenPriceAsset > outPrAmt))
962972 then throw(((("noLessThenPriceAsset failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset)))
963973 else {
964974 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
965975 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
966976 then state
967977 else throw("Strict value is not equal to itself.")
968978 }
969979 }
970980
971981
972982
973983 @Callable(i)
974984 func unstakeAndGet (amount) = {
975985 let checkPayments = if ((size(i.payments) != 0))
976986 then throw("No payments are expected")
977987 else true
978988 if ((checkPayments == checkPayments))
979989 then {
980990 let cfg = getPoolConfig()
981991 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
982992 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(lpAssetId), amount], nil)
983993 if ((unstakeInv == unstakeInv))
984994 then {
985995 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller)
986996 let poolStatus = parseIntValue(res._9)
987997 let state = res._10
988998 let checkPoolStatus = if (if (isGlobalShutdown())
989999 then true
9901000 else (poolStatus == PoolShutdown))
9911001 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
9921002 else true
9931003 if ((checkPoolStatus == checkPoolStatus))
9941004 then {
9951005 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
9961006 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
9971007 then state
9981008 else throw("Strict value is not equal to itself.")
9991009 }
10001010 else throw("Strict value is not equal to itself.")
10011011 }
10021012 else throw("Strict value is not equal to itself.")
10031013 }
10041014 else throw("Strict value is not equal to itself.")
10051015 }
10061016
10071017
10081018
10091019 @Callable(i)
10101020 func unstakeAndGetNoLess (unstakeAmount,noLessThenAmountAsset,noLessThenPriceAsset) = {
10111021 let isGetDisabled = if (isGlobalShutdown())
10121022 then true
10131023 else (cfgPoolStatus == PoolShutdown)
10141024 let checks = [if (!(isGetDisabled))
10151025 then true
10161026 else throw("get operation is blocked by admin"), if ((size(i.payments) == 0))
10171027 then true
10181028 else throw("no payments are expected")]
10191029 if ((checks == checks))
10201030 then {
10211031 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
10221032 if ((unstakeInv == unstakeInv))
10231033 then {
10241034 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller)
10251035 let outAmAmt = res._1
10261036 let outPrAmt = res._2
10271037 let state = res._10
10281038 let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset))
10291039 then true
10301040 else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset))
10311041 then true
10321042 else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))]
10331043 if ((checkAmounts == checkAmounts))
10341044 then {
10351045 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
10361046 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
10371047 then state
10381048 else throw("Strict value is not equal to itself.")
10391049 }
10401050 else throw("Strict value is not equal to itself.")
10411051 }
10421052 else throw("Strict value is not equal to itself.")
10431053 }
10441054 else throw("Strict value is not equal to itself.")
10451055 }
10461056
10471057
10481058
10491059 @Callable(i)
10501060 func activate (amtAssetStr,priceAssetStr) = if ((toString(i.caller) != toString(factoryContract)))
10511061 then throw("permissions denied")
10521062 else $Tuple2([StringEntry(aa(), amtAssetStr), StringEntry(pa(), priceAssetStr)], "success")
10531063
10541064
10551065
10561066 @Callable(i)
10571067 func getPoolConfigWrapperREADONLY () = $Tuple2(nil, getPoolConfig())
10581068
10591069
10601070
10611071 @Callable(i)
10621072 func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId))
10631073
10641074
10651075
10661076 @Callable(i)
10671077 func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = {
10681078 let prices = calcPrices(amAmt, prAmt, lpAmt)
10691079 $Tuple2(nil, [toString(prices[0]), toString(prices[1]), toString(prices[2])])
10701080 }
10711081
10721082
10731083
10741084 @Callable(i)
10751085 func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(toX18(origVal, origScaleMult)))
10761086
10771087
10781088
10791089 @Callable(i)
10801090 func fromX18WrapperREADONLY (val,resultScaleMult) = $Tuple2(nil, fromX18(parseBigIntValue(val), resultScaleMult))
10811091
10821092
10831093
10841094 @Callable(i)
10851095 func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(calcPriceBigInt(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18))))
10861096
10871097
10881098
10891099 @Callable(i)
10901100 func estimatePutOperationWrapperREADONLY (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = $Tuple2(nil, estimatePutOperation(txId58, slippageTolerance, inAmAssetAmt, inAmAssetId, inPrAssetAmt, inPrAssetId, userAddress, isEvaluate, emitLp))
10911101
10921102
10931103
10941104 @Callable(i)
10951105 func estimateGetOperationWrapperREADONLY (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
10961106 let res = estimateGetOperation(txId58, pmtAssetId, pmtLpAmt, addressFromStringValue(userAddress))
10971107 $Tuple2(nil, $Tuple10(res._1, res._2, res._3, res._4, res._5, res._6, res._7, toString(res._8), res._9, res._10))
10981108 }
10991109
11001110
11011111
11021112 @Callable(i)
11031113 func statsREADONLY () = {
11041114 let cfg = getPoolConfig()
11051115 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
11061116 let amtAssetId = cfg[idxAmtAssetId]
11071117 let priceAssetId = cfg[idxPriceAssetId]
11081118 let iAmtAssetId = cfg[idxIAmtAssetId]
11091119 let iPriceAssetId = cfg[idxIPriceAssetId]
11101120 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
11111121 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
11121122 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
11131123 let accAmtAssetBalance = getAccBalance(amtAssetId)
11141124 let accPriceAssetBalance = getAccBalance(priceAssetId)
11151125 let pricesList = if ((poolLPBalance == 0))
11161126 then [zeroBigInt, zeroBigInt, zeroBigInt]
11171127 else calcPrices(accAmtAssetBalance, accPriceAssetBalance, poolLPBalance)
11181128 let curPrice = 0
11191129 let lpAmtAssetShare = fromX18(pricesList[1], scale8)
11201130 let lpPriceAssetShare = fromX18(pricesList[2], scale8)
11211131 let poolWeight = value(getInteger(factoryContract, keyPoolWeight(toString(this))))
11221132 $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))
11231133 }
11241134
11251135
11261136
11271137 @Callable(i)
11281138 func evaluatePutByAmountAssetREADONLY (inAmAssetAmt) = {
11291139 let cfg = getPoolConfig()
11301140 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
11311141 let amAssetIdStr = cfg[idxAmtAssetId]
11321142 let amAssetId = fromBase58String(amAssetIdStr)
11331143 let prAssetIdStr = cfg[idxPriceAssetId]
11341144 let prAssetId = fromBase58String(prAssetIdStr)
11351145 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
11361146 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
11371147 let poolStatus = cfg[idxPoolStatus]
11381148 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
11391149 let accAmtAssetBalance = getAccBalance(amAssetIdStr)
11401150 let accPriceAssetBalance = getAccBalance(prAssetIdStr)
11411151 let amtAssetAmtX18 = toX18(accAmtAssetBalance, amtAssetDcm)
11421152 let priceAssetAmtX18 = toX18(accPriceAssetBalance, priceAssetDcm)
11431153 let curPriceX18 = if ((poolLPBalance == 0))
11441154 then zeroBigInt
11451155 else calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
11461156 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
11471157 let inPrAssetAmtX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18)
11481158 let inPrAssetAmt = fromX18(inPrAssetAmtX18, priceAssetDcm)
11491159 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
11501160 let calcLpAmt = estPut._1
11511161 let curPriceCalc = estPut._3
11521162 let amBalance = estPut._4
11531163 let prBalance = estPut._5
11541164 let lpEmission = estPut._6
11551165 $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))
11561166 }
11571167
11581168
11591169
11601170 @Callable(i)
11611171 func evaluatePutByPriceAssetREADONLY (inPrAssetAmt) = {
11621172 let cfg = getPoolConfig()
11631173 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
11641174 let amAssetIdStr = cfg[idxAmtAssetId]
11651175 let amAssetId = fromBase58String(amAssetIdStr)
11661176 let prAssetIdStr = cfg[idxPriceAssetId]
11671177 let prAssetId = fromBase58String(prAssetIdStr)
11681178 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
11691179 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
11701180 let poolStatus = cfg[idxPoolStatus]
11711181 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
11721182 let amBalanceRaw = getAccBalance(amAssetIdStr)
11731183 let prBalanceRaw = getAccBalance(prAssetIdStr)
11741184 let amBalanceRawX18 = toX18(amBalanceRaw, amtAssetDcm)
11751185 let prBalanceRawX18 = toX18(prBalanceRaw, priceAssetDcm)
11761186 let curPriceX18 = if ((poolLPBalance == 0))
11771187 then zeroBigInt
11781188 else calcPriceBigInt(prBalanceRawX18, amBalanceRawX18)
11791189 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
11801190 let inAmAssetAmtX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
11811191 let inAmAssetAmt = fromX18(inAmAssetAmtX18, amtAssetDcm)
11821192 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
11831193 let calcLpAmt = estPut._1
11841194 let curPriceCalc = estPut._3
11851195 let amBalance = estPut._4
11861196 let prBalance = estPut._5
11871197 let lpEmission = estPut._6
11881198 $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))
11891199 }
11901200
11911201
11921202
11931203 @Callable(i)
11941204 func evaluateGetREADONLY (paymentLpAssetId,paymentLpAmt) = {
11951205 let res = estimateGetOperation("", paymentLpAssetId, paymentLpAmt, this)
11961206 let outAmAmt = res._1
11971207 let outPrAmt = res._2
11981208 let amBalance = res._5
11991209 let prBalance = res._6
12001210 let lpEmission = res._7
12011211 let curPrice = res._8
12021212 let poolStatus = parseIntValue(res._9)
12031213 $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))
12041214 }
12051215
12061216
12071217 @Verifier(tx)
12081218 func verify () = {
12091219 let targetPublicKey = match managerPublicKeyOrUnit() {
12101220 case pk: ByteVector =>
12111221 pk
12121222 case _: Unit =>
12131223 tx.senderPublicKey
12141224 case _ =>
12151225 throw("Match error")
12161226 }
12171227 match tx {
12181228 case order: Order =>
12191229 let matcherPub = getMatcherPubOrFail()
12201230 let orderValid = validateMatcherOrderAllowed(order)
12211231 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
12221232 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
12231233 if (if (if (orderValid)
12241234 then senderValid
12251235 else false)
12261236 then matcherValid
12271237 else false)
12281238 then true
12291239 else throwOrderError(orderValid, senderValid, matcherValid)
12301240 case s: SetScriptTransaction =>
12311241 let newHash = blake2b256(value(s.script))
12321242 let allowedHash = fromBase64String(value(getString(factoryContract, keyAllowedLpScriptHash())))
12331243 let currentHash = scriptHash(this)
12341244 if (if ((allowedHash == newHash))
12351245 then (currentHash != newHash)
12361246 else false)
12371247 then true
12381248 else sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
12391249 case _ =>
12401250 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
12411251 }
12421252 }
12431253

github/deemru/w8io/026f985 
133.72 ms