tx · DPeUt7wnGvdHELznmS9rTXMcaxf3edHYXYHZXjsHXgfQ 3N9yYa7DXfSFLkgzWHmwzTpwd21GUxQApy9: -0.05000000 Waves 2021.08.12 17:59 [1655298] smart account 3N9yYa7DXfSFLkgzWHmwzTpwd21GUxQApy9 > SELF 0.00000000 Waves
{ "type": 13, "id": "DPeUt7wnGvdHELznmS9rTXMcaxf3edHYXYHZXjsHXgfQ", "fee": 5000000, "feeAssetId": null, "timestamp": 1628780396162, "version": 2, "chainId": 84, "sender": "3N9yYa7DXfSFLkgzWHmwzTpwd21GUxQApy9", "senderPublicKey": "AzWZ4rwReUMi2EBexU5XceFGKPvTcfdkZnygszAEtnYv", "proofs": [ "24AhF1uX5BqREhw4Sar1STSYpHHyDVkb9s55R2MXaSPMExe8GQxAijoTBxhmBtEy3qWdiKVV4mZ2UA2QuCqqdKhA" ], "script": "base64:AAIFAAAAAAAAABcIAhIDCgEBEgASBwoFCAgICAESAwoBAQAAACsAAAAACmxQZGVjaW1hbHMAAAAAAAAAAAgAAAAAEWRlY2ltYWxzTXVsdFByaWNlCQAAaAAAAAIJAABoAAAAAgAAAAAAAAAAZAAAAAAAAAAD6AAAAAAAAAAD6AAAAAADU0VQAgAAAAJfXwAAAAAKUG9vbEFjdGl2ZQAAAAAAAAAAAQAAAAAPUG9vbFB1dERpc2FibGVkAAAAAAAAAAACAAAAABNQb29sTWF0Y2hlckRpc2FibGVkAAAAAAAAAAADAAAAAAxQb29sU2h1dGRvd24AAAAAAAAAAAQAAAAAEGZhY3RvcnlQdWJsaWNLZXkJAAJZAAAAAQIAAAAsNnBKa3J3Zld5aFpqbTNMb1FXUmpqTlZhTHQ1Q1F6cWZnZ3pYeXFyN25yd0EAAAAADmlkeFBvb2xBZGRyZXNzAAAAAAAAAAABAAAAAA1pZHhQb29sU3RhdHVzAAAAAAAAAAACAAAAABBpZHhQb29sTFBBc3NldElkAAAAAAAAAAADAAAAABBpZHhBbW91bnRBc3NldElkAAAAAAAAAAAEAAAA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cmljZUFzc2V0U3RyBAAAABJwcmljZUFzc2V0RGVjaW1hbHMICQEAAAAFdmFsdWUAAAABCQAD7AAAAAEFAAAADHByaWNlQXNzZXRJZAAAAAhkZWNpbWFscwQAAAASbHBBc3NldElzc3VlQWN0aW9uCQAEQgAAAAUFAAAAC2xwQXNzZXROYW1lBQAAAAxscEFzc2V0RGVzY3IAAAAAAAAAAAEAAAAAAAAAAAgGBAAAAAlscEFzc2V0SWQJAAQ4AAAAAQUAAAASbHBBc3NldElzc3VlQWN0aW9uBAAAABFscEFzc2V0SWRBc1N0cmluZwkAAlgAAAABBQAAAAlscEFzc2V0SWQJAAUUAAAAAgkABEwAAAACBQAAABJscEFzc2V0SXNzdWVBY3Rpb24JAARMAAAAAgkBAAAABEJ1cm4AAAACBQAAAAlscEFzc2V0SWQAAAAAAAAAAAEFAAAAA25pbAUAAAARbHBBc3NldElkQXNTdHJpbmcAAAABaQEAAAAGbWFuYWdlAAAAAQAAAAZzdGF0dXMFAAAAA25pbAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5B0lR6A==", "height": 1655298, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: De9XQDZ8XxPaTcmakSZuh13BK719YcNToZRRZuU2DvK1 Next: H2t2ndYUuGgHU8Gna1YaTPfVUgkQNpQMMesszuZGpbUT Diff:
Old | New | Differences | |
---|---|---|---|
112 | 112 | } | |
113 | 113 | ||
114 | 114 | ||
115 | + | func privateCastAssetToOriginDecimals (assetDecimals,assetAmount) = { | |
116 | + | let decimalsMult = pow(10, 0, (lPdecimals - assetDecimals), 0, 0, DOWN) | |
117 | + | $Tuple2((assetAmount / decimalsMult), decimalsMult) | |
118 | + | } | |
119 | + | ||
120 | + | ||
115 | 121 | func privateCalculatePrice (amoutAssetDecimals,priceAssetDecimals,amountAssetAmt,priceAssetAmt) = { | |
116 | 122 | let amountAssetPoolLockedAmt = privateCastAssetToLPDecimals(amoutAssetDecimals, amountAssetAmt)._1 | |
117 | 123 | let priceAssetPoolLockedAmt = privateCastAssetToLPDecimals(priceAssetDecimals, priceAssetAmt)._1 | |
167 | 173 | let priceAssetPoolLockedAmt = privateCastAssetToLPDecimals(priceAssetDecimals, poolPriceAssetBalance)._1 | |
168 | 174 | let outAmountAssetAmt = fraction(amountAssetPoolLockedAmt, paymentLpAmount, poolLPBalance) | |
169 | 175 | let outPriceAssetAmt = fraction(priceAssetPoolLockedAmt, paymentLpAmount, poolLPBalance) | |
176 | + | let outAmountAssetAmtFinal = privateCastAssetToOriginDecimals(amoutAssetDecimals, outAmountAssetAmt)._1 | |
177 | + | let outPriceAssetAmtFinal = privateCastAssetToOriginDecimals(priceAssetDecimals, outPriceAssetAmt)._1 | |
170 | 178 | if (true) | |
171 | - | then throw(((toString( | |
179 | + | then throw(((toString(outAmountAssetAmtFinal) + " / ") + toString(outPriceAssetAmtFinal))) | |
172 | 180 | else { | |
173 | 181 | let currentPrice = fraction(priceAssetPoolLockedAmt, decimalsMultPrice, amountAssetPoolLockedAmt) | |
174 | - | $Tuple14(amountAssetId, priceAssetId, amountAssetInternalId, priceAssetInternalId, userAmountAssetBalance, | |
182 | + | $Tuple14(amountAssetId, priceAssetId, amountAssetInternalId, priceAssetInternalId, userAmountAssetBalance, outAmountAssetAmtFinal, userPriceAssetBalance, outPriceAssetAmtFinal, outAmountAssetAmt, userLPBalance, poolAmountAssetBalance, poolPriceAssetBalance, poolLPBalance, currentPrice) | |
175 | 183 | } | |
176 | 184 | } | |
177 | 185 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let lPdecimals = 8 | |
5 | 5 | ||
6 | 6 | let decimalsMultPrice = ((100 * 1000) * 1000) | |
7 | 7 | ||
8 | 8 | let SEP = "__" | |
9 | 9 | ||
10 | 10 | let PoolActive = 1 | |
11 | 11 | ||
12 | 12 | let PoolPutDisabled = 2 | |
13 | 13 | ||
14 | 14 | let PoolMatcherDisabled = 3 | |
15 | 15 | ||
16 | 16 | let PoolShutdown = 4 | |
17 | 17 | ||
18 | 18 | let factoryPublicKey = fromBase58String("6pJkrwfWyhZjm3LoQWRjjNVaLt5CQzqfggzXyqr7nrwA") | |
19 | 19 | ||
20 | 20 | let idxPoolAddress = 1 | |
21 | 21 | ||
22 | 22 | let idxPoolStatus = 2 | |
23 | 23 | ||
24 | 24 | let idxPoolLPAssetId = 3 | |
25 | 25 | ||
26 | 26 | let idxAmountAssetId = 4 | |
27 | 27 | ||
28 | 28 | let idxPriceAssetId = 5 | |
29 | 29 | ||
30 | 30 | let idxAmountAssetDecimals = 6 | |
31 | 31 | ||
32 | 32 | let idxPriceAssetDecimals = 7 | |
33 | 33 | ||
34 | 34 | let idxAmountAssetInternalId = 8 | |
35 | 35 | ||
36 | 36 | let idxPriceAssetInternalId = 9 | |
37 | 37 | ||
38 | 38 | let idxPoolWeight = 10 | |
39 | 39 | ||
40 | 40 | let idxPoolAmountAssetAmt = 1 | |
41 | 41 | ||
42 | 42 | let idxPoolPriceAssetAmt = 2 | |
43 | 43 | ||
44 | 44 | let idxPoolLPAssetAmt = 3 | |
45 | 45 | ||
46 | 46 | func keyPriceLast () = "%s%s__price__last" | |
47 | 47 | ||
48 | 48 | ||
49 | 49 | func keyPriceHistory (h,timestamp) = makeString(["%s%s%d%d__price__history", toString(h), toString(timestamp)], SEP) | |
50 | 50 | ||
51 | 51 | ||
52 | 52 | func keyPoolLiquidity (internalAmountAsset,internalPriceAsset) = (((("%d%d%s__" + internalAmountAsset) + "__") + internalPriceAsset) + "__locked") | |
53 | 53 | ||
54 | 54 | ||
55 | 55 | func keyPoolLiquidityByUser (internalAmountAsset,internalPriceAsset,userAddress) = (((((("%d%d%s%s__" + internalAmountAsset) + "__") + internalPriceAsset) + "__") + userAddress) + "__locked") | |
56 | 56 | ||
57 | 57 | ||
58 | 58 | func keyPutActionByUser (userAddress,txId) = ((("%s%s%s__P__" + userAddress) + "__") + txId) | |
59 | 59 | ||
60 | 60 | ||
61 | 61 | func keyGetActionByUser (userAddress,txId) = ((("%s%s%s__G__" + userAddress) + "__") + txId) | |
62 | 62 | ||
63 | 63 | ||
64 | 64 | func keyMappingPoolContractAddressToPoolAssets (poolContractAddress) = (("%s%s%s__" + poolContractAddress) + "__mappings__poolContract2LpAsset") | |
65 | 65 | ||
66 | 66 | ||
67 | 67 | func keyPoolConfig (amountAssetInternal,priceAssetInternal) = (((("%d%d%s__" + amountAssetInternal) + "__") + priceAssetInternal) + "__config") | |
68 | 68 | ||
69 | 69 | ||
70 | 70 | func getPoolConfig () = { | |
71 | 71 | let factoryAddress = addressFromPublicKey(factoryPublicKey) | |
72 | 72 | let currentPoolAssets = split(valueOrErrorMessage(getString(factoryAddress, keyMappingPoolContractAddressToPoolAssets(toString(this))), "No factory config found for pool address."), SEP) | |
73 | 73 | let currentPoolConfig = split(valueOrErrorMessage(getString(factoryAddress, keyPoolConfig(currentPoolAssets[1], currentPoolAssets[2])), "No factory config found for pool assets."), SEP) | |
74 | 74 | currentPoolConfig | |
75 | 75 | } | |
76 | 76 | ||
77 | 77 | ||
78 | 78 | func getPoolLiquidity (amountAssetInternalId,priceAssetInternalId) = { | |
79 | 79 | let currentPoolLiquidityValue = getString(keyPoolLiquidity(amountAssetInternalId, priceAssetInternalId)) | |
80 | 80 | if (!(isDefined(currentPoolLiquidityValue))) | |
81 | 81 | then ["", "0", "0", "0"] | |
82 | 82 | else split(value(currentPoolLiquidityValue), SEP) | |
83 | 83 | } | |
84 | 84 | ||
85 | 85 | ||
86 | 86 | func getPoolLiquidityByUser (amountAssetInternalId,priceAssetInternalId,userAddress) = { | |
87 | 87 | let currentPoolLiquidityValue = getString(keyPoolLiquidityByUser(amountAssetInternalId, priceAssetInternalId, userAddress)) | |
88 | 88 | if (!(isDefined(currentPoolLiquidityValue))) | |
89 | 89 | then ["", "0", "0", "0", "0"] | |
90 | 90 | else split(value(currentPoolLiquidityValue), SEP) | |
91 | 91 | } | |
92 | 92 | ||
93 | 93 | ||
94 | 94 | func dataPoolLiquidity (amountAssetLocked,priceAssetLocked,lpTokenLocked) = makeString(["%d%d%d", toString(amountAssetLocked), toString(priceAssetLocked), toString(lpTokenLocked)], SEP) | |
95 | 95 | ||
96 | 96 | ||
97 | 97 | func dataPutActionInfo (inAmountAssetAmt,inPriceAssetAmt,outLpAmt,price,slippageTolerancePassedByUser,txHeight,txTimestamp) = makeString(["%d%d%d%d%d%d%d", toString(inAmountAssetAmt), toString(inPriceAssetAmt), toString(outLpAmt), toString(price), toString(slippageTolerancePassedByUser), toString(txHeight), toString(txTimestamp)], SEP) | |
98 | 98 | ||
99 | 99 | ||
100 | 100 | func dataGetActionInfo (outAmountAssetAmt,outPriceAssetAmt,inLpAmt,price,txHeight,txTimestamp) = makeString(["%d%d%d%d%d%d", toString(outAmountAssetAmt), toString(outPriceAssetAmt), toString(inLpAmt), toString(price), toString(txHeight), toString(txTimestamp)], SEP) | |
101 | 101 | ||
102 | 102 | ||
103 | 103 | func dataPoolLiquidityByUser (amountAssetLocked,priceAssetLocked,lpTokenLocked,userAddress) = makeString(["%d%d%d", toString(amountAssetLocked), toString(priceAssetLocked), toString(lpTokenLocked)], SEP) | |
104 | 104 | ||
105 | 105 | ||
106 | 106 | func getScriptHash () = toBase64String(value(scriptHash(this))) | |
107 | 107 | ||
108 | 108 | ||
109 | 109 | func privateCastAssetToLPDecimals (assetDecimals,assetAmount) = { | |
110 | 110 | let decimalsMult = pow(10, 0, (lPdecimals - assetDecimals), 0, 0, DOWN) | |
111 | 111 | $Tuple2((assetAmount * decimalsMult), decimalsMult) | |
112 | 112 | } | |
113 | 113 | ||
114 | 114 | ||
115 | + | func privateCastAssetToOriginDecimals (assetDecimals,assetAmount) = { | |
116 | + | let decimalsMult = pow(10, 0, (lPdecimals - assetDecimals), 0, 0, DOWN) | |
117 | + | $Tuple2((assetAmount / decimalsMult), decimalsMult) | |
118 | + | } | |
119 | + | ||
120 | + | ||
115 | 121 | func privateCalculatePrice (amoutAssetDecimals,priceAssetDecimals,amountAssetAmt,priceAssetAmt) = { | |
116 | 122 | let amountAssetPoolLockedAmt = privateCastAssetToLPDecimals(amoutAssetDecimals, amountAssetAmt)._1 | |
117 | 123 | let priceAssetPoolLockedAmt = privateCastAssetToLPDecimals(priceAssetDecimals, priceAssetAmt)._1 | |
118 | 124 | fraction(priceAssetPoolLockedAmt, decimalsMultPrice, amountAssetPoolLockedAmt) | |
119 | 125 | } | |
120 | 126 | ||
121 | 127 | ||
122 | 128 | func privateGetPoolStatistics () = { | |
123 | 129 | let poolConfigDataList = getPoolConfig() | |
124 | 130 | let lpAssetId = fromBase58String(poolConfigDataList[idxPoolLPAssetId]) | |
125 | 131 | let amountAssetId = poolConfigDataList[idxAmountAssetId] | |
126 | 132 | let priceAssetId = poolConfigDataList[idxPriceAssetId] | |
127 | 133 | let amountAssetInternalId = poolConfigDataList[idxAmountAssetInternalId] | |
128 | 134 | let priceAssetInternalId = poolConfigDataList[idxPriceAssetInternalId] | |
129 | 135 | let amoutAssetDecimals = parseIntValue(poolConfigDataList[idxAmountAssetDecimals]) | |
130 | 136 | let priceAssetDecimals = parseIntValue(poolConfigDataList[idxPriceAssetDecimals]) | |
131 | 137 | let poolLiquidityDataList = getPoolLiquidity(amountAssetInternalId, priceAssetInternalId) | |
132 | 138 | let poolAmountAssetBalance = parseIntValue(poolLiquidityDataList[idxPoolAmountAssetAmt]) | |
133 | 139 | let poolPriceAssetBalance = parseIntValue(poolLiquidityDataList[idxPoolPriceAssetAmt]) | |
134 | 140 | let poolLPBalance = parseIntValue(poolLiquidityDataList[idxPoolLPAssetAmt]) | |
135 | 141 | let amountAssetPoolLockedAmt = privateCastAssetToLPDecimals(amoutAssetDecimals, poolAmountAssetBalance)._1 | |
136 | 142 | let priceAssetPoolLockedAmt = privateCastAssetToLPDecimals(priceAssetDecimals, poolPriceAssetBalance)._1 | |
137 | 143 | let lpPriceInAmountAsset = fraction(amountAssetPoolLockedAmt, (1 * decimalsMultPrice), poolLPBalance) | |
138 | 144 | let lpPriceInPriceAsset = fraction(priceAssetPoolLockedAmt, (1 * decimalsMultPrice), poolLPBalance) | |
139 | 145 | let currentPrice = privateCalculatePrice(amoutAssetDecimals, priceAssetDecimals, poolAmountAssetBalance, poolPriceAssetBalance) | |
140 | 146 | [poolAmountAssetBalance, poolPriceAssetBalance, poolLPBalance, currentPrice, lpPriceInAmountAsset, lpPriceInPriceAsset] | |
141 | 147 | } | |
142 | 148 | ||
143 | 149 | ||
144 | 150 | func privateEstimateGetOperation (paymentLpAssetId,paymentLpAmount,userAddress) = { | |
145 | 151 | let poolConfigList = getPoolConfig() | |
146 | 152 | let lpAssetId = poolConfigList[idxPoolLPAssetId] | |
147 | 153 | let amountAssetId = poolConfigList[idxAmountAssetId] | |
148 | 154 | let priceAssetId = poolConfigList[idxPriceAssetId] | |
149 | 155 | let amountAssetInternalId = poolConfigList[idxAmountAssetInternalId] | |
150 | 156 | let priceAssetInternalId = poolConfigList[idxPriceAssetInternalId] | |
151 | 157 | let amoutAssetDecimals = parseIntValue(poolConfigList[idxAmountAssetDecimals]) | |
152 | 158 | let priceAssetDecimals = parseIntValue(poolConfigList[idxPriceAssetDecimals]) | |
153 | 159 | let userLiquidityList = getPoolLiquidityByUser(amountAssetInternalId, priceAssetInternalId, userAddress) | |
154 | 160 | let userLPBalance = parseIntValue(userLiquidityList[idxPoolLPAssetAmt]) | |
155 | 161 | let userAmountAssetBalance = parseIntValue(userLiquidityList[idxPoolAmountAssetAmt]) | |
156 | 162 | let userPriceAssetBalance = parseIntValue(userLiquidityList[idxPoolPriceAssetAmt]) | |
157 | 163 | let poolLiquidityList = getPoolLiquidity(amountAssetInternalId, priceAssetInternalId) | |
158 | 164 | let poolLPBalance = parseIntValue(poolLiquidityList[idxPoolLPAssetAmt]) | |
159 | 165 | let poolAmountAssetBalance = parseIntValue(poolLiquidityList[idxPoolAmountAssetAmt]) | |
160 | 166 | let poolPriceAssetBalance = parseIntValue(poolLiquidityList[idxPoolPriceAssetAmt]) | |
161 | 167 | if ((lpAssetId != paymentLpAssetId)) | |
162 | 168 | then throw("Invalid asset passed.") | |
163 | 169 | else if ((paymentLpAmount > userLPBalance)) | |
164 | 170 | then throw("Invalid amount passed. Amount less than available.") | |
165 | 171 | else { | |
166 | 172 | let amountAssetPoolLockedAmt = privateCastAssetToLPDecimals(amoutAssetDecimals, poolAmountAssetBalance)._1 | |
167 | 173 | let priceAssetPoolLockedAmt = privateCastAssetToLPDecimals(priceAssetDecimals, poolPriceAssetBalance)._1 | |
168 | 174 | let outAmountAssetAmt = fraction(amountAssetPoolLockedAmt, paymentLpAmount, poolLPBalance) | |
169 | 175 | let outPriceAssetAmt = fraction(priceAssetPoolLockedAmt, paymentLpAmount, poolLPBalance) | |
176 | + | let outAmountAssetAmtFinal = privateCastAssetToOriginDecimals(amoutAssetDecimals, outAmountAssetAmt)._1 | |
177 | + | let outPriceAssetAmtFinal = privateCastAssetToOriginDecimals(priceAssetDecimals, outPriceAssetAmt)._1 | |
170 | 178 | if (true) | |
171 | - | then throw(((toString( | |
179 | + | then throw(((toString(outAmountAssetAmtFinal) + " / ") + toString(outPriceAssetAmtFinal))) | |
172 | 180 | else { | |
173 | 181 | let currentPrice = fraction(priceAssetPoolLockedAmt, decimalsMultPrice, amountAssetPoolLockedAmt) | |
174 | - | $Tuple14(amountAssetId, priceAssetId, amountAssetInternalId, priceAssetInternalId, userAmountAssetBalance, | |
182 | + | $Tuple14(amountAssetId, priceAssetId, amountAssetInternalId, priceAssetInternalId, userAmountAssetBalance, outAmountAssetAmtFinal, userPriceAssetBalance, outPriceAssetAmtFinal, outAmountAssetAmt, userLPBalance, poolAmountAssetBalance, poolPriceAssetBalance, poolLPBalance, currentPrice) | |
175 | 183 | } | |
176 | 184 | } | |
177 | 185 | } | |
178 | 186 | ||
179 | 187 | ||
180 | 188 | func privateEstimatePutOperation (slippageTolerance,inAmountAssetAmt,inAmountAssetId,inPriceAssetAmt,inPriceAssetId,userAddress) = { | |
181 | 189 | let poolConfigDataList = getPoolConfig() | |
182 | 190 | let lpAssetId = fromBase58String(poolConfigDataList[idxPoolLPAssetId]) | |
183 | 191 | let amountAssetId = poolConfigDataList[idxAmountAssetId] | |
184 | 192 | let priceAssetId = poolConfigDataList[idxPriceAssetId] | |
185 | 193 | let amountAssetInternalId = poolConfigDataList[idxAmountAssetInternalId] | |
186 | 194 | let priceAssetInternalId = poolConfigDataList[idxPriceAssetInternalId] | |
187 | 195 | let amoutAssetDecimals = parseIntValue(poolConfigDataList[idxAmountAssetDecimals]) | |
188 | 196 | let priceAssetDecimals = parseIntValue(poolConfigDataList[idxPriceAssetDecimals]) | |
189 | 197 | let poolLiquidityDataList = getPoolLiquidity(amountAssetInternalId, priceAssetInternalId) | |
190 | 198 | let poolAmountAssetBalance = parseIntValue(poolLiquidityDataList[idxPoolAmountAssetAmt]) | |
191 | 199 | let poolPriceAssetBalance = parseIntValue(poolLiquidityDataList[idxPoolPriceAssetAmt]) | |
192 | 200 | let poolLPBalance = parseIntValue(poolLiquidityDataList[idxPoolLPAssetAmt]) | |
193 | 201 | let userLiquidityDataList = getPoolLiquidityByUser(amountAssetInternalId, priceAssetInternalId, userAddress) | |
194 | 202 | let userAmountAssetBalance = parseIntValue(userLiquidityDataList[idxPoolAmountAssetAmt]) | |
195 | 203 | let userPriceAssetBalance = parseIntValue(userLiquidityDataList[idxPoolPriceAssetAmt]) | |
196 | 204 | let userLPBalance = parseIntValue(userLiquidityDataList[idxPoolLPAssetAmt]) | |
197 | 205 | if (if ((amountAssetId != inAmountAssetId)) | |
198 | 206 | then true | |
199 | 207 | else (priceAssetId != inPriceAssetId)) | |
200 | 208 | then throw("Invalid amount or price asset passed.") | |
201 | 209 | else { | |
202 | 210 | let inAmountAssetAmtCalculatedTuple = privateCastAssetToLPDecimals(amoutAssetDecimals, inAmountAssetAmt) | |
203 | 211 | let inPriceAssetAmtCalculatedTuple = privateCastAssetToLPDecimals(priceAssetDecimals, inPriceAssetAmt) | |
204 | 212 | let inAmountAssetAmtCalculated = inAmountAssetAmtCalculatedTuple._1 | |
205 | 213 | let inPriceAssetAmtCalculated = inPriceAssetAmtCalculatedTuple._1 | |
206 | 214 | let userPrice = fraction(inPriceAssetAmtCalculated, decimalsMultPrice, inAmountAssetAmtCalculated) | |
207 | 215 | let amountAssetPoolLockedAmt = (poolAmountAssetBalance * inAmountAssetAmtCalculatedTuple._2) | |
208 | 216 | let priceAssetPoolLockedAmt = (poolPriceAssetBalance * inPriceAssetAmtCalculatedTuple._2) | |
209 | 217 | let curentPrice = if ((poolLPBalance == 0)) | |
210 | 218 | then 0 | |
211 | 219 | else fraction(priceAssetPoolLockedAmt, decimalsMultPrice, amountAssetPoolLockedAmt) | |
212 | 220 | let outLpAmount = if ((poolLPBalance == 0)) | |
213 | 221 | then { | |
214 | 222 | let partA = pow(inAmountAssetAmtCalculated, 0, 5, 1, 0, DOWN) | |
215 | 223 | let partB = pow(inPriceAssetAmtCalculated, 0, 5, 1, 0, DOWN) | |
216 | 224 | (partA * partB) | |
217 | 225 | } | |
218 | 226 | else { | |
219 | 227 | let slippage = fraction(curentPrice, 100, userPrice) | |
220 | 228 | if ((slippage > slippageTolerance)) | |
221 | 229 | then throw(((("Price slippage " + toString(slippage)) + " exceeded the passed limit of ") + toString(slippageTolerance))) | |
222 | 230 | else { | |
223 | 231 | let lpAmtByAmountAsset = fraction(poolLPBalance, inAmountAssetAmtCalculated, amountAssetPoolLockedAmt) | |
224 | 232 | let lpAmtByPriceAsset = fraction(poolLPBalance, inPriceAssetAmtCalculated, priceAssetPoolLockedAmt) | |
225 | 233 | if ((lpAmtByPriceAsset > lpAmtByAmountAsset)) | |
226 | 234 | then lpAmtByAmountAsset | |
227 | 235 | else lpAmtByPriceAsset | |
228 | 236 | } | |
229 | 237 | } | |
230 | 238 | $Tuple11(outLpAmount, curentPrice, userAmountAssetBalance, userPriceAssetBalance, userLPBalance, poolAmountAssetBalance, poolPriceAssetBalance, poolLPBalance, amountAssetInternalId, priceAssetInternalId, lpAssetId) | |
231 | 239 | } | |
232 | 240 | } | |
233 | 241 | ||
234 | 242 | ||
235 | 243 | @Callable(i) | |
236 | 244 | func put (slippageTolerance) = { | |
237 | 245 | let pmtAmountAsset = value(i.payments[0]) | |
238 | 246 | let inAmountAssetAmt = pmtAmountAsset.amount | |
239 | 247 | let inAmountAssetId = if (!(isDefined(pmtAmountAsset.assetId))) | |
240 | 248 | then fromBase58String("") | |
241 | 249 | else value(pmtAmountAsset.assetId) | |
242 | 250 | let pmtPriceAsset = value(i.payments[1]) | |
243 | 251 | let inPriceAssetAmt = pmtPriceAsset.amount | |
244 | 252 | let inPriceAssetId = value(pmtPriceAsset.assetId) | |
245 | 253 | let estimatedPutResults = privateEstimatePutOperation(slippageTolerance, inAmountAssetAmt, toBase58String(inAmountAssetId), inPriceAssetAmt, toBase58String(inPriceAssetId), toString(i.caller)) | |
246 | 254 | let outLpAmount = estimatedPutResults._1 | |
247 | 255 | let curentPrice = estimatedPutResults._2 | |
248 | 256 | let userAmountAssetBalance = estimatedPutResults._3 | |
249 | 257 | let userPriceAssetBalance = estimatedPutResults._4 | |
250 | 258 | let userLPBalance = estimatedPutResults._5 | |
251 | 259 | let poolAmountAssetBalance = estimatedPutResults._6 | |
252 | 260 | let poolPriceAssetBalance = estimatedPutResults._7 | |
253 | 261 | let poolLPBalance = estimatedPutResults._8 | |
254 | 262 | let amountAssetInternalId = estimatedPutResults._9 | |
255 | 263 | let priceAssetInternalId = estimatedPutResults._10 | |
256 | 264 | let lpAssetId = estimatedPutResults._11 | |
257 | 265 | [StringEntry(keyPriceLast(), ("%s__" + toString(curentPrice))), StringEntry(keyPriceHistory(height, lastBlock.timestamp), ("%s__" + toString(curentPrice))), StringEntry(keyPutActionByUser(toString(i.caller), toBase58String(i.transactionId)), dataPutActionInfo(inAmountAssetAmt, inPriceAssetAmt, outLpAmount, curentPrice, slippageTolerance, height, lastBlock.timestamp)), StringEntry(keyPoolLiquidityByUser(amountAssetInternalId, priceAssetInternalId, toString(i.caller)), dataPoolLiquidity((userAmountAssetBalance + inAmountAssetAmt), (userPriceAssetBalance + inPriceAssetAmt), (userLPBalance + outLpAmount))), StringEntry(keyPoolLiquidity(amountAssetInternalId, priceAssetInternalId), dataPoolLiquidity((poolAmountAssetBalance + inAmountAssetAmt), (poolPriceAssetBalance + inPriceAssetAmt), (poolLPBalance + outLpAmount))), Reissue(lpAssetId, outLpAmount, true), ScriptTransfer(i.caller, outLpAmount, lpAssetId)] | |
258 | 266 | } | |
259 | 267 | ||
260 | 268 | ||
261 | 269 | ||
262 | 270 | @Callable(i) | |
263 | 271 | func get () = { | |
264 | 272 | let pmtAmountAsset = value(i.payments[0]) | |
265 | 273 | let pmtAssetId = value(pmtAmountAsset.assetId) | |
266 | 274 | let pmtAssetAmount = pmtAmountAsset.amount | |
267 | 275 | let results = privateEstimateGetOperation(toBase58String(pmtAssetId), pmtAssetAmount, toString(i.caller)) | |
268 | 276 | let amountAssetId = results._1 | |
269 | 277 | let priceAssetId = results._2 | |
270 | 278 | let amountAssetInternalId = results._3 | |
271 | 279 | let priceAssetInternalId = results._4 | |
272 | 280 | let userAmountAssetBalance = results._5 | |
273 | 281 | let outAmountAssetAmt = results._6 | |
274 | 282 | let userPriceAssetBalance = results._7 | |
275 | 283 | let outPriceAssetAmt = results._8 | |
276 | 284 | let userLPBalance = results._9 | |
277 | 285 | let poolAmountAssetBalance = results._11 | |
278 | 286 | let poolPriceAssetBalance = results._12 | |
279 | 287 | let poolLPBalance = results._13 | |
280 | 288 | let currentPrice = results._14 | |
281 | 289 | [Burn(pmtAssetId, pmtAssetAmount), ScriptTransfer(i.caller, outAmountAssetAmt, if ((amountAssetId == "")) | |
282 | 290 | then unit | |
283 | 291 | else fromBase58String(amountAssetId)), ScriptTransfer(i.caller, outPriceAssetAmt, fromBase58String(priceAssetId)), StringEntry(keyPoolLiquidityByUser(amountAssetInternalId, priceAssetInternalId, toString(i.caller)), dataPoolLiquidity((userAmountAssetBalance - outAmountAssetAmt), (userPriceAssetBalance - outPriceAssetAmt), (userLPBalance - pmtAssetAmount))), StringEntry(keyPoolLiquidity(amountAssetInternalId, priceAssetInternalId), dataPoolLiquidity((poolAmountAssetBalance - outAmountAssetAmt), (poolPriceAssetBalance - outPriceAssetAmt), (poolLPBalance - pmtAssetAmount))), StringEntry(keyGetActionByUser(toString(i.caller), toBase58String(i.transactionId)), dataGetActionInfo(outAmountAssetAmt, outPriceAssetAmt, pmtAssetAmount, currentPrice, height, lastBlock.timestamp)), StringEntry(keyPriceLast(), ("%s__" + toString(currentPrice))), StringEntry(keyPriceHistory(height, lastBlock.timestamp), ("%s__" + toString(currentPrice)))] | |
284 | 292 | } | |
285 | 293 | ||
286 | 294 | ||
287 | 295 | ||
288 | 296 | @Callable(i) | |
289 | 297 | func activate (amountAssetStr,priceAssetStr,lpAssetName,lpAssetDescr,poolWeight) = if ((i.callerPublicKey != factoryPublicKey)) | |
290 | 298 | then throw("permissions denied") | |
291 | 299 | else { | |
292 | 300 | let amountAssetId = fromBase58String(amountAssetStr) | |
293 | 301 | let amountAssetDecimals = value(assetInfo(amountAssetId)).decimals | |
294 | 302 | let priceAssetId = fromBase58String(priceAssetStr) | |
295 | 303 | let priceAssetDecimals = value(assetInfo(priceAssetId)).decimals | |
296 | 304 | let lpAssetIssueAction = Issue(lpAssetName, lpAssetDescr, 1, 8, true) | |
297 | 305 | let lpAssetId = calculateAssetId(lpAssetIssueAction) | |
298 | 306 | let lpAssetIdAsString = toBase58String(lpAssetId) | |
299 | 307 | $Tuple2([lpAssetIssueAction, Burn(lpAssetId, 1)], lpAssetIdAsString) | |
300 | 308 | } | |
301 | 309 | ||
302 | 310 | ||
303 | 311 | ||
304 | 312 | @Callable(i) | |
305 | 313 | func manage (status) = nil | |
306 | 314 | ||
307 | 315 | ||
308 | 316 | @Verifier(tx) | |
309 | 317 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
310 | 318 |
github/deemru/w8io/169f3d6 56.51 ms ◑