tx · HLAmkic12CEcaCRssiCeCPrWKY4t1KaCpG8KYeytqv9J

3N1WjhmF3EyutvrvtsfsSLbhmiLU8Bc1Toy:  -0.01400000 Waves

2023.01.27 13:21 [2423245] smart account 3N1WjhmF3EyutvrvtsfsSLbhmiLU8Bc1Toy > SELF 0.00000000 Waves

{ "type": 13, "id": "HLAmkic12CEcaCRssiCeCPrWKY4t1KaCpG8KYeytqv9J", "fee": 1400000, "feeAssetId": null, "timestamp": 1674814974182, "version": 1, "sender": "3N1WjhmF3EyutvrvtsfsSLbhmiLU8Bc1Toy", "senderPublicKey": "8PYTpiaoJ6s5TkL4uwQK1Z575gkArpvk8mmAQ2b8P9dZ", "proofs": [ "3NihZhx49vg7qUxjvSmpB9nVjt2W26jHKqQDt6LJ1jzLnWHLWovZo15AXDKo8CqFTLJUM2mr9Ns5tyQKPr4WrmnJ" ], "script": "base64:BgIRCAISCAoGCAgCAgICEgMKAQEtAAtQcm90b2NvbFNFUAIBOgADU0VQAgJfXwAScGVyY2VudFByaWNlT2Zmc2V0AF8BCGtleVByaWNlAQZzeW1ib2wJAKwCAgINJXMlc19fcHJpY2VfXwUGc3ltYm9sAQprZXlPcmFjbGVzAAIVJXMlc19fY29uZmlnX19vcmFjbGVzAQxrZXlHcm91cERhdGEBCGdyb3VwTnVtCQCsAgICDSVzJWRfX2dyb3VwX18FCGdyb3VwTnVtAQ9rZXlNaW5Db25zZW5zdXMAAholcyVzX19jb25maWdfX21pbkNvbnNlbnN1cwEPa2V5UHJpY2VGYWlsdXJlAQZzeW1ib2wJALkJAgkAzAgCAhslcyVzJWRfX2ZpbmFsaXphdGlvbkZhaWx1cmUJAMwIAgUGc3ltYm9sCQDMCAIJAKQDAQUGaGVpZ2h0BQNuaWwFA1NFUAENa2V5TGFzdEhlaWdodAEGc3ltYm9sCQCsAgICEiVzJXNfX2xhc3RIZWlnaHRfXwUGc3ltYm9sARBrZXlQcmljZUJ5SGVpZ2h0AgZzeW1ib2wBaAkAuQkCCQDMCA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VkcyAyMQkBBSRmMF8yAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgUFJGFjYzAAAAABAAIAAwAEAAUABgAHAAgACQAKAAsADAANAA4ADwAQABEAEgATABQAFQkAlAoCBQNuaWwJAJYKBAUFcHJpY2UFCHByaWNlQXZnCAUMbWluTWF4U1RSVUNUAl8xCAUMbWluTWF4U1RSVUNUAl8yAJefFYU=", "chainId": 84, "height": 2423245, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8ZFeaUGZtBBCY2G3oeGG4ttWHxAffx4tQhExjDXMjAWV Next: none Diff:
OldNewDifferences
172172 let lpAmount = $t075807719._1
173173 let feeAmount1 = $t075807719._2
174174 let bonus = $t075807719._3
175- let $t077227840 = {
175+ let $t077227902 = {
176176 let @ = invoke(wxPoolAddress, "getOneTknV2READONLY", [usdtId, lpAmount], nil)
177177 if ($isInstanceOf(@, "(Int, Int)"))
178178 then @
179179 else throw(($getType(@) + " couldn't be cast to (Int, Int)"))
180180 }
181- let usdtAmount = $t077227840._1
182- let feeAmount2 = $t077227840._2
183- let newPrice = fraction(usdtAmount, 1000000, usdnAmount)
181+ let usdtAmount = $t077227902._1
182+ let feeAmount2 = $t077227902._2
183+ let newPrice = ((33 * 1000000) / 100)
184184 (PriceEntry(symbol, newPrice, true) ++ StatsEntry(symbol, newPrice))
185185 }
186186
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let ProtocolSEP = ":"
55
66 let SEP = "__"
77
88 let percentPriceOffset = 95
99
1010 func keyPrice (symbol) = ("%s%s__price__" + symbol)
1111
1212
1313 func keyOracles () = "%s%s__config__oracles"
1414
1515
1616 func keyGroupData (groupNum) = ("%s%d__group__" + groupNum)
1717
1818
1919 func keyMinConsensus () = "%s%s__config__minConsensus"
2020
2121
2222 func keyPriceFailure (symbol) = makeString(["%s%s%d__finalizationFailure", symbol, toString(height)], SEP)
2323
2424
2525 func keyLastHeight (symbol) = ("%s%s__lastHeight__" + symbol)
2626
2727
2828 func keyPriceByHeight (symbol,h) = makeString(["%s%s%d__priceByHeight", symbol, toString(h)], SEP)
2929
3030
3131 func keyIdx (symbol) = ("%s%s__idxCurrent__" + symbol)
3232
3333
3434 func keyIdx2Height (symbol,idx) = makeString(["%s%s%d__idx2Height", symbol, toString(idx)], SEP)
3535
3636
3737 func keyHeight2Idx (symbol,h) = makeString(["%s%s%d__height2Idx", symbol, toString(h)], SEP)
3838
3939
4040 func keyGroupStatus (groupNum,finHeightStr) = makeString(["%s%d%d__groupStatus", groupNum, finHeightStr], SEP)
4141
4242
4343 func keyIsMarketOpened (symbol) = ("%s%s__isMarketOpened__" + symbol)
4444
4545
4646 func keyEmptyPriceMsg (position) = makeString(["%s%d%d__emptyPriceMsg", toString(height), toString(position)], SEP)
4747
4848
4949 func keyIsBlocked (symbol) = ("%s%s__isBlocked__" + symbol)
5050
5151
5252 func keyIsBlockedSender (symbol) = makeString(["%s%s%s__isBlocked", symbol, "sender"], SEP)
5353
5454
5555 func keyIsBlockedReason (symbol) = makeString(["%s%s%s__isBlocked", symbol, "reason"], SEP)
5656
5757
5858 func keyBlackSwarmPrice (h,symbol) = makeString(["%s%s%s%d__isBlocked", symbol, "blackSwarmPrice", toString(h)], SEP)
5959
6060
6161 let DAYMILLIS = 86400000
6262
6363 let H4MILLIS = 14400000
6464
6565 func toPeriod (timestamp,period) = ((timestamp / period) * period)
6666
6767
6868 func keyStats1stPeriod (symbol) = makeString(["%s%s", "stats1stPeriod", symbol], SEP)
6969
7070
7171 func keyStatsPriceSum (symbol) = makeString(["%s%s", "statsPriceSum", symbol], SEP)
7272
7373
7474 func keyStatsCountSum (symbol) = makeString(["%s%s", "statsCountSum", symbol], SEP)
7575
7676
7777 func keyStatsByPeriodPriceSum (symbol,period) = makeString(["%s%s%d", "statsPriceSum", symbol, period], SEP)
7878
7979
8080 func keyStatsByPeriodCountSum (symbol,period) = makeString(["%s%s%d", "statsCountSum", symbol, period], SEP)
8181
8282
8383 func keyStatsByPeriodMin (symbol,period) = makeString(["%s%s%d", "statsPriceMin", symbol, period], SEP)
8484
8585
8686 func keyStatsByPeriodMax (symbol,period) = makeString(["%s%s%d", "statsPriceMax", symbol, period], SEP)
8787
8888
8989 func StatsEntry (symbol,price) = {
9090 let period = toPeriod(lastBlock.timestamp, H4MILLIS)
9191 let periodStr = toString(period)
9292 let stats1stPeriodKEY = keyStats1stPeriod(symbol)
9393 let statsPriceSumKEY = keyStatsPriceSum(symbol)
9494 let statsCountSumKEY = keyStatsCountSum(symbol)
9595 let statsByPeriodPriceSumKEY = keyStatsByPeriodPriceSum(symbol, periodStr)
9696 let statsByPeriodCountSumKEY = keyStatsByPeriodCountSum(symbol, periodStr)
9797 let statsByPeriodMinKEY = keyStatsByPeriodMin(symbol, periodStr)
9898 let statsByPeriodMaxKEY = keyStatsByPeriodMax(symbol, periodStr)
9999 let statsPriceSum = parseBigIntValue(valueOrElse(getString(this, statsPriceSumKEY), "0"))
100100 let statsCountSum = valueOrElse(getInteger(this, statsCountSumKEY), 0)
101101 let statsByPeriodMin = valueOrElse(getInteger(this, statsByPeriodMinKEY), 9223372036854775)
102102 let statsByPeriodMax = valueOrElse(getInteger(this, statsByPeriodMaxKEY), 0)
103103 let newStatsPriceSum = (statsPriceSum + toBigInt(price))
104104 let newStatsCountSum = (statsCountSum + 1)
105105 let newStatsByPeriodPriceSum = newStatsPriceSum
106106 let newStatsByPeriodCountSum = newStatsCountSum
107107 let newStatsByPeriodMin = min([statsByPeriodMin, price])
108108 let newStatsByPeriodMax = max([statsByPeriodMax, price])
109109 let stats1stPeriod = valueOrElse(getInteger(this, stats1stPeriodKEY), -1)
110110 ([StringEntry(statsPriceSumKEY, toString(newStatsPriceSum)), IntegerEntry(statsCountSumKEY, newStatsCountSum), StringEntry(statsByPeriodPriceSumKEY, toString(newStatsByPeriodPriceSum)), IntegerEntry(statsByPeriodCountSumKEY, newStatsByPeriodCountSum), IntegerEntry(statsByPeriodMinKEY, newStatsByPeriodMin), IntegerEntry(statsByPeriodMaxKEY, newStatsByPeriodMax)] ++ (if ((0 > stats1stPeriod))
111111 then [IntegerEntry(stats1stPeriodKEY, period)]
112112 else nil))
113113 }
114114
115115
116116 func isGroupFinalaized (groupNum,finHeightStr) = isDefined(getBoolean(this, keyGroupStatus(groupNum, finHeightStr)))
117117
118118
119119 func readGroupDataOrFail (groupNum) = {
120120 let k = keyGroupData(groupNum)
121121 let groupDataOpt = getString(this, k)
122122 if (isDefined(groupDataOpt))
123123 then value(groupDataOpt)
124124 else throw(("empty group data for key=" + k))
125125 }
126126
127127
128128 let pubKeyOraclesList = split(getStringValue(this, keyOracles()), ",")
129129
130130 let oracleCount = size(pubKeyOraclesList)
131131
132132 let minConsensus = valueOrElse(getInteger(this, keyMinConsensus()), 3)
133133
134134 func PriceFailedResult (symbol,msg) = [StringEntry(keyPriceFailure(symbol), msg)]
135135
136136
137137 func throwInvalidFinalizationHeight (finHeightStr) = throw(((("invalid finalization height: height=" + toString(height)) + " finalizationHeight=") + finHeightStr))
138138
139139
140140 func throwGroupAlreadyFinalized (groupNum,finHeightStr) = throw((((("prices for groupNum=" + groupNum) + " at ") + finHeightStr) + " height have been already finalized"))
141141
142142
143143 func throwInvalidSignsParamLength (num,param) = throw(((((("invalid signs" + toString(num)) + " parameter: actual.size=") + toString(size(param))) + " base58Val=") + toBase58String(param)))
144144
145145
146146 func throwOutOfTurnFinalization () = throw(((("Out of turn finalization: " + toString(height)) + " block should be finalize by ") + pubKeyOraclesList[(height % oracleCount)]))
147147
148148
149149 func throwBlockedError () = throw("contract is blocked by EMERGENCY SHUTDOWN action")
150150
151151
152152 func PriceEntry (symbol,newPrice,isMarketOpened) = {
153153 let idx = valueOrElse(getInteger(this, keyIdx(symbol)), 0)
154154 let newIdx = (idx + 1)
155155 [IntegerEntry(keyPrice(symbol), newPrice), IntegerEntry(keyLastHeight(symbol), height), IntegerEntry(keyPriceByHeight(symbol, height), newPrice), IntegerEntry(keyIdx(symbol), newIdx), IntegerEntry(keyIdx2Height(symbol, newIdx), height), IntegerEntry(keyHeight2Idx(symbol, height), newIdx), BooleanEntry(keyIsMarketOpened(symbol), isMarketOpened)]
156156 }
157157
158158
159159 func finalizeUsdnUsdtOnchain () = {
160160 let symbol = "USDN-USDT"
161161 let usdnId = "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"
162162 let usdtId = "5Sh9KghfkZyhjwuodovDhB6PghDUGBHiAPZ4MkrPgKtX"
163163 let usdnAmount = 1000000000
164164 let wxPoolAddressStr = "3NAefciWv6f9fWvEXdGgpHfanJFG8HqfjuT"
165165 let wxPoolAddress = addressFromStringValue(wxPoolAddressStr)
166166 let $t075807719 = {
167167 let @ = invoke(wxPoolAddress, "putOneTknV2WithBonusREADONLY", [usdnAmount, usdnId], nil)
168168 if ($isInstanceOf(@, "(Int, Int, Int)"))
169169 then @
170170 else throw(($getType(@) + " couldn't be cast to (Int, Int, Int)"))
171171 }
172172 let lpAmount = $t075807719._1
173173 let feeAmount1 = $t075807719._2
174174 let bonus = $t075807719._3
175- let $t077227840 = {
175+ let $t077227902 = {
176176 let @ = invoke(wxPoolAddress, "getOneTknV2READONLY", [usdtId, lpAmount], nil)
177177 if ($isInstanceOf(@, "(Int, Int)"))
178178 then @
179179 else throw(($getType(@) + " couldn't be cast to (Int, Int)"))
180180 }
181- let usdtAmount = $t077227840._1
182- let feeAmount2 = $t077227840._2
183- let newPrice = fraction(usdtAmount, 1000000, usdnAmount)
181+ let usdtAmount = $t077227902._1
182+ let feeAmount2 = $t077227902._2
183+ let newPrice = ((33 * 1000000) / 100)
184184 (PriceEntry(symbol, newPrice, true) ++ StatsEntry(symbol, newPrice))
185185 }
186186
187187
188188 func finalizePriceV2Common (position,groupNum,groupDataStr,msgArray,signs) = {
189189 let msgOffset = (position * 3)
190190 if ((msgOffset >= size(msgArray)))
191191 then [StringEntry(keyEmptyPriceMsg(position), "price data is empty")]
192192 else {
193193 let symbol = msgArray[(msgOffset + 0)]
194194 let newPriceStr = msgArray[(msgOffset + 1)]
195195 let isMarketOpenedStr = msgArray[(msgOffset + 2)]
196196 let newPriceOpt = parseInt(newPriceStr)
197197 let isMarketOpenedOpt = parseInt(isMarketOpenedStr)
198198 let sig0 = take(signs, 64)
199199 let sig1 = take(drop(signs, 64), 64)
200200 let sig2 = take(drop(signs, 128), 64)
201201 let sig3 = take(drop(signs, 192), 64)
202202 let sig4 = takeRight(signs, 64)
203203 let isBlocked = valueOrElse(getBoolean(this, keyIsBlocked(symbol)), false)
204204 if ((symbol == ""))
205205 then nil
206206 else if (isBlocked)
207207 then PriceFailedResult(symbol, (symbol + " is blocked"))
208208 else if (contains(groupDataStr, symbol))
209209 then if (if (isDefined(newPriceOpt))
210210 then isDefined(isMarketOpenedOpt)
211211 else false)
212212 then {
213213 let newPrice = value(newPriceOpt)
214214 let isMarketOpened = if ((value(isMarketOpenedOpt) == 1))
215215 then true
216216 else false
217217 let priceMsgStr = makeString(["WAVES-DORA2", groupNum, toString(height), symbol, newPriceStr, isMarketOpenedStr], ProtocolSEP)
218218 let priceMsg = toBytes(priceMsgStr)
219219 let verificationsCount = (((((if (sigVerify_8Kb(priceMsg, sig0, fromBase58String(pubKeyOraclesList[0])))
220220 then 1
221221 else 0) + (if (sigVerify_8Kb(priceMsg, sig1, fromBase58String(pubKeyOraclesList[1])))
222222 then 1
223223 else 0)) + (if (sigVerify_8Kb(priceMsg, sig2, fromBase58String(pubKeyOraclesList[2])))
224224 then 1
225225 else 0)) + (if (sigVerify_8Kb(priceMsg, sig3, fromBase58String(pubKeyOraclesList[3])))
226226 then 1
227227 else 0)) + (if (sigVerify_8Kb(priceMsg, sig4, fromBase58String(pubKeyOraclesList[4])))
228228 then 1
229229 else 0))
230230 if ((verificationsCount >= minConsensus))
231231 then {
232232 let price = valueOrElse(getInteger(this, keyPrice(symbol)), 0)
233233 if (if ((price != 0))
234234 then if ((newPrice >= (price + ((price * percentPriceOffset) / 100))))
235235 then true
236236 else ((price - ((price * percentPriceOffset) / 100)) >= newPrice)
237237 else false)
238238 then {
239239 let reason = "automatic emergency shutdown because of large price variability"
240240 [BooleanEntry(keyIsBlocked(symbol), true), StringEntry(keyIsBlockedSender(symbol), toString(this)), StringEntry(keyIsBlockedReason(symbol), reason), IntegerEntry(keyBlackSwarmPrice(height, symbol), newPrice)]
241241 }
242242 else (PriceEntry(symbol, newPrice, isMarketOpened) ++ StatsEntry(symbol, newPrice))
243243 }
244244 else PriceFailedResult(symbol, ((((((((("verificationsCount = " + toString(verificationsCount)) + "signs0.length=") + toString(size(signs))) + " msg0 = ") + priceMsgStr) + " sig0 = ") + toBase58String(sig0)) + " key0 = ") + pubKeyOraclesList[0]))
245245 }
246246 else PriceFailedResult(symbol, ((("data parsing error: newPrice=" + newPriceStr) + " isMarketOpened=") + isMarketOpenedStr))
247247 else PriceFailedResult(symbol, ((symbol + " doesn't exist in group: groupDataStr=") + groupDataStr))
248248 }
249249 }
250250
251251
252252 @Callable(i)
253253 func finalizeDORA2 (header,msg,signs0,signs1,signs2,signs3) = {
254254 let headerArray = split(header, ProtocolSEP)
255255 let groupNum = headerArray[1]
256256 let finHeightStr = headerArray[2]
257257 let finHeight = parseIntValue(finHeightStr)
258258 let signsLength = (64 * oracleCount)
259259 if ((height != finHeight))
260260 then throwInvalidFinalizationHeight(finHeightStr)
261261 else if (isGroupFinalaized(groupNum, finHeightStr))
262262 then throwGroupAlreadyFinalized(groupNum, finHeightStr)
263263 else if ((pubKeyOraclesList[(height % oracleCount)] != toBase58String(i.callerPublicKey)))
264264 then throwOutOfTurnFinalization()
265265 else if ((size(signs0) != signsLength))
266266 then throwInvalidSignsParamLength(0, signs0)
267267 else if ((size(signs1) != signsLength))
268268 then throwInvalidSignsParamLength(1, signs1)
269269 else if ((size(signs2) != signsLength))
270270 then throwInvalidSignsParamLength(2, signs2)
271271 else if ((size(signs3) != signsLength))
272272 then throwInvalidSignsParamLength(3, signs3)
273273 else {
274274 let groupDataKey = keyGroupData(groupNum)
275275 let groupDataStr = valueOrErrorMessage(getString(this, groupDataKey), ("empty group data for key=" + groupDataKey))
276276 let msgArray = split(msg, ProtocolSEP)
277277 if (((size(msgArray) % 3) != 0))
278278 then throw(("msg parameters count must be multiple of 3: msgArray.size=" + toString(size(msg))))
279279 else ((((finalizePriceV2Common(0, groupNum, groupDataStr, msgArray, signs0) ++ finalizePriceV2Common(1, groupNum, groupDataStr, msgArray, signs1)) ++ finalizePriceV2Common(2, groupNum, groupDataStr, msgArray, signs2)) ++ finalizeUsdnUsdtOnchain()) :+ BooleanEntry(keyGroupStatus(groupNum, finHeightStr), true))
280280 }
281281 }
282282
283283
284284
285285 @Callable(i)
286286 func price (hours) = {
287287 let symbol = "USDN-USDT"
288288 let periodSTEP = H4MILLIS
289289 let maxHours = 80
290290 let iters = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]
291291 if ((hours > maxHours))
292292 then throw("hours is greater then max 80")
293293 else if ((4 > hours))
294294 then throw("hours is less then min value 4")
295295 else {
296296 let currTime = lastBlock.timestamp
297297 let startTime = ((currTime - (hours * 3600000)) - H4MILLIS)
298298 let period = toPeriod(currTime, periodSTEP)
299299 let periodStr = toString(period)
300300 let smallestPeriod = getIntegerValue(this, keyStats1stPeriod(symbol))
301301 let startPeriodTmp = toPeriod(startTime, periodSTEP)
302302 let isEnoughData = (startPeriodTmp >= smallestPeriod)
303303 let startPeriod = if (isEnoughData)
304304 then startPeriodTmp
305305 else smallestPeriod
306306 let startPeriodStr = toString(startPeriod)
307307 let startPriceSumX = parseBigIntValue(getStringValue(this, keyStatsByPeriodPriceSum(symbol, startPeriodStr)))
308308 let startCountSum = getIntegerValue(this, keyStatsByPeriodCountSum(symbol, startPeriodStr))
309309 let endPriceSumX = if (isEnoughData)
310310 then parseBigIntValue(getStringValue(this, keyStatsByPeriodPriceSum(symbol, periodStr)))
311311 else toBigInt(0)
312312 let endCountSum = if (isEnoughData)
313313 then getIntegerValue(this, keyStatsByPeriodCountSum(symbol, periodStr))
314314 else 0
315315 let priceSum = toInt((endPriceSumX - startPriceSumX))
316316 let priceCount = (endCountSum - startCountSum)
317317 let priceAvg = (priceSum / priceCount)
318318 if ((0 >= priceAvg))
319319 then throw("calculation error")
320320 else {
321321 func findMinMax (minAndMax,nextIdx) = {
322322 let periodToCheck = (period - (nextIdx * periodSTEP))
323323 if ((startPeriod > periodToCheck))
324324 then minAndMax
325325 else {
326326 let periodToCheckStr = toString(periodToCheck)
327327 let minVal = minAndMax._1
328328 let maxVal = minAndMax._2
329329 let newMinVal = getIntegerValue(this, keyStatsByPeriodMin(symbol, periodToCheckStr))
330330 let newMaxVal = getIntegerValue(this, keyStatsByPeriodMax(symbol, periodToCheckStr))
331331 $Tuple2(min([minVal, newMinVal]), max([maxVal, newMaxVal]))
332332 }
333333 }
334334
335335 let price = getIntegerValue(this, keyPrice(symbol))
336336 let minMaxSTRUCT = {
337337 let $l = iters
338338 let $s = size($l)
339339 let $acc0 = $Tuple2(9223372036854775, 0)
340340 func $f0_1 ($a,$i) = if (($i >= $s))
341341 then $a
342342 else findMinMax($a, $l[$i])
343343
344344 func $f0_2 ($a,$i) = if (($i >= $s))
345345 then $a
346346 else throw("List size exceeds 21")
347347
348348 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21)
349349 }
350350 $Tuple2(nil, $Tuple4(price, priceAvg, minMaxSTRUCT._1, minMaxSTRUCT._2))
351351 }
352352 }
353353 }
354354
355355

github/deemru/w8io/026f985 
62.14 ms