tx · D8UgC2wdNZzaYcHUd3GyamxS1Ri4DMEKwuQR2LFP8inf 3NAefciWv6f9fWvEXdGgpHfanJFG8HqfjuT: -0.03700000 Waves 2023.01.19 13:26 [2411690] smart account 3NAefciWv6f9fWvEXdGgpHfanJFG8HqfjuT > SELF 0.00000000 Waves
{ "type": 13, "id": "D8UgC2wdNZzaYcHUd3GyamxS1Ri4DMEKwuQR2LFP8inf", "fee": 3700000, "feeAssetId": null, "timestamp": 1674123999671, "version": 1, "sender": "3NAefciWv6f9fWvEXdGgpHfanJFG8HqfjuT", "senderPublicKey": "D1BL65meykxFZTCuq7jq9HSGLLnWvQamQPUNrguW5w39", "proofs": [ "WJk66Rmsx25poj2g8kyiJjgzxJXRtB6Vxd6c8TBB1j8UbRLrH4pZ2J82s9TUswfsiFv9KEKHQBSFDBT81bgibCb" ], "script": "base64:BgKwKQgCEgMKAQgSAwoBCBIAEgQKAgEEEgQKAgEEEgMKAQESABIECgIIARIAEgQKAggBEgQKAggBEgQKAgEBEgMKAQESBQoDAQEBEgUKAwEIARIECgIBCBIECgIBCBIECgIICBIECgIICBIECgIIARIAEgMKAQgSBQoDAQEBEgQKAggBEgQKAgEBEgQKAggIEgsKCQgBAQIBAggEBBIGCgQICAEIIgZzY2FsZTgiDHNjYWxlOEJpZ0ludCIHc2NhbGUxOCIKemVyb0JpZ0ludCIEYmlnMCIEYmlnMSIEYmlnMiIEYmlnMyIEYmlnNCIKc2xpcHBhZ2U0RCILd2F2ZXNTdHJpbmciBUFtdWx0IgVEY29udiIDU0VQIgVFTVBUWSIKUG9vbEFjdGl2ZSIKUG9vbFB1dERpcyIOUG9vbE1hdGNoZXJEaXMiDFBvb2xTaHV0ZG93biIOaWR4UG9vbEFkZHJlc3MiCWlkeFBvb2xTdCIJaWR4TFBBc0lkIglpZHhBbUFzSWQiCWlkeFByQXNJZCILaWR4QW10QXNEY20iDWlkeFByaWNlQXNEY20iC2lkeElBbXRBc0lkIg1pZHhJUHJpY2VBc0lkIg9p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yYW5zYWN0aW9uBAJkTwUCZ28DCQD0AwMIBQJoVAlib2R5Qnl0ZXMJAJEDAggFAmhUBnByb29mcwAABQJoVgYEAmlhCQD2AwEJAQV2YWx1ZQEIBQJkTwZzY3JpcHQEAmliCQDbBAEJAQV2YWx1ZQEJAJ0IAgUCYU8JAQJhQgAEAmljCQDxBwEFBHRoaXMDCQAAAgUCaWIFAmlhCQECIT0CBQJpYwUCaWEHCQD0AwMIBQJoVAlib2R5Qnl0ZXMJAJEDAggFAmhUBnByb29mcwAABQJoVsBgp8s=", "chainId": 84, "height": 2411690, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BLr6KWC37tFJvyDYyrG5feHE1ZuPkYQE6qsVmFvbHA5q Next: GrB9HF4txtnu48nFnuU4TLCy7xeHrCwsGSmznH85Rc3i Diff:
Old | New | Differences | |
---|---|---|---|
1374 | 1374 | let lpAssetId = cfgLpAssetId | |
1375 | 1375 | let staking = valueOrErrorMessage(addressFromString(factoryCfg[idxFactStakCntr]), "Wr st addr") | |
1376 | 1376 | let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1377 | - | let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), amount], nil) | |
1378 | - | if ((unstakeInv == unstakeInv)) | |
1377 | + | if ((currentDLp == currentDLp)) | |
1379 | 1378 | then { | |
1380 | - | let r = ego(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller) | |
1381 | - | let outAmAmt = r._1 | |
1382 | - | let outPrAmt = r._2 | |
1383 | - | let sts = parseIntValue(r._9) | |
1384 | - | let state = r._10 | |
1385 | - | let v = if (if (igs()) | |
1386 | - | then true | |
1387 | - | else (sts == PoolShutdown)) | |
1388 | - | then throw(("Blocked: " + toString(sts))) | |
1389 | - | else true | |
1390 | - | if ((v == v)) | |
1379 | + | let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), amount], nil) | |
1380 | + | if ((unstakeInv == unstakeInv)) | |
1391 | 1381 | then { | |
1392 | - | let burnA = invoke(fca, "burn", [amount], [AttachedPayment(lpAssetId, amount)]) | |
1393 | - | if ((burnA == burnA)) | |
1382 | + | let r = ego(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller) | |
1383 | + | let outAmAmt = r._1 | |
1384 | + | let outPrAmt = r._2 | |
1385 | + | let sts = parseIntValue(r._9) | |
1386 | + | let state = r._10 | |
1387 | + | let v = if (if (igs()) | |
1388 | + | then true | |
1389 | + | else (sts == PoolShutdown)) | |
1390 | + | then throw(("Blocked: " + toString(sts))) | |
1391 | + | else true | |
1392 | + | if ((v == v)) | |
1394 | 1393 | then { | |
1395 | - | let $t04748847569 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0) | |
1396 | - | let refreshDLpActions = $t04748847569._1 | |
1397 | - | let updatedDLp = $t04748847569._2 | |
1398 | - | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1399 | - | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1400 | - | then (state ++ refreshDLpActions) | |
1394 | + | let burnA = invoke(fca, "burn", [amount], [AttachedPayment(lpAssetId, amount)]) | |
1395 | + | if ((burnA == burnA)) | |
1396 | + | then { | |
1397 | + | let $t04749147572 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0) | |
1398 | + | let refreshDLpActions = $t04749147572._1 | |
1399 | + | let updatedDLp = $t04749147572._2 | |
1400 | + | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1401 | + | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1402 | + | then (state ++ refreshDLpActions) | |
1403 | + | else throw("Strict value is not equal to itself.") | |
1404 | + | } | |
1401 | 1405 | else throw("Strict value is not equal to itself.") | |
1402 | 1406 | } | |
1403 | 1407 | else throw("Strict value is not equal to itself.") | |
1424 | 1428 | if ((checks == checks)) | |
1425 | 1429 | then { | |
1426 | 1430 | let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1427 | - | let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil) | |
1428 | - | if ((unstakeInv == unstakeInv)) | |
1431 | + | if ((currentDLp == currentDLp)) | |
1429 | 1432 | then { | |
1430 | - | let res = ego(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller) | |
1431 | - | let outAmAmt = res._1 | |
1432 | - | let outPrAmt = res._2 | |
1433 | - | let state = res._10 | |
1434 | - | let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset)) | |
1435 | - | then true | |
1436 | - | else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset)) | |
1437 | - | then true | |
1438 | - | else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))] | |
1439 | - | if ((checkAmounts == checkAmounts)) | |
1433 | + | let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil) | |
1434 | + | if ((unstakeInv == unstakeInv)) | |
1440 | 1435 | then { | |
1441 | - | let burnLPAssetOnFactory = invoke(fca, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)]) | |
1442 | - | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
1436 | + | let res = ego(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller) | |
1437 | + | let outAmAmt = res._1 | |
1438 | + | let outPrAmt = res._2 | |
1439 | + | let state = res._10 | |
1440 | + | let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset)) | |
1441 | + | then true | |
1442 | + | else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset)) | |
1443 | + | then true | |
1444 | + | else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))] | |
1445 | + | if ((checkAmounts == checkAmounts)) | |
1443 | 1446 | then { | |
1444 | - | let $t04881748898 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0) | |
1445 | - | let refreshDLpActions = $t04881748898._1 | |
1446 | - | let updatedDLp = $t04881748898._2 | |
1447 | - | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1448 | - | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1449 | - | then (state ++ refreshDLpActions) | |
1447 | + | let burnLPAssetOnFactory = invoke(fca, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)]) | |
1448 | + | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
1449 | + | then { | |
1450 | + | let $t04882348904 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0) | |
1451 | + | let refreshDLpActions = $t04882348904._1 | |
1452 | + | let updatedDLp = $t04882348904._2 | |
1453 | + | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1454 | + | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1455 | + | then (state ++ refreshDLpActions) | |
1456 | + | else throw("Strict value is not equal to itself.") | |
1457 | + | } | |
1450 | 1458 | else throw("Strict value is not equal to itself.") | |
1451 | 1459 | } | |
1452 | 1460 | else throw("Strict value is not equal to itself.") | |
1488 | 1496 | let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), unstakeAmount], nil) | |
1489 | 1497 | if ((unstakeInv == unstakeInv)) | |
1490 | 1498 | then { | |
1491 | - | let $ | |
1492 | - | let state = $ | |
1493 | - | let totalAmount = $ | |
1499 | + | let $t04979949987 = getOneTknV2Internal(outAssetId, minOutAmount, [AttachedPayment(lpAssetId, unstakeAmount)], i.caller, i.originCaller, i.transactionId) | |
1500 | + | let state = $t04979949987._1 | |
1501 | + | let totalAmount = $t04979949987._2 | |
1494 | 1502 | $Tuple2(state, totalAmount) | |
1495 | 1503 | } | |
1496 | 1504 | else throw("Strict value is not equal to itself.") | |
1502 | 1510 | ||
1503 | 1511 | @Callable(i) | |
1504 | 1512 | func putOneTknV2WithBonusREADONLY (paymentAmountRaw,paymentAssetId) = { | |
1505 | - | let $ | |
1506 | - | let lpAmount = $ | |
1507 | - | let state = $ | |
1508 | - | let feeAmount = $ | |
1509 | - | let bonus = $ | |
1513 | + | let $t05011550218 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", true) | |
1514 | + | let lpAmount = $t05011550218._1 | |
1515 | + | let state = $t05011550218._2 | |
1516 | + | let feeAmount = $t05011550218._3 | |
1517 | + | let bonus = $t05011550218._4 | |
1510 | 1518 | $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus)) | |
1511 | 1519 | } | |
1512 | 1520 | ||
1514 | 1522 | ||
1515 | 1523 | @Callable(i) | |
1516 | 1524 | func putOneTknV2WithoutTakeFeeREADONLY (paymentAmountRaw,paymentAssetId) = { | |
1517 | - | let $ | |
1518 | - | let lpAmount = $ | |
1519 | - | let state = $ | |
1520 | - | let feeAmount = $ | |
1521 | - | let bonus = $ | |
1525 | + | let $t05036650470 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", false) | |
1526 | + | let lpAmount = $t05036650470._1 | |
1527 | + | let state = $t05036650470._2 | |
1528 | + | let feeAmount = $t05036650470._3 | |
1529 | + | let bonus = $t05036650470._4 | |
1522 | 1530 | $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus)) | |
1523 | 1531 | } | |
1524 | 1532 |
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 big3 = toBigInt(3) | |
19 | 19 | ||
20 | 20 | let big4 = toBigInt(4) | |
21 | 21 | ||
22 | 22 | let slippage4D = toBigInt((scale8 - ((scale8 * 1) / scale8))) | |
23 | 23 | ||
24 | 24 | let wavesString = "WAVES" | |
25 | 25 | ||
26 | 26 | let Amult = "100" | |
27 | 27 | ||
28 | 28 | let Dconv = "1" | |
29 | 29 | ||
30 | 30 | let SEP = "__" | |
31 | 31 | ||
32 | 32 | let EMPTY = "" | |
33 | 33 | ||
34 | 34 | let PoolActive = 1 | |
35 | 35 | ||
36 | 36 | let PoolPutDis = 2 | |
37 | 37 | ||
38 | 38 | let PoolMatcherDis = 3 | |
39 | 39 | ||
40 | 40 | let PoolShutdown = 4 | |
41 | 41 | ||
42 | 42 | let idxPoolAddress = 1 | |
43 | 43 | ||
44 | 44 | let idxPoolSt = 2 | |
45 | 45 | ||
46 | 46 | let idxLPAsId = 3 | |
47 | 47 | ||
48 | 48 | let idxAmAsId = 4 | |
49 | 49 | ||
50 | 50 | let idxPrAsId = 5 | |
51 | 51 | ||
52 | 52 | let idxAmtAsDcm = 6 | |
53 | 53 | ||
54 | 54 | let idxPriceAsDcm = 7 | |
55 | 55 | ||
56 | 56 | let idxIAmtAsId = 8 | |
57 | 57 | ||
58 | 58 | let idxIPriceAsId = 9 | |
59 | 59 | ||
60 | 60 | let idxFactStakCntr = 1 | |
61 | 61 | ||
62 | 62 | let idxFactoryRestCntr = 6 | |
63 | 63 | ||
64 | 64 | let idxFactSlippCntr = 7 | |
65 | 65 | ||
66 | 66 | let idxFactGwxRewCntr = 10 | |
67 | 67 | ||
68 | 68 | let feeDefault = fraction(10, scale8, 10000) | |
69 | 69 | ||
70 | 70 | func t1 (origVal,origScaleMult) = fraction(toBigInt(origVal), scale18, toBigInt(origScaleMult)) | |
71 | 71 | ||
72 | 72 | ||
73 | 73 | func f1 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), scale18)) | |
74 | 74 | ||
75 | 75 | ||
76 | 76 | func fromX18Round (val,resultScaleMult,round) = toInt(fraction(val, toBigInt(resultScaleMult), scale18, round)) | |
77 | 77 | ||
78 | 78 | ||
79 | 79 | func t2 (origVal,origScaleMult) = fraction(origVal, scale18, toBigInt(origScaleMult)) | |
80 | 80 | ||
81 | 81 | ||
82 | 82 | func f2 (val,resultScaleMult) = fraction(val, toBigInt(resultScaleMult), scale18) | |
83 | 83 | ||
84 | 84 | ||
85 | 85 | func ts (amt,resScale,curScale) = fraction(amt, resScale, curScale) | |
86 | 86 | ||
87 | 87 | ||
88 | 88 | func abs (val) = if ((zeroBigInt > val)) | |
89 | 89 | then -(val) | |
90 | 90 | else val | |
91 | 91 | ||
92 | 92 | ||
93 | 93 | func absBigInt (val) = if ((zeroBigInt > val)) | |
94 | 94 | then -(val) | |
95 | 95 | else val | |
96 | 96 | ||
97 | 97 | ||
98 | 98 | func fc () = "%s__factoryContract" | |
99 | 99 | ||
100 | 100 | ||
101 | 101 | func mpk () = "%s__managerPublicKey" | |
102 | 102 | ||
103 | 103 | ||
104 | 104 | func pmpk () = "%s__pendingManagerPublicKey" | |
105 | 105 | ||
106 | 106 | ||
107 | 107 | func pl () = "%s%s__price__last" | |
108 | 108 | ||
109 | 109 | ||
110 | 110 | func ph (h,t) = makeString(["%s%s%d%d__price__history", toString(h), toString(t)], SEP) | |
111 | 111 | ||
112 | 112 | ||
113 | 113 | func pau (ua,txId) = ((("%s%s%s__P__" + ua) + "__") + txId) | |
114 | 114 | ||
115 | 115 | ||
116 | 116 | func gau (ua,txId) = ((("%s%s%s__G__" + ua) + "__") + txId) | |
117 | 117 | ||
118 | 118 | ||
119 | 119 | func aa () = "%s__amountAsset" | |
120 | 120 | ||
121 | 121 | ||
122 | 122 | func pa () = "%s__priceAsset" | |
123 | 123 | ||
124 | 124 | ||
125 | 125 | func amp () = "%s__amp" | |
126 | 126 | ||
127 | 127 | ||
128 | 128 | func ada () = "%s__addonAddr" | |
129 | 129 | ||
130 | 130 | ||
131 | 131 | let keyFee = "%s__fee" | |
132 | 132 | ||
133 | 133 | let fee = valueOrElse(getInteger(this, keyFee), feeDefault) | |
134 | 134 | ||
135 | 135 | let keyDLp = makeString(["%s", "dLp"], SEP) | |
136 | 136 | ||
137 | 137 | let keyDLpRefreshedHeight = makeString(["%s", "dLpRefreshedHeight"], SEP) | |
138 | 138 | ||
139 | 139 | let keyDLpRefreshDelay = makeString(["%s", "refreshDLpDelay"], SEP) | |
140 | 140 | ||
141 | 141 | let dLpRefreshDelayDefault = 1 | |
142 | 142 | ||
143 | 143 | let dLpRefreshDelay = valueOrElse(getInteger(this, keyDLpRefreshDelay), dLpRefreshDelayDefault) | |
144 | 144 | ||
145 | 145 | func fcfg () = "%s__factoryConfig" | |
146 | 146 | ||
147 | 147 | ||
148 | 148 | func mtpk () = "%s%s__matcher__publicKey" | |
149 | 149 | ||
150 | 150 | ||
151 | 151 | func pc (iAmtAs,iPrAs) = (((("%d%d%s__" + iAmtAs) + "__") + iPrAs) + "__config") | |
152 | 152 | ||
153 | 153 | ||
154 | 154 | func mba (bAStr) = ("%s%s%s__mappings__baseAsset2internalId__" + bAStr) | |
155 | 155 | ||
156 | 156 | ||
157 | 157 | func aps () = "%s__shutdown" | |
158 | 158 | ||
159 | 159 | ||
160 | 160 | func keyAllowedLpStableScriptHash () = "%s__allowedLpStableScriptHash" | |
161 | 161 | ||
162 | 162 | ||
163 | 163 | func keyFeeCollectorAddress () = "%s__feeCollectorAddress" | |
164 | 164 | ||
165 | 165 | ||
166 | 166 | func toe (orV,sendrV,matchV) = throw(((((("Failed: ordValid=" + toString(orV)) + " sndrValid=") + toString(sendrV)) + " mtchrValid=") + toString(matchV))) | |
167 | 167 | ||
168 | 168 | ||
169 | 169 | func strf (addr,key) = valueOrErrorMessage(getString(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], "")) | |
170 | 170 | ||
171 | 171 | ||
172 | 172 | func intf (addr,key) = valueOrErrorMessage(getInteger(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], "")) | |
173 | 173 | ||
174 | 174 | ||
175 | 175 | func throwErr (msg) = throw(makeString(["lp_stable.ride:", msg], " ")) | |
176 | 176 | ||
177 | 177 | ||
178 | 178 | func fmtErr (msg) = makeString(["lp_stable.ride:", msg], " ") | |
179 | 179 | ||
180 | 180 | ||
181 | 181 | let fca = addressFromStringValue(strf(this, fc())) | |
182 | 182 | ||
183 | 183 | let inFee = { | |
184 | 184 | let @ = invoke(fca, "getInFeeREADONLY", [toString(this)], nil) | |
185 | 185 | if ($isInstanceOf(@, "Int")) | |
186 | 186 | then @ | |
187 | 187 | else throw(($getType(@) + " couldn't be cast to Int")) | |
188 | 188 | } | |
189 | 189 | ||
190 | 190 | let outFee = { | |
191 | 191 | let @ = invoke(fca, "getOutFeeREADONLY", [toString(this)], nil) | |
192 | 192 | if ($isInstanceOf(@, "Int")) | |
193 | 193 | then @ | |
194 | 194 | else throw(($getType(@) + " couldn't be cast to Int")) | |
195 | 195 | } | |
196 | 196 | ||
197 | 197 | let A = strf(this, amp()) | |
198 | 198 | ||
199 | 199 | func igs () = valueOrElse(getBoolean(fca, aps()), false) | |
200 | 200 | ||
201 | 201 | ||
202 | 202 | func mp () = fromBase58String(strf(fca, mtpk())) | |
203 | 203 | ||
204 | 204 | ||
205 | 205 | let feeCollectorAddress = addressFromStringValue(strf(fca, keyFeeCollectorAddress())) | |
206 | 206 | ||
207 | 207 | func gpc () = { | |
208 | 208 | let amtAs = strf(this, aa()) | |
209 | 209 | let priceAs = strf(this, pa()) | |
210 | 210 | let iPriceAs = intf(fca, mba(priceAs)) | |
211 | 211 | let iAmtAs = intf(fca, mba(amtAs)) | |
212 | 212 | split(strf(fca, pc(toString(iAmtAs), toString(iPriceAs))), SEP) | |
213 | 213 | } | |
214 | 214 | ||
215 | 215 | ||
216 | 216 | func parseAssetId (input) = if ((input == wavesString)) | |
217 | 217 | then unit | |
218 | 218 | else fromBase58String(input) | |
219 | 219 | ||
220 | 220 | ||
221 | 221 | func assetIdToString (input) = if ((input == unit)) | |
222 | 222 | then wavesString | |
223 | 223 | else toBase58String(value(input)) | |
224 | 224 | ||
225 | 225 | ||
226 | 226 | func parsePoolConfig (poolConfig) = $Tuple9(addressFromStringValue(poolConfig[idxPoolAddress]), parseIntValue(poolConfig[idxPoolSt]), fromBase58String(poolConfig[idxLPAsId]), parseAssetId(poolConfig[idxAmAsId]), parseAssetId(poolConfig[idxPrAsId]), parseIntValue(poolConfig[idxAmtAsDcm]), parseIntValue(poolConfig[idxPriceAsDcm]), fromBase58String(poolConfig[idxIAmtAsId]), fromBase58String(poolConfig[idxIPriceAsId])) | |
227 | 227 | ||
228 | 228 | ||
229 | 229 | let poolConfigParsed = parsePoolConfig(gpc()) | |
230 | 230 | ||
231 | 231 | let $t077427971 = poolConfigParsed | |
232 | 232 | ||
233 | 233 | let cfgPoolAddress = $t077427971._1 | |
234 | 234 | ||
235 | 235 | let cfgPoolStatus = $t077427971._2 | |
236 | 236 | ||
237 | 237 | let cfgLpAssetId = $t077427971._3 | |
238 | 238 | ||
239 | 239 | let cfgAmountAssetId = $t077427971._4 | |
240 | 240 | ||
241 | 241 | let cfgPriceAssetId = $t077427971._5 | |
242 | 242 | ||
243 | 243 | let cfgAmountAssetDecimals = $t077427971._6 | |
244 | 244 | ||
245 | 245 | let cfgPriceAssetDecimals = $t077427971._7 | |
246 | 246 | ||
247 | 247 | let cfgInAmountAssedId = $t077427971._8 | |
248 | 248 | ||
249 | 249 | let cfgInPriceAssetId = $t077427971._9 | |
250 | 250 | ||
251 | 251 | func gfc () = split(strf(fca, fcfg()), SEP) | |
252 | 252 | ||
253 | 253 | ||
254 | 254 | let factoryConfig = gfc() | |
255 | 255 | ||
256 | 256 | let stakingContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactStakCntr]), "Invalid staking contract address") | |
257 | 257 | ||
258 | 258 | let slipageContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactSlippCntr]), "Invalid slipage contract address") | |
259 | 259 | ||
260 | 260 | let gwxContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactGwxRewCntr]), "Invalid gwx contract address") | |
261 | 261 | ||
262 | 262 | let restContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactoryRestCntr]), "Invalid gwx contract address") | |
263 | 263 | ||
264 | 264 | 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) | |
265 | 265 | ||
266 | 266 | ||
267 | 267 | 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) | |
268 | 268 | ||
269 | 269 | ||
270 | 270 | func getAccBalance (assetId) = if ((assetId == "WAVES")) | |
271 | 271 | then wavesBalance(this).available | |
272 | 272 | else assetBalance(this, fromBase58String(assetId)) | |
273 | 273 | ||
274 | 274 | ||
275 | 275 | func cpbi (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18) | |
276 | 276 | ||
277 | 277 | ||
278 | 278 | func cpbir (prAmtX18,amAmtX18,round) = fraction(prAmtX18, scale18, amAmtX18, round) | |
279 | 279 | ||
280 | 280 | ||
281 | 281 | func vad (A1,A2,slippage) = { | |
282 | 282 | let diff = fraction((A1 - A2), scale8BigInt, A2) | |
283 | 283 | let pass = ((slippage - abs(diff)) > zeroBigInt) | |
284 | 284 | if (!(pass)) | |
285 | 285 | then throw(("Big slpg: " + toString(diff))) | |
286 | 286 | else $Tuple2(pass, min([A1, A2])) | |
287 | 287 | } | |
288 | 288 | ||
289 | 289 | ||
290 | 290 | func vd (D1,D0,slpg) = { | |
291 | 291 | let diff = fraction(D0, scale8BigInt, D1) | |
292 | 292 | let fail = (slpg > diff) | |
293 | 293 | if (if (fail) | |
294 | 294 | then true | |
295 | 295 | else (D0 > D1)) | |
296 | 296 | then throw(((((((toString(D0) + " ") + toString(D1)) + " ") + toString(diff)) + " ") + toString(slpg))) | |
297 | 297 | else fail | |
298 | 298 | } | |
299 | 299 | ||
300 | 300 | ||
301 | 301 | func pcp (amAssetDcm,prAssetDcm,amAmt,prAmt) = { | |
302 | 302 | let amtAsAmtX18 = t1(amAmt, amAssetDcm) | |
303 | 303 | let prAsAmtX18 = t1(prAmt, prAssetDcm) | |
304 | 304 | cpbi(prAsAmtX18, amtAsAmtX18) | |
305 | 305 | } | |
306 | 306 | ||
307 | 307 | ||
308 | 308 | func calcPrices (amAmt,prAmt,lpAmt) = { | |
309 | 309 | let amtAsDcm = cfgAmountAssetDecimals | |
310 | 310 | let prAsDcm = cfgPriceAssetDecimals | |
311 | 311 | let priceX18 = pcp(amtAsDcm, prAsDcm, amAmt, prAmt) | |
312 | 312 | let amAmtX18 = t1(amAmt, amtAsDcm) | |
313 | 313 | let prAmtX18 = t1(prAmt, prAsDcm) | |
314 | 314 | let lpAmtX18 = t1(lpAmt, scale8) | |
315 | 315 | let lpPrInAmAsX18 = cpbi(amAmtX18, lpAmtX18) | |
316 | 316 | let lpPrInPrAsX18 = cpbi(prAmtX18, lpAmtX18) | |
317 | 317 | [priceX18, lpPrInAmAsX18, lpPrInPrAsX18] | |
318 | 318 | } | |
319 | 319 | ||
320 | 320 | ||
321 | 321 | func calculatePrices (amAmt,prAmt,lpAmt) = { | |
322 | 322 | let p = calcPrices(amAmt, prAmt, lpAmt) | |
323 | 323 | [f1(p[0], scale8), f1(p[1], scale8), f1(p[2], scale8)] | |
324 | 324 | } | |
325 | 325 | ||
326 | 326 | ||
327 | 327 | func takeFee (amount,fee) = { | |
328 | 328 | let feeAmount = if ((fee == 0)) | |
329 | 329 | then 0 | |
330 | 330 | else fraction(amount, fee, scale8) | |
331 | 331 | $Tuple2((amount - feeAmount), feeAmount) | |
332 | 332 | } | |
333 | 333 | ||
334 | 334 | ||
335 | 335 | func ego (txId58,pmtAssetId,pmtLpAmt,userAddress) = { | |
336 | 336 | let lpId = cfgLpAssetId | |
337 | 337 | let amId = toBase58String(value(cfgAmountAssetId)) | |
338 | 338 | let prId = toBase58String(value(cfgPriceAssetId)) | |
339 | 339 | let amDcm = cfgAmountAssetDecimals | |
340 | 340 | let prDcm = cfgPriceAssetDecimals | |
341 | 341 | let sts = toString(cfgPoolStatus) | |
342 | 342 | let lpEmiss = valueOrErrorMessage(assetInfo(lpId), "Wrong LP id").quantity | |
343 | 343 | if ((toBase58String(lpId) != pmtAssetId)) | |
344 | 344 | then throw("Wrong pmt asset") | |
345 | 345 | else { | |
346 | 346 | let amBalance = getAccBalance(amId) | |
347 | 347 | let amBalanceX18 = t1(amBalance, amDcm) | |
348 | 348 | let prBalance = getAccBalance(prId) | |
349 | 349 | let prBalanceX18 = t1(prBalance, prDcm) | |
350 | 350 | let curPriceX18 = cpbi(prBalanceX18, amBalanceX18) | |
351 | 351 | let curPrice = f1(curPriceX18, scale8) | |
352 | 352 | let pmtLpAmtX18 = t1(pmtLpAmt, scale8) | |
353 | 353 | let lpEmissX18 = t1(lpEmiss, scale8) | |
354 | 354 | let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissX18) | |
355 | 355 | let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissX18) | |
356 | 356 | let outAmAmt = fromX18Round(outAmAmtX18, amDcm, FLOOR) | |
357 | 357 | let outPrAmt = fromX18Round(outPrAmtX18, prDcm, FLOOR) | |
358 | 358 | let state = if ((txId58 == "")) | |
359 | 359 | then nil | |
360 | 360 | else [ScriptTransfer(userAddress, outAmAmt, if ((amId == "WAVES")) | |
361 | 361 | then unit | |
362 | 362 | else fromBase58String(amId)), ScriptTransfer(userAddress, outPrAmt, if ((prId == "WAVES")) | |
363 | 363 | then unit | |
364 | 364 | 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)] | |
365 | 365 | $Tuple10(outAmAmt, outPrAmt, amId, prId, amBalance, prBalance, lpEmiss, curPriceX18, sts, state) | |
366 | 366 | } | |
367 | 367 | } | |
368 | 368 | ||
369 | 369 | ||
370 | 370 | func epo (txId58,slippage,inAmAmt,inAmId,inPrAmt,inPrId,userAddress,isEval,emitLp,isOneAsset,validateSlippage,pmtAmt,pmtId) = { | |
371 | 371 | let lpId = cfgLpAssetId | |
372 | 372 | let amIdStr = toBase58String(value(cfgAmountAssetId)) | |
373 | 373 | let prIdStr = toBase58String(value(cfgPriceAssetId)) | |
374 | 374 | let inAmIdStr = cfgInAmountAssedId | |
375 | 375 | let inPrIdStr = cfgInPriceAssetId | |
376 | 376 | let amtDcm = cfgAmountAssetDecimals | |
377 | 377 | let priceDcm = cfgPriceAssetDecimals | |
378 | 378 | let sts = toString(cfgPoolStatus) | |
379 | 379 | let lpEm = valueOrErrorMessage(assetInfo(lpId), "Wr lp as").quantity | |
380 | 380 | let amBalance = if (isEval) | |
381 | 381 | then getAccBalance(amIdStr) | |
382 | 382 | else if (if (isOneAsset) | |
383 | 383 | then (pmtId == amIdStr) | |
384 | 384 | else false) | |
385 | 385 | then (getAccBalance(amIdStr) - pmtAmt) | |
386 | 386 | else if (isOneAsset) | |
387 | 387 | then getAccBalance(amIdStr) | |
388 | 388 | else (getAccBalance(amIdStr) - inAmAmt) | |
389 | 389 | let prBalance = if (isEval) | |
390 | 390 | then getAccBalance(prIdStr) | |
391 | 391 | else if (if (isOneAsset) | |
392 | 392 | then (pmtId == prIdStr) | |
393 | 393 | else false) | |
394 | 394 | then (getAccBalance(prIdStr) - pmtAmt) | |
395 | 395 | else if (isOneAsset) | |
396 | 396 | then getAccBalance(prIdStr) | |
397 | 397 | else (getAccBalance(prIdStr) - inPrAmt) | |
398 | 398 | let inAmAssetAmtX18 = t1(inAmAmt, amtDcm) | |
399 | 399 | let inPrAssetAmtX18 = t1(inPrAmt, priceDcm) | |
400 | 400 | let userPriceX18 = cpbi(inPrAssetAmtX18, inAmAssetAmtX18) | |
401 | 401 | let amBalanceX18 = t1(amBalance, amtDcm) | |
402 | 402 | let prBalanceX18 = t1(prBalance, priceDcm) | |
403 | 403 | let r = if ((lpEm == 0)) | |
404 | 404 | then { | |
405 | 405 | let curPriceX18 = zeroBigInt | |
406 | 406 | let slippageX18 = zeroBigInt | |
407 | 407 | let lpAmtX18 = pow((inAmAssetAmtX18 * inPrAssetAmtX18), 0, toBigInt(5), 1, 0, DOWN) | |
408 | 408 | $Tuple5(f1(lpAmtX18, scale8), f1(inAmAssetAmtX18, amtDcm), f1(inPrAssetAmtX18, priceDcm), cpbi((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18) | |
409 | 409 | } | |
410 | 410 | else { | |
411 | 411 | let curPriceX18 = cpbi(prBalanceX18, amBalanceX18) | |
412 | 412 | let slippageRealX18 = fraction(abs((curPriceX18 - userPriceX18)), scale18, curPriceX18) | |
413 | 413 | let slippageX18 = t1(slippage, scale8) | |
414 | 414 | if (if (if (validateSlippage) | |
415 | 415 | then (curPriceX18 != zeroBigInt) | |
416 | 416 | else false) | |
417 | 417 | then (slippageRealX18 > slippageX18) | |
418 | 418 | else false) | |
419 | 419 | then throw(((("Price slippage " + toString(slippageRealX18)) + " > ") + toString(slippageX18))) | |
420 | 420 | else { | |
421 | 421 | let lpEmissionX18 = t1(lpEm, scale8) | |
422 | 422 | let prViaAmX18 = fraction(inAmAssetAmtX18, cpbir(prBalanceX18, amBalanceX18, CEILING), scale18, CEILING) | |
423 | 423 | let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, cpbir(prBalanceX18, amBalanceX18, FLOOR), CEILING) | |
424 | 424 | let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18)) | |
425 | 425 | then $Tuple2(amViaPrX18, inPrAssetAmtX18) | |
426 | 426 | else $Tuple2(inAmAssetAmtX18, prViaAmX18) | |
427 | 427 | let expAmtAssetAmtX18 = expectedAmts._1 | |
428 | 428 | let expPriceAssetAmtX18 = expectedAmts._2 | |
429 | 429 | let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18, FLOOR) | |
430 | 430 | $Tuple5(fromX18Round(lpAmtX18, scale8, FLOOR), fromX18Round(expAmtAssetAmtX18, amtDcm, CEILING), fromX18Round(expPriceAssetAmtX18, priceDcm, CEILING), curPriceX18, slippageX18) | |
431 | 431 | } | |
432 | 432 | } | |
433 | 433 | let calcLpAmt = r._1 | |
434 | 434 | let calcAmAssetPmt = r._2 | |
435 | 435 | let calcPrAssetPmt = r._3 | |
436 | 436 | let curPrice = f1(r._4, scale8) | |
437 | 437 | let slippageCalc = f1(r._5, scale8) | |
438 | 438 | if ((0 >= calcLpAmt)) | |
439 | 439 | then throw("LP <= 0") | |
440 | 440 | else { | |
441 | 441 | let emitLpAmt = if (!(emitLp)) | |
442 | 442 | then 0 | |
443 | 443 | else calcLpAmt | |
444 | 444 | let amDiff = (inAmAmt - calcAmAssetPmt) | |
445 | 445 | let prDiff = (inPrAmt - calcPrAssetPmt) | |
446 | 446 | let $t01862118966 = if (if (isOneAsset) | |
447 | 447 | then (pmtId == amIdStr) | |
448 | 448 | else false) | |
449 | 449 | then $Tuple2(pmtAmt, 0) | |
450 | 450 | else if (if (isOneAsset) | |
451 | 451 | then (pmtId == prIdStr) | |
452 | 452 | else false) | |
453 | 453 | then $Tuple2(0, pmtAmt) | |
454 | 454 | else $Tuple2(calcAmAssetPmt, calcPrAssetPmt) | |
455 | 455 | let writeAmAmt = $t01862118966._1 | |
456 | 456 | let writePrAmt = $t01862118966._2 | |
457 | 457 | 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))] | |
458 | 458 | $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEm, lpId, sts, commonState, amDiff, prDiff, inAmId, inPrId) | |
459 | 459 | } | |
460 | 460 | } | |
461 | 461 | ||
462 | 462 | ||
463 | 463 | func getD (xp) = { | |
464 | 464 | let xp0 = xp[0] | |
465 | 465 | let xp1 = xp[1] | |
466 | 466 | let s = (xp0 + xp1) | |
467 | 467 | if ((s == big0)) | |
468 | 468 | then big0 | |
469 | 469 | else { | |
470 | 470 | let a = parseIntValue(A) | |
471 | 471 | let ann = (a * 2) | |
472 | 472 | let p = fraction(xp0, xp1, big1) | |
473 | 473 | let xp0_xp1_n_n = fraction(p, big4, big1) | |
474 | 474 | let ann_s = fraction(toBigInt(ann), s, big1) | |
475 | 475 | let ann_1 = toBigInt((ann - 1)) | |
476 | 476 | func calcDNext (d) = { | |
477 | 477 | let dd = fraction(d, d, big1) | |
478 | 478 | let ddd = fraction(dd, d, big1) | |
479 | 479 | let dp = fraction(ddd, big1, xp0_xp1_n_n) | |
480 | 480 | fraction((ann_s + fraction(dp, big2, big1)), d, (fraction(ann_1, d, big1) + fraction(big3, dp, big1)), CEILING) | |
481 | 481 | } | |
482 | 482 | ||
483 | 483 | func calc (acc,i) = if (acc._2) | |
484 | 484 | then acc | |
485 | 485 | else { | |
486 | 486 | let d = acc._1 | |
487 | 487 | let dNext = calcDNext(d) | |
488 | 488 | let dDiffRaw = (dNext - value(d)) | |
489 | 489 | let dDiff = if ((big0 > dDiffRaw)) | |
490 | 490 | then -(dDiffRaw) | |
491 | 491 | else dDiffRaw | |
492 | 492 | if ((big1 >= dDiff)) | |
493 | 493 | then $Tuple2(dNext, true) | |
494 | 494 | else $Tuple2(dNext, false) | |
495 | 495 | } | |
496 | 496 | ||
497 | 497 | let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] | |
498 | 498 | let $t02089020938 = { | |
499 | 499 | let $l = arr | |
500 | 500 | let $s = size($l) | |
501 | 501 | let $acc0 = $Tuple2(s, false) | |
502 | 502 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
503 | 503 | then $a | |
504 | 504 | else calc($a, $l[$i]) | |
505 | 505 | ||
506 | 506 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
507 | 507 | then $a | |
508 | 508 | else throw("List size exceeds 15") | |
509 | 509 | ||
510 | 510 | $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) | |
511 | 511 | } | |
512 | 512 | let d = $t02089020938._1 | |
513 | 513 | let found = $t02089020938._2 | |
514 | 514 | if (found) | |
515 | 515 | then d | |
516 | 516 | else throw(("D calculation error, D = " + toString(d))) | |
517 | 517 | } | |
518 | 518 | } | |
519 | 519 | ||
520 | 520 | ||
521 | 521 | func getDOld (xp) = { | |
522 | 522 | let n = big2 | |
523 | 523 | let xp0 = xp[0] | |
524 | 524 | let xp1 = xp[1] | |
525 | 525 | let aPrecision = parseBigIntValue(Amult) | |
526 | 526 | let a = (parseBigIntValue(A) * aPrecision) | |
527 | 527 | let s = (xp0 + xp1) | |
528 | 528 | if ((s == big0)) | |
529 | 529 | then big0 | |
530 | 530 | else { | |
531 | 531 | let ann = (a * n) | |
532 | 532 | let xp0_xp1_n_n = (((xp0 * xp1) * n) * n) | |
533 | 533 | let ann_s_aPrecision = ((ann * s) / aPrecision) | |
534 | 534 | let ann_aPrecision = (ann - aPrecision) | |
535 | 535 | let n1 = (n + big1) | |
536 | 536 | func calc (acc,cur) = { | |
537 | 537 | let $t02156721587 = acc | |
538 | 538 | let d = $t02156721587._1 | |
539 | 539 | let found = $t02156721587._2 | |
540 | 540 | if ((found != unit)) | |
541 | 541 | then acc | |
542 | 542 | else { | |
543 | 543 | let dp = (((d * d) * d) / xp0_xp1_n_n) | |
544 | 544 | let dNext = (((ann_s_aPrecision + (dp * n)) * d) / (((ann_aPrecision * d) / aPrecision) + (n1 * dp))) | |
545 | 545 | let dDiff = absBigInt((dNext - value(d))) | |
546 | 546 | if ((big1 >= dDiff)) | |
547 | 547 | then $Tuple2(dNext, cur) | |
548 | 548 | else $Tuple2(dNext, unit) | |
549 | 549 | } | |
550 | 550 | } | |
551 | 551 | ||
552 | 552 | let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] | |
553 | 553 | let $t02200822055 = { | |
554 | 554 | let $l = arr | |
555 | 555 | let $s = size($l) | |
556 | 556 | let $acc0 = $Tuple2(s, unit) | |
557 | 557 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
558 | 558 | then $a | |
559 | 559 | else calc($a, $l[$i]) | |
560 | 560 | ||
561 | 561 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
562 | 562 | then $a | |
563 | 563 | else throw("List size exceeds 15") | |
564 | 564 | ||
565 | 565 | $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) | |
566 | 566 | } | |
567 | 567 | let d = $t02200822055._1 | |
568 | 568 | let found = $t02200822055._2 | |
569 | 569 | if ((found != unit)) | |
570 | 570 | then d | |
571 | 571 | else throw(("D calculation error, D = " + toString(d))) | |
572 | 572 | } | |
573 | 573 | } | |
574 | 574 | ||
575 | 575 | ||
576 | 576 | func getYD (xp,i,D) = { | |
577 | 577 | let n = big2 | |
578 | 578 | let x = xp[if ((i == 0)) | |
579 | 579 | then 1 | |
580 | 580 | else 0] | |
581 | 581 | let aPrecision = parseBigIntValue(Amult) | |
582 | 582 | let a = (parseBigIntValue(A) * aPrecision) | |
583 | 583 | let s = x | |
584 | 584 | let ann = (a * n) | |
585 | 585 | let c = (((((D * D) / (x * n)) * D) * aPrecision) / (ann * n)) | |
586 | 586 | let b = ((s + ((D * aPrecision) / ann)) - D) | |
587 | 587 | func calc (acc,cur) = { | |
588 | 588 | let $t02255522575 = acc | |
589 | 589 | let y = $t02255522575._1 | |
590 | 590 | let found = $t02255522575._2 | |
591 | 591 | if ((found != unit)) | |
592 | 592 | then acc | |
593 | 593 | else { | |
594 | 594 | let yNext = (((y * y) + c) / ((big2 * y) + b)) | |
595 | 595 | let yDiff = absBigInt((yNext - value(y))) | |
596 | 596 | if ((big1 >= yDiff)) | |
597 | 597 | then $Tuple2(yNext, cur) | |
598 | 598 | else $Tuple2(yNext, unit) | |
599 | 599 | } | |
600 | 600 | } | |
601 | 601 | ||
602 | 602 | let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] | |
603 | 603 | let $t02288222929 = { | |
604 | 604 | let $l = arr | |
605 | 605 | let $s = size($l) | |
606 | 606 | let $acc0 = $Tuple2(D, unit) | |
607 | 607 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
608 | 608 | then $a | |
609 | 609 | else calc($a, $l[$i]) | |
610 | 610 | ||
611 | 611 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
612 | 612 | then $a | |
613 | 613 | else throw("List size exceeds 15") | |
614 | 614 | ||
615 | 615 | $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) | |
616 | 616 | } | |
617 | 617 | let y = $t02288222929._1 | |
618 | 618 | let found = $t02288222929._2 | |
619 | 619 | if ((found != unit)) | |
620 | 620 | then y | |
621 | 621 | else throw(("Y calculation error, Y = " + toString(y))) | |
622 | 622 | } | |
623 | 623 | ||
624 | 624 | ||
625 | 625 | func calcDLp (amountBalance,priceBalance,lpEmission) = { | |
626 | 626 | let updatedDLp = fraction(getD([t1(toInt(amountBalance), cfgAmountAssetDecimals), t1(toInt(priceBalance), cfgPriceAssetDecimals)]), big1, lpEmission) | |
627 | 627 | if ((lpEmission == big0)) | |
628 | 628 | then big0 | |
629 | 629 | else updatedDLp | |
630 | 630 | } | |
631 | 631 | ||
632 | 632 | ||
633 | 633 | func calcCurrentDLp (amountAssetDelta,priceAssetDelta,lpAssetEmissionDelta) = { | |
634 | 634 | let amountAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) - amountAssetDelta) | |
635 | 635 | let priceAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) - priceAssetDelta) | |
636 | 636 | let lpAssetEmission = (toBigInt(value(assetInfo(cfgLpAssetId)).quantity) - lpAssetEmissionDelta) | |
637 | 637 | let currentDLp = calcDLp(amountAssetBalance, priceAssetBalance, lpAssetEmission) | |
638 | 638 | currentDLp | |
639 | 639 | } | |
640 | 640 | ||
641 | 641 | ||
642 | 642 | func refreshDLpInternal (amountAssetBalanceDelta,priceAssetBalanceDelta,lpAssetEmissionDelta) = { | |
643 | 643 | let amountAssetBalance = (getAccBalance(assetIdToString(cfgAmountAssetId)) + amountAssetBalanceDelta) | |
644 | 644 | let priceAssetBalance = (getAccBalance(assetIdToString(cfgPriceAssetId)) + priceAssetBalanceDelta) | |
645 | 645 | let lpAssetEmission = (value(assetInfo(cfgLpAssetId)).quantity + lpAssetEmissionDelta) | |
646 | 646 | let updatedDLp = calcDLp(toBigInt(amountAssetBalance), toBigInt(priceAssetBalance), toBigInt(lpAssetEmission)) | |
647 | 647 | let actions = [IntegerEntry(keyDLpRefreshedHeight, height), StringEntry(keyDLp, toString(updatedDLp))] | |
648 | 648 | $Tuple2(actions, updatedDLp) | |
649 | 649 | } | |
650 | 650 | ||
651 | 651 | ||
652 | 652 | func validateUpdatedDLp (oldDLp,updatedDLp) = if ((updatedDLp >= oldDLp)) | |
653 | 653 | then true | |
654 | 654 | else throwErr("updated DLp lower than current DLp") | |
655 | 655 | ||
656 | 656 | ||
657 | 657 | func validateMatcherOrderAllowed (order) = { | |
658 | 658 | let amountAssetAmount = order.amount | |
659 | 659 | let priceAssetAmount = fraction(order.amount, order.price, scale8, FLOOR) | |
660 | 660 | let $t02495225164 = if ((order.orderType == Buy)) | |
661 | 661 | then $Tuple2(amountAssetAmount, -(priceAssetAmount)) | |
662 | 662 | else $Tuple2(-(amountAssetAmount), priceAssetAmount) | |
663 | 663 | let amountAssetBalanceDelta = $t02495225164._1 | |
664 | 664 | let priceAssetBalanceDelta = $t02495225164._2 | |
665 | 665 | if (if (if (igs()) | |
666 | 666 | then true | |
667 | 667 | else (cfgPoolStatus == PoolMatcherDis)) | |
668 | 668 | then true | |
669 | 669 | else (cfgPoolStatus == PoolShutdown)) | |
670 | 670 | then throw("Admin blocked") | |
671 | 671 | else if (if ((order.assetPair.amountAsset != cfgAmountAssetId)) | |
672 | 672 | then true | |
673 | 673 | else (order.assetPair.priceAsset != cfgPriceAssetId)) | |
674 | 674 | then throw("Wr assets") | |
675 | 675 | else { | |
676 | 676 | let dLp = parseBigIntValue(getStringValue(this, keyDLp)) | |
677 | 677 | let $t02549425594 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0) | |
678 | 678 | let unusedActions = $t02549425594._1 | |
679 | 679 | let dLpNew = $t02549425594._2 | |
680 | 680 | let isOrderValid = (dLpNew >= dLp) | |
681 | 681 | isOrderValid | |
682 | 682 | } | |
683 | 683 | } | |
684 | 684 | ||
685 | 685 | ||
686 | 686 | func cg (i) = if ((size(i.payments) != 1)) | |
687 | 687 | then throw("1 pmnt exp") | |
688 | 688 | else { | |
689 | 689 | let pmt = value(i.payments[0]) | |
690 | 690 | let pmtAssetId = value(pmt.assetId) | |
691 | 691 | let pmtAmt = pmt.amount | |
692 | 692 | let r = ego(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller) | |
693 | 693 | let outAmAmt = r._1 | |
694 | 694 | let outPrAmt = r._2 | |
695 | 695 | let sts = parseIntValue(r._9) | |
696 | 696 | let state = r._10 | |
697 | 697 | if (if (igs()) | |
698 | 698 | then true | |
699 | 699 | else (sts == PoolShutdown)) | |
700 | 700 | then throw(("Admin blocked: " + toString(sts))) | |
701 | 701 | else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state) | |
702 | 702 | } | |
703 | 703 | ||
704 | 704 | ||
705 | 705 | func cp (caller,txId,amAsPmt,prAsPmt,slippage,emitLp,isOneAsset,validateSlippage,pmtAmt,pmtId) = { | |
706 | 706 | let r = epo(txId, slippage, value(amAsPmt).amount, value(amAsPmt).assetId, value(prAsPmt).amount, value(prAsPmt).assetId, caller, (txId == ""), emitLp, isOneAsset, validateSlippage, pmtAmt, pmtId) | |
707 | 707 | let sts = parseIntValue(r._8) | |
708 | 708 | if (if (if (igs()) | |
709 | 709 | then true | |
710 | 710 | else (sts == PoolPutDis)) | |
711 | 711 | then true | |
712 | 712 | else (sts == PoolShutdown)) | |
713 | 713 | then throw(("Blocked:" + toString(sts))) | |
714 | 714 | else r | |
715 | 715 | } | |
716 | 716 | ||
717 | 717 | ||
718 | 718 | func calcPutOneTkn (pmtAmtRaw,pmtAssetId,userAddress,txId,withTakeFee) = { | |
719 | 719 | let amId = toBase58String(value(cfgAmountAssetId)) | |
720 | 720 | let prId = toBase58String(value(cfgPriceAssetId)) | |
721 | 721 | let lpId = cfgLpAssetId | |
722 | 722 | let amtDcm = cfgAmountAssetDecimals | |
723 | 723 | let priceDcm = cfgPriceAssetDecimals | |
724 | 724 | let lpAssetEmission = toBigInt(valueOrErrorMessage(assetInfo(lpId), "invalid lp asset").quantity) | |
725 | 725 | let chechEmission = if ((lpAssetEmission > big0)) | |
726 | 726 | then true | |
727 | 727 | else throw("initial deposit requires all coins") | |
728 | 728 | if ((chechEmission == chechEmission)) | |
729 | 729 | then { | |
730 | 730 | let amBalance = getAccBalance(amId) | |
731 | 731 | let prBalance = getAccBalance(prId) | |
732 | 732 | let $t02786028322 = if ((txId == "")) | |
733 | 733 | then $Tuple2(amBalance, prBalance) | |
734 | 734 | else if ((pmtAssetId == amId)) | |
735 | 735 | then if ((pmtAmtRaw > amBalance)) | |
736 | 736 | then throw("invalid payment amount") | |
737 | 737 | else $Tuple2((amBalance - pmtAmtRaw), prBalance) | |
738 | 738 | else if ((pmtAssetId == prId)) | |
739 | 739 | then if ((pmtAmtRaw > prBalance)) | |
740 | 740 | then throw("invalid payment amount") | |
741 | 741 | else $Tuple2(amBalance, (prBalance - pmtAmtRaw)) | |
742 | 742 | else throw("wrong pmtAssetId") | |
743 | 743 | let amBalanceOld = $t02786028322._1 | |
744 | 744 | let prBalanceOld = $t02786028322._2 | |
745 | 745 | let $t02832828504 = if ((pmtAssetId == amId)) | |
746 | 746 | then $Tuple2(pmtAmtRaw, 0) | |
747 | 747 | else if ((pmtAssetId == prId)) | |
748 | 748 | then $Tuple2(0, pmtAmtRaw) | |
749 | 749 | else throw("invalid payment") | |
750 | 750 | let amAmountRaw = $t02832828504._1 | |
751 | 751 | let prAmountRaw = $t02832828504._2 | |
752 | 752 | let $t02850828762 = if (withTakeFee) | |
753 | 753 | then $Tuple3(takeFee(amAmountRaw, inFee)._1, takeFee(prAmountRaw, inFee)._1, takeFee(pmtAmtRaw, inFee)._2) | |
754 | 754 | else $Tuple3(amAmountRaw, prAmountRaw, 0) | |
755 | 755 | let amAmount = $t02850828762._1 | |
756 | 756 | let prAmount = $t02850828762._2 | |
757 | 757 | let feeAmount = $t02850828762._3 | |
758 | 758 | let amBalanceNew = (amBalanceOld + amAmount) | |
759 | 759 | let prBalanceNew = (prBalanceOld + prAmount) | |
760 | 760 | let D0 = getD([toBigInt(amBalanceOld), toBigInt(prBalanceOld)]) | |
761 | 761 | let D1 = getD([toBigInt(amBalanceNew), toBigInt(prBalanceNew)]) | |
762 | 762 | let checkD = if ((D1 > D0)) | |
763 | 763 | then true | |
764 | 764 | else throw() | |
765 | 765 | if ((checkD == checkD)) | |
766 | 766 | then { | |
767 | 767 | let lpAmount = fraction(lpAssetEmission, (D1 - D0), D0, FLOOR) | |
768 | 768 | let curPrice = f1(cpbi(t1(prBalanceNew, priceDcm), t1(amBalanceNew, amtDcm)), scale8) | |
769 | 769 | 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))] | |
770 | 770 | let poolProportion = fraction(prBalanceOld, scale8, amBalanceOld) | |
771 | 771 | let amountAssetPart = fraction(pmtAmtRaw, scale8, (poolProportion + scale8)) | |
772 | 772 | let priceAssetPart = (pmtAmtRaw - amountAssetPart) | |
773 | 773 | let lpAmtBoth = fraction(lpAssetEmission, toBigInt(priceAssetPart), toBigInt(prBalanceOld)) | |
774 | 774 | let bonus = toInt(fraction((lpAmount - lpAmtBoth), scale8BigInt, lpAmtBoth)) | |
775 | 775 | $Tuple4(toInt(lpAmount), commonState, feeAmount, bonus) | |
776 | 776 | } | |
777 | 777 | else throw("Strict value is not equal to itself.") | |
778 | 778 | } | |
779 | 779 | else throw("Strict value is not equal to itself.") | |
780 | 780 | } | |
781 | 781 | ||
782 | 782 | ||
783 | 783 | func getOneTknV2Internal (outAssetId,minOutAmount,payments,caller,originCaller,transactionId) = { | |
784 | 784 | let lpId = toBase58String(value(cfgLpAssetId)) | |
785 | 785 | let amId = toBase58String(value(cfgAmountAssetId)) | |
786 | 786 | let prId = toBase58String(value(cfgPriceAssetId)) | |
787 | 787 | let amDecimals = cfgAmountAssetDecimals | |
788 | 788 | let prDecimals = cfgPriceAssetDecimals | |
789 | 789 | let poolStatus = cfgPoolStatus | |
790 | 790 | let userAddress = if ((caller == restContract)) | |
791 | 791 | then originCaller | |
792 | 792 | else caller | |
793 | 793 | let pmt = value(payments[0]) | |
794 | 794 | let pmtAssetId = value(pmt.assetId) | |
795 | 795 | let pmtAmt = pmt.amount | |
796 | 796 | let currentDLp = calcCurrentDLp(big0, big0, big0) | |
797 | 797 | if ((currentDLp == currentDLp)) | |
798 | 798 | then { | |
799 | 799 | let txId58 = toBase58String(transactionId) | |
800 | 800 | if ((lpId != toBase58String(pmtAssetId))) | |
801 | 801 | then throw("Wrong LP") | |
802 | 802 | else { | |
803 | 803 | let amBalance = getAccBalance(amId) | |
804 | 804 | let prBalance = getAccBalance(prId) | |
805 | 805 | let $t03081230923 = { | |
806 | 806 | let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, pmtAmt], nil) | |
807 | 807 | if ($isInstanceOf(@, "(Int, Int)")) | |
808 | 808 | then @ | |
809 | 809 | else throw(($getType(@) + " couldn't be cast to (Int, Int)")) | |
810 | 810 | } | |
811 | 811 | if (($t03081230923 == $t03081230923)) | |
812 | 812 | then { | |
813 | 813 | let feeAmount = $t03081230923._2 | |
814 | 814 | let totalGet = $t03081230923._1 | |
815 | 815 | let totalAmount = if (if ((minOutAmount > 0)) | |
816 | 816 | then (minOutAmount > totalGet) | |
817 | 817 | else false) | |
818 | 818 | then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], "")) | |
819 | 819 | else totalGet | |
820 | 820 | let $t03111331420 = if ((outAssetId == amId)) | |
821 | 821 | then $Tuple4(totalAmount, 0, ((amBalance - totalAmount) - feeAmount), prBalance) | |
822 | 822 | else if ((outAssetId == prId)) | |
823 | 823 | then $Tuple4(0, totalAmount, amBalance, ((prBalance - totalAmount) - feeAmount)) | |
824 | 824 | else throw("invalid out asset id") | |
825 | 825 | let outAm = $t03111331420._1 | |
826 | 826 | let outPr = $t03111331420._2 | |
827 | 827 | let amBalanceNew = $t03111331420._3 | |
828 | 828 | let prBalanceNew = $t03111331420._4 | |
829 | 829 | let curPrX18 = cpbi(t1(prBalanceNew, prDecimals), t1(amBalanceNew, amDecimals)) | |
830 | 830 | let curPr = f1(curPrX18, scale8) | |
831 | 831 | let outAssetIdOrWaves = if ((outAssetId == "WAVES")) | |
832 | 832 | then unit | |
833 | 833 | else fromBase58String(outAssetId) | |
834 | 834 | let sendFeeToMatcher = if ((feeAmount > 0)) | |
835 | 835 | then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetIdOrWaves)] | |
836 | 836 | else nil | |
837 | 837 | 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) | |
838 | 838 | if ((state == state)) | |
839 | 839 | then { | |
840 | 840 | let burn = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
841 | 841 | if ((burn == burn)) | |
842 | 842 | then { | |
843 | 843 | let $t03220532555 = { | |
844 | 844 | let feeAmountForCalc = if ((this == feeCollectorAddress)) | |
845 | 845 | then 0 | |
846 | 846 | else feeAmount | |
847 | 847 | let outInAmountAsset = if ((parseAssetId(outAssetId) == cfgAmountAssetId)) | |
848 | 848 | then true | |
849 | 849 | else false | |
850 | 850 | if (outInAmountAsset) | |
851 | 851 | then $Tuple2(-((totalGet + feeAmountForCalc)), 0) | |
852 | 852 | else $Tuple2(0, -((totalGet + feeAmountForCalc))) | |
853 | 853 | } | |
854 | 854 | let amountAssetBalanceDelta = $t03220532555._1 | |
855 | 855 | let priceAssetBalanceDelta = $t03220532555._2 | |
856 | 856 | let $t03255832666 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0) | |
857 | 857 | let refreshDLpActions = $t03255832666._1 | |
858 | 858 | let updatedDLp = $t03255832666._2 | |
859 | 859 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
860 | 860 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
861 | 861 | then $Tuple2((state ++ refreshDLpActions), totalAmount) | |
862 | 862 | else throw("Strict value is not equal to itself.") | |
863 | 863 | } | |
864 | 864 | else throw("Strict value is not equal to itself.") | |
865 | 865 | } | |
866 | 866 | else throw("Strict value is not equal to itself.") | |
867 | 867 | } | |
868 | 868 | else throw("Strict value is not equal to itself.") | |
869 | 869 | } | |
870 | 870 | } | |
871 | 871 | else throw("Strict value is not equal to itself.") | |
872 | 872 | } | |
873 | 873 | ||
874 | 874 | ||
875 | 875 | func m () = match getString(mpk()) { | |
876 | 876 | case s: String => | |
877 | 877 | fromBase58String(s) | |
878 | 878 | case _: Unit => | |
879 | 879 | unit | |
880 | 880 | case _ => | |
881 | 881 | throw("Match error") | |
882 | 882 | } | |
883 | 883 | ||
884 | 884 | ||
885 | 885 | func pm () = match getString(pmpk()) { | |
886 | 886 | case s: String => | |
887 | 887 | fromBase58String(s) | |
888 | 888 | case _: Unit => | |
889 | 889 | unit | |
890 | 890 | case _ => | |
891 | 891 | throw("Match error") | |
892 | 892 | } | |
893 | 893 | ||
894 | 894 | ||
895 | 895 | let pd = throw("Permission denied") | |
896 | 896 | ||
897 | 897 | func isManager (i) = match m() { | |
898 | 898 | case pk: ByteVector => | |
899 | 899 | (i.callerPublicKey == pk) | |
900 | 900 | case _: Unit => | |
901 | 901 | (i.caller == this) | |
902 | 902 | case _ => | |
903 | 903 | throw("Match error") | |
904 | 904 | } | |
905 | 905 | ||
906 | 906 | ||
907 | 907 | func mm (i) = match m() { | |
908 | 908 | case pk: ByteVector => | |
909 | 909 | if ((i.callerPublicKey == pk)) | |
910 | 910 | then true | |
911 | 911 | else pd | |
912 | 912 | case _: Unit => | |
913 | 913 | if ((i.caller == this)) | |
914 | 914 | then true | |
915 | 915 | else pd | |
916 | 916 | case _ => | |
917 | 917 | throw("Match error") | |
918 | 918 | } | |
919 | 919 | ||
920 | 920 | ||
921 | 921 | @Callable(i) | |
922 | 922 | func constructor (fc) = { | |
923 | 923 | let c = mm(i) | |
924 | 924 | if ((c == c)) | |
925 | 925 | then [StringEntry(fc(), fc)] | |
926 | 926 | else throw("Strict value is not equal to itself.") | |
927 | 927 | } | |
928 | 928 | ||
929 | 929 | ||
930 | 930 | ||
931 | 931 | @Callable(i) | |
932 | 932 | func setManager (pendingManagerPublicKey) = { | |
933 | 933 | let c = mm(i) | |
934 | 934 | if ((c == c)) | |
935 | 935 | then { | |
936 | 936 | let cm = fromBase58String(pendingManagerPublicKey) | |
937 | 937 | if ((cm == cm)) | |
938 | 938 | then [StringEntry(pmpk(), pendingManagerPublicKey)] | |
939 | 939 | else throw("Strict value is not equal to itself.") | |
940 | 940 | } | |
941 | 941 | else throw("Strict value is not equal to itself.") | |
942 | 942 | } | |
943 | 943 | ||
944 | 944 | ||
945 | 945 | ||
946 | 946 | @Callable(i) | |
947 | 947 | func confirmManager () = { | |
948 | 948 | let p = pm() | |
949 | 949 | let hpm = if (isDefined(p)) | |
950 | 950 | then true | |
951 | 951 | else throw("No pending manager") | |
952 | 952 | if ((hpm == hpm)) | |
953 | 953 | then { | |
954 | 954 | let cpm = if ((i.callerPublicKey == value(p))) | |
955 | 955 | then true | |
956 | 956 | else throw("You are not pending manager") | |
957 | 957 | if ((cpm == cpm)) | |
958 | 958 | then [StringEntry(mpk(), toBase58String(value(p))), DeleteEntry(pmpk())] | |
959 | 959 | else throw("Strict value is not equal to itself.") | |
960 | 960 | } | |
961 | 961 | else throw("Strict value is not equal to itself.") | |
962 | 962 | } | |
963 | 963 | ||
964 | 964 | ||
965 | 965 | ||
966 | 966 | @Callable(i) | |
967 | 967 | func put (slip,autoStake) = { | |
968 | 968 | let factCfg = gfc() | |
969 | 969 | let stakingCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactStakCntr]), "Wr st addr") | |
970 | 970 | let slipCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactSlippCntr]), "Wr sl addr") | |
971 | 971 | if ((0 > slip)) | |
972 | 972 | then throw("Wrong slippage") | |
973 | 973 | else if ((size(i.payments) != 2)) | |
974 | 974 | then throw("2 pmnts expd") | |
975 | 975 | else { | |
976 | 976 | let amAssetPmt = toBigInt(value(i.payments[0]).amount) | |
977 | 977 | let prAssetPmt = toBigInt(value(i.payments[1]).amount) | |
978 | 978 | let amountAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) - amAssetPmt) | |
979 | 979 | if ((amountAssetBalance == amountAssetBalance)) | |
980 | 980 | then { | |
981 | 981 | let priceAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) - prAssetPmt) | |
982 | 982 | if ((priceAssetBalance == priceAssetBalance)) | |
983 | 983 | then { | |
984 | 984 | let lpAssetEmission = toBigInt(value(assetInfo(cfgLpAssetId)).quantity) | |
985 | 985 | if ((lpAssetEmission == lpAssetEmission)) | |
986 | 986 | then { | |
987 | 987 | let currentDLp = calcCurrentDLp(amAssetPmt, prAssetPmt, toBigInt(0)) | |
988 | 988 | if ((currentDLp == currentDLp)) | |
989 | 989 | then { | |
990 | 990 | 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, "") | |
991 | 991 | let emitLpAmt = e._2 | |
992 | 992 | let lpAssetId = e._7 | |
993 | 993 | let state = e._9 | |
994 | 994 | let amDiff = e._10 | |
995 | 995 | let prDiff = e._11 | |
996 | 996 | let amId = e._12 | |
997 | 997 | let prId = e._13 | |
998 | 998 | let r = invoke(fca, "emit", [emitLpAmt], nil) | |
999 | 999 | if ((r == r)) | |
1000 | 1000 | then { | |
1001 | 1001 | let el = match r { | |
1002 | 1002 | case legacy: Address => | |
1003 | 1003 | invoke(legacy, "emit", [emitLpAmt], nil) | |
1004 | 1004 | case _ => | |
1005 | 1005 | unit | |
1006 | 1006 | } | |
1007 | 1007 | if ((el == el)) | |
1008 | 1008 | then { | |
1009 | 1009 | let sa = if ((amDiff > 0)) | |
1010 | 1010 | then invoke(slipCntr, "put", nil, [AttachedPayment(amId, amDiff)]) | |
1011 | 1011 | else nil | |
1012 | 1012 | if ((sa == sa)) | |
1013 | 1013 | then { | |
1014 | 1014 | let sp = if ((prDiff > 0)) | |
1015 | 1015 | then invoke(slipCntr, "put", nil, [AttachedPayment(prId, prDiff)]) | |
1016 | 1016 | else nil | |
1017 | 1017 | if ((sp == sp)) | |
1018 | 1018 | then { | |
1019 | 1019 | let lpTrnsfr = if (autoStake) | |
1020 | 1020 | then { | |
1021 | 1021 | let ss = invoke(stakingCntr, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)]) | |
1022 | 1022 | if ((ss == ss)) | |
1023 | 1023 | then nil | |
1024 | 1024 | else throw("Strict value is not equal to itself.") | |
1025 | 1025 | } | |
1026 | 1026 | else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)] | |
1027 | 1027 | let $t03681536957 = refreshDLpInternal(0, 0, 0) | |
1028 | 1028 | let refreshDLpActions = $t03681536957._1 | |
1029 | 1029 | let updatedDLp = $t03681536957._2 | |
1030 | 1030 | let check = if ((updatedDLp >= currentDLp)) | |
1031 | 1031 | then true | |
1032 | 1032 | else throwErr(makeString(["updated DLp lower than current DLp", toString(amountAssetBalance), toString(priceAssetBalance), toString(lpAssetEmission), toString(currentDLp), toString(updatedDLp), toString(amDiff), toString(prDiff)], " ")) | |
1033 | 1033 | if ((check == check)) | |
1034 | 1034 | then { | |
1035 | 1035 | let lpAssetEmissionAfter = value(assetInfo(cfgLpAssetId)).quantity | |
1036 | 1036 | if ((lpAssetEmissionAfter == lpAssetEmissionAfter)) | |
1037 | 1037 | then ((state ++ lpTrnsfr) ++ refreshDLpActions) | |
1038 | 1038 | else throw("Strict value is not equal to itself.") | |
1039 | 1039 | } | |
1040 | 1040 | else throw("Strict value is not equal to itself.") | |
1041 | 1041 | } | |
1042 | 1042 | else throw("Strict value is not equal to itself.") | |
1043 | 1043 | } | |
1044 | 1044 | else throw("Strict value is not equal to itself.") | |
1045 | 1045 | } | |
1046 | 1046 | else throw("Strict value is not equal to itself.") | |
1047 | 1047 | } | |
1048 | 1048 | else throw("Strict value is not equal to itself.") | |
1049 | 1049 | } | |
1050 | 1050 | else throw("Strict value is not equal to itself.") | |
1051 | 1051 | } | |
1052 | 1052 | else throw("Strict value is not equal to itself.") | |
1053 | 1053 | } | |
1054 | 1054 | else throw("Strict value is not equal to itself.") | |
1055 | 1055 | } | |
1056 | 1056 | else throw("Strict value is not equal to itself.") | |
1057 | 1057 | } | |
1058 | 1058 | } | |
1059 | 1059 | ||
1060 | 1060 | ||
1061 | 1061 | ||
1062 | 1062 | @Callable(i) | |
1063 | 1063 | func putOneTknV2 (minOutAmount,autoStake) = { | |
1064 | 1064 | let isPoolOneTokenOperationsDisabled = { | |
1065 | 1065 | let @ = invoke(fca, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
1066 | 1066 | if ($isInstanceOf(@, "Boolean")) | |
1067 | 1067 | then @ | |
1068 | 1068 | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
1069 | 1069 | } | |
1070 | 1070 | let isPutDisabled = if (if (if (igs()) | |
1071 | 1071 | then true | |
1072 | 1072 | else (cfgPoolStatus == PoolPutDis)) | |
1073 | 1073 | then true | |
1074 | 1074 | else (cfgPoolStatus == PoolShutdown)) | |
1075 | 1075 | then true | |
1076 | 1076 | else isPoolOneTokenOperationsDisabled | |
1077 | 1077 | let checks = [if (if (!(isPutDisabled)) | |
1078 | 1078 | then true | |
1079 | 1079 | else isManager(i)) | |
1080 | 1080 | then true | |
1081 | 1081 | else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1)) | |
1082 | 1082 | then true | |
1083 | 1083 | else throwErr("exactly 1 payment are expected")] | |
1084 | 1084 | if ((checks == checks)) | |
1085 | 1085 | then { | |
1086 | 1086 | let amId = toBase58String(value(cfgAmountAssetId)) | |
1087 | 1087 | let prId = toBase58String(value(cfgPriceAssetId)) | |
1088 | 1088 | let lpId = cfgLpAssetId | |
1089 | 1089 | let amDecimals = cfgAmountAssetDecimals | |
1090 | 1090 | let prDecimals = cfgPriceAssetDecimals | |
1091 | 1091 | let userAddress = if ((i.caller == this)) | |
1092 | 1092 | then i.originCaller | |
1093 | 1093 | else i.caller | |
1094 | 1094 | let pmt = value(i.payments[0]) | |
1095 | 1095 | let pmtAssetId = toBase58String(value(pmt.assetId)) | |
1096 | 1096 | let pmtAmt = pmt.amount | |
1097 | 1097 | let currentDLp = if ((pmt.assetId == cfgAmountAssetId)) | |
1098 | 1098 | then calcCurrentDLp(toBigInt(pmtAmt), toBigInt(0), toBigInt(0)) | |
1099 | 1099 | else calcCurrentDLp(toBigInt(0), toBigInt(pmtAmt), toBigInt(0)) | |
1100 | 1100 | if ((currentDLp == currentDLp)) | |
1101 | 1101 | then { | |
1102 | 1102 | let $t03859838756 = calcPutOneTkn(pmtAmt, pmtAssetId, toString(userAddress), toBase58String(i.transactionId), true) | |
1103 | 1103 | if (($t03859838756 == $t03859838756)) | |
1104 | 1104 | then { | |
1105 | 1105 | let feeAmount = $t03859838756._3 | |
1106 | 1106 | let state = $t03859838756._2 | |
1107 | 1107 | let estimLP = $t03859838756._1 | |
1108 | 1108 | let emitLpAmt = if (if ((minOutAmount > 0)) | |
1109 | 1109 | then (minOutAmount > estimLP) | |
1110 | 1110 | else false) | |
1111 | 1111 | then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], "")) | |
1112 | 1112 | else estimLP | |
1113 | 1113 | let e = invoke(fca, "emit", [emitLpAmt], nil) | |
1114 | 1114 | if ((e == e)) | |
1115 | 1115 | then { | |
1116 | 1116 | let el = match e { | |
1117 | 1117 | case legacy: Address => | |
1118 | 1118 | invoke(legacy, "emit", [emitLpAmt], nil) | |
1119 | 1119 | case _ => | |
1120 | 1120 | unit | |
1121 | 1121 | } | |
1122 | 1122 | if ((el == el)) | |
1123 | 1123 | then { | |
1124 | 1124 | let lpTrnsfr = if (autoStake) | |
1125 | 1125 | then { | |
1126 | 1126 | let ss = invoke(stakingContract, "stake", nil, [AttachedPayment(lpId, emitLpAmt)]) | |
1127 | 1127 | if ((ss == ss)) | |
1128 | 1128 | then nil | |
1129 | 1129 | else throw("Strict value is not equal to itself.") | |
1130 | 1130 | } | |
1131 | 1131 | else [ScriptTransfer(i.caller, emitLpAmt, lpId)] | |
1132 | 1132 | let sendFeeToMatcher = if ((feeAmount > 0)) | |
1133 | 1133 | then [ScriptTransfer(feeCollectorAddress, feeAmount, fromBase58String(pmtAssetId))] | |
1134 | 1134 | else nil | |
1135 | 1135 | let $t03957139920 = if ((this == feeCollectorAddress)) | |
1136 | 1136 | then $Tuple2(0, 0) | |
1137 | 1137 | else { | |
1138 | 1138 | let paymentInAmountAsset = if ((pmt.assetId == cfgAmountAssetId)) | |
1139 | 1139 | then true | |
1140 | 1140 | else false | |
1141 | 1141 | if (paymentInAmountAsset) | |
1142 | 1142 | then $Tuple2(-(feeAmount), 0) | |
1143 | 1143 | else $Tuple2(0, -(feeAmount)) | |
1144 | 1144 | } | |
1145 | 1145 | let amountAssetBalanceDelta = $t03957139920._1 | |
1146 | 1146 | let priceAssetBalanceDelta = $t03957139920._2 | |
1147 | 1147 | let $t03992340031 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0) | |
1148 | 1148 | let refreshDLpActions = $t03992340031._1 | |
1149 | 1149 | let updatedDLp = $t03992340031._2 | |
1150 | 1150 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1151 | 1151 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1152 | 1152 | then $Tuple2((((state ++ lpTrnsfr) ++ sendFeeToMatcher) ++ refreshDLpActions), emitLpAmt) | |
1153 | 1153 | else throw("Strict value is not equal to itself.") | |
1154 | 1154 | } | |
1155 | 1155 | else throw("Strict value is not equal to itself.") | |
1156 | 1156 | } | |
1157 | 1157 | else throw("Strict value is not equal to itself.") | |
1158 | 1158 | } | |
1159 | 1159 | else throw("Strict value is not equal to itself.") | |
1160 | 1160 | } | |
1161 | 1161 | else throw("Strict value is not equal to itself.") | |
1162 | 1162 | } | |
1163 | 1163 | else throw("Strict value is not equal to itself.") | |
1164 | 1164 | } | |
1165 | 1165 | ||
1166 | 1166 | ||
1167 | 1167 | ||
1168 | 1168 | @Callable(i) | |
1169 | 1169 | func putForFree (maxSlpg) = if ((0 > maxSlpg)) | |
1170 | 1170 | then throw("Wrong slpg") | |
1171 | 1171 | else if ((size(i.payments) != 2)) | |
1172 | 1172 | then throw("2 pmnts expd") | |
1173 | 1173 | else { | |
1174 | 1174 | 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, "") | |
1175 | 1175 | let state = estPut._9 | |
1176 | 1176 | let amAssetPmt = toBigInt(value(i.payments[0]).amount) | |
1177 | 1177 | let prAssetPmt = toBigInt(value(i.payments[1]).amount) | |
1178 | 1178 | let currentDLp = calcCurrentDLp(amAssetPmt, prAssetPmt, toBigInt(0)) | |
1179 | 1179 | if ((currentDLp == currentDLp)) | |
1180 | 1180 | then { | |
1181 | 1181 | let $t04106141126 = refreshDLpInternal(0, 0, 0) | |
1182 | 1182 | let refreshDLpActions = $t04106141126._1 | |
1183 | 1183 | let updatedDLp = $t04106141126._2 | |
1184 | 1184 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1185 | 1185 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1186 | 1186 | then (state ++ refreshDLpActions) | |
1187 | 1187 | else throw("Strict value is not equal to itself.") | |
1188 | 1188 | } | |
1189 | 1189 | else throw("Strict value is not equal to itself.") | |
1190 | 1190 | } | |
1191 | 1191 | ||
1192 | 1192 | ||
1193 | 1193 | ||
1194 | 1194 | @Callable(i) | |
1195 | 1195 | func get () = { | |
1196 | 1196 | let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1197 | 1197 | if ((currentDLp == currentDLp)) | |
1198 | 1198 | then { | |
1199 | 1199 | let r = cg(i) | |
1200 | 1200 | let outAmtAmt = r._1 | |
1201 | 1201 | let outPrAmt = r._2 | |
1202 | 1202 | let pmtAmt = r._3 | |
1203 | 1203 | let pmtAssetId = r._4 | |
1204 | 1204 | let state = r._5 | |
1205 | 1205 | let b = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
1206 | 1206 | if ((b == b)) | |
1207 | 1207 | then { | |
1208 | 1208 | let $t04229942381 = refreshDLpInternal(-(outAmtAmt), -(outPrAmt), 0) | |
1209 | 1209 | let refreshDLpActions = $t04229942381._1 | |
1210 | 1210 | let updatedDLp = $t04229942381._2 | |
1211 | 1211 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1212 | 1212 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1213 | 1213 | then (state ++ refreshDLpActions) | |
1214 | 1214 | else throw("Strict value is not equal to itself.") | |
1215 | 1215 | } | |
1216 | 1216 | else throw("Strict value is not equal to itself.") | |
1217 | 1217 | } | |
1218 | 1218 | else throw("Strict value is not equal to itself.") | |
1219 | 1219 | } | |
1220 | 1220 | ||
1221 | 1221 | ||
1222 | 1222 | ||
1223 | 1223 | @Callable(i) | |
1224 | 1224 | func getOneTknV2 (outAssetId,minOutAmount) = { | |
1225 | 1225 | let isPoolOneTokenOperationsDisabled = { | |
1226 | 1226 | let @ = invoke(fca, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
1227 | 1227 | if ($isInstanceOf(@, "Boolean")) | |
1228 | 1228 | then @ | |
1229 | 1229 | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
1230 | 1230 | } | |
1231 | 1231 | let isGetDisabled = if (if (igs()) | |
1232 | 1232 | then true | |
1233 | 1233 | else (cfgPoolStatus == PoolShutdown)) | |
1234 | 1234 | then true | |
1235 | 1235 | else isPoolOneTokenOperationsDisabled | |
1236 | 1236 | let checks = [if (if (!(isGetDisabled)) | |
1237 | 1237 | then true | |
1238 | 1238 | else isManager(i)) | |
1239 | 1239 | then true | |
1240 | 1240 | else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1)) | |
1241 | 1241 | then true | |
1242 | 1242 | else throwErr("exactly 1 payment are expected")] | |
1243 | 1243 | if ((checks == checks)) | |
1244 | 1244 | then { | |
1245 | 1245 | let $t04299943154 = getOneTknV2Internal(outAssetId, minOutAmount, i.payments, i.caller, i.originCaller, i.transactionId) | |
1246 | 1246 | let state = $t04299943154._1 | |
1247 | 1247 | let totalAmount = $t04299943154._2 | |
1248 | 1248 | $Tuple2(state, totalAmount) | |
1249 | 1249 | } | |
1250 | 1250 | else throw("Strict value is not equal to itself.") | |
1251 | 1251 | } | |
1252 | 1252 | ||
1253 | 1253 | ||
1254 | 1254 | ||
1255 | 1255 | @Callable(i) | |
1256 | 1256 | func refreshDLp () = { | |
1257 | 1257 | let lastRefreshedBlockHeight = valueOrElse(getInteger(keyDLpRefreshedHeight), 0) | |
1258 | 1258 | let checkLastRefreshedBlockHeight = if (((height - lastRefreshedBlockHeight) >= dLpRefreshDelay)) | |
1259 | 1259 | then unit | |
1260 | 1260 | else throwErr(makeString([toString(dLpRefreshDelay), " blocks have not passed since the previous call"], "")) | |
1261 | 1261 | if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight)) | |
1262 | 1262 | then { | |
1263 | 1263 | let dLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyDLp), "0")), fmtErr("invalid dLp")) | |
1264 | 1264 | let $t04367843742 = refreshDLpInternal(0, 0, 0) | |
1265 | 1265 | let dLpUpdateActions = $t04367843742._1 | |
1266 | 1266 | let updatedDLp = $t04367843742._2 | |
1267 | 1267 | let actions = if ((dLp != updatedDLp)) | |
1268 | 1268 | then dLpUpdateActions | |
1269 | 1269 | else throwErr("nothing to refresh") | |
1270 | 1270 | $Tuple2(actions, toString(updatedDLp)) | |
1271 | 1271 | } | |
1272 | 1272 | else throw("Strict value is not equal to itself.") | |
1273 | 1273 | } | |
1274 | 1274 | ||
1275 | 1275 | ||
1276 | 1276 | ||
1277 | 1277 | @Callable(i) | |
1278 | 1278 | func getOneTknV2READONLY (outAssetId,lpAssetAmount) = { | |
1279 | 1279 | let amId = toBase58String(value(cfgAmountAssetId)) | |
1280 | 1280 | let prId = toBase58String(value(cfgPriceAssetId)) | |
1281 | 1281 | let lpId = toBase58String(value(cfgLpAssetId)) | |
1282 | 1282 | let xp = [toBigInt(getAccBalance(amId)), toBigInt(getAccBalance(prId))] | |
1283 | 1283 | let lpEmission = toBigInt(valueOrErrorMessage(assetInfo(fromBase58String(lpId)), "invalid lp asset").quantity) | |
1284 | 1284 | let D0 = getD(xp) | |
1285 | 1285 | let D1 = (D0 - fraction(toBigInt(lpAssetAmount), D0, lpEmission)) | |
1286 | 1286 | let index = if ((outAssetId == amId)) | |
1287 | 1287 | then 0 | |
1288 | 1288 | else if ((outAssetId == prId)) | |
1289 | 1289 | then 1 | |
1290 | 1290 | else throw("invalid out asset id") | |
1291 | 1291 | let newY = getYD(xp, index, D1) | |
1292 | 1292 | let dy = (xp[index] - newY) | |
1293 | 1293 | let totalGetRaw = max([0, toInt((dy - big1))]) | |
1294 | 1294 | let $t04467244727 = takeFee(totalGetRaw, outFee) | |
1295 | 1295 | let totalGet = $t04467244727._1 | |
1296 | 1296 | let feeAmount = $t04467244727._2 | |
1297 | 1297 | $Tuple2(nil, $Tuple2(totalGet, feeAmount)) | |
1298 | 1298 | } | |
1299 | 1299 | ||
1300 | 1300 | ||
1301 | 1301 | ||
1302 | 1302 | @Callable(i) | |
1303 | 1303 | func getOneTknV2WithBonusREADONLY (outAssetId,lpAssetAmount) = { | |
1304 | 1304 | let amId = toBase58String(value(cfgAmountAssetId)) | |
1305 | 1305 | let prId = toBase58String(value(cfgPriceAssetId)) | |
1306 | 1306 | let lpId = toBase58String(value(cfgLpAssetId)) | |
1307 | 1307 | let amBalance = getAccBalance(amId) | |
1308 | 1308 | let prBalance = getAccBalance(prId) | |
1309 | 1309 | let $t04510245217 = { | |
1310 | 1310 | let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, lpAssetAmount], nil) | |
1311 | 1311 | if ($isInstanceOf(@, "(Int, Int)")) | |
1312 | 1312 | then @ | |
1313 | 1313 | else throw(($getType(@) + " couldn't be cast to (Int, Int)")) | |
1314 | 1314 | } | |
1315 | 1315 | let totalGet = $t04510245217._1 | |
1316 | 1316 | let feeAmount = $t04510245217._2 | |
1317 | 1317 | let r = ego("", lpId, lpAssetAmount, this) | |
1318 | 1318 | let outAmAmt = r._1 | |
1319 | 1319 | let outPrAmt = r._2 | |
1320 | 1320 | let sumOfGetAssets = (outAmAmt + outPrAmt) | |
1321 | 1321 | let bonus = if ((sumOfGetAssets == 0)) | |
1322 | 1322 | then if ((totalGet == 0)) | |
1323 | 1323 | then 0 | |
1324 | 1324 | else throw("bonus calculation error") | |
1325 | 1325 | else fraction((totalGet - sumOfGetAssets), scale8, sumOfGetAssets) | |
1326 | 1326 | $Tuple2(nil, $Tuple3(totalGet, feeAmount, bonus)) | |
1327 | 1327 | } | |
1328 | 1328 | ||
1329 | 1329 | ||
1330 | 1330 | ||
1331 | 1331 | @Callable(i) | |
1332 | 1332 | func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = { | |
1333 | 1333 | let r = cg(i) | |
1334 | 1334 | let outAmAmt = r._1 | |
1335 | 1335 | let outPrAmt = r._2 | |
1336 | 1336 | let pmtAmt = r._3 | |
1337 | 1337 | let pmtAssetId = r._4 | |
1338 | 1338 | let state = r._5 | |
1339 | 1339 | if ((noLessThenAmtAsset > outAmAmt)) | |
1340 | 1340 | then throw(((("Failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset))) | |
1341 | 1341 | else if ((noLessThenPriceAsset > outPrAmt)) | |
1342 | 1342 | then throw(((("Failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset))) | |
1343 | 1343 | else { | |
1344 | 1344 | let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1345 | 1345 | if ((currentDLp == currentDLp)) | |
1346 | 1346 | then { | |
1347 | 1347 | let burnLPAssetOnFactory = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
1348 | 1348 | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
1349 | 1349 | then { | |
1350 | 1350 | let $t04638346464 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0) | |
1351 | 1351 | let refreshDLpActions = $t04638346464._1 | |
1352 | 1352 | let updatedDLp = $t04638346464._2 | |
1353 | 1353 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1354 | 1354 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1355 | 1355 | then (state ++ refreshDLpActions) | |
1356 | 1356 | else throw("Strict value is not equal to itself.") | |
1357 | 1357 | } | |
1358 | 1358 | else throw("Strict value is not equal to itself.") | |
1359 | 1359 | } | |
1360 | 1360 | else throw("Strict value is not equal to itself.") | |
1361 | 1361 | } | |
1362 | 1362 | } | |
1363 | 1363 | ||
1364 | 1364 | ||
1365 | 1365 | ||
1366 | 1366 | @Callable(i) | |
1367 | 1367 | func unstakeAndGet (amount) = { | |
1368 | 1368 | let checkPayments = if ((size(i.payments) != 0)) | |
1369 | 1369 | then throw("No pmnts expd") | |
1370 | 1370 | else true | |
1371 | 1371 | if ((checkPayments == checkPayments)) | |
1372 | 1372 | then { | |
1373 | 1373 | let factoryCfg = gfc() | |
1374 | 1374 | let lpAssetId = cfgLpAssetId | |
1375 | 1375 | let staking = valueOrErrorMessage(addressFromString(factoryCfg[idxFactStakCntr]), "Wr st addr") | |
1376 | 1376 | let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1377 | - | let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), amount], nil) | |
1378 | - | if ((unstakeInv == unstakeInv)) | |
1377 | + | if ((currentDLp == currentDLp)) | |
1379 | 1378 | then { | |
1380 | - | let r = ego(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller) | |
1381 | - | let outAmAmt = r._1 | |
1382 | - | let outPrAmt = r._2 | |
1383 | - | let sts = parseIntValue(r._9) | |
1384 | - | let state = r._10 | |
1385 | - | let v = if (if (igs()) | |
1386 | - | then true | |
1387 | - | else (sts == PoolShutdown)) | |
1388 | - | then throw(("Blocked: " + toString(sts))) | |
1389 | - | else true | |
1390 | - | if ((v == v)) | |
1379 | + | let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), amount], nil) | |
1380 | + | if ((unstakeInv == unstakeInv)) | |
1391 | 1381 | then { | |
1392 | - | let burnA = invoke(fca, "burn", [amount], [AttachedPayment(lpAssetId, amount)]) | |
1393 | - | if ((burnA == burnA)) | |
1382 | + | let r = ego(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller) | |
1383 | + | let outAmAmt = r._1 | |
1384 | + | let outPrAmt = r._2 | |
1385 | + | let sts = parseIntValue(r._9) | |
1386 | + | let state = r._10 | |
1387 | + | let v = if (if (igs()) | |
1388 | + | then true | |
1389 | + | else (sts == PoolShutdown)) | |
1390 | + | then throw(("Blocked: " + toString(sts))) | |
1391 | + | else true | |
1392 | + | if ((v == v)) | |
1394 | 1393 | then { | |
1395 | - | let $t04748847569 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0) | |
1396 | - | let refreshDLpActions = $t04748847569._1 | |
1397 | - | let updatedDLp = $t04748847569._2 | |
1398 | - | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1399 | - | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1400 | - | then (state ++ refreshDLpActions) | |
1394 | + | let burnA = invoke(fca, "burn", [amount], [AttachedPayment(lpAssetId, amount)]) | |
1395 | + | if ((burnA == burnA)) | |
1396 | + | then { | |
1397 | + | let $t04749147572 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0) | |
1398 | + | let refreshDLpActions = $t04749147572._1 | |
1399 | + | let updatedDLp = $t04749147572._2 | |
1400 | + | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1401 | + | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1402 | + | then (state ++ refreshDLpActions) | |
1403 | + | else throw("Strict value is not equal to itself.") | |
1404 | + | } | |
1401 | 1405 | else throw("Strict value is not equal to itself.") | |
1402 | 1406 | } | |
1403 | 1407 | else throw("Strict value is not equal to itself.") | |
1404 | 1408 | } | |
1405 | 1409 | else throw("Strict value is not equal to itself.") | |
1406 | 1410 | } | |
1407 | 1411 | else throw("Strict value is not equal to itself.") | |
1408 | 1412 | } | |
1409 | 1413 | else throw("Strict value is not equal to itself.") | |
1410 | 1414 | } | |
1411 | 1415 | ||
1412 | 1416 | ||
1413 | 1417 | ||
1414 | 1418 | @Callable(i) | |
1415 | 1419 | func unstakeAndGetNoLess (unstakeAmount,noLessThenAmountAsset,noLessThenPriceAsset) = { | |
1416 | 1420 | let isGetDisabled = if (igs()) | |
1417 | 1421 | then true | |
1418 | 1422 | else (cfgPoolStatus == PoolShutdown) | |
1419 | 1423 | let checks = [if (!(isGetDisabled)) | |
1420 | 1424 | then true | |
1421 | 1425 | else throw("get operation is blocked by admin"), if ((size(i.payments) == 0)) | |
1422 | 1426 | then true | |
1423 | 1427 | else throw("no payments are expected")] | |
1424 | 1428 | if ((checks == checks)) | |
1425 | 1429 | then { | |
1426 | 1430 | let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1427 | - | let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil) | |
1428 | - | if ((unstakeInv == unstakeInv)) | |
1431 | + | if ((currentDLp == currentDLp)) | |
1429 | 1432 | then { | |
1430 | - | let res = ego(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller) | |
1431 | - | let outAmAmt = res._1 | |
1432 | - | let outPrAmt = res._2 | |
1433 | - | let state = res._10 | |
1434 | - | let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset)) | |
1435 | - | then true | |
1436 | - | else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset)) | |
1437 | - | then true | |
1438 | - | else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))] | |
1439 | - | if ((checkAmounts == checkAmounts)) | |
1433 | + | let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil) | |
1434 | + | if ((unstakeInv == unstakeInv)) | |
1440 | 1435 | then { | |
1441 | - | let burnLPAssetOnFactory = invoke(fca, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)]) | |
1442 | - | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
1436 | + | let res = ego(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller) | |
1437 | + | let outAmAmt = res._1 | |
1438 | + | let outPrAmt = res._2 | |
1439 | + | let state = res._10 | |
1440 | + | let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset)) | |
1441 | + | then true | |
1442 | + | else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset)) | |
1443 | + | then true | |
1444 | + | else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))] | |
1445 | + | if ((checkAmounts == checkAmounts)) | |
1443 | 1446 | then { | |
1444 | - | let $t04881748898 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0) | |
1445 | - | let refreshDLpActions = $t04881748898._1 | |
1446 | - | let updatedDLp = $t04881748898._2 | |
1447 | - | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1448 | - | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1449 | - | then (state ++ refreshDLpActions) | |
1447 | + | let burnLPAssetOnFactory = invoke(fca, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)]) | |
1448 | + | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
1449 | + | then { | |
1450 | + | let $t04882348904 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0) | |
1451 | + | let refreshDLpActions = $t04882348904._1 | |
1452 | + | let updatedDLp = $t04882348904._2 | |
1453 | + | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1454 | + | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1455 | + | then (state ++ refreshDLpActions) | |
1456 | + | else throw("Strict value is not equal to itself.") | |
1457 | + | } | |
1450 | 1458 | else throw("Strict value is not equal to itself.") | |
1451 | 1459 | } | |
1452 | 1460 | else throw("Strict value is not equal to itself.") | |
1453 | 1461 | } | |
1454 | 1462 | else throw("Strict value is not equal to itself.") | |
1455 | 1463 | } | |
1456 | 1464 | else throw("Strict value is not equal to itself.") | |
1457 | 1465 | } | |
1458 | 1466 | else throw("Strict value is not equal to itself.") | |
1459 | 1467 | } | |
1460 | 1468 | ||
1461 | 1469 | ||
1462 | 1470 | ||
1463 | 1471 | @Callable(i) | |
1464 | 1472 | func unstakeAndGetOneTknV2 (unstakeAmount,outAssetId,minOutAmount) = { | |
1465 | 1473 | let isPoolOneTokenOperationsDisabled = { | |
1466 | 1474 | let @ = invoke(fca, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
1467 | 1475 | if ($isInstanceOf(@, "Boolean")) | |
1468 | 1476 | then @ | |
1469 | 1477 | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
1470 | 1478 | } | |
1471 | 1479 | let isGetDisabled = if (if (igs()) | |
1472 | 1480 | then true | |
1473 | 1481 | else (cfgPoolStatus == PoolShutdown)) | |
1474 | 1482 | then true | |
1475 | 1483 | else isPoolOneTokenOperationsDisabled | |
1476 | 1484 | let checks = [if (if (!(isGetDisabled)) | |
1477 | 1485 | then true | |
1478 | 1486 | else isManager(i)) | |
1479 | 1487 | then true | |
1480 | 1488 | else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 0)) | |
1481 | 1489 | then true | |
1482 | 1490 | else throwErr("no payments are expected")] | |
1483 | 1491 | if ((checks == checks)) | |
1484 | 1492 | then { | |
1485 | 1493 | let factoryCfg = gfc() | |
1486 | 1494 | let lpAssetId = cfgLpAssetId | |
1487 | 1495 | let staking = valueOrErrorMessage(addressFromString(factoryCfg[idxFactStakCntr]), "Wr st addr") | |
1488 | 1496 | let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), unstakeAmount], nil) | |
1489 | 1497 | if ((unstakeInv == unstakeInv)) | |
1490 | 1498 | then { | |
1491 | - | let $ | |
1492 | - | let state = $ | |
1493 | - | let totalAmount = $ | |
1499 | + | let $t04979949987 = getOneTknV2Internal(outAssetId, minOutAmount, [AttachedPayment(lpAssetId, unstakeAmount)], i.caller, i.originCaller, i.transactionId) | |
1500 | + | let state = $t04979949987._1 | |
1501 | + | let totalAmount = $t04979949987._2 | |
1494 | 1502 | $Tuple2(state, totalAmount) | |
1495 | 1503 | } | |
1496 | 1504 | else throw("Strict value is not equal to itself.") | |
1497 | 1505 | } | |
1498 | 1506 | else throw("Strict value is not equal to itself.") | |
1499 | 1507 | } | |
1500 | 1508 | ||
1501 | 1509 | ||
1502 | 1510 | ||
1503 | 1511 | @Callable(i) | |
1504 | 1512 | func putOneTknV2WithBonusREADONLY (paymentAmountRaw,paymentAssetId) = { | |
1505 | - | let $ | |
1506 | - | let lpAmount = $ | |
1507 | - | let state = $ | |
1508 | - | let feeAmount = $ | |
1509 | - | let bonus = $ | |
1513 | + | let $t05011550218 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", true) | |
1514 | + | let lpAmount = $t05011550218._1 | |
1515 | + | let state = $t05011550218._2 | |
1516 | + | let feeAmount = $t05011550218._3 | |
1517 | + | let bonus = $t05011550218._4 | |
1510 | 1518 | $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus)) | |
1511 | 1519 | } | |
1512 | 1520 | ||
1513 | 1521 | ||
1514 | 1522 | ||
1515 | 1523 | @Callable(i) | |
1516 | 1524 | func putOneTknV2WithoutTakeFeeREADONLY (paymentAmountRaw,paymentAssetId) = { | |
1517 | - | let $ | |
1518 | - | let lpAmount = $ | |
1519 | - | let state = $ | |
1520 | - | let feeAmount = $ | |
1521 | - | let bonus = $ | |
1525 | + | let $t05036650470 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", false) | |
1526 | + | let lpAmount = $t05036650470._1 | |
1527 | + | let state = $t05036650470._2 | |
1528 | + | let feeAmount = $t05036650470._3 | |
1529 | + | let bonus = $t05036650470._4 | |
1522 | 1530 | $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus)) | |
1523 | 1531 | } | |
1524 | 1532 | ||
1525 | 1533 | ||
1526 | 1534 | ||
1527 | 1535 | @Callable(i) | |
1528 | 1536 | func activate (amtAsStr,prAsStr) = if ((toString(i.caller) != toString(fca))) | |
1529 | 1537 | then throw("denied") | |
1530 | 1538 | else $Tuple2([StringEntry(aa(), amtAsStr), StringEntry(pa(), prAsStr)], "success") | |
1531 | 1539 | ||
1532 | 1540 | ||
1533 | 1541 | ||
1534 | 1542 | @Callable(i) | |
1535 | 1543 | func setS (k,v) = if ((toString(i.caller) != strf(this, ada()))) | |
1536 | 1544 | then pd | |
1537 | 1545 | else [StringEntry(k, v)] | |
1538 | 1546 | ||
1539 | 1547 | ||
1540 | 1548 | ||
1541 | 1549 | @Callable(i) | |
1542 | 1550 | func setI (k,v) = if ((toString(i.caller) != strf(this, ada()))) | |
1543 | 1551 | then pd | |
1544 | 1552 | else [IntegerEntry(k, v)] | |
1545 | 1553 | ||
1546 | 1554 | ||
1547 | 1555 | ||
1548 | 1556 | @Callable(i) | |
1549 | 1557 | func getPoolConfigWrapperREADONLY () = $Tuple2(nil, gpc()) | |
1550 | 1558 | ||
1551 | 1559 | ||
1552 | 1560 | ||
1553 | 1561 | @Callable(i) | |
1554 | 1562 | func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId)) | |
1555 | 1563 | ||
1556 | 1564 | ||
1557 | 1565 | ||
1558 | 1566 | @Callable(i) | |
1559 | 1567 | func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = { | |
1560 | 1568 | let pr = calcPrices(amAmt, prAmt, lpAmt) | |
1561 | 1569 | $Tuple2(nil, [toString(pr[0]), toString(pr[1]), toString(pr[2])]) | |
1562 | 1570 | } | |
1563 | 1571 | ||
1564 | 1572 | ||
1565 | 1573 | ||
1566 | 1574 | @Callable(i) | |
1567 | 1575 | func fromX18WrapperREADONLY (val,resScaleMult) = $Tuple2(nil, f1(parseBigIntValue(val), resScaleMult)) | |
1568 | 1576 | ||
1569 | 1577 | ||
1570 | 1578 | ||
1571 | 1579 | @Callable(i) | |
1572 | 1580 | func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(t1(origVal, origScaleMult))) | |
1573 | 1581 | ||
1574 | 1582 | ||
1575 | 1583 | ||
1576 | 1584 | @Callable(i) | |
1577 | 1585 | func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(cpbi(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18)))) | |
1578 | 1586 | ||
1579 | 1587 | ||
1580 | 1588 | ||
1581 | 1589 | @Callable(i) | |
1582 | 1590 | 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, "")) | |
1583 | 1591 | ||
1584 | 1592 | ||
1585 | 1593 | ||
1586 | 1594 | @Callable(i) | |
1587 | 1595 | func estimateGetOperationWrapperREADONLY (txId58,pmtAsId,pmtLpAmt,usrAddr) = { | |
1588 | 1596 | let r = ego(txId58, pmtAsId, pmtLpAmt, addressFromStringValue(usrAddr)) | |
1589 | 1597 | $Tuple2(nil, $Tuple10(r._1, r._2, r._3, r._4, r._5, r._6, r._7, toString(r._8), r._9, r._10)) | |
1590 | 1598 | } | |
1591 | 1599 | ||
1592 | 1600 | ||
1593 | 1601 | @Verifier(tx) | |
1594 | 1602 | func verify () = { | |
1595 | 1603 | let targetPublicKey = match m() { | |
1596 | 1604 | case pk: ByteVector => | |
1597 | 1605 | pk | |
1598 | 1606 | case _: Unit => | |
1599 | 1607 | tx.senderPublicKey | |
1600 | 1608 | case _ => | |
1601 | 1609 | throw("Match error") | |
1602 | 1610 | } | |
1603 | 1611 | match tx { | |
1604 | 1612 | case order: Order => | |
1605 | 1613 | let matcherPub = mp() | |
1606 | 1614 | let orderValid = validateMatcherOrderAllowed(order) | |
1607 | 1615 | let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey) | |
1608 | 1616 | let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub) | |
1609 | 1617 | if (if (if (orderValid) | |
1610 | 1618 | then senderValid | |
1611 | 1619 | else false) | |
1612 | 1620 | then matcherValid | |
1613 | 1621 | else false) | |
1614 | 1622 | then true | |
1615 | 1623 | else toe(orderValid, senderValid, matcherValid) | |
1616 | 1624 | case s: SetScriptTransaction => | |
1617 | 1625 | if (sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)) | |
1618 | 1626 | then true | |
1619 | 1627 | else { | |
1620 | 1628 | let newHash = blake2b256(value(s.script)) | |
1621 | 1629 | let allowedHash = fromBase64String(value(getString(fca, keyAllowedLpStableScriptHash()))) | |
1622 | 1630 | let currentHash = scriptHash(this) | |
1623 | 1631 | if ((allowedHash == newHash)) | |
1624 | 1632 | then (currentHash != newHash) | |
1625 | 1633 | else false | |
1626 | 1634 | } | |
1627 | 1635 | case _ => | |
1628 | 1636 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
1629 | 1637 | } | |
1630 | 1638 | } | |
1631 | 1639 |
github/deemru/w8io/026f985 139.93 ms ◑