tx · 31k1wxKGSaXgRpYWrvf2WQQwvSzchRMC2YXdaykP92Mt 3N7LYefWk1WhvCsY5A9nTq244SbVPmhCypi: -0.02500000 Waves 2023.02.10 10:52 [2443254] smart account 3N7LYefWk1WhvCsY5A9nTq244SbVPmhCypi > SELF 0.00000000 Waves
{ "type": 13, "id": "31k1wxKGSaXgRpYWrvf2WQQwvSzchRMC2YXdaykP92Mt", "fee": 2500000, "feeAssetId": null, "timestamp": 1676015649321, "version": 2, "chainId": 84, "sender": "3N7LYefWk1WhvCsY5A9nTq244SbVPmhCypi", "senderPublicKey": "4qGVXRFATZNzo2RZZ5UYHXojGyJgSRBwtgJcCU8rJe5A", "proofs": [ "2FwpqkDQZcZpBGqiP3sKqMzusipT5AFRsXG87br28a5p9Hfsfh6G8PQ73eBeHJ1EXWLcSRpHsbDEkMkbxu8ZHGjE", "5CFzvjL3qhx7NipjSdiy6h7fHpjSeYYtd1HXX8Fp7zzjMxsDiK6fArC6gWvNcgpv8DbZnnSijiouwVmgvrGG43Yy", "2TT4fMVUnbEDsmrCKT73EnmDtoEa3ADq1esPxDZzPYnX9xqjxTsasp5nnkhET9ehyg9ZcZUuZG2YzA6FCRiZcEci" ], "script": "base64:AAIFAAAAAAAAADkIAhIFCgMICAESAwoBARIHCgUBAQEBARIDCgEBEgQKAgECEgMKAQESABIFCgMBAQESBwoFAQEBAQEAAABxAAAAAAtyZXZpc2lvbk51bQIAAAAAAAAAAAlNVUxUU0NBTEUAAAAAAAAAAAgAAAAAB1NDQUxFMTYAAAAAAAAAABAAAAAAA1NFUAIAAAACX18AAAAABUhBTEY4AAAAAAAC+vCAAAAAAAhFVUxFUlgxNgkAATYAAAABAABgkqET2NV0AAAAAARUV09YCQABNgAAAAEAAAAAAAAAAAIAAAAABU1VTFQ2AAAAAAAAD0JAAAAAAAZNVUxUWDYJAAE2AAAAAQAAAAAAAA9CQAAAAAAFTVVMVDgAAAAAAAX14QAAAAAABk1VTFRYOAkAATYAAAABAAAAAAAF9eE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AALERVdXVMalh1OThuQndaYzdmcXdDVGp0QTNublJ3Z1Ria01TcjVTVTJObURSBQAAAANuaWwFAAAAA1NFUAQAAAAQcHViS2V5QWRtaW5zTGlzdAkABLUAAAACCQEAAAALdmFsdWVPckVsc2UAAAACCQAEHQAAAAIFAAAAD2NvbnRyb2xDb250cmFjdAIAAAAMJXNfX211bHRpc2lnBQAAABNwdWJLZXlBZG1pbnNMaXN0U3RyBQAAAANTRVAEAAAABWNvdW50CQAAZAAAAAIJAABkAAAAAgkAAGQAAAACAwkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAJAAJZAAAAAQkAAZEAAAACBQAAABBwdWJLZXlBZG1pbnNMaXN0AAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAwkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAEJAAJZAAAAAQkAAZEAAAACBQAAABBwdWJLZXlBZG1pbnNMaXN0AAAAAAAAAAABAAAAAAAAAAABAAAAAAAAAAAAAwkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAIJAAJZAAAAAQkAAZEAAAACBQAAABBwdWJLZXlBZG1pbnNMaXN0AAAAAAAAAAACAAAAAAAAAAABAAAAAAAAAAAAAwkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAMJAAJZAAAAAQkAAZEAAAACBQAAABBwdWJLZXlBZG1pbnNMaXN0AAAAAAAAAAADAAAAAAAAAAACAAAAAAAAAAAACQAAZwAAAAIFAAAABWNvdW50AAAAAAAAAAADP83mnw==", "height": 2443254, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: AJntcx3jaN6xUZFbDEvfFphUpr8eW19ng4Xf7KJenV1F Next: 5tkknVVKLuUkW7vV7LkVXnvq6jiRzHUCsD21GNHTuA7Q Diff:
Old | New | Differences | |
---|---|---|---|
71 | 71 | ||
72 | 72 | let nMetricCurrentPriceAdj = 13 | |
73 | 73 | ||
74 | + | let nMetricBasketInfo = 14 | |
75 | + | ||
74 | 76 | func keyNeutrinoAddress () = "%s%s__config__neutrinoAddress" | |
75 | 77 | ||
76 | 78 | ||
119 | 121 | func keyQuickSwapUserSpentInPeriod (userAddress) = makeString(["%s%s", "quickSwapUserSpentInPeriod", userAddress], SEP) | |
120 | 122 | ||
121 | 123 | ||
124 | + | func basketAssetsKey () = "%s%s__common__basketAssets" | |
125 | + | ||
126 | + | ||
122 | 127 | func keyPrice () = "price" | |
128 | + | ||
129 | + | ||
130 | + | func keyPriceByAsset (assetId) = "%s%s__common__priceByAsset" | |
123 | 131 | ||
124 | 132 | ||
125 | 133 | let RpdBalanceKey = "rpd_balance" | |
304 | 312 | then 0 | |
305 | 313 | else fraction(reservesInUsdn, MULT6, neutrinoSupply) | |
306 | 314 | ||
315 | + | func getBasketInfo () = { | |
316 | + | let basketAssets = valueOrElse(getString(neutrinoContract, basketAssetsKey()), "WAVES") | |
317 | + | let basket = split(basketAssets, SEP) | |
318 | + | func weightCalc (acc,assetId) = { | |
319 | + | let tempAssetId = fromBase58String(assetId) | |
320 | + | let vol = if ((tempAssetId == WAVESID)) | |
321 | + | then reserve | |
322 | + | else assetBalance(neutrinoContract, tempAssetId) | |
323 | + | let pr = valueOrElse(getInteger(controlContract, keyPriceByAsset(assetId)), MULT6) | |
324 | + | let resU = fraction(vol, pr, MULT8) | |
325 | + | $Tuple2((acc._1 :+ $Tuple4(assetId, vol, resU, pr)), (acc._2 + resU)) | |
326 | + | } | |
327 | + | ||
328 | + | let t = { | |
329 | + | let $l = basket | |
330 | + | let $s = size($l) | |
331 | + | let $acc0 = $Tuple2(nil, 0) | |
332 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
333 | + | then $a | |
334 | + | else weightCalc($a, $l[$i]) | |
335 | + | ||
336 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
337 | + | then $a | |
338 | + | else throw("List size exceeds 10") | |
339 | + | ||
340 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
341 | + | } | |
342 | + | func combine (acc,item) = { | |
343 | + | let share = if ((t._2 == 0)) | |
344 | + | then MULT6 | |
345 | + | else fraction(item._3, MULT6, t._2) | |
346 | + | (acc :+ makeString([item._1, toString(share), toString(item._4), toString(item._2)], ":")) | |
347 | + | } | |
348 | + | ||
349 | + | let weightedPrice = if ((neutrinoSupply == 0)) | |
350 | + | then 0 | |
351 | + | else fraction(t._2, MULT6, neutrinoSupply) | |
352 | + | $Tuple3(makeString({ | |
353 | + | let $l = t._1 | |
354 | + | let $s = size($l) | |
355 | + | let $acc0 = nil | |
356 | + | func $f1_1 ($a,$i) = if (($i >= $s)) | |
357 | + | then $a | |
358 | + | else combine($a, $l[$i]) | |
359 | + | ||
360 | + | func $f1_2 ($a,$i) = if (($i >= $s)) | |
361 | + | then $a | |
362 | + | else throw("List size exceeds 10") | |
363 | + | ||
364 | + | $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
365 | + | }, "_"), weightedPrice, t._2) | |
366 | + | } | |
367 | + | ||
368 | + | ||
307 | 369 | @Callable(i) | |
308 | - | func | |
370 | + | func constructorV1 (neutrinoAddress,nsbtLockAddress,swapAmountAParam) = if ((i.caller != this)) | |
309 | 371 | then throw("not authorized") | |
310 | 372 | else [StringEntry(keyNeutrinoAddress(), neutrinoAddress), IntegerEntry(keySwapAmountAParam(), swapAmountAParam)] | |
311 | 373 | ||
437 | 499 | let nsbtSupplyMAX = value(assetInfo(nsbtAssetId)).quantity | |
438 | 500 | let nsbtSupply = (nsbtSupplyMAX - assetBalance(auctionContract, nsbtAssetId)) | |
439 | 501 | let surfSupply = value(assetInfo(surfAssetId)).quantity | |
440 | - | $Tuple2(nil, [currentPrice, neutrinoLockedBalance, wavesLockedBalance, reserve, reservesInUsdn, neutrinoSupply, neutrinoOutOfMarketSupply, neutrinoTotalSupply, BR, nsbtSupply, nsbtSupplyMAX, surfSupply, usdnUsdtPegX6, currentPriceAdj]) | |
502 | + | let basketInfo = getBasketInfo() | |
503 | + | $Tuple2(nil, [currentPrice, neutrinoLockedBalance, wavesLockedBalance, reserve, reservesInUsdn, neutrinoSupply, neutrinoOutOfMarketSupply, neutrinoTotalSupply, BR, nsbtSupply, nsbtSupplyMAX, surfSupply, usdnUsdtPegX6, currentPriceAdj, basketInfo._1, basketInfo._2, basketInfo._3]) | |
441 | 504 | } | |
442 | 505 | ||
443 | 506 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let revisionNum = "" | |
5 | 5 | ||
6 | 6 | let MULTSCALE = 8 | |
7 | 7 | ||
8 | 8 | let SCALE16 = 16 | |
9 | 9 | ||
10 | 10 | let SEP = "__" | |
11 | 11 | ||
12 | 12 | let HALF8 = 50000000 | |
13 | 13 | ||
14 | 14 | let EULERX16 = toBigInt(27182818284590452) | |
15 | 15 | ||
16 | 16 | let TWOX = toBigInt(2) | |
17 | 17 | ||
18 | 18 | let MULT6 = 1000000 | |
19 | 19 | ||
20 | 20 | let MULTX6 = toBigInt(1000000) | |
21 | 21 | ||
22 | 22 | let MULT8 = 100000000 | |
23 | 23 | ||
24 | 24 | let MULTX8 = toBigInt(100000000) | |
25 | 25 | ||
26 | 26 | let MULTX10 = toBigInt(10000000000) | |
27 | 27 | ||
28 | 28 | let MULTX16 = toBigInt(10000000000000000) | |
29 | 29 | ||
30 | 30 | let WAVESID = fromBase58String("WAVES") | |
31 | 31 | ||
32 | 32 | let kResultIdxA = 0 | |
33 | 33 | ||
34 | 34 | let kResultIdxPaulB = 1 | |
35 | 35 | ||
36 | 36 | let kResultIdxWReservesInUsdn = 2 | |
37 | 37 | ||
38 | 38 | let kResultIdxMultBR = 3 | |
39 | 39 | ||
40 | 40 | let kResultIdxMultPower = 4 | |
41 | 41 | ||
42 | 42 | let kResultIdxMultExpInPowerStr = 5 | |
43 | 43 | ||
44 | 44 | let kResultIdxMultKStr = 6 | |
45 | 45 | ||
46 | 46 | let nMetricIdxPrice = 0 | |
47 | 47 | ||
48 | 48 | let nMetricIdxUsdnLockedBalance = 1 | |
49 | 49 | ||
50 | 50 | let nMetricIdxWavesLockedBalance = 2 | |
51 | 51 | ||
52 | 52 | let nMetricIdxReserve = 3 | |
53 | 53 | ||
54 | 54 | let nMetricIdxReserveInUsdn = 4 | |
55 | 55 | ||
56 | 56 | let nMetricIdxUsdnSupply = 5 | |
57 | 57 | ||
58 | 58 | let nMetricIdxSurplus = 6 | |
59 | 59 | ||
60 | 60 | let nMetricIdxSurplusPercent = 7 | |
61 | 61 | ||
62 | 62 | let nMetricIdxBR = 8 | |
63 | 63 | ||
64 | 64 | let nMetricIdxNsbtSupply = 9 | |
65 | 65 | ||
66 | 66 | let nMetricIdxMaxNsbtSupply = 10 | |
67 | 67 | ||
68 | 68 | let nMetricIdxSurfSupply = 11 | |
69 | 69 | ||
70 | 70 | let nMetricUsdnUsdtPeg = 12 | |
71 | 71 | ||
72 | 72 | let nMetricCurrentPriceAdj = 13 | |
73 | 73 | ||
74 | + | let nMetricBasketInfo = 14 | |
75 | + | ||
74 | 76 | func keyNeutrinoAddress () = "%s%s__config__neutrinoAddress" | |
75 | 77 | ||
76 | 78 | ||
77 | 79 | func keySwapAmountAParam () = "%s%s__config__swapAParam" | |
78 | 80 | ||
79 | 81 | ||
80 | 82 | func keySwapAmountBParam () = "%s%s__config__swapBParam" | |
81 | 83 | ||
82 | 84 | ||
83 | 85 | func keyUsdnSwapAmountAParam () = "%s%s__config__usdnSwapAParam" | |
84 | 86 | ||
85 | 87 | ||
86 | 88 | func keyUsdnSwapAmountBParam () = "%s%s__config__usdnSwapBParam" | |
87 | 89 | ||
88 | 90 | ||
89 | 91 | func keyPriceAdjMinCoeff () = "%s%s__priceAdj__minCoefficient" | |
90 | 92 | ||
91 | 93 | ||
92 | 94 | func keyPriceAdjArbRegulator () = "%s%s__priceAdj__arbRegulator" | |
93 | 95 | ||
94 | 96 | ||
95 | 97 | func keyNeutrinoAssetId () = "neutrino_asset_id" | |
96 | 98 | ||
97 | 99 | ||
98 | 100 | func keyNsbtAssetId () = "bond_asset_id" | |
99 | 101 | ||
100 | 102 | ||
101 | 103 | func keySurfAssetId () = "surf_asset_id" | |
102 | 104 | ||
103 | 105 | ||
104 | 106 | func keyBalanceLocked () = "balance_lock_" | |
105 | 107 | ||
106 | 108 | ||
107 | 109 | func keyWavesLockedBalance () = (keyBalanceLocked() + "waves") | |
108 | 110 | ||
109 | 111 | ||
110 | 112 | func keyNeutrinoLockedBalance () = (keyBalanceLocked() + "neutrino") | |
111 | 113 | ||
112 | 114 | ||
113 | 115 | func swapsTimeframeKEY () = "swaps_timeframe" | |
114 | 116 | ||
115 | 117 | ||
116 | 118 | func keyUserLastQuickSwapHeight (userAddress) = makeString(["%s%s", "userLastQuickSwapHeight", userAddress], SEP) | |
117 | 119 | ||
118 | 120 | ||
119 | 121 | func keyQuickSwapUserSpentInPeriod (userAddress) = makeString(["%s%s", "quickSwapUserSpentInPeriod", userAddress], SEP) | |
120 | 122 | ||
121 | 123 | ||
124 | + | func basketAssetsKey () = "%s%s__common__basketAssets" | |
125 | + | ||
126 | + | ||
122 | 127 | func keyPrice () = "price" | |
128 | + | ||
129 | + | ||
130 | + | func keyPriceByAsset (assetId) = "%s%s__common__priceByAsset" | |
123 | 131 | ||
124 | 132 | ||
125 | 133 | let RpdBalanceKey = "rpd_balance" | |
126 | 134 | ||
127 | 135 | func rpdUserBalanceKey (owner,assetId) = makeString([RpdBalanceKey, assetId, owner], "_") | |
128 | 136 | ||
129 | 137 | ||
130 | 138 | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
131 | 139 | ||
132 | 140 | ||
133 | 141 | func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
134 | 142 | ||
135 | 143 | ||
136 | 144 | func getNumberByKey (address,key) = valueOrElse(getInteger(address, key), 0) | |
137 | 145 | ||
138 | 146 | ||
139 | 147 | func getBoolOrFail (address,key) = valueOrErrorMessage(getBoolean(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
140 | 148 | ||
141 | 149 | ||
142 | 150 | func convertNeutrinoToWaves (amount,price) = fraction(amount, MULT8, price) | |
143 | 151 | ||
144 | 152 | ||
145 | 153 | func convertWavesToNeutrino (amount,price) = fraction(amount, price, MULT8) | |
146 | 154 | ||
147 | 155 | ||
148 | 156 | func toX16 (origVal,origScaleMult) = fraction(toBigInt(origVal), MULTX16, toBigInt(origScaleMult)) | |
149 | 157 | ||
150 | 158 | ||
151 | 159 | func fromX16 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), MULTX16)) | |
152 | 160 | ||
153 | 161 | ||
154 | 162 | func asAnyList (val) = match val { | |
155 | 163 | case valAnyLyst: List[Any] => | |
156 | 164 | valAnyLyst | |
157 | 165 | case _ => | |
158 | 166 | throw("fail to cast into List[Any]") | |
159 | 167 | } | |
160 | 168 | ||
161 | 169 | ||
162 | 170 | func asInt (val) = match val { | |
163 | 171 | case valInt: Int => | |
164 | 172 | valInt | |
165 | 173 | case _ => | |
166 | 174 | throw("fail to cast into Int") | |
167 | 175 | } | |
168 | 176 | ||
169 | 177 | ||
170 | 178 | func asString (val) = match val { | |
171 | 179 | case valStr: String => | |
172 | 180 | valStr | |
173 | 181 | case _ => | |
174 | 182 | throw("fail to cast into String") | |
175 | 183 | } | |
176 | 184 | ||
177 | 185 | ||
178 | 186 | func asPriceSTRUCT (v) = match v { | |
179 | 187 | case struct: (Int, Int, Int, Int) => | |
180 | 188 | struct | |
181 | 189 | case _ => | |
182 | 190 | throw("fail to cast into PriceSTRUCT") | |
183 | 191 | } | |
184 | 192 | ||
185 | 193 | ||
186 | 194 | let IdxControlCfgNeutrinoDapp = 1 | |
187 | 195 | ||
188 | 196 | let IdxControlCfgAuctionDapp = 2 | |
189 | 197 | ||
190 | 198 | let IdxControlCfgRpdDapp = 3 | |
191 | 199 | ||
192 | 200 | let IdxControlCfgMathDapp = 4 | |
193 | 201 | ||
194 | 202 | let IdxControlCfgLiquidationDapp = 5 | |
195 | 203 | ||
196 | 204 | let IdxControlCfgRestDapp = 6 | |
197 | 205 | ||
198 | 206 | let IdxControlCfgNodeRegistryDapp = 7 | |
199 | 207 | ||
200 | 208 | let IdxControlCfgNsbtStakingDapp = 8 | |
201 | 209 | ||
202 | 210 | let IdxControlCfgMediatorDapp = 9 | |
203 | 211 | ||
204 | 212 | let IdxControlCfgSurfStakingDapp = 10 | |
205 | 213 | ||
206 | 214 | let IdxControlCfgGnsbtControllerDapp = 11 | |
207 | 215 | ||
208 | 216 | let IdxControlCfgRestV2Dapp = 12 | |
209 | 217 | ||
210 | 218 | let IdxControlCfgGovernanceDapp = 13 | |
211 | 219 | ||
212 | 220 | let IdxControlCfgPegProviderDapp = 14 | |
213 | 221 | ||
214 | 222 | func keyControlAddress () = "%s%s__config__controlAddress" | |
215 | 223 | ||
216 | 224 | ||
217 | 225 | func keyControlCfg () = "%s__controlConfig" | |
218 | 226 | ||
219 | 227 | ||
220 | 228 | func readControlCfgOrFail (control) = split(getStringOrFail(control, keyControlCfg()), SEP) | |
221 | 229 | ||
222 | 230 | ||
223 | 231 | func getContractAddressOrFail (controlCfg,idx) = valueOrErrorMessage(addressFromString(controlCfg[idx]), ("Control cfg doesn't contain address at index " + toString(idx))) | |
224 | 232 | ||
225 | 233 | ||
226 | 234 | let controlContract = addressFromStringValue(valueOrElse(getString(this, keyControlAddress()), "3N4NS7d4Jo9a6F14LiFUKKYVdUkkf2eP4Zx")) | |
227 | 235 | ||
228 | 236 | let controlCfg = readControlCfgOrFail(controlContract) | |
229 | 237 | ||
230 | 238 | let neutrinoContract = getContractAddressOrFail(controlCfg, IdxControlCfgNeutrinoDapp) | |
231 | 239 | ||
232 | 240 | let auctionContract = getContractAddressOrFail(controlCfg, IdxControlCfgAuctionDapp) | |
233 | 241 | ||
234 | 242 | let liquidationContract = getContractAddressOrFail(controlCfg, IdxControlCfgLiquidationDapp) | |
235 | 243 | ||
236 | 244 | let usdnStakingContract = getContractAddressOrFail(controlCfg, IdxControlCfgRpdDapp) | |
237 | 245 | ||
238 | 246 | let pegProviderContract = getContractAddressOrFail(controlCfg, IdxControlCfgPegProviderDapp) | |
239 | 247 | ||
240 | 248 | let neutrinoAssetIdStr = getStringOrFail(neutrinoContract, keyNeutrinoAssetId()) | |
241 | 249 | ||
242 | 250 | let neutrinoAssetId = fromBase58String(neutrinoAssetIdStr) | |
243 | 251 | ||
244 | 252 | let nsbtAssetId = fromBase58String(getStringValue(neutrinoContract, keyNsbtAssetId())) | |
245 | 253 | ||
246 | 254 | let surfAssetId = fromBase58String(getStringValue(auctionContract, keySurfAssetId())) | |
247 | 255 | ||
248 | 256 | func calcUsdnOutOfMarketSupply () = { | |
249 | 257 | let outOfMarketAddressList = valueOrElse(getString(controlContract, "%s%s__control__outOfMarketAddressList"), "") | |
250 | 258 | if ((outOfMarketAddressList == "")) | |
251 | 259 | then 0 | |
252 | 260 | else { | |
253 | 261 | func balancesSUM (outOfMarketSupply,nextAddress) = ((outOfMarketSupply + valueOrElse(getInteger(usdnStakingContract, rpdUserBalanceKey(nextAddress, neutrinoAssetIdStr)), 0)) + assetBalance(addressFromStringValue(nextAddress), neutrinoAssetId)) | |
254 | 262 | ||
255 | 263 | let $l = split(outOfMarketAddressList, SEP) | |
256 | 264 | let $s = size($l) | |
257 | 265 | let $acc0 = 0 | |
258 | 266 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
259 | 267 | then $a | |
260 | 268 | else balancesSUM($a, $l[$i]) | |
261 | 269 | ||
262 | 270 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
263 | 271 | then $a | |
264 | 272 | else throw("List size exceeds 7") | |
265 | 273 | ||
266 | 274 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7) | |
267 | 275 | } | |
268 | 276 | } | |
269 | 277 | ||
270 | 278 | ||
271 | 279 | func readCurrentAvgPeg () = asPriceSTRUCT(invoke(pegProviderContract, "price", [4], nil))._2 | |
272 | 280 | ||
273 | 281 | ||
274 | 282 | func adjustPrice (priceX6,usdnUsdtPegX6) = { | |
275 | 283 | let minCoeffX6 = valueOrElse(getInteger(this, keyPriceAdjMinCoeff()), 600000) | |
276 | 284 | let arbRegulatorX6 = valueOrElse(getInteger(this, keyPriceAdjArbRegulator()), 150000) | |
277 | 285 | let maxPriceCoeffX6 = max([minCoeffX6, fraction((MULT6 + arbRegulatorX6), usdnUsdtPegX6, MULT6)]) | |
278 | 286 | let priceCoeffX6 = min([maxPriceCoeffX6, MULT6]) | |
279 | 287 | fraction(priceX6, MULT6, priceCoeffX6) | |
280 | 288 | } | |
281 | 289 | ||
282 | 290 | ||
283 | 291 | let currentPrice = getIntegerValue(controlContract, keyPrice()) | |
284 | 292 | ||
285 | 293 | let usdnUsdtPegX6 = readCurrentAvgPeg() | |
286 | 294 | ||
287 | 295 | let currentPriceAdj = adjustPrice(currentPrice, usdnUsdtPegX6) | |
288 | 296 | ||
289 | 297 | let neutrinoLockedBalance = valueOrElse(getInteger(neutrinoContract, keyNeutrinoLockedBalance()), 0) | |
290 | 298 | ||
291 | 299 | let wavesLockedBalance = valueOrElse(getInteger(neutrinoContract, keyWavesLockedBalance()), 0) | |
292 | 300 | ||
293 | 301 | let reserve = (wavesBalance(neutrinoContract).regular - wavesLockedBalance) | |
294 | 302 | ||
295 | 303 | let reservesInUsdn = convertWavesToNeutrino(reserve, currentPriceAdj) | |
296 | 304 | ||
297 | 305 | let neutrinoOutOfMarketSupply = calcUsdnOutOfMarketSupply() | |
298 | 306 | ||
299 | 307 | let neutrinoTotalSupply = (((neutrinoLockedBalance + value(assetInfo(neutrinoAssetId)).quantity) - assetBalance(neutrinoContract, neutrinoAssetId)) - assetBalance(liquidationContract, neutrinoAssetId)) | |
300 | 308 | ||
301 | 309 | let neutrinoSupply = (neutrinoTotalSupply - neutrinoOutOfMarketSupply) | |
302 | 310 | ||
303 | 311 | let BR = if ((neutrinoSupply == 0)) | |
304 | 312 | then 0 | |
305 | 313 | else fraction(reservesInUsdn, MULT6, neutrinoSupply) | |
306 | 314 | ||
315 | + | func getBasketInfo () = { | |
316 | + | let basketAssets = valueOrElse(getString(neutrinoContract, basketAssetsKey()), "WAVES") | |
317 | + | let basket = split(basketAssets, SEP) | |
318 | + | func weightCalc (acc,assetId) = { | |
319 | + | let tempAssetId = fromBase58String(assetId) | |
320 | + | let vol = if ((tempAssetId == WAVESID)) | |
321 | + | then reserve | |
322 | + | else assetBalance(neutrinoContract, tempAssetId) | |
323 | + | let pr = valueOrElse(getInteger(controlContract, keyPriceByAsset(assetId)), MULT6) | |
324 | + | let resU = fraction(vol, pr, MULT8) | |
325 | + | $Tuple2((acc._1 :+ $Tuple4(assetId, vol, resU, pr)), (acc._2 + resU)) | |
326 | + | } | |
327 | + | ||
328 | + | let t = { | |
329 | + | let $l = basket | |
330 | + | let $s = size($l) | |
331 | + | let $acc0 = $Tuple2(nil, 0) | |
332 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
333 | + | then $a | |
334 | + | else weightCalc($a, $l[$i]) | |
335 | + | ||
336 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
337 | + | then $a | |
338 | + | else throw("List size exceeds 10") | |
339 | + | ||
340 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
341 | + | } | |
342 | + | func combine (acc,item) = { | |
343 | + | let share = if ((t._2 == 0)) | |
344 | + | then MULT6 | |
345 | + | else fraction(item._3, MULT6, t._2) | |
346 | + | (acc :+ makeString([item._1, toString(share), toString(item._4), toString(item._2)], ":")) | |
347 | + | } | |
348 | + | ||
349 | + | let weightedPrice = if ((neutrinoSupply == 0)) | |
350 | + | then 0 | |
351 | + | else fraction(t._2, MULT6, neutrinoSupply) | |
352 | + | $Tuple3(makeString({ | |
353 | + | let $l = t._1 | |
354 | + | let $s = size($l) | |
355 | + | let $acc0 = nil | |
356 | + | func $f1_1 ($a,$i) = if (($i >= $s)) | |
357 | + | then $a | |
358 | + | else combine($a, $l[$i]) | |
359 | + | ||
360 | + | func $f1_2 ($a,$i) = if (($i >= $s)) | |
361 | + | then $a | |
362 | + | else throw("List size exceeds 10") | |
363 | + | ||
364 | + | $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
365 | + | }, "_"), weightedPrice, t._2) | |
366 | + | } | |
367 | + | ||
368 | + | ||
307 | 369 | @Callable(i) | |
308 | - | func | |
370 | + | func constructorV1 (neutrinoAddress,nsbtLockAddress,swapAmountAParam) = if ((i.caller != this)) | |
309 | 371 | then throw("not authorized") | |
310 | 372 | else [StringEntry(keyNeutrinoAddress(), neutrinoAddress), IntegerEntry(keySwapAmountAParam(), swapAmountAParam)] | |
311 | 373 | ||
312 | 374 | ||
313 | 375 | ||
314 | 376 | @Callable(i) | |
315 | 377 | func calcSwapLimitREADONLY (gNsbtAmount) = { | |
316 | 378 | let limitWavesInUsdn = if ((0 >= gNsbtAmount)) | |
317 | 379 | then 0 | |
318 | 380 | else { | |
319 | 381 | let aParamX8 = toBigInt(getIntOrFail(this, keySwapAmountAParam())) | |
320 | 382 | let bParamX16 = toBigInt(getIntOrFail(this, keySwapAmountBParam())) | |
321 | 383 | let powPartX8 = pow(toBigInt(gNsbtAmount), 6, bParamX16, 16, 8, CEILING) | |
322 | 384 | toInt(fraction(aParamX8, powPartX8, MULTX10)) | |
323 | 385 | } | |
324 | 386 | let limitWaves = convertNeutrinoToWaves(limitWavesInUsdn, currentPrice) | |
325 | 387 | let limitUsdn = if ((0 >= gNsbtAmount)) | |
326 | 388 | then 0 | |
327 | 389 | else { | |
328 | 390 | let aParamX8 = toBigInt(getIntOrFail(this, keyUsdnSwapAmountAParam())) | |
329 | 391 | let bParamX16 = toBigInt(getIntOrFail(this, keyUsdnSwapAmountBParam())) | |
330 | 392 | let brX6 = toBigInt(BR) | |
331 | 393 | let powPartX8 = pow(toBigInt(gNsbtAmount), 6, bParamX16, 16, 8, CEILING) | |
332 | 394 | toInt(fraction(fraction(aParamX8, powPartX8, MULTX10), brX6, MULTX6)) | |
333 | 395 | } | |
334 | 396 | $Tuple2(nil, [limitWavesInUsdn, limitWaves, limitUsdn]) | |
335 | 397 | } | |
336 | 398 | ||
337 | 399 | ||
338 | 400 | ||
339 | 401 | @Callable(i) | |
340 | 402 | func calculateKREADONLY (wRaw,uRaw,price,mRaw,sRaw) = { | |
341 | 403 | let EXP = toBigInt(2718281) | |
342 | 404 | let EXPSCALE = 6 | |
343 | 405 | let a = valueOrElse(getInteger(auctionContract, "nsbtCurveParam_a"), 3) | |
344 | 406 | let paulB = valueOrElse(getInteger(auctionContract, "nsbtCurveParam_b"), ((3 * MULT6) / 10)) | |
345 | 407 | let wReservesInUsdn = convertWavesToNeutrino(wRaw, price) | |
346 | 408 | let multBR = fraction(wReservesInUsdn, MULT8, uRaw) | |
347 | 409 | if ((multBR > 10678564816)) | |
348 | 410 | then throw((("BR=" + toString(multBR)) + " > 10678.564816% will overflow exponent")) | |
349 | 411 | else { | |
350 | 412 | let multPower = (a * (multBR - MULT8)) | |
351 | 413 | let multExpInPower = pow(EXP, EXPSCALE, toBigInt(multPower), MULTSCALE, SCALE16, DOWN) | |
352 | 414 | let multK = fraction(toBigInt(paulB), multExpInPower, MULTX6) | |
353 | 415 | $Tuple2(nil, [a, paulB, wReservesInUsdn, multBR, multPower, toString(multExpInPower), toString(multK)]) | |
354 | 416 | } | |
355 | 417 | } | |
356 | 418 | ||
357 | 419 | ||
358 | 420 | ||
359 | 421 | @Callable(i) | |
360 | 422 | func curveFunctionREADONLY (wavesPayRaw) = { | |
361 | 423 | let neutrinoMetrics = asAnyList(invoke(this, "calcNeutinoMetricsREADONLY", nil, nil)) | |
362 | 424 | let price = asInt(neutrinoMetrics[nMetricIdxPrice]) | |
363 | 425 | let wRaw = asInt(neutrinoMetrics[nMetricIdxReserve]) | |
364 | 426 | let uRaw = asInt(neutrinoMetrics[nMetricIdxUsdnSupply]) | |
365 | 427 | let sRaw = asInt(neutrinoMetrics[nMetricIdxNsbtSupply]) | |
366 | 428 | let mRaw = asInt(neutrinoMetrics[nMetricIdxMaxNsbtSupply]) | |
367 | 429 | let kCalcArray = asAnyList(invoke(this, "calculateKREADONLY", [wRaw, uRaw, price, mRaw, sRaw], nil)) | |
368 | 430 | let multK = parseBigIntValue(asString(kCalcArray[kResultIdxMultKStr])) | |
369 | 431 | let usdnPay = convertWavesToNeutrino(wavesPayRaw, price) | |
370 | 432 | let bigMaxNsbtSupply = toBigInt(mRaw) | |
371 | 433 | let bigNsbtSupply = toBigInt((mRaw - sRaw)) | |
372 | 434 | let step1 = fraction(toBigInt(usdnPay), MULTX16, multK) | |
373 | 435 | let step2 = fraction(step1, bigNsbtSupply, bigMaxNsbtSupply) | |
374 | 436 | let step3 = toInt(fraction(bigNsbtSupply, bigMaxNsbtSupply, (step2 + bigMaxNsbtSupply))) | |
375 | 437 | let nsbtAmountRaw = ((mRaw - sRaw) - step3) | |
376 | 438 | $Tuple2(nil, [nsbtAmountRaw, usdnPay, wRaw, uRaw, mRaw, sRaw, asInt(kCalcArray[kResultIdxA]), asInt(kCalcArray[kResultIdxPaulB]), asInt(kCalcArray[kResultIdxWReservesInUsdn]), price, asInt(kCalcArray[kResultIdxMultBR]), asInt(kCalcArray[kResultIdxMultPower]), kCalcArray[kResultIdxMultExpInPowerStr], kCalcArray[kResultIdxMultKStr], toString(step1), toString(step2), step3]) | |
377 | 439 | } | |
378 | 440 | ||
379 | 441 | ||
380 | 442 | ||
381 | 443 | @Callable(i) | |
382 | 444 | func surfFunctionREADONLY (amount,assetId) = if ((0 > amount)) | |
383 | 445 | then throw("amount should be positive") | |
384 | 446 | else { | |
385 | 447 | let price = currentPrice | |
386 | 448 | let priceBig = toBigInt(price) | |
387 | 449 | let reserveBig = toBigInt(reserve) | |
388 | 450 | let supply = neutrinoSupply | |
389 | 451 | let supplyBig = toBigInt(supply) | |
390 | 452 | if ((BR >= MULT6)) | |
391 | 453 | then throw((("BR = " + toString(BR)) + ", cannot buy SURF")) | |
392 | 454 | else { | |
393 | 455 | let maxWavesPay = (fraction(supply, MULT8, price) - reserve) | |
394 | 456 | let maxUsdnPay = (supply - fraction(reserve, price, MULT8)) | |
395 | 457 | let useAmount = if ((assetId == neutrinoAssetId)) | |
396 | 458 | then if ((amount > maxUsdnPay)) | |
397 | 459 | then maxUsdnPay | |
398 | 460 | else amount | |
399 | 461 | else if ((assetId == WAVESID)) | |
400 | 462 | then if ((amount > maxWavesPay)) | |
401 | 463 | then maxWavesPay | |
402 | 464 | else amount | |
403 | 465 | else 0 | |
404 | 466 | let amountBig = toBigInt(useAmount) | |
405 | 467 | if ((assetId == neutrinoAssetId)) | |
406 | 468 | then $Tuple2(nil, [toInt(fraction(fraction(amountBig, MULTX8, priceBig), (supplyBig - (amountBig / TWOX)), reserveBig)), 0, useAmount, reserve, supply, BR, reserve, (supply - useAmount), fraction(convertWavesToNeutrino(reserve, price), MULT6, (supply - useAmount)), (amount - useAmount), price]) | |
407 | 469 | else if ((assetId == WAVESID)) | |
408 | 470 | then $Tuple2(nil, [toInt(fraction(supplyBig, log(fraction((reserveBig + amountBig), MULTX16, reserveBig), 16, EULERX16, 16, 16, HALFUP), MULTX16)), useAmount, 0, reserve, supply, BR, (reserve + useAmount), supply, fraction(convertWavesToNeutrino((reserve + useAmount), price), MULT6, supply), (amount - useAmount), price]) | |
409 | 471 | else throw("Unsupported asset") | |
410 | 472 | } | |
411 | 473 | } | |
412 | 474 | ||
413 | 475 | ||
414 | 476 | ||
415 | 477 | @Callable(i) | |
416 | 478 | func calcContractNsbtPriceSYSREADONLY (nsbtSupplyDELTA) = { | |
417 | 479 | let neutrinoMetrics = asAnyList(invoke(this, "calcNeutinoMetricsREADONLY", nil, nil)) | |
418 | 480 | let price = asInt(neutrinoMetrics[nMetricIdxPrice]) | |
419 | 481 | let wRaw = asInt(neutrinoMetrics[nMetricIdxReserve]) | |
420 | 482 | let uRaw = (asInt(neutrinoMetrics[nMetricIdxUsdnSupply]) - nsbtSupplyDELTA) | |
421 | 483 | let sRaw = (asInt(neutrinoMetrics[nMetricIdxNsbtSupply]) + nsbtSupplyDELTA) | |
422 | 484 | let mRaw = asInt(neutrinoMetrics[nMetricIdxMaxNsbtSupply]) | |
423 | 485 | let kCalcArray = asAnyList(invoke(this, "calculateKREADONLY", [wRaw, uRaw, price, mRaw, sRaw], nil)) | |
424 | 486 | let multKX16 = parseBigIntValue(asString(kCalcArray[kResultIdxMultKStr])) | |
425 | 487 | let multStep1X16 = fraction(toBigInt(mRaw), MULTX16, toBigInt((mRaw - sRaw))) | |
426 | 488 | let multStep2X16 = fraction(multStep1X16, multStep1X16, MULTX16) | |
427 | 489 | let multNsbt2usdnPriceX16 = fraction(multKX16, multStep2X16, MULTX16) | |
428 | 490 | let nsbt2usdnPrice = toInt(fraction(multNsbt2usdnPriceX16, toBigInt(MULT6), MULTX16)) | |
429 | 491 | let nsbt2wavesPrice = fraction(nsbt2usdnPrice, MULT6, price) | |
430 | 492 | $Tuple2(nil, [nsbt2usdnPrice, nsbt2wavesPrice]) | |
431 | 493 | } | |
432 | 494 | ||
433 | 495 | ||
434 | 496 | ||
435 | 497 | @Callable(i) | |
436 | 498 | func calcNeutinoMetricsREADONLY () = { | |
437 | 499 | let nsbtSupplyMAX = value(assetInfo(nsbtAssetId)).quantity | |
438 | 500 | let nsbtSupply = (nsbtSupplyMAX - assetBalance(auctionContract, nsbtAssetId)) | |
439 | 501 | let surfSupply = value(assetInfo(surfAssetId)).quantity | |
440 | - | $Tuple2(nil, [currentPrice, neutrinoLockedBalance, wavesLockedBalance, reserve, reservesInUsdn, neutrinoSupply, neutrinoOutOfMarketSupply, neutrinoTotalSupply, BR, nsbtSupply, nsbtSupplyMAX, surfSupply, usdnUsdtPegX6, currentPriceAdj]) | |
502 | + | let basketInfo = getBasketInfo() | |
503 | + | $Tuple2(nil, [currentPrice, neutrinoLockedBalance, wavesLockedBalance, reserve, reservesInUsdn, neutrinoSupply, neutrinoOutOfMarketSupply, neutrinoTotalSupply, BR, nsbtSupply, nsbtSupplyMAX, surfSupply, usdnUsdtPegX6, currentPriceAdj, basketInfo._1, basketInfo._2, basketInfo._3]) | |
441 | 504 | } | |
442 | 505 | ||
443 | 506 | ||
444 | 507 | ||
445 | 508 | @Callable(i) | |
446 | 509 | func getUnstakeComissionAmountREADONLY (amount,startHeight,halfLife) = $Tuple2(nil, fraction(amount, pow(2, 0, fraction(-((height - startHeight)), MULT8, halfLife), 8, 8, HALFUP), MULT8)) | |
447 | 510 | ||
448 | 511 | ||
449 | 512 | ||
450 | 513 | @Callable(i) | |
451 | 514 | func mergeStakesREADONLY (amount1,height1,amount2,height2,halfLife) = { | |
452 | 515 | let w = fraction(amount2, pow(2, 0, fraction((height2 - height1), MULT8, halfLife), 8, 8, HALFUP), MULT8) | |
453 | 516 | let v = fraction((amount1 + amount2), MULT8, (amount1 + w)) | |
454 | 517 | $Tuple2(nil, (height1 + ((HALF8 - (halfLife * log(v, 8, 2, 0, 8, HALFUP))) / MULT8))) | |
455 | 518 | } | |
456 | 519 | ||
457 | 520 | ||
458 | 521 | @Verifier(tx) | |
459 | 522 | func verify () = { | |
460 | 523 | let pubKeyAdminsListStr = makeString(["ExtEEK19nmKj9mCpnWyvEEJFYATLMcVEMvohhUHkyHNm", "Ev5py5FfBQX9cZpYKnfQrTB49Byf8QmpZWeDVRim4yV7", "DUuuLjXu98nBwZc7fqwCTjtA3nnRwgTbkMSr5SU2NmDR", "DUuuLjXu98nBwZc7fqwCTjtA3nnRwgTbkMSr5SU2NmDR"], SEP) | |
461 | 524 | let pubKeyAdminsList = split(valueOrElse(getString(controlContract, "%s__multisig"), pubKeyAdminsListStr), SEP) | |
462 | 525 | let count = ((((if (sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(pubKeyAdminsList[0]))) | |
463 | 526 | then 1 | |
464 | 527 | else 0) + (if (sigVerify(tx.bodyBytes, tx.proofs[1], fromBase58String(pubKeyAdminsList[1]))) | |
465 | 528 | then 1 | |
466 | 529 | else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[2], fromBase58String(pubKeyAdminsList[2]))) | |
467 | 530 | then 1 | |
468 | 531 | else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[3], fromBase58String(pubKeyAdminsList[3]))) | |
469 | 532 | then 2 | |
470 | 533 | else 0)) | |
471 | 534 | (count >= 3) | |
472 | 535 | } | |
473 | 536 |
github/deemru/w8io/169f3d6 92.41 ms ◑