tx · JhGsAs6Bqp8mhbTCBfZTGwBrVWBoiJf2tHEfGdmja1n

3MxbR7b3gHF4XdQKNTT5aQMRiazHvrVWC8N:  -0.02000000 Waves

2021.01.08 06:45 [1343908] smart account 3MxbR7b3gHF4XdQKNTT5aQMRiazHvrVWC8N > SELF 0.00000000 Waves

{ "type": 13, "id": "JhGsAs6Bqp8mhbTCBfZTGwBrVWBoiJf2tHEfGdmja1n", "fee": 2000000, "feeAssetId": null, "timestamp": 1610077566783, "version": 1, "sender": "3MxbR7b3gHF4XdQKNTT5aQMRiazHvrVWC8N", "senderPublicKey": "4bj7YXaphTC4Ldx7DqqMmrTjNshRtw1yNsej2XXZcAzS", "proofs": [ "w1rRfvkcvp6YFpMd1VB5gwm4bJLK6Ub2pLeHyTgBGHyJJE5MSN2kPSi29rU7wstahznWZpP2xbJ22eG4EeVuncB", "CpXKKBkueAZrXjdoEqtgVisifSfkqbJ7bTUVZYZr1ppGq7ZQ4D3NjSpD6MQdSCsy1V9p4Z5GjRi7qjLQTCc4wTC", "4AbWBnzZFwQ8Rhp1DAjPSoDM7KA469j6kddJgPfeHDheMAhfA2dgSvuhTuRiZwHV2ETBdvm1UhjZU4ffPv2GKjv5" ], "script": "base64:AAIEAAAAAAAAABoIAhIECgIBARIDCgEBEgQKAgEIEgMKAQgSAAAAAEMBAAAADmdldE51bWJlckJ5S2V5AAAAAQAAAANrZXkJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AAAAAAAAAAAAAQAAAA5nZXRTdHJpbmdCeUtleQAAAAEAAAADa2V5CQEAAAALdmFsdWVPckVsc2UAAAACCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQIAAAAAAQAAABZnZXRCb29sQnlBZGRyZXNzQW5kS2V5AAAAAgAAAAdhZGRyZXNzAAAAA2tleQkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkABBsAAAACBQAAAAdhZGRyZXNzBQAAAANrZXkHAQAAABh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AUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACQACWQAAAAEJAAGRAAAAAgUAAAAQcHViS2V5QWRtaW5zTGlzdAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAMJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAABCQACWQAAAAEJAAGRAAAAAgUAAAAQcHViS2V5QWRtaW5zTGlzdAAAAAAAAAAAAQAAAAAAAAAAAQAAAAAAAAAAAAMJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAACCQACWQAAAAEJAAGRAAAAAgUAAAAQcHViS2V5QWRtaW5zTGlzdAAAAAAAAAAAAgAAAAAAAAAAAQAAAAAAAAAAAAMJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAADCQACWQAAAAEJAAGRAAAAAgUAAAAQcHViS2V5QWRtaW5zTGlzdAAAAAAAAAAAAwAAAAAAAAAAAgAAAAAAAAAAAAkAAGcAAAACBQAAAAVjb3VudAAAAAAAAAAAA8pctQ8=", "chainId": 84, "height": 1343908, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3dg2e9q1kfuTtvoZxLHncXAahiwd2MtFK1o1X8eTCAwv Next: 2ouMhj8ivPh81KrkUmZgL4kB7fTEiErURkQn1vkfTRo3 Diff:
OldNewDifferences
2020
2121 let PAULI = 1000000
2222
23+let PAULISCALE = 6
24+
2325 let PRICELET = 1000000
2426
2527 let MULT = 100000000
2628
27-let SCALEMULT = 8
29+let MULTSCALE = 8
2830
2931 let MINORDERTOTAL = (10 * WAVELET)
3032
234236 }
235237
236238
237-func curveFunction (wRaw,uRaw,price) = {
239+func curveFunction (wRaw,uRaw,price,mRaw,sRaw,nRaw) = {
238240 let EXP = 271828100
239241 let nsbtCurveParamA = valueOrElse(getInteger(this, "nsbtCurveParam_a"), 3)
240242 let wReservesInUsdn = convertWavesToNeutrino(wRaw, price)
241243 let brMult = fraction(wReservesInUsdn, MULT, uRaw)
242244 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)
245+ let expInPowerMult = pow(EXP, MULTSCALE, powerMult, MULTSCALE, MULTSCALE, DOWN)
246+ let lnRes1 = log(((mRaw - sRaw) - nRaw), PAULISCALE, EXP, MULTSCALE, MULTSCALE, DOWN)
247+ let lnRes0 = log((mRaw - sRaw), PAULISCALE, EXP, MULTSCALE, MULTSCALE, DOWN)
248+ let lnDiffMult = (lnRes0 - lnRes1)
249+ let lnDiffMultipliedMaxRaw = fraction(mRaw, lnDiffMult, MULT)
250+ let usdnPaymentRaw = fraction(expInPowerMult, lnDiffMultipliedMaxRaw, MULT)
251+ let wavesPayment = convertNeutrinoToWaves(usdnPaymentRaw, price)
252+[wavesPayment, usdnPaymentRaw, wRaw, uRaw, mRaw, sRaw, nRaw, nsbtCurveParamA, wReservesInUsdn, brMult, powerMult, expInPowerMult, lnRes0, lnRes1, lnDiffMult, lnDiffMultipliedMaxRaw]
248253 }
249254
250255
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)) + "]")
256+func toStr (name,curveResult) = (((((((((((((((((((((((((((((((((name + "[wavesPayment=") + toString(curveResult[0])) + " usdnPayment=") + toString(curveResult[1])) + " wRaw=") + toString(curveResult[2])) + " uRaw=") + toString(curveResult[3])) + " mRaw=") + toString(curveResult[4])) + " sRaw=") + toString(curveResult[5])) + " nRaw=") + toString(curveResult[6])) + " nsbtCurveParamA=") + toString(curveResult[7])) + " wReservesInUsdn=") + toString(curveResult[8])) + " brMult=") + toString(curveResult[9])) + " powerMult=") + toString(curveResult[10])) + " expInPowerMult=") + toString(curveResult[11])) + " lnRes0=") + toString(curveResult[12])) + " lnRes1=") + toString(curveResult[13])) + " lnDiffMult=") + toString(curveResult[14])) + " maxXlndiff=") + toString(curveResult[15])) + "]")
257+
258+
259+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")))))
260+ then !(isDefined(transferTransactionById(fromBase58String("adLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
261+ else false)
262+ then !(isDefined(transferTransactionById(fromBase58String("sdLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
263+ else false)
264+ then !(isDefined(transferTransactionById(fromBase58String("ddLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
265+ else false)
266+ then !(isDefined(transferTransactionById(fromBase58String("fdLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
267+ else false)
268+ then !(isDefined(transferTransactionById(fromBase58String("gdLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
269+ else false)
270+ then !(isDefined(transferTransactionById(fromBase58String("hdLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
271+ else false)
272+ then !(isDefined(transferTransactionById(fromBase58String("jdLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
273+ else false)
274+ then !(isDefined(transferTransactionById(fromBase58String("kdLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
275+ else false)
276+ then !(isDefined(transferTransactionById(fromBase58String("rdLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
277+ else false)
278+ then !(isDefined(transferTransactionById(fromBase58String("tdLq5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
279+ else false)
280+ then !(isDefined(transferTransactionById(fromBase58String("tdLy5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
281+ else false)
282+ then !(isDefined(transferTransactionById(fromBase58String("tdLu5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
283+ else false)
284+ then !(isDefined(transferTransactionById(fromBase58String("tdLh5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
285+ else false)
286+ then !(isDefined(transferTransactionById(fromBase58String("1dL4JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
287+ else false)
288+ then !(isDefined(transferTransactionById(fromBase58String("2dL25JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
289+ else false)
290+ then !(isDefined(transferTransactionById(fromBase58String("3dL95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
291+ else false)
292+ then !(isDefined(transferTransactionById(fromBase58String("4dL95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
293+ else false)
294+ then !(isDefined(transferTransactionById(fromBase58String("5dL95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
295+ else false)
296+ then !(isDefined(transferTransactionById(fromBase58String("6dL95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
297+ else false)
298+ then !(isDefined(transferTransactionById(fromBase58String("7dL95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
299+ else false)
300+ then !(isDefined(transferTransactionById(fromBase58String("8dL95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
301+ else false)
302+ then !(isDefined(transferTransactionById(fromBase58String("91L95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
303+ else false)
304+ then !(isDefined(transferTransactionById(fromBase58String("92L95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
305+ else false)
306+ then !(isDefined(transferTransactionById(fromBase58String("93L95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
307+ else false)
308+ then !(isDefined(transferTransactionById(fromBase58String("94L95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
309+ else false
252310
253311
254312 @Callable(i)
255-func buyNsbtInSurplus () = {
313+func buyNsbtInSurplus (nsbtAmount,toleranceRaw) = {
256314 let pmt = value(i.payments[0])
257315 let pmtAmount = pmt.amount
258316 let ownerAddress = i.caller
259317 if (isBlocked)
260318 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")
319+ else if (isDefined(pmt.assetId))
320+ then throw("can use waves only")
321+ else if (((10 * WAVELET) > pmtAmount))
322+ then throw("min 10 waves expected")
265323 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))])
324+ let issuedNsbt = valueOrElse(getInteger(this, "tmp_issuedNsbt"), 0)
325+ let nsbtMax = ((2500 * 1000) * PAULI)
326+ let nsbtCurrent = (((1500 * 1000) * PAULI) + issuedNsbt)
327+ let curveResult = curveFunction(reserve, neutrinoSupply, currentPrice, nsbtMax, nsbtCurrent, nsbtAmount)
328+ let requiredWaves = curveResult[0]
329+ if ((requiredWaves > pmtAmount))
330+ then throw(((("Payment amount is less then required: pmtAmount=" + toString(pmtAmount)) + " requiredWaves=") + toString(requiredWaves)))
331+ else if ((0 > toleranceRaw))
332+ then throw("Invalid tolerance param")
333+ else {
334+ let maxAllowedPayment = fraction(requiredWaves, (toleranceRaw + PAULI), PAULI)
335+ if ((requiredWaves > maxAllowedPayment))
336+ then throw(((("Tolerance check failed: pmtAmount=" + toString(pmtAmount)) + " maxAllowedPayment=") + toString(maxAllowedPayment)))
337+ else {
338+ let nsbt2WavesPriceRaw = calcNsbt2WavesPriceRaw(requiredWaves, nsbtAmount)
339+ let roi = (fraction(getReversePrice(nsbt2WavesPriceRaw), 100, currentPrice) - 100)
340+ (orderData(toBase58String(i.transactionId), pmtAmount, pmtAmount, toString(ownerAddress), FILLED, roi, nsbt2WavesPriceRaw) ++ [ScriptTransfer(ownerAddress, nsbtAmount, bondAssetId), ScriptTransfer(ownerAddress, (pmtAmount - requiredWaves), unit), ScriptTransfer(neutrinoContract, requiredWaves, unit), StringEntry("debug_curveResult", toStr("curveResult", curveResult)), IntegerEntry("tmp_issuedNsbt", (issuedNsbt + nsbtAmount))])
341+ }
342+ }
272343 }
273344 }
274345
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
23+let PAULISCALE = 6
24+
2325 let PRICELET = 1000000
2426
2527 let MULT = 100000000
2628
27-let SCALEMULT = 8
29+let MULTSCALE = 8
2830
2931 let MINORDERTOTAL = (10 * WAVELET)
3032
3133 let MAXROI = 95
3234
3335 let CANCELED = "canceled"
3436
3537 let NEW = "new"
3638
3739 let FILLED = "filled"
3840
3941 let PriceKey = "price"
4042
4143 let BondAssetIdKey = "bond_asset_id"
4244
4345 let NeutrinoAssetIdKey = "neutrino_asset_id"
4446
4547 let BalanceLockedkKey = "balance_lock_"
4648
4749 let WavesLockedBalanceKey = (BalanceLockedkKey + "waves")
4850
4951 let NeutrinoLockedBalanceKey = (BalanceLockedkKey + "neutrino")
5052
5153 let FirstOrderKey = "order_first"
5254
5355 func getRoiByOrderIdKey (orderId) = ("debug_order_roi_" + orderId)
5456
5557
5658 func getOrderPriceKey (orderId) = ("order_price_" + orderId)
5759
5860
5961 func getOrderTotalKey (orderId) = ("order_total_" + orderId)
6062
6163
6264 func getOrderOwnerKey (orderId) = ("order_owner_" + orderId)
6365
6466
6567 func getOrderHeightKey (orderId) = ("order_height_" + orderId)
6668
6769
6870 func getOrderStatusKey (orderId) = ("order_status_" + orderId)
6971
7072
7173 func getOrderFilledTotalKey (orderId) = ("order_filled_total_" + orderId)
7274
7375
7476 func getPrevOrderKey (orderId) = ("order_prev_" + orderId)
7577
7678
7779 func getNextOrderKey (orderId) = ("order_next_" + orderId)
7880
7981
8082 func convertNeutrinoToWaves (amount,price) = fraction(fraction(amount, PRICELET, price), WAVELET, PAULI)
8183
8284
8385 func convertWavesToNeutrino (amount,price) = fraction(fraction(amount, price, PRICELET), PAULI, WAVELET)
8486
8587
8688 func convertWavesToBond (amount,price) = convertWavesToNeutrino(amount, price)
8789
8890
8991 func convertBondToWaves (amount,price) = convertNeutrinoToWaves(amount, price)
9092
9193
9294 let neutrinoContract = Address(base58'3Mzbx34Ex5rRbn39vUHx9kiwh3nneF8S5we')
9395
9496 let controlContract = Address(base58'3N4NS7d4Jo9a6F14LiFUKKYVdUkkf2eP4Zx')
9597
9698 let liquidationContract = Address(base58'3N5nmMvMH8o3RPEyCKCaoWahBTYTexnZy62')
9799
98100 let neutrinoAssetId = base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT'
99101
100102 let bondAssetId = base58'BGhPYquXSK6UYjnPLEn94gFhetp4Jvf7toekEY4x1VDH'
101103
102104 let isBlocked = getBoolByAddressAndKey(controlContract, "is_blocked")
103105
104106 let currentPrice = getNumberByAddressAndKey(controlContract, PriceKey)
105107
106108 let neutrinoLockedBalance = getNumberByAddressAndKey(neutrinoContract, NeutrinoLockedBalanceKey)
107109
108110 let reserve = (wavesBalance(neutrinoContract).regular - getNumberByAddressAndKey(neutrinoContract, WavesLockedBalanceKey))
109111
110112 let reservesInUsdn = convertWavesToNeutrino(reserve, currentPrice)
111113
112114 let neutrinoSupply = (((neutrinoLockedBalance + value(assetInfo(neutrinoAssetId)).quantity) - assetBalance(neutrinoContract, neutrinoAssetId)) - assetBalance(liquidationContract, neutrinoAssetId))
113115
114116 let deficit = (neutrinoSupply - reservesInUsdn)
115117
116118 let currentMaxRoi = fraction(deficit, 100, neutrinoSupply)
117119
118120 let currentBrMult = fraction(reservesInUsdn, MULT, neutrinoSupply)
119121
120122 let firstOrder = getStringByKey(FirstOrderKey)
121123
122124 func getOrderPrice (id) = getNumberByKey(getOrderPriceKey(id))
123125
124126
125127 func getOrderTotal (id) = getNumberByKey(getOrderTotalKey(id))
126128
127129
128130 func getOrderOwner (id) = getStringByKey(getOrderOwnerKey(id))
129131
130132
131133 func getOrderStatus (id) = getStringByKey(getOrderStatusKey(id))
132134
133135
134136 func getOrderFilledTotal (id) = getNumberByKey(getOrderFilledTotalKey(id))
135137
136138
137139 func getPrevOrder (id) = getStringByKey(getPrevOrderKey(id))
138140
139141
140142 func getNextOrder (id) = getStringByKey(getNextOrderKey(id))
141143
142144
143145 func getPriceForRoi (roiPercents) = fraction((100 + roiPercents), currentPrice, 100)
144146
145147
146148 func getReversePrice (price) = ((PRICELET * PRICELET) / price)
147149
148150
149151 func calcNsbt2WavesPriceRaw (spentWavesRaw,receivedNsbtRaw) = fraction(spentWavesRaw, (PAULI * PRICELET), receivedNsbtRaw)
150152
151153
152154 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)]
153155
154156
155157 func internalSellBond (pFirstOrder,pNextOrder,pFilledTotal,pRoi,pPrice,pPaymentWavelets,orderOwnerAddress,instantOrder) = {
156158 let priceWavesByBondCents = getPriceForRoi(pRoi)
157159 let remainedTotal = (pPaymentWavelets - pFilledTotal)
158160 let fillableOrderAmount = convertWavesToBond(remainedTotal, priceWavesByBondCents)
159161 let totalOrderWaveletesRequired = convertBondToWaves(fillableOrderAmount, priceWavesByBondCents)
160162 let nbTokensSellCondition = (currentMaxRoi >= pRoi)
161163 if (!(nbTokensSellCondition))
162164 then throw(("innapropriate roi: " + toString(pRoi)))
163165 else if ((totalOrderWaveletesRequired == 0))
164166 then throw("cannot fill order at the moment")
165167 else {
166168 let changeWavelets = (remainedTotal - totalOrderWaveletesRequired)
167169 let writeSetData = if (instantOrder)
168170 then orderData(pFirstOrder, pPaymentWavelets, (pFilledTotal + totalOrderWaveletesRequired), toBase58String(orderOwnerAddress.bytes), FILLED, pRoi, currentPrice)
169171 else [IntegerEntry(getOrderFilledTotalKey(pFirstOrder), (pFilledTotal + totalOrderWaveletesRequired)), StringEntry(getOrderStatusKey(pFirstOrder), FILLED), StringEntry(getPrevOrderKey(pNextOrder), ""), StringEntry(FirstOrderKey, pNextOrder)]
170172 (writeSetData ++ [ScriptTransfer(orderOwnerAddress, fillableOrderAmount, bondAssetId), ScriptTransfer(neutrinoContract, totalOrderWaveletesRequired, unit), ScriptTransfer(orderOwnerAddress, changeWavelets, unit)])
171173 }
172174 }
173175
174176
175177 func internalAddBuyBondOrder (roi,price,prevOrder,inv,instantOrder) = {
176178 let pmt = value(inv.payments[0])
177179 let newOrderId = toBase58String(inv.transactionId)
178180 if (isBlocked)
179181 then throw("contract is blocked by EMERGENCY SHUTDOWN actions until reactivation by emergency oracles")
180182 else if ((MINORDERTOTAL > pmt.amount))
181183 then throw(("min order total equals " + toString(MINORDERTOTAL)))
182184 else if ((roi > MAXROI))
183185 then throw("max setOrder ROI is 95%")
184186 else if ((0 > roi))
185187 then throw("can't place order with negative roi")
186188 else if ((roi == 0))
187189 then throw("roi should not be equal to 0")
188190 else if (isDefined(pmt.assetId))
189191 then throw("can use waves only")
190192 else if ((getOrderOwner(newOrderId) != ""))
191193 then throw("order exists")
192194 else if (if ((prevOrder != ""))
193195 then (getOrderStatus(prevOrder) != NEW)
194196 else false)
195197 then throw("prev order status is not new")
196198 else {
197199 let isNewOrderAtFirstPosition = (prevOrder == "")
198200 let owner = toString(inv.caller)
199201 let nextOrder = if (isNewOrderAtFirstPosition)
200202 then firstOrder
201203 else getNextOrder(prevOrder)
202204 let nextOrderRoi = getNumberByKey(getRoiByOrderIdKey(nextOrder))
203205 let isNextOrderError = if (if ((nextOrder != ""))
204206 then (roi >= nextOrderRoi)
205207 else false)
206208 then true
207209 else false
208210 let prevOrderRoi = getNumberByKey(getRoiByOrderIdKey(prevOrder))
209211 let isPrevOrderError = if (if ((prevOrder != ""))
210212 then (prevOrderRoi > roi)
211213 else false)
212214 then true
213215 else false
214216 if (if (isNextOrderError)
215217 then true
216218 else isPrevOrderError)
217219 then throw(((("invalid order isPrevOrderError:" + toString(isPrevOrderError)) + " isNextOrderError:") + toString(isNextOrderError)))
218220 else if (if (isNewOrderAtFirstPosition)
219221 then (currentMaxRoi >= roi)
220222 else false)
221223 then internalSellBond(newOrderId, nextOrder, 0, roi, price, pmt.amount, inv.caller, true)
222224 else if (instantOrder)
223225 then throw("Instant order couldn't be added into waiting queue")
224226 else ([StringEntry(getPrevOrderKey(newOrderId), prevOrder), StringEntry(getNextOrderKey(newOrderId), nextOrder), StringEntry(getNextOrderKey(prevOrder), if ((prevOrder == ""))
225227 then ""
226228 else newOrderId), StringEntry(getPrevOrderKey(nextOrder), if ((nextOrder == ""))
227229 then ""
228230 else newOrderId), StringEntry(FirstOrderKey, if (if ((firstOrder == ""))
229231 then true
230232 else (firstOrder == nextOrder))
231233 then newOrderId
232234 else firstOrder)] ++ orderData(newOrderId, pmt.amount, 0, owner, NEW, roi, price))
233235 }
234236 }
235237
236238
237-func curveFunction (wRaw,uRaw,price) = {
239+func curveFunction (wRaw,uRaw,price,mRaw,sRaw,nRaw) = {
238240 let EXP = 271828100
239241 let nsbtCurveParamA = valueOrElse(getInteger(this, "nsbtCurveParam_a"), 3)
240242 let wReservesInUsdn = convertWavesToNeutrino(wRaw, price)
241243 let brMult = fraction(wReservesInUsdn, MULT, uRaw)
242244 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)
245+ let expInPowerMult = pow(EXP, MULTSCALE, powerMult, MULTSCALE, MULTSCALE, DOWN)
246+ let lnRes1 = log(((mRaw - sRaw) - nRaw), PAULISCALE, EXP, MULTSCALE, MULTSCALE, DOWN)
247+ let lnRes0 = log((mRaw - sRaw), PAULISCALE, EXP, MULTSCALE, MULTSCALE, DOWN)
248+ let lnDiffMult = (lnRes0 - lnRes1)
249+ let lnDiffMultipliedMaxRaw = fraction(mRaw, lnDiffMult, MULT)
250+ let usdnPaymentRaw = fraction(expInPowerMult, lnDiffMultipliedMaxRaw, MULT)
251+ let wavesPayment = convertNeutrinoToWaves(usdnPaymentRaw, price)
252+[wavesPayment, usdnPaymentRaw, wRaw, uRaw, mRaw, sRaw, nRaw, nsbtCurveParamA, wReservesInUsdn, brMult, powerMult, expInPowerMult, lnRes0, lnRes1, lnDiffMult, lnDiffMultipliedMaxRaw]
248253 }
249254
250255
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)) + "]")
256+func toStr (name,curveResult) = (((((((((((((((((((((((((((((((((name + "[wavesPayment=") + toString(curveResult[0])) + " usdnPayment=") + toString(curveResult[1])) + " wRaw=") + toString(curveResult[2])) + " uRaw=") + toString(curveResult[3])) + " mRaw=") + toString(curveResult[4])) + " sRaw=") + toString(curveResult[5])) + " nRaw=") + toString(curveResult[6])) + " nsbtCurveParamA=") + toString(curveResult[7])) + " wReservesInUsdn=") + toString(curveResult[8])) + " brMult=") + toString(curveResult[9])) + " powerMult=") + toString(curveResult[10])) + " expInPowerMult=") + toString(curveResult[11])) + " lnRes0=") + toString(curveResult[12])) + " lnRes1=") + toString(curveResult[13])) + " lnDiffMult=") + toString(curveResult[14])) + " maxXlndiff=") + toString(curveResult[15])) + "]")
257+
258+
259+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")))))
260+ then !(isDefined(transferTransactionById(fromBase58String("adLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
261+ else false)
262+ then !(isDefined(transferTransactionById(fromBase58String("sdLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
263+ else false)
264+ then !(isDefined(transferTransactionById(fromBase58String("ddLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
265+ else false)
266+ then !(isDefined(transferTransactionById(fromBase58String("fdLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
267+ else false)
268+ then !(isDefined(transferTransactionById(fromBase58String("gdLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
269+ else false)
270+ then !(isDefined(transferTransactionById(fromBase58String("hdLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
271+ else false)
272+ then !(isDefined(transferTransactionById(fromBase58String("jdLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
273+ else false)
274+ then !(isDefined(transferTransactionById(fromBase58String("kdLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
275+ else false)
276+ then !(isDefined(transferTransactionById(fromBase58String("rdLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
277+ else false)
278+ then !(isDefined(transferTransactionById(fromBase58String("tdLq5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
279+ else false)
280+ then !(isDefined(transferTransactionById(fromBase58String("tdLy5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
281+ else false)
282+ then !(isDefined(transferTransactionById(fromBase58String("tdLu5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
283+ else false)
284+ then !(isDefined(transferTransactionById(fromBase58String("tdLh5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
285+ else false)
286+ then !(isDefined(transferTransactionById(fromBase58String("1dL4JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
287+ else false)
288+ then !(isDefined(transferTransactionById(fromBase58String("2dL25JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
289+ else false)
290+ then !(isDefined(transferTransactionById(fromBase58String("3dL95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
291+ else false)
292+ then !(isDefined(transferTransactionById(fromBase58String("4dL95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
293+ else false)
294+ then !(isDefined(transferTransactionById(fromBase58String("5dL95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
295+ else false)
296+ then !(isDefined(transferTransactionById(fromBase58String("6dL95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
297+ else false)
298+ then !(isDefined(transferTransactionById(fromBase58String("7dL95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
299+ else false)
300+ then !(isDefined(transferTransactionById(fromBase58String("8dL95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
301+ else false)
302+ then !(isDefined(transferTransactionById(fromBase58String("91L95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
303+ else false)
304+ then !(isDefined(transferTransactionById(fromBase58String("92L95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
305+ else false)
306+ then !(isDefined(transferTransactionById(fromBase58String("93L95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
307+ else false)
308+ then !(isDefined(transferTransactionById(fromBase58String("94L95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))
309+ else false
252310
253311
254312 @Callable(i)
255-func buyNsbtInSurplus () = {
313+func buyNsbtInSurplus (nsbtAmount,toleranceRaw) = {
256314 let pmt = value(i.payments[0])
257315 let pmtAmount = pmt.amount
258316 let ownerAddress = i.caller
259317 if (isBlocked)
260318 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")
319+ else if (isDefined(pmt.assetId))
320+ then throw("can use waves only")
321+ else if (((10 * WAVELET) > pmtAmount))
322+ then throw("min 10 waves expected")
265323 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))])
324+ let issuedNsbt = valueOrElse(getInteger(this, "tmp_issuedNsbt"), 0)
325+ let nsbtMax = ((2500 * 1000) * PAULI)
326+ let nsbtCurrent = (((1500 * 1000) * PAULI) + issuedNsbt)
327+ let curveResult = curveFunction(reserve, neutrinoSupply, currentPrice, nsbtMax, nsbtCurrent, nsbtAmount)
328+ let requiredWaves = curveResult[0]
329+ if ((requiredWaves > pmtAmount))
330+ then throw(((("Payment amount is less then required: pmtAmount=" + toString(pmtAmount)) + " requiredWaves=") + toString(requiredWaves)))
331+ else if ((0 > toleranceRaw))
332+ then throw("Invalid tolerance param")
333+ else {
334+ let maxAllowedPayment = fraction(requiredWaves, (toleranceRaw + PAULI), PAULI)
335+ if ((requiredWaves > maxAllowedPayment))
336+ then throw(((("Tolerance check failed: pmtAmount=" + toString(pmtAmount)) + " maxAllowedPayment=") + toString(maxAllowedPayment)))
337+ else {
338+ let nsbt2WavesPriceRaw = calcNsbt2WavesPriceRaw(requiredWaves, nsbtAmount)
339+ let roi = (fraction(getReversePrice(nsbt2WavesPriceRaw), 100, currentPrice) - 100)
340+ (orderData(toBase58String(i.transactionId), pmtAmount, pmtAmount, toString(ownerAddress), FILLED, roi, nsbt2WavesPriceRaw) ++ [ScriptTransfer(ownerAddress, nsbtAmount, bondAssetId), ScriptTransfer(ownerAddress, (pmtAmount - requiredWaves), unit), ScriptTransfer(neutrinoContract, requiredWaves, unit), StringEntry("debug_curveResult", toStr("curveResult", curveResult)), IntegerEntry("tmp_issuedNsbt", (issuedNsbt + nsbtAmount))])
341+ }
342+ }
272343 }
273344 }
274345
275346
276347
277348 @Callable(i)
278349 func instantBuyNsbtOrFail (noLessThenRoi) = {
279350 let pmt = value(i.payments[0])
280351 let roi = currentMaxRoi
281352 if ((noLessThenRoi > roi))
282353 then throw(((("Current maxRoi=" + toString(roi)) + " is less then passed parameter noLessThenRoi=") + toString(noLessThenRoi)))
283354 else {
284355 let priceWavesByBondCents = getPriceForRoi(roi)
285356 internalAddBuyBondOrder(roi, getReversePrice(priceWavesByBondCents), "", i, true)
286357 }
287358 }
288359
289360
290361
291362 @Callable(i)
292363 func addBuyBondOrder (price,prevOrder) = {
293364 let pmt = value(i.payments[0])
294365 let priceWavesByBondCents = getReversePrice(price)
295366 if ((0 >= price))
296367 then throw("price less zero")
297368 else internalAddBuyBondOrder(fraction((priceWavesByBondCents - currentPrice), 100, currentPrice), price, prevOrder, i, false)
298369 }
299370
300371
301372
302373 @Callable(i)
303374 func cancelOrder (orderId) = {
304375 let owner = getOrderOwner(orderId)
305376 let amount = (getOrderTotal(orderId) - getOrderFilledTotal(orderId))
306377 let caller = toString(i.caller)
307378 let nextOrder = getNextOrder(orderId)
308379 let prevOrder = getPrevOrder(orderId)
309380 if (isBlocked)
310381 then throw("contract is blocked by EMERGENCY SHUTDOWN actions until reactivation by emergency oracles")
311382 else if ((owner != caller))
312383 then throw("permission denied")
313384 else if ((getOrderStatus(orderId) != NEW))
314385 then throw("invalid order status")
315386 else [StringEntry(FirstOrderKey, if ((firstOrder == orderId))
316387 then nextOrder
317388 else firstOrder), StringEntry(getNextOrderKey(prevOrder), nextOrder), StringEntry(getPrevOrderKey(nextOrder), prevOrder), StringEntry(getOrderStatusKey(orderId), CANCELED), ScriptTransfer(i.caller, amount, unit)]
318389 }
319390
320391
321392
322393 @Callable(i)
323394 func sellBond () = if (isBlocked)
324395 then throw("contract is blocked by EMERGENCY SHUTDOWN actions until reactivation by emergency oracles")
325396 else if ((firstOrder == ""))
326397 then throw("empty orderbook")
327398 else {
328399 let nextOrder = getNextOrder(firstOrder)
329400 let filledTotal = getOrderFilledTotal(firstOrder)
330401 let orderPrice = getOrderPrice(firstOrder)
331402 let roi = getNumberByKey(getRoiByOrderIdKey(firstOrder))
332403 let paymentWavelets = getOrderTotal(firstOrder)
333404 let orderOwnerAddress = Address(fromBase58String(getOrderOwner(firstOrder)))
334405 internalSellBond(firstOrder, nextOrder, filledTotal, roi, orderPrice, paymentWavelets, orderOwnerAddress, false)
335406 }
336407
337408
338409 @Verifier(tx)
339410 func verify () = {
340411 let pubKeyAdminsList = ["GXxmZaCigPgJsT6d1cLr8nUXA65nGX8V7FuAzzrY8wQE", "3xumx4hrPpeeoo79HLGbZCgfz95L39ZFdxxwWeSUC2Pu", "D4CqtK5fBsnzRo33ZMhrM7niLseDH2uRoK6weBq2JQ3A", "5WRXFSjwcTbNfKcJs8ZqXmSSWYsSVJUtMvMqZj5hH4Nc"]
341412 let count = ((((if (sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(pubKeyAdminsList[0])))
342413 then 1
343414 else 0) + (if (sigVerify(tx.bodyBytes, tx.proofs[1], fromBase58String(pubKeyAdminsList[1])))
344415 then 1
345416 else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[2], fromBase58String(pubKeyAdminsList[2])))
346417 then 1
347418 else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[3], fromBase58String(pubKeyAdminsList[3])))
348419 then 2
349420 else 0))
350421 (count >= 3)
351422 }
352423

github/deemru/w8io/169f3d6 
59.02 ms