tx · H8YeaEAJNxKqs13gCutmhiL4Ho7kgDwqTz8u284Y3CAM

3N4revPn12feiSAyC78tAZEJfsyprVYPzsL:  -0.05000000 Waves

2022.02.22 10:53 [1934591] smart account 3N4revPn12feiSAyC78tAZEJfsyprVYPzsL > SELF 0.00000000 Waves

{ "type": 13, "id": "H8YeaEAJNxKqs13gCutmhiL4Ho7kgDwqTz8u284Y3CAM", "fee": 5000000, "feeAssetId": null, "timestamp": 1645516468520, "version": 2, "chainId": 84, "sender": "3N4revPn12feiSAyC78tAZEJfsyprVYPzsL", "senderPublicKey": "5smGxL7bfeRokaN53Z31Y72dF2Lkr5Cg1kuWRV3gniNe", "proofs": [ "4XRbcnyf1N1Ax9Y9dmuzCr5iicVL6TRNKCG8cN9NJ3wQCvuapJqKnHv8Aj174vibFjq5JcdJCDiTgLMJNzA9K6mg" ], "script": "base64:AAIFAAAAAAAAAB4IAhIECgIBARIECgIBARIECgIBARIICgYBAQEIAQEAAAAcAAAAAAtzdHJBc3NldElkQQIAAAAsMzROOVljRUVUTFduOTNxWVE2NEVzUDF4ODl0U3J1SlU0NFJyRU1TWFhFUEoAAAAAC3N0ckFzc2V0SWRCAgAAACxERzJ4RmtQZER3S1VvQmt6R0FoUXRMcFNHemZYTGlDWVBFemVLSDJBZDI0cAAAAAAIYXNzZXRJZEEDCQAAAAAAAAIFAAAAC3N0ckFzc2V0SWRBAgAAAAVXQVZFUwUAAAAEdW5pdAkAAlkAAAABBQAAAAtzdHJBc3NldElkQQAAAAAIYXNzZXRJZEIDCQAAAAAAAAIFAAAAC3N0ckFzc2V0SWRCAgAAAAVXQVZFUwUAAAAEdW5pdAkAAlkAAAABBQAAAAtzdHJBc3NldElkQgAAAAADZmVlAAAAAAAAAAH0AAAAAA1mZWVHb3Zlcm5hbmNlAAAAAAAAAADIAAAAAAlmZWVTY2FsZTYAAAAAAAAPQkAAAAAABnNjYWxlMwAAAAAAAAAD6AAAAAAGc2NhbGU4AAAAAAAF9eEAAAAAAAdzY2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wbXRBbW91bnQJAABlAAAAAgUAAAAIYmFsYW5jZUIFAAAABmFtb3VudAUAAAADbmlsCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACAgAAAAxpbnZhcmlhbnROZXcJAQAAAA1pbnZhcmlhbnRDYWxjAAAAAgkAAGUAAAACBQAAAAhiYWxhbmNlQQUAAAAGYW1vdW50CQAAZAAAAAIFAAAACGJhbGFuY2VCBQAAAAlwbXRBbW91bnQFAAAAA25pbAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5S8dleA==", "height": 1934591, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2Vc7aHTkra4gYTn8nsDCMfCsMnZfmx3vpoVz9LasQAoD Next: none Diff:
OldNewDifferences
163163 let secondSumFraction = fraction(toBigInt(x), toBigInt(y), toBigInt(scale8))
164164 let secondSumFirstPart = toInt(pow(secondSumFraction, 0, toBigInt(5), 1, (digits8 / 2), DOWN))
165165 let t = (sk - betaDR)
166- let secondSumSecondPart = pow((sk - betaDR), digits8, alpha, alphaDigits, digits8, DOWN)
166+ let secondSumSecondPart = pow(t, digits8, alpha, alphaDigits, digits8, DOWN)
167167 let secondSum = (2 * fraction(secondSumFirstPart, secondSumSecondPart, scale8))
168168 let invariant = (firstSum + secondSum)
169169 [IntegerEntry("invariant", invariant)]
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let strAssetIdA = "34N9YcEETLWn93qYQ64EsP1x89tSruJU44RrEMSXXEPJ"
55
66 let strAssetIdB = "DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p"
77
88 let assetIdA = if ((strAssetIdA == "WAVES"))
99 then unit
1010 else fromBase58String(strAssetIdA)
1111
1212 let assetIdB = if ((strAssetIdB == "WAVES"))
1313 then unit
1414 else fromBase58String(strAssetIdB)
1515
1616 let fee = 500
1717
1818 let feeGovernance = 200
1919
2020 let feeScale6 = 1000000
2121
2222 let scale3 = 1000
2323
2424 let scale8 = 100000000
2525
2626 let scale12 = 1000000000000
2727
2828 let scale16 = 10000000000000000
2929
3030 let slippageScale3 = 1000
3131
3232 let digits8 = 8
3333
3434 let digits12 = 12
3535
3636 let dAppThreshold = 50
3737
3838 let dAppThresholdScale2 = 100
3939
4040 let exchangeRatioLimitMin = 90000000
4141
4242 let exchangeRatioLimitMax = 110000000
4343
4444 let alpha = 50
4545
4646 let alphaDigits = 2
4747
4848 let beta = 46000000
4949
5050 let betaBigInt = 460000000000
5151
5252 let betaDR = 4600000000000000
5353
5454 func skewness (x,y) = (((fraction(scale12, x, y) + fraction(scale12, y, x)) / 2) / 10000)
5555
5656
5757 func skewnessBigInt (x,y) = {
5858 let skfirst = fraction(scale12, x, y)
5959 let skseconsd = fraction(scale12, y, x)
6060 ((skfirst + skseconsd) / 2)
6161 }
6262
6363
6464 func skewnessDR (x,y) = ((fraction(scale16, x, y) + fraction(scale16, y, x)) / 2)
6565
6666
6767 func invariantCalc (x,y) = {
6868 let sk = skewness(x, y)
6969 let xy = (x + y)
7070 let firstpow = pow(sk, digits8, alpha, alphaDigits, digits8, CEILING)
7171 let secondpow = pow(fraction(x, y, scale8), 0, 5, 1, (digits8 / 2), DOWN)
7272 let thirdpow = pow((sk - beta), digits8, alpha, alphaDigits, digits8, DOWN)
7373 let firstsum = fraction(xy, scale8, firstpow)
7474 let secondsum = (2 * fraction(secondpow, thirdpow, scale8))
7575 (firstsum + secondsum)
7676 }
7777
7878
7979 func calculateSendAmount (balanceA,balanceB,amountToSendEstimated,minTokenReceiveAmount,tokenReceiveAmount,tokenId) = {
8080 let slippageValue = (scale8 - ((scale8 * 1) / 10000000))
8181 let deltaBetweenMaxAndMinSendValue = (amountToSendEstimated - minTokenReceiveAmount)
8282 let x = (balanceA + tokenReceiveAmount)
8383 let y = (balanceB + tokenReceiveAmount)
8484 let invariant = invariantCalc(balanceA, balanceB)
8585 let invariantNew = if ((tokenId == strAssetIdA))
8686 then invariantCalc(x, (balanceB - amountToSendEstimated))
8787 else if ((tokenId == strAssetIdB))
8888 then invariantCalc((balanceA - amountToSendEstimated), y)
8989 else throw("Wrong asset in payment")
9090 let invariantEstimatedRatio = fraction(scale8, invariant, invariantNew)
9191 func getStepAmount (acc,step) = if ((acc == -1))
9292 then {
9393 let amountToSend = (amountToSendEstimated - ((step * deltaBetweenMaxAndMinSendValue) / 5))
9494 let stepInvariant = if ((tokenId == strAssetIdA))
9595 then invariantCalc(x, (balanceB - amountToSend))
9696 else invariantCalc((balanceA - amountToSend), y)
9797 if ((stepInvariant > invariant))
9898 then amountToSend
9999 else -1
100100 }
101101 else acc
102102
103103 let stepAmount = {
104104 let $l = [1, 2, 3, 4, 5]
105105 let $s = size($l)
106106 let $acc0 = -1
107107 func $f0_1 ($a,$i) = if (($i >= $s))
108108 then $a
109109 else getStepAmount($a, $l[$i])
110110
111111 func $f0_2 ($a,$i) = if (($i >= $s))
112112 then $a
113113 else throw("List size exceeds 5")
114114
115115 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5)
116116 }
117117 if ((0 > stepAmount))
118118 then throw("something went wrong while working with amountToSend")
119119 else if (if ((invariantEstimatedRatio > slippageValue))
120120 then (invariantNew > invariant)
121121 else false)
122122 then amountToSendEstimated
123123 else stepAmount
124124 }
125125
126126
127127 @Callable(i)
128128 func invariantCalcc (x,y) = {
129129 let sk = skewness(x, y)
130130 let xy = (x + y)
131131 let firstpow = pow(sk, digits8, alpha, alphaDigits, digits8, CEILING)
132132 let secondpow = pow(fraction(x, y, scale8), 0, 5, 1, (digits8 / 2), DOWN)
133133 let thirdpow = pow((sk - beta), digits8, alpha, alphaDigits, digits8, DOWN)
134134 let fractionFirst = fraction(xy, scale8, firstpow)
135135 let fractionSecond = fraction(secondpow, thirdpow, scale8)
136136 let invariant = (fractionFirst + (2 * fractionSecond))
137137 [IntegerEntry("invariant", invariant)]
138138 }
139139
140140
141141
142142 @Callable(i)
143143 func invariantCalccBigInt (x,y) = {
144144 let sk = skewnessBigInt(x, y)
145145 let xy = toBigInt((x + y))
146146 let firstpow = pow(toBigInt(sk), digits12, toBigInt(alpha), alphaDigits, digits12, CEILING)
147147 let secpowfraction = fraction(toBigInt(x), toBigInt(y), toBigInt(scale8))
148148 let secondpow = pow(secpowfraction, 0, toBigInt(5), 1, (digits8 / 2), DOWN)
149149 let thirdpow = pow(toBigInt((sk - betaBigInt)), digits12, toBigInt(alpha), alphaDigits, digits12, DOWN)
150150 let fractionFirst = toInt(fraction(xy, toBigInt(scale12), firstpow))
151151 let fractionSecond = (2 * toInt(fraction(secondpow, thirdpow, toBigInt(scale12))))
152152 let invariant = (fractionFirst + fractionSecond)
153153 [IntegerEntry("invariant", invariant)]
154154 }
155155
156156
157157
158158 @Callable(i)
159159 func invariantCalcDR (x,y) = {
160160 let sk = skewnessDR(x, y)
161161 let firstPow = pow(sk, digits8, alpha, alphaDigits, digits8, CEILING)
162162 let firstSum = fraction((x + y), scale16, firstPow)
163163 let secondSumFraction = fraction(toBigInt(x), toBigInt(y), toBigInt(scale8))
164164 let secondSumFirstPart = toInt(pow(secondSumFraction, 0, toBigInt(5), 1, (digits8 / 2), DOWN))
165165 let t = (sk - betaDR)
166- let secondSumSecondPart = pow((sk - betaDR), digits8, alpha, alphaDigits, digits8, DOWN)
166+ let secondSumSecondPart = pow(t, digits8, alpha, alphaDigits, digits8, DOWN)
167167 let secondSum = (2 * fraction(secondSumFirstPart, secondSumSecondPart, scale8))
168168 let invariant = (firstSum + secondSum)
169169 [IntegerEntry("invariant", invariant)]
170170 }
171171
172172
173173
174174 @Callable(i)
175175 func exchange (balanceA,balanceB,pmtAmount,pmtAssetId,estimatedAmountToReceive,minAmountToReceive) = {
176176 let amount = calculateSendAmount(balanceA, balanceB, estimatedAmountToReceive, minAmountToReceive, pmtAmount, pmtAssetId)
177177 let governanceReward = fraction(amount, feeGovernance, feeScale6)
178178 let amountMinusFee = fraction(amount, (feeScale6 - fee), feeScale6)
179179 ([IntegerEntry("sendAmount", amount), IntegerEntry("sendAmountWithComission", amountMinusFee), IntegerEntry("invariant", invariantCalc(balanceA, balanceB))] ++ (if ((pmtAssetId == strAssetIdA))
180180 then [IntegerEntry("invariantNew", invariantCalc((balanceA + pmtAmount), (balanceB - amount)))]
181181 else [IntegerEntry("invariantNew", invariantCalc((balanceA - amount), (balanceB + pmtAmount)))]))
182182 }
183183
184184
185185 @Verifier(tx)
186186 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
187187

github/deemru/w8io/169f3d6 
55.50 ms