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