tx · Bjpm6N7af5vQacoQuRVk8xPQDDYJiEKmexkBd4XHkoUv 3MtP3m8hWMxYcyDxXB6n299KrsLLyT8ehni: -0.01400000 Waves 2021.11.17 17:20 [1795149] smart account 3MtP3m8hWMxYcyDxXB6n299KrsLLyT8ehni > SELF 0.00000000 Waves
{ "type": 13, "id": "Bjpm6N7af5vQacoQuRVk8xPQDDYJiEKmexkBd4XHkoUv", "fee": 1400000, "feeAssetId": null, "timestamp": 1637158866664, "version": 1, "sender": "3MtP3m8hWMxYcyDxXB6n299KrsLLyT8ehni", "senderPublicKey": "BRyVaCURUMe7ssUbXucteig1g44bGwWirJQzugKahUQ1", "proofs": [ "3t6oNRRM6J1GZYF2uUrmNmsKC4dJGnuAhZRGnLUPuYkVWSjQ31nVhdE25e2sKqLngkPQoh4BYrtByzSdpvWZhir5" ], "script": "base64:AAIFAAAAAAAAAGgIAhIECgIICBIECgIBBBIDCgEBEgASBAoCAQESBAoCCAgSABIDCgEIEgUKAwEBARIECgIBARIECgIIARIECgIICBILCgkIAQECAQIIBAQSBgoECAgBCBIAEgMKAQESAwoBARIECgIIAQAAAD8AAAAACmxQZGVjaW1hbHMAAAAAAAAAAAgAAAAABnNjYWxlOAAAAAAABfXhAAAAAAAMc2NhbGU4QmlnSW50CQABNgAAAAEAAAAAAAX14QAAAAAAB3NjYWxlMTgJAAE2AAAAAQAN4Lazp2QAAAAAAAAKemVyb0JpZ0ludAkAATYAAAABAAAAAAAAAAAAAAAAAANTRVACAAAAAl9fAAAAAAVFTVBUWQIAAAAAAAAAAApQb29sQWN0aXZlAAAAAAAAAAABAAAAAA9Qb29sUHV0RGlzYWJsZWQAAAAAAAAAAAIAAAAAE1Bvb2xNYXRjaGVyRGlzYWJsZWQAAAAAAAAAAAMAAAAADFBvb2xTaHV0ZG93bgAAAAAAAAAABAAAAAAOaWR4UG9vbEFkZHJlc3MAAAAAAAAAAAEAAAAADWlkeFBvb2xTdGF0dXMAAAAAAAAAAAIAAAAAEGlkeFBvb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5jZQkABEwAAAACCQABpAAAAAEFAAAACmxwRW1pc3Npb24JAARMAAAAAgkAAaYAAAABBQAAAAhjdXJQcmljZQkABEwAAAACCQABpAAAAAEFAAAACnBvb2xTdGF0dXMFAAAAA25pbAUAAAADU0VQAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAQAAAAHJG1hdGNoMAUAAAACdHgDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABU9yZGVyBAAAAAVvcmRlcgUAAAAHJG1hdGNoMAMJAQAAABt2YWxpZGF0ZU1hdGNoZXJPcmRlckFsbG93ZWQAAAABBQAAAAVvcmRlcgkAAfQAAAADCAUAAAAFb3JkZXIAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAVvcmRlcgAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAVvcmRlcgAAAA9zZW5kZXJQdWJsaWNLZXkHBAAAAA1tYW5hZ2VyUHVibGljCQEAAAALdmFsdWVPckVsc2UAAAACCQAEHQAAAAIFAAAABHRoaXMJAQAAABNrZXlNYW5hZ2VyUHVibGljS2V5AAAAAAUAAAAFRU1QVFkDCQAAAAAAAAIFAAAADW1hbmFnZXJQdWJsaWMFAAAABUVNUFRZCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleQkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAJAAJZAAAAAQUAAAANbWFuYWdlclB1YmxpY18rDF0=", "chainId": 84, "height": 1795149, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: CoCTt5kDzrUWysarKp24YqEkt2YJXCRbiGasyrEeMeS1 Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
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 EMPTY = "" | |
17 | + | ||
18 | + | let PoolActive = 1 | |
19 | + | ||
20 | + | let PoolPutDisabled = 2 | |
21 | + | ||
22 | + | let PoolMatcherDisabled = 3 | |
23 | + | ||
24 | + | let PoolShutdown = 4 | |
25 | + | ||
26 | + | let idxPoolAddress = 1 | |
27 | + | ||
28 | + | let idxPoolStatus = 2 | |
29 | + | ||
30 | + | let idxPoolLPAssetId = 3 | |
31 | + | ||
32 | + | let idxAmtAssetId = 4 | |
33 | + | ||
34 | + | let idxPriceAssetId = 5 | |
35 | + | ||
36 | + | let idxAmtAssetDcm = 6 | |
37 | + | ||
38 | + | let idxPriceAssetDcm = 7 | |
39 | + | ||
40 | + | let idxIAmtAssetId = 8 | |
41 | + | ||
42 | + | let idxIPriceAssetId = 9 | |
43 | + | ||
44 | + | let idxLPAssetDcm = 10 | |
45 | + | ||
46 | + | let idxPoolAmtAssetAmt = 1 | |
47 | + | ||
48 | + | let idxPoolPriceAssetAmt = 2 | |
49 | + | ||
50 | + | let idxPoolLPAssetAmt = 3 | |
51 | + | ||
52 | + | let idxFactoryStakingContract = 1 | |
53 | + | ||
54 | + | let idxFactorySlippageContract = 7 | |
55 | + | ||
56 | + | func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), scale18, toBigInt(origScaleMult)) | |
57 | + | ||
58 | + | ||
59 | + | func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), scale18)) | |
60 | + | ||
61 | + | ||
62 | + | func toScale (amt,resScale,curScale) = fraction(amt, resScale, curScale) | |
63 | + | ||
64 | + | ||
65 | + | func abs (val) = if ((zeroBigInt > val)) | |
66 | + | then -(val) | |
67 | + | else val | |
68 | + | ||
69 | + | ||
70 | + | func keyFactoryContract () = "%s__factoryContract" | |
71 | + | ||
72 | + | ||
73 | + | func keyManagerPublicKey () = "%s__managerPublicKey" | |
74 | + | ||
75 | + | ||
76 | + | func keyPriceLast () = "%s%s__price__last" | |
77 | + | ||
78 | + | ||
79 | + | func keyPriceHistory (h,timestamp) = makeString(["%s%s%d%d__price__history", toString(h), toString(timestamp)], SEP) | |
80 | + | ||
81 | + | ||
82 | + | func keyPutActionByUser (userAddress,txId) = ((("%s%s%s__P__" + userAddress) + "__") + txId) | |
83 | + | ||
84 | + | ||
85 | + | func keyGetActionByUser (userAddress,txId) = ((("%s%s%s__G__" + userAddress) + "__") + txId) | |
86 | + | ||
87 | + | ||
88 | + | func keyAmtAsset () = "%s__amountAsset" | |
89 | + | ||
90 | + | ||
91 | + | func keyPriceAsset () = "%s__priceAsset" | |
92 | + | ||
93 | + | ||
94 | + | func keyKHistoric (h,timestamp) = makeString(["%s%s%d%d__K_history", toString(h), toString(timestamp)], SEP) | |
95 | + | ||
96 | + | ||
97 | + | func keyFactoryConfig () = "%s__factoryConfig" | |
98 | + | ||
99 | + | ||
100 | + | func keyMappingPoolContractAddressToPoolAssets (poolContractAddress) = (("%s%s%s__" + poolContractAddress) + "__mappings__poolContract2LpAsset") | |
101 | + | ||
102 | + | ||
103 | + | func keyPoolConfig (iAmtAsset,iPriceAsset) = (((("%d%d%s__" + iAmtAsset) + "__") + iPriceAsset) + "__config") | |
104 | + | ||
105 | + | ||
106 | + | func keyMappingsBaseAsset2internalId (baseAssetStr) = ("%s%s%s__mappings__baseAsset2internalId__" + baseAssetStr) | |
107 | + | ||
108 | + | ||
109 | + | func keyAllPoolsShutdown () = "%s__shutdown" | |
110 | + | ||
111 | + | ||
112 | + | func keyPoolWeight (contractAddress) = ("%s%s__poolWeight__" + contractAddress) | |
113 | + | ||
114 | + | ||
115 | + | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
116 | + | ||
117 | + | ||
118 | + | func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
119 | + | ||
120 | + | ||
121 | + | let factoryContract = addressFromStringValue(getStringOrFail(this, keyFactoryContract())) | |
122 | + | ||
123 | + | func isGlobalShutdown () = valueOrElse(getBoolean(factoryContract, keyAllPoolsShutdown()), false) | |
124 | + | ||
125 | + | ||
126 | + | func getPoolConfig () = { | |
127 | + | let amtAsset = getStringOrFail(this, keyAmtAsset()) | |
128 | + | let priceAsset = getStringOrFail(this, keyPriceAsset()) | |
129 | + | let iPriceAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(priceAsset)) | |
130 | + | let iAmtAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(amtAsset)) | |
131 | + | split(getStringOrFail(factoryContract, keyPoolConfig(toString(iAmtAsset), toString(iPriceAsset))), SEP) | |
132 | + | } | |
133 | + | ||
134 | + | ||
135 | + | func getFactoryConfig () = split(getStringOrFail(factoryContract, keyFactoryConfig()), SEP) | |
136 | + | ||
137 | + | ||
138 | + | 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) | |
139 | + | ||
140 | + | ||
141 | + | 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) | |
142 | + | ||
143 | + | ||
144 | + | func getAccBalance (assetId) = if ((assetId == "WAVES")) | |
145 | + | then wavesBalance(this).available | |
146 | + | else assetBalance(this, fromBase58String(assetId)) | |
147 | + | ||
148 | + | ||
149 | + | func calcPriceBigInt (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18) | |
150 | + | ||
151 | + | ||
152 | + | func privateCalcPrice (amAssetDcm,prAssetDcm,amAmt,prAmt) = { | |
153 | + | let amtAssetAmtX18 = toX18(amAmt, amAssetDcm) | |
154 | + | let priceAssetAmtX18 = toX18(prAmt, prAssetDcm) | |
155 | + | calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18) | |
156 | + | } | |
157 | + | ||
158 | + | ||
159 | + | func calcPrices (amAmt,prAmt,lpAmt) = { | |
160 | + | let cfg = getPoolConfig() | |
161 | + | let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm]) | |
162 | + | let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm]) | |
163 | + | let priceX18 = privateCalcPrice(amtAssetDcm, priceAssetDcm, amAmt, prAmt) | |
164 | + | let amAmtX18 = toX18(amAmt, amtAssetDcm) | |
165 | + | let prAmtX18 = toX18(prAmt, priceAssetDcm) | |
166 | + | let lpAmtX18 = toX18(lpAmt, scale8) | |
167 | + | let lpPriceInAmAssetX18 = calcPriceBigInt(amAmtX18, lpAmtX18) | |
168 | + | let lpPriceInPrAssetX18 = calcPriceBigInt(prAmtX18, lpAmtX18) | |
169 | + | [priceX18, lpPriceInAmAssetX18, lpPriceInPrAssetX18] | |
170 | + | } | |
171 | + | ||
172 | + | ||
173 | + | func calculatePrices (amAmt,prAmt,lpAmt) = { | |
174 | + | let prices = calcPrices(amAmt, prAmt, lpAmt) | |
175 | + | [fromX18(prices[0], scale8), fromX18(prices[1], scale8), fromX18(prices[2], scale8)] | |
176 | + | } | |
177 | + | ||
178 | + | ||
179 | + | func estimateGetOperation (txId58,pmtAssetId,pmtLpAmt,userAddress) = { | |
180 | + | let cfg = getPoolConfig() | |
181 | + | let lpAssetId = cfg[idxPoolLPAssetId] | |
182 | + | let amAssetId = cfg[idxAmtAssetId] | |
183 | + | let prAssetId = cfg[idxPriceAssetId] | |
184 | + | let amAssetDcm = parseIntValue(cfg[idxAmtAssetDcm]) | |
185 | + | let prAssetDcm = parseIntValue(cfg[idxPriceAssetDcm]) | |
186 | + | let poolStatus = cfg[idxPoolStatus] | |
187 | + | let lpEmission = valueOrErrorMessage(assetInfo(fromBase58String(lpAssetId)), (("Asset " + lpAssetId) + " doesn't exist")).quantity | |
188 | + | if ((lpAssetId != pmtAssetId)) | |
189 | + | then throw("Invalid asset passed.") | |
190 | + | else { | |
191 | + | let amBalance = getAccBalance(amAssetId) | |
192 | + | let amBalanceX18 = toX18(amBalance, amAssetDcm) | |
193 | + | let prBalance = getAccBalance(prAssetId) | |
194 | + | let prBalanceX18 = toX18(prBalance, prAssetDcm) | |
195 | + | let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18) | |
196 | + | let curPrice = fromX18(curPriceX18, scale8) | |
197 | + | let pmtLpAmtX18 = toX18(pmtLpAmt, scale8) | |
198 | + | let lpEmissionX18 = toX18(lpEmission, scale8) | |
199 | + | let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissionX18) | |
200 | + | let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissionX18) | |
201 | + | let outAmAmt = fromX18(outAmAmtX18, amAssetDcm) | |
202 | + | let outPrAmt = fromX18(outPrAmtX18, prAssetDcm) | |
203 | + | let state = if ((txId58 == "")) | |
204 | + | then nil | |
205 | + | else [ScriptTransfer(userAddress, outAmAmt, if ((amAssetId == "WAVES")) | |
206 | + | then unit | |
207 | + | else fromBase58String(amAssetId)), ScriptTransfer(userAddress, outPrAmt, if ((prAssetId == "WAVES")) | |
208 | + | then unit | |
209 | + | else fromBase58String(prAssetId)), StringEntry(keyGetActionByUser(toString(userAddress), txId58), dataGetActionInfo(outAmAmt, outPrAmt, pmtLpAmt, curPrice, height, lastBlock.timestamp)), IntegerEntry(keyPriceLast(), curPrice), IntegerEntry(keyPriceHistory(height, lastBlock.timestamp), curPrice)] | |
210 | + | $Tuple10(outAmAmt, outPrAmt, amAssetId, prAssetId, amBalance, prBalance, lpEmission, curPriceX18, poolStatus, state) | |
211 | + | } | |
212 | + | } | |
213 | + | ||
214 | + | ||
215 | + | func estimatePutOperation (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = { | |
216 | + | let cfg = getPoolConfig() | |
217 | + | let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId]) | |
218 | + | let amAssetIdStr = cfg[idxAmtAssetId] | |
219 | + | let prAssetIdStr = cfg[idxPriceAssetId] | |
220 | + | let iAmtAssetId = cfg[idxIAmtAssetId] | |
221 | + | let iPriceAssetId = cfg[idxIPriceAssetId] | |
222 | + | let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm]) | |
223 | + | let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm]) | |
224 | + | let poolStatus = cfg[idxPoolStatus] | |
225 | + | let lpEmission = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity | |
226 | + | let inAmAssetIdStr = toBase58String(valueOrElse(inAmAssetId, fromBase58String("WAVES"))) | |
227 | + | let inPrAssetIdStr = toBase58String(valueOrElse(inPrAssetId, fromBase58String("WAVES"))) | |
228 | + | if (if ((amAssetIdStr != inAmAssetIdStr)) | |
229 | + | then true | |
230 | + | else (prAssetIdStr != inPrAssetIdStr)) | |
231 | + | then throw("Invalid amt or price asset passed.") | |
232 | + | else { | |
233 | + | let amBalance = if (isEvaluate) | |
234 | + | then getAccBalance(amAssetIdStr) | |
235 | + | else (getAccBalance(amAssetIdStr) - inAmAssetAmt) | |
236 | + | let prBalance = if (isEvaluate) | |
237 | + | then getAccBalance(prAssetIdStr) | |
238 | + | else (getAccBalance(prAssetIdStr) - inPrAssetAmt) | |
239 | + | let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm) | |
240 | + | let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm) | |
241 | + | let userPriceX18 = calcPriceBigInt(inPrAssetAmtX18, inAmAssetAmtX18) | |
242 | + | let amBalanceX18 = toX18(amBalance, amtAssetDcm) | |
243 | + | let prBalanceX18 = toX18(prBalance, priceAssetDcm) | |
244 | + | let res = if ((lpEmission == 0)) | |
245 | + | then { | |
246 | + | let curPriceX18 = zeroBigInt | |
247 | + | let slippageX18 = zeroBigInt | |
248 | + | let lpAmtX18 = pow((inAmAssetAmtX18 * inPrAssetAmtX18), 0, toBigInt(5), 1, 0, DOWN) | |
249 | + | $Tuple5(fromX18(lpAmtX18, scale8), fromX18(inAmAssetAmtX18, amtAssetDcm), fromX18(inPrAssetAmtX18, priceAssetDcm), calcPriceBigInt((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18) | |
250 | + | } | |
251 | + | else { | |
252 | + | let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18) | |
253 | + | let slippageX18 = fraction(abs((curPriceX18 - userPriceX18)), scale18, curPriceX18) | |
254 | + | let slippageToleranceX18 = toX18(slippageTolerance, scale8) | |
255 | + | if (if ((curPriceX18 != zeroBigInt)) | |
256 | + | then (slippageX18 > slippageToleranceX18) | |
257 | + | else false) | |
258 | + | then throw(((("Price slippage " + toString(slippageX18)) + " exceeded the passed limit of ") + toString(slippageToleranceX18))) | |
259 | + | else { | |
260 | + | let lpEmissionX18 = toX18(lpEmission, scale8) | |
261 | + | let prViaAmX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18) | |
262 | + | let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18) | |
263 | + | let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18)) | |
264 | + | then $Tuple2(amViaPrX18, inPrAssetAmtX18) | |
265 | + | else $Tuple2(inAmAssetAmtX18, prViaAmX18) | |
266 | + | let expAmtAssetAmtX18 = expectedAmts._1 | |
267 | + | let expPriceAssetAmtX18 = expectedAmts._2 | |
268 | + | let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18) | |
269 | + | $Tuple5(fromX18(lpAmtX18, scale8), fromX18(expAmtAssetAmtX18, amtAssetDcm), fromX18(expPriceAssetAmtX18, priceAssetDcm), curPriceX18, slippageX18) | |
270 | + | } | |
271 | + | } | |
272 | + | let calcLpAmt = res._1 | |
273 | + | let calcAmAssetPmt = res._2 | |
274 | + | let calcPrAssetPmt = res._3 | |
275 | + | let curPrice = fromX18(res._4, scale8) | |
276 | + | let slippageCalc = fromX18(res._5, scale8) | |
277 | + | if ((0 >= calcLpAmt)) | |
278 | + | then throw("Invalid calculations. LP calculated is less than zero.") | |
279 | + | else { | |
280 | + | let emitLpAmt = if (!(emitLp)) | |
281 | + | then 0 | |
282 | + | else calcLpAmt | |
283 | + | let amDiff = (inAmAssetAmt - calcAmAssetPmt) | |
284 | + | let prDiff = (inPrAssetAmt - calcPrAssetPmt) | |
285 | + | let commonState = [IntegerEntry(keyPriceLast(), curPrice), IntegerEntry(keyPriceHistory(height, lastBlock.timestamp), curPrice), StringEntry(keyPutActionByUser(userAddress, txId58), dataPutActionInfo(calcAmAssetPmt, calcPrAssetPmt, emitLpAmt, curPrice, slippageTolerance, slippageCalc, height, lastBlock.timestamp, amDiff, prDiff))] | |
286 | + | $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEmission, lpAssetId, poolStatus, commonState, amDiff, prDiff, inAmAssetId, inPrAssetId) | |
287 | + | } | |
288 | + | } | |
289 | + | } | |
290 | + | ||
291 | + | ||
292 | + | func validateMatcherOrderAllowed (order) = { | |
293 | + | let cfg = getPoolConfig() | |
294 | + | let amtAssetId = cfg[idxAmtAssetId] | |
295 | + | let priceAssetId = cfg[idxPriceAssetId] | |
296 | + | let poolStatus = parseIntValue(cfg[idxPoolStatus]) | |
297 | + | let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm]) | |
298 | + | let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm]) | |
299 | + | let accAmtAssetBalance = getAccBalance(amtAssetId) | |
300 | + | let accPriceAssetBalance = getAccBalance(priceAssetId) | |
301 | + | let curPriceX18 = if ((order.orderType == Buy)) | |
302 | + | then privateCalcPrice(amtAssetDcm, priceAssetDcm, (accAmtAssetBalance + order.amount), accPriceAssetBalance) | |
303 | + | else privateCalcPrice(amtAssetDcm, priceAssetDcm, (accAmtAssetBalance - order.amount), accPriceAssetBalance) | |
304 | + | let curPrice = fromX18(curPriceX18, scale8) | |
305 | + | if (if (if (isGlobalShutdown()) | |
306 | + | then true | |
307 | + | else (poolStatus == PoolMatcherDisabled)) | |
308 | + | then true | |
309 | + | else (poolStatus == PoolShutdown)) | |
310 | + | then throw("Exchange operations disabled") | |
311 | + | else { | |
312 | + | let orderAmtAsset = order.assetPair.amountAsset | |
313 | + | let orderAmtAssetStr = if ((orderAmtAsset == unit)) | |
314 | + | then "WAVES" | |
315 | + | else toBase58String(value(orderAmtAsset)) | |
316 | + | let orderPriceAsset = order.assetPair.priceAsset | |
317 | + | let orderPriceAssetStr = if ((orderPriceAsset == unit)) | |
318 | + | then "WAVES" | |
319 | + | else toBase58String(value(orderPriceAsset)) | |
320 | + | if (if ((orderAmtAssetStr != amtAssetId)) | |
321 | + | then true | |
322 | + | else (orderPriceAssetStr != priceAssetId)) | |
323 | + | then throw("Wrong order assets.") | |
324 | + | else { | |
325 | + | let orderPrice = order.price | |
326 | + | let priceDcm = fraction(scale8, priceAssetDcm, amtAssetDcm) | |
327 | + | let castedOrderPrice = toScale(orderPrice, scale8, priceDcm) | |
328 | + | let isOrderPriceValid = if ((order.orderType == Buy)) | |
329 | + | then (curPrice >= castedOrderPrice) | |
330 | + | else (castedOrderPrice >= curPrice) | |
331 | + | true | |
332 | + | } | |
333 | + | } | |
334 | + | } | |
335 | + | ||
336 | + | ||
337 | + | func commonGet (i) = if ((size(i.payments) != 1)) | |
338 | + | then throw("exactly 1 payment is expected") | |
339 | + | else { | |
340 | + | let pmt = value(i.payments[0]) | |
341 | + | let pmtAssetId = value(pmt.assetId) | |
342 | + | let pmtAmt = pmt.amount | |
343 | + | let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller) | |
344 | + | let outAmAmt = res._1 | |
345 | + | let outPrAmt = res._2 | |
346 | + | let poolStatus = parseIntValue(res._9) | |
347 | + | let state = res._10 | |
348 | + | if (if (isGlobalShutdown()) | |
349 | + | then true | |
350 | + | else (poolStatus == PoolShutdown)) | |
351 | + | then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus))) | |
352 | + | else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state) | |
353 | + | } | |
354 | + | ||
355 | + | ||
356 | + | func commonPut (i,slippageTolerance,emitLp) = if ((size(i.payments) != 2)) | |
357 | + | then throw("exactly 2 payments are expected") | |
358 | + | else { | |
359 | + | let amAssetPmt = value(i.payments[0]) | |
360 | + | let prAssetPmt = value(i.payments[1]) | |
361 | + | let estPut = estimatePutOperation(toBase58String(i.transactionId), slippageTolerance, amAssetPmt.amount, amAssetPmt.assetId, prAssetPmt.amount, prAssetPmt.assetId, toString(i.caller), false, emitLp) | |
362 | + | let poolStatus = parseIntValue(estPut._8) | |
363 | + | if (if (if (isGlobalShutdown()) | |
364 | + | then true | |
365 | + | else (poolStatus == PoolPutDisabled)) | |
366 | + | then true | |
367 | + | else (poolStatus == PoolShutdown)) | |
368 | + | then throw(("Put operation is blocked by admin. Status = " + toString(poolStatus))) | |
369 | + | else estPut | |
370 | + | } | |
371 | + | ||
372 | + | ||
373 | + | @Callable(i) | |
374 | + | func constructor (factoryContract,managerPublicKey) = if ((i.caller != this)) | |
375 | + | then throw("permissions denied") | |
376 | + | else [StringEntry(keyFactoryContract(), factoryContract), StringEntry(keyManagerPublicKey(), managerPublicKey)] | |
377 | + | ||
378 | + | ||
379 | + | ||
380 | + | @Callable(i) | |
381 | + | func put (slippageTolerance,shouldAutoStake) = { | |
382 | + | let factoryCfg = getFactoryConfig() | |
383 | + | let stakingContract = valueOrErrorMessage(addressFromString(factoryCfg[idxFactoryStakingContract]), "Error. Incorrect staking address.") | |
384 | + | let slippageContract = valueOrErrorMessage(addressFromString(factoryCfg[idxFactorySlippageContract]), "Error. Incorrect slippage contract address.") | |
385 | + | if ((0 > slippageTolerance)) | |
386 | + | then throw("Invalid slippageTolerance passed") | |
387 | + | else { | |
388 | + | let estPut = commonPut(i, slippageTolerance, true) | |
389 | + | let emitLpAmt = estPut._2 | |
390 | + | let lpAssetId = estPut._7 | |
391 | + | let state = estPut._9 | |
392 | + | let amDiff = estPut._10 | |
393 | + | let prDiff = estPut._11 | |
394 | + | let amId = estPut._12 | |
395 | + | let prId = estPut._13 | |
396 | + | let emitInv = invoke(factoryContract, "emit", [emitLpAmt], nil) | |
397 | + | if ((emitInv == emitInv)) | |
398 | + | then { | |
399 | + | let slippageAInv = if ((amDiff > 0)) | |
400 | + | then invoke(slippageContract, "put", nil, [AttachedPayment(amId, amDiff)]) | |
401 | + | else nil | |
402 | + | if ((slippageAInv == slippageAInv)) | |
403 | + | then { | |
404 | + | let slippagePInv = if ((prDiff > 0)) | |
405 | + | then invoke(slippageContract, "put", nil, [AttachedPayment(prId, prDiff)]) | |
406 | + | else nil | |
407 | + | if ((slippagePInv == slippagePInv)) | |
408 | + | then { | |
409 | + | let lpTransfer = if (shouldAutoStake) | |
410 | + | then { | |
411 | + | let slpStakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)]) | |
412 | + | if ((slpStakeInv == slpStakeInv)) | |
413 | + | then nil | |
414 | + | else throw("Strict value is not equal to itself.") | |
415 | + | } | |
416 | + | else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)] | |
417 | + | (state ++ lpTransfer) | |
418 | + | } | |
419 | + | else throw("Strict value is not equal to itself.") | |
420 | + | } | |
421 | + | else throw("Strict value is not equal to itself.") | |
422 | + | } | |
423 | + | else throw("Strict value is not equal to itself.") | |
424 | + | } | |
425 | + | } | |
426 | + | ||
427 | + | ||
428 | + | ||
429 | + | @Callable(i) | |
430 | + | func putForFree (maxSlippage) = if ((0 > maxSlippage)) | |
431 | + | then throw("Invalid value passed") | |
432 | + | else { | |
433 | + | let estPut = commonPut(i, maxSlippage, false) | |
434 | + | estPut._9 | |
435 | + | } | |
436 | + | ||
437 | + | ||
438 | + | ||
439 | + | @Callable(i) | |
440 | + | func get () = { | |
441 | + | let res = commonGet(i) | |
442 | + | let outAmtAmt = res._1 | |
443 | + | let outPrAmt = res._2 | |
444 | + | let pmtAmt = res._3 | |
445 | + | let pmtAssetId = res._4 | |
446 | + | let state = res._5 | |
447 | + | let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
448 | + | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
449 | + | then state | |
450 | + | else throw("Strict value is not equal to itself.") | |
451 | + | } | |
452 | + | ||
453 | + | ||
454 | + | ||
455 | + | @Callable(i) | |
456 | + | func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = { | |
457 | + | let res = commonGet(i) | |
458 | + | let outAmAmt = res._1 | |
459 | + | let outPrAmt = res._2 | |
460 | + | let pmtAmt = res._3 | |
461 | + | let pmtAssetId = res._4 | |
462 | + | let state = res._5 | |
463 | + | if ((noLessThenAmtAsset > outAmAmt)) | |
464 | + | then throw(((("noLessThenAmtAsset failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset))) | |
465 | + | else if ((noLessThenPriceAsset > outPrAmt)) | |
466 | + | then throw(((("noLessThenPriceAsset failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset))) | |
467 | + | else { | |
468 | + | let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
469 | + | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
470 | + | then state | |
471 | + | else throw("Strict value is not equal to itself.") | |
472 | + | } | |
473 | + | } | |
474 | + | ||
475 | + | ||
476 | + | ||
477 | + | @Callable(i) | |
478 | + | func activate (amtAssetStr,priceAssetStr) = if ((toString(i.caller) != toString(factoryContract))) | |
479 | + | then throw("permissions denied") | |
480 | + | else $Tuple2([StringEntry(keyAmtAsset(), amtAssetStr), StringEntry(keyPriceAsset(), priceAssetStr)], "success") | |
481 | + | ||
482 | + | ||
483 | + | ||
484 | + | @Callable(i) | |
485 | + | func getPoolConfigWrapperREADONLY () = $Tuple2(nil, getPoolConfig()) | |
486 | + | ||
487 | + | ||
488 | + | ||
489 | + | @Callable(i) | |
490 | + | func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId)) | |
491 | + | ||
492 | + | ||
493 | + | ||
494 | + | @Callable(i) | |
495 | + | func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = { | |
496 | + | let prices = calcPrices(amAmt, prAmt, lpAmt) | |
497 | + | $Tuple2(nil, [toString(prices[0]), toString(prices[1]), toString(prices[2])]) | |
498 | + | } | |
499 | + | ||
500 | + | ||
501 | + | ||
502 | + | @Callable(i) | |
503 | + | func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(toX18(origVal, origScaleMult))) | |
504 | + | ||
505 | + | ||
506 | + | ||
507 | + | @Callable(i) | |
508 | + | func fromX18WrapperREADONLY (val,resultScaleMult) = $Tuple2(nil, fromX18(parseBigIntValue(val), resultScaleMult)) | |
509 | + | ||
510 | + | ||
511 | + | ||
512 | + | @Callable(i) | |
513 | + | func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(calcPriceBigInt(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18)))) | |
514 | + | ||
515 | + | ||
516 | + | ||
517 | + | @Callable(i) | |
518 | + | func estimatePutOperationWrapperREADONLY (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = $Tuple2(nil, estimatePutOperation(txId58, slippageTolerance, inAmAssetAmt, inAmAssetId, inPrAssetAmt, inPrAssetId, userAddress, isEvaluate, emitLp)) | |
519 | + | ||
520 | + | ||
521 | + | ||
522 | + | @Callable(i) | |
523 | + | func estimateGetOperationWrapperREADONLY (txId58,pmtAssetId,pmtLpAmt,userAddress) = { | |
524 | + | let res = estimateGetOperation(txId58, pmtAssetId, pmtLpAmt, addressFromStringValue(userAddress)) | |
525 | + | $Tuple2(nil, $Tuple10(res._1, res._2, res._3, res._4, res._5, res._6, res._7, toString(res._8), res._9, res._10)) | |
526 | + | } | |
527 | + | ||
528 | + | ||
529 | + | ||
530 | + | @Callable(i) | |
531 | + | func statsREADONLY () = { | |
532 | + | let cfg = getPoolConfig() | |
533 | + | let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId]) | |
534 | + | let amtAssetId = cfg[idxAmtAssetId] | |
535 | + | let priceAssetId = cfg[idxPriceAssetId] | |
536 | + | let iAmtAssetId = cfg[idxIAmtAssetId] | |
537 | + | let iPriceAssetId = cfg[idxIPriceAssetId] | |
538 | + | let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm]) | |
539 | + | let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm]) | |
540 | + | let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity | |
541 | + | let accAmtAssetBalance = getAccBalance(amtAssetId) | |
542 | + | let accPriceAssetBalance = getAccBalance(priceAssetId) | |
543 | + | let pricesList = calcPrices(accAmtAssetBalance, accPriceAssetBalance, poolLPBalance) | |
544 | + | let curPrice = 0 | |
545 | + | let lpAmtAssetShare = fromX18(pricesList[1], scale8) | |
546 | + | let lpPriceAssetShare = fromX18(pricesList[2], scale8) | |
547 | + | let poolWeight = value(getInteger(factoryContract, keyPoolWeight(toString(this)))) | |
548 | + | $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)) | |
549 | + | } | |
550 | + | ||
551 | + | ||
552 | + | ||
553 | + | @Callable(i) | |
554 | + | func evaluatePutByAmountAssetREADONLY (inAmAssetAmt) = { | |
555 | + | let cfg = getPoolConfig() | |
556 | + | let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId]) | |
557 | + | let amAssetIdStr = cfg[idxAmtAssetId] | |
558 | + | let amAssetId = fromBase58String(amAssetIdStr) | |
559 | + | let prAssetIdStr = cfg[idxPriceAssetId] | |
560 | + | let prAssetId = fromBase58String(prAssetIdStr) | |
561 | + | let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm]) | |
562 | + | let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm]) | |
563 | + | let poolStatus = cfg[idxPoolStatus] | |
564 | + | let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity | |
565 | + | let accAmtAssetBalance = getAccBalance(amAssetIdStr) | |
566 | + | let accPriceAssetBalance = getAccBalance(prAssetIdStr) | |
567 | + | let amtAssetAmtX18 = toX18(accAmtAssetBalance, amtAssetDcm) | |
568 | + | let priceAssetAmtX18 = toX18(accPriceAssetBalance, priceAssetDcm) | |
569 | + | let curPriceX18 = if ((poolLPBalance == 0)) | |
570 | + | then zeroBigInt | |
571 | + | else calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18) | |
572 | + | let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm) | |
573 | + | let inPrAssetAmtX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18) | |
574 | + | let inPrAssetAmt = fromX18(inPrAssetAmtX18, priceAssetDcm) | |
575 | + | let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false) | |
576 | + | let calcLpAmt = estPut._1 | |
577 | + | let curPriceCalc = estPut._3 | |
578 | + | let amBalance = estPut._4 | |
579 | + | let prBalance = estPut._5 | |
580 | + | let lpEmission = estPut._6 | |
581 | + | $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)) | |
582 | + | } | |
583 | + | ||
584 | + | ||
585 | + | ||
586 | + | @Callable(i) | |
587 | + | func evaluatePutByPriceAssetREADONLY (inPrAssetAmt) = { | |
588 | + | let cfg = getPoolConfig() | |
589 | + | let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId]) | |
590 | + | let amAssetIdStr = cfg[idxAmtAssetId] | |
591 | + | let amAssetId = fromBase58String(amAssetIdStr) | |
592 | + | let prAssetIdStr = cfg[idxPriceAssetId] | |
593 | + | let prAssetId = fromBase58String(prAssetIdStr) | |
594 | + | let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm]) | |
595 | + | let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm]) | |
596 | + | let poolStatus = cfg[idxPoolStatus] | |
597 | + | let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity | |
598 | + | let amBalanceRaw = getAccBalance(amAssetIdStr) | |
599 | + | let prBalanceRaw = getAccBalance(prAssetIdStr) | |
600 | + | let amBalanceRawX18 = toX18(amBalanceRaw, amtAssetDcm) | |
601 | + | let prBalanceRawX18 = toX18(prBalanceRaw, priceAssetDcm) | |
602 | + | let curPriceX18 = if ((poolLPBalance == 0)) | |
603 | + | then zeroBigInt | |
604 | + | else calcPriceBigInt(prBalanceRawX18, amBalanceRawX18) | |
605 | + | let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm) | |
606 | + | let inAmAssetAmtX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18) | |
607 | + | let inAmAssetAmt = fromX18(inAmAssetAmtX18, amtAssetDcm) | |
608 | + | let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false) | |
609 | + | let calcLpAmt = estPut._1 | |
610 | + | let curPriceCalc = estPut._3 | |
611 | + | let amBalance = estPut._4 | |
612 | + | let prBalance = estPut._5 | |
613 | + | let lpEmission = estPut._6 | |
614 | + | $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)) | |
615 | + | } | |
616 | + | ||
617 | + | ||
618 | + | ||
619 | + | @Callable(i) | |
620 | + | func evaluateGetREADONLY (paymentLpAssetId,paymentLpAmt) = { | |
621 | + | let res = estimateGetOperation("", paymentLpAssetId, paymentLpAmt, this) | |
622 | + | let outAmAmt = res._1 | |
623 | + | let outPrAmt = res._2 | |
624 | + | let amBalance = res._5 | |
625 | + | let prBalance = res._6 | |
626 | + | let lpEmission = res._7 | |
627 | + | let curPrice = res._8 | |
628 | + | let poolStatus = parseIntValue(res._9) | |
629 | + | $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)) | |
630 | + | } | |
631 | + | ||
632 | + | ||
633 | + | @Verifier(tx) | |
634 | + | func verify () = match tx { | |
635 | + | case order: Order => | |
636 | + | if (validateMatcherOrderAllowed(order)) | |
637 | + | then sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey) | |
638 | + | else false | |
639 | + | case _ => | |
640 | + | let managerPublic = valueOrElse(getString(this, keyManagerPublicKey()), EMPTY) | |
641 | + | if ((managerPublic == EMPTY)) | |
642 | + | then sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
643 | + | else sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(managerPublic)) | |
644 | + | } | |
645 | + |
github/deemru/w8io/169f3d6 35.94 ms ◑