tx · 7X3LFxdPQt1bxd5JsemCmswSPgD2rUyJy6aBmT426SSi 3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL: -0.01000000 Waves 2021.09.12 19:51 [1700100] smart account 3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL > SELF 0.00000000 Waves
{ "type": 13, "id": "7X3LFxdPQt1bxd5JsemCmswSPgD2rUyJy6aBmT426SSi", "fee": 1000000, "feeAssetId": null, "timestamp": 1631465493895, "version": 2, "chainId": 84, "sender": "3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL", "senderPublicKey": "EYAKsFBespqQveBrfmX29rsehBJrSwQ3B6yN4ADyw8Kx", "proofs": [ "5eYXBePMsEo794Kfsmmn9T8TYHZGz64sT1KRe44PV4TdiMfwbtCu7eAzMLSo4juYuUfCcnx46sdWDacZmiZDbaVu" ], "script": "base64:AAIFAAAAAAAAAA0IAhIJCgcYGBERGAIBAAAACQAAAAAHZGlnaXRzOAAAAAAAAAAACAAAAAAGc2NhbGU4AAAAAAAF9eEAAAAAAAdzY2FsZTEyAAAAAOjUpRAAAAAAAAVhbHBoYQAAAAAAAAAAMgAAAAALYWxwaGFEaWdpdHMAAAAAAAAAAAIAAAAABGJldGEAAAAAAAK954ABAAAACHNrZXduZXNzAAAAAgAAAAF4AAAAAXkJAABpAAAAAgkAAGkAAAACCQAAZAAAAAIJAABrAAAAAwUAAAAHc2NhbGUxMgUAAAABeAUAAAABeQkAAGsAAAADBQAAAAdzY2FsZTEyBQAAAAF5BQAAAAF4AAAAAAAAAAACAAAAAAAAACcQAQAAAA1pbnZhcmlhbnRDYWxjAAAAAgAAAAF4AAAAAXkEAAAAAnNrCQEAAAAIc2tld25lc3MAAAACBQAAAAF4BQAAAAF5CQAAZAAAAAIJAABrAAAAAwkAAGQAAAACBQAAAAF4BQAAAAF5BQAAAAZzY2FsZTgJAABsAAAABgUAAAACc2sFAAAAB2RpZ2l0czgFAAAABWFscGhhBQAAAAthbHBoYURpZ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AZEAAAACBQAAAA0kbGlzdDYyNjM2MzEyAAAAAAAAAAADCQAAAgAAAAECAAAAEkxpc3Qgc2l6ZSBleGNlZWQgMwQAAAAPZXhjaGFuZ2VDb3VudGVyCAUAAAALJHQwNjIxMTYzMTIAAAACXzEEAAAADmFtb3VudHNXaXRoRmVlCAUAAAALJHQwNjIxMTYzMTIAAAACXzIEAAAADGFzc2V0c0lkU2VuZAgFAAAACyR0MDYyMTE2MzEyAAAAAl8zBAAAAA9hbW91bnRUb1JlY2lldmUJAAPwAAAAAgUAAAAEdGhpcwUAAAAOcmVjZWl2ZUFzc2V0SWQDAwkAAAAAAAACBQAAAA9leGNoYW5nZUNvdW50ZXIFAAAAC3JvdXRpbmdTaXplCQAAZwAAAAIFAAAAD2Ftb3VudFRvUmVjaWV2ZQUAAAASbWluQW1vdW50VG9SZWNlaXZlBwkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIFAAAAD2Ftb3VudFRvUmVjaWV2ZQUAAAAOcmVjZWl2ZUFzc2V0SWQFAAAAA25pbAkAAAIAAAABAgAAAD5yb3V0aW5nICE9IHJvdXRpbmdTaXplIG9yIGFtb3VudFRvUmVjaWV2ZSA8IG1pbkFtb3VudFRvUmVjZWl2ZQAAAABs8yVG", "height": 1700100, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BLpFyCWpUHFNyuwHprZGidX7x6yHV8xhUR8mVANTeTAF Next: 6Fs8rzUuoHKgpMcMxR6uxFxNXzdSQ8fr9Y28V6UgPTkc Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let digits8 = 8 | |
5 | 5 | ||
6 | 6 | let scale8 = 100000000 | |
7 | 7 | ||
8 | 8 | let scale12 = 1000000000000 | |
9 | 9 | ||
10 | 10 | let alpha = 50 | |
11 | 11 | ||
12 | 12 | let alphaDigits = 2 | |
13 | 13 | ||
14 | 14 | let beta = 46000000 | |
15 | 15 | ||
16 | 16 | func skewness (x,y) = (((fraction(scale12, x, y) + fraction(scale12, y, x)) / 2) / 10000) | |
17 | 17 | ||
18 | 18 | ||
19 | 19 | func invariantCalc (x,y) = { | |
20 | 20 | let sk = skewness(x, y) | |
21 | 21 | (fraction((x + y), scale8, pow(sk, digits8, alpha, alphaDigits, digits8, CEILING)) + (2 * fraction(pow(fraction(x, y, scale8), 0, 5, 1, (digits8 / 2), DOWN), pow((sk - beta), digits8, alpha, alphaDigits, digits8, DOWN), scale8))) | |
22 | 22 | } | |
23 | 23 | ||
24 | 24 | ||
25 | 25 | func checkPossibilty (pmtAmount,minAmountToReceive,exchangers,exchangersType,routingAssetsKeys,args1,args2) = { | |
26 | 26 | let commission = 3000 | |
27 | 27 | let commissionScaleDelimiter = 1000000 | |
28 | 28 | let dApp1TokenPay = getIntegerValue(addressFromStringValue(exchangers[0]), routingAssetsKeys[0]) | |
29 | 29 | let dApp1TokenGet = getIntegerValue(addressFromStringValue(exchangers[0]), routingAssetsKeys[1]) | |
30 | 30 | let dApp2TokenPay = getIntegerValue(addressFromStringValue(exchangers[1]), routingAssetsKeys[2]) | |
31 | 31 | let dApp2TokenGet = getIntegerValue(addressFromStringValue(exchangers[1]), routingAssetsKeys[3]) | |
32 | 32 | let getFrom1TradeWithFee = if ((exchangersType[0] == "cpmm")) | |
33 | 33 | then { | |
34 | 34 | let getFrom1Trade = fraction(dApp1TokenGet, pmtAmount, (pmtAmount + dApp1TokenPay)) | |
35 | 35 | fraction(getFrom1Trade, (commissionScaleDelimiter - commission), commissionScaleDelimiter) | |
36 | 36 | } | |
37 | 37 | else if ((exchangersType[0] == "flat")) | |
38 | 38 | then { | |
39 | 39 | let invariant = invariantCalc(dApp1TokenPay, dApp1TokenGet) | |
40 | 40 | let minAmountToReceive1 = args2[0] | |
41 | 41 | let invariantNew = invariantCalc((dApp1TokenPay + pmtAmount), (dApp1TokenGet - args2[0])) | |
42 | 42 | if ((invariantNew >= invariant)) | |
43 | 43 | then minAmountToReceive1 | |
44 | 44 | else throw("Flat contract: invariantNew < invariant") | |
45 | 45 | } | |
46 | 46 | else throw("Incorrect exchange type") | |
47 | 47 | let getFrom2TradeWithFee = if ((exchangersType[1] == "cpmm")) | |
48 | 48 | then { | |
49 | 49 | let getFrom2Trade = fraction(dApp2TokenGet, getFrom1TradeWithFee, (getFrom1TradeWithFee + dApp2TokenPay)) | |
50 | 50 | fraction(getFrom2Trade, (commissionScaleDelimiter - commission), commissionScaleDelimiter) | |
51 | 51 | } | |
52 | 52 | else if ((exchangersType[1] == "flat")) | |
53 | 53 | then { | |
54 | 54 | let invariant = invariantCalc(dApp2TokenPay, dApp2TokenGet) | |
55 | 55 | let minAmountToReceive2 = args2[1] | |
56 | 56 | let invariantNew = invariantCalc((dApp2TokenPay + getFrom1TradeWithFee), (dApp2TokenGet - minAmountToReceive2)) | |
57 | 57 | if ((invariantNew >= invariant)) | |
58 | 58 | then minAmountToReceive2 | |
59 | 59 | else throw("Flat contract: invariantNew < invariant") | |
60 | 60 | } | |
61 | 61 | else throw("Incorrect exchange type") | |
62 | 62 | if ((getFrom2TradeWithFee >= minAmountToReceive)) | |
63 | 63 | then true | |
64 | 64 | else false | |
65 | 65 | } | |
66 | 66 | ||
67 | 67 | ||
68 | 68 | @Callable(i) | |
69 | 69 | func routingTrade (exchangers,exchangersType,args1,args2,routingAssetsKeys,receiveAssetId,minAmountToReceive) = { | |
70 | 70 | let $t037483822 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
71 | 71 | let pmtAmount = $t037483822._1 | |
72 | 72 | let pmtAssetId = $t037483822._2 | |
73 | 73 | if (!(checkPossibilty(pmtAmount, minAmountToReceive, exchangers, exchangersType, routingAssetsKeys, args1, args2))) | |
74 | 74 | then throw("Check transaction possibilty: declined") | |
75 | 75 | else { | |
76 | 76 | let routingSize = size(exchangers) | |
77 | 77 | func exchangeFold (accumulated,exchanger) = { | |
78 | 78 | let $t041214184 = accumulated | |
79 | 79 | let exchangeCounter = $t041214184._1 | |
80 | 80 | let amountsWithFee = $t041214184._2 | |
81 | 81 | let assetsIdSend = $t041214184._3 | |
82 | 82 | if ((exchangeCounter == 0)) | |
83 | 83 | then { | |
84 | 84 | let exchangerAddress = addressFromStringValue(exchanger) | |
85 | 85 | let inv = if ((exchangersType[exchangeCounter] == "cpmm")) | |
86 | 86 | then invoke(exchangerAddress, "exchange", [args1[exchangeCounter]], [AttachedPayment(pmtAssetId, pmtAmount)]) | |
87 | 87 | else if ((exchangersType[exchangeCounter] == "flat")) | |
88 | 88 | then invoke(exchangerAddress, "exchange", [args1[exchangeCounter], args2[exchangeCounter]], [AttachedPayment(pmtAssetId, pmtAmount)]) | |
89 | 89 | else throw("Incorrect exchange type") | |
90 | 90 | if ((inv == inv)) | |
91 | 91 | then match inv { | |
92 | 92 | case inv: (Int, ByteVector) => | |
93 | 93 | let $t048804918 = inv | |
94 | 94 | let amountWithFee = $t048804918._1 | |
95 | 95 | let assetIdSend = $t048804918._2 | |
96 | 96 | $Tuple3((exchangeCounter + 1), amountWithFee, assetIdSend) | |
97 | 97 | case _ => | |
98 | 98 | throw("Incorrect invoke result: expected amountWithFee and assetsIdSend") | |
99 | 99 | } | |
100 | 100 | else throw("Strict value is not equal to itself.") | |
101 | 101 | } | |
102 | 102 | else if (if ((exchangeCounter > 0)) | |
103 | 103 | then (routingSize > exchangeCounter) | |
104 | 104 | else false) | |
105 | 105 | then { | |
106 | 106 | let exchangerAddress = addressFromStringValue(exchanger) | |
107 | 107 | let $t052645330 = $Tuple2(assetsIdSend, amountsWithFee) | |
108 | 108 | let pmtAssetIdRout = $t052645330._1 | |
109 | 109 | let pmtAmountRout = $t052645330._2 | |
110 | 110 | let inv = if ((exchangersType[exchangeCounter] == "cpmm")) | |
111 | 111 | then invoke(exchangerAddress, "exchange", [args1[exchangeCounter]], [AttachedPayment(pmtAssetIdRout, pmtAmountRout)]) | |
112 | 112 | else if ((exchangersType[exchangeCounter] == "flat")) | |
113 | 113 | then invoke(exchangerAddress, "exchange", [args1[exchangeCounter], args2[exchangeCounter]], [AttachedPayment(pmtAssetIdRout, pmtAmountRout)]) | |
114 | 114 | else throw("Incorrect exchange type") | |
115 | 115 | if ((inv == inv)) | |
116 | 116 | then match inv { | |
117 | 117 | case inv: (Int, ByteVector) => | |
118 | 118 | let $t059355973 = inv | |
119 | 119 | let amountWithFee = $t059355973._1 | |
120 | 120 | let assetIdSend = $t059355973._2 | |
121 | 121 | $Tuple3((exchangeCounter + 1), amountWithFee, assetIdSend) | |
122 | 122 | case _ => | |
123 | 123 | throw("Incorrect invoke result: expected amountWithFee and assetsIdSend") | |
124 | 124 | } | |
125 | 125 | else throw("Strict value is not equal to itself.") | |
126 | 126 | } | |
127 | 127 | else accumulated | |
128 | 128 | } | |
129 | 129 | ||
130 | 130 | let $t062116312 = { | |
131 | 131 | let $list62636312 = exchangers | |
132 | 132 | let $size62636312 = size($list62636312) | |
133 | 133 | let $acc062636312 = $Tuple3(0, 0, base58'') | |
134 | 134 | if (($size62636312 == 0)) | |
135 | 135 | then $acc062636312 | |
136 | 136 | else { | |
137 | 137 | let $acc162636312 = exchangeFold($acc062636312, $list62636312[0]) | |
138 | 138 | if (($size62636312 == 1)) | |
139 | 139 | then $acc162636312 | |
140 | 140 | else { | |
141 | 141 | let $acc262636312 = exchangeFold($acc162636312, $list62636312[1]) | |
142 | 142 | if (($size62636312 == 2)) | |
143 | 143 | then $acc262636312 | |
144 | 144 | else { | |
145 | 145 | let $acc362636312 = exchangeFold($acc262636312, $list62636312[2]) | |
146 | 146 | if (($size62636312 == 3)) | |
147 | 147 | then $acc362636312 | |
148 | 148 | else { | |
149 | 149 | let $acc462636312 = exchangeFold($acc362636312, $list62636312[3]) | |
150 | 150 | throw("List size exceed 3") | |
151 | 151 | } | |
152 | 152 | } | |
153 | 153 | } | |
154 | 154 | } | |
155 | 155 | } | |
156 | 156 | let exchangeCounter = $t062116312._1 | |
157 | 157 | let amountsWithFee = $t062116312._2 | |
158 | 158 | let assetsIdSend = $t062116312._3 | |
159 | 159 | let amountToRecieve = assetBalance(this, receiveAssetId) | |
160 | 160 | if (if ((exchangeCounter == routingSize)) | |
161 | 161 | then (amountToRecieve >= minAmountToReceive) | |
162 | 162 | else false) | |
163 | 163 | then [ScriptTransfer(i.caller, amountToRecieve, receiveAssetId)] | |
164 | 164 | else throw("routing != routingSize or amountToRecieve < minAmountToReceive") | |
165 | 165 | } | |
166 | 166 | } | |
167 | 167 | ||
168 | 168 |
github/deemru/w8io/026f985 29.62 ms ◑