tx · 8t7P7J53q6p5Ktr38CWp5cxA5cMEKZgMiP93G9yfKpkH 3N7LYefWk1WhvCsY5A9nTq244SbVPmhCypi: -0.04000000 Waves 2022.07.01 23:38 [2121074] smart account 3N7LYefWk1WhvCsY5A9nTq244SbVPmhCypi > SELF 0.00000000 Waves
{ "type": 13, "id": "8t7P7J53q6p5Ktr38CWp5cxA5cMEKZgMiP93G9yfKpkH", "fee": 4000000, "feeAssetId": null, "timestamp": 1656707907672, "version": 1, "sender": "3N7LYefWk1WhvCsY5A9nTq244SbVPmhCypi", "senderPublicKey": "4qGVXRFATZNzo2RZZ5UYHXojGyJgSRBwtgJcCU8rJe5A", "proofs": [ "5vWUpSASftDfRCoU6AwhvyHZMAdezY8FiUhnY9tVsWw6NvbkFgaocMoauyp6RFfsctNo79keCopbB8oXGYwNaBrL", "5KWmKH2WCGYWRLjYqjYAS646WFpqBKnP4NPv4ZPzCNsr1K5ZMDXYTpqMBjiXxSDwDHB86i7ZGpJNaZ8f5zpWZB6F", "5Wfu3ALvZWvBnNjKNRmvpQT6A3cDGqW2K3m9mLTMpA312ShkC81kDe1atyiT1rdgKtA29QZaZa9u53JUadAimh2b" ], "script": "base64:AAIFAAAAAAAAADkIAhIFCgMICAESAwoBARIHCgUBAQEBARIDCgEBEgQKAgECEgMKAQESABIFCgMBAQESBwoFAQEBAQEAAABCAAAAAAtyZXZpc2lvbk51bQIAAAAAAAAAAAlNVUxUU0NBTEUAAAAAAAAAAAgAAAAAB1NDQUxFMTYAAAAAAAAAABAAAAAAA1NFUAIAAAACX18AAAAABUhBTEY4AAAAAAAC+vCAAAAAAAhFVUxFUlgxNgkAATYAAAABAABgkqET2NV0AAAAAARUV09YCQABNgAAAAEAAAAAAAAAAAIAAAAABU1VTFQ2AAAAAAAAD0JAAAAAAAZNVUxUWDYJAAE2AAAAAQAAAAAAAA9CQAAAAAAFTVVMVDgAAAAAAAX14QAAAAAABk1VTFRYOAkAATYAAAABAAAAAAAF9eEAAAAAAAdNVUx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BQAAABBwdWJLZXlBZG1pbnNMaXN0AAAAAAAAAAADAAAAAAAAAAACAAAAAAAAAAAACQAAZwAAAAIFAAAABWNvdW50AAAAAAAAAAADW4w/9Q==", "chainId": 84, "height": 2121074, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BiJZqwsb8TzNFBkn62N2iP3H3Lh9RsKrcqwrpvPnkwfK Next: BA5Pkt9JZmSJNHoeBr5W2pa6q26a4wZkC5gnvtMWsWYw Diff:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let revisionNum = "96200842ae4031398fba18a06b8c9624a0d43cf0" | |
5 | - | ||
6 | - | let WAVELET = 100000000 | |
7 | - | ||
8 | - | let PAULI = 1000000 | |
9 | - | ||
10 | - | let BIGPAULI = toBigInt(1000000) | |
11 | - | ||
12 | - | let PRICELET = 1000000 | |
13 | - | ||
14 | - | let MULT = 100000000 | |
15 | - | ||
16 | - | let BIGMULT16 = toBigInt(10000000000000000) | |
4 | + | let revisionNum = "" | |
17 | 5 | ||
18 | 6 | let MULTSCALE = 8 | |
19 | 7 | ||
23 | 11 | ||
24 | 12 | let HALF8 = 50000000 | |
25 | 13 | ||
26 | - | let | |
14 | + | let EULERX16 = toBigInt(27182818284590452) | |
27 | 15 | ||
28 | - | let | |
16 | + | let TWOX = toBigInt(2) | |
29 | 17 | ||
30 | - | let | |
18 | + | let MULT6 = 1000000 | |
31 | 19 | ||
32 | - | let | |
20 | + | let MULTX6 = toBigInt(1000000) | |
33 | 21 | ||
34 | - | let scale10BigInt = toBigInt(10000000000) | |
22 | + | let MULT8 = 100000000 | |
23 | + | ||
24 | + | let MULTX8 = toBigInt(100000000) | |
25 | + | ||
26 | + | let MULTX10 = toBigInt(10000000000) | |
27 | + | ||
28 | + | let MULTX16 = toBigInt(10000000000000000) | |
29 | + | ||
30 | + | let WAVESID = fromBase58String("WAVES") | |
35 | 31 | ||
36 | 32 | let kResultIdxA = 0 | |
37 | 33 | ||
90 | 86 | func keyContolContract () = "control_contract" | |
91 | 87 | ||
92 | 88 | ||
93 | - | func keyBondAssetId () = "bond_asset_id" | |
89 | + | func keyNsbtAssetId () = "bond_asset_id" | |
90 | + | ||
91 | + | ||
92 | + | func keySurfAssetId () = "surf_asset_id" | |
94 | 93 | ||
95 | 94 | ||
96 | 95 | func keyBalanceLocked () = "balance_lock_" | |
126 | 125 | func getBoolOrFail (address,key) = valueOrErrorMessage(getBoolean(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
127 | 126 | ||
128 | 127 | ||
129 | - | func convertNeutrinoToWaves (amount,price) = fraction( | |
128 | + | func convertNeutrinoToWaves (amount,price) = fraction(amount, MULT8, price) | |
130 | 129 | ||
131 | 130 | ||
132 | - | func convertWavesToNeutrino (amount,price) = fraction( | |
131 | + | func convertWavesToNeutrino (amount,price) = fraction(amount, price, MULT8) | |
133 | 132 | ||
134 | 133 | ||
135 | - | func toX16 (origVal,origScaleMult) = fraction(toBigInt(origVal), | |
134 | + | func toX16 (origVal,origScaleMult) = fraction(toBigInt(origVal), MULTX16, toBigInt(origScaleMult)) | |
136 | 135 | ||
137 | 136 | ||
138 | - | func fromX16 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), | |
137 | + | func fromX16 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), MULTX16)) | |
139 | 138 | ||
140 | 139 | ||
141 | 140 | func asAnyList (val) = match val { | |
172 | 171 | ||
173 | 172 | let neutrinoAssetId = fromBase58String(getStringOrFail(neutrinoContract, keyNeutrinoAssetId())) | |
174 | 173 | ||
175 | - | let nsbtAssetId = fromBase58String(getStringValue(neutrinoContract, keyBondAssetId())) | |
174 | + | let nsbtAssetId = fromBase58String(getStringValue(neutrinoContract, keyNsbtAssetId())) | |
175 | + | ||
176 | + | let surfAssetId = fromBase58String(getStringValue(auctionContract, keySurfAssetId())) | |
176 | 177 | ||
177 | 178 | @Callable(i) | |
178 | 179 | func constructor (neutrinoAddress,nsbtLockAddress,swapAmountAParam) = if ((i.caller != this)) | |
185 | 186 | func calcSwapLimitREADONLY (gNsbtAmount) = { | |
186 | 187 | let limitParamA = toBigInt(getIntOrFail(this, keySwapAmountAParam())) | |
187 | 188 | let limitParamB = toBigInt(getIntOrFail(this, keySwapAmountBParam())) | |
188 | - | let gNsbtAmountScale16 = toX16(gNsbtAmount, | |
189 | + | let gNsbtAmountScale16 = toX16(gNsbtAmount, MULT6) | |
189 | 190 | let limitPowPart = pow(gNsbtAmountScale16, 16, limitParamB, 16, 8, CEILING) | |
190 | - | let limit = fraction(limitParamA, limitPowPart, | |
191 | + | let limit = fraction(limitParamA, limitPowPart, MULTX10) | |
191 | 192 | $Tuple2(nil, toInt(limit)) | |
192 | 193 | } | |
193 | 194 | ||
198 | 199 | let EXP = toBigInt(2718281) | |
199 | 200 | let EXPSCALE = 6 | |
200 | 201 | let a = valueOrElse(getInteger(auctionContract, "nsbtCurveParam_a"), 3) | |
201 | - | let paulB = valueOrElse(getInteger(auctionContract, "nsbtCurveParam_b"), ((3 * | |
202 | + | let paulB = valueOrElse(getInteger(auctionContract, "nsbtCurveParam_b"), ((3 * MULT6) / 10)) | |
202 | 203 | let wReservesInUsdn = convertWavesToNeutrino(wRaw, price) | |
203 | - | let multBR = fraction(wReservesInUsdn, | |
204 | + | let multBR = fraction(wReservesInUsdn, MULT8, uRaw) | |
204 | 205 | if ((multBR > 10678564816)) | |
205 | 206 | then throw("BR > 10678.564816% will overflow exponent") | |
206 | 207 | else { | |
207 | - | let multPower = (a * (multBR - | |
208 | + | let multPower = (a * (multBR - MULT8)) | |
208 | 209 | let multExpInPower = pow(EXP, EXPSCALE, toBigInt(multPower), MULTSCALE, SCALE16, DOWN) | |
209 | - | let multK = fraction(toBigInt(paulB), multExpInPower, | |
210 | + | let multK = fraction(toBigInt(paulB), multExpInPower, MULTX6) | |
210 | 211 | $Tuple2(nil, [a, paulB, wReservesInUsdn, multBR, multPower, toString(multExpInPower), toString(multK)]) | |
211 | 212 | } | |
212 | 213 | } | |
226 | 227 | let usdnPay = convertWavesToNeutrino(wavesPayRaw, price) | |
227 | 228 | let bigMaxNsbtSupply = toBigInt(mRaw) | |
228 | 229 | let bigNsbtSupply = toBigInt((mRaw - sRaw)) | |
229 | - | let step1 = fraction(toBigInt(usdnPay), | |
230 | + | let step1 = fraction(toBigInt(usdnPay), MULTX16, multK) | |
230 | 231 | let step2 = fraction(step1, bigNsbtSupply, bigMaxNsbtSupply) | |
231 | 232 | let step3 = toInt(fraction(bigNsbtSupply, bigMaxNsbtSupply, (step2 + bigMaxNsbtSupply))) | |
232 | 233 | let nsbtAmountRaw = ((mRaw - sRaw) - step3) | |
233 | 234 | $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]) | |
235 | + | } | |
236 | + | ||
237 | + | ||
238 | + | ||
239 | + | @Callable(i) | |
240 | + | func surfFunctionREADONLY (amount,assetId) = { | |
241 | + | let neutrinoMetrics = asAnyList(invoke(this, "calcNeutinoMetricsREADONLY", nil, nil)) | |
242 | + | let price = asInt(neutrinoMetrics[nMetricIdxPrice]) | |
243 | + | let priceBig = toBigInt(price) | |
244 | + | let reserve = asInt(neutrinoMetrics[nMetricIdxReserve]) | |
245 | + | let reserveBig = toBigInt(reserve) | |
246 | + | let supply = asInt(neutrinoMetrics[nMetricIdxUsdnSupply]) | |
247 | + | let supplyBig = toBigInt(supply) | |
248 | + | let BR = asInt(neutrinoMetrics[nMetricIdxBR]) | |
249 | + | if ((BR >= MULT6)) | |
250 | + | then throw((("BR = " + toString(BR)) + ", cannot buy SURF")) | |
251 | + | else { | |
252 | + | let maxWavesPay = (fraction(supply, MULT8, price) - reserve) | |
253 | + | let maxUsdnPay = (supply - fraction(reserve, price, MULT8)) | |
254 | + | let useAmount = if ((assetId == neutrinoAssetId)) | |
255 | + | then if ((amount > maxUsdnPay)) | |
256 | + | then maxUsdnPay | |
257 | + | else amount | |
258 | + | else if ((assetId == WAVESID)) | |
259 | + | then if ((amount > maxWavesPay)) | |
260 | + | then maxWavesPay | |
261 | + | else amount | |
262 | + | else 0 | |
263 | + | let amountBig = toBigInt(useAmount) | |
264 | + | if ((assetId == neutrinoAssetId)) | |
265 | + | 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)), 0, (amount - useAmount)]) | |
266 | + | else if ((assetId == WAVESID)) | |
267 | + | 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), 0]) | |
268 | + | else throw("Unsupported asset") | |
269 | + | } | |
234 | 270 | } | |
235 | 271 | ||
236 | 272 | ||
245 | 281 | let mRaw = asInt(neutrinoMetrics[nMetricIdxMaxNsbtSupply]) | |
246 | 282 | let kCalcArray = asAnyList(invoke(this, "calculateKREADONLY", [wRaw, uRaw, price, mRaw, sRaw], nil)) | |
247 | 283 | let multKX16 = parseBigIntValue(asString(kCalcArray[kResultIdxMultKStr])) | |
248 | - | let multStep1X16 = fraction(toBigInt(mRaw), | |
249 | - | let multStep2X16 = fraction(multStep1X16, multStep1X16, | |
250 | - | let multNsbt2usdnPriceX16 = fraction(multKX16, multStep2X16, | |
251 | - | let nsbt2usdnPrice = toInt(fraction(multNsbt2usdnPriceX16, toBigInt( | |
252 | - | let nsbt2wavesPrice = fraction(nsbt2usdnPrice, | |
284 | + | let multStep1X16 = fraction(toBigInt(mRaw), MULTX16, toBigInt((mRaw - sRaw))) | |
285 | + | let multStep2X16 = fraction(multStep1X16, multStep1X16, MULTX16) | |
286 | + | let multNsbt2usdnPriceX16 = fraction(multKX16, multStep2X16, MULTX16) | |
287 | + | let nsbt2usdnPrice = toInt(fraction(multNsbt2usdnPriceX16, toBigInt(MULT6), MULTX16)) | |
288 | + | let nsbt2wavesPrice = fraction(nsbt2usdnPrice, MULT6, price) | |
253 | 289 | $Tuple2(nil, [nsbt2usdnPrice, nsbt2wavesPrice]) | |
254 | 290 | } | |
255 | 291 | ||
267 | 303 | let deficit = (neutrinoSupply - reservesInUsdn) | |
268 | 304 | let surplusPercent = if ((neutrinoSupply == 0)) | |
269 | 305 | then 0 | |
270 | - | else (fraction(surplus, | |
306 | + | else (fraction(surplus, MULT6, neutrinoSupply) * 100) | |
271 | 307 | let BR = if ((neutrinoSupply == 0)) | |
272 | 308 | then 0 | |
273 | - | else fraction(reservesInUsdn, | |
309 | + | else fraction(reservesInUsdn, MULT6, neutrinoSupply) | |
274 | 310 | let nsbtSupplyMAX = value(assetInfo(nsbtAssetId)).quantity | |
275 | 311 | let nsbtSupply = (nsbtSupplyMAX - assetBalance(auctionContract, nsbtAssetId)) | |
276 | 312 | $Tuple2(nil, [currentPrice, neutrinoLockedBalance, wavesLockedBalance, reserve, reservesInUsdn, neutrinoSupply, surplus, surplusPercent, BR, nsbtSupply, nsbtSupplyMAX]) | |
279 | 315 | ||
280 | 316 | ||
281 | 317 | @Callable(i) | |
282 | - | func getUnstakeComissionAmountREADONLY (amount,startHeight,halfLife) = $Tuple2(nil, fraction(amount, pow(2, 0, fraction(-((height - startHeight)), | |
318 | + | func getUnstakeComissionAmountREADONLY (amount,startHeight,halfLife) = $Tuple2(nil, fraction(amount, pow(2, 0, fraction(-((height - startHeight)), MULT8, halfLife), 8, 8, HALFUP), MULT8)) | |
283 | 319 | ||
284 | 320 | ||
285 | 321 | ||
286 | 322 | @Callable(i) | |
287 | 323 | func mergeStakesREADONLY (amount1,height1,amount2,height2,halfLife) = { | |
288 | - | let w = fraction(amount2, pow(2, 0, fraction((height2 - height1), | |
289 | - | let v = fraction((amount1 + amount2), | |
290 | - | $Tuple2(nil, (height1 + ((HALF8 - (halfLife * log(v, 8, 2, 0, 8, HALFUP))) / | |
324 | + | let w = fraction(amount2, pow(2, 0, fraction((height2 - height1), MULT8, halfLife), 8, 8, HALFUP), MULT8) | |
325 | + | let v = fraction((amount1 + amount2), MULT8, (amount1 + w)) | |
326 | + | $Tuple2(nil, (height1 + ((HALF8 - (halfLife * log(v, 8, 2, 0, 8, HALFUP))) / MULT8))) | |
291 | 327 | } | |
292 | 328 | ||
293 | 329 | ||
294 | 330 | @Verifier(tx) | |
295 | 331 | func verify () = { | |
296 | - | let pubKeyAdminsList = ["ExtEEK19nmKj9mCpnWyvEEJFYATLMcVEMvohhUHkyHNm", "Ev5py5FfBQX9cZpYKnfQrTB49Byf8QmpZWeDVRim4yV7", "DUuuLjXu98nBwZc7fqwCTjtA3nnRwgTbkMSr5SU2NmDR", "5WRXFSjwcTbNfKcJs8ZqXmSSWYsSVJUtMvMqZj5hH4Nc"] | |
332 | + | let pubKeyAdminsListStr = makeString(["ExtEEK19nmKj9mCpnWyvEEJFYATLMcVEMvohhUHkyHNm", "Ev5py5FfBQX9cZpYKnfQrTB49Byf8QmpZWeDVRim4yV7", "DUuuLjXu98nBwZc7fqwCTjtA3nnRwgTbkMSr5SU2NmDR", "5WRXFSjwcTbNfKcJs8ZqXmSSWYsSVJUtMvMqZj5hH4Nc"], SEP) | |
333 | + | let pubKeyAdminsList = split(valueOrElse(getString(controlContract, "%s__multisig"), pubKeyAdminsListStr), SEP) | |
297 | 334 | let count = ((((if (sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(pubKeyAdminsList[0]))) | |
298 | 335 | then 1 | |
299 | 336 | else 0) + (if (sigVerify(tx.bodyBytes, tx.proofs[1], fromBase58String(pubKeyAdminsList[1]))) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let revisionNum = "96200842ae4031398fba18a06b8c9624a0d43cf0" | |
5 | - | ||
6 | - | let WAVELET = 100000000 | |
7 | - | ||
8 | - | let PAULI = 1000000 | |
9 | - | ||
10 | - | let BIGPAULI = toBigInt(1000000) | |
11 | - | ||
12 | - | let PRICELET = 1000000 | |
13 | - | ||
14 | - | let MULT = 100000000 | |
15 | - | ||
16 | - | let BIGMULT16 = toBigInt(10000000000000000) | |
4 | + | let revisionNum = "" | |
17 | 5 | ||
18 | 6 | let MULTSCALE = 8 | |
19 | 7 | ||
20 | 8 | let SCALE16 = 16 | |
21 | 9 | ||
22 | 10 | let SEP = "__" | |
23 | 11 | ||
24 | 12 | let HALF8 = 50000000 | |
25 | 13 | ||
26 | - | let | |
14 | + | let EULERX16 = toBigInt(27182818284590452) | |
27 | 15 | ||
28 | - | let | |
16 | + | let TWOX = toBigInt(2) | |
29 | 17 | ||
30 | - | let | |
18 | + | let MULT6 = 1000000 | |
31 | 19 | ||
32 | - | let | |
20 | + | let MULTX6 = toBigInt(1000000) | |
33 | 21 | ||
34 | - | let scale10BigInt = toBigInt(10000000000) | |
22 | + | let MULT8 = 100000000 | |
23 | + | ||
24 | + | let MULTX8 = toBigInt(100000000) | |
25 | + | ||
26 | + | let MULTX10 = toBigInt(10000000000) | |
27 | + | ||
28 | + | let MULTX16 = toBigInt(10000000000000000) | |
29 | + | ||
30 | + | let WAVESID = fromBase58String("WAVES") | |
35 | 31 | ||
36 | 32 | let kResultIdxA = 0 | |
37 | 33 | ||
38 | 34 | let kResultIdxPaulB = 1 | |
39 | 35 | ||
40 | 36 | let kResultIdxWReservesInUsdn = 2 | |
41 | 37 | ||
42 | 38 | let kResultIdxMultBR = 3 | |
43 | 39 | ||
44 | 40 | let kResultIdxMultPower = 4 | |
45 | 41 | ||
46 | 42 | let kResultIdxMultExpInPowerStr = 5 | |
47 | 43 | ||
48 | 44 | let kResultIdxMultKStr = 6 | |
49 | 45 | ||
50 | 46 | let nMetricIdxPrice = 0 | |
51 | 47 | ||
52 | 48 | let nMetricIdxUsdnLockedBalance = 1 | |
53 | 49 | ||
54 | 50 | let nMetricIdxWavesLockedBalance = 2 | |
55 | 51 | ||
56 | 52 | let nMetricIdxReserve = 3 | |
57 | 53 | ||
58 | 54 | let nMetricIdxReserveInUsdn = 4 | |
59 | 55 | ||
60 | 56 | let nMetricIdxUsdnSupply = 5 | |
61 | 57 | ||
62 | 58 | let nMetricIdxSurplus = 6 | |
63 | 59 | ||
64 | 60 | let nMetricIdxSurplusPercent = 7 | |
65 | 61 | ||
66 | 62 | let nMetricIdxBR = 8 | |
67 | 63 | ||
68 | 64 | let nMetricIdxNsbtSupply = 9 | |
69 | 65 | ||
70 | 66 | let nMetricIdxMaxNsbtSupply = 10 | |
71 | 67 | ||
72 | 68 | func keyNeutrinoAddress () = "%s%s__config__neutrinoAddress" | |
73 | 69 | ||
74 | 70 | ||
75 | 71 | func keySwapAmountAParam () = "%s%s__config__swapAParam" | |
76 | 72 | ||
77 | 73 | ||
78 | 74 | func keySwapAmountBParam () = "%s%s__config__swapBParam" | |
79 | 75 | ||
80 | 76 | ||
81 | 77 | func keyNeutrinoAssetId () = "neutrino_asset_id" | |
82 | 78 | ||
83 | 79 | ||
84 | 80 | func keyLiquidationContractAddress () = "liquidation_contract" | |
85 | 81 | ||
86 | 82 | ||
87 | 83 | func keyAuctionContract () = "auction_contract" | |
88 | 84 | ||
89 | 85 | ||
90 | 86 | func keyContolContract () = "control_contract" | |
91 | 87 | ||
92 | 88 | ||
93 | - | func keyBondAssetId () = "bond_asset_id" | |
89 | + | func keyNsbtAssetId () = "bond_asset_id" | |
90 | + | ||
91 | + | ||
92 | + | func keySurfAssetId () = "surf_asset_id" | |
94 | 93 | ||
95 | 94 | ||
96 | 95 | func keyBalanceLocked () = "balance_lock_" | |
97 | 96 | ||
98 | 97 | ||
99 | 98 | func keyWavesLockedBalance () = (keyBalanceLocked() + "waves") | |
100 | 99 | ||
101 | 100 | ||
102 | 101 | func keyNeutrinoLockedBalance () = (keyBalanceLocked() + "neutrino") | |
103 | 102 | ||
104 | 103 | ||
105 | 104 | func swapsTimeframeKEY () = "swaps_timeframe" | |
106 | 105 | ||
107 | 106 | ||
108 | 107 | func keyUserLastQuickSwapHeight (userAddress) = makeString(["%s%s", "userLastQuickSwapHeight", userAddress], SEP) | |
109 | 108 | ||
110 | 109 | ||
111 | 110 | func keyQuickSwapUserSpentInPeriod (userAddress) = makeString(["%s%s", "quickSwapUserSpentInPeriod", userAddress], SEP) | |
112 | 111 | ||
113 | 112 | ||
114 | 113 | func keyPrice () = "price" | |
115 | 114 | ||
116 | 115 | ||
117 | 116 | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
118 | 117 | ||
119 | 118 | ||
120 | 119 | func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
121 | 120 | ||
122 | 121 | ||
123 | 122 | func getNumberByKey (address,key) = valueOrElse(getInteger(address, key), 0) | |
124 | 123 | ||
125 | 124 | ||
126 | 125 | func getBoolOrFail (address,key) = valueOrErrorMessage(getBoolean(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
127 | 126 | ||
128 | 127 | ||
129 | - | func convertNeutrinoToWaves (amount,price) = fraction( | |
128 | + | func convertNeutrinoToWaves (amount,price) = fraction(amount, MULT8, price) | |
130 | 129 | ||
131 | 130 | ||
132 | - | func convertWavesToNeutrino (amount,price) = fraction( | |
131 | + | func convertWavesToNeutrino (amount,price) = fraction(amount, price, MULT8) | |
133 | 132 | ||
134 | 133 | ||
135 | - | func toX16 (origVal,origScaleMult) = fraction(toBigInt(origVal), | |
134 | + | func toX16 (origVal,origScaleMult) = fraction(toBigInt(origVal), MULTX16, toBigInt(origScaleMult)) | |
136 | 135 | ||
137 | 136 | ||
138 | - | func fromX16 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), | |
137 | + | func fromX16 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), MULTX16)) | |
139 | 138 | ||
140 | 139 | ||
141 | 140 | func asAnyList (val) = match val { | |
142 | 141 | case valAnyLyst: List[Any] => | |
143 | 142 | valAnyLyst | |
144 | 143 | case _ => | |
145 | 144 | throw("fail to cast into List[Any]") | |
146 | 145 | } | |
147 | 146 | ||
148 | 147 | ||
149 | 148 | func asInt (val) = match val { | |
150 | 149 | case valInt: Int => | |
151 | 150 | valInt | |
152 | 151 | case _ => | |
153 | 152 | throw("fail to cast into Int") | |
154 | 153 | } | |
155 | 154 | ||
156 | 155 | ||
157 | 156 | func asString (val) = match val { | |
158 | 157 | case valStr: String => | |
159 | 158 | valStr | |
160 | 159 | case _ => | |
161 | 160 | throw("fail to cast into String") | |
162 | 161 | } | |
163 | 162 | ||
164 | 163 | ||
165 | 164 | let neutrinoContract = addressFromStringValue(getStringOrFail(this, keyNeutrinoAddress())) | |
166 | 165 | ||
167 | 166 | let controlContract = addressFromStringValue(getStringOrFail(neutrinoContract, keyContolContract())) | |
168 | 167 | ||
169 | 168 | let auctionContract = addressFromStringValue(getStringOrFail(neutrinoContract, keyAuctionContract())) | |
170 | 169 | ||
171 | 170 | let liquidationContract = addressFromStringValue(getStringOrFail(neutrinoContract, keyLiquidationContractAddress())) | |
172 | 171 | ||
173 | 172 | let neutrinoAssetId = fromBase58String(getStringOrFail(neutrinoContract, keyNeutrinoAssetId())) | |
174 | 173 | ||
175 | - | let nsbtAssetId = fromBase58String(getStringValue(neutrinoContract, keyBondAssetId())) | |
174 | + | let nsbtAssetId = fromBase58String(getStringValue(neutrinoContract, keyNsbtAssetId())) | |
175 | + | ||
176 | + | let surfAssetId = fromBase58String(getStringValue(auctionContract, keySurfAssetId())) | |
176 | 177 | ||
177 | 178 | @Callable(i) | |
178 | 179 | func constructor (neutrinoAddress,nsbtLockAddress,swapAmountAParam) = if ((i.caller != this)) | |
179 | 180 | then throw("not authorized") | |
180 | 181 | else [StringEntry(keyNeutrinoAddress(), neutrinoAddress), IntegerEntry(keySwapAmountAParam(), swapAmountAParam)] | |
181 | 182 | ||
182 | 183 | ||
183 | 184 | ||
184 | 185 | @Callable(i) | |
185 | 186 | func calcSwapLimitREADONLY (gNsbtAmount) = { | |
186 | 187 | let limitParamA = toBigInt(getIntOrFail(this, keySwapAmountAParam())) | |
187 | 188 | let limitParamB = toBigInt(getIntOrFail(this, keySwapAmountBParam())) | |
188 | - | let gNsbtAmountScale16 = toX16(gNsbtAmount, | |
189 | + | let gNsbtAmountScale16 = toX16(gNsbtAmount, MULT6) | |
189 | 190 | let limitPowPart = pow(gNsbtAmountScale16, 16, limitParamB, 16, 8, CEILING) | |
190 | - | let limit = fraction(limitParamA, limitPowPart, | |
191 | + | let limit = fraction(limitParamA, limitPowPart, MULTX10) | |
191 | 192 | $Tuple2(nil, toInt(limit)) | |
192 | 193 | } | |
193 | 194 | ||
194 | 195 | ||
195 | 196 | ||
196 | 197 | @Callable(i) | |
197 | 198 | func calculateKREADONLY (wRaw,uRaw,price,mRaw,sRaw) = { | |
198 | 199 | let EXP = toBigInt(2718281) | |
199 | 200 | let EXPSCALE = 6 | |
200 | 201 | let a = valueOrElse(getInteger(auctionContract, "nsbtCurveParam_a"), 3) | |
201 | - | let paulB = valueOrElse(getInteger(auctionContract, "nsbtCurveParam_b"), ((3 * | |
202 | + | let paulB = valueOrElse(getInteger(auctionContract, "nsbtCurveParam_b"), ((3 * MULT6) / 10)) | |
202 | 203 | let wReservesInUsdn = convertWavesToNeutrino(wRaw, price) | |
203 | - | let multBR = fraction(wReservesInUsdn, | |
204 | + | let multBR = fraction(wReservesInUsdn, MULT8, uRaw) | |
204 | 205 | if ((multBR > 10678564816)) | |
205 | 206 | then throw("BR > 10678.564816% will overflow exponent") | |
206 | 207 | else { | |
207 | - | let multPower = (a * (multBR - | |
208 | + | let multPower = (a * (multBR - MULT8)) | |
208 | 209 | let multExpInPower = pow(EXP, EXPSCALE, toBigInt(multPower), MULTSCALE, SCALE16, DOWN) | |
209 | - | let multK = fraction(toBigInt(paulB), multExpInPower, | |
210 | + | let multK = fraction(toBigInt(paulB), multExpInPower, MULTX6) | |
210 | 211 | $Tuple2(nil, [a, paulB, wReservesInUsdn, multBR, multPower, toString(multExpInPower), toString(multK)]) | |
211 | 212 | } | |
212 | 213 | } | |
213 | 214 | ||
214 | 215 | ||
215 | 216 | ||
216 | 217 | @Callable(i) | |
217 | 218 | func curveFunctionREADONLY (wavesPayRaw) = { | |
218 | 219 | let neutrinoMetrics = asAnyList(invoke(this, "calcNeutinoMetricsREADONLY", nil, nil)) | |
219 | 220 | let price = asInt(neutrinoMetrics[nMetricIdxPrice]) | |
220 | 221 | let wRaw = asInt(neutrinoMetrics[nMetricIdxReserve]) | |
221 | 222 | let uRaw = asInt(neutrinoMetrics[nMetricIdxUsdnSupply]) | |
222 | 223 | let sRaw = asInt(neutrinoMetrics[nMetricIdxNsbtSupply]) | |
223 | 224 | let mRaw = asInt(neutrinoMetrics[nMetricIdxMaxNsbtSupply]) | |
224 | 225 | let kCalcArray = asAnyList(invoke(this, "calculateKREADONLY", [wRaw, uRaw, price, mRaw, sRaw], nil)) | |
225 | 226 | let multK = parseBigIntValue(asString(kCalcArray[kResultIdxMultKStr])) | |
226 | 227 | let usdnPay = convertWavesToNeutrino(wavesPayRaw, price) | |
227 | 228 | let bigMaxNsbtSupply = toBigInt(mRaw) | |
228 | 229 | let bigNsbtSupply = toBigInt((mRaw - sRaw)) | |
229 | - | let step1 = fraction(toBigInt(usdnPay), | |
230 | + | let step1 = fraction(toBigInt(usdnPay), MULTX16, multK) | |
230 | 231 | let step2 = fraction(step1, bigNsbtSupply, bigMaxNsbtSupply) | |
231 | 232 | let step3 = toInt(fraction(bigNsbtSupply, bigMaxNsbtSupply, (step2 + bigMaxNsbtSupply))) | |
232 | 233 | let nsbtAmountRaw = ((mRaw - sRaw) - step3) | |
233 | 234 | $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]) | |
235 | + | } | |
236 | + | ||
237 | + | ||
238 | + | ||
239 | + | @Callable(i) | |
240 | + | func surfFunctionREADONLY (amount,assetId) = { | |
241 | + | let neutrinoMetrics = asAnyList(invoke(this, "calcNeutinoMetricsREADONLY", nil, nil)) | |
242 | + | let price = asInt(neutrinoMetrics[nMetricIdxPrice]) | |
243 | + | let priceBig = toBigInt(price) | |
244 | + | let reserve = asInt(neutrinoMetrics[nMetricIdxReserve]) | |
245 | + | let reserveBig = toBigInt(reserve) | |
246 | + | let supply = asInt(neutrinoMetrics[nMetricIdxUsdnSupply]) | |
247 | + | let supplyBig = toBigInt(supply) | |
248 | + | let BR = asInt(neutrinoMetrics[nMetricIdxBR]) | |
249 | + | if ((BR >= MULT6)) | |
250 | + | then throw((("BR = " + toString(BR)) + ", cannot buy SURF")) | |
251 | + | else { | |
252 | + | let maxWavesPay = (fraction(supply, MULT8, price) - reserve) | |
253 | + | let maxUsdnPay = (supply - fraction(reserve, price, MULT8)) | |
254 | + | let useAmount = if ((assetId == neutrinoAssetId)) | |
255 | + | then if ((amount > maxUsdnPay)) | |
256 | + | then maxUsdnPay | |
257 | + | else amount | |
258 | + | else if ((assetId == WAVESID)) | |
259 | + | then if ((amount > maxWavesPay)) | |
260 | + | then maxWavesPay | |
261 | + | else amount | |
262 | + | else 0 | |
263 | + | let amountBig = toBigInt(useAmount) | |
264 | + | if ((assetId == neutrinoAssetId)) | |
265 | + | 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)), 0, (amount - useAmount)]) | |
266 | + | else if ((assetId == WAVESID)) | |
267 | + | 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), 0]) | |
268 | + | else throw("Unsupported asset") | |
269 | + | } | |
234 | 270 | } | |
235 | 271 | ||
236 | 272 | ||
237 | 273 | ||
238 | 274 | @Callable(i) | |
239 | 275 | func calcContractNsbtPriceSYSREADONLY (nsbtSupplyDELTA) = { | |
240 | 276 | let neutrinoMetrics = asAnyList(invoke(this, "calcNeutinoMetricsREADONLY", nil, nil)) | |
241 | 277 | let price = asInt(neutrinoMetrics[nMetricIdxPrice]) | |
242 | 278 | let wRaw = asInt(neutrinoMetrics[nMetricIdxReserve]) | |
243 | 279 | let uRaw = (asInt(neutrinoMetrics[nMetricIdxUsdnSupply]) - nsbtSupplyDELTA) | |
244 | 280 | let sRaw = (asInt(neutrinoMetrics[nMetricIdxNsbtSupply]) + nsbtSupplyDELTA) | |
245 | 281 | let mRaw = asInt(neutrinoMetrics[nMetricIdxMaxNsbtSupply]) | |
246 | 282 | let kCalcArray = asAnyList(invoke(this, "calculateKREADONLY", [wRaw, uRaw, price, mRaw, sRaw], nil)) | |
247 | 283 | let multKX16 = parseBigIntValue(asString(kCalcArray[kResultIdxMultKStr])) | |
248 | - | let multStep1X16 = fraction(toBigInt(mRaw), | |
249 | - | let multStep2X16 = fraction(multStep1X16, multStep1X16, | |
250 | - | let multNsbt2usdnPriceX16 = fraction(multKX16, multStep2X16, | |
251 | - | let nsbt2usdnPrice = toInt(fraction(multNsbt2usdnPriceX16, toBigInt( | |
252 | - | let nsbt2wavesPrice = fraction(nsbt2usdnPrice, | |
284 | + | let multStep1X16 = fraction(toBigInt(mRaw), MULTX16, toBigInt((mRaw - sRaw))) | |
285 | + | let multStep2X16 = fraction(multStep1X16, multStep1X16, MULTX16) | |
286 | + | let multNsbt2usdnPriceX16 = fraction(multKX16, multStep2X16, MULTX16) | |
287 | + | let nsbt2usdnPrice = toInt(fraction(multNsbt2usdnPriceX16, toBigInt(MULT6), MULTX16)) | |
288 | + | let nsbt2wavesPrice = fraction(nsbt2usdnPrice, MULT6, price) | |
253 | 289 | $Tuple2(nil, [nsbt2usdnPrice, nsbt2wavesPrice]) | |
254 | 290 | } | |
255 | 291 | ||
256 | 292 | ||
257 | 293 | ||
258 | 294 | @Callable(i) | |
259 | 295 | func calcNeutinoMetricsREADONLY () = { | |
260 | 296 | let currentPrice = getIntegerValue(controlContract, keyPrice()) | |
261 | 297 | let neutrinoLockedBalance = valueOrElse(getInteger(neutrinoContract, keyNeutrinoLockedBalance()), 0) | |
262 | 298 | let wavesLockedBalance = valueOrElse(getInteger(neutrinoContract, keyWavesLockedBalance()), 0) | |
263 | 299 | let reserve = (wavesBalance(neutrinoContract).regular - wavesLockedBalance) | |
264 | 300 | let reservesInUsdn = convertWavesToNeutrino(reserve, currentPrice) | |
265 | 301 | let neutrinoSupply = (((neutrinoLockedBalance + value(assetInfo(neutrinoAssetId)).quantity) - assetBalance(neutrinoContract, neutrinoAssetId)) - assetBalance(liquidationContract, neutrinoAssetId)) | |
266 | 302 | let surplus = (reservesInUsdn - neutrinoSupply) | |
267 | 303 | let deficit = (neutrinoSupply - reservesInUsdn) | |
268 | 304 | let surplusPercent = if ((neutrinoSupply == 0)) | |
269 | 305 | then 0 | |
270 | - | else (fraction(surplus, | |
306 | + | else (fraction(surplus, MULT6, neutrinoSupply) * 100) | |
271 | 307 | let BR = if ((neutrinoSupply == 0)) | |
272 | 308 | then 0 | |
273 | - | else fraction(reservesInUsdn, | |
309 | + | else fraction(reservesInUsdn, MULT6, neutrinoSupply) | |
274 | 310 | let nsbtSupplyMAX = value(assetInfo(nsbtAssetId)).quantity | |
275 | 311 | let nsbtSupply = (nsbtSupplyMAX - assetBalance(auctionContract, nsbtAssetId)) | |
276 | 312 | $Tuple2(nil, [currentPrice, neutrinoLockedBalance, wavesLockedBalance, reserve, reservesInUsdn, neutrinoSupply, surplus, surplusPercent, BR, nsbtSupply, nsbtSupplyMAX]) | |
277 | 313 | } | |
278 | 314 | ||
279 | 315 | ||
280 | 316 | ||
281 | 317 | @Callable(i) | |
282 | - | func getUnstakeComissionAmountREADONLY (amount,startHeight,halfLife) = $Tuple2(nil, fraction(amount, pow(2, 0, fraction(-((height - startHeight)), | |
318 | + | func getUnstakeComissionAmountREADONLY (amount,startHeight,halfLife) = $Tuple2(nil, fraction(amount, pow(2, 0, fraction(-((height - startHeight)), MULT8, halfLife), 8, 8, HALFUP), MULT8)) | |
283 | 319 | ||
284 | 320 | ||
285 | 321 | ||
286 | 322 | @Callable(i) | |
287 | 323 | func mergeStakesREADONLY (amount1,height1,amount2,height2,halfLife) = { | |
288 | - | let w = fraction(amount2, pow(2, 0, fraction((height2 - height1), | |
289 | - | let v = fraction((amount1 + amount2), | |
290 | - | $Tuple2(nil, (height1 + ((HALF8 - (halfLife * log(v, 8, 2, 0, 8, HALFUP))) / | |
324 | + | let w = fraction(amount2, pow(2, 0, fraction((height2 - height1), MULT8, halfLife), 8, 8, HALFUP), MULT8) | |
325 | + | let v = fraction((amount1 + amount2), MULT8, (amount1 + w)) | |
326 | + | $Tuple2(nil, (height1 + ((HALF8 - (halfLife * log(v, 8, 2, 0, 8, HALFUP))) / MULT8))) | |
291 | 327 | } | |
292 | 328 | ||
293 | 329 | ||
294 | 330 | @Verifier(tx) | |
295 | 331 | func verify () = { | |
296 | - | let pubKeyAdminsList = ["ExtEEK19nmKj9mCpnWyvEEJFYATLMcVEMvohhUHkyHNm", "Ev5py5FfBQX9cZpYKnfQrTB49Byf8QmpZWeDVRim4yV7", "DUuuLjXu98nBwZc7fqwCTjtA3nnRwgTbkMSr5SU2NmDR", "5WRXFSjwcTbNfKcJs8ZqXmSSWYsSVJUtMvMqZj5hH4Nc"] | |
332 | + | let pubKeyAdminsListStr = makeString(["ExtEEK19nmKj9mCpnWyvEEJFYATLMcVEMvohhUHkyHNm", "Ev5py5FfBQX9cZpYKnfQrTB49Byf8QmpZWeDVRim4yV7", "DUuuLjXu98nBwZc7fqwCTjtA3nnRwgTbkMSr5SU2NmDR", "5WRXFSjwcTbNfKcJs8ZqXmSSWYsSVJUtMvMqZj5hH4Nc"], SEP) | |
333 | + | let pubKeyAdminsList = split(valueOrElse(getString(controlContract, "%s__multisig"), pubKeyAdminsListStr), SEP) | |
297 | 334 | let count = ((((if (sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(pubKeyAdminsList[0]))) | |
298 | 335 | then 1 | |
299 | 336 | else 0) + (if (sigVerify(tx.bodyBytes, tx.proofs[1], fromBase58String(pubKeyAdminsList[1]))) | |
300 | 337 | then 1 | |
301 | 338 | else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[2], fromBase58String(pubKeyAdminsList[2]))) | |
302 | 339 | then 1 | |
303 | 340 | else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[3], fromBase58String(pubKeyAdminsList[3]))) | |
304 | 341 | then 2 | |
305 | 342 | else 0)) | |
306 | 343 | (count >= 3) | |
307 | 344 | } | |
308 | 345 |
github/deemru/w8io/026f985 61.94 ms ◑