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