tx · 2ayYC1B9HcySGdpJdeqK5BvqjZgbhcBdgvramWMAFTqh 3MzKSdTH2jFbypLsoNfrH7QgkzSbx3EYwCA: -0.03100000 Waves 2022.11.07 10:38 [2306431] smart account 3MzKSdTH2jFbypLsoNfrH7QgkzSbx3EYwCA > SELF 0.00000000 Waves
{ "type": 13, "id": "2ayYC1B9HcySGdpJdeqK5BvqjZgbhcBdgvramWMAFTqh", "fee": 3100000, "feeAssetId": null, "timestamp": 1667806676154, "version": 1, "sender": "3MzKSdTH2jFbypLsoNfrH7QgkzSbx3EYwCA", "senderPublicKey": "35yd3qw1gxKDxKwGAykHN9fANbXNWwseaUwbWDj24o3x", "proofs": [ "3XBCXJ7nQCceSm5TVcYvmfW47NGEh7GhP2o13sNn9r8Dm7y9RLyQ4jguSJraDeUb5hSZ26w7gEpf5288HEhAoYxx" ], "script": "base64:BgKWIggCEgMKAQgSAwoBCBIAEgQKAgEEEgQKAgEEEgMKAQESABIECgIIARIECgIIARIECgIIARIECgIBARIDCgEBEgUKAwEBARIFCgMBCAESBAoCAQgSBAoCAQgSBAoCCAgSBAoCCAgSBAoCCAESABIDCgEIEgUKAwEBARIECgIIARIECgIBARIECgIICBILCgkIAQECAQIIBAQSBgoECAgBCBIAIgZzY2FsZTgiDHNjYWxlOEJpZ0ludCIHc2NhbGUxOCIKemVyb0JpZ0ludCIEYmlnMCIEYmlnMSIEYmlnMiIKc2xpcHBhZ2U0RCILd2F2ZXNTdHJpbmciBUFtdWx0IgVEY29udiIDU0VQIgVFTVBUWSIKUG9vbEFjdGl2ZSIKUG9vbFB1dERpcyIOUG9vbE1hdGNoZXJEaXMiDFBvb2xTaHV0ZG93biIOaWR4UG9vbEFkZHJlc3MiCWlkeFBvb2xTdCIJaWR4TFBBc0lkIglpZHhBbUFzSWQiCWlkeFByQXNJZCILaWR4QW10QXNEY20iDWlkeFByaWNlQXNEY20iC2lkeElBbXRBc0lkIg1pZHhJUHJpY2VBc0lkIg9pZHhGYWN0U3Rha0Nud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acted Prev: 9pErnrZKdPdxrFXJLyUNtJawXPMFszYnNWf3zh8y5JnH Next: 9ENMVh8GQkMBTT5heFtv4hVnwzyxmc8Ab7giNzcQYduS Diff:
Old | New | Differences | |
---|---|---|---|
61 | 61 | ||
62 | 62 | let idxFactGwxRewCntr = 10 | |
63 | 63 | ||
64 | - | let feeDefault = fraction( | |
64 | + | let feeDefault = fraction(10, scale8, 10000) | |
65 | 65 | ||
66 | 66 | func t1 (origVal,origScaleMult) = fraction(toBigInt(origVal), scale18, toBigInt(origScaleMult)) | |
67 | 67 | ||
1125 | 1125 | ||
1126 | 1126 | ||
1127 | 1127 | @Callable(i) | |
1128 | + | func unstakeAndGetNoLess (unstakeAmount,noLessThenAmountAsset,noLessThenPriceAsset) = { | |
1129 | + | let isGetDisabled = if (igs()) | |
1130 | + | then true | |
1131 | + | else (cfgPoolStatus == PoolShutdown) | |
1132 | + | let checks = [if (!(isGetDisabled)) | |
1133 | + | then true | |
1134 | + | else throw("get operation is blocked by admin"), if ((size(i.payments) == 0)) | |
1135 | + | then true | |
1136 | + | else throw("no payments are expected")] | |
1137 | + | if ((checks == checks)) | |
1138 | + | then { | |
1139 | + | let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil) | |
1140 | + | if ((unstakeInv == unstakeInv)) | |
1141 | + | then { | |
1142 | + | let res = ego(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller) | |
1143 | + | let outAmAmt = res._1 | |
1144 | + | let outPrAmt = res._2 | |
1145 | + | let state = res._10 | |
1146 | + | let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset)) | |
1147 | + | then true | |
1148 | + | else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset)) | |
1149 | + | then true | |
1150 | + | else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))] | |
1151 | + | if ((checkAmounts == checkAmounts)) | |
1152 | + | then { | |
1153 | + | let burnLPAssetOnFactory = invoke(fca, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)]) | |
1154 | + | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
1155 | + | then state | |
1156 | + | else throw("Strict value is not equal to itself.") | |
1157 | + | } | |
1158 | + | else throw("Strict value is not equal to itself.") | |
1159 | + | } | |
1160 | + | else throw("Strict value is not equal to itself.") | |
1161 | + | } | |
1162 | + | else throw("Strict value is not equal to itself.") | |
1163 | + | } | |
1164 | + | ||
1165 | + | ||
1166 | + | ||
1167 | + | @Callable(i) | |
1128 | 1168 | func unstakeAndGetOneTknV2 (unstakeAmount,outAssetId,minOutAmount) = { | |
1129 | 1169 | let isPoolOneTokenOperationsDisabled = { | |
1130 | 1170 | let @ = invoke(fca, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
1151 | 1191 | let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), unstakeAmount], nil) | |
1152 | 1192 | if ((unstakeInv == unstakeInv)) | |
1153 | 1193 | then { | |
1154 | - | let $ | |
1155 | - | let state = $ | |
1156 | - | let totalAmount = $ | |
1194 | + | let $t04117241360 = getOneTknV2Internal(outAssetId, minOutAmount, [AttachedPayment(lpAssetId, unstakeAmount)], i.caller, i.originCaller, i.transactionId) | |
1195 | + | let state = $t04117241360._1 | |
1196 | + | let totalAmount = $t04117241360._2 | |
1157 | 1197 | $Tuple2(state, totalAmount) | |
1158 | 1198 | } | |
1159 | 1199 | else throw("Strict value is not equal to itself.") | |
1169 | 1209 | let amId = poolConfig[idxAmAsId] | |
1170 | 1210 | let prId = poolConfig[idxPrAsId] | |
1171 | 1211 | let lpId = poolConfig[idxLPAsId] | |
1172 | - | let $ | |
1173 | - | let lpAmount = $ | |
1174 | - | let state = $ | |
1175 | - | let feeAmount = $ | |
1176 | - | let bonus = $ | |
1212 | + | let $t04161941722 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", true) | |
1213 | + | let lpAmount = $t04161941722._1 | |
1214 | + | let state = $t04161941722._2 | |
1215 | + | let feeAmount = $t04161941722._3 | |
1216 | + | let bonus = $t04161941722._4 | |
1177 | 1217 | $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus)) | |
1178 | 1218 | } | |
1179 | 1219 | ||
1185 | 1225 | let amId = poolConfig[idxAmAsId] | |
1186 | 1226 | let prId = poolConfig[idxPrAsId] | |
1187 | 1227 | let lpId = poolConfig[idxLPAsId] | |
1188 | - | let $ | |
1189 | - | let lpAmount = $ | |
1190 | - | let state = $ | |
1191 | - | let feeAmount = $ | |
1192 | - | let bonus = $ | |
1228 | + | let $t04200142105 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", false) | |
1229 | + | let lpAmount = $t04200142105._1 | |
1230 | + | let state = $t04200142105._2 | |
1231 | + | let feeAmount = $t04200142105._3 | |
1232 | + | let bonus = $t04200142105._4 | |
1193 | 1233 | $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus)) | |
1194 | 1234 | } | |
1195 | 1235 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let scale8 = 100000000 | |
5 | 5 | ||
6 | 6 | let scale8BigInt = toBigInt(100000000) | |
7 | 7 | ||
8 | 8 | let scale18 = toBigInt(1000000000000000000) | |
9 | 9 | ||
10 | 10 | let zeroBigInt = toBigInt(0) | |
11 | 11 | ||
12 | 12 | let big0 = toBigInt(0) | |
13 | 13 | ||
14 | 14 | let big1 = toBigInt(1) | |
15 | 15 | ||
16 | 16 | let big2 = toBigInt(2) | |
17 | 17 | ||
18 | 18 | let slippage4D = toBigInt((scale8 - ((scale8 * 1) / scale8))) | |
19 | 19 | ||
20 | 20 | let wavesString = "WAVES" | |
21 | 21 | ||
22 | 22 | let Amult = "100" | |
23 | 23 | ||
24 | 24 | let Dconv = "1" | |
25 | 25 | ||
26 | 26 | let SEP = "__" | |
27 | 27 | ||
28 | 28 | let EMPTY = "" | |
29 | 29 | ||
30 | 30 | let PoolActive = 1 | |
31 | 31 | ||
32 | 32 | let PoolPutDis = 2 | |
33 | 33 | ||
34 | 34 | let PoolMatcherDis = 3 | |
35 | 35 | ||
36 | 36 | let PoolShutdown = 4 | |
37 | 37 | ||
38 | 38 | let idxPoolAddress = 1 | |
39 | 39 | ||
40 | 40 | let idxPoolSt = 2 | |
41 | 41 | ||
42 | 42 | let idxLPAsId = 3 | |
43 | 43 | ||
44 | 44 | let idxAmAsId = 4 | |
45 | 45 | ||
46 | 46 | let idxPrAsId = 5 | |
47 | 47 | ||
48 | 48 | let idxAmtAsDcm = 6 | |
49 | 49 | ||
50 | 50 | let idxPriceAsDcm = 7 | |
51 | 51 | ||
52 | 52 | let idxIAmtAsId = 8 | |
53 | 53 | ||
54 | 54 | let idxIPriceAsId = 9 | |
55 | 55 | ||
56 | 56 | let idxFactStakCntr = 1 | |
57 | 57 | ||
58 | 58 | let idxFactoryRestCntr = 6 | |
59 | 59 | ||
60 | 60 | let idxFactSlippCntr = 7 | |
61 | 61 | ||
62 | 62 | let idxFactGwxRewCntr = 10 | |
63 | 63 | ||
64 | - | let feeDefault = fraction( | |
64 | + | let feeDefault = fraction(10, scale8, 10000) | |
65 | 65 | ||
66 | 66 | func t1 (origVal,origScaleMult) = fraction(toBigInt(origVal), scale18, toBigInt(origScaleMult)) | |
67 | 67 | ||
68 | 68 | ||
69 | 69 | func f1 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), scale18)) | |
70 | 70 | ||
71 | 71 | ||
72 | 72 | func ts (amt,resScale,curScale) = fraction(amt, resScale, curScale) | |
73 | 73 | ||
74 | 74 | ||
75 | 75 | func abs (val) = if ((zeroBigInt > val)) | |
76 | 76 | then -(val) | |
77 | 77 | else val | |
78 | 78 | ||
79 | 79 | ||
80 | 80 | func absBigInt (val) = if ((zeroBigInt > val)) | |
81 | 81 | then -(val) | |
82 | 82 | else val | |
83 | 83 | ||
84 | 84 | ||
85 | 85 | func fc () = "%s__factoryContract" | |
86 | 86 | ||
87 | 87 | ||
88 | 88 | func mpk () = "%s__managerPublicKey" | |
89 | 89 | ||
90 | 90 | ||
91 | 91 | func pmpk () = "%s__pendingManagerPublicKey" | |
92 | 92 | ||
93 | 93 | ||
94 | 94 | func pl () = "%s%s__price__last" | |
95 | 95 | ||
96 | 96 | ||
97 | 97 | func ph (h,t) = makeString(["%s%s%d%d__price__history", toString(h), toString(t)], SEP) | |
98 | 98 | ||
99 | 99 | ||
100 | 100 | func pau (ua,txId) = ((("%s%s%s__P__" + ua) + "__") + txId) | |
101 | 101 | ||
102 | 102 | ||
103 | 103 | func gau (ua,txId) = ((("%s%s%s__G__" + ua) + "__") + txId) | |
104 | 104 | ||
105 | 105 | ||
106 | 106 | func aa () = "%s__amountAsset" | |
107 | 107 | ||
108 | 108 | ||
109 | 109 | func pa () = "%s__priceAsset" | |
110 | 110 | ||
111 | 111 | ||
112 | 112 | func amp () = "%s__amp" | |
113 | 113 | ||
114 | 114 | ||
115 | 115 | func ada () = "%s__addonAddr" | |
116 | 116 | ||
117 | 117 | ||
118 | 118 | let keyFee = "%s__fee" | |
119 | 119 | ||
120 | 120 | let fee = valueOrElse(getInteger(this, keyFee), feeDefault) | |
121 | 121 | ||
122 | 122 | func fcfg () = "%s__factoryConfig" | |
123 | 123 | ||
124 | 124 | ||
125 | 125 | func mtpk () = "%s%s__matcher__publicKey" | |
126 | 126 | ||
127 | 127 | ||
128 | 128 | func pc (iAmtAs,iPrAs) = (((("%d%d%s__" + iAmtAs) + "__") + iPrAs) + "__config") | |
129 | 129 | ||
130 | 130 | ||
131 | 131 | func mba (bAStr) = ("%s%s%s__mappings__baseAsset2internalId__" + bAStr) | |
132 | 132 | ||
133 | 133 | ||
134 | 134 | func aps () = "%s__shutdown" | |
135 | 135 | ||
136 | 136 | ||
137 | 137 | func keyAllowedLpStableScriptHash () = "%s__allowedLpStableScriptHash" | |
138 | 138 | ||
139 | 139 | ||
140 | 140 | func keyFeeCollectorAddress () = "%s__feeCollectorAddress" | |
141 | 141 | ||
142 | 142 | ||
143 | 143 | func toe (orV,sendrV,matchV) = throw(((((("Failed: ordValid=" + toString(orV)) + " sndrValid=") + toString(sendrV)) + " mtchrValid=") + toString(matchV))) | |
144 | 144 | ||
145 | 145 | ||
146 | 146 | func str (val) = match val { | |
147 | 147 | case valStr: String => | |
148 | 148 | valStr | |
149 | 149 | case _ => | |
150 | 150 | throw("fail cast to String") | |
151 | 151 | } | |
152 | 152 | ||
153 | 153 | ||
154 | 154 | func strf (addr,key) = valueOrErrorMessage(getString(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], "")) | |
155 | 155 | ||
156 | 156 | ||
157 | 157 | func intf (addr,key) = valueOrErrorMessage(getInteger(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], "")) | |
158 | 158 | ||
159 | 159 | ||
160 | 160 | func throwErr (msg) = throw(makeString(["lp_stable.ride:", msg], " ")) | |
161 | 161 | ||
162 | 162 | ||
163 | 163 | let fca = addressFromStringValue(strf(this, fc())) | |
164 | 164 | ||
165 | 165 | let A = strf(this, amp()) | |
166 | 166 | ||
167 | 167 | func igs () = valueOrElse(getBoolean(fca, aps()), false) | |
168 | 168 | ||
169 | 169 | ||
170 | 170 | func mp () = fromBase58String(strf(fca, mtpk())) | |
171 | 171 | ||
172 | 172 | ||
173 | 173 | let feeCollectorAddress = addressFromStringValue(strf(fca, keyFeeCollectorAddress())) | |
174 | 174 | ||
175 | 175 | func gpc () = { | |
176 | 176 | let amtAs = strf(this, aa()) | |
177 | 177 | let priceAs = strf(this, pa()) | |
178 | 178 | let iPriceAs = intf(fca, mba(priceAs)) | |
179 | 179 | let iAmtAs = intf(fca, mba(amtAs)) | |
180 | 180 | split(strf(fca, pc(toString(iAmtAs), toString(iPriceAs))), SEP) | |
181 | 181 | } | |
182 | 182 | ||
183 | 183 | ||
184 | 184 | func parseAssetId (input) = if ((input == wavesString)) | |
185 | 185 | then unit | |
186 | 186 | else fromBase58String(input) | |
187 | 187 | ||
188 | 188 | ||
189 | 189 | func assetIdToString (input) = if ((input == unit)) | |
190 | 190 | then wavesString | |
191 | 191 | else toBase58String(value(input)) | |
192 | 192 | ||
193 | 193 | ||
194 | 194 | func parsePoolConfig (poolConfig) = $Tuple7(addressFromStringValue(poolConfig[idxPoolAddress]), parseIntValue(poolConfig[idxPoolSt]), fromBase58String(poolConfig[idxLPAsId]), parseAssetId(poolConfig[idxAmAsId]), parseAssetId(poolConfig[idxPrAsId]), parseIntValue(poolConfig[idxAmtAsDcm]), parseIntValue(poolConfig[idxPriceAsDcm])) | |
195 | 195 | ||
196 | 196 | ||
197 | 197 | let poolConfigParsed = parsePoolConfig(gpc()) | |
198 | 198 | ||
199 | 199 | let $t068307016 = poolConfigParsed | |
200 | 200 | ||
201 | 201 | let cfgPoolAddress = $t068307016._1 | |
202 | 202 | ||
203 | 203 | let cfgPoolStatus = $t068307016._2 | |
204 | 204 | ||
205 | 205 | let cfgLpAssetId = $t068307016._3 | |
206 | 206 | ||
207 | 207 | let cfgAmountAssetId = $t068307016._4 | |
208 | 208 | ||
209 | 209 | let cfgPriceAssetId = $t068307016._5 | |
210 | 210 | ||
211 | 211 | let cfgAmountAssetDecimals = $t068307016._6 | |
212 | 212 | ||
213 | 213 | let cfgPriceAssetDecimals = $t068307016._7 | |
214 | 214 | ||
215 | 215 | func gfc () = split(strf(fca, fcfg()), SEP) | |
216 | 216 | ||
217 | 217 | ||
218 | 218 | let factoryConfig = gfc() | |
219 | 219 | ||
220 | 220 | let stakingContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactStakCntr]), "Invalid staking contract address") | |
221 | 221 | ||
222 | 222 | let slipageContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactSlippCntr]), "Invalid slipage contract address") | |
223 | 223 | ||
224 | 224 | let gwxContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactGwxRewCntr]), "Invalid gwx contract address") | |
225 | 225 | ||
226 | 226 | let restContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactoryRestCntr]), "Invalid gwx contract address") | |
227 | 227 | ||
228 | 228 | func dataPutActionInfo (inAmtAssetAmt,inPriceAssetAmt,outLpAmt,price,slipByUser,slippageReal,txHeight,txTimestamp,slipageAmAmt,slipagePrAmt) = makeString(["%d%d%d%d%d%d%d%d%d%d", toString(inAmtAssetAmt), toString(inPriceAssetAmt), toString(outLpAmt), toString(price), toString(slipByUser), toString(slippageReal), toString(txHeight), toString(txTimestamp), toString(slipageAmAmt), toString(slipagePrAmt)], SEP) | |
229 | 229 | ||
230 | 230 | ||
231 | 231 | func dataGetActionInfo (outAmtAssetAmt,outPriceAssetAmt,inLpAmt,price,txHeight,txTimestamp) = makeString(["%d%d%d%d%d%d", toString(outAmtAssetAmt), toString(outPriceAssetAmt), toString(inLpAmt), toString(price), toString(txHeight), toString(txTimestamp)], SEP) | |
232 | 232 | ||
233 | 233 | ||
234 | 234 | func getAccBalance (assetId) = if ((assetId == "WAVES")) | |
235 | 235 | then wavesBalance(this).available | |
236 | 236 | else assetBalance(this, fromBase58String(assetId)) | |
237 | 237 | ||
238 | 238 | ||
239 | 239 | func cpbi (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18) | |
240 | 240 | ||
241 | 241 | ||
242 | 242 | func vad (A1,A2,slippage) = { | |
243 | 243 | let diff = fraction((A1 - A2), scale8BigInt, A2) | |
244 | 244 | let pass = ((slippage - abs(diff)) > zeroBigInt) | |
245 | 245 | if (!(pass)) | |
246 | 246 | then throw(("Big slpg: " + toString(diff))) | |
247 | 247 | else $Tuple2(pass, min([A1, A2])) | |
248 | 248 | } | |
249 | 249 | ||
250 | 250 | ||
251 | 251 | func vd (D1,D0,slpg) = { | |
252 | 252 | let diff = fraction(D0, scale8BigInt, D1) | |
253 | 253 | let fail = (slpg > diff) | |
254 | 254 | if (if (fail) | |
255 | 255 | then true | |
256 | 256 | else (D0 > D1)) | |
257 | 257 | then throw(((((((toString(D0) + " ") + toString(D1)) + " ") + toString(diff)) + " ") + toString(slpg))) | |
258 | 258 | else fail | |
259 | 259 | } | |
260 | 260 | ||
261 | 261 | ||
262 | 262 | func pcp (amAssetDcm,prAssetDcm,amAmt,prAmt) = { | |
263 | 263 | let amtAsAmtX18 = t1(amAmt, amAssetDcm) | |
264 | 264 | let prAsAmtX18 = t1(prAmt, prAssetDcm) | |
265 | 265 | cpbi(prAsAmtX18, amtAsAmtX18) | |
266 | 266 | } | |
267 | 267 | ||
268 | 268 | ||
269 | 269 | func calcPrices (amAmt,prAmt,lpAmt) = { | |
270 | 270 | let cfg = gpc() | |
271 | 271 | let amtAsDcm = parseIntValue(cfg[idxAmtAsDcm]) | |
272 | 272 | let prAsDcm = parseIntValue(cfg[idxPriceAsDcm]) | |
273 | 273 | let priceX18 = pcp(amtAsDcm, prAsDcm, amAmt, prAmt) | |
274 | 274 | let amAmtX18 = t1(amAmt, amtAsDcm) | |
275 | 275 | let prAmtX18 = t1(prAmt, prAsDcm) | |
276 | 276 | let lpAmtX18 = t1(lpAmt, scale8) | |
277 | 277 | let lpPrInAmAsX18 = cpbi(amAmtX18, lpAmtX18) | |
278 | 278 | let lpPrInPrAsX18 = cpbi(prAmtX18, lpAmtX18) | |
279 | 279 | [priceX18, lpPrInAmAsX18, lpPrInPrAsX18] | |
280 | 280 | } | |
281 | 281 | ||
282 | 282 | ||
283 | 283 | func calculatePrices (amAmt,prAmt,lpAmt) = { | |
284 | 284 | let p = calcPrices(amAmt, prAmt, lpAmt) | |
285 | 285 | [f1(p[0], scale8), f1(p[1], scale8), f1(p[2], scale8)] | |
286 | 286 | } | |
287 | 287 | ||
288 | 288 | ||
289 | 289 | func takeFee (amount) = { | |
290 | 290 | let feeAmount = fraction(amount, fee, scale8) | |
291 | 291 | $Tuple2((amount - feeAmount), feeAmount) | |
292 | 292 | } | |
293 | 293 | ||
294 | 294 | ||
295 | 295 | func ego (txId58,pmtAssetId,pmtLpAmt,userAddress) = { | |
296 | 296 | let cfg = gpc() | |
297 | 297 | let lpId = cfg[idxLPAsId] | |
298 | 298 | let amId = cfg[idxAmAsId] | |
299 | 299 | let prId = cfg[idxPrAsId] | |
300 | 300 | let amDcm = parseIntValue(cfg[idxAmtAsDcm]) | |
301 | 301 | let prDcm = parseIntValue(cfg[idxPriceAsDcm]) | |
302 | 302 | let sts = cfg[idxPoolSt] | |
303 | 303 | let lpEmiss = valueOrErrorMessage(assetInfo(fromBase58String(lpId)), "Wrong LP id").quantity | |
304 | 304 | if ((lpId != pmtAssetId)) | |
305 | 305 | then throw("Wrong pmt asset") | |
306 | 306 | else { | |
307 | 307 | let amBalance = getAccBalance(amId) | |
308 | 308 | let amBalanceX18 = t1(amBalance, amDcm) | |
309 | 309 | let prBalance = getAccBalance(prId) | |
310 | 310 | let prBalanceX18 = t1(prBalance, prDcm) | |
311 | 311 | let curPriceX18 = cpbi(prBalanceX18, amBalanceX18) | |
312 | 312 | let curPrice = f1(curPriceX18, scale8) | |
313 | 313 | let pmtLpAmtX18 = t1(pmtLpAmt, scale8) | |
314 | 314 | let lpEmissX18 = t1(lpEmiss, scale8) | |
315 | 315 | let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissX18) | |
316 | 316 | let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissX18) | |
317 | 317 | let outAmAmt = f1(outAmAmtX18, amDcm) | |
318 | 318 | let outPrAmt = f1(outPrAmtX18, prDcm) | |
319 | 319 | let state = if ((txId58 == "")) | |
320 | 320 | then nil | |
321 | 321 | else [ScriptTransfer(userAddress, outAmAmt, if ((amId == "WAVES")) | |
322 | 322 | then unit | |
323 | 323 | else fromBase58String(amId)), ScriptTransfer(userAddress, outPrAmt, if ((prId == "WAVES")) | |
324 | 324 | then unit | |
325 | 325 | else fromBase58String(prId)), StringEntry(gau(toString(userAddress), txId58), dataGetActionInfo(outAmAmt, outPrAmt, pmtLpAmt, curPrice, height, lastBlock.timestamp)), IntegerEntry(pl(), curPrice), IntegerEntry(ph(height, lastBlock.timestamp), curPrice)] | |
326 | 326 | $Tuple10(outAmAmt, outPrAmt, amId, prId, amBalance, prBalance, lpEmiss, curPriceX18, sts, state) | |
327 | 327 | } | |
328 | 328 | } | |
329 | 329 | ||
330 | 330 | ||
331 | 331 | func epo (txId58,slippage,inAmAmt,inAmId,inPrAmt,inPrId,userAddress,isEval,emitLp,isOneAsset,validateSlippage,pmtAmt,pmtId) = { | |
332 | 332 | let cfg = gpc() | |
333 | 333 | let lpId = fromBase58String(cfg[idxLPAsId]) | |
334 | 334 | let amIdStr = cfg[idxAmAsId] | |
335 | 335 | let prIdStr = cfg[idxPrAsId] | |
336 | 336 | let inAmIdStr = cfg[idxIAmtAsId] | |
337 | 337 | let inPrIdStr = cfg[idxIPriceAsId] | |
338 | 338 | let amtDcm = parseIntValue(cfg[idxAmtAsDcm]) | |
339 | 339 | let priceDcm = parseIntValue(cfg[idxPriceAsDcm]) | |
340 | 340 | let sts = cfg[idxPoolSt] | |
341 | 341 | let lpEm = valueOrErrorMessage(assetInfo(lpId), "Wr lp as").quantity | |
342 | 342 | let amBalance = if (isEval) | |
343 | 343 | then getAccBalance(amIdStr) | |
344 | 344 | else if (if (isOneAsset) | |
345 | 345 | then (pmtId == amIdStr) | |
346 | 346 | else false) | |
347 | 347 | then (getAccBalance(amIdStr) - pmtAmt) | |
348 | 348 | else if (isOneAsset) | |
349 | 349 | then getAccBalance(amIdStr) | |
350 | 350 | else (getAccBalance(amIdStr) - inAmAmt) | |
351 | 351 | let prBalance = if (isEval) | |
352 | 352 | then getAccBalance(prIdStr) | |
353 | 353 | else if (if (isOneAsset) | |
354 | 354 | then (pmtId == prIdStr) | |
355 | 355 | else false) | |
356 | 356 | then (getAccBalance(prIdStr) - pmtAmt) | |
357 | 357 | else if (isOneAsset) | |
358 | 358 | then getAccBalance(prIdStr) | |
359 | 359 | else (getAccBalance(prIdStr) - inPrAmt) | |
360 | 360 | let inAmAssetAmtX18 = t1(inAmAmt, amtDcm) | |
361 | 361 | let inPrAssetAmtX18 = t1(inPrAmt, priceDcm) | |
362 | 362 | let userPriceX18 = cpbi(inPrAssetAmtX18, inAmAssetAmtX18) | |
363 | 363 | let amBalanceX18 = t1(amBalance, amtDcm) | |
364 | 364 | let prBalanceX18 = t1(prBalance, priceDcm) | |
365 | 365 | let r = if ((lpEm == 0)) | |
366 | 366 | then { | |
367 | 367 | let curPriceX18 = zeroBigInt | |
368 | 368 | let slippageX18 = zeroBigInt | |
369 | 369 | let lpAmtX18 = pow((inAmAssetAmtX18 * inPrAssetAmtX18), 0, toBigInt(5), 1, 0, DOWN) | |
370 | 370 | $Tuple5(f1(lpAmtX18, scale8), f1(inAmAssetAmtX18, amtDcm), f1(inPrAssetAmtX18, priceDcm), cpbi((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18) | |
371 | 371 | } | |
372 | 372 | else { | |
373 | 373 | let curPriceX18 = cpbi(prBalanceX18, amBalanceX18) | |
374 | 374 | let slippageRealX18 = fraction(abs((curPriceX18 - userPriceX18)), scale18, curPriceX18) | |
375 | 375 | let slippageX18 = t1(slippage, scale8) | |
376 | 376 | if (if (if (validateSlippage) | |
377 | 377 | then (curPriceX18 != zeroBigInt) | |
378 | 378 | else false) | |
379 | 379 | then (slippageRealX18 > slippageX18) | |
380 | 380 | else false) | |
381 | 381 | then throw(((("Price slippage " + toString(slippageRealX18)) + " > ") + toString(slippageX18))) | |
382 | 382 | else { | |
383 | 383 | let lpEmissionX18 = t1(lpEm, scale8) | |
384 | 384 | let prViaAmX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18) | |
385 | 385 | let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18) | |
386 | 386 | let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18)) | |
387 | 387 | then $Tuple2(amViaPrX18, inPrAssetAmtX18) | |
388 | 388 | else $Tuple2(inAmAssetAmtX18, prViaAmX18) | |
389 | 389 | let expAmtAssetAmtX18 = expectedAmts._1 | |
390 | 390 | let expPriceAssetAmtX18 = expectedAmts._2 | |
391 | 391 | let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18) | |
392 | 392 | $Tuple5(f1(lpAmtX18, scale8), f1(expAmtAssetAmtX18, amtDcm), f1(expPriceAssetAmtX18, priceDcm), curPriceX18, slippageX18) | |
393 | 393 | } | |
394 | 394 | } | |
395 | 395 | let calcLpAmt = r._1 | |
396 | 396 | let calcAmAssetPmt = r._2 | |
397 | 397 | let calcPrAssetPmt = r._3 | |
398 | 398 | let curPrice = f1(r._4, scale8) | |
399 | 399 | let slippageCalc = f1(r._5, scale8) | |
400 | 400 | if ((0 >= calcLpAmt)) | |
401 | 401 | then throw("LP <= 0") | |
402 | 402 | else { | |
403 | 403 | let emitLpAmt = if (!(emitLp)) | |
404 | 404 | then 0 | |
405 | 405 | else calcLpAmt | |
406 | 406 | let amDiff = (inAmAmt - calcAmAssetPmt) | |
407 | 407 | let prDiff = (inPrAmt - calcPrAssetPmt) | |
408 | 408 | let $t01744717792 = if (if (isOneAsset) | |
409 | 409 | then (pmtId == amIdStr) | |
410 | 410 | else false) | |
411 | 411 | then $Tuple2(pmtAmt, 0) | |
412 | 412 | else if (if (isOneAsset) | |
413 | 413 | then (pmtId == prIdStr) | |
414 | 414 | else false) | |
415 | 415 | then $Tuple2(0, pmtAmt) | |
416 | 416 | else $Tuple2(calcAmAssetPmt, calcPrAssetPmt) | |
417 | 417 | let writeAmAmt = $t01744717792._1 | |
418 | 418 | let writePrAmt = $t01744717792._2 | |
419 | 419 | let commonState = [IntegerEntry(pl(), curPrice), IntegerEntry(ph(height, lastBlock.timestamp), curPrice), StringEntry(pau(userAddress, txId58), dataPutActionInfo(writeAmAmt, writePrAmt, emitLpAmt, curPrice, slippage, slippageCalc, height, lastBlock.timestamp, amDiff, prDiff))] | |
420 | 420 | $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEm, lpId, sts, commonState, amDiff, prDiff, inAmId, inPrId) | |
421 | 421 | } | |
422 | 422 | } | |
423 | 423 | ||
424 | 424 | ||
425 | 425 | func moa (order) = { | |
426 | 426 | let cfg = gpc() | |
427 | 427 | let amtAsId = cfg[idxAmAsId] | |
428 | 428 | let prAsId = cfg[idxPrAsId] | |
429 | 429 | let sts = parseIntValue(cfg[idxPoolSt]) | |
430 | 430 | let amtAsDcm = parseIntValue(cfg[idxAmtAsDcm]) | |
431 | 431 | let prAsDcm = parseIntValue(cfg[idxPriceAsDcm]) | |
432 | 432 | let accAmtAsBalance = getAccBalance(amtAsId) | |
433 | 433 | let accPrAsBalance = getAccBalance(prAsId) | |
434 | 434 | let curPriceX18 = if ((order.orderType == Buy)) | |
435 | 435 | then pcp(amtAsDcm, prAsDcm, (accAmtAsBalance + order.amount), accPrAsBalance) | |
436 | 436 | else pcp(amtAsDcm, prAsDcm, (accAmtAsBalance - order.amount), accPrAsBalance) | |
437 | 437 | let curPrice = f1(curPriceX18, scale8) | |
438 | 438 | if (if (if (igs()) | |
439 | 439 | then true | |
440 | 440 | else (sts == PoolMatcherDis)) | |
441 | 441 | then true | |
442 | 442 | else (sts == PoolShutdown)) | |
443 | 443 | then throw("Admin blocked") | |
444 | 444 | else { | |
445 | 445 | let orAmtAsset = order.assetPair.amountAsset | |
446 | 446 | let orAmtAsStr = if ((orAmtAsset == unit)) | |
447 | 447 | then "WAVES" | |
448 | 448 | else toBase58String(value(orAmtAsset)) | |
449 | 449 | let orPrAsset = order.assetPair.priceAsset | |
450 | 450 | let orPrAsStr = if ((orPrAsset == unit)) | |
451 | 451 | then "WAVES" | |
452 | 452 | else toBase58String(value(orPrAsset)) | |
453 | 453 | if (if ((orAmtAsStr != amtAsId)) | |
454 | 454 | then true | |
455 | 455 | else (orPrAsStr != prAsId)) | |
456 | 456 | then throw("Wr assets") | |
457 | 457 | else { | |
458 | 458 | let orderPrice = order.price | |
459 | 459 | let priceDcm = fraction(scale8, prAsDcm, amtAsDcm) | |
460 | 460 | let castOrderPrice = ts(orderPrice, scale8, priceDcm) | |
461 | 461 | let isOrderPriceValid = if ((order.orderType == Buy)) | |
462 | 462 | then (curPrice >= castOrderPrice) | |
463 | 463 | else (castOrderPrice >= curPrice) | |
464 | 464 | true | |
465 | 465 | } | |
466 | 466 | } | |
467 | 467 | } | |
468 | 468 | ||
469 | 469 | ||
470 | 470 | func cg (i) = if ((size(i.payments) != 1)) | |
471 | 471 | then throw("1 pmnt exp") | |
472 | 472 | else { | |
473 | 473 | let pmt = value(i.payments[0]) | |
474 | 474 | let pmtAssetId = value(pmt.assetId) | |
475 | 475 | let pmtAmt = pmt.amount | |
476 | 476 | let r = ego(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller) | |
477 | 477 | let outAmAmt = r._1 | |
478 | 478 | let outPrAmt = r._2 | |
479 | 479 | let sts = parseIntValue(r._9) | |
480 | 480 | let state = r._10 | |
481 | 481 | if (if (igs()) | |
482 | 482 | then true | |
483 | 483 | else (sts == PoolShutdown)) | |
484 | 484 | then throw(("Admin blocked: " + toString(sts))) | |
485 | 485 | else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state) | |
486 | 486 | } | |
487 | 487 | ||
488 | 488 | ||
489 | 489 | func cp (caller,txId,amAsPmt,prAsPmt,slippage,emitLp,isOneAsset,validateSlippage,pmtAmt,pmtId) = { | |
490 | 490 | let r = epo(txId, slippage, value(amAsPmt).amount, value(amAsPmt).assetId, value(prAsPmt).amount, value(prAsPmt).assetId, caller, (txId == ""), emitLp, isOneAsset, validateSlippage, pmtAmt, pmtId) | |
491 | 491 | let sts = parseIntValue(r._8) | |
492 | 492 | if (if (if (igs()) | |
493 | 493 | then true | |
494 | 494 | else (sts == PoolPutDis)) | |
495 | 495 | then true | |
496 | 496 | else (sts == PoolShutdown)) | |
497 | 497 | then throw(("Blocked:" + toString(sts))) | |
498 | 498 | else r | |
499 | 499 | } | |
500 | 500 | ||
501 | 501 | ||
502 | 502 | func getD (xp) = { | |
503 | 503 | let n = big2 | |
504 | 504 | let xp0 = xp[0] | |
505 | 505 | let xp1 = xp[1] | |
506 | 506 | let aPrecision = parseBigIntValue(Amult) | |
507 | 507 | let a = (parseBigIntValue(A) * aPrecision) | |
508 | 508 | let s = (xp0 + xp1) | |
509 | 509 | if ((s == big0)) | |
510 | 510 | then big0 | |
511 | 511 | else { | |
512 | 512 | let ann = (a * n) | |
513 | 513 | let xp0_xp1_n_n = (((xp0 * xp1) * n) * n) | |
514 | 514 | let ann_s_aPrecision = ((ann * s) / aPrecision) | |
515 | 515 | let ann_aPrecision = (ann - aPrecision) | |
516 | 516 | let n1 = (n + big1) | |
517 | 517 | func calc (acc,cur) = { | |
518 | 518 | let $t02234422364 = acc | |
519 | 519 | let d = $t02234422364._1 | |
520 | 520 | let found = $t02234422364._2 | |
521 | 521 | if ((found != unit)) | |
522 | 522 | then acc | |
523 | 523 | else { | |
524 | 524 | let dp = (((d * d) * d) / xp0_xp1_n_n) | |
525 | 525 | let dNext = (((ann_s_aPrecision + (dp * n)) * d) / (((ann_aPrecision * d) / aPrecision) + (n1 * dp))) | |
526 | 526 | let dDiff = absBigInt((dNext - value(d))) | |
527 | 527 | if ((big1 >= dDiff)) | |
528 | 528 | then $Tuple2(dNext, cur) | |
529 | 529 | else $Tuple2(dNext, unit) | |
530 | 530 | } | |
531 | 531 | } | |
532 | 532 | ||
533 | 533 | let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] | |
534 | 534 | let $t02278522832 = { | |
535 | 535 | let $l = arr | |
536 | 536 | let $s = size($l) | |
537 | 537 | let $acc0 = $Tuple2(s, unit) | |
538 | 538 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
539 | 539 | then $a | |
540 | 540 | else calc($a, $l[$i]) | |
541 | 541 | ||
542 | 542 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
543 | 543 | then $a | |
544 | 544 | else throw("List size exceeds 15") | |
545 | 545 | ||
546 | 546 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
547 | 547 | } | |
548 | 548 | let d = $t02278522832._1 | |
549 | 549 | let found = $t02278522832._2 | |
550 | 550 | if ((found != unit)) | |
551 | 551 | then d | |
552 | 552 | else throw(("D calculation error, D = " + toString(d))) | |
553 | 553 | } | |
554 | 554 | } | |
555 | 555 | ||
556 | 556 | ||
557 | 557 | func getYD (xp,i,D) = { | |
558 | 558 | let n = big2 | |
559 | 559 | let x = xp[if ((i == 0)) | |
560 | 560 | then 1 | |
561 | 561 | else 0] | |
562 | 562 | let aPrecision = parseBigIntValue(Amult) | |
563 | 563 | let a = (parseBigIntValue(A) * aPrecision) | |
564 | 564 | let s = x | |
565 | 565 | let ann = (a * n) | |
566 | 566 | let c = (((((D * D) / (x * n)) * D) * aPrecision) / (ann * n)) | |
567 | 567 | let b = ((s + ((D * aPrecision) / ann)) - D) | |
568 | 568 | func calc (acc,cur) = { | |
569 | 569 | let $t02333223352 = acc | |
570 | 570 | let y = $t02333223352._1 | |
571 | 571 | let found = $t02333223352._2 | |
572 | 572 | if ((found != unit)) | |
573 | 573 | then acc | |
574 | 574 | else { | |
575 | 575 | let yNext = (((y * y) + c) / ((big2 * y) + b)) | |
576 | 576 | let yDiff = absBigInt((yNext - value(y))) | |
577 | 577 | if ((big1 >= yDiff)) | |
578 | 578 | then $Tuple2(yNext, cur) | |
579 | 579 | else $Tuple2(yNext, unit) | |
580 | 580 | } | |
581 | 581 | } | |
582 | 582 | ||
583 | 583 | let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] | |
584 | 584 | let $t02365923706 = { | |
585 | 585 | let $l = arr | |
586 | 586 | let $s = size($l) | |
587 | 587 | let $acc0 = $Tuple2(D, unit) | |
588 | 588 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
589 | 589 | then $a | |
590 | 590 | else calc($a, $l[$i]) | |
591 | 591 | ||
592 | 592 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
593 | 593 | then $a | |
594 | 594 | else throw("List size exceeds 15") | |
595 | 595 | ||
596 | 596 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
597 | 597 | } | |
598 | 598 | let y = $t02365923706._1 | |
599 | 599 | let found = $t02365923706._2 | |
600 | 600 | if ((found != unit)) | |
601 | 601 | then y | |
602 | 602 | else throw(("Y calculation error, Y = " + toString(y))) | |
603 | 603 | } | |
604 | 604 | ||
605 | 605 | ||
606 | 606 | func calcPutOneTkn (pmtAmtRaw,pmtAssetId,userAddress,txId,withTakeFee) = { | |
607 | 607 | let poolConfig = gpc() | |
608 | 608 | let amId = poolConfig[idxAmAsId] | |
609 | 609 | let prId = poolConfig[idxPrAsId] | |
610 | 610 | let lpId = poolConfig[idxLPAsId] | |
611 | 611 | let amtDcm = parseIntValue(poolConfig[idxAmtAsDcm]) | |
612 | 612 | let priceDcm = parseIntValue(poolConfig[idxPriceAsDcm]) | |
613 | 613 | let lpAssetEmission = toBigInt(valueOrErrorMessage(assetInfo(fromBase58String(lpId)), "invalid lp asset").quantity) | |
614 | 614 | let chechEmission = if ((lpAssetEmission > big0)) | |
615 | 615 | then true | |
616 | 616 | else throw("initial deposit requires all coins") | |
617 | 617 | if ((chechEmission == chechEmission)) | |
618 | 618 | then { | |
619 | 619 | let amBalance = getAccBalance(amId) | |
620 | 620 | let prBalance = getAccBalance(prId) | |
621 | 621 | let $t02448924951 = if ((txId == "")) | |
622 | 622 | then $Tuple2(amBalance, prBalance) | |
623 | 623 | else if ((pmtAssetId == amId)) | |
624 | 624 | then if ((pmtAmtRaw > amBalance)) | |
625 | 625 | then throw("invalid payment amount") | |
626 | 626 | else $Tuple2((amBalance - pmtAmtRaw), prBalance) | |
627 | 627 | else if ((pmtAssetId == prId)) | |
628 | 628 | then if ((pmtAmtRaw > prBalance)) | |
629 | 629 | then throw("invalid payment amount") | |
630 | 630 | else $Tuple2(amBalance, (prBalance - pmtAmtRaw)) | |
631 | 631 | else throw("wrong pmtAssetId") | |
632 | 632 | let amBalanceOld = $t02448924951._1 | |
633 | 633 | let prBalanceOld = $t02448924951._2 | |
634 | 634 | let $t02495725133 = if ((pmtAssetId == amId)) | |
635 | 635 | then $Tuple2(pmtAmtRaw, 0) | |
636 | 636 | else if ((pmtAssetId == prId)) | |
637 | 637 | then $Tuple2(0, pmtAmtRaw) | |
638 | 638 | else throw("invalid payment") | |
639 | 639 | let amAmountRaw = $t02495725133._1 | |
640 | 640 | let prAmountRaw = $t02495725133._2 | |
641 | 641 | let $t02513725376 = if (withTakeFee) | |
642 | 642 | then $Tuple3(takeFee(amAmountRaw)._1, takeFee(prAmountRaw)._1, takeFee(pmtAmtRaw)._2) | |
643 | 643 | else $Tuple3(amAmountRaw, prAmountRaw, 0) | |
644 | 644 | let amAmount = $t02513725376._1 | |
645 | 645 | let prAmount = $t02513725376._2 | |
646 | 646 | let feeAmount = $t02513725376._3 | |
647 | 647 | let amBalanceNew = (amBalanceOld + amAmount) | |
648 | 648 | let prBalanceNew = (prBalanceOld + prAmount) | |
649 | 649 | let D0 = getD([toBigInt(amBalanceOld), toBigInt(prBalanceOld)]) | |
650 | 650 | let D1 = getD([toBigInt(amBalanceNew), toBigInt(prBalanceNew)]) | |
651 | 651 | let checkD = if ((D1 > D0)) | |
652 | 652 | then true | |
653 | 653 | else throw() | |
654 | 654 | if ((checkD == checkD)) | |
655 | 655 | then { | |
656 | 656 | let lpAmount = fraction(lpAssetEmission, (D1 - D0), D0) | |
657 | 657 | let curPrice = f1(cpbi(t1(prBalanceNew, priceDcm), t1(amBalanceNew, amtDcm)), scale8) | |
658 | 658 | let commonState = [IntegerEntry(pl(), curPrice), IntegerEntry(ph(height, lastBlock.timestamp), curPrice), StringEntry(pau(userAddress, txId), dataPutActionInfo(amAmountRaw, prAmountRaw, toInt(lpAmount), curPrice, 0, 0, height, lastBlock.timestamp, 0, 0))] | |
659 | 659 | let poolProportion = fraction(prBalanceOld, scale8, amBalanceOld) | |
660 | 660 | let amountAssetPart = fraction(pmtAmtRaw, scale8, (poolProportion + scale8)) | |
661 | 661 | let priceAssetPart = (pmtAmtRaw - amountAssetPart) | |
662 | 662 | let lpAmtBoth = fraction(lpAssetEmission, toBigInt(priceAssetPart), toBigInt(prBalanceOld)) | |
663 | 663 | let bonus = toInt(fraction((lpAmount - lpAmtBoth), scale8BigInt, lpAmtBoth)) | |
664 | 664 | $Tuple4(toInt(lpAmount), commonState, feeAmount, bonus) | |
665 | 665 | } | |
666 | 666 | else throw("Strict value is not equal to itself.") | |
667 | 667 | } | |
668 | 668 | else throw("Strict value is not equal to itself.") | |
669 | 669 | } | |
670 | 670 | ||
671 | 671 | ||
672 | 672 | func getOneTknV2Internal (outAssetId,minOutAmount,payments,caller,originCaller,transactionId) = { | |
673 | 673 | let poolConfig = gpc() | |
674 | 674 | let lpId = poolConfig[idxLPAsId] | |
675 | 675 | let amId = poolConfig[idxAmAsId] | |
676 | 676 | let prId = poolConfig[idxPrAsId] | |
677 | 677 | let amDecimals = parseIntValue(poolConfig[idxAmtAsDcm]) | |
678 | 678 | let prDecimals = parseIntValue(poolConfig[idxPriceAsDcm]) | |
679 | 679 | let poolStatus = poolConfig[idxPoolSt] | |
680 | 680 | let userAddress = if ((caller == restContract)) | |
681 | 681 | then originCaller | |
682 | 682 | else caller | |
683 | 683 | let pmt = value(payments[0]) | |
684 | 684 | let pmtAssetId = value(pmt.assetId) | |
685 | 685 | let pmtAmt = pmt.amount | |
686 | 686 | let txId58 = toBase58String(transactionId) | |
687 | 687 | if ((lpId != toBase58String(pmtAssetId))) | |
688 | 688 | then throw("Wrong LP") | |
689 | 689 | else { | |
690 | 690 | let amBalance = getAccBalance(amId) | |
691 | 691 | let prBalance = getAccBalance(prId) | |
692 | 692 | let $t02737827486 = { | |
693 | 693 | let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, pmtAmt], nil) | |
694 | 694 | if ($isInstanceOf(@, "(Int, Int)")) | |
695 | 695 | then @ | |
696 | 696 | else throw(($getType(@) + " couldn't be cast to (Int, Int)")) | |
697 | 697 | } | |
698 | 698 | let totalGet = $t02737827486._1 | |
699 | 699 | let feeAmount = $t02737827486._2 | |
700 | 700 | let totalAmount = if (if ((minOutAmount > 0)) | |
701 | 701 | then (minOutAmount > totalGet) | |
702 | 702 | else false) | |
703 | 703 | then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], "")) | |
704 | 704 | else totalGet | |
705 | 705 | let $t02767627983 = if ((outAssetId == amId)) | |
706 | 706 | then $Tuple4(totalAmount, 0, ((amBalance - totalAmount) - feeAmount), prBalance) | |
707 | 707 | else if ((outAssetId == prId)) | |
708 | 708 | then $Tuple4(0, totalAmount, amBalance, ((prBalance - totalAmount) - feeAmount)) | |
709 | 709 | else throw("invalid out asset id") | |
710 | 710 | let outAm = $t02767627983._1 | |
711 | 711 | let outPr = $t02767627983._2 | |
712 | 712 | let amBalanceNew = $t02767627983._3 | |
713 | 713 | let prBalanceNew = $t02767627983._4 | |
714 | 714 | let curPrX18 = cpbi(t1(prBalanceNew, prDecimals), t1(amBalanceNew, amDecimals)) | |
715 | 715 | let curPr = f1(curPrX18, scale8) | |
716 | 716 | let outAssetIdOrWaves = if ((outAssetId == "WAVES")) | |
717 | 717 | then unit | |
718 | 718 | else fromBase58String(outAssetId) | |
719 | 719 | let sendFeeToMatcher = if ((feeAmount > 0)) | |
720 | 720 | then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetIdOrWaves)] | |
721 | 721 | else nil | |
722 | 722 | let state = ([ScriptTransfer(userAddress, totalAmount, outAssetIdOrWaves), StringEntry(gau(toString(userAddress), txId58), dataGetActionInfo(outAm, outPr, pmtAmt, curPr, height, lastBlock.timestamp)), IntegerEntry(pl(), curPr), IntegerEntry(ph(height, lastBlock.timestamp), curPr)] ++ sendFeeToMatcher) | |
723 | 723 | if ((state == state)) | |
724 | 724 | then { | |
725 | 725 | let burn = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
726 | 726 | if ((burn == burn)) | |
727 | 727 | then $Tuple2(state, totalAmount) | |
728 | 728 | else throw("Strict value is not equal to itself.") | |
729 | 729 | } | |
730 | 730 | else throw("Strict value is not equal to itself.") | |
731 | 731 | } | |
732 | 732 | } | |
733 | 733 | ||
734 | 734 | ||
735 | 735 | func m () = match getString(mpk()) { | |
736 | 736 | case s: String => | |
737 | 737 | fromBase58String(s) | |
738 | 738 | case _: Unit => | |
739 | 739 | unit | |
740 | 740 | case _ => | |
741 | 741 | throw("Match error") | |
742 | 742 | } | |
743 | 743 | ||
744 | 744 | ||
745 | 745 | func pm () = match getString(pmpk()) { | |
746 | 746 | case s: String => | |
747 | 747 | fromBase58String(s) | |
748 | 748 | case _: Unit => | |
749 | 749 | unit | |
750 | 750 | case _ => | |
751 | 751 | throw("Match error") | |
752 | 752 | } | |
753 | 753 | ||
754 | 754 | ||
755 | 755 | let pd = throw("Permission denied") | |
756 | 756 | ||
757 | 757 | func mm (i) = match m() { | |
758 | 758 | case pk: ByteVector => | |
759 | 759 | if ((i.callerPublicKey == pk)) | |
760 | 760 | then true | |
761 | 761 | else pd | |
762 | 762 | case _: Unit => | |
763 | 763 | if ((i.caller == this)) | |
764 | 764 | then true | |
765 | 765 | else pd | |
766 | 766 | case _ => | |
767 | 767 | throw("Match error") | |
768 | 768 | } | |
769 | 769 | ||
770 | 770 | ||
771 | 771 | @Callable(i) | |
772 | 772 | func constructor (fc) = { | |
773 | 773 | let c = mm(i) | |
774 | 774 | if ((c == c)) | |
775 | 775 | then [StringEntry(fc(), fc)] | |
776 | 776 | else throw("Strict value is not equal to itself.") | |
777 | 777 | } | |
778 | 778 | ||
779 | 779 | ||
780 | 780 | ||
781 | 781 | @Callable(i) | |
782 | 782 | func setManager (pendingManagerPublicKey) = { | |
783 | 783 | let c = mm(i) | |
784 | 784 | if ((c == c)) | |
785 | 785 | then { | |
786 | 786 | let cm = fromBase58String(pendingManagerPublicKey) | |
787 | 787 | if ((cm == cm)) | |
788 | 788 | then [StringEntry(pmpk(), pendingManagerPublicKey)] | |
789 | 789 | else throw("Strict value is not equal to itself.") | |
790 | 790 | } | |
791 | 791 | else throw("Strict value is not equal to itself.") | |
792 | 792 | } | |
793 | 793 | ||
794 | 794 | ||
795 | 795 | ||
796 | 796 | @Callable(i) | |
797 | 797 | func confirmManager () = { | |
798 | 798 | let p = pm() | |
799 | 799 | let hpm = if (isDefined(p)) | |
800 | 800 | then true | |
801 | 801 | else throw("No pending manager") | |
802 | 802 | if ((hpm == hpm)) | |
803 | 803 | then { | |
804 | 804 | let cpm = if ((i.callerPublicKey == value(p))) | |
805 | 805 | then true | |
806 | 806 | else throw("You are not pending manager") | |
807 | 807 | if ((cpm == cpm)) | |
808 | 808 | then [StringEntry(mpk(), toBase58String(value(p))), DeleteEntry(pmpk())] | |
809 | 809 | else throw("Strict value is not equal to itself.") | |
810 | 810 | } | |
811 | 811 | else throw("Strict value is not equal to itself.") | |
812 | 812 | } | |
813 | 813 | ||
814 | 814 | ||
815 | 815 | ||
816 | 816 | @Callable(i) | |
817 | 817 | func put (slip,autoStake) = { | |
818 | 818 | let factCfg = gfc() | |
819 | 819 | let stakingCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactStakCntr]), "Wr st addr") | |
820 | 820 | let slipCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactSlippCntr]), "Wr sl addr") | |
821 | 821 | if ((0 > slip)) | |
822 | 822 | then throw("Wrong slippage") | |
823 | 823 | else if ((size(i.payments) != 2)) | |
824 | 824 | then throw("2 pmnts expd") | |
825 | 825 | else { | |
826 | 826 | let e = cp(toString(i.caller), toBase58String(i.transactionId), AttachedPayment(value(i.payments[0]).assetId, value(i.payments[0]).amount), i.payments[1], slip, true, false, true, 0, "") | |
827 | 827 | let emitLpAmt = e._2 | |
828 | 828 | let lpAssetId = e._7 | |
829 | 829 | let state = e._9 | |
830 | 830 | let amDiff = e._10 | |
831 | 831 | let prDiff = e._11 | |
832 | 832 | let amId = e._12 | |
833 | 833 | let prId = e._13 | |
834 | 834 | let r = invoke(fca, "emit", [emitLpAmt], nil) | |
835 | 835 | if ((r == r)) | |
836 | 836 | then { | |
837 | 837 | let el = match r { | |
838 | 838 | case legacy: Address => | |
839 | 839 | invoke(legacy, "emit", [emitLpAmt], nil) | |
840 | 840 | case _ => | |
841 | 841 | unit | |
842 | 842 | } | |
843 | 843 | if ((el == el)) | |
844 | 844 | then { | |
845 | 845 | let sa = if ((amDiff > 0)) | |
846 | 846 | then invoke(slipCntr, "put", nil, [AttachedPayment(amId, amDiff)]) | |
847 | 847 | else nil | |
848 | 848 | if ((sa == sa)) | |
849 | 849 | then { | |
850 | 850 | let sp = if ((prDiff > 0)) | |
851 | 851 | then invoke(slipCntr, "put", nil, [AttachedPayment(prId, prDiff)]) | |
852 | 852 | else nil | |
853 | 853 | if ((sp == sp)) | |
854 | 854 | then { | |
855 | 855 | let lpTrnsfr = if (autoStake) | |
856 | 856 | then { | |
857 | 857 | let ss = invoke(stakingCntr, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)]) | |
858 | 858 | if ((ss == ss)) | |
859 | 859 | then nil | |
860 | 860 | else throw("Strict value is not equal to itself.") | |
861 | 861 | } | |
862 | 862 | else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)] | |
863 | 863 | (state ++ lpTrnsfr) | |
864 | 864 | } | |
865 | 865 | else throw("Strict value is not equal to itself.") | |
866 | 866 | } | |
867 | 867 | else throw("Strict value is not equal to itself.") | |
868 | 868 | } | |
869 | 869 | else throw("Strict value is not equal to itself.") | |
870 | 870 | } | |
871 | 871 | else throw("Strict value is not equal to itself.") | |
872 | 872 | } | |
873 | 873 | } | |
874 | 874 | ||
875 | 875 | ||
876 | 876 | ||
877 | 877 | @Callable(i) | |
878 | 878 | func putOneTknV2 (minOutAmount,autoStake) = { | |
879 | 879 | let isPoolOneTokenOperationsDisabled = { | |
880 | 880 | let @ = invoke(fca, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
881 | 881 | if ($isInstanceOf(@, "Boolean")) | |
882 | 882 | then @ | |
883 | 883 | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
884 | 884 | } | |
885 | 885 | let isPutDisabled = if (if (if (igs()) | |
886 | 886 | then true | |
887 | 887 | else (cfgPoolStatus == PoolPutDis)) | |
888 | 888 | then true | |
889 | 889 | else (cfgPoolStatus == PoolShutdown)) | |
890 | 890 | then true | |
891 | 891 | else isPoolOneTokenOperationsDisabled | |
892 | 892 | let checks = [if (!(isPutDisabled)) | |
893 | 893 | then true | |
894 | 894 | else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1)) | |
895 | 895 | then true | |
896 | 896 | else throwErr("exactly 1 payment are expected")] | |
897 | 897 | if ((checks == checks)) | |
898 | 898 | then { | |
899 | 899 | let poolConfig = gpc() | |
900 | 900 | let amId = poolConfig[idxAmAsId] | |
901 | 901 | let prId = poolConfig[idxPrAsId] | |
902 | 902 | let lpId = fromBase58String(poolConfig[idxLPAsId]) | |
903 | 903 | let amDecimals = parseIntValue(poolConfig[idxAmtAsDcm]) | |
904 | 904 | let prDecimals = parseIntValue(poolConfig[idxPriceAsDcm]) | |
905 | 905 | let userAddress = if ((i.caller == this)) | |
906 | 906 | then i.originCaller | |
907 | 907 | else i.caller | |
908 | 908 | let pmt = value(i.payments[0]) | |
909 | 909 | let pmtAssetId = toBase58String(value(pmt.assetId)) | |
910 | 910 | let pmtAmt = pmt.amount | |
911 | 911 | let $t03316933324 = calcPutOneTkn(pmtAmt, pmtAssetId, toString(userAddress), toBase58String(i.transactionId), true) | |
912 | 912 | let estimLP = $t03316933324._1 | |
913 | 913 | let state = $t03316933324._2 | |
914 | 914 | let feeAmount = $t03316933324._3 | |
915 | 915 | let emitLpAmt = if (if ((minOutAmount > 0)) | |
916 | 916 | then (minOutAmount > estimLP) | |
917 | 917 | else false) | |
918 | 918 | then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], "")) | |
919 | 919 | else estimLP | |
920 | 920 | let e = invoke(fca, "emit", [emitLpAmt], nil) | |
921 | 921 | if ((e == e)) | |
922 | 922 | then { | |
923 | 923 | let el = match e { | |
924 | 924 | case legacy: Address => | |
925 | 925 | invoke(legacy, "emit", [emitLpAmt], nil) | |
926 | 926 | case _ => | |
927 | 927 | unit | |
928 | 928 | } | |
929 | 929 | if ((el == el)) | |
930 | 930 | then { | |
931 | 931 | let lpTrnsfr = if (autoStake) | |
932 | 932 | then { | |
933 | 933 | let ss = invoke(stakingContract, "stake", nil, [AttachedPayment(lpId, emitLpAmt)]) | |
934 | 934 | if ((ss == ss)) | |
935 | 935 | then nil | |
936 | 936 | else throw("Strict value is not equal to itself.") | |
937 | 937 | } | |
938 | 938 | else [ScriptTransfer(i.caller, emitLpAmt, lpId)] | |
939 | 939 | let sendFeeToMatcher = if ((feeAmount > 0)) | |
940 | 940 | then [ScriptTransfer(feeCollectorAddress, feeAmount, fromBase58String(pmtAssetId))] | |
941 | 941 | else nil | |
942 | 942 | $Tuple2(((state ++ lpTrnsfr) ++ sendFeeToMatcher), emitLpAmt) | |
943 | 943 | } | |
944 | 944 | else throw("Strict value is not equal to itself.") | |
945 | 945 | } | |
946 | 946 | else throw("Strict value is not equal to itself.") | |
947 | 947 | } | |
948 | 948 | else throw("Strict value is not equal to itself.") | |
949 | 949 | } | |
950 | 950 | ||
951 | 951 | ||
952 | 952 | ||
953 | 953 | @Callable(i) | |
954 | 954 | func putForFree (maxSlpg) = if ((0 > maxSlpg)) | |
955 | 955 | then throw("Wrong slpg") | |
956 | 956 | else if ((size(i.payments) != 2)) | |
957 | 957 | then throw("2 pmnts expd") | |
958 | 958 | else { | |
959 | 959 | let estPut = cp(toString(i.caller), toBase58String(i.transactionId), AttachedPayment(value(i.payments[0]).assetId, value(i.payments[0]).amount), i.payments[1], maxSlpg, false, false, true, 0, "") | |
960 | 960 | estPut._9 | |
961 | 961 | } | |
962 | 962 | ||
963 | 963 | ||
964 | 964 | ||
965 | 965 | @Callable(i) | |
966 | 966 | func get () = { | |
967 | 967 | let r = cg(i) | |
968 | 968 | let outAmtAmt = r._1 | |
969 | 969 | let outPrAmt = r._2 | |
970 | 970 | let pmtAmt = r._3 | |
971 | 971 | let pmtAssetId = r._4 | |
972 | 972 | let state = r._5 | |
973 | 973 | let b = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
974 | 974 | if ((b == b)) | |
975 | 975 | then state | |
976 | 976 | else throw("Strict value is not equal to itself.") | |
977 | 977 | } | |
978 | 978 | ||
979 | 979 | ||
980 | 980 | ||
981 | 981 | @Callable(i) | |
982 | 982 | func getOneTknV2 (outAssetId,minOutAmount) = { | |
983 | 983 | let isPoolOneTokenOperationsDisabled = { | |
984 | 984 | let @ = invoke(fca, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
985 | 985 | if ($isInstanceOf(@, "Boolean")) | |
986 | 986 | then @ | |
987 | 987 | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
988 | 988 | } | |
989 | 989 | let isGetDisabled = if (if (igs()) | |
990 | 990 | then true | |
991 | 991 | else (cfgPoolStatus == PoolShutdown)) | |
992 | 992 | then true | |
993 | 993 | else isPoolOneTokenOperationsDisabled | |
994 | 994 | let checks = [if (!(isGetDisabled)) | |
995 | 995 | then true | |
996 | 996 | else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1)) | |
997 | 997 | then true | |
998 | 998 | else throwErr("exactly 1 payment are expected")] | |
999 | 999 | if ((checks == checks)) | |
1000 | 1000 | then { | |
1001 | 1001 | let $t03591336068 = getOneTknV2Internal(outAssetId, minOutAmount, i.payments, i.caller, i.originCaller, i.transactionId) | |
1002 | 1002 | let state = $t03591336068._1 | |
1003 | 1003 | let totalAmount = $t03591336068._2 | |
1004 | 1004 | $Tuple2(state, totalAmount) | |
1005 | 1005 | } | |
1006 | 1006 | else throw("Strict value is not equal to itself.") | |
1007 | 1007 | } | |
1008 | 1008 | ||
1009 | 1009 | ||
1010 | 1010 | ||
1011 | 1011 | @Callable(i) | |
1012 | 1012 | func getOneTknV2READONLY (outAssetId,lpAssetAmount) = { | |
1013 | 1013 | let poolConfig = gpc() | |
1014 | 1014 | let amId = poolConfig[idxAmAsId] | |
1015 | 1015 | let prId = poolConfig[idxPrAsId] | |
1016 | 1016 | let lpId = poolConfig[idxLPAsId] | |
1017 | 1017 | let xp = [toBigInt(getAccBalance(amId)), toBigInt(getAccBalance(prId))] | |
1018 | 1018 | let lpEmission = toBigInt(valueOrErrorMessage(assetInfo(fromBase58String(lpId)), "invalid lp asset").quantity) | |
1019 | 1019 | let D0 = getD(xp) | |
1020 | 1020 | let D1 = (D0 - fraction(toBigInt(lpAssetAmount), D0, lpEmission)) | |
1021 | 1021 | let index = if ((outAssetId == amId)) | |
1022 | 1022 | then 0 | |
1023 | 1023 | else if ((outAssetId == prId)) | |
1024 | 1024 | then 1 | |
1025 | 1025 | else throw("invalid out asset id") | |
1026 | 1026 | let newY = getYD(xp, index, D1) | |
1027 | 1027 | let dy = (xp[index] - newY) | |
1028 | 1028 | let totalGetRaw = max([0, toInt((dy - big1))]) | |
1029 | 1029 | let $t03685836907 = takeFee(totalGetRaw) | |
1030 | 1030 | let totalGet = $t03685836907._1 | |
1031 | 1031 | let feeAmount = $t03685836907._2 | |
1032 | 1032 | $Tuple2(nil, $Tuple2(totalGet, feeAmount)) | |
1033 | 1033 | } | |
1034 | 1034 | ||
1035 | 1035 | ||
1036 | 1036 | ||
1037 | 1037 | @Callable(i) | |
1038 | 1038 | func getOneTknV2WithBonusREADONLY (outAssetId,lpAssetAmount) = { | |
1039 | 1039 | let poolConfig = gpc() | |
1040 | 1040 | let amId = poolConfig[idxAmAsId] | |
1041 | 1041 | let prId = poolConfig[idxPrAsId] | |
1042 | 1042 | let lpId = poolConfig[idxLPAsId] | |
1043 | 1043 | let amBalance = getAccBalance(amId) | |
1044 | 1044 | let prBalance = getAccBalance(prId) | |
1045 | 1045 | let $t03725237367 = { | |
1046 | 1046 | let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, lpAssetAmount], nil) | |
1047 | 1047 | if ($isInstanceOf(@, "(Int, Int)")) | |
1048 | 1048 | then @ | |
1049 | 1049 | else throw(($getType(@) + " couldn't be cast to (Int, Int)")) | |
1050 | 1050 | } | |
1051 | 1051 | let totalGet = $t03725237367._1 | |
1052 | 1052 | let feeAmount = $t03725237367._2 | |
1053 | 1053 | let r = ego("", lpId, lpAssetAmount, this) | |
1054 | 1054 | let outAmAmt = r._1 | |
1055 | 1055 | let outPrAmt = r._2 | |
1056 | 1056 | let sumOfGetAssets = (outAmAmt + outPrAmt) | |
1057 | 1057 | let bonus = if ((sumOfGetAssets == 0)) | |
1058 | 1058 | then if ((totalGet == 0)) | |
1059 | 1059 | then 0 | |
1060 | 1060 | else throw("bonus calculation error") | |
1061 | 1061 | else fraction((totalGet - sumOfGetAssets), scale8, sumOfGetAssets) | |
1062 | 1062 | $Tuple2(nil, $Tuple3(totalGet, feeAmount, bonus)) | |
1063 | 1063 | } | |
1064 | 1064 | ||
1065 | 1065 | ||
1066 | 1066 | ||
1067 | 1067 | @Callable(i) | |
1068 | 1068 | func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = { | |
1069 | 1069 | let r = cg(i) | |
1070 | 1070 | let outAmAmt = r._1 | |
1071 | 1071 | let outPrAmt = r._2 | |
1072 | 1072 | let pmtAmt = r._3 | |
1073 | 1073 | let pmtAssetId = r._4 | |
1074 | 1074 | let state = r._5 | |
1075 | 1075 | if ((noLessThenAmtAsset > outAmAmt)) | |
1076 | 1076 | then throw(((("Failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset))) | |
1077 | 1077 | else if ((noLessThenPriceAsset > outPrAmt)) | |
1078 | 1078 | then throw(((("Failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset))) | |
1079 | 1079 | else { | |
1080 | 1080 | let burnLPAssetOnFactory = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
1081 | 1081 | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
1082 | 1082 | then state | |
1083 | 1083 | else throw("Strict value is not equal to itself.") | |
1084 | 1084 | } | |
1085 | 1085 | } | |
1086 | 1086 | ||
1087 | 1087 | ||
1088 | 1088 | ||
1089 | 1089 | @Callable(i) | |
1090 | 1090 | func unstakeAndGet (amount) = { | |
1091 | 1091 | let checkPayments = if ((size(i.payments) != 0)) | |
1092 | 1092 | then throw("No pmnts expd") | |
1093 | 1093 | else true | |
1094 | 1094 | if ((checkPayments == checkPayments)) | |
1095 | 1095 | then { | |
1096 | 1096 | let cfg = gpc() | |
1097 | 1097 | let factoryCfg = gfc() | |
1098 | 1098 | let lpAssetId = fromBase58String(cfg[idxLPAsId]) | |
1099 | 1099 | let staking = valueOrErrorMessage(addressFromString(factoryCfg[idxFactStakCntr]), "Wr st addr") | |
1100 | 1100 | let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), amount], nil) | |
1101 | 1101 | if ((unstakeInv == unstakeInv)) | |
1102 | 1102 | then { | |
1103 | 1103 | let r = ego(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller) | |
1104 | 1104 | let sts = parseIntValue(r._9) | |
1105 | 1105 | let state = r._10 | |
1106 | 1106 | let v = if (if (igs()) | |
1107 | 1107 | then true | |
1108 | 1108 | else (sts == PoolShutdown)) | |
1109 | 1109 | then throw(("Blocked: " + toString(sts))) | |
1110 | 1110 | else true | |
1111 | 1111 | if ((v == v)) | |
1112 | 1112 | then { | |
1113 | 1113 | let burnA = invoke(fca, "burn", [amount], [AttachedPayment(lpAssetId, amount)]) | |
1114 | 1114 | if ((burnA == burnA)) | |
1115 | 1115 | then state | |
1116 | 1116 | else throw("Strict value is not equal to itself.") | |
1117 | 1117 | } | |
1118 | 1118 | else throw("Strict value is not equal to itself.") | |
1119 | 1119 | } | |
1120 | 1120 | else throw("Strict value is not equal to itself.") | |
1121 | 1121 | } | |
1122 | 1122 | else throw("Strict value is not equal to itself.") | |
1123 | 1123 | } | |
1124 | 1124 | ||
1125 | 1125 | ||
1126 | 1126 | ||
1127 | 1127 | @Callable(i) | |
1128 | + | func unstakeAndGetNoLess (unstakeAmount,noLessThenAmountAsset,noLessThenPriceAsset) = { | |
1129 | + | let isGetDisabled = if (igs()) | |
1130 | + | then true | |
1131 | + | else (cfgPoolStatus == PoolShutdown) | |
1132 | + | let checks = [if (!(isGetDisabled)) | |
1133 | + | then true | |
1134 | + | else throw("get operation is blocked by admin"), if ((size(i.payments) == 0)) | |
1135 | + | then true | |
1136 | + | else throw("no payments are expected")] | |
1137 | + | if ((checks == checks)) | |
1138 | + | then { | |
1139 | + | let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil) | |
1140 | + | if ((unstakeInv == unstakeInv)) | |
1141 | + | then { | |
1142 | + | let res = ego(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller) | |
1143 | + | let outAmAmt = res._1 | |
1144 | + | let outPrAmt = res._2 | |
1145 | + | let state = res._10 | |
1146 | + | let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset)) | |
1147 | + | then true | |
1148 | + | else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset)) | |
1149 | + | then true | |
1150 | + | else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))] | |
1151 | + | if ((checkAmounts == checkAmounts)) | |
1152 | + | then { | |
1153 | + | let burnLPAssetOnFactory = invoke(fca, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)]) | |
1154 | + | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
1155 | + | then state | |
1156 | + | else throw("Strict value is not equal to itself.") | |
1157 | + | } | |
1158 | + | else throw("Strict value is not equal to itself.") | |
1159 | + | } | |
1160 | + | else throw("Strict value is not equal to itself.") | |
1161 | + | } | |
1162 | + | else throw("Strict value is not equal to itself.") | |
1163 | + | } | |
1164 | + | ||
1165 | + | ||
1166 | + | ||
1167 | + | @Callable(i) | |
1128 | 1168 | func unstakeAndGetOneTknV2 (unstakeAmount,outAssetId,minOutAmount) = { | |
1129 | 1169 | let isPoolOneTokenOperationsDisabled = { | |
1130 | 1170 | let @ = invoke(fca, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
1131 | 1171 | if ($isInstanceOf(@, "Boolean")) | |
1132 | 1172 | then @ | |
1133 | 1173 | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
1134 | 1174 | } | |
1135 | 1175 | let isGetDisabled = if (if (igs()) | |
1136 | 1176 | then true | |
1137 | 1177 | else (cfgPoolStatus == PoolShutdown)) | |
1138 | 1178 | then true | |
1139 | 1179 | else isPoolOneTokenOperationsDisabled | |
1140 | 1180 | let checks = [if (!(isGetDisabled)) | |
1141 | 1181 | then true | |
1142 | 1182 | else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 0)) | |
1143 | 1183 | then true | |
1144 | 1184 | else throwErr("no payments are expected")] | |
1145 | 1185 | if ((checks == checks)) | |
1146 | 1186 | then { | |
1147 | 1187 | let cfg = gpc() | |
1148 | 1188 | let factoryCfg = gfc() | |
1149 | 1189 | let lpAssetId = fromBase58String(cfg[idxLPAsId]) | |
1150 | 1190 | let staking = valueOrErrorMessage(addressFromString(factoryCfg[idxFactStakCntr]), "Wr st addr") | |
1151 | 1191 | let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), unstakeAmount], nil) | |
1152 | 1192 | if ((unstakeInv == unstakeInv)) | |
1153 | 1193 | then { | |
1154 | - | let $ | |
1155 | - | let state = $ | |
1156 | - | let totalAmount = $ | |
1194 | + | let $t04117241360 = getOneTknV2Internal(outAssetId, minOutAmount, [AttachedPayment(lpAssetId, unstakeAmount)], i.caller, i.originCaller, i.transactionId) | |
1195 | + | let state = $t04117241360._1 | |
1196 | + | let totalAmount = $t04117241360._2 | |
1157 | 1197 | $Tuple2(state, totalAmount) | |
1158 | 1198 | } | |
1159 | 1199 | else throw("Strict value is not equal to itself.") | |
1160 | 1200 | } | |
1161 | 1201 | else throw("Strict value is not equal to itself.") | |
1162 | 1202 | } | |
1163 | 1203 | ||
1164 | 1204 | ||
1165 | 1205 | ||
1166 | 1206 | @Callable(i) | |
1167 | 1207 | func putOneTknV2WithBonusREADONLY (paymentAmountRaw,paymentAssetId) = { | |
1168 | 1208 | let poolConfig = gpc() | |
1169 | 1209 | let amId = poolConfig[idxAmAsId] | |
1170 | 1210 | let prId = poolConfig[idxPrAsId] | |
1171 | 1211 | let lpId = poolConfig[idxLPAsId] | |
1172 | - | let $ | |
1173 | - | let lpAmount = $ | |
1174 | - | let state = $ | |
1175 | - | let feeAmount = $ | |
1176 | - | let bonus = $ | |
1212 | + | let $t04161941722 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", true) | |
1213 | + | let lpAmount = $t04161941722._1 | |
1214 | + | let state = $t04161941722._2 | |
1215 | + | let feeAmount = $t04161941722._3 | |
1216 | + | let bonus = $t04161941722._4 | |
1177 | 1217 | $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus)) | |
1178 | 1218 | } | |
1179 | 1219 | ||
1180 | 1220 | ||
1181 | 1221 | ||
1182 | 1222 | @Callable(i) | |
1183 | 1223 | func putOneTknV2WithoutTakeFeeREADONLY (paymentAmountRaw,paymentAssetId) = { | |
1184 | 1224 | let poolConfig = gpc() | |
1185 | 1225 | let amId = poolConfig[idxAmAsId] | |
1186 | 1226 | let prId = poolConfig[idxPrAsId] | |
1187 | 1227 | let lpId = poolConfig[idxLPAsId] | |
1188 | - | let $ | |
1189 | - | let lpAmount = $ | |
1190 | - | let state = $ | |
1191 | - | let feeAmount = $ | |
1192 | - | let bonus = $ | |
1228 | + | let $t04200142105 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", false) | |
1229 | + | let lpAmount = $t04200142105._1 | |
1230 | + | let state = $t04200142105._2 | |
1231 | + | let feeAmount = $t04200142105._3 | |
1232 | + | let bonus = $t04200142105._4 | |
1193 | 1233 | $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus)) | |
1194 | 1234 | } | |
1195 | 1235 | ||
1196 | 1236 | ||
1197 | 1237 | ||
1198 | 1238 | @Callable(i) | |
1199 | 1239 | func activate (amtAsStr,prAsStr) = if ((toString(i.caller) != toString(fca))) | |
1200 | 1240 | then throw("denied") | |
1201 | 1241 | else $Tuple2([StringEntry(aa(), amtAsStr), StringEntry(pa(), prAsStr)], "success") | |
1202 | 1242 | ||
1203 | 1243 | ||
1204 | 1244 | ||
1205 | 1245 | @Callable(i) | |
1206 | 1246 | func setS (k,v) = if ((toString(i.caller) != strf(this, ada()))) | |
1207 | 1247 | then pd | |
1208 | 1248 | else [StringEntry(k, v)] | |
1209 | 1249 | ||
1210 | 1250 | ||
1211 | 1251 | ||
1212 | 1252 | @Callable(i) | |
1213 | 1253 | func setI (k,v) = if ((toString(i.caller) != strf(this, ada()))) | |
1214 | 1254 | then pd | |
1215 | 1255 | else [IntegerEntry(k, v)] | |
1216 | 1256 | ||
1217 | 1257 | ||
1218 | 1258 | ||
1219 | 1259 | @Callable(i) | |
1220 | 1260 | func getPoolConfigWrapperREADONLY () = $Tuple2(nil, gpc()) | |
1221 | 1261 | ||
1222 | 1262 | ||
1223 | 1263 | ||
1224 | 1264 | @Callable(i) | |
1225 | 1265 | func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId)) | |
1226 | 1266 | ||
1227 | 1267 | ||
1228 | 1268 | ||
1229 | 1269 | @Callable(i) | |
1230 | 1270 | func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = { | |
1231 | 1271 | let pr = calcPrices(amAmt, prAmt, lpAmt) | |
1232 | 1272 | $Tuple2(nil, [toString(pr[0]), toString(pr[1]), toString(pr[2])]) | |
1233 | 1273 | } | |
1234 | 1274 | ||
1235 | 1275 | ||
1236 | 1276 | ||
1237 | 1277 | @Callable(i) | |
1238 | 1278 | func fromX18WrapperREADONLY (val,resScaleMult) = $Tuple2(nil, f1(parseBigIntValue(val), resScaleMult)) | |
1239 | 1279 | ||
1240 | 1280 | ||
1241 | 1281 | ||
1242 | 1282 | @Callable(i) | |
1243 | 1283 | func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(t1(origVal, origScaleMult))) | |
1244 | 1284 | ||
1245 | 1285 | ||
1246 | 1286 | ||
1247 | 1287 | @Callable(i) | |
1248 | 1288 | func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(cpbi(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18)))) | |
1249 | 1289 | ||
1250 | 1290 | ||
1251 | 1291 | ||
1252 | 1292 | @Callable(i) | |
1253 | 1293 | func estimatePutOperationWrapperREADONLY (txId58,slippage,inAmAmt,inAmId,inPrAmt,inPrId,usrAddr,isEval,emitLp) = $Tuple2(nil, epo(txId58, slippage, inAmAmt, inAmId, inPrAmt, inPrId, usrAddr, isEval, emitLp, true, false, 0, "")) | |
1254 | 1294 | ||
1255 | 1295 | ||
1256 | 1296 | ||
1257 | 1297 | @Callable(i) | |
1258 | 1298 | func estimateGetOperationWrapperREADONLY (txId58,pmtAsId,pmtLpAmt,usrAddr) = { | |
1259 | 1299 | let r = ego(txId58, pmtAsId, pmtLpAmt, addressFromStringValue(usrAddr)) | |
1260 | 1300 | $Tuple2(nil, $Tuple10(r._1, r._2, r._3, r._4, r._5, r._6, r._7, toString(r._8), r._9, r._10)) | |
1261 | 1301 | } | |
1262 | 1302 | ||
1263 | 1303 | ||
1264 | 1304 | ||
1265 | 1305 | @Callable(i) | |
1266 | 1306 | func getFeeREADONLY () = $Tuple2(nil, fee) | |
1267 | 1307 | ||
1268 | 1308 | ||
1269 | 1309 | @Verifier(tx) | |
1270 | 1310 | func verify () = { | |
1271 | 1311 | let targetPublicKey = match m() { | |
1272 | 1312 | case pk: ByteVector => | |
1273 | 1313 | pk | |
1274 | 1314 | case _: Unit => | |
1275 | 1315 | tx.senderPublicKey | |
1276 | 1316 | case _ => | |
1277 | 1317 | throw("Match error") | |
1278 | 1318 | } | |
1279 | 1319 | match tx { | |
1280 | 1320 | case order: Order => | |
1281 | 1321 | let matcherPub = mp() | |
1282 | 1322 | let orderValid = moa(order) | |
1283 | 1323 | let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey) | |
1284 | 1324 | let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub) | |
1285 | 1325 | if (if (if (orderValid) | |
1286 | 1326 | then senderValid | |
1287 | 1327 | else false) | |
1288 | 1328 | then matcherValid | |
1289 | 1329 | else false) | |
1290 | 1330 | then true | |
1291 | 1331 | else toe(orderValid, senderValid, matcherValid) | |
1292 | 1332 | case s: SetScriptTransaction => | |
1293 | 1333 | let newHash = blake2b256(value(s.script)) | |
1294 | 1334 | let allowedHash = fromBase64String(value(getString(fca, keyAllowedLpStableScriptHash()))) | |
1295 | 1335 | let currentHash = scriptHash(this) | |
1296 | 1336 | if (if ((allowedHash == newHash)) | |
1297 | 1337 | then (currentHash != newHash) | |
1298 | 1338 | else false) | |
1299 | 1339 | then true | |
1300 | 1340 | else sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
1301 | 1341 | case _ => | |
1302 | 1342 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
1303 | 1343 | } | |
1304 | 1344 | } | |
1305 | 1345 |
github/deemru/w8io/026f985 134.63 ms ◑