tx · Er48URK6xZ8SZK2657Gw37FNVN1WN4Ptgk2up7Jk7HNa 3MxbR7b3gHF4XdQKNTT5aQMRiazHvrVWC8N: -0.02000000 Waves 2021.01.13 18:48 [1351877] smart account 3MxbR7b3gHF4XdQKNTT5aQMRiazHvrVWC8N > SELF 0.00000000 Waves
{ "type": 13, "id": "Er48URK6xZ8SZK2657Gw37FNVN1WN4Ptgk2up7Jk7HNa", "fee": 2000000, "feeAssetId": null, "timestamp": 1610552937389, "version": 1, "sender": "3MxbR7b3gHF4XdQKNTT5aQMRiazHvrVWC8N", "senderPublicKey": "4bj7YXaphTC4Ldx7DqqMmrTjNshRtw1yNsej2XXZcAzS", "proofs": [ "3ZuWtwg85kVgCBnCAwfcRQUozhDV5DcxRMEAicFmKFxz4azW6y3anvBAxcSoCVxffttA13LRaPwDcRj4mS9FJNro", "3EgNfW1edN5vpZwy1tViCvQnG6piNUgH8UhpFqpp7Wxwai3JQ5zy4f8WZEugA2Py1WVE4Fnc4nHucFT5997Y5Zn4", "59G1RzXA9Tg7nyD3GUWAG2yDVy6tpAWCr2s77msVw3frDTGE3gJofi7gKGtxG6buX4fhns949UzLo2fgrvfEQzos" ], "script": "base64:AAIEAAAAAAAAABgIAhIAEgASAwoBARIECgIBCBIDCgEIEgAAAABPAQAAAA5nZXROdW1iZXJCeUtleQAAAAEAAAADa2V5CQEAAAALdmFsdWVPckVsc2UAAAACCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQAAAAAAAAAAAAEAAAAOZ2V0U3RyaW5nQnlLZXkAAAABAAAAA2tleQkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkABB0AAAACBQAAAAR0aGlzBQAAAANrZXkCAAAAAAEAAAAWZ2V0Qm9vbEJ5QWRkcmVzc0FuZEtleQAAAAIAAAAHYWRkcmVzcwAAAANrZXkJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAAQbAAAAAgUAAAAHYWRkcmVzcwUAAAADa2V5BwEAAAAYZ2V0U3RyaW5nQ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AAAwkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAEJAAJZAAAAAQkAAZEAAAACBQAAABBwdWJLZXlBZG1pbnNMaXN0AAAAAAAAAAABAAAAAAAAAAABAAAAAAAAAAAAAwkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAIJAAJZAAAAAQkAAZEAAAACBQAAABBwdWJLZXlBZG1pbnNMaXN0AAAAAAAAAAACAAAAAAAAAAABAAAAAAAAAAAAAwkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAMJAAJZAAAAAQkAAZEAAAACBQAAABBwdWJLZXlBZG1pbnNMaXN0AAAAAAAAAAADAAAAAAAAAAACAAAAAAAAAAAACQAAZwAAAAIFAAAABWNvdW50AAAAAAAAAAADV9HOFg==", "chainId": 84, "height": 1351877, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CMZRDuE8nV6x3S1DPMn2VF8oYNFuyvRwY7USwytKyZdy Next: 7ib7q42TFXW558nKYQh6sBRzhboEFcXwPij2wocAhD61 Diff:
Old | New | Differences | |
---|---|---|---|
121 | 121 | ||
122 | 122 | let firstOrder = getStringByKey(FirstOrderKey) | |
123 | 123 | ||
124 | + | let issuedNsbt = valueOrElse(getInteger(this, "tmp_issuedNsbt_2"), 0) | |
125 | + | ||
126 | + | let nsbtMax = ((2850 * 1000) * PAULI) | |
127 | + | ||
128 | + | let nsbtCurrent = (((1850 * 1000) * PAULI) + issuedNsbt) | |
129 | + | ||
124 | 130 | func getOrderPrice (id) = getNumberByKey(getOrderPriceKey(id)) | |
125 | 131 | ||
126 | 132 | ||
236 | 242 | } | |
237 | 243 | ||
238 | 244 | ||
239 | - | func curveFunction (wRaw,uRaw,price,mRaw,sRaw,wavesPayRaw) = { | |
245 | + | let IdxA = 0 | |
246 | + | ||
247 | + | let IdxPaulB = 1 | |
248 | + | ||
249 | + | let IdxWResAsUsdn = 2 | |
250 | + | ||
251 | + | let IdxMultBR = 3 | |
252 | + | ||
253 | + | let IdxMultPower = 4 | |
254 | + | ||
255 | + | let IdxMultExpInPower = 5 | |
256 | + | ||
257 | + | let IdxMultK = 6 | |
258 | + | ||
259 | + | func calculateK (wRaw,uRaw,price,mRaw,sRaw) = { | |
240 | 260 | let EXP = 271828100 | |
241 | 261 | let a = valueOrElse(getInteger(this, "nsbtCurveParam_a"), 3) | |
242 | 262 | let paulB = valueOrElse(getInteger(this, "nsbtCurveParam_b"), ((3 * PAULI) / 10)) | |
245 | 265 | let multPower = (a * (multBR - (1 * MULT))) | |
246 | 266 | let multExpInPower = pow(EXP, MULTSCALE, multPower, MULTSCALE, MULTSCALE, DOWN) | |
247 | 267 | let multK = fraction(paulB, multExpInPower, PAULI) | |
268 | + | [a, paulB, wReservesInUsdn, multBR, multPower, multExpInPower, multK] | |
269 | + | } | |
270 | + | ||
271 | + | ||
272 | + | func curveFunction (wRaw,uRaw,price,mRaw,sRaw,wavesPayRaw) = { | |
273 | + | let kCalcArray = calculateK(wRaw, uRaw, price, mRaw, sRaw) | |
274 | + | let multK = kCalcArray[IdxMultK] | |
248 | 275 | let usdnPay = convertWavesToNeutrino(wavesPayRaw, price) | |
249 | 276 | let multStepM1 = fraction(multK, mRaw, PAULI) | |
250 | 277 | let multStep2 = fraction(multStepM1, PAULI, (mRaw - sRaw)) | |
252 | 279 | let multStep4 = fraction(multStepM1, MULT, multStepM3) | |
253 | 280 | let stepM5 = fraction(multStep4, mRaw, MULT) | |
254 | 281 | let nsbtAmountRaw = ((mRaw - sRaw) - stepM5) | |
255 | - | [nsbtAmountRaw, usdnPay, wRaw, uRaw, mRaw, sRaw, | |
282 | + | [nsbtAmountRaw, usdnPay, wRaw, uRaw, mRaw, sRaw, kCalcArray[IdxA], kCalcArray[IdxPaulB], kCalcArray[IdxWResAsUsdn], price, kCalcArray[IdxMultBR], kCalcArray[IdxMultPower], kCalcArray[IdxMultExpInPower], multK, multStepM1, multStep2, multStepM3, multStep4, stepM5] | |
256 | 283 | } | |
257 | 284 | ||
258 | 285 | ||
312 | 339 | else false | |
313 | 340 | ||
314 | 341 | ||
342 | + | func privateNsbtPriceREST () = { | |
343 | + | let kCalcArray = calculateK(reserve, neutrinoSupply, currentPrice, nsbtMax, nsbtCurrent) | |
344 | + | let multK = kCalcArray[IdxMultK] | |
345 | + | let multStep1 = fraction(nsbtMax, MULT, (nsbtMax - nsbtCurrent)) | |
346 | + | let multStep2 = fraction(multStep1, multStep1, MULT) | |
347 | + | let multNsbt2usdnPrice = fraction(multK, multStep2, MULT) | |
348 | + | let nsbt2usdnPrice = fraction(multNsbt2usdnPrice, PAULI, MULT) | |
349 | + | let nsbt2wavesPrice = fraction(nsbt2usdnPrice, PAULI, currentPrice) | |
350 | + | $Tuple2(IntegerEntry("nsbt2usdnPrice", nsbt2usdnPrice), IntegerEntry("nsbt2wavesPrice", nsbt2wavesPrice)) | |
351 | + | } | |
352 | + | ||
353 | + | ||
354 | + | @Callable(i) | |
355 | + | func nsbtPriceREST () = { | |
356 | + | let nsbtPriceTuple = privateNsbtPriceREST() | |
357 | + | let nsbt2usdnPrice = nsbtPriceTuple._1.value | |
358 | + | let nsbt2wavesPrice = nsbtPriceTuple._2.value | |
359 | + | let restData = makeString(["startNsbtPriceREST", toString(nsbt2usdnPrice), toString(nsbt2wavesPrice), "endNsbtPriceREST"], "__") | |
360 | + | throw(restData) | |
361 | + | } | |
362 | + | ||
363 | + | ||
364 | + | ||
315 | 365 | @Callable(i) | |
316 | 366 | func buyNsbt () = { | |
317 | 367 | let pmt = value(i.payments[0]) | |
325 | 375 | else if (((10 * WAVELET) > pmtAmount)) | |
326 | 376 | then throw("min 10 waves expected") | |
327 | 377 | else { | |
328 | - | let issuedNsbt = valueOrElse(getInteger(this, "tmp_issuedNsbt_2"), 0) | |
329 | - | let nsbtMax = ((2850 * 1000) * PAULI) | |
330 | - | let nsbtCurrent = (((1850 * 1000) * PAULI) + issuedNsbt) | |
331 | 378 | let curveResult = curveFunction(reserve, neutrinoSupply, currentPrice, nsbtMax, nsbtCurrent, wavesPay) | |
332 | 379 | let nsbtAmount = curveResult[0] | |
333 | 380 | let nsbt2WavesPriceRaw = calcNsbt2WavesPriceRaw(wavesPay, nsbtAmount) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func getNumberByKey (key) = valueOrElse(getInteger(this, key), 0) | |
5 | 5 | ||
6 | 6 | ||
7 | 7 | func getStringByKey (key) = valueOrElse(getString(this, key), "") | |
8 | 8 | ||
9 | 9 | ||
10 | 10 | func getBoolByAddressAndKey (address,key) = valueOrElse(getBoolean(address, key), false) | |
11 | 11 | ||
12 | 12 | ||
13 | 13 | func getStringByAddressAndKey (address,key) = valueOrElse(getString(address, key), "") | |
14 | 14 | ||
15 | 15 | ||
16 | 16 | func getNumberByAddressAndKey (address,key) = valueOrElse(getInteger(address, key), 0) | |
17 | 17 | ||
18 | 18 | ||
19 | 19 | let WAVELET = 100000000 | |
20 | 20 | ||
21 | 21 | let PAULI = 1000000 | |
22 | 22 | ||
23 | 23 | let PAULISCALE = 6 | |
24 | 24 | ||
25 | 25 | let PRICELET = 1000000 | |
26 | 26 | ||
27 | 27 | let MULT = 100000000 | |
28 | 28 | ||
29 | 29 | let MULTSCALE = 8 | |
30 | 30 | ||
31 | 31 | let MINORDERTOTAL = (10 * WAVELET) | |
32 | 32 | ||
33 | 33 | let MAXROI = 95 | |
34 | 34 | ||
35 | 35 | let CANCELED = "canceled" | |
36 | 36 | ||
37 | 37 | let NEW = "new" | |
38 | 38 | ||
39 | 39 | let FILLED = "filled" | |
40 | 40 | ||
41 | 41 | let PriceKey = "price" | |
42 | 42 | ||
43 | 43 | let BondAssetIdKey = "bond_asset_id" | |
44 | 44 | ||
45 | 45 | let NeutrinoAssetIdKey = "neutrino_asset_id" | |
46 | 46 | ||
47 | 47 | let BalanceLockedkKey = "balance_lock_" | |
48 | 48 | ||
49 | 49 | let WavesLockedBalanceKey = (BalanceLockedkKey + "waves") | |
50 | 50 | ||
51 | 51 | let NeutrinoLockedBalanceKey = (BalanceLockedkKey + "neutrino") | |
52 | 52 | ||
53 | 53 | let FirstOrderKey = "order_first" | |
54 | 54 | ||
55 | 55 | func getRoiByOrderIdKey (orderId) = ("debug_order_roi_" + orderId) | |
56 | 56 | ||
57 | 57 | ||
58 | 58 | func getOrderPriceKey (orderId) = ("order_price_" + orderId) | |
59 | 59 | ||
60 | 60 | ||
61 | 61 | func getOrderTotalKey (orderId) = ("order_total_" + orderId) | |
62 | 62 | ||
63 | 63 | ||
64 | 64 | func getOrderOwnerKey (orderId) = ("order_owner_" + orderId) | |
65 | 65 | ||
66 | 66 | ||
67 | 67 | func getOrderHeightKey (orderId) = ("order_height_" + orderId) | |
68 | 68 | ||
69 | 69 | ||
70 | 70 | func getOrderStatusKey (orderId) = ("order_status_" + orderId) | |
71 | 71 | ||
72 | 72 | ||
73 | 73 | func getOrderFilledTotalKey (orderId) = ("order_filled_total_" + orderId) | |
74 | 74 | ||
75 | 75 | ||
76 | 76 | func getPrevOrderKey (orderId) = ("order_prev_" + orderId) | |
77 | 77 | ||
78 | 78 | ||
79 | 79 | func getNextOrderKey (orderId) = ("order_next_" + orderId) | |
80 | 80 | ||
81 | 81 | ||
82 | 82 | func convertNeutrinoToWaves (amount,price) = fraction(fraction(amount, PRICELET, price), WAVELET, PAULI) | |
83 | 83 | ||
84 | 84 | ||
85 | 85 | func convertWavesToNeutrino (amount,price) = fraction(fraction(amount, price, PRICELET), PAULI, WAVELET) | |
86 | 86 | ||
87 | 87 | ||
88 | 88 | func convertWavesToBond (amount,price) = convertWavesToNeutrino(amount, price) | |
89 | 89 | ||
90 | 90 | ||
91 | 91 | func convertBondToWaves (amount,price) = convertNeutrinoToWaves(amount, price) | |
92 | 92 | ||
93 | 93 | ||
94 | 94 | let neutrinoContract = Address(base58'3Mzbx34Ex5rRbn39vUHx9kiwh3nneF8S5we') | |
95 | 95 | ||
96 | 96 | let controlContract = Address(base58'3N4NS7d4Jo9a6F14LiFUKKYVdUkkf2eP4Zx') | |
97 | 97 | ||
98 | 98 | let liquidationContract = Address(base58'3N5nmMvMH8o3RPEyCKCaoWahBTYTexnZy62') | |
99 | 99 | ||
100 | 100 | let neutrinoAssetId = base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT' | |
101 | 101 | ||
102 | 102 | let bondAssetId = base58'BGhPYquXSK6UYjnPLEn94gFhetp4Jvf7toekEY4x1VDH' | |
103 | 103 | ||
104 | 104 | let isBlocked = getBoolByAddressAndKey(controlContract, "is_blocked") | |
105 | 105 | ||
106 | 106 | let currentPrice = getNumberByAddressAndKey(controlContract, PriceKey) | |
107 | 107 | ||
108 | 108 | let neutrinoLockedBalance = getNumberByAddressAndKey(neutrinoContract, NeutrinoLockedBalanceKey) | |
109 | 109 | ||
110 | 110 | let reserve = (wavesBalance(neutrinoContract).regular - getNumberByAddressAndKey(neutrinoContract, WavesLockedBalanceKey)) | |
111 | 111 | ||
112 | 112 | let reservesInUsdn = convertWavesToNeutrino(reserve, currentPrice) | |
113 | 113 | ||
114 | 114 | let neutrinoSupply = (((neutrinoLockedBalance + value(assetInfo(neutrinoAssetId)).quantity) - assetBalance(neutrinoContract, neutrinoAssetId)) - assetBalance(liquidationContract, neutrinoAssetId)) | |
115 | 115 | ||
116 | 116 | let deficit = (neutrinoSupply - reservesInUsdn) | |
117 | 117 | ||
118 | 118 | let currentMaxRoi = fraction(deficit, 100, neutrinoSupply) | |
119 | 119 | ||
120 | 120 | let currentBrMult = fraction(reservesInUsdn, MULT, neutrinoSupply) | |
121 | 121 | ||
122 | 122 | let firstOrder = getStringByKey(FirstOrderKey) | |
123 | 123 | ||
124 | + | let issuedNsbt = valueOrElse(getInteger(this, "tmp_issuedNsbt_2"), 0) | |
125 | + | ||
126 | + | let nsbtMax = ((2850 * 1000) * PAULI) | |
127 | + | ||
128 | + | let nsbtCurrent = (((1850 * 1000) * PAULI) + issuedNsbt) | |
129 | + | ||
124 | 130 | func getOrderPrice (id) = getNumberByKey(getOrderPriceKey(id)) | |
125 | 131 | ||
126 | 132 | ||
127 | 133 | func getOrderTotal (id) = getNumberByKey(getOrderTotalKey(id)) | |
128 | 134 | ||
129 | 135 | ||
130 | 136 | func getOrderOwner (id) = getStringByKey(getOrderOwnerKey(id)) | |
131 | 137 | ||
132 | 138 | ||
133 | 139 | func getOrderStatus (id) = getStringByKey(getOrderStatusKey(id)) | |
134 | 140 | ||
135 | 141 | ||
136 | 142 | func getOrderFilledTotal (id) = getNumberByKey(getOrderFilledTotalKey(id)) | |
137 | 143 | ||
138 | 144 | ||
139 | 145 | func getPrevOrder (id) = getStringByKey(getPrevOrderKey(id)) | |
140 | 146 | ||
141 | 147 | ||
142 | 148 | func getNextOrder (id) = getStringByKey(getNextOrderKey(id)) | |
143 | 149 | ||
144 | 150 | ||
145 | 151 | func getPriceForRoi (roiPercents) = fraction((100 + roiPercents), currentPrice, 100) | |
146 | 152 | ||
147 | 153 | ||
148 | 154 | func getReversePrice (price) = ((PRICELET * PRICELET) / price) | |
149 | 155 | ||
150 | 156 | ||
151 | 157 | func calcNsbt2WavesPriceRaw (spentWavesRaw,receivedNsbtRaw) = fraction(spentWavesRaw, (PAULI * PRICELET), receivedNsbtRaw) | |
152 | 158 | ||
153 | 159 | ||
154 | 160 | 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)] | |
155 | 161 | ||
156 | 162 | ||
157 | 163 | func internalSellBond (pFirstOrder,pNextOrder,pFilledTotal,pRoi,pPrice,pPaymentWavelets,orderOwnerAddress,instantOrder) = { | |
158 | 164 | let priceWavesByBondCents = getPriceForRoi(pRoi) | |
159 | 165 | let remainedTotal = (pPaymentWavelets - pFilledTotal) | |
160 | 166 | let fillableOrderAmount = convertWavesToBond(remainedTotal, priceWavesByBondCents) | |
161 | 167 | let totalOrderWaveletesRequired = convertBondToWaves(fillableOrderAmount, priceWavesByBondCents) | |
162 | 168 | let nbTokensSellCondition = (currentMaxRoi >= pRoi) | |
163 | 169 | if (!(nbTokensSellCondition)) | |
164 | 170 | then throw(("innapropriate roi: " + toString(pRoi))) | |
165 | 171 | else if ((totalOrderWaveletesRequired == 0)) | |
166 | 172 | then throw("cannot fill order at the moment") | |
167 | 173 | else { | |
168 | 174 | let changeWavelets = (remainedTotal - totalOrderWaveletesRequired) | |
169 | 175 | let writeSetData = if (instantOrder) | |
170 | 176 | then orderData(pFirstOrder, pPaymentWavelets, (pFilledTotal + totalOrderWaveletesRequired), toBase58String(orderOwnerAddress.bytes), FILLED, pRoi, currentPrice) | |
171 | 177 | else [IntegerEntry(getOrderFilledTotalKey(pFirstOrder), (pFilledTotal + totalOrderWaveletesRequired)), StringEntry(getOrderStatusKey(pFirstOrder), FILLED), StringEntry(getPrevOrderKey(pNextOrder), ""), StringEntry(FirstOrderKey, pNextOrder)] | |
172 | 178 | (writeSetData ++ [ScriptTransfer(orderOwnerAddress, fillableOrderAmount, bondAssetId), ScriptTransfer(neutrinoContract, totalOrderWaveletesRequired, unit), ScriptTransfer(orderOwnerAddress, changeWavelets, unit)]) | |
173 | 179 | } | |
174 | 180 | } | |
175 | 181 | ||
176 | 182 | ||
177 | 183 | func internalAddBuyBondOrder (roi,price,prevOrder,inv,instantOrder) = { | |
178 | 184 | let pmt = value(inv.payments[0]) | |
179 | 185 | let newOrderId = toBase58String(inv.transactionId) | |
180 | 186 | if (isBlocked) | |
181 | 187 | then throw("contract is blocked by EMERGENCY SHUTDOWN actions until reactivation by emergency oracles") | |
182 | 188 | else if ((MINORDERTOTAL > pmt.amount)) | |
183 | 189 | then throw(("min order total equals " + toString(MINORDERTOTAL))) | |
184 | 190 | else if ((roi > MAXROI)) | |
185 | 191 | then throw("max setOrder ROI is 95%") | |
186 | 192 | else if ((0 > roi)) | |
187 | 193 | then throw("can't place order with negative roi") | |
188 | 194 | else if ((roi == 0)) | |
189 | 195 | then throw("roi should not be equal to 0") | |
190 | 196 | else if (isDefined(pmt.assetId)) | |
191 | 197 | then throw("can use waves only") | |
192 | 198 | else if ((getOrderOwner(newOrderId) != "")) | |
193 | 199 | then throw("order exists") | |
194 | 200 | else if (if ((prevOrder != "")) | |
195 | 201 | then (getOrderStatus(prevOrder) != NEW) | |
196 | 202 | else false) | |
197 | 203 | then throw("prev order status is not new") | |
198 | 204 | else { | |
199 | 205 | let isNewOrderAtFirstPosition = (prevOrder == "") | |
200 | 206 | let owner = toString(inv.caller) | |
201 | 207 | let nextOrder = if (isNewOrderAtFirstPosition) | |
202 | 208 | then firstOrder | |
203 | 209 | else getNextOrder(prevOrder) | |
204 | 210 | let nextOrderRoi = getNumberByKey(getRoiByOrderIdKey(nextOrder)) | |
205 | 211 | let isNextOrderError = if (if ((nextOrder != "")) | |
206 | 212 | then (roi >= nextOrderRoi) | |
207 | 213 | else false) | |
208 | 214 | then true | |
209 | 215 | else false | |
210 | 216 | let prevOrderRoi = getNumberByKey(getRoiByOrderIdKey(prevOrder)) | |
211 | 217 | let isPrevOrderError = if (if ((prevOrder != "")) | |
212 | 218 | then (prevOrderRoi > roi) | |
213 | 219 | else false) | |
214 | 220 | then true | |
215 | 221 | else false | |
216 | 222 | if (if (isNextOrderError) | |
217 | 223 | then true | |
218 | 224 | else isPrevOrderError) | |
219 | 225 | then throw(((("invalid order isPrevOrderError:" + toString(isPrevOrderError)) + " isNextOrderError:") + toString(isNextOrderError))) | |
220 | 226 | else if (if (isNewOrderAtFirstPosition) | |
221 | 227 | then (currentMaxRoi >= roi) | |
222 | 228 | else false) | |
223 | 229 | then internalSellBond(newOrderId, nextOrder, 0, roi, price, pmt.amount, inv.caller, true) | |
224 | 230 | else if (instantOrder) | |
225 | 231 | then throw("Instant order couldn't be added into waiting queue") | |
226 | 232 | else ([StringEntry(getPrevOrderKey(newOrderId), prevOrder), StringEntry(getNextOrderKey(newOrderId), nextOrder), StringEntry(getNextOrderKey(prevOrder), if ((prevOrder == "")) | |
227 | 233 | then "" | |
228 | 234 | else newOrderId), StringEntry(getPrevOrderKey(nextOrder), if ((nextOrder == "")) | |
229 | 235 | then "" | |
230 | 236 | else newOrderId), StringEntry(FirstOrderKey, if (if ((firstOrder == "")) | |
231 | 237 | then true | |
232 | 238 | else (firstOrder == nextOrder)) | |
233 | 239 | then newOrderId | |
234 | 240 | else firstOrder)] ++ orderData(newOrderId, pmt.amount, 0, owner, NEW, roi, price)) | |
235 | 241 | } | |
236 | 242 | } | |
237 | 243 | ||
238 | 244 | ||
239 | - | func curveFunction (wRaw,uRaw,price,mRaw,sRaw,wavesPayRaw) = { | |
245 | + | let IdxA = 0 | |
246 | + | ||
247 | + | let IdxPaulB = 1 | |
248 | + | ||
249 | + | let IdxWResAsUsdn = 2 | |
250 | + | ||
251 | + | let IdxMultBR = 3 | |
252 | + | ||
253 | + | let IdxMultPower = 4 | |
254 | + | ||
255 | + | let IdxMultExpInPower = 5 | |
256 | + | ||
257 | + | let IdxMultK = 6 | |
258 | + | ||
259 | + | func calculateK (wRaw,uRaw,price,mRaw,sRaw) = { | |
240 | 260 | let EXP = 271828100 | |
241 | 261 | let a = valueOrElse(getInteger(this, "nsbtCurveParam_a"), 3) | |
242 | 262 | let paulB = valueOrElse(getInteger(this, "nsbtCurveParam_b"), ((3 * PAULI) / 10)) | |
243 | 263 | let wReservesInUsdn = convertWavesToNeutrino(wRaw, price) | |
244 | 264 | let multBR = fraction(wReservesInUsdn, MULT, uRaw) | |
245 | 265 | let multPower = (a * (multBR - (1 * MULT))) | |
246 | 266 | let multExpInPower = pow(EXP, MULTSCALE, multPower, MULTSCALE, MULTSCALE, DOWN) | |
247 | 267 | let multK = fraction(paulB, multExpInPower, PAULI) | |
268 | + | [a, paulB, wReservesInUsdn, multBR, multPower, multExpInPower, multK] | |
269 | + | } | |
270 | + | ||
271 | + | ||
272 | + | func curveFunction (wRaw,uRaw,price,mRaw,sRaw,wavesPayRaw) = { | |
273 | + | let kCalcArray = calculateK(wRaw, uRaw, price, mRaw, sRaw) | |
274 | + | let multK = kCalcArray[IdxMultK] | |
248 | 275 | let usdnPay = convertWavesToNeutrino(wavesPayRaw, price) | |
249 | 276 | let multStepM1 = fraction(multK, mRaw, PAULI) | |
250 | 277 | let multStep2 = fraction(multStepM1, PAULI, (mRaw - sRaw)) | |
251 | 278 | let multStepM3 = (fraction(usdnPay, MULT, PAULI) + fraction(multStep2, mRaw, PAULI)) | |
252 | 279 | let multStep4 = fraction(multStepM1, MULT, multStepM3) | |
253 | 280 | let stepM5 = fraction(multStep4, mRaw, MULT) | |
254 | 281 | let nsbtAmountRaw = ((mRaw - sRaw) - stepM5) | |
255 | - | [nsbtAmountRaw, usdnPay, wRaw, uRaw, mRaw, sRaw, | |
282 | + | [nsbtAmountRaw, usdnPay, wRaw, uRaw, mRaw, sRaw, kCalcArray[IdxA], kCalcArray[IdxPaulB], kCalcArray[IdxWResAsUsdn], price, kCalcArray[IdxMultBR], kCalcArray[IdxMultPower], kCalcArray[IdxMultExpInPower], multK, multStepM1, multStep2, multStepM3, multStep4, stepM5] | |
256 | 283 | } | |
257 | 284 | ||
258 | 285 | ||
259 | 286 | func toStr (name,curveResult) = (((((((((((((((((((((((((((((((((((((((name + "[nsbtAmountRaw=") + toString(curveResult[0])) + " usdnPayment=") + toString(curveResult[1])) + " wRaw=") + toString(curveResult[2])) + " uRaw=") + toString(curveResult[3])) + " mRaw=") + toString(curveResult[4])) + " sRaw=") + toString(curveResult[5])) + " nsbtCurveParam_a=") + toString(curveResult[6])) + " nsbtCurveParam_b=") + toString(curveResult[7])) + " wReservesInUsdn=") + toString(curveResult[8])) + " price=") + toString(curveResult[9])) + " multBR=") + toString(curveResult[10])) + " multPower=") + toString(curveResult[11])) + " multExpInPower=") + toString(curveResult[12])) + " multK=") + toString(curveResult[13])) + " multStepM1=") + toString(curveResult[14])) + " multStep2=") + toString(curveResult[15])) + " multStepM3=") + toString(curveResult[16])) + " multStep4=") + toString(curveResult[17])) + " stepM5=") + toString(curveResult[18])) + "]") | |
260 | 287 | ||
261 | 288 | ||
262 | 289 | func bigComplexity (i) = if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (!(isDefined(transferTransactionById(fromBase58String("PdLw5JK5ppfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))) | |
263 | 290 | then !(isDefined(transferTransactionById(fromBase58String("adLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
264 | 291 | else false) | |
265 | 292 | then !(isDefined(transferTransactionById(fromBase58String("sdLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
266 | 293 | else false) | |
267 | 294 | then !(isDefined(transferTransactionById(fromBase58String("ddLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
268 | 295 | else false) | |
269 | 296 | then !(isDefined(transferTransactionById(fromBase58String("fdLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
270 | 297 | else false) | |
271 | 298 | then !(isDefined(transferTransactionById(fromBase58String("gdLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
272 | 299 | else false) | |
273 | 300 | then !(isDefined(transferTransactionById(fromBase58String("hdLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
274 | 301 | else false) | |
275 | 302 | then !(isDefined(transferTransactionById(fromBase58String("jdLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
276 | 303 | else false) | |
277 | 304 | then !(isDefined(transferTransactionById(fromBase58String("kdLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
278 | 305 | else false) | |
279 | 306 | then !(isDefined(transferTransactionById(fromBase58String("rdLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
280 | 307 | else false) | |
281 | 308 | then !(isDefined(transferTransactionById(fromBase58String("tdLq5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
282 | 309 | else false) | |
283 | 310 | then !(isDefined(transferTransactionById(fromBase58String("tdLy5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
284 | 311 | else false) | |
285 | 312 | then !(isDefined(transferTransactionById(fromBase58String("tdLu5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
286 | 313 | else false) | |
287 | 314 | then !(isDefined(transferTransactionById(fromBase58String("tdLh5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
288 | 315 | else false) | |
289 | 316 | then !(isDefined(transferTransactionById(fromBase58String("1dL4JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
290 | 317 | else false) | |
291 | 318 | then !(isDefined(transferTransactionById(fromBase58String("2dL25JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
292 | 319 | else false) | |
293 | 320 | then !(isDefined(transferTransactionById(fromBase58String("3dL95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
294 | 321 | else false) | |
295 | 322 | then !(isDefined(transferTransactionById(fromBase58String("4dL95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
296 | 323 | else false) | |
297 | 324 | then !(isDefined(transferTransactionById(fromBase58String("5dL95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
298 | 325 | else false) | |
299 | 326 | then !(isDefined(transferTransactionById(fromBase58String("6dL95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
300 | 327 | else false) | |
301 | 328 | then !(isDefined(transferTransactionById(fromBase58String("7dL95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
302 | 329 | else false) | |
303 | 330 | then !(isDefined(transferTransactionById(fromBase58String("8dL95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
304 | 331 | else false) | |
305 | 332 | then !(isDefined(transferTransactionById(fromBase58String("91L95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
306 | 333 | else false) | |
307 | 334 | then !(isDefined(transferTransactionById(fromBase58String("92L95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
308 | 335 | else false) | |
309 | 336 | then !(isDefined(transferTransactionById(fromBase58String("93L95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
310 | 337 | else false) | |
311 | 338 | then !(isDefined(transferTransactionById(fromBase58String("94L95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
312 | 339 | else false | |
313 | 340 | ||
314 | 341 | ||
342 | + | func privateNsbtPriceREST () = { | |
343 | + | let kCalcArray = calculateK(reserve, neutrinoSupply, currentPrice, nsbtMax, nsbtCurrent) | |
344 | + | let multK = kCalcArray[IdxMultK] | |
345 | + | let multStep1 = fraction(nsbtMax, MULT, (nsbtMax - nsbtCurrent)) | |
346 | + | let multStep2 = fraction(multStep1, multStep1, MULT) | |
347 | + | let multNsbt2usdnPrice = fraction(multK, multStep2, MULT) | |
348 | + | let nsbt2usdnPrice = fraction(multNsbt2usdnPrice, PAULI, MULT) | |
349 | + | let nsbt2wavesPrice = fraction(nsbt2usdnPrice, PAULI, currentPrice) | |
350 | + | $Tuple2(IntegerEntry("nsbt2usdnPrice", nsbt2usdnPrice), IntegerEntry("nsbt2wavesPrice", nsbt2wavesPrice)) | |
351 | + | } | |
352 | + | ||
353 | + | ||
354 | + | @Callable(i) | |
355 | + | func nsbtPriceREST () = { | |
356 | + | let nsbtPriceTuple = privateNsbtPriceREST() | |
357 | + | let nsbt2usdnPrice = nsbtPriceTuple._1.value | |
358 | + | let nsbt2wavesPrice = nsbtPriceTuple._2.value | |
359 | + | let restData = makeString(["startNsbtPriceREST", toString(nsbt2usdnPrice), toString(nsbt2wavesPrice), "endNsbtPriceREST"], "__") | |
360 | + | throw(restData) | |
361 | + | } | |
362 | + | ||
363 | + | ||
364 | + | ||
315 | 365 | @Callable(i) | |
316 | 366 | func buyNsbt () = { | |
317 | 367 | let pmt = value(i.payments[0]) | |
318 | 368 | let pmtAmount = pmt.amount | |
319 | 369 | let wavesPay = pmtAmount | |
320 | 370 | let ownerAddress = i.caller | |
321 | 371 | if (isBlocked) | |
322 | 372 | then throw("contract is blocked by EMERGENCY SHUTDOWN actions until reactivation by emergency oracles") | |
323 | 373 | else if (isDefined(pmt.assetId)) | |
324 | 374 | then throw("can use waves only") | |
325 | 375 | else if (((10 * WAVELET) > pmtAmount)) | |
326 | 376 | then throw("min 10 waves expected") | |
327 | 377 | else { | |
328 | - | let issuedNsbt = valueOrElse(getInteger(this, "tmp_issuedNsbt_2"), 0) | |
329 | - | let nsbtMax = ((2850 * 1000) * PAULI) | |
330 | - | let nsbtCurrent = (((1850 * 1000) * PAULI) + issuedNsbt) | |
331 | 378 | let curveResult = curveFunction(reserve, neutrinoSupply, currentPrice, nsbtMax, nsbtCurrent, wavesPay) | |
332 | 379 | let nsbtAmount = curveResult[0] | |
333 | 380 | let nsbt2WavesPriceRaw = calcNsbt2WavesPriceRaw(wavesPay, nsbtAmount) | |
334 | 381 | let roi = (fraction(getReversePrice(nsbt2WavesPriceRaw), 100, currentPrice) - 100) | |
335 | 382 | (orderData(toBase58String(i.transactionId), pmtAmount, pmtAmount, toString(ownerAddress), FILLED, roi, nsbt2WavesPriceRaw) ++ [ScriptTransfer(ownerAddress, nsbtAmount, bondAssetId), ScriptTransfer(neutrinoContract, wavesPay, unit), StringEntry("debug_curveResult", toStr("curveResult", curveResult)), IntegerEntry("tmp_issuedNsbt_2", (issuedNsbt + nsbtAmount))]) | |
336 | 383 | } | |
337 | 384 | } | |
338 | 385 | ||
339 | 386 | ||
340 | 387 | ||
341 | 388 | @Callable(i) | |
342 | 389 | func instantBuyNsbtOrFail (noLessThenRoi) = { | |
343 | 390 | let pmt = value(i.payments[0]) | |
344 | 391 | let roi = currentMaxRoi | |
345 | 392 | if ((noLessThenRoi > roi)) | |
346 | 393 | then throw(((("Current maxRoi=" + toString(roi)) + " is less then passed parameter noLessThenRoi=") + toString(noLessThenRoi))) | |
347 | 394 | else { | |
348 | 395 | let priceWavesByBondCents = getPriceForRoi(roi) | |
349 | 396 | internalAddBuyBondOrder(roi, getReversePrice(priceWavesByBondCents), "", i, true) | |
350 | 397 | } | |
351 | 398 | } | |
352 | 399 | ||
353 | 400 | ||
354 | 401 | ||
355 | 402 | @Callable(i) | |
356 | 403 | func addBuyBondOrder (price,prevOrder) = { | |
357 | 404 | let pmt = value(i.payments[0]) | |
358 | 405 | let priceWavesByBondCents = getReversePrice(price) | |
359 | 406 | if ((0 >= price)) | |
360 | 407 | then throw("price less zero") | |
361 | 408 | else internalAddBuyBondOrder(fraction((priceWavesByBondCents - currentPrice), 100, currentPrice), price, prevOrder, i, false) | |
362 | 409 | } | |
363 | 410 | ||
364 | 411 | ||
365 | 412 | ||
366 | 413 | @Callable(i) | |
367 | 414 | func cancelOrder (orderId) = { | |
368 | 415 | let owner = getOrderOwner(orderId) | |
369 | 416 | let amount = (getOrderTotal(orderId) - getOrderFilledTotal(orderId)) | |
370 | 417 | let caller = toString(i.caller) | |
371 | 418 | let nextOrder = getNextOrder(orderId) | |
372 | 419 | let prevOrder = getPrevOrder(orderId) | |
373 | 420 | if (isBlocked) | |
374 | 421 | then throw("contract is blocked by EMERGENCY SHUTDOWN actions until reactivation by emergency oracles") | |
375 | 422 | else if ((owner != caller)) | |
376 | 423 | then throw("permission denied") | |
377 | 424 | else if ((getOrderStatus(orderId) != NEW)) | |
378 | 425 | then throw("invalid order status") | |
379 | 426 | else [StringEntry(FirstOrderKey, if ((firstOrder == orderId)) | |
380 | 427 | then nextOrder | |
381 | 428 | else firstOrder), StringEntry(getNextOrderKey(prevOrder), nextOrder), StringEntry(getPrevOrderKey(nextOrder), prevOrder), StringEntry(getOrderStatusKey(orderId), CANCELED), ScriptTransfer(i.caller, amount, unit)] | |
382 | 429 | } | |
383 | 430 | ||
384 | 431 | ||
385 | 432 | ||
386 | 433 | @Callable(i) | |
387 | 434 | func sellBond () = if (isBlocked) | |
388 | 435 | then throw("contract is blocked by EMERGENCY SHUTDOWN actions until reactivation by emergency oracles") | |
389 | 436 | else if ((firstOrder == "")) | |
390 | 437 | then throw("empty orderbook") | |
391 | 438 | else { | |
392 | 439 | let nextOrder = getNextOrder(firstOrder) | |
393 | 440 | let filledTotal = getOrderFilledTotal(firstOrder) | |
394 | 441 | let orderPrice = getOrderPrice(firstOrder) | |
395 | 442 | let roi = getNumberByKey(getRoiByOrderIdKey(firstOrder)) | |
396 | 443 | let paymentWavelets = getOrderTotal(firstOrder) | |
397 | 444 | let orderOwnerAddress = Address(fromBase58String(getOrderOwner(firstOrder))) | |
398 | 445 | internalSellBond(firstOrder, nextOrder, filledTotal, roi, orderPrice, paymentWavelets, orderOwnerAddress, false) | |
399 | 446 | } | |
400 | 447 | ||
401 | 448 | ||
402 | 449 | @Verifier(tx) | |
403 | 450 | func verify () = { | |
404 | 451 | let pubKeyAdminsList = ["GXxmZaCigPgJsT6d1cLr8nUXA65nGX8V7FuAzzrY8wQE", "3xumx4hrPpeeoo79HLGbZCgfz95L39ZFdxxwWeSUC2Pu", "D4CqtK5fBsnzRo33ZMhrM7niLseDH2uRoK6weBq2JQ3A", "5WRXFSjwcTbNfKcJs8ZqXmSSWYsSVJUtMvMqZj5hH4Nc"] | |
405 | 452 | let count = ((((if (sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(pubKeyAdminsList[0]))) | |
406 | 453 | then 1 | |
407 | 454 | else 0) + (if (sigVerify(tx.bodyBytes, tx.proofs[1], fromBase58String(pubKeyAdminsList[1]))) | |
408 | 455 | then 1 | |
409 | 456 | else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[2], fromBase58String(pubKeyAdminsList[2]))) | |
410 | 457 | then 1 | |
411 | 458 | else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[3], fromBase58String(pubKeyAdminsList[3]))) | |
412 | 459 | then 2 | |
413 | 460 | else 0)) | |
414 | 461 | (count >= 3) | |
415 | 462 | } | |
416 | 463 |
github/deemru/w8io/169f3d6 77.17 ms ◑