tx · GpjgmQwBBwgr3ubP99giqneYk1opkEBVNn6HLobrtqYZ 3N9KXr9JbnPwrN9oacmFjc3qB4tYrzvxWss: -0.02800000 Waves 2022.09.16 12:57 [2231503] smart account 3N9KXr9JbnPwrN9oacmFjc3qB4tYrzvxWss > SELF 0.00000000 Waves
{ "type": 13, "id": "GpjgmQwBBwgr3ubP99giqneYk1opkEBVNn6HLobrtqYZ", "fee": 2800000, "feeAssetId": null, "timestamp": 1663322283679, "version": 1, "sender": "3N9KXr9JbnPwrN9oacmFjc3qB4tYrzvxWss", "senderPublicKey": "CuH6mrgac4GztriBQFELtAx7gw4diUcD94EVLt78E1kt", "proofs": [ "yCTQMPb3oMkyTrS8yFeHaWAYsHcToZk3MUtfV4vQW4CuFRW8ZfgGxjg4fS2yF4jcUtnK38ygfPS53BbwjEeEr8G" ], "script": "base64:BgJzCAISAwoBCBIDCgEIEgASBAoCAQQSAwoBARIAEgQKAgEBEgMKAQESBAoCCAgSABIDCgEIEgUKAwEBARIECgIBARIECgIIARIECgIICBILCgkIAQECAQIIBAQSBgoECAgBCBIAEgMKAQESAwoBARIECgIIAUUACmxQZGVjaW1hbHMACAAGc2NhbGU4AIDC1y8ADHNjYWxlOEJpZ0ludAkAtgIBAIDC1y8AB3NjYWxlMTgJALYCAQCAgJC7utat8A0ACnplcm9CaWdJbnQJALYCAQAAAANTRVACAl9fAApQb29sQWN0aXZlAAEAD1Bvb2xQdXREaXNhYmxlZAACABNQb29sTWF0Y2hlckRpc2FibGVkAAMADFBvb2xTaHV0ZG93bgAEAA5pZHhQb29sQWRkcmVzcwABAA1pZHhQb29sU3RhdHVzAAIAEGlkeFBvb2xMUEFzc2V0SWQAAwANaWR4QW10QXNzZXRJZAAEAA9pZHhQcmljZUFzc2V0SWQABQAOaWR4QW10QXNzZXREY20ABgAQaWR4UHJpY2VBc3NldERjbQAHAA5pZHhJQW10QXNzZXRJZAAIABBpZHhJUHJpY2VBc3NldElkAAkADWlkeExQQXNzZXREY20ACgASa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gFAXMGc2NyaXB0BAthbGxvd2VkSGFzaAkA2wQBCQEFdmFsdWUBCQCdCAIFD2ZhY3RvcnlDb250cmFjdAkBFmtleUFsbG93ZWRMcFNjcmlwdEhhc2gABAtjdXJyZW50SGFzaAkA8QcBBQR0aGlzAwMJAAACBQthbGxvd2VkSGFzaAUHbmV3SGFzaAkBAiE9AgULY3VycmVudEhhc2gFB25ld0hhc2gHBgkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAUPdGFyZ2V0UHVibGljS2V5CQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAABQ90YXJnZXRQdWJsaWNLZXmGtmB4", "chainId": 84, "height": 2231503, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: FySWGaZp8PHbak2QgtQSQxbZfhm9aWfyDxVf3p7vQN5g Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let lPdecimals = 8 | |
5 | + | ||
6 | + | let scale8 = 100000000 | |
7 | + | ||
8 | + | let scale8BigInt = toBigInt(100000000) | |
9 | + | ||
10 | + | let scale18 = toBigInt(1000000000000000000) | |
11 | + | ||
12 | + | let zeroBigInt = toBigInt(0) | |
13 | + | ||
14 | + | let SEP = "__" | |
15 | + | ||
16 | + | let PoolActive = 1 | |
17 | + | ||
18 | + | let PoolPutDisabled = 2 | |
19 | + | ||
20 | + | let PoolMatcherDisabled = 3 | |
21 | + | ||
22 | + | let PoolShutdown = 4 | |
23 | + | ||
24 | + | let idxPoolAddress = 1 | |
25 | + | ||
26 | + | let idxPoolStatus = 2 | |
27 | + | ||
28 | + | let idxPoolLPAssetId = 3 | |
29 | + | ||
30 | + | let idxAmtAssetId = 4 | |
31 | + | ||
32 | + | let idxPriceAssetId = 5 | |
33 | + | ||
34 | + | let idxAmtAssetDcm = 6 | |
35 | + | ||
36 | + | let idxPriceAssetDcm = 7 | |
37 | + | ||
38 | + | let idxIAmtAssetId = 8 | |
39 | + | ||
40 | + | let idxIPriceAssetId = 9 | |
41 | + | ||
42 | + | let idxLPAssetDcm = 10 | |
43 | + | ||
44 | + | let idxPoolAmtAssetAmt = 1 | |
45 | + | ||
46 | + | let idxPoolPriceAssetAmt = 2 | |
47 | + | ||
48 | + | let idxPoolLPAssetAmt = 3 | |
49 | + | ||
50 | + | let idxFactoryStakingContract = 1 | |
51 | + | ||
52 | + | let idxFactorySlippageContract = 7 | |
53 | + | ||
54 | + | func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), scale18, toBigInt(origScaleMult)) | |
55 | + | ||
56 | + | ||
57 | + | func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), scale18)) | |
58 | + | ||
59 | + | ||
60 | + | func toScale (amt,resScale,curScale) = fraction(amt, resScale, curScale) | |
61 | + | ||
62 | + | ||
63 | + | func abs (val) = if ((zeroBigInt > val)) | |
64 | + | then -(val) | |
65 | + | else val | |
66 | + | ||
67 | + | ||
68 | + | func fc () = "%s__factoryContract" | |
69 | + | ||
70 | + | ||
71 | + | func mpk () = "%s__managerPublicKey" | |
72 | + | ||
73 | + | ||
74 | + | func pmpk () = "%s__pendingManagerPublicKey" | |
75 | + | ||
76 | + | ||
77 | + | func pl () = "%s%s__price__last" | |
78 | + | ||
79 | + | ||
80 | + | func ph (h,timestamp) = makeString(["%s%s%d%d__price__history", toString(h), toString(timestamp)], SEP) | |
81 | + | ||
82 | + | ||
83 | + | func pau (userAddress,txId) = ((("%s%s%s__P__" + userAddress) + "__") + txId) | |
84 | + | ||
85 | + | ||
86 | + | func gau (userAddress,txId) = ((("%s%s%s__G__" + userAddress) + "__") + txId) | |
87 | + | ||
88 | + | ||
89 | + | func aa () = "%s__amountAsset" | |
90 | + | ||
91 | + | ||
92 | + | func pa () = "%s__priceAsset" | |
93 | + | ||
94 | + | ||
95 | + | func keyFactoryConfig () = "%s__factoryConfig" | |
96 | + | ||
97 | + | ||
98 | + | func keyMatcherPub () = "%s%s__matcher__publicKey" | |
99 | + | ||
100 | + | ||
101 | + | func keyMappingPoolContractAddressToPoolAssets (poolContractAddress) = (("%s%s%s__" + poolContractAddress) + "__mappings__poolContract2LpAsset") | |
102 | + | ||
103 | + | ||
104 | + | func keyPoolConfig (iAmtAsset,iPriceAsset) = (((("%d%d%s__" + iAmtAsset) + "__") + iPriceAsset) + "__config") | |
105 | + | ||
106 | + | ||
107 | + | func keyMappingsBaseAsset2internalId (baseAssetStr) = ("%s%s%s__mappings__baseAsset2internalId__" + baseAssetStr) | |
108 | + | ||
109 | + | ||
110 | + | func keyAllPoolsShutdown () = "%s__shutdown" | |
111 | + | ||
112 | + | ||
113 | + | func keyPoolWeight (contractAddress) = ("%s%s__poolWeight__" + contractAddress) | |
114 | + | ||
115 | + | ||
116 | + | func keyAllowedLpScriptHash () = "%s__allowedLpScriptHash" | |
117 | + | ||
118 | + | ||
119 | + | func throwOrderError (orderValid,senderValid,matcherValid) = throw(((((("order validation failed: orderValid=" + toString(orderValid)) + " senderValid=") + toString(senderValid)) + " matcherValid=") + toString(matcherValid))) | |
120 | + | ||
121 | + | ||
122 | + | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
123 | + | ||
124 | + | ||
125 | + | func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
126 | + | ||
127 | + | ||
128 | + | let factoryContract = addressFromStringValue(getStringOrFail(this, fc())) | |
129 | + | ||
130 | + | func isGlobalShutdown () = valueOrElse(getBoolean(factoryContract, keyAllPoolsShutdown()), false) | |
131 | + | ||
132 | + | ||
133 | + | func getMatcherPubOrFail () = fromBase58String(getStringOrFail(factoryContract, keyMatcherPub())) | |
134 | + | ||
135 | + | ||
136 | + | func getPoolConfig () = { | |
137 | + | let amtAsset = getStringOrFail(this, aa()) | |
138 | + | let priceAsset = getStringOrFail(this, pa()) | |
139 | + | let iPriceAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(priceAsset)) | |
140 | + | let iAmtAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(amtAsset)) | |
141 | + | split(getStringOrFail(factoryContract, keyPoolConfig(toString(iAmtAsset), toString(iPriceAsset))), SEP) | |
142 | + | } | |
143 | + | ||
144 | + | ||
145 | + | func getFactoryConfig () = split(getStringOrFail(factoryContract, keyFactoryConfig()), SEP) | |
146 | + | ||
147 | + | ||
148 | + | 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) | |
149 | + | ||
150 | + | ||
151 | + | 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) | |
152 | + | ||
153 | + | ||
154 | + | func getAccBalance (assetId) = if ((assetId == "WAVES")) | |
155 | + | then wavesBalance(this).available | |
156 | + | else assetBalance(this, fromBase58String(assetId)) | |
157 | + | ||
158 | + | ||
159 | + | func calcPriceBigInt (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18) | |
160 | + | ||
161 | + | ||
162 | + | func privateCalcPrice (amAssetDcm,prAssetDcm,amAmt,prAmt) = { | |
163 | + | let amtAssetAmtX18 = toX18(amAmt, amAssetDcm) | |
164 | + | let priceAssetAmtX18 = toX18(prAmt, prAssetDcm) | |
165 | + | calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18) | |
166 | + | } | |
167 | + | ||
168 | + | ||
169 | + | func calcPrices (amAmt,prAmt,lpAmt) = { | |
170 | + | let cfg = getPoolConfig() | |
171 | + | let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm]) | |
172 | + | let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm]) | |
173 | + | let priceX18 = privateCalcPrice(amtAssetDcm, priceAssetDcm, amAmt, prAmt) | |
174 | + | let amAmtX18 = toX18(amAmt, amtAssetDcm) | |
175 | + | let prAmtX18 = toX18(prAmt, priceAssetDcm) | |
176 | + | let lpAmtX18 = toX18(lpAmt, scale8) | |
177 | + | let lpPriceInAmAssetX18 = calcPriceBigInt(amAmtX18, lpAmtX18) | |
178 | + | let lpPriceInPrAssetX18 = calcPriceBigInt(prAmtX18, lpAmtX18) | |
179 | + | [priceX18, lpPriceInAmAssetX18, lpPriceInPrAssetX18] | |
180 | + | } | |
181 | + | ||
182 | + | ||
183 | + | func calculatePrices (amAmt,prAmt,lpAmt) = { | |
184 | + | let prices = calcPrices(amAmt, prAmt, lpAmt) | |
185 | + | [fromX18(prices[0], scale8), fromX18(prices[1], scale8), fromX18(prices[2], scale8)] | |
186 | + | } | |
187 | + | ||
188 | + | ||
189 | + | func estimateGetOperation (txId58,pmtAssetId,pmtLpAmt,userAddress) = { | |
190 | + | let cfg = getPoolConfig() | |
191 | + | let lpAssetId = cfg[idxPoolLPAssetId] | |
192 | + | let amAssetId = cfg[idxAmtAssetId] | |
193 | + | let prAssetId = cfg[idxPriceAssetId] | |
194 | + | let amAssetDcm = parseIntValue(cfg[idxAmtAssetDcm]) | |
195 | + | let prAssetDcm = parseIntValue(cfg[idxPriceAssetDcm]) | |
196 | + | let poolStatus = cfg[idxPoolStatus] | |
197 | + | let lpEmission = valueOrErrorMessage(assetInfo(fromBase58String(lpAssetId)), (("Asset " + lpAssetId) + " doesn't exist")).quantity | |
198 | + | if ((lpAssetId != pmtAssetId)) | |
199 | + | then throw("Invalid asset passed.") | |
200 | + | else { | |
201 | + | let amBalance = getAccBalance(amAssetId) | |
202 | + | let amBalanceX18 = toX18(amBalance, amAssetDcm) | |
203 | + | let prBalance = getAccBalance(prAssetId) | |
204 | + | let prBalanceX18 = toX18(prBalance, prAssetDcm) | |
205 | + | let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18) | |
206 | + | let curPrice = fromX18(curPriceX18, scale8) | |
207 | + | let pmtLpAmtX18 = toX18(pmtLpAmt, scale8) | |
208 | + | let lpEmissionX18 = toX18(lpEmission, scale8) | |
209 | + | let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissionX18) | |
210 | + | let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissionX18) | |
211 | + | let outAmAmt = fromX18(outAmAmtX18, amAssetDcm) | |
212 | + | let outPrAmt = fromX18(outPrAmtX18, prAssetDcm) | |
213 | + | let state = if ((txId58 == "")) | |
214 | + | then nil | |
215 | + | else [ScriptTransfer(userAddress, outAmAmt, if ((amAssetId == "WAVES")) | |
216 | + | then unit | |
217 | + | else fromBase58String(amAssetId)), ScriptTransfer(userAddress, outPrAmt, if ((prAssetId == "WAVES")) | |
218 | + | then unit | |
219 | + | 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)] | |
220 | + | $Tuple10(outAmAmt, outPrAmt, amAssetId, prAssetId, amBalance, prBalance, lpEmission, curPriceX18, poolStatus, state) | |
221 | + | } | |
222 | + | } | |
223 | + | ||
224 | + | ||
225 | + | func estimatePutOperation (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = { | |
226 | + | let cfg = getPoolConfig() | |
227 | + | let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId]) | |
228 | + | let amAssetIdStr = cfg[idxAmtAssetId] | |
229 | + | let prAssetIdStr = cfg[idxPriceAssetId] | |
230 | + | let iAmtAssetId = cfg[idxIAmtAssetId] | |
231 | + | let iPriceAssetId = cfg[idxIPriceAssetId] | |
232 | + | let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm]) | |
233 | + | let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm]) | |
234 | + | let poolStatus = cfg[idxPoolStatus] | |
235 | + | let lpEmission = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity | |
236 | + | let inAmAssetIdStr = toBase58String(valueOrElse(inAmAssetId, fromBase58String("WAVES"))) | |
237 | + | let inPrAssetIdStr = toBase58String(valueOrElse(inPrAssetId, fromBase58String("WAVES"))) | |
238 | + | if (if ((amAssetIdStr != inAmAssetIdStr)) | |
239 | + | then true | |
240 | + | else (prAssetIdStr != inPrAssetIdStr)) | |
241 | + | then throw("Invalid amt or price asset passed.") | |
242 | + | else { | |
243 | + | let amBalance = if (isEvaluate) | |
244 | + | then getAccBalance(amAssetIdStr) | |
245 | + | else (getAccBalance(amAssetIdStr) - inAmAssetAmt) | |
246 | + | let prBalance = if (isEvaluate) | |
247 | + | then getAccBalance(prAssetIdStr) | |
248 | + | else (getAccBalance(prAssetIdStr) - inPrAssetAmt) | |
249 | + | let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm) | |
250 | + | let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm) | |
251 | + | let userPriceX18 = calcPriceBigInt(inPrAssetAmtX18, inAmAssetAmtX18) | |
252 | + | let amBalanceX18 = toX18(amBalance, amtAssetDcm) | |
253 | + | let prBalanceX18 = toX18(prBalance, priceAssetDcm) | |
254 | + | let res = if ((lpEmission == 0)) | |
255 | + | then { | |
256 | + | let curPriceX18 = zeroBigInt | |
257 | + | let slippageX18 = zeroBigInt | |
258 | + | let lpAmtX18 = pow((inAmAssetAmtX18 * inPrAssetAmtX18), 0, toBigInt(5), 1, 0, DOWN) | |
259 | + | $Tuple5(fromX18(lpAmtX18, scale8), fromX18(inAmAssetAmtX18, amtAssetDcm), fromX18(inPrAssetAmtX18, priceAssetDcm), calcPriceBigInt((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18) | |
260 | + | } | |
261 | + | else { | |
262 | + | let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18) | |
263 | + | let slippageX18 = fraction(abs((curPriceX18 - userPriceX18)), scale18, curPriceX18) | |
264 | + | let slippageToleranceX18 = toX18(slippageTolerance, scale8) | |
265 | + | if (if ((curPriceX18 != zeroBigInt)) | |
266 | + | then (slippageX18 > slippageToleranceX18) | |
267 | + | else false) | |
268 | + | then throw(((("Price slippage " + toString(slippageX18)) + " exceeded the passed limit of ") + toString(slippageToleranceX18))) | |
269 | + | else { | |
270 | + | let lpEmissionX18 = toX18(lpEmission, scale8) | |
271 | + | let prViaAmX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18) | |
272 | + | let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18) | |
273 | + | let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18)) | |
274 | + | then $Tuple2(amViaPrX18, inPrAssetAmtX18) | |
275 | + | else $Tuple2(inAmAssetAmtX18, prViaAmX18) | |
276 | + | let expAmtAssetAmtX18 = expectedAmts._1 | |
277 | + | let expPriceAssetAmtX18 = expectedAmts._2 | |
278 | + | let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18) | |
279 | + | $Tuple5(fromX18(lpAmtX18, scale8), fromX18(expAmtAssetAmtX18, amtAssetDcm), fromX18(expPriceAssetAmtX18, priceAssetDcm), curPriceX18, slippageX18) | |
280 | + | } | |
281 | + | } | |
282 | + | let calcLpAmt = res._1 | |
283 | + | let calcAmAssetPmt = res._2 | |
284 | + | let calcPrAssetPmt = res._3 | |
285 | + | let curPrice = fromX18(res._4, scale8) | |
286 | + | let slippageCalc = fromX18(res._5, scale8) | |
287 | + | if ((0 >= calcLpAmt)) | |
288 | + | then throw("Invalid calculations. LP calculated is less than zero.") | |
289 | + | else { | |
290 | + | let emitLpAmt = if (!(emitLp)) | |
291 | + | then 0 | |
292 | + | else calcLpAmt | |
293 | + | let amDiff = (inAmAssetAmt - calcAmAssetPmt) | |
294 | + | let prDiff = (inPrAssetAmt - calcPrAssetPmt) | |
295 | + | 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))] | |
296 | + | $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEmission, lpAssetId, poolStatus, commonState, amDiff, prDiff, inAmAssetId, inPrAssetId) | |
297 | + | } | |
298 | + | } | |
299 | + | } | |
300 | + | ||
301 | + | ||
302 | + | func validateMatcherOrderAllowed (order) = { | |
303 | + | let cfg = getPoolConfig() | |
304 | + | let amtAssetId = cfg[idxAmtAssetId] | |
305 | + | let priceAssetId = cfg[idxPriceAssetId] | |
306 | + | let poolStatus = parseIntValue(cfg[idxPoolStatus]) | |
307 | + | let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm]) | |
308 | + | let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm]) | |
309 | + | let accAmtAssetBalance = getAccBalance(amtAssetId) | |
310 | + | let accPriceAssetBalance = getAccBalance(priceAssetId) | |
311 | + | let curPriceX18 = if ((order.orderType == Buy)) | |
312 | + | then privateCalcPrice(amtAssetDcm, priceAssetDcm, (accAmtAssetBalance + order.amount), accPriceAssetBalance) | |
313 | + | else privateCalcPrice(amtAssetDcm, priceAssetDcm, (accAmtAssetBalance - order.amount), accPriceAssetBalance) | |
314 | + | let curPrice = fromX18(curPriceX18, scale8) | |
315 | + | if (if (if (isGlobalShutdown()) | |
316 | + | then true | |
317 | + | else (poolStatus == PoolMatcherDisabled)) | |
318 | + | then true | |
319 | + | else (poolStatus == PoolShutdown)) | |
320 | + | then throw("Exchange operations disabled") | |
321 | + | else { | |
322 | + | let orderAmtAsset = order.assetPair.amountAsset | |
323 | + | let orderAmtAssetStr = if ((orderAmtAsset == unit)) | |
324 | + | then "WAVES" | |
325 | + | else toBase58String(value(orderAmtAsset)) | |
326 | + | let orderPriceAsset = order.assetPair.priceAsset | |
327 | + | let orderPriceAssetStr = if ((orderPriceAsset == unit)) | |
328 | + | then "WAVES" | |
329 | + | else toBase58String(value(orderPriceAsset)) | |
330 | + | if (if ((orderAmtAssetStr != amtAssetId)) | |
331 | + | then true | |
332 | + | else (orderPriceAssetStr != priceAssetId)) | |
333 | + | then throw("Wrong order assets.") | |
334 | + | else { | |
335 | + | let orderPrice = order.price | |
336 | + | let priceDcm = fraction(scale8, priceAssetDcm, amtAssetDcm) | |
337 | + | let castedOrderPrice = toScale(orderPrice, scale8, priceDcm) | |
338 | + | let isOrderPriceValid = if ((order.orderType == Buy)) | |
339 | + | then (curPrice >= castedOrderPrice) | |
340 | + | else (castedOrderPrice >= curPrice) | |
341 | + | true | |
342 | + | } | |
343 | + | } | |
344 | + | } | |
345 | + | ||
346 | + | ||
347 | + | func commonGet (i) = if ((size(i.payments) != 1)) | |
348 | + | then throw("exactly 1 payment is expected") | |
349 | + | else { | |
350 | + | let pmt = value(i.payments[0]) | |
351 | + | let pmtAssetId = value(pmt.assetId) | |
352 | + | let pmtAmt = pmt.amount | |
353 | + | let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller) | |
354 | + | let outAmAmt = res._1 | |
355 | + | let outPrAmt = res._2 | |
356 | + | let poolStatus = parseIntValue(res._9) | |
357 | + | let state = res._10 | |
358 | + | if (if (isGlobalShutdown()) | |
359 | + | then true | |
360 | + | else (poolStatus == PoolShutdown)) | |
361 | + | then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus))) | |
362 | + | else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state) | |
363 | + | } | |
364 | + | ||
365 | + | ||
366 | + | func commonPut (i,slippageTolerance,emitLp) = if ((size(i.payments) != 2)) | |
367 | + | then throw("exactly 2 payments are expected") | |
368 | + | else { | |
369 | + | let amAssetPmt = value(i.payments[0]) | |
370 | + | let prAssetPmt = value(i.payments[1]) | |
371 | + | let estPut = estimatePutOperation(toBase58String(i.transactionId), slippageTolerance, amAssetPmt.amount, amAssetPmt.assetId, prAssetPmt.amount, prAssetPmt.assetId, toString(i.caller), false, emitLp) | |
372 | + | let poolStatus = parseIntValue(estPut._8) | |
373 | + | if (if (if (isGlobalShutdown()) | |
374 | + | then true | |
375 | + | else (poolStatus == PoolPutDisabled)) | |
376 | + | then true | |
377 | + | else (poolStatus == PoolShutdown)) | |
378 | + | then throw(("Put operation is blocked by admin. Status = " + toString(poolStatus))) | |
379 | + | else estPut | |
380 | + | } | |
381 | + | ||
382 | + | ||
383 | + | func managerPublicKeyOrUnit () = match getString(mpk()) { | |
384 | + | case s: String => | |
385 | + | fromBase58String(s) | |
386 | + | case _: Unit => | |
387 | + | unit | |
388 | + | case _ => | |
389 | + | throw("Match error") | |
390 | + | } | |
391 | + | ||
392 | + | ||
393 | + | func pendingManagerPublicKeyOrUnit () = match getString(pmpk()) { | |
394 | + | case s: String => | |
395 | + | fromBase58String(s) | |
396 | + | case _: Unit => | |
397 | + | unit | |
398 | + | case _ => | |
399 | + | throw("Match error") | |
400 | + | } | |
401 | + | ||
402 | + | ||
403 | + | func mustManager (i) = { | |
404 | + | let pd = throw("Permission denied") | |
405 | + | match managerPublicKeyOrUnit() { | |
406 | + | case pk: ByteVector => | |
407 | + | if ((i.callerPublicKey == pk)) | |
408 | + | then true | |
409 | + | else pd | |
410 | + | case _: Unit => | |
411 | + | if ((i.caller == this)) | |
412 | + | then true | |
413 | + | else pd | |
414 | + | case _ => | |
415 | + | throw("Match error") | |
416 | + | } | |
417 | + | } | |
418 | + | ||
419 | + | ||
420 | + | @Callable(i) | |
421 | + | func constructor (factoryContract) = { | |
422 | + | let checkCaller = mustManager(i) | |
423 | + | if ((checkCaller == checkCaller)) | |
424 | + | then [StringEntry(fc(), factoryContract)] | |
425 | + | else throw("Strict value is not equal to itself.") | |
426 | + | } | |
427 | + | ||
428 | + | ||
429 | + | ||
430 | + | @Callable(i) | |
431 | + | func setManager (pendingManagerPublicKey) = { | |
432 | + | let checkCaller = mustManager(i) | |
433 | + | if ((checkCaller == checkCaller)) | |
434 | + | then { | |
435 | + | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
436 | + | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
437 | + | then [StringEntry(pmpk(), pendingManagerPublicKey)] | |
438 | + | else throw("Strict value is not equal to itself.") | |
439 | + | } | |
440 | + | else throw("Strict value is not equal to itself.") | |
441 | + | } | |
442 | + | ||
443 | + | ||
444 | + | ||
445 | + | @Callable(i) | |
446 | + | func confirmManager () = { | |
447 | + | let pm = pendingManagerPublicKeyOrUnit() | |
448 | + | let hasPM = if (isDefined(pm)) | |
449 | + | then true | |
450 | + | else throw("No pending manager") | |
451 | + | if ((hasPM == hasPM)) | |
452 | + | then { | |
453 | + | let checkPM = if ((i.callerPublicKey == value(pm))) | |
454 | + | then true | |
455 | + | else throw("You are not pending manager") | |
456 | + | if ((checkPM == checkPM)) | |
457 | + | then [StringEntry(mpk(), toBase58String(value(pm))), DeleteEntry(pmpk())] | |
458 | + | else throw("Strict value is not equal to itself.") | |
459 | + | } | |
460 | + | else throw("Strict value is not equal to itself.") | |
461 | + | } | |
462 | + | ||
463 | + | ||
464 | + | ||
465 | + | @Callable(i) | |
466 | + | func put (slippageTolerance,shouldAutoStake) = { | |
467 | + | let factoryCfg = getFactoryConfig() | |
468 | + | let stakingContract = valueOrErrorMessage(addressFromString(factoryCfg[idxFactoryStakingContract]), "Error. Incorrect staking address.") | |
469 | + | let slippageContract = valueOrErrorMessage(addressFromString(factoryCfg[idxFactorySlippageContract]), "Error. Incorrect slippage contract address.") | |
470 | + | if ((0 > slippageTolerance)) | |
471 | + | then throw("Invalid slippageTolerance passed") | |
472 | + | else { | |
473 | + | let estPut = commonPut(i, slippageTolerance, true) | |
474 | + | let emitLpAmt = estPut._2 | |
475 | + | let lpAssetId = estPut._7 | |
476 | + | let state = estPut._9 | |
477 | + | let amDiff = estPut._10 | |
478 | + | let prDiff = estPut._11 | |
479 | + | let amId = estPut._12 | |
480 | + | let prId = estPut._13 | |
481 | + | let emitInv = invoke(factoryContract, "emit", [emitLpAmt], nil) | |
482 | + | if ((emitInv == emitInv)) | |
483 | + | then { | |
484 | + | let emitInvLegacy = match emitInv { | |
485 | + | case legacyFactoryContract: Address => | |
486 | + | invoke(legacyFactoryContract, "emit", [emitLpAmt], nil) | |
487 | + | case _ => | |
488 | + | unit | |
489 | + | } | |
490 | + | if ((emitInvLegacy == emitInvLegacy)) | |
491 | + | then { | |
492 | + | let slippageAInv = if ((amDiff > 0)) | |
493 | + | then invoke(slippageContract, "put", nil, [AttachedPayment(amId, amDiff)]) | |
494 | + | else nil | |
495 | + | if ((slippageAInv == slippageAInv)) | |
496 | + | then { | |
497 | + | let slippagePInv = if ((prDiff > 0)) | |
498 | + | then invoke(slippageContract, "put", nil, [AttachedPayment(prId, prDiff)]) | |
499 | + | else nil | |
500 | + | if ((slippagePInv == slippagePInv)) | |
501 | + | then { | |
502 | + | let lpTransfer = if (shouldAutoStake) | |
503 | + | then { | |
504 | + | let slpStakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)]) | |
505 | + | if ((slpStakeInv == slpStakeInv)) | |
506 | + | then nil | |
507 | + | else throw("Strict value is not equal to itself.") | |
508 | + | } | |
509 | + | else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)] | |
510 | + | (state ++ lpTransfer) | |
511 | + | } | |
512 | + | else throw("Strict value is not equal to itself.") | |
513 | + | } | |
514 | + | else throw("Strict value is not equal to itself.") | |
515 | + | } | |
516 | + | else throw("Strict value is not equal to itself.") | |
517 | + | } | |
518 | + | else throw("Strict value is not equal to itself.") | |
519 | + | } | |
520 | + | } | |
521 | + | ||
522 | + | ||
523 | + | ||
524 | + | @Callable(i) | |
525 | + | func putForFree (maxSlippage) = if ((0 > maxSlippage)) | |
526 | + | then throw("Invalid value passed") | |
527 | + | else { | |
528 | + | let estPut = commonPut(i, maxSlippage, false) | |
529 | + | estPut._9 | |
530 | + | } | |
531 | + | ||
532 | + | ||
533 | + | ||
534 | + | @Callable(i) | |
535 | + | func get () = { | |
536 | + | let res = commonGet(i) | |
537 | + | let outAmtAmt = res._1 | |
538 | + | let outPrAmt = res._2 | |
539 | + | let pmtAmt = res._3 | |
540 | + | let pmtAssetId = res._4 | |
541 | + | let state = res._5 | |
542 | + | let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
543 | + | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
544 | + | then state | |
545 | + | else throw("Strict value is not equal to itself.") | |
546 | + | } | |
547 | + | ||
548 | + | ||
549 | + | ||
550 | + | @Callable(i) | |
551 | + | func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = { | |
552 | + | let res = commonGet(i) | |
553 | + | let outAmAmt = res._1 | |
554 | + | let outPrAmt = res._2 | |
555 | + | let pmtAmt = res._3 | |
556 | + | let pmtAssetId = res._4 | |
557 | + | let state = res._5 | |
558 | + | if ((noLessThenAmtAsset > outAmAmt)) | |
559 | + | then throw(((("noLessThenAmtAsset failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset))) | |
560 | + | else if ((noLessThenPriceAsset > outPrAmt)) | |
561 | + | then throw(((("noLessThenPriceAsset failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset))) | |
562 | + | else { | |
563 | + | let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
564 | + | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
565 | + | then state | |
566 | + | else throw("Strict value is not equal to itself.") | |
567 | + | } | |
568 | + | } | |
569 | + | ||
570 | + | ||
571 | + | ||
572 | + | @Callable(i) | |
573 | + | func unstakeAndGet (amount) = { | |
574 | + | let checkPayments = if ((size(i.payments) != 0)) | |
575 | + | then throw("No payments are expected") | |
576 | + | else true | |
577 | + | if ((checkPayments == checkPayments)) | |
578 | + | then { | |
579 | + | let cfg = getPoolConfig() | |
580 | + | let factoryCfg = getFactoryConfig() | |
581 | + | let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId]) | |
582 | + | let stakingContract = valueOrErrorMessage(addressFromString(factoryCfg[idxFactoryStakingContract]), "Error. Incorrect staking address.") | |
583 | + | let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(lpAssetId), amount], nil) | |
584 | + | if ((unstakeInv == unstakeInv)) | |
585 | + | then { | |
586 | + | let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller) | |
587 | + | let poolStatus = parseIntValue(res._9) | |
588 | + | let state = res._10 | |
589 | + | let checkPoolStatus = if (if (isGlobalShutdown()) | |
590 | + | then true | |
591 | + | else (poolStatus == PoolShutdown)) | |
592 | + | then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus))) | |
593 | + | else true | |
594 | + | if ((checkPoolStatus == checkPoolStatus)) | |
595 | + | then { | |
596 | + | let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)]) | |
597 | + | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
598 | + | then state | |
599 | + | else throw("Strict value is not equal to itself.") | |
600 | + | } | |
601 | + | else throw("Strict value is not equal to itself.") | |
602 | + | } | |
603 | + | else throw("Strict value is not equal to itself.") | |
604 | + | } | |
605 | + | else throw("Strict value is not equal to itself.") | |
606 | + | } | |
607 | + | ||
608 | + | ||
609 | + | ||
610 | + | @Callable(i) | |
611 | + | func activate (amtAssetStr,priceAssetStr) = if ((toString(i.caller) != toString(factoryContract))) | |
612 | + | then throw("permissions denied") | |
613 | + | else $Tuple2([StringEntry(aa(), amtAssetStr), StringEntry(pa(), priceAssetStr)], "success") | |
614 | + | ||
615 | + | ||
616 | + | ||
617 | + | @Callable(i) | |
618 | + | func getPoolConfigWrapperREADONLY () = $Tuple2(nil, getPoolConfig()) | |
619 | + | ||
620 | + | ||
621 | + | ||
622 | + | @Callable(i) | |
623 | + | func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId)) | |
624 | + | ||
625 | + | ||
626 | + | ||
627 | + | @Callable(i) | |
628 | + | func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = { | |
629 | + | let prices = calcPrices(amAmt, prAmt, lpAmt) | |
630 | + | $Tuple2(nil, [toString(prices[0]), toString(prices[1]), toString(prices[2])]) | |
631 | + | } | |
632 | + | ||
633 | + | ||
634 | + | ||
635 | + | @Callable(i) | |
636 | + | func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(toX18(origVal, origScaleMult))) | |
637 | + | ||
638 | + | ||
639 | + | ||
640 | + | @Callable(i) | |
641 | + | func fromX18WrapperREADONLY (val,resultScaleMult) = $Tuple2(nil, fromX18(parseBigIntValue(val), resultScaleMult)) | |
642 | + | ||
643 | + | ||
644 | + | ||
645 | + | @Callable(i) | |
646 | + | func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(calcPriceBigInt(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18)))) | |
647 | + | ||
648 | + | ||
649 | + | ||
650 | + | @Callable(i) | |
651 | + | func estimatePutOperationWrapperREADONLY (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = $Tuple2(nil, estimatePutOperation(txId58, slippageTolerance, inAmAssetAmt, inAmAssetId, inPrAssetAmt, inPrAssetId, userAddress, isEvaluate, emitLp)) | |
652 | + | ||
653 | + | ||
654 | + | ||
655 | + | @Callable(i) | |
656 | + | func estimateGetOperationWrapperREADONLY (txId58,pmtAssetId,pmtLpAmt,userAddress) = { | |
657 | + | let res = estimateGetOperation(txId58, pmtAssetId, pmtLpAmt, addressFromStringValue(userAddress)) | |
658 | + | $Tuple2(nil, $Tuple10(res._1, res._2, res._3, res._4, res._5, res._6, res._7, toString(res._8), res._9, res._10)) | |
659 | + | } | |
660 | + | ||
661 | + | ||
662 | + | ||
663 | + | @Callable(i) | |
664 | + | func statsREADONLY () = { | |
665 | + | let cfg = getPoolConfig() | |
666 | + | let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId]) | |
667 | + | let amtAssetId = cfg[idxAmtAssetId] | |
668 | + | let priceAssetId = cfg[idxPriceAssetId] | |
669 | + | let iAmtAssetId = cfg[idxIAmtAssetId] | |
670 | + | let iPriceAssetId = cfg[idxIPriceAssetId] | |
671 | + | let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm]) | |
672 | + | let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm]) | |
673 | + | let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity | |
674 | + | let accAmtAssetBalance = getAccBalance(amtAssetId) | |
675 | + | let accPriceAssetBalance = getAccBalance(priceAssetId) | |
676 | + | let pricesList = if ((poolLPBalance == 0)) | |
677 | + | then [zeroBigInt, zeroBigInt, zeroBigInt] | |
678 | + | else calcPrices(accAmtAssetBalance, accPriceAssetBalance, poolLPBalance) | |
679 | + | let curPrice = 0 | |
680 | + | let lpAmtAssetShare = fromX18(pricesList[1], scale8) | |
681 | + | let lpPriceAssetShare = fromX18(pricesList[2], scale8) | |
682 | + | let poolWeight = value(getInteger(factoryContract, keyPoolWeight(toString(this)))) | |
683 | + | $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)) | |
684 | + | } | |
685 | + | ||
686 | + | ||
687 | + | ||
688 | + | @Callable(i) | |
689 | + | func evaluatePutByAmountAssetREADONLY (inAmAssetAmt) = { | |
690 | + | let cfg = getPoolConfig() | |
691 | + | let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId]) | |
692 | + | let amAssetIdStr = cfg[idxAmtAssetId] | |
693 | + | let amAssetId = fromBase58String(amAssetIdStr) | |
694 | + | let prAssetIdStr = cfg[idxPriceAssetId] | |
695 | + | let prAssetId = fromBase58String(prAssetIdStr) | |
696 | + | let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm]) | |
697 | + | let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm]) | |
698 | + | let poolStatus = cfg[idxPoolStatus] | |
699 | + | let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity | |
700 | + | let accAmtAssetBalance = getAccBalance(amAssetIdStr) | |
701 | + | let accPriceAssetBalance = getAccBalance(prAssetIdStr) | |
702 | + | let amtAssetAmtX18 = toX18(accAmtAssetBalance, amtAssetDcm) | |
703 | + | let priceAssetAmtX18 = toX18(accPriceAssetBalance, priceAssetDcm) | |
704 | + | let curPriceX18 = if ((poolLPBalance == 0)) | |
705 | + | then zeroBigInt | |
706 | + | else calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18) | |
707 | + | let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm) | |
708 | + | let inPrAssetAmtX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18) | |
709 | + | let inPrAssetAmt = fromX18(inPrAssetAmtX18, priceAssetDcm) | |
710 | + | let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false) | |
711 | + | let calcLpAmt = estPut._1 | |
712 | + | let curPriceCalc = estPut._3 | |
713 | + | let amBalance = estPut._4 | |
714 | + | let prBalance = estPut._5 | |
715 | + | let lpEmission = estPut._6 | |
716 | + | $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)) | |
717 | + | } | |
718 | + | ||
719 | + | ||
720 | + | ||
721 | + | @Callable(i) | |
722 | + | func evaluatePutByPriceAssetREADONLY (inPrAssetAmt) = { | |
723 | + | let cfg = getPoolConfig() | |
724 | + | let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId]) | |
725 | + | let amAssetIdStr = cfg[idxAmtAssetId] | |
726 | + | let amAssetId = fromBase58String(amAssetIdStr) | |
727 | + | let prAssetIdStr = cfg[idxPriceAssetId] | |
728 | + | let prAssetId = fromBase58String(prAssetIdStr) | |
729 | + | let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm]) | |
730 | + | let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm]) | |
731 | + | let poolStatus = cfg[idxPoolStatus] | |
732 | + | let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity | |
733 | + | let amBalanceRaw = getAccBalance(amAssetIdStr) | |
734 | + | let prBalanceRaw = getAccBalance(prAssetIdStr) | |
735 | + | let amBalanceRawX18 = toX18(amBalanceRaw, amtAssetDcm) | |
736 | + | let prBalanceRawX18 = toX18(prBalanceRaw, priceAssetDcm) | |
737 | + | let curPriceX18 = if ((poolLPBalance == 0)) | |
738 | + | then zeroBigInt | |
739 | + | else calcPriceBigInt(prBalanceRawX18, amBalanceRawX18) | |
740 | + | let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm) | |
741 | + | let inAmAssetAmtX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18) | |
742 | + | let inAmAssetAmt = fromX18(inAmAssetAmtX18, amtAssetDcm) | |
743 | + | let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false) | |
744 | + | let calcLpAmt = estPut._1 | |
745 | + | let curPriceCalc = estPut._3 | |
746 | + | let amBalance = estPut._4 | |
747 | + | let prBalance = estPut._5 | |
748 | + | let lpEmission = estPut._6 | |
749 | + | $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)) | |
750 | + | } | |
751 | + | ||
752 | + | ||
753 | + | ||
754 | + | @Callable(i) | |
755 | + | func evaluateGetREADONLY (paymentLpAssetId,paymentLpAmt) = { | |
756 | + | let res = estimateGetOperation("", paymentLpAssetId, paymentLpAmt, this) | |
757 | + | let outAmAmt = res._1 | |
758 | + | let outPrAmt = res._2 | |
759 | + | let amBalance = res._5 | |
760 | + | let prBalance = res._6 | |
761 | + | let lpEmission = res._7 | |
762 | + | let curPrice = res._8 | |
763 | + | let poolStatus = parseIntValue(res._9) | |
764 | + | $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)) | |
765 | + | } | |
766 | + | ||
767 | + | ||
768 | + | @Verifier(tx) | |
769 | + | func verify () = { | |
770 | + | let targetPublicKey = match managerPublicKeyOrUnit() { | |
771 | + | case pk: ByteVector => | |
772 | + | pk | |
773 | + | case _: Unit => | |
774 | + | tx.senderPublicKey | |
775 | + | case _ => | |
776 | + | throw("Match error") | |
777 | + | } | |
778 | + | match tx { | |
779 | + | case order: Order => | |
780 | + | let matcherPub = getMatcherPubOrFail() | |
781 | + | let orderValid = validateMatcherOrderAllowed(order) | |
782 | + | let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey) | |
783 | + | let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub) | |
784 | + | if (if (if (orderValid) | |
785 | + | then senderValid | |
786 | + | else false) | |
787 | + | then matcherValid | |
788 | + | else false) | |
789 | + | then true | |
790 | + | else throwOrderError(orderValid, senderValid, matcherValid) | |
791 | + | case s: SetScriptTransaction => | |
792 | + | let newHash = blake2b256(value(s.script)) | |
793 | + | let allowedHash = fromBase64String(value(getString(factoryContract, keyAllowedLpScriptHash()))) | |
794 | + | let currentHash = scriptHash(this) | |
795 | + | if (if ((allowedHash == newHash)) | |
796 | + | then (currentHash != newHash) | |
797 | + | else false) | |
798 | + | then true | |
799 | + | else sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
800 | + | case _ => | |
801 | + | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
802 | + | } | |
803 | + | } | |
804 | + |
github/deemru/w8io/fabc49c 42.41 ms ◑