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