tx · Ehsz59tFRahrbrmvuUU6tyHrXcS3kaT9CAFX8f4kfMsT 3MrRa3KaEgRyyjQdMLuU78m5GkJLvP5DZLj: -0.05100000 Waves 2022.08.24 17:42 [2198697] smart account 3MrRa3KaEgRyyjQdMLuU78m5GkJLvP5DZLj > SELF 0.00000000 Waves
{ "type": 13, "id": "Ehsz59tFRahrbrmvuUU6tyHrXcS3kaT9CAFX8f4kfMsT", "fee": 5100000, "feeAssetId": null, "timestamp": 1661352204691, "version": 2, "chainId": 84, "sender": "3MrRa3KaEgRyyjQdMLuU78m5GkJLvP5DZLj", "senderPublicKey": "AJNTN7EtP9dsAmPzcKRp9bRMvzZL4uwkmVxQuFuar3Qr", "proofs": [ "4dhdHV1mKsTTPG9skVEo9ET4fUAtbcpXWdygpJhsFXSWqZk3CRMibPgZtkVTvmmGPB6XXEP4pkXxVM3Vgo7D4GLi" ], "script": "base64:BgJjCAISABIAEgMKAQESAwoBARIJCgcBAQEBAQEBEg4KDAEBAQEBAQEICAgBARIDCgEBEgMKAQESBQoDAQEBEgUKAwEBARIAEgMKAQESABIDCgEIEgASAwoBCBIDCgEIEgQKAggBdwAJa19vcmFfa2V5AglrX29yYV9rZXkAD2tfb3JhX2Jsb2NrX2tleQIPa19vcmFfYmxvY2tfa2V5AAVrX29yYQIFa19vcmEACWtfYmFsYW5jZQIJa19iYWxhbmNlAA5rX3Bvc2l0aW9uU2l6ZQIOa19wb3NpdGlvblNpemUAEGtfcG9zaXRpb25NYXJnaW4CEGtfcG9zaXRpb25NYXJnaW4AFmtfcG9zaXRpb25PcGVuTm90aW9uYWwCFmtfcG9zaXRpb25PcGVuTm90aW9uYWwALmtfcG9zaXRpb25MYXN0VXBkYXRlZEN1bXVsYXRpdmVQcmVtaXVtRnJhY3Rpb24CEmtfcG9zaXRpb25GcmFjdGlvbgANa19pbml0aWFsaXplZAINa19pbml0aWFsaXplZAAIa19wYXVzZWQCCGtfcGF1c2VkAAVrX2ZlZQIFa19mZWUAD2tfZnVu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AIFB3Vuc3Rha2UFB3Vuc3Rha2UJAM4IAgkBCHdpdGhkcmF3AgkBEUBleHRyTmF0aXZlKDEwNjIpAQUHX3RyYWRlcgUHX2Ftb3VudAkBDXVwZGF0ZUJhbGFuY2UBCQBlAgkBCGNiYWxhbmNlAAUHX2Ftb3VudAkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgECdHgBBnZlcmlmeQAJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAJAQ5hZG1pblB1YmxpY0tleQD2Kwit", "height": 2198697, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6jA3yWbKPoHCx6LkM23kJrgaTaJtHUB2dD1erLLMTd3U Next: none Diff:
Old | New | Differences | |
---|---|---|---|
669 | 669 | ||
670 | 670 | ||
671 | 671 | @Callable(i) | |
672 | + | func setMaxPriceImpact (_maxPriceImpact) = if (if ((0 >= _maxPriceImpact)) | |
673 | + | then true | |
674 | + | else !(initialized())) | |
675 | + | then throw("Invalid _maxPriceImpact parameters") | |
676 | + | else updateSettings(initMarginRatio(), maintenanceMarginRatio(), liquidationFeeRatio(), fundingPeriodRaw(), fee(), spreadLimit(), _maxPriceImpact) | |
677 | + | ||
678 | + | ||
679 | + | ||
680 | + | @Callable(i) | |
681 | + | func setInitMarginRatio (_initMarginRatio) = if (if ((0 >= _initMarginRatio)) | |
682 | + | then true | |
683 | + | else !(initialized())) | |
684 | + | then throw("Invalid setInitMarginRatio parameters") | |
685 | + | else updateSettings(_initMarginRatio, maintenanceMarginRatio(), liquidationFeeRatio(), fundingPeriodRaw(), fee(), spreadLimit(), maxPriceImpact()) | |
686 | + | ||
687 | + | ||
688 | + | ||
689 | + | @Callable(i) | |
672 | 690 | func decreasePosition (_amount,_leverage,_minBaseAssetAmount) = if (if (if (if (if ((0 >= _amount)) | |
673 | 691 | then true | |
674 | 692 | else !(initialized())) | |
680 | 698 | else paused()) | |
681 | 699 | then throw("Invalid decreasePosition parameters") | |
682 | 700 | else { | |
683 | - | let $ | |
684 | - | let oldPositionSize = $ | |
685 | - | let oldPositionMargin = $ | |
686 | - | let oldPositionOpenNotional = $ | |
687 | - | let oldPositionLstUpdCPF = $ | |
701 | + | let $t03173131883 = getPosition(toString(i.caller)) | |
702 | + | let oldPositionSize = $t03173131883._1 | |
703 | + | let oldPositionMargin = $t03173131883._2 | |
704 | + | let oldPositionOpenNotional = $t03173131883._3 | |
705 | + | let oldPositionLstUpdCPF = $t03173131883._4 | |
688 | 706 | let _direction = if ((oldPositionSize > 0)) | |
689 | 707 | then DIR_SHORT | |
690 | 708 | else DIR_LONG | |
691 | 709 | let isAdd = (_direction == DIR_LONG) | |
692 | 710 | let openNotional = muld(_amount, _leverage) | |
693 | - | let $ | |
694 | - | let oldPositionNotional = $ | |
695 | - | let unrealizedPnl = $ | |
696 | - | let $ | |
711 | + | let $t03205632172 = getPositionNotionalAndUnrealizedPnl(toString(i.caller), PNL_OPTION_SPOT) | |
712 | + | let oldPositionNotional = $t03205632172._1 | |
713 | + | let unrealizedPnl = $t03205632172._2 | |
714 | + | let $t03217834727 = if ((oldPositionNotional > openNotional)) | |
697 | 715 | then { | |
698 | - | let $ | |
699 | - | let exchangedPositionSize = $ | |
700 | - | let quoteAssetReserveAfter = $ | |
701 | - | let baseAssetReserveAfter = $ | |
702 | - | let totalPositionSizeAfter = $ | |
703 | - | let cumulativeNotionalAfter = $ | |
716 | + | let $t03255532774 = swapInput(isAdd, openNotional) | |
717 | + | let exchangedPositionSize = $t03255532774._1 | |
718 | + | let quoteAssetReserveAfter = $t03255532774._2 | |
719 | + | let baseAssetReserveAfter = $t03255532774._3 | |
720 | + | let totalPositionSizeAfter = $t03255532774._4 | |
721 | + | let cumulativeNotionalAfter = $t03255532774._5 | |
704 | 722 | let exchangedPositionSizeAbs = abs(exchangedPositionSize) | |
705 | 723 | if (if ((_minBaseAssetAmount != 0)) | |
706 | 724 | then (_minBaseAssetAmount > exchangedPositionSizeAbs) | |
708 | 726 | then throw(((("Too little base asset exchanged, got " + toString(exchangedPositionSizeAbs)) + " expected ") + toString(_minBaseAssetAmount))) | |
709 | 727 | else { | |
710 | 728 | let realizedPnl = divd(muld(unrealizedPnl, exchangedPositionSizeAbs), abs(oldPositionSize)) | |
711 | - | let $ | |
712 | - | let remainMargin = $ | |
713 | - | let badDebt = $ | |
714 | - | let fundingPayment = $ | |
729 | + | let $t03321133456 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, realizedPnl) | |
730 | + | let remainMargin = $t03321133456._1 | |
731 | + | let badDebt = $t03321133456._2 | |
732 | + | let fundingPayment = $t03321133456._3 | |
715 | 733 | let exchangedQuoteAssetAmount = openNotional | |
716 | 734 | let unrealizedPnlAfter = (unrealizedPnl - realizedPnl) | |
717 | 735 | let remainOpenNotional = if ((oldPositionSize > 0)) | |
726 | 744 | } | |
727 | 745 | } | |
728 | 746 | else throw("Close position first") | |
729 | - | let newPositionSize = $ | |
730 | - | let newPositionRemainMargin = $ | |
731 | - | let newPositionOpenNotional = $ | |
732 | - | let newPositionLatestCPF = $ | |
733 | - | let baseAssetReserveAfter = $ | |
734 | - | let quoteAssetReserveAfter = $ | |
735 | - | let totalPositionSizeAfter = $ | |
736 | - | let cumulativeNotionalAfter = $ | |
737 | - | let openInterestNotionalAfter = $ | |
738 | - | let totalLongAfter = $ | |
739 | - | let totalShortAfter = $ | |
747 | + | let newPositionSize = $t03217834727._1 | |
748 | + | let newPositionRemainMargin = $t03217834727._2 | |
749 | + | let newPositionOpenNotional = $t03217834727._3 | |
750 | + | let newPositionLatestCPF = $t03217834727._4 | |
751 | + | let baseAssetReserveAfter = $t03217834727._5 | |
752 | + | let quoteAssetReserveAfter = $t03217834727._6 | |
753 | + | let totalPositionSizeAfter = $t03217834727._7 | |
754 | + | let cumulativeNotionalAfter = $t03217834727._8 | |
755 | + | let openInterestNotionalAfter = $t03217834727._9 | |
756 | + | let totalLongAfter = $t03217834727._10 | |
757 | + | let totalShortAfter = $t03217834727._11 | |
740 | 758 | let notifyNotional = invoke(minerAddress(), "notifyNotional", [toString(i.caller), newPositionOpenNotional], nil) | |
741 | 759 | if ((notifyNotional == notifyNotional)) | |
742 | 760 | then (updatePosition(toString(i.caller), newPositionSize, newPositionRemainMargin, newPositionOpenNotional, newPositionLatestCPF) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter)) | |
765 | 783 | else { | |
766 | 784 | let feeAmount = muld(_rawAmount, fee()) | |
767 | 785 | let _amount = (_rawAmount - feeAmount) | |
768 | - | let $ | |
769 | - | let oldPositionSize = $ | |
770 | - | let oldPositionMargin = $ | |
771 | - | let oldPositionOpenNotional = $ | |
772 | - | let oldPositionLstUpdCPF = $ | |
786 | + | let $t03584535997 = getPosition(toString(i.caller)) | |
787 | + | let oldPositionSize = $t03584535997._1 | |
788 | + | let oldPositionMargin = $t03584535997._2 | |
789 | + | let oldPositionOpenNotional = $t03584535997._3 | |
790 | + | let oldPositionLstUpdCPF = $t03584535997._4 | |
773 | 791 | let isNewPosition = (oldPositionSize == 0) | |
774 | 792 | let isSameDirection = if ((oldPositionSize > 0)) | |
775 | 793 | then (_direction == DIR_LONG) | |
778 | 796 | then isSameDirection | |
779 | 797 | else false | |
780 | 798 | let isAdd = (_direction == DIR_LONG) | |
781 | - | let $ | |
799 | + | let $t03628638675 = if (if (isNewPosition) | |
782 | 800 | then true | |
783 | 801 | else expandExisting) | |
784 | 802 | then { | |
785 | 803 | let openNotional = muld(_amount, _leverage) | |
786 | - | let $ | |
787 | - | let amountBaseAssetBought = $ | |
788 | - | let quoteAssetReserveAfter = $ | |
789 | - | let baseAssetReserveAfter = $ | |
790 | - | let totalPositionSizeAfter = $ | |
791 | - | let cumulativeNotionalAfter = $ | |
804 | + | let $t03671036916 = swapInput(isAdd, openNotional) | |
805 | + | let amountBaseAssetBought = $t03671036916._1 | |
806 | + | let quoteAssetReserveAfter = $t03671036916._2 | |
807 | + | let baseAssetReserveAfter = $t03671036916._3 | |
808 | + | let totalPositionSizeAfter = $t03671036916._4 | |
809 | + | let cumulativeNotionalAfter = $t03671036916._5 | |
792 | 810 | if (if ((_minBaseAssetAmount != 0)) | |
793 | 811 | then (_minBaseAssetAmount > abs(amountBaseAssetBought)) | |
794 | 812 | else false) | |
796 | 814 | else { | |
797 | 815 | let newPositionSize = (oldPositionSize + amountBaseAssetBought) | |
798 | 816 | let increaseMarginRequirement = divd(openNotional, _leverage) | |
799 | - | let $ | |
800 | - | let remainMargin = $ | |
801 | - | let x1 = $ | |
802 | - | let x2 = $ | |
817 | + | let $t03729737536 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, increaseMarginRequirement) | |
818 | + | let remainMargin = $t03729737536._1 | |
819 | + | let x1 = $t03729737536._2 | |
820 | + | let x2 = $t03729737536._3 | |
803 | 821 | $Tuple11(newPositionSize, remainMargin, (oldPositionOpenNotional + openNotional), latestCumulativePremiumFraction(newPositionSize), baseAssetReserveAfter, quoteAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, (openInterestNotional() + openNotional), (totalLongPositionSize() + (if ((newPositionSize > 0)) | |
804 | 822 | then abs(amountBaseAssetBought) | |
805 | 823 | else 0)), (totalShortPositionSize() + (if ((0 > newPositionSize)) | |
809 | 827 | } | |
810 | 828 | else { | |
811 | 829 | let openNotional = muld(_amount, _leverage) | |
812 | - | let $ | |
813 | - | let oldPositionNotional = $ | |
814 | - | let unrealizedPnl = $ | |
830 | + | let $t03836838484 = getPositionNotionalAndUnrealizedPnl(toString(i.caller), PNL_OPTION_SPOT) | |
831 | + | let oldPositionNotional = $t03836838484._1 | |
832 | + | let unrealizedPnl = $t03836838484._2 | |
815 | 833 | if ((oldPositionNotional > openNotional)) | |
816 | 834 | then throw("Use decreasePosition to decrease position size") | |
817 | 835 | else throw("Close position first") | |
818 | 836 | } | |
819 | - | let newPositionSize = $ | |
820 | - | let newPositionRemainMargin = $ | |
821 | - | let newPositionOpenNotional = $ | |
822 | - | let newPositionLatestCPF = $ | |
823 | - | let baseAssetReserveAfter = $ | |
824 | - | let quoteAssetReserveAfter = $ | |
825 | - | let totalPositionSizeAfter = $ | |
826 | - | let cumulativeNotionalAfter = $ | |
827 | - | let openInterestNotionalAfter = $ | |
828 | - | let totalLongAfter = $ | |
829 | - | let totalShortAfter = $ | |
837 | + | let newPositionSize = $t03628638675._1 | |
838 | + | let newPositionRemainMargin = $t03628638675._2 | |
839 | + | let newPositionOpenNotional = $t03628638675._3 | |
840 | + | let newPositionLatestCPF = $t03628638675._4 | |
841 | + | let baseAssetReserveAfter = $t03628638675._5 | |
842 | + | let quoteAssetReserveAfter = $t03628638675._6 | |
843 | + | let totalPositionSizeAfter = $t03628638675._7 | |
844 | + | let cumulativeNotionalAfter = $t03628638675._8 | |
845 | + | let openInterestNotionalAfter = $t03628638675._9 | |
846 | + | let totalLongAfter = $t03628638675._10 | |
847 | + | let totalShortAfter = $t03628638675._11 | |
830 | 848 | let feeToStakers = (feeAmount / 2) | |
831 | 849 | let feeToInsurance = (feeAmount - feeToStakers) | |
832 | 850 | let stake = invoke(quoteAssetStaking(), "lockNeutrinoSP", [toString(stakingAddress()), ALL_FEES], [AttachedPayment(quoteAsset(), _amount)]) | |
867 | 885 | else { | |
868 | 886 | let feeAmount = muld(_rawAmount, fee()) | |
869 | 887 | let _amount = (_rawAmount - feeAmount) | |
870 | - | let $ | |
871 | - | let oldPositionSize = $ | |
872 | - | let oldPositionMargin = $ | |
873 | - | let oldPositionOpenNotional = $ | |
874 | - | let oldPositionLstUpdCPF = $ | |
888 | + | let $t04023140383 = getPosition(toString(i.caller)) | |
889 | + | let oldPositionSize = $t04023140383._1 | |
890 | + | let oldPositionMargin = $t04023140383._2 | |
891 | + | let oldPositionOpenNotional = $t04023140383._3 | |
892 | + | let oldPositionLstUpdCPF = $t04023140383._4 | |
875 | 893 | let feeToStakers = (feeAmount / 2) | |
876 | 894 | let feeToInsurance = (feeAmount - feeToStakers) | |
877 | 895 | let stake = invoke(quoteAssetStaking(), "lockNeutrinoSP", [toString(stakingAddress()), ALL_FEES], [AttachedPayment(quoteAsset(), _amount)]) | |
903 | 921 | else paused()) | |
904 | 922 | then throw("Invalid removeMargin parameters") | |
905 | 923 | else { | |
906 | - | let $ | |
907 | - | let oldPositionSize = $ | |
908 | - | let oldPositionMargin = $ | |
909 | - | let oldPositionOpenNotional = $ | |
910 | - | let oldPositionLstUpdCPF = $ | |
924 | + | let $t04143241584 = getPosition(toString(i.caller)) | |
925 | + | let oldPositionSize = $t04143241584._1 | |
926 | + | let oldPositionMargin = $t04143241584._2 | |
927 | + | let oldPositionOpenNotional = $t04143241584._3 | |
928 | + | let oldPositionLstUpdCPF = $t04143241584._4 | |
911 | 929 | let marginDelta = -(_amount) | |
912 | - | let $ | |
913 | - | let remainMargin = $ | |
914 | - | let badDebt = $ | |
930 | + | let $t04162141800 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, marginDelta) | |
931 | + | let remainMargin = $t04162141800._1 | |
932 | + | let badDebt = $t04162141800._2 | |
915 | 933 | if ((badDebt != 0)) | |
916 | 934 | then throw("Invalid removed margin amount") | |
917 | 935 | else { | |
937 | 955 | else paused()) | |
938 | 956 | then throw("Invalid closePosition parameters") | |
939 | 957 | else { | |
940 | - | let $ | |
941 | - | let x1 = $ | |
942 | - | let positionBadDebt = $ | |
943 | - | let realizedPnl = $ | |
944 | - | let marginToVault = $ | |
945 | - | let quoteAssetReserveAfter = $ | |
946 | - | let baseAssetReserveAfter = $ | |
947 | - | let totalPositionSizeAfter = $ | |
948 | - | let cumulativeNotionalAfter = $ | |
949 | - | let openInterestNotionalAfter = $ | |
950 | - | let x2 = $ | |
951 | - | let totalLongAfter = $ | |
952 | - | let totalShortAfter = $ | |
958 | + | let $t04289643286 = internalClosePosition(toString(i.caller), true) | |
959 | + | let x1 = $t04289643286._1 | |
960 | + | let positionBadDebt = $t04289643286._2 | |
961 | + | let realizedPnl = $t04289643286._3 | |
962 | + | let marginToVault = $t04289643286._4 | |
963 | + | let quoteAssetReserveAfter = $t04289643286._5 | |
964 | + | let baseAssetReserveAfter = $t04289643286._6 | |
965 | + | let totalPositionSizeAfter = $t04289643286._7 | |
966 | + | let cumulativeNotionalAfter = $t04289643286._8 | |
967 | + | let openInterestNotionalAfter = $t04289643286._9 | |
968 | + | let x2 = $t04289643286._10 | |
969 | + | let totalLongAfter = $t04289643286._11 | |
970 | + | let totalShortAfter = $t04289643286._12 | |
953 | 971 | if ((positionBadDebt > 0)) | |
954 | 972 | then throw("Unable to close position with bad debt") | |
955 | 973 | else { | |
956 | 974 | let withdrawAmount = abs(marginToVault) | |
957 | 975 | let ammBalance = (cbalance() - withdrawAmount) | |
958 | - | let $ | |
976 | + | let $t04349543637 = if ((0 > ammBalance)) | |
959 | 977 | then $Tuple2(0, abs(ammBalance)) | |
960 | 978 | else $Tuple2(ammBalance, 0) | |
961 | - | let ammNewBalance = $ | |
962 | - | let getFromInsurance = $ | |
979 | + | let ammNewBalance = $t04349543637._1 | |
980 | + | let getFromInsurance = $t04349543637._2 | |
963 | 981 | let x = if ((getFromInsurance > 0)) | |
964 | 982 | then { | |
965 | 983 | let withdrawInsurance = invoke(insuranceAddress(), "withdraw", [getFromInsurance], nil) | |
1004 | 1022 | else paused()) | |
1005 | 1023 | then throw("Unable to liquidate") | |
1006 | 1024 | else { | |
1007 | - | let $ | |
1008 | - | let x1 = $ | |
1009 | - | let badDebt = $ | |
1010 | - | let x2 = $ | |
1011 | - | let x3 = $ | |
1012 | - | let quoteAssetReserveAfter = $ | |
1013 | - | let baseAssetReserveAfter = $ | |
1014 | - | let totalPositionSizeAfter = $ | |
1015 | - | let cumulativeNotionalAfter = $ | |
1016 | - | let openInterestNotionalAfter = $ | |
1017 | - | let exchangedQuoteAssetAmount = $ | |
1018 | - | let totalLongAfter = $ | |
1019 | - | let totalShortAfter = $ | |
1025 | + | let $t04532745750 = internalClosePosition(_trader, false) | |
1026 | + | let x1 = $t04532745750._1 | |
1027 | + | let badDebt = $t04532745750._2 | |
1028 | + | let x2 = $t04532745750._3 | |
1029 | + | let x3 = $t04532745750._4 | |
1030 | + | let quoteAssetReserveAfter = $t04532745750._5 | |
1031 | + | let baseAssetReserveAfter = $t04532745750._6 | |
1032 | + | let totalPositionSizeAfter = $t04532745750._7 | |
1033 | + | let cumulativeNotionalAfter = $t04532745750._8 | |
1034 | + | let openInterestNotionalAfter = $t04532745750._9 | |
1035 | + | let exchangedQuoteAssetAmount = $t04532745750._10 | |
1036 | + | let totalLongAfter = $t04532745750._11 | |
1037 | + | let totalShortAfter = $t04532745750._12 | |
1020 | 1038 | let liquidationPenalty = muld(exchangedQuoteAssetAmount, liquidationFeeRatio()) | |
1021 | 1039 | let feeToLiquidator = (liquidationPenalty / 2) | |
1022 | 1040 | let feeToInsurance = (liquidationPenalty - feeToLiquidator) | |
1023 | 1041 | let ammBalance = (cbalance() - liquidationPenalty) | |
1024 | - | let $ | |
1042 | + | let $t04614846283 = if ((0 > ammBalance)) | |
1025 | 1043 | then $Tuple2(0, abs(ammBalance)) | |
1026 | 1044 | else $Tuple2(ammBalance, 0) | |
1027 | - | let newAmmBalance = $ | |
1028 | - | let takeFromInsurance = $ | |
1045 | + | let newAmmBalance = $t04614846283._1 | |
1046 | + | let takeFromInsurance = $t04614846283._2 | |
1029 | 1047 | let x = if ((takeFromInsurance > 0)) | |
1030 | 1048 | then { | |
1031 | 1049 | let withdrawInsurance = invoke(insuranceAddress(), "withdraw", [takeFromInsurance], nil) | |
1070 | 1088 | let underlyingPrice = getOracleTwapPrice() | |
1071 | 1089 | let spotTwapPrice = getTwapSpotPrice() | |
1072 | 1090 | let premium = (spotTwapPrice - underlyingPrice) | |
1073 | - | let $ | |
1091 | + | let $t04777749112 = if (if ((totalShortPositionSize() == 0)) | |
1074 | 1092 | then true | |
1075 | 1093 | else (totalLongPositionSize() == 0)) | |
1076 | 1094 | then $Tuple2(0, 0) | |
1085 | 1103 | let shortPremiumFraction = divd(muld(longPremiumFraction, totalLongPositionSize()), totalShortPositionSize()) | |
1086 | 1104 | $Tuple2(shortPremiumFraction, longPremiumFraction) | |
1087 | 1105 | } | |
1088 | - | let shortPremiumFraction = $ | |
1089 | - | let longPremiumFraction = $ | |
1106 | + | let shortPremiumFraction = $t04777749112._1 | |
1107 | + | let longPremiumFraction = $t04777749112._2 | |
1090 | 1108 | updateFunding((fundingBlockTimestamp + fundingPeriodSeconds()), (latestLongCumulativePremiumFraction() + longPremiumFraction), (latestShortCumulativePremiumFraction() + shortPremiumFraction), divd(longPremiumFraction, underlyingPrice), divd(shortPremiumFraction, underlyingPrice)) | |
1091 | 1109 | } | |
1092 | 1110 | } | |
1095 | 1113 | ||
1096 | 1114 | @Callable(i) | |
1097 | 1115 | func v_get (_trader) = { | |
1098 | - | let $ | |
1099 | - | let x1 = $ | |
1100 | - | let x2 = $ | |
1101 | - | let x3 = $ | |
1102 | - | let x4 = $ | |
1116 | + | let $t04948749547 = internalClosePosition(_trader, false) | |
1117 | + | let x1 = $t04948749547._1 | |
1118 | + | let x2 = $t04948749547._2 | |
1119 | + | let x3 = $t04948749547._3 | |
1120 | + | let x4 = $t04948749547._4 | |
1103 | 1121 | throw((((s(x2) + s(x3)) + s(x4)) + s(getMarginRatio(_trader)))) | |
1104 | 1122 | } | |
1105 | 1123 | ||
1107 | 1125 | ||
1108 | 1126 | @Callable(i) | |
1109 | 1127 | func view_calcRemainMarginWithFundingPayment (_trader) = { | |
1110 | - | let $ | |
1111 | - | let positionSize = $ | |
1112 | - | let positionMargin = $ | |
1113 | - | let pon = $ | |
1114 | - | let positionLstUpdCPF = $ | |
1115 | - | let $ | |
1116 | - | let positionNotional = $ | |
1117 | - | let unrealizedPnl = $ | |
1118 | - | let $ | |
1119 | - | let remainMargin = $ | |
1120 | - | let badDebt = $ | |
1121 | - | let fundingPayment = $ | |
1128 | + | let $t04969449805 = getPosition(_trader) | |
1129 | + | let positionSize = $t04969449805._1 | |
1130 | + | let positionMargin = $t04969449805._2 | |
1131 | + | let pon = $t04969449805._3 | |
1132 | + | let positionLstUpdCPF = $t04969449805._4 | |
1133 | + | let $t04981049911 = getPositionNotionalAndUnrealizedPnl(_trader, PNL_OPTION_SPOT) | |
1134 | + | let positionNotional = $t04981049911._1 | |
1135 | + | let unrealizedPnl = $t04981049911._2 | |
1136 | + | let $t04991650098 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl) | |
1137 | + | let remainMargin = $t04991650098._1 | |
1138 | + | let badDebt = $t04991650098._2 | |
1139 | + | let fundingPayment = $t04991650098._3 | |
1122 | 1140 | throw(((((s(remainMargin) + s(fundingPayment)) + s(getMarginRatio(_trader))) + s(unrealizedPnl)) + s(badDebt))) | |
1123 | 1141 | } | |
1124 | 1142 |
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_initialized = "k_initialized" | |
21 | 21 | ||
22 | 22 | let k_paused = "k_paused" | |
23 | 23 | ||
24 | 24 | let k_fee = "k_fee" | |
25 | 25 | ||
26 | 26 | let k_fundingPeriod = "k_fundingPeriod" | |
27 | 27 | ||
28 | 28 | let k_initMarginRatio = "k_initMarginRatio" | |
29 | 29 | ||
30 | 30 | let k_maintenanceMarginRatio = "k_mmr" | |
31 | 31 | ||
32 | 32 | let k_liquidationFeeRatio = "k_liquidationFeeRatio" | |
33 | 33 | ||
34 | 34 | let k_spreadLimit = "k_spreadLimit" | |
35 | 35 | ||
36 | 36 | let k_maxPriceImpact = "k_maxPriceImpact" | |
37 | 37 | ||
38 | 38 | let k_lastDataStr = "k_lastDataStr" | |
39 | 39 | ||
40 | 40 | let k_lastMinuteId = "k_lastMinuteId" | |
41 | 41 | ||
42 | 42 | let k_twapDataLastCumulativePrice = "k_twapDataLastCumulativePrice" | |
43 | 43 | ||
44 | 44 | let k_twapDataLastPrice = "k_twapDataLastPrice" | |
45 | 45 | ||
46 | 46 | let k_twapDataPreviousMinuteId = "k_twapDataPreviousMinuteId" | |
47 | 47 | ||
48 | 48 | let k_latestLongCumulativePremiumFraction = "k_latestLongPremiumFraction" | |
49 | 49 | ||
50 | 50 | let k_latestShortCumulativePremiumFraction = "k_latestShortPremiumFraction" | |
51 | 51 | ||
52 | 52 | let k_nextFundingBlock = "k_nextFundingBlockMinTimestamp" | |
53 | 53 | ||
54 | 54 | let k_longFundingRate = "k_longFundingRate" | |
55 | 55 | ||
56 | 56 | let k_shortFundingRate = "k_shortFundingRate" | |
57 | 57 | ||
58 | 58 | let k_quoteAssetReserve = "k_qtAstR" | |
59 | 59 | ||
60 | 60 | let k_baseAssetReserve = "k_bsAstR" | |
61 | 61 | ||
62 | 62 | let k_totalPositionSize = "k_totalPositionSize" | |
63 | 63 | ||
64 | 64 | let k_totalLongPositionSize = "k_totalLongPositionSize" | |
65 | 65 | ||
66 | 66 | let k_totalShortPositionSize = "k_totalShortPositionSize" | |
67 | 67 | ||
68 | 68 | let k_cumulativeNotional = "k_cumulativeNotional" | |
69 | 69 | ||
70 | 70 | let k_openInterestNotional = "k_openInterestNotional" | |
71 | 71 | ||
72 | 72 | let k_coordinatorAddress = "k_coordinatorAddress" | |
73 | 73 | ||
74 | 74 | let k_insurance_address = "k_insurance_address" | |
75 | 75 | ||
76 | 76 | let k_admin_address = "k_admin_address" | |
77 | 77 | ||
78 | 78 | let k_admin_public_key = "k_admin_public_key" | |
79 | 79 | ||
80 | 80 | let k_quote_asset = "k_quote_asset" | |
81 | 81 | ||
82 | 82 | let k_quote_staking = "k_quote_staking" | |
83 | 83 | ||
84 | 84 | let k_staking_address = "k_staking_address" | |
85 | 85 | ||
86 | 86 | let k_miner_address = "k_miner_address" | |
87 | 87 | ||
88 | 88 | func coordinator () = valueOrErrorMessage(addressFromString(getStringValue(this, k_coordinatorAddress)), "Coordinator not set") | |
89 | 89 | ||
90 | 90 | ||
91 | 91 | func adminAddress () = addressFromString(getStringValue(coordinator(), k_admin_address)) | |
92 | 92 | ||
93 | 93 | ||
94 | 94 | func adminPublicKey () = fromBase58String(getStringValue(coordinator(), k_admin_public_key)) | |
95 | 95 | ||
96 | 96 | ||
97 | 97 | func quoteAsset () = fromBase58String(getStringValue(coordinator(), k_quote_asset)) | |
98 | 98 | ||
99 | 99 | ||
100 | 100 | func quoteAssetStaking () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_quote_staking)), "Quote asset staking not set") | |
101 | 101 | ||
102 | 102 | ||
103 | 103 | func stakingAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_staking_address)), "Insurance not set") | |
104 | 104 | ||
105 | 105 | ||
106 | 106 | func insuranceAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_insurance_address)), "Insurance not set") | |
107 | 107 | ||
108 | 108 | ||
109 | 109 | func minerAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_miner_address)), "Insurance not set") | |
110 | 110 | ||
111 | 111 | ||
112 | 112 | let DIR_LONG = 1 | |
113 | 113 | ||
114 | 114 | let DIR_SHORT = 2 | |
115 | 115 | ||
116 | 116 | let TWAP_INTERVAL = 15 | |
117 | 117 | ||
118 | 118 | let ORACLE_INTERVAL = 15 | |
119 | 119 | ||
120 | 120 | let SECONDS = 1000 | |
121 | 121 | ||
122 | 122 | let DECIMAL_UNIT = (1 * (((((10 * 10) * 10) * 10) * 10) * 10)) | |
123 | 123 | ||
124 | 124 | let ONE_DAY = (86400 * DECIMAL_UNIT) | |
125 | 125 | ||
126 | 126 | let ALL_FEES = 100 | |
127 | 127 | ||
128 | 128 | let PNL_OPTION_SPOT = 1 | |
129 | 129 | ||
130 | 130 | let PNL_OPTION_ORACLE = 2 | |
131 | 131 | ||
132 | 132 | func s (_x) = (toString(_x) + ",") | |
133 | 133 | ||
134 | 134 | ||
135 | 135 | func divd (_x,_y) = fraction(_x, DECIMAL_UNIT, _y, HALFEVEN) | |
136 | 136 | ||
137 | 137 | ||
138 | 138 | func muld (_x,_y) = fraction(_x, _y, DECIMAL_UNIT, HALFEVEN) | |
139 | 139 | ||
140 | 140 | ||
141 | 141 | func abs (_x) = if ((_x > 0)) | |
142 | 142 | then _x | |
143 | 143 | else -(_x) | |
144 | 144 | ||
145 | 145 | ||
146 | 146 | func vmax (_x,_y) = if ((_x >= _y)) | |
147 | 147 | then _x | |
148 | 148 | else _y | |
149 | 149 | ||
150 | 150 | ||
151 | 151 | func toCompositeKey (_key,_address) = ((_key + "_") + _address) | |
152 | 152 | ||
153 | 153 | ||
154 | 154 | func listToStr (_list) = { | |
155 | 155 | func _join (accumulator,val) = ((accumulator + val) + ",") | |
156 | 156 | ||
157 | 157 | let newListStr = { | |
158 | 158 | let $l = _list | |
159 | 159 | let $s = size($l) | |
160 | 160 | let $acc0 = "" | |
161 | 161 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
162 | 162 | then $a | |
163 | 163 | else _join($a, $l[$i]) | |
164 | 164 | ||
165 | 165 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
166 | 166 | then $a | |
167 | 167 | else throw("List size exceeds 20") | |
168 | 168 | ||
169 | 169 | $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) | |
170 | 170 | } | |
171 | 171 | let newListStrU = dropRight(newListStr, 1) | |
172 | 172 | let newListStrR = if ((take(newListStrU, 1) == ",")) | |
173 | 173 | then drop(newListStrU, 1) | |
174 | 174 | else newListStrU | |
175 | 175 | newListStrR | |
176 | 176 | } | |
177 | 177 | ||
178 | 178 | ||
179 | 179 | func strToList (_str) = split(_str, ",") | |
180 | 180 | ||
181 | 181 | ||
182 | 182 | func pushToQueue (_list,_maxSize,_value) = if ((size(_list) > _maxSize)) | |
183 | 183 | then (removeByIndex(_list, 0) :+ _value) | |
184 | 184 | else (_list :+ _value) | |
185 | 185 | ||
186 | 186 | ||
187 | 187 | func int (k) = valueOrErrorMessage(getInteger(this, k), ("no value for " + k)) | |
188 | 188 | ||
189 | 189 | ||
190 | 190 | func cbalance () = int(k_balance) | |
191 | 191 | ||
192 | 192 | ||
193 | 193 | func fee () = int(k_fee) | |
194 | 194 | ||
195 | 195 | ||
196 | 196 | func initMarginRatio () = int(k_initMarginRatio) | |
197 | 197 | ||
198 | 198 | ||
199 | 199 | func qtAstR () = int(k_quoteAssetReserve) | |
200 | 200 | ||
201 | 201 | ||
202 | 202 | func bsAstR () = int(k_baseAssetReserve) | |
203 | 203 | ||
204 | 204 | ||
205 | 205 | func totalPositionSize () = int(k_totalPositionSize) | |
206 | 206 | ||
207 | 207 | ||
208 | 208 | func cumulativeNotional () = int(k_cumulativeNotional) | |
209 | 209 | ||
210 | 210 | ||
211 | 211 | func openInterestNotional () = int(k_openInterestNotional) | |
212 | 212 | ||
213 | 213 | ||
214 | 214 | func nextFundingBlockTimestamp () = int(k_nextFundingBlock) | |
215 | 215 | ||
216 | 216 | ||
217 | 217 | func fundingPeriodRaw () = int(k_fundingPeriod) | |
218 | 218 | ||
219 | 219 | ||
220 | 220 | func fundingPeriodDecimal () = (fundingPeriodRaw() * DECIMAL_UNIT) | |
221 | 221 | ||
222 | 222 | ||
223 | 223 | func fundingPeriodSeconds () = (fundingPeriodRaw() * SECONDS) | |
224 | 224 | ||
225 | 225 | ||
226 | 226 | func maintenanceMarginRatio () = int(k_maintenanceMarginRatio) | |
227 | 227 | ||
228 | 228 | ||
229 | 229 | func liquidationFeeRatio () = int(k_liquidationFeeRatio) | |
230 | 230 | ||
231 | 231 | ||
232 | 232 | func spreadLimit () = int(k_spreadLimit) | |
233 | 233 | ||
234 | 234 | ||
235 | 235 | func maxPriceImpact () = int(k_maxPriceImpact) | |
236 | 236 | ||
237 | 237 | ||
238 | 238 | func latestLongCumulativePremiumFraction () = int(k_latestLongCumulativePremiumFraction) | |
239 | 239 | ||
240 | 240 | ||
241 | 241 | func latestShortCumulativePremiumFraction () = int(k_latestShortCumulativePremiumFraction) | |
242 | 242 | ||
243 | 243 | ||
244 | 244 | func totalShortPositionSize () = int(k_totalShortPositionSize) | |
245 | 245 | ||
246 | 246 | ||
247 | 247 | func totalLongPositionSize () = int(k_totalLongPositionSize) | |
248 | 248 | ||
249 | 249 | ||
250 | 250 | func requireMoreMarginRatio (_marginRatio,_baseMarginRatio,_largerThanOrEqualTo) = { | |
251 | 251 | let remainingMarginRatio = (_marginRatio - _baseMarginRatio) | |
252 | 252 | if (if (_largerThanOrEqualTo) | |
253 | 253 | then (0 > remainingMarginRatio) | |
254 | 254 | else false) | |
255 | 255 | then throw("Invalid margin") | |
256 | 256 | else if (if (!(_largerThanOrEqualTo)) | |
257 | 257 | then (remainingMarginRatio >= 0) | |
258 | 258 | else false) | |
259 | 259 | then throw("Invalid margin") | |
260 | 260 | else true | |
261 | 261 | } | |
262 | 262 | ||
263 | 263 | ||
264 | 264 | func latestCumulativePremiumFraction (_positionSize) = if ((_positionSize == 0)) | |
265 | 265 | then throw("Should not be called with _positionSize == 0") | |
266 | 266 | else if ((_positionSize > 0)) | |
267 | 267 | then latestLongCumulativePremiumFraction() | |
268 | 268 | else latestShortCumulativePremiumFraction() | |
269 | 269 | ||
270 | 270 | ||
271 | 271 | func getPosition (_trader) = { | |
272 | 272 | let positionSizeOpt = getInteger(this, toCompositeKey(k_positionSize, _trader)) | |
273 | 273 | match positionSizeOpt { | |
274 | 274 | case positionSize: Int => | |
275 | 275 | $Tuple4(positionSize, getIntegerValue(this, toCompositeKey(k_positionMargin, _trader)), getIntegerValue(this, toCompositeKey(k_positionOpenNotional, _trader)), getIntegerValue(this, toCompositeKey(k_positionLastUpdatedCumulativePremiumFraction, _trader))) | |
276 | 276 | case _ => | |
277 | 277 | $Tuple4(0, 0, 0, 0) | |
278 | 278 | } | |
279 | 279 | } | |
280 | 280 | ||
281 | 281 | ||
282 | 282 | func requireOpenPosition (_trader) = if ((getPosition(_trader)._1 == 0)) | |
283 | 283 | then throw("No open position") | |
284 | 284 | else true | |
285 | 285 | ||
286 | 286 | ||
287 | 287 | func initialized () = valueOrElse(getBoolean(this, k_initialized), false) | |
288 | 288 | ||
289 | 289 | ||
290 | 290 | func paused () = valueOrElse(getBoolean(this, k_paused), false) | |
291 | 291 | ||
292 | 292 | ||
293 | 293 | func updateReserve (_isAdd,_quoteAssetAmount,_baseAssetAmount) = if (_isAdd) | |
294 | 294 | then { | |
295 | 295 | let newBase = (bsAstR() - _baseAssetAmount) | |
296 | 296 | if ((0 >= newBase)) | |
297 | 297 | then throw("Tx lead to base asset reserve <= 0, revert") | |
298 | 298 | else $Tuple4((qtAstR() + _quoteAssetAmount), newBase, (totalPositionSize() + _baseAssetAmount), (cumulativeNotional() + _quoteAssetAmount)) | |
299 | 299 | } | |
300 | 300 | else { | |
301 | 301 | let newQuote = (qtAstR() - _quoteAssetAmount) | |
302 | 302 | if ((0 >= newQuote)) | |
303 | 303 | then throw("Tx lead to base quote reserve <= 0, revert") | |
304 | 304 | else $Tuple4(newQuote, (bsAstR() + _baseAssetAmount), (totalPositionSize() - _baseAssetAmount), (cumulativeNotional() - _quoteAssetAmount)) | |
305 | 305 | } | |
306 | 306 | ||
307 | 307 | ||
308 | 308 | func swapInput (_isAdd,_quoteAssetAmount) = { | |
309 | 309 | let _qtAstR = qtAstR() | |
310 | 310 | let _bsAstR = bsAstR() | |
311 | 311 | let k = muld(_qtAstR, _bsAstR) | |
312 | 312 | let quoteAssetReserveAfter = if (_isAdd) | |
313 | 313 | then (_qtAstR + _quoteAssetAmount) | |
314 | 314 | else (_qtAstR - _quoteAssetAmount) | |
315 | 315 | let baseAssetReserveAfter = divd(k, quoteAssetReserveAfter) | |
316 | 316 | let amountBaseAssetBoughtAbs = abs((baseAssetReserveAfter - _bsAstR)) | |
317 | 317 | let amountBaseAssetBought = if (_isAdd) | |
318 | 318 | then amountBaseAssetBoughtAbs | |
319 | 319 | else -(amountBaseAssetBoughtAbs) | |
320 | 320 | let $t01183712030 = updateReserve(_isAdd, _quoteAssetAmount, amountBaseAssetBoughtAbs) | |
321 | 321 | let quoteAssetReserveAfter1 = $t01183712030._1 | |
322 | 322 | let baseAssetReserveAfter1 = $t01183712030._2 | |
323 | 323 | let totalPositionSizeAfter1 = $t01183712030._3 | |
324 | 324 | let cumulativeNotionalAfter1 = $t01183712030._4 | |
325 | 325 | let priceBefore = divd(_qtAstR, _bsAstR) | |
326 | 326 | let marketPrice = divd(_quoteAssetAmount, amountBaseAssetBoughtAbs) | |
327 | 327 | let priceDiff = abs((priceBefore - marketPrice)) | |
328 | 328 | let priceImpact = (DECIMAL_UNIT - divd(priceBefore, (priceBefore + priceDiff))) | |
329 | 329 | let maxPriceImpactValue = maxPriceImpact() | |
330 | 330 | if ((priceImpact > maxPriceImpactValue)) | |
331 | 331 | 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))) | |
332 | 332 | else $Tuple5(amountBaseAssetBought, quoteAssetReserveAfter1, baseAssetReserveAfter1, totalPositionSizeAfter1, cumulativeNotionalAfter1) | |
333 | 333 | } | |
334 | 334 | ||
335 | 335 | ||
336 | 336 | func calcRemainMarginWithFundingPayment (_oldPositionSize,_oldPositionMargin,_oldPositionCumulativePremiumFraction,_marginDelta) = { | |
337 | 337 | let fundingPayment = if ((_oldPositionSize != 0)) | |
338 | 338 | then { | |
339 | 339 | let _latestCumulativePremiumFraction = latestCumulativePremiumFraction(_oldPositionSize) | |
340 | 340 | muld((_latestCumulativePremiumFraction - _oldPositionCumulativePremiumFraction), _oldPositionSize) | |
341 | 341 | } | |
342 | 342 | else 0 | |
343 | 343 | let signedMargin = ((_marginDelta - fundingPayment) + _oldPositionMargin) | |
344 | 344 | let $t01352113648 = if ((0 > signedMargin)) | |
345 | 345 | then $Tuple2(0, abs(signedMargin)) | |
346 | 346 | else $Tuple2(abs(signedMargin), 0) | |
347 | 347 | let remainMargin = $t01352113648._1 | |
348 | 348 | let badDebt = $t01352113648._2 | |
349 | 349 | $Tuple3(remainMargin, badDebt, fundingPayment) | |
350 | 350 | } | |
351 | 351 | ||
352 | 352 | ||
353 | 353 | func swapOutput (_isAdd,_baseAssetAmount,_checkMaxPriceImpact) = { | |
354 | 354 | let _quoteAssetReserve = qtAstR() | |
355 | 355 | let _baseAssetReserve = bsAstR() | |
356 | 356 | let priceBefore = divd(_quoteAssetReserve, _baseAssetReserve) | |
357 | 357 | if ((_baseAssetAmount == 0)) | |
358 | 358 | then throw("Invalid base asset amount") | |
359 | 359 | else { | |
360 | 360 | let k = muld(_quoteAssetReserve, _baseAssetReserve) | |
361 | 361 | let baseAssetPoolAmountAfter = if (_isAdd) | |
362 | 362 | then (_baseAssetReserve + _baseAssetAmount) | |
363 | 363 | else (_baseAssetReserve - _baseAssetAmount) | |
364 | 364 | let quoteAssetAfter = divd(k, baseAssetPoolAmountAfter) | |
365 | 365 | let quoteAssetSold = abs((quoteAssetAfter - _quoteAssetReserve)) | |
366 | 366 | let maxPriceImpactValue = maxPriceImpact() | |
367 | 367 | let $t01463214825 = updateReserve(!(_isAdd), quoteAssetSold, _baseAssetAmount) | |
368 | 368 | let quoteAssetReserveAfter1 = $t01463214825._1 | |
369 | 369 | let baseAssetReserveAfter1 = $t01463214825._2 | |
370 | 370 | let totalPositionSizeAfter1 = $t01463214825._3 | |
371 | 371 | let cumulativeNotionalAfter1 = $t01463214825._4 | |
372 | 372 | let marketPrice = divd(quoteAssetSold, _baseAssetAmount) | |
373 | 373 | let priceDiff = abs((priceBefore - marketPrice)) | |
374 | 374 | let priceImpact = (DECIMAL_UNIT - divd(priceBefore, (priceBefore + priceDiff))) | |
375 | 375 | if (if ((priceImpact > maxPriceImpactValue)) | |
376 | 376 | then _checkMaxPriceImpact | |
377 | 377 | else false) | |
378 | 378 | 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))) | |
379 | 379 | else $Tuple7(quoteAssetSold, quoteAssetReserveAfter1, baseAssetReserveAfter1, totalPositionSizeAfter1, cumulativeNotionalAfter1, (totalLongPositionSize() - (if (_isAdd) | |
380 | 380 | then abs(_baseAssetAmount) | |
381 | 381 | else 0)), (totalShortPositionSize() - (if (!(_isAdd)) | |
382 | 382 | then abs(_baseAssetAmount) | |
383 | 383 | else 0))) | |
384 | 384 | } | |
385 | 385 | } | |
386 | 386 | ||
387 | 387 | ||
388 | 388 | func getOracleTwapPrice () = { | |
389 | 389 | let oracle = valueOrErrorMessage(addressFromString(getStringValue(this, k_ora)), "") | |
390 | 390 | let priceKey = getStringValue(this, k_ora_key) | |
391 | 391 | let blockKey = getStringValue(this, k_ora_block_key) | |
392 | 392 | let lastValue = valueOrErrorMessage(getInteger(oracle, priceKey), ((("Can not get oracle price. Oracle: " + toString(oracle)) + " key: ") + priceKey)) | |
393 | 393 | lastValue | |
394 | 394 | } | |
395 | 395 | ||
396 | 396 | ||
397 | 397 | func getSpotPrice () = { | |
398 | 398 | let _quoteAssetReserve = qtAstR() | |
399 | 399 | let _baseAssetReserve = bsAstR() | |
400 | 400 | divd(_quoteAssetReserve, _baseAssetReserve) | |
401 | 401 | } | |
402 | 402 | ||
403 | 403 | ||
404 | 404 | func isOverFluctuationLimit () = { | |
405 | 405 | let oraclePrice = getOracleTwapPrice() | |
406 | 406 | let currentPrice = getSpotPrice() | |
407 | 407 | (divd(abs((oraclePrice - currentPrice)), oraclePrice) > spreadLimit()) | |
408 | 408 | } | |
409 | 409 | ||
410 | 410 | ||
411 | 411 | func getPositionNotionalAndUnrealizedPnl (_trader,_option) = { | |
412 | 412 | let $t01729317421 = getPosition(_trader) | |
413 | 413 | let positionSize = $t01729317421._1 | |
414 | 414 | let positionMargin = $t01729317421._2 | |
415 | 415 | let positionOpenNotional = $t01729317421._3 | |
416 | 416 | let positionLstUpdCPF = $t01729317421._4 | |
417 | 417 | let positionSizeAbs = abs(positionSize) | |
418 | 418 | if ((positionSizeAbs == 0)) | |
419 | 419 | then throw("Invalid position size") | |
420 | 420 | else { | |
421 | 421 | let isShort = (0 > positionSize) | |
422 | 422 | let positionNotional = if ((_option == PNL_OPTION_SPOT)) | |
423 | 423 | then { | |
424 | 424 | let $t01766817792 = swapOutput(!(isShort), positionSizeAbs, false) | |
425 | 425 | let outPositionNotional = $t01766817792._1 | |
426 | 426 | let x1 = $t01766817792._2 | |
427 | 427 | let x2 = $t01766817792._3 | |
428 | 428 | let x3 = $t01766817792._4 | |
429 | 429 | outPositionNotional | |
430 | 430 | } | |
431 | 431 | else muld(positionSizeAbs, getOracleTwapPrice()) | |
432 | 432 | let unrealizedPnl = if (isShort) | |
433 | 433 | then (positionOpenNotional - positionNotional) | |
434 | 434 | else (positionNotional - positionOpenNotional) | |
435 | 435 | $Tuple2(positionNotional, unrealizedPnl) | |
436 | 436 | } | |
437 | 437 | } | |
438 | 438 | ||
439 | 439 | ||
440 | 440 | func calcMarginRatio (_remainMargin,_badDebt,_positionNotional) = divd((_remainMargin - _badDebt), _positionNotional) | |
441 | 441 | ||
442 | 442 | ||
443 | 443 | func getMarginRatioByOption (_trader,_option) = { | |
444 | 444 | let $t01846218573 = getPosition(_trader) | |
445 | 445 | let positionSize = $t01846218573._1 | |
446 | 446 | let positionMargin = $t01846218573._2 | |
447 | 447 | let pon = $t01846218573._3 | |
448 | 448 | let positionLstUpdCPF = $t01846218573._4 | |
449 | 449 | let $t01857918672 = getPositionNotionalAndUnrealizedPnl(_trader, _option) | |
450 | 450 | let positionNotional = $t01857918672._1 | |
451 | 451 | let unrealizedPnl = $t01857918672._2 | |
452 | 452 | let $t01867718843 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl) | |
453 | 453 | let remainMargin = $t01867718843._1 | |
454 | 454 | let badDebt = $t01867718843._2 | |
455 | 455 | calcMarginRatio(remainMargin, badDebt, positionNotional) | |
456 | 456 | } | |
457 | 457 | ||
458 | 458 | ||
459 | 459 | func getMarginRatio (_trader) = getMarginRatioByOption(_trader, PNL_OPTION_SPOT) | |
460 | 460 | ||
461 | 461 | ||
462 | 462 | func internalClosePosition (_trader,_checkMaxPriceImpact) = { | |
463 | 463 | let $t01919019318 = getPosition(_trader) | |
464 | 464 | let positionSize = $t01919019318._1 | |
465 | 465 | let positionMargin = $t01919019318._2 | |
466 | 466 | let positionOpenNotional = $t01919019318._3 | |
467 | 467 | let positionLstUpdCPF = $t01919019318._4 | |
468 | 468 | let $t01932419411 = getPositionNotionalAndUnrealizedPnl(_trader, PNL_OPTION_SPOT) | |
469 | 469 | let x1 = $t01932419411._1 | |
470 | 470 | let unrealizedPnl = $t01932419411._2 | |
471 | 471 | let $t01941619584 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl) | |
472 | 472 | let remainMargin = $t01941619584._1 | |
473 | 473 | let badDebt = $t01941619584._2 | |
474 | 474 | let exchangedPositionSize = -(positionSize) | |
475 | 475 | let realizedPnl = unrealizedPnl | |
476 | 476 | let marginToVault = -(remainMargin) | |
477 | 477 | let $t01971120022 = swapOutput((positionSize > 0), abs(positionSize), _checkMaxPriceImpact) | |
478 | 478 | let exchangedQuoteAssetAmount = $t01971120022._1 | |
479 | 479 | let quoteAssetReserveAfter = $t01971120022._2 | |
480 | 480 | let baseAssetReserveAfter = $t01971120022._3 | |
481 | 481 | let totalPositionSizeAfter = $t01971120022._4 | |
482 | 482 | let cumulativeNotionalAfter = $t01971120022._5 | |
483 | 483 | let totalLongAfter = $t01971120022._6 | |
484 | 484 | let totalShortAfter = $t01971120022._7 | |
485 | 485 | let openInterestNotionalAfter = (openInterestNotional() - positionOpenNotional) | |
486 | 486 | $Tuple12(exchangedPositionSize, badDebt, realizedPnl, marginToVault, quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, exchangedQuoteAssetAmount, totalLongAfter, totalShortAfter) | |
487 | 487 | } | |
488 | 488 | ||
489 | 489 | ||
490 | 490 | func getTwapSpotPrice () = { | |
491 | 491 | let minuteId = ((lastBlock.timestamp / 1000) / 60) | |
492 | 492 | let startMinuteId = (minuteId - TWAP_INTERVAL) | |
493 | 493 | let listStr = valueOrElse(getString(this, k_lastDataStr), "") | |
494 | 494 | let list = split(listStr, ",") | |
495 | 495 | func filterFn (accumulator,next) = if ((startMinuteId >= parseIntValue(next))) | |
496 | 496 | then (accumulator :+ parseIntValue(next)) | |
497 | 497 | else accumulator | |
498 | 498 | ||
499 | 499 | let listF = { | |
500 | 500 | let $l = list | |
501 | 501 | let $s = size($l) | |
502 | 502 | let $acc0 = nil | |
503 | 503 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
504 | 504 | then $a | |
505 | 505 | else filterFn($a, $l[$i]) | |
506 | 506 | ||
507 | 507 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
508 | 508 | then $a | |
509 | 509 | else throw("List size exceeds 20") | |
510 | 510 | ||
511 | 511 | $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) | |
512 | 512 | } | |
513 | 513 | let maxIndex = if ((size(listF) > 0)) | |
514 | 514 | then max(listF) | |
515 | 515 | else parseIntValue(list[0]) | |
516 | 516 | let lastMinuteId = valueOrElse(getInteger(this, k_lastMinuteId), 0) | |
517 | 517 | let endLastCumulativePrice = valueOrElse(getInteger(this, ((k_twapDataLastCumulativePrice + "_") + toString(lastMinuteId))), 0) | |
518 | 518 | let endLastPrice = valueOrElse(getInteger(this, ((k_twapDataLastPrice + "_") + toString(lastMinuteId))), 0) | |
519 | 519 | let nowCumulativePrice = (endLastCumulativePrice + ((minuteId - lastMinuteId) * endLastPrice)) | |
520 | 520 | let startLastCumulativePrice = valueOrElse(getInteger(this, ((k_twapDataLastCumulativePrice + "_") + toString(maxIndex))), 0) | |
521 | 521 | let startLastPrice = valueOrElse(getInteger(this, ((k_twapDataLastPrice + "_") + toString(maxIndex))), 0) | |
522 | 522 | let startCumulativePrice = (startLastCumulativePrice + ((startMinuteId - maxIndex) * startLastPrice)) | |
523 | 523 | ((nowCumulativePrice - startCumulativePrice) / TWAP_INTERVAL) | |
524 | 524 | } | |
525 | 525 | ||
526 | 526 | ||
527 | 527 | func updateSettings (_initMarginRatio,_mmr,_liquidationFeeRatio,_fundingPeriod,_fee,_spreadLimit,_maxPriceImpact) = [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)] | |
528 | 528 | ||
529 | 529 | ||
530 | 530 | 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)] | |
531 | 531 | ||
532 | 532 | ||
533 | 533 | 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)] | |
534 | 534 | ||
535 | 535 | ||
536 | 536 | func appendTwap (price) = { | |
537 | 537 | let minuteId = ((lastBlock.timestamp / 1000) / 60) | |
538 | 538 | let previousMinuteId = valueOrElse(getInteger(this, k_lastMinuteId), 0) | |
539 | 539 | if ((previousMinuteId > minuteId)) | |
540 | 540 | then throw("TWAP out-of-order") | |
541 | 541 | else { | |
542 | 542 | let lastMinuteId = if ((previousMinuteId == 0)) | |
543 | 543 | then minuteId | |
544 | 544 | else previousMinuteId | |
545 | 545 | if ((minuteId > previousMinuteId)) | |
546 | 546 | then { | |
547 | 547 | let prevCumulativePrice = valueOrElse(getInteger(this, ((k_twapDataLastCumulativePrice + "_") + toString(previousMinuteId))), 0) | |
548 | 548 | let prevPrice = valueOrElse(getInteger(this, ((k_twapDataLastPrice + "_") + toString(previousMinuteId))), price) | |
549 | 549 | let lastCumulativePrice = (prevCumulativePrice + ((minuteId - lastMinuteId) * prevPrice)) | |
550 | 550 | let list = pushToQueue(strToList(valueOrElse(getString(this, k_lastDataStr), "")), TWAP_INTERVAL, toString(minuteId)) | |
551 | 551 | [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))] | |
552 | 552 | } | |
553 | 553 | else { | |
554 | 554 | let twapDataPreviousMinuteId = valueOrElse(getInteger(this, toCompositeKey(k_twapDataPreviousMinuteId, toString(minuteId))), 0) | |
555 | 555 | let prevCumulativePrice = valueOrElse(getInteger(this, toCompositeKey(k_twapDataLastCumulativePrice, toString(twapDataPreviousMinuteId))), 0) | |
556 | 556 | let prevPrice = valueOrElse(getInteger(this, toCompositeKey(k_twapDataLastPrice, toString(twapDataPreviousMinuteId))), price) | |
557 | 557 | let lastCumulativePrice = (prevCumulativePrice + ((minuteId - twapDataPreviousMinuteId) * prevPrice)) | |
558 | 558 | [IntegerEntry(toCompositeKey(k_twapDataLastCumulativePrice, toString(minuteId)), lastCumulativePrice), IntegerEntry(toCompositeKey(k_twapDataLastPrice, toString(minuteId)), price)] | |
559 | 559 | } | |
560 | 560 | } | |
561 | 561 | } | |
562 | 562 | ||
563 | 563 | ||
564 | 564 | func updateAmmReserves (_qtAstR,_bsAstR) = [IntegerEntry(k_quoteAssetReserve, _qtAstR), IntegerEntry(k_baseAssetReserve, _bsAstR)] | |
565 | 565 | ||
566 | 566 | ||
567 | 567 | func updateAmm (_qtAstR,_bsAstR,_totalPositionSizeAfter,_cumulativeNotionalAfter,_openInterestNotional,_totalLongPositionSize,_totalShortPositionSize) = if (((_totalLongPositionSize - _totalShortPositionSize) != _totalPositionSizeAfter)) | |
568 | 568 | then throw(((((("Invalid AMM state data: " + toString(_totalLongPositionSize)) + " + ") + toString(_totalShortPositionSize)) + " != ") + toString(_totalPositionSizeAfter))) | |
569 | 569 | 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))) | |
570 | 570 | ||
571 | 571 | ||
572 | 572 | func deletePosition (_address) = [DeleteEntry(toCompositeKey(k_positionSize, _address)), DeleteEntry(toCompositeKey(k_positionMargin, _address)), DeleteEntry(toCompositeKey(k_positionOpenNotional, _address)), DeleteEntry(toCompositeKey(k_positionLastUpdatedCumulativePremiumFraction, _address))] | |
573 | 573 | ||
574 | 574 | ||
575 | 575 | func withdraw (_address,_amount) = { | |
576 | 576 | let balance = assetBalance(this, quoteAsset()) | |
577 | 577 | if ((_amount > balance)) | |
578 | 578 | then throw(((("Unable to withdraw " + toString(_amount)) + " from contract balance ") + toString(balance))) | |
579 | 579 | else [ScriptTransfer(_address, _amount, quoteAsset())] | |
580 | 580 | } | |
581 | 581 | ||
582 | 582 | ||
583 | 583 | func updateBalance (i) = if ((0 > i)) | |
584 | 584 | then throw("Balance") | |
585 | 585 | else [IntegerEntry(k_balance, i)] | |
586 | 586 | ||
587 | 587 | ||
588 | 588 | func transferFee (i) = [ScriptTransfer(stakingAddress(), i, quoteAsset())] | |
589 | 589 | ||
590 | 590 | ||
591 | 591 | @Callable(i) | |
592 | 592 | func pause () = if ((i.caller != adminAddress())) | |
593 | 593 | then throw("Invalid togglePause params") | |
594 | 594 | else [BooleanEntry(k_paused, true)] | |
595 | 595 | ||
596 | 596 | ||
597 | 597 | ||
598 | 598 | @Callable(i) | |
599 | 599 | func unpause () = if ((i.caller != adminAddress())) | |
600 | 600 | then throw("Invalid togglePause params") | |
601 | 601 | else [BooleanEntry(k_paused, false)] | |
602 | 602 | ||
603 | 603 | ||
604 | 604 | ||
605 | 605 | @Callable(i) | |
606 | 606 | func addLiquidity (_quoteAssetAmount) = if (if ((i.caller != adminAddress())) | |
607 | 607 | then true | |
608 | 608 | else (0 >= _quoteAssetAmount)) | |
609 | 609 | then throw("Invalid addLiquidity params") | |
610 | 610 | else { | |
611 | 611 | let _qtAstR = qtAstR() | |
612 | 612 | let _bsAstR = bsAstR() | |
613 | 613 | let price = divd(_qtAstR, _bsAstR) | |
614 | 614 | let baseAssetAmountToAdd = divd(_quoteAssetAmount, price) | |
615 | 615 | let qtAstRAfter = (_qtAstR + _quoteAssetAmount) | |
616 | 616 | let bsAstRAfter = (_bsAstR + baseAssetAmountToAdd) | |
617 | 617 | updateAmmReserves(qtAstRAfter, bsAstRAfter) | |
618 | 618 | } | |
619 | 619 | ||
620 | 620 | ||
621 | 621 | ||
622 | 622 | @Callable(i) | |
623 | 623 | func removeLiquidity (_quoteAssetAmount) = if (if ((i.caller != adminAddress())) | |
624 | 624 | then true | |
625 | 625 | else (0 >= _quoteAssetAmount)) | |
626 | 626 | then throw("Invalid removeLiquidity params") | |
627 | 627 | else { | |
628 | 628 | let _qtAstR = qtAstR() | |
629 | 629 | let _bsAstR = bsAstR() | |
630 | 630 | let price = divd(_qtAstR, _bsAstR) | |
631 | 631 | let baseAssetAmountToRemove = divd(_quoteAssetAmount, price) | |
632 | 632 | let qtAstRAfter = (_qtAstR - _quoteAssetAmount) | |
633 | 633 | let bsAstRAfter = (_bsAstR - baseAssetAmountToRemove) | |
634 | 634 | updateAmmReserves(qtAstRAfter, bsAstRAfter) | |
635 | 635 | } | |
636 | 636 | ||
637 | 637 | ||
638 | 638 | ||
639 | 639 | @Callable(i) | |
640 | 640 | func changeSettings (_initMarginRatio,_mmr,_liquidationFeeRatio,_fundingPeriod,_fee,_spreadLimit,_maxPriceImpact) = if ((i.caller != adminAddress())) | |
641 | 641 | then throw("Invalid changeSettings params") | |
642 | 642 | else updateSettings(_initMarginRatio, _mmr, _liquidationFeeRatio, _fundingPeriod, _fee, _spreadLimit, _maxPriceImpact) | |
643 | 643 | ||
644 | 644 | ||
645 | 645 | ||
646 | 646 | @Callable(i) | |
647 | 647 | func initialize (_qtAstR,_bsAstR,_fundingPeriod,_initMarginRatio,_mmr,_liquidationFeeRatio,_fee,_oracle,_oracleKey,_coordinator,_spreadLimit,_maxPriceImpact) = if (if (if (if (if (if (if (if (if (if ((0 >= _qtAstR)) | |
648 | 648 | then true | |
649 | 649 | else (0 >= _bsAstR)) | |
650 | 650 | then true | |
651 | 651 | else (0 >= _fundingPeriod)) | |
652 | 652 | then true | |
653 | 653 | else (0 >= _initMarginRatio)) | |
654 | 654 | then true | |
655 | 655 | else (0 >= _mmr)) | |
656 | 656 | then true | |
657 | 657 | else (0 >= _liquidationFeeRatio)) | |
658 | 658 | then true | |
659 | 659 | else (0 >= _fee)) | |
660 | 660 | then true | |
661 | 661 | else (0 >= _spreadLimit)) | |
662 | 662 | then true | |
663 | 663 | else (0 >= _maxPriceImpact)) | |
664 | 664 | then true | |
665 | 665 | else initialized()) | |
666 | 666 | then throw("Invalid initialize parameters") | |
667 | 667 | else ((((updateAmm(_qtAstR, _bsAstR, 0, 0, 0, 0, 0) ++ updateSettings(_initMarginRatio, _mmr, _liquidationFeeRatio, _fundingPeriod, _fee, _spreadLimit, _maxPriceImpact)) ++ 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)]) | |
668 | 668 | ||
669 | 669 | ||
670 | 670 | ||
671 | 671 | @Callable(i) | |
672 | + | func setMaxPriceImpact (_maxPriceImpact) = if (if ((0 >= _maxPriceImpact)) | |
673 | + | then true | |
674 | + | else !(initialized())) | |
675 | + | then throw("Invalid _maxPriceImpact parameters") | |
676 | + | else updateSettings(initMarginRatio(), maintenanceMarginRatio(), liquidationFeeRatio(), fundingPeriodRaw(), fee(), spreadLimit(), _maxPriceImpact) | |
677 | + | ||
678 | + | ||
679 | + | ||
680 | + | @Callable(i) | |
681 | + | func setInitMarginRatio (_initMarginRatio) = if (if ((0 >= _initMarginRatio)) | |
682 | + | then true | |
683 | + | else !(initialized())) | |
684 | + | then throw("Invalid setInitMarginRatio parameters") | |
685 | + | else updateSettings(_initMarginRatio, maintenanceMarginRatio(), liquidationFeeRatio(), fundingPeriodRaw(), fee(), spreadLimit(), maxPriceImpact()) | |
686 | + | ||
687 | + | ||
688 | + | ||
689 | + | @Callable(i) | |
672 | 690 | func decreasePosition (_amount,_leverage,_minBaseAssetAmount) = if (if (if (if (if ((0 >= _amount)) | |
673 | 691 | then true | |
674 | 692 | else !(initialized())) | |
675 | 693 | then true | |
676 | 694 | else !(requireMoreMarginRatio(divd(DECIMAL_UNIT, _leverage), initMarginRatio(), true))) | |
677 | 695 | then true | |
678 | 696 | else !(requireOpenPosition(toString(i.caller)))) | |
679 | 697 | then true | |
680 | 698 | else paused()) | |
681 | 699 | then throw("Invalid decreasePosition parameters") | |
682 | 700 | else { | |
683 | - | let $ | |
684 | - | let oldPositionSize = $ | |
685 | - | let oldPositionMargin = $ | |
686 | - | let oldPositionOpenNotional = $ | |
687 | - | let oldPositionLstUpdCPF = $ | |
701 | + | let $t03173131883 = getPosition(toString(i.caller)) | |
702 | + | let oldPositionSize = $t03173131883._1 | |
703 | + | let oldPositionMargin = $t03173131883._2 | |
704 | + | let oldPositionOpenNotional = $t03173131883._3 | |
705 | + | let oldPositionLstUpdCPF = $t03173131883._4 | |
688 | 706 | let _direction = if ((oldPositionSize > 0)) | |
689 | 707 | then DIR_SHORT | |
690 | 708 | else DIR_LONG | |
691 | 709 | let isAdd = (_direction == DIR_LONG) | |
692 | 710 | let openNotional = muld(_amount, _leverage) | |
693 | - | let $ | |
694 | - | let oldPositionNotional = $ | |
695 | - | let unrealizedPnl = $ | |
696 | - | let $ | |
711 | + | let $t03205632172 = getPositionNotionalAndUnrealizedPnl(toString(i.caller), PNL_OPTION_SPOT) | |
712 | + | let oldPositionNotional = $t03205632172._1 | |
713 | + | let unrealizedPnl = $t03205632172._2 | |
714 | + | let $t03217834727 = if ((oldPositionNotional > openNotional)) | |
697 | 715 | then { | |
698 | - | let $ | |
699 | - | let exchangedPositionSize = $ | |
700 | - | let quoteAssetReserveAfter = $ | |
701 | - | let baseAssetReserveAfter = $ | |
702 | - | let totalPositionSizeAfter = $ | |
703 | - | let cumulativeNotionalAfter = $ | |
716 | + | let $t03255532774 = swapInput(isAdd, openNotional) | |
717 | + | let exchangedPositionSize = $t03255532774._1 | |
718 | + | let quoteAssetReserveAfter = $t03255532774._2 | |
719 | + | let baseAssetReserveAfter = $t03255532774._3 | |
720 | + | let totalPositionSizeAfter = $t03255532774._4 | |
721 | + | let cumulativeNotionalAfter = $t03255532774._5 | |
704 | 722 | let exchangedPositionSizeAbs = abs(exchangedPositionSize) | |
705 | 723 | if (if ((_minBaseAssetAmount != 0)) | |
706 | 724 | then (_minBaseAssetAmount > exchangedPositionSizeAbs) | |
707 | 725 | else false) | |
708 | 726 | then throw(((("Too little base asset exchanged, got " + toString(exchangedPositionSizeAbs)) + " expected ") + toString(_minBaseAssetAmount))) | |
709 | 727 | else { | |
710 | 728 | let realizedPnl = divd(muld(unrealizedPnl, exchangedPositionSizeAbs), abs(oldPositionSize)) | |
711 | - | let $ | |
712 | - | let remainMargin = $ | |
713 | - | let badDebt = $ | |
714 | - | let fundingPayment = $ | |
729 | + | let $t03321133456 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, realizedPnl) | |
730 | + | let remainMargin = $t03321133456._1 | |
731 | + | let badDebt = $t03321133456._2 | |
732 | + | let fundingPayment = $t03321133456._3 | |
715 | 733 | let exchangedQuoteAssetAmount = openNotional | |
716 | 734 | let unrealizedPnlAfter = (unrealizedPnl - realizedPnl) | |
717 | 735 | let remainOpenNotional = if ((oldPositionSize > 0)) | |
718 | 736 | then ((oldPositionNotional - exchangedQuoteAssetAmount) - unrealizedPnlAfter) | |
719 | 737 | else ((unrealizedPnlAfter + oldPositionNotional) - exchangedQuoteAssetAmount) | |
720 | 738 | let newPositionSize = (oldPositionSize + exchangedPositionSize) | |
721 | 739 | $Tuple11(newPositionSize, remainMargin, abs(remainOpenNotional), latestCumulativePremiumFraction(newPositionSize), baseAssetReserveAfter, quoteAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, (openInterestNotional() - openNotional), (totalLongPositionSize() - (if ((newPositionSize > 0)) | |
722 | 740 | then abs(exchangedPositionSize) | |
723 | 741 | else 0)), (totalShortPositionSize() - (if ((0 > newPositionSize)) | |
724 | 742 | then abs(exchangedPositionSize) | |
725 | 743 | else 0))) | |
726 | 744 | } | |
727 | 745 | } | |
728 | 746 | else throw("Close position first") | |
729 | - | let newPositionSize = $ | |
730 | - | let newPositionRemainMargin = $ | |
731 | - | let newPositionOpenNotional = $ | |
732 | - | let newPositionLatestCPF = $ | |
733 | - | let baseAssetReserveAfter = $ | |
734 | - | let quoteAssetReserveAfter = $ | |
735 | - | let totalPositionSizeAfter = $ | |
736 | - | let cumulativeNotionalAfter = $ | |
737 | - | let openInterestNotionalAfter = $ | |
738 | - | let totalLongAfter = $ | |
739 | - | let totalShortAfter = $ | |
747 | + | let newPositionSize = $t03217834727._1 | |
748 | + | let newPositionRemainMargin = $t03217834727._2 | |
749 | + | let newPositionOpenNotional = $t03217834727._3 | |
750 | + | let newPositionLatestCPF = $t03217834727._4 | |
751 | + | let baseAssetReserveAfter = $t03217834727._5 | |
752 | + | let quoteAssetReserveAfter = $t03217834727._6 | |
753 | + | let totalPositionSizeAfter = $t03217834727._7 | |
754 | + | let cumulativeNotionalAfter = $t03217834727._8 | |
755 | + | let openInterestNotionalAfter = $t03217834727._9 | |
756 | + | let totalLongAfter = $t03217834727._10 | |
757 | + | let totalShortAfter = $t03217834727._11 | |
740 | 758 | let notifyNotional = invoke(minerAddress(), "notifyNotional", [toString(i.caller), newPositionOpenNotional], nil) | |
741 | 759 | if ((notifyNotional == notifyNotional)) | |
742 | 760 | then (updatePosition(toString(i.caller), newPositionSize, newPositionRemainMargin, newPositionOpenNotional, newPositionLatestCPF) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter)) | |
743 | 761 | else throw("Strict value is not equal to itself.") | |
744 | 762 | } | |
745 | 763 | ||
746 | 764 | ||
747 | 765 | ||
748 | 766 | @Callable(i) | |
749 | 767 | func increasePosition (_direction,_leverage,_minBaseAssetAmount) = { | |
750 | 768 | let _rawAmount = i.payments[0].amount | |
751 | 769 | if (if (if (if (if (if (if ((_direction != DIR_LONG)) | |
752 | 770 | then (_direction != DIR_SHORT) | |
753 | 771 | else false) | |
754 | 772 | then true | |
755 | 773 | else (0 >= _rawAmount)) | |
756 | 774 | then true | |
757 | 775 | else !(initialized())) | |
758 | 776 | then true | |
759 | 777 | else (i.payments[0].assetId != quoteAsset())) | |
760 | 778 | then true | |
761 | 779 | else !(requireMoreMarginRatio(divd(DECIMAL_UNIT, _leverage), initMarginRatio(), true))) | |
762 | 780 | then true | |
763 | 781 | else paused()) | |
764 | 782 | then throw("Invalid increasePosition parameters") | |
765 | 783 | else { | |
766 | 784 | let feeAmount = muld(_rawAmount, fee()) | |
767 | 785 | let _amount = (_rawAmount - feeAmount) | |
768 | - | let $ | |
769 | - | let oldPositionSize = $ | |
770 | - | let oldPositionMargin = $ | |
771 | - | let oldPositionOpenNotional = $ | |
772 | - | let oldPositionLstUpdCPF = $ | |
786 | + | let $t03584535997 = getPosition(toString(i.caller)) | |
787 | + | let oldPositionSize = $t03584535997._1 | |
788 | + | let oldPositionMargin = $t03584535997._2 | |
789 | + | let oldPositionOpenNotional = $t03584535997._3 | |
790 | + | let oldPositionLstUpdCPF = $t03584535997._4 | |
773 | 791 | let isNewPosition = (oldPositionSize == 0) | |
774 | 792 | let isSameDirection = if ((oldPositionSize > 0)) | |
775 | 793 | then (_direction == DIR_LONG) | |
776 | 794 | else (_direction == DIR_SHORT) | |
777 | 795 | let expandExisting = if (!(isNewPosition)) | |
778 | 796 | then isSameDirection | |
779 | 797 | else false | |
780 | 798 | let isAdd = (_direction == DIR_LONG) | |
781 | - | let $ | |
799 | + | let $t03628638675 = if (if (isNewPosition) | |
782 | 800 | then true | |
783 | 801 | else expandExisting) | |
784 | 802 | then { | |
785 | 803 | let openNotional = muld(_amount, _leverage) | |
786 | - | let $ | |
787 | - | let amountBaseAssetBought = $ | |
788 | - | let quoteAssetReserveAfter = $ | |
789 | - | let baseAssetReserveAfter = $ | |
790 | - | let totalPositionSizeAfter = $ | |
791 | - | let cumulativeNotionalAfter = $ | |
804 | + | let $t03671036916 = swapInput(isAdd, openNotional) | |
805 | + | let amountBaseAssetBought = $t03671036916._1 | |
806 | + | let quoteAssetReserveAfter = $t03671036916._2 | |
807 | + | let baseAssetReserveAfter = $t03671036916._3 | |
808 | + | let totalPositionSizeAfter = $t03671036916._4 | |
809 | + | let cumulativeNotionalAfter = $t03671036916._5 | |
792 | 810 | if (if ((_minBaseAssetAmount != 0)) | |
793 | 811 | then (_minBaseAssetAmount > abs(amountBaseAssetBought)) | |
794 | 812 | else false) | |
795 | 813 | then throw(((("Limit error: " + toString(abs(amountBaseAssetBought))) + " < ") + toString(_minBaseAssetAmount))) | |
796 | 814 | else { | |
797 | 815 | let newPositionSize = (oldPositionSize + amountBaseAssetBought) | |
798 | 816 | let increaseMarginRequirement = divd(openNotional, _leverage) | |
799 | - | let $ | |
800 | - | let remainMargin = $ | |
801 | - | let x1 = $ | |
802 | - | let x2 = $ | |
817 | + | let $t03729737536 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, increaseMarginRequirement) | |
818 | + | let remainMargin = $t03729737536._1 | |
819 | + | let x1 = $t03729737536._2 | |
820 | + | let x2 = $t03729737536._3 | |
803 | 821 | $Tuple11(newPositionSize, remainMargin, (oldPositionOpenNotional + openNotional), latestCumulativePremiumFraction(newPositionSize), baseAssetReserveAfter, quoteAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, (openInterestNotional() + openNotional), (totalLongPositionSize() + (if ((newPositionSize > 0)) | |
804 | 822 | then abs(amountBaseAssetBought) | |
805 | 823 | else 0)), (totalShortPositionSize() + (if ((0 > newPositionSize)) | |
806 | 824 | then abs(amountBaseAssetBought) | |
807 | 825 | else 0))) | |
808 | 826 | } | |
809 | 827 | } | |
810 | 828 | else { | |
811 | 829 | let openNotional = muld(_amount, _leverage) | |
812 | - | let $ | |
813 | - | let oldPositionNotional = $ | |
814 | - | let unrealizedPnl = $ | |
830 | + | let $t03836838484 = getPositionNotionalAndUnrealizedPnl(toString(i.caller), PNL_OPTION_SPOT) | |
831 | + | let oldPositionNotional = $t03836838484._1 | |
832 | + | let unrealizedPnl = $t03836838484._2 | |
815 | 833 | if ((oldPositionNotional > openNotional)) | |
816 | 834 | then throw("Use decreasePosition to decrease position size") | |
817 | 835 | else throw("Close position first") | |
818 | 836 | } | |
819 | - | let newPositionSize = $ | |
820 | - | let newPositionRemainMargin = $ | |
821 | - | let newPositionOpenNotional = $ | |
822 | - | let newPositionLatestCPF = $ | |
823 | - | let baseAssetReserveAfter = $ | |
824 | - | let quoteAssetReserveAfter = $ | |
825 | - | let totalPositionSizeAfter = $ | |
826 | - | let cumulativeNotionalAfter = $ | |
827 | - | let openInterestNotionalAfter = $ | |
828 | - | let totalLongAfter = $ | |
829 | - | let totalShortAfter = $ | |
837 | + | let newPositionSize = $t03628638675._1 | |
838 | + | let newPositionRemainMargin = $t03628638675._2 | |
839 | + | let newPositionOpenNotional = $t03628638675._3 | |
840 | + | let newPositionLatestCPF = $t03628638675._4 | |
841 | + | let baseAssetReserveAfter = $t03628638675._5 | |
842 | + | let quoteAssetReserveAfter = $t03628638675._6 | |
843 | + | let totalPositionSizeAfter = $t03628638675._7 | |
844 | + | let cumulativeNotionalAfter = $t03628638675._8 | |
845 | + | let openInterestNotionalAfter = $t03628638675._9 | |
846 | + | let totalLongAfter = $t03628638675._10 | |
847 | + | let totalShortAfter = $t03628638675._11 | |
830 | 848 | let feeToStakers = (feeAmount / 2) | |
831 | 849 | let feeToInsurance = (feeAmount - feeToStakers) | |
832 | 850 | let stake = invoke(quoteAssetStaking(), "lockNeutrinoSP", [toString(stakingAddress()), ALL_FEES], [AttachedPayment(quoteAsset(), _amount)]) | |
833 | 851 | if ((stake == stake)) | |
834 | 852 | then { | |
835 | 853 | let depositInsurance = invoke(insuranceAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), feeToInsurance)]) | |
836 | 854 | if ((depositInsurance == depositInsurance)) | |
837 | 855 | then { | |
838 | 856 | let notifyFee = invoke(minerAddress(), "notifyFees", [toString(i.caller), feeAmount], nil) | |
839 | 857 | if ((notifyFee == notifyFee)) | |
840 | 858 | then { | |
841 | 859 | let notifyNotional = invoke(minerAddress(), "notifyNotional", [toString(i.caller), newPositionOpenNotional], nil) | |
842 | 860 | if ((notifyNotional == notifyNotional)) | |
843 | 861 | then (((updatePosition(toString(i.caller), newPositionSize, newPositionRemainMargin, newPositionOpenNotional, newPositionLatestCPF) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter)) ++ transferFee(feeToStakers)) ++ updateBalance((cbalance() + _amount))) | |
844 | 862 | else throw("Strict value is not equal to itself.") | |
845 | 863 | } | |
846 | 864 | else throw("Strict value is not equal to itself.") | |
847 | 865 | } | |
848 | 866 | else throw("Strict value is not equal to itself.") | |
849 | 867 | } | |
850 | 868 | else throw("Strict value is not equal to itself.") | |
851 | 869 | } | |
852 | 870 | } | |
853 | 871 | ||
854 | 872 | ||
855 | 873 | ||
856 | 874 | @Callable(i) | |
857 | 875 | func addMargin () = { | |
858 | 876 | let _rawAmount = i.payments[0].amount | |
859 | 877 | if (if (if (if ((i.payments[0].assetId != quoteAsset())) | |
860 | 878 | then true | |
861 | 879 | else !(requireOpenPosition(toString(i.caller)))) | |
862 | 880 | then true | |
863 | 881 | else !(initialized())) | |
864 | 882 | then true | |
865 | 883 | else paused()) | |
866 | 884 | then throw("Invalid addMargin parameters") | |
867 | 885 | else { | |
868 | 886 | let feeAmount = muld(_rawAmount, fee()) | |
869 | 887 | let _amount = (_rawAmount - feeAmount) | |
870 | - | let $ | |
871 | - | let oldPositionSize = $ | |
872 | - | let oldPositionMargin = $ | |
873 | - | let oldPositionOpenNotional = $ | |
874 | - | let oldPositionLstUpdCPF = $ | |
888 | + | let $t04023140383 = getPosition(toString(i.caller)) | |
889 | + | let oldPositionSize = $t04023140383._1 | |
890 | + | let oldPositionMargin = $t04023140383._2 | |
891 | + | let oldPositionOpenNotional = $t04023140383._3 | |
892 | + | let oldPositionLstUpdCPF = $t04023140383._4 | |
875 | 893 | let feeToStakers = (feeAmount / 2) | |
876 | 894 | let feeToInsurance = (feeAmount - feeToStakers) | |
877 | 895 | let stake = invoke(quoteAssetStaking(), "lockNeutrinoSP", [toString(stakingAddress()), ALL_FEES], [AttachedPayment(quoteAsset(), _amount)]) | |
878 | 896 | if ((stake == stake)) | |
879 | 897 | then { | |
880 | 898 | let depositInsurance = invoke(insuranceAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), feeToInsurance)]) | |
881 | 899 | if ((depositInsurance == depositInsurance)) | |
882 | 900 | then { | |
883 | 901 | let notifyFee = invoke(minerAddress(), "notifyFees", [toString(i.caller), feeAmount], nil) | |
884 | 902 | if ((notifyFee == notifyFee)) | |
885 | 903 | then ((updatePosition(toString(i.caller), oldPositionSize, (oldPositionMargin + _amount), oldPositionOpenNotional, oldPositionLstUpdCPF) ++ transferFee(feeToStakers)) ++ updateBalance((cbalance() + _amount))) | |
886 | 904 | else throw("Strict value is not equal to itself.") | |
887 | 905 | } | |
888 | 906 | else throw("Strict value is not equal to itself.") | |
889 | 907 | } | |
890 | 908 | else throw("Strict value is not equal to itself.") | |
891 | 909 | } | |
892 | 910 | } | |
893 | 911 | ||
894 | 912 | ||
895 | 913 | ||
896 | 914 | @Callable(i) | |
897 | 915 | func removeMargin (_amount) = if (if (if (if ((0 >= _amount)) | |
898 | 916 | then true | |
899 | 917 | else !(requireOpenPosition(toString(i.caller)))) | |
900 | 918 | then true | |
901 | 919 | else !(initialized())) | |
902 | 920 | then true | |
903 | 921 | else paused()) | |
904 | 922 | then throw("Invalid removeMargin parameters") | |
905 | 923 | else { | |
906 | - | let $ | |
907 | - | let oldPositionSize = $ | |
908 | - | let oldPositionMargin = $ | |
909 | - | let oldPositionOpenNotional = $ | |
910 | - | let oldPositionLstUpdCPF = $ | |
924 | + | let $t04143241584 = getPosition(toString(i.caller)) | |
925 | + | let oldPositionSize = $t04143241584._1 | |
926 | + | let oldPositionMargin = $t04143241584._2 | |
927 | + | let oldPositionOpenNotional = $t04143241584._3 | |
928 | + | let oldPositionLstUpdCPF = $t04143241584._4 | |
911 | 929 | let marginDelta = -(_amount) | |
912 | - | let $ | |
913 | - | let remainMargin = $ | |
914 | - | let badDebt = $ | |
930 | + | let $t04162141800 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, marginDelta) | |
931 | + | let remainMargin = $t04162141800._1 | |
932 | + | let badDebt = $t04162141800._2 | |
915 | 933 | if ((badDebt != 0)) | |
916 | 934 | then throw("Invalid removed margin amount") | |
917 | 935 | else { | |
918 | 936 | let marginRatio = calcMarginRatio(remainMargin, badDebt, oldPositionOpenNotional) | |
919 | 937 | if (!(requireMoreMarginRatio(marginRatio, initMarginRatio(), true))) | |
920 | 938 | then throw(((("Too much margin removed: " + toString(marginRatio)) + " < ") + toString(initMarginRatio()))) | |
921 | 939 | else { | |
922 | 940 | let unstake = invoke(quoteAssetStaking(), "unlockNeutrino", [_amount, toBase58String(quoteAsset())], nil) | |
923 | 941 | if ((unstake == unstake)) | |
924 | 942 | then ((updatePosition(toString(i.caller), oldPositionSize, remainMargin, oldPositionOpenNotional, latestCumulativePremiumFraction(oldPositionSize)) ++ withdraw(i.caller, _amount)) ++ updateBalance((cbalance() - _amount))) | |
925 | 943 | else throw("Strict value is not equal to itself.") | |
926 | 944 | } | |
927 | 945 | } | |
928 | 946 | } | |
929 | 947 | ||
930 | 948 | ||
931 | 949 | ||
932 | 950 | @Callable(i) | |
933 | 951 | func closePosition () = if (if (if (!(requireOpenPosition(toString(i.caller)))) | |
934 | 952 | then true | |
935 | 953 | else !(initialized())) | |
936 | 954 | then true | |
937 | 955 | else paused()) | |
938 | 956 | then throw("Invalid closePosition parameters") | |
939 | 957 | else { | |
940 | - | let $ | |
941 | - | let x1 = $ | |
942 | - | let positionBadDebt = $ | |
943 | - | let realizedPnl = $ | |
944 | - | let marginToVault = $ | |
945 | - | let quoteAssetReserveAfter = $ | |
946 | - | let baseAssetReserveAfter = $ | |
947 | - | let totalPositionSizeAfter = $ | |
948 | - | let cumulativeNotionalAfter = $ | |
949 | - | let openInterestNotionalAfter = $ | |
950 | - | let x2 = $ | |
951 | - | let totalLongAfter = $ | |
952 | - | let totalShortAfter = $ | |
958 | + | let $t04289643286 = internalClosePosition(toString(i.caller), true) | |
959 | + | let x1 = $t04289643286._1 | |
960 | + | let positionBadDebt = $t04289643286._2 | |
961 | + | let realizedPnl = $t04289643286._3 | |
962 | + | let marginToVault = $t04289643286._4 | |
963 | + | let quoteAssetReserveAfter = $t04289643286._5 | |
964 | + | let baseAssetReserveAfter = $t04289643286._6 | |
965 | + | let totalPositionSizeAfter = $t04289643286._7 | |
966 | + | let cumulativeNotionalAfter = $t04289643286._8 | |
967 | + | let openInterestNotionalAfter = $t04289643286._9 | |
968 | + | let x2 = $t04289643286._10 | |
969 | + | let totalLongAfter = $t04289643286._11 | |
970 | + | let totalShortAfter = $t04289643286._12 | |
953 | 971 | if ((positionBadDebt > 0)) | |
954 | 972 | then throw("Unable to close position with bad debt") | |
955 | 973 | else { | |
956 | 974 | let withdrawAmount = abs(marginToVault) | |
957 | 975 | let ammBalance = (cbalance() - withdrawAmount) | |
958 | - | let $ | |
976 | + | let $t04349543637 = if ((0 > ammBalance)) | |
959 | 977 | then $Tuple2(0, abs(ammBalance)) | |
960 | 978 | else $Tuple2(ammBalance, 0) | |
961 | - | let ammNewBalance = $ | |
962 | - | let getFromInsurance = $ | |
979 | + | let ammNewBalance = $t04349543637._1 | |
980 | + | let getFromInsurance = $t04349543637._2 | |
963 | 981 | let x = if ((getFromInsurance > 0)) | |
964 | 982 | then { | |
965 | 983 | let withdrawInsurance = invoke(insuranceAddress(), "withdraw", [getFromInsurance], nil) | |
966 | 984 | if ((withdrawInsurance == withdrawInsurance)) | |
967 | 985 | then nil | |
968 | 986 | else throw("Strict value is not equal to itself.") | |
969 | 987 | } | |
970 | 988 | else nil | |
971 | 989 | if ((x == x)) | |
972 | 990 | then { | |
973 | 991 | let unstake = invoke(quoteAssetStaking(), "unlockNeutrino", [(withdrawAmount - getFromInsurance), toBase58String(quoteAsset())], nil) | |
974 | 992 | if ((unstake == unstake)) | |
975 | 993 | then { | |
976 | 994 | let notifyNotional = invoke(minerAddress(), "notifyNotional", [toString(i.caller), 0], nil) | |
977 | 995 | if ((notifyNotional == notifyNotional)) | |
978 | 996 | then (((deletePosition(toString(i.caller)) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter)) ++ withdraw(i.caller, withdrawAmount)) ++ updateBalance(ammNewBalance)) | |
979 | 997 | else throw("Strict value is not equal to itself.") | |
980 | 998 | } | |
981 | 999 | else throw("Strict value is not equal to itself.") | |
982 | 1000 | } | |
983 | 1001 | else throw("Strict value is not equal to itself.") | |
984 | 1002 | } | |
985 | 1003 | } | |
986 | 1004 | ||
987 | 1005 | ||
988 | 1006 | ||
989 | 1007 | @Callable(i) | |
990 | 1008 | func liquidate (_trader) = { | |
991 | 1009 | let spotMarginRatio = getMarginRatioByOption(_trader, PNL_OPTION_SPOT) | |
992 | 1010 | let marginRatio = if (isOverFluctuationLimit()) | |
993 | 1011 | then { | |
994 | 1012 | let oracleMarginRatio = getMarginRatioByOption(_trader, PNL_OPTION_ORACLE) | |
995 | 1013 | vmax(spotMarginRatio, oracleMarginRatio) | |
996 | 1014 | } | |
997 | 1015 | else spotMarginRatio | |
998 | 1016 | if (if (if (if (!(requireMoreMarginRatio(marginRatio, maintenanceMarginRatio(), false))) | |
999 | 1017 | then true | |
1000 | 1018 | else !(requireOpenPosition(_trader))) | |
1001 | 1019 | then true | |
1002 | 1020 | else !(initialized())) | |
1003 | 1021 | then true | |
1004 | 1022 | else paused()) | |
1005 | 1023 | then throw("Unable to liquidate") | |
1006 | 1024 | else { | |
1007 | - | let $ | |
1008 | - | let x1 = $ | |
1009 | - | let badDebt = $ | |
1010 | - | let x2 = $ | |
1011 | - | let x3 = $ | |
1012 | - | let quoteAssetReserveAfter = $ | |
1013 | - | let baseAssetReserveAfter = $ | |
1014 | - | let totalPositionSizeAfter = $ | |
1015 | - | let cumulativeNotionalAfter = $ | |
1016 | - | let openInterestNotionalAfter = $ | |
1017 | - | let exchangedQuoteAssetAmount = $ | |
1018 | - | let totalLongAfter = $ | |
1019 | - | let totalShortAfter = $ | |
1025 | + | let $t04532745750 = internalClosePosition(_trader, false) | |
1026 | + | let x1 = $t04532745750._1 | |
1027 | + | let badDebt = $t04532745750._2 | |
1028 | + | let x2 = $t04532745750._3 | |
1029 | + | let x3 = $t04532745750._4 | |
1030 | + | let quoteAssetReserveAfter = $t04532745750._5 | |
1031 | + | let baseAssetReserveAfter = $t04532745750._6 | |
1032 | + | let totalPositionSizeAfter = $t04532745750._7 | |
1033 | + | let cumulativeNotionalAfter = $t04532745750._8 | |
1034 | + | let openInterestNotionalAfter = $t04532745750._9 | |
1035 | + | let exchangedQuoteAssetAmount = $t04532745750._10 | |
1036 | + | let totalLongAfter = $t04532745750._11 | |
1037 | + | let totalShortAfter = $t04532745750._12 | |
1020 | 1038 | let liquidationPenalty = muld(exchangedQuoteAssetAmount, liquidationFeeRatio()) | |
1021 | 1039 | let feeToLiquidator = (liquidationPenalty / 2) | |
1022 | 1040 | let feeToInsurance = (liquidationPenalty - feeToLiquidator) | |
1023 | 1041 | let ammBalance = (cbalance() - liquidationPenalty) | |
1024 | - | let $ | |
1042 | + | let $t04614846283 = if ((0 > ammBalance)) | |
1025 | 1043 | then $Tuple2(0, abs(ammBalance)) | |
1026 | 1044 | else $Tuple2(ammBalance, 0) | |
1027 | - | let newAmmBalance = $ | |
1028 | - | let takeFromInsurance = $ | |
1045 | + | let newAmmBalance = $t04614846283._1 | |
1046 | + | let takeFromInsurance = $t04614846283._2 | |
1029 | 1047 | let x = if ((takeFromInsurance > 0)) | |
1030 | 1048 | then { | |
1031 | 1049 | let withdrawInsurance = invoke(insuranceAddress(), "withdraw", [takeFromInsurance], nil) | |
1032 | 1050 | if ((withdrawInsurance == withdrawInsurance)) | |
1033 | 1051 | then nil | |
1034 | 1052 | else throw("Strict value is not equal to itself.") | |
1035 | 1053 | } | |
1036 | 1054 | else nil | |
1037 | 1055 | if ((x == x)) | |
1038 | 1056 | then { | |
1039 | 1057 | let unstake = invoke(quoteAssetStaking(), "unlockNeutrino", [(liquidationPenalty - takeFromInsurance), toBase58String(quoteAsset())], nil) | |
1040 | 1058 | if ((unstake == unstake)) | |
1041 | 1059 | then { | |
1042 | 1060 | let depositInsurance = invoke(insuranceAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), feeToInsurance)]) | |
1043 | 1061 | if ((depositInsurance == depositInsurance)) | |
1044 | 1062 | then { | |
1045 | 1063 | let notifyNotional = invoke(minerAddress(), "notifyNotional", [_trader, 0], nil) | |
1046 | 1064 | if ((notifyNotional == notifyNotional)) | |
1047 | 1065 | then (((deletePosition(_trader) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter)) ++ withdraw(i.caller, feeToLiquidator)) ++ updateBalance(newAmmBalance)) | |
1048 | 1066 | else throw("Strict value is not equal to itself.") | |
1049 | 1067 | } | |
1050 | 1068 | else throw("Strict value is not equal to itself.") | |
1051 | 1069 | } | |
1052 | 1070 | else throw("Strict value is not equal to itself.") | |
1053 | 1071 | } | |
1054 | 1072 | else throw("Strict value is not equal to itself.") | |
1055 | 1073 | } | |
1056 | 1074 | } | |
1057 | 1075 | ||
1058 | 1076 | ||
1059 | 1077 | ||
1060 | 1078 | @Callable(i) | |
1061 | 1079 | func payFunding () = { | |
1062 | 1080 | let fundingBlockTimestamp = nextFundingBlockTimestamp() | |
1063 | 1081 | if (if (if ((fundingBlockTimestamp > lastBlock.timestamp)) | |
1064 | 1082 | then true | |
1065 | 1083 | else !(initialized())) | |
1066 | 1084 | then true | |
1067 | 1085 | else paused()) | |
1068 | 1086 | then throw(((("Invalid funding block timestamp: " + toString(lastBlock.timestamp)) + " < ") + toString(fundingBlockTimestamp))) | |
1069 | 1087 | else { | |
1070 | 1088 | let underlyingPrice = getOracleTwapPrice() | |
1071 | 1089 | let spotTwapPrice = getTwapSpotPrice() | |
1072 | 1090 | let premium = (spotTwapPrice - underlyingPrice) | |
1073 | - | let $ | |
1091 | + | let $t04777749112 = if (if ((totalShortPositionSize() == 0)) | |
1074 | 1092 | then true | |
1075 | 1093 | else (totalLongPositionSize() == 0)) | |
1076 | 1094 | then $Tuple2(0, 0) | |
1077 | 1095 | else if ((0 > premium)) | |
1078 | 1096 | then { | |
1079 | 1097 | let shortPremiumFraction = divd(muld(premium, fundingPeriodDecimal()), ONE_DAY) | |
1080 | 1098 | let longPremiumFraction = divd(muld(shortPremiumFraction, totalShortPositionSize()), totalLongPositionSize()) | |
1081 | 1099 | $Tuple2(shortPremiumFraction, longPremiumFraction) | |
1082 | 1100 | } | |
1083 | 1101 | else { | |
1084 | 1102 | let longPremiumFraction = divd(muld(premium, fundingPeriodDecimal()), ONE_DAY) | |
1085 | 1103 | let shortPremiumFraction = divd(muld(longPremiumFraction, totalLongPositionSize()), totalShortPositionSize()) | |
1086 | 1104 | $Tuple2(shortPremiumFraction, longPremiumFraction) | |
1087 | 1105 | } | |
1088 | - | let shortPremiumFraction = $ | |
1089 | - | let longPremiumFraction = $ | |
1106 | + | let shortPremiumFraction = $t04777749112._1 | |
1107 | + | let longPremiumFraction = $t04777749112._2 | |
1090 | 1108 | updateFunding((fundingBlockTimestamp + fundingPeriodSeconds()), (latestLongCumulativePremiumFraction() + longPremiumFraction), (latestShortCumulativePremiumFraction() + shortPremiumFraction), divd(longPremiumFraction, underlyingPrice), divd(shortPremiumFraction, underlyingPrice)) | |
1091 | 1109 | } | |
1092 | 1110 | } | |
1093 | 1111 | ||
1094 | 1112 | ||
1095 | 1113 | ||
1096 | 1114 | @Callable(i) | |
1097 | 1115 | func v_get (_trader) = { | |
1098 | - | let $ | |
1099 | - | let x1 = $ | |
1100 | - | let x2 = $ | |
1101 | - | let x3 = $ | |
1102 | - | let x4 = $ | |
1116 | + | let $t04948749547 = internalClosePosition(_trader, false) | |
1117 | + | let x1 = $t04948749547._1 | |
1118 | + | let x2 = $t04948749547._2 | |
1119 | + | let x3 = $t04948749547._3 | |
1120 | + | let x4 = $t04948749547._4 | |
1103 | 1121 | throw((((s(x2) + s(x3)) + s(x4)) + s(getMarginRatio(_trader)))) | |
1104 | 1122 | } | |
1105 | 1123 | ||
1106 | 1124 | ||
1107 | 1125 | ||
1108 | 1126 | @Callable(i) | |
1109 | 1127 | func view_calcRemainMarginWithFundingPayment (_trader) = { | |
1110 | - | let $ | |
1111 | - | let positionSize = $ | |
1112 | - | let positionMargin = $ | |
1113 | - | let pon = $ | |
1114 | - | let positionLstUpdCPF = $ | |
1115 | - | let $ | |
1116 | - | let positionNotional = $ | |
1117 | - | let unrealizedPnl = $ | |
1118 | - | let $ | |
1119 | - | let remainMargin = $ | |
1120 | - | let badDebt = $ | |
1121 | - | let fundingPayment = $ | |
1128 | + | let $t04969449805 = getPosition(_trader) | |
1129 | + | let positionSize = $t04969449805._1 | |
1130 | + | let positionMargin = $t04969449805._2 | |
1131 | + | let pon = $t04969449805._3 | |
1132 | + | let positionLstUpdCPF = $t04969449805._4 | |
1133 | + | let $t04981049911 = getPositionNotionalAndUnrealizedPnl(_trader, PNL_OPTION_SPOT) | |
1134 | + | let positionNotional = $t04981049911._1 | |
1135 | + | let unrealizedPnl = $t04981049911._2 | |
1136 | + | let $t04991650098 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl) | |
1137 | + | let remainMargin = $t04991650098._1 | |
1138 | + | let badDebt = $t04991650098._2 | |
1139 | + | let fundingPayment = $t04991650098._3 | |
1122 | 1140 | throw(((((s(remainMargin) + s(fundingPayment)) + s(getMarginRatio(_trader))) + s(unrealizedPnl)) + s(badDebt))) | |
1123 | 1141 | } | |
1124 | 1142 | ||
1125 | 1143 | ||
1126 | 1144 | ||
1127 | 1145 | @Callable(i) | |
1128 | 1146 | func forceMoveAsset (_trader,_amount) = if (if ((addressFromPublicKey(adminPublicKey()) != i.caller)) | |
1129 | 1147 | then true | |
1130 | 1148 | else (0 > _amount)) | |
1131 | 1149 | then throw("Invalid forceMoveAsset parameters") | |
1132 | 1150 | else { | |
1133 | 1151 | let unstake = invoke(quoteAssetStaking(), "unlockNeutrino", [_amount, toBase58String(quoteAsset())], nil) | |
1134 | 1152 | if ((unstake == unstake)) | |
1135 | 1153 | then (withdraw(addressFromStringValue(_trader), _amount) ++ updateBalance((cbalance() - _amount))) | |
1136 | 1154 | else throw("Strict value is not equal to itself.") | |
1137 | 1155 | } | |
1138 | 1156 | ||
1139 | 1157 | ||
1140 | 1158 | @Verifier(tx) | |
1141 | 1159 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], adminPublicKey()) | |
1142 | 1160 |
github/deemru/w8io/169f3d6 177.87 ms ◑