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:AAIFAAAAAAAAADsIAhIFCgMICAgSABIDCgEIEgQKAggBEgMKAQESBAoCAQgSBgoEAQEBARIECgIBARIECgIBCBIAEgASAAAAAFgAAAAAC3JldmlzaW9uTnVtAgAAAAAAAAAABkVVTEVSOAAAAAAAEDPE1gAAAAAFTVVMVDYAAAAAAAAPQkAAAAAABk1VTFRYNgkAATYAAAABAAAAAAAAD0JAAAAAAAVNVUxUOAAAAAAABfXhAAAAAAAGTVVMVFg4CQABNgAAAAEAAAAAAAX14QAAAAAABk1VTFQxMgAAAADo1KUQAAAAAAAGTVVMVDE4CQABNgAAAAEADeC2s6dkAAAAAAAAA1NFUAIAAAACX18AAAAAB1dBVkVTSUQJAAJZAAAAAQIAAAAFV0FWRVMAAAAAD25NZXRyaWNJZHhQcmljZQAAAAAAAAAAAAAAAAAbbk1ldHJpY0lkeFVzZG5Mb2NrZWRCYWxhbmNlAAAAAAAAAAABAAAAABxuTWV0cmljSWR4V2F2ZXNMb2NrZWRCYWxhbmNlAAAAAAAAAAACAAAAABFuTWV0cmljSWR4UmVzZXJ2ZQAAAAAAAAAAAwAAAA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AAAAEnN0YXJ0U3VyZlByaWNlUkVTVAkABEwAAAACCQABpAAAAAEFAAAAD3N1cmZQcmljZUluVXNkbgkABEwAAAACCQABpAAAAAEFAAAAEHN1cmZQcmljZUluV2F2ZXMJAARMAAAAAgIAAAAQZW5kU3VyZlByaWNlUkVTVAUAAAADbmlsAgAAAAJfXwkAAAIAAAABBQAAAAhyZXN0RGF0YQAAAADIAZbZ", "chainId": 84, "height": 2121074, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6bfSNoNPK6dkCWnW2TbcpvkhtJGxNs7QWxWLnZUP9bV5 Next: 3jGn9Qg3c76ABfCdDn3DHGHFAC4CrkEGRxYQZkXABGPQ Diff:
OldNewDifferences
33 {-# CONTENT_TYPE DAPP #-}
44 let revisionNum = ""
55
6-let PRICELET = 1000000
6+let EULER8 = 271828182
77
8-let MULTSCALE = 8
8+let MULT6 = 1000000
99
10-let EULERNUMBER = 271828182
10+let MULTX6 = toBigInt(1000000)
1111
12-let scale6 = 1000000
12+let MULT8 = 100000000
1313
14-let scale6BigInt = toBigInt(1000000)
14+let MULTX8 = toBigInt(100000000)
1515
16-let scale8 = 100000000
16+let MULT12 = 1000000000000
1717
18-let scale8BigInt = toBigInt(100000000)
19-
20-let scale12 = 1000000000000
21-
22-let scale18 = toBigInt(1000000000000000000)
18+let MULT18 = toBigInt(1000000000000000000)
2319
2420 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
2567
2668 func keyNeutrinoAddress () = "%s%s__config__neutrinoAddress"
2769
4183 func keyContolContract () = "control_contract"
4284
4385
44-func keyBondAssetId () = "bond_asset_id"
86+func keyNsbtAssetId () = "bond_asset_id"
87+
88+
89+func keySurfAssetId () = "surf_asset_id"
4590
4691
4792 func keyBalanceLocked () = "balance_lock_"
104149 func getBoolOrFail (address,key) = valueOrErrorMessage(getBoolean(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
105150
106151
107-func convertNeutrinoToWaves (amount,price) = fraction(fraction(amount, PRICELET, price), scale8, scale6)
152+func convertNeutrinoToWaves (amount,price) = fraction(amount, MULT8, price)
108153
109154
110-func convertWavesToNeutrino (amount,price) = fraction(fraction(amount, price, PRICELET), scale6, scale8)
155+func convertWavesToNeutrino (amount,price) = fraction(amount, price, MULT8)
111156
112157
113158 func asAnyList (val) = match val {
160205 }
161206
162207
163-func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), scale18, toBigInt(origScaleMult))
208+func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), MULT18, toBigInt(origScaleMult))
164209
165210
166-func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), scale18))
211+func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), MULT18))
167212
168213
169214 let neutrinoContract = addressFromStringValue(getStringOrFail(this, keyNeutrinoAddress()))
184229
185230 let neutrinoAssetId = fromBase58String(neutrinoAssetIdString)
186231
187-let nsbtAssetIdStr = getStringValue(neutrinoContract, keyBondAssetId())
232+let nsbtAssetIdStr = getStringValue(neutrinoContract, keyNsbtAssetId())
188233
189234 let nsbtAssetId = fromBase58String(nsbtAssetIdStr)
235+
236+let surfAssetIdStr = getStringValue(auctionContract, keySurfAssetId())
237+
238+let surfAssetId = fromBase58String(surfAssetIdStr)
190239
191240 func minWavesForNsbtBuy () = asInt(invoke(auctionContract, "minWavesAmountNsbtBuySYSREADONLY", nil, nil))
192241
193242
194243 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))
195250
196251
197252 func privateNsbtPriceREST () = {
213268 func neutrinoStatsREADONLY () = {
214269 let neutrinoMetrics = asAnyList(invoke(mathContract, "calcNeutinoMetricsREADONLY", nil, nil))
215270 let prices = asAnyList(invoke(mathContract, "calcContractNsbtPriceSYSREADONLY", [0], nil))
216- let currentPrice = asInt(neutrinoMetrics[0])
217- let neutrinoLockedBalance = asInt(neutrinoMetrics[1])
218- let wavesLockedBalance = asInt(neutrinoMetrics[2])
219- let reservesInWaves = asInt(neutrinoMetrics[3])
220- let reservesInUsdn = asInt(neutrinoMetrics[4])
221- let neutrinoSupply = asInt(neutrinoMetrics[5])
222- let surplus = asInt(neutrinoMetrics[6])
223- let surplusPercent = asInt(neutrinoMetrics[7])
224- let BR = asInt(neutrinoMetrics[8])
225- let nsbtSupply = asInt(neutrinoMetrics[9])
226- let maxNsbtSupply = asInt(neutrinoMetrics[10])
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])
227282 let nsbt2usdnPrice = asInt(prices[0])
228283 let nsbt2wavesPrice = asInt(prices[1])
229284 let minWaves4NsbtBuy = minWavesForNsbtBuy()
230285 let minNsbtsell = minNsbtForSell()
231286 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))
233294 }
234295
235296
243304 let usdn2WavesFee = getIntegerValue(neutrinoContract, keyNeutrinoOutFeePart())
244305 let usdnSwapDelayDuration = getIntegerValue(neutrinoContract, keyBalanceNeutrinoLockInterval())
245306 let wavesSwapDelayDuration = getIntegerValue(neutrinoContract, keyBalanceWavesLockInterval())
246- let $t084988662 = asSwapParamsSTRUCT(invoke(neutrinoContract, "swapParamsByUserSYSREADONLY", [userAddressStrOpt, 0], nil))
247- let swapLimitMaxUsdn = $t084988662._1
248- let swapLimitSpentUsdn = $t084988662._2
249- let blcks2LmtReset = $t084988662._3
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
250311 let swapLimitMaxWaves = convertNeutrinoToWaves(swapLimitMaxUsdn, currentPrice)
251312 $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))
252313 }
256317 @Callable(i)
257318 func gnsbtInfoREADONLY (userAddressStrOpt,nsbtAmtDiff) = {
258319 let currentPrice = getIntegerValue(controlContract, keyPrice())
259- let $t096689851 = asSwapParamsSTRUCT(invoke(neutrinoContract, "swapParamsByUserSYSREADONLY", [userAddressStrOpt, 0], nil))
260- let limitMaxUsdn = $t096689851._1
261- let limitSpent = $t096689851._2
262- let blcks2LmtReset = $t096689851._3
263- let gnsbtAmt = $t096689851._4
264- let gnsbtAmtTotal = $t096689851._5
265- let $t0985510063 = asSwapParamsSTRUCT(invoke(neutrinoContract, "swapParamsByUserSYSREADONLY", [userAddressStrOpt, nsbtAmtDiff], nil))
266- let limitMaxUsdnNEW = $t0985510063._1
267- let limitSpentNEW = $t0985510063._2
268- let blcks2LmtResetNEW = $t0985510063._3
269- let gnsbtAmtNEW = $t0985510063._4
270- let gnsbtAmtTotalNEW = $t0985510063._5
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
271332 let limitMaxWaves = convertNeutrinoToWaves(limitMaxUsdn, currentPrice)
272333 let limitMaxWavesNEW = convertNeutrinoToWaves(limitMaxUsdnNEW, currentPrice)
273334 let gnsbtShare = if ((gnsbtAmtTotal != 0))
274- then fraction((gnsbtAmt * 100), scale12, gnsbtAmtTotal)
335+ then fraction((gnsbtAmt * 100), MULT12, gnsbtAmtTotal)
275336 else 0
276337 let gnsbtShareNEW = if ((gnsbtAmtTotalNEW != 0))
277- then fraction((gnsbtAmtNEW * 100), scale12, gnsbtAmtTotalNEW)
338+ then fraction((gnsbtAmtNEW * 100), MULT12, gnsbtAmtTotalNEW)
278339 else 0
279340 let rewardInfo = asString(invoke(nsbtStakingContract, "unclaimedRewardsREADONLY", [userAddressStrOpt], nil))
280341 let nsbtAmt = gnsbtAmt
320381
321382
322383 @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)
323406 func mergedStakeREADONLY (amount1,height1,amount2,height2) = {
324407 let halfLife = getIntOrFail(nsbtStakingContract, keyHalfLife())
325408 let h = asInt(invoke(mathContract, "mergeStakesREADONLY", [amount1, height1, amount2, height2, halfLife], nil))
356439 @Callable(i)
357440 func neutrinoStateREST () = {
358441 let neutrinoMetrics = asAnyList(invoke(mathContract, "calcNeutinoMetricsREADONLY", nil, nil))
359- let currentPrice = asInt(neutrinoMetrics[0])
360- let neutrinoLockedBalance = asInt(neutrinoMetrics[1])
361- let wavesLockedBalance = asInt(neutrinoMetrics[2])
362- let reservesInWaves = asInt(neutrinoMetrics[3])
363- let reservesInUsdn = asInt(neutrinoMetrics[4])
364- let neutrinoSupply = asInt(neutrinoMetrics[5])
365- let surplus = asInt(neutrinoMetrics[6])
366- let surplusPercent = asInt(neutrinoMetrics[7])
367- let BR = asInt(neutrinoMetrics[8])
368- let nsbtSupply = asInt(neutrinoMetrics[9])
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])
369452 throw(makeString(["resultNeutrinoStateREST", toString(currentPrice), toString(neutrinoLockedBalance), toString(wavesLockedBalance), toString(reservesInWaves), toString(reservesInUsdn), toString(neutrinoSupply), toString(surplus), toString(surplusPercent), toString(BR), toString(nsbtSupply)], "__"))
370453 }
371454
381464 }
382465
383466
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+
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let revisionNum = ""
55
6-let PRICELET = 1000000
6+let EULER8 = 271828182
77
8-let MULTSCALE = 8
8+let MULT6 = 1000000
99
10-let EULERNUMBER = 271828182
10+let MULTX6 = toBigInt(1000000)
1111
12-let scale6 = 1000000
12+let MULT8 = 100000000
1313
14-let scale6BigInt = toBigInt(1000000)
14+let MULTX8 = toBigInt(100000000)
1515
16-let scale8 = 100000000
16+let MULT12 = 1000000000000
1717
18-let scale8BigInt = toBigInt(100000000)
19-
20-let scale12 = 1000000000000
21-
22-let scale18 = toBigInt(1000000000000000000)
18+let MULT18 = toBigInt(1000000000000000000)
2319
2420 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
2567
2668 func keyNeutrinoAddress () = "%s%s__config__neutrinoAddress"
2769
2870
2971 func keyNeutrinoAssetId () = "neutrino_asset_id"
3072
3173
3274 func keyLiquidationContractAddress () = "liquidation_contract"
3375
3476
3577 func keyRPDContract () = "rpd_contract"
3678
3779
3880 func keyAuctionContract () = "auction_contract"
3981
4082
4183 func keyContolContract () = "control_contract"
4284
4385
44-func keyBondAssetId () = "bond_asset_id"
86+func keyNsbtAssetId () = "bond_asset_id"
87+
88+
89+func keySurfAssetId () = "surf_asset_id"
4590
4691
4792 func keyBalanceLocked () = "balance_lock_"
4893
4994
5095 func keyWavesLockedBalance () = (keyBalanceLocked() + "waves")
5196
5297
5398 func keyNeutrinoLockedBalance () = (keyBalanceLocked() + "neutrino")
5499
55100
56101 func keyMinWavesSwapAmount () = "min_waves_swap_amount"
57102
58103
59104 func keyMinNeutrinoSwapAmount () = "min_neutrino_swap_amount"
60105
61106
62107 func keyWavesOutFeePart () = "wavesOut_swap_feePart"
63108
64109
65110 func keyNeutrinoOutFeePart () = "neutrinoOut_swap_feePart"
66111
67112
68113 func keyNsbtLockContract () = "%s__nsbtLockContract"
69114
70115
71116 func keyMathContract () = "%s__mathContract"
72117
73118
74119 func keyBalanceWavesLockInterval () = "balance_waves_lock_interval"
75120
76121
77122 func keyBalanceNeutrinoLockInterval () = "balance_neutrino_lock_interval"
78123
79124
80125 func keyPrice () = "price"
81126
82127
83128 func keyLockParamStartBlock (userAddress) = makeString(["%s%s%s", "paramByUser", userAddress, "start"], SEP)
84129
85130
86131 func keyHalfLife () = "%s__halfLife"
87132
88133
89134 func keyMinLockAmount () = "%s__minLockAmount"
90135
91136
92137 func keyMinWavesForNsbtBuy () = "min_waves_nsbt_buy"
93138
94139
95140 func keyMinNsbtSell () = "min_nsbt_sell"
96141
97142
98143 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
99144
100145
101146 func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
102147
103148
104149 func getBoolOrFail (address,key) = valueOrErrorMessage(getBoolean(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
105150
106151
107-func convertNeutrinoToWaves (amount,price) = fraction(fraction(amount, PRICELET, price), scale8, scale6)
152+func convertNeutrinoToWaves (amount,price) = fraction(amount, MULT8, price)
108153
109154
110-func convertWavesToNeutrino (amount,price) = fraction(fraction(amount, price, PRICELET), scale6, scale8)
155+func convertWavesToNeutrino (amount,price) = fraction(amount, price, MULT8)
111156
112157
113158 func asAnyList (val) = match val {
114159 case valAnyList: List[Any] =>
115160 valAnyList
116161 case _ =>
117162 throw("fail to cast into List[Any]")
118163 }
119164
120165
121166 func asInt (val) = match val {
122167 case valInt: Int =>
123168 valInt
124169 case _ =>
125170 throw("fail to cast into Int")
126171 }
127172
128173
129174 func asString (val) = match val {
130175 case valStr: String =>
131176 valStr
132177 case _ =>
133178 throw("fail to cast into String")
134179 }
135180
136181
137182 func asTuple2Ints (val) = match val {
138183 case v: (Int, Int) =>
139184 v
140185 case _ =>
141186 throw("fail to cast into Tuple2 ints")
142187 }
143188
144189
145190 func asSwapParamsSTRUCT (val) = match val {
146191 case struct: (Int, Int, Int, Int, Int) =>
147192 struct
148193 case _ =>
149194 throw("fail to cast into Int")
150195 }
151196
152197
153198 func toTimestamp (start) = if ((0 > start))
154199 then -1
155200 else match blockInfoByHeight(start) {
156201 case block: BlockInfo =>
157202 block.timestamp
158203 case _ =>
159204 -1
160205 }
161206
162207
163-func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), scale18, toBigInt(origScaleMult))
208+func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), MULT18, toBigInt(origScaleMult))
164209
165210
166-func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), scale18))
211+func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), MULT18))
167212
168213
169214 let neutrinoContract = addressFromStringValue(getStringOrFail(this, keyNeutrinoAddress()))
170215
171216 let controlContract = addressFromStringValue(getStringOrFail(neutrinoContract, keyContolContract()))
172217
173218 let auctionContract = addressFromStringValue(getStringOrFail(neutrinoContract, keyAuctionContract()))
174219
175220 let liquidationContract = getStringOrFail(neutrinoContract, keyLiquidationContractAddress())
176221
177222 let rpdContract = getStringOrFail(neutrinoContract, keyRPDContract())
178223
179224 let mathContract = addressFromStringValue(getStringOrFail(this, keyMathContract()))
180225
181226 let nsbtStakingContract = addressFromStringValue(getStringOrFail(this, keyNsbtLockContract()))
182227
183228 let neutrinoAssetIdString = getStringOrFail(neutrinoContract, keyNeutrinoAssetId())
184229
185230 let neutrinoAssetId = fromBase58String(neutrinoAssetIdString)
186231
187-let nsbtAssetIdStr = getStringValue(neutrinoContract, keyBondAssetId())
232+let nsbtAssetIdStr = getStringValue(neutrinoContract, keyNsbtAssetId())
188233
189234 let nsbtAssetId = fromBase58String(nsbtAssetIdStr)
235+
236+let surfAssetIdStr = getStringValue(auctionContract, keySurfAssetId())
237+
238+let surfAssetId = fromBase58String(surfAssetIdStr)
190239
191240 func minWavesForNsbtBuy () = asInt(invoke(auctionContract, "minWavesAmountNsbtBuySYSREADONLY", nil, nil))
192241
193242
194243 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))
195250
196251
197252 func privateNsbtPriceREST () = {
198253 let prices = asAnyList(invoke(mathContract, "calcContractNsbtPriceSYSREADONLY", [0], nil))
199254 let nsbt2usdnPrice = asInt(prices[0])
200255 let nsbt2wavesPrice = asInt(prices[1])
201256 $Tuple2(IntegerEntry("nsbt2usdnPrice", nsbt2usdnPrice), IntegerEntry("nsbt2wavesPrice", nsbt2wavesPrice))
202257 }
203258
204259
205260 @Callable(i)
206261 func constructor (neutrinoAddress,nsbtLockAddress,mathAddress) = if ((i.caller != this))
207262 then throw("not authorized")
208263 else [StringEntry(keyNeutrinoAddress(), neutrinoAddress), StringEntry(keyNsbtLockContract(), nsbtLockAddress), StringEntry(keyMathContract(), mathAddress)]
209264
210265
211266
212267 @Callable(i)
213268 func neutrinoStatsREADONLY () = {
214269 let neutrinoMetrics = asAnyList(invoke(mathContract, "calcNeutinoMetricsREADONLY", nil, nil))
215270 let prices = asAnyList(invoke(mathContract, "calcContractNsbtPriceSYSREADONLY", [0], nil))
216- let currentPrice = asInt(neutrinoMetrics[0])
217- let neutrinoLockedBalance = asInt(neutrinoMetrics[1])
218- let wavesLockedBalance = asInt(neutrinoMetrics[2])
219- let reservesInWaves = asInt(neutrinoMetrics[3])
220- let reservesInUsdn = asInt(neutrinoMetrics[4])
221- let neutrinoSupply = asInt(neutrinoMetrics[5])
222- let surplus = asInt(neutrinoMetrics[6])
223- let surplusPercent = asInt(neutrinoMetrics[7])
224- let BR = asInt(neutrinoMetrics[8])
225- let nsbtSupply = asInt(neutrinoMetrics[9])
226- let maxNsbtSupply = asInt(neutrinoMetrics[10])
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])
227282 let nsbt2usdnPrice = asInt(prices[0])
228283 let nsbt2wavesPrice = asInt(prices[1])
229284 let minWaves4NsbtBuy = minWavesForNsbtBuy()
230285 let minNsbtsell = minNsbtForSell()
231286 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))
233294 }
234295
235296
236297
237298 @Callable(i)
238299 func swapInfoREADONLY (userAddressStrOpt) = {
239300 let currentPrice = getIntegerValue(controlContract, keyPrice())
240301 let minWavesSwapAmt = getIntegerValue(neutrinoContract, keyMinWavesSwapAmount())
241302 let minUsdnSwapAmt = getIntegerValue(neutrinoContract, keyMinNeutrinoSwapAmount())
242303 let waves2UsdnFee = getIntegerValue(neutrinoContract, keyWavesOutFeePart())
243304 let usdn2WavesFee = getIntegerValue(neutrinoContract, keyNeutrinoOutFeePart())
244305 let usdnSwapDelayDuration = getIntegerValue(neutrinoContract, keyBalanceNeutrinoLockInterval())
245306 let wavesSwapDelayDuration = getIntegerValue(neutrinoContract, keyBalanceWavesLockInterval())
246- let $t084988662 = asSwapParamsSTRUCT(invoke(neutrinoContract, "swapParamsByUserSYSREADONLY", [userAddressStrOpt, 0], nil))
247- let swapLimitMaxUsdn = $t084988662._1
248- let swapLimitSpentUsdn = $t084988662._2
249- let blcks2LmtReset = $t084988662._3
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
250311 let swapLimitMaxWaves = convertNeutrinoToWaves(swapLimitMaxUsdn, currentPrice)
251312 $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))
252313 }
253314
254315
255316
256317 @Callable(i)
257318 func gnsbtInfoREADONLY (userAddressStrOpt,nsbtAmtDiff) = {
258319 let currentPrice = getIntegerValue(controlContract, keyPrice())
259- let $t096689851 = asSwapParamsSTRUCT(invoke(neutrinoContract, "swapParamsByUserSYSREADONLY", [userAddressStrOpt, 0], nil))
260- let limitMaxUsdn = $t096689851._1
261- let limitSpent = $t096689851._2
262- let blcks2LmtReset = $t096689851._3
263- let gnsbtAmt = $t096689851._4
264- let gnsbtAmtTotal = $t096689851._5
265- let $t0985510063 = asSwapParamsSTRUCT(invoke(neutrinoContract, "swapParamsByUserSYSREADONLY", [userAddressStrOpt, nsbtAmtDiff], nil))
266- let limitMaxUsdnNEW = $t0985510063._1
267- let limitSpentNEW = $t0985510063._2
268- let blcks2LmtResetNEW = $t0985510063._3
269- let gnsbtAmtNEW = $t0985510063._4
270- let gnsbtAmtTotalNEW = $t0985510063._5
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
271332 let limitMaxWaves = convertNeutrinoToWaves(limitMaxUsdn, currentPrice)
272333 let limitMaxWavesNEW = convertNeutrinoToWaves(limitMaxUsdnNEW, currentPrice)
273334 let gnsbtShare = if ((gnsbtAmtTotal != 0))
274- then fraction((gnsbtAmt * 100), scale12, gnsbtAmtTotal)
335+ then fraction((gnsbtAmt * 100), MULT12, gnsbtAmtTotal)
275336 else 0
276337 let gnsbtShareNEW = if ((gnsbtAmtTotalNEW != 0))
277- then fraction((gnsbtAmtNEW * 100), scale12, gnsbtAmtTotalNEW)
338+ then fraction((gnsbtAmtNEW * 100), MULT12, gnsbtAmtTotalNEW)
278339 else 0
279340 let rewardInfo = asString(invoke(nsbtStakingContract, "unclaimedRewardsREADONLY", [userAddressStrOpt], nil))
280341 let nsbtAmt = gnsbtAmt
281342 let nsbtAmtNew = gnsbtAmtNEW
282343 let nsbtAmtStakedTotal = gnsbtAmtTotal
283344 let nsbtAmtStakedTotalNew = gnsbtAmtTotalNEW
284345 let nsbtData = asAnyList(invoke(nsbtStakingContract, "nsbtStakingSYSREADONLY", [userAddressStrOpt], nil))
285346 let isEmptyNsbtBalance = if ((gnsbtAmt == 0))
286347 then (gnsbtAmtNEW == 0)
287348 else false
288349 let startHeight = if (isEmptyNsbtBalance)
289350 then -1
290351 else asInt(nsbtData[2])
291352 let startTimestamp = toTimestamp(startHeight)
292353 let halfLife = getIntOrFail(nsbtStakingContract, keyHalfLife())
293354 let startHeightNew = if (isEmptyNsbtBalance)
294355 then -1
295356 else asInt(invoke(mathContract, "mergeStakesREADONLY", [gnsbtAmt, startHeight, gnsbtAmtNEW, height, halfLife], nil))
296357 let startTimestampNew = toTimestamp(startHeightNew)
297358 $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))
298359 }
299360
300361
301362
302363 @Callable(i)
303364 func buyNsbtREADONLY (wavesPay) = {
304365 let minWavesAmountNsbtBuy = minWavesForNsbtBuy()
305366 if ((minWavesAmountNsbtBuy > wavesPay))
306367 then throw((("min " + toString(minWavesAmountNsbtBuy)) + " waves expected"))
307368 else {
308369 let curveResult = asAnyList(invoke(mathContract, "curveFunctionREADONLY", [wavesPay], nil))
309370 if ((curveResult == curveResult))
310371 then {
311372 let nsbtAmount = asInt(curveResult[0])
312373 if ((0 >= nsbtAmount))
313374 then throw("nsbtAmount <= 0")
314375 else $Tuple2(nil, makeString(["%d", toString(nsbtAmount)], SEP))
315376 }
316377 else throw("Strict value is not equal to itself.")
317378 }
318379 }
319380
320381
321382
322383 @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)
323406 func mergedStakeREADONLY (amount1,height1,amount2,height2) = {
324407 let halfLife = getIntOrFail(nsbtStakingContract, keyHalfLife())
325408 let h = asInt(invoke(mathContract, "mergeStakesREADONLY", [amount1, height1, amount2, height2, halfLife], nil))
326409 if ((h == h))
327410 then $Tuple2(nil, makeString(["%d%d", toString((amount1 + amount2)), toString(h)], SEP))
328411 else throw("Strict value is not equal to itself.")
329412 }
330413
331414
332415
333416 @Callable(i)
334417 func unstakeComissionAmountByHeightREADONLY (amount,startHeight) = {
335418 let halfLife = getIntOrFail(nsbtStakingContract, keyHalfLife())
336419 let a = asInt(invoke(mathContract, "getUnstakeComissionAmountREADONLY", [amount, startHeight, halfLife], nil))
337420 if ((a == a))
338421 then $Tuple2(nil, makeString(["%d", toString(a)], SEP))
339422 else throw("Strict value is not equal to itself.")
340423 }
341424
342425
343426
344427 @Callable(i)
345428 func unstakeComissionAmountByUserREADONLY (amount,userAddress) = {
346429 let halfLife = getIntOrFail(nsbtStakingContract, keyHalfLife())
347430 let startHeight = valueOrElse(getInteger(nsbtStakingContract, keyLockParamStartBlock(userAddress)), height)
348431 let a = asInt(invoke(mathContract, "getUnstakeComissionAmountREADONLY", [amount, startHeight, halfLife], nil))
349432 if ((a == a))
350433 then $Tuple2(nil, makeString(["%d", toString(a)], SEP))
351434 else throw("Strict value is not equal to itself.")
352435 }
353436
354437
355438
356439 @Callable(i)
357440 func neutrinoStateREST () = {
358441 let neutrinoMetrics = asAnyList(invoke(mathContract, "calcNeutinoMetricsREADONLY", nil, nil))
359- let currentPrice = asInt(neutrinoMetrics[0])
360- let neutrinoLockedBalance = asInt(neutrinoMetrics[1])
361- let wavesLockedBalance = asInt(neutrinoMetrics[2])
362- let reservesInWaves = asInt(neutrinoMetrics[3])
363- let reservesInUsdn = asInt(neutrinoMetrics[4])
364- let neutrinoSupply = asInt(neutrinoMetrics[5])
365- let surplus = asInt(neutrinoMetrics[6])
366- let surplusPercent = asInt(neutrinoMetrics[7])
367- let BR = asInt(neutrinoMetrics[8])
368- let nsbtSupply = asInt(neutrinoMetrics[9])
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])
369452 throw(makeString(["resultNeutrinoStateREST", toString(currentPrice), toString(neutrinoLockedBalance), toString(wavesLockedBalance), toString(reservesInWaves), toString(reservesInUsdn), toString(neutrinoSupply), toString(surplus), toString(surplusPercent), toString(BR), toString(nsbtSupply)], "__"))
370453 }
371454
372455
373456
374457 @Callable(i)
375458 func nsbtPriceREST () = {
376459 let prices = asAnyList(invoke(mathContract, "calcContractNsbtPriceSYSREADONLY", [0], nil))
377460 let nsbt2usdnPrice = asInt(prices[0])
378461 let nsbt2wavesPrice = asInt(prices[1])
379462 let restData = makeString(["startNsbtPriceREST", toString(nsbt2usdnPrice), toString(nsbt2wavesPrice), "endNsbtPriceREST"], "__")
380463 throw(restData)
381464 }
382465
383466
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