tx · D7X1B6cdQbg4ZQu5aNV4rzaAQzHzUBjv2KP8J53dYwBp 3Mxd5o7PwH76ZkN8zG4xwDLubEnbkaihKzi: -0.04000000 Waves 2022.07.01 23:38 [2121074] smart account 3Mxd5o7PwH76ZkN8zG4xwDLubEnbkaihKzi > SELF 0.00000000 Waves
{ "type": 13, "id": "D7X1B6cdQbg4ZQu5aNV4rzaAQzHzUBjv2KP8J53dYwBp", "fee": 4000000, "feeAssetId": null, "timestamp": 1656707906673, "version": 1, "sender": "3Mxd5o7PwH76ZkN8zG4xwDLubEnbkaihKzi", "senderPublicKey": "BwVRZtTzoCigEsffCvQ9uo7WvkoBNNGVjX4nat5X5zyQ", "proofs": [ "3GDJqce4tuMLN7sVJarGJtW6LrxPf2RcvvxMdr6eiZMPQHFFDshvj5UtNhALbWTpd4hpDTmHMcY5dh2qDGEyagsr" ], "script": "base64:AAIFAAAAAAAAADsIAhIFCgMICAgSABIDCgEIEgQKAggBEgMKAQESBAoCAQgSBgoEAQEBARIECgIBARIECgIBCBIAEgASAAAAAFgAAAAAC3JldmlzaW9uTnVtAgAAAAAAAAAABkVVTEVSOAAAAAAAEDPE1gAAAAAFTVVMVDYAAAAAAAAPQkAAAAAABk1VTFRYNgkAATYAAAABAAAAAAAAD0JAAAAAAAVNVUxUOAAAAAAABfXhAAAAAAAGTVVMVFg4CQABNgAAAAEAAAAAAAX14QAAAAAABk1VTFQxMgAAAADo1KUQAAAAAAAGTVVMVDE4CQABNgAAAAEADeC2s6dkAAAAAAAAA1NFUAIAAAACX18AAAAAB1dBVkVTSUQJAAJZAAAAAQIAAAAFV0FWRVMAAAAAD25NZXRyaWNJZHhQcmljZQAAAAAAAAAAAAAAAAAbbk1ldHJpY0lkeFVzZG5Mb2NrZWRCYWxhbmNlAAAAAAAAAAABAAAAABxuTWV0cmljSWR4V2F2ZXNMb2NrZWRCYWxhbmNlAAAAAAAAAAACAAAAABFuTWV0cmljSWR4UmVzZXJ2ZQAAAAAAAAAAAwAAAAA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AAAEnN0YXJ0U3VyZlByaWNlUkVTVAkABEwAAAACCQABpAAAAAEFAAAAD3N1cmZQcmljZUluVXNkbgkABEwAAAACCQABpAAAAAEFAAAAEHN1cmZQcmljZUluV2F2ZXMJAARMAAAAAgIAAAAQZW5kU3VyZlByaWNlUkVTVAUAAAADbmlsAgAAAAJfXwkAAAIAAAABBQAAAAhyZXN0RGF0YQAAAADIAZbZ", "chainId": 84, "height": 2121074, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6bfSNoNPK6dkCWnW2TbcpvkhtJGxNs7QWxWLnZUP9bV5 Next: 3jGn9Qg3c76ABfCdDn3DHGHFAC4CrkEGRxYQZkXABGPQ Diff:
Old | New | Differences | |
---|---|---|---|
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let revisionNum = "" | |
5 | 5 | ||
6 | - | let | |
6 | + | let EULER8 = 271828182 | |
7 | 7 | ||
8 | - | let | |
8 | + | let MULT6 = 1000000 | |
9 | 9 | ||
10 | - | let | |
10 | + | let MULTX6 = toBigInt(1000000) | |
11 | 11 | ||
12 | - | let | |
12 | + | let MULT8 = 100000000 | |
13 | 13 | ||
14 | - | let | |
14 | + | let MULTX8 = toBigInt(100000000) | |
15 | 15 | ||
16 | - | let | |
16 | + | let MULT12 = 1000000000000 | |
17 | 17 | ||
18 | - | let scale8BigInt = toBigInt(100000000) | |
19 | - | ||
20 | - | let scale12 = 1000000000000 | |
21 | - | ||
22 | - | let scale18 = toBigInt(1000000000000000000) | |
18 | + | let MULT18 = toBigInt(1000000000000000000) | |
23 | 19 | ||
24 | 20 | let SEP = "__" | |
21 | + | ||
22 | + | let WAVESID = fromBase58String("WAVES") | |
23 | + | ||
24 | + | let nMetricIdxPrice = 0 | |
25 | + | ||
26 | + | let nMetricIdxUsdnLockedBalance = 1 | |
27 | + | ||
28 | + | let nMetricIdxWavesLockedBalance = 2 | |
29 | + | ||
30 | + | let nMetricIdxReserve = 3 | |
31 | + | ||
32 | + | let nMetricIdxReserveInUsdn = 4 | |
33 | + | ||
34 | + | let nMetricIdxUsdnSupply = 5 | |
35 | + | ||
36 | + | let nMetricIdxSurplus = 6 | |
37 | + | ||
38 | + | let nMetricIdxSurplusPercent = 7 | |
39 | + | ||
40 | + | let nMetricIdxBR = 8 | |
41 | + | ||
42 | + | let nMetricIdxNsbtSupply = 9 | |
43 | + | ||
44 | + | let nMetricIdxMaxNsbtSupply = 10 | |
45 | + | ||
46 | + | let bFuncIdxSurf = 0 | |
47 | + | ||
48 | + | let bFuncIdxWaves = 1 | |
49 | + | ||
50 | + | let bFuncIdxUsdn = 2 | |
51 | + | ||
52 | + | let bFuncIdxReserveStart = 3 | |
53 | + | ||
54 | + | let bFuncIdxSupplyStart = 4 | |
55 | + | ||
56 | + | let bFuncIdxBRStart = 5 | |
57 | + | ||
58 | + | let bFuncIdxReserveEnd = 6 | |
59 | + | ||
60 | + | let bFuncIdxSupplyEnd = 7 | |
61 | + | ||
62 | + | let bFuncIdxBREnd = 8 | |
63 | + | ||
64 | + | let bFuncIdxRestWaves = 9 | |
65 | + | ||
66 | + | let bFuncIdxRestUsdn = 10 | |
25 | 67 | ||
26 | 68 | func keyNeutrinoAddress () = "%s%s__config__neutrinoAddress" | |
27 | 69 | ||
41 | 83 | func keyContolContract () = "control_contract" | |
42 | 84 | ||
43 | 85 | ||
44 | - | func keyBondAssetId () = "bond_asset_id" | |
86 | + | func keyNsbtAssetId () = "bond_asset_id" | |
87 | + | ||
88 | + | ||
89 | + | func keySurfAssetId () = "surf_asset_id" | |
45 | 90 | ||
46 | 91 | ||
47 | 92 | func keyBalanceLocked () = "balance_lock_" | |
104 | 149 | func getBoolOrFail (address,key) = valueOrErrorMessage(getBoolean(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
105 | 150 | ||
106 | 151 | ||
107 | - | func convertNeutrinoToWaves (amount,price) = fraction( | |
152 | + | func convertNeutrinoToWaves (amount,price) = fraction(amount, MULT8, price) | |
108 | 153 | ||
109 | 154 | ||
110 | - | func convertWavesToNeutrino (amount,price) = fraction( | |
155 | + | func convertWavesToNeutrino (amount,price) = fraction(amount, price, MULT8) | |
111 | 156 | ||
112 | 157 | ||
113 | 158 | func asAnyList (val) = match val { | |
160 | 205 | } | |
161 | 206 | ||
162 | 207 | ||
163 | - | func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), | |
208 | + | func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), MULT18, toBigInt(origScaleMult)) | |
164 | 209 | ||
165 | 210 | ||
166 | - | func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), | |
211 | + | func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), MULT18)) | |
167 | 212 | ||
168 | 213 | ||
169 | 214 | let neutrinoContract = addressFromStringValue(getStringOrFail(this, keyNeutrinoAddress())) | |
184 | 229 | ||
185 | 230 | let neutrinoAssetId = fromBase58String(neutrinoAssetIdString) | |
186 | 231 | ||
187 | - | let nsbtAssetIdStr = getStringValue(neutrinoContract, | |
232 | + | let nsbtAssetIdStr = getStringValue(neutrinoContract, keyNsbtAssetId()) | |
188 | 233 | ||
189 | 234 | let nsbtAssetId = fromBase58String(nsbtAssetIdStr) | |
235 | + | ||
236 | + | let surfAssetIdStr = getStringValue(auctionContract, keySurfAssetId()) | |
237 | + | ||
238 | + | let surfAssetId = fromBase58String(surfAssetIdStr) | |
190 | 239 | ||
191 | 240 | func minWavesForNsbtBuy () = asInt(invoke(auctionContract, "minWavesAmountNsbtBuySYSREADONLY", nil, nil)) | |
192 | 241 | ||
193 | 242 | ||
194 | 243 | func minNsbtForSell () = asInt(invoke(auctionContract, "minNsbtAmountForSellSYSREADONLY", nil, nil)) | |
244 | + | ||
245 | + | ||
246 | + | func minWavesForSurfBuy () = asInt(invoke(auctionContract, "minWavesAmountSurfBuySYSREADONLY", nil, nil)) | |
247 | + | ||
248 | + | ||
249 | + | func minUsdnForSurfBuy () = asInt(invoke(auctionContract, "minUsdnAmountSurfBuySYSREADONLY", nil, nil)) | |
195 | 250 | ||
196 | 251 | ||
197 | 252 | func privateNsbtPriceREST () = { | |
213 | 268 | func neutrinoStatsREADONLY () = { | |
214 | 269 | let neutrinoMetrics = asAnyList(invoke(mathContract, "calcNeutinoMetricsREADONLY", nil, nil)) | |
215 | 270 | let prices = asAnyList(invoke(mathContract, "calcContractNsbtPriceSYSREADONLY", [0], nil)) | |
216 | - | let currentPrice = asInt(neutrinoMetrics[ | |
217 | - | let neutrinoLockedBalance = asInt(neutrinoMetrics[ | |
218 | - | let wavesLockedBalance = asInt(neutrinoMetrics[ | |
219 | - | let reservesInWaves = asInt(neutrinoMetrics[ | |
220 | - | let reservesInUsdn = asInt(neutrinoMetrics[ | |
221 | - | let neutrinoSupply = asInt(neutrinoMetrics[ | |
222 | - | let surplus = asInt(neutrinoMetrics[ | |
223 | - | let surplusPercent = asInt(neutrinoMetrics[ | |
224 | - | let BR = asInt(neutrinoMetrics[ | |
225 | - | let nsbtSupply = asInt(neutrinoMetrics[ | |
226 | - | let maxNsbtSupply = asInt(neutrinoMetrics[ | |
271 | + | let currentPrice = asInt(neutrinoMetrics[nMetricIdxPrice]) | |
272 | + | let neutrinoLockedBalance = asInt(neutrinoMetrics[nMetricIdxUsdnLockedBalance]) | |
273 | + | let wavesLockedBalance = asInt(neutrinoMetrics[nMetricIdxWavesLockedBalance]) | |
274 | + | let reservesInWaves = asInt(neutrinoMetrics[nMetricIdxReserve]) | |
275 | + | let reservesInUsdn = asInt(neutrinoMetrics[nMetricIdxReserveInUsdn]) | |
276 | + | let neutrinoSupply = asInt(neutrinoMetrics[nMetricIdxUsdnSupply]) | |
277 | + | let surplus = asInt(neutrinoMetrics[nMetricIdxSurplus]) | |
278 | + | let surplusPercent = asInt(neutrinoMetrics[nMetricIdxSurplusPercent]) | |
279 | + | let BR = asInt(neutrinoMetrics[nMetricIdxBR]) | |
280 | + | let nsbtSupply = asInt(neutrinoMetrics[nMetricIdxNsbtSupply]) | |
281 | + | let maxNsbtSupply = asInt(neutrinoMetrics[nMetricIdxMaxNsbtSupply]) | |
227 | 282 | let nsbt2usdnPrice = asInt(prices[0]) | |
228 | 283 | let nsbt2wavesPrice = asInt(prices[1]) | |
229 | 284 | let minWaves4NsbtBuy = minWavesForNsbtBuy() | |
230 | 285 | let minNsbtsell = minNsbtForSell() | |
231 | 286 | let minNsbtLockAmt = getIntOrFail(nsbtStakingContract, keyMinLockAmount()) | |
232 | - | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d", toString(currentPrice), toString(neutrinoLockedBalance), toString(wavesLockedBalance), toString(reservesInWaves), toString(reservesInUsdn), toString(neutrinoSupply), toString(surplus), toString(surplusPercent), toString(BR), toString(nsbtSupply), toString(maxNsbtSupply), toString(nsbt2usdnPrice), toString(nsbt2wavesPrice), toString(minWaves4NsbtBuy), toString(minNsbtsell), toString(minNsbtLockAmt)], SEP)) | |
287 | + | let minWaves4SurfBuy = minWavesForSurfBuy() | |
288 | + | let minUsdn4SurfBuy = minUsdnForSurfBuy() | |
289 | + | let maxWaves2BuySurf = (fraction(neutrinoSupply, MULT8, currentPrice) - reservesInWaves) | |
290 | + | let maxUsdn2BuySurf = (neutrinoSupply - reservesInUsdn) | |
291 | + | let surfPriceInUsdn = fraction(reservesInWaves, currentPrice, neutrinoSupply) | |
292 | + | let surfPriceInWaves = fraction(reservesInWaves, 1, neutrinoSupply) | |
293 | + | $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", toString(currentPrice), toString(neutrinoLockedBalance), toString(wavesLockedBalance), toString(reservesInWaves), toString(reservesInUsdn), toString(neutrinoSupply), toString(surplus), toString(surplusPercent), toString(BR), toString(nsbtSupply), toString(maxNsbtSupply), toString(nsbt2usdnPrice), toString(nsbt2wavesPrice), toString(minWaves4NsbtBuy), toString(minNsbtsell), toString(minNsbtLockAmt), toString(minWaves4SurfBuy), toString(minUsdn4SurfBuy), toString(maxWaves2BuySurf), toString(maxUsdn2BuySurf), toString(surfPriceInUsdn), toString(surfPriceInWaves)], SEP)) | |
233 | 294 | } | |
234 | 295 | ||
235 | 296 | ||
243 | 304 | let usdn2WavesFee = getIntegerValue(neutrinoContract, keyNeutrinoOutFeePart()) | |
244 | 305 | let usdnSwapDelayDuration = getIntegerValue(neutrinoContract, keyBalanceNeutrinoLockInterval()) | |
245 | 306 | let wavesSwapDelayDuration = getIntegerValue(neutrinoContract, keyBalanceWavesLockInterval()) | |
246 | - | let $ | |
247 | - | let swapLimitMaxUsdn = $ | |
248 | - | let swapLimitSpentUsdn = $ | |
249 | - | let blcks2LmtReset = $ | |
307 | + | let $t01039610560 = asSwapParamsSTRUCT(invoke(neutrinoContract, "swapParamsByUserSYSREADONLY", [userAddressStrOpt, 0], nil)) | |
308 | + | let swapLimitMaxUsdn = $t01039610560._1 | |
309 | + | let swapLimitSpentUsdn = $t01039610560._2 | |
310 | + | let blcks2LmtReset = $t01039610560._3 | |
250 | 311 | let swapLimitMaxWaves = convertNeutrinoToWaves(swapLimitMaxUsdn, currentPrice) | |
251 | 312 | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d%d%d%d", toString(currentPrice), toString(minWavesSwapAmt), toString(minUsdnSwapAmt), toString(waves2UsdnFee), toString(usdn2WavesFee), toString(usdnSwapDelayDuration), toString(wavesSwapDelayDuration), toString(blcks2LmtReset), toString(swapLimitMaxWaves), toString(swapLimitMaxUsdn), toString(swapLimitSpentUsdn)], SEP)) | |
252 | 313 | } | |
256 | 317 | @Callable(i) | |
257 | 318 | func gnsbtInfoREADONLY (userAddressStrOpt,nsbtAmtDiff) = { | |
258 | 319 | let currentPrice = getIntegerValue(controlContract, keyPrice()) | |
259 | - | let $ | |
260 | - | let limitMaxUsdn = $ | |
261 | - | let limitSpent = $ | |
262 | - | let blcks2LmtReset = $ | |
263 | - | let gnsbtAmt = $ | |
264 | - | let gnsbtAmtTotal = $ | |
265 | - | let $ | |
266 | - | let limitMaxUsdnNEW = $ | |
267 | - | let limitSpentNEW = $ | |
268 | - | let blcks2LmtResetNEW = $ | |
269 | - | let gnsbtAmtNEW = $ | |
270 | - | let gnsbtAmtTotalNEW = $ | |
320 | + | let $t01156611749 = asSwapParamsSTRUCT(invoke(neutrinoContract, "swapParamsByUserSYSREADONLY", [userAddressStrOpt, 0], nil)) | |
321 | + | let limitMaxUsdn = $t01156611749._1 | |
322 | + | let limitSpent = $t01156611749._2 | |
323 | + | let blcks2LmtReset = $t01156611749._3 | |
324 | + | let gnsbtAmt = $t01156611749._4 | |
325 | + | let gnsbtAmtTotal = $t01156611749._5 | |
326 | + | let $t01175311961 = asSwapParamsSTRUCT(invoke(neutrinoContract, "swapParamsByUserSYSREADONLY", [userAddressStrOpt, nsbtAmtDiff], nil)) | |
327 | + | let limitMaxUsdnNEW = $t01175311961._1 | |
328 | + | let limitSpentNEW = $t01175311961._2 | |
329 | + | let blcks2LmtResetNEW = $t01175311961._3 | |
330 | + | let gnsbtAmtNEW = $t01175311961._4 | |
331 | + | let gnsbtAmtTotalNEW = $t01175311961._5 | |
271 | 332 | let limitMaxWaves = convertNeutrinoToWaves(limitMaxUsdn, currentPrice) | |
272 | 333 | let limitMaxWavesNEW = convertNeutrinoToWaves(limitMaxUsdnNEW, currentPrice) | |
273 | 334 | let gnsbtShare = if ((gnsbtAmtTotal != 0)) | |
274 | - | then fraction((gnsbtAmt * 100), | |
335 | + | then fraction((gnsbtAmt * 100), MULT12, gnsbtAmtTotal) | |
275 | 336 | else 0 | |
276 | 337 | let gnsbtShareNEW = if ((gnsbtAmtTotalNEW != 0)) | |
277 | - | then fraction((gnsbtAmtNEW * 100), | |
338 | + | then fraction((gnsbtAmtNEW * 100), MULT12, gnsbtAmtTotalNEW) | |
278 | 339 | else 0 | |
279 | 340 | let rewardInfo = asString(invoke(nsbtStakingContract, "unclaimedRewardsREADONLY", [userAddressStrOpt], nil)) | |
280 | 341 | let nsbtAmt = gnsbtAmt | |
320 | 381 | ||
321 | 382 | ||
322 | 383 | @Callable(i) | |
384 | + | func buySurfREADONLY (amount,assetIdStr) = { | |
385 | + | let assetId = fromBase58String(assetIdStr) | |
386 | + | if (if ((assetId == WAVESID)) | |
387 | + | then (minWavesForSurfBuy() > amount) | |
388 | + | else false) | |
389 | + | then throw((("min " + toString(minWavesForSurfBuy())) + " WAVES expected")) | |
390 | + | else if (if ((assetId == neutrinoAssetId)) | |
391 | + | then (minUsdnForSurfBuy() > amount) | |
392 | + | else false) | |
393 | + | then throw((("min " + toString(minUsdnForSurfBuy())) + " USDN expected")) | |
394 | + | else { | |
395 | + | let surfResult = asAnyList(invoke(mathContract, "surfFunctionREADONLY", [amount, assetId], nil)) | |
396 | + | let surfAmount = asInt(surfResult[bFuncIdxSurf]) | |
397 | + | if ((0 >= surfAmount)) | |
398 | + | then throw("surfAmount <= 0") | |
399 | + | else $Tuple2(nil, makeString(["%d", toString(surfAmount)], SEP)) | |
400 | + | } | |
401 | + | } | |
402 | + | ||
403 | + | ||
404 | + | ||
405 | + | @Callable(i) | |
323 | 406 | func mergedStakeREADONLY (amount1,height1,amount2,height2) = { | |
324 | 407 | let halfLife = getIntOrFail(nsbtStakingContract, keyHalfLife()) | |
325 | 408 | let h = asInt(invoke(mathContract, "mergeStakesREADONLY", [amount1, height1, amount2, height2, halfLife], nil)) | |
356 | 439 | @Callable(i) | |
357 | 440 | func neutrinoStateREST () = { | |
358 | 441 | let neutrinoMetrics = asAnyList(invoke(mathContract, "calcNeutinoMetricsREADONLY", nil, nil)) | |
359 | - | let currentPrice = asInt(neutrinoMetrics[ | |
360 | - | let neutrinoLockedBalance = asInt(neutrinoMetrics[ | |
361 | - | let wavesLockedBalance = asInt(neutrinoMetrics[ | |
362 | - | let reservesInWaves = asInt(neutrinoMetrics[ | |
363 | - | let reservesInUsdn = asInt(neutrinoMetrics[ | |
364 | - | let neutrinoSupply = asInt(neutrinoMetrics[ | |
365 | - | let surplus = asInt(neutrinoMetrics[ | |
366 | - | let surplusPercent = asInt(neutrinoMetrics[ | |
367 | - | let BR = asInt(neutrinoMetrics[ | |
368 | - | let nsbtSupply = asInt(neutrinoMetrics[ | |
442 | + | let currentPrice = asInt(neutrinoMetrics[nMetricIdxPrice]) | |
443 | + | let neutrinoLockedBalance = asInt(neutrinoMetrics[nMetricIdxUsdnLockedBalance]) | |
444 | + | let wavesLockedBalance = asInt(neutrinoMetrics[nMetricIdxWavesLockedBalance]) | |
445 | + | let reservesInWaves = asInt(neutrinoMetrics[nMetricIdxReserve]) | |
446 | + | let reservesInUsdn = asInt(neutrinoMetrics[nMetricIdxReserveInUsdn]) | |
447 | + | let neutrinoSupply = asInt(neutrinoMetrics[nMetricIdxUsdnSupply]) | |
448 | + | let surplus = asInt(neutrinoMetrics[nMetricIdxSurplus]) | |
449 | + | let surplusPercent = asInt(neutrinoMetrics[nMetricIdxSurplusPercent]) | |
450 | + | let BR = asInt(neutrinoMetrics[nMetricIdxBR]) | |
451 | + | let nsbtSupply = asInt(neutrinoMetrics[nMetricIdxNsbtSupply]) | |
369 | 452 | throw(makeString(["resultNeutrinoStateREST", toString(currentPrice), toString(neutrinoLockedBalance), toString(wavesLockedBalance), toString(reservesInWaves), toString(reservesInUsdn), toString(neutrinoSupply), toString(surplus), toString(surplusPercent), toString(BR), toString(nsbtSupply)], "__")) | |
370 | 453 | } | |
371 | 454 | ||
381 | 464 | } | |
382 | 465 | ||
383 | 466 | ||
467 | + | ||
468 | + | @Callable(i) | |
469 | + | func surfPriceREST () = { | |
470 | + | let neutrinoMetrics = asAnyList(invoke(mathContract, "calcNeutinoMetricsREADONLY", nil, nil)) | |
471 | + | let currentPrice = asInt(neutrinoMetrics[nMetricIdxPrice]) | |
472 | + | let reservesInWaves = asInt(neutrinoMetrics[nMetricIdxReserve]) | |
473 | + | let neutrinoSupply = asInt(neutrinoMetrics[nMetricIdxUsdnSupply]) | |
474 | + | let surfPriceInUsdn = fraction(reservesInWaves, currentPrice, neutrinoSupply) | |
475 | + | let surfPriceInWaves = fraction(reservesInWaves, 1, neutrinoSupply) | |
476 | + | let restData = makeString(["startSurfPriceREST", toString(surfPriceInUsdn), toString(surfPriceInWaves), "endSurfPriceREST"], "__") | |
477 | + | throw(restData) | |
478 | + | } | |
479 | + | ||
480 | + |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let revisionNum = "" | |
5 | 5 | ||
6 | - | let | |
6 | + | let EULER8 = 271828182 | |
7 | 7 | ||
8 | - | let | |
8 | + | let MULT6 = 1000000 | |
9 | 9 | ||
10 | - | let | |
10 | + | let MULTX6 = toBigInt(1000000) | |
11 | 11 | ||
12 | - | let | |
12 | + | let MULT8 = 100000000 | |
13 | 13 | ||
14 | - | let | |
14 | + | let MULTX8 = toBigInt(100000000) | |
15 | 15 | ||
16 | - | let | |
16 | + | let MULT12 = 1000000000000 | |
17 | 17 | ||
18 | - | let scale8BigInt = toBigInt(100000000) | |
19 | - | ||
20 | - | let scale12 = 1000000000000 | |
21 | - | ||
22 | - | let scale18 = toBigInt(1000000000000000000) | |
18 | + | let MULT18 = toBigInt(1000000000000000000) | |
23 | 19 | ||
24 | 20 | let SEP = "__" | |
21 | + | ||
22 | + | let WAVESID = fromBase58String("WAVES") | |
23 | + | ||
24 | + | let nMetricIdxPrice = 0 | |
25 | + | ||
26 | + | let nMetricIdxUsdnLockedBalance = 1 | |
27 | + | ||
28 | + | let nMetricIdxWavesLockedBalance = 2 | |
29 | + | ||
30 | + | let nMetricIdxReserve = 3 | |
31 | + | ||
32 | + | let nMetricIdxReserveInUsdn = 4 | |
33 | + | ||
34 | + | let nMetricIdxUsdnSupply = 5 | |
35 | + | ||
36 | + | let nMetricIdxSurplus = 6 | |
37 | + | ||
38 | + | let nMetricIdxSurplusPercent = 7 | |
39 | + | ||
40 | + | let nMetricIdxBR = 8 | |
41 | + | ||
42 | + | let nMetricIdxNsbtSupply = 9 | |
43 | + | ||
44 | + | let nMetricIdxMaxNsbtSupply = 10 | |
45 | + | ||
46 | + | let bFuncIdxSurf = 0 | |
47 | + | ||
48 | + | let bFuncIdxWaves = 1 | |
49 | + | ||
50 | + | let bFuncIdxUsdn = 2 | |
51 | + | ||
52 | + | let bFuncIdxReserveStart = 3 | |
53 | + | ||
54 | + | let bFuncIdxSupplyStart = 4 | |
55 | + | ||
56 | + | let bFuncIdxBRStart = 5 | |
57 | + | ||
58 | + | let bFuncIdxReserveEnd = 6 | |
59 | + | ||
60 | + | let bFuncIdxSupplyEnd = 7 | |
61 | + | ||
62 | + | let bFuncIdxBREnd = 8 | |
63 | + | ||
64 | + | let bFuncIdxRestWaves = 9 | |
65 | + | ||
66 | + | let bFuncIdxRestUsdn = 10 | |
25 | 67 | ||
26 | 68 | func keyNeutrinoAddress () = "%s%s__config__neutrinoAddress" | |
27 | 69 | ||
28 | 70 | ||
29 | 71 | func keyNeutrinoAssetId () = "neutrino_asset_id" | |
30 | 72 | ||
31 | 73 | ||
32 | 74 | func keyLiquidationContractAddress () = "liquidation_contract" | |
33 | 75 | ||
34 | 76 | ||
35 | 77 | func keyRPDContract () = "rpd_contract" | |
36 | 78 | ||
37 | 79 | ||
38 | 80 | func keyAuctionContract () = "auction_contract" | |
39 | 81 | ||
40 | 82 | ||
41 | 83 | func keyContolContract () = "control_contract" | |
42 | 84 | ||
43 | 85 | ||
44 | - | func keyBondAssetId () = "bond_asset_id" | |
86 | + | func keyNsbtAssetId () = "bond_asset_id" | |
87 | + | ||
88 | + | ||
89 | + | func keySurfAssetId () = "surf_asset_id" | |
45 | 90 | ||
46 | 91 | ||
47 | 92 | func keyBalanceLocked () = "balance_lock_" | |
48 | 93 | ||
49 | 94 | ||
50 | 95 | func keyWavesLockedBalance () = (keyBalanceLocked() + "waves") | |
51 | 96 | ||
52 | 97 | ||
53 | 98 | func keyNeutrinoLockedBalance () = (keyBalanceLocked() + "neutrino") | |
54 | 99 | ||
55 | 100 | ||
56 | 101 | func keyMinWavesSwapAmount () = "min_waves_swap_amount" | |
57 | 102 | ||
58 | 103 | ||
59 | 104 | func keyMinNeutrinoSwapAmount () = "min_neutrino_swap_amount" | |
60 | 105 | ||
61 | 106 | ||
62 | 107 | func keyWavesOutFeePart () = "wavesOut_swap_feePart" | |
63 | 108 | ||
64 | 109 | ||
65 | 110 | func keyNeutrinoOutFeePart () = "neutrinoOut_swap_feePart" | |
66 | 111 | ||
67 | 112 | ||
68 | 113 | func keyNsbtLockContract () = "%s__nsbtLockContract" | |
69 | 114 | ||
70 | 115 | ||
71 | 116 | func keyMathContract () = "%s__mathContract" | |
72 | 117 | ||
73 | 118 | ||
74 | 119 | func keyBalanceWavesLockInterval () = "balance_waves_lock_interval" | |
75 | 120 | ||
76 | 121 | ||
77 | 122 | func keyBalanceNeutrinoLockInterval () = "balance_neutrino_lock_interval" | |
78 | 123 | ||
79 | 124 | ||
80 | 125 | func keyPrice () = "price" | |
81 | 126 | ||
82 | 127 | ||
83 | 128 | func keyLockParamStartBlock (userAddress) = makeString(["%s%s%s", "paramByUser", userAddress, "start"], SEP) | |
84 | 129 | ||
85 | 130 | ||
86 | 131 | func keyHalfLife () = "%s__halfLife" | |
87 | 132 | ||
88 | 133 | ||
89 | 134 | func keyMinLockAmount () = "%s__minLockAmount" | |
90 | 135 | ||
91 | 136 | ||
92 | 137 | func keyMinWavesForNsbtBuy () = "min_waves_nsbt_buy" | |
93 | 138 | ||
94 | 139 | ||
95 | 140 | func keyMinNsbtSell () = "min_nsbt_sell" | |
96 | 141 | ||
97 | 142 | ||
98 | 143 | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
99 | 144 | ||
100 | 145 | ||
101 | 146 | func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
102 | 147 | ||
103 | 148 | ||
104 | 149 | func getBoolOrFail (address,key) = valueOrErrorMessage(getBoolean(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
105 | 150 | ||
106 | 151 | ||
107 | - | func convertNeutrinoToWaves (amount,price) = fraction( | |
152 | + | func convertNeutrinoToWaves (amount,price) = fraction(amount, MULT8, price) | |
108 | 153 | ||
109 | 154 | ||
110 | - | func convertWavesToNeutrino (amount,price) = fraction( | |
155 | + | func convertWavesToNeutrino (amount,price) = fraction(amount, price, MULT8) | |
111 | 156 | ||
112 | 157 | ||
113 | 158 | func asAnyList (val) = match val { | |
114 | 159 | case valAnyList: List[Any] => | |
115 | 160 | valAnyList | |
116 | 161 | case _ => | |
117 | 162 | throw("fail to cast into List[Any]") | |
118 | 163 | } | |
119 | 164 | ||
120 | 165 | ||
121 | 166 | func asInt (val) = match val { | |
122 | 167 | case valInt: Int => | |
123 | 168 | valInt | |
124 | 169 | case _ => | |
125 | 170 | throw("fail to cast into Int") | |
126 | 171 | } | |
127 | 172 | ||
128 | 173 | ||
129 | 174 | func asString (val) = match val { | |
130 | 175 | case valStr: String => | |
131 | 176 | valStr | |
132 | 177 | case _ => | |
133 | 178 | throw("fail to cast into String") | |
134 | 179 | } | |
135 | 180 | ||
136 | 181 | ||
137 | 182 | func asTuple2Ints (val) = match val { | |
138 | 183 | case v: (Int, Int) => | |
139 | 184 | v | |
140 | 185 | case _ => | |
141 | 186 | throw("fail to cast into Tuple2 ints") | |
142 | 187 | } | |
143 | 188 | ||
144 | 189 | ||
145 | 190 | func asSwapParamsSTRUCT (val) = match val { | |
146 | 191 | case struct: (Int, Int, Int, Int, Int) => | |
147 | 192 | struct | |
148 | 193 | case _ => | |
149 | 194 | throw("fail to cast into Int") | |
150 | 195 | } | |
151 | 196 | ||
152 | 197 | ||
153 | 198 | func toTimestamp (start) = if ((0 > start)) | |
154 | 199 | then -1 | |
155 | 200 | else match blockInfoByHeight(start) { | |
156 | 201 | case block: BlockInfo => | |
157 | 202 | block.timestamp | |
158 | 203 | case _ => | |
159 | 204 | -1 | |
160 | 205 | } | |
161 | 206 | ||
162 | 207 | ||
163 | - | func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), | |
208 | + | func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), MULT18, toBigInt(origScaleMult)) | |
164 | 209 | ||
165 | 210 | ||
166 | - | func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), | |
211 | + | func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), MULT18)) | |
167 | 212 | ||
168 | 213 | ||
169 | 214 | let neutrinoContract = addressFromStringValue(getStringOrFail(this, keyNeutrinoAddress())) | |
170 | 215 | ||
171 | 216 | let controlContract = addressFromStringValue(getStringOrFail(neutrinoContract, keyContolContract())) | |
172 | 217 | ||
173 | 218 | let auctionContract = addressFromStringValue(getStringOrFail(neutrinoContract, keyAuctionContract())) | |
174 | 219 | ||
175 | 220 | let liquidationContract = getStringOrFail(neutrinoContract, keyLiquidationContractAddress()) | |
176 | 221 | ||
177 | 222 | let rpdContract = getStringOrFail(neutrinoContract, keyRPDContract()) | |
178 | 223 | ||
179 | 224 | let mathContract = addressFromStringValue(getStringOrFail(this, keyMathContract())) | |
180 | 225 | ||
181 | 226 | let nsbtStakingContract = addressFromStringValue(getStringOrFail(this, keyNsbtLockContract())) | |
182 | 227 | ||
183 | 228 | let neutrinoAssetIdString = getStringOrFail(neutrinoContract, keyNeutrinoAssetId()) | |
184 | 229 | ||
185 | 230 | let neutrinoAssetId = fromBase58String(neutrinoAssetIdString) | |
186 | 231 | ||
187 | - | let nsbtAssetIdStr = getStringValue(neutrinoContract, | |
232 | + | let nsbtAssetIdStr = getStringValue(neutrinoContract, keyNsbtAssetId()) | |
188 | 233 | ||
189 | 234 | let nsbtAssetId = fromBase58String(nsbtAssetIdStr) | |
235 | + | ||
236 | + | let surfAssetIdStr = getStringValue(auctionContract, keySurfAssetId()) | |
237 | + | ||
238 | + | let surfAssetId = fromBase58String(surfAssetIdStr) | |
190 | 239 | ||
191 | 240 | func minWavesForNsbtBuy () = asInt(invoke(auctionContract, "minWavesAmountNsbtBuySYSREADONLY", nil, nil)) | |
192 | 241 | ||
193 | 242 | ||
194 | 243 | func minNsbtForSell () = asInt(invoke(auctionContract, "minNsbtAmountForSellSYSREADONLY", nil, nil)) | |
244 | + | ||
245 | + | ||
246 | + | func minWavesForSurfBuy () = asInt(invoke(auctionContract, "minWavesAmountSurfBuySYSREADONLY", nil, nil)) | |
247 | + | ||
248 | + | ||
249 | + | func minUsdnForSurfBuy () = asInt(invoke(auctionContract, "minUsdnAmountSurfBuySYSREADONLY", nil, nil)) | |
195 | 250 | ||
196 | 251 | ||
197 | 252 | func privateNsbtPriceREST () = { | |
198 | 253 | let prices = asAnyList(invoke(mathContract, "calcContractNsbtPriceSYSREADONLY", [0], nil)) | |
199 | 254 | let nsbt2usdnPrice = asInt(prices[0]) | |
200 | 255 | let nsbt2wavesPrice = asInt(prices[1]) | |
201 | 256 | $Tuple2(IntegerEntry("nsbt2usdnPrice", nsbt2usdnPrice), IntegerEntry("nsbt2wavesPrice", nsbt2wavesPrice)) | |
202 | 257 | } | |
203 | 258 | ||
204 | 259 | ||
205 | 260 | @Callable(i) | |
206 | 261 | func constructor (neutrinoAddress,nsbtLockAddress,mathAddress) = if ((i.caller != this)) | |
207 | 262 | then throw("not authorized") | |
208 | 263 | else [StringEntry(keyNeutrinoAddress(), neutrinoAddress), StringEntry(keyNsbtLockContract(), nsbtLockAddress), StringEntry(keyMathContract(), mathAddress)] | |
209 | 264 | ||
210 | 265 | ||
211 | 266 | ||
212 | 267 | @Callable(i) | |
213 | 268 | func neutrinoStatsREADONLY () = { | |
214 | 269 | let neutrinoMetrics = asAnyList(invoke(mathContract, "calcNeutinoMetricsREADONLY", nil, nil)) | |
215 | 270 | let prices = asAnyList(invoke(mathContract, "calcContractNsbtPriceSYSREADONLY", [0], nil)) | |
216 | - | let currentPrice = asInt(neutrinoMetrics[ | |
217 | - | let neutrinoLockedBalance = asInt(neutrinoMetrics[ | |
218 | - | let wavesLockedBalance = asInt(neutrinoMetrics[ | |
219 | - | let reservesInWaves = asInt(neutrinoMetrics[ | |
220 | - | let reservesInUsdn = asInt(neutrinoMetrics[ | |
221 | - | let neutrinoSupply = asInt(neutrinoMetrics[ | |
222 | - | let surplus = asInt(neutrinoMetrics[ | |
223 | - | let surplusPercent = asInt(neutrinoMetrics[ | |
224 | - | let BR = asInt(neutrinoMetrics[ | |
225 | - | let nsbtSupply = asInt(neutrinoMetrics[ | |
226 | - | let maxNsbtSupply = asInt(neutrinoMetrics[ | |
271 | + | let currentPrice = asInt(neutrinoMetrics[nMetricIdxPrice]) | |
272 | + | let neutrinoLockedBalance = asInt(neutrinoMetrics[nMetricIdxUsdnLockedBalance]) | |
273 | + | let wavesLockedBalance = asInt(neutrinoMetrics[nMetricIdxWavesLockedBalance]) | |
274 | + | let reservesInWaves = asInt(neutrinoMetrics[nMetricIdxReserve]) | |
275 | + | let reservesInUsdn = asInt(neutrinoMetrics[nMetricIdxReserveInUsdn]) | |
276 | + | let neutrinoSupply = asInt(neutrinoMetrics[nMetricIdxUsdnSupply]) | |
277 | + | let surplus = asInt(neutrinoMetrics[nMetricIdxSurplus]) | |
278 | + | let surplusPercent = asInt(neutrinoMetrics[nMetricIdxSurplusPercent]) | |
279 | + | let BR = asInt(neutrinoMetrics[nMetricIdxBR]) | |
280 | + | let nsbtSupply = asInt(neutrinoMetrics[nMetricIdxNsbtSupply]) | |
281 | + | let maxNsbtSupply = asInt(neutrinoMetrics[nMetricIdxMaxNsbtSupply]) | |
227 | 282 | let nsbt2usdnPrice = asInt(prices[0]) | |
228 | 283 | let nsbt2wavesPrice = asInt(prices[1]) | |
229 | 284 | let minWaves4NsbtBuy = minWavesForNsbtBuy() | |
230 | 285 | let minNsbtsell = minNsbtForSell() | |
231 | 286 | let minNsbtLockAmt = getIntOrFail(nsbtStakingContract, keyMinLockAmount()) | |
232 | - | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d", toString(currentPrice), toString(neutrinoLockedBalance), toString(wavesLockedBalance), toString(reservesInWaves), toString(reservesInUsdn), toString(neutrinoSupply), toString(surplus), toString(surplusPercent), toString(BR), toString(nsbtSupply), toString(maxNsbtSupply), toString(nsbt2usdnPrice), toString(nsbt2wavesPrice), toString(minWaves4NsbtBuy), toString(minNsbtsell), toString(minNsbtLockAmt)], SEP)) | |
287 | + | let minWaves4SurfBuy = minWavesForSurfBuy() | |
288 | + | let minUsdn4SurfBuy = minUsdnForSurfBuy() | |
289 | + | let maxWaves2BuySurf = (fraction(neutrinoSupply, MULT8, currentPrice) - reservesInWaves) | |
290 | + | let maxUsdn2BuySurf = (neutrinoSupply - reservesInUsdn) | |
291 | + | let surfPriceInUsdn = fraction(reservesInWaves, currentPrice, neutrinoSupply) | |
292 | + | let surfPriceInWaves = fraction(reservesInWaves, 1, neutrinoSupply) | |
293 | + | $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", toString(currentPrice), toString(neutrinoLockedBalance), toString(wavesLockedBalance), toString(reservesInWaves), toString(reservesInUsdn), toString(neutrinoSupply), toString(surplus), toString(surplusPercent), toString(BR), toString(nsbtSupply), toString(maxNsbtSupply), toString(nsbt2usdnPrice), toString(nsbt2wavesPrice), toString(minWaves4NsbtBuy), toString(minNsbtsell), toString(minNsbtLockAmt), toString(minWaves4SurfBuy), toString(minUsdn4SurfBuy), toString(maxWaves2BuySurf), toString(maxUsdn2BuySurf), toString(surfPriceInUsdn), toString(surfPriceInWaves)], SEP)) | |
233 | 294 | } | |
234 | 295 | ||
235 | 296 | ||
236 | 297 | ||
237 | 298 | @Callable(i) | |
238 | 299 | func swapInfoREADONLY (userAddressStrOpt) = { | |
239 | 300 | let currentPrice = getIntegerValue(controlContract, keyPrice()) | |
240 | 301 | let minWavesSwapAmt = getIntegerValue(neutrinoContract, keyMinWavesSwapAmount()) | |
241 | 302 | let minUsdnSwapAmt = getIntegerValue(neutrinoContract, keyMinNeutrinoSwapAmount()) | |
242 | 303 | let waves2UsdnFee = getIntegerValue(neutrinoContract, keyWavesOutFeePart()) | |
243 | 304 | let usdn2WavesFee = getIntegerValue(neutrinoContract, keyNeutrinoOutFeePart()) | |
244 | 305 | let usdnSwapDelayDuration = getIntegerValue(neutrinoContract, keyBalanceNeutrinoLockInterval()) | |
245 | 306 | let wavesSwapDelayDuration = getIntegerValue(neutrinoContract, keyBalanceWavesLockInterval()) | |
246 | - | let $ | |
247 | - | let swapLimitMaxUsdn = $ | |
248 | - | let swapLimitSpentUsdn = $ | |
249 | - | let blcks2LmtReset = $ | |
307 | + | let $t01039610560 = asSwapParamsSTRUCT(invoke(neutrinoContract, "swapParamsByUserSYSREADONLY", [userAddressStrOpt, 0], nil)) | |
308 | + | let swapLimitMaxUsdn = $t01039610560._1 | |
309 | + | let swapLimitSpentUsdn = $t01039610560._2 | |
310 | + | let blcks2LmtReset = $t01039610560._3 | |
250 | 311 | let swapLimitMaxWaves = convertNeutrinoToWaves(swapLimitMaxUsdn, currentPrice) | |
251 | 312 | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d%d%d%d", toString(currentPrice), toString(minWavesSwapAmt), toString(minUsdnSwapAmt), toString(waves2UsdnFee), toString(usdn2WavesFee), toString(usdnSwapDelayDuration), toString(wavesSwapDelayDuration), toString(blcks2LmtReset), toString(swapLimitMaxWaves), toString(swapLimitMaxUsdn), toString(swapLimitSpentUsdn)], SEP)) | |
252 | 313 | } | |
253 | 314 | ||
254 | 315 | ||
255 | 316 | ||
256 | 317 | @Callable(i) | |
257 | 318 | func gnsbtInfoREADONLY (userAddressStrOpt,nsbtAmtDiff) = { | |
258 | 319 | let currentPrice = getIntegerValue(controlContract, keyPrice()) | |
259 | - | let $ | |
260 | - | let limitMaxUsdn = $ | |
261 | - | let limitSpent = $ | |
262 | - | let blcks2LmtReset = $ | |
263 | - | let gnsbtAmt = $ | |
264 | - | let gnsbtAmtTotal = $ | |
265 | - | let $ | |
266 | - | let limitMaxUsdnNEW = $ | |
267 | - | let limitSpentNEW = $ | |
268 | - | let blcks2LmtResetNEW = $ | |
269 | - | let gnsbtAmtNEW = $ | |
270 | - | let gnsbtAmtTotalNEW = $ | |
320 | + | let $t01156611749 = asSwapParamsSTRUCT(invoke(neutrinoContract, "swapParamsByUserSYSREADONLY", [userAddressStrOpt, 0], nil)) | |
321 | + | let limitMaxUsdn = $t01156611749._1 | |
322 | + | let limitSpent = $t01156611749._2 | |
323 | + | let blcks2LmtReset = $t01156611749._3 | |
324 | + | let gnsbtAmt = $t01156611749._4 | |
325 | + | let gnsbtAmtTotal = $t01156611749._5 | |
326 | + | let $t01175311961 = asSwapParamsSTRUCT(invoke(neutrinoContract, "swapParamsByUserSYSREADONLY", [userAddressStrOpt, nsbtAmtDiff], nil)) | |
327 | + | let limitMaxUsdnNEW = $t01175311961._1 | |
328 | + | let limitSpentNEW = $t01175311961._2 | |
329 | + | let blcks2LmtResetNEW = $t01175311961._3 | |
330 | + | let gnsbtAmtNEW = $t01175311961._4 | |
331 | + | let gnsbtAmtTotalNEW = $t01175311961._5 | |
271 | 332 | let limitMaxWaves = convertNeutrinoToWaves(limitMaxUsdn, currentPrice) | |
272 | 333 | let limitMaxWavesNEW = convertNeutrinoToWaves(limitMaxUsdnNEW, currentPrice) | |
273 | 334 | let gnsbtShare = if ((gnsbtAmtTotal != 0)) | |
274 | - | then fraction((gnsbtAmt * 100), | |
335 | + | then fraction((gnsbtAmt * 100), MULT12, gnsbtAmtTotal) | |
275 | 336 | else 0 | |
276 | 337 | let gnsbtShareNEW = if ((gnsbtAmtTotalNEW != 0)) | |
277 | - | then fraction((gnsbtAmtNEW * 100), | |
338 | + | then fraction((gnsbtAmtNEW * 100), MULT12, gnsbtAmtTotalNEW) | |
278 | 339 | else 0 | |
279 | 340 | let rewardInfo = asString(invoke(nsbtStakingContract, "unclaimedRewardsREADONLY", [userAddressStrOpt], nil)) | |
280 | 341 | let nsbtAmt = gnsbtAmt | |
281 | 342 | let nsbtAmtNew = gnsbtAmtNEW | |
282 | 343 | let nsbtAmtStakedTotal = gnsbtAmtTotal | |
283 | 344 | let nsbtAmtStakedTotalNew = gnsbtAmtTotalNEW | |
284 | 345 | let nsbtData = asAnyList(invoke(nsbtStakingContract, "nsbtStakingSYSREADONLY", [userAddressStrOpt], nil)) | |
285 | 346 | let isEmptyNsbtBalance = if ((gnsbtAmt == 0)) | |
286 | 347 | then (gnsbtAmtNEW == 0) | |
287 | 348 | else false | |
288 | 349 | let startHeight = if (isEmptyNsbtBalance) | |
289 | 350 | then -1 | |
290 | 351 | else asInt(nsbtData[2]) | |
291 | 352 | let startTimestamp = toTimestamp(startHeight) | |
292 | 353 | let halfLife = getIntOrFail(nsbtStakingContract, keyHalfLife()) | |
293 | 354 | let startHeightNew = if (isEmptyNsbtBalance) | |
294 | 355 | then -1 | |
295 | 356 | else asInt(invoke(mathContract, "mergeStakesREADONLY", [gnsbtAmt, startHeight, gnsbtAmtNEW, height, halfLife], nil)) | |
296 | 357 | let startTimestampNew = toTimestamp(startHeightNew) | |
297 | 358 | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d%s%d%d%d%d%d%d%d%d", toString(gnsbtAmt), toString(gnsbtAmtNEW), toString(gnsbtShare), toString(gnsbtShareNEW), toString(limitMaxUsdn), toString(limitMaxWaves), toString(limitMaxUsdnNEW), toString(limitMaxWavesNEW), rewardInfo, toString(nsbtAmt), toString(nsbtAmtNew), toString(nsbtAmtStakedTotal), toString(nsbtAmtStakedTotalNew), toString(startHeight), toString(startTimestamp), toString(startHeightNew), toString(startTimestampNew)], SEP)) | |
298 | 359 | } | |
299 | 360 | ||
300 | 361 | ||
301 | 362 | ||
302 | 363 | @Callable(i) | |
303 | 364 | func buyNsbtREADONLY (wavesPay) = { | |
304 | 365 | let minWavesAmountNsbtBuy = minWavesForNsbtBuy() | |
305 | 366 | if ((minWavesAmountNsbtBuy > wavesPay)) | |
306 | 367 | then throw((("min " + toString(minWavesAmountNsbtBuy)) + " waves expected")) | |
307 | 368 | else { | |
308 | 369 | let curveResult = asAnyList(invoke(mathContract, "curveFunctionREADONLY", [wavesPay], nil)) | |
309 | 370 | if ((curveResult == curveResult)) | |
310 | 371 | then { | |
311 | 372 | let nsbtAmount = asInt(curveResult[0]) | |
312 | 373 | if ((0 >= nsbtAmount)) | |
313 | 374 | then throw("nsbtAmount <= 0") | |
314 | 375 | else $Tuple2(nil, makeString(["%d", toString(nsbtAmount)], SEP)) | |
315 | 376 | } | |
316 | 377 | else throw("Strict value is not equal to itself.") | |
317 | 378 | } | |
318 | 379 | } | |
319 | 380 | ||
320 | 381 | ||
321 | 382 | ||
322 | 383 | @Callable(i) | |
384 | + | func buySurfREADONLY (amount,assetIdStr) = { | |
385 | + | let assetId = fromBase58String(assetIdStr) | |
386 | + | if (if ((assetId == WAVESID)) | |
387 | + | then (minWavesForSurfBuy() > amount) | |
388 | + | else false) | |
389 | + | then throw((("min " + toString(minWavesForSurfBuy())) + " WAVES expected")) | |
390 | + | else if (if ((assetId == neutrinoAssetId)) | |
391 | + | then (minUsdnForSurfBuy() > amount) | |
392 | + | else false) | |
393 | + | then throw((("min " + toString(minUsdnForSurfBuy())) + " USDN expected")) | |
394 | + | else { | |
395 | + | let surfResult = asAnyList(invoke(mathContract, "surfFunctionREADONLY", [amount, assetId], nil)) | |
396 | + | let surfAmount = asInt(surfResult[bFuncIdxSurf]) | |
397 | + | if ((0 >= surfAmount)) | |
398 | + | then throw("surfAmount <= 0") | |
399 | + | else $Tuple2(nil, makeString(["%d", toString(surfAmount)], SEP)) | |
400 | + | } | |
401 | + | } | |
402 | + | ||
403 | + | ||
404 | + | ||
405 | + | @Callable(i) | |
323 | 406 | func mergedStakeREADONLY (amount1,height1,amount2,height2) = { | |
324 | 407 | let halfLife = getIntOrFail(nsbtStakingContract, keyHalfLife()) | |
325 | 408 | let h = asInt(invoke(mathContract, "mergeStakesREADONLY", [amount1, height1, amount2, height2, halfLife], nil)) | |
326 | 409 | if ((h == h)) | |
327 | 410 | then $Tuple2(nil, makeString(["%d%d", toString((amount1 + amount2)), toString(h)], SEP)) | |
328 | 411 | else throw("Strict value is not equal to itself.") | |
329 | 412 | } | |
330 | 413 | ||
331 | 414 | ||
332 | 415 | ||
333 | 416 | @Callable(i) | |
334 | 417 | func unstakeComissionAmountByHeightREADONLY (amount,startHeight) = { | |
335 | 418 | let halfLife = getIntOrFail(nsbtStakingContract, keyHalfLife()) | |
336 | 419 | let a = asInt(invoke(mathContract, "getUnstakeComissionAmountREADONLY", [amount, startHeight, halfLife], nil)) | |
337 | 420 | if ((a == a)) | |
338 | 421 | then $Tuple2(nil, makeString(["%d", toString(a)], SEP)) | |
339 | 422 | else throw("Strict value is not equal to itself.") | |
340 | 423 | } | |
341 | 424 | ||
342 | 425 | ||
343 | 426 | ||
344 | 427 | @Callable(i) | |
345 | 428 | func unstakeComissionAmountByUserREADONLY (amount,userAddress) = { | |
346 | 429 | let halfLife = getIntOrFail(nsbtStakingContract, keyHalfLife()) | |
347 | 430 | let startHeight = valueOrElse(getInteger(nsbtStakingContract, keyLockParamStartBlock(userAddress)), height) | |
348 | 431 | let a = asInt(invoke(mathContract, "getUnstakeComissionAmountREADONLY", [amount, startHeight, halfLife], nil)) | |
349 | 432 | if ((a == a)) | |
350 | 433 | then $Tuple2(nil, makeString(["%d", toString(a)], SEP)) | |
351 | 434 | else throw("Strict value is not equal to itself.") | |
352 | 435 | } | |
353 | 436 | ||
354 | 437 | ||
355 | 438 | ||
356 | 439 | @Callable(i) | |
357 | 440 | func neutrinoStateREST () = { | |
358 | 441 | let neutrinoMetrics = asAnyList(invoke(mathContract, "calcNeutinoMetricsREADONLY", nil, nil)) | |
359 | - | let currentPrice = asInt(neutrinoMetrics[ | |
360 | - | let neutrinoLockedBalance = asInt(neutrinoMetrics[ | |
361 | - | let wavesLockedBalance = asInt(neutrinoMetrics[ | |
362 | - | let reservesInWaves = asInt(neutrinoMetrics[ | |
363 | - | let reservesInUsdn = asInt(neutrinoMetrics[ | |
364 | - | let neutrinoSupply = asInt(neutrinoMetrics[ | |
365 | - | let surplus = asInt(neutrinoMetrics[ | |
366 | - | let surplusPercent = asInt(neutrinoMetrics[ | |
367 | - | let BR = asInt(neutrinoMetrics[ | |
368 | - | let nsbtSupply = asInt(neutrinoMetrics[ | |
442 | + | let currentPrice = asInt(neutrinoMetrics[nMetricIdxPrice]) | |
443 | + | let neutrinoLockedBalance = asInt(neutrinoMetrics[nMetricIdxUsdnLockedBalance]) | |
444 | + | let wavesLockedBalance = asInt(neutrinoMetrics[nMetricIdxWavesLockedBalance]) | |
445 | + | let reservesInWaves = asInt(neutrinoMetrics[nMetricIdxReserve]) | |
446 | + | let reservesInUsdn = asInt(neutrinoMetrics[nMetricIdxReserveInUsdn]) | |
447 | + | let neutrinoSupply = asInt(neutrinoMetrics[nMetricIdxUsdnSupply]) | |
448 | + | let surplus = asInt(neutrinoMetrics[nMetricIdxSurplus]) | |
449 | + | let surplusPercent = asInt(neutrinoMetrics[nMetricIdxSurplusPercent]) | |
450 | + | let BR = asInt(neutrinoMetrics[nMetricIdxBR]) | |
451 | + | let nsbtSupply = asInt(neutrinoMetrics[nMetricIdxNsbtSupply]) | |
369 | 452 | throw(makeString(["resultNeutrinoStateREST", toString(currentPrice), toString(neutrinoLockedBalance), toString(wavesLockedBalance), toString(reservesInWaves), toString(reservesInUsdn), toString(neutrinoSupply), toString(surplus), toString(surplusPercent), toString(BR), toString(nsbtSupply)], "__")) | |
370 | 453 | } | |
371 | 454 | ||
372 | 455 | ||
373 | 456 | ||
374 | 457 | @Callable(i) | |
375 | 458 | func nsbtPriceREST () = { | |
376 | 459 | let prices = asAnyList(invoke(mathContract, "calcContractNsbtPriceSYSREADONLY", [0], nil)) | |
377 | 460 | let nsbt2usdnPrice = asInt(prices[0]) | |
378 | 461 | let nsbt2wavesPrice = asInt(prices[1]) | |
379 | 462 | let restData = makeString(["startNsbtPriceREST", toString(nsbt2usdnPrice), toString(nsbt2wavesPrice), "endNsbtPriceREST"], "__") | |
380 | 463 | throw(restData) | |
381 | 464 | } | |
382 | 465 | ||
383 | 466 | ||
467 | + | ||
468 | + | @Callable(i) | |
469 | + | func surfPriceREST () = { | |
470 | + | let neutrinoMetrics = asAnyList(invoke(mathContract, "calcNeutinoMetricsREADONLY", nil, nil)) | |
471 | + | let currentPrice = asInt(neutrinoMetrics[nMetricIdxPrice]) | |
472 | + | let reservesInWaves = asInt(neutrinoMetrics[nMetricIdxReserve]) | |
473 | + | let neutrinoSupply = asInt(neutrinoMetrics[nMetricIdxUsdnSupply]) | |
474 | + | let surfPriceInUsdn = fraction(reservesInWaves, currentPrice, neutrinoSupply) | |
475 | + | let surfPriceInWaves = fraction(reservesInWaves, 1, neutrinoSupply) | |
476 | + | let restData = makeString(["startSurfPriceREST", toString(surfPriceInUsdn), toString(surfPriceInWaves), "endSurfPriceREST"], "__") | |
477 | + | throw(restData) | |
478 | + | } | |
479 | + | ||
480 | + |
github/deemru/w8io/026f985 76.41 ms ◑