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