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:BgIRCAISCAoGCAgCAgICEgMKAQEtAAtQcm90b2NvbFNFUAIBOgADU0VQAgJfXwAScGVyY2VudFByaWNlT2Zmc2V0AF8BCGtleVByaWNlAQZzeW1ib2wJAKwCAgINJXMlc19fcHJpY2VfXwUGc3ltYm9sAQprZXlPcmFjbGVzAAIVJXMlc19fY29uZmlnX19vcmFjbGVzAQxrZXlHcm91cERhdGEBCGdyb3VwTnVtCQCsAgICDSVzJWRfX2dyb3VwX18FCGdyb3VwTnVtAQ9rZXlNaW5Db25zZW5zdXMAAholcyVzX19jb25maWdfX21pbkNvbnNlbnN1cwEPa2V5UHJpY2VGYWlsdXJlAQZzeW1ib2wJALkJAgkAzAgCAhslcyVzJWRfX2ZpbmFsaXphdGlvbkZhaWx1cmUJAMwIAgUGc3ltYm9sCQDMCAIJAKQDAQUGaGVpZ2h0BQNuaWwFA1NFUAENa2V5TGFzdEhlaWdodAEGc3ltYm9sCQCsAgICEiVzJXNfX2xhc3RIZWlnaHRfXwUGc3ltYm9sARBrZXlQcmljZUJ5SGVpZ2h0AgZzeW1ib2wBaAkAuQkCCQDMCAIC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kcyAyMQkBBSRmMF8yAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgUFJGFjYzAAAAABAAIAAwAEAAUABgAHAAgACQAKAAsADAANAA4ADwAQABEAEgATABQAFQkAlAoCBQNuaWwJAJYKBAUFcHJpY2UFCHByaWNlQXZnCAUMbWluTWF4U1RSVUNUAl8xCAUMbWluTWF4U1RSVUNUAl8yAJefFYU=", "chainId": 84, "height": 2423245, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8ZFeaUGZtBBCY2G3oeGG4ttWHxAffx4tQhExjDXMjAWV Next: none Diff:
Old | New | Differences | |
---|---|---|---|
172 | 172 | let lpAmount = $t075807719._1 | |
173 | 173 | let feeAmount1 = $t075807719._2 | |
174 | 174 | let bonus = $t075807719._3 | |
175 | - | let $ | |
175 | + | let $t077227902 = { | |
176 | 176 | let @ = invoke(wxPoolAddress, "getOneTknV2READONLY", [usdtId, lpAmount], nil) | |
177 | 177 | if ($isInstanceOf(@, "(Int, Int)")) | |
178 | 178 | then @ | |
179 | 179 | else throw(($getType(@) + " couldn't be cast to (Int, Int)")) | |
180 | 180 | } | |
181 | - | let usdtAmount = $ | |
182 | - | let feeAmount2 = $ | |
183 | - | let newPrice = | |
181 | + | let usdtAmount = $t077227902._1 | |
182 | + | let feeAmount2 = $t077227902._2 | |
183 | + | let newPrice = ((33 * 1000000) / 100) | |
184 | 184 | (PriceEntry(symbol, newPrice, true) ++ StatsEntry(symbol, newPrice)) | |
185 | 185 | } | |
186 | 186 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let ProtocolSEP = ":" | |
5 | 5 | ||
6 | 6 | let SEP = "__" | |
7 | 7 | ||
8 | 8 | let percentPriceOffset = 95 | |
9 | 9 | ||
10 | 10 | func keyPrice (symbol) = ("%s%s__price__" + symbol) | |
11 | 11 | ||
12 | 12 | ||
13 | 13 | func keyOracles () = "%s%s__config__oracles" | |
14 | 14 | ||
15 | 15 | ||
16 | 16 | func keyGroupData (groupNum) = ("%s%d__group__" + groupNum) | |
17 | 17 | ||
18 | 18 | ||
19 | 19 | func keyMinConsensus () = "%s%s__config__minConsensus" | |
20 | 20 | ||
21 | 21 | ||
22 | 22 | func keyPriceFailure (symbol) = makeString(["%s%s%d__finalizationFailure", symbol, toString(height)], SEP) | |
23 | 23 | ||
24 | 24 | ||
25 | 25 | func keyLastHeight (symbol) = ("%s%s__lastHeight__" + symbol) | |
26 | 26 | ||
27 | 27 | ||
28 | 28 | func keyPriceByHeight (symbol,h) = makeString(["%s%s%d__priceByHeight", symbol, toString(h)], SEP) | |
29 | 29 | ||
30 | 30 | ||
31 | 31 | func keyIdx (symbol) = ("%s%s__idxCurrent__" + symbol) | |
32 | 32 | ||
33 | 33 | ||
34 | 34 | func keyIdx2Height (symbol,idx) = makeString(["%s%s%d__idx2Height", symbol, toString(idx)], SEP) | |
35 | 35 | ||
36 | 36 | ||
37 | 37 | func keyHeight2Idx (symbol,h) = makeString(["%s%s%d__height2Idx", symbol, toString(h)], SEP) | |
38 | 38 | ||
39 | 39 | ||
40 | 40 | func keyGroupStatus (groupNum,finHeightStr) = makeString(["%s%d%d__groupStatus", groupNum, finHeightStr], SEP) | |
41 | 41 | ||
42 | 42 | ||
43 | 43 | func keyIsMarketOpened (symbol) = ("%s%s__isMarketOpened__" + symbol) | |
44 | 44 | ||
45 | 45 | ||
46 | 46 | func keyEmptyPriceMsg (position) = makeString(["%s%d%d__emptyPriceMsg", toString(height), toString(position)], SEP) | |
47 | 47 | ||
48 | 48 | ||
49 | 49 | func keyIsBlocked (symbol) = ("%s%s__isBlocked__" + symbol) | |
50 | 50 | ||
51 | 51 | ||
52 | 52 | func keyIsBlockedSender (symbol) = makeString(["%s%s%s__isBlocked", symbol, "sender"], SEP) | |
53 | 53 | ||
54 | 54 | ||
55 | 55 | func keyIsBlockedReason (symbol) = makeString(["%s%s%s__isBlocked", symbol, "reason"], SEP) | |
56 | 56 | ||
57 | 57 | ||
58 | 58 | func keyBlackSwarmPrice (h,symbol) = makeString(["%s%s%s%d__isBlocked", symbol, "blackSwarmPrice", toString(h)], SEP) | |
59 | 59 | ||
60 | 60 | ||
61 | 61 | let DAYMILLIS = 86400000 | |
62 | 62 | ||
63 | 63 | let H4MILLIS = 14400000 | |
64 | 64 | ||
65 | 65 | func toPeriod (timestamp,period) = ((timestamp / period) * period) | |
66 | 66 | ||
67 | 67 | ||
68 | 68 | func keyStats1stPeriod (symbol) = makeString(["%s%s", "stats1stPeriod", symbol], SEP) | |
69 | 69 | ||
70 | 70 | ||
71 | 71 | func keyStatsPriceSum (symbol) = makeString(["%s%s", "statsPriceSum", symbol], SEP) | |
72 | 72 | ||
73 | 73 | ||
74 | 74 | func keyStatsCountSum (symbol) = makeString(["%s%s", "statsCountSum", symbol], SEP) | |
75 | 75 | ||
76 | 76 | ||
77 | 77 | func keyStatsByPeriodPriceSum (symbol,period) = makeString(["%s%s%d", "statsPriceSum", symbol, period], SEP) | |
78 | 78 | ||
79 | 79 | ||
80 | 80 | func keyStatsByPeriodCountSum (symbol,period) = makeString(["%s%s%d", "statsCountSum", symbol, period], SEP) | |
81 | 81 | ||
82 | 82 | ||
83 | 83 | func keyStatsByPeriodMin (symbol,period) = makeString(["%s%s%d", "statsPriceMin", symbol, period], SEP) | |
84 | 84 | ||
85 | 85 | ||
86 | 86 | func keyStatsByPeriodMax (symbol,period) = makeString(["%s%s%d", "statsPriceMax", symbol, period], SEP) | |
87 | 87 | ||
88 | 88 | ||
89 | 89 | func StatsEntry (symbol,price) = { | |
90 | 90 | let period = toPeriod(lastBlock.timestamp, H4MILLIS) | |
91 | 91 | let periodStr = toString(period) | |
92 | 92 | let stats1stPeriodKEY = keyStats1stPeriod(symbol) | |
93 | 93 | let statsPriceSumKEY = keyStatsPriceSum(symbol) | |
94 | 94 | let statsCountSumKEY = keyStatsCountSum(symbol) | |
95 | 95 | let statsByPeriodPriceSumKEY = keyStatsByPeriodPriceSum(symbol, periodStr) | |
96 | 96 | let statsByPeriodCountSumKEY = keyStatsByPeriodCountSum(symbol, periodStr) | |
97 | 97 | let statsByPeriodMinKEY = keyStatsByPeriodMin(symbol, periodStr) | |
98 | 98 | let statsByPeriodMaxKEY = keyStatsByPeriodMax(symbol, periodStr) | |
99 | 99 | let statsPriceSum = parseBigIntValue(valueOrElse(getString(this, statsPriceSumKEY), "0")) | |
100 | 100 | let statsCountSum = valueOrElse(getInteger(this, statsCountSumKEY), 0) | |
101 | 101 | let statsByPeriodMin = valueOrElse(getInteger(this, statsByPeriodMinKEY), 9223372036854775) | |
102 | 102 | let statsByPeriodMax = valueOrElse(getInteger(this, statsByPeriodMaxKEY), 0) | |
103 | 103 | let newStatsPriceSum = (statsPriceSum + toBigInt(price)) | |
104 | 104 | let newStatsCountSum = (statsCountSum + 1) | |
105 | 105 | let newStatsByPeriodPriceSum = newStatsPriceSum | |
106 | 106 | let newStatsByPeriodCountSum = newStatsCountSum | |
107 | 107 | let newStatsByPeriodMin = min([statsByPeriodMin, price]) | |
108 | 108 | let newStatsByPeriodMax = max([statsByPeriodMax, price]) | |
109 | 109 | let stats1stPeriod = valueOrElse(getInteger(this, stats1stPeriodKEY), -1) | |
110 | 110 | ([StringEntry(statsPriceSumKEY, toString(newStatsPriceSum)), IntegerEntry(statsCountSumKEY, newStatsCountSum), StringEntry(statsByPeriodPriceSumKEY, toString(newStatsByPeriodPriceSum)), IntegerEntry(statsByPeriodCountSumKEY, newStatsByPeriodCountSum), IntegerEntry(statsByPeriodMinKEY, newStatsByPeriodMin), IntegerEntry(statsByPeriodMaxKEY, newStatsByPeriodMax)] ++ (if ((0 > stats1stPeriod)) | |
111 | 111 | then [IntegerEntry(stats1stPeriodKEY, period)] | |
112 | 112 | else nil)) | |
113 | 113 | } | |
114 | 114 | ||
115 | 115 | ||
116 | 116 | func isGroupFinalaized (groupNum,finHeightStr) = isDefined(getBoolean(this, keyGroupStatus(groupNum, finHeightStr))) | |
117 | 117 | ||
118 | 118 | ||
119 | 119 | func readGroupDataOrFail (groupNum) = { | |
120 | 120 | let k = keyGroupData(groupNum) | |
121 | 121 | let groupDataOpt = getString(this, k) | |
122 | 122 | if (isDefined(groupDataOpt)) | |
123 | 123 | then value(groupDataOpt) | |
124 | 124 | else throw(("empty group data for key=" + k)) | |
125 | 125 | } | |
126 | 126 | ||
127 | 127 | ||
128 | 128 | let pubKeyOraclesList = split(getStringValue(this, keyOracles()), ",") | |
129 | 129 | ||
130 | 130 | let oracleCount = size(pubKeyOraclesList) | |
131 | 131 | ||
132 | 132 | let minConsensus = valueOrElse(getInteger(this, keyMinConsensus()), 3) | |
133 | 133 | ||
134 | 134 | func PriceFailedResult (symbol,msg) = [StringEntry(keyPriceFailure(symbol), msg)] | |
135 | 135 | ||
136 | 136 | ||
137 | 137 | func throwInvalidFinalizationHeight (finHeightStr) = throw(((("invalid finalization height: height=" + toString(height)) + " finalizationHeight=") + finHeightStr)) | |
138 | 138 | ||
139 | 139 | ||
140 | 140 | func throwGroupAlreadyFinalized (groupNum,finHeightStr) = throw((((("prices for groupNum=" + groupNum) + " at ") + finHeightStr) + " height have been already finalized")) | |
141 | 141 | ||
142 | 142 | ||
143 | 143 | func throwInvalidSignsParamLength (num,param) = throw(((((("invalid signs" + toString(num)) + " parameter: actual.size=") + toString(size(param))) + " base58Val=") + toBase58String(param))) | |
144 | 144 | ||
145 | 145 | ||
146 | 146 | func throwOutOfTurnFinalization () = throw(((("Out of turn finalization: " + toString(height)) + " block should be finalize by ") + pubKeyOraclesList[(height % oracleCount)])) | |
147 | 147 | ||
148 | 148 | ||
149 | 149 | func throwBlockedError () = throw("contract is blocked by EMERGENCY SHUTDOWN action") | |
150 | 150 | ||
151 | 151 | ||
152 | 152 | func PriceEntry (symbol,newPrice,isMarketOpened) = { | |
153 | 153 | let idx = valueOrElse(getInteger(this, keyIdx(symbol)), 0) | |
154 | 154 | let newIdx = (idx + 1) | |
155 | 155 | [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)] | |
156 | 156 | } | |
157 | 157 | ||
158 | 158 | ||
159 | 159 | func finalizeUsdnUsdtOnchain () = { | |
160 | 160 | let symbol = "USDN-USDT" | |
161 | 161 | let usdnId = "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT" | |
162 | 162 | let usdtId = "5Sh9KghfkZyhjwuodovDhB6PghDUGBHiAPZ4MkrPgKtX" | |
163 | 163 | let usdnAmount = 1000000000 | |
164 | 164 | let wxPoolAddressStr = "3NAefciWv6f9fWvEXdGgpHfanJFG8HqfjuT" | |
165 | 165 | let wxPoolAddress = addressFromStringValue(wxPoolAddressStr) | |
166 | 166 | let $t075807719 = { | |
167 | 167 | let @ = invoke(wxPoolAddress, "putOneTknV2WithBonusREADONLY", [usdnAmount, usdnId], nil) | |
168 | 168 | if ($isInstanceOf(@, "(Int, Int, Int)")) | |
169 | 169 | then @ | |
170 | 170 | else throw(($getType(@) + " couldn't be cast to (Int, Int, Int)")) | |
171 | 171 | } | |
172 | 172 | let lpAmount = $t075807719._1 | |
173 | 173 | let feeAmount1 = $t075807719._2 | |
174 | 174 | let bonus = $t075807719._3 | |
175 | - | let $ | |
175 | + | let $t077227902 = { | |
176 | 176 | let @ = invoke(wxPoolAddress, "getOneTknV2READONLY", [usdtId, lpAmount], nil) | |
177 | 177 | if ($isInstanceOf(@, "(Int, Int)")) | |
178 | 178 | then @ | |
179 | 179 | else throw(($getType(@) + " couldn't be cast to (Int, Int)")) | |
180 | 180 | } | |
181 | - | let usdtAmount = $ | |
182 | - | let feeAmount2 = $ | |
183 | - | let newPrice = | |
181 | + | let usdtAmount = $t077227902._1 | |
182 | + | let feeAmount2 = $t077227902._2 | |
183 | + | let newPrice = ((33 * 1000000) / 100) | |
184 | 184 | (PriceEntry(symbol, newPrice, true) ++ StatsEntry(symbol, newPrice)) | |
185 | 185 | } | |
186 | 186 | ||
187 | 187 | ||
188 | 188 | func finalizePriceV2Common (position,groupNum,groupDataStr,msgArray,signs) = { | |
189 | 189 | let msgOffset = (position * 3) | |
190 | 190 | if ((msgOffset >= size(msgArray))) | |
191 | 191 | then [StringEntry(keyEmptyPriceMsg(position), "price data is empty")] | |
192 | 192 | else { | |
193 | 193 | let symbol = msgArray[(msgOffset + 0)] | |
194 | 194 | let newPriceStr = msgArray[(msgOffset + 1)] | |
195 | 195 | let isMarketOpenedStr = msgArray[(msgOffset + 2)] | |
196 | 196 | let newPriceOpt = parseInt(newPriceStr) | |
197 | 197 | let isMarketOpenedOpt = parseInt(isMarketOpenedStr) | |
198 | 198 | let sig0 = take(signs, 64) | |
199 | 199 | let sig1 = take(drop(signs, 64), 64) | |
200 | 200 | let sig2 = take(drop(signs, 128), 64) | |
201 | 201 | let sig3 = take(drop(signs, 192), 64) | |
202 | 202 | let sig4 = takeRight(signs, 64) | |
203 | 203 | let isBlocked = valueOrElse(getBoolean(this, keyIsBlocked(symbol)), false) | |
204 | 204 | if ((symbol == "")) | |
205 | 205 | then nil | |
206 | 206 | else if (isBlocked) | |
207 | 207 | then PriceFailedResult(symbol, (symbol + " is blocked")) | |
208 | 208 | else if (contains(groupDataStr, symbol)) | |
209 | 209 | then if (if (isDefined(newPriceOpt)) | |
210 | 210 | then isDefined(isMarketOpenedOpt) | |
211 | 211 | else false) | |
212 | 212 | then { | |
213 | 213 | let newPrice = value(newPriceOpt) | |
214 | 214 | let isMarketOpened = if ((value(isMarketOpenedOpt) == 1)) | |
215 | 215 | then true | |
216 | 216 | else false | |
217 | 217 | let priceMsgStr = makeString(["WAVES-DORA2", groupNum, toString(height), symbol, newPriceStr, isMarketOpenedStr], ProtocolSEP) | |
218 | 218 | let priceMsg = toBytes(priceMsgStr) | |
219 | 219 | let verificationsCount = (((((if (sigVerify_8Kb(priceMsg, sig0, fromBase58String(pubKeyOraclesList[0]))) | |
220 | 220 | then 1 | |
221 | 221 | else 0) + (if (sigVerify_8Kb(priceMsg, sig1, fromBase58String(pubKeyOraclesList[1]))) | |
222 | 222 | then 1 | |
223 | 223 | else 0)) + (if (sigVerify_8Kb(priceMsg, sig2, fromBase58String(pubKeyOraclesList[2]))) | |
224 | 224 | then 1 | |
225 | 225 | else 0)) + (if (sigVerify_8Kb(priceMsg, sig3, fromBase58String(pubKeyOraclesList[3]))) | |
226 | 226 | then 1 | |
227 | 227 | else 0)) + (if (sigVerify_8Kb(priceMsg, sig4, fromBase58String(pubKeyOraclesList[4]))) | |
228 | 228 | then 1 | |
229 | 229 | else 0)) | |
230 | 230 | if ((verificationsCount >= minConsensus)) | |
231 | 231 | then { | |
232 | 232 | let price = valueOrElse(getInteger(this, keyPrice(symbol)), 0) | |
233 | 233 | if (if ((price != 0)) | |
234 | 234 | then if ((newPrice >= (price + ((price * percentPriceOffset) / 100)))) | |
235 | 235 | then true | |
236 | 236 | else ((price - ((price * percentPriceOffset) / 100)) >= newPrice) | |
237 | 237 | else false) | |
238 | 238 | then { | |
239 | 239 | let reason = "automatic emergency shutdown because of large price variability" | |
240 | 240 | [BooleanEntry(keyIsBlocked(symbol), true), StringEntry(keyIsBlockedSender(symbol), toString(this)), StringEntry(keyIsBlockedReason(symbol), reason), IntegerEntry(keyBlackSwarmPrice(height, symbol), newPrice)] | |
241 | 241 | } | |
242 | 242 | else (PriceEntry(symbol, newPrice, isMarketOpened) ++ StatsEntry(symbol, newPrice)) | |
243 | 243 | } | |
244 | 244 | else PriceFailedResult(symbol, ((((((((("verificationsCount = " + toString(verificationsCount)) + "signs0.length=") + toString(size(signs))) + " msg0 = ") + priceMsgStr) + " sig0 = ") + toBase58String(sig0)) + " key0 = ") + pubKeyOraclesList[0])) | |
245 | 245 | } | |
246 | 246 | else PriceFailedResult(symbol, ((("data parsing error: newPrice=" + newPriceStr) + " isMarketOpened=") + isMarketOpenedStr)) | |
247 | 247 | else PriceFailedResult(symbol, ((symbol + " doesn't exist in group: groupDataStr=") + groupDataStr)) | |
248 | 248 | } | |
249 | 249 | } | |
250 | 250 | ||
251 | 251 | ||
252 | 252 | @Callable(i) | |
253 | 253 | func finalizeDORA2 (header,msg,signs0,signs1,signs2,signs3) = { | |
254 | 254 | let headerArray = split(header, ProtocolSEP) | |
255 | 255 | let groupNum = headerArray[1] | |
256 | 256 | let finHeightStr = headerArray[2] | |
257 | 257 | let finHeight = parseIntValue(finHeightStr) | |
258 | 258 | let signsLength = (64 * oracleCount) | |
259 | 259 | if ((height != finHeight)) | |
260 | 260 | then throwInvalidFinalizationHeight(finHeightStr) | |
261 | 261 | else if (isGroupFinalaized(groupNum, finHeightStr)) | |
262 | 262 | then throwGroupAlreadyFinalized(groupNum, finHeightStr) | |
263 | 263 | else if ((pubKeyOraclesList[(height % oracleCount)] != toBase58String(i.callerPublicKey))) | |
264 | 264 | then throwOutOfTurnFinalization() | |
265 | 265 | else if ((size(signs0) != signsLength)) | |
266 | 266 | then throwInvalidSignsParamLength(0, signs0) | |
267 | 267 | else if ((size(signs1) != signsLength)) | |
268 | 268 | then throwInvalidSignsParamLength(1, signs1) | |
269 | 269 | else if ((size(signs2) != signsLength)) | |
270 | 270 | then throwInvalidSignsParamLength(2, signs2) | |
271 | 271 | else if ((size(signs3) != signsLength)) | |
272 | 272 | then throwInvalidSignsParamLength(3, signs3) | |
273 | 273 | else { | |
274 | 274 | let groupDataKey = keyGroupData(groupNum) | |
275 | 275 | let groupDataStr = valueOrErrorMessage(getString(this, groupDataKey), ("empty group data for key=" + groupDataKey)) | |
276 | 276 | let msgArray = split(msg, ProtocolSEP) | |
277 | 277 | if (((size(msgArray) % 3) != 0)) | |
278 | 278 | then throw(("msg parameters count must be multiple of 3: msgArray.size=" + toString(size(msg)))) | |
279 | 279 | 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)) | |
280 | 280 | } | |
281 | 281 | } | |
282 | 282 | ||
283 | 283 | ||
284 | 284 | ||
285 | 285 | @Callable(i) | |
286 | 286 | func price (hours) = { | |
287 | 287 | let symbol = "USDN-USDT" | |
288 | 288 | let periodSTEP = H4MILLIS | |
289 | 289 | let maxHours = 80 | |
290 | 290 | let iters = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20] | |
291 | 291 | if ((hours > maxHours)) | |
292 | 292 | then throw("hours is greater then max 80") | |
293 | 293 | else if ((4 > hours)) | |
294 | 294 | then throw("hours is less then min value 4") | |
295 | 295 | else { | |
296 | 296 | let currTime = lastBlock.timestamp | |
297 | 297 | let startTime = ((currTime - (hours * 3600000)) - H4MILLIS) | |
298 | 298 | let period = toPeriod(currTime, periodSTEP) | |
299 | 299 | let periodStr = toString(period) | |
300 | 300 | let smallestPeriod = getIntegerValue(this, keyStats1stPeriod(symbol)) | |
301 | 301 | let startPeriodTmp = toPeriod(startTime, periodSTEP) | |
302 | 302 | let isEnoughData = (startPeriodTmp >= smallestPeriod) | |
303 | 303 | let startPeriod = if (isEnoughData) | |
304 | 304 | then startPeriodTmp | |
305 | 305 | else smallestPeriod | |
306 | 306 | let startPeriodStr = toString(startPeriod) | |
307 | 307 | let startPriceSumX = parseBigIntValue(getStringValue(this, keyStatsByPeriodPriceSum(symbol, startPeriodStr))) | |
308 | 308 | let startCountSum = getIntegerValue(this, keyStatsByPeriodCountSum(symbol, startPeriodStr)) | |
309 | 309 | let endPriceSumX = if (isEnoughData) | |
310 | 310 | then parseBigIntValue(getStringValue(this, keyStatsByPeriodPriceSum(symbol, periodStr))) | |
311 | 311 | else toBigInt(0) | |
312 | 312 | let endCountSum = if (isEnoughData) | |
313 | 313 | then getIntegerValue(this, keyStatsByPeriodCountSum(symbol, periodStr)) | |
314 | 314 | else 0 | |
315 | 315 | let priceSum = toInt((endPriceSumX - startPriceSumX)) | |
316 | 316 | let priceCount = (endCountSum - startCountSum) | |
317 | 317 | let priceAvg = (priceSum / priceCount) | |
318 | 318 | if ((0 >= priceAvg)) | |
319 | 319 | then throw("calculation error") | |
320 | 320 | else { | |
321 | 321 | func findMinMax (minAndMax,nextIdx) = { | |
322 | 322 | let periodToCheck = (period - (nextIdx * periodSTEP)) | |
323 | 323 | if ((startPeriod > periodToCheck)) | |
324 | 324 | then minAndMax | |
325 | 325 | else { | |
326 | 326 | let periodToCheckStr = toString(periodToCheck) | |
327 | 327 | let minVal = minAndMax._1 | |
328 | 328 | let maxVal = minAndMax._2 | |
329 | 329 | let newMinVal = getIntegerValue(this, keyStatsByPeriodMin(symbol, periodToCheckStr)) | |
330 | 330 | let newMaxVal = getIntegerValue(this, keyStatsByPeriodMax(symbol, periodToCheckStr)) | |
331 | 331 | $Tuple2(min([minVal, newMinVal]), max([maxVal, newMaxVal])) | |
332 | 332 | } | |
333 | 333 | } | |
334 | 334 | ||
335 | 335 | let price = getIntegerValue(this, keyPrice(symbol)) | |
336 | 336 | let minMaxSTRUCT = { | |
337 | 337 | let $l = iters | |
338 | 338 | let $s = size($l) | |
339 | 339 | let $acc0 = $Tuple2(9223372036854775, 0) | |
340 | 340 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
341 | 341 | then $a | |
342 | 342 | else findMinMax($a, $l[$i]) | |
343 | 343 | ||
344 | 344 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
345 | 345 | then $a | |
346 | 346 | else throw("List size exceeds 21") | |
347 | 347 | ||
348 | 348 | $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) | |
349 | 349 | } | |
350 | 350 | $Tuple2(nil, $Tuple4(price, priceAvg, minMaxSTRUCT._1, minMaxSTRUCT._2)) | |
351 | 351 | } | |
352 | 352 | } | |
353 | 353 | } | |
354 | 354 | ||
355 | 355 |
github/deemru/w8io/026f985 62.14 ms ◑