tx · 5sfiqQq7iY7tbqNpRfviYrWJYPDWruroN4JALwdoPShQ 3NAfzeA3URU6oCV6HvtAiNwqGXsTs87ZpHh: -0.02500000 Waves 2023.02.24 14:28 [2463696] smart account 3NAfzeA3URU6oCV6HvtAiNwqGXsTs87ZpHh > SELF 0.00000000 Waves
{ "type": 13, "id": "5sfiqQq7iY7tbqNpRfviYrWJYPDWruroN4JALwdoPShQ", "fee": 2500000, "feeAssetId": null, "timestamp": 1677238115020, "version": 2, "chainId": 84, "sender": "3NAfzeA3URU6oCV6HvtAiNwqGXsTs87ZpHh", "senderPublicKey": "HiTi1JT7GQRqLNxg4yZhD1mV42y1Mv2AYvRx92JQRbwX", "proofs": [ "3WSc4YumhHmmB8ExDqnC8evAv6Ka4xcNoiewZd85MSNny6Z5XvsmTZbT16vhUtPcTzugLL4JDCNkXAdgBEUp91dF" ], "script": "base64:BgJYCAISBAoCAQQSBQoDCAEBEgUKAwgBARIDCgEIEgMKAQgSBAoCCAESBQoDCAEIEgUKAwgBCBIFCgMIAQgSABIDCgEBEgMKAQESBAoCAQESAwoBARIECgIBAXUABkVVTEVSOADWic+BAQAFTVVMVDYAwIQ9AAZNVUxUWDYJALYCAQDAhD0ABU1VTFQ4AIDC1y8ABk1VTFRYOAkAtgIBAIDC1y8AB01VTFRYMTAJALYCAQCAyK+gJQAGTVVMVDEyAICglKWNHQAHTVVMVFgxNgkAtgIBAICAhP6m3uERAAZNVUxUMTgJALYCAQCAgJC7utat8A0AA1NFUAICX18AB0xJU1RTRVACAToAEURFRkFVTFRTV0FQRkVFTjJXAIgnABFERUZBVUxUU1dBUEZFRVcyTgCgnAEAC0JSUFJPVEVDVEVEAKCNBgAHV0FWRVNJRAkA2QQBAgVXQVZFUwAJREFZTUlMTElTAIC4mSkBEmtleU5ldXRyaW5vQXNzZXRJZAACEW5ldXRyaW5vX2Fzc2V0X2lkAQ5rZXlOc2J0QXNzZXRJZAACDWJvbmRfYXNzZXRfaWQBDmtleVN1cmZBc3NldEl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JQZXJpb2QJARdjYWxjVXNkbkluY29tZUZvclBlcmlvZAIFE25zYnRTdGFraW5nQ29udHJhY3QFB3RtcERheXMEA2FwcgkBB2NhbGNBcHIEBRNuc2J0U3Rha2luZ0NvbnRyYWN0BQd0bXBEYXlzBQ9pbmNvbWVGb3JQZXJpb2QFD25zYnRVc2RuUHJpY2VYNgkAlAoCBQNuaWwJAKwCAgIEJWRfXwkApAMBBQNhcHIAmfVX7Q==", "height": 2463696, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9ucoZspxY9njVCMc6WaBHNusJhhEvaEkSprzXFwuv9rP Next: 3TELj6W36ALJEyV2LJQYXNF3Mt82KRczeTdsGk94SttE Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let EULER8 = 271828182 | |
5 | 5 | ||
6 | 6 | let MULT6 = 1000000 | |
7 | 7 | ||
8 | 8 | let MULTX6 = toBigInt(1000000) | |
9 | 9 | ||
10 | 10 | let MULT8 = 100000000 | |
11 | 11 | ||
12 | 12 | let MULTX8 = toBigInt(100000000) | |
13 | 13 | ||
14 | 14 | let MULTX10 = toBigInt(10000000000) | |
15 | 15 | ||
16 | 16 | let MULT12 = 1000000000000 | |
17 | 17 | ||
18 | 18 | let MULTX16 = toBigInt(10000000000000000) | |
19 | 19 | ||
20 | 20 | let MULT18 = toBigInt(1000000000000000000) | |
21 | 21 | ||
22 | 22 | let SEP = "__" | |
23 | 23 | ||
24 | 24 | let LISTSEP = ":" | |
25 | 25 | ||
26 | 26 | let DEFAULTSWAPFEEN2W = 5000 | |
27 | 27 | ||
28 | 28 | let DEFAULTSWAPFEEW2N = 20000 | |
29 | 29 | ||
30 | 30 | let BRPROTECTED = 100000 | |
31 | 31 | ||
32 | 32 | let WAVESID = fromBase58String("WAVES") | |
33 | 33 | ||
34 | 34 | let DAYMILLIS = 86400000 | |
35 | 35 | ||
36 | 36 | func keyNeutrinoAssetId () = "neutrino_asset_id" | |
37 | 37 | ||
38 | 38 | ||
39 | 39 | func keyNsbtAssetId () = "bond_asset_id" | |
40 | 40 | ||
41 | 41 | ||
42 | 42 | func keySurfAssetId () = "surf_asset_id" | |
43 | 43 | ||
44 | 44 | ||
45 | 45 | func keySwapAmountAParam () = "%s%s__config__swapAParam" | |
46 | 46 | ||
47 | 47 | ||
48 | 48 | func keySwapAmountBParam () = "%s%s__config__swapBParam" | |
49 | 49 | ||
50 | 50 | ||
51 | 51 | func keyUsdnSwapAmountAParam () = "%s%s__config__usdnSwapAParam" | |
52 | 52 | ||
53 | 53 | ||
54 | 54 | func keyUsdnSwapAmountBParam () = "%s%s__config__usdnSwapBParam" | |
55 | 55 | ||
56 | 56 | ||
57 | 57 | func keyNsbtLockContract () = "%s__nsbtLockContract" | |
58 | 58 | ||
59 | 59 | ||
60 | 60 | func keyMathContract () = "%s__mathContract" | |
61 | 61 | ||
62 | 62 | ||
63 | 63 | func basketAssetsKey () = "%s%s__common__basketAssets" | |
64 | 64 | ||
65 | 65 | ||
66 | 66 | func basketDKey () = "%s%s__common__basketD" | |
67 | 67 | ||
68 | 68 | ||
69 | 69 | func basketBKey () = "%s%s__common__basketB" | |
70 | 70 | ||
71 | 71 | ||
72 | 72 | func basketLogbDeltaKey () = "%s%s__common__basketLogbDelta" | |
73 | 73 | ||
74 | 74 | ||
75 | 75 | func basketWeightByAssetKey (assetId) = ("%s%s%s__common__weightByAsset__" + assetId) | |
76 | 76 | ||
77 | 77 | ||
78 | 78 | func keyPrice () = "price" | |
79 | 79 | ||
80 | 80 | ||
81 | 81 | func keyPriceByAsset (assetId) = ("%s%s%s__common__priceByAsset__" + assetId) | |
82 | 82 | ||
83 | 83 | ||
84 | 84 | func keyLockParamStartBlock (userAddress) = makeString(["%s%s%s", "paramByUser", userAddress, "start"], SEP) | |
85 | 85 | ||
86 | 86 | ||
87 | 87 | func keyHalfLife () = "%s__halfLife" | |
88 | 88 | ||
89 | 89 | ||
90 | 90 | func keyMinLockAmount () = "%s__minLockAmount" | |
91 | 91 | ||
92 | 92 | ||
93 | 93 | func keyMinWavesForNsbtBuy () = "min_waves_nsbt_buy" | |
94 | 94 | ||
95 | 95 | ||
96 | 96 | func keyMinNsbtSell () = "min_nsbt_sell" | |
97 | 97 | ||
98 | 98 | ||
99 | 99 | func keyStatsDepositAmtByDay (timestamp) = makeString(["%s%s%d", "stats", "depositAmtByDay", toString(timestamp)], SEP) | |
100 | 100 | ||
101 | 101 | ||
102 | 102 | func toStartOfDay (timestamp) = ((timestamp / DAYMILLIS) * DAYMILLIS) | |
103 | 103 | ||
104 | 104 | ||
105 | 105 | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
106 | 106 | ||
107 | 107 | ||
108 | 108 | func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
109 | 109 | ||
110 | 110 | ||
111 | 111 | func getBoolOrFail (address,key) = valueOrErrorMessage(getBoolean(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
112 | 112 | ||
113 | 113 | ||
114 | 114 | func getIntOrElse (address,key,defaultVal) = valueOrElse(getInteger(address, key), defaultVal) | |
115 | 115 | ||
116 | 116 | ||
117 | 117 | func getStrOrElse (address,key,defaultVal) = valueOrElse(getString(address, key), defaultVal) | |
118 | 118 | ||
119 | 119 | ||
120 | 120 | func convertNeutrinoToWaves (amount,price) = fraction(amount, MULT8, price) | |
121 | 121 | ||
122 | 122 | ||
123 | 123 | func convertTokenToUsd (amount,price) = fraction(amount, price, MULT8) | |
124 | 124 | ||
125 | 125 | ||
126 | 126 | func asAnyList (val) = match val { | |
127 | 127 | case valAnyList: List[Any] => | |
128 | 128 | valAnyList | |
129 | 129 | case _ => | |
130 | 130 | throw("fail to cast into List[Any]") | |
131 | 131 | } | |
132 | 132 | ||
133 | 133 | ||
134 | 134 | func asInt (val) = match val { | |
135 | 135 | case valInt: Int => | |
136 | 136 | valInt | |
137 | 137 | case _ => | |
138 | 138 | throw("fail to cast into Int") | |
139 | 139 | } | |
140 | 140 | ||
141 | 141 | ||
142 | 142 | func asString (val) = match val { | |
143 | 143 | case valStr: String => | |
144 | 144 | valStr | |
145 | 145 | case _ => | |
146 | 146 | throw("fail to cast into String") | |
147 | 147 | } | |
148 | 148 | ||
149 | 149 | ||
150 | 150 | func asTuple2Ints (val) = match val { | |
151 | 151 | case v: (Int, Int) => | |
152 | 152 | v | |
153 | 153 | case _ => | |
154 | 154 | throw("fail to cast into Tuple2 ints") | |
155 | 155 | } | |
156 | 156 | ||
157 | 157 | ||
158 | 158 | func asSwapParamsSTRUCT (val) = match val { | |
159 | 159 | case struct: (Int, Int, Int, Int, Int, Int, Int) => | |
160 | 160 | struct | |
161 | 161 | case _ => | |
162 | 162 | throw("fail to cast into SwapParamsSTRUCT") | |
163 | 163 | } | |
164 | 164 | ||
165 | 165 | ||
166 | 166 | func asWithdrawResultSTRUCT (val) = match val { | |
167 | 167 | case struct: (Int, Unit, Int, Int, Int, Int, Int, Int, String)|(Int, ByteVector, Int, Int, Int, Int, Int, Int, String) => | |
168 | 168 | struct | |
169 | 169 | case _ => | |
170 | 170 | throw("fail to cast into WithdrawResult") | |
171 | 171 | } | |
172 | 172 | ||
173 | 173 | ||
174 | 174 | func toTimestamp (start) = if ((0 > start)) | |
175 | 175 | then -1 | |
176 | 176 | else match blockInfoByHeight(start) { | |
177 | 177 | case block: BlockInfo => | |
178 | 178 | block.timestamp | |
179 | 179 | case _ => | |
180 | 180 | -1 | |
181 | 181 | } | |
182 | 182 | ||
183 | 183 | ||
184 | 184 | func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), MULT18, toBigInt(origScaleMult)) | |
185 | 185 | ||
186 | 186 | ||
187 | 187 | func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), MULT18)) | |
188 | 188 | ||
189 | 189 | ||
190 | 190 | let nMetricIdxPrice = 0 | |
191 | 191 | ||
192 | 192 | let nMetricIdxUsdnLockedBalance = 1 | |
193 | 193 | ||
194 | 194 | let nMetricIdxWavesLockedBalance = 2 | |
195 | 195 | ||
196 | 196 | let nMetricIdxReserve = 3 | |
197 | 197 | ||
198 | 198 | let nMetricIdxReserveInUsdn = 4 | |
199 | 199 | ||
200 | 200 | let nMetricIdxUsdnSupply = 5 | |
201 | 201 | ||
202 | 202 | let nMetricIdxSurplus = 6 | |
203 | 203 | ||
204 | 204 | let nMetricIdxSurplusPercent = 7 | |
205 | 205 | ||
206 | 206 | let nMetricIdxBR = 8 | |
207 | 207 | ||
208 | 208 | let nMetricIdxNsbtSupply = 9 | |
209 | 209 | ||
210 | 210 | let nMetricIdxMaxNsbtSupply = 10 | |
211 | 211 | ||
212 | 212 | let nMetricIdxSurfSupply = 11 | |
213 | 213 | ||
214 | 214 | let nMetricUsdnUsdtPeg = 12 | |
215 | 215 | ||
216 | 216 | let nMetricCurrentPriceAdj = 13 | |
217 | 217 | ||
218 | 218 | let nMetricBasketInfo = 14 | |
219 | 219 | ||
220 | 220 | let nMetricWeightedPrice = 15 | |
221 | 221 | ||
222 | 222 | let nMetricTotalReservesUsd = 16 | |
223 | 223 | ||
224 | 224 | let IdxControlCfgNeutrinoDapp = 1 | |
225 | 225 | ||
226 | 226 | let IdxControlCfgAuctionDapp = 2 | |
227 | 227 | ||
228 | 228 | let IdxControlCfgRpdDapp = 3 | |
229 | 229 | ||
230 | 230 | let IdxControlCfgMathDapp = 4 | |
231 | 231 | ||
232 | 232 | let IdxControlCfgLiquidationDapp = 5 | |
233 | 233 | ||
234 | 234 | let IdxControlCfgRestDapp = 6 | |
235 | 235 | ||
236 | 236 | let IdxControlCfgNodeRegistryDapp = 7 | |
237 | 237 | ||
238 | 238 | let IdxControlCfgNsbtStakingDapp = 8 | |
239 | 239 | ||
240 | 240 | let IdxControlCfgMediatorDapp = 9 | |
241 | 241 | ||
242 | 242 | let IdxControlCfgSurfStakingDapp = 10 | |
243 | 243 | ||
244 | 244 | let IdxControlCfgGnsbtControllerDapp = 11 | |
245 | 245 | ||
246 | 246 | let bFuncIdxSurf = 0 | |
247 | 247 | ||
248 | 248 | let bFuncIdxWaves = 1 | |
249 | 249 | ||
250 | 250 | let bFuncIdxUsdn = 2 | |
251 | 251 | ||
252 | 252 | let bFuncIdxReserveStart = 3 | |
253 | 253 | ||
254 | 254 | let bFuncIdxSupplyStart = 4 | |
255 | 255 | ||
256 | 256 | let bFuncIdxBRStart = 5 | |
257 | 257 | ||
258 | 258 | let bFuncIdxReserveEnd = 6 | |
259 | 259 | ||
260 | 260 | let bFuncIdxSupplyEnd = 7 | |
261 | 261 | ||
262 | 262 | let bFuncIdxBREnd = 8 | |
263 | 263 | ||
264 | 264 | let bFuncIdxRest = 9 | |
265 | 265 | ||
266 | 266 | let bFuncIdxWavesPrice = 10 | |
267 | 267 | ||
268 | 268 | func keyControlAddress () = "%s%s__config__controlAddress" | |
269 | 269 | ||
270 | 270 | ||
271 | 271 | func keyControlCfg () = "%s__controlConfig" | |
272 | 272 | ||
273 | 273 | ||
274 | 274 | func readControlCfgOrFail (control) = split_4C(getStringOrFail(control, keyControlCfg()), SEP) | |
275 | 275 | ||
276 | 276 | ||
277 | 277 | func getContractAddressOrFail (controlCfg,idx) = valueOrErrorMessage(addressFromString(controlCfg[idx]), ("Control cfg doesn't contain address at index " + toString(idx))) | |
278 | 278 | ||
279 | 279 | ||
280 | 280 | let controlContract = addressFromStringValue(valueOrElse(getString(this, keyControlAddress()), "3N4NS7d4Jo9a6F14LiFUKKYVdUkkf2eP4Zx")) | |
281 | 281 | ||
282 | 282 | let controlCfg = readControlCfgOrFail(controlContract) | |
283 | 283 | ||
284 | 284 | let mathContract = getContractAddressOrFail(controlCfg, IdxControlCfgMathDapp) | |
285 | 285 | ||
286 | 286 | let neutrinoContract = getContractAddressOrFail(controlCfg, IdxControlCfgNeutrinoDapp) | |
287 | 287 | ||
288 | 288 | let auctionContract = getContractAddressOrFail(controlCfg, IdxControlCfgAuctionDapp) | |
289 | 289 | ||
290 | 290 | let liquidationContract = getContractAddressOrFail(controlCfg, IdxControlCfgLiquidationDapp) | |
291 | 291 | ||
292 | 292 | let rpdContract = getContractAddressOrFail(controlCfg, IdxControlCfgRpdDapp) | |
293 | 293 | ||
294 | 294 | let nsbtStakingContract = getContractAddressOrFail(controlCfg, IdxControlCfgNsbtStakingDapp) | |
295 | 295 | ||
296 | 296 | let surfStakingContract = getContractAddressOrFail(controlCfg, IdxControlCfgSurfStakingDapp) | |
297 | 297 | ||
298 | 298 | let gnsbtControllerContract = getContractAddressOrFail(controlCfg, IdxControlCfgGnsbtControllerDapp) | |
299 | 299 | ||
300 | 300 | let neutrinoAssetIdString = getStringOrFail(neutrinoContract, keyNeutrinoAssetId()) | |
301 | 301 | ||
302 | 302 | let neutrinoAssetId = fromBase58String(neutrinoAssetIdString) | |
303 | 303 | ||
304 | 304 | let nsbtAssetIdStr = getStringValue(neutrinoContract, keyNsbtAssetId()) | |
305 | 305 | ||
306 | 306 | let nsbtAssetId = fromBase58String(nsbtAssetIdStr) | |
307 | 307 | ||
308 | 308 | let surfAssetIdStr = getStringValue(auctionContract, keySurfAssetId()) | |
309 | 309 | ||
310 | 310 | let surfAssetId = fromBase58String(surfAssetIdStr) | |
311 | 311 | ||
312 | 312 | func readUsdnIncomeForDay (stakingAcc,startOfDayTimestamp,neutrinoMetrics) = { | |
313 | 313 | let amtByDayKEY = keyStatsDepositAmtByDay(startOfDayTimestamp) | |
314 | 314 | let incomeStr = getStrOrElse(stakingAcc, amtByDayKEY, "%s%s__0__0") | |
315 | 315 | let incomeArray = split(incomeStr, SEP) | |
316 | 316 | let wavesAmt = parseIntValue(incomeArray[1]) | |
317 | 317 | let usdnAmt = parseIntValue(incomeArray[2]) | |
318 | 318 | let currentPrice = asInt(neutrinoMetrics[nMetricIdxPrice]) | |
319 | 319 | let wavesAsUsdnAmt = fraction(wavesAmt, currentPrice, MULT8) | |
320 | 320 | (wavesAsUsdnAmt + usdnAmt) | |
321 | 321 | } | |
322 | 322 | ||
323 | 323 | ||
324 | 324 | func calcUsdnIncomeForPeriod (stakingAcc,days) = { | |
325 | 325 | let neutrinoMetrics = asAnyList(invoke(mathContract, "calcNeutinoMetricsREADONLY", nil, nil)) | |
326 | 326 | let currStartOfDay = toStartOfDay(lastBlock.timestamp) | |
327 | 327 | let startTimestamp = (currStartOfDay - (DAYMILLIS * (days + 1))) | |
328 | 328 | let endTimestamp = (currStartOfDay - DAYMILLIS) | |
329 | 329 | let startUsdnAmtTMP = readUsdnIncomeForDay(stakingAcc, startTimestamp, neutrinoMetrics) | |
330 | 330 | let endUsdnAmt = readUsdnIncomeForDay(stakingAcc, endTimestamp, neutrinoMetrics) | |
331 | 331 | let startUsdnAmt = if ((startUsdnAmtTMP == 0)) | |
332 | 332 | then endUsdnAmt | |
333 | 333 | else startUsdnAmtTMP | |
334 | 334 | (endUsdnAmt - startUsdnAmt) | |
335 | 335 | } | |
336 | 336 | ||
337 | 337 | ||
338 | 338 | func calcApr (stakingAcc,periodInDays,incomeForPeriod,stakingAssetPriceToUsdnX6) = { | |
339 | 339 | let totalStaked = getIntOrElse(stakingAcc, "%s%s__stats__activeTotalLocked", 1) | |
340 | 340 | let totalStakedInUsdn = fraction(totalStaked, stakingAssetPriceToUsdnX6, MULT6) | |
341 | 341 | if ((0 > incomeForPeriod)) | |
342 | 342 | then 0 | |
343 | 343 | else fraction((incomeForPeriod * MULT6), 365, (totalStakedInUsdn * periodInDays)) | |
344 | 344 | } | |
345 | 345 | ||
346 | 346 | ||
347 | 347 | @Callable(i) | |
348 | 348 | func reverseSwapLimitREADONLY (lim,isOutMulti) = { | |
349 | 349 | let BR = asInt(asAnyList(invoke(mathContract, "calcNeutinoMetricsREADONLY", nil, nil))[nMetricIdxBR]) | |
350 | 350 | let gNsbt = if ((0 >= lim)) | |
351 | 351 | then 0 | |
352 | 352 | else { | |
353 | 353 | let aParamX8 = toBigInt(getIntOrFail(mathContract, if (isOutMulti) | |
354 | 354 | then keyUsdnSwapAmountAParam() | |
355 | 355 | else keySwapAmountAParam())) | |
356 | 356 | let bParamX16 = toBigInt(getIntOrFail(mathContract, if (isOutMulti) | |
357 | 357 | then keyUsdnSwapAmountBParam() | |
358 | 358 | else keySwapAmountBParam())) | |
359 | 359 | let limDivAX8 = if (isOutMulti) | |
360 | 360 | then fraction(fraction(toBigInt(lim), MULTX10, aParamX8), MULTX6, toBigInt(BR)) | |
361 | 361 | else fraction(toBigInt(lim), MULTX10, aParamX8) | |
362 | 362 | let revBX16 = fraction(MULTX16, MULTX16, bParamX16) | |
363 | 363 | toInt(pow(limDivAX8, 8, revBX16, 16, 6, CEILING)) | |
364 | 364 | } | |
365 | 365 | $Tuple2(nil, gNsbt) | |
366 | 366 | } | |
367 | 367 | ||
368 | 368 | ||
369 | 369 | ||
370 | 370 | @Callable(i) | |
371 | 371 | func gnsbtInfoINTERNAL (userAddressStrOrEmpty,additionalNsbtToStakeOrZero,additionalSurfToStakeOrZero) = { | |
372 | 372 | let userAddressOrThis = if ((userAddressStrOrEmpty != "")) | |
373 | 373 | then addressFromStringValue(userAddressStrOrEmpty) | |
374 | 374 | else this | |
375 | 375 | let currentPrice = getIntegerValue(controlContract, keyPrice()) | |
376 | 376 | let gnsbtFromNsbtDiff = additionalNsbtToStakeOrZero | |
377 | 377 | let gnsbtFromSurfDiff = asInt(invoke(surfStakingContract, "gnsbtFromSurfSYSREADONLY", [additionalSurfToStakeOrZero], nil)) | |
378 | 378 | let gNsbtDiff = (gnsbtFromNsbtDiff + gnsbtFromSurfDiff) | |
379 | 379 | let swapParamsTuple = asSwapParamsSTRUCT(invoke(neutrinoContract, "swapParamsByUserSYSREADONLY", [userAddressStrOrEmpty, 0], nil)) | |
380 | 380 | let limitMaxTokenUsd = swapParamsTuple._1 | |
381 | 381 | let blcks2LmtReset = swapParamsTuple._3 | |
382 | 382 | let gnsbtAmt = swapParamsTuple._4 | |
383 | 383 | let gnsbtAmtTotal = swapParamsTuple._5 | |
384 | 384 | let limitMaxUsdn = swapParamsTuple._7 | |
385 | 385 | let swapParamsTupleNEW = asSwapParamsSTRUCT(invoke(neutrinoContract, "swapParamsByUserSYSREADONLY", [userAddressStrOrEmpty, gNsbtDiff], nil)) | |
386 | 386 | let limitMaxTokenUsdNEW = swapParamsTupleNEW._1 | |
387 | 387 | let blcks2LmtResetNEW = swapParamsTupleNEW._3 | |
388 | 388 | let gnsbtAmtNEW = swapParamsTupleNEW._4 | |
389 | 389 | let gnsbtAmtTotalNEW = swapParamsTupleNEW._5 | |
390 | 390 | let limitMaxUsdnNEW = swapParamsTupleNEW._7 | |
391 | 391 | let nsbtBalance = if ((userAddressStrOrEmpty != "")) | |
392 | 392 | then assetBalance(userAddressOrThis, nsbtAssetId) | |
393 | 393 | else 0 | |
394 | 394 | let surfBalance = if ((userAddressStrOrEmpty != "")) | |
395 | 395 | then assetBalance(userAddressOrThis, surfAssetId) | |
396 | 396 | else 0 | |
397 | 397 | let nsbtBalanceDiff = if ((additionalNsbtToStakeOrZero >= 0)) | |
398 | 398 | then additionalNsbtToStakeOrZero | |
399 | 399 | else { | |
400 | 400 | let nsbtUnstakingData = asAnyList(invoke(nsbtStakingContract, "nsbtUnstakingSYSREADONLY", [userAddressStrOrEmpty, (-1 * additionalNsbtToStakeOrZero)], nil)) | |
401 | 401 | let nsbtReceiveAmount = asInt(nsbtUnstakingData[2]) | |
402 | 402 | let result = -(nsbtReceiveAmount) | |
403 | 403 | result | |
404 | 404 | } | |
405 | 405 | let nsbtBalanceNew = (nsbtBalance - nsbtBalanceDiff) | |
406 | 406 | let surfBalanceNew = (surfBalance - additionalSurfToStakeOrZero) | |
407 | 407 | let gnsbtData = asAnyList(invoke(gnsbtControllerContract, "gnsbtInfoSYSREADONLY", [userAddressStrOrEmpty, additionalNsbtToStakeOrZero, additionalSurfToStakeOrZero], nil)) | |
408 | 408 | let gnsbtUser = asInt(gnsbtData[0]) | |
409 | 409 | let gnsbtTotal = asInt(gnsbtData[1]) | |
410 | 410 | let nsbtData = asAnyList(gnsbtData[2]) | |
411 | 411 | let surfData = asAnyList(gnsbtData[3]) | |
412 | 412 | let vpEffectiveHeight = asInt(gnsbtData[4]) | |
413 | 413 | let vpEffectiveHeightNEW = asInt(gnsbtData[5]) | |
414 | 414 | let gnsbtAmtFromNsbt = asInt(nsbtData[2]) | |
415 | 415 | let gnsbtAmtFromSurf = asInt(surfData[2]) | |
416 | 416 | let gnsbtAmtFromNsbtNEW = (gnsbtAmtFromNsbt + gnsbtFromNsbtDiff) | |
417 | 417 | let gnsbtAmtFromSurfNEW = (gnsbtAmtFromSurf + gnsbtFromSurfDiff) | |
418 | 418 | let gnsbtFromNsbtTotal = asInt(nsbtData[3]) | |
419 | 419 | let gnsbtFromSurfTotal = asInt(surfData[3]) | |
420 | 420 | let gnsbtFromSurfActiveTotal = 0 | |
421 | 421 | let gnsbtFromSurfFrozenTotal = gnsbtFromSurfTotal | |
422 | 422 | let gnsbtFromNsbtTotalNEW = (gnsbtFromNsbtTotal + gnsbtFromNsbtDiff) | |
423 | 423 | let gnsbtFromSurfTotalNEW = (gnsbtFromSurfTotal + gnsbtFromSurfDiff) | |
424 | 424 | let gnsbtFromSurfFrozenTotalNEW = gnsbtFromSurfTotalNEW | |
425 | 425 | let votingPower = fraction(gnsbtAmtFromNsbt, MULT8, (gnsbtFromNsbtTotal + gnsbtFromSurfActiveTotal)) | |
426 | 426 | let votingPowerNew = fraction(gnsbtAmtFromNsbtNEW, MULT8, (gnsbtFromNsbtTotalNEW + gnsbtFromSurfActiveTotal)) | |
427 | 427 | let votingPowerMax = fraction((gnsbtAmtFromNsbt + gnsbtAmtFromSurf), MULT8, ((gnsbtFromNsbtTotal + gnsbtFromSurfActiveTotal) + gnsbtFromSurfFrozenTotal)) | |
428 | 428 | let votingPowerMaxNew = fraction((gnsbtAmtFromNsbtNEW + gnsbtAmtFromSurfNEW), MULT8, ((gnsbtFromNsbtTotalNEW + gnsbtFromSurfActiveTotal) + gnsbtFromSurfFrozenTotalNEW)) | |
429 | 429 | let votingPowerEta = if ((vpEffectiveHeight == 0)) | |
430 | 430 | then height | |
431 | 431 | else vpEffectiveHeight | |
432 | 432 | let votingPowerEtaNew = if ((vpEffectiveHeightNEW == 0)) | |
433 | 433 | then height | |
434 | 434 | else vpEffectiveHeightNEW | |
435 | 435 | $Tuple2(nil, [0, nsbtBalance, surfBalance, nsbtBalanceNew, surfBalanceNew, gnsbtAmtFromNsbt, gnsbtAmtFromSurf, gnsbtAmtFromNsbtNEW, gnsbtAmtFromSurfNEW, gnsbtFromNsbtTotal, gnsbtFromSurfTotal, gnsbtFromNsbtTotalNEW, gnsbtFromSurfTotalNEW, limitMaxUsdn, limitMaxTokenUsd, limitMaxUsdnNEW, limitMaxTokenUsdNEW, blcks2LmtReset, blcks2LmtResetNEW, votingPower, votingPowerNew, votingPowerMax, votingPowerMaxNew, votingPowerEta, votingPowerEtaNew]) | |
436 | 436 | } | |
437 | 437 | ||
438 | 438 | ||
439 | 439 | ||
440 | 440 | @Callable(i) | |
441 | 441 | func gnsbtInfoREADONLY (userAddressStrOrEmpty,additionalNsbtToStakeOrZero,additionalSurfToStakeOrZero) = { | |
442 | 442 | let gnsbtInfoDATA = asAnyList(invoke(this, "gnsbtInfoINTERNAL", [userAddressStrOrEmpty, additionalNsbtToStakeOrZero, additionalSurfToStakeOrZero], nil)) | |
443 | 443 | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d", toString(asInt(gnsbtInfoDATA[1])), toString(asInt(gnsbtInfoDATA[2])), toString(asInt(gnsbtInfoDATA[3])), toString(asInt(gnsbtInfoDATA[4])), toString(asInt(gnsbtInfoDATA[5])), toString(asInt(gnsbtInfoDATA[6])), toString(asInt(gnsbtInfoDATA[7])), toString(asInt(gnsbtInfoDATA[8])), toString(asInt(gnsbtInfoDATA[9])), toString(asInt(gnsbtInfoDATA[10])), toString(asInt(gnsbtInfoDATA[11])), toString(asInt(gnsbtInfoDATA[12])), toString(asInt(gnsbtInfoDATA[13])), toString(asInt(gnsbtInfoDATA[14])), toString(asInt(gnsbtInfoDATA[15])), toString(asInt(gnsbtInfoDATA[16])), toString(asInt(gnsbtInfoDATA[17])), toString(asInt(gnsbtInfoDATA[18])), toString(asInt(gnsbtInfoDATA[19])), toString(asInt(gnsbtInfoDATA[20])), toString(asInt(gnsbtInfoDATA[21])), toString(asInt(gnsbtInfoDATA[22])), toString(asInt(gnsbtInfoDATA[23])), toString(asInt(gnsbtInfoDATA[24]))], SEP)) | |
444 | 444 | } | |
445 | 445 | ||
446 | 446 | ||
447 | 447 | ||
448 | 448 | @Callable(i) | |
449 | 449 | func gnsbtEffectiveREADONLY (userAddressStrOrEmpty) = { | |
450 | 450 | let gnsbtData = asAnyList(invoke(gnsbtControllerContract, "gnsbtInfoSYSREADONLY", [userAddressStrOrEmpty, 0, 0], nil)) | |
451 | 451 | let nsbtData = asAnyList(gnsbtData[2]) | |
452 | 452 | let userFromNsbt = asInt(nsbtData[2]) | |
453 | 453 | let totalFromNsbt = asInt(nsbtData[3]) | |
454 | 454 | let userMatureFromSurf = asInt(gnsbtData[9]) | |
455 | 455 | let totalMatureFromSurf = asInt(gnsbtData[6]) | |
456 | 456 | $Tuple2(nil, makeString(["%d%d", toString((totalFromNsbt + totalMatureFromSurf)), toString((userFromNsbt + userMatureFromSurf))], SEP)) | |
457 | 457 | } | |
458 | 458 | ||
459 | 459 | ||
460 | 460 | ||
461 | 461 | @Callable(i) | |
462 | 462 | func rewardInfoREADONLY (userAddressStrOrEmpty) = { | |
463 | 463 | let rewardsData = asAnyList(invoke(gnsbtControllerContract, "gnsbtRewardsSYSREADONLY", [userAddressStrOrEmpty], nil)) | |
464 | 464 | let usdnRewards = asString(invoke(rpdContract, "unclaimedRewardsREADONLY", [userAddressStrOrEmpty], nil)) | |
465 | 465 | $Tuple2(nil, makeString(["%s%s%s", asString(rewardsData[0]), asString(rewardsData[1]), usdnRewards], SEP)) | |
466 | 466 | } | |
467 | 467 | ||
468 | 468 | ||
469 | 469 | ||
470 | 470 | @Callable(i) | |
471 | 471 | func mergeNsbtREADONLY (userAddressMandatory,newAmount) = { | |
472 | 472 | let nsbtData = asAnyList(invoke(nsbtStakingContract, "nsbtStakingSYSREADONLY", [userAddressMandatory, newAmount], nil)) | |
473 | 473 | let amount0 = asInt(nsbtData[0]) | |
474 | 474 | let startHeight = if ((0 >= amount0)) | |
475 | 475 | then -1 | |
476 | 476 | else asInt(nsbtData[2]) | |
477 | 477 | let startTimestamp = toTimestamp(startHeight) | |
478 | 478 | let startHeightNew = if ((0 >= newAmount)) | |
479 | 479 | then startHeight | |
480 | 480 | else if ((0 >= amount0)) | |
481 | 481 | then height | |
482 | 482 | else { | |
483 | 483 | let halfLife = getIntOrFail(nsbtStakingContract, keyHalfLife()) | |
484 | 484 | asInt(invoke(mathContract, "mergeStakesREADONLY", [amount0, startHeight, newAmount, height, halfLife], nil)) | |
485 | 485 | } | |
486 | 486 | let startTimestampNew = toTimestamp(startHeightNew) | |
487 | 487 | $Tuple2(nil, makeString(["%d%d%d%d", toString(startHeight), toString(startTimestamp), toString(startHeightNew), toString(startTimestampNew)], SEP)) | |
488 | 488 | } | |
489 | 489 | ||
490 | 490 | ||
491 | 491 | ||
492 | 492 | @Callable(i) | |
493 | 493 | func swapLimitCalculatorREADONLY (userAddressStrOpt,limitWanted,assetIdStr) = { | |
494 | 494 | let gNsbtCurrent = if ((userAddressStrOpt == "")) | |
495 | 495 | then 0 | |
496 | 496 | else asInt(asSwapParamsSTRUCT(invoke(neutrinoContract, "swapParamsByUserSYSREADONLY", [userAddressStrOpt, 0], nil))._4) | |
497 | 497 | let price = valueOrErrorMessage(getInteger(controlContract, keyPriceByAsset(assetIdStr)), ("No price for asset " + assetIdStr)) | |
498 | 498 | let isOutMulti = (assetIdStr == neutrinoAssetIdString) | |
499 | 499 | let limitWantedUsdn = if (isOutMulti) | |
500 | 500 | then limitWanted | |
501 | 501 | else convertTokenToUsd(limitWanted, price) | |
502 | 502 | let gNsbtNeeded = asInt(invoke(this, "reverseSwapLimitREADONLY", [limitWantedUsdn, isOutMulti], nil)) | |
503 | 503 | let gNsbtDelta = (gNsbtNeeded - gNsbtCurrent) | |
504 | 504 | $Tuple2(nil, makeString(["%s%s", toString(gNsbtCurrent), toString(gNsbtDelta)], SEP)) | |
505 | 505 | } | |
506 | 506 | ||
507 | 507 | ||
508 | 508 | ||
509 | 509 | @Callable(i) | |
510 | 510 | func swapInfoREADONLY (userAddressStrOrEmpty,amount,assetIdStr) = { | |
511 | 511 | let neutrinoMetrics = asAnyList(invoke(mathContract, "calcNeutinoMetricsREADONLY", nil, nil)) | |
512 | 512 | let price = asInt(neutrinoMetrics[nMetricIdxPrice]) | |
513 | 513 | let swapParamsTuple = asSwapParamsSTRUCT(invoke(neutrinoContract, "swapParamsByUserSYSREADONLY", [userAddressStrOrEmpty, 0], nil)) | |
514 | 514 | let limitMaxTokenInUsd = swapParamsTuple._1 | |
515 | 515 | let blcks2LmtReset = swapParamsTuple._3 | |
516 | 516 | let limitMaxUsdn = swapParamsTuple._7 | |
517 | 517 | let assetId = fromBase58String(assetIdStr) | |
518 | 518 | let basketAssets = valueOrElse(getString(neutrinoContract, basketAssetsKey()), "WAVES") | |
519 | 519 | let swapType = if (contains(basketAssets, assetIdStr)) | |
520 | 520 | then "outNeutrino" | |
521 | 521 | else if ((assetId == neutrinoAssetId)) | |
522 | 522 | then "outMulti" | |
523 | 523 | else throw(("Can't swap assetId=" + assetIdStr)) | |
524 | 524 | let withdrawTuple = asWithdrawResultSTRUCT(invoke(neutrinoContract, "calcWithdrawResultSYSREADONLY", [swapType, amount, price, assetIdStr], nil)) | |
525 | 525 | let outNetAmount = withdrawTuple._1 | |
526 | 526 | let outSurfAmt = withdrawTuple._3 | |
527 | 527 | let inAmtToSurfPart = withdrawTuple._4 | |
528 | 528 | let outFeeAmount = withdrawTuple._6 | |
529 | 529 | let outAmtGross = withdrawTuple._7 | |
530 | 530 | let withdrawPrice = withdrawTuple._8 | |
531 | 531 | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d", toString(outNetAmount), toString(outSurfAmt), toString(outFeeAmount), toString(withdrawPrice), toString(blcks2LmtReset), toString(limitMaxTokenInUsd), toString(limitMaxUsdn), toString(inAmtToSurfPart)], SEP)) | |
532 | 532 | } | |
533 | 533 | ||
534 | 534 | ||
535 | 535 | ||
536 | 536 | @Callable(i) | |
537 | 537 | func swapInfoV2READONLY (userAddressStrOrEmpty,amount,assetIdStr) = { | |
538 | 538 | let neutrinoMetrics = asAnyList(invoke(mathContract, "calcNeutinoMetricsREADONLY", nil, nil)) | |
539 | 539 | let price = asInt(neutrinoMetrics[nMetricIdxPrice]) | |
540 | 540 | let swapParamsTuple = asSwapParamsSTRUCT(invoke(neutrinoContract, "swapParamsByUserSYSREADONLY", [userAddressStrOrEmpty, 0], nil)) | |
541 | 541 | let limitMaxTokenInUsd = swapParamsTuple._1 | |
542 | 542 | let blcks2LmtReset = swapParamsTuple._3 | |
543 | 543 | let limitMaxUsdn = swapParamsTuple._7 | |
544 | 544 | let assetId = fromBase58String(assetIdStr) | |
545 | 545 | let basketAssets = valueOrElse(getString(neutrinoContract, basketAssetsKey()), "WAVES") | |
546 | 546 | let swapType = if (contains(basketAssets, assetIdStr)) | |
547 | 547 | then "outNeutrino" | |
548 | 548 | else if ((assetId == neutrinoAssetId)) | |
549 | 549 | then "outMulti" | |
550 | 550 | else throw(("Can't swap assetId=" + assetIdStr)) | |
551 | 551 | let withdrawTuple = asWithdrawResultSTRUCT(invoke(neutrinoContract, "calcWithdrawResultSYSREADONLY", [swapType, amount, price, assetIdStr], nil)) | |
552 | 552 | let outNeutrinoInfo = makeString([neutrinoAssetIdString, toString(withdrawTuple._8), toString(withdrawTuple._1), toString(withdrawTuple._6), "1000000"], LISTSEP) | |
553 | 553 | let withdrawBasket = if ((swapType == "outNeutrino")) | |
554 | 554 | then outNeutrinoInfo | |
555 | 555 | else withdrawTuple._9 | |
556 | 556 | $Tuple2(nil, makeString_2C(["%d%d%d%s", toString(blcks2LmtReset), toString(limitMaxTokenInUsd), toString(limitMaxUsdn), withdrawBasket], SEP)) | |
557 | 557 | } | |
558 | 558 | ||
559 | 559 | ||
560 | 560 | ||
561 | 561 | @Callable(i) | |
562 | 562 | func basketInfoREADONLY () = { | |
563 | 563 | let neutrinoMetrics = asAnyList(invoke(mathContract, "calcNeutinoMetricsREADONLY", nil, nil)) | |
564 | 564 | let basketInfo = asString(neutrinoMetrics[nMetricBasketInfo]) | |
565 | 565 | let basket = split_4C(basketInfo, "_") | |
566 | 566 | func modify (acc,item) = { | |
567 | 567 | let parts = split(item, LISTSEP) | |
568 | 568 | let assetId = parts[0] | |
569 | 569 | let dlog6 = valueOrErrorMessage(getInteger(neutrinoContract, basketLogbDeltaKey()), "log(b, delta) key is undefined") | |
570 | 570 | let D6 = valueOrErrorMessage(getInteger(neutrinoContract, basketDKey()), "D key is undefined") | |
571 | 571 | let b6 = valueOrErrorMessage(getInteger(neutrinoContract, basketBKey()), "b key is undefined") | |
572 | 572 | let w6 = valueOrErrorMessage(getInteger(neutrinoContract, basketWeightByAssetKey(assetId)), (("Target weight for asset " + assetId) + " is undefined")) | |
573 | 573 | let p6 = ((dlog6 - w6) + parseIntValue(parts[1])) | |
574 | 574 | let d = (D6 - pow(b6, 6, p6, 6, 6, HALFUP)) | |
575 | 575 | (acc :+ makeString(((parts :+ toString(w6)) :+ toString(d)), LISTSEP)) | |
576 | 576 | } | |
577 | 577 | ||
578 | 578 | let b = { | |
579 | 579 | let $l = basket | |
580 | 580 | let $s = size($l) | |
581 | 581 | let $acc0 = nil | |
582 | 582 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
583 | 583 | then $a | |
584 | 584 | else modify($a, $l[$i]) | |
585 | 585 | ||
586 | 586 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
587 | 587 | then $a | |
588 | 588 | else throw("List size exceeds 10") | |
589 | 589 | ||
590 | 590 | $f0_2($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) | |
591 | 591 | } | |
592 | 592 | $Tuple2(nil, ("%s__" + makeString_2C(b, "_"))) | |
593 | 593 | } | |
594 | 594 | ||
595 | 595 | ||
596 | 596 | ||
597 | 597 | @Callable(i) | |
598 | 598 | func usdnStakingAprREADONLY (days) = { | |
599 | 599 | let tmpDays = 1 | |
600 | 600 | let neutrinoMetrics = asAnyList(invoke(mathContract, "calcNeutinoMetricsREADONLY", nil, nil)) | |
601 | 601 | let currentPrice = asInt(neutrinoMetrics[nMetricIdxPrice]) | |
602 | 602 | let wavesIncome = (0 * MULT8) | |
603 | 603 | let incomeForPeriod = fraction(wavesIncome, currentPrice, MULT8) | |
604 | 604 | let apr = calcApr(rpdContract, tmpDays, incomeForPeriod, MULT6) | |
605 | 605 | $Tuple2(nil, ("%d__" + toString(apr))) | |
606 | 606 | } | |
607 | 607 | ||
608 | 608 | ||
609 | 609 | ||
610 | 610 | @Callable(i) | |
611 | 611 | func surfStakingAprREADONLY (days) = { | |
612 | 612 | let tmpDays = 3 | |
613 | 613 | let incomeForPeriod = calcUsdnIncomeForPeriod(surfStakingContract, tmpDays) | |
614 | 614 | let surfPriceToUsdnX6 = 86400 | |
615 | 615 | let apr = calcApr(surfStakingContract, tmpDays, incomeForPeriod, surfPriceToUsdnX6) | |
616 | 616 | $Tuple2(nil, ("%d__" + toString(apr))) | |
617 | 617 | } | |
618 | 618 | ||
619 | 619 | ||
620 | 620 | ||
621 | 621 | @Callable(i) | |
622 | 622 | func surfStakingAprV2READONLY (days,surfUsdnPriceX6) = { | |
623 | 623 | let tmpDays = 3 | |
624 | 624 | let incomeForPeriod = calcUsdnIncomeForPeriod(surfStakingContract, tmpDays) | |
625 | 625 | let apr = calcApr(surfStakingContract, tmpDays, incomeForPeriod, surfUsdnPriceX6) | |
626 | 626 | $Tuple2(nil, ("%d__" + toString(apr))) | |
627 | 627 | } | |
628 | 628 | ||
629 | 629 | ||
630 | 630 | ||
631 | 631 | @Callable(i) | |
632 | 632 | func nsbtStakingAprREADONLY (days) = { | |
633 | 633 | let tmpDays = 3 | |
634 | 634 | let nsbtPriceToUsdnX6 = 8000000 | |
635 | 635 | let incomeForPeriod = calcUsdnIncomeForPeriod(nsbtStakingContract, tmpDays) | |
636 | 636 | let apr = calcApr(nsbtStakingContract, tmpDays, incomeForPeriod, nsbtPriceToUsdnX6) | |
637 | 637 | $Tuple2(nil, ("%d__" + toString(apr))) | |
638 | 638 | } | |
639 | 639 | ||
640 | 640 | ||
641 | 641 | ||
642 | 642 | @Callable(i) | |
643 | 643 | func nsbtStakingAprV2READONLY (days,nsbtUsdnPriceX6) = { | |
644 | 644 | let tmpDays = 3 | |
645 | 645 | let incomeForPeriod = calcUsdnIncomeForPeriod(nsbtStakingContract, tmpDays) | |
646 | 646 | let apr = calcApr(nsbtStakingContract, tmpDays, incomeForPeriod, nsbtUsdnPriceX6) | |
647 | 647 | $Tuple2(nil, ("%d__" + toString(apr))) | |
648 | 648 | } | |
649 | 649 | ||
650 | 650 |
github/deemru/w8io/026f985 53.32 ms ◑