tx · 5LQET3pBXKVNvZRW6v9Gjt9EyMRGBB9ndrPrrrP2kmaV

3N7LYefWk1WhvCsY5A9nTq244SbVPmhCypi:  -0.01400000 Waves

2022.03.24 09:26 [1977639] smart account 3N7LYefWk1WhvCsY5A9nTq244SbVPmhCypi > SELF 0.00000000 Waves

{ "type": 13, "id": "5LQET3pBXKVNvZRW6v9Gjt9EyMRGBB9ndrPrrrP2kmaV", "fee": 1400000, "feeAssetId": null, "timestamp": 1648103224472, "version": 1, "sender": "3N7LYefWk1WhvCsY5A9nTq244SbVPmhCypi", "senderPublicKey": "4qGVXRFATZNzo2RZZ5UYHXojGyJgSRBwtgJcCU8rJe5A", "proofs": [ "2GDnH1kcpVpW1eMyYebWVZM3pJ67StnMiKrr7XRVeLJyuiAZ7AcftXE8beD6236s1reHzJErcbLzh8x4QnjfukXw" ], "script": "base64:AAIFAAAAAAAAADMIAhIFCgMICAESAwoBARIHCgUBAQEBARIDCgEBEgMKAQESABIFCgMBAQESBwoFAQEBAQEAAABBAAAAAAdXQVZFTEVUAAAAAAAF9eEAAAAAAAVQQVVMSQAAAAAAAA9CQAAAAAAIQklHUEFVTEkJAAE2AAAAAQAAAAAAAA9CQAAAAAAIUFJJQ0VMRVQAAAAAAAAPQkAAAAAABE1VTFQAAAAAAAX14QAAAAAACUJJR01VTFQxNgkAATYAAAABAAAjhvJvwQAAAAAAAAlNVUxUU0NBTEUAAAAAAAAAAAgAAAAAB1NDQUxFMTYAAAAAAAAAABAAAAAAA1NFUAIAAAACX18AAAAABUhBTEY4AAAAAAAC+vCAAAAAAAtFVUxFUk5VTUJFUgkAATYAAAABAABgkqET2NV0AAAAAAZzY2FsZTYAAAAAAAAPQkAAAAAADHNjYWxlNkJpZ0ludAkAATYAAAABAAAAAAAAD0JAAAAAAAxzY2FsZThCaWdJbnQJAAE2AAAAAQAAAAAABfXhAAAAAAANc2NhbGUxMEJpZ0ludAkAATYAAAABAAAAAAJUC+QAAAAAAAtrUmVzdWx0SWR4QQAA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: original | compacted Prev: HCUkraKw7BiYJp6rQ3rRi2P5mpg6Y7UarD1RWHeSefNY Next: BiJZqwsb8TzNFBkn62N2iP3H3Lh9RsKrcqwrpvPnkwfK Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let WAVELET = 100000000
55
66 let PAULI = 1000000
77
88 let BIGPAULI = toBigInt(1000000)
99
1010 let PRICELET = 1000000
1111
1212 let MULT = 100000000
1313
1414 let BIGMULT16 = toBigInt(10000000000000000)
1515
1616 let MULTSCALE = 8
1717
1818 let SCALE16 = 16
1919
2020 let SEP = "__"
2121
2222 let HALF8 = 50000000
2323
2424 let EULERNUMBER = toBigInt(27182818284590452)
2525
2626 let scale6 = 1000000
2727
2828 let scale6BigInt = toBigInt(1000000)
2929
3030 let scale8BigInt = toBigInt(100000000)
3131
3232 let scale10BigInt = toBigInt(10000000000)
3333
3434 let kResultIdxA = 0
3535
3636 let kResultIdxPaulB = 1
3737
3838 let kResultIdxWReservesInUsdn = 2
3939
4040 let kResultIdxMultBR = 3
4141
4242 let kResultIdxMultPower = 4
4343
4444 let kResultIdxMultExpInPowerStr = 5
4545
4646 let kResultIdxMultKStr = 6
4747
4848 let nMetricIdxPrice = 0
4949
5050 let nMetricIdxUsdnLockedBalance = 1
5151
5252 let nMetricIdxWavesLockedBalance = 2
5353
5454 let nMetricIdxReserve = 3
5555
5656 let nMetricIdxReserveInUsdn = 4
5757
5858 let nMetricIdxUsdnSupply = 5
5959
6060 let nMetricIdxSurplus = 6
6161
6262 let nMetricIdxSurplusPercent = 7
6363
6464 let nMetricIdxBR = 8
6565
6666 let nMetricIdxNsbtSupply = 9
6767
6868 let nMetricIdxMaxNsbtSupply = 10
6969
7070 func keyNeutrinoAddress () = "%s%s__config__neutrinoAddress"
7171
7272
7373 func keySwapAmountAParam () = "%s%s__config__swapAParam"
7474
7575
7676 func keyNeutrinoAssetId () = "neutrino_asset_id"
7777
7878
7979 func keyLiquidationContractAddress () = "liquidation_contract"
8080
8181
8282 func keyAuctionContract () = "auction_contract"
8383
8484
8585 func keyContolContract () = "control_contract"
8686
8787
8888 func keyBondAssetId () = "bond_asset_id"
8989
9090
9191 func keyBalanceLocked () = "balance_lock_"
9292
9393
9494 func keyWavesLockedBalance () = (keyBalanceLocked() + "waves")
9595
9696
9797 func keyNeutrinoLockedBalance () = (keyBalanceLocked() + "neutrino")
9898
9999
100100 func swapsTimeframeKEY () = "swaps_timeframe"
101101
102102
103103 func keyUserLastQuickSwapHeight (userAddress) = makeString(["%s%s", "userLastQuickSwapHeight", userAddress], SEP)
104104
105105
106106 func keyQuickSwapUserSpentInPeriod (userAddress) = makeString(["%s%s", "quickSwapUserSpentInPeriod", userAddress], SEP)
107107
108108
109109 func keyPrice () = "price"
110110
111111
112112 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
113113
114114
115115 func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
116116
117117
118118 func getNumberByKey (address,key) = valueOrElse(getInteger(address, key), 0)
119119
120120
121121 func getBoolOrFail (address,key) = valueOrErrorMessage(getBoolean(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
122122
123123
124124 func convertNeutrinoToWaves (amount,price) = fraction(fraction(amount, PRICELET, price), WAVELET, PAULI)
125125
126126
127127 func convertWavesToNeutrino (amount,price) = fraction(fraction(amount, price, PRICELET), PAULI, WAVELET)
128128
129129
130130 func toX16 (origVal,origScaleMult) = fraction(toBigInt(origVal), BIGMULT16, toBigInt(origScaleMult))
131131
132132
133133 func fromX16 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), BIGMULT16))
134134
135135
136136 func asAnyList (val) = match val {
137137 case valAnyLyst: List[Any] =>
138138 valAnyLyst
139139 case _ =>
140140 throw("fail to cast into List[Any]")
141141 }
142142
143143
144144 func asInt (val) = match val {
145145 case valInt: Int =>
146146 valInt
147147 case _ =>
148148 throw("fail to cast into Int")
149149 }
150150
151151
152152 func asString (val) = match val {
153153 case valStr: String =>
154154 valStr
155155 case _ =>
156156 throw("fail to cast into String")
157157 }
158158
159159
160160 let neutrinoContract = addressFromStringValue(getStringOrFail(this, keyNeutrinoAddress()))
161161
162162 let controlContract = addressFromStringValue(getStringOrFail(neutrinoContract, keyContolContract()))
163163
164164 let auctionContract = addressFromStringValue(getStringOrFail(neutrinoContract, keyAuctionContract()))
165165
166166 let liquidationContract = addressFromStringValue(getStringOrFail(neutrinoContract, keyLiquidationContractAddress()))
167167
168168 let neutrinoAssetId = fromBase58String(getStringOrFail(neutrinoContract, keyNeutrinoAssetId()))
169169
170170 let nsbtAssetId = fromBase58String(getStringValue(neutrinoContract, keyBondAssetId()))
171171
172172 func calcContractNsbtPriceInternal (nsbtSupplyDELTA) = {
173173 let neutrinoMetrics = asAnyList(invoke(this, "calcNeutinoMetricsREADONLY", nil, nil))
174174 let price = asInt(neutrinoMetrics[nMetricIdxPrice])
175175 let wRaw = asInt(neutrinoMetrics[nMetricIdxReserve])
176176 let uRaw = (asInt(neutrinoMetrics[nMetricIdxUsdnSupply]) - nsbtSupplyDELTA)
177177 let sRaw = (asInt(neutrinoMetrics[nMetricIdxNsbtSupply]) + nsbtSupplyDELTA)
178178 let mRaw = asInt(neutrinoMetrics[nMetricIdxMaxNsbtSupply])
179179 let kCalcArray = asAnyList(invoke(this, "calculateKREADONLY", [wRaw, uRaw, price, mRaw, sRaw], nil))
180180 let multKX16 = parseBigIntValue(asString(kCalcArray[kResultIdxMultKStr]))
181181 let multStep1X16 = fraction(toBigInt(mRaw), BIGMULT16, toBigInt((mRaw - sRaw)))
182182 let multStep2X16 = fraction(multStep1X16, multStep1X16, BIGMULT16)
183183 let multNsbt2usdnPriceX16 = fraction(multKX16, multStep2X16, BIGMULT16)
184184 let nsbt2usdnPrice = toInt(fraction(multNsbt2usdnPriceX16, toBigInt(PAULI), BIGMULT16))
185185 let nsbt2wavesPrice = fraction(nsbt2usdnPrice, PAULI, price)
186186 $Tuple2(nil, [nsbt2usdnPrice, nsbt2wavesPrice])
187187 }
188188
189189
190190 @Callable(i)
191191 func constructor (neutrinoAddress,nsbtLockAddress,swapAmountAParam) = if ((i.caller != this))
192192 then throw("not authorized")
193193 else [StringEntry(keyNeutrinoAddress(), neutrinoAddress), IntegerEntry(keySwapAmountAParam(), swapAmountAParam)]
194194
195195
196196
197197 @Callable(i)
198198 func calcSwapLimitREADONLY (gNsbtAmount) = {
199199 let limitParamA = toBigInt(getIntOrFail(this, keySwapAmountAParam()))
200200 let gNsbtAmountScale16 = toX16(gNsbtAmount, scale6)
201201 let limitPowPart = pow(gNsbtAmountScale16, 16, EULERNUMBER, 16, 8, CEILING)
202202 let limit = fraction(limitParamA, limitPowPart, scale10BigInt)
203203 $Tuple2(nil, toInt(limit))
204204 }
205205
206206
207207
208208 @Callable(i)
209209 func calculateKREADONLY (wRaw,uRaw,price,mRaw,sRaw) = {
210210 let EXP = toBigInt(2718281)
211211 let EXPSCALE = 6
212212 let a = valueOrElse(getInteger(auctionContract, "nsbtCurveParam_a"), 3)
213213 let paulB = valueOrElse(getInteger(auctionContract, "nsbtCurveParam_b"), ((3 * PAULI) / 10))
214214 let wReservesInUsdn = convertWavesToNeutrino(wRaw, price)
215215 let multBR = fraction(wReservesInUsdn, MULT, uRaw)
216216 if ((multBR > 10678564816))
217217 then throw("BR > 10678.564816% will overflow exponent")
218218 else {
219219 let multPower = (a * (multBR - MULT))
220220 let multExpInPower = pow(EXP, EXPSCALE, toBigInt(multPower), MULTSCALE, SCALE16, DOWN)
221221 let multK = fraction(toBigInt(paulB), multExpInPower, BIGPAULI)
222222 $Tuple2(nil, [a, paulB, wReservesInUsdn, multBR, multPower, toString(multExpInPower), toString(multK)])
223223 }
224224 }
225225
226226
227227
228228 @Callable(i)
229229 func curveFunctionREADONLY (wavesPayRaw) = {
230230 let neutrinoMetrics = asAnyList(invoke(this, "calcNeutinoMetricsREADONLY", nil, nil))
231231 let price = asInt(neutrinoMetrics[nMetricIdxPrice])
232232 let wRaw = asInt(neutrinoMetrics[nMetricIdxReserve])
233233 let uRaw = asInt(neutrinoMetrics[nMetricIdxUsdnSupply])
234234 let sRaw = asInt(neutrinoMetrics[nMetricIdxNsbtSupply])
235235 let mRaw = asInt(neutrinoMetrics[nMetricIdxMaxNsbtSupply])
236236 let kCalcArray = asAnyList(invoke(this, "calculateKREADONLY", [wRaw, uRaw, price, mRaw, sRaw], nil))
237237 let multK = parseBigIntValue(asString(kCalcArray[kResultIdxMultKStr]))
238238 let usdnPay = convertWavesToNeutrino(wavesPayRaw, price)
239239 let bigMaxNsbtSupply = toBigInt(mRaw)
240240 let bigNsbtSupply = toBigInt((mRaw - sRaw))
241241 let step1 = fraction(toBigInt(usdnPay), BIGMULT16, multK)
242242 let step2 = fraction(step1, bigNsbtSupply, bigMaxNsbtSupply)
243243 let step3 = toInt(fraction(bigNsbtSupply, bigMaxNsbtSupply, (step2 + bigMaxNsbtSupply)))
244244 let nsbtAmountRaw = ((mRaw - sRaw) - step3)
245245 $Tuple2(nil, [nsbtAmountRaw, usdnPay, wRaw, uRaw, mRaw, sRaw, asInt(kCalcArray[kResultIdxA]), asInt(kCalcArray[kResultIdxPaulB]), asInt(kCalcArray[kResultIdxWReservesInUsdn]), price, asInt(kCalcArray[kResultIdxMultBR]), asInt(kCalcArray[kResultIdxMultPower]), kCalcArray[kResultIdxMultExpInPowerStr], kCalcArray[kResultIdxMultKStr], toString(step1), toString(step2), step3])
246246 }
247247
248248
249249
250250 @Callable(i)
251251 func calcContractNsbtPriceSYSREADONLY (nsbtSupplyDELTA) = calcContractNsbtPriceInternal(nsbtSupplyDELTA)
252252
253253
254254
255255 @Callable(i)
256256 func calcNeutinoMetricsREADONLY () = {
257257 let currentPrice = getIntegerValue(controlContract, keyPrice())
258258 let neutrinoLockedBalance = valueOrElse(getInteger(neutrinoContract, keyNeutrinoLockedBalance()), 0)
259259 let wavesLockedBalance = valueOrElse(getInteger(neutrinoContract, keyWavesLockedBalance()), 0)
260260 let reserve = (wavesBalance(neutrinoContract).regular - wavesLockedBalance)
261261 let reservesInUsdn = convertWavesToNeutrino(reserve, currentPrice)
262262 let neutrinoSupply = (((neutrinoLockedBalance + value(assetInfo(neutrinoAssetId)).quantity) - assetBalance(neutrinoContract, neutrinoAssetId)) - assetBalance(liquidationContract, neutrinoAssetId))
263263 let surplus = (reservesInUsdn - neutrinoSupply)
264264 let deficit = (neutrinoSupply - reservesInUsdn)
265265 let surplusPercent = if ((neutrinoSupply == 0))
266266 then 0
267267 else (fraction(surplus, PAULI, neutrinoSupply) * 100)
268268 let BR = if ((neutrinoSupply == 0))
269269 then 0
270270 else fraction(reservesInUsdn, PAULI, neutrinoSupply)
271271 let nsbtSupplyMAX = value(assetInfo(nsbtAssetId)).quantity
272272 let nsbtSupply = (nsbtSupplyMAX - assetBalance(auctionContract, nsbtAssetId))
273273 $Tuple2(nil, [currentPrice, neutrinoLockedBalance, wavesLockedBalance, reserve, reservesInUsdn, neutrinoSupply, surplus, surplusPercent, BR, nsbtSupply, nsbtSupplyMAX])
274274 }
275275
276276
277277
278278 @Callable(i)
279279 func getUnstakeComissionAmountREADONLY (amount,startHeight,halfLife) = $Tuple2(nil, fraction(amount, pow(2, 0, fraction(-((height - startHeight)), MULT, halfLife), 8, 8, HALFUP), MULT))
280280
281281
282282
283283 @Callable(i)
284284 func mergeStakesREADONLY (amount1,height1,amount2,height2,halfLife) = {
285285 let w = fraction(amount2, pow(2, 0, fraction((height2 - height1), MULT, halfLife), 8, 8, HALFUP), MULT)
286286 let v = fraction((amount1 + amount2), MULT, (amount1 + w))
287287 $Tuple2(nil, (height1 + ((HALF8 - (halfLife * log(v, 8, 2, 0, 8, HALFUP))) / MULT)))
288288 }
289289
290290

github/deemru/w8io/026f985 
38.58 ms