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