tx · CJ3TF2ncnaGaD7kABpBAmsHxh74RyPsSus7TuSwpwcgP 3MuCofTkjmv397dEuRXE3pZxTb4zDWa96uo: -0.06000000 Waves 2022.09.21 12:59 [2238744] smart account 3MuCofTkjmv397dEuRXE3pZxTb4zDWa96uo > SELF 0.00000000 Waves
{ "type": 13, "id": "CJ3TF2ncnaGaD7kABpBAmsHxh74RyPsSus7TuSwpwcgP", "fee": 6000000, "feeAssetId": null, "timestamp": 1663754394993, "version": 2, "chainId": 84, "sender": "3MuCofTkjmv397dEuRXE3pZxTb4zDWa96uo", "senderPublicKey": "HGKkqEdKKPVXHMq25FyB6nm1kyvrixu1a8Av6wc9t5CG", "proofs": [ "2kQzMTpQg8HjSX1kGwuecSFj9oYSSV1UST8wdFZ1FDTXssTUqpiUe6YVrd6jgys7aUwbvR8WmqYxd8tq5MetGjTP" ], "script": "base64:BgJvCAISABIAEgMKAQESAwoBARILCgkBAQEBAQEBAQESEAoOAQEBAQEBAQgICAEBAQESAwoBARIFCgMBAQESBgoEAQEBCBIAEgMKAQESABIDCgEIEgASBAoCCAESAwoBARIDCgEIEgMKAQgSAwoBARIAiAEACWtfb3JhX2tleQIJa19vcmFfa2V5AA9rX29yYV9ibG9ja19rZXkCD2tfb3JhX2Jsb2NrX2tleQAFa19vcmECBWtfb3JhAAlrX2JhbGFuY2UCCWtfYmFsYW5jZQAOa19wb3NpdGlvblNpemUCDmtfcG9zaXRpb25TaXplABBrX3Bvc2l0aW9uTWFyZ2luAhBrX3Bvc2l0aW9uTWFyZ2luABZrX3Bvc2l0aW9uT3Blbk5vdGlvbmFsAhZrX3Bvc2l0aW9uT3Blbk5vdGlvbmFsAC5rX3Bvc2l0aW9uTGFzdFVwZGF0ZWRDdW11bGF0aXZlUHJlbWl1bUZyYWN0aW9uAhJrX3Bvc2l0aW9uRnJhY3Rpb24AFGtfcG9zaXRpb25DbG9zZWREYXRlAhRrX3Bvc2l0aW9uQ2xvc2VkRGF0ZQANa19pbml0aWFsaXplZAIN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kAgUUc2hvcnRQcmVtaXVtRnJhY3Rpb24FD3VuZGVybHlpbmdQcmljZQkAAgEJAKwCAgkBAXMBBQtsb25nRnVuZGluZwkBAXMBBQxzaG9ydEZ1bmRpbmcBAnR4AQZ2ZXJpZnkACQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACQEOYWRtaW5QdWJsaWNLZXkAOgg+lg==", "height": 2238744, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: J68PxUYPz47WL64ij5ehnSXvWJfSUBa2YgGmV3WV9bud Next: 7rWVsYp68MHdRkwTSJofPtbk9x3zucckaQywP5rD5kTA Diff:
Old | New | Differences | |
---|---|---|---|
596 | 596 | } | |
597 | 597 | ||
598 | 598 | ||
599 | + | func getFunding () = { | |
600 | + | let underlyingPrice = getOracleTwapPrice() | |
601 | + | let spotTwapPrice = getTwapSpotPrice() | |
602 | + | let premium = (spotTwapPrice - underlyingPrice) | |
603 | + | if (if ((totalShortPositionSize() == 0)) | |
604 | + | then true | |
605 | + | else (totalLongPositionSize() == 0)) | |
606 | + | then $Tuple2(0, 0) | |
607 | + | else if ((0 > premium)) | |
608 | + | then { | |
609 | + | let shortPremiumFraction = divd(muld(premium, fundingPeriodDecimal()), ONE_DAY) | |
610 | + | let longPremiumFraction = divd(muld(shortPremiumFraction, totalShortPositionSize()), totalLongPositionSize()) | |
611 | + | $Tuple2(shortPremiumFraction, longPremiumFraction) | |
612 | + | } | |
613 | + | else { | |
614 | + | let longPremiumFraction = divd(muld(premium, fundingPeriodDecimal()), ONE_DAY) | |
615 | + | let shortPremiumFraction = divd(muld(longPremiumFraction, totalLongPositionSize()), totalShortPositionSize()) | |
616 | + | $Tuple2(shortPremiumFraction, longPremiumFraction) | |
617 | + | } | |
618 | + | } | |
619 | + | ||
620 | + | ||
599 | 621 | func updateSettings (_initMarginRatio,_mmr,_liquidationFeeRatio,_fundingPeriod,_fee,_spreadLimit,_maxPriceImpact,_partialLiquidationRatio,_maxPriceSpread) = [IntegerEntry(k_initMarginRatio, _initMarginRatio), IntegerEntry(k_maintenanceMarginRatio, _mmr), IntegerEntry(k_liquidationFeeRatio, _liquidationFeeRatio), IntegerEntry(k_fundingPeriod, _fundingPeriod), IntegerEntry(k_fee, _fee), IntegerEntry(k_spreadLimit, _spreadLimit), IntegerEntry(k_maxPriceImpact, _maxPriceImpact), IntegerEntry(k_partialLiquidationRatio, _partialLiquidationRatio), IntegerEntry(k_maxPriceSpread, _maxPriceSpread)] | |
600 | 622 | ||
601 | 623 | ||
765 | 787 | else paused()) | |
766 | 788 | then throw("Invalid decreasePosition parameters") | |
767 | 789 | else { | |
768 | - | let $ | |
769 | - | let oldPositionSize = $ | |
770 | - | let oldPositionMargin = $ | |
771 | - | let oldPositionOpenNotional = $ | |
772 | - | let oldPositionLstUpdCPF = $ | |
790 | + | let $t03733137483 = getPosition(toString(i.caller)) | |
791 | + | let oldPositionSize = $t03733137483._1 | |
792 | + | let oldPositionMargin = $t03733137483._2 | |
793 | + | let oldPositionOpenNotional = $t03733137483._3 | |
794 | + | let oldPositionLstUpdCPF = $t03733137483._4 | |
773 | 795 | let _direction = if ((oldPositionSize > 0)) | |
774 | 796 | then DIR_SHORT | |
775 | 797 | else DIR_LONG | |
776 | 798 | let isAdd = (_direction == DIR_LONG) | |
777 | 799 | let openNotional = muld(_amount, _leverage) | |
778 | - | let $ | |
779 | - | let oldPositionNotional = $ | |
780 | - | let unrealizedPnl = $ | |
781 | - | let $ | |
800 | + | let $t03765637772 = getPositionNotionalAndUnrealizedPnl(toString(i.caller), PNL_OPTION_SPOT) | |
801 | + | let oldPositionNotional = $t03765637772._1 | |
802 | + | let unrealizedPnl = $t03765637772._2 | |
803 | + | let $t03777840327 = if ((oldPositionNotional > openNotional)) | |
782 | 804 | then { | |
783 | - | let $ | |
784 | - | let exchangedPositionSize = $ | |
785 | - | let quoteAssetReserveAfter = $ | |
786 | - | let baseAssetReserveAfter = $ | |
787 | - | let totalPositionSizeAfter = $ | |
788 | - | let cumulativeNotionalAfter = $ | |
805 | + | let $t03815538374 = swapInput(isAdd, openNotional) | |
806 | + | let exchangedPositionSize = $t03815538374._1 | |
807 | + | let quoteAssetReserveAfter = $t03815538374._2 | |
808 | + | let baseAssetReserveAfter = $t03815538374._3 | |
809 | + | let totalPositionSizeAfter = $t03815538374._4 | |
810 | + | let cumulativeNotionalAfter = $t03815538374._5 | |
789 | 811 | let exchangedPositionSizeAbs = abs(exchangedPositionSize) | |
790 | 812 | if (if ((_minBaseAssetAmount != 0)) | |
791 | 813 | then (_minBaseAssetAmount > exchangedPositionSizeAbs) | |
793 | 815 | then throw(((("Too little base asset exchanged, got " + toString(exchangedPositionSizeAbs)) + " expected ") + toString(_minBaseAssetAmount))) | |
794 | 816 | else { | |
795 | 817 | let realizedPnl = divd(muld(unrealizedPnl, exchangedPositionSizeAbs), abs(oldPositionSize)) | |
796 | - | let $ | |
797 | - | let remainMargin = $ | |
798 | - | let badDebt = $ | |
799 | - | let fundingPayment = $ | |
818 | + | let $t03881139056 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, realizedPnl) | |
819 | + | let remainMargin = $t03881139056._1 | |
820 | + | let badDebt = $t03881139056._2 | |
821 | + | let fundingPayment = $t03881139056._3 | |
800 | 822 | let exchangedQuoteAssetAmount = openNotional | |
801 | 823 | let unrealizedPnlAfter = (unrealizedPnl - realizedPnl) | |
802 | 824 | let remainOpenNotional = if ((oldPositionSize > 0)) | |
811 | 833 | } | |
812 | 834 | } | |
813 | 835 | else throw("Close position first") | |
814 | - | let newPositionSize = $ | |
815 | - | let newPositionRemainMargin = $ | |
816 | - | let newPositionOpenNotional = $ | |
817 | - | let newPositionLatestCPF = $ | |
818 | - | let baseAssetReserveAfter = $ | |
819 | - | let quoteAssetReserveAfter = $ | |
820 | - | let totalPositionSizeAfter = $ | |
821 | - | let cumulativeNotionalAfter = $ | |
822 | - | let openInterestNotionalAfter = $ | |
823 | - | let totalLongAfter = $ | |
824 | - | let totalShortAfter = $ | |
836 | + | let newPositionSize = $t03777840327._1 | |
837 | + | let newPositionRemainMargin = $t03777840327._2 | |
838 | + | let newPositionOpenNotional = $t03777840327._3 | |
839 | + | let newPositionLatestCPF = $t03777840327._4 | |
840 | + | let baseAssetReserveAfter = $t03777840327._5 | |
841 | + | let quoteAssetReserveAfter = $t03777840327._6 | |
842 | + | let totalPositionSizeAfter = $t03777840327._7 | |
843 | + | let cumulativeNotionalAfter = $t03777840327._8 | |
844 | + | let openInterestNotionalAfter = $t03777840327._9 | |
845 | + | let totalLongAfter = $t03777840327._10 | |
846 | + | let totalShortAfter = $t03777840327._11 | |
825 | 847 | let notifyNotional = invoke(minerAddress(), "notifyNotional", [toString(i.caller), newPositionOpenNotional], nil) | |
826 | 848 | if ((notifyNotional == notifyNotional)) | |
827 | 849 | then (updatePosition(toString(i.caller), newPositionSize, newPositionRemainMargin, newPositionOpenNotional, newPositionLatestCPF) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter)) | |
861 | 883 | } | |
862 | 884 | let _amount = (_rawAmount - rawFeeAmount) | |
863 | 885 | let feeAmount = (rawFeeAmount - referrerFee) | |
864 | - | let $ | |
865 | - | let oldPositionSize = $ | |
866 | - | let oldPositionMargin = $ | |
867 | - | let oldPositionOpenNotional = $ | |
868 | - | let oldPositionLstUpdCPF = $ | |
886 | + | let $t04185641996 = getPosition(_trader) | |
887 | + | let oldPositionSize = $t04185641996._1 | |
888 | + | let oldPositionMargin = $t04185641996._2 | |
889 | + | let oldPositionOpenNotional = $t04185641996._3 | |
890 | + | let oldPositionLstUpdCPF = $t04185641996._4 | |
869 | 891 | let isNewPosition = (oldPositionSize == 0) | |
870 | 892 | let isSameDirection = if ((oldPositionSize > 0)) | |
871 | 893 | then (_direction == DIR_LONG) | |
874 | 896 | then isSameDirection | |
875 | 897 | else false | |
876 | 898 | let isAdd = (_direction == DIR_LONG) | |
877 | - | let $ | |
899 | + | let $t04228544853 = if (if (isNewPosition) | |
878 | 900 | then true | |
879 | 901 | else expandExisting) | |
880 | 902 | then { | |
881 | 903 | let openNotional = muld(_amount, _leverage) | |
882 | - | let $ | |
883 | - | let amountBaseAssetBought = $ | |
884 | - | let quoteAssetReserveAfter = $ | |
885 | - | let baseAssetReserveAfter = $ | |
886 | - | let totalPositionSizeAfter = $ | |
887 | - | let cumulativeNotionalAfter = $ | |
904 | + | let $t04270942915 = swapInput(isAdd, openNotional) | |
905 | + | let amountBaseAssetBought = $t04270942915._1 | |
906 | + | let quoteAssetReserveAfter = $t04270942915._2 | |
907 | + | let baseAssetReserveAfter = $t04270942915._3 | |
908 | + | let totalPositionSizeAfter = $t04270942915._4 | |
909 | + | let cumulativeNotionalAfter = $t04270942915._5 | |
888 | 910 | if (if ((_minBaseAssetAmount != 0)) | |
889 | 911 | then (_minBaseAssetAmount > abs(amountBaseAssetBought)) | |
890 | 912 | else false) | |
892 | 914 | else { | |
893 | 915 | let newPositionSize = (oldPositionSize + amountBaseAssetBought) | |
894 | 916 | let increaseMarginRequirement = divd(openNotional, _leverage) | |
895 | - | let $ | |
896 | - | let remainMargin = $ | |
897 | - | let x1 = $ | |
898 | - | let x2 = $ | |
917 | + | let $t04329643535 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, increaseMarginRequirement) | |
918 | + | let remainMargin = $t04329643535._1 | |
919 | + | let x1 = $t04329643535._2 | |
920 | + | let x2 = $t04329643535._3 | |
899 | 921 | if (!(requireNotOverSpreadLimit(quoteAssetReserveAfter, baseAssetReserveAfter))) | |
900 | 922 | then throw("Over max spread limit") | |
901 | 923 | else $Tuple11(newPositionSize, remainMargin, (oldPositionOpenNotional + openNotional), latestCumulativePremiumFraction(newPositionSize), baseAssetReserveAfter, quoteAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, (openInterestNotional() + openNotional), (totalLongPositionSize() + (if ((newPositionSize > 0)) | |
907 | 929 | } | |
908 | 930 | else { | |
909 | 931 | let openNotional = muld(_amount, _leverage) | |
910 | - | let $ | |
911 | - | let oldPositionNotional = $ | |
912 | - | let unrealizedPnl = $ | |
932 | + | let $t04454644662 = getPositionNotionalAndUnrealizedPnl(toString(i.caller), PNL_OPTION_SPOT) | |
933 | + | let oldPositionNotional = $t04454644662._1 | |
934 | + | let unrealizedPnl = $t04454644662._2 | |
913 | 935 | if ((oldPositionNotional > openNotional)) | |
914 | 936 | then throw("Use decreasePosition to decrease position size") | |
915 | 937 | else throw("Close position first") | |
916 | 938 | } | |
917 | - | let newPositionSize = $ | |
918 | - | let newPositionRemainMargin = $ | |
919 | - | let newPositionOpenNotional = $ | |
920 | - | let newPositionLatestCPF = $ | |
921 | - | let baseAssetReserveAfter = $ | |
922 | - | let quoteAssetReserveAfter = $ | |
923 | - | let totalPositionSizeAfter = $ | |
924 | - | let cumulativeNotionalAfter = $ | |
925 | - | let openInterestNotionalAfter = $ | |
926 | - | let totalLongAfter = $ | |
927 | - | let totalShortAfter = $ | |
939 | + | let newPositionSize = $t04228544853._1 | |
940 | + | let newPositionRemainMargin = $t04228544853._2 | |
941 | + | let newPositionOpenNotional = $t04228544853._3 | |
942 | + | let newPositionLatestCPF = $t04228544853._4 | |
943 | + | let baseAssetReserveAfter = $t04228544853._5 | |
944 | + | let quoteAssetReserveAfter = $t04228544853._6 | |
945 | + | let totalPositionSizeAfter = $t04228544853._7 | |
946 | + | let cumulativeNotionalAfter = $t04228544853._8 | |
947 | + | let openInterestNotionalAfter = $t04228544853._9 | |
948 | + | let totalLongAfter = $t04228544853._10 | |
949 | + | let totalShortAfter = $t04228544853._11 | |
928 | 950 | let feeToStakers = (feeAmount / 2) | |
929 | 951 | let feeToInsurance = (feeAmount - feeToStakers) | |
930 | 952 | let stake = invoke(quoteAssetStaking(), "lockNeutrinoSP", [toString(stakingAddress()), ALL_FEES], [AttachedPayment(quoteAsset(), _amount)]) | |
978 | 1000 | } | |
979 | 1001 | let feeAmount = (rawFeeAmount - referrerFee) | |
980 | 1002 | let _amount = (_rawAmount - rawFeeAmount) | |
981 | - | let $ | |
982 | - | let oldPositionSize = $ | |
983 | - | let oldPositionMargin = $ | |
984 | - | let oldPositionOpenNotional = $ | |
985 | - | let oldPositionLstUpdCPF = $ | |
1003 | + | let $t04674646886 = getPosition(_trader) | |
1004 | + | let oldPositionSize = $t04674646886._1 | |
1005 | + | let oldPositionMargin = $t04674646886._2 | |
1006 | + | let oldPositionOpenNotional = $t04674646886._3 | |
1007 | + | let oldPositionLstUpdCPF = $t04674646886._4 | |
986 | 1008 | let feeToStakers = (feeAmount / 2) | |
987 | 1009 | let feeToInsurance = (feeAmount - feeToStakers) | |
988 | 1010 | let stake = invoke(quoteAssetStaking(), "lockNeutrinoSP", [toString(stakingAddress()), ALL_FEES], [AttachedPayment(quoteAsset(), _amount)]) | |
1016 | 1038 | else paused()) | |
1017 | 1039 | then throw("Invalid removeMargin parameters") | |
1018 | 1040 | else { | |
1019 | - | let $ | |
1020 | - | let oldPositionSize = $ | |
1021 | - | let oldPositionMargin = $ | |
1022 | - | let oldPositionOpenNotional = $ | |
1023 | - | let oldPositionLstUpdCPF = $ | |
1041 | + | let $t04791148063 = getPosition(toString(i.caller)) | |
1042 | + | let oldPositionSize = $t04791148063._1 | |
1043 | + | let oldPositionMargin = $t04791148063._2 | |
1044 | + | let oldPositionOpenNotional = $t04791148063._3 | |
1045 | + | let oldPositionLstUpdCPF = $t04791148063._4 | |
1024 | 1046 | let marginDelta = -(_amount) | |
1025 | - | let $ | |
1026 | - | let remainMargin = $ | |
1027 | - | let badDebt = $ | |
1047 | + | let $t04810048279 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, marginDelta) | |
1048 | + | let remainMargin = $t04810048279._1 | |
1049 | + | let badDebt = $t04810048279._2 | |
1028 | 1050 | if ((badDebt != 0)) | |
1029 | 1051 | then throw("Invalid removed margin amount") | |
1030 | 1052 | else { | |
1053 | 1075 | else paused()) | |
1054 | 1076 | then throw("Invalid closePosition parameters") | |
1055 | 1077 | else { | |
1056 | - | let $ | |
1057 | - | let x1 = $ | |
1058 | - | let positionBadDebt = $ | |
1059 | - | let realizedPnl = $ | |
1060 | - | let marginToVault = $ | |
1061 | - | let quoteAssetReserveAfter = $ | |
1062 | - | let baseAssetReserveAfter = $ | |
1063 | - | let totalPositionSizeAfter = $ | |
1064 | - | let cumulativeNotionalAfter = $ | |
1065 | - | let openInterestNotionalAfter = $ | |
1066 | - | let x2 = $ | |
1067 | - | let totalLongAfter = $ | |
1068 | - | let totalShortAfter = $ | |
1078 | + | let $t04948249859 = internalClosePosition(caller, true) | |
1079 | + | let x1 = $t04948249859._1 | |
1080 | + | let positionBadDebt = $t04948249859._2 | |
1081 | + | let realizedPnl = $t04948249859._3 | |
1082 | + | let marginToVault = $t04948249859._4 | |
1083 | + | let quoteAssetReserveAfter = $t04948249859._5 | |
1084 | + | let baseAssetReserveAfter = $t04948249859._6 | |
1085 | + | let totalPositionSizeAfter = $t04948249859._7 | |
1086 | + | let cumulativeNotionalAfter = $t04948249859._8 | |
1087 | + | let openInterestNotionalAfter = $t04948249859._9 | |
1088 | + | let x2 = $t04948249859._10 | |
1089 | + | let totalLongAfter = $t04948249859._11 | |
1090 | + | let totalShortAfter = $t04948249859._12 | |
1069 | 1091 | if ((positionBadDebt > 0)) | |
1070 | 1092 | then throw("Unable to close position with bad debt") | |
1071 | 1093 | else { | |
1072 | 1094 | let withdrawAmount = abs(marginToVault) | |
1073 | 1095 | let ammBalance = (cbalance() - withdrawAmount) | |
1074 | - | let $ | |
1096 | + | let $t05006850210 = if ((0 > ammBalance)) | |
1075 | 1097 | then $Tuple2(0, abs(ammBalance)) | |
1076 | 1098 | else $Tuple2(ammBalance, 0) | |
1077 | - | let ammNewBalance = $ | |
1078 | - | let getFromInsurance = $ | |
1099 | + | let ammNewBalance = $t05006850210._1 | |
1100 | + | let getFromInsurance = $t05006850210._2 | |
1079 | 1101 | let x = if ((getFromInsurance > 0)) | |
1080 | 1102 | then { | |
1081 | 1103 | let withdrawInsurance = invoke(insuranceAddress(), "withdraw", [getFromInsurance], nil) | |
1126 | 1148 | then (DECIMAL_UNIT > partialLiquidationRatio()) | |
1127 | 1149 | else false) | |
1128 | 1150 | then { | |
1129 | - | let $ | |
1130 | - | let oldPositionSize = $ | |
1131 | - | let oldPositionMargin = $ | |
1132 | - | let oldPositionOpenNotional = $ | |
1133 | - | let oldPositionLstUpdCPF = $ | |
1151 | + | let $t05229052440 = getPosition(_trader) | |
1152 | + | let oldPositionSize = $t05229052440._1 | |
1153 | + | let oldPositionMargin = $t05229052440._2 | |
1154 | + | let oldPositionOpenNotional = $t05229052440._3 | |
1155 | + | let oldPositionLstUpdCPF = $t05229052440._4 | |
1134 | 1156 | let _direction = if ((oldPositionSize > 0)) | |
1135 | 1157 | then DIR_SHORT | |
1136 | 1158 | else DIR_LONG | |
1137 | 1159 | let isAdd = (_direction == DIR_LONG) | |
1138 | 1160 | let exchangedQuoteAssetAmount = getPartialLiquidationAmount(_trader, oldPositionSize) | |
1139 | - | let $ | |
1140 | - | let oldPositionNotional = $ | |
1141 | - | let unrealizedPnl = $ | |
1142 | - | let $ | |
1143 | - | let exchangedPositionSize = $ | |
1144 | - | let quoteAssetReserveAfter = $ | |
1145 | - | let baseAssetReserveAfter = $ | |
1146 | - | let totalPositionSizeAfter = $ | |
1147 | - | let cumulativeNotionalAfter = $ | |
1161 | + | let $t05266552769 = getPositionNotionalAndUnrealizedPnl(_trader, PNL_OPTION_SPOT) | |
1162 | + | let oldPositionNotional = $t05266552769._1 | |
1163 | + | let unrealizedPnl = $t05266552769._2 | |
1164 | + | let $t05277753067 = swapInput(isAdd, exchangedQuoteAssetAmount) | |
1165 | + | let exchangedPositionSize = $t05277753067._1 | |
1166 | + | let quoteAssetReserveAfter = $t05277753067._2 | |
1167 | + | let baseAssetReserveAfter = $t05277753067._3 | |
1168 | + | let totalPositionSizeAfter = $t05277753067._4 | |
1169 | + | let cumulativeNotionalAfter = $t05277753067._5 | |
1148 | 1170 | let realizedPnl = divd(muld(unrealizedPnl, abs(exchangedPositionSize)), abs(oldPositionSize)) | |
1149 | - | let $ | |
1150 | - | let remainMargin = $ | |
1151 | - | let badDebt = $ | |
1152 | - | let fundingPayment = $ | |
1171 | + | let $t05317453407 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, realizedPnl) | |
1172 | + | let remainMargin = $t05317453407._1 | |
1173 | + | let badDebt = $t05317453407._2 | |
1174 | + | let fundingPayment = $t05317453407._3 | |
1153 | 1175 | let unrealizedPnlAfter = (unrealizedPnl - realizedPnl) | |
1154 | 1176 | let remainOpenNotional = if ((oldPositionSize > 0)) | |
1155 | 1177 | then ((oldPositionNotional - exchangedQuoteAssetAmount) - unrealizedPnlAfter) | |
1163 | 1185 | let newPositionLstUpdCPF = latestCumulativePremiumFraction(newPositionSize) | |
1164 | 1186 | let openInterestNotionalAfter = (openInterestNotional() - exchangedQuoteAssetAmount) | |
1165 | 1187 | let ammBalance = (cbalance() - liquidationPenalty) | |
1166 | - | let $ | |
1188 | + | let $t05458054723 = if ((0 > ammBalance)) | |
1167 | 1189 | then $Tuple2(0, abs(ammBalance)) | |
1168 | 1190 | else $Tuple2(ammBalance, 0) | |
1169 | - | let newAmmBalance = $ | |
1170 | - | let takeFromInsurance = $ | |
1191 | + | let newAmmBalance = $t05458054723._1 | |
1192 | + | let takeFromInsurance = $t05458054723._2 | |
1171 | 1193 | let x = if ((takeFromInsurance > 0)) | |
1172 | 1194 | then { | |
1173 | 1195 | let withdrawInsurance = invoke(insuranceAddress(), "withdraw", [takeFromInsurance], nil) | |
1200 | 1222 | else throw("Strict value is not equal to itself.") | |
1201 | 1223 | } | |
1202 | 1224 | else { | |
1203 | - | let $ | |
1204 | - | let x1 = $ | |
1205 | - | let badDebt = $ | |
1206 | - | let x2 = $ | |
1207 | - | let x3 = $ | |
1208 | - | let quoteAssetReserveAfter = $ | |
1209 | - | let baseAssetReserveAfter = $ | |
1210 | - | let totalPositionSizeAfter = $ | |
1211 | - | let cumulativeNotionalAfter = $ | |
1212 | - | let openInterestNotionalAfter = $ | |
1213 | - | let exchangedQuoteAssetAmount = $ | |
1214 | - | let totalLongAfter = $ | |
1215 | - | let totalShortAfter = $ | |
1225 | + | let $t05617956634 = internalClosePosition(_trader, false) | |
1226 | + | let x1 = $t05617956634._1 | |
1227 | + | let badDebt = $t05617956634._2 | |
1228 | + | let x2 = $t05617956634._3 | |
1229 | + | let x3 = $t05617956634._4 | |
1230 | + | let quoteAssetReserveAfter = $t05617956634._5 | |
1231 | + | let baseAssetReserveAfter = $t05617956634._6 | |
1232 | + | let totalPositionSizeAfter = $t05617956634._7 | |
1233 | + | let cumulativeNotionalAfter = $t05617956634._8 | |
1234 | + | let openInterestNotionalAfter = $t05617956634._9 | |
1235 | + | let exchangedQuoteAssetAmount = $t05617956634._10 | |
1236 | + | let totalLongAfter = $t05617956634._11 | |
1237 | + | let totalShortAfter = $t05617956634._12 | |
1216 | 1238 | let liquidationPenalty = muld(exchangedQuoteAssetAmount, liquidationFeeRatio()) | |
1217 | 1239 | let feeToLiquidator = (liquidationPenalty / 2) | |
1218 | 1240 | let feeToInsurance = (liquidationPenalty - feeToLiquidator) | |
1219 | 1241 | let ammBalance = (cbalance() - liquidationPenalty) | |
1220 | - | let $ | |
1242 | + | let $t05704657189 = if ((0 > ammBalance)) | |
1221 | 1243 | then $Tuple2(0, abs(ammBalance)) | |
1222 | 1244 | else $Tuple2(ammBalance, 0) | |
1223 | - | let newAmmBalance = $ | |
1224 | - | let takeFromInsurance = $ | |
1245 | + | let newAmmBalance = $t05704657189._1 | |
1246 | + | let takeFromInsurance = $t05704657189._2 | |
1225 | 1247 | let x = if ((takeFromInsurance > 0)) | |
1226 | 1248 | then { | |
1227 | 1249 | let withdrawInsurance = invoke(insuranceAddress(), "withdraw", [takeFromInsurance], nil) | |
1264 | 1286 | then throw(((("Invalid funding block timestamp: " + toString(lastBlock.timestamp)) + " < ") + toString(fundingBlockTimestamp))) | |
1265 | 1287 | else { | |
1266 | 1288 | let underlyingPrice = getOracleTwapPrice() | |
1267 | - | let spotTwapPrice = getTwapSpotPrice() | |
1268 | - | let premium = (spotTwapPrice - underlyingPrice) | |
1269 | - | let $t05751958854 = if (if ((totalShortPositionSize() == 0)) | |
1270 | - | then true | |
1271 | - | else (totalLongPositionSize() == 0)) | |
1272 | - | then $Tuple2(0, 0) | |
1273 | - | else if ((0 > premium)) | |
1274 | - | then { | |
1275 | - | let shortPremiumFraction = divd(muld(premium, fundingPeriodDecimal()), ONE_DAY) | |
1276 | - | let longPremiumFraction = divd(muld(shortPremiumFraction, totalShortPositionSize()), totalLongPositionSize()) | |
1277 | - | $Tuple2(shortPremiumFraction, longPremiumFraction) | |
1278 | - | } | |
1279 | - | else { | |
1280 | - | let longPremiumFraction = divd(muld(premium, fundingPeriodDecimal()), ONE_DAY) | |
1281 | - | let shortPremiumFraction = divd(muld(longPremiumFraction, totalLongPositionSize()), totalShortPositionSize()) | |
1282 | - | $Tuple2(shortPremiumFraction, longPremiumFraction) | |
1283 | - | } | |
1284 | - | let shortPremiumFraction = $t05751958854._1 | |
1285 | - | let longPremiumFraction = $t05751958854._2 | |
1289 | + | let $t05868458746 = getFunding() | |
1290 | + | let shortPremiumFraction = $t05868458746._1 | |
1291 | + | let longPremiumFraction = $t05868458746._2 | |
1286 | 1292 | updateFunding((fundingBlockTimestamp + fundingPeriodSeconds()), (latestLongCumulativePremiumFraction() + longPremiumFraction), (latestShortCumulativePremiumFraction() + shortPremiumFraction), divd(longPremiumFraction, underlyingPrice), divd(shortPremiumFraction, underlyingPrice)) | |
1287 | 1293 | } | |
1288 | 1294 | } | |
1309 | 1315 | else (0 > _price)) | |
1310 | 1316 | then throw("Invalid adjustPeg parameters") | |
1311 | 1317 | else { | |
1312 | - | let $ | |
1313 | - | let newQuoteAssetReserve = $ | |
1314 | - | let pegChangeCost = $ | |
1318 | + | let $t05974659832 = getPegAdjustCost(_price) | |
1319 | + | let newQuoteAssetReserve = $t05974659832._1 | |
1320 | + | let pegChangeCost = $t05974659832._2 | |
1315 | 1321 | if ((pegChangeCost == 0)) | |
1316 | 1322 | then throw("Nothing to adjust") | |
1317 | 1323 | else if ((pegChangeCost > 0)) | |
1343 | 1349 | ||
1344 | 1350 | @Callable(i) | |
1345 | 1351 | func v_get (_trader) = { | |
1346 | - | let $ | |
1347 | - | let x1 = $ | |
1348 | - | let x2 = $ | |
1349 | - | let x3 = $ | |
1350 | - | let x4 = $ | |
1352 | + | let $t06105761117 = internalClosePosition(_trader, false) | |
1353 | + | let x1 = $t06105761117._1 | |
1354 | + | let x2 = $t06105761117._2 | |
1355 | + | let x3 = $t06105761117._3 | |
1356 | + | let x4 = $t06105761117._4 | |
1351 | 1357 | throw((((s(x2) + s(x3)) + s(x4)) + s(getMarginRatio(_trader)))) | |
1352 | 1358 | } | |
1353 | 1359 | ||
1355 | 1361 | ||
1356 | 1362 | @Callable(i) | |
1357 | 1363 | func view_calcRemainMarginWithFundingPayment (_trader) = { | |
1358 | - | let $ | |
1359 | - | let positionSize = $ | |
1360 | - | let positionMargin = $ | |
1361 | - | let pon = $ | |
1362 | - | let positionLstUpdCPF = $ | |
1363 | - | let $ | |
1364 | - | let positionNotional = $ | |
1365 | - | let unrealizedPnl = $ | |
1366 | - | let $ | |
1367 | - | let remainMargin = $ | |
1368 | - | let badDebt = $ | |
1369 | - | let fundingPayment = $ | |
1364 | + | let $t06126461375 = getPosition(_trader) | |
1365 | + | let positionSize = $t06126461375._1 | |
1366 | + | let positionMargin = $t06126461375._2 | |
1367 | + | let pon = $t06126461375._3 | |
1368 | + | let positionLstUpdCPF = $t06126461375._4 | |
1369 | + | let $t06138061481 = getPositionNotionalAndUnrealizedPnl(_trader, PNL_OPTION_SPOT) | |
1370 | + | let positionNotional = $t06138061481._1 | |
1371 | + | let unrealizedPnl = $t06138061481._2 | |
1372 | + | let $t06148661668 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl) | |
1373 | + | let remainMargin = $t06148661668._1 | |
1374 | + | let badDebt = $t06148661668._2 | |
1375 | + | let fundingPayment = $t06148661668._3 | |
1370 | 1376 | throw((((((s(remainMargin) + s(fundingPayment)) + s(getMarginRatio(_trader))) + s(unrealizedPnl)) + s(badDebt)) + s(positionNotional))) | |
1371 | 1377 | } | |
1372 | 1378 | ||
1379 | 1385 | } | |
1380 | 1386 | ||
1381 | 1387 | ||
1388 | + | ||
1389 | + | @Callable(i) | |
1390 | + | func view_getFunding () = { | |
1391 | + | let underlyingPrice = getOracleTwapPrice() | |
1392 | + | let $t06205962121 = getFunding() | |
1393 | + | let shortPremiumFraction = $t06205962121._1 | |
1394 | + | let longPremiumFraction = $t06205962121._2 | |
1395 | + | let longFunding = divd(longPremiumFraction, underlyingPrice) | |
1396 | + | let shortFunding = divd(shortPremiumFraction, underlyingPrice) | |
1397 | + | throw((s(longFunding) + s(shortFunding))) | |
1398 | + | } | |
1399 | + | ||
1400 | + | ||
1382 | 1401 | @Verifier(tx) | |
1383 | 1402 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], adminPublicKey()) | |
1384 | 1403 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let k_ora_key = "k_ora_key" | |
5 | 5 | ||
6 | 6 | let k_ora_block_key = "k_ora_block_key" | |
7 | 7 | ||
8 | 8 | let k_ora = "k_ora" | |
9 | 9 | ||
10 | 10 | let k_balance = "k_balance" | |
11 | 11 | ||
12 | 12 | let k_positionSize = "k_positionSize" | |
13 | 13 | ||
14 | 14 | let k_positionMargin = "k_positionMargin" | |
15 | 15 | ||
16 | 16 | let k_positionOpenNotional = "k_positionOpenNotional" | |
17 | 17 | ||
18 | 18 | let k_positionLastUpdatedCumulativePremiumFraction = "k_positionFraction" | |
19 | 19 | ||
20 | 20 | let k_positionClosedDate = "k_positionClosedDate" | |
21 | 21 | ||
22 | 22 | let k_initialized = "k_initialized" | |
23 | 23 | ||
24 | 24 | let k_paused = "k_paused" | |
25 | 25 | ||
26 | 26 | let k_fee = "k_fee" | |
27 | 27 | ||
28 | 28 | let k_fundingPeriod = "k_fundingPeriod" | |
29 | 29 | ||
30 | 30 | let k_initMarginRatio = "k_initMarginRatio" | |
31 | 31 | ||
32 | 32 | let k_maintenanceMarginRatio = "k_mmr" | |
33 | 33 | ||
34 | 34 | let k_liquidationFeeRatio = "k_liquidationFeeRatio" | |
35 | 35 | ||
36 | 36 | let k_partialLiquidationRatio = "k_partLiquidationRatio" | |
37 | 37 | ||
38 | 38 | let k_spreadLimit = "k_spreadLimit" | |
39 | 39 | ||
40 | 40 | let k_maxPriceImpact = "k_maxPriceImpact" | |
41 | 41 | ||
42 | 42 | let k_maxPriceSpread = "k_maxPriceSpread" | |
43 | 43 | ||
44 | 44 | let k_lastDataStr = "k_lastDataStr" | |
45 | 45 | ||
46 | 46 | let k_lastMinuteId = "k_lastMinuteId" | |
47 | 47 | ||
48 | 48 | let k_twapDataLastCumulativePrice = "k_twapDataLastCumulativePrice" | |
49 | 49 | ||
50 | 50 | let k_twapDataLastPrice = "k_twapDataLastPrice" | |
51 | 51 | ||
52 | 52 | let k_twapDataPreviousMinuteId = "k_twapDataPreviousMinuteId" | |
53 | 53 | ||
54 | 54 | let k_latestLongCumulativePremiumFraction = "k_latestLongPremiumFraction" | |
55 | 55 | ||
56 | 56 | let k_latestShortCumulativePremiumFraction = "k_latestShortPremiumFraction" | |
57 | 57 | ||
58 | 58 | let k_nextFundingBlock = "k_nextFundingBlockMinTimestamp" | |
59 | 59 | ||
60 | 60 | let k_longFundingRate = "k_longFundingRate" | |
61 | 61 | ||
62 | 62 | let k_shortFundingRate = "k_shortFundingRate" | |
63 | 63 | ||
64 | 64 | let k_quoteAssetReserve = "k_qtAstR" | |
65 | 65 | ||
66 | 66 | let k_baseAssetReserve = "k_bsAstR" | |
67 | 67 | ||
68 | 68 | let k_totalPositionSize = "k_totalPositionSize" | |
69 | 69 | ||
70 | 70 | let k_totalLongPositionSize = "k_totalLongPositionSize" | |
71 | 71 | ||
72 | 72 | let k_totalShortPositionSize = "k_totalShortPositionSize" | |
73 | 73 | ||
74 | 74 | let k_cumulativeNotional = "k_cumulativeNotional" | |
75 | 75 | ||
76 | 76 | let k_openInterestNotional = "k_openInterestNotional" | |
77 | 77 | ||
78 | 78 | let k_coordinatorAddress = "k_coordinatorAddress" | |
79 | 79 | ||
80 | 80 | let k_insurance_address = "k_insurance_address" | |
81 | 81 | ||
82 | 82 | let k_admin_address = "k_admin_address" | |
83 | 83 | ||
84 | 84 | let k_admin_public_key = "k_admin_public_key" | |
85 | 85 | ||
86 | 86 | let k_quote_asset = "k_quote_asset" | |
87 | 87 | ||
88 | 88 | let k_quote_staking = "k_quote_staking" | |
89 | 89 | ||
90 | 90 | let k_staking_address = "k_staking_address" | |
91 | 91 | ||
92 | 92 | let k_miner_address = "k_miner_address" | |
93 | 93 | ||
94 | 94 | let k_orders_address = "k_orders_address" | |
95 | 95 | ||
96 | 96 | let k_referral_address = "k_referral_address" | |
97 | 97 | ||
98 | 98 | func coordinator () = valueOrErrorMessage(addressFromString(getStringValue(this, k_coordinatorAddress)), "Coordinator not set") | |
99 | 99 | ||
100 | 100 | ||
101 | 101 | func adminAddress () = addressFromString(getStringValue(coordinator(), k_admin_address)) | |
102 | 102 | ||
103 | 103 | ||
104 | 104 | func adminPublicKey () = fromBase58String(getStringValue(coordinator(), k_admin_public_key)) | |
105 | 105 | ||
106 | 106 | ||
107 | 107 | func quoteAsset () = fromBase58String(getStringValue(coordinator(), k_quote_asset)) | |
108 | 108 | ||
109 | 109 | ||
110 | 110 | func quoteAssetStaking () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_quote_staking)), "Quote asset staking not set") | |
111 | 111 | ||
112 | 112 | ||
113 | 113 | func stakingAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_staking_address)), "Staking not set") | |
114 | 114 | ||
115 | 115 | ||
116 | 116 | func insuranceAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_insurance_address)), "Insurance not set") | |
117 | 117 | ||
118 | 118 | ||
119 | 119 | func minerAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_miner_address)), "Miner not set") | |
120 | 120 | ||
121 | 121 | ||
122 | 122 | func ordersAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_orders_address)), "Orders not set") | |
123 | 123 | ||
124 | 124 | ||
125 | 125 | func referralAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_referral_address)), "Referral not set") | |
126 | 126 | ||
127 | 127 | ||
128 | 128 | let DIR_LONG = 1 | |
129 | 129 | ||
130 | 130 | let DIR_SHORT = 2 | |
131 | 131 | ||
132 | 132 | let TWAP_INTERVAL = 15 | |
133 | 133 | ||
134 | 134 | let ORACLE_INTERVAL = 15 | |
135 | 135 | ||
136 | 136 | let SECONDS = 1000 | |
137 | 137 | ||
138 | 138 | let DECIMAL_UNIT = (1 * (((((10 * 10) * 10) * 10) * 10) * 10)) | |
139 | 139 | ||
140 | 140 | let ONE_DAY = (86400 * DECIMAL_UNIT) | |
141 | 141 | ||
142 | 142 | let ALL_FEES = 100 | |
143 | 143 | ||
144 | 144 | let PNL_OPTION_SPOT = 1 | |
145 | 145 | ||
146 | 146 | let PNL_OPTION_ORACLE = 2 | |
147 | 147 | ||
148 | 148 | func s (_x) = (toString(_x) + ",") | |
149 | 149 | ||
150 | 150 | ||
151 | 151 | func divd (_x,_y) = fraction(_x, DECIMAL_UNIT, _y, HALFEVEN) | |
152 | 152 | ||
153 | 153 | ||
154 | 154 | func muld (_x,_y) = fraction(_x, _y, DECIMAL_UNIT, HALFEVEN) | |
155 | 155 | ||
156 | 156 | ||
157 | 157 | func abs (_x) = if ((_x > 0)) | |
158 | 158 | then _x | |
159 | 159 | else -(_x) | |
160 | 160 | ||
161 | 161 | ||
162 | 162 | func vmax (_x,_y) = if ((_x >= _y)) | |
163 | 163 | then _x | |
164 | 164 | else _y | |
165 | 165 | ||
166 | 166 | ||
167 | 167 | func toCompositeKey (_key,_address) = ((_key + "_") + _address) | |
168 | 168 | ||
169 | 169 | ||
170 | 170 | func listToStr (_list) = { | |
171 | 171 | func _join (accumulator,val) = ((accumulator + val) + ",") | |
172 | 172 | ||
173 | 173 | let newListStr = { | |
174 | 174 | let $l = _list | |
175 | 175 | let $s = size($l) | |
176 | 176 | let $acc0 = "" | |
177 | 177 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
178 | 178 | then $a | |
179 | 179 | else _join($a, $l[$i]) | |
180 | 180 | ||
181 | 181 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
182 | 182 | then $a | |
183 | 183 | else throw("List size exceeds 20") | |
184 | 184 | ||
185 | 185 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20) | |
186 | 186 | } | |
187 | 187 | let newListStrU = dropRight(newListStr, 1) | |
188 | 188 | let newListStrR = if ((take(newListStrU, 1) == ",")) | |
189 | 189 | then drop(newListStrU, 1) | |
190 | 190 | else newListStrU | |
191 | 191 | newListStrR | |
192 | 192 | } | |
193 | 193 | ||
194 | 194 | ||
195 | 195 | func strToList (_str) = split(_str, ",") | |
196 | 196 | ||
197 | 197 | ||
198 | 198 | func pushToQueue (_list,_maxSize,_value) = if ((size(_list) > _maxSize)) | |
199 | 199 | then (removeByIndex(_list, 0) :+ _value) | |
200 | 200 | else (_list :+ _value) | |
201 | 201 | ||
202 | 202 | ||
203 | 203 | func int (k) = valueOrErrorMessage(getInteger(this, k), ("no value for " + k)) | |
204 | 204 | ||
205 | 205 | ||
206 | 206 | func cbalance () = int(k_balance) | |
207 | 207 | ||
208 | 208 | ||
209 | 209 | func fee () = int(k_fee) | |
210 | 210 | ||
211 | 211 | ||
212 | 212 | func initMarginRatio () = int(k_initMarginRatio) | |
213 | 213 | ||
214 | 214 | ||
215 | 215 | func qtAstR () = int(k_quoteAssetReserve) | |
216 | 216 | ||
217 | 217 | ||
218 | 218 | func bsAstR () = int(k_baseAssetReserve) | |
219 | 219 | ||
220 | 220 | ||
221 | 221 | func totalPositionSize () = int(k_totalPositionSize) | |
222 | 222 | ||
223 | 223 | ||
224 | 224 | func cumulativeNotional () = int(k_cumulativeNotional) | |
225 | 225 | ||
226 | 226 | ||
227 | 227 | func openInterestNotional () = int(k_openInterestNotional) | |
228 | 228 | ||
229 | 229 | ||
230 | 230 | func nextFundingBlockTimestamp () = int(k_nextFundingBlock) | |
231 | 231 | ||
232 | 232 | ||
233 | 233 | func fundingPeriodRaw () = int(k_fundingPeriod) | |
234 | 234 | ||
235 | 235 | ||
236 | 236 | func fundingPeriodDecimal () = (fundingPeriodRaw() * DECIMAL_UNIT) | |
237 | 237 | ||
238 | 238 | ||
239 | 239 | func fundingPeriodSeconds () = (fundingPeriodRaw() * SECONDS) | |
240 | 240 | ||
241 | 241 | ||
242 | 242 | func maintenanceMarginRatio () = int(k_maintenanceMarginRatio) | |
243 | 243 | ||
244 | 244 | ||
245 | 245 | func liquidationFeeRatio () = int(k_liquidationFeeRatio) | |
246 | 246 | ||
247 | 247 | ||
248 | 248 | func partialLiquidationRatio () = int(k_partialLiquidationRatio) | |
249 | 249 | ||
250 | 250 | ||
251 | 251 | func spreadLimit () = int(k_spreadLimit) | |
252 | 252 | ||
253 | 253 | ||
254 | 254 | func maxPriceImpact () = int(k_maxPriceImpact) | |
255 | 255 | ||
256 | 256 | ||
257 | 257 | func maxPriceSpread () = int(k_maxPriceSpread) | |
258 | 258 | ||
259 | 259 | ||
260 | 260 | func latestLongCumulativePremiumFraction () = int(k_latestLongCumulativePremiumFraction) | |
261 | 261 | ||
262 | 262 | ||
263 | 263 | func latestShortCumulativePremiumFraction () = int(k_latestShortCumulativePremiumFraction) | |
264 | 264 | ||
265 | 265 | ||
266 | 266 | func totalShortPositionSize () = int(k_totalShortPositionSize) | |
267 | 267 | ||
268 | 268 | ||
269 | 269 | func totalLongPositionSize () = int(k_totalLongPositionSize) | |
270 | 270 | ||
271 | 271 | ||
272 | 272 | func getActualCaller (i) = valueOrElse(getString(ordersAddress(), "k_sender"), toString(i.caller)) | |
273 | 273 | ||
274 | 274 | ||
275 | 275 | func requireMoreMarginRatio (_marginRatio,_baseMarginRatio,_largerThanOrEqualTo) = { | |
276 | 276 | let remainingMarginRatio = (_marginRatio - _baseMarginRatio) | |
277 | 277 | if (if (_largerThanOrEqualTo) | |
278 | 278 | then (0 > remainingMarginRatio) | |
279 | 279 | else false) | |
280 | 280 | then throw("Invalid margin") | |
281 | 281 | else if (if (!(_largerThanOrEqualTo)) | |
282 | 282 | then (remainingMarginRatio >= 0) | |
283 | 283 | else false) | |
284 | 284 | then throw("Invalid margin") | |
285 | 285 | else true | |
286 | 286 | } | |
287 | 287 | ||
288 | 288 | ||
289 | 289 | func latestCumulativePremiumFraction (_positionSize) = if ((_positionSize == 0)) | |
290 | 290 | then throw("Should not be called with _positionSize == 0") | |
291 | 291 | else if ((_positionSize > 0)) | |
292 | 292 | then latestLongCumulativePremiumFraction() | |
293 | 293 | else latestShortCumulativePremiumFraction() | |
294 | 294 | ||
295 | 295 | ||
296 | 296 | func getPosition (_trader) = { | |
297 | 297 | let positionSizeOpt = getInteger(this, toCompositeKey(k_positionSize, _trader)) | |
298 | 298 | match positionSizeOpt { | |
299 | 299 | case positionSize: Int => | |
300 | 300 | $Tuple4(positionSize, getIntegerValue(this, toCompositeKey(k_positionMargin, _trader)), getIntegerValue(this, toCompositeKey(k_positionOpenNotional, _trader)), getIntegerValue(this, toCompositeKey(k_positionLastUpdatedCumulativePremiumFraction, _trader))) | |
301 | 301 | case _ => | |
302 | 302 | $Tuple4(0, 0, 0, 0) | |
303 | 303 | } | |
304 | 304 | } | |
305 | 305 | ||
306 | 306 | ||
307 | 307 | func requireOpenPosition (_trader) = if ((getPosition(_trader)._1 == 0)) | |
308 | 308 | then throw("No open position") | |
309 | 309 | else true | |
310 | 310 | ||
311 | 311 | ||
312 | 312 | func initialized () = valueOrElse(getBoolean(this, k_initialized), false) | |
313 | 313 | ||
314 | 314 | ||
315 | 315 | func paused () = valueOrElse(getBoolean(this, k_paused), false) | |
316 | 316 | ||
317 | 317 | ||
318 | 318 | func updateReserve (_isAdd,_quoteAssetAmount,_baseAssetAmount) = if (_isAdd) | |
319 | 319 | then { | |
320 | 320 | let newBase = (bsAstR() - _baseAssetAmount) | |
321 | 321 | if ((0 >= newBase)) | |
322 | 322 | then throw("Tx lead to base asset reserve <= 0, revert") | |
323 | 323 | else $Tuple4((qtAstR() + _quoteAssetAmount), newBase, (totalPositionSize() + _baseAssetAmount), (cumulativeNotional() + _quoteAssetAmount)) | |
324 | 324 | } | |
325 | 325 | else { | |
326 | 326 | let newQuote = (qtAstR() - _quoteAssetAmount) | |
327 | 327 | if ((0 >= newQuote)) | |
328 | 328 | then throw("Tx lead to base quote reserve <= 0, revert") | |
329 | 329 | else $Tuple4(newQuote, (bsAstR() + _baseAssetAmount), (totalPositionSize() - _baseAssetAmount), (cumulativeNotional() - _quoteAssetAmount)) | |
330 | 330 | } | |
331 | 331 | ||
332 | 332 | ||
333 | 333 | func swapInput (_isAdd,_quoteAssetAmount) = { | |
334 | 334 | let _qtAstR = qtAstR() | |
335 | 335 | let _bsAstR = bsAstR() | |
336 | 336 | let k = muld(_qtAstR, _bsAstR) | |
337 | 337 | let quoteAssetReserveAfter = if (_isAdd) | |
338 | 338 | then (_qtAstR + _quoteAssetAmount) | |
339 | 339 | else (_qtAstR - _quoteAssetAmount) | |
340 | 340 | let baseAssetReserveAfter = divd(k, quoteAssetReserveAfter) | |
341 | 341 | let amountBaseAssetBoughtAbs = abs((baseAssetReserveAfter - _bsAstR)) | |
342 | 342 | let amountBaseAssetBought = if (_isAdd) | |
343 | 343 | then amountBaseAssetBoughtAbs | |
344 | 344 | else -(amountBaseAssetBoughtAbs) | |
345 | 345 | let $t01281613009 = updateReserve(_isAdd, _quoteAssetAmount, amountBaseAssetBoughtAbs) | |
346 | 346 | let quoteAssetReserveAfter1 = $t01281613009._1 | |
347 | 347 | let baseAssetReserveAfter1 = $t01281613009._2 | |
348 | 348 | let totalPositionSizeAfter1 = $t01281613009._3 | |
349 | 349 | let cumulativeNotionalAfter1 = $t01281613009._4 | |
350 | 350 | let priceBefore = divd(_qtAstR, _bsAstR) | |
351 | 351 | let marketPrice = divd(_quoteAssetAmount, amountBaseAssetBoughtAbs) | |
352 | 352 | let priceDiff = abs((priceBefore - marketPrice)) | |
353 | 353 | let priceImpact = (DECIMAL_UNIT - divd(priceBefore, (priceBefore + priceDiff))) | |
354 | 354 | let maxPriceImpactValue = maxPriceImpact() | |
355 | 355 | if ((priceImpact > maxPriceImpactValue)) | |
356 | 356 | then throw(((((((((((((("Price impact " + toString(priceImpact)) + " > max price impact ") + toString(maxPriceImpactValue)) + " before quote asset: ") + toString(_qtAstR)) + " before base asset: ") + toString(_bsAstR)) + " quote asset amount to exchange: ") + toString(_quoteAssetAmount)) + " price before: ") + toString(priceBefore)) + " marketPrice: ") + toString(marketPrice))) | |
357 | 357 | else $Tuple5(amountBaseAssetBought, quoteAssetReserveAfter1, baseAssetReserveAfter1, totalPositionSizeAfter1, cumulativeNotionalAfter1) | |
358 | 358 | } | |
359 | 359 | ||
360 | 360 | ||
361 | 361 | func calcRemainMarginWithFundingPayment (_oldPositionSize,_oldPositionMargin,_oldPositionCumulativePremiumFraction,_marginDelta) = { | |
362 | 362 | let fundingPayment = if ((_oldPositionSize != 0)) | |
363 | 363 | then { | |
364 | 364 | let _latestCumulativePremiumFraction = latestCumulativePremiumFraction(_oldPositionSize) | |
365 | 365 | muld((_latestCumulativePremiumFraction - _oldPositionCumulativePremiumFraction), _oldPositionSize) | |
366 | 366 | } | |
367 | 367 | else 0 | |
368 | 368 | let signedMargin = ((_marginDelta - fundingPayment) + _oldPositionMargin) | |
369 | 369 | let $t01450014627 = if ((0 > signedMargin)) | |
370 | 370 | then $Tuple2(0, abs(signedMargin)) | |
371 | 371 | else $Tuple2(abs(signedMargin), 0) | |
372 | 372 | let remainMargin = $t01450014627._1 | |
373 | 373 | let badDebt = $t01450014627._2 | |
374 | 374 | $Tuple3(remainMargin, badDebt, fundingPayment) | |
375 | 375 | } | |
376 | 376 | ||
377 | 377 | ||
378 | 378 | func swapOutputWithReserves (_isAdd,_baseAssetAmount,_checkMaxPriceImpact,_quoteAssetReserve,_baseAssetReserve) = { | |
379 | 379 | let priceBefore = divd(_quoteAssetReserve, _baseAssetReserve) | |
380 | 380 | if ((_baseAssetAmount == 0)) | |
381 | 381 | then throw("Invalid base asset amount") | |
382 | 382 | else { | |
383 | 383 | let k = muld(_quoteAssetReserve, _baseAssetReserve) | |
384 | 384 | let baseAssetPoolAmountAfter = if (_isAdd) | |
385 | 385 | then (_baseAssetReserve + _baseAssetAmount) | |
386 | 386 | else (_baseAssetReserve - _baseAssetAmount) | |
387 | 387 | let quoteAssetAfter = divd(k, baseAssetPoolAmountAfter) | |
388 | 388 | let quoteAssetSold = abs((quoteAssetAfter - _quoteAssetReserve)) | |
389 | 389 | let maxPriceImpactValue = maxPriceImpact() | |
390 | 390 | let $t01560415797 = updateReserve(!(_isAdd), quoteAssetSold, _baseAssetAmount) | |
391 | 391 | let quoteAssetReserveAfter1 = $t01560415797._1 | |
392 | 392 | let baseAssetReserveAfter1 = $t01560415797._2 | |
393 | 393 | let totalPositionSizeAfter1 = $t01560415797._3 | |
394 | 394 | let cumulativeNotionalAfter1 = $t01560415797._4 | |
395 | 395 | let marketPrice = divd(quoteAssetSold, _baseAssetAmount) | |
396 | 396 | let priceDiff = abs((priceBefore - marketPrice)) | |
397 | 397 | let priceImpact = (DECIMAL_UNIT - divd(priceBefore, (priceBefore + priceDiff))) | |
398 | 398 | if (if ((priceImpact > maxPriceImpactValue)) | |
399 | 399 | then _checkMaxPriceImpact | |
400 | 400 | else false) | |
401 | 401 | then throw(((((((((((((("Price impact " + toString(priceImpact)) + " > max price impact ") + toString(maxPriceImpactValue)) + " before quote asset: ") + toString(_quoteAssetReserve)) + " before base asset: ") + toString(_baseAssetReserve)) + " base asset amount to exchange: ") + toString(_baseAssetAmount)) + " price before: ") + toString(priceBefore)) + " market price: ") + toString(marketPrice))) | |
402 | 402 | else $Tuple8(quoteAssetSold, quoteAssetReserveAfter1, baseAssetReserveAfter1, totalPositionSizeAfter1, cumulativeNotionalAfter1, (totalLongPositionSize() - (if (_isAdd) | |
403 | 403 | then abs(_baseAssetAmount) | |
404 | 404 | else 0)), (totalShortPositionSize() - (if (!(_isAdd)) | |
405 | 405 | then abs(_baseAssetAmount) | |
406 | 406 | else 0)), priceImpact) | |
407 | 407 | } | |
408 | 408 | } | |
409 | 409 | ||
410 | 410 | ||
411 | 411 | func swapOutput (_isAdd,_baseAssetAmount,_checkMaxPriceImpact) = swapOutputWithReserves(_isAdd, _baseAssetAmount, _checkMaxPriceImpact, qtAstR(), bsAstR()) | |
412 | 412 | ||
413 | 413 | ||
414 | 414 | func getOracleTwapPrice () = { | |
415 | 415 | let oracle = valueOrErrorMessage(addressFromString(getStringValue(this, k_ora)), "") | |
416 | 416 | let priceKey = getStringValue(this, k_ora_key) | |
417 | 417 | let blockKey = getStringValue(this, k_ora_block_key) | |
418 | 418 | let lastValue = valueOrErrorMessage(getInteger(oracle, priceKey), ((("Can not get oracle price. Oracle: " + toString(oracle)) + " key: ") + priceKey)) | |
419 | 419 | lastValue | |
420 | 420 | } | |
421 | 421 | ||
422 | 422 | ||
423 | 423 | func requireNotOverSpreadLimit (_quoteAssetReserve,_baseAssetReserve) = { | |
424 | 424 | let oraclePrice = getOracleTwapPrice() | |
425 | 425 | let priceAfter = divd(_quoteAssetReserve, _baseAssetReserve) | |
426 | 426 | let averagePrice = divd((oraclePrice + priceAfter), (2 * DECIMAL_UNIT)) | |
427 | 427 | let absPriceDiff = divd(abs((oraclePrice - priceAfter)), averagePrice) | |
428 | 428 | if ((absPriceDiff > maxPriceSpread())) | |
429 | 429 | then throw(((("Price spread " + toString(absPriceDiff)) + " > max price spread ") + toString(maxPriceSpread()))) | |
430 | 430 | else true | |
431 | 431 | } | |
432 | 432 | ||
433 | 433 | ||
434 | 434 | func getSpotPrice () = { | |
435 | 435 | let _quoteAssetReserve = qtAstR() | |
436 | 436 | let _baseAssetReserve = bsAstR() | |
437 | 437 | divd(_quoteAssetReserve, _baseAssetReserve) | |
438 | 438 | } | |
439 | 439 | ||
440 | 440 | ||
441 | 441 | func isOverFluctuationLimit () = { | |
442 | 442 | let oraclePrice = getOracleTwapPrice() | |
443 | 443 | let currentPrice = getSpotPrice() | |
444 | 444 | (divd(abs((oraclePrice - currentPrice)), oraclePrice) > spreadLimit()) | |
445 | 445 | } | |
446 | 446 | ||
447 | 447 | ||
448 | 448 | func getPositionAdjustedOpenNotional (_positionSize,_option,_quoteAssetReserve,_baseAssetReserve) = { | |
449 | 449 | let positionSizeAbs = abs(_positionSize) | |
450 | 450 | let isShort = (0 > _positionSize) | |
451 | 451 | let positionNotional = if ((_option == PNL_OPTION_SPOT)) | |
452 | 452 | then { | |
453 | 453 | let $t01901519186 = swapOutputWithReserves(!(isShort), positionSizeAbs, false, _quoteAssetReserve, _baseAssetReserve) | |
454 | 454 | let outPositionNotional = $t01901519186._1 | |
455 | 455 | let x1 = $t01901519186._2 | |
456 | 456 | let x2 = $t01901519186._3 | |
457 | 457 | let x3 = $t01901519186._4 | |
458 | 458 | outPositionNotional | |
459 | 459 | } | |
460 | 460 | else muld(positionSizeAbs, getOracleTwapPrice()) | |
461 | 461 | positionNotional | |
462 | 462 | } | |
463 | 463 | ||
464 | 464 | ||
465 | 465 | func getPositionNotionalAndUnrealizedPnlByValues (_positionSize,_positionOpenNotional,_quoteAssetReserve,_baseAssetReserve,_option) = if ((_positionSize == 0)) | |
466 | 466 | then throw("Invalid position size") | |
467 | 467 | else { | |
468 | 468 | let isShort = (0 > _positionSize) | |
469 | 469 | let positionNotional = getPositionAdjustedOpenNotional(_positionSize, _option, _quoteAssetReserve, _baseAssetReserve) | |
470 | 470 | let unrealizedPnl = if (isShort) | |
471 | 471 | then (_positionOpenNotional - positionNotional) | |
472 | 472 | else (positionNotional - _positionOpenNotional) | |
473 | 473 | $Tuple2(positionNotional, unrealizedPnl) | |
474 | 474 | } | |
475 | 475 | ||
476 | 476 | ||
477 | 477 | func getPositionNotionalAndUnrealizedPnl (_trader,_option) = { | |
478 | 478 | let $t02050320631 = getPosition(_trader) | |
479 | 479 | let positionSize = $t02050320631._1 | |
480 | 480 | let positionMargin = $t02050320631._2 | |
481 | 481 | let positionOpenNotional = $t02050320631._3 | |
482 | 482 | let positionLstUpdCPF = $t02050320631._4 | |
483 | 483 | getPositionNotionalAndUnrealizedPnlByValues(positionSize, positionOpenNotional, qtAstR(), bsAstR(), _option) | |
484 | 484 | } | |
485 | 485 | ||
486 | 486 | ||
487 | 487 | func calcMarginRatio (_remainMargin,_badDebt,_positionNotional) = divd((_remainMargin - _badDebt), _positionNotional) | |
488 | 488 | ||
489 | 489 | ||
490 | 490 | func getMarginRatioByOption (_trader,_option) = { | |
491 | 491 | let $t02111221223 = getPosition(_trader) | |
492 | 492 | let positionSize = $t02111221223._1 | |
493 | 493 | let positionMargin = $t02111221223._2 | |
494 | 494 | let pon = $t02111221223._3 | |
495 | 495 | let positionLstUpdCPF = $t02111221223._4 | |
496 | 496 | let $t02122921322 = getPositionNotionalAndUnrealizedPnl(_trader, _option) | |
497 | 497 | let positionNotional = $t02122921322._1 | |
498 | 498 | let unrealizedPnl = $t02122921322._2 | |
499 | 499 | let $t02132721493 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl) | |
500 | 500 | let remainMargin = $t02132721493._1 | |
501 | 501 | let badDebt = $t02132721493._2 | |
502 | 502 | calcMarginRatio(remainMargin, badDebt, positionNotional) | |
503 | 503 | } | |
504 | 504 | ||
505 | 505 | ||
506 | 506 | func getMarginRatio (_trader) = getMarginRatioByOption(_trader, PNL_OPTION_SPOT) | |
507 | 507 | ||
508 | 508 | ||
509 | 509 | func getPartialLiquidationAmount (_trader,_positionSize) = { | |
510 | 510 | let maximumRatio = vmax(partialLiquidationRatio(), (DECIMAL_UNIT - divd(getMarginRatio(_trader), maintenanceMarginRatio()))) | |
511 | 511 | let maxExchangedPositionSize = muld(abs(_positionSize), maximumRatio) | |
512 | 512 | let swapResult = swapOutput((_positionSize > 0), maxExchangedPositionSize, false) | |
513 | 513 | let maxExchangedQuoteAssetAmount = swapResult._1 | |
514 | 514 | let priceImpact = swapResult._8 | |
515 | 515 | if ((maxPriceImpact() > priceImpact)) | |
516 | 516 | then maxExchangedQuoteAssetAmount | |
517 | 517 | else { | |
518 | 518 | let exchangedPositionSize = muld(abs(_positionSize), partialLiquidationRatio()) | |
519 | 519 | let exchangedQuoteAssetAmount = swapOutput((_positionSize > 0), exchangedPositionSize, false)._1 | |
520 | 520 | exchangedQuoteAssetAmount | |
521 | 521 | } | |
522 | 522 | } | |
523 | 523 | ||
524 | 524 | ||
525 | 525 | func internalClosePosition (_trader,_checkMaxPriceImpact) = { | |
526 | 526 | let $t02272622854 = getPosition(_trader) | |
527 | 527 | let positionSize = $t02272622854._1 | |
528 | 528 | let positionMargin = $t02272622854._2 | |
529 | 529 | let positionOpenNotional = $t02272622854._3 | |
530 | 530 | let positionLstUpdCPF = $t02272622854._4 | |
531 | 531 | let unrealizedPnl = getPositionNotionalAndUnrealizedPnl(_trader, PNL_OPTION_SPOT)._2 | |
532 | 532 | let $t02294923117 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl) | |
533 | 533 | let remainMargin = $t02294923117._1 | |
534 | 534 | let badDebt = $t02294923117._2 | |
535 | 535 | let exchangedPositionSize = -(positionSize) | |
536 | 536 | let realizedPnl = unrealizedPnl | |
537 | 537 | let marginToVault = -(remainMargin) | |
538 | 538 | let $t02324423555 = swapOutput((positionSize > 0), abs(positionSize), _checkMaxPriceImpact) | |
539 | 539 | let exchangedQuoteAssetAmount = $t02324423555._1 | |
540 | 540 | let quoteAssetReserveAfter = $t02324423555._2 | |
541 | 541 | let baseAssetReserveAfter = $t02324423555._3 | |
542 | 542 | let totalPositionSizeAfter = $t02324423555._4 | |
543 | 543 | let cumulativeNotionalAfter = $t02324423555._5 | |
544 | 544 | let totalLongAfter = $t02324423555._6 | |
545 | 545 | let totalShortAfter = $t02324423555._7 | |
546 | 546 | let openInterestNotionalAfter = (openInterestNotional() - positionOpenNotional) | |
547 | 547 | $Tuple12(exchangedPositionSize, badDebt, realizedPnl, marginToVault, quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, exchangedQuoteAssetAmount, totalLongAfter, totalShortAfter) | |
548 | 548 | } | |
549 | 549 | ||
550 | 550 | ||
551 | 551 | func getTwapSpotPrice () = { | |
552 | 552 | let minuteId = ((lastBlock.timestamp / 1000) / 60) | |
553 | 553 | let startMinuteId = (minuteId - TWAP_INTERVAL) | |
554 | 554 | let listStr = valueOrElse(getString(this, k_lastDataStr), "") | |
555 | 555 | let list = split(listStr, ",") | |
556 | 556 | func filterFn (accumulator,next) = if ((startMinuteId >= parseIntValue(next))) | |
557 | 557 | then (accumulator :+ parseIntValue(next)) | |
558 | 558 | else accumulator | |
559 | 559 | ||
560 | 560 | let listF = { | |
561 | 561 | let $l = list | |
562 | 562 | let $s = size($l) | |
563 | 563 | let $acc0 = nil | |
564 | 564 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
565 | 565 | then $a | |
566 | 566 | else filterFn($a, $l[$i]) | |
567 | 567 | ||
568 | 568 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
569 | 569 | then $a | |
570 | 570 | else throw("List size exceeds 20") | |
571 | 571 | ||
572 | 572 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20) | |
573 | 573 | } | |
574 | 574 | let maxIndex = if ((size(listF) > 0)) | |
575 | 575 | then max(listF) | |
576 | 576 | else parseIntValue(list[0]) | |
577 | 577 | let lastMinuteId = valueOrElse(getInteger(this, k_lastMinuteId), 0) | |
578 | 578 | let endLastCumulativePrice = valueOrElse(getInteger(this, ((k_twapDataLastCumulativePrice + "_") + toString(lastMinuteId))), 0) | |
579 | 579 | let endLastPrice = valueOrElse(getInteger(this, ((k_twapDataLastPrice + "_") + toString(lastMinuteId))), 0) | |
580 | 580 | let nowCumulativePrice = (endLastCumulativePrice + ((minuteId - lastMinuteId) * endLastPrice)) | |
581 | 581 | let startLastCumulativePrice = valueOrElse(getInteger(this, ((k_twapDataLastCumulativePrice + "_") + toString(maxIndex))), 0) | |
582 | 582 | let startLastPrice = valueOrElse(getInteger(this, ((k_twapDataLastPrice + "_") + toString(maxIndex))), 0) | |
583 | 583 | let startCumulativePrice = (startLastCumulativePrice + ((startMinuteId - maxIndex) * startLastPrice)) | |
584 | 584 | ((nowCumulativePrice - startCumulativePrice) / TWAP_INTERVAL) | |
585 | 585 | } | |
586 | 586 | ||
587 | 587 | ||
588 | 588 | func getPegAdjustCost (_price) = { | |
589 | 589 | let _positionSize = totalPositionSize() | |
590 | 590 | let direction = (_positionSize > 0) | |
591 | 591 | let currentNetMarketValue = swapOutput(direction, abs(_positionSize), false)._1 | |
592 | 592 | let baseAssetReserve = bsAstR() | |
593 | 593 | let newQuoteAssetReserve = muld(baseAssetReserve, _price) | |
594 | 594 | let cost = getPositionNotionalAndUnrealizedPnlByValues(_positionSize, currentNetMarketValue, newQuoteAssetReserve, baseAssetReserve, PNL_OPTION_SPOT)._2 | |
595 | 595 | $Tuple2(newQuoteAssetReserve, cost) | |
596 | 596 | } | |
597 | 597 | ||
598 | 598 | ||
599 | + | func getFunding () = { | |
600 | + | let underlyingPrice = getOracleTwapPrice() | |
601 | + | let spotTwapPrice = getTwapSpotPrice() | |
602 | + | let premium = (spotTwapPrice - underlyingPrice) | |
603 | + | if (if ((totalShortPositionSize() == 0)) | |
604 | + | then true | |
605 | + | else (totalLongPositionSize() == 0)) | |
606 | + | then $Tuple2(0, 0) | |
607 | + | else if ((0 > premium)) | |
608 | + | then { | |
609 | + | let shortPremiumFraction = divd(muld(premium, fundingPeriodDecimal()), ONE_DAY) | |
610 | + | let longPremiumFraction = divd(muld(shortPremiumFraction, totalShortPositionSize()), totalLongPositionSize()) | |
611 | + | $Tuple2(shortPremiumFraction, longPremiumFraction) | |
612 | + | } | |
613 | + | else { | |
614 | + | let longPremiumFraction = divd(muld(premium, fundingPeriodDecimal()), ONE_DAY) | |
615 | + | let shortPremiumFraction = divd(muld(longPremiumFraction, totalLongPositionSize()), totalShortPositionSize()) | |
616 | + | $Tuple2(shortPremiumFraction, longPremiumFraction) | |
617 | + | } | |
618 | + | } | |
619 | + | ||
620 | + | ||
599 | 621 | func updateSettings (_initMarginRatio,_mmr,_liquidationFeeRatio,_fundingPeriod,_fee,_spreadLimit,_maxPriceImpact,_partialLiquidationRatio,_maxPriceSpread) = [IntegerEntry(k_initMarginRatio, _initMarginRatio), IntegerEntry(k_maintenanceMarginRatio, _mmr), IntegerEntry(k_liquidationFeeRatio, _liquidationFeeRatio), IntegerEntry(k_fundingPeriod, _fundingPeriod), IntegerEntry(k_fee, _fee), IntegerEntry(k_spreadLimit, _spreadLimit), IntegerEntry(k_maxPriceImpact, _maxPriceImpact), IntegerEntry(k_partialLiquidationRatio, _partialLiquidationRatio), IntegerEntry(k_maxPriceSpread, _maxPriceSpread)] | |
600 | 622 | ||
601 | 623 | ||
602 | 624 | func updateFunding (_nextFundingBlock,_latestLongCumulativePremiumFraction,_latestShortCumulativePremiumFraction,_longFundingRate,_shortFundingRate) = [IntegerEntry(k_nextFundingBlock, _nextFundingBlock), IntegerEntry(k_latestLongCumulativePremiumFraction, _latestLongCumulativePremiumFraction), IntegerEntry(k_latestShortCumulativePremiumFraction, _latestShortCumulativePremiumFraction), IntegerEntry(k_longFundingRate, _longFundingRate), IntegerEntry(k_shortFundingRate, _shortFundingRate)] | |
603 | 625 | ||
604 | 626 | ||
605 | 627 | func updatePosition (_address,_size,_margin,_openNotional,_latestCumulativePremiumFraction) = [IntegerEntry(toCompositeKey(k_positionSize, _address), _size), IntegerEntry(toCompositeKey(k_positionMargin, _address), _margin), IntegerEntry(toCompositeKey(k_positionOpenNotional, _address), _openNotional), IntegerEntry(toCompositeKey(k_positionLastUpdatedCumulativePremiumFraction, _address), _latestCumulativePremiumFraction)] | |
606 | 628 | ||
607 | 629 | ||
608 | 630 | func appendTwap (price) = { | |
609 | 631 | let minuteId = ((lastBlock.timestamp / 1000) / 60) | |
610 | 632 | let previousMinuteId = valueOrElse(getInteger(this, k_lastMinuteId), 0) | |
611 | 633 | if ((previousMinuteId > minuteId)) | |
612 | 634 | then throw("TWAP out-of-order") | |
613 | 635 | else { | |
614 | 636 | let lastMinuteId = if ((previousMinuteId == 0)) | |
615 | 637 | then minuteId | |
616 | 638 | else previousMinuteId | |
617 | 639 | if ((minuteId > previousMinuteId)) | |
618 | 640 | then { | |
619 | 641 | let prevCumulativePrice = valueOrElse(getInteger(this, ((k_twapDataLastCumulativePrice + "_") + toString(previousMinuteId))), 0) | |
620 | 642 | let prevPrice = valueOrElse(getInteger(this, ((k_twapDataLastPrice + "_") + toString(previousMinuteId))), price) | |
621 | 643 | let lastCumulativePrice = (prevCumulativePrice + ((minuteId - lastMinuteId) * prevPrice)) | |
622 | 644 | let list = pushToQueue(strToList(valueOrElse(getString(this, k_lastDataStr), "")), TWAP_INTERVAL, toString(minuteId)) | |
623 | 645 | [IntegerEntry(toCompositeKey(k_twapDataLastCumulativePrice, toString(minuteId)), lastCumulativePrice), IntegerEntry(toCompositeKey(k_twapDataLastPrice, toString(minuteId)), price), IntegerEntry(toCompositeKey(k_twapDataPreviousMinuteId, toString(minuteId)), previousMinuteId), IntegerEntry(k_lastMinuteId, minuteId), StringEntry(k_lastDataStr, listToStr(list))] | |
624 | 646 | } | |
625 | 647 | else { | |
626 | 648 | let twapDataPreviousMinuteId = valueOrElse(getInteger(this, toCompositeKey(k_twapDataPreviousMinuteId, toString(minuteId))), 0) | |
627 | 649 | let prevCumulativePrice = valueOrElse(getInteger(this, toCompositeKey(k_twapDataLastCumulativePrice, toString(twapDataPreviousMinuteId))), 0) | |
628 | 650 | let prevPrice = valueOrElse(getInteger(this, toCompositeKey(k_twapDataLastPrice, toString(twapDataPreviousMinuteId))), price) | |
629 | 651 | let lastCumulativePrice = (prevCumulativePrice + ((minuteId - twapDataPreviousMinuteId) * prevPrice)) | |
630 | 652 | [IntegerEntry(toCompositeKey(k_twapDataLastCumulativePrice, toString(minuteId)), lastCumulativePrice), IntegerEntry(toCompositeKey(k_twapDataLastPrice, toString(minuteId)), price)] | |
631 | 653 | } | |
632 | 654 | } | |
633 | 655 | } | |
634 | 656 | ||
635 | 657 | ||
636 | 658 | func updateAmmReserves (_qtAstR,_bsAstR) = [IntegerEntry(k_quoteAssetReserve, _qtAstR), IntegerEntry(k_baseAssetReserve, _bsAstR)] | |
637 | 659 | ||
638 | 660 | ||
639 | 661 | func updateAmm (_qtAstR,_bsAstR,_totalPositionSizeAfter,_cumulativeNotionalAfter,_openInterestNotional,_totalLongPositionSize,_totalShortPositionSize) = if (((_totalLongPositionSize - _totalShortPositionSize) != _totalPositionSizeAfter)) | |
640 | 662 | then throw(((((("Invalid AMM state data: " + toString(_totalLongPositionSize)) + " + ") + toString(_totalShortPositionSize)) + " != ") + toString(_totalPositionSizeAfter))) | |
641 | 663 | else ((updateAmmReserves(_qtAstR, _bsAstR) ++ [IntegerEntry(k_totalPositionSize, _totalPositionSizeAfter), IntegerEntry(k_cumulativeNotional, _cumulativeNotionalAfter), IntegerEntry(k_openInterestNotional, _openInterestNotional), IntegerEntry(k_totalLongPositionSize, _totalLongPositionSize), IntegerEntry(k_totalShortPositionSize, _totalShortPositionSize)]) ++ appendTwap(divd(_qtAstR, _bsAstR))) | |
642 | 664 | ||
643 | 665 | ||
644 | 666 | func deletePosition (_address) = [DeleteEntry(toCompositeKey(k_positionSize, _address)), DeleteEntry(toCompositeKey(k_positionMargin, _address)), DeleteEntry(toCompositeKey(k_positionOpenNotional, _address)), DeleteEntry(toCompositeKey(k_positionLastUpdatedCumulativePremiumFraction, _address)), IntegerEntry(toCompositeKey(k_positionClosedDate, _address), lastBlock.timestamp)] | |
645 | 667 | ||
646 | 668 | ||
647 | 669 | func withdraw (_address,_amount) = { | |
648 | 670 | let balance = assetBalance(this, quoteAsset()) | |
649 | 671 | if ((_amount > balance)) | |
650 | 672 | then throw(((("Unable to withdraw " + toString(_amount)) + " from contract balance ") + toString(balance))) | |
651 | 673 | else [ScriptTransfer(_address, _amount, quoteAsset())] | |
652 | 674 | } | |
653 | 675 | ||
654 | 676 | ||
655 | 677 | func updateBalance (i) = if ((0 > i)) | |
656 | 678 | then throw("Balance") | |
657 | 679 | else [IntegerEntry(k_balance, i)] | |
658 | 680 | ||
659 | 681 | ||
660 | 682 | func transferFee (i) = [ScriptTransfer(stakingAddress(), i, quoteAsset())] | |
661 | 683 | ||
662 | 684 | ||
663 | 685 | @Callable(i) | |
664 | 686 | func pause () = if ((i.caller != adminAddress())) | |
665 | 687 | then throw("Invalid togglePause params") | |
666 | 688 | else [BooleanEntry(k_paused, true)] | |
667 | 689 | ||
668 | 690 | ||
669 | 691 | ||
670 | 692 | @Callable(i) | |
671 | 693 | func unpause () = if ((i.caller != adminAddress())) | |
672 | 694 | then throw("Invalid togglePause params") | |
673 | 695 | else [BooleanEntry(k_paused, false)] | |
674 | 696 | ||
675 | 697 | ||
676 | 698 | ||
677 | 699 | @Callable(i) | |
678 | 700 | func addLiquidity (_quoteAssetAmount) = if (if ((i.caller != adminAddress())) | |
679 | 701 | then true | |
680 | 702 | else (0 >= _quoteAssetAmount)) | |
681 | 703 | then throw("Invalid addLiquidity params") | |
682 | 704 | else { | |
683 | 705 | let _qtAstR = qtAstR() | |
684 | 706 | let _bsAstR = bsAstR() | |
685 | 707 | let price = divd(_qtAstR, _bsAstR) | |
686 | 708 | let baseAssetAmountToAdd = divd(_quoteAssetAmount, price) | |
687 | 709 | let qtAstRAfter = (_qtAstR + _quoteAssetAmount) | |
688 | 710 | let bsAstRAfter = (_bsAstR + baseAssetAmountToAdd) | |
689 | 711 | updateAmmReserves(qtAstRAfter, bsAstRAfter) | |
690 | 712 | } | |
691 | 713 | ||
692 | 714 | ||
693 | 715 | ||
694 | 716 | @Callable(i) | |
695 | 717 | func removeLiquidity (_quoteAssetAmount) = if (if ((i.caller != adminAddress())) | |
696 | 718 | then true | |
697 | 719 | else (0 >= _quoteAssetAmount)) | |
698 | 720 | then throw("Invalid removeLiquidity params") | |
699 | 721 | else { | |
700 | 722 | let _qtAstR = qtAstR() | |
701 | 723 | let _bsAstR = bsAstR() | |
702 | 724 | let price = divd(_qtAstR, _bsAstR) | |
703 | 725 | let baseAssetAmountToRemove = divd(_quoteAssetAmount, price) | |
704 | 726 | let qtAstRAfter = (_qtAstR - _quoteAssetAmount) | |
705 | 727 | let bsAstRAfter = (_bsAstR - baseAssetAmountToRemove) | |
706 | 728 | updateAmmReserves(qtAstRAfter, bsAstRAfter) | |
707 | 729 | } | |
708 | 730 | ||
709 | 731 | ||
710 | 732 | ||
711 | 733 | @Callable(i) | |
712 | 734 | func changeSettings (_initMarginRatio,_mmr,_liquidationFeeRatio,_fundingPeriod,_fee,_spreadLimit,_maxPriceImpact,_partialLiquidationRatio,_maxPriceSpread) = if ((i.caller != adminAddress())) | |
713 | 735 | then throw("Invalid changeSettings params") | |
714 | 736 | else updateSettings(_initMarginRatio, _mmr, _liquidationFeeRatio, _fundingPeriod, _fee, _spreadLimit, _maxPriceImpact, _partialLiquidationRatio, _maxPriceSpread) | |
715 | 737 | ||
716 | 738 | ||
717 | 739 | ||
718 | 740 | @Callable(i) | |
719 | 741 | func initialize (_qtAstR,_bsAstR,_fundingPeriod,_initMarginRatio,_mmr,_liquidationFeeRatio,_fee,_oracle,_oracleKey,_coordinator,_spreadLimit,_maxPriceImpact,_partialLiquidationRatio,_maxPriceSpread) = if (if (if (if (if (if (if (if (if (if (if (if ((0 >= _qtAstR)) | |
720 | 742 | then true | |
721 | 743 | else (0 >= _bsAstR)) | |
722 | 744 | then true | |
723 | 745 | else (0 >= _fundingPeriod)) | |
724 | 746 | then true | |
725 | 747 | else (0 >= _initMarginRatio)) | |
726 | 748 | then true | |
727 | 749 | else (0 >= _mmr)) | |
728 | 750 | then true | |
729 | 751 | else (0 >= _liquidationFeeRatio)) | |
730 | 752 | then true | |
731 | 753 | else (0 >= _fee)) | |
732 | 754 | then true | |
733 | 755 | else (0 >= _spreadLimit)) | |
734 | 756 | then true | |
735 | 757 | else (0 >= _maxPriceImpact)) | |
736 | 758 | then true | |
737 | 759 | else (0 >= _partialLiquidationRatio)) | |
738 | 760 | then true | |
739 | 761 | else (0 >= _maxPriceSpread)) | |
740 | 762 | then true | |
741 | 763 | else initialized()) | |
742 | 764 | then throw("Invalid initialize parameters") | |
743 | 765 | else ((((updateAmm(_qtAstR, _bsAstR, 0, 0, 0, 0, 0) ++ updateSettings(_initMarginRatio, _mmr, _liquidationFeeRatio, _fundingPeriod, _fee, _spreadLimit, _maxPriceImpact, _partialLiquidationRatio, _maxPriceSpread)) ++ updateFunding((lastBlock.timestamp + _fundingPeriod), 0, 0, 0, 0)) ++ updateBalance(0)) ++ [BooleanEntry(k_initialized, true), StringEntry(k_ora, _oracle), StringEntry(k_ora_key, _oracleKey), StringEntry(k_coordinatorAddress, _coordinator)]) | |
744 | 766 | ||
745 | 767 | ||
746 | 768 | ||
747 | 769 | @Callable(i) | |
748 | 770 | func setInitMarginRatio (_initMarginRatio) = if (if ((0 >= _initMarginRatio)) | |
749 | 771 | then true | |
750 | 772 | else !(initialized())) | |
751 | 773 | then throw("Invalid setInitMarginRatio parameters") | |
752 | 774 | else updateSettings(_initMarginRatio, maintenanceMarginRatio(), liquidationFeeRatio(), fundingPeriodRaw(), fee(), spreadLimit(), maxPriceImpact(), partialLiquidationRatio(), maxPriceSpread()) | |
753 | 775 | ||
754 | 776 | ||
755 | 777 | ||
756 | 778 | @Callable(i) | |
757 | 779 | func decreasePosition (_amount,_leverage,_minBaseAssetAmount) = if (if (if (if (if ((0 >= _amount)) | |
758 | 780 | then true | |
759 | 781 | else !(initialized())) | |
760 | 782 | then true | |
761 | 783 | else !(requireMoreMarginRatio(divd(DECIMAL_UNIT, _leverage), initMarginRatio(), true))) | |
762 | 784 | then true | |
763 | 785 | else !(requireOpenPosition(toString(i.caller)))) | |
764 | 786 | then true | |
765 | 787 | else paused()) | |
766 | 788 | then throw("Invalid decreasePosition parameters") | |
767 | 789 | else { | |
768 | - | let $ | |
769 | - | let oldPositionSize = $ | |
770 | - | let oldPositionMargin = $ | |
771 | - | let oldPositionOpenNotional = $ | |
772 | - | let oldPositionLstUpdCPF = $ | |
790 | + | let $t03733137483 = getPosition(toString(i.caller)) | |
791 | + | let oldPositionSize = $t03733137483._1 | |
792 | + | let oldPositionMargin = $t03733137483._2 | |
793 | + | let oldPositionOpenNotional = $t03733137483._3 | |
794 | + | let oldPositionLstUpdCPF = $t03733137483._4 | |
773 | 795 | let _direction = if ((oldPositionSize > 0)) | |
774 | 796 | then DIR_SHORT | |
775 | 797 | else DIR_LONG | |
776 | 798 | let isAdd = (_direction == DIR_LONG) | |
777 | 799 | let openNotional = muld(_amount, _leverage) | |
778 | - | let $ | |
779 | - | let oldPositionNotional = $ | |
780 | - | let unrealizedPnl = $ | |
781 | - | let $ | |
800 | + | let $t03765637772 = getPositionNotionalAndUnrealizedPnl(toString(i.caller), PNL_OPTION_SPOT) | |
801 | + | let oldPositionNotional = $t03765637772._1 | |
802 | + | let unrealizedPnl = $t03765637772._2 | |
803 | + | let $t03777840327 = if ((oldPositionNotional > openNotional)) | |
782 | 804 | then { | |
783 | - | let $ | |
784 | - | let exchangedPositionSize = $ | |
785 | - | let quoteAssetReserveAfter = $ | |
786 | - | let baseAssetReserveAfter = $ | |
787 | - | let totalPositionSizeAfter = $ | |
788 | - | let cumulativeNotionalAfter = $ | |
805 | + | let $t03815538374 = swapInput(isAdd, openNotional) | |
806 | + | let exchangedPositionSize = $t03815538374._1 | |
807 | + | let quoteAssetReserveAfter = $t03815538374._2 | |
808 | + | let baseAssetReserveAfter = $t03815538374._3 | |
809 | + | let totalPositionSizeAfter = $t03815538374._4 | |
810 | + | let cumulativeNotionalAfter = $t03815538374._5 | |
789 | 811 | let exchangedPositionSizeAbs = abs(exchangedPositionSize) | |
790 | 812 | if (if ((_minBaseAssetAmount != 0)) | |
791 | 813 | then (_minBaseAssetAmount > exchangedPositionSizeAbs) | |
792 | 814 | else false) | |
793 | 815 | then throw(((("Too little base asset exchanged, got " + toString(exchangedPositionSizeAbs)) + " expected ") + toString(_minBaseAssetAmount))) | |
794 | 816 | else { | |
795 | 817 | let realizedPnl = divd(muld(unrealizedPnl, exchangedPositionSizeAbs), abs(oldPositionSize)) | |
796 | - | let $ | |
797 | - | let remainMargin = $ | |
798 | - | let badDebt = $ | |
799 | - | let fundingPayment = $ | |
818 | + | let $t03881139056 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, realizedPnl) | |
819 | + | let remainMargin = $t03881139056._1 | |
820 | + | let badDebt = $t03881139056._2 | |
821 | + | let fundingPayment = $t03881139056._3 | |
800 | 822 | let exchangedQuoteAssetAmount = openNotional | |
801 | 823 | let unrealizedPnlAfter = (unrealizedPnl - realizedPnl) | |
802 | 824 | let remainOpenNotional = if ((oldPositionSize > 0)) | |
803 | 825 | then ((oldPositionNotional - exchangedQuoteAssetAmount) - unrealizedPnlAfter) | |
804 | 826 | else ((unrealizedPnlAfter + oldPositionNotional) - exchangedQuoteAssetAmount) | |
805 | 827 | let newPositionSize = (oldPositionSize + exchangedPositionSize) | |
806 | 828 | $Tuple11(newPositionSize, remainMargin, abs(remainOpenNotional), latestCumulativePremiumFraction(newPositionSize), baseAssetReserveAfter, quoteAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, (openInterestNotional() - openNotional), (totalLongPositionSize() - (if ((newPositionSize > 0)) | |
807 | 829 | then abs(exchangedPositionSize) | |
808 | 830 | else 0)), (totalShortPositionSize() - (if ((0 > newPositionSize)) | |
809 | 831 | then abs(exchangedPositionSize) | |
810 | 832 | else 0))) | |
811 | 833 | } | |
812 | 834 | } | |
813 | 835 | else throw("Close position first") | |
814 | - | let newPositionSize = $ | |
815 | - | let newPositionRemainMargin = $ | |
816 | - | let newPositionOpenNotional = $ | |
817 | - | let newPositionLatestCPF = $ | |
818 | - | let baseAssetReserveAfter = $ | |
819 | - | let quoteAssetReserveAfter = $ | |
820 | - | let totalPositionSizeAfter = $ | |
821 | - | let cumulativeNotionalAfter = $ | |
822 | - | let openInterestNotionalAfter = $ | |
823 | - | let totalLongAfter = $ | |
824 | - | let totalShortAfter = $ | |
836 | + | let newPositionSize = $t03777840327._1 | |
837 | + | let newPositionRemainMargin = $t03777840327._2 | |
838 | + | let newPositionOpenNotional = $t03777840327._3 | |
839 | + | let newPositionLatestCPF = $t03777840327._4 | |
840 | + | let baseAssetReserveAfter = $t03777840327._5 | |
841 | + | let quoteAssetReserveAfter = $t03777840327._6 | |
842 | + | let totalPositionSizeAfter = $t03777840327._7 | |
843 | + | let cumulativeNotionalAfter = $t03777840327._8 | |
844 | + | let openInterestNotionalAfter = $t03777840327._9 | |
845 | + | let totalLongAfter = $t03777840327._10 | |
846 | + | let totalShortAfter = $t03777840327._11 | |
825 | 847 | let notifyNotional = invoke(minerAddress(), "notifyNotional", [toString(i.caller), newPositionOpenNotional], nil) | |
826 | 848 | if ((notifyNotional == notifyNotional)) | |
827 | 849 | then (updatePosition(toString(i.caller), newPositionSize, newPositionRemainMargin, newPositionOpenNotional, newPositionLatestCPF) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter)) | |
828 | 850 | else throw("Strict value is not equal to itself.") | |
829 | 851 | } | |
830 | 852 | ||
831 | 853 | ||
832 | 854 | ||
833 | 855 | @Callable(i) | |
834 | 856 | func increasePosition (_direction,_leverage,_minBaseAssetAmount,_refLink) = { | |
835 | 857 | let _rawAmount = i.payments[0].amount | |
836 | 858 | if (if (if (if (if (if (if ((_direction != DIR_LONG)) | |
837 | 859 | then (_direction != DIR_SHORT) | |
838 | 860 | else false) | |
839 | 861 | then true | |
840 | 862 | else (0 >= _rawAmount)) | |
841 | 863 | then true | |
842 | 864 | else !(initialized())) | |
843 | 865 | then true | |
844 | 866 | else (i.payments[0].assetId != quoteAsset())) | |
845 | 867 | then true | |
846 | 868 | else !(requireMoreMarginRatio(divd(DECIMAL_UNIT, _leverage), initMarginRatio(), true))) | |
847 | 869 | then true | |
848 | 870 | else paused()) | |
849 | 871 | then throw("Invalid increasePosition parameters") | |
850 | 872 | else { | |
851 | 873 | let _trader = toString(i.caller) | |
852 | 874 | let rawFeeAmount = muld(_rawAmount, fee()) | |
853 | 875 | let referrerFeeAny = invoke(referralAddress(), "acceptPaymentWithLink", [_trader, _refLink], [AttachedPayment(quoteAsset(), rawFeeAmount)]) | |
854 | 876 | if ((referrerFeeAny == referrerFeeAny)) | |
855 | 877 | then { | |
856 | 878 | let referrerFee = match referrerFeeAny { | |
857 | 879 | case x: Int => | |
858 | 880 | x | |
859 | 881 | case _ => | |
860 | 882 | throw("Invalid referrerFee") | |
861 | 883 | } | |
862 | 884 | let _amount = (_rawAmount - rawFeeAmount) | |
863 | 885 | let feeAmount = (rawFeeAmount - referrerFee) | |
864 | - | let $ | |
865 | - | let oldPositionSize = $ | |
866 | - | let oldPositionMargin = $ | |
867 | - | let oldPositionOpenNotional = $ | |
868 | - | let oldPositionLstUpdCPF = $ | |
886 | + | let $t04185641996 = getPosition(_trader) | |
887 | + | let oldPositionSize = $t04185641996._1 | |
888 | + | let oldPositionMargin = $t04185641996._2 | |
889 | + | let oldPositionOpenNotional = $t04185641996._3 | |
890 | + | let oldPositionLstUpdCPF = $t04185641996._4 | |
869 | 891 | let isNewPosition = (oldPositionSize == 0) | |
870 | 892 | let isSameDirection = if ((oldPositionSize > 0)) | |
871 | 893 | then (_direction == DIR_LONG) | |
872 | 894 | else (_direction == DIR_SHORT) | |
873 | 895 | let expandExisting = if (!(isNewPosition)) | |
874 | 896 | then isSameDirection | |
875 | 897 | else false | |
876 | 898 | let isAdd = (_direction == DIR_LONG) | |
877 | - | let $ | |
899 | + | let $t04228544853 = if (if (isNewPosition) | |
878 | 900 | then true | |
879 | 901 | else expandExisting) | |
880 | 902 | then { | |
881 | 903 | let openNotional = muld(_amount, _leverage) | |
882 | - | let $ | |
883 | - | let amountBaseAssetBought = $ | |
884 | - | let quoteAssetReserveAfter = $ | |
885 | - | let baseAssetReserveAfter = $ | |
886 | - | let totalPositionSizeAfter = $ | |
887 | - | let cumulativeNotionalAfter = $ | |
904 | + | let $t04270942915 = swapInput(isAdd, openNotional) | |
905 | + | let amountBaseAssetBought = $t04270942915._1 | |
906 | + | let quoteAssetReserveAfter = $t04270942915._2 | |
907 | + | let baseAssetReserveAfter = $t04270942915._3 | |
908 | + | let totalPositionSizeAfter = $t04270942915._4 | |
909 | + | let cumulativeNotionalAfter = $t04270942915._5 | |
888 | 910 | if (if ((_minBaseAssetAmount != 0)) | |
889 | 911 | then (_minBaseAssetAmount > abs(amountBaseAssetBought)) | |
890 | 912 | else false) | |
891 | 913 | then throw(((("Limit error: " + toString(abs(amountBaseAssetBought))) + " < ") + toString(_minBaseAssetAmount))) | |
892 | 914 | else { | |
893 | 915 | let newPositionSize = (oldPositionSize + amountBaseAssetBought) | |
894 | 916 | let increaseMarginRequirement = divd(openNotional, _leverage) | |
895 | - | let $ | |
896 | - | let remainMargin = $ | |
897 | - | let x1 = $ | |
898 | - | let x2 = $ | |
917 | + | let $t04329643535 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, increaseMarginRequirement) | |
918 | + | let remainMargin = $t04329643535._1 | |
919 | + | let x1 = $t04329643535._2 | |
920 | + | let x2 = $t04329643535._3 | |
899 | 921 | if (!(requireNotOverSpreadLimit(quoteAssetReserveAfter, baseAssetReserveAfter))) | |
900 | 922 | then throw("Over max spread limit") | |
901 | 923 | else $Tuple11(newPositionSize, remainMargin, (oldPositionOpenNotional + openNotional), latestCumulativePremiumFraction(newPositionSize), baseAssetReserveAfter, quoteAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, (openInterestNotional() + openNotional), (totalLongPositionSize() + (if ((newPositionSize > 0)) | |
902 | 924 | then abs(amountBaseAssetBought) | |
903 | 925 | else 0)), (totalShortPositionSize() + (if ((0 > newPositionSize)) | |
904 | 926 | then abs(amountBaseAssetBought) | |
905 | 927 | else 0))) | |
906 | 928 | } | |
907 | 929 | } | |
908 | 930 | else { | |
909 | 931 | let openNotional = muld(_amount, _leverage) | |
910 | - | let $ | |
911 | - | let oldPositionNotional = $ | |
912 | - | let unrealizedPnl = $ | |
932 | + | let $t04454644662 = getPositionNotionalAndUnrealizedPnl(toString(i.caller), PNL_OPTION_SPOT) | |
933 | + | let oldPositionNotional = $t04454644662._1 | |
934 | + | let unrealizedPnl = $t04454644662._2 | |
913 | 935 | if ((oldPositionNotional > openNotional)) | |
914 | 936 | then throw("Use decreasePosition to decrease position size") | |
915 | 937 | else throw("Close position first") | |
916 | 938 | } | |
917 | - | let newPositionSize = $ | |
918 | - | let newPositionRemainMargin = $ | |
919 | - | let newPositionOpenNotional = $ | |
920 | - | let newPositionLatestCPF = $ | |
921 | - | let baseAssetReserveAfter = $ | |
922 | - | let quoteAssetReserveAfter = $ | |
923 | - | let totalPositionSizeAfter = $ | |
924 | - | let cumulativeNotionalAfter = $ | |
925 | - | let openInterestNotionalAfter = $ | |
926 | - | let totalLongAfter = $ | |
927 | - | let totalShortAfter = $ | |
939 | + | let newPositionSize = $t04228544853._1 | |
940 | + | let newPositionRemainMargin = $t04228544853._2 | |
941 | + | let newPositionOpenNotional = $t04228544853._3 | |
942 | + | let newPositionLatestCPF = $t04228544853._4 | |
943 | + | let baseAssetReserveAfter = $t04228544853._5 | |
944 | + | let quoteAssetReserveAfter = $t04228544853._6 | |
945 | + | let totalPositionSizeAfter = $t04228544853._7 | |
946 | + | let cumulativeNotionalAfter = $t04228544853._8 | |
947 | + | let openInterestNotionalAfter = $t04228544853._9 | |
948 | + | let totalLongAfter = $t04228544853._10 | |
949 | + | let totalShortAfter = $t04228544853._11 | |
928 | 950 | let feeToStakers = (feeAmount / 2) | |
929 | 951 | let feeToInsurance = (feeAmount - feeToStakers) | |
930 | 952 | let stake = invoke(quoteAssetStaking(), "lockNeutrinoSP", [toString(stakingAddress()), ALL_FEES], [AttachedPayment(quoteAsset(), _amount)]) | |
931 | 953 | if ((stake == stake)) | |
932 | 954 | then { | |
933 | 955 | let depositInsurance = invoke(insuranceAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), feeToInsurance)]) | |
934 | 956 | if ((depositInsurance == depositInsurance)) | |
935 | 957 | then { | |
936 | 958 | let notifyFee = invoke(minerAddress(), "notifyFees", [_trader, feeAmount], nil) | |
937 | 959 | if ((notifyFee == notifyFee)) | |
938 | 960 | then { | |
939 | 961 | let notifyNotional = invoke(minerAddress(), "notifyNotional", [_trader, newPositionOpenNotional], nil) | |
940 | 962 | if ((notifyNotional == notifyNotional)) | |
941 | 963 | then (((updatePosition(_trader, newPositionSize, newPositionRemainMargin, newPositionOpenNotional, newPositionLatestCPF) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter)) ++ transferFee(feeToStakers)) ++ updateBalance((cbalance() + _amount))) | |
942 | 964 | else throw("Strict value is not equal to itself.") | |
943 | 965 | } | |
944 | 966 | else throw("Strict value is not equal to itself.") | |
945 | 967 | } | |
946 | 968 | else throw("Strict value is not equal to itself.") | |
947 | 969 | } | |
948 | 970 | else throw("Strict value is not equal to itself.") | |
949 | 971 | } | |
950 | 972 | else throw("Strict value is not equal to itself.") | |
951 | 973 | } | |
952 | 974 | } | |
953 | 975 | ||
954 | 976 | ||
955 | 977 | ||
956 | 978 | @Callable(i) | |
957 | 979 | func addMargin () = { | |
958 | 980 | let _rawAmount = i.payments[0].amount | |
959 | 981 | if (if (if (if ((i.payments[0].assetId != quoteAsset())) | |
960 | 982 | then true | |
961 | 983 | else !(requireOpenPosition(toString(i.caller)))) | |
962 | 984 | then true | |
963 | 985 | else !(initialized())) | |
964 | 986 | then true | |
965 | 987 | else paused()) | |
966 | 988 | then throw("Invalid addMargin parameters") | |
967 | 989 | else { | |
968 | 990 | let _trader = toString(i.caller) | |
969 | 991 | let rawFeeAmount = muld(_rawAmount, fee()) | |
970 | 992 | let referrerFeeAny = invoke(referralAddress(), "acceptPayment", [_trader], [AttachedPayment(quoteAsset(), rawFeeAmount)]) | |
971 | 993 | if ((referrerFeeAny == referrerFeeAny)) | |
972 | 994 | then { | |
973 | 995 | let referrerFee = match referrerFeeAny { | |
974 | 996 | case x: Int => | |
975 | 997 | x | |
976 | 998 | case _ => | |
977 | 999 | throw("Invalid referrerFee") | |
978 | 1000 | } | |
979 | 1001 | let feeAmount = (rawFeeAmount - referrerFee) | |
980 | 1002 | let _amount = (_rawAmount - rawFeeAmount) | |
981 | - | let $ | |
982 | - | let oldPositionSize = $ | |
983 | - | let oldPositionMargin = $ | |
984 | - | let oldPositionOpenNotional = $ | |
985 | - | let oldPositionLstUpdCPF = $ | |
1003 | + | let $t04674646886 = getPosition(_trader) | |
1004 | + | let oldPositionSize = $t04674646886._1 | |
1005 | + | let oldPositionMargin = $t04674646886._2 | |
1006 | + | let oldPositionOpenNotional = $t04674646886._3 | |
1007 | + | let oldPositionLstUpdCPF = $t04674646886._4 | |
986 | 1008 | let feeToStakers = (feeAmount / 2) | |
987 | 1009 | let feeToInsurance = (feeAmount - feeToStakers) | |
988 | 1010 | let stake = invoke(quoteAssetStaking(), "lockNeutrinoSP", [toString(stakingAddress()), ALL_FEES], [AttachedPayment(quoteAsset(), _amount)]) | |
989 | 1011 | if ((stake == stake)) | |
990 | 1012 | then { | |
991 | 1013 | let depositInsurance = invoke(insuranceAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), feeToInsurance)]) | |
992 | 1014 | if ((depositInsurance == depositInsurance)) | |
993 | 1015 | then { | |
994 | 1016 | let notifyFee = invoke(minerAddress(), "notifyFees", [_trader, feeAmount], nil) | |
995 | 1017 | if ((notifyFee == notifyFee)) | |
996 | 1018 | then ((updatePosition(_trader, oldPositionSize, (oldPositionMargin + _amount), oldPositionOpenNotional, oldPositionLstUpdCPF) ++ transferFee(feeToStakers)) ++ updateBalance((cbalance() + _amount))) | |
997 | 1019 | else throw("Strict value is not equal to itself.") | |
998 | 1020 | } | |
999 | 1021 | else throw("Strict value is not equal to itself.") | |
1000 | 1022 | } | |
1001 | 1023 | else throw("Strict value is not equal to itself.") | |
1002 | 1024 | } | |
1003 | 1025 | else throw("Strict value is not equal to itself.") | |
1004 | 1026 | } | |
1005 | 1027 | } | |
1006 | 1028 | ||
1007 | 1029 | ||
1008 | 1030 | ||
1009 | 1031 | @Callable(i) | |
1010 | 1032 | func removeMargin (_amount) = if (if (if (if ((0 >= _amount)) | |
1011 | 1033 | then true | |
1012 | 1034 | else !(requireOpenPosition(toString(i.caller)))) | |
1013 | 1035 | then true | |
1014 | 1036 | else !(initialized())) | |
1015 | 1037 | then true | |
1016 | 1038 | else paused()) | |
1017 | 1039 | then throw("Invalid removeMargin parameters") | |
1018 | 1040 | else { | |
1019 | - | let $ | |
1020 | - | let oldPositionSize = $ | |
1021 | - | let oldPositionMargin = $ | |
1022 | - | let oldPositionOpenNotional = $ | |
1023 | - | let oldPositionLstUpdCPF = $ | |
1041 | + | let $t04791148063 = getPosition(toString(i.caller)) | |
1042 | + | let oldPositionSize = $t04791148063._1 | |
1043 | + | let oldPositionMargin = $t04791148063._2 | |
1044 | + | let oldPositionOpenNotional = $t04791148063._3 | |
1045 | + | let oldPositionLstUpdCPF = $t04791148063._4 | |
1024 | 1046 | let marginDelta = -(_amount) | |
1025 | - | let $ | |
1026 | - | let remainMargin = $ | |
1027 | - | let badDebt = $ | |
1047 | + | let $t04810048279 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, marginDelta) | |
1048 | + | let remainMargin = $t04810048279._1 | |
1049 | + | let badDebt = $t04810048279._2 | |
1028 | 1050 | if ((badDebt != 0)) | |
1029 | 1051 | then throw("Invalid removed margin amount") | |
1030 | 1052 | else { | |
1031 | 1053 | let marginRatio = calcMarginRatio(remainMargin, badDebt, oldPositionOpenNotional) | |
1032 | 1054 | if (!(requireMoreMarginRatio(marginRatio, initMarginRatio(), true))) | |
1033 | 1055 | then throw(((("Too much margin removed: " + toString(marginRatio)) + " < ") + toString(initMarginRatio()))) | |
1034 | 1056 | else { | |
1035 | 1057 | let unstake = invoke(quoteAssetStaking(), "unlockNeutrino", [_amount, toBase58String(quoteAsset())], nil) | |
1036 | 1058 | if ((unstake == unstake)) | |
1037 | 1059 | then ((updatePosition(toString(i.caller), oldPositionSize, remainMargin, oldPositionOpenNotional, latestCumulativePremiumFraction(oldPositionSize)) ++ withdraw(i.caller, _amount)) ++ updateBalance((cbalance() - _amount))) | |
1038 | 1060 | else throw("Strict value is not equal to itself.") | |
1039 | 1061 | } | |
1040 | 1062 | } | |
1041 | 1063 | } | |
1042 | 1064 | ||
1043 | 1065 | ||
1044 | 1066 | ||
1045 | 1067 | @Callable(i) | |
1046 | 1068 | func closePosition () = { | |
1047 | 1069 | let caller = getActualCaller(i) | |
1048 | 1070 | let callerAddress = valueOrErrorMessage(addressFromString(caller), "Invalid caller") | |
1049 | 1071 | if (if (if (!(requireOpenPosition(caller))) | |
1050 | 1072 | then true | |
1051 | 1073 | else !(initialized())) | |
1052 | 1074 | then true | |
1053 | 1075 | else paused()) | |
1054 | 1076 | then throw("Invalid closePosition parameters") | |
1055 | 1077 | else { | |
1056 | - | let $ | |
1057 | - | let x1 = $ | |
1058 | - | let positionBadDebt = $ | |
1059 | - | let realizedPnl = $ | |
1060 | - | let marginToVault = $ | |
1061 | - | let quoteAssetReserveAfter = $ | |
1062 | - | let baseAssetReserveAfter = $ | |
1063 | - | let totalPositionSizeAfter = $ | |
1064 | - | let cumulativeNotionalAfter = $ | |
1065 | - | let openInterestNotionalAfter = $ | |
1066 | - | let x2 = $ | |
1067 | - | let totalLongAfter = $ | |
1068 | - | let totalShortAfter = $ | |
1078 | + | let $t04948249859 = internalClosePosition(caller, true) | |
1079 | + | let x1 = $t04948249859._1 | |
1080 | + | let positionBadDebt = $t04948249859._2 | |
1081 | + | let realizedPnl = $t04948249859._3 | |
1082 | + | let marginToVault = $t04948249859._4 | |
1083 | + | let quoteAssetReserveAfter = $t04948249859._5 | |
1084 | + | let baseAssetReserveAfter = $t04948249859._6 | |
1085 | + | let totalPositionSizeAfter = $t04948249859._7 | |
1086 | + | let cumulativeNotionalAfter = $t04948249859._8 | |
1087 | + | let openInterestNotionalAfter = $t04948249859._9 | |
1088 | + | let x2 = $t04948249859._10 | |
1089 | + | let totalLongAfter = $t04948249859._11 | |
1090 | + | let totalShortAfter = $t04948249859._12 | |
1069 | 1091 | if ((positionBadDebt > 0)) | |
1070 | 1092 | then throw("Unable to close position with bad debt") | |
1071 | 1093 | else { | |
1072 | 1094 | let withdrawAmount = abs(marginToVault) | |
1073 | 1095 | let ammBalance = (cbalance() - withdrawAmount) | |
1074 | - | let $ | |
1096 | + | let $t05006850210 = if ((0 > ammBalance)) | |
1075 | 1097 | then $Tuple2(0, abs(ammBalance)) | |
1076 | 1098 | else $Tuple2(ammBalance, 0) | |
1077 | - | let ammNewBalance = $ | |
1078 | - | let getFromInsurance = $ | |
1099 | + | let ammNewBalance = $t05006850210._1 | |
1100 | + | let getFromInsurance = $t05006850210._2 | |
1079 | 1101 | let x = if ((getFromInsurance > 0)) | |
1080 | 1102 | then { | |
1081 | 1103 | let withdrawInsurance = invoke(insuranceAddress(), "withdraw", [getFromInsurance], nil) | |
1082 | 1104 | if ((withdrawInsurance == withdrawInsurance)) | |
1083 | 1105 | then nil | |
1084 | 1106 | else throw("Strict value is not equal to itself.") | |
1085 | 1107 | } | |
1086 | 1108 | else nil | |
1087 | 1109 | if ((x == x)) | |
1088 | 1110 | then { | |
1089 | 1111 | let unstake = invoke(quoteAssetStaking(), "unlockNeutrino", [(withdrawAmount - getFromInsurance), toBase58String(quoteAsset())], nil) | |
1090 | 1112 | if ((unstake == unstake)) | |
1091 | 1113 | then { | |
1092 | 1114 | let notifyNotional = invoke(minerAddress(), "notifyNotional", [caller, 0], nil) | |
1093 | 1115 | if ((notifyNotional == notifyNotional)) | |
1094 | 1116 | then (((deletePosition(caller) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter)) ++ withdraw(callerAddress, withdrawAmount)) ++ updateBalance(ammNewBalance)) | |
1095 | 1117 | else throw("Strict value is not equal to itself.") | |
1096 | 1118 | } | |
1097 | 1119 | else throw("Strict value is not equal to itself.") | |
1098 | 1120 | } | |
1099 | 1121 | else throw("Strict value is not equal to itself.") | |
1100 | 1122 | } | |
1101 | 1123 | } | |
1102 | 1124 | } | |
1103 | 1125 | ||
1104 | 1126 | ||
1105 | 1127 | ||
1106 | 1128 | @Callable(i) | |
1107 | 1129 | func liquidate (_trader) = { | |
1108 | 1130 | let spotMarginRatio = getMarginRatioByOption(_trader, PNL_OPTION_SPOT) | |
1109 | 1131 | let marginRatio = if (isOverFluctuationLimit()) | |
1110 | 1132 | then { | |
1111 | 1133 | let oracleMarginRatio = getMarginRatioByOption(_trader, PNL_OPTION_ORACLE) | |
1112 | 1134 | vmax(spotMarginRatio, oracleMarginRatio) | |
1113 | 1135 | } | |
1114 | 1136 | else spotMarginRatio | |
1115 | 1137 | if (if (if (if (!(requireMoreMarginRatio(marginRatio, maintenanceMarginRatio(), false))) | |
1116 | 1138 | then true | |
1117 | 1139 | else !(requireOpenPosition(_trader))) | |
1118 | 1140 | then true | |
1119 | 1141 | else !(initialized())) | |
1120 | 1142 | then true | |
1121 | 1143 | else paused()) | |
1122 | 1144 | then throw("Unable to liquidate") | |
1123 | 1145 | else if (if (if ((spotMarginRatio > liquidationFeeRatio())) | |
1124 | 1146 | then (partialLiquidationRatio() > 0) | |
1125 | 1147 | else false) | |
1126 | 1148 | then (DECIMAL_UNIT > partialLiquidationRatio()) | |
1127 | 1149 | else false) | |
1128 | 1150 | then { | |
1129 | - | let $ | |
1130 | - | let oldPositionSize = $ | |
1131 | - | let oldPositionMargin = $ | |
1132 | - | let oldPositionOpenNotional = $ | |
1133 | - | let oldPositionLstUpdCPF = $ | |
1151 | + | let $t05229052440 = getPosition(_trader) | |
1152 | + | let oldPositionSize = $t05229052440._1 | |
1153 | + | let oldPositionMargin = $t05229052440._2 | |
1154 | + | let oldPositionOpenNotional = $t05229052440._3 | |
1155 | + | let oldPositionLstUpdCPF = $t05229052440._4 | |
1134 | 1156 | let _direction = if ((oldPositionSize > 0)) | |
1135 | 1157 | then DIR_SHORT | |
1136 | 1158 | else DIR_LONG | |
1137 | 1159 | let isAdd = (_direction == DIR_LONG) | |
1138 | 1160 | let exchangedQuoteAssetAmount = getPartialLiquidationAmount(_trader, oldPositionSize) | |
1139 | - | let $ | |
1140 | - | let oldPositionNotional = $ | |
1141 | - | let unrealizedPnl = $ | |
1142 | - | let $ | |
1143 | - | let exchangedPositionSize = $ | |
1144 | - | let quoteAssetReserveAfter = $ | |
1145 | - | let baseAssetReserveAfter = $ | |
1146 | - | let totalPositionSizeAfter = $ | |
1147 | - | let cumulativeNotionalAfter = $ | |
1161 | + | let $t05266552769 = getPositionNotionalAndUnrealizedPnl(_trader, PNL_OPTION_SPOT) | |
1162 | + | let oldPositionNotional = $t05266552769._1 | |
1163 | + | let unrealizedPnl = $t05266552769._2 | |
1164 | + | let $t05277753067 = swapInput(isAdd, exchangedQuoteAssetAmount) | |
1165 | + | let exchangedPositionSize = $t05277753067._1 | |
1166 | + | let quoteAssetReserveAfter = $t05277753067._2 | |
1167 | + | let baseAssetReserveAfter = $t05277753067._3 | |
1168 | + | let totalPositionSizeAfter = $t05277753067._4 | |
1169 | + | let cumulativeNotionalAfter = $t05277753067._5 | |
1148 | 1170 | let realizedPnl = divd(muld(unrealizedPnl, abs(exchangedPositionSize)), abs(oldPositionSize)) | |
1149 | - | let $ | |
1150 | - | let remainMargin = $ | |
1151 | - | let badDebt = $ | |
1152 | - | let fundingPayment = $ | |
1171 | + | let $t05317453407 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, realizedPnl) | |
1172 | + | let remainMargin = $t05317453407._1 | |
1173 | + | let badDebt = $t05317453407._2 | |
1174 | + | let fundingPayment = $t05317453407._3 | |
1153 | 1175 | let unrealizedPnlAfter = (unrealizedPnl - realizedPnl) | |
1154 | 1176 | let remainOpenNotional = if ((oldPositionSize > 0)) | |
1155 | 1177 | then ((oldPositionNotional - exchangedQuoteAssetAmount) - unrealizedPnlAfter) | |
1156 | 1178 | else ((unrealizedPnlAfter + oldPositionNotional) - exchangedQuoteAssetAmount) | |
1157 | 1179 | let liquidationPenalty = muld(exchangedQuoteAssetAmount, liquidationFeeRatio()) | |
1158 | 1180 | let feeToLiquidator = (liquidationPenalty / 2) | |
1159 | 1181 | let feeToInsurance = (liquidationPenalty - feeToLiquidator) | |
1160 | 1182 | let newPositionMargin = (remainMargin - liquidationPenalty) | |
1161 | 1183 | let newPositionSize = (oldPositionSize + exchangedPositionSize) | |
1162 | 1184 | let newPositionOpenNotional = abs(remainOpenNotional) | |
1163 | 1185 | let newPositionLstUpdCPF = latestCumulativePremiumFraction(newPositionSize) | |
1164 | 1186 | let openInterestNotionalAfter = (openInterestNotional() - exchangedQuoteAssetAmount) | |
1165 | 1187 | let ammBalance = (cbalance() - liquidationPenalty) | |
1166 | - | let $ | |
1188 | + | let $t05458054723 = if ((0 > ammBalance)) | |
1167 | 1189 | then $Tuple2(0, abs(ammBalance)) | |
1168 | 1190 | else $Tuple2(ammBalance, 0) | |
1169 | - | let newAmmBalance = $ | |
1170 | - | let takeFromInsurance = $ | |
1191 | + | let newAmmBalance = $t05458054723._1 | |
1192 | + | let takeFromInsurance = $t05458054723._2 | |
1171 | 1193 | let x = if ((takeFromInsurance > 0)) | |
1172 | 1194 | then { | |
1173 | 1195 | let withdrawInsurance = invoke(insuranceAddress(), "withdraw", [takeFromInsurance], nil) | |
1174 | 1196 | if ((withdrawInsurance == withdrawInsurance)) | |
1175 | 1197 | then nil | |
1176 | 1198 | else throw("Strict value is not equal to itself.") | |
1177 | 1199 | } | |
1178 | 1200 | else nil | |
1179 | 1201 | if ((x == x)) | |
1180 | 1202 | then { | |
1181 | 1203 | let unstake = invoke(quoteAssetStaking(), "unlockNeutrino", [(liquidationPenalty - takeFromInsurance), toBase58String(quoteAsset())], nil) | |
1182 | 1204 | if ((unstake == unstake)) | |
1183 | 1205 | then { | |
1184 | 1206 | let depositInsurance = invoke(insuranceAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), feeToInsurance)]) | |
1185 | 1207 | if ((depositInsurance == depositInsurance)) | |
1186 | 1208 | then { | |
1187 | 1209 | let notifyNotional = invoke(minerAddress(), "notifyNotional", [_trader, newPositionOpenNotional], nil) | |
1188 | 1210 | if ((notifyNotional == notifyNotional)) | |
1189 | 1211 | then (((updatePosition(_trader, newPositionSize, newPositionMargin, newPositionOpenNotional, newPositionLstUpdCPF) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, (totalLongPositionSize() - (if ((newPositionSize > 0)) | |
1190 | 1212 | then abs(exchangedPositionSize) | |
1191 | 1213 | else 0)), (totalShortPositionSize() - (if ((0 > newPositionSize)) | |
1192 | 1214 | then abs(exchangedPositionSize) | |
1193 | 1215 | else 0)))) ++ withdraw(i.caller, feeToLiquidator)) ++ updateBalance(newAmmBalance)) | |
1194 | 1216 | else throw("Strict value is not equal to itself.") | |
1195 | 1217 | } | |
1196 | 1218 | else throw("Strict value is not equal to itself.") | |
1197 | 1219 | } | |
1198 | 1220 | else throw("Strict value is not equal to itself.") | |
1199 | 1221 | } | |
1200 | 1222 | else throw("Strict value is not equal to itself.") | |
1201 | 1223 | } | |
1202 | 1224 | else { | |
1203 | - | let $ | |
1204 | - | let x1 = $ | |
1205 | - | let badDebt = $ | |
1206 | - | let x2 = $ | |
1207 | - | let x3 = $ | |
1208 | - | let quoteAssetReserveAfter = $ | |
1209 | - | let baseAssetReserveAfter = $ | |
1210 | - | let totalPositionSizeAfter = $ | |
1211 | - | let cumulativeNotionalAfter = $ | |
1212 | - | let openInterestNotionalAfter = $ | |
1213 | - | let exchangedQuoteAssetAmount = $ | |
1214 | - | let totalLongAfter = $ | |
1215 | - | let totalShortAfter = $ | |
1225 | + | let $t05617956634 = internalClosePosition(_trader, false) | |
1226 | + | let x1 = $t05617956634._1 | |
1227 | + | let badDebt = $t05617956634._2 | |
1228 | + | let x2 = $t05617956634._3 | |
1229 | + | let x3 = $t05617956634._4 | |
1230 | + | let quoteAssetReserveAfter = $t05617956634._5 | |
1231 | + | let baseAssetReserveAfter = $t05617956634._6 | |
1232 | + | let totalPositionSizeAfter = $t05617956634._7 | |
1233 | + | let cumulativeNotionalAfter = $t05617956634._8 | |
1234 | + | let openInterestNotionalAfter = $t05617956634._9 | |
1235 | + | let exchangedQuoteAssetAmount = $t05617956634._10 | |
1236 | + | let totalLongAfter = $t05617956634._11 | |
1237 | + | let totalShortAfter = $t05617956634._12 | |
1216 | 1238 | let liquidationPenalty = muld(exchangedQuoteAssetAmount, liquidationFeeRatio()) | |
1217 | 1239 | let feeToLiquidator = (liquidationPenalty / 2) | |
1218 | 1240 | let feeToInsurance = (liquidationPenalty - feeToLiquidator) | |
1219 | 1241 | let ammBalance = (cbalance() - liquidationPenalty) | |
1220 | - | let $ | |
1242 | + | let $t05704657189 = if ((0 > ammBalance)) | |
1221 | 1243 | then $Tuple2(0, abs(ammBalance)) | |
1222 | 1244 | else $Tuple2(ammBalance, 0) | |
1223 | - | let newAmmBalance = $ | |
1224 | - | let takeFromInsurance = $ | |
1245 | + | let newAmmBalance = $t05704657189._1 | |
1246 | + | let takeFromInsurance = $t05704657189._2 | |
1225 | 1247 | let x = if ((takeFromInsurance > 0)) | |
1226 | 1248 | then { | |
1227 | 1249 | let withdrawInsurance = invoke(insuranceAddress(), "withdraw", [takeFromInsurance], nil) | |
1228 | 1250 | if ((withdrawInsurance == withdrawInsurance)) | |
1229 | 1251 | then nil | |
1230 | 1252 | else throw("Strict value is not equal to itself.") | |
1231 | 1253 | } | |
1232 | 1254 | else nil | |
1233 | 1255 | if ((x == x)) | |
1234 | 1256 | then { | |
1235 | 1257 | let unstake = invoke(quoteAssetStaking(), "unlockNeutrino", [(liquidationPenalty - takeFromInsurance), toBase58String(quoteAsset())], nil) | |
1236 | 1258 | if ((unstake == unstake)) | |
1237 | 1259 | then { | |
1238 | 1260 | let depositInsurance = invoke(insuranceAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), feeToInsurance)]) | |
1239 | 1261 | if ((depositInsurance == depositInsurance)) | |
1240 | 1262 | then { | |
1241 | 1263 | let notifyNotional = invoke(minerAddress(), "notifyNotional", [_trader, 0], nil) | |
1242 | 1264 | if ((notifyNotional == notifyNotional)) | |
1243 | 1265 | then (((deletePosition(_trader) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter)) ++ withdraw(i.caller, feeToLiquidator)) ++ updateBalance(newAmmBalance)) | |
1244 | 1266 | else throw("Strict value is not equal to itself.") | |
1245 | 1267 | } | |
1246 | 1268 | else throw("Strict value is not equal to itself.") | |
1247 | 1269 | } | |
1248 | 1270 | else throw("Strict value is not equal to itself.") | |
1249 | 1271 | } | |
1250 | 1272 | else throw("Strict value is not equal to itself.") | |
1251 | 1273 | } | |
1252 | 1274 | } | |
1253 | 1275 | ||
1254 | 1276 | ||
1255 | 1277 | ||
1256 | 1278 | @Callable(i) | |
1257 | 1279 | func payFunding () = { | |
1258 | 1280 | let fundingBlockTimestamp = nextFundingBlockTimestamp() | |
1259 | 1281 | if (if (if ((fundingBlockTimestamp > lastBlock.timestamp)) | |
1260 | 1282 | then true | |
1261 | 1283 | else !(initialized())) | |
1262 | 1284 | then true | |
1263 | 1285 | else paused()) | |
1264 | 1286 | then throw(((("Invalid funding block timestamp: " + toString(lastBlock.timestamp)) + " < ") + toString(fundingBlockTimestamp))) | |
1265 | 1287 | else { | |
1266 | 1288 | let underlyingPrice = getOracleTwapPrice() | |
1267 | - | let spotTwapPrice = getTwapSpotPrice() | |
1268 | - | let premium = (spotTwapPrice - underlyingPrice) | |
1269 | - | let $t05751958854 = if (if ((totalShortPositionSize() == 0)) | |
1270 | - | then true | |
1271 | - | else (totalLongPositionSize() == 0)) | |
1272 | - | then $Tuple2(0, 0) | |
1273 | - | else if ((0 > premium)) | |
1274 | - | then { | |
1275 | - | let shortPremiumFraction = divd(muld(premium, fundingPeriodDecimal()), ONE_DAY) | |
1276 | - | let longPremiumFraction = divd(muld(shortPremiumFraction, totalShortPositionSize()), totalLongPositionSize()) | |
1277 | - | $Tuple2(shortPremiumFraction, longPremiumFraction) | |
1278 | - | } | |
1279 | - | else { | |
1280 | - | let longPremiumFraction = divd(muld(premium, fundingPeriodDecimal()), ONE_DAY) | |
1281 | - | let shortPremiumFraction = divd(muld(longPremiumFraction, totalLongPositionSize()), totalShortPositionSize()) | |
1282 | - | $Tuple2(shortPremiumFraction, longPremiumFraction) | |
1283 | - | } | |
1284 | - | let shortPremiumFraction = $t05751958854._1 | |
1285 | - | let longPremiumFraction = $t05751958854._2 | |
1289 | + | let $t05868458746 = getFunding() | |
1290 | + | let shortPremiumFraction = $t05868458746._1 | |
1291 | + | let longPremiumFraction = $t05868458746._2 | |
1286 | 1292 | updateFunding((fundingBlockTimestamp + fundingPeriodSeconds()), (latestLongCumulativePremiumFraction() + longPremiumFraction), (latestShortCumulativePremiumFraction() + shortPremiumFraction), divd(longPremiumFraction, underlyingPrice), divd(shortPremiumFraction, underlyingPrice)) | |
1287 | 1293 | } | |
1288 | 1294 | } | |
1289 | 1295 | ||
1290 | 1296 | ||
1291 | 1297 | ||
1292 | 1298 | @Callable(i) | |
1293 | 1299 | func forceMoveAsset (_trader,_amount) = if (if ((addressFromPublicKey(adminPublicKey()) != i.caller)) | |
1294 | 1300 | then true | |
1295 | 1301 | else (0 > _amount)) | |
1296 | 1302 | then throw("Invalid forceMoveAsset parameters") | |
1297 | 1303 | else { | |
1298 | 1304 | let unstake = invoke(quoteAssetStaking(), "unlockNeutrino", [_amount, toBase58String(quoteAsset())], nil) | |
1299 | 1305 | if ((unstake == unstake)) | |
1300 | 1306 | then (withdraw(addressFromStringValue(_trader), _amount) ++ updateBalance((cbalance() - _amount))) | |
1301 | 1307 | else throw("Strict value is not equal to itself.") | |
1302 | 1308 | } | |
1303 | 1309 | ||
1304 | 1310 | ||
1305 | 1311 | ||
1306 | 1312 | @Callable(i) | |
1307 | 1313 | func adjustPeg (_price) = if (if ((addressFromPublicKey(adminPublicKey()) != i.caller)) | |
1308 | 1314 | then true | |
1309 | 1315 | else (0 > _price)) | |
1310 | 1316 | then throw("Invalid adjustPeg parameters") | |
1311 | 1317 | else { | |
1312 | - | let $ | |
1313 | - | let newQuoteAssetReserve = $ | |
1314 | - | let pegChangeCost = $ | |
1318 | + | let $t05974659832 = getPegAdjustCost(_price) | |
1319 | + | let newQuoteAssetReserve = $t05974659832._1 | |
1320 | + | let pegChangeCost = $t05974659832._2 | |
1315 | 1321 | if ((pegChangeCost == 0)) | |
1316 | 1322 | then throw("Nothing to adjust") | |
1317 | 1323 | else if ((pegChangeCost > 0)) | |
1318 | 1324 | then { | |
1319 | 1325 | let withdrawInsurance = invoke(insuranceAddress(), "withdraw", [pegChangeCost], nil) | |
1320 | 1326 | if ((withdrawInsurance == withdrawInsurance)) | |
1321 | 1327 | then { | |
1322 | 1328 | let stake = invoke(quoteAssetStaking(), "lockNeutrinoSP", [toString(stakingAddress()), ALL_FEES], [AttachedPayment(quoteAsset(), pegChangeCost)]) | |
1323 | 1329 | if ((stake == stake)) | |
1324 | 1330 | then (updateBalance((cbalance() + pegChangeCost)) ++ updateAmmReserves(newQuoteAssetReserve, bsAstR())) | |
1325 | 1331 | else throw("Strict value is not equal to itself.") | |
1326 | 1332 | } | |
1327 | 1333 | else throw("Strict value is not equal to itself.") | |
1328 | 1334 | } | |
1329 | 1335 | else { | |
1330 | 1336 | let unstake = invoke(quoteAssetStaking(), "unlockNeutrino", [abs(pegChangeCost), toBase58String(quoteAsset())], nil) | |
1331 | 1337 | if ((unstake == unstake)) | |
1332 | 1338 | then { | |
1333 | 1339 | let depositInsurance = invoke(insuranceAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), abs(pegChangeCost))]) | |
1334 | 1340 | if ((depositInsurance == depositInsurance)) | |
1335 | 1341 | then (updateBalance((cbalance() - abs(pegChangeCost))) ++ updateAmmReserves(newQuoteAssetReserve, bsAstR())) | |
1336 | 1342 | else throw("Strict value is not equal to itself.") | |
1337 | 1343 | } | |
1338 | 1344 | else throw("Strict value is not equal to itself.") | |
1339 | 1345 | } | |
1340 | 1346 | } | |
1341 | 1347 | ||
1342 | 1348 | ||
1343 | 1349 | ||
1344 | 1350 | @Callable(i) | |
1345 | 1351 | func v_get (_trader) = { | |
1346 | - | let $ | |
1347 | - | let x1 = $ | |
1348 | - | let x2 = $ | |
1349 | - | let x3 = $ | |
1350 | - | let x4 = $ | |
1352 | + | let $t06105761117 = internalClosePosition(_trader, false) | |
1353 | + | let x1 = $t06105761117._1 | |
1354 | + | let x2 = $t06105761117._2 | |
1355 | + | let x3 = $t06105761117._3 | |
1356 | + | let x4 = $t06105761117._4 | |
1351 | 1357 | throw((((s(x2) + s(x3)) + s(x4)) + s(getMarginRatio(_trader)))) | |
1352 | 1358 | } | |
1353 | 1359 | ||
1354 | 1360 | ||
1355 | 1361 | ||
1356 | 1362 | @Callable(i) | |
1357 | 1363 | func view_calcRemainMarginWithFundingPayment (_trader) = { | |
1358 | - | let $ | |
1359 | - | let positionSize = $ | |
1360 | - | let positionMargin = $ | |
1361 | - | let pon = $ | |
1362 | - | let positionLstUpdCPF = $ | |
1363 | - | let $ | |
1364 | - | let positionNotional = $ | |
1365 | - | let unrealizedPnl = $ | |
1366 | - | let $ | |
1367 | - | let remainMargin = $ | |
1368 | - | let badDebt = $ | |
1369 | - | let fundingPayment = $ | |
1364 | + | let $t06126461375 = getPosition(_trader) | |
1365 | + | let positionSize = $t06126461375._1 | |
1366 | + | let positionMargin = $t06126461375._2 | |
1367 | + | let pon = $t06126461375._3 | |
1368 | + | let positionLstUpdCPF = $t06126461375._4 | |
1369 | + | let $t06138061481 = getPositionNotionalAndUnrealizedPnl(_trader, PNL_OPTION_SPOT) | |
1370 | + | let positionNotional = $t06138061481._1 | |
1371 | + | let unrealizedPnl = $t06138061481._2 | |
1372 | + | let $t06148661668 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl) | |
1373 | + | let remainMargin = $t06148661668._1 | |
1374 | + | let badDebt = $t06148661668._2 | |
1375 | + | let fundingPayment = $t06148661668._3 | |
1370 | 1376 | throw((((((s(remainMargin) + s(fundingPayment)) + s(getMarginRatio(_trader))) + s(unrealizedPnl)) + s(badDebt)) + s(positionNotional))) | |
1371 | 1377 | } | |
1372 | 1378 | ||
1373 | 1379 | ||
1374 | 1380 | ||
1375 | 1381 | @Callable(i) | |
1376 | 1382 | func view_getPegAdjustCost (_price) = { | |
1377 | 1383 | let cost = getPegAdjustCost(_price) | |
1378 | 1384 | throw(toString(cost._2)) | |
1379 | 1385 | } | |
1380 | 1386 | ||
1381 | 1387 | ||
1388 | + | ||
1389 | + | @Callable(i) | |
1390 | + | func view_getFunding () = { | |
1391 | + | let underlyingPrice = getOracleTwapPrice() | |
1392 | + | let $t06205962121 = getFunding() | |
1393 | + | let shortPremiumFraction = $t06205962121._1 | |
1394 | + | let longPremiumFraction = $t06205962121._2 | |
1395 | + | let longFunding = divd(longPremiumFraction, underlyingPrice) | |
1396 | + | let shortFunding = divd(shortPremiumFraction, underlyingPrice) | |
1397 | + | throw((s(longFunding) + s(shortFunding))) | |
1398 | + | } | |
1399 | + | ||
1400 | + | ||
1382 | 1401 | @Verifier(tx) | |
1383 | 1402 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], adminPublicKey()) | |
1384 | 1403 |
github/deemru/w8io/026f985 259.88 ms ◑