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