tx · BVe39w1uGUZEE9S9Mz2ti8jjy3HogVGWF2kEs3c58YGa 3NCUrmBwKvfQDkfTg1gL8BPKZid8fC4YDx3: -0.03500000 Waves 2022.12.07 12:23 [2349742] smart account 3NCUrmBwKvfQDkfTg1gL8BPKZid8fC4YDx3 > SELF 0.00000000 Waves
{ "type": 13, "id": "BVe39w1uGUZEE9S9Mz2ti8jjy3HogVGWF2kEs3c58YGa", "fee": 3500000, "feeAssetId": null, "timestamp": 1670404984314, "version": 1, "sender": "3NCUrmBwKvfQDkfTg1gL8BPKZid8fC4YDx3", "senderPublicKey": "DnbhDz6GvchfLCy83fxyPKD7SoAmXD6DrJ5ubi3LXtgM", "proofs": [ "4wiwNpk6xJGKKy2PQJY2gev88mEPtfeSrFgDmkrq1As3eyaFQVEipppLcSU9WntpGMkUPej1Rxg7d2M1DtvbLXDZ" ], "script": "base64:BgLfLAgCEgMKAQgSABIECgIBBBIDCgEBEgQKAgEEEgQKAggBEgQKAggBEgQKAggBEgUKAwEIARIAEgQKAgEBEgMKAQESBQoDAQEBEgQKAggIEgASABIDCgEIEgUKAwEBARIECgIBARIECgIIARIECgIICBILCgkIAQECAQIIBAQSBgoECAgBCBIAEgMKAQESAwoBARIECgIIASIKbFBkZWNpbWFscyIGc2NhbGU4IgxzY2FsZThCaWdJbnQiB3NjYWxlMTgiCnplcm9CaWdJbnQiBGJpZzAiBGJpZzEiBGJpZzIiC3dhdmVzU3RyaW5nIgNTRVAiClBvb2xBY3RpdmUiD1Bvb2xQdXREaXNhYmxlZCITUG9vbE1hdGNoZXJEaXNhYmxlZCIMUG9vbFNodXRkb3duIg5pZHhQb29sQWRkcmVzcyINaWR4UG9vbFN0YXR1cyIQaWR4UG9vbExQQXNzZXRJZCINaWR4QW10QXNzZXRJZCIPaWR4UHJpY2VBc3NldElkIg5pZHhBbXRBc3NldERjbSIQaWR4UHJpY2VBc3NldERjbSIOaWR4SUFtdEFzc2V0SWQiEGlkeElQcmljZUFzc2V0SWQiDWlkeEx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AJkSwkBAmVNAAMJAAECBQJkSwIKQnl0ZVZlY3RvcgQCZVEFAmRLBQJlUQMJAAECBQJkSwIEVW5pdAgFAmd5D3NlbmRlclB1YmxpY0tleQkAAgECC01hdGNoIGVycm9yBAJkSwUCZ3kDCQABAgUCZEsCBU9yZGVyBAJkcAUCZEsEAmdCCQECYU0ABAJhegkBAmRvAQUCZHAEAmFBCQD0AwMIBQJkcAlib2R5Qnl0ZXMJAJEDAggFAmRwBnByb29mcwAACAUCZHAPc2VuZGVyUHVibGljS2V5BAJhQgkA9AMDCAUCZHAJYm9keUJ5dGVzCQCRAwIIBQJkcAZwcm9vZnMAAQUCZ0IDAwMFAmF6BQJhQQcFAmFCBwYJAQJheQMFAmF6BQJhQQUCYUIDCQABAgUCZEsCFFNldFNjcmlwdFRyYW5zYWN0aW9uBAJlTgUCZEsEAmdDCQD2AwEJAQV2YWx1ZQEIBQJlTgZzY3JpcHQEAmdECQDbBAEJAQV2YWx1ZQEJAJ0IAgUCYUoJAQJhdwAEAmdFCQDxBwEFBHRoaXMDAwkAAAIFAmdEBQJnQwkBAiE9AgUCZ0UFAmdDBwYJAPQDAwgFAmd5CWJvZHlCeXRlcwkAkQMCCAUCZ3kGcHJvb2ZzAAAFAmdBCQD0AwMIBQJneQlib2R5Qnl0ZXMJAJEDAggFAmd5BnByb29mcwAABQJnQTbwpA0=", "chainId": 84, "height": 2349742, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 79SjRdLSDkz4h9Pt62RjxGwUkz56awqmAp7LHqFEjjpC Next: pvRF2WemsEdFrYJmQC3sd18udcXUcmsXXBA72PhrA2C Diff:
Old | New | Differences | |
---|---|---|---|
703 | 703 | let prId = estPut._13 | |
704 | 704 | let amAssetPmt = toBigInt(value(i.payments[0]).amount) | |
705 | 705 | let prAssetPmt = toBigInt(value(i.payments[1]).amount) | |
706 | - | let | |
707 | - | if (( | |
706 | + | let amountAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) - amAssetPmt) | |
707 | + | if ((amountAssetBalance == amountAssetBalance)) | |
708 | 708 | then { | |
709 | - | let | |
710 | - | if (( | |
709 | + | let priceAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) - prAssetPmt) | |
710 | + | if ((priceAssetBalance == priceAssetBalance)) | |
711 | 711 | then { | |
712 | - | let emitInvLegacy = match emitInv { | |
713 | - | case legacyFactoryContract: Address => | |
714 | - | invoke(legacyFactoryContract, "emit", [emitLpAmt], nil) | |
715 | - | case _ => | |
716 | - | unit | |
717 | - | } | |
718 | - | if ((emitInvLegacy == emitInvLegacy)) | |
712 | + | let lpAssetEmission = toBigInt(value(assetInfo(cfgLpAssetId)).quantity) | |
713 | + | if ((lpAssetEmission == lpAssetEmission)) | |
719 | 714 | then { | |
720 | - | let slippageAInv = if ((amDiff > 0)) | |
721 | - | then invoke(slippageContract, "put", nil, [AttachedPayment(amId, amDiff)]) | |
722 | - | else nil | |
723 | - | if ((slippageAInv == slippageAInv)) | |
715 | + | let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0)) | |
716 | + | if ((currentKLp == currentKLp)) | |
724 | 717 | then { | |
725 | - | let slippagePInv = if ((prDiff > 0)) | |
726 | - | then invoke(slippageContract, "put", nil, [AttachedPayment(prId, prDiff)]) | |
727 | - | else nil | |
728 | - | if ((slippagePInv == slippagePInv)) | |
718 | + | let emitInv = invoke(factoryContract, "emit", [emitLpAmt], nil) | |
719 | + | if ((emitInv == emitInv)) | |
729 | 720 | then { | |
730 | - | let lpTransfer = if (shouldAutoStake) | |
721 | + | let emitInvLegacy = match emitInv { | |
722 | + | case legacyFactoryContract: Address => | |
723 | + | invoke(legacyFactoryContract, "emit", [emitLpAmt], nil) | |
724 | + | case _ => | |
725 | + | unit | |
726 | + | } | |
727 | + | if ((emitInvLegacy == emitInvLegacy)) | |
731 | 728 | then { | |
732 | - | let slpStakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)]) | |
733 | - | if ((slpStakeInv == slpStakeInv)) | |
734 | - | then nil | |
735 | - | else throw("Strict value is not equal to itself.") | |
736 | - | } | |
737 | - | else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)] | |
738 | - | let $t03211432179 = refreshKLpInternal(0, 0, 0) | |
739 | - | let refreshKLpActions = $t03211432179._1 | |
740 | - | let updatedKLp = $t03211432179._2 | |
741 | - | let amountAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) - amAssetPmt) | |
742 | - | let priceAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) - prAssetPmt) | |
743 | - | let lpAssetEmission = toBigInt(value(assetInfo(cfgLpAssetId)).quantity) | |
744 | - | let error = throwErr(makeString([toString(amountAssetBalance), toString(priceAssetBalance), toString(lpAssetEmission), toString(currentKLp), toString(updatedKLp)], " ")) | |
745 | - | if ((error == error)) | |
746 | - | then { | |
747 | - | let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp) | |
748 | - | if ((isUpdatedKLpValid == isUpdatedKLpValid)) | |
749 | - | then ((state ++ lpTransfer) ++ refreshKLpActions) | |
729 | + | let slippageAInv = if ((amDiff > 0)) | |
730 | + | then invoke(slippageContract, "put", nil, [AttachedPayment(amId, amDiff)]) | |
731 | + | else nil | |
732 | + | if ((slippageAInv == slippageAInv)) | |
733 | + | then { | |
734 | + | let slippagePInv = if ((prDiff > 0)) | |
735 | + | then invoke(slippageContract, "put", nil, [AttachedPayment(prId, prDiff)]) | |
736 | + | else nil | |
737 | + | if ((slippagePInv == slippagePInv)) | |
738 | + | then { | |
739 | + | let lpTransfer = if (shouldAutoStake) | |
740 | + | then { | |
741 | + | let slpStakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)]) | |
742 | + | if ((slpStakeInv == slpStakeInv)) | |
743 | + | then nil | |
744 | + | else throw("Strict value is not equal to itself.") | |
745 | + | } | |
746 | + | else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)] | |
747 | + | let $t03240732472 = refreshKLpInternal(0, 0, 0) | |
748 | + | let refreshKLpActions = $t03240732472._1 | |
749 | + | let updatedKLp = $t03240732472._2 | |
750 | + | let error = throwErr(makeString([toString(amountAssetBalance), toString(priceAssetBalance), toString(lpAssetEmission), toString(currentKLp), toString(updatedKLp)], " ")) | |
751 | + | if ((error == error)) | |
752 | + | then { | |
753 | + | let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp) | |
754 | + | if ((isUpdatedKLpValid == isUpdatedKLpValid)) | |
755 | + | then ((state ++ lpTransfer) ++ refreshKLpActions) | |
756 | + | else throw("Strict value is not equal to itself.") | |
757 | + | } | |
758 | + | else throw("Strict value is not equal to itself.") | |
759 | + | } | |
760 | + | else throw("Strict value is not equal to itself.") | |
761 | + | } | |
750 | 762 | else throw("Strict value is not equal to itself.") | |
751 | 763 | } | |
752 | 764 | else throw("Strict value is not equal to itself.") | |
775 | 787 | let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0)) | |
776 | 788 | if ((currentKLp == currentKLp)) | |
777 | 789 | then { | |
778 | - | let $ | |
779 | - | let refreshKLpActions = $ | |
780 | - | let updatedKLp = $ | |
790 | + | let $t03325333318 = refreshKLpInternal(0, 0, 0) | |
791 | + | let refreshKLpActions = $t03325333318._1 | |
792 | + | let updatedKLp = $t03325333318._2 | |
781 | 793 | let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp) | |
782 | 794 | if ((isUpdatedKLpValid == isUpdatedKLpValid)) | |
783 | 795 | then (state ++ refreshKLpActions) | |
822 | 834 | else throwErr("payment asset is not supported") | |
823 | 835 | let userAddress = i.caller | |
824 | 836 | let txId = i.transactionId | |
825 | - | let $ | |
826 | - | if (($ | |
837 | + | let $t03450334655 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId) | |
838 | + | if (($t03450334655 == $t03450334655)) | |
827 | 839 | then { | |
828 | - | let paymentInAmountAsset = $ | |
829 | - | let bonus = $ | |
830 | - | let feeAmount = $ | |
831 | - | let commonState = $ | |
832 | - | let emitAmountEstimated = $ | |
840 | + | let paymentInAmountAsset = $t03450334655._5 | |
841 | + | let bonus = $t03450334655._4 | |
842 | + | let feeAmount = $t03450334655._3 | |
843 | + | let commonState = $t03450334655._2 | |
844 | + | let emitAmountEstimated = $t03450334655._1 | |
833 | 845 | let emitAmount = if (if ((minOutAmount > 0)) | |
834 | 846 | then (minOutAmount > emitAmountEstimated) | |
835 | 847 | else false) | |
849 | 861 | let sendFee = if ((feeAmount > 0)) | |
850 | 862 | then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)] | |
851 | 863 | else nil | |
852 | - | let $ | |
864 | + | let $t03524135438 = if ((this == feeCollectorAddress)) | |
853 | 865 | then $Tuple2(0, 0) | |
854 | 866 | else if (paymentInAmountAsset) | |
855 | 867 | then $Tuple2(-(feeAmount), 0) | |
856 | 868 | else $Tuple2(0, -(feeAmount)) | |
857 | - | let amountAssetBalanceDelta = $ | |
858 | - | let priceAssetBalanceDelta = $ | |
859 | - | let $ | |
860 | - | let refreshKLpActions = $ | |
861 | - | let updatedKLp = $ | |
869 | + | let amountAssetBalanceDelta = $t03524135438._1 | |
870 | + | let priceAssetBalanceDelta = $t03524135438._2 | |
871 | + | let $t03544135549 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0) | |
872 | + | let refreshKLpActions = $t03544135549._1 | |
873 | + | let updatedKLp = $t03544135549._2 | |
862 | 874 | let kLp = value(getString(keyKLp)) | |
863 | 875 | let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp) | |
864 | 876 | if ((isUpdatedKLpValid == isUpdatedKLpValid)) | |
876 | 888 | ||
877 | 889 | @Callable(i) | |
878 | 890 | func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = { | |
879 | - | let $ | |
880 | - | let emitAmountEstimated = $ | |
881 | - | let commonState = $ | |
882 | - | let feeAmount = $ | |
883 | - | let bonus = $ | |
884 | - | let paymentInAmountAsset = $ | |
891 | + | let $t03585536012 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit) | |
892 | + | let emitAmountEstimated = $t03585536012._1 | |
893 | + | let commonState = $t03585536012._2 | |
894 | + | let feeAmount = $t03585536012._3 | |
895 | + | let bonus = $t03585536012._4 | |
896 | + | let paymentInAmountAsset = $t03585536012._5 | |
885 | 897 | $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus)) | |
886 | 898 | } | |
887 | 899 | ||
916 | 928 | let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(paymentAmount)) | |
917 | 929 | let userAddress = i.caller | |
918 | 930 | let txId = i.transactionId | |
919 | - | let $ | |
920 | - | if (($ | |
931 | + | let $t03690637059 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId) | |
932 | + | if (($t03690637059 == $t03690637059)) | |
921 | 933 | then { | |
922 | - | let outInAmountAsset = $ | |
923 | - | let bonus = $ | |
924 | - | let feeAmount = $ | |
925 | - | let commonState = $ | |
926 | - | let amountEstimated = $ | |
934 | + | let outInAmountAsset = $t03690637059._5 | |
935 | + | let bonus = $t03690637059._4 | |
936 | + | let feeAmount = $t03690637059._3 | |
937 | + | let commonState = $t03690637059._2 | |
938 | + | let amountEstimated = $t03690637059._1 | |
927 | 939 | let amount = if (if ((minOutAmount > 0)) | |
928 | 940 | then (minOutAmount > amountEstimated) | |
929 | 941 | else false) | |
936 | 948 | let sendFee = if ((feeAmount > 0)) | |
937 | 949 | then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)] | |
938 | 950 | else nil | |
939 | - | let $ | |
951 | + | let $t03755937806 = { | |
940 | 952 | let feeAmountForCalc = if ((this == feeCollectorAddress)) | |
941 | 953 | then 0 | |
942 | 954 | else feeAmount | |
944 | 956 | then $Tuple2(-((amount + feeAmountForCalc)), 0) | |
945 | 957 | else $Tuple2(0, -((amount + feeAmountForCalc))) | |
946 | 958 | } | |
947 | - | let amountAssetBalanceDelta = $ | |
948 | - | let priceAssetBalanceDelta = $ | |
949 | - | let $ | |
950 | - | let refreshKLpActions = $ | |
951 | - | let updatedKLp = $ | |
959 | + | let amountAssetBalanceDelta = $t03755937806._1 | |
960 | + | let priceAssetBalanceDelta = $t03755937806._2 | |
961 | + | let $t03780937917 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0) | |
962 | + | let refreshKLpActions = $t03780937917._1 | |
963 | + | let updatedKLp = $t03780937917._2 | |
952 | 964 | let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp) | |
953 | 965 | if ((isUpdatedKLpValid == isUpdatedKLpValid)) | |
954 | 966 | then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount) | |
965 | 977 | ||
966 | 978 | @Callable(i) | |
967 | 979 | func getOneTknREADONLY (outAssetId,paymentAmount) = { | |
968 | - | let $ | |
969 | - | let amountEstimated = $ | |
970 | - | let commonState = $ | |
971 | - | let feeAmount = $ | |
972 | - | let bonus = $ | |
973 | - | let outInAmountAsset = $ | |
980 | + | let $t03817438330 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit) | |
981 | + | let amountEstimated = $t03817438330._1 | |
982 | + | let commonState = $t03817438330._2 | |
983 | + | let feeAmount = $t03817438330._3 | |
984 | + | let bonus = $t03817438330._4 | |
985 | + | let outInAmountAsset = $t03817438330._5 | |
974 | 986 | $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus)) | |
975 | 987 | } | |
976 | 988 | ||
1005 | 1017 | let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil) | |
1006 | 1018 | if ((unstakeInv == unstakeInv)) | |
1007 | 1019 | then { | |
1008 | - | let $ | |
1009 | - | if (($ | |
1020 | + | let $t03923239383 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId) | |
1021 | + | if (($t03923239383 == $t03923239383)) | |
1010 | 1022 | then { | |
1011 | - | let outInAmountAsset = $ | |
1012 | - | let bonus = $ | |
1013 | - | let feeAmount = $ | |
1014 | - | let commonState = $ | |
1015 | - | let amountEstimated = $ | |
1023 | + | let outInAmountAsset = $t03923239383._5 | |
1024 | + | let bonus = $t03923239383._4 | |
1025 | + | let feeAmount = $t03923239383._3 | |
1026 | + | let commonState = $t03923239383._2 | |
1027 | + | let amountEstimated = $t03923239383._1 | |
1016 | 1028 | let amount = if (if ((minOutAmount > 0)) | |
1017 | 1029 | then (minOutAmount > amountEstimated) | |
1018 | 1030 | else false) | |
1025 | 1037 | let sendFee = if ((feeAmount > 0)) | |
1026 | 1038 | then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)] | |
1027 | 1039 | else nil | |
1028 | - | let $ | |
1040 | + | let $t03987840125 = { | |
1029 | 1041 | let feeAmountForCalc = if ((this == feeCollectorAddress)) | |
1030 | 1042 | then 0 | |
1031 | 1043 | else feeAmount | |
1033 | 1045 | then $Tuple2(-((amount + feeAmountForCalc)), 0) | |
1034 | 1046 | else $Tuple2(0, -((amount + feeAmountForCalc))) | |
1035 | 1047 | } | |
1036 | - | let amountAssetBalanceDelta = $ | |
1037 | - | let priceAssetBalanceDelta = $ | |
1038 | - | let $ | |
1039 | - | let refreshKLpActions = $ | |
1040 | - | let updatedKLp = $ | |
1048 | + | let amountAssetBalanceDelta = $t03987840125._1 | |
1049 | + | let priceAssetBalanceDelta = $t03987840125._2 | |
1050 | + | let $t04012840236 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0) | |
1051 | + | let refreshKLpActions = $t04012840236._1 | |
1052 | + | let updatedKLp = $t04012840236._2 | |
1041 | 1053 | let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp) | |
1042 | 1054 | if ((isUpdatedKLpValid == isUpdatedKLpValid)) | |
1043 | 1055 | then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount) | |
1066 | 1078 | let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
1067 | 1079 | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
1068 | 1080 | then { | |
1069 | - | let $ | |
1070 | - | let refreshKLpActions = $ | |
1071 | - | let updatedKLp = $ | |
1081 | + | let $t04118441266 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0) | |
1082 | + | let refreshKLpActions = $t04118441266._1 | |
1083 | + | let updatedKLp = $t04118441266._2 | |
1072 | 1084 | let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp) | |
1073 | 1085 | if ((isUpdatedKLpValid == isUpdatedKLpValid)) | |
1074 | 1086 | then (state ++ refreshKLpActions) | |
1096 | 1108 | let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
1097 | 1109 | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
1098 | 1110 | then { | |
1099 | - | let $ | |
1100 | - | let refreshKLpActions = $ | |
1101 | - | let updatedKLp = $ | |
1111 | + | let $t04221742298 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0) | |
1112 | + | let refreshKLpActions = $t04221742298._1 | |
1113 | + | let updatedKLp = $t04221742298._2 | |
1102 | 1114 | let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp) | |
1103 | 1115 | if ((isUpdatedKLpValid == isUpdatedKLpValid)) | |
1104 | 1116 | then (state ++ refreshKLpActions) | |
1138 | 1150 | let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)]) | |
1139 | 1151 | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
1140 | 1152 | then { | |
1141 | - | let $ | |
1142 | - | let refreshKLpActions = $ | |
1143 | - | let updatedKLp = $ | |
1153 | + | let $t04342143502 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0) | |
1154 | + | let refreshKLpActions = $t04342143502._1 | |
1155 | + | let updatedKLp = $t04342143502._2 | |
1144 | 1156 | let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp) | |
1145 | 1157 | if ((isUpdatedKLpValid == isUpdatedKLpValid)) | |
1146 | 1158 | then (state ++ refreshKLpActions) | |
1187 | 1199 | let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)]) | |
1188 | 1200 | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
1189 | 1201 | then { | |
1190 | - | let $ | |
1191 | - | let refreshKLpActions = $ | |
1192 | - | let updatedKLp = $ | |
1202 | + | let $t04479444875 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0) | |
1203 | + | let refreshKLpActions = $t04479444875._1 | |
1204 | + | let updatedKLp = $t04479444875._2 | |
1193 | 1205 | let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp) | |
1194 | 1206 | if ((isUpdatedKLpValid == isUpdatedKLpValid)) | |
1195 | 1207 | then (state ++ refreshKLpActions) | |
1222 | 1234 | if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight)) | |
1223 | 1235 | then { | |
1224 | 1236 | let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp")) | |
1225 | - | let $ | |
1226 | - | let kLpUpdateActions = $ | |
1227 | - | let updatedKLp = $ | |
1237 | + | let $t04606246126 = refreshKLpInternal(0, 0, 0) | |
1238 | + | let kLpUpdateActions = $t04606246126._1 | |
1239 | + | let updatedKLp = $t04606246126._2 | |
1228 | 1240 | let actions = if ((kLp != updatedKLp)) | |
1229 | 1241 | then kLpUpdateActions | |
1230 | 1242 | else throwErr("nothing to refresh") |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let lPdecimals = 8 | |
5 | 5 | ||
6 | 6 | let scale8 = 100000000 | |
7 | 7 | ||
8 | 8 | let scale8BigInt = toBigInt(100000000) | |
9 | 9 | ||
10 | 10 | let scale18 = toBigInt(1000000000000000000) | |
11 | 11 | ||
12 | 12 | let zeroBigInt = toBigInt(0) | |
13 | 13 | ||
14 | 14 | let big0 = toBigInt(0) | |
15 | 15 | ||
16 | 16 | let big1 = toBigInt(1) | |
17 | 17 | ||
18 | 18 | let big2 = toBigInt(2) | |
19 | 19 | ||
20 | 20 | let wavesString = "WAVES" | |
21 | 21 | ||
22 | 22 | let SEP = "__" | |
23 | 23 | ||
24 | 24 | let PoolActive = 1 | |
25 | 25 | ||
26 | 26 | let PoolPutDisabled = 2 | |
27 | 27 | ||
28 | 28 | let PoolMatcherDisabled = 3 | |
29 | 29 | ||
30 | 30 | let PoolShutdown = 4 | |
31 | 31 | ||
32 | 32 | let idxPoolAddress = 1 | |
33 | 33 | ||
34 | 34 | let idxPoolStatus = 2 | |
35 | 35 | ||
36 | 36 | let idxPoolLPAssetId = 3 | |
37 | 37 | ||
38 | 38 | let idxAmtAssetId = 4 | |
39 | 39 | ||
40 | 40 | let idxPriceAssetId = 5 | |
41 | 41 | ||
42 | 42 | let idxAmtAssetDcm = 6 | |
43 | 43 | ||
44 | 44 | let idxPriceAssetDcm = 7 | |
45 | 45 | ||
46 | 46 | let idxIAmtAssetId = 8 | |
47 | 47 | ||
48 | 48 | let idxIPriceAssetId = 9 | |
49 | 49 | ||
50 | 50 | let idxLPAssetDcm = 10 | |
51 | 51 | ||
52 | 52 | let idxPoolAmtAssetAmt = 1 | |
53 | 53 | ||
54 | 54 | let idxPoolPriceAssetAmt = 2 | |
55 | 55 | ||
56 | 56 | let idxPoolLPAssetAmt = 3 | |
57 | 57 | ||
58 | 58 | let idxFactoryStakingContract = 1 | |
59 | 59 | ||
60 | 60 | let idxFactorySlippageContract = 7 | |
61 | 61 | ||
62 | 62 | func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), scale18, toBigInt(origScaleMult)) | |
63 | 63 | ||
64 | 64 | ||
65 | 65 | func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), scale18)) | |
66 | 66 | ||
67 | 67 | ||
68 | 68 | func toScale (amt,resScale,curScale) = fraction(amt, resScale, curScale) | |
69 | 69 | ||
70 | 70 | ||
71 | 71 | func abs (val) = if ((0 > 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,timestamp) = makeString(["%s%s%d%d__price__history", toString(h), toString(timestamp)], SEP) | |
94 | 94 | ||
95 | 95 | ||
96 | 96 | func pau (userAddress,txId) = ((("%s%s%s__P__" + userAddress) + "__") + txId) | |
97 | 97 | ||
98 | 98 | ||
99 | 99 | func gau (userAddress,txId) = ((("%s%s%s__G__" + userAddress) + "__") + 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 | let keyFee = "%s__fee" | |
109 | 109 | ||
110 | 110 | let feeDefault = fraction(10, scale8, 10000) | |
111 | 111 | ||
112 | 112 | let fee = valueOrElse(getInteger(this, keyFee), feeDefault) | |
113 | 113 | ||
114 | 114 | let keyKLp = makeString(["%s", "kLp"], SEP) | |
115 | 115 | ||
116 | 116 | let keyKLpRefreshedHeight = makeString(["%s", "kLpRefreshedHeight"], SEP) | |
117 | 117 | ||
118 | 118 | let keyKLpRefreshDelay = makeString(["%s", "refreshKLpDelay"], SEP) | |
119 | 119 | ||
120 | 120 | let kLpRefreshDelayDefault = 30 | |
121 | 121 | ||
122 | 122 | let kLpRefreshDelay = valueOrElse(getInteger(this, keyKLpRefreshDelay), kLpRefreshDelayDefault) | |
123 | 123 | ||
124 | 124 | func keyFactoryConfig () = "%s__factoryConfig" | |
125 | 125 | ||
126 | 126 | ||
127 | 127 | func keyMatcherPub () = "%s%s__matcher__publicKey" | |
128 | 128 | ||
129 | 129 | ||
130 | 130 | func keyMappingPoolContractAddressToPoolAssets (poolContractAddress) = (("%s%s%s__" + poolContractAddress) + "__mappings__poolContract2LpAsset") | |
131 | 131 | ||
132 | 132 | ||
133 | 133 | func keyPoolConfig (iAmtAsset,iPriceAsset) = (((("%d%d%s__" + iAmtAsset) + "__") + iPriceAsset) + "__config") | |
134 | 134 | ||
135 | 135 | ||
136 | 136 | func keyMappingsBaseAsset2internalId (baseAssetStr) = ("%s%s%s__mappings__baseAsset2internalId__" + baseAssetStr) | |
137 | 137 | ||
138 | 138 | ||
139 | 139 | func keyAllPoolsShutdown () = "%s__shutdown" | |
140 | 140 | ||
141 | 141 | ||
142 | 142 | func keyPoolWeight (contractAddress) = ("%s%s__poolWeight__" + contractAddress) | |
143 | 143 | ||
144 | 144 | ||
145 | 145 | func keyAllowedLpScriptHash () = "%s__allowedLpScriptHash" | |
146 | 146 | ||
147 | 147 | ||
148 | 148 | let keyFeeCollectorAddress = "%s__feeCollectorAddress" | |
149 | 149 | ||
150 | 150 | func throwOrderError (orderValid,senderValid,matcherValid) = throw(((((("order validation failed: orderValid=" + toString(orderValid)) + " senderValid=") + toString(senderValid)) + " matcherValid=") + toString(matcherValid))) | |
151 | 151 | ||
152 | 152 | ||
153 | 153 | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
154 | 154 | ||
155 | 155 | ||
156 | 156 | func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
157 | 157 | ||
158 | 158 | ||
159 | 159 | func throwErr (msg) = throw(makeString(["lp.ride:", msg], " ")) | |
160 | 160 | ||
161 | 161 | ||
162 | 162 | func fmtErr (msg) = makeString(["lp.ride:", msg], " ") | |
163 | 163 | ||
164 | 164 | ||
165 | 165 | let factoryContract = addressFromStringValue(getStringOrFail(this, fc())) | |
166 | 166 | ||
167 | 167 | let feeCollectorAddress = addressFromStringValue(getStringOrFail(factoryContract, keyFeeCollectorAddress)) | |
168 | 168 | ||
169 | 169 | func isGlobalShutdown () = valueOrElse(getBoolean(factoryContract, keyAllPoolsShutdown()), false) | |
170 | 170 | ||
171 | 171 | ||
172 | 172 | func getMatcherPubOrFail () = fromBase58String(getStringOrFail(factoryContract, keyMatcherPub())) | |
173 | 173 | ||
174 | 174 | ||
175 | 175 | func getPoolConfig () = { | |
176 | 176 | let amtAsset = getStringOrFail(this, aa()) | |
177 | 177 | let priceAsset = getStringOrFail(this, pa()) | |
178 | 178 | let iPriceAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(priceAsset)) | |
179 | 179 | let iAmtAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(amtAsset)) | |
180 | 180 | split(getStringOrFail(factoryContract, keyPoolConfig(toString(iAmtAsset), toString(iPriceAsset))), SEP) | |
181 | 181 | } | |
182 | 182 | ||
183 | 183 | ||
184 | 184 | func parseAssetId (input) = if ((input == wavesString)) | |
185 | 185 | then unit | |
186 | 186 | else fromBase58String(input) | |
187 | 187 | ||
188 | 188 | ||
189 | 189 | func assetIdToString (input) = if ((input == unit)) | |
190 | 190 | then wavesString | |
191 | 191 | else toBase58String(value(input)) | |
192 | 192 | ||
193 | 193 | ||
194 | 194 | func parsePoolConfig (poolConfig) = $Tuple7(addressFromStringValue(poolConfig[idxPoolAddress]), parseIntValue(poolConfig[idxPoolStatus]), fromBase58String(poolConfig[idxPoolLPAssetId]), parseAssetId(poolConfig[idxAmtAssetId]), parseAssetId(poolConfig[idxPriceAssetId]), parseIntValue(poolConfig[idxAmtAssetDcm]), parseIntValue(poolConfig[idxPriceAssetDcm])) | |
195 | 195 | ||
196 | 196 | ||
197 | 197 | let poolConfigParsed = parsePoolConfig(getPoolConfig()) | |
198 | 198 | ||
199 | 199 | let $t079158081 = poolConfigParsed | |
200 | 200 | ||
201 | 201 | let cfgPoolAddress = $t079158081._1 | |
202 | 202 | ||
203 | 203 | let cfgPoolStatus = $t079158081._2 | |
204 | 204 | ||
205 | 205 | let cfgLpAssetId = $t079158081._3 | |
206 | 206 | ||
207 | 207 | let cfgAmountAssetId = $t079158081._4 | |
208 | 208 | ||
209 | 209 | let cfgPriceAssetId = $t079158081._5 | |
210 | 210 | ||
211 | 211 | let cfgAmountAssetDecimals = $t079158081._6 | |
212 | 212 | ||
213 | 213 | let cfgPriceAssetDecimals = $t079158081._7 | |
214 | 214 | ||
215 | 215 | func getFactoryConfig () = split(getStringOrFail(factoryContract, keyFactoryConfig()), SEP) | |
216 | 216 | ||
217 | 217 | ||
218 | 218 | let stakingContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactoryStakingContract]), "incorrect staking address") | |
219 | 219 | ||
220 | 220 | let slippageContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactorySlippageContract]), "incorrect staking address") | |
221 | 221 | ||
222 | 222 | func dataPutActionInfo (inAmtAssetAmt,inPriceAssetAmt,outLpAmt,price,slippageTolerancePassedByUser,slippageToleranceReal,txHeight,txTimestamp,slipageAmtAssetAmt,slipagePriceAssetAmt) = makeString(["%d%d%d%d%d%d%d%d%d%d", toString(inAmtAssetAmt), toString(inPriceAssetAmt), toString(outLpAmt), toString(price), toString(slippageTolerancePassedByUser), toString(slippageToleranceReal), toString(txHeight), toString(txTimestamp), toString(slipageAmtAssetAmt), toString(slipagePriceAssetAmt)], SEP) | |
223 | 223 | ||
224 | 224 | ||
225 | 225 | 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) | |
226 | 226 | ||
227 | 227 | ||
228 | 228 | func getAccBalance (assetId) = if ((assetId == "WAVES")) | |
229 | 229 | then wavesBalance(this).available | |
230 | 230 | else assetBalance(this, fromBase58String(assetId)) | |
231 | 231 | ||
232 | 232 | ||
233 | 233 | func calcPriceBigInt (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18) | |
234 | 234 | ||
235 | 235 | ||
236 | 236 | func privateCalcPrice (amAssetDcm,prAssetDcm,amAmt,prAmt) = { | |
237 | 237 | let amtAssetAmtX18 = toX18(amAmt, amAssetDcm) | |
238 | 238 | let priceAssetAmtX18 = toX18(prAmt, prAssetDcm) | |
239 | 239 | calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18) | |
240 | 240 | } | |
241 | 241 | ||
242 | 242 | ||
243 | 243 | func calcPrices (amAmt,prAmt,lpAmt) = { | |
244 | 244 | let cfg = getPoolConfig() | |
245 | 245 | let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm]) | |
246 | 246 | let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm]) | |
247 | 247 | let priceX18 = privateCalcPrice(amtAssetDcm, priceAssetDcm, amAmt, prAmt) | |
248 | 248 | let amAmtX18 = toX18(amAmt, amtAssetDcm) | |
249 | 249 | let prAmtX18 = toX18(prAmt, priceAssetDcm) | |
250 | 250 | let lpAmtX18 = toX18(lpAmt, scale8) | |
251 | 251 | let lpPriceInAmAssetX18 = calcPriceBigInt(amAmtX18, lpAmtX18) | |
252 | 252 | let lpPriceInPrAssetX18 = calcPriceBigInt(prAmtX18, lpAmtX18) | |
253 | 253 | [priceX18, lpPriceInAmAssetX18, lpPriceInPrAssetX18] | |
254 | 254 | } | |
255 | 255 | ||
256 | 256 | ||
257 | 257 | func calculatePrices (amAmt,prAmt,lpAmt) = { | |
258 | 258 | let prices = calcPrices(amAmt, prAmt, lpAmt) | |
259 | 259 | [fromX18(prices[0], scale8), fromX18(prices[1], scale8), fromX18(prices[2], scale8)] | |
260 | 260 | } | |
261 | 261 | ||
262 | 262 | ||
263 | 263 | func estimateGetOperation (txId58,pmtAssetId,pmtLpAmt,userAddress) = { | |
264 | 264 | let cfg = getPoolConfig() | |
265 | 265 | let lpAssetId = cfg[idxPoolLPAssetId] | |
266 | 266 | let amAssetId = cfg[idxAmtAssetId] | |
267 | 267 | let prAssetId = cfg[idxPriceAssetId] | |
268 | 268 | let amAssetDcm = parseIntValue(cfg[idxAmtAssetDcm]) | |
269 | 269 | let prAssetDcm = parseIntValue(cfg[idxPriceAssetDcm]) | |
270 | 270 | let poolStatus = cfg[idxPoolStatus] | |
271 | 271 | let lpEmission = valueOrErrorMessage(assetInfo(fromBase58String(lpAssetId)), (("Asset " + lpAssetId) + " doesn't exist")).quantity | |
272 | 272 | if ((lpAssetId != pmtAssetId)) | |
273 | 273 | then throw("Invalid asset passed.") | |
274 | 274 | else { | |
275 | 275 | let amBalance = getAccBalance(amAssetId) | |
276 | 276 | let amBalanceX18 = toX18(amBalance, amAssetDcm) | |
277 | 277 | let prBalance = getAccBalance(prAssetId) | |
278 | 278 | let prBalanceX18 = toX18(prBalance, prAssetDcm) | |
279 | 279 | let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18) | |
280 | 280 | let curPrice = fromX18(curPriceX18, scale8) | |
281 | 281 | let pmtLpAmtX18 = toX18(pmtLpAmt, scale8) | |
282 | 282 | let lpEmissionX18 = toX18(lpEmission, scale8) | |
283 | 283 | let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissionX18) | |
284 | 284 | let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissionX18) | |
285 | 285 | let outAmAmt = fromX18(outAmAmtX18, amAssetDcm) | |
286 | 286 | let outPrAmt = fromX18(outPrAmtX18, prAssetDcm) | |
287 | 287 | let state = if ((txId58 == "")) | |
288 | 288 | then nil | |
289 | 289 | else [ScriptTransfer(userAddress, outAmAmt, if ((amAssetId == "WAVES")) | |
290 | 290 | then unit | |
291 | 291 | else fromBase58String(amAssetId)), ScriptTransfer(userAddress, outPrAmt, if ((prAssetId == "WAVES")) | |
292 | 292 | then unit | |
293 | 293 | else fromBase58String(prAssetId)), StringEntry(gau(toString(userAddress), txId58), dataGetActionInfo(outAmAmt, outPrAmt, pmtLpAmt, curPrice, height, lastBlock.timestamp)), IntegerEntry(pl(), curPrice), IntegerEntry(ph(height, lastBlock.timestamp), curPrice)] | |
294 | 294 | $Tuple10(outAmAmt, outPrAmt, amAssetId, prAssetId, amBalance, prBalance, lpEmission, curPriceX18, poolStatus, state) | |
295 | 295 | } | |
296 | 296 | } | |
297 | 297 | ||
298 | 298 | ||
299 | 299 | func estimatePutOperation (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = { | |
300 | 300 | let cfg = getPoolConfig() | |
301 | 301 | let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId]) | |
302 | 302 | let amAssetIdStr = cfg[idxAmtAssetId] | |
303 | 303 | let prAssetIdStr = cfg[idxPriceAssetId] | |
304 | 304 | let iAmtAssetId = cfg[idxIAmtAssetId] | |
305 | 305 | let iPriceAssetId = cfg[idxIPriceAssetId] | |
306 | 306 | let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm]) | |
307 | 307 | let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm]) | |
308 | 308 | let poolStatus = cfg[idxPoolStatus] | |
309 | 309 | let lpEmission = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity | |
310 | 310 | let inAmAssetIdStr = toBase58String(valueOrElse(inAmAssetId, fromBase58String("WAVES"))) | |
311 | 311 | let inPrAssetIdStr = toBase58String(valueOrElse(inPrAssetId, fromBase58String("WAVES"))) | |
312 | 312 | if (if ((amAssetIdStr != inAmAssetIdStr)) | |
313 | 313 | then true | |
314 | 314 | else (prAssetIdStr != inPrAssetIdStr)) | |
315 | 315 | then throw("Invalid amt or price asset passed.") | |
316 | 316 | else { | |
317 | 317 | let amBalance = if (isEvaluate) | |
318 | 318 | then getAccBalance(amAssetIdStr) | |
319 | 319 | else (getAccBalance(amAssetIdStr) - inAmAssetAmt) | |
320 | 320 | let prBalance = if (isEvaluate) | |
321 | 321 | then getAccBalance(prAssetIdStr) | |
322 | 322 | else (getAccBalance(prAssetIdStr) - inPrAssetAmt) | |
323 | 323 | let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm) | |
324 | 324 | let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm) | |
325 | 325 | let userPriceX18 = calcPriceBigInt(inPrAssetAmtX18, inAmAssetAmtX18) | |
326 | 326 | let amBalanceX18 = toX18(amBalance, amtAssetDcm) | |
327 | 327 | let prBalanceX18 = toX18(prBalance, priceAssetDcm) | |
328 | 328 | let res = if ((lpEmission == 0)) | |
329 | 329 | then { | |
330 | 330 | let curPriceX18 = zeroBigInt | |
331 | 331 | let slippageX18 = zeroBigInt | |
332 | 332 | let lpAmtX18 = pow((inAmAssetAmtX18 * inPrAssetAmtX18), 0, toBigInt(5), 1, 0, DOWN) | |
333 | 333 | $Tuple5(fromX18(lpAmtX18, scale8), fromX18(inAmAssetAmtX18, amtAssetDcm), fromX18(inPrAssetAmtX18, priceAssetDcm), calcPriceBigInt((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18) | |
334 | 334 | } | |
335 | 335 | else { | |
336 | 336 | let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18) | |
337 | 337 | let slippageX18 = fraction(absBigInt((curPriceX18 - userPriceX18)), scale18, curPriceX18) | |
338 | 338 | let slippageToleranceX18 = toX18(slippageTolerance, scale8) | |
339 | 339 | if (if ((curPriceX18 != zeroBigInt)) | |
340 | 340 | then (slippageX18 > slippageToleranceX18) | |
341 | 341 | else false) | |
342 | 342 | then throw(((("Price slippage " + toString(slippageX18)) + " exceeded the passed limit of ") + toString(slippageToleranceX18))) | |
343 | 343 | else { | |
344 | 344 | let lpEmissionX18 = toX18(lpEmission, scale8) | |
345 | 345 | let prViaAmX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18) | |
346 | 346 | let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18) | |
347 | 347 | let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18)) | |
348 | 348 | then $Tuple2(amViaPrX18, inPrAssetAmtX18) | |
349 | 349 | else $Tuple2(inAmAssetAmtX18, prViaAmX18) | |
350 | 350 | let expAmtAssetAmtX18 = expectedAmts._1 | |
351 | 351 | let expPriceAssetAmtX18 = expectedAmts._2 | |
352 | 352 | let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18) | |
353 | 353 | $Tuple5(fromX18(lpAmtX18, scale8), fromX18(expAmtAssetAmtX18, amtAssetDcm), fromX18(expPriceAssetAmtX18, priceAssetDcm), curPriceX18, slippageX18) | |
354 | 354 | } | |
355 | 355 | } | |
356 | 356 | let calcLpAmt = res._1 | |
357 | 357 | let calcAmAssetPmt = res._2 | |
358 | 358 | let calcPrAssetPmt = res._3 | |
359 | 359 | let curPrice = fromX18(res._4, scale8) | |
360 | 360 | let slippageCalc = fromX18(res._5, scale8) | |
361 | 361 | if ((0 >= calcLpAmt)) | |
362 | 362 | then throw("Invalid calculations. LP calculated is less than zero.") | |
363 | 363 | else { | |
364 | 364 | let emitLpAmt = if (!(emitLp)) | |
365 | 365 | then 0 | |
366 | 366 | else calcLpAmt | |
367 | 367 | let amDiff = (inAmAssetAmt - calcAmAssetPmt) | |
368 | 368 | let prDiff = (inPrAssetAmt - calcPrAssetPmt) | |
369 | 369 | let commonState = [IntegerEntry(pl(), curPrice), IntegerEntry(ph(height, lastBlock.timestamp), curPrice), StringEntry(pau(userAddress, txId58), dataPutActionInfo(calcAmAssetPmt, calcPrAssetPmt, emitLpAmt, curPrice, slippageTolerance, slippageCalc, height, lastBlock.timestamp, amDiff, prDiff))] | |
370 | 370 | $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEmission, lpAssetId, poolStatus, commonState, amDiff, prDiff, inAmAssetId, inPrAssetId) | |
371 | 371 | } | |
372 | 372 | } | |
373 | 373 | } | |
374 | 374 | ||
375 | 375 | ||
376 | 376 | func calcKLp (amountBalance,priceBalance,lpEmission) = { | |
377 | 377 | let updatedKLp = fraction(pow((amountBalance * priceBalance), 0, toBigInt(5), 1, 18, DOWN), big1, lpEmission) | |
378 | 378 | if ((lpEmission == big0)) | |
379 | 379 | then big0 | |
380 | 380 | else updatedKLp | |
381 | 381 | } | |
382 | 382 | ||
383 | 383 | ||
384 | 384 | func calcCurrentKLp (amountAssetDelta,priceAssetDelta,lpAssetEmissionDelta) = { | |
385 | 385 | let amountAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) - amountAssetDelta) | |
386 | 386 | let priceAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) - priceAssetDelta) | |
387 | 387 | let lpAssetEmission = (toBigInt(value(assetInfo(cfgLpAssetId)).quantity) - lpAssetEmissionDelta) | |
388 | 388 | let currentKLp = calcKLp(amountAssetBalance, priceAssetBalance, lpAssetEmission) | |
389 | 389 | currentKLp | |
390 | 390 | } | |
391 | 391 | ||
392 | 392 | ||
393 | 393 | func refreshKLpInternal (amountAssetBalanceDelta,priceAssetBalanceDelta,lpAssetEmissionDelta) = { | |
394 | 394 | let amountAssetBalance = (getAccBalance(assetIdToString(cfgAmountAssetId)) + amountAssetBalanceDelta) | |
395 | 395 | let priceAssetBalance = (getAccBalance(assetIdToString(cfgPriceAssetId)) + priceAssetBalanceDelta) | |
396 | 396 | let lpAssetEmission = (value(assetInfo(cfgLpAssetId)).quantity + lpAssetEmissionDelta) | |
397 | 397 | let updatedKLp = calcKLp(toBigInt(amountAssetBalance), toBigInt(priceAssetBalance), toBigInt(lpAssetEmission)) | |
398 | 398 | let actions = [IntegerEntry(keyKLpRefreshedHeight, height), StringEntry(keyKLp, toString(updatedKLp))] | |
399 | 399 | $Tuple2(actions, updatedKLp) | |
400 | 400 | } | |
401 | 401 | ||
402 | 402 | ||
403 | 403 | func validateUpdatedKLp (oldKLp,updatedKLp) = if ((updatedKLp >= oldKLp)) | |
404 | 404 | then true | |
405 | 405 | else throwErr(makeString(["updated KLp lower than current KLp", toString(oldKLp), toString(updatedKLp)], " ")) | |
406 | 406 | ||
407 | 407 | ||
408 | 408 | func validateMatcherOrderAllowed (order) = { | |
409 | 409 | let amountAssetAmount = order.amount | |
410 | 410 | let priceAssetAmount = fraction(order.amount, order.price, scale8, FLOOR) | |
411 | 411 | let $t02034120553 = if ((order.orderType == Buy)) | |
412 | 412 | then $Tuple2(amountAssetAmount, -(priceAssetAmount)) | |
413 | 413 | else $Tuple2(-(amountAssetAmount), priceAssetAmount) | |
414 | 414 | let amountAssetBalanceDelta = $t02034120553._1 | |
415 | 415 | let priceAssetBalanceDelta = $t02034120553._2 | |
416 | 416 | if (if (if (isGlobalShutdown()) | |
417 | 417 | then true | |
418 | 418 | else (cfgPoolStatus == PoolMatcherDisabled)) | |
419 | 419 | then true | |
420 | 420 | else (cfgPoolStatus == PoolShutdown)) | |
421 | 421 | then throw("Exchange operations disabled") | |
422 | 422 | else if (if ((order.assetPair.amountAsset != cfgAmountAssetId)) | |
423 | 423 | then true | |
424 | 424 | else (order.assetPair.priceAsset != cfgPriceAssetId)) | |
425 | 425 | then throw("Wrong order assets.") | |
426 | 426 | else { | |
427 | 427 | let kLp = valueOrErrorMessage(parseBigInt(valueOrErrorMessage(getString(this, keyKLp), fmtErr("kLp is required"))), fmtErr("invalid kLp")) | |
428 | 428 | let $t02102421124 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0) | |
429 | 429 | let unusedActions = $t02102421124._1 | |
430 | 430 | let kLpNew = $t02102421124._2 | |
431 | 431 | let isOrderValid = (kLpNew >= kLp) | |
432 | 432 | isOrderValid | |
433 | 433 | } | |
434 | 434 | } | |
435 | 435 | ||
436 | 436 | ||
437 | 437 | func commonGet (i) = if ((size(i.payments) != 1)) | |
438 | 438 | then throw("exactly 1 payment is expected") | |
439 | 439 | else { | |
440 | 440 | let pmt = value(i.payments[0]) | |
441 | 441 | let pmtAssetId = value(pmt.assetId) | |
442 | 442 | let pmtAmt = pmt.amount | |
443 | 443 | let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller) | |
444 | 444 | let outAmAmt = res._1 | |
445 | 445 | let outPrAmt = res._2 | |
446 | 446 | let poolStatus = parseIntValue(res._9) | |
447 | 447 | let state = res._10 | |
448 | 448 | if (if (isGlobalShutdown()) | |
449 | 449 | then true | |
450 | 450 | else (poolStatus == PoolShutdown)) | |
451 | 451 | then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus))) | |
452 | 452 | else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state) | |
453 | 453 | } | |
454 | 454 | ||
455 | 455 | ||
456 | 456 | func commonPut (i,slippageTolerance,emitLp) = if ((size(i.payments) != 2)) | |
457 | 457 | then throw("exactly 2 payments are expected") | |
458 | 458 | else { | |
459 | 459 | let amAssetPmt = value(i.payments[0]) | |
460 | 460 | let prAssetPmt = value(i.payments[1]) | |
461 | 461 | let estPut = estimatePutOperation(toBase58String(i.transactionId), slippageTolerance, amAssetPmt.amount, amAssetPmt.assetId, prAssetPmt.amount, prAssetPmt.assetId, toString(i.caller), false, emitLp) | |
462 | 462 | let poolStatus = parseIntValue(estPut._8) | |
463 | 463 | if (if (if (isGlobalShutdown()) | |
464 | 464 | then true | |
465 | 465 | else (poolStatus == PoolPutDisabled)) | |
466 | 466 | then true | |
467 | 467 | else (poolStatus == PoolShutdown)) | |
468 | 468 | then throw(("Put operation is blocked by admin. Status = " + toString(poolStatus))) | |
469 | 469 | else estPut | |
470 | 470 | } | |
471 | 471 | ||
472 | 472 | ||
473 | 473 | func emit (amount) = { | |
474 | 474 | let emitInv = invoke(factoryContract, "emit", [amount], nil) | |
475 | 475 | if ((emitInv == emitInv)) | |
476 | 476 | then { | |
477 | 477 | let emitInvLegacy = match emitInv { | |
478 | 478 | case legacyFactoryContract: Address => | |
479 | 479 | invoke(legacyFactoryContract, "emit", [amount], nil) | |
480 | 480 | case _ => | |
481 | 481 | unit | |
482 | 482 | } | |
483 | 483 | if ((emitInvLegacy == emitInvLegacy)) | |
484 | 484 | then amount | |
485 | 485 | else throw("Strict value is not equal to itself.") | |
486 | 486 | } | |
487 | 487 | else throw("Strict value is not equal to itself.") | |
488 | 488 | } | |
489 | 489 | ||
490 | 490 | ||
491 | 491 | func takeFee (amount) = { | |
492 | 492 | let feeAmount = fraction(amount, fee, scale8) | |
493 | 493 | $Tuple2((amount - feeAmount), feeAmount) | |
494 | 494 | } | |
495 | 495 | ||
496 | 496 | ||
497 | 497 | func calcPutOneToken (paymentAmountRaw,paymentAssetId,userAddress,txId) = { | |
498 | 498 | let isEval = (txId == unit) | |
499 | 499 | let amountBalanceRaw = getAccBalance(assetIdToString(cfgAmountAssetId)) | |
500 | 500 | let priceBalanceRaw = getAccBalance(assetIdToString(cfgPriceAssetId)) | |
501 | 501 | let paymentInAmountAsset = if ((paymentAssetId == cfgAmountAssetId)) | |
502 | 502 | then true | |
503 | 503 | else if ((paymentAssetId == cfgPriceAssetId)) | |
504 | 504 | then false | |
505 | 505 | else throwErr("invalid asset") | |
506 | 506 | let $t02380924102 = if (isEval) | |
507 | 507 | then $Tuple2(amountBalanceRaw, priceBalanceRaw) | |
508 | 508 | else if (paymentInAmountAsset) | |
509 | 509 | then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw) | |
510 | 510 | else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw)) | |
511 | 511 | let amountBalanceOld = $t02380924102._1 | |
512 | 512 | let priceBalanceOld = $t02380924102._2 | |
513 | 513 | let $t02410624255 = if (paymentInAmountAsset) | |
514 | 514 | then $Tuple2(paymentAmountRaw, 0) | |
515 | 515 | else $Tuple2(0, paymentAmountRaw) | |
516 | 516 | let amountAssetAmountRaw = $t02410624255._1 | |
517 | 517 | let priceAssetAmountRaw = $t02410624255._2 | |
518 | 518 | let amountAssetAmount = takeFee(amountAssetAmountRaw)._1 | |
519 | 519 | let priceAssetAmount = takeFee(priceAssetAmountRaw)._1 | |
520 | 520 | let $t02437724436 = takeFee(paymentAmountRaw) | |
521 | 521 | let paymentAmount = $t02437724436._1 | |
522 | 522 | let feeAmount = $t02437724436._2 | |
523 | 523 | let amountBalanceNew = (amountBalanceOld + amountAssetAmount) | |
524 | 524 | let priceBalanceNew = (priceBalanceOld + priceAssetAmount) | |
525 | 525 | let priceNewX18 = calcPriceBigInt(toX18(priceBalanceNew, cfgPriceAssetDecimals), toX18(amountBalanceNew, cfgAmountAssetDecimals)) | |
526 | 526 | let priceNew = fromX18(priceNewX18, scale8) | |
527 | 527 | let paymentBalance = if (paymentInAmountAsset) | |
528 | 528 | then amountBalanceOld | |
529 | 529 | else priceBalanceOld | |
530 | 530 | let paymentBalanceBigInt = toBigInt(paymentBalance) | |
531 | 531 | let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity) | |
532 | 532 | let chechSupply = if ((supplyBigInt > big0)) | |
533 | 533 | then true | |
534 | 534 | else throwErr("initial deposit requires all coins") | |
535 | 535 | if ((chechSupply == chechSupply)) | |
536 | 536 | then { | |
537 | 537 | let depositBigInt = toBigInt(paymentAmount) | |
538 | 538 | let issueAmount = max([0, toInt(((supplyBigInt * (sqrtBigInt((scale18 + ((depositBigInt * scale18) / paymentBalanceBigInt)), 18, 18, DOWN) - scale18)) / scale18))]) | |
539 | 539 | let commonState = if (isEval) | |
540 | 540 | then nil | |
541 | 541 | else [IntegerEntry(pl(), priceNew), IntegerEntry(ph(height, lastBlock.timestamp), priceNew), StringEntry(pau(toString(value(userAddress)), toBase58String(value(txId))), dataPutActionInfo(amountAssetAmountRaw, priceAssetAmountRaw, issueAmount, priceNew, 0, 0, height, lastBlock.timestamp, 0, 0))] | |
542 | 542 | let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, cfgPriceAssetDecimals), toX18(amountBalanceOld, cfgAmountAssetDecimals)) | |
543 | 543 | let priceOld = fromX18(priceOldX18, scale8) | |
544 | 544 | let loss = { | |
545 | 545 | let $t02591326080 = if (paymentInAmountAsset) | |
546 | 546 | then $Tuple2(amountAssetAmountRaw, amountBalanceOld) | |
547 | 547 | else $Tuple2(priceAssetAmountRaw, priceBalanceOld) | |
548 | 548 | let amount = $t02591326080._1 | |
549 | 549 | let balance = $t02591326080._2 | |
550 | 550 | let issueAmountBoth = toInt(fraction(supplyBigInt, toBigInt((amount / 2)), toBigInt(balance))) | |
551 | 551 | fraction((issueAmount - issueAmountBoth), scale8, issueAmountBoth) | |
552 | 552 | } | |
553 | 553 | $Tuple5(issueAmount, commonState, feeAmount, loss, paymentInAmountAsset) | |
554 | 554 | } | |
555 | 555 | else throw("Strict value is not equal to itself.") | |
556 | 556 | } | |
557 | 557 | ||
558 | 558 | ||
559 | 559 | func calcGetOneToken (outAssetId,paymentAmount,paymentAssetId,userAddress,txId) = { | |
560 | 560 | let isEval = (txId == unit) | |
561 | 561 | let checks = [if ((paymentAssetId == cfgLpAssetId)) | |
562 | 562 | then true | |
563 | 563 | else throwErr("invalid lp asset")] | |
564 | 564 | if ((checks == checks)) | |
565 | 565 | then { | |
566 | 566 | let outInAmountAsset = if ((outAssetId == cfgAmountAssetId)) | |
567 | 567 | then true | |
568 | 568 | else if ((outAssetId == cfgPriceAssetId)) | |
569 | 569 | then false | |
570 | 570 | else throwErr("invalid asset") | |
571 | 571 | let balanceBigInt = if (outInAmountAsset) | |
572 | 572 | then toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) | |
573 | 573 | else toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) | |
574 | 574 | let amBalanceOld = getAccBalance(assetIdToString(cfgAmountAssetId)) | |
575 | 575 | let prBalanceOld = getAccBalance(assetIdToString(cfgPriceAssetId)) | |
576 | 576 | let outBalance = if (outInAmountAsset) | |
577 | 577 | then amBalanceOld | |
578 | 578 | else prBalanceOld | |
579 | 579 | let outBalanceBigInt = toBigInt(outBalance) | |
580 | 580 | let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity) | |
581 | 581 | let redeemedBigInt = toBigInt(paymentAmount) | |
582 | 582 | let amountRaw = max([0, toInt(((balanceBigInt * (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN))) / scale18))]) | |
583 | 583 | let $t02768227732 = takeFee(amountRaw) | |
584 | 584 | let totalAmount = $t02768227732._1 | |
585 | 585 | let feeAmount = $t02768227732._2 | |
586 | 586 | let $t02773627962 = if (outInAmountAsset) | |
587 | 587 | then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld) | |
588 | 588 | else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw)) | |
589 | 589 | let outAmAmount = $t02773627962._1 | |
590 | 590 | let outPrAmount = $t02773627962._2 | |
591 | 591 | let amBalanceNew = $t02773627962._3 | |
592 | 592 | let prBalanceNew = $t02773627962._4 | |
593 | 593 | let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, cfgPriceAssetDecimals), toX18(amBalanceNew, cfgAmountAssetDecimals)) | |
594 | 594 | let priceNew = fromX18(priceNewX18, scale8) | |
595 | 595 | let commonState = if (isEval) | |
596 | 596 | then nil | |
597 | 597 | else [StringEntry(gau(toString(value(userAddress)), toBase58String(value(txId))), dataGetActionInfo(outAmAmount, outPrAmount, paymentAmount, priceNew, height, lastBlock.timestamp)), IntegerEntry(pl(), priceNew), IntegerEntry(ph(height, lastBlock.timestamp), priceNew)] | |
598 | 598 | let priceOldX18 = calcPriceBigInt(toX18(prBalanceOld, cfgPriceAssetDecimals), toX18(amBalanceOld, cfgAmountAssetDecimals)) | |
599 | 599 | let priceOld = fromX18(priceOldX18, scale8) | |
600 | 600 | let loss = { | |
601 | 601 | let amountBothInPaymentAsset = (toInt(fraction(balanceBigInt, redeemedBigInt, supplyBigInt)) * 2) | |
602 | 602 | fraction((totalAmount - amountBothInPaymentAsset), scale8, amountBothInPaymentAsset) | |
603 | 603 | } | |
604 | 604 | $Tuple5(totalAmount, commonState, feeAmount, loss, outInAmountAsset) | |
605 | 605 | } | |
606 | 606 | else throw("Strict value is not equal to itself.") | |
607 | 607 | } | |
608 | 608 | ||
609 | 609 | ||
610 | 610 | func managerPublicKeyOrUnit () = match getString(mpk()) { | |
611 | 611 | case s: String => | |
612 | 612 | fromBase58String(s) | |
613 | 613 | case _: Unit => | |
614 | 614 | unit | |
615 | 615 | case _ => | |
616 | 616 | throw("Match error") | |
617 | 617 | } | |
618 | 618 | ||
619 | 619 | ||
620 | 620 | func pendingManagerPublicKeyOrUnit () = match getString(pmpk()) { | |
621 | 621 | case s: String => | |
622 | 622 | fromBase58String(s) | |
623 | 623 | case _: Unit => | |
624 | 624 | unit | |
625 | 625 | case _ => | |
626 | 626 | throw("Match error") | |
627 | 627 | } | |
628 | 628 | ||
629 | 629 | ||
630 | 630 | func isManager (i) = match managerPublicKeyOrUnit() { | |
631 | 631 | case pk: ByteVector => | |
632 | 632 | (i.callerPublicKey == pk) | |
633 | 633 | case _: Unit => | |
634 | 634 | (i.caller == this) | |
635 | 635 | case _ => | |
636 | 636 | throw("Match error") | |
637 | 637 | } | |
638 | 638 | ||
639 | 639 | ||
640 | 640 | func mustManager (i) = { | |
641 | 641 | let pd = throw("Permission denied") | |
642 | 642 | match managerPublicKeyOrUnit() { | |
643 | 643 | case pk: ByteVector => | |
644 | 644 | if ((i.callerPublicKey == pk)) | |
645 | 645 | then true | |
646 | 646 | else pd | |
647 | 647 | case _: Unit => | |
648 | 648 | if ((i.caller == this)) | |
649 | 649 | then true | |
650 | 650 | else pd | |
651 | 651 | case _ => | |
652 | 652 | throw("Match error") | |
653 | 653 | } | |
654 | 654 | } | |
655 | 655 | ||
656 | 656 | ||
657 | 657 | @Callable(i) | |
658 | 658 | func setManager (pendingManagerPublicKey) = { | |
659 | 659 | let checkCaller = mustManager(i) | |
660 | 660 | if ((checkCaller == checkCaller)) | |
661 | 661 | then { | |
662 | 662 | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
663 | 663 | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
664 | 664 | then [StringEntry(pmpk(), pendingManagerPublicKey)] | |
665 | 665 | else throw("Strict value is not equal to itself.") | |
666 | 666 | } | |
667 | 667 | else throw("Strict value is not equal to itself.") | |
668 | 668 | } | |
669 | 669 | ||
670 | 670 | ||
671 | 671 | ||
672 | 672 | @Callable(i) | |
673 | 673 | func confirmManager () = { | |
674 | 674 | let pm = pendingManagerPublicKeyOrUnit() | |
675 | 675 | let hasPM = if (isDefined(pm)) | |
676 | 676 | then true | |
677 | 677 | else throw("No pending manager") | |
678 | 678 | if ((hasPM == hasPM)) | |
679 | 679 | then { | |
680 | 680 | let checkPM = if ((i.callerPublicKey == value(pm))) | |
681 | 681 | then true | |
682 | 682 | else throw("You are not pending manager") | |
683 | 683 | if ((checkPM == checkPM)) | |
684 | 684 | then [StringEntry(mpk(), toBase58String(value(pm))), DeleteEntry(pmpk())] | |
685 | 685 | else throw("Strict value is not equal to itself.") | |
686 | 686 | } | |
687 | 687 | else throw("Strict value is not equal to itself.") | |
688 | 688 | } | |
689 | 689 | ||
690 | 690 | ||
691 | 691 | ||
692 | 692 | @Callable(i) | |
693 | 693 | func put (slippageTolerance,shouldAutoStake) = if ((0 > slippageTolerance)) | |
694 | 694 | then throw("Invalid slippageTolerance passed") | |
695 | 695 | else { | |
696 | 696 | let estPut = commonPut(i, slippageTolerance, true) | |
697 | 697 | let emitLpAmt = estPut._2 | |
698 | 698 | let lpAssetId = estPut._7 | |
699 | 699 | let state = estPut._9 | |
700 | 700 | let amDiff = estPut._10 | |
701 | 701 | let prDiff = estPut._11 | |
702 | 702 | let amId = estPut._12 | |
703 | 703 | let prId = estPut._13 | |
704 | 704 | let amAssetPmt = toBigInt(value(i.payments[0]).amount) | |
705 | 705 | let prAssetPmt = toBigInt(value(i.payments[1]).amount) | |
706 | - | let | |
707 | - | if (( | |
706 | + | let amountAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) - amAssetPmt) | |
707 | + | if ((amountAssetBalance == amountAssetBalance)) | |
708 | 708 | then { | |
709 | - | let | |
710 | - | if (( | |
709 | + | let priceAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) - prAssetPmt) | |
710 | + | if ((priceAssetBalance == priceAssetBalance)) | |
711 | 711 | then { | |
712 | - | let emitInvLegacy = match emitInv { | |
713 | - | case legacyFactoryContract: Address => | |
714 | - | invoke(legacyFactoryContract, "emit", [emitLpAmt], nil) | |
715 | - | case _ => | |
716 | - | unit | |
717 | - | } | |
718 | - | if ((emitInvLegacy == emitInvLegacy)) | |
712 | + | let lpAssetEmission = toBigInt(value(assetInfo(cfgLpAssetId)).quantity) | |
713 | + | if ((lpAssetEmission == lpAssetEmission)) | |
719 | 714 | then { | |
720 | - | let slippageAInv = if ((amDiff > 0)) | |
721 | - | then invoke(slippageContract, "put", nil, [AttachedPayment(amId, amDiff)]) | |
722 | - | else nil | |
723 | - | if ((slippageAInv == slippageAInv)) | |
715 | + | let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0)) | |
716 | + | if ((currentKLp == currentKLp)) | |
724 | 717 | then { | |
725 | - | let slippagePInv = if ((prDiff > 0)) | |
726 | - | then invoke(slippageContract, "put", nil, [AttachedPayment(prId, prDiff)]) | |
727 | - | else nil | |
728 | - | if ((slippagePInv == slippagePInv)) | |
718 | + | let emitInv = invoke(factoryContract, "emit", [emitLpAmt], nil) | |
719 | + | if ((emitInv == emitInv)) | |
729 | 720 | then { | |
730 | - | let lpTransfer = if (shouldAutoStake) | |
721 | + | let emitInvLegacy = match emitInv { | |
722 | + | case legacyFactoryContract: Address => | |
723 | + | invoke(legacyFactoryContract, "emit", [emitLpAmt], nil) | |
724 | + | case _ => | |
725 | + | unit | |
726 | + | } | |
727 | + | if ((emitInvLegacy == emitInvLegacy)) | |
731 | 728 | then { | |
732 | - | let slpStakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)]) | |
733 | - | if ((slpStakeInv == slpStakeInv)) | |
734 | - | then nil | |
735 | - | else throw("Strict value is not equal to itself.") | |
736 | - | } | |
737 | - | else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)] | |
738 | - | let $t03211432179 = refreshKLpInternal(0, 0, 0) | |
739 | - | let refreshKLpActions = $t03211432179._1 | |
740 | - | let updatedKLp = $t03211432179._2 | |
741 | - | let amountAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) - amAssetPmt) | |
742 | - | let priceAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) - prAssetPmt) | |
743 | - | let lpAssetEmission = toBigInt(value(assetInfo(cfgLpAssetId)).quantity) | |
744 | - | let error = throwErr(makeString([toString(amountAssetBalance), toString(priceAssetBalance), toString(lpAssetEmission), toString(currentKLp), toString(updatedKLp)], " ")) | |
745 | - | if ((error == error)) | |
746 | - | then { | |
747 | - | let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp) | |
748 | - | if ((isUpdatedKLpValid == isUpdatedKLpValid)) | |
749 | - | then ((state ++ lpTransfer) ++ refreshKLpActions) | |
729 | + | let slippageAInv = if ((amDiff > 0)) | |
730 | + | then invoke(slippageContract, "put", nil, [AttachedPayment(amId, amDiff)]) | |
731 | + | else nil | |
732 | + | if ((slippageAInv == slippageAInv)) | |
733 | + | then { | |
734 | + | let slippagePInv = if ((prDiff > 0)) | |
735 | + | then invoke(slippageContract, "put", nil, [AttachedPayment(prId, prDiff)]) | |
736 | + | else nil | |
737 | + | if ((slippagePInv == slippagePInv)) | |
738 | + | then { | |
739 | + | let lpTransfer = if (shouldAutoStake) | |
740 | + | then { | |
741 | + | let slpStakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)]) | |
742 | + | if ((slpStakeInv == slpStakeInv)) | |
743 | + | then nil | |
744 | + | else throw("Strict value is not equal to itself.") | |
745 | + | } | |
746 | + | else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)] | |
747 | + | let $t03240732472 = refreshKLpInternal(0, 0, 0) | |
748 | + | let refreshKLpActions = $t03240732472._1 | |
749 | + | let updatedKLp = $t03240732472._2 | |
750 | + | let error = throwErr(makeString([toString(amountAssetBalance), toString(priceAssetBalance), toString(lpAssetEmission), toString(currentKLp), toString(updatedKLp)], " ")) | |
751 | + | if ((error == error)) | |
752 | + | then { | |
753 | + | let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp) | |
754 | + | if ((isUpdatedKLpValid == isUpdatedKLpValid)) | |
755 | + | then ((state ++ lpTransfer) ++ refreshKLpActions) | |
756 | + | else throw("Strict value is not equal to itself.") | |
757 | + | } | |
758 | + | else throw("Strict value is not equal to itself.") | |
759 | + | } | |
760 | + | else throw("Strict value is not equal to itself.") | |
761 | + | } | |
750 | 762 | else throw("Strict value is not equal to itself.") | |
751 | 763 | } | |
752 | 764 | else throw("Strict value is not equal to itself.") | |
753 | 765 | } | |
754 | 766 | else throw("Strict value is not equal to itself.") | |
755 | 767 | } | |
756 | 768 | else throw("Strict value is not equal to itself.") | |
757 | 769 | } | |
758 | 770 | else throw("Strict value is not equal to itself.") | |
759 | 771 | } | |
760 | 772 | else throw("Strict value is not equal to itself.") | |
761 | 773 | } | |
762 | 774 | else throw("Strict value is not equal to itself.") | |
763 | 775 | } | |
764 | 776 | ||
765 | 777 | ||
766 | 778 | ||
767 | 779 | @Callable(i) | |
768 | 780 | func putForFree (maxSlippage) = if ((0 > maxSlippage)) | |
769 | 781 | then throw("Invalid value passed") | |
770 | 782 | else { | |
771 | 783 | let estPut = commonPut(i, maxSlippage, false) | |
772 | 784 | let state = estPut._9 | |
773 | 785 | let amAssetPmt = toBigInt(value(i.payments[0]).amount) | |
774 | 786 | let prAssetPmt = toBigInt(value(i.payments[1]).amount) | |
775 | 787 | let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0)) | |
776 | 788 | if ((currentKLp == currentKLp)) | |
777 | 789 | then { | |
778 | - | let $ | |
779 | - | let refreshKLpActions = $ | |
780 | - | let updatedKLp = $ | |
790 | + | let $t03325333318 = refreshKLpInternal(0, 0, 0) | |
791 | + | let refreshKLpActions = $t03325333318._1 | |
792 | + | let updatedKLp = $t03325333318._2 | |
781 | 793 | let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp) | |
782 | 794 | if ((isUpdatedKLpValid == isUpdatedKLpValid)) | |
783 | 795 | then (state ++ refreshKLpActions) | |
784 | 796 | else throw("Strict value is not equal to itself.") | |
785 | 797 | } | |
786 | 798 | else throw("Strict value is not equal to itself.") | |
787 | 799 | } | |
788 | 800 | ||
789 | 801 | ||
790 | 802 | ||
791 | 803 | @Callable(i) | |
792 | 804 | func putOneTkn (minOutAmount,autoStake) = { | |
793 | 805 | let isPoolOneTokenOperationsDisabled = { | |
794 | 806 | let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
795 | 807 | if ($isInstanceOf(@, "Boolean")) | |
796 | 808 | then @ | |
797 | 809 | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
798 | 810 | } | |
799 | 811 | let isPutDisabled = if (if (if (isGlobalShutdown()) | |
800 | 812 | then true | |
801 | 813 | else (cfgPoolStatus == PoolPutDisabled)) | |
802 | 814 | then true | |
803 | 815 | else (cfgPoolStatus == PoolShutdown)) | |
804 | 816 | then true | |
805 | 817 | else isPoolOneTokenOperationsDisabled | |
806 | 818 | let checks = [if (if (!(isPutDisabled)) | |
807 | 819 | then true | |
808 | 820 | else isManager(i)) | |
809 | 821 | then true | |
810 | 822 | else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1)) | |
811 | 823 | then true | |
812 | 824 | else throwErr("exactly 1 payment are expected")] | |
813 | 825 | if ((checks == checks)) | |
814 | 826 | then { | |
815 | 827 | let payment = i.payments[0] | |
816 | 828 | let paymentAssetId = payment.assetId | |
817 | 829 | let paymentAmountRaw = payment.amount | |
818 | 830 | let currentKLp = if ((paymentAssetId == cfgAmountAssetId)) | |
819 | 831 | then calcCurrentKLp(toBigInt(paymentAmountRaw), toBigInt(0), toBigInt(0)) | |
820 | 832 | else if ((paymentAssetId == cfgPriceAssetId)) | |
821 | 833 | then calcCurrentKLp(toBigInt(0), toBigInt(paymentAmountRaw), toBigInt(0)) | |
822 | 834 | else throwErr("payment asset is not supported") | |
823 | 835 | let userAddress = i.caller | |
824 | 836 | let txId = i.transactionId | |
825 | - | let $ | |
826 | - | if (($ | |
837 | + | let $t03450334655 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId) | |
838 | + | if (($t03450334655 == $t03450334655)) | |
827 | 839 | then { | |
828 | - | let paymentInAmountAsset = $ | |
829 | - | let bonus = $ | |
830 | - | let feeAmount = $ | |
831 | - | let commonState = $ | |
832 | - | let emitAmountEstimated = $ | |
840 | + | let paymentInAmountAsset = $t03450334655._5 | |
841 | + | let bonus = $t03450334655._4 | |
842 | + | let feeAmount = $t03450334655._3 | |
843 | + | let commonState = $t03450334655._2 | |
844 | + | let emitAmountEstimated = $t03450334655._1 | |
833 | 845 | let emitAmount = if (if ((minOutAmount > 0)) | |
834 | 846 | then (minOutAmount > emitAmountEstimated) | |
835 | 847 | else false) | |
836 | 848 | then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], "")) | |
837 | 849 | else emitAmountEstimated | |
838 | 850 | let emitInv = emit(emitAmount) | |
839 | 851 | if ((emitInv == emitInv)) | |
840 | 852 | then { | |
841 | 853 | let lpTransfer = if (autoStake) | |
842 | 854 | then { | |
843 | 855 | let stakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(cfgLpAssetId, emitAmount)]) | |
844 | 856 | if ((stakeInv == stakeInv)) | |
845 | 857 | then nil | |
846 | 858 | else throw("Strict value is not equal to itself.") | |
847 | 859 | } | |
848 | 860 | else [ScriptTransfer(i.caller, emitAmount, cfgLpAssetId)] | |
849 | 861 | let sendFee = if ((feeAmount > 0)) | |
850 | 862 | then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)] | |
851 | 863 | else nil | |
852 | - | let $ | |
864 | + | let $t03524135438 = if ((this == feeCollectorAddress)) | |
853 | 865 | then $Tuple2(0, 0) | |
854 | 866 | else if (paymentInAmountAsset) | |
855 | 867 | then $Tuple2(-(feeAmount), 0) | |
856 | 868 | else $Tuple2(0, -(feeAmount)) | |
857 | - | let amountAssetBalanceDelta = $ | |
858 | - | let priceAssetBalanceDelta = $ | |
859 | - | let $ | |
860 | - | let refreshKLpActions = $ | |
861 | - | let updatedKLp = $ | |
869 | + | let amountAssetBalanceDelta = $t03524135438._1 | |
870 | + | let priceAssetBalanceDelta = $t03524135438._2 | |
871 | + | let $t03544135549 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0) | |
872 | + | let refreshKLpActions = $t03544135549._1 | |
873 | + | let updatedKLp = $t03544135549._2 | |
862 | 874 | let kLp = value(getString(keyKLp)) | |
863 | 875 | let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp) | |
864 | 876 | if ((isUpdatedKLpValid == isUpdatedKLpValid)) | |
865 | 877 | then $Tuple2((((commonState ++ lpTransfer) ++ sendFee) ++ refreshKLpActions), emitAmount) | |
866 | 878 | else throw("Strict value is not equal to itself.") | |
867 | 879 | } | |
868 | 880 | else throw("Strict value is not equal to itself.") | |
869 | 881 | } | |
870 | 882 | else throw("Strict value is not equal to itself.") | |
871 | 883 | } | |
872 | 884 | else throw("Strict value is not equal to itself.") | |
873 | 885 | } | |
874 | 886 | ||
875 | 887 | ||
876 | 888 | ||
877 | 889 | @Callable(i) | |
878 | 890 | func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = { | |
879 | - | let $ | |
880 | - | let emitAmountEstimated = $ | |
881 | - | let commonState = $ | |
882 | - | let feeAmount = $ | |
883 | - | let bonus = $ | |
884 | - | let paymentInAmountAsset = $ | |
891 | + | let $t03585536012 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit) | |
892 | + | let emitAmountEstimated = $t03585536012._1 | |
893 | + | let commonState = $t03585536012._2 | |
894 | + | let feeAmount = $t03585536012._3 | |
895 | + | let bonus = $t03585536012._4 | |
896 | + | let paymentInAmountAsset = $t03585536012._5 | |
885 | 897 | $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus)) | |
886 | 898 | } | |
887 | 899 | ||
888 | 900 | ||
889 | 901 | ||
890 | 902 | @Callable(i) | |
891 | 903 | func getOneTkn (outAssetIdStr,minOutAmount) = { | |
892 | 904 | let isPoolOneTokenOperationsDisabled = { | |
893 | 905 | let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
894 | 906 | if ($isInstanceOf(@, "Boolean")) | |
895 | 907 | then @ | |
896 | 908 | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
897 | 909 | } | |
898 | 910 | let isGetDisabled = if (if (isGlobalShutdown()) | |
899 | 911 | then true | |
900 | 912 | else (cfgPoolStatus == PoolShutdown)) | |
901 | 913 | then true | |
902 | 914 | else isPoolOneTokenOperationsDisabled | |
903 | 915 | let checks = [if (if (!(isGetDisabled)) | |
904 | 916 | then true | |
905 | 917 | else isManager(i)) | |
906 | 918 | then true | |
907 | 919 | else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1)) | |
908 | 920 | then true | |
909 | 921 | else throwErr("exactly 1 payment are expected")] | |
910 | 922 | if ((checks == checks)) | |
911 | 923 | then { | |
912 | 924 | let outAssetId = parseAssetId(outAssetIdStr) | |
913 | 925 | let payment = i.payments[0] | |
914 | 926 | let paymentAssetId = payment.assetId | |
915 | 927 | let paymentAmount = payment.amount | |
916 | 928 | let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(paymentAmount)) | |
917 | 929 | let userAddress = i.caller | |
918 | 930 | let txId = i.transactionId | |
919 | - | let $ | |
920 | - | if (($ | |
931 | + | let $t03690637059 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId) | |
932 | + | if (($t03690637059 == $t03690637059)) | |
921 | 933 | then { | |
922 | - | let outInAmountAsset = $ | |
923 | - | let bonus = $ | |
924 | - | let feeAmount = $ | |
925 | - | let commonState = $ | |
926 | - | let amountEstimated = $ | |
934 | + | let outInAmountAsset = $t03690637059._5 | |
935 | + | let bonus = $t03690637059._4 | |
936 | + | let feeAmount = $t03690637059._3 | |
937 | + | let commonState = $t03690637059._2 | |
938 | + | let amountEstimated = $t03690637059._1 | |
927 | 939 | let amount = if (if ((minOutAmount > 0)) | |
928 | 940 | then (minOutAmount > amountEstimated) | |
929 | 941 | else false) | |
930 | 942 | then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], "")) | |
931 | 943 | else amountEstimated | |
932 | 944 | let burnInv = invoke(factoryContract, "burn", [paymentAmount], [AttachedPayment(paymentAssetId, paymentAmount)]) | |
933 | 945 | if ((burnInv == burnInv)) | |
934 | 946 | then { | |
935 | 947 | let assetTransfer = [ScriptTransfer(userAddress, amount, outAssetId)] | |
936 | 948 | let sendFee = if ((feeAmount > 0)) | |
937 | 949 | then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)] | |
938 | 950 | else nil | |
939 | - | let $ | |
951 | + | let $t03755937806 = { | |
940 | 952 | let feeAmountForCalc = if ((this == feeCollectorAddress)) | |
941 | 953 | then 0 | |
942 | 954 | else feeAmount | |
943 | 955 | if (outInAmountAsset) | |
944 | 956 | then $Tuple2(-((amount + feeAmountForCalc)), 0) | |
945 | 957 | else $Tuple2(0, -((amount + feeAmountForCalc))) | |
946 | 958 | } | |
947 | - | let amountAssetBalanceDelta = $ | |
948 | - | let priceAssetBalanceDelta = $ | |
949 | - | let $ | |
950 | - | let refreshKLpActions = $ | |
951 | - | let updatedKLp = $ | |
959 | + | let amountAssetBalanceDelta = $t03755937806._1 | |
960 | + | let priceAssetBalanceDelta = $t03755937806._2 | |
961 | + | let $t03780937917 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0) | |
962 | + | let refreshKLpActions = $t03780937917._1 | |
963 | + | let updatedKLp = $t03780937917._2 | |
952 | 964 | let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp) | |
953 | 965 | if ((isUpdatedKLpValid == isUpdatedKLpValid)) | |
954 | 966 | then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount) | |
955 | 967 | else throw("Strict value is not equal to itself.") | |
956 | 968 | } | |
957 | 969 | else throw("Strict value is not equal to itself.") | |
958 | 970 | } | |
959 | 971 | else throw("Strict value is not equal to itself.") | |
960 | 972 | } | |
961 | 973 | else throw("Strict value is not equal to itself.") | |
962 | 974 | } | |
963 | 975 | ||
964 | 976 | ||
965 | 977 | ||
966 | 978 | @Callable(i) | |
967 | 979 | func getOneTknREADONLY (outAssetId,paymentAmount) = { | |
968 | - | let $ | |
969 | - | let amountEstimated = $ | |
970 | - | let commonState = $ | |
971 | - | let feeAmount = $ | |
972 | - | let bonus = $ | |
973 | - | let outInAmountAsset = $ | |
980 | + | let $t03817438330 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit) | |
981 | + | let amountEstimated = $t03817438330._1 | |
982 | + | let commonState = $t03817438330._2 | |
983 | + | let feeAmount = $t03817438330._3 | |
984 | + | let bonus = $t03817438330._4 | |
985 | + | let outInAmountAsset = $t03817438330._5 | |
974 | 986 | $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus)) | |
975 | 987 | } | |
976 | 988 | ||
977 | 989 | ||
978 | 990 | ||
979 | 991 | @Callable(i) | |
980 | 992 | func unstakeAndGetOneTkn (unstakeAmount,outAssetIdStr,minOutAmount) = { | |
981 | 993 | let isPoolOneTokenOperationsDisabled = { | |
982 | 994 | let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
983 | 995 | if ($isInstanceOf(@, "Boolean")) | |
984 | 996 | then @ | |
985 | 997 | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
986 | 998 | } | |
987 | 999 | let isGetDisabled = if (if (isGlobalShutdown()) | |
988 | 1000 | then true | |
989 | 1001 | else (cfgPoolStatus == PoolShutdown)) | |
990 | 1002 | then true | |
991 | 1003 | else isPoolOneTokenOperationsDisabled | |
992 | 1004 | let checks = [if (if (!(isGetDisabled)) | |
993 | 1005 | then true | |
994 | 1006 | else isManager(i)) | |
995 | 1007 | then true | |
996 | 1008 | else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 0)) | |
997 | 1009 | then true | |
998 | 1010 | else throwErr("no payments are expected")] | |
999 | 1011 | if ((checks == checks)) | |
1000 | 1012 | then { | |
1001 | 1013 | let outAssetId = parseAssetId(outAssetIdStr) | |
1002 | 1014 | let userAddress = i.caller | |
1003 | 1015 | let txId = i.transactionId | |
1004 | 1016 | let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1005 | 1017 | let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil) | |
1006 | 1018 | if ((unstakeInv == unstakeInv)) | |
1007 | 1019 | then { | |
1008 | - | let $ | |
1009 | - | if (($ | |
1020 | + | let $t03923239383 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId) | |
1021 | + | if (($t03923239383 == $t03923239383)) | |
1010 | 1022 | then { | |
1011 | - | let outInAmountAsset = $ | |
1012 | - | let bonus = $ | |
1013 | - | let feeAmount = $ | |
1014 | - | let commonState = $ | |
1015 | - | let amountEstimated = $ | |
1023 | + | let outInAmountAsset = $t03923239383._5 | |
1024 | + | let bonus = $t03923239383._4 | |
1025 | + | let feeAmount = $t03923239383._3 | |
1026 | + | let commonState = $t03923239383._2 | |
1027 | + | let amountEstimated = $t03923239383._1 | |
1016 | 1028 | let amount = if (if ((minOutAmount > 0)) | |
1017 | 1029 | then (minOutAmount > amountEstimated) | |
1018 | 1030 | else false) | |
1019 | 1031 | then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], "")) | |
1020 | 1032 | else amountEstimated | |
1021 | 1033 | let burnInv = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)]) | |
1022 | 1034 | if ((burnInv == burnInv)) | |
1023 | 1035 | then { | |
1024 | 1036 | let assetTransfer = [ScriptTransfer(i.caller, amount, outAssetId)] | |
1025 | 1037 | let sendFee = if ((feeAmount > 0)) | |
1026 | 1038 | then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)] | |
1027 | 1039 | else nil | |
1028 | - | let $ | |
1040 | + | let $t03987840125 = { | |
1029 | 1041 | let feeAmountForCalc = if ((this == feeCollectorAddress)) | |
1030 | 1042 | then 0 | |
1031 | 1043 | else feeAmount | |
1032 | 1044 | if (outInAmountAsset) | |
1033 | 1045 | then $Tuple2(-((amount + feeAmountForCalc)), 0) | |
1034 | 1046 | else $Tuple2(0, -((amount + feeAmountForCalc))) | |
1035 | 1047 | } | |
1036 | - | let amountAssetBalanceDelta = $ | |
1037 | - | let priceAssetBalanceDelta = $ | |
1038 | - | let $ | |
1039 | - | let refreshKLpActions = $ | |
1040 | - | let updatedKLp = $ | |
1048 | + | let amountAssetBalanceDelta = $t03987840125._1 | |
1049 | + | let priceAssetBalanceDelta = $t03987840125._2 | |
1050 | + | let $t04012840236 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0) | |
1051 | + | let refreshKLpActions = $t04012840236._1 | |
1052 | + | let updatedKLp = $t04012840236._2 | |
1041 | 1053 | let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp) | |
1042 | 1054 | if ((isUpdatedKLpValid == isUpdatedKLpValid)) | |
1043 | 1055 | then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount) | |
1044 | 1056 | else throw("Strict value is not equal to itself.") | |
1045 | 1057 | } | |
1046 | 1058 | else throw("Strict value is not equal to itself.") | |
1047 | 1059 | } | |
1048 | 1060 | else throw("Strict value is not equal to itself.") | |
1049 | 1061 | } | |
1050 | 1062 | else throw("Strict value is not equal to itself.") | |
1051 | 1063 | } | |
1052 | 1064 | else throw("Strict value is not equal to itself.") | |
1053 | 1065 | } | |
1054 | 1066 | ||
1055 | 1067 | ||
1056 | 1068 | ||
1057 | 1069 | @Callable(i) | |
1058 | 1070 | func get () = { | |
1059 | 1071 | let res = commonGet(i) | |
1060 | 1072 | let outAmtAmt = res._1 | |
1061 | 1073 | let outPrAmt = res._2 | |
1062 | 1074 | let pmtAmt = res._3 | |
1063 | 1075 | let pmtAssetId = res._4 | |
1064 | 1076 | let state = res._5 | |
1065 | 1077 | let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(pmtAmt)) | |
1066 | 1078 | let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
1067 | 1079 | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
1068 | 1080 | then { | |
1069 | - | let $ | |
1070 | - | let refreshKLpActions = $ | |
1071 | - | let updatedKLp = $ | |
1081 | + | let $t04118441266 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0) | |
1082 | + | let refreshKLpActions = $t04118441266._1 | |
1083 | + | let updatedKLp = $t04118441266._2 | |
1072 | 1084 | let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp) | |
1073 | 1085 | if ((isUpdatedKLpValid == isUpdatedKLpValid)) | |
1074 | 1086 | then (state ++ refreshKLpActions) | |
1075 | 1087 | else throw("Strict value is not equal to itself.") | |
1076 | 1088 | } | |
1077 | 1089 | else throw("Strict value is not equal to itself.") | |
1078 | 1090 | } | |
1079 | 1091 | ||
1080 | 1092 | ||
1081 | 1093 | ||
1082 | 1094 | @Callable(i) | |
1083 | 1095 | func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = { | |
1084 | 1096 | let res = commonGet(i) | |
1085 | 1097 | let outAmAmt = res._1 | |
1086 | 1098 | let outPrAmt = res._2 | |
1087 | 1099 | let pmtAmt = res._3 | |
1088 | 1100 | let pmtAssetId = res._4 | |
1089 | 1101 | let state = res._5 | |
1090 | 1102 | if ((noLessThenAmtAsset > outAmAmt)) | |
1091 | 1103 | then throw(((("noLessThenAmtAsset failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset))) | |
1092 | 1104 | else if ((noLessThenPriceAsset > outPrAmt)) | |
1093 | 1105 | then throw(((("noLessThenPriceAsset failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset))) | |
1094 | 1106 | else { | |
1095 | 1107 | let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(pmtAmt)) | |
1096 | 1108 | let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
1097 | 1109 | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
1098 | 1110 | then { | |
1099 | - | let $ | |
1100 | - | let refreshKLpActions = $ | |
1101 | - | let updatedKLp = $ | |
1111 | + | let $t04221742298 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0) | |
1112 | + | let refreshKLpActions = $t04221742298._1 | |
1113 | + | let updatedKLp = $t04221742298._2 | |
1102 | 1114 | let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp) | |
1103 | 1115 | if ((isUpdatedKLpValid == isUpdatedKLpValid)) | |
1104 | 1116 | then (state ++ refreshKLpActions) | |
1105 | 1117 | else throw("Strict value is not equal to itself.") | |
1106 | 1118 | } | |
1107 | 1119 | else throw("Strict value is not equal to itself.") | |
1108 | 1120 | } | |
1109 | 1121 | } | |
1110 | 1122 | ||
1111 | 1123 | ||
1112 | 1124 | ||
1113 | 1125 | @Callable(i) | |
1114 | 1126 | func unstakeAndGet (amount) = { | |
1115 | 1127 | let checkPayments = if ((size(i.payments) != 0)) | |
1116 | 1128 | then throw("No payments are expected") | |
1117 | 1129 | else true | |
1118 | 1130 | if ((checkPayments == checkPayments)) | |
1119 | 1131 | then { | |
1120 | 1132 | let cfg = getPoolConfig() | |
1121 | 1133 | let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId]) | |
1122 | 1134 | let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1123 | 1135 | let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(lpAssetId), amount], nil) | |
1124 | 1136 | if ((unstakeInv == unstakeInv)) | |
1125 | 1137 | then { | |
1126 | 1138 | let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller) | |
1127 | 1139 | let outAmAmt = res._1 | |
1128 | 1140 | let outPrAmt = res._2 | |
1129 | 1141 | let poolStatus = parseIntValue(res._9) | |
1130 | 1142 | let state = res._10 | |
1131 | 1143 | let checkPoolStatus = if (if (isGlobalShutdown()) | |
1132 | 1144 | then true | |
1133 | 1145 | else (poolStatus == PoolShutdown)) | |
1134 | 1146 | then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus))) | |
1135 | 1147 | else true | |
1136 | 1148 | if ((checkPoolStatus == checkPoolStatus)) | |
1137 | 1149 | then { | |
1138 | 1150 | let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)]) | |
1139 | 1151 | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
1140 | 1152 | then { | |
1141 | - | let $ | |
1142 | - | let refreshKLpActions = $ | |
1143 | - | let updatedKLp = $ | |
1153 | + | let $t04342143502 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0) | |
1154 | + | let refreshKLpActions = $t04342143502._1 | |
1155 | + | let updatedKLp = $t04342143502._2 | |
1144 | 1156 | let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp) | |
1145 | 1157 | if ((isUpdatedKLpValid == isUpdatedKLpValid)) | |
1146 | 1158 | then (state ++ refreshKLpActions) | |
1147 | 1159 | else throw("Strict value is not equal to itself.") | |
1148 | 1160 | } | |
1149 | 1161 | else throw("Strict value is not equal to itself.") | |
1150 | 1162 | } | |
1151 | 1163 | else throw("Strict value is not equal to itself.") | |
1152 | 1164 | } | |
1153 | 1165 | else throw("Strict value is not equal to itself.") | |
1154 | 1166 | } | |
1155 | 1167 | else throw("Strict value is not equal to itself.") | |
1156 | 1168 | } | |
1157 | 1169 | ||
1158 | 1170 | ||
1159 | 1171 | ||
1160 | 1172 | @Callable(i) | |
1161 | 1173 | func unstakeAndGetNoLess (unstakeAmount,noLessThenAmountAsset,noLessThenPriceAsset) = { | |
1162 | 1174 | let isGetDisabled = if (isGlobalShutdown()) | |
1163 | 1175 | then true | |
1164 | 1176 | else (cfgPoolStatus == PoolShutdown) | |
1165 | 1177 | let checks = [if (!(isGetDisabled)) | |
1166 | 1178 | then true | |
1167 | 1179 | else throw("get operation is blocked by admin"), if ((size(i.payments) == 0)) | |
1168 | 1180 | then true | |
1169 | 1181 | else throw("no payments are expected")] | |
1170 | 1182 | if ((checks == checks)) | |
1171 | 1183 | then { | |
1172 | 1184 | let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1173 | 1185 | let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil) | |
1174 | 1186 | if ((unstakeInv == unstakeInv)) | |
1175 | 1187 | then { | |
1176 | 1188 | let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller) | |
1177 | 1189 | let outAmAmt = res._1 | |
1178 | 1190 | let outPrAmt = res._2 | |
1179 | 1191 | let state = res._10 | |
1180 | 1192 | let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset)) | |
1181 | 1193 | then true | |
1182 | 1194 | else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset)) | |
1183 | 1195 | then true | |
1184 | 1196 | else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))] | |
1185 | 1197 | if ((checkAmounts == checkAmounts)) | |
1186 | 1198 | then { | |
1187 | 1199 | let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)]) | |
1188 | 1200 | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
1189 | 1201 | then { | |
1190 | - | let $ | |
1191 | - | let refreshKLpActions = $ | |
1192 | - | let updatedKLp = $ | |
1202 | + | let $t04479444875 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0) | |
1203 | + | let refreshKLpActions = $t04479444875._1 | |
1204 | + | let updatedKLp = $t04479444875._2 | |
1193 | 1205 | let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp) | |
1194 | 1206 | if ((isUpdatedKLpValid == isUpdatedKLpValid)) | |
1195 | 1207 | then (state ++ refreshKLpActions) | |
1196 | 1208 | else throw("Strict value is not equal to itself.") | |
1197 | 1209 | } | |
1198 | 1210 | else throw("Strict value is not equal to itself.") | |
1199 | 1211 | } | |
1200 | 1212 | else throw("Strict value is not equal to itself.") | |
1201 | 1213 | } | |
1202 | 1214 | else throw("Strict value is not equal to itself.") | |
1203 | 1215 | } | |
1204 | 1216 | else throw("Strict value is not equal to itself.") | |
1205 | 1217 | } | |
1206 | 1218 | ||
1207 | 1219 | ||
1208 | 1220 | ||
1209 | 1221 | @Callable(i) | |
1210 | 1222 | func activate (amtAssetStr,priceAssetStr) = if ((toString(i.caller) != toString(factoryContract))) | |
1211 | 1223 | then throw("permissions denied") | |
1212 | 1224 | else $Tuple2([StringEntry(aa(), amtAssetStr), StringEntry(pa(), priceAssetStr)], "success") | |
1213 | 1225 | ||
1214 | 1226 | ||
1215 | 1227 | ||
1216 | 1228 | @Callable(i) | |
1217 | 1229 | func refreshKLp () = { | |
1218 | 1230 | let lastRefreshedBlockHeight = valueOrElse(getInteger(keyKLpRefreshedHeight), 0) | |
1219 | 1231 | let checkLastRefreshedBlockHeight = if (((height - lastRefreshedBlockHeight) >= kLpRefreshDelay)) | |
1220 | 1232 | then unit | |
1221 | 1233 | else throwErr(makeString([toString(kLpRefreshDelay), " blocks have not passed since the previous call"], "")) | |
1222 | 1234 | if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight)) | |
1223 | 1235 | then { | |
1224 | 1236 | let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp")) | |
1225 | - | let $ | |
1226 | - | let kLpUpdateActions = $ | |
1227 | - | let updatedKLp = $ | |
1237 | + | let $t04606246126 = refreshKLpInternal(0, 0, 0) | |
1238 | + | let kLpUpdateActions = $t04606246126._1 | |
1239 | + | let updatedKLp = $t04606246126._2 | |
1228 | 1240 | let actions = if ((kLp != updatedKLp)) | |
1229 | 1241 | then kLpUpdateActions | |
1230 | 1242 | else throwErr("nothing to refresh") | |
1231 | 1243 | $Tuple2(actions, toString(updatedKLp)) | |
1232 | 1244 | } | |
1233 | 1245 | else throw("Strict value is not equal to itself.") | |
1234 | 1246 | } | |
1235 | 1247 | ||
1236 | 1248 | ||
1237 | 1249 | ||
1238 | 1250 | @Callable(i) | |
1239 | 1251 | func getPoolConfigWrapperREADONLY () = $Tuple2(nil, getPoolConfig()) | |
1240 | 1252 | ||
1241 | 1253 | ||
1242 | 1254 | ||
1243 | 1255 | @Callable(i) | |
1244 | 1256 | func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId)) | |
1245 | 1257 | ||
1246 | 1258 | ||
1247 | 1259 | ||
1248 | 1260 | @Callable(i) | |
1249 | 1261 | func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = { | |
1250 | 1262 | let prices = calcPrices(amAmt, prAmt, lpAmt) | |
1251 | 1263 | $Tuple2(nil, [toString(prices[0]), toString(prices[1]), toString(prices[2])]) | |
1252 | 1264 | } | |
1253 | 1265 | ||
1254 | 1266 | ||
1255 | 1267 | ||
1256 | 1268 | @Callable(i) | |
1257 | 1269 | func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(toX18(origVal, origScaleMult))) | |
1258 | 1270 | ||
1259 | 1271 | ||
1260 | 1272 | ||
1261 | 1273 | @Callable(i) | |
1262 | 1274 | func fromX18WrapperREADONLY (val,resultScaleMult) = $Tuple2(nil, fromX18(parseBigIntValue(val), resultScaleMult)) | |
1263 | 1275 | ||
1264 | 1276 | ||
1265 | 1277 | ||
1266 | 1278 | @Callable(i) | |
1267 | 1279 | func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(calcPriceBigInt(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18)))) | |
1268 | 1280 | ||
1269 | 1281 | ||
1270 | 1282 | ||
1271 | 1283 | @Callable(i) | |
1272 | 1284 | func estimatePutOperationWrapperREADONLY (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = $Tuple2(nil, estimatePutOperation(txId58, slippageTolerance, inAmAssetAmt, inAmAssetId, inPrAssetAmt, inPrAssetId, userAddress, isEvaluate, emitLp)) | |
1273 | 1285 | ||
1274 | 1286 | ||
1275 | 1287 | ||
1276 | 1288 | @Callable(i) | |
1277 | 1289 | func estimateGetOperationWrapperREADONLY (txId58,pmtAssetId,pmtLpAmt,userAddress) = { | |
1278 | 1290 | let res = estimateGetOperation(txId58, pmtAssetId, pmtLpAmt, addressFromStringValue(userAddress)) | |
1279 | 1291 | $Tuple2(nil, $Tuple10(res._1, res._2, res._3, res._4, res._5, res._6, res._7, toString(res._8), res._9, res._10)) | |
1280 | 1292 | } | |
1281 | 1293 | ||
1282 | 1294 | ||
1283 | 1295 | ||
1284 | 1296 | @Callable(i) | |
1285 | 1297 | func statsREADONLY () = { | |
1286 | 1298 | let cfg = getPoolConfig() | |
1287 | 1299 | let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId]) | |
1288 | 1300 | let amtAssetId = cfg[idxAmtAssetId] | |
1289 | 1301 | let priceAssetId = cfg[idxPriceAssetId] | |
1290 | 1302 | let iAmtAssetId = cfg[idxIAmtAssetId] | |
1291 | 1303 | let iPriceAssetId = cfg[idxIPriceAssetId] | |
1292 | 1304 | let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm]) | |
1293 | 1305 | let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm]) | |
1294 | 1306 | let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity | |
1295 | 1307 | let accAmtAssetBalance = getAccBalance(amtAssetId) | |
1296 | 1308 | let accPriceAssetBalance = getAccBalance(priceAssetId) | |
1297 | 1309 | let pricesList = if ((poolLPBalance == 0)) | |
1298 | 1310 | then [zeroBigInt, zeroBigInt, zeroBigInt] | |
1299 | 1311 | else calcPrices(accAmtAssetBalance, accPriceAssetBalance, poolLPBalance) | |
1300 | 1312 | let curPrice = 0 | |
1301 | 1313 | let lpAmtAssetShare = fromX18(pricesList[1], scale8) | |
1302 | 1314 | let lpPriceAssetShare = fromX18(pricesList[2], scale8) | |
1303 | 1315 | let poolWeight = value(getInteger(factoryContract, keyPoolWeight(toString(this)))) | |
1304 | 1316 | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d", toString(accAmtAssetBalance), toString(accPriceAssetBalance), toString(poolLPBalance), toString(curPrice), toString(lpAmtAssetShare), toString(lpPriceAssetShare), toString(poolWeight)], SEP)) | |
1305 | 1317 | } | |
1306 | 1318 | ||
1307 | 1319 | ||
1308 | 1320 | ||
1309 | 1321 | @Callable(i) | |
1310 | 1322 | func evaluatePutByAmountAssetREADONLY (inAmAssetAmt) = { | |
1311 | 1323 | let cfg = getPoolConfig() | |
1312 | 1324 | let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId]) | |
1313 | 1325 | let amAssetIdStr = cfg[idxAmtAssetId] | |
1314 | 1326 | let amAssetId = fromBase58String(amAssetIdStr) | |
1315 | 1327 | let prAssetIdStr = cfg[idxPriceAssetId] | |
1316 | 1328 | let prAssetId = fromBase58String(prAssetIdStr) | |
1317 | 1329 | let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm]) | |
1318 | 1330 | let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm]) | |
1319 | 1331 | let poolStatus = cfg[idxPoolStatus] | |
1320 | 1332 | let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity | |
1321 | 1333 | let accAmtAssetBalance = getAccBalance(amAssetIdStr) | |
1322 | 1334 | let accPriceAssetBalance = getAccBalance(prAssetIdStr) | |
1323 | 1335 | let amtAssetAmtX18 = toX18(accAmtAssetBalance, amtAssetDcm) | |
1324 | 1336 | let priceAssetAmtX18 = toX18(accPriceAssetBalance, priceAssetDcm) | |
1325 | 1337 | let curPriceX18 = if ((poolLPBalance == 0)) | |
1326 | 1338 | then zeroBigInt | |
1327 | 1339 | else calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18) | |
1328 | 1340 | let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm) | |
1329 | 1341 | let inPrAssetAmtX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18) | |
1330 | 1342 | let inPrAssetAmt = fromX18(inPrAssetAmtX18, priceAssetDcm) | |
1331 | 1343 | let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false) | |
1332 | 1344 | let calcLpAmt = estPut._1 | |
1333 | 1345 | let curPriceCalc = estPut._3 | |
1334 | 1346 | let amBalance = estPut._4 | |
1335 | 1347 | let prBalance = estPut._5 | |
1336 | 1348 | let lpEmission = estPut._6 | |
1337 | 1349 | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d", toString(calcLpAmt), toString(fromX18(curPriceX18, scale8)), toString(amBalance), toString(prBalance), toString(lpEmission), poolStatus, toString(inAmAssetAmt), toString(inPrAssetAmt)], SEP)) | |
1338 | 1350 | } | |
1339 | 1351 | ||
1340 | 1352 | ||
1341 | 1353 | ||
1342 | 1354 | @Callable(i) | |
1343 | 1355 | func evaluatePutByPriceAssetREADONLY (inPrAssetAmt) = { | |
1344 | 1356 | let cfg = getPoolConfig() | |
1345 | 1357 | let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId]) | |
1346 | 1358 | let amAssetIdStr = cfg[idxAmtAssetId] | |
1347 | 1359 | let amAssetId = fromBase58String(amAssetIdStr) | |
1348 | 1360 | let prAssetIdStr = cfg[idxPriceAssetId] | |
1349 | 1361 | let prAssetId = fromBase58String(prAssetIdStr) | |
1350 | 1362 | let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm]) | |
1351 | 1363 | let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm]) | |
1352 | 1364 | let poolStatus = cfg[idxPoolStatus] | |
1353 | 1365 | let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity | |
1354 | 1366 | let amBalanceRaw = getAccBalance(amAssetIdStr) | |
1355 | 1367 | let prBalanceRaw = getAccBalance(prAssetIdStr) | |
1356 | 1368 | let amBalanceRawX18 = toX18(amBalanceRaw, amtAssetDcm) | |
1357 | 1369 | let prBalanceRawX18 = toX18(prBalanceRaw, priceAssetDcm) | |
1358 | 1370 | let curPriceX18 = if ((poolLPBalance == 0)) | |
1359 | 1371 | then zeroBigInt | |
1360 | 1372 | else calcPriceBigInt(prBalanceRawX18, amBalanceRawX18) | |
1361 | 1373 | let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm) | |
1362 | 1374 | let inAmAssetAmtX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18) | |
1363 | 1375 | let inAmAssetAmt = fromX18(inAmAssetAmtX18, amtAssetDcm) | |
1364 | 1376 | let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false) | |
1365 | 1377 | let calcLpAmt = estPut._1 | |
1366 | 1378 | let curPriceCalc = estPut._3 | |
1367 | 1379 | let amBalance = estPut._4 | |
1368 | 1380 | let prBalance = estPut._5 | |
1369 | 1381 | let lpEmission = estPut._6 | |
1370 | 1382 | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d", toString(calcLpAmt), toString(fromX18(curPriceX18, scale8)), toString(amBalance), toString(prBalance), toString(lpEmission), poolStatus, toString(inAmAssetAmt), toString(inPrAssetAmt)], SEP)) | |
1371 | 1383 | } | |
1372 | 1384 | ||
1373 | 1385 | ||
1374 | 1386 | ||
1375 | 1387 | @Callable(i) | |
1376 | 1388 | func evaluateGetREADONLY (paymentLpAssetId,paymentLpAmt) = { | |
1377 | 1389 | let res = estimateGetOperation("", paymentLpAssetId, paymentLpAmt, this) | |
1378 | 1390 | let outAmAmt = res._1 | |
1379 | 1391 | let outPrAmt = res._2 | |
1380 | 1392 | let amBalance = res._5 | |
1381 | 1393 | let prBalance = res._6 | |
1382 | 1394 | let lpEmission = res._7 | |
1383 | 1395 | let curPrice = res._8 | |
1384 | 1396 | let poolStatus = parseIntValue(res._9) | |
1385 | 1397 | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d", toString(outAmAmt), toString(outPrAmt), toString(amBalance), toString(prBalance), toString(lpEmission), toString(curPrice), toString(poolStatus)], SEP)) | |
1386 | 1398 | } | |
1387 | 1399 | ||
1388 | 1400 | ||
1389 | 1401 | @Verifier(tx) | |
1390 | 1402 | func verify () = { | |
1391 | 1403 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
1392 | 1404 | case pk: ByteVector => | |
1393 | 1405 | pk | |
1394 | 1406 | case _: Unit => | |
1395 | 1407 | tx.senderPublicKey | |
1396 | 1408 | case _ => | |
1397 | 1409 | throw("Match error") | |
1398 | 1410 | } | |
1399 | 1411 | match tx { | |
1400 | 1412 | case order: Order => | |
1401 | 1413 | let matcherPub = getMatcherPubOrFail() | |
1402 | 1414 | let orderValid = validateMatcherOrderAllowed(order) | |
1403 | 1415 | let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey) | |
1404 | 1416 | let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub) | |
1405 | 1417 | if (if (if (orderValid) | |
1406 | 1418 | then senderValid | |
1407 | 1419 | else false) | |
1408 | 1420 | then matcherValid | |
1409 | 1421 | else false) | |
1410 | 1422 | then true | |
1411 | 1423 | else throwOrderError(orderValid, senderValid, matcherValid) | |
1412 | 1424 | case s: SetScriptTransaction => | |
1413 | 1425 | let newHash = blake2b256(value(s.script)) | |
1414 | 1426 | let allowedHash = fromBase64String(value(getString(factoryContract, keyAllowedLpScriptHash()))) | |
1415 | 1427 | let currentHash = scriptHash(this) | |
1416 | 1428 | if (if ((allowedHash == newHash)) | |
1417 | 1429 | then (currentHash != newHash) | |
1418 | 1430 | else false) | |
1419 | 1431 | then true | |
1420 | 1432 | else sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
1421 | 1433 | case _ => | |
1422 | 1434 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
1423 | 1435 | } | |
1424 | 1436 | } | |
1425 | 1437 |
github/deemru/w8io/026f985 154.71 ms ◑