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