tx · 3dg2e9q1kfuTtvoZxLHncXAahiwd2MtFK1o1X8eTCAwv 3MxbR7b3gHF4XdQKNTT5aQMRiazHvrVWC8N: -0.02000000 Waves 2020.09.16 13:47 [1179729] smart account 3MxbR7b3gHF4XdQKNTT5aQMRiazHvrVWC8N > SELF 0.00000000 Waves
{ "type": 13, "id": "3dg2e9q1kfuTtvoZxLHncXAahiwd2MtFK1o1X8eTCAwv", "fee": 2000000, "feeAssetId": null, "timestamp": 1600253261210, "version": 1, "sender": "3MxbR7b3gHF4XdQKNTT5aQMRiazHvrVWC8N", "senderPublicKey": "4bj7YXaphTC4Ldx7DqqMmrTjNshRtw1yNsej2XXZcAzS", "proofs": [ "5VrLwg3Djiget5uHibinytzYUAtBZxzzzV5B6P1gqfQcwQFZFJ3peT3fkKvmcpBZmU9rbhkEe5itWr6jsRTT2idR", "fdZNKk8MTKjF6xUHLaMQ8Xyy61Cy8W3LNV4qkA81gmjbWtyg5KKWruTth5EiB2WewRUb1gEr7JPZUjG8yuY1eXV", "zc3dHSwjQvfJoXGWstmG6g22x5dt9HFjhypUCctN3Q9rbeZdug2LfjQ5MMdyLDgX7DFsfdYyLXyyN7oZiUeu5BZ" ], "script": "base64:AAIEAAAAAAAAABYIAhIAEgMKAQESBAoCAQgSAwoBCBIAAAAAQQEAAAAOZ2V0TnVtYmVyQnlLZXkAAAABAAAAA2tleQkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkABBoAAAACBQAAAAR0aGlzBQAAAANrZXkAAAAAAAAAAAABAAAADmdldFN0cmluZ0J5S2V5AAAAAQAAAANrZXkJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAAQdAAAAAgUAAAAEdGhpcwUAAAADa2V5AgAAAAABAAAAFmdldEJvb2xCeUFkZHJlc3NBbmRLZXkAAAACAAAAB2FkZHJlc3MAAAADa2V5CQEAAAALdmFsdWVPckVsc2UAAAACCQAEGwAAAAIFAAAAB2FkZHJlc3MFAAAAA2tleQcBAAAAGGdldFN0cmluZ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elJvMzNaTWhyTTduaUxzZURIMnVSb0s2d2VCcTJKUTNBCQAETAAAAAICAAAALDVXUlhGU2p3Y1RiTmZLY0pzOFpxWG1TU1dZc1NWSlV0TXZNcVpqNWhINE5jBQAAAANuaWwEAAAABWNvdW50CQAAZAAAAAIJAABkAAAAAgkAAGQAAAACAwkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAJAAJZAAAAAQkAAZEAAAACBQAAABBwdWJLZXlBZG1pbnNMaXN0AAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAwkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAEJAAJZAAAAAQkAAZEAAAACBQAAABBwdWJLZXlBZG1pbnNMaXN0AAAAAAAAAAABAAAAAAAAAAABAAAAAAAAAAAAAwkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAIJAAJZAAAAAQkAAZEAAAACBQAAABBwdWJLZXlBZG1pbnNMaXN0AAAAAAAAAAACAAAAAAAAAAABAAAAAAAAAAAAAwkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAMJAAJZAAAAAQkAAZEAAAACBQAAABBwdWJLZXlBZG1pbnNMaXN0AAAAAAAAAAADAAAAAAAAAAACAAAAAAAAAAAACQAAZwAAAAIFAAAABWNvdW50AAAAAAAAAAADxUoPQA==", "chainId": 84, "height": 1179729, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 7VYauowJCP5uTGaiELVpCQzaEv9d9opqR1dx4rhENsfB Next: JhGsAs6Bqp8mhbTCBfZTGwBrVWBoiJf2tHEfGdmja1n Diff:
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | func getNumberByKey (key) = match getInteger(this, key) { | |
5 | - | case a: Int => | |
6 | - | a | |
7 | - | case _ => | |
8 | - | 0 | |
9 | - | } | |
4 | + | func getNumberByKey (key) = valueOrElse(getInteger(this, key), 0) | |
10 | 5 | ||
11 | 6 | ||
12 | - | func getStringByKey (key) = match getString(this, key) { | |
13 | - | case a: String => | |
14 | - | a | |
15 | - | case _ => | |
16 | - | "" | |
17 | - | } | |
7 | + | func getStringByKey (key) = valueOrElse(getString(this, key), "") | |
18 | 8 | ||
19 | 9 | ||
20 | - | func getBoolByAddressAndKey (address,key) = match getBoolean(address, key) { | |
21 | - | case a: Boolean => | |
22 | - | a | |
23 | - | case _ => | |
24 | - | false | |
25 | - | } | |
10 | + | func getBoolByAddressAndKey (address,key) = valueOrElse(getBoolean(address, key), false) | |
26 | 11 | ||
27 | 12 | ||
28 | - | func getStringByAddressAndKey (address,key) = match getString(address, key) { | |
29 | - | case a: String => | |
30 | - | a | |
31 | - | case _ => | |
32 | - | "" | |
33 | - | } | |
13 | + | func getStringByAddressAndKey (address,key) = valueOrElse(getString(address, key), "") | |
34 | 14 | ||
35 | 15 | ||
36 | - | func getNumberByAddressAndKey (address,key) = match getInteger(address, key) { | |
37 | - | case a: Int => | |
38 | - | a | |
39 | - | case _ => | |
40 | - | 0 | |
41 | - | } | |
16 | + | func getNumberByAddressAndKey (address,key) = valueOrElse(getInteger(address, key), 0) | |
42 | 17 | ||
43 | 18 | ||
44 | 19 | let WAVELET = 100000000 | |
46 | 21 | let PAULI = 1000000 | |
47 | 22 | ||
48 | 23 | let PRICELET = 1000000 | |
24 | + | ||
25 | + | let MULT = 100000000 | |
26 | + | ||
27 | + | let SCALEMULT = 8 | |
49 | 28 | ||
50 | 29 | let MINORDERTOTAL = (10 * WAVELET) | |
51 | 30 | ||
126 | 105 | ||
127 | 106 | let neutrinoLockedBalance = getNumberByAddressAndKey(neutrinoContract, NeutrinoLockedBalanceKey) | |
128 | 107 | ||
129 | - | let reserve = (wavesBalance(neutrinoContract) - getNumberByAddressAndKey(neutrinoContract, WavesLockedBalanceKey)) | |
108 | + | let reserve = (wavesBalance(neutrinoContract).regular - getNumberByAddressAndKey(neutrinoContract, WavesLockedBalanceKey)) | |
130 | 109 | ||
131 | - | let | |
110 | + | let reservesInUsdn = convertWavesToNeutrino(reserve, currentPrice) | |
132 | 111 | ||
133 | - | let deficit = (neutrinoSupply - convertWavesToNeutrino(reserve, currentPrice)) | |
112 | + | let neutrinoSupply = (((neutrinoLockedBalance + value(assetInfo(neutrinoAssetId)).quantity) - assetBalance(neutrinoContract, neutrinoAssetId)) - assetBalance(liquidationContract, neutrinoAssetId)) | |
113 | + | ||
114 | + | let deficit = (neutrinoSupply - reservesInUsdn) | |
115 | + | ||
116 | + | let currentMaxRoi = fraction(deficit, 100, neutrinoSupply) | |
117 | + | ||
118 | + | let currentBrMult = fraction(reservesInUsdn, MULT, neutrinoSupply) | |
134 | 119 | ||
135 | 120 | let firstOrder = getStringByKey(FirstOrderKey) | |
136 | 121 | ||
155 | 140 | func getNextOrder (id) = getStringByKey(getNextOrderKey(id)) | |
156 | 141 | ||
157 | 142 | ||
158 | - | func | |
143 | + | func getPriceForRoi (roiPercents) = fraction((100 + roiPercents), currentPrice, 100) | |
159 | 144 | ||
160 | 145 | ||
161 | - | func internalSellBond (currentMaxRoi,pFirstOrder,pNextOrder,pFilledTotal,pRoi,pPrice,pPaymentWavelets,orderOwnerAddress,instantOrder) = { | |
162 | - | let priceWavesByBondCents = fraction((100 + pRoi), currentPrice, 100) | |
146 | + | func getReversePrice (price) = ((PRICELET * PRICELET) / price) | |
147 | + | ||
148 | + | ||
149 | + | func calcNsbt2WavesPriceRaw (spentWavesRaw,receivedNsbtRaw) = fraction(spentWavesRaw, (PAULI * PRICELET), receivedNsbtRaw) | |
150 | + | ||
151 | + | ||
152 | + | func orderData (orderId,totalWavelets,filledWavelets,owner,status,roi,price) = [IntegerEntry(getOrderPriceKey(orderId), price), IntegerEntry(getOrderTotalKey(orderId), totalWavelets), IntegerEntry(getOrderFilledTotalKey(orderId), filledWavelets), StringEntry(getOrderOwnerKey(orderId), owner), IntegerEntry(getOrderHeightKey(orderId), height), StringEntry(getOrderStatusKey(orderId), status), IntegerEntry(("debug_order_currentPrice_" + orderId), currentPrice), IntegerEntry(getRoiByOrderIdKey(orderId), roi)] | |
153 | + | ||
154 | + | ||
155 | + | func internalSellBond (pFirstOrder,pNextOrder,pFilledTotal,pRoi,pPrice,pPaymentWavelets,orderOwnerAddress,instantOrder) = { | |
156 | + | let priceWavesByBondCents = getPriceForRoi(pRoi) | |
163 | 157 | let remainedTotal = (pPaymentWavelets - pFilledTotal) | |
164 | 158 | let fillableOrderAmount = convertWavesToBond(remainedTotal, priceWavesByBondCents) | |
165 | 159 | let totalOrderWaveletesRequired = convertBondToWaves(fillableOrderAmount, priceWavesByBondCents) | |
171 | 165 | else { | |
172 | 166 | let changeWavelets = (remainedTotal - totalOrderWaveletesRequired) | |
173 | 167 | let writeSetData = if (instantOrder) | |
174 | - | then | |
175 | - | else [ | |
176 | - | | |
168 | + | then orderData(pFirstOrder, pPaymentWavelets, (pFilledTotal + totalOrderWaveletesRequired), toBase58String(orderOwnerAddress.bytes), FILLED, pRoi, currentPrice) | |
169 | + | else [IntegerEntry(getOrderFilledTotalKey(pFirstOrder), (pFilledTotal + totalOrderWaveletesRequired)), StringEntry(getOrderStatusKey(pFirstOrder), FILLED), StringEntry(getPrevOrderKey(pNextOrder), ""), StringEntry(FirstOrderKey, pNextOrder)] | |
170 | + | (writeSetData ++ [ScriptTransfer(orderOwnerAddress, fillableOrderAmount, bondAssetId), ScriptTransfer(neutrinoContract, totalOrderWaveletesRequired, unit), ScriptTransfer(orderOwnerAddress, changeWavelets, unit)]) | |
177 | 171 | } | |
178 | 172 | } | |
179 | 173 | ||
180 | 174 | ||
181 | - | func internalAddBuyBondOrder ( | |
182 | - | let pmt = | |
175 | + | func internalAddBuyBondOrder (roi,price,prevOrder,inv,instantOrder) = { | |
176 | + | let pmt = value(inv.payments[0]) | |
183 | 177 | let newOrderId = toBase58String(inv.transactionId) | |
184 | 178 | if (isBlocked) | |
185 | 179 | then throw("contract is blocked by EMERGENCY SHUTDOWN actions until reactivation by emergency oracles") | |
187 | 181 | then throw(("min order total equals " + toString(MINORDERTOTAL))) | |
188 | 182 | else if ((roi > MAXROI)) | |
189 | 183 | then throw("max setOrder ROI is 95%") | |
190 | - | else if (if ((deficit > 0)) | |
191 | - | then (0 > roi) | |
192 | - | else false) | |
193 | - | then throw("can't place order with negative roi during deficit") | |
194 | - | else if ((-(MAXROI) > roi)) | |
195 | - | then throw("min setOrder ROI is -95%") | |
196 | - | else if ((roi == 0)) | |
197 | - | then throw("roi should not be equal to 0") | |
198 | - | else if (isDefined(pmt.assetId)) | |
199 | - | then throw("can use waves only") | |
200 | - | else if ((getOrderOwner(newOrderId) != "")) | |
201 | - | then throw("order exists") | |
202 | - | else if (if ((prevOrder != "")) | |
203 | - | then (getOrderStatus(prevOrder) != NEW) | |
204 | - | else false) | |
205 | - | then throw("prev order status is not new") | |
206 | - | else { | |
207 | - | let isNewOrderAtFirstPosition = (prevOrder == "") | |
208 | - | let owner = toString(inv.caller) | |
209 | - | let nextOrder = if (isNewOrderAtFirstPosition) | |
210 | - | then firstOrder | |
211 | - | else getNextOrder(prevOrder) | |
212 | - | let nextOrderRoi = getNumberByKey(getRoiByOrderIdKey(nextOrder)) | |
213 | - | let isNextOrderError = if (if ((nextOrder != "")) | |
214 | - | then (roi >= nextOrderRoi) | |
184 | + | else if ((0 > roi)) | |
185 | + | then throw("can't place order with negative roi") | |
186 | + | else if ((roi == 0)) | |
187 | + | then throw("roi should not be equal to 0") | |
188 | + | else if (isDefined(pmt.assetId)) | |
189 | + | then throw("can use waves only") | |
190 | + | else if ((getOrderOwner(newOrderId) != "")) | |
191 | + | then throw("order exists") | |
192 | + | else if (if ((prevOrder != "")) | |
193 | + | then (getOrderStatus(prevOrder) != NEW) | |
194 | + | else false) | |
195 | + | then throw("prev order status is not new") | |
196 | + | else { | |
197 | + | let isNewOrderAtFirstPosition = (prevOrder == "") | |
198 | + | let owner = toString(inv.caller) | |
199 | + | let nextOrder = if (isNewOrderAtFirstPosition) | |
200 | + | then firstOrder | |
201 | + | else getNextOrder(prevOrder) | |
202 | + | let nextOrderRoi = getNumberByKey(getRoiByOrderIdKey(nextOrder)) | |
203 | + | let isNextOrderError = if (if ((nextOrder != "")) | |
204 | + | then (roi >= nextOrderRoi) | |
205 | + | else false) | |
206 | + | then true | |
207 | + | else false | |
208 | + | let prevOrderRoi = getNumberByKey(getRoiByOrderIdKey(prevOrder)) | |
209 | + | let isPrevOrderError = if (if ((prevOrder != "")) | |
210 | + | then (prevOrderRoi > roi) | |
211 | + | else false) | |
212 | + | then true | |
213 | + | else false | |
214 | + | if (if (isNextOrderError) | |
215 | + | then true | |
216 | + | else isPrevOrderError) | |
217 | + | then throw(((("invalid order isPrevOrderError:" + toString(isPrevOrderError)) + " isNextOrderError:") + toString(isNextOrderError))) | |
218 | + | else if (if (isNewOrderAtFirstPosition) | |
219 | + | then (currentMaxRoi >= roi) | |
215 | 220 | else false) | |
216 | - | then true | |
217 | - | else false | |
218 | - | let prevOrderRoi = getNumberByKey(getRoiByOrderIdKey(prevOrder)) | |
219 | - | let isPrevOrderError = if (if ((prevOrder != "")) | |
220 | - | then (prevOrderRoi > roi) | |
221 | - | else false) | |
222 | - | then true | |
223 | - | else false | |
224 | - | if (if (isNextOrderError) | |
225 | - | then true | |
226 | - | else isPrevOrderError) | |
227 | - | then throw(((("invalid order isPrevOrderError:" + toString(isPrevOrderError)) + " isNextOrderError:") + toString(isNextOrderError))) | |
228 | - | else if (if (isNewOrderAtFirstPosition) | |
229 | - | then (currentMaxRoi >= roi) | |
230 | - | else false) | |
231 | - | then internalSellBond(currentMaxRoi, newOrderId, nextOrder, 0, roi, price, pmt.amount, inv.caller, true) | |
232 | - | else if (instantOrder) | |
233 | - | then throw("Instant order couldn't be added into waiting queue") | |
234 | - | else WriteSet([DataEntry(getPrevOrderKey(newOrderId), prevOrder), DataEntry(getNextOrderKey(newOrderId), nextOrder), DataEntry(getNextOrderKey(prevOrder), if ((prevOrder == "")) | |
235 | - | then "" | |
236 | - | else newOrderId), DataEntry(getPrevOrderKey(nextOrder), if ((nextOrder == "")) | |
237 | - | then "" | |
238 | - | else newOrderId), DataEntry(FirstOrderKey, if (if ((firstOrder == "")) | |
239 | - | then true | |
240 | - | else (firstOrder == nextOrder)) | |
241 | - | then newOrderId | |
242 | - | else firstOrder), orderData(newOrderId, pmt.amount, owner, NEW, roi, price)]) | |
243 | - | } | |
221 | + | then internalSellBond(newOrderId, nextOrder, 0, roi, price, pmt.amount, inv.caller, true) | |
222 | + | else if (instantOrder) | |
223 | + | then throw("Instant order couldn't be added into waiting queue") | |
224 | + | else ([StringEntry(getPrevOrderKey(newOrderId), prevOrder), StringEntry(getNextOrderKey(newOrderId), nextOrder), StringEntry(getNextOrderKey(prevOrder), if ((prevOrder == "")) | |
225 | + | then "" | |
226 | + | else newOrderId), StringEntry(getPrevOrderKey(nextOrder), if ((nextOrder == "")) | |
227 | + | then "" | |
228 | + | else newOrderId), StringEntry(FirstOrderKey, if (if ((firstOrder == "")) | |
229 | + | then true | |
230 | + | else (firstOrder == nextOrder)) | |
231 | + | then newOrderId | |
232 | + | else firstOrder)] ++ orderData(newOrderId, pmt.amount, 0, owner, NEW, roi, price)) | |
233 | + | } | |
244 | 234 | } | |
235 | + | ||
236 | + | ||
237 | + | func curveFunction (wRaw,uRaw,price) = { | |
238 | + | let EXP = 271828100 | |
239 | + | let nsbtCurveParamA = valueOrElse(getInteger(this, "nsbtCurveParam_a"), 3) | |
240 | + | let wReservesInUsdn = convertWavesToNeutrino(wRaw, price) | |
241 | + | let brMult = fraction(wReservesInUsdn, MULT, uRaw) | |
242 | + | let powerMult = (nsbtCurveParamA * (brMult - (1 * MULT))) | |
243 | + | let expInPowerMult = pow(EXP, SCALEMULT, powerMult, SCALEMULT, SCALEMULT, DOWN) | |
244 | + | let constCoeff = fraction(uRaw, PRICELET, (nsbtCurveParamA * price)) | |
245 | + | let finalResultIfPriceInUsdn = fraction(constCoeff, MULT, expInPowerMult) | |
246 | + | let finalResult = fraction(finalResultIfPriceInUsdn, price, PRICELET) | |
247 | + | $Tuple6(finalResult, wReservesInUsdn, brMult, powerMult, expInPowerMult, constCoeff) | |
248 | + | } | |
249 | + | ||
250 | + | ||
251 | + | func toStr (name,l) = (((((((((((((name + "[finalResult=") + toString(l._1)) + "wReservesInUsdn=") + toString(l._2)) + " brMult=") + toString(l._3)) + " powerMult=") + toString(l._4)) + " expInPowerMult=") + toString(l._5)) + " constCoeff=") + toString(l._6)) + "]") | |
252 | + | ||
253 | + | ||
254 | + | @Callable(i) | |
255 | + | func buyNsbtInSurplus () = { | |
256 | + | let pmt = value(i.payments[0]) | |
257 | + | let pmtAmount = pmt.amount | |
258 | + | let ownerAddress = i.caller | |
259 | + | if (isBlocked) | |
260 | + | then throw("contract is blocked by EMERGENCY SHUTDOWN actions until reactivation by emergency oracles") | |
261 | + | else if (((1 * MULT) > currentBrMult)) | |
262 | + | then throw(((("use instantBuyNsbtOrFail or addBuyBondOrder methods to buy nsbt when BR < 1: currentBR=" + toString(currentBrMult)) + "/") + toString(MULT))) | |
263 | + | else if (isDefined(pmt.assetId)) | |
264 | + | then throw("can use waves only") | |
265 | + | else { | |
266 | + | let f0 = curveFunction(reserve, neutrinoSupply, currentPrice) | |
267 | + | let f1 = curveFunction((reserve + pmtAmount), neutrinoSupply, currentPrice) | |
268 | + | let nsbtAmount = (f0._1 - f1._1) | |
269 | + | let nsbt2WavesPriceRaw = calcNsbt2WavesPriceRaw(pmtAmount, nsbtAmount) | |
270 | + | let roi = (fraction(getReversePrice(nsbt2WavesPriceRaw), 100, currentPrice) - 100) | |
271 | + | (orderData(toBase58String(i.transactionId), pmtAmount, pmtAmount, toString(ownerAddress), FILLED, roi, nsbt2WavesPriceRaw) ++ [ScriptTransfer(ownerAddress, nsbtAmount, bondAssetId), ScriptTransfer(neutrinoContract, pmtAmount, unit), StringEntry("debug_f0", toStr("f0", f0)), StringEntry("debug_f1", toStr("f1", f1))]) | |
272 | + | } | |
273 | + | } | |
274 | + | ||
245 | 275 | ||
246 | 276 | ||
247 | 277 | @Callable(i) | |
248 | 278 | func instantBuyNsbtOrFail (noLessThenRoi) = { | |
249 | - | let pmt = | |
250 | - | let | |
251 | - | if ((noLessThenRoi > | |
252 | - | then throw(((("Current maxRoi=" + toString( | |
279 | + | let pmt = value(i.payments[0]) | |
280 | + | let roi = currentMaxRoi | |
281 | + | if ((noLessThenRoi > roi)) | |
282 | + | then throw(((("Current maxRoi=" + toString(roi)) + " is less then passed parameter noLessThenRoi=") + toString(noLessThenRoi))) | |
253 | 283 | else { | |
254 | - | let priceWavesByBondCents = | |
255 | - | internalAddBuyBondOrder( | |
284 | + | let priceWavesByBondCents = getPriceForRoi(roi) | |
285 | + | internalAddBuyBondOrder(roi, getReversePrice(priceWavesByBondCents), "", i, true) | |
256 | 286 | } | |
257 | 287 | } | |
258 | 288 | ||
260 | 290 | ||
261 | 291 | @Callable(i) | |
262 | 292 | func addBuyBondOrder (price,prevOrder) = { | |
263 | - | let pmt = | |
264 | - | let priceWavesByBondCents = | |
293 | + | let pmt = value(i.payments[0]) | |
294 | + | let priceWavesByBondCents = getReversePrice(price) | |
265 | 295 | if ((0 >= price)) | |
266 | 296 | then throw("price less zero") | |
267 | - | else internalAddBuyBondOrder( | |
297 | + | else internalAddBuyBondOrder(fraction((priceWavesByBondCents - currentPrice), 100, currentPrice), price, prevOrder, i, false) | |
268 | 298 | } | |
269 | 299 | ||
270 | 300 | ||
282 | 312 | then throw("permission denied") | |
283 | 313 | else if ((getOrderStatus(orderId) != NEW)) | |
284 | 314 | then throw("invalid order status") | |
285 | - | else | |
315 | + | else [StringEntry(FirstOrderKey, if ((firstOrder == orderId)) | |
286 | 316 | then nextOrder | |
287 | - | else firstOrder), | |
317 | + | else firstOrder), StringEntry(getNextOrderKey(prevOrder), nextOrder), StringEntry(getPrevOrderKey(nextOrder), prevOrder), StringEntry(getOrderStatusKey(orderId), CANCELED), ScriptTransfer(i.caller, amount, unit)] | |
288 | 318 | } | |
289 | 319 | ||
290 | 320 | ||
301 | 331 | let roi = getNumberByKey(getRoiByOrderIdKey(firstOrder)) | |
302 | 332 | let paymentWavelets = getOrderTotal(firstOrder) | |
303 | 333 | let orderOwnerAddress = Address(fromBase58String(getOrderOwner(firstOrder))) | |
304 | - | internalSellBond( | |
334 | + | internalSellBond(firstOrder, nextOrder, filledTotal, roi, orderPrice, paymentWavelets, orderOwnerAddress, false) | |
305 | 335 | } | |
306 | - | ||
307 | - | ||
308 | - | ||
309 | - | @Callable(i) | |
310 | - | func updateReservesAndNeutrinoSupply () = { | |
311 | - | func getNumberByKeyInternal (key) = match getInteger(this, key) { | |
312 | - | case a: Int => | |
313 | - | a | |
314 | - | case _ => | |
315 | - | 0 | |
316 | - | } | |
317 | - | ||
318 | - | let idx = getNumberByKeyInternal("updateReservesAndNeutrinoSupplyIdx") | |
319 | - | let newIdx = (idx + 1) | |
320 | - | WriteSet([DataEntry("updateReservesAndNeutrinoSupplyIdx", newIdx), DataEntry("reserve", reserve), DataEntry("neutrinoSupply", neutrinoSupply), DataEntry("deficit", deficit)]) | |
321 | - | } | |
322 | 336 | ||
323 | 337 | ||
324 | 338 | @Verifier(tx) |
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | func getNumberByKey (key) = match getInteger(this, key) { | |
5 | - | case a: Int => | |
6 | - | a | |
7 | - | case _ => | |
8 | - | 0 | |
9 | - | } | |
4 | + | func getNumberByKey (key) = valueOrElse(getInteger(this, key), 0) | |
10 | 5 | ||
11 | 6 | ||
12 | - | func getStringByKey (key) = match getString(this, key) { | |
13 | - | case a: String => | |
14 | - | a | |
15 | - | case _ => | |
16 | - | "" | |
17 | - | } | |
7 | + | func getStringByKey (key) = valueOrElse(getString(this, key), "") | |
18 | 8 | ||
19 | 9 | ||
20 | - | func getBoolByAddressAndKey (address,key) = match getBoolean(address, key) { | |
21 | - | case a: Boolean => | |
22 | - | a | |
23 | - | case _ => | |
24 | - | false | |
25 | - | } | |
10 | + | func getBoolByAddressAndKey (address,key) = valueOrElse(getBoolean(address, key), false) | |
26 | 11 | ||
27 | 12 | ||
28 | - | func getStringByAddressAndKey (address,key) = match getString(address, key) { | |
29 | - | case a: String => | |
30 | - | a | |
31 | - | case _ => | |
32 | - | "" | |
33 | - | } | |
13 | + | func getStringByAddressAndKey (address,key) = valueOrElse(getString(address, key), "") | |
34 | 14 | ||
35 | 15 | ||
36 | - | func getNumberByAddressAndKey (address,key) = match getInteger(address, key) { | |
37 | - | case a: Int => | |
38 | - | a | |
39 | - | case _ => | |
40 | - | 0 | |
41 | - | } | |
16 | + | func getNumberByAddressAndKey (address,key) = valueOrElse(getInteger(address, key), 0) | |
42 | 17 | ||
43 | 18 | ||
44 | 19 | let WAVELET = 100000000 | |
45 | 20 | ||
46 | 21 | let PAULI = 1000000 | |
47 | 22 | ||
48 | 23 | let PRICELET = 1000000 | |
24 | + | ||
25 | + | let MULT = 100000000 | |
26 | + | ||
27 | + | let SCALEMULT = 8 | |
49 | 28 | ||
50 | 29 | let MINORDERTOTAL = (10 * WAVELET) | |
51 | 30 | ||
52 | 31 | let MAXROI = 95 | |
53 | 32 | ||
54 | 33 | let CANCELED = "canceled" | |
55 | 34 | ||
56 | 35 | let NEW = "new" | |
57 | 36 | ||
58 | 37 | let FILLED = "filled" | |
59 | 38 | ||
60 | 39 | let PriceKey = "price" | |
61 | 40 | ||
62 | 41 | let BondAssetIdKey = "bond_asset_id" | |
63 | 42 | ||
64 | 43 | let NeutrinoAssetIdKey = "neutrino_asset_id" | |
65 | 44 | ||
66 | 45 | let BalanceLockedkKey = "balance_lock_" | |
67 | 46 | ||
68 | 47 | let WavesLockedBalanceKey = (BalanceLockedkKey + "waves") | |
69 | 48 | ||
70 | 49 | let NeutrinoLockedBalanceKey = (BalanceLockedkKey + "neutrino") | |
71 | 50 | ||
72 | 51 | let FirstOrderKey = "order_first" | |
73 | 52 | ||
74 | 53 | func getRoiByOrderIdKey (orderId) = ("debug_order_roi_" + orderId) | |
75 | 54 | ||
76 | 55 | ||
77 | 56 | func getOrderPriceKey (orderId) = ("order_price_" + orderId) | |
78 | 57 | ||
79 | 58 | ||
80 | 59 | func getOrderTotalKey (orderId) = ("order_total_" + orderId) | |
81 | 60 | ||
82 | 61 | ||
83 | 62 | func getOrderOwnerKey (orderId) = ("order_owner_" + orderId) | |
84 | 63 | ||
85 | 64 | ||
86 | 65 | func getOrderHeightKey (orderId) = ("order_height_" + orderId) | |
87 | 66 | ||
88 | 67 | ||
89 | 68 | func getOrderStatusKey (orderId) = ("order_status_" + orderId) | |
90 | 69 | ||
91 | 70 | ||
92 | 71 | func getOrderFilledTotalKey (orderId) = ("order_filled_total_" + orderId) | |
93 | 72 | ||
94 | 73 | ||
95 | 74 | func getPrevOrderKey (orderId) = ("order_prev_" + orderId) | |
96 | 75 | ||
97 | 76 | ||
98 | 77 | func getNextOrderKey (orderId) = ("order_next_" + orderId) | |
99 | 78 | ||
100 | 79 | ||
101 | 80 | func convertNeutrinoToWaves (amount,price) = fraction(fraction(amount, PRICELET, price), WAVELET, PAULI) | |
102 | 81 | ||
103 | 82 | ||
104 | 83 | func convertWavesToNeutrino (amount,price) = fraction(fraction(amount, price, PRICELET), PAULI, WAVELET) | |
105 | 84 | ||
106 | 85 | ||
107 | 86 | func convertWavesToBond (amount,price) = convertWavesToNeutrino(amount, price) | |
108 | 87 | ||
109 | 88 | ||
110 | 89 | func convertBondToWaves (amount,price) = convertNeutrinoToWaves(amount, price) | |
111 | 90 | ||
112 | 91 | ||
113 | 92 | let neutrinoContract = Address(base58'3Mzbx34Ex5rRbn39vUHx9kiwh3nneF8S5we') | |
114 | 93 | ||
115 | 94 | let controlContract = Address(base58'3N4NS7d4Jo9a6F14LiFUKKYVdUkkf2eP4Zx') | |
116 | 95 | ||
117 | 96 | let liquidationContract = Address(base58'3N5nmMvMH8o3RPEyCKCaoWahBTYTexnZy62') | |
118 | 97 | ||
119 | 98 | let neutrinoAssetId = base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT' | |
120 | 99 | ||
121 | 100 | let bondAssetId = base58'BGhPYquXSK6UYjnPLEn94gFhetp4Jvf7toekEY4x1VDH' | |
122 | 101 | ||
123 | 102 | let isBlocked = getBoolByAddressAndKey(controlContract, "is_blocked") | |
124 | 103 | ||
125 | 104 | let currentPrice = getNumberByAddressAndKey(controlContract, PriceKey) | |
126 | 105 | ||
127 | 106 | let neutrinoLockedBalance = getNumberByAddressAndKey(neutrinoContract, NeutrinoLockedBalanceKey) | |
128 | 107 | ||
129 | - | let reserve = (wavesBalance(neutrinoContract) - getNumberByAddressAndKey(neutrinoContract, WavesLockedBalanceKey)) | |
108 | + | let reserve = (wavesBalance(neutrinoContract).regular - getNumberByAddressAndKey(neutrinoContract, WavesLockedBalanceKey)) | |
130 | 109 | ||
131 | - | let | |
110 | + | let reservesInUsdn = convertWavesToNeutrino(reserve, currentPrice) | |
132 | 111 | ||
133 | - | let deficit = (neutrinoSupply - convertWavesToNeutrino(reserve, currentPrice)) | |
112 | + | let neutrinoSupply = (((neutrinoLockedBalance + value(assetInfo(neutrinoAssetId)).quantity) - assetBalance(neutrinoContract, neutrinoAssetId)) - assetBalance(liquidationContract, neutrinoAssetId)) | |
113 | + | ||
114 | + | let deficit = (neutrinoSupply - reservesInUsdn) | |
115 | + | ||
116 | + | let currentMaxRoi = fraction(deficit, 100, neutrinoSupply) | |
117 | + | ||
118 | + | let currentBrMult = fraction(reservesInUsdn, MULT, neutrinoSupply) | |
134 | 119 | ||
135 | 120 | let firstOrder = getStringByKey(FirstOrderKey) | |
136 | 121 | ||
137 | 122 | func getOrderPrice (id) = getNumberByKey(getOrderPriceKey(id)) | |
138 | 123 | ||
139 | 124 | ||
140 | 125 | func getOrderTotal (id) = getNumberByKey(getOrderTotalKey(id)) | |
141 | 126 | ||
142 | 127 | ||
143 | 128 | func getOrderOwner (id) = getStringByKey(getOrderOwnerKey(id)) | |
144 | 129 | ||
145 | 130 | ||
146 | 131 | func getOrderStatus (id) = getStringByKey(getOrderStatusKey(id)) | |
147 | 132 | ||
148 | 133 | ||
149 | 134 | func getOrderFilledTotal (id) = getNumberByKey(getOrderFilledTotalKey(id)) | |
150 | 135 | ||
151 | 136 | ||
152 | 137 | func getPrevOrder (id) = getStringByKey(getPrevOrderKey(id)) | |
153 | 138 | ||
154 | 139 | ||
155 | 140 | func getNextOrder (id) = getStringByKey(getNextOrderKey(id)) | |
156 | 141 | ||
157 | 142 | ||
158 | - | func | |
143 | + | func getPriceForRoi (roiPercents) = fraction((100 + roiPercents), currentPrice, 100) | |
159 | 144 | ||
160 | 145 | ||
161 | - | func internalSellBond (currentMaxRoi,pFirstOrder,pNextOrder,pFilledTotal,pRoi,pPrice,pPaymentWavelets,orderOwnerAddress,instantOrder) = { | |
162 | - | let priceWavesByBondCents = fraction((100 + pRoi), currentPrice, 100) | |
146 | + | func getReversePrice (price) = ((PRICELET * PRICELET) / price) | |
147 | + | ||
148 | + | ||
149 | + | func calcNsbt2WavesPriceRaw (spentWavesRaw,receivedNsbtRaw) = fraction(spentWavesRaw, (PAULI * PRICELET), receivedNsbtRaw) | |
150 | + | ||
151 | + | ||
152 | + | func orderData (orderId,totalWavelets,filledWavelets,owner,status,roi,price) = [IntegerEntry(getOrderPriceKey(orderId), price), IntegerEntry(getOrderTotalKey(orderId), totalWavelets), IntegerEntry(getOrderFilledTotalKey(orderId), filledWavelets), StringEntry(getOrderOwnerKey(orderId), owner), IntegerEntry(getOrderHeightKey(orderId), height), StringEntry(getOrderStatusKey(orderId), status), IntegerEntry(("debug_order_currentPrice_" + orderId), currentPrice), IntegerEntry(getRoiByOrderIdKey(orderId), roi)] | |
153 | + | ||
154 | + | ||
155 | + | func internalSellBond (pFirstOrder,pNextOrder,pFilledTotal,pRoi,pPrice,pPaymentWavelets,orderOwnerAddress,instantOrder) = { | |
156 | + | let priceWavesByBondCents = getPriceForRoi(pRoi) | |
163 | 157 | let remainedTotal = (pPaymentWavelets - pFilledTotal) | |
164 | 158 | let fillableOrderAmount = convertWavesToBond(remainedTotal, priceWavesByBondCents) | |
165 | 159 | let totalOrderWaveletesRequired = convertBondToWaves(fillableOrderAmount, priceWavesByBondCents) | |
166 | 160 | let nbTokensSellCondition = (currentMaxRoi >= pRoi) | |
167 | 161 | if (!(nbTokensSellCondition)) | |
168 | 162 | then throw(("innapropriate roi: " + toString(pRoi))) | |
169 | 163 | else if ((totalOrderWaveletesRequired == 0)) | |
170 | 164 | then throw("cannot fill order at the moment") | |
171 | 165 | else { | |
172 | 166 | let changeWavelets = (remainedTotal - totalOrderWaveletesRequired) | |
173 | 167 | let writeSetData = if (instantOrder) | |
174 | - | then | |
175 | - | else [ | |
176 | - | | |
168 | + | then orderData(pFirstOrder, pPaymentWavelets, (pFilledTotal + totalOrderWaveletesRequired), toBase58String(orderOwnerAddress.bytes), FILLED, pRoi, currentPrice) | |
169 | + | else [IntegerEntry(getOrderFilledTotalKey(pFirstOrder), (pFilledTotal + totalOrderWaveletesRequired)), StringEntry(getOrderStatusKey(pFirstOrder), FILLED), StringEntry(getPrevOrderKey(pNextOrder), ""), StringEntry(FirstOrderKey, pNextOrder)] | |
170 | + | (writeSetData ++ [ScriptTransfer(orderOwnerAddress, fillableOrderAmount, bondAssetId), ScriptTransfer(neutrinoContract, totalOrderWaveletesRequired, unit), ScriptTransfer(orderOwnerAddress, changeWavelets, unit)]) | |
177 | 171 | } | |
178 | 172 | } | |
179 | 173 | ||
180 | 174 | ||
181 | - | func internalAddBuyBondOrder ( | |
182 | - | let pmt = | |
175 | + | func internalAddBuyBondOrder (roi,price,prevOrder,inv,instantOrder) = { | |
176 | + | let pmt = value(inv.payments[0]) | |
183 | 177 | let newOrderId = toBase58String(inv.transactionId) | |
184 | 178 | if (isBlocked) | |
185 | 179 | then throw("contract is blocked by EMERGENCY SHUTDOWN actions until reactivation by emergency oracles") | |
186 | 180 | else if ((MINORDERTOTAL > pmt.amount)) | |
187 | 181 | then throw(("min order total equals " + toString(MINORDERTOTAL))) | |
188 | 182 | else if ((roi > MAXROI)) | |
189 | 183 | then throw("max setOrder ROI is 95%") | |
190 | - | else if (if ((deficit > 0)) | |
191 | - | then (0 > roi) | |
192 | - | else false) | |
193 | - | then throw("can't place order with negative roi during deficit") | |
194 | - | else if ((-(MAXROI) > roi)) | |
195 | - | then throw("min setOrder ROI is -95%") | |
196 | - | else if ((roi == 0)) | |
197 | - | then throw("roi should not be equal to 0") | |
198 | - | else if (isDefined(pmt.assetId)) | |
199 | - | then throw("can use waves only") | |
200 | - | else if ((getOrderOwner(newOrderId) != "")) | |
201 | - | then throw("order exists") | |
202 | - | else if (if ((prevOrder != "")) | |
203 | - | then (getOrderStatus(prevOrder) != NEW) | |
204 | - | else false) | |
205 | - | then throw("prev order status is not new") | |
206 | - | else { | |
207 | - | let isNewOrderAtFirstPosition = (prevOrder == "") | |
208 | - | let owner = toString(inv.caller) | |
209 | - | let nextOrder = if (isNewOrderAtFirstPosition) | |
210 | - | then firstOrder | |
211 | - | else getNextOrder(prevOrder) | |
212 | - | let nextOrderRoi = getNumberByKey(getRoiByOrderIdKey(nextOrder)) | |
213 | - | let isNextOrderError = if (if ((nextOrder != "")) | |
214 | - | then (roi >= nextOrderRoi) | |
184 | + | else if ((0 > roi)) | |
185 | + | then throw("can't place order with negative roi") | |
186 | + | else if ((roi == 0)) | |
187 | + | then throw("roi should not be equal to 0") | |
188 | + | else if (isDefined(pmt.assetId)) | |
189 | + | then throw("can use waves only") | |
190 | + | else if ((getOrderOwner(newOrderId) != "")) | |
191 | + | then throw("order exists") | |
192 | + | else if (if ((prevOrder != "")) | |
193 | + | then (getOrderStatus(prevOrder) != NEW) | |
194 | + | else false) | |
195 | + | then throw("prev order status is not new") | |
196 | + | else { | |
197 | + | let isNewOrderAtFirstPosition = (prevOrder == "") | |
198 | + | let owner = toString(inv.caller) | |
199 | + | let nextOrder = if (isNewOrderAtFirstPosition) | |
200 | + | then firstOrder | |
201 | + | else getNextOrder(prevOrder) | |
202 | + | let nextOrderRoi = getNumberByKey(getRoiByOrderIdKey(nextOrder)) | |
203 | + | let isNextOrderError = if (if ((nextOrder != "")) | |
204 | + | then (roi >= nextOrderRoi) | |
205 | + | else false) | |
206 | + | then true | |
207 | + | else false | |
208 | + | let prevOrderRoi = getNumberByKey(getRoiByOrderIdKey(prevOrder)) | |
209 | + | let isPrevOrderError = if (if ((prevOrder != "")) | |
210 | + | then (prevOrderRoi > roi) | |
211 | + | else false) | |
212 | + | then true | |
213 | + | else false | |
214 | + | if (if (isNextOrderError) | |
215 | + | then true | |
216 | + | else isPrevOrderError) | |
217 | + | then throw(((("invalid order isPrevOrderError:" + toString(isPrevOrderError)) + " isNextOrderError:") + toString(isNextOrderError))) | |
218 | + | else if (if (isNewOrderAtFirstPosition) | |
219 | + | then (currentMaxRoi >= roi) | |
215 | 220 | else false) | |
216 | - | then true | |
217 | - | else false | |
218 | - | let prevOrderRoi = getNumberByKey(getRoiByOrderIdKey(prevOrder)) | |
219 | - | let isPrevOrderError = if (if ((prevOrder != "")) | |
220 | - | then (prevOrderRoi > roi) | |
221 | - | else false) | |
222 | - | then true | |
223 | - | else false | |
224 | - | if (if (isNextOrderError) | |
225 | - | then true | |
226 | - | else isPrevOrderError) | |
227 | - | then throw(((("invalid order isPrevOrderError:" + toString(isPrevOrderError)) + " isNextOrderError:") + toString(isNextOrderError))) | |
228 | - | else if (if (isNewOrderAtFirstPosition) | |
229 | - | then (currentMaxRoi >= roi) | |
230 | - | else false) | |
231 | - | then internalSellBond(currentMaxRoi, newOrderId, nextOrder, 0, roi, price, pmt.amount, inv.caller, true) | |
232 | - | else if (instantOrder) | |
233 | - | then throw("Instant order couldn't be added into waiting queue") | |
234 | - | else WriteSet([DataEntry(getPrevOrderKey(newOrderId), prevOrder), DataEntry(getNextOrderKey(newOrderId), nextOrder), DataEntry(getNextOrderKey(prevOrder), if ((prevOrder == "")) | |
235 | - | then "" | |
236 | - | else newOrderId), DataEntry(getPrevOrderKey(nextOrder), if ((nextOrder == "")) | |
237 | - | then "" | |
238 | - | else newOrderId), DataEntry(FirstOrderKey, if (if ((firstOrder == "")) | |
239 | - | then true | |
240 | - | else (firstOrder == nextOrder)) | |
241 | - | then newOrderId | |
242 | - | else firstOrder), orderData(newOrderId, pmt.amount, owner, NEW, roi, price)]) | |
243 | - | } | |
221 | + | then internalSellBond(newOrderId, nextOrder, 0, roi, price, pmt.amount, inv.caller, true) | |
222 | + | else if (instantOrder) | |
223 | + | then throw("Instant order couldn't be added into waiting queue") | |
224 | + | else ([StringEntry(getPrevOrderKey(newOrderId), prevOrder), StringEntry(getNextOrderKey(newOrderId), nextOrder), StringEntry(getNextOrderKey(prevOrder), if ((prevOrder == "")) | |
225 | + | then "" | |
226 | + | else newOrderId), StringEntry(getPrevOrderKey(nextOrder), if ((nextOrder == "")) | |
227 | + | then "" | |
228 | + | else newOrderId), StringEntry(FirstOrderKey, if (if ((firstOrder == "")) | |
229 | + | then true | |
230 | + | else (firstOrder == nextOrder)) | |
231 | + | then newOrderId | |
232 | + | else firstOrder)] ++ orderData(newOrderId, pmt.amount, 0, owner, NEW, roi, price)) | |
233 | + | } | |
244 | 234 | } | |
235 | + | ||
236 | + | ||
237 | + | func curveFunction (wRaw,uRaw,price) = { | |
238 | + | let EXP = 271828100 | |
239 | + | let nsbtCurveParamA = valueOrElse(getInteger(this, "nsbtCurveParam_a"), 3) | |
240 | + | let wReservesInUsdn = convertWavesToNeutrino(wRaw, price) | |
241 | + | let brMult = fraction(wReservesInUsdn, MULT, uRaw) | |
242 | + | let powerMult = (nsbtCurveParamA * (brMult - (1 * MULT))) | |
243 | + | let expInPowerMult = pow(EXP, SCALEMULT, powerMult, SCALEMULT, SCALEMULT, DOWN) | |
244 | + | let constCoeff = fraction(uRaw, PRICELET, (nsbtCurveParamA * price)) | |
245 | + | let finalResultIfPriceInUsdn = fraction(constCoeff, MULT, expInPowerMult) | |
246 | + | let finalResult = fraction(finalResultIfPriceInUsdn, price, PRICELET) | |
247 | + | $Tuple6(finalResult, wReservesInUsdn, brMult, powerMult, expInPowerMult, constCoeff) | |
248 | + | } | |
249 | + | ||
250 | + | ||
251 | + | func toStr (name,l) = (((((((((((((name + "[finalResult=") + toString(l._1)) + "wReservesInUsdn=") + toString(l._2)) + " brMult=") + toString(l._3)) + " powerMult=") + toString(l._4)) + " expInPowerMult=") + toString(l._5)) + " constCoeff=") + toString(l._6)) + "]") | |
252 | + | ||
253 | + | ||
254 | + | @Callable(i) | |
255 | + | func buyNsbtInSurplus () = { | |
256 | + | let pmt = value(i.payments[0]) | |
257 | + | let pmtAmount = pmt.amount | |
258 | + | let ownerAddress = i.caller | |
259 | + | if (isBlocked) | |
260 | + | then throw("contract is blocked by EMERGENCY SHUTDOWN actions until reactivation by emergency oracles") | |
261 | + | else if (((1 * MULT) > currentBrMult)) | |
262 | + | then throw(((("use instantBuyNsbtOrFail or addBuyBondOrder methods to buy nsbt when BR < 1: currentBR=" + toString(currentBrMult)) + "/") + toString(MULT))) | |
263 | + | else if (isDefined(pmt.assetId)) | |
264 | + | then throw("can use waves only") | |
265 | + | else { | |
266 | + | let f0 = curveFunction(reserve, neutrinoSupply, currentPrice) | |
267 | + | let f1 = curveFunction((reserve + pmtAmount), neutrinoSupply, currentPrice) | |
268 | + | let nsbtAmount = (f0._1 - f1._1) | |
269 | + | let nsbt2WavesPriceRaw = calcNsbt2WavesPriceRaw(pmtAmount, nsbtAmount) | |
270 | + | let roi = (fraction(getReversePrice(nsbt2WavesPriceRaw), 100, currentPrice) - 100) | |
271 | + | (orderData(toBase58String(i.transactionId), pmtAmount, pmtAmount, toString(ownerAddress), FILLED, roi, nsbt2WavesPriceRaw) ++ [ScriptTransfer(ownerAddress, nsbtAmount, bondAssetId), ScriptTransfer(neutrinoContract, pmtAmount, unit), StringEntry("debug_f0", toStr("f0", f0)), StringEntry("debug_f1", toStr("f1", f1))]) | |
272 | + | } | |
273 | + | } | |
274 | + | ||
245 | 275 | ||
246 | 276 | ||
247 | 277 | @Callable(i) | |
248 | 278 | func instantBuyNsbtOrFail (noLessThenRoi) = { | |
249 | - | let pmt = | |
250 | - | let | |
251 | - | if ((noLessThenRoi > | |
252 | - | then throw(((("Current maxRoi=" + toString( | |
279 | + | let pmt = value(i.payments[0]) | |
280 | + | let roi = currentMaxRoi | |
281 | + | if ((noLessThenRoi > roi)) | |
282 | + | then throw(((("Current maxRoi=" + toString(roi)) + " is less then passed parameter noLessThenRoi=") + toString(noLessThenRoi))) | |
253 | 283 | else { | |
254 | - | let priceWavesByBondCents = | |
255 | - | internalAddBuyBondOrder( | |
284 | + | let priceWavesByBondCents = getPriceForRoi(roi) | |
285 | + | internalAddBuyBondOrder(roi, getReversePrice(priceWavesByBondCents), "", i, true) | |
256 | 286 | } | |
257 | 287 | } | |
258 | 288 | ||
259 | 289 | ||
260 | 290 | ||
261 | 291 | @Callable(i) | |
262 | 292 | func addBuyBondOrder (price,prevOrder) = { | |
263 | - | let pmt = | |
264 | - | let priceWavesByBondCents = | |
293 | + | let pmt = value(i.payments[0]) | |
294 | + | let priceWavesByBondCents = getReversePrice(price) | |
265 | 295 | if ((0 >= price)) | |
266 | 296 | then throw("price less zero") | |
267 | - | else internalAddBuyBondOrder( | |
297 | + | else internalAddBuyBondOrder(fraction((priceWavesByBondCents - currentPrice), 100, currentPrice), price, prevOrder, i, false) | |
268 | 298 | } | |
269 | 299 | ||
270 | 300 | ||
271 | 301 | ||
272 | 302 | @Callable(i) | |
273 | 303 | func cancelOrder (orderId) = { | |
274 | 304 | let owner = getOrderOwner(orderId) | |
275 | 305 | let amount = (getOrderTotal(orderId) - getOrderFilledTotal(orderId)) | |
276 | 306 | let caller = toString(i.caller) | |
277 | 307 | let nextOrder = getNextOrder(orderId) | |
278 | 308 | let prevOrder = getPrevOrder(orderId) | |
279 | 309 | if (isBlocked) | |
280 | 310 | then throw("contract is blocked by EMERGENCY SHUTDOWN actions until reactivation by emergency oracles") | |
281 | 311 | else if ((owner != caller)) | |
282 | 312 | then throw("permission denied") | |
283 | 313 | else if ((getOrderStatus(orderId) != NEW)) | |
284 | 314 | then throw("invalid order status") | |
285 | - | else | |
315 | + | else [StringEntry(FirstOrderKey, if ((firstOrder == orderId)) | |
286 | 316 | then nextOrder | |
287 | - | else firstOrder), | |
317 | + | else firstOrder), StringEntry(getNextOrderKey(prevOrder), nextOrder), StringEntry(getPrevOrderKey(nextOrder), prevOrder), StringEntry(getOrderStatusKey(orderId), CANCELED), ScriptTransfer(i.caller, amount, unit)] | |
288 | 318 | } | |
289 | 319 | ||
290 | 320 | ||
291 | 321 | ||
292 | 322 | @Callable(i) | |
293 | 323 | func sellBond () = if (isBlocked) | |
294 | 324 | then throw("contract is blocked by EMERGENCY SHUTDOWN actions until reactivation by emergency oracles") | |
295 | 325 | else if ((firstOrder == "")) | |
296 | 326 | then throw("empty orderbook") | |
297 | 327 | else { | |
298 | 328 | let nextOrder = getNextOrder(firstOrder) | |
299 | 329 | let filledTotal = getOrderFilledTotal(firstOrder) | |
300 | 330 | let orderPrice = getOrderPrice(firstOrder) | |
301 | 331 | let roi = getNumberByKey(getRoiByOrderIdKey(firstOrder)) | |
302 | 332 | let paymentWavelets = getOrderTotal(firstOrder) | |
303 | 333 | let orderOwnerAddress = Address(fromBase58String(getOrderOwner(firstOrder))) | |
304 | - | internalSellBond( | |
334 | + | internalSellBond(firstOrder, nextOrder, filledTotal, roi, orderPrice, paymentWavelets, orderOwnerAddress, false) | |
305 | 335 | } | |
306 | - | ||
307 | - | ||
308 | - | ||
309 | - | @Callable(i) | |
310 | - | func updateReservesAndNeutrinoSupply () = { | |
311 | - | func getNumberByKeyInternal (key) = match getInteger(this, key) { | |
312 | - | case a: Int => | |
313 | - | a | |
314 | - | case _ => | |
315 | - | 0 | |
316 | - | } | |
317 | - | ||
318 | - | let idx = getNumberByKeyInternal("updateReservesAndNeutrinoSupplyIdx") | |
319 | - | let newIdx = (idx + 1) | |
320 | - | WriteSet([DataEntry("updateReservesAndNeutrinoSupplyIdx", newIdx), DataEntry("reserve", reserve), DataEntry("neutrinoSupply", neutrinoSupply), DataEntry("deficit", deficit)]) | |
321 | - | } | |
322 | 336 | ||
323 | 337 | ||
324 | 338 | @Verifier(tx) | |
325 | 339 | func verify () = { | |
326 | 340 | let pubKeyAdminsList = ["GXxmZaCigPgJsT6d1cLr8nUXA65nGX8V7FuAzzrY8wQE", "3xumx4hrPpeeoo79HLGbZCgfz95L39ZFdxxwWeSUC2Pu", "D4CqtK5fBsnzRo33ZMhrM7niLseDH2uRoK6weBq2JQ3A", "5WRXFSjwcTbNfKcJs8ZqXmSSWYsSVJUtMvMqZj5hH4Nc"] | |
327 | 341 | let count = ((((if (sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(pubKeyAdminsList[0]))) | |
328 | 342 | then 1 | |
329 | 343 | else 0) + (if (sigVerify(tx.bodyBytes, tx.proofs[1], fromBase58String(pubKeyAdminsList[1]))) | |
330 | 344 | then 1 | |
331 | 345 | else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[2], fromBase58String(pubKeyAdminsList[2]))) | |
332 | 346 | then 1 | |
333 | 347 | else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[3], fromBase58String(pubKeyAdminsList[3]))) | |
334 | 348 | then 2 | |
335 | 349 | else 0)) | |
336 | 350 | (count >= 3) | |
337 | 351 | } | |
338 | 352 |
github/deemru/w8io/169f3d6 71.01 ms ◑