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:AAIEAAAAAAAAABgIAhIAEgASAwoBARIECgIBCBIDCgEIEgAAAABPAQAAAA5nZXROdW1iZXJCeUtleQAAAAEAAAADa2V5CQEAAAALdmFsdWVPckVsc2UAAAACCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQAAAAAAAAAAAAEAAAAOZ2V0U3RyaW5nQnlLZXkAAAABAAAAA2tleQkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkABB0AAAACBQAAAAR0aGlzBQAAAANrZXkCAAAAAAEAAAAWZ2V0Qm9vbEJ5QWRkcmVzc0FuZEtleQAAAAIAAAAHYWRkcmVzcwAAAANrZXkJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAAQbAAAAAgUAAAAHYWRkcmVzcwUAAAADa2V5BwEAAAAYZ2V0U3RyaW5n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AAAAwkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAEJAAJZAAAAAQkAAZEAAAACBQAAABBwdWJLZXlBZG1pbnNMaXN0AAAAAAAAAAABAAAAAAAAAAABAAAAAAAAAAAAAwkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAIJAAJZAAAAAQkAAZEAAAACBQAAABBwdWJLZXlBZG1pbnNMaXN0AAAAAAAAAAACAAAAAAAAAAABAAAAAAAAAAAAAwkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAMJAAJZAAAAAQkAAZEAAAACBQAAABBwdWJLZXlBZG1pbnNMaXN0AAAAAAAAAAADAAAAAAAAAAACAAAAAAAAAAAACQAAZwAAAAIFAAAABWNvdW50AAAAAAAAAAADV9HOFg==", "chainId": 84, "height": 1351877, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CMZRDuE8nV6x3S1DPMn2VF8oYNFuyvRwY7USwytKyZdy Next: 7ib7q42TFXW558nKYQh6sBRzhboEFcXwPij2wocAhD61 Diff:
OldNewDifferences
121121
122122 let firstOrder = getStringByKey(FirstOrderKey)
123123
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+
124130 func getOrderPrice (id) = getNumberByKey(getOrderPriceKey(id))
125131
126132
236242 }
237243
238244
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) = {
240260 let EXP = 271828100
241261 let a = valueOrElse(getInteger(this, "nsbtCurveParam_a"), 3)
242262 let paulB = valueOrElse(getInteger(this, "nsbtCurveParam_b"), ((3 * PAULI) / 10))
245265 let multPower = (a * (multBR - (1 * MULT)))
246266 let multExpInPower = pow(EXP, MULTSCALE, multPower, MULTSCALE, MULTSCALE, DOWN)
247267 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]
248275 let usdnPay = convertWavesToNeutrino(wavesPayRaw, price)
249276 let multStepM1 = fraction(multK, mRaw, PAULI)
250277 let multStep2 = fraction(multStepM1, PAULI, (mRaw - sRaw))
252279 let multStep4 = fraction(multStepM1, MULT, multStepM3)
253280 let stepM5 = fraction(multStep4, mRaw, MULT)
254281 let nsbtAmountRaw = ((mRaw - sRaw) - stepM5)
255-[nsbtAmountRaw, usdnPay, wRaw, uRaw, mRaw, sRaw, a, paulB, wReservesInUsdn, price, multBR, multPower, multExpInPower, multK, multStepM1, multStep2, multStepM3, multStep4, stepM5]
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]
256283 }
257284
258285
312339 else false
313340
314341
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+
315365 @Callable(i)
316366 func buyNsbt () = {
317367 let pmt = value(i.payments[0])
325375 else if (((10 * WAVELET) > pmtAmount))
326376 then throw("min 10 waves expected")
327377 else {
328- let issuedNsbt = valueOrElse(getInteger(this, "tmp_issuedNsbt_2"), 0)
329- let nsbtMax = ((2850 * 1000) * PAULI)
330- let nsbtCurrent = (((1850 * 1000) * PAULI) + issuedNsbt)
331378 let curveResult = curveFunction(reserve, neutrinoSupply, currentPrice, nsbtMax, nsbtCurrent, wavesPay)
332379 let nsbtAmount = curveResult[0]
333380 let nsbt2WavesPriceRaw = calcNsbt2WavesPriceRaw(wavesPay, nsbtAmount)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 4 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 func getNumberByKey (key) = valueOrElse(getInteger(this, key), 0)
55
66
77 func getStringByKey (key) = valueOrElse(getString(this, key), "")
88
99
1010 func getBoolByAddressAndKey (address,key) = valueOrElse(getBoolean(address, key), false)
1111
1212
1313 func getStringByAddressAndKey (address,key) = valueOrElse(getString(address, key), "")
1414
1515
1616 func getNumberByAddressAndKey (address,key) = valueOrElse(getInteger(address, key), 0)
1717
1818
1919 let WAVELET = 100000000
2020
2121 let PAULI = 1000000
2222
2323 let PAULISCALE = 6
2424
2525 let PRICELET = 1000000
2626
2727 let MULT = 100000000
2828
2929 let MULTSCALE = 8
3030
3131 let MINORDERTOTAL = (10 * WAVELET)
3232
3333 let MAXROI = 95
3434
3535 let CANCELED = "canceled"
3636
3737 let NEW = "new"
3838
3939 let FILLED = "filled"
4040
4141 let PriceKey = "price"
4242
4343 let BondAssetIdKey = "bond_asset_id"
4444
4545 let NeutrinoAssetIdKey = "neutrino_asset_id"
4646
4747 let BalanceLockedkKey = "balance_lock_"
4848
4949 let WavesLockedBalanceKey = (BalanceLockedkKey + "waves")
5050
5151 let NeutrinoLockedBalanceKey = (BalanceLockedkKey + "neutrino")
5252
5353 let FirstOrderKey = "order_first"
5454
5555 func getRoiByOrderIdKey (orderId) = ("debug_order_roi_" + orderId)
5656
5757
5858 func getOrderPriceKey (orderId) = ("order_price_" + orderId)
5959
6060
6161 func getOrderTotalKey (orderId) = ("order_total_" + orderId)
6262
6363
6464 func getOrderOwnerKey (orderId) = ("order_owner_" + orderId)
6565
6666
6767 func getOrderHeightKey (orderId) = ("order_height_" + orderId)
6868
6969
7070 func getOrderStatusKey (orderId) = ("order_status_" + orderId)
7171
7272
7373 func getOrderFilledTotalKey (orderId) = ("order_filled_total_" + orderId)
7474
7575
7676 func getPrevOrderKey (orderId) = ("order_prev_" + orderId)
7777
7878
7979 func getNextOrderKey (orderId) = ("order_next_" + orderId)
8080
8181
8282 func convertNeutrinoToWaves (amount,price) = fraction(fraction(amount, PRICELET, price), WAVELET, PAULI)
8383
8484
8585 func convertWavesToNeutrino (amount,price) = fraction(fraction(amount, price, PRICELET), PAULI, WAVELET)
8686
8787
8888 func convertWavesToBond (amount,price) = convertWavesToNeutrino(amount, price)
8989
9090
9191 func convertBondToWaves (amount,price) = convertNeutrinoToWaves(amount, price)
9292
9393
9494 let neutrinoContract = Address(base58'3Mzbx34Ex5rRbn39vUHx9kiwh3nneF8S5we')
9595
9696 let controlContract = Address(base58'3N4NS7d4Jo9a6F14LiFUKKYVdUkkf2eP4Zx')
9797
9898 let liquidationContract = Address(base58'3N5nmMvMH8o3RPEyCKCaoWahBTYTexnZy62')
9999
100100 let neutrinoAssetId = base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT'
101101
102102 let bondAssetId = base58'BGhPYquXSK6UYjnPLEn94gFhetp4Jvf7toekEY4x1VDH'
103103
104104 let isBlocked = getBoolByAddressAndKey(controlContract, "is_blocked")
105105
106106 let currentPrice = getNumberByAddressAndKey(controlContract, PriceKey)
107107
108108 let neutrinoLockedBalance = getNumberByAddressAndKey(neutrinoContract, NeutrinoLockedBalanceKey)
109109
110110 let reserve = (wavesBalance(neutrinoContract).regular - getNumberByAddressAndKey(neutrinoContract, WavesLockedBalanceKey))
111111
112112 let reservesInUsdn = convertWavesToNeutrino(reserve, currentPrice)
113113
114114 let neutrinoSupply = (((neutrinoLockedBalance + value(assetInfo(neutrinoAssetId)).quantity) - assetBalance(neutrinoContract, neutrinoAssetId)) - assetBalance(liquidationContract, neutrinoAssetId))
115115
116116 let deficit = (neutrinoSupply - reservesInUsdn)
117117
118118 let currentMaxRoi = fraction(deficit, 100, neutrinoSupply)
119119
120120 let currentBrMult = fraction(reservesInUsdn, MULT, neutrinoSupply)
121121
122122 let firstOrder = getStringByKey(FirstOrderKey)
123123
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+
124130 func getOrderPrice (id) = getNumberByKey(getOrderPriceKey(id))
125131
126132
127133 func getOrderTotal (id) = getNumberByKey(getOrderTotalKey(id))
128134
129135
130136 func getOrderOwner (id) = getStringByKey(getOrderOwnerKey(id))
131137
132138
133139 func getOrderStatus (id) = getStringByKey(getOrderStatusKey(id))
134140
135141
136142 func getOrderFilledTotal (id) = getNumberByKey(getOrderFilledTotalKey(id))
137143
138144
139145 func getPrevOrder (id) = getStringByKey(getPrevOrderKey(id))
140146
141147
142148 func getNextOrder (id) = getStringByKey(getNextOrderKey(id))
143149
144150
145151 func getPriceForRoi (roiPercents) = fraction((100 + roiPercents), currentPrice, 100)
146152
147153
148154 func getReversePrice (price) = ((PRICELET * PRICELET) / price)
149155
150156
151157 func calcNsbt2WavesPriceRaw (spentWavesRaw,receivedNsbtRaw) = fraction(spentWavesRaw, (PAULI * PRICELET), receivedNsbtRaw)
152158
153159
154160 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)]
155161
156162
157163 func internalSellBond (pFirstOrder,pNextOrder,pFilledTotal,pRoi,pPrice,pPaymentWavelets,orderOwnerAddress,instantOrder) = {
158164 let priceWavesByBondCents = getPriceForRoi(pRoi)
159165 let remainedTotal = (pPaymentWavelets - pFilledTotal)
160166 let fillableOrderAmount = convertWavesToBond(remainedTotal, priceWavesByBondCents)
161167 let totalOrderWaveletesRequired = convertBondToWaves(fillableOrderAmount, priceWavesByBondCents)
162168 let nbTokensSellCondition = (currentMaxRoi >= pRoi)
163169 if (!(nbTokensSellCondition))
164170 then throw(("innapropriate roi: " + toString(pRoi)))
165171 else if ((totalOrderWaveletesRequired == 0))
166172 then throw("cannot fill order at the moment")
167173 else {
168174 let changeWavelets = (remainedTotal - totalOrderWaveletesRequired)
169175 let writeSetData = if (instantOrder)
170176 then orderData(pFirstOrder, pPaymentWavelets, (pFilledTotal + totalOrderWaveletesRequired), toBase58String(orderOwnerAddress.bytes), FILLED, pRoi, currentPrice)
171177 else [IntegerEntry(getOrderFilledTotalKey(pFirstOrder), (pFilledTotal + totalOrderWaveletesRequired)), StringEntry(getOrderStatusKey(pFirstOrder), FILLED), StringEntry(getPrevOrderKey(pNextOrder), ""), StringEntry(FirstOrderKey, pNextOrder)]
172178 (writeSetData ++ [ScriptTransfer(orderOwnerAddress, fillableOrderAmount, bondAssetId), ScriptTransfer(neutrinoContract, totalOrderWaveletesRequired, unit), ScriptTransfer(orderOwnerAddress, changeWavelets, unit)])
173179 }
174180 }
175181
176182
177183 func internalAddBuyBondOrder (roi,price,prevOrder,inv,instantOrder) = {
178184 let pmt = value(inv.payments[0])
179185 let newOrderId = toBase58String(inv.transactionId)
180186 if (isBlocked)
181187 then throw("contract is blocked by EMERGENCY SHUTDOWN actions until reactivation by emergency oracles")
182188 else if ((MINORDERTOTAL > pmt.amount))
183189 then throw(("min order total equals " + toString(MINORDERTOTAL)))
184190 else if ((roi > MAXROI))
185191 then throw("max setOrder ROI is 95%")
186192 else if ((0 > roi))
187193 then throw("can't place order with negative roi")
188194 else if ((roi == 0))
189195 then throw("roi should not be equal to 0")
190196 else if (isDefined(pmt.assetId))
191197 then throw("can use waves only")
192198 else if ((getOrderOwner(newOrderId) != ""))
193199 then throw("order exists")
194200 else if (if ((prevOrder != ""))
195201 then (getOrderStatus(prevOrder) != NEW)
196202 else false)
197203 then throw("prev order status is not new")
198204 else {
199205 let isNewOrderAtFirstPosition = (prevOrder == "")
200206 let owner = toString(inv.caller)
201207 let nextOrder = if (isNewOrderAtFirstPosition)
202208 then firstOrder
203209 else getNextOrder(prevOrder)
204210 let nextOrderRoi = getNumberByKey(getRoiByOrderIdKey(nextOrder))
205211 let isNextOrderError = if (if ((nextOrder != ""))
206212 then (roi >= nextOrderRoi)
207213 else false)
208214 then true
209215 else false
210216 let prevOrderRoi = getNumberByKey(getRoiByOrderIdKey(prevOrder))
211217 let isPrevOrderError = if (if ((prevOrder != ""))
212218 then (prevOrderRoi > roi)
213219 else false)
214220 then true
215221 else false
216222 if (if (isNextOrderError)
217223 then true
218224 else isPrevOrderError)
219225 then throw(((("invalid order isPrevOrderError:" + toString(isPrevOrderError)) + " isNextOrderError:") + toString(isNextOrderError)))
220226 else if (if (isNewOrderAtFirstPosition)
221227 then (currentMaxRoi >= roi)
222228 else false)
223229 then internalSellBond(newOrderId, nextOrder, 0, roi, price, pmt.amount, inv.caller, true)
224230 else if (instantOrder)
225231 then throw("Instant order couldn't be added into waiting queue")
226232 else ([StringEntry(getPrevOrderKey(newOrderId), prevOrder), StringEntry(getNextOrderKey(newOrderId), nextOrder), StringEntry(getNextOrderKey(prevOrder), if ((prevOrder == ""))
227233 then ""
228234 else newOrderId), StringEntry(getPrevOrderKey(nextOrder), if ((nextOrder == ""))
229235 then ""
230236 else newOrderId), StringEntry(FirstOrderKey, if (if ((firstOrder == ""))
231237 then true
232238 else (firstOrder == nextOrder))
233239 then newOrderId
234240 else firstOrder)] ++ orderData(newOrderId, pmt.amount, 0, owner, NEW, roi, price))
235241 }
236242 }
237243
238244
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) = {
240260 let EXP = 271828100
241261 let a = valueOrElse(getInteger(this, "nsbtCurveParam_a"), 3)
242262 let paulB = valueOrElse(getInteger(this, "nsbtCurveParam_b"), ((3 * PAULI) / 10))
243263 let wReservesInUsdn = convertWavesToNeutrino(wRaw, price)
244264 let multBR = fraction(wReservesInUsdn, MULT, uRaw)
245265 let multPower = (a * (multBR - (1 * MULT)))
246266 let multExpInPower = pow(EXP, MULTSCALE, multPower, MULTSCALE, MULTSCALE, DOWN)
247267 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]
248275 let usdnPay = convertWavesToNeutrino(wavesPayRaw, price)
249276 let multStepM1 = fraction(multK, mRaw, PAULI)
250277 let multStep2 = fraction(multStepM1, PAULI, (mRaw - sRaw))
251278 let multStepM3 = (fraction(usdnPay, MULT, PAULI) + fraction(multStep2, mRaw, PAULI))
252279 let multStep4 = fraction(multStepM1, MULT, multStepM3)
253280 let stepM5 = fraction(multStep4, mRaw, MULT)
254281 let nsbtAmountRaw = ((mRaw - sRaw) - stepM5)
255-[nsbtAmountRaw, usdnPay, wRaw, uRaw, mRaw, sRaw, a, paulB, wReservesInUsdn, price, multBR, multPower, multExpInPower, multK, multStepM1, multStep2, multStepM3, multStep4, stepM5]
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]
256283 }
257284
258285
259286 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])) + "]")
260287
261288
262289 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")))))
263290 then !(isDefined(transferTransactionById(fromBase58String("adLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
264291 else false)
265292 then !(isDefined(transferTransactionById(fromBase58String("sdLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
266293 else false)
267294 then !(isDefined(transferTransactionById(fromBase58String("ddLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
268295 else false)
269296 then !(isDefined(transferTransactionById(fromBase58String("fdLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
270297 else false)
271298 then !(isDefined(transferTransactionById(fromBase58String("gdLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
272299 else false)
273300 then !(isDefined(transferTransactionById(fromBase58String("hdLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
274301 else false)
275302 then !(isDefined(transferTransactionById(fromBase58String("jdLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
276303 else false)
277304 then !(isDefined(transferTransactionById(fromBase58String("kdLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
278305 else false)
279306 then !(isDefined(transferTransactionById(fromBase58String("rdLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
280307 else false)
281308 then !(isDefined(transferTransactionById(fromBase58String("tdLq5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
282309 else false)
283310 then !(isDefined(transferTransactionById(fromBase58String("tdLy5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
284311 else false)
285312 then !(isDefined(transferTransactionById(fromBase58String("tdLu5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
286313 else false)
287314 then !(isDefined(transferTransactionById(fromBase58String("tdLh5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
288315 else false)
289316 then !(isDefined(transferTransactionById(fromBase58String("1dL4JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
290317 else false)
291318 then !(isDefined(transferTransactionById(fromBase58String("2dL25JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
292319 else false)
293320 then !(isDefined(transferTransactionById(fromBase58String("3dL95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
294321 else false)
295322 then !(isDefined(transferTransactionById(fromBase58String("4dL95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
296323 else false)
297324 then !(isDefined(transferTransactionById(fromBase58String("5dL95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
298325 else false)
299326 then !(isDefined(transferTransactionById(fromBase58String("6dL95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
300327 else false)
301328 then !(isDefined(transferTransactionById(fromBase58String("7dL95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
302329 else false)
303330 then !(isDefined(transferTransactionById(fromBase58String("8dL95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
304331 else false)
305332 then !(isDefined(transferTransactionById(fromBase58String("91L95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
306333 else false)
307334 then !(isDefined(transferTransactionById(fromBase58String("92L95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
308335 else false)
309336 then !(isDefined(transferTransactionById(fromBase58String("93L95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
310337 else false)
311338 then !(isDefined(transferTransactionById(fromBase58String("94L95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
312339 else false
313340
314341
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+
315365 @Callable(i)
316366 func buyNsbt () = {
317367 let pmt = value(i.payments[0])
318368 let pmtAmount = pmt.amount
319369 let wavesPay = pmtAmount
320370 let ownerAddress = i.caller
321371 if (isBlocked)
322372 then throw("contract is blocked by EMERGENCY SHUTDOWN actions until reactivation by emergency oracles")
323373 else if (isDefined(pmt.assetId))
324374 then throw("can use waves only")
325375 else if (((10 * WAVELET) > pmtAmount))
326376 then throw("min 10 waves expected")
327377 else {
328- let issuedNsbt = valueOrElse(getInteger(this, "tmp_issuedNsbt_2"), 0)
329- let nsbtMax = ((2850 * 1000) * PAULI)
330- let nsbtCurrent = (((1850 * 1000) * PAULI) + issuedNsbt)
331378 let curveResult = curveFunction(reserve, neutrinoSupply, currentPrice, nsbtMax, nsbtCurrent, wavesPay)
332379 let nsbtAmount = curveResult[0]
333380 let nsbt2WavesPriceRaw = calcNsbt2WavesPriceRaw(wavesPay, nsbtAmount)
334381 let roi = (fraction(getReversePrice(nsbt2WavesPriceRaw), 100, currentPrice) - 100)
335382 (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))])
336383 }
337384 }
338385
339386
340387
341388 @Callable(i)
342389 func instantBuyNsbtOrFail (noLessThenRoi) = {
343390 let pmt = value(i.payments[0])
344391 let roi = currentMaxRoi
345392 if ((noLessThenRoi > roi))
346393 then throw(((("Current maxRoi=" + toString(roi)) + " is less then passed parameter noLessThenRoi=") + toString(noLessThenRoi)))
347394 else {
348395 let priceWavesByBondCents = getPriceForRoi(roi)
349396 internalAddBuyBondOrder(roi, getReversePrice(priceWavesByBondCents), "", i, true)
350397 }
351398 }
352399
353400
354401
355402 @Callable(i)
356403 func addBuyBondOrder (price,prevOrder) = {
357404 let pmt = value(i.payments[0])
358405 let priceWavesByBondCents = getReversePrice(price)
359406 if ((0 >= price))
360407 then throw("price less zero")
361408 else internalAddBuyBondOrder(fraction((priceWavesByBondCents - currentPrice), 100, currentPrice), price, prevOrder, i, false)
362409 }
363410
364411
365412
366413 @Callable(i)
367414 func cancelOrder (orderId) = {
368415 let owner = getOrderOwner(orderId)
369416 let amount = (getOrderTotal(orderId) - getOrderFilledTotal(orderId))
370417 let caller = toString(i.caller)
371418 let nextOrder = getNextOrder(orderId)
372419 let prevOrder = getPrevOrder(orderId)
373420 if (isBlocked)
374421 then throw("contract is blocked by EMERGENCY SHUTDOWN actions until reactivation by emergency oracles")
375422 else if ((owner != caller))
376423 then throw("permission denied")
377424 else if ((getOrderStatus(orderId) != NEW))
378425 then throw("invalid order status")
379426 else [StringEntry(FirstOrderKey, if ((firstOrder == orderId))
380427 then nextOrder
381428 else firstOrder), StringEntry(getNextOrderKey(prevOrder), nextOrder), StringEntry(getPrevOrderKey(nextOrder), prevOrder), StringEntry(getOrderStatusKey(orderId), CANCELED), ScriptTransfer(i.caller, amount, unit)]
382429 }
383430
384431
385432
386433 @Callable(i)
387434 func sellBond () = if (isBlocked)
388435 then throw("contract is blocked by EMERGENCY SHUTDOWN actions until reactivation by emergency oracles")
389436 else if ((firstOrder == ""))
390437 then throw("empty orderbook")
391438 else {
392439 let nextOrder = getNextOrder(firstOrder)
393440 let filledTotal = getOrderFilledTotal(firstOrder)
394441 let orderPrice = getOrderPrice(firstOrder)
395442 let roi = getNumberByKey(getRoiByOrderIdKey(firstOrder))
396443 let paymentWavelets = getOrderTotal(firstOrder)
397444 let orderOwnerAddress = Address(fromBase58String(getOrderOwner(firstOrder)))
398445 internalSellBond(firstOrder, nextOrder, filledTotal, roi, orderPrice, paymentWavelets, orderOwnerAddress, false)
399446 }
400447
401448
402449 @Verifier(tx)
403450 func verify () = {
404451 let pubKeyAdminsList = ["GXxmZaCigPgJsT6d1cLr8nUXA65nGX8V7FuAzzrY8wQE", "3xumx4hrPpeeoo79HLGbZCgfz95L39ZFdxxwWeSUC2Pu", "D4CqtK5fBsnzRo33ZMhrM7niLseDH2uRoK6weBq2JQ3A", "5WRXFSjwcTbNfKcJs8ZqXmSSWYsSVJUtMvMqZj5hH4Nc"]
405452 let count = ((((if (sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(pubKeyAdminsList[0])))
406453 then 1
407454 else 0) + (if (sigVerify(tx.bodyBytes, tx.proofs[1], fromBase58String(pubKeyAdminsList[1])))
408455 then 1
409456 else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[2], fromBase58String(pubKeyAdminsList[2])))
410457 then 1
411458 else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[3], fromBase58String(pubKeyAdminsList[3])))
412459 then 2
413460 else 0))
414461 (count >= 3)
415462 }
416463

github/deemru/w8io/169f3d6 
77.17 ms