tx · ACrKzQCW7PBnqiFodpeh1qCEn4x7mGxBPSwLqk4DWVD1 3MuAyo3UDyRW1uGJYpgNwKJx4rGPEQdHetK: -0.02000000 Waves 2022.02.24 18:55 [1937942] smart account 3MuAyo3UDyRW1uGJYpgNwKJx4rGPEQdHetK > SELF 0.00000000 Waves
{ "type": 13, "id": "ACrKzQCW7PBnqiFodpeh1qCEn4x7mGxBPSwLqk4DWVD1", "fee": 2000000, "feeAssetId": null, "timestamp": 1645718198511, "version": 1, "sender": "3MuAyo3UDyRW1uGJYpgNwKJx4rGPEQdHetK", "senderPublicKey": "8JFUsgTkU5xXsm3gJYTdzsJwYfzBYbZsW7bgR1SYLmas", "proofs": [ "537CamsAzN19st9QwngMA9v6Lfux2HkqBa9nmGV8nJuw1QFHvEF3UXj2XnTavbBjrw3jXiAfCNnwb5xbuPb94fo7" ], "script": "base64:AAIFAAAAAAAAADgIAhIFCgMICAESAwoBARIHCgUBAQEBARIICgYBAQEBAQESABIDCgEIEgASBAoCAQESBgoEAQEBAQAAADgAAAAAB1dBVkVMRVQAAAAAAAX14QAAAAAABVBBVUxJAAAAAAAAD0JAAAAAAAhCSUdQQVVMSQkAATYAAAABAAAAAAAAD0JAAAAAAAhQUklDRUxFVAAAAAAAAA9CQAAAAAAETVVMVAAAAAAABfXhAAAAAAAJQklHTVVMVDE2CQABNgAAAAEAACOG8m/BAAAAAAAACU1VTFRTQ0FMRQAAAAAAAAAACAAAAAAHU0NBTEUxNgAAAAAAAAAAEAAAAAADU0VQAgAAAAJfXwAAAAAFSEFMRjgAAAAAAAL68IAAAAAAC0VVTEVSTlVNQkVSAAAAAAAQM8TWAAAAAAZzY2FsZTYAAAAAAAAPQkAAAAAADHNjYWxlNkJpZ0ludAkAATYAAAABAAAAAAAAD0JAAAAAAAxzY2FsZThCaWdJbnQJAAE2AAAAAQAAAAAABfXhAAEAAAASa2V5TmV1dHJpbm9BZGRyZXNzAAAAAAIAAAAdJXMlc19fY29uZmlnX19uZXV0cmlub0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AAAAAAAAAAAIBQAAAAZIQUxGVVAFAAAABE1VTFQAAAABaQEAAAAPbWVyZ2VTdGFrZXNNQVRIAAAABAAAAAdhbW91bnQxAAAAB2hlaWdodDEAAAAHYW1vdW50MgAAAAdoZWlnaHQyBAAAAAhoYWxmTGlmZQkBAAAADGdldEludE9yRmFpbAAAAAIFAAAAE25zYnRTdGFraW5nQ29udHJhY3QJAQAAAAtrZXlIYWxmTGlmZQAAAAAEAAAAAXcJAABrAAAAAwUAAAAHYW1vdW50MgkAAGwAAAAGAAAAAAAAAAACAAAAAAAAAAAACQAAawAAAAMJAABlAAAAAgUAAAAHaGVpZ2h0MgUAAAAHaGVpZ2h0MQUAAAAETVVMVAUAAAAIaGFsZkxpZmUAAAAAAAAAAAgAAAAAAAAAAAgFAAAABkhBTEZVUAUAAAAETVVMVAQAAAABdgkAAGsAAAADCQAAZAAAAAIFAAAAB2Ftb3VudDEFAAAAB2Ftb3VudDIFAAAABE1VTFQJAABkAAAAAgUAAAAHYW1vdW50MQUAAAABdwkABRQAAAACBQAAAANuaWwJAABkAAAAAgUAAAAHaGVpZ2h0MQkAAGkAAAACCQAAZQAAAAIFAAAABUhBTEY4CQAAaAAAAAIFAAAACGhhbGZMaWZlCQAAbQAAAAYFAAAAAXYAAAAAAAAAAAgAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAgFAAAABkhBTEZVUAUAAAAETVVMVAAAAADE+/bf", "chainId": 84, "height": 1937942, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HqADTGxJGACF4dqaSCq12uVTgKQ3Y2xdfeaFQ2H4wWLf Next: Fed8HpsMqR681T6aWP4qFvtMbb5SRAF96rLDQoYn9gtU Diff:
Old | New | Differences | |
---|---|---|---|
192 | 192 | let multPower = (a * (multBR - MULT)) | |
193 | 193 | let multExpInPower = pow(EXP, EXPSCALE, toBigInt(multPower), MULTSCALE, SCALE16, DOWN) | |
194 | 194 | let multK = fraction(toBigInt(paulB), multExpInPower, BIGPAULI) | |
195 | - | $Tuple2(nil, | |
195 | + | $Tuple2(nil, [a, paulB, wReservesInUsdn, multBR, multPower, toString(multExpInPower), toString(multK)]) | |
196 | 196 | } | |
197 | 197 | } | |
198 | 198 | ||
211 | 211 | let step2 = fraction(step1, bigNsbtSupply, bigMaxNsbtSupply) | |
212 | 212 | let step3 = toInt(fraction(bigNsbtSupply, bigMaxNsbtSupply, (step2 + bigMaxNsbtSupply))) | |
213 | 213 | let nsbtAmountRaw = ((mRaw - sRaw) - step3) | |
214 | - | $Tuple2(nil, | |
214 | + | $Tuple2(nil, [nsbtAmountRaw, usdnPay, wRaw, uRaw, mRaw, sRaw, asInt(kCalcArray[1]), asInt(kCalcArray[2]), asInt(kCalcArray[3]), asInt(price), asInt(kCalcArray[4]), asInt(kCalcArray[5]), kCalcArray[6], kCalcArray[7], toString(step1), toString(step2), toString(step3)]) | |
215 | 215 | } | |
216 | 216 | else throw("Strict value is not equal to itself.") | |
217 | 217 | } | |
236 | 236 | let multNsbt2usdnPrice = fraction(mK, multStep2, MULT) | |
237 | 237 | let nsbt2usdnPrice = fraction(multNsbt2usdnPrice, PAULI, MULT) | |
238 | 238 | let nsbt2wavesPrice = fraction(nsbt2usdnPrice, PAULI, currentPrice) | |
239 | - | $Tuple2(nil, | |
239 | + | $Tuple2(nil, [nsbt2usdnPrice, nsbt2wavesPrice]) | |
240 | 240 | } | |
241 | 241 | else throw("Strict value is not equal to itself.") | |
242 | 242 | } | |
257 | 257 | let quickSwapUserSpent = if (isNewQuickSwapPeriod) | |
258 | 258 | then 0 | |
259 | 259 | else valueOrElse(getInteger(neutrinoContract, keyQuickSwapUserSpentInPeriod(userAddressStr)), 0) | |
260 | - | $Tuple2(nil, | |
260 | + | $Tuple2(nil, [usdnLmtMax, quickSwapUserSpent]) | |
261 | 261 | } | |
262 | 262 | else throw("Strict value is not equal to itself.") | |
263 | 263 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let WAVELET = 100000000 | |
5 | 5 | ||
6 | 6 | let PAULI = 1000000 | |
7 | 7 | ||
8 | 8 | let BIGPAULI = toBigInt(1000000) | |
9 | 9 | ||
10 | 10 | let PRICELET = 1000000 | |
11 | 11 | ||
12 | 12 | let MULT = 100000000 | |
13 | 13 | ||
14 | 14 | let BIGMULT16 = toBigInt(10000000000000000) | |
15 | 15 | ||
16 | 16 | let MULTSCALE = 8 | |
17 | 17 | ||
18 | 18 | let SCALE16 = 16 | |
19 | 19 | ||
20 | 20 | let SEP = "__" | |
21 | 21 | ||
22 | 22 | let HALF8 = 50000000 | |
23 | 23 | ||
24 | 24 | let EULERNUMBER = 271828182 | |
25 | 25 | ||
26 | 26 | let scale6 = 1000000 | |
27 | 27 | ||
28 | 28 | let scale6BigInt = toBigInt(1000000) | |
29 | 29 | ||
30 | 30 | let scale8BigInt = toBigInt(100000000) | |
31 | 31 | ||
32 | 32 | func keyNeutrinoAddress () = "%s%s__config__neutrinoAddress" | |
33 | 33 | ||
34 | 34 | ||
35 | 35 | func keySwapAmountAParam () = "%s%s__config__swapAParam" | |
36 | 36 | ||
37 | 37 | ||
38 | 38 | func keyNeutrinoAssetId () = "neutrino_asset_id" | |
39 | 39 | ||
40 | 40 | ||
41 | 41 | func keyLiquidationContractAddress () = "liquidation_contract" | |
42 | 42 | ||
43 | 43 | ||
44 | 44 | func keyRPDContract () = "rpd_contract" | |
45 | 45 | ||
46 | 46 | ||
47 | 47 | func keyAuctionContract () = "auction_contract" | |
48 | 48 | ||
49 | 49 | ||
50 | 50 | func keyContolContract () = "control_contract" | |
51 | 51 | ||
52 | 52 | ||
53 | 53 | func keyBondAssetId () = "bond_asset_id" | |
54 | 54 | ||
55 | 55 | ||
56 | 56 | func keyBalanceLocked () = "balance_lock_" | |
57 | 57 | ||
58 | 58 | ||
59 | 59 | func keyWavesLockedBalance () = (keyBalanceLocked() + "waves") | |
60 | 60 | ||
61 | 61 | ||
62 | 62 | func keyNeutrinoLockedBalance () = (keyBalanceLocked() + "neutrino") | |
63 | 63 | ||
64 | 64 | ||
65 | 65 | func keyMinWavesSwapAmount () = "min_waves_swap_amount" | |
66 | 66 | ||
67 | 67 | ||
68 | 68 | func keyMinNeutrinoSwapAmount () = "min_neutrino_swap_amount" | |
69 | 69 | ||
70 | 70 | ||
71 | 71 | func keyWavesOutFeePart () = "wavesOut_swap_feePart" | |
72 | 72 | ||
73 | 73 | ||
74 | 74 | func keyNeutrinoOutFeePart () = "neutrinoOut_swap_feePart" | |
75 | 75 | ||
76 | 76 | ||
77 | 77 | func keyNsbtLockContract () = "%s__nsbtLockContract" | |
78 | 78 | ||
79 | 79 | ||
80 | 80 | func keyQuickSwapLimitDuration () = "%s__quickSwapLimitDuration" | |
81 | 81 | ||
82 | 82 | ||
83 | 83 | func keyUserLastQuickSwapHeight (userAddress) = makeString(["%s%s", "userLastQuickSwapHeight", userAddress], SEP) | |
84 | 84 | ||
85 | 85 | ||
86 | 86 | func keyQuickSwapUserSpentInPeriod (userAddress) = makeString(["%s%s", "quickSwapUserSpentInPeriod", userAddress], SEP) | |
87 | 87 | ||
88 | 88 | ||
89 | 89 | func keyPrice () = "price" | |
90 | 90 | ||
91 | 91 | ||
92 | 92 | func keyHalfLife () = "%s__halfLife" | |
93 | 93 | ||
94 | 94 | ||
95 | 95 | func keyLockParamUserAmount (userAddress) = makeString(["%s%s%s", "paramByUser", userAddress, "amount"], SEP) | |
96 | 96 | ||
97 | 97 | ||
98 | 98 | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
99 | 99 | ||
100 | 100 | ||
101 | 101 | func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
102 | 102 | ||
103 | 103 | ||
104 | 104 | func getBoolOrFail (address,key) = valueOrErrorMessage(getBoolean(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
105 | 105 | ||
106 | 106 | ||
107 | 107 | func convertNeutrinoToWaves (amount,price) = fraction(fraction(amount, PRICELET, price), WAVELET, PAULI) | |
108 | 108 | ||
109 | 109 | ||
110 | 110 | func convertWavesToNeutrino (amount,price) = fraction(fraction(amount, price, PRICELET), PAULI, WAVELET) | |
111 | 111 | ||
112 | 112 | ||
113 | 113 | func toX16 (origVal,origScaleMult) = fraction(toBigInt(origVal), BIGMULT16, toBigInt(origScaleMult)) | |
114 | 114 | ||
115 | 115 | ||
116 | 116 | func fromX16 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), BIGMULT16)) | |
117 | 117 | ||
118 | 118 | ||
119 | 119 | func asAnyList (val) = match val { | |
120 | 120 | case valAnyLyst: List[Any] => | |
121 | 121 | valAnyLyst | |
122 | 122 | case _ => | |
123 | 123 | throw("fail to cast into List[Any]") | |
124 | 124 | } | |
125 | 125 | ||
126 | 126 | ||
127 | 127 | func asInt (val) = match val { | |
128 | 128 | case valInt: Int => | |
129 | 129 | valInt | |
130 | 130 | case _ => | |
131 | 131 | throw("fail to cast into Int") | |
132 | 132 | } | |
133 | 133 | ||
134 | 134 | ||
135 | 135 | func asString (val) = match val { | |
136 | 136 | case valStr: String => | |
137 | 137 | valStr | |
138 | 138 | case _ => | |
139 | 139 | throw("fail to cast into String") | |
140 | 140 | } | |
141 | 141 | ||
142 | 142 | ||
143 | 143 | let neutrinoContract = addressFromStringValue(getStringOrFail(this, keyNeutrinoAddress())) | |
144 | 144 | ||
145 | 145 | let controlContract = addressFromStringValue(getStringOrFail(neutrinoContract, keyContolContract())) | |
146 | 146 | ||
147 | 147 | let auctionContract = addressFromStringValue(getStringOrFail(neutrinoContract, keyAuctionContract())) | |
148 | 148 | ||
149 | 149 | let liquidationContract = getStringOrFail(neutrinoContract, keyLiquidationContractAddress()) | |
150 | 150 | ||
151 | 151 | let rpdContract = getStringOrFail(neutrinoContract, keyRPDContract()) | |
152 | 152 | ||
153 | 153 | let nsbtStakingContract = addressFromStringValue(getStringOrFail(this, keyNsbtLockContract())) | |
154 | 154 | ||
155 | 155 | let neutrinoAssetIdString = getStringOrFail(neutrinoContract, keyNeutrinoAssetId()) | |
156 | 156 | ||
157 | 157 | let neutrinoAssetId = fromBase58String(neutrinoAssetIdString) | |
158 | 158 | ||
159 | 159 | let nsbtAssetIdStr = getStringValue(neutrinoContract, keyBondAssetId()) | |
160 | 160 | ||
161 | 161 | let nsbtAssetId = fromBase58String(nsbtAssetIdStr) | |
162 | 162 | ||
163 | 163 | @Callable(i) | |
164 | 164 | func constructor (neutrinoAddress,nsbtLockAddress,swapAmountAParam) = if ((i.caller != this)) | |
165 | 165 | then throw("not authorized") | |
166 | 166 | else [StringEntry(keyNeutrinoAddress(), neutrinoAddress), StringEntry(keyNsbtLockContract(), nsbtLockAddress), IntegerEntry(keySwapAmountAParam(), swapAmountAParam)] | |
167 | 167 | ||
168 | 168 | ||
169 | 169 | ||
170 | 170 | @Callable(i) | |
171 | 171 | func calcSwapLimitMATH (gNsbtAmount) = { | |
172 | 172 | let usdnSwapDelayDuration = valueOrErrorMessage(getIntegerValue(this, keySwapAmountAParam()), "Swap parameter A missed.") | |
173 | 173 | let gNsbtAmountBigInt = toBigInt(gNsbtAmount) | |
174 | 174 | let limitPowPart = pow(gNsbtAmountBigInt, 0, toBigInt(EULERNUMBER), 8, 0, DOWN) | |
175 | 175 | let limit = fraction(toBigInt(usdnSwapDelayDuration), limitPowPart, scale8BigInt) | |
176 | 176 | $Tuple2(nil, limit) | |
177 | 177 | } | |
178 | 178 | ||
179 | 179 | ||
180 | 180 | ||
181 | 181 | @Callable(i) | |
182 | 182 | func calculateKMATH (wRaw,uRaw,price,mRaw,sRaw) = { | |
183 | 183 | let EXP = toBigInt(2718281) | |
184 | 184 | let EXPSCALE = 6 | |
185 | 185 | let a = valueOrElse(getInteger(auctionContract, "nsbtCurveParam_a"), 3) | |
186 | 186 | let paulB = valueOrElse(getInteger(auctionContract, "nsbtCurveParam_b"), ((3 * PAULI) / 10)) | |
187 | 187 | let wReservesInUsdn = convertWavesToNeutrino(wRaw, price) | |
188 | 188 | let multBR = fraction(wReservesInUsdn, MULT, uRaw) | |
189 | 189 | if ((multBR > 10678564816)) | |
190 | 190 | then throw("BR > 10678.564816% will overflow exponent") | |
191 | 191 | else { | |
192 | 192 | let multPower = (a * (multBR - MULT)) | |
193 | 193 | let multExpInPower = pow(EXP, EXPSCALE, toBigInt(multPower), MULTSCALE, SCALE16, DOWN) | |
194 | 194 | let multK = fraction(toBigInt(paulB), multExpInPower, BIGPAULI) | |
195 | - | $Tuple2(nil, | |
195 | + | $Tuple2(nil, [a, paulB, wReservesInUsdn, multBR, multPower, toString(multExpInPower), toString(multK)]) | |
196 | 196 | } | |
197 | 197 | } | |
198 | 198 | ||
199 | 199 | ||
200 | 200 | ||
201 | 201 | @Callable(i) | |
202 | 202 | func curveFunctionMATH (wRaw,uRaw,price,mRaw,sRaw,wavesPayRaw) = { | |
203 | 203 | let kCalcArray = asAnyList(invoke(this, "calculateKMATH", [wRaw, uRaw, price, mRaw, sRaw], nil)) | |
204 | 204 | if ((kCalcArray == kCalcArray)) | |
205 | 205 | then { | |
206 | 206 | let multK = parseBigIntValue(asString(kCalcArray[7])) | |
207 | 207 | let usdnPay = convertWavesToNeutrino(wavesPayRaw, price) | |
208 | 208 | let bigMaxNsbtSupply = toBigInt(mRaw) | |
209 | 209 | let bigNsbtSupply = toBigInt((mRaw - sRaw)) | |
210 | 210 | let step1 = fraction(toBigInt(usdnPay), BIGMULT16, multK) | |
211 | 211 | let step2 = fraction(step1, bigNsbtSupply, bigMaxNsbtSupply) | |
212 | 212 | let step3 = toInt(fraction(bigNsbtSupply, bigMaxNsbtSupply, (step2 + bigMaxNsbtSupply))) | |
213 | 213 | let nsbtAmountRaw = ((mRaw - sRaw) - step3) | |
214 | - | $Tuple2(nil, | |
214 | + | $Tuple2(nil, [nsbtAmountRaw, usdnPay, wRaw, uRaw, mRaw, sRaw, asInt(kCalcArray[1]), asInt(kCalcArray[2]), asInt(kCalcArray[3]), asInt(price), asInt(kCalcArray[4]), asInt(kCalcArray[5]), kCalcArray[6], kCalcArray[7], toString(step1), toString(step2), toString(step3)]) | |
215 | 215 | } | |
216 | 216 | else throw("Strict value is not equal to itself.") | |
217 | 217 | } | |
218 | 218 | ||
219 | 219 | ||
220 | 220 | ||
221 | 221 | @Callable(i) | |
222 | 222 | func calcContractNsbtPriceMATH () = { | |
223 | 223 | let nsbtSupplyMAX = value(assetInfo(nsbtAssetId)).quantity | |
224 | 224 | let neutrinoMetrics = asAnyList(invoke(this, "calcNeutinoMetricsMATH", nil, nil)) | |
225 | 225 | if ((neutrinoMetrics == neutrinoMetrics)) | |
226 | 226 | then { | |
227 | 227 | let nsbtSupply = asInt(neutrinoMetrics[10]) | |
228 | 228 | let currentPrice = asInt(neutrinoMetrics[1]) | |
229 | 229 | let kCalcArray = asAnyList(invoke(this, "calculateKMATH", [asInt(neutrinoMetrics[4]), asInt(neutrinoMetrics[6]), currentPrice, nsbtSupplyMAX, nsbtSupply], nil)) | |
230 | 230 | if ((kCalcArray == kCalcArray)) | |
231 | 231 | then { | |
232 | 232 | let multK = parseBigIntValue(asString(kCalcArray[7])) | |
233 | 233 | let mK = fromX16(multK, MULT) | |
234 | 234 | let multStep1 = fraction(nsbtSupplyMAX, MULT, (nsbtSupplyMAX - nsbtSupply)) | |
235 | 235 | let multStep2 = fraction(multStep1, multStep1, MULT) | |
236 | 236 | let multNsbt2usdnPrice = fraction(mK, multStep2, MULT) | |
237 | 237 | let nsbt2usdnPrice = fraction(multNsbt2usdnPrice, PAULI, MULT) | |
238 | 238 | let nsbt2wavesPrice = fraction(nsbt2usdnPrice, PAULI, currentPrice) | |
239 | - | $Tuple2(nil, | |
239 | + | $Tuple2(nil, [nsbt2usdnPrice, nsbt2wavesPrice]) | |
240 | 240 | } | |
241 | 241 | else throw("Strict value is not equal to itself.") | |
242 | 242 | } | |
243 | 243 | else throw("Strict value is not equal to itself.") | |
244 | 244 | } | |
245 | 245 | ||
246 | 246 | ||
247 | 247 | ||
248 | 248 | @Callable(i) | |
249 | 249 | func calcUserSwapLimitsMATH (userAddressStr) = { | |
250 | 250 | let userGNsbtAmount = valueOrElse(getInteger(nsbtStakingContract, keyLockParamUserAmount(userAddressStr)), 0) | |
251 | 251 | let usdnLmtMax = asInt(invoke(this, "calcSwapLimitMATH", [userGNsbtAmount], nil)) | |
252 | 252 | if ((usdnLmtMax == usdnLmtMax)) | |
253 | 253 | then { | |
254 | 254 | let quickSwapResetBlocks = getIntegerValue(neutrinoContract, keyQuickSwapLimitDuration()) | |
255 | 255 | let lastQuickSwapBlock = valueOrElse(getInteger(neutrinoContract, keyUserLastQuickSwapHeight(userAddressStr)), 0) | |
256 | 256 | let isNewQuickSwapPeriod = ((height - lastQuickSwapBlock) > quickSwapResetBlocks) | |
257 | 257 | let quickSwapUserSpent = if (isNewQuickSwapPeriod) | |
258 | 258 | then 0 | |
259 | 259 | else valueOrElse(getInteger(neutrinoContract, keyQuickSwapUserSpentInPeriod(userAddressStr)), 0) | |
260 | - | $Tuple2(nil, | |
260 | + | $Tuple2(nil, [usdnLmtMax, quickSwapUserSpent]) | |
261 | 261 | } | |
262 | 262 | else throw("Strict value is not equal to itself.") | |
263 | 263 | } | |
264 | 264 | ||
265 | 265 | ||
266 | 266 | ||
267 | 267 | @Callable(i) | |
268 | 268 | func calcNeutinoMetricsMATH () = { | |
269 | 269 | let currentPrice = getIntegerValue(controlContract, keyPrice()) | |
270 | 270 | let neutrinoLockedBalance = valueOrElse(getInteger(neutrinoContract, keyNeutrinoLockedBalance()), 0) | |
271 | 271 | let wavesLockedBalance = valueOrElse(getInteger(neutrinoContract, keyWavesLockedBalance()), 0) | |
272 | 272 | let reserve = (wavesBalance(neutrinoContract).regular - wavesLockedBalance) | |
273 | 273 | let reservesInUsdn = convertWavesToNeutrino(reserve, currentPrice) | |
274 | 274 | let neutrinoSupply = (((neutrinoLockedBalance + value(assetInfo(neutrinoAssetId)).quantity) - assetBalance(neutrinoContract, neutrinoAssetId)) - assetBalance(addressFromStringValue(liquidationContract), neutrinoAssetId)) | |
275 | 275 | let surplus = (reservesInUsdn - neutrinoSupply) | |
276 | 276 | let deficit = (neutrinoSupply - reservesInUsdn) | |
277 | 277 | let surplusPercent = (fraction(surplus, PAULI, neutrinoSupply) * 100) | |
278 | 278 | let BR = fraction(reservesInUsdn, PAULI, neutrinoSupply) | |
279 | 279 | let nsbtSupplyMAX = value(assetInfo(nsbtAssetId)).quantity | |
280 | 280 | let nsbtSupply = (nsbtSupplyMAX - assetBalance(auctionContract, nsbtAssetId)) | |
281 | 281 | $Tuple2(nil, [currentPrice, neutrinoLockedBalance, wavesLockedBalance, reserve, reservesInUsdn, neutrinoSupply, surplus, surplusPercent, BR, nsbtSupply, nsbtSupplyMAX]) | |
282 | 282 | } | |
283 | 283 | ||
284 | 284 | ||
285 | 285 | ||
286 | 286 | @Callable(i) | |
287 | 287 | func getUnstakeComissionAmountMATH (amount,startHeight) = { | |
288 | 288 | let halfLife = getIntOrFail(nsbtStakingContract, keyHalfLife()) | |
289 | 289 | $Tuple2(nil, fraction(amount, pow(2, 0, fraction(-((height - startHeight)), MULT, halfLife), 8, 8, HALFUP), MULT)) | |
290 | 290 | } | |
291 | 291 | ||
292 | 292 | ||
293 | 293 | ||
294 | 294 | @Callable(i) | |
295 | 295 | func mergeStakesMATH (amount1,height1,amount2,height2) = { | |
296 | 296 | let halfLife = getIntOrFail(nsbtStakingContract, keyHalfLife()) | |
297 | 297 | let w = fraction(amount2, pow(2, 0, fraction((height2 - height1), MULT, halfLife), 8, 8, HALFUP), MULT) | |
298 | 298 | let v = fraction((amount1 + amount2), MULT, (amount1 + w)) | |
299 | 299 | $Tuple2(nil, (height1 + ((HALF8 - (halfLife * log(v, 8, 2, 0, 8, HALFUP))) / MULT))) | |
300 | 300 | } | |
301 | 301 | ||
302 | 302 |
github/deemru/w8io/169f3d6 56.59 ms ◑