tx · BPYC7byV8hCU8JMjDxPAdkkhE6HswjY57DPY4ri7CwLg

3NAfzeA3URU6oCV6HvtAiNwqGXsTs87ZpHh:  -0.04000000 Waves

2022.08.15 12:06 [2185377] smart account 3NAfzeA3URU6oCV6HvtAiNwqGXsTs87ZpHh > SELF 0.00000000 Waves

{ "type": 13, "id": "BPYC7byV8hCU8JMjDxPAdkkhE6HswjY57DPY4ri7CwLg", "fee": 4000000, "feeAssetId": null, "timestamp": 1660554428936, "version": 1, "sender": "3NAfzeA3URU6oCV6HvtAiNwqGXsTs87ZpHh", "senderPublicKey": "HiTi1JT7GQRqLNxg4yZhD1mV42y1Mv2AYvRx92JQRbwX", "proofs": [ "ai7ypCJb9ygc73VJv46vtzPWCabEW5izfzbdkjQMpG66c5jC7HPq8MAbg1WWaHXKcDqsMuTayBjXWY7zEA3oVuT" ], "script": "base64:BgInCAISAwoBARIFCgMIAQESBQoDCAEBEgMKAQgSBAoCCAESBQoDCAEITQAGRVVMRVI4ANaJz4EBAAVNVUxUNgDAhD0ABk1VTFRYNgkAtgIBAMCEPQAFTVVMVDgAgMLXLwAGTVVMVFg4CQC2AgEAgMLXLwAHTVVMVFgxMAkAtgIBAIDIr6AlAAZNVUxUMTIAgKCUpY0dAAdNVUxUWDE2CQC2AgEAgICE/qbe4REABk1VTFQxOAkAtgIBAICAkLu61q3wDQADU0VQAgJfXwAHV0FWRVNJRAkA2QQBAgVXQVZFUwESa2V5TmV1dHJpbm9Bc3NldElkAAIRbmV1dHJpbm9fYXNzZXRfaWQBDmtleU5zYnRBc3NldElkAAINYm9uZF9hc3NldF9pZAEOa2V5U3VyZkFzc2V0SWQAAg1zdXJmX2Fzc2V0X2lkARBrZXlCYWxhbmNlTG9ja2VkAAINYmFsYW5jZV9sb2NrXwEVa2V5V2F2ZXNMb2NrZWRCYWxhbmNlAAkArAICCQEQa2V5QmFsYW5jZUxvY2tlZAACBXdhdmVzARhrZXlOZXV0cmlub0xvY2tlZEJhbGFuY2UACQCsAgI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wNTApAgUPY29udHJvbENvbnRyYWN0CQEIa2V5UHJpY2UABQtsaW1pdFdhbnRlZAQLZ05zYnROZWVkZWQJAQVhc0ludAEJAPwHBAUEdGhpcwIYcmV2ZXJzZVN3YXBMaW1pdFJFQURPTkxZCQDMCAIFD2xpbWl0V2FudGVkVXNkbgUDbmlsBQNuaWwECmdOc2J0RGVsdGEJAGUCBQtnTnNidE5lZWRlZAUMZ05zYnRDdXJyZW50CQCUCgIFA25pbAkAuQkCCQDMCAICBCVzJXMJAMwIAgkApAMBBQxnTnNidEN1cnJlbnQJAMwIAgkApAMBBQpnTnNidERlbHRhBQNuaWwFA1NFUAA5J0N/", "chainId": 84, "height": 2185377, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3kvi8PPiuoLt2QVHA4ErwLBq8iK6G7XhNAabzn8WFvUz Next: BrB2GWcz86YLVmAHaAB9RWrsu2ASrCbzoZm6rMtgqLG7 Diff:
OldNewDifferences
351351
352352
353353 @Callable(i)
354-func swapLimitCalculatorREADONLY (userAddressStrOpt,limitWanted) = {
354+func swapLimitCalculatorREADONLY (userAddressStrOpt,limitWanted,assetIdStr) = {
355355 let gNsbtCurrent = if ((userAddressStrOpt == ""))
356356 then 0
357357 else asInt(asSwapParamsSTRUCT(invoke(neutrinoContract, "swapParamsByUserSYSREADONLY", [userAddressStrOpt, 0], nil))._4)
358- let gNsbtNeeded = asInt(invoke(this, "reverseSwapLimitREADONLY", [limitWanted], nil))
358+ let limitWantedUsdn = if ((assetIdStr == "WAVES"))
359+ then (limitWanted * getIntegerValue(controlContract, keyPrice()))
360+ else limitWanted
361+ let gNsbtNeeded = asInt(invoke(this, "reverseSwapLimitREADONLY", [limitWantedUsdn], nil))
359362 let gNsbtDelta = (gNsbtNeeded - gNsbtCurrent)
360363 $Tuple2(nil, makeString(["%s%s", toString(gNsbtCurrent), toString(gNsbtDelta)], SEP))
361364 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let EULER8 = 271828182
55
66 let MULT6 = 1000000
77
88 let MULTX6 = toBigInt(1000000)
99
1010 let MULT8 = 100000000
1111
1212 let MULTX8 = toBigInt(100000000)
1313
1414 let MULTX10 = toBigInt(10000000000)
1515
1616 let MULT12 = 1000000000000
1717
1818 let MULTX16 = toBigInt(10000000000000000)
1919
2020 let MULT18 = toBigInt(1000000000000000000)
2121
2222 let SEP = "__"
2323
2424 let WAVESID = fromBase58String("WAVES")
2525
2626 func keyNeutrinoAssetId () = "neutrino_asset_id"
2727
2828
2929 func keyNsbtAssetId () = "bond_asset_id"
3030
3131
3232 func keySurfAssetId () = "surf_asset_id"
3333
3434
3535 func keyBalanceLocked () = "balance_lock_"
3636
3737
3838 func keyWavesLockedBalance () = (keyBalanceLocked() + "waves")
3939
4040
4141 func keyNeutrinoLockedBalance () = (keyBalanceLocked() + "neutrino")
4242
4343
4444 func keyMinWavesSwapAmount () = "min_waves_swap_amount"
4545
4646
4747 func keyMinNeutrinoSwapAmount () = "min_neutrino_swap_amount"
4848
4949
5050 func keyWavesOutFeePart () = "wavesOut_swap_feePart"
5151
5252
5353 func keyNeutrinoOutFeePart () = "neutrinoOut_swap_feePart"
5454
5555
5656 func keySwapAmountAParam () = "%s%s__config__swapAParam"
5757
5858
5959 func keySwapAmountBParam () = "%s%s__config__swapBParam"
6060
6161
6262 func keyNsbtLockContract () = "%s__nsbtLockContract"
6363
6464
6565 func keyMathContract () = "%s__mathContract"
6666
6767
6868 func keyBalanceWavesLockInterval () = "balance_waves_lock_interval"
6969
7070
7171 func keyBalanceNeutrinoLockInterval () = "balance_neutrino_lock_interval"
7272
7373
7474 func keyPrice () = "price"
7575
7676
7777 func keyLockParamStartBlock (userAddress) = makeString(["%s%s%s", "paramByUser", userAddress, "start"], SEP)
7878
7979
8080 func keyHalfLife () = "%s__halfLife"
8181
8282
8383 func keyMinLockAmount () = "%s__minLockAmount"
8484
8585
8686 func keyMinWavesForNsbtBuy () = "min_waves_nsbt_buy"
8787
8888
8989 func keyMinNsbtSell () = "min_nsbt_sell"
9090
9191
9292 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
9393
9494
9595 func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
9696
9797
9898 func getBoolOrFail (address,key) = valueOrErrorMessage(getBoolean(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
9999
100100
101101 func convertNeutrinoToWaves (amount,price) = fraction(amount, MULT8, price)
102102
103103
104104 func convertWavesToNeutrino (amount,price) = fraction(amount, price, MULT8)
105105
106106
107107 func asAnyList (val) = match val {
108108 case valAnyList: List[Any] =>
109109 valAnyList
110110 case _ =>
111111 throw("fail to cast into List[Any]")
112112 }
113113
114114
115115 func asInt (val) = match val {
116116 case valInt: Int =>
117117 valInt
118118 case _ =>
119119 throw("fail to cast into Int")
120120 }
121121
122122
123123 func asString (val) = match val {
124124 case valStr: String =>
125125 valStr
126126 case _ =>
127127 throw("fail to cast into String")
128128 }
129129
130130
131131 func asTuple2Ints (val) = match val {
132132 case v: (Int, Int) =>
133133 v
134134 case _ =>
135135 throw("fail to cast into Tuple2 ints")
136136 }
137137
138138
139139 func asSwapParamsSTRUCT (val) = match val {
140140 case struct: (Int, Int, Int, Int, Int) =>
141141 struct
142142 case _ =>
143143 throw("fail to cast into Tuple5 ints")
144144 }
145145
146146
147147 func toTimestamp (start) = if ((0 > start))
148148 then -1
149149 else match blockInfoByHeight(start) {
150150 case block: BlockInfo =>
151151 block.timestamp
152152 case _ =>
153153 -1
154154 }
155155
156156
157157 func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), MULT18, toBigInt(origScaleMult))
158158
159159
160160 func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), MULT18))
161161
162162
163163 let IdxControlCfgNeutrinoDapp = 1
164164
165165 let IdxControlCfgAuctionDapp = 2
166166
167167 let IdxControlCfgRpdDapp = 3
168168
169169 let IdxControlCfgMathDapp = 4
170170
171171 let IdxControlCfgLiquidationDapp = 5
172172
173173 let IdxControlCfgRestDapp = 6
174174
175175 let IdxControlCfgNodeRegistryDapp = 7
176176
177177 let IdxControlCfgNsbtStakingDapp = 8
178178
179179 let IdxControlCfgMediatorDapp = 9
180180
181181 let IdxControlCfgSurfStakingDapp = 10
182182
183183 let IdxControlCfgGnsbtControllerDapp = 11
184184
185185 func keyControlAddress () = "%s%s__config__controlAddress"
186186
187187
188188 func keyControlCfg () = "%s__controlConfig"
189189
190190
191191 func readControlCfgOrFail (control) = split(getStringOrFail(control, keyControlCfg()), SEP)
192192
193193
194194 func getContractAddressOrFail (controlCfg,idx) = valueOrErrorMessage(addressFromString(controlCfg[idx]), ("Control cfg doesn't contain address at index " + toString(idx)))
195195
196196
197197 let controlContract = addressFromStringValue(valueOrElse(getString(this, keyControlAddress()), "3N4NS7d4Jo9a6F14LiFUKKYVdUkkf2eP4Zx"))
198198
199199 let controlCfg = readControlCfgOrFail(controlContract)
200200
201201 let mathContract = getContractAddressOrFail(controlCfg, IdxControlCfgMathDapp)
202202
203203 let neutrinoContract = getContractAddressOrFail(controlCfg, IdxControlCfgNeutrinoDapp)
204204
205205 let auctionContract = getContractAddressOrFail(controlCfg, IdxControlCfgAuctionDapp)
206206
207207 let liquidationContract = getContractAddressOrFail(controlCfg, IdxControlCfgLiquidationDapp)
208208
209209 let rpdContract = getContractAddressOrFail(controlCfg, IdxControlCfgRpdDapp)
210210
211211 let nsbtStakingContract = getContractAddressOrFail(controlCfg, IdxControlCfgNsbtStakingDapp)
212212
213213 let surfStakingContract = getContractAddressOrFail(controlCfg, IdxControlCfgSurfStakingDapp)
214214
215215 let gnsbtControllerContract = getContractAddressOrFail(controlCfg, IdxControlCfgGnsbtControllerDapp)
216216
217217 let neutrinoAssetIdString = getStringOrFail(neutrinoContract, keyNeutrinoAssetId())
218218
219219 let neutrinoAssetId = fromBase58String(neutrinoAssetIdString)
220220
221221 let nsbtAssetIdStr = getStringValue(neutrinoContract, keyNsbtAssetId())
222222
223223 let nsbtAssetId = fromBase58String(nsbtAssetIdStr)
224224
225225 let surfAssetIdStr = getStringValue(auctionContract, keySurfAssetId())
226226
227227 let surfAssetId = fromBase58String(surfAssetIdStr)
228228
229229 @Callable(i)
230230 func reverseSwapLimitREADONLY (lim) = {
231231 let gNsbt = if ((0 >= lim))
232232 then 0
233233 else {
234234 let aParamX8 = toBigInt(getIntOrFail(mathContract, keySwapAmountAParam()))
235235 let bParamX16 = toBigInt(getIntOrFail(mathContract, keySwapAmountBParam()))
236236 let limDivAX8 = fraction(toBigInt(lim), MULTX10, aParamX8)
237237 let revBX16 = fraction(MULTX16, MULTX16, bParamX16)
238238 toInt(pow(limDivAX8, 8, revBX16, 16, 6, CEILING))
239239 }
240240 $Tuple2(nil, gNsbt)
241241 }
242242
243243
244244
245245 @Callable(i)
246246 func gnsbtInfoINTERNAL (userAddressStrOrEmpty,additionalNsbtToStakeOrZero,additionalSurfToStakeOrZero) = {
247247 let userAddressOrThis = if ((userAddressStrOrEmpty != ""))
248248 then addressFromStringValue(userAddressStrOrEmpty)
249249 else this
250250 let currentPrice = getIntegerValue(controlContract, keyPrice())
251251 let gnsbtFromNsbtDiff = additionalNsbtToStakeOrZero
252252 let gnsbtFromSurfDiff = asInt(invoke(surfStakingContract, "gnsbtFromSurfSYSREADONLY", [additionalSurfToStakeOrZero], nil))
253253 let gNsbtDiff = (gnsbtFromNsbtDiff + gnsbtFromSurfDiff)
254254 let swapParamsTuple = asSwapParamsSTRUCT(invoke(neutrinoContract, "swapParamsByUserSYSREADONLY", [userAddressStrOrEmpty, 0], nil))
255255 let limitMaxUsdn = swapParamsTuple._1
256256 let limitSpent = swapParamsTuple._2
257257 let blcks2LmtReset = swapParamsTuple._3
258258 let gnsbtAmt = swapParamsTuple._4
259259 let gnsbtAmtTotal = swapParamsTuple._5
260260 let swapParamsTupleNEW = asSwapParamsSTRUCT(invoke(neutrinoContract, "swapParamsByUserSYSREADONLY", [userAddressStrOrEmpty, gNsbtDiff], nil))
261261 let limitMaxUsdnNEW = swapParamsTupleNEW._1
262262 let limitSpentNEW = swapParamsTupleNEW._2
263263 let blcks2LmtResetNEW = swapParamsTupleNEW._3
264264 let gnsbtAmtNEW = swapParamsTupleNEW._4
265265 let gnsbtAmtTotalNEW = swapParamsTupleNEW._5
266266 let limitMaxWaves = convertNeutrinoToWaves(limitMaxUsdn, currentPrice)
267267 let limitMaxWavesNEW = convertNeutrinoToWaves(limitMaxUsdnNEW, currentPrice)
268268 let nsbtBalance = if ((userAddressStrOrEmpty != ""))
269269 then assetBalance(userAddressOrThis, nsbtAssetId)
270270 else 0
271271 let surfBalance = if ((userAddressStrOrEmpty != ""))
272272 then assetBalance(userAddressOrThis, surfAssetId)
273273 else 0
274274 let nsbtBalanceDiff = if ((additionalNsbtToStakeOrZero >= 0))
275275 then additionalNsbtToStakeOrZero
276276 else {
277277 let nsbtUnstakingData = asAnyList(invoke(nsbtStakingContract, "nsbtUnstakingSYSREADONLY", [userAddressStrOrEmpty, (-1 * additionalNsbtToStakeOrZero)], nil))
278278 let nsbtReceiveAmount = asInt(nsbtUnstakingData[2])
279279 let result = -(nsbtReceiveAmount)
280280 result
281281 }
282282 let nsbtBalanceNew = (nsbtBalance - nsbtBalanceDiff)
283283 let surfBalanceNew = (surfBalance - additionalSurfToStakeOrZero)
284284 let gnsbtData = asAnyList(invoke(gnsbtControllerContract, "gnsbtInfoSYSREADONLY", [userAddressStrOrEmpty, additionalNsbtToStakeOrZero, additionalSurfToStakeOrZero], nil))
285285 let gnsbtUser = asInt(gnsbtData[0])
286286 let gnsbtTotal = asInt(gnsbtData[1])
287287 let nsbtData = asAnyList(gnsbtData[2])
288288 let surfData = asAnyList(gnsbtData[3])
289289 let vpEffectiveHeight = asInt(gnsbtData[4])
290290 let vpEffectiveHeightNEW = asInt(gnsbtData[5])
291291 let gnsbtAmtFromNsbt = asInt(nsbtData[2])
292292 let gnsbtAmtFromSurf = asInt(surfData[2])
293293 let gnsbtAmtFromNsbtNEW = (gnsbtAmtFromNsbt + gnsbtFromNsbtDiff)
294294 let gnsbtAmtFromSurfNEW = (gnsbtAmtFromSurf + gnsbtFromSurfDiff)
295295 let gnsbtFromNsbtTotal = asInt(nsbtData[3])
296296 let gnsbtFromSurfTotal = asInt(surfData[3])
297297 let gnsbtFromSurfActiveTotal = 0
298298 let gnsbtFromSurfFrozenTotal = gnsbtFromSurfTotal
299299 let gnsbtFromNsbtTotalNEW = (gnsbtFromNsbtTotal + gnsbtFromNsbtDiff)
300300 let gnsbtFromSurfTotalNEW = (gnsbtFromSurfTotal + gnsbtFromSurfDiff)
301301 let gnsbtFromSurfFrozenTotalNEW = gnsbtFromSurfTotalNEW
302302 let votingPower = fraction(gnsbtAmtFromNsbt, MULT8, (gnsbtFromNsbtTotal + gnsbtFromSurfActiveTotal))
303303 let votingPowerNew = fraction(gnsbtAmtFromNsbtNEW, MULT8, (gnsbtFromNsbtTotalNEW + gnsbtFromSurfActiveTotal))
304304 let votingPowerMax = fraction((gnsbtAmtFromNsbt + gnsbtAmtFromSurf), MULT8, ((gnsbtFromNsbtTotal + gnsbtFromSurfActiveTotal) + gnsbtFromSurfFrozenTotal))
305305 let votingPowerMaxNew = fraction((gnsbtAmtFromNsbtNEW + gnsbtAmtFromSurfNEW), MULT8, ((gnsbtFromNsbtTotalNEW + gnsbtFromSurfActiveTotal) + gnsbtFromSurfFrozenTotalNEW))
306306 let votingPowerEta = if ((vpEffectiveHeight == 0))
307307 then height
308308 else vpEffectiveHeight
309309 let votingPowerEtaNew = if ((vpEffectiveHeightNEW == 0))
310310 then height
311311 else vpEffectiveHeightNEW
312312 $Tuple2(nil, [0, nsbtBalance, surfBalance, nsbtBalanceNew, surfBalanceNew, gnsbtAmtFromNsbt, gnsbtAmtFromSurf, gnsbtAmtFromNsbtNEW, gnsbtAmtFromSurfNEW, gnsbtFromNsbtTotal, gnsbtFromSurfTotal, gnsbtFromNsbtTotalNEW, gnsbtFromSurfTotalNEW, limitMaxUsdn, limitMaxWaves, limitMaxUsdnNEW, limitMaxWavesNEW, blcks2LmtReset, blcks2LmtResetNEW, votingPower, votingPowerNew, votingPowerMax, votingPowerMaxNew, votingPowerEta, votingPowerEtaNew])
313313 }
314314
315315
316316
317317 @Callable(i)
318318 func gnsbtInfoREADONLY (userAddressStrOrEmpty,additionalNsbtToStakeOrZero,additionalSurfToStakeOrZero) = {
319319 let gnsbtInfoDATA = asAnyList(invoke(this, "gnsbtInfoINTERNAL", [userAddressStrOrEmpty, additionalNsbtToStakeOrZero, additionalSurfToStakeOrZero], nil))
320320 $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))
321321 }
322322
323323
324324
325325 @Callable(i)
326326 func rewardInfoREADONLY (userAddressStrOrEmpty) = {
327327 let rewardsData = asAnyList(invoke(gnsbtControllerContract, "gnsbtRewardsSYSREADONLY", [userAddressStrOrEmpty], nil))
328328 $Tuple2(nil, makeString(["%s%s", asString(rewardsData[0]), asString(rewardsData[1])], SEP))
329329 }
330330
331331
332332
333333 @Callable(i)
334334 func mergeNsbtREADONLY (userAddressMandatory,newAmount) = {
335335 let nsbtData = asAnyList(invoke(nsbtStakingContract, "nsbtStakingSYSREADONLY", [userAddressMandatory, newAmount], nil))
336336 let amount0 = asInt(nsbtData[0])
337337 let startHeight = if ((0 >= amount0))
338338 then -1
339339 else asInt(nsbtData[2])
340340 let startTimestamp = toTimestamp(startHeight)
341341 let startHeightNew = if ((0 >= newAmount))
342342 then startHeight
343343 else {
344344 let halfLife = getIntOrFail(nsbtStakingContract, keyHalfLife())
345345 asInt(invoke(mathContract, "mergeStakesREADONLY", [amount0, startHeight, newAmount, height, halfLife], nil))
346346 }
347347 let startTimestampNew = toTimestamp(startHeightNew)
348348 $Tuple2(nil, makeString(["%d%d%d%d", toString(startHeight), toString(startTimestamp), toString(startHeightNew), toString(startTimestampNew)], SEP))
349349 }
350350
351351
352352
353353 @Callable(i)
354-func swapLimitCalculatorREADONLY (userAddressStrOpt,limitWanted) = {
354+func swapLimitCalculatorREADONLY (userAddressStrOpt,limitWanted,assetIdStr) = {
355355 let gNsbtCurrent = if ((userAddressStrOpt == ""))
356356 then 0
357357 else asInt(asSwapParamsSTRUCT(invoke(neutrinoContract, "swapParamsByUserSYSREADONLY", [userAddressStrOpt, 0], nil))._4)
358- let gNsbtNeeded = asInt(invoke(this, "reverseSwapLimitREADONLY", [limitWanted], nil))
358+ let limitWantedUsdn = if ((assetIdStr == "WAVES"))
359+ then (limitWanted * getIntegerValue(controlContract, keyPrice()))
360+ else limitWanted
361+ let gNsbtNeeded = asInt(invoke(this, "reverseSwapLimitREADONLY", [limitWantedUsdn], nil))
359362 let gNsbtDelta = (gNsbtNeeded - gNsbtCurrent)
360363 $Tuple2(nil, makeString(["%s%s", toString(gNsbtCurrent), toString(gNsbtDelta)], SEP))
361364 }
362365
363366

github/deemru/w8io/026f985 
292.59 ms