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