tx · BARqyD79cWwN4YyDjMpjty5xkLAMH7ypqYi5drHCtsw 3N4JvGpYF8iwSPzqwqWcubTfWWaKxdgmE4H: -0.03000000 Waves 2022.11.07 15:19 [2306723] smart account 3N4JvGpYF8iwSPzqwqWcubTfWWaKxdgmE4H > SELF 0.00000000 Waves
{ "type": 13, "id": "BARqyD79cWwN4YyDjMpjty5xkLAMH7ypqYi5drHCtsw", "fee": 3000000, "feeAssetId": null, "timestamp": 1667823634392, "version": 1, "sender": "3N4JvGpYF8iwSPzqwqWcubTfWWaKxdgmE4H", "senderPublicKey": "p2hzghiY7UemNr13x5jVMEC1aSdo6Tkv76kjMxRU9cZ", "proofs": [ "2wt5kxx1p2692Mgi1Vg6BAabo2B6of48yDweL3M57wLg1hdVdThGrjXfAjijbgPEPrtepdyseZJY3n35YosMrM1M" ], "script": "base64:BgKrJwgCEgMKAQgSABIECgIBBBIDCgEBEgQKAgEEEgQKAggBEgQKAggBEgQKAggBEgUKAwEIARIAEgQKAgEBEgMKAQESBQoDAQEBEgQKAggIEgASAwoBCBIFCgMBAQESBAoCAQESBAoCCAESBAoCCAgSCwoJCAEBAgECCAQEEgYKBAgIAQgSABIDCgEBEgMKAQESBAoCCAEiCmxQZGVjaW1hbHMiBnNjYWxlOCIMc2NhbGU4QmlnSW50IgdzY2FsZTE4Igp6ZXJvQmlnSW50IgRiaWcwIgRiaWcxIgRiaWcyIgt3YXZlc1N0cmluZyIDU0VQIgpQb29sQWN0aXZlIg9Qb29sUHV0RGlzYWJsZWQiE1Bvb2xNYXRjaGVyRGlzYWJsZWQiDFBvb2xTaHV0ZG93biIOaWR4UG9vbEFkZHJlc3MiDWlkeFBvb2xTdGF0dXMiEGlkeFBvb2xMUEFzc2V0SWQiDWlkeEFtdEFzc2V0SWQiD2lkeFByaWNlQXNzZXRJZCIOaWR4QW10QXNzZXREY20iEGlkeFByaWNlQXNzZXREY20iDmlkeElBbXRBc3NldElkIhBpZHhJUHJpY2VBc3NldElkIg1pZHhMUEF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JZCQDMCAIJAKQDAQUCYlYJAMwIAgkApgMBBQJjYgkAzAgCCQCkAwEFAmJVBQNuaWwFAWoBAmZHAQJmSAAEAmZJBAJkcQkBAmV1AAMJAAECBQJkcQIKQnl0ZVZlY3RvcgQCZXoFAmRxBQJlegMJAAECBQJkcQIEVW5pdAgFAmZHD3NlbmRlclB1YmxpY0tleQkAAgECC01hdGNoIGVycm9yBAJkcQUCZkcDCQABAgUCZHECBU9yZGVyBAJjUgUCZHEEAmZKCQECYUcABAJhdQkBAmNRAQUCY1IEAmF2CQD0AwMIBQJjUglib2R5Qnl0ZXMJAJEDAggFAmNSBnByb29mcwAACAUCY1IPc2VuZGVyUHVibGljS2V5BAJhdwkA9AMDCAUCY1IJYm9keUJ5dGVzCQCRAwIIBQJjUgZwcm9vZnMAAQUCZkoDAwMFAmF1BQJhdgcFAmF3BwYJAQJhdAMFAmF1BQJhdgUCYXcDCQABAgUCZHECFFNldFNjcmlwdFRyYW5zYWN0aW9uBAJldgUCZHEEAmZLCQD2AwEJAQV2YWx1ZQEIBQJldgZzY3JpcHQEAmZMCQDbBAEJAQV2YWx1ZQEJAJ0IAgUCYUQJAQJhcgAEAmZNCQDxBwEFBHRoaXMDAwkAAAIFAmZMBQJmSwkBAiE9AgUCZk0FAmZLBwYJAPQDAwgFAmZHCWJvZHlCeXRlcwkAkQMCCAUCZkcGcHJvb2ZzAAAFAmZJCQD0AwMIBQJmRwlib2R5Qnl0ZXMJAJEDAggFAmZHBnByb29mcwAABQJmSfqdYTY=", "chainId": 84, "height": 2306723, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: J5oVBWpJ7S9o6X6ibNm7JciaVvDxzkixBYcazjVJYkeN Next: 2iwS4GzGXnqk6ei5xTc1Kc4jNEo1y5iosVRDeW98Ux3a Diff:
Old | New | Differences | |
---|---|---|---|
512 | 512 | 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))] | |
513 | 513 | let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, cfgPriceAssetDecimals), toX18(amountBalanceOld, cfgAmountAssetDecimals)) | |
514 | 514 | let priceOld = fromX18(priceOldX18, scale8) | |
515 | - | let priceImpact = abs((((priceNew - priceOld) * scale8) / priceOld)) | |
516 | - | $Tuple4(issueAmount, commonState, feeAmount, priceImpact) | |
515 | + | let bonus = { | |
516 | + | let $t02467624843 = if (paymentInAmountAsset) | |
517 | + | then $Tuple2(amountAssetAmountRaw, amountBalanceOld) | |
518 | + | else $Tuple2(priceAssetAmountRaw, priceBalanceOld) | |
519 | + | let amount = $t02467624843._1 | |
520 | + | let balance = $t02467624843._2 | |
521 | + | let issueAmountBoth = toInt(fraction(supplyBigInt, toBigInt((amount / 2)), toBigInt(balance))) | |
522 | + | (((issueAmount - issueAmountBoth) * scale8) / issueAmount) | |
523 | + | } | |
524 | + | $Tuple4(issueAmount, commonState, feeAmount, bonus) | |
517 | 525 | } | |
518 | 526 | else throw("Strict value is not equal to itself.") | |
519 | 527 | } | |
543 | 551 | let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity) | |
544 | 552 | let redeemedBigInt = toBigInt(paymentAmount) | |
545 | 553 | let amountRaw = max([0, toInt(((balanceBigInt * (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN))) / scale18))]) | |
546 | - | let $ | |
547 | - | let totalAmount = $ | |
548 | - | let feeAmount = $ | |
549 | - | let $ | |
554 | + | let $t02641426464 = takeFee(amountRaw) | |
555 | + | let totalAmount = $t02641426464._1 | |
556 | + | let feeAmount = $t02641426464._2 | |
557 | + | let $t02646826694 = if (outInAmountAsset) | |
550 | 558 | then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld) | |
551 | 559 | else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw)) | |
552 | - | let outAmAmount = $ | |
553 | - | let outPrAmount = $ | |
554 | - | let amBalanceNew = $ | |
555 | - | let prBalanceNew = $ | |
560 | + | let outAmAmount = $t02646826694._1 | |
561 | + | let outPrAmount = $t02646826694._2 | |
562 | + | let amBalanceNew = $t02646826694._3 | |
563 | + | let prBalanceNew = $t02646826694._4 | |
556 | 564 | let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, cfgPriceAssetDecimals), toX18(amBalanceNew, cfgAmountAssetDecimals)) | |
557 | 565 | let priceNew = fromX18(priceNewX18, scale8) | |
558 | 566 | let commonState = if (isEval) | |
560 | 568 | 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)] | |
561 | 569 | let priceOldX18 = calcPriceBigInt(toX18(prBalanceOld, cfgPriceAssetDecimals), toX18(amBalanceOld, cfgAmountAssetDecimals)) | |
562 | 570 | let priceOld = fromX18(priceOldX18, scale8) | |
563 | - | let priceImpact = abs((((priceNew - priceOld) * scale8) / priceOld)) | |
564 | - | $Tuple4(totalAmount, commonState, feeAmount, priceImpact) | |
571 | + | let bonus = { | |
572 | + | let amountBothInPaymentAsset = (toInt(fraction(balanceBigInt, redeemedBigInt, supplyBigInt)) * 2) | |
573 | + | (((totalAmount - amountBothInPaymentAsset) * scale8) / totalAmount) | |
574 | + | } | |
575 | + | $Tuple4(totalAmount, commonState, feeAmount, bonus) | |
565 | 576 | } | |
566 | 577 | else throw("Strict value is not equal to itself.") | |
567 | 578 | } | |
730 | 741 | let paymentAmountRaw = payment.amount | |
731 | 742 | let userAddress = i.caller | |
732 | 743 | let txId = i.transactionId | |
733 | - | let $ | |
734 | - | let emitAmountEstimated = $ | |
735 | - | let commonState = $ | |
736 | - | let feeAmount = $ | |
737 | - | let bonus = $ | |
744 | + | let $t03138731514 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId) | |
745 | + | let emitAmountEstimated = $t03138731514._1 | |
746 | + | let commonState = $t03138731514._2 | |
747 | + | let feeAmount = $t03138731514._3 | |
748 | + | let bonus = $t03138731514._4 | |
738 | 749 | let emitAmount = if (if ((minOutAmount > 0)) | |
739 | 750 | then (minOutAmount > emitAmountEstimated) | |
740 | 751 | else false) | |
765 | 776 | ||
766 | 777 | @Callable(i) | |
767 | 778 | func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = { | |
768 | - | let $ | |
769 | - | let emitAmountEstimated = $ | |
770 | - | let commonState = $ | |
771 | - | let feeAmount = $ | |
772 | - | let bonus = $ | |
779 | + | let $t03224332378 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit) | |
780 | + | let emitAmountEstimated = $t03224332378._1 | |
781 | + | let commonState = $t03224332378._2 | |
782 | + | let feeAmount = $t03224332378._3 | |
783 | + | let bonus = $t03224332378._4 | |
773 | 784 | $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus)) | |
774 | 785 | } | |
775 | 786 | ||
801 | 812 | let paymentAmount = payment.amount | |
802 | 813 | let userAddress = i.caller | |
803 | 814 | let txId = i.transactionId | |
804 | - | let $ | |
805 | - | let amountEstimated = $ | |
806 | - | let commonState = $ | |
807 | - | let feeAmount = $ | |
808 | - | let bonus = $ | |
815 | + | let $t03315033282 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId) | |
816 | + | let amountEstimated = $t03315033282._1 | |
817 | + | let commonState = $t03315033282._2 | |
818 | + | let feeAmount = $t03315033282._3 | |
819 | + | let bonus = $t03315033282._4 | |
809 | 820 | let amount = if (if ((minOutAmount > 0)) | |
810 | 821 | then (minOutAmount > amountEstimated) | |
811 | 822 | else false) | |
829 | 840 | ||
830 | 841 | @Callable(i) | |
831 | 842 | func getOneTknREADONLY (outAssetId,paymentAmount) = { | |
832 | - | let $ | |
833 | - | let amountEstimated = $ | |
834 | - | let commonState = $ | |
835 | - | let feeAmount = $ | |
836 | - | let bonus = $ | |
843 | + | let $t03391734055 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit) | |
844 | + | let amountEstimated = $t03391734055._1 | |
845 | + | let commonState = $t03391734055._2 | |
846 | + | let feeAmount = $t03391734055._3 | |
847 | + | let bonus = $t03391734055._4 | |
837 | 848 | $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus)) | |
838 | 849 | } | |
839 | 850 | ||
865 | 876 | let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil) | |
866 | 877 | if ((unstakeInv == unstakeInv)) | |
867 | 878 | then { | |
868 | - | let $ | |
869 | - | let amountEstimated = $ | |
870 | - | let commonState = $ | |
871 | - | let feeAmount = $ | |
872 | - | let bonus = $ | |
879 | + | let $t03484734977 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId) | |
880 | + | let amountEstimated = $t03484734977._1 | |
881 | + | let commonState = $t03484734977._2 | |
882 | + | let feeAmount = $t03484734977._3 | |
883 | + | let bonus = $t03484734977._4 | |
873 | 884 | let amount = if (if ((minOutAmount > 0)) | |
874 | 885 | then (minOutAmount > amountEstimated) | |
875 | 886 | else false) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let lPdecimals = 8 | |
5 | 5 | ||
6 | 6 | let scale8 = 100000000 | |
7 | 7 | ||
8 | 8 | let scale8BigInt = toBigInt(100000000) | |
9 | 9 | ||
10 | 10 | let scale18 = toBigInt(1000000000000000000) | |
11 | 11 | ||
12 | 12 | let zeroBigInt = toBigInt(0) | |
13 | 13 | ||
14 | 14 | let big0 = toBigInt(0) | |
15 | 15 | ||
16 | 16 | let big1 = toBigInt(1) | |
17 | 17 | ||
18 | 18 | let big2 = toBigInt(2) | |
19 | 19 | ||
20 | 20 | let wavesString = "WAVES" | |
21 | 21 | ||
22 | 22 | let SEP = "__" | |
23 | 23 | ||
24 | 24 | let PoolActive = 1 | |
25 | 25 | ||
26 | 26 | let PoolPutDisabled = 2 | |
27 | 27 | ||
28 | 28 | let PoolMatcherDisabled = 3 | |
29 | 29 | ||
30 | 30 | let PoolShutdown = 4 | |
31 | 31 | ||
32 | 32 | let idxPoolAddress = 1 | |
33 | 33 | ||
34 | 34 | let idxPoolStatus = 2 | |
35 | 35 | ||
36 | 36 | let idxPoolLPAssetId = 3 | |
37 | 37 | ||
38 | 38 | let idxAmtAssetId = 4 | |
39 | 39 | ||
40 | 40 | let idxPriceAssetId = 5 | |
41 | 41 | ||
42 | 42 | let idxAmtAssetDcm = 6 | |
43 | 43 | ||
44 | 44 | let idxPriceAssetDcm = 7 | |
45 | 45 | ||
46 | 46 | let idxIAmtAssetId = 8 | |
47 | 47 | ||
48 | 48 | let idxIPriceAssetId = 9 | |
49 | 49 | ||
50 | 50 | let idxLPAssetDcm = 10 | |
51 | 51 | ||
52 | 52 | let idxPoolAmtAssetAmt = 1 | |
53 | 53 | ||
54 | 54 | let idxPoolPriceAssetAmt = 2 | |
55 | 55 | ||
56 | 56 | let idxPoolLPAssetAmt = 3 | |
57 | 57 | ||
58 | 58 | let idxFactoryStakingContract = 1 | |
59 | 59 | ||
60 | 60 | let idxFactorySlippageContract = 7 | |
61 | 61 | ||
62 | 62 | func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), scale18, toBigInt(origScaleMult)) | |
63 | 63 | ||
64 | 64 | ||
65 | 65 | func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), scale18)) | |
66 | 66 | ||
67 | 67 | ||
68 | 68 | func toScale (amt,resScale,curScale) = fraction(amt, resScale, curScale) | |
69 | 69 | ||
70 | 70 | ||
71 | 71 | func abs (val) = if ((0 > val)) | |
72 | 72 | then -(val) | |
73 | 73 | else val | |
74 | 74 | ||
75 | 75 | ||
76 | 76 | func absBigInt (val) = if ((zeroBigInt > val)) | |
77 | 77 | then -(val) | |
78 | 78 | else val | |
79 | 79 | ||
80 | 80 | ||
81 | 81 | func fc () = "%s__factoryContract" | |
82 | 82 | ||
83 | 83 | ||
84 | 84 | func mpk () = "%s__managerPublicKey" | |
85 | 85 | ||
86 | 86 | ||
87 | 87 | func pmpk () = "%s__pendingManagerPublicKey" | |
88 | 88 | ||
89 | 89 | ||
90 | 90 | func pl () = "%s%s__price__last" | |
91 | 91 | ||
92 | 92 | ||
93 | 93 | func ph (h,timestamp) = makeString(["%s%s%d%d__price__history", toString(h), toString(timestamp)], SEP) | |
94 | 94 | ||
95 | 95 | ||
96 | 96 | func pau (userAddress,txId) = ((("%s%s%s__P__" + userAddress) + "__") + txId) | |
97 | 97 | ||
98 | 98 | ||
99 | 99 | func gau (userAddress,txId) = ((("%s%s%s__G__" + userAddress) + "__") + txId) | |
100 | 100 | ||
101 | 101 | ||
102 | 102 | func aa () = "%s__amountAsset" | |
103 | 103 | ||
104 | 104 | ||
105 | 105 | func pa () = "%s__priceAsset" | |
106 | 106 | ||
107 | 107 | ||
108 | 108 | let keyFee = "%s__fee" | |
109 | 109 | ||
110 | 110 | let feeDefault = fraction(10, scale8, 10000) | |
111 | 111 | ||
112 | 112 | let fee = valueOrElse(getInteger(this, keyFee), feeDefault) | |
113 | 113 | ||
114 | 114 | func keyFactoryConfig () = "%s__factoryConfig" | |
115 | 115 | ||
116 | 116 | ||
117 | 117 | func keyMatcherPub () = "%s%s__matcher__publicKey" | |
118 | 118 | ||
119 | 119 | ||
120 | 120 | func keyMappingPoolContractAddressToPoolAssets (poolContractAddress) = (("%s%s%s__" + poolContractAddress) + "__mappings__poolContract2LpAsset") | |
121 | 121 | ||
122 | 122 | ||
123 | 123 | func keyPoolConfig (iAmtAsset,iPriceAsset) = (((("%d%d%s__" + iAmtAsset) + "__") + iPriceAsset) + "__config") | |
124 | 124 | ||
125 | 125 | ||
126 | 126 | func keyMappingsBaseAsset2internalId (baseAssetStr) = ("%s%s%s__mappings__baseAsset2internalId__" + baseAssetStr) | |
127 | 127 | ||
128 | 128 | ||
129 | 129 | func keyAllPoolsShutdown () = "%s__shutdown" | |
130 | 130 | ||
131 | 131 | ||
132 | 132 | func keyPoolWeight (contractAddress) = ("%s%s__poolWeight__" + contractAddress) | |
133 | 133 | ||
134 | 134 | ||
135 | 135 | func keyAllowedLpScriptHash () = "%s__allowedLpScriptHash" | |
136 | 136 | ||
137 | 137 | ||
138 | 138 | let keyFeeCollectorAddress = "%s__feeCollectorAddress" | |
139 | 139 | ||
140 | 140 | func throwOrderError (orderValid,senderValid,matcherValid) = throw(((((("order validation failed: orderValid=" + toString(orderValid)) + " senderValid=") + toString(senderValid)) + " matcherValid=") + toString(matcherValid))) | |
141 | 141 | ||
142 | 142 | ||
143 | 143 | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
144 | 144 | ||
145 | 145 | ||
146 | 146 | func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
147 | 147 | ||
148 | 148 | ||
149 | 149 | func throwErr (msg) = throw(makeString(["lp.ride:", msg], " ")) | |
150 | 150 | ||
151 | 151 | ||
152 | 152 | let factoryContract = addressFromStringValue(getStringOrFail(this, fc())) | |
153 | 153 | ||
154 | 154 | let feeCollectorAddress = addressFromStringValue(getStringOrFail(factoryContract, keyFeeCollectorAddress)) | |
155 | 155 | ||
156 | 156 | func isGlobalShutdown () = valueOrElse(getBoolean(factoryContract, keyAllPoolsShutdown()), false) | |
157 | 157 | ||
158 | 158 | ||
159 | 159 | func getMatcherPubOrFail () = fromBase58String(getStringOrFail(factoryContract, keyMatcherPub())) | |
160 | 160 | ||
161 | 161 | ||
162 | 162 | func getPoolConfig () = { | |
163 | 163 | let amtAsset = getStringOrFail(this, aa()) | |
164 | 164 | let priceAsset = getStringOrFail(this, pa()) | |
165 | 165 | let iPriceAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(priceAsset)) | |
166 | 166 | let iAmtAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(amtAsset)) | |
167 | 167 | split(getStringOrFail(factoryContract, keyPoolConfig(toString(iAmtAsset), toString(iPriceAsset))), SEP) | |
168 | 168 | } | |
169 | 169 | ||
170 | 170 | ||
171 | 171 | func parseAssetId (input) = if ((input == wavesString)) | |
172 | 172 | then unit | |
173 | 173 | else fromBase58String(input) | |
174 | 174 | ||
175 | 175 | ||
176 | 176 | func assetIdToString (input) = if ((input == unit)) | |
177 | 177 | then wavesString | |
178 | 178 | else toBase58String(value(input)) | |
179 | 179 | ||
180 | 180 | ||
181 | 181 | 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])) | |
182 | 182 | ||
183 | 183 | ||
184 | 184 | let poolConfigParsed = parsePoolConfig(getPoolConfig()) | |
185 | 185 | ||
186 | 186 | let $t075447710 = poolConfigParsed | |
187 | 187 | ||
188 | 188 | let cfgPoolAddress = $t075447710._1 | |
189 | 189 | ||
190 | 190 | let cfgPoolStatus = $t075447710._2 | |
191 | 191 | ||
192 | 192 | let cfgLpAssetId = $t075447710._3 | |
193 | 193 | ||
194 | 194 | let cfgAmountAssetId = $t075447710._4 | |
195 | 195 | ||
196 | 196 | let cfgPriceAssetId = $t075447710._5 | |
197 | 197 | ||
198 | 198 | let cfgAmountAssetDecimals = $t075447710._6 | |
199 | 199 | ||
200 | 200 | let cfgPriceAssetDecimals = $t075447710._7 | |
201 | 201 | ||
202 | 202 | func getFactoryConfig () = split(getStringOrFail(factoryContract, keyFactoryConfig()), SEP) | |
203 | 203 | ||
204 | 204 | ||
205 | 205 | let stakingContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactoryStakingContract]), "incorrect staking address") | |
206 | 206 | ||
207 | 207 | let slippageContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactorySlippageContract]), "incorrect staking address") | |
208 | 208 | ||
209 | 209 | 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) | |
210 | 210 | ||
211 | 211 | ||
212 | 212 | 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) | |
213 | 213 | ||
214 | 214 | ||
215 | 215 | func getAccBalance (assetId) = if ((assetId == "WAVES")) | |
216 | 216 | then wavesBalance(this).available | |
217 | 217 | else assetBalance(this, fromBase58String(assetId)) | |
218 | 218 | ||
219 | 219 | ||
220 | 220 | func calcPriceBigInt (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18) | |
221 | 221 | ||
222 | 222 | ||
223 | 223 | func privateCalcPrice (amAssetDcm,prAssetDcm,amAmt,prAmt) = { | |
224 | 224 | let amtAssetAmtX18 = toX18(amAmt, amAssetDcm) | |
225 | 225 | let priceAssetAmtX18 = toX18(prAmt, prAssetDcm) | |
226 | 226 | calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18) | |
227 | 227 | } | |
228 | 228 | ||
229 | 229 | ||
230 | 230 | func calcPrices (amAmt,prAmt,lpAmt) = { | |
231 | 231 | let cfg = getPoolConfig() | |
232 | 232 | let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm]) | |
233 | 233 | let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm]) | |
234 | 234 | let priceX18 = privateCalcPrice(amtAssetDcm, priceAssetDcm, amAmt, prAmt) | |
235 | 235 | let amAmtX18 = toX18(amAmt, amtAssetDcm) | |
236 | 236 | let prAmtX18 = toX18(prAmt, priceAssetDcm) | |
237 | 237 | let lpAmtX18 = toX18(lpAmt, scale8) | |
238 | 238 | let lpPriceInAmAssetX18 = calcPriceBigInt(amAmtX18, lpAmtX18) | |
239 | 239 | let lpPriceInPrAssetX18 = calcPriceBigInt(prAmtX18, lpAmtX18) | |
240 | 240 | [priceX18, lpPriceInAmAssetX18, lpPriceInPrAssetX18] | |
241 | 241 | } | |
242 | 242 | ||
243 | 243 | ||
244 | 244 | func calculatePrices (amAmt,prAmt,lpAmt) = { | |
245 | 245 | let prices = calcPrices(amAmt, prAmt, lpAmt) | |
246 | 246 | [fromX18(prices[0], scale8), fromX18(prices[1], scale8), fromX18(prices[2], scale8)] | |
247 | 247 | } | |
248 | 248 | ||
249 | 249 | ||
250 | 250 | func estimateGetOperation (txId58,pmtAssetId,pmtLpAmt,userAddress) = { | |
251 | 251 | let cfg = getPoolConfig() | |
252 | 252 | let lpAssetId = cfg[idxPoolLPAssetId] | |
253 | 253 | let amAssetId = cfg[idxAmtAssetId] | |
254 | 254 | let prAssetId = cfg[idxPriceAssetId] | |
255 | 255 | let amAssetDcm = parseIntValue(cfg[idxAmtAssetDcm]) | |
256 | 256 | let prAssetDcm = parseIntValue(cfg[idxPriceAssetDcm]) | |
257 | 257 | let poolStatus = cfg[idxPoolStatus] | |
258 | 258 | let lpEmission = valueOrErrorMessage(assetInfo(fromBase58String(lpAssetId)), (("Asset " + lpAssetId) + " doesn't exist")).quantity | |
259 | 259 | if ((lpAssetId != pmtAssetId)) | |
260 | 260 | then throw("Invalid asset passed.") | |
261 | 261 | else { | |
262 | 262 | let amBalance = getAccBalance(amAssetId) | |
263 | 263 | let amBalanceX18 = toX18(amBalance, amAssetDcm) | |
264 | 264 | let prBalance = getAccBalance(prAssetId) | |
265 | 265 | let prBalanceX18 = toX18(prBalance, prAssetDcm) | |
266 | 266 | let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18) | |
267 | 267 | let curPrice = fromX18(curPriceX18, scale8) | |
268 | 268 | let pmtLpAmtX18 = toX18(pmtLpAmt, scale8) | |
269 | 269 | let lpEmissionX18 = toX18(lpEmission, scale8) | |
270 | 270 | let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissionX18) | |
271 | 271 | let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissionX18) | |
272 | 272 | let outAmAmt = fromX18(outAmAmtX18, amAssetDcm) | |
273 | 273 | let outPrAmt = fromX18(outPrAmtX18, prAssetDcm) | |
274 | 274 | let state = if ((txId58 == "")) | |
275 | 275 | then nil | |
276 | 276 | else [ScriptTransfer(userAddress, outAmAmt, if ((amAssetId == "WAVES")) | |
277 | 277 | then unit | |
278 | 278 | else fromBase58String(amAssetId)), ScriptTransfer(userAddress, outPrAmt, if ((prAssetId == "WAVES")) | |
279 | 279 | then unit | |
280 | 280 | 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)] | |
281 | 281 | $Tuple10(outAmAmt, outPrAmt, amAssetId, prAssetId, amBalance, prBalance, lpEmission, curPriceX18, poolStatus, state) | |
282 | 282 | } | |
283 | 283 | } | |
284 | 284 | ||
285 | 285 | ||
286 | 286 | func estimatePutOperation (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = { | |
287 | 287 | let cfg = getPoolConfig() | |
288 | 288 | let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId]) | |
289 | 289 | let amAssetIdStr = cfg[idxAmtAssetId] | |
290 | 290 | let prAssetIdStr = cfg[idxPriceAssetId] | |
291 | 291 | let iAmtAssetId = cfg[idxIAmtAssetId] | |
292 | 292 | let iPriceAssetId = cfg[idxIPriceAssetId] | |
293 | 293 | let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm]) | |
294 | 294 | let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm]) | |
295 | 295 | let poolStatus = cfg[idxPoolStatus] | |
296 | 296 | let lpEmission = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity | |
297 | 297 | let inAmAssetIdStr = toBase58String(valueOrElse(inAmAssetId, fromBase58String("WAVES"))) | |
298 | 298 | let inPrAssetIdStr = toBase58String(valueOrElse(inPrAssetId, fromBase58String("WAVES"))) | |
299 | 299 | if (if ((amAssetIdStr != inAmAssetIdStr)) | |
300 | 300 | then true | |
301 | 301 | else (prAssetIdStr != inPrAssetIdStr)) | |
302 | 302 | then throw("Invalid amt or price asset passed.") | |
303 | 303 | else { | |
304 | 304 | let amBalance = if (isEvaluate) | |
305 | 305 | then getAccBalance(amAssetIdStr) | |
306 | 306 | else (getAccBalance(amAssetIdStr) - inAmAssetAmt) | |
307 | 307 | let prBalance = if (isEvaluate) | |
308 | 308 | then getAccBalance(prAssetIdStr) | |
309 | 309 | else (getAccBalance(prAssetIdStr) - inPrAssetAmt) | |
310 | 310 | let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm) | |
311 | 311 | let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm) | |
312 | 312 | let userPriceX18 = calcPriceBigInt(inPrAssetAmtX18, inAmAssetAmtX18) | |
313 | 313 | let amBalanceX18 = toX18(amBalance, amtAssetDcm) | |
314 | 314 | let prBalanceX18 = toX18(prBalance, priceAssetDcm) | |
315 | 315 | let res = if ((lpEmission == 0)) | |
316 | 316 | then { | |
317 | 317 | let curPriceX18 = zeroBigInt | |
318 | 318 | let slippageX18 = zeroBigInt | |
319 | 319 | let lpAmtX18 = pow((inAmAssetAmtX18 * inPrAssetAmtX18), 0, toBigInt(5), 1, 0, DOWN) | |
320 | 320 | $Tuple5(fromX18(lpAmtX18, scale8), fromX18(inAmAssetAmtX18, amtAssetDcm), fromX18(inPrAssetAmtX18, priceAssetDcm), calcPriceBigInt((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18) | |
321 | 321 | } | |
322 | 322 | else { | |
323 | 323 | let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18) | |
324 | 324 | let slippageX18 = fraction(absBigInt((curPriceX18 - userPriceX18)), scale18, curPriceX18) | |
325 | 325 | let slippageToleranceX18 = toX18(slippageTolerance, scale8) | |
326 | 326 | if (if ((curPriceX18 != zeroBigInt)) | |
327 | 327 | then (slippageX18 > slippageToleranceX18) | |
328 | 328 | else false) | |
329 | 329 | then throw(((("Price slippage " + toString(slippageX18)) + " exceeded the passed limit of ") + toString(slippageToleranceX18))) | |
330 | 330 | else { | |
331 | 331 | let lpEmissionX18 = toX18(lpEmission, scale8) | |
332 | 332 | let prViaAmX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18) | |
333 | 333 | let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18) | |
334 | 334 | let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18)) | |
335 | 335 | then $Tuple2(amViaPrX18, inPrAssetAmtX18) | |
336 | 336 | else $Tuple2(inAmAssetAmtX18, prViaAmX18) | |
337 | 337 | let expAmtAssetAmtX18 = expectedAmts._1 | |
338 | 338 | let expPriceAssetAmtX18 = expectedAmts._2 | |
339 | 339 | let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18) | |
340 | 340 | $Tuple5(fromX18(lpAmtX18, scale8), fromX18(expAmtAssetAmtX18, amtAssetDcm), fromX18(expPriceAssetAmtX18, priceAssetDcm), curPriceX18, slippageX18) | |
341 | 341 | } | |
342 | 342 | } | |
343 | 343 | let calcLpAmt = res._1 | |
344 | 344 | let calcAmAssetPmt = res._2 | |
345 | 345 | let calcPrAssetPmt = res._3 | |
346 | 346 | let curPrice = fromX18(res._4, scale8) | |
347 | 347 | let slippageCalc = fromX18(res._5, scale8) | |
348 | 348 | if ((0 >= calcLpAmt)) | |
349 | 349 | then throw("Invalid calculations. LP calculated is less than zero.") | |
350 | 350 | else { | |
351 | 351 | let emitLpAmt = if (!(emitLp)) | |
352 | 352 | then 0 | |
353 | 353 | else calcLpAmt | |
354 | 354 | let amDiff = (inAmAssetAmt - calcAmAssetPmt) | |
355 | 355 | let prDiff = (inPrAssetAmt - calcPrAssetPmt) | |
356 | 356 | 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))] | |
357 | 357 | $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEmission, lpAssetId, poolStatus, commonState, amDiff, prDiff, inAmAssetId, inPrAssetId) | |
358 | 358 | } | |
359 | 359 | } | |
360 | 360 | } | |
361 | 361 | ||
362 | 362 | ||
363 | 363 | func validateMatcherOrderAllowed (order) = { | |
364 | 364 | let cfg = getPoolConfig() | |
365 | 365 | let amtAssetId = cfg[idxAmtAssetId] | |
366 | 366 | let priceAssetId = cfg[idxPriceAssetId] | |
367 | 367 | let poolStatus = parseIntValue(cfg[idxPoolStatus]) | |
368 | 368 | let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm]) | |
369 | 369 | let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm]) | |
370 | 370 | let accAmtAssetBalance = getAccBalance(amtAssetId) | |
371 | 371 | let accPriceAssetBalance = getAccBalance(priceAssetId) | |
372 | 372 | let curPriceX18 = if ((order.orderType == Buy)) | |
373 | 373 | then privateCalcPrice(amtAssetDcm, priceAssetDcm, (accAmtAssetBalance + order.amount), accPriceAssetBalance) | |
374 | 374 | else privateCalcPrice(amtAssetDcm, priceAssetDcm, (accAmtAssetBalance - order.amount), accPriceAssetBalance) | |
375 | 375 | let curPrice = fromX18(curPriceX18, scale8) | |
376 | 376 | if (if (if (isGlobalShutdown()) | |
377 | 377 | then true | |
378 | 378 | else (poolStatus == PoolMatcherDisabled)) | |
379 | 379 | then true | |
380 | 380 | else (poolStatus == PoolShutdown)) | |
381 | 381 | then throw("Exchange operations disabled") | |
382 | 382 | else { | |
383 | 383 | let orderAmtAsset = order.assetPair.amountAsset | |
384 | 384 | let orderAmtAssetStr = if ((orderAmtAsset == unit)) | |
385 | 385 | then "WAVES" | |
386 | 386 | else toBase58String(value(orderAmtAsset)) | |
387 | 387 | let orderPriceAsset = order.assetPair.priceAsset | |
388 | 388 | let orderPriceAssetStr = if ((orderPriceAsset == unit)) | |
389 | 389 | then "WAVES" | |
390 | 390 | else toBase58String(value(orderPriceAsset)) | |
391 | 391 | if (if ((orderAmtAssetStr != amtAssetId)) | |
392 | 392 | then true | |
393 | 393 | else (orderPriceAssetStr != priceAssetId)) | |
394 | 394 | then throw("Wrong order assets.") | |
395 | 395 | else { | |
396 | 396 | let orderPrice = order.price | |
397 | 397 | let priceDcm = fraction(scale8, priceAssetDcm, amtAssetDcm) | |
398 | 398 | let castedOrderPrice = toScale(orderPrice, scale8, priceDcm) | |
399 | 399 | let isOrderPriceValid = if ((order.orderType == Buy)) | |
400 | 400 | then (curPrice >= castedOrderPrice) | |
401 | 401 | else (castedOrderPrice >= curPrice) | |
402 | 402 | true | |
403 | 403 | } | |
404 | 404 | } | |
405 | 405 | } | |
406 | 406 | ||
407 | 407 | ||
408 | 408 | func commonGet (i) = if ((size(i.payments) != 1)) | |
409 | 409 | then throw("exactly 1 payment is expected") | |
410 | 410 | else { | |
411 | 411 | let pmt = value(i.payments[0]) | |
412 | 412 | let pmtAssetId = value(pmt.assetId) | |
413 | 413 | let pmtAmt = pmt.amount | |
414 | 414 | let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller) | |
415 | 415 | let outAmAmt = res._1 | |
416 | 416 | let outPrAmt = res._2 | |
417 | 417 | let poolStatus = parseIntValue(res._9) | |
418 | 418 | let state = res._10 | |
419 | 419 | if (if (isGlobalShutdown()) | |
420 | 420 | then true | |
421 | 421 | else (poolStatus == PoolShutdown)) | |
422 | 422 | then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus))) | |
423 | 423 | else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state) | |
424 | 424 | } | |
425 | 425 | ||
426 | 426 | ||
427 | 427 | func commonPut (i,slippageTolerance,emitLp) = if ((size(i.payments) != 2)) | |
428 | 428 | then throw("exactly 2 payments are expected") | |
429 | 429 | else { | |
430 | 430 | let amAssetPmt = value(i.payments[0]) | |
431 | 431 | let prAssetPmt = value(i.payments[1]) | |
432 | 432 | let estPut = estimatePutOperation(toBase58String(i.transactionId), slippageTolerance, amAssetPmt.amount, amAssetPmt.assetId, prAssetPmt.amount, prAssetPmt.assetId, toString(i.caller), false, emitLp) | |
433 | 433 | let poolStatus = parseIntValue(estPut._8) | |
434 | 434 | if (if (if (isGlobalShutdown()) | |
435 | 435 | then true | |
436 | 436 | else (poolStatus == PoolPutDisabled)) | |
437 | 437 | then true | |
438 | 438 | else (poolStatus == PoolShutdown)) | |
439 | 439 | then throw(("Put operation is blocked by admin. Status = " + toString(poolStatus))) | |
440 | 440 | else estPut | |
441 | 441 | } | |
442 | 442 | ||
443 | 443 | ||
444 | 444 | func emit (amount) = { | |
445 | 445 | let emitInv = invoke(factoryContract, "emit", [amount], nil) | |
446 | 446 | if ((emitInv == emitInv)) | |
447 | 447 | then { | |
448 | 448 | let emitInvLegacy = match emitInv { | |
449 | 449 | case legacyFactoryContract: Address => | |
450 | 450 | invoke(legacyFactoryContract, "emit", [amount], nil) | |
451 | 451 | case _ => | |
452 | 452 | unit | |
453 | 453 | } | |
454 | 454 | if ((emitInvLegacy == emitInvLegacy)) | |
455 | 455 | then amount | |
456 | 456 | else throw("Strict value is not equal to itself.") | |
457 | 457 | } | |
458 | 458 | else throw("Strict value is not equal to itself.") | |
459 | 459 | } | |
460 | 460 | ||
461 | 461 | ||
462 | 462 | func takeFee (amount) = { | |
463 | 463 | let feeAmount = fraction(amount, fee, scale8) | |
464 | 464 | $Tuple2((amount - feeAmount), feeAmount) | |
465 | 465 | } | |
466 | 466 | ||
467 | 467 | ||
468 | 468 | func calcPutOneToken (paymentAmountRaw,paymentAssetId,userAddress,txId) = { | |
469 | 469 | let isEval = (txId == unit) | |
470 | 470 | let amountBalanceRaw = getAccBalance(assetIdToString(cfgAmountAssetId)) | |
471 | 471 | let priceBalanceRaw = getAccBalance(assetIdToString(cfgPriceAssetId)) | |
472 | 472 | let paymentInAmountAsset = if ((paymentAssetId == cfgAmountAssetId)) | |
473 | 473 | then true | |
474 | 474 | else if ((paymentAssetId == cfgPriceAssetId)) | |
475 | 475 | then false | |
476 | 476 | else throwErr("invalid asset") | |
477 | 477 | let $t02257122864 = if (isEval) | |
478 | 478 | then $Tuple2(amountBalanceRaw, priceBalanceRaw) | |
479 | 479 | else if (paymentInAmountAsset) | |
480 | 480 | then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw) | |
481 | 481 | else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw)) | |
482 | 482 | let amountBalanceOld = $t02257122864._1 | |
483 | 483 | let priceBalanceOld = $t02257122864._2 | |
484 | 484 | let $t02286823017 = if (paymentInAmountAsset) | |
485 | 485 | then $Tuple2(paymentAmountRaw, 0) | |
486 | 486 | else $Tuple2(0, paymentAmountRaw) | |
487 | 487 | let amountAssetAmountRaw = $t02286823017._1 | |
488 | 488 | let priceAssetAmountRaw = $t02286823017._2 | |
489 | 489 | let amountAssetAmount = takeFee(amountAssetAmountRaw)._1 | |
490 | 490 | let priceAssetAmount = takeFee(priceAssetAmountRaw)._1 | |
491 | 491 | let $t02313923198 = takeFee(paymentAmountRaw) | |
492 | 492 | let paymentAmount = $t02313923198._1 | |
493 | 493 | let feeAmount = $t02313923198._2 | |
494 | 494 | let amountBalanceNew = (amountBalanceOld + amountAssetAmount) | |
495 | 495 | let priceBalanceNew = (priceBalanceOld + priceAssetAmount) | |
496 | 496 | let priceNewX18 = calcPriceBigInt(toX18(priceBalanceNew, cfgPriceAssetDecimals), toX18(amountBalanceNew, cfgAmountAssetDecimals)) | |
497 | 497 | let priceNew = fromX18(priceNewX18, scale8) | |
498 | 498 | let paymentBalance = if (paymentInAmountAsset) | |
499 | 499 | then amountBalanceOld | |
500 | 500 | else priceBalanceOld | |
501 | 501 | let paymentBalanceBigInt = toBigInt(paymentBalance) | |
502 | 502 | let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity) | |
503 | 503 | let chechSupply = if ((supplyBigInt > big0)) | |
504 | 504 | then true | |
505 | 505 | else throwErr("initial deposit requires all coins") | |
506 | 506 | if ((chechSupply == chechSupply)) | |
507 | 507 | then { | |
508 | 508 | let depositBigInt = toBigInt(paymentAmount) | |
509 | 509 | let issueAmount = max([0, toInt(((supplyBigInt * (sqrtBigInt((scale18 + ((depositBigInt * scale18) / paymentBalanceBigInt)), 18, 18, DOWN) - scale18)) / scale18))]) | |
510 | 510 | let commonState = if (isEval) | |
511 | 511 | then nil | |
512 | 512 | 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))] | |
513 | 513 | let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, cfgPriceAssetDecimals), toX18(amountBalanceOld, cfgAmountAssetDecimals)) | |
514 | 514 | let priceOld = fromX18(priceOldX18, scale8) | |
515 | - | let priceImpact = abs((((priceNew - priceOld) * scale8) / priceOld)) | |
516 | - | $Tuple4(issueAmount, commonState, feeAmount, priceImpact) | |
515 | + | let bonus = { | |
516 | + | let $t02467624843 = if (paymentInAmountAsset) | |
517 | + | then $Tuple2(amountAssetAmountRaw, amountBalanceOld) | |
518 | + | else $Tuple2(priceAssetAmountRaw, priceBalanceOld) | |
519 | + | let amount = $t02467624843._1 | |
520 | + | let balance = $t02467624843._2 | |
521 | + | let issueAmountBoth = toInt(fraction(supplyBigInt, toBigInt((amount / 2)), toBigInt(balance))) | |
522 | + | (((issueAmount - issueAmountBoth) * scale8) / issueAmount) | |
523 | + | } | |
524 | + | $Tuple4(issueAmount, commonState, feeAmount, bonus) | |
517 | 525 | } | |
518 | 526 | else throw("Strict value is not equal to itself.") | |
519 | 527 | } | |
520 | 528 | ||
521 | 529 | ||
522 | 530 | func calcGetOneToken (outAssetId,paymentAmount,paymentAssetId,userAddress,txId) = { | |
523 | 531 | let isEval = (txId == unit) | |
524 | 532 | let checks = [if ((paymentAssetId == cfgLpAssetId)) | |
525 | 533 | then true | |
526 | 534 | else throwErr("invalid lp asset")] | |
527 | 535 | if ((checks == checks)) | |
528 | 536 | then { | |
529 | 537 | let outInAmountAsset = if ((outAssetId == cfgAmountAssetId)) | |
530 | 538 | then true | |
531 | 539 | else if ((outAssetId == cfgPriceAssetId)) | |
532 | 540 | then false | |
533 | 541 | else throwErr("invalid asset") | |
534 | 542 | let balanceBigInt = if (outInAmountAsset) | |
535 | 543 | then toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) | |
536 | 544 | else toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) | |
537 | 545 | let amBalanceOld = getAccBalance(assetIdToString(cfgAmountAssetId)) | |
538 | 546 | let prBalanceOld = getAccBalance(assetIdToString(cfgPriceAssetId)) | |
539 | 547 | let outBalance = if (outInAmountAsset) | |
540 | 548 | then amBalanceOld | |
541 | 549 | else prBalanceOld | |
542 | 550 | let outBalanceBigInt = toBigInt(outBalance) | |
543 | 551 | let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity) | |
544 | 552 | let redeemedBigInt = toBigInt(paymentAmount) | |
545 | 553 | let amountRaw = max([0, toInt(((balanceBigInt * (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN))) / scale18))]) | |
546 | - | let $ | |
547 | - | let totalAmount = $ | |
548 | - | let feeAmount = $ | |
549 | - | let $ | |
554 | + | let $t02641426464 = takeFee(amountRaw) | |
555 | + | let totalAmount = $t02641426464._1 | |
556 | + | let feeAmount = $t02641426464._2 | |
557 | + | let $t02646826694 = if (outInAmountAsset) | |
550 | 558 | then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld) | |
551 | 559 | else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw)) | |
552 | - | let outAmAmount = $ | |
553 | - | let outPrAmount = $ | |
554 | - | let amBalanceNew = $ | |
555 | - | let prBalanceNew = $ | |
560 | + | let outAmAmount = $t02646826694._1 | |
561 | + | let outPrAmount = $t02646826694._2 | |
562 | + | let amBalanceNew = $t02646826694._3 | |
563 | + | let prBalanceNew = $t02646826694._4 | |
556 | 564 | let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, cfgPriceAssetDecimals), toX18(amBalanceNew, cfgAmountAssetDecimals)) | |
557 | 565 | let priceNew = fromX18(priceNewX18, scale8) | |
558 | 566 | let commonState = if (isEval) | |
559 | 567 | then nil | |
560 | 568 | 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)] | |
561 | 569 | let priceOldX18 = calcPriceBigInt(toX18(prBalanceOld, cfgPriceAssetDecimals), toX18(amBalanceOld, cfgAmountAssetDecimals)) | |
562 | 570 | let priceOld = fromX18(priceOldX18, scale8) | |
563 | - | let priceImpact = abs((((priceNew - priceOld) * scale8) / priceOld)) | |
564 | - | $Tuple4(totalAmount, commonState, feeAmount, priceImpact) | |
571 | + | let bonus = { | |
572 | + | let amountBothInPaymentAsset = (toInt(fraction(balanceBigInt, redeemedBigInt, supplyBigInt)) * 2) | |
573 | + | (((totalAmount - amountBothInPaymentAsset) * scale8) / totalAmount) | |
574 | + | } | |
575 | + | $Tuple4(totalAmount, commonState, feeAmount, bonus) | |
565 | 576 | } | |
566 | 577 | else throw("Strict value is not equal to itself.") | |
567 | 578 | } | |
568 | 579 | ||
569 | 580 | ||
570 | 581 | func managerPublicKeyOrUnit () = match getString(mpk()) { | |
571 | 582 | case s: String => | |
572 | 583 | fromBase58String(s) | |
573 | 584 | case _: Unit => | |
574 | 585 | unit | |
575 | 586 | case _ => | |
576 | 587 | throw("Match error") | |
577 | 588 | } | |
578 | 589 | ||
579 | 590 | ||
580 | 591 | func pendingManagerPublicKeyOrUnit () = match getString(pmpk()) { | |
581 | 592 | case s: String => | |
582 | 593 | fromBase58String(s) | |
583 | 594 | case _: Unit => | |
584 | 595 | unit | |
585 | 596 | case _ => | |
586 | 597 | throw("Match error") | |
587 | 598 | } | |
588 | 599 | ||
589 | 600 | ||
590 | 601 | func mustManager (i) = { | |
591 | 602 | let pd = throw("Permission denied") | |
592 | 603 | match managerPublicKeyOrUnit() { | |
593 | 604 | case pk: ByteVector => | |
594 | 605 | if ((i.callerPublicKey == pk)) | |
595 | 606 | then true | |
596 | 607 | else pd | |
597 | 608 | case _: Unit => | |
598 | 609 | if ((i.caller == this)) | |
599 | 610 | then true | |
600 | 611 | else pd | |
601 | 612 | case _ => | |
602 | 613 | throw("Match error") | |
603 | 614 | } | |
604 | 615 | } | |
605 | 616 | ||
606 | 617 | ||
607 | 618 | @Callable(i) | |
608 | 619 | func setManager (pendingManagerPublicKey) = { | |
609 | 620 | let checkCaller = mustManager(i) | |
610 | 621 | if ((checkCaller == checkCaller)) | |
611 | 622 | then { | |
612 | 623 | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
613 | 624 | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
614 | 625 | then [StringEntry(pmpk(), pendingManagerPublicKey)] | |
615 | 626 | else throw("Strict value is not equal to itself.") | |
616 | 627 | } | |
617 | 628 | else throw("Strict value is not equal to itself.") | |
618 | 629 | } | |
619 | 630 | ||
620 | 631 | ||
621 | 632 | ||
622 | 633 | @Callable(i) | |
623 | 634 | func confirmManager () = { | |
624 | 635 | let pm = pendingManagerPublicKeyOrUnit() | |
625 | 636 | let hasPM = if (isDefined(pm)) | |
626 | 637 | then true | |
627 | 638 | else throw("No pending manager") | |
628 | 639 | if ((hasPM == hasPM)) | |
629 | 640 | then { | |
630 | 641 | let checkPM = if ((i.callerPublicKey == value(pm))) | |
631 | 642 | then true | |
632 | 643 | else throw("You are not pending manager") | |
633 | 644 | if ((checkPM == checkPM)) | |
634 | 645 | then [StringEntry(mpk(), toBase58String(value(pm))), DeleteEntry(pmpk())] | |
635 | 646 | else throw("Strict value is not equal to itself.") | |
636 | 647 | } | |
637 | 648 | else throw("Strict value is not equal to itself.") | |
638 | 649 | } | |
639 | 650 | ||
640 | 651 | ||
641 | 652 | ||
642 | 653 | @Callable(i) | |
643 | 654 | func put (slippageTolerance,shouldAutoStake) = if ((0 > slippageTolerance)) | |
644 | 655 | then throw("Invalid slippageTolerance passed") | |
645 | 656 | else { | |
646 | 657 | let estPut = commonPut(i, slippageTolerance, true) | |
647 | 658 | let emitLpAmt = estPut._2 | |
648 | 659 | let lpAssetId = estPut._7 | |
649 | 660 | let state = estPut._9 | |
650 | 661 | let amDiff = estPut._10 | |
651 | 662 | let prDiff = estPut._11 | |
652 | 663 | let amId = estPut._12 | |
653 | 664 | let prId = estPut._13 | |
654 | 665 | let emitInv = invoke(factoryContract, "emit", [emitLpAmt], nil) | |
655 | 666 | if ((emitInv == emitInv)) | |
656 | 667 | then { | |
657 | 668 | let emitInvLegacy = match emitInv { | |
658 | 669 | case legacyFactoryContract: Address => | |
659 | 670 | invoke(legacyFactoryContract, "emit", [emitLpAmt], nil) | |
660 | 671 | case _ => | |
661 | 672 | unit | |
662 | 673 | } | |
663 | 674 | if ((emitInvLegacy == emitInvLegacy)) | |
664 | 675 | then { | |
665 | 676 | let slippageAInv = if ((amDiff > 0)) | |
666 | 677 | then invoke(slippageContract, "put", nil, [AttachedPayment(amId, amDiff)]) | |
667 | 678 | else nil | |
668 | 679 | if ((slippageAInv == slippageAInv)) | |
669 | 680 | then { | |
670 | 681 | let slippagePInv = if ((prDiff > 0)) | |
671 | 682 | then invoke(slippageContract, "put", nil, [AttachedPayment(prId, prDiff)]) | |
672 | 683 | else nil | |
673 | 684 | if ((slippagePInv == slippagePInv)) | |
674 | 685 | then { | |
675 | 686 | let lpTransfer = if (shouldAutoStake) | |
676 | 687 | then { | |
677 | 688 | let slpStakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)]) | |
678 | 689 | if ((slpStakeInv == slpStakeInv)) | |
679 | 690 | then nil | |
680 | 691 | else throw("Strict value is not equal to itself.") | |
681 | 692 | } | |
682 | 693 | else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)] | |
683 | 694 | (state ++ lpTransfer) | |
684 | 695 | } | |
685 | 696 | else throw("Strict value is not equal to itself.") | |
686 | 697 | } | |
687 | 698 | else throw("Strict value is not equal to itself.") | |
688 | 699 | } | |
689 | 700 | else throw("Strict value is not equal to itself.") | |
690 | 701 | } | |
691 | 702 | else throw("Strict value is not equal to itself.") | |
692 | 703 | } | |
693 | 704 | ||
694 | 705 | ||
695 | 706 | ||
696 | 707 | @Callable(i) | |
697 | 708 | func putForFree (maxSlippage) = if ((0 > maxSlippage)) | |
698 | 709 | then throw("Invalid value passed") | |
699 | 710 | else { | |
700 | 711 | let estPut = commonPut(i, maxSlippage, false) | |
701 | 712 | estPut._9 | |
702 | 713 | } | |
703 | 714 | ||
704 | 715 | ||
705 | 716 | ||
706 | 717 | @Callable(i) | |
707 | 718 | func putOneTkn (minOutAmount,autoStake) = { | |
708 | 719 | let isPoolOneTokenOperationsDisabled = { | |
709 | 720 | let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
710 | 721 | if ($isInstanceOf(@, "Boolean")) | |
711 | 722 | then @ | |
712 | 723 | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
713 | 724 | } | |
714 | 725 | let isPutDisabled = if (if (if (isGlobalShutdown()) | |
715 | 726 | then true | |
716 | 727 | else (cfgPoolStatus == PoolPutDisabled)) | |
717 | 728 | then true | |
718 | 729 | else (cfgPoolStatus == PoolShutdown)) | |
719 | 730 | then true | |
720 | 731 | else isPoolOneTokenOperationsDisabled | |
721 | 732 | let checks = [if (!(isPutDisabled)) | |
722 | 733 | then true | |
723 | 734 | else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1)) | |
724 | 735 | then true | |
725 | 736 | else throwErr("exactly 1 payment are expected")] | |
726 | 737 | if ((checks == checks)) | |
727 | 738 | then { | |
728 | 739 | let payment = i.payments[0] | |
729 | 740 | let paymentAssetId = payment.assetId | |
730 | 741 | let paymentAmountRaw = payment.amount | |
731 | 742 | let userAddress = i.caller | |
732 | 743 | let txId = i.transactionId | |
733 | - | let $ | |
734 | - | let emitAmountEstimated = $ | |
735 | - | let commonState = $ | |
736 | - | let feeAmount = $ | |
737 | - | let bonus = $ | |
744 | + | let $t03138731514 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId) | |
745 | + | let emitAmountEstimated = $t03138731514._1 | |
746 | + | let commonState = $t03138731514._2 | |
747 | + | let feeAmount = $t03138731514._3 | |
748 | + | let bonus = $t03138731514._4 | |
738 | 749 | let emitAmount = if (if ((minOutAmount > 0)) | |
739 | 750 | then (minOutAmount > emitAmountEstimated) | |
740 | 751 | else false) | |
741 | 752 | then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], "")) | |
742 | 753 | else emitAmountEstimated | |
743 | 754 | let emitInv = emit(emitAmount) | |
744 | 755 | if ((emitInv == emitInv)) | |
745 | 756 | then { | |
746 | 757 | let lpTransfer = if (autoStake) | |
747 | 758 | then { | |
748 | 759 | let stakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(cfgLpAssetId, emitAmount)]) | |
749 | 760 | if ((stakeInv == stakeInv)) | |
750 | 761 | then nil | |
751 | 762 | else throw("Strict value is not equal to itself.") | |
752 | 763 | } | |
753 | 764 | else [ScriptTransfer(i.caller, emitAmount, cfgLpAssetId)] | |
754 | 765 | let sendFee = if ((feeAmount > 0)) | |
755 | 766 | then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)] | |
756 | 767 | else nil | |
757 | 768 | $Tuple2(((commonState ++ lpTransfer) ++ sendFee), emitAmount) | |
758 | 769 | } | |
759 | 770 | else throw("Strict value is not equal to itself.") | |
760 | 771 | } | |
761 | 772 | else throw("Strict value is not equal to itself.") | |
762 | 773 | } | |
763 | 774 | ||
764 | 775 | ||
765 | 776 | ||
766 | 777 | @Callable(i) | |
767 | 778 | func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = { | |
768 | - | let $ | |
769 | - | let emitAmountEstimated = $ | |
770 | - | let commonState = $ | |
771 | - | let feeAmount = $ | |
772 | - | let bonus = $ | |
779 | + | let $t03224332378 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit) | |
780 | + | let emitAmountEstimated = $t03224332378._1 | |
781 | + | let commonState = $t03224332378._2 | |
782 | + | let feeAmount = $t03224332378._3 | |
783 | + | let bonus = $t03224332378._4 | |
773 | 784 | $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus)) | |
774 | 785 | } | |
775 | 786 | ||
776 | 787 | ||
777 | 788 | ||
778 | 789 | @Callable(i) | |
779 | 790 | func getOneTkn (outAssetIdStr,minOutAmount) = { | |
780 | 791 | let isPoolOneTokenOperationsDisabled = { | |
781 | 792 | let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
782 | 793 | if ($isInstanceOf(@, "Boolean")) | |
783 | 794 | then @ | |
784 | 795 | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
785 | 796 | } | |
786 | 797 | let isGetDisabled = if (if (isGlobalShutdown()) | |
787 | 798 | then true | |
788 | 799 | else (cfgPoolStatus == PoolShutdown)) | |
789 | 800 | then true | |
790 | 801 | else isPoolOneTokenOperationsDisabled | |
791 | 802 | let checks = [if (!(isGetDisabled)) | |
792 | 803 | then true | |
793 | 804 | else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1)) | |
794 | 805 | then true | |
795 | 806 | else throwErr("exactly 1 payment are expected")] | |
796 | 807 | if ((checks == checks)) | |
797 | 808 | then { | |
798 | 809 | let outAssetId = parseAssetId(outAssetIdStr) | |
799 | 810 | let payment = i.payments[0] | |
800 | 811 | let paymentAssetId = payment.assetId | |
801 | 812 | let paymentAmount = payment.amount | |
802 | 813 | let userAddress = i.caller | |
803 | 814 | let txId = i.transactionId | |
804 | - | let $ | |
805 | - | let amountEstimated = $ | |
806 | - | let commonState = $ | |
807 | - | let feeAmount = $ | |
808 | - | let bonus = $ | |
815 | + | let $t03315033282 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId) | |
816 | + | let amountEstimated = $t03315033282._1 | |
817 | + | let commonState = $t03315033282._2 | |
818 | + | let feeAmount = $t03315033282._3 | |
819 | + | let bonus = $t03315033282._4 | |
809 | 820 | let amount = if (if ((minOutAmount > 0)) | |
810 | 821 | then (minOutAmount > amountEstimated) | |
811 | 822 | else false) | |
812 | 823 | then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], "")) | |
813 | 824 | else amountEstimated | |
814 | 825 | let burnInv = invoke(factoryContract, "burn", [paymentAmount], [AttachedPayment(paymentAssetId, paymentAmount)]) | |
815 | 826 | if ((burnInv == burnInv)) | |
816 | 827 | then { | |
817 | 828 | let assetTransfer = [ScriptTransfer(userAddress, amount, outAssetId)] | |
818 | 829 | let sendFee = if ((feeAmount > 0)) | |
819 | 830 | then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)] | |
820 | 831 | else nil | |
821 | 832 | $Tuple2(((commonState ++ assetTransfer) ++ sendFee), amount) | |
822 | 833 | } | |
823 | 834 | else throw("Strict value is not equal to itself.") | |
824 | 835 | } | |
825 | 836 | else throw("Strict value is not equal to itself.") | |
826 | 837 | } | |
827 | 838 | ||
828 | 839 | ||
829 | 840 | ||
830 | 841 | @Callable(i) | |
831 | 842 | func getOneTknREADONLY (outAssetId,paymentAmount) = { | |
832 | - | let $ | |
833 | - | let amountEstimated = $ | |
834 | - | let commonState = $ | |
835 | - | let feeAmount = $ | |
836 | - | let bonus = $ | |
843 | + | let $t03391734055 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit) | |
844 | + | let amountEstimated = $t03391734055._1 | |
845 | + | let commonState = $t03391734055._2 | |
846 | + | let feeAmount = $t03391734055._3 | |
847 | + | let bonus = $t03391734055._4 | |
837 | 848 | $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus)) | |
838 | 849 | } | |
839 | 850 | ||
840 | 851 | ||
841 | 852 | ||
842 | 853 | @Callable(i) | |
843 | 854 | func unstakeAndGetOneTkn (unstakeAmount,outAssetIdStr,minOutAmount) = { | |
844 | 855 | let isPoolOneTokenOperationsDisabled = { | |
845 | 856 | let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
846 | 857 | if ($isInstanceOf(@, "Boolean")) | |
847 | 858 | then @ | |
848 | 859 | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
849 | 860 | } | |
850 | 861 | let isGetDisabled = if (if (isGlobalShutdown()) | |
851 | 862 | then true | |
852 | 863 | else (cfgPoolStatus == PoolShutdown)) | |
853 | 864 | then true | |
854 | 865 | else isPoolOneTokenOperationsDisabled | |
855 | 866 | let checks = [if (!(isGetDisabled)) | |
856 | 867 | then true | |
857 | 868 | else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 0)) | |
858 | 869 | then true | |
859 | 870 | else throwErr("no payments are expected")] | |
860 | 871 | if ((checks == checks)) | |
861 | 872 | then { | |
862 | 873 | let outAssetId = parseAssetId(outAssetIdStr) | |
863 | 874 | let userAddress = i.caller | |
864 | 875 | let txId = i.transactionId | |
865 | 876 | let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil) | |
866 | 877 | if ((unstakeInv == unstakeInv)) | |
867 | 878 | then { | |
868 | - | let $ | |
869 | - | let amountEstimated = $ | |
870 | - | let commonState = $ | |
871 | - | let feeAmount = $ | |
872 | - | let bonus = $ | |
879 | + | let $t03484734977 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId) | |
880 | + | let amountEstimated = $t03484734977._1 | |
881 | + | let commonState = $t03484734977._2 | |
882 | + | let feeAmount = $t03484734977._3 | |
883 | + | let bonus = $t03484734977._4 | |
873 | 884 | let amount = if (if ((minOutAmount > 0)) | |
874 | 885 | then (minOutAmount > amountEstimated) | |
875 | 886 | else false) | |
876 | 887 | then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], "")) | |
877 | 888 | else amountEstimated | |
878 | 889 | let burnInv = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)]) | |
879 | 890 | if ((burnInv == burnInv)) | |
880 | 891 | then { | |
881 | 892 | let assetTransfer = [ScriptTransfer(i.caller, amount, outAssetId)] | |
882 | 893 | let sendFee = if ((feeAmount > 0)) | |
883 | 894 | then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)] | |
884 | 895 | else nil | |
885 | 896 | $Tuple2(((commonState ++ assetTransfer) ++ sendFee), amount) | |
886 | 897 | } | |
887 | 898 | else throw("Strict value is not equal to itself.") | |
888 | 899 | } | |
889 | 900 | else throw("Strict value is not equal to itself.") | |
890 | 901 | } | |
891 | 902 | else throw("Strict value is not equal to itself.") | |
892 | 903 | } | |
893 | 904 | ||
894 | 905 | ||
895 | 906 | ||
896 | 907 | @Callable(i) | |
897 | 908 | func get () = { | |
898 | 909 | let res = commonGet(i) | |
899 | 910 | let outAmtAmt = res._1 | |
900 | 911 | let outPrAmt = res._2 | |
901 | 912 | let pmtAmt = res._3 | |
902 | 913 | let pmtAssetId = res._4 | |
903 | 914 | let state = res._5 | |
904 | 915 | let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
905 | 916 | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
906 | 917 | then state | |
907 | 918 | else throw("Strict value is not equal to itself.") | |
908 | 919 | } | |
909 | 920 | ||
910 | 921 | ||
911 | 922 | ||
912 | 923 | @Callable(i) | |
913 | 924 | func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = { | |
914 | 925 | let res = commonGet(i) | |
915 | 926 | let outAmAmt = res._1 | |
916 | 927 | let outPrAmt = res._2 | |
917 | 928 | let pmtAmt = res._3 | |
918 | 929 | let pmtAssetId = res._4 | |
919 | 930 | let state = res._5 | |
920 | 931 | if ((noLessThenAmtAsset > outAmAmt)) | |
921 | 932 | then throw(((("noLessThenAmtAsset failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset))) | |
922 | 933 | else if ((noLessThenPriceAsset > outPrAmt)) | |
923 | 934 | then throw(((("noLessThenPriceAsset failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset))) | |
924 | 935 | else { | |
925 | 936 | let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
926 | 937 | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
927 | 938 | then state | |
928 | 939 | else throw("Strict value is not equal to itself.") | |
929 | 940 | } | |
930 | 941 | } | |
931 | 942 | ||
932 | 943 | ||
933 | 944 | ||
934 | 945 | @Callable(i) | |
935 | 946 | func unstakeAndGet (amount) = { | |
936 | 947 | let checkPayments = if ((size(i.payments) != 0)) | |
937 | 948 | then throw("No payments are expected") | |
938 | 949 | else true | |
939 | 950 | if ((checkPayments == checkPayments)) | |
940 | 951 | then { | |
941 | 952 | let cfg = getPoolConfig() | |
942 | 953 | let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId]) | |
943 | 954 | let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(lpAssetId), amount], nil) | |
944 | 955 | if ((unstakeInv == unstakeInv)) | |
945 | 956 | then { | |
946 | 957 | let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller) | |
947 | 958 | let poolStatus = parseIntValue(res._9) | |
948 | 959 | let state = res._10 | |
949 | 960 | let checkPoolStatus = if (if (isGlobalShutdown()) | |
950 | 961 | then true | |
951 | 962 | else (poolStatus == PoolShutdown)) | |
952 | 963 | then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus))) | |
953 | 964 | else true | |
954 | 965 | if ((checkPoolStatus == checkPoolStatus)) | |
955 | 966 | then { | |
956 | 967 | let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)]) | |
957 | 968 | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
958 | 969 | then state | |
959 | 970 | else throw("Strict value is not equal to itself.") | |
960 | 971 | } | |
961 | 972 | else throw("Strict value is not equal to itself.") | |
962 | 973 | } | |
963 | 974 | else throw("Strict value is not equal to itself.") | |
964 | 975 | } | |
965 | 976 | else throw("Strict value is not equal to itself.") | |
966 | 977 | } | |
967 | 978 | ||
968 | 979 | ||
969 | 980 | ||
970 | 981 | @Callable(i) | |
971 | 982 | func unstakeAndGetNoLess (unstakeAmount,noLessThenAmountAsset,noLessThenPriceAsset) = { | |
972 | 983 | let isGetDisabled = if (isGlobalShutdown()) | |
973 | 984 | then true | |
974 | 985 | else (cfgPoolStatus == PoolShutdown) | |
975 | 986 | let checks = [if (!(isGetDisabled)) | |
976 | 987 | then true | |
977 | 988 | else throw("get operation is blocked by admin"), if ((size(i.payments) == 0)) | |
978 | 989 | then true | |
979 | 990 | else throw("no payments are expected")] | |
980 | 991 | if ((checks == checks)) | |
981 | 992 | then { | |
982 | 993 | let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil) | |
983 | 994 | if ((unstakeInv == unstakeInv)) | |
984 | 995 | then { | |
985 | 996 | let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller) | |
986 | 997 | let outAmAmt = res._1 | |
987 | 998 | let outPrAmt = res._2 | |
988 | 999 | let state = res._10 | |
989 | 1000 | let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset)) | |
990 | 1001 | then true | |
991 | 1002 | else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset)) | |
992 | 1003 | then true | |
993 | 1004 | else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))] | |
994 | 1005 | if ((checkAmounts == checkAmounts)) | |
995 | 1006 | then { | |
996 | 1007 | let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)]) | |
997 | 1008 | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
998 | 1009 | then state | |
999 | 1010 | else throw("Strict value is not equal to itself.") | |
1000 | 1011 | } | |
1001 | 1012 | else throw("Strict value is not equal to itself.") | |
1002 | 1013 | } | |
1003 | 1014 | else throw("Strict value is not equal to itself.") | |
1004 | 1015 | } | |
1005 | 1016 | else throw("Strict value is not equal to itself.") | |
1006 | 1017 | } | |
1007 | 1018 | ||
1008 | 1019 | ||
1009 | 1020 | ||
1010 | 1021 | @Callable(i) | |
1011 | 1022 | func activate (amtAssetStr,priceAssetStr) = if ((toString(i.caller) != toString(factoryContract))) | |
1012 | 1023 | then throw("permissions denied") | |
1013 | 1024 | else $Tuple2([StringEntry(aa(), amtAssetStr), StringEntry(pa(), priceAssetStr)], "success") | |
1014 | 1025 | ||
1015 | 1026 | ||
1016 | 1027 | ||
1017 | 1028 | @Callable(i) | |
1018 | 1029 | func getPoolConfigWrapperREADONLY () = $Tuple2(nil, getPoolConfig()) | |
1019 | 1030 | ||
1020 | 1031 | ||
1021 | 1032 | ||
1022 | 1033 | @Callable(i) | |
1023 | 1034 | func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId)) | |
1024 | 1035 | ||
1025 | 1036 | ||
1026 | 1037 | ||
1027 | 1038 | @Callable(i) | |
1028 | 1039 | func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = { | |
1029 | 1040 | let prices = calcPrices(amAmt, prAmt, lpAmt) | |
1030 | 1041 | $Tuple2(nil, [toString(prices[0]), toString(prices[1]), toString(prices[2])]) | |
1031 | 1042 | } | |
1032 | 1043 | ||
1033 | 1044 | ||
1034 | 1045 | ||
1035 | 1046 | @Callable(i) | |
1036 | 1047 | func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(toX18(origVal, origScaleMult))) | |
1037 | 1048 | ||
1038 | 1049 | ||
1039 | 1050 | ||
1040 | 1051 | @Callable(i) | |
1041 | 1052 | func fromX18WrapperREADONLY (val,resultScaleMult) = $Tuple2(nil, fromX18(parseBigIntValue(val), resultScaleMult)) | |
1042 | 1053 | ||
1043 | 1054 | ||
1044 | 1055 | ||
1045 | 1056 | @Callable(i) | |
1046 | 1057 | func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(calcPriceBigInt(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18)))) | |
1047 | 1058 | ||
1048 | 1059 | ||
1049 | 1060 | ||
1050 | 1061 | @Callable(i) | |
1051 | 1062 | func estimatePutOperationWrapperREADONLY (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = $Tuple2(nil, estimatePutOperation(txId58, slippageTolerance, inAmAssetAmt, inAmAssetId, inPrAssetAmt, inPrAssetId, userAddress, isEvaluate, emitLp)) | |
1052 | 1063 | ||
1053 | 1064 | ||
1054 | 1065 | ||
1055 | 1066 | @Callable(i) | |
1056 | 1067 | func estimateGetOperationWrapperREADONLY (txId58,pmtAssetId,pmtLpAmt,userAddress) = { | |
1057 | 1068 | let res = estimateGetOperation(txId58, pmtAssetId, pmtLpAmt, addressFromStringValue(userAddress)) | |
1058 | 1069 | $Tuple2(nil, $Tuple10(res._1, res._2, res._3, res._4, res._5, res._6, res._7, toString(res._8), res._9, res._10)) | |
1059 | 1070 | } | |
1060 | 1071 | ||
1061 | 1072 | ||
1062 | 1073 | ||
1063 | 1074 | @Callable(i) | |
1064 | 1075 | func statsREADONLY () = { | |
1065 | 1076 | let cfg = getPoolConfig() | |
1066 | 1077 | let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId]) | |
1067 | 1078 | let amtAssetId = cfg[idxAmtAssetId] | |
1068 | 1079 | let priceAssetId = cfg[idxPriceAssetId] | |
1069 | 1080 | let iAmtAssetId = cfg[idxIAmtAssetId] | |
1070 | 1081 | let iPriceAssetId = cfg[idxIPriceAssetId] | |
1071 | 1082 | let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm]) | |
1072 | 1083 | let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm]) | |
1073 | 1084 | let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity | |
1074 | 1085 | let accAmtAssetBalance = getAccBalance(amtAssetId) | |
1075 | 1086 | let accPriceAssetBalance = getAccBalance(priceAssetId) | |
1076 | 1087 | let pricesList = if ((poolLPBalance == 0)) | |
1077 | 1088 | then [zeroBigInt, zeroBigInt, zeroBigInt] | |
1078 | 1089 | else calcPrices(accAmtAssetBalance, accPriceAssetBalance, poolLPBalance) | |
1079 | 1090 | let curPrice = 0 | |
1080 | 1091 | let lpAmtAssetShare = fromX18(pricesList[1], scale8) | |
1081 | 1092 | let lpPriceAssetShare = fromX18(pricesList[2], scale8) | |
1082 | 1093 | let poolWeight = value(getInteger(factoryContract, keyPoolWeight(toString(this)))) | |
1083 | 1094 | $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)) | |
1084 | 1095 | } | |
1085 | 1096 | ||
1086 | 1097 | ||
1087 | 1098 | ||
1088 | 1099 | @Callable(i) | |
1089 | 1100 | func evaluatePutByAmountAssetREADONLY (inAmAssetAmt) = { | |
1090 | 1101 | let cfg = getPoolConfig() | |
1091 | 1102 | let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId]) | |
1092 | 1103 | let amAssetIdStr = cfg[idxAmtAssetId] | |
1093 | 1104 | let amAssetId = fromBase58String(amAssetIdStr) | |
1094 | 1105 | let prAssetIdStr = cfg[idxPriceAssetId] | |
1095 | 1106 | let prAssetId = fromBase58String(prAssetIdStr) | |
1096 | 1107 | let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm]) | |
1097 | 1108 | let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm]) | |
1098 | 1109 | let poolStatus = cfg[idxPoolStatus] | |
1099 | 1110 | let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity | |
1100 | 1111 | let accAmtAssetBalance = getAccBalance(amAssetIdStr) | |
1101 | 1112 | let accPriceAssetBalance = getAccBalance(prAssetIdStr) | |
1102 | 1113 | let amtAssetAmtX18 = toX18(accAmtAssetBalance, amtAssetDcm) | |
1103 | 1114 | let priceAssetAmtX18 = toX18(accPriceAssetBalance, priceAssetDcm) | |
1104 | 1115 | let curPriceX18 = if ((poolLPBalance == 0)) | |
1105 | 1116 | then zeroBigInt | |
1106 | 1117 | else calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18) | |
1107 | 1118 | let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm) | |
1108 | 1119 | let inPrAssetAmtX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18) | |
1109 | 1120 | let inPrAssetAmt = fromX18(inPrAssetAmtX18, priceAssetDcm) | |
1110 | 1121 | let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false) | |
1111 | 1122 | let calcLpAmt = estPut._1 | |
1112 | 1123 | let curPriceCalc = estPut._3 | |
1113 | 1124 | let amBalance = estPut._4 | |
1114 | 1125 | let prBalance = estPut._5 | |
1115 | 1126 | let lpEmission = estPut._6 | |
1116 | 1127 | $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)) | |
1117 | 1128 | } | |
1118 | 1129 | ||
1119 | 1130 | ||
1120 | 1131 | ||
1121 | 1132 | @Callable(i) | |
1122 | 1133 | func evaluatePutByPriceAssetREADONLY (inPrAssetAmt) = { | |
1123 | 1134 | let cfg = getPoolConfig() | |
1124 | 1135 | let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId]) | |
1125 | 1136 | let amAssetIdStr = cfg[idxAmtAssetId] | |
1126 | 1137 | let amAssetId = fromBase58String(amAssetIdStr) | |
1127 | 1138 | let prAssetIdStr = cfg[idxPriceAssetId] | |
1128 | 1139 | let prAssetId = fromBase58String(prAssetIdStr) | |
1129 | 1140 | let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm]) | |
1130 | 1141 | let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm]) | |
1131 | 1142 | let poolStatus = cfg[idxPoolStatus] | |
1132 | 1143 | let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity | |
1133 | 1144 | let amBalanceRaw = getAccBalance(amAssetIdStr) | |
1134 | 1145 | let prBalanceRaw = getAccBalance(prAssetIdStr) | |
1135 | 1146 | let amBalanceRawX18 = toX18(amBalanceRaw, amtAssetDcm) | |
1136 | 1147 | let prBalanceRawX18 = toX18(prBalanceRaw, priceAssetDcm) | |
1137 | 1148 | let curPriceX18 = if ((poolLPBalance == 0)) | |
1138 | 1149 | then zeroBigInt | |
1139 | 1150 | else calcPriceBigInt(prBalanceRawX18, amBalanceRawX18) | |
1140 | 1151 | let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm) | |
1141 | 1152 | let inAmAssetAmtX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18) | |
1142 | 1153 | let inAmAssetAmt = fromX18(inAmAssetAmtX18, amtAssetDcm) | |
1143 | 1154 | let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false) | |
1144 | 1155 | let calcLpAmt = estPut._1 | |
1145 | 1156 | let curPriceCalc = estPut._3 | |
1146 | 1157 | let amBalance = estPut._4 | |
1147 | 1158 | let prBalance = estPut._5 | |
1148 | 1159 | let lpEmission = estPut._6 | |
1149 | 1160 | $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)) | |
1150 | 1161 | } | |
1151 | 1162 | ||
1152 | 1163 | ||
1153 | 1164 | ||
1154 | 1165 | @Callable(i) | |
1155 | 1166 | func evaluateGetREADONLY (paymentLpAssetId,paymentLpAmt) = { | |
1156 | 1167 | let res = estimateGetOperation("", paymentLpAssetId, paymentLpAmt, this) | |
1157 | 1168 | let outAmAmt = res._1 | |
1158 | 1169 | let outPrAmt = res._2 | |
1159 | 1170 | let amBalance = res._5 | |
1160 | 1171 | let prBalance = res._6 | |
1161 | 1172 | let lpEmission = res._7 | |
1162 | 1173 | let curPrice = res._8 | |
1163 | 1174 | let poolStatus = parseIntValue(res._9) | |
1164 | 1175 | $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)) | |
1165 | 1176 | } | |
1166 | 1177 | ||
1167 | 1178 | ||
1168 | 1179 | @Verifier(tx) | |
1169 | 1180 | func verify () = { | |
1170 | 1181 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
1171 | 1182 | case pk: ByteVector => | |
1172 | 1183 | pk | |
1173 | 1184 | case _: Unit => | |
1174 | 1185 | tx.senderPublicKey | |
1175 | 1186 | case _ => | |
1176 | 1187 | throw("Match error") | |
1177 | 1188 | } | |
1178 | 1189 | match tx { | |
1179 | 1190 | case order: Order => | |
1180 | 1191 | let matcherPub = getMatcherPubOrFail() | |
1181 | 1192 | let orderValid = validateMatcherOrderAllowed(order) | |
1182 | 1193 | let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey) | |
1183 | 1194 | let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub) | |
1184 | 1195 | if (if (if (orderValid) | |
1185 | 1196 | then senderValid | |
1186 | 1197 | else false) | |
1187 | 1198 | then matcherValid | |
1188 | 1199 | else false) | |
1189 | 1200 | then true | |
1190 | 1201 | else throwOrderError(orderValid, senderValid, matcherValid) | |
1191 | 1202 | case s: SetScriptTransaction => | |
1192 | 1203 | let newHash = blake2b256(value(s.script)) | |
1193 | 1204 | let allowedHash = fromBase64String(value(getString(factoryContract, keyAllowedLpScriptHash()))) | |
1194 | 1205 | let currentHash = scriptHash(this) | |
1195 | 1206 | if (if ((allowedHash == newHash)) | |
1196 | 1207 | then (currentHash != newHash) | |
1197 | 1208 | else false) | |
1198 | 1209 | then true | |
1199 | 1210 | else sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
1200 | 1211 | case _ => | |
1201 | 1212 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
1202 | 1213 | } | |
1203 | 1214 | } | |
1204 | 1215 |
github/deemru/w8io/026f985 134.28 ms ◑