tx · 3jBfdf3b1m7yKm41jTtarUMEs3t8YCBZ3Ba4D1zxbTa1 3MpjMveMjHs97n26f8QdyN8i3Csx379uswG: -0.07500000 Waves 2023.06.06 19:33 [2611055] smart account 3MpjMveMjHs97n26f8QdyN8i3Csx379uswG > SELF 0.00000000 Waves
{ "type": 13, "id": "3jBfdf3b1m7yKm41jTtarUMEs3t8YCBZ3Ba4D1zxbTa1", "fee": 7500000, "feeAssetId": null, "timestamp": 1686069228854, "version": 2, "chainId": 84, "sender": "3MpjMveMjHs97n26f8QdyN8i3Csx379uswG", "senderPublicKey": "7yXUpfDsaJbPTTdmfjwoT8UnaUpTf61azAA8NGbkRxSM", "proofs": [ "2YbRRpb8JmSbLkEEyJTjUy4fU2fd9yTEQUSWsx3WqCXQbLMR1Nr1d3cGhtaq2QA5SQDo97TVUGksMciGSx5Sg76Z" ], "script": "base64:BgKOAQgCEgASABIAEgASAwoBARIRCg8BAQEBAQEBAQEBAQEBAQESFgoUAQEBAQEBAQgICAEBAQEBAQEBAQESBwoFAQEBCAgSBAoCAQgSBQoDAQEIEgcKBQEBAQQIEgUKAwgBCBIDCgEIEgMKAQgSABIAEgMKAQgSBQoDCAEIEgMKAQESABIDCgEIEgASBAoCCAi2AQAMa19iYXNlT3JhY2xlAgxrX2Jhc2VPcmFjbGUADWtfcXVvdGVPcmFjbGUCDWtfcXVvdGVPcmFjbGUACWtfYmFsYW5jZQIJa19iYWxhbmNlAAprX3NlcXVlbmNlAgprX3NlcXVlbmNlAA5rX3Bvc2l0aW9uU2l6ZQIOa19wb3NpdGlvblNpemUAEGtfcG9zaXRpb25NYXJnaW4CEGtfcG9zaXRpb25NYXJnaW4AFmtfcG9zaXRpb25PcGVuTm90aW9uYWwCFmtfcG9zaXRpb25PcGVuTm90aW9uYWwALmtfcG9zaXRpb25MYXN0VXBkYXRlZEN1bXVsYXRpdmVQcmVtaXVtRnJhY3Rpb24CEmtfcG9zaXRpb25GcmFjdGlvbgASa19wb3NpdGlvblNlcXV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UcmFkZXJXaXRoQXJ0aWZhY3QCB190cmFkZXILX2FydGlmYWN0SWQEBnJlc3VsdAkBGGdldEZvclRyYWRlcldpdGhBcnRpZmFjdAIFB190cmFkZXIFC19hcnRpZmFjdElkCQCUCgIFA25pbAUGcmVzdWx0AQJ0eAEGdmVyaWZ5AAQOY29vcmRpbmF0b3JTdHIJAJ0IAgUEdGhpcwUUa19jb29yZGluYXRvckFkZHJlc3MDCQEJaXNEZWZpbmVkAQUOY29vcmRpbmF0b3JTdHIEBWFkbWluCQCdCAIJARFAZXh0ck5hdGl2ZSgxMDYyKQEJAQV2YWx1ZQEFDmNvb3JkaW5hdG9yU3RyBQ9rX2FkbWluX2FkZHJlc3MDCQEJaXNEZWZpbmVkAQUFYWRtaW4JAQt2YWx1ZU9yRWxzZQIJAJsIAgkBEUBleHRyTmF0aXZlKDEwNjIpAQkBBXZhbHVlAQUFYWRtaW4JAKwCAgkArAICCQCsAgICB3N0YXR1c18JAKUIAQUEdGhpcwIBXwkA2AQBCAUCdHgCaWQHCQACAQIudW5hYmxlIHRvIHZlcmlmeTogYWRtaW4gbm90IHNldCBpbiBjb29yZGluYXRvcgkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tleYs4L3Y=", "height": 2611055, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: DScut2b9TZqS12LvrgRok7ZzxE3V1atYVbPE1SKwZ11h Next: 5uDiV7NBKy8GhTDAjhGajbgkwAxFWPEhqA3hcN3zqbRH Diff:
Old | New | Differences | |
---|---|---|---|
217 | 217 | func cbalance () = int(k_balance) | |
218 | 218 | ||
219 | 219 | ||
220 | + | func cbalance0 () = intOr(k_balance, 0) | |
221 | + | ||
222 | + | ||
220 | 223 | func fee () = int(k_fee) | |
221 | 224 | ||
222 | 225 | ||
229 | 232 | func qtAstR () = int(k_quoteAssetReserve) | |
230 | 233 | ||
231 | 234 | ||
235 | + | func qtAstR0 () = intOr(k_quoteAssetReserve, 0) | |
236 | + | ||
237 | + | ||
232 | 238 | func bsAstR () = int(k_baseAssetReserve) | |
239 | + | ||
240 | + | ||
241 | + | func bsAstR0 () = intOr(k_baseAssetReserve, 0) | |
233 | 242 | ||
234 | 243 | ||
235 | 244 | func qtAstW () = intOr(k_quoteAssetWeight, DECIMAL_UNIT) | |
434 | 443 | let amountBaseAssetBought = if (_isAdd) | |
435 | 444 | then amountBaseAssetBoughtAbs | |
436 | 445 | else -(amountBaseAssetBoughtAbs) | |
437 | - | let $ | |
438 | - | let quoteAssetReserveAfter1 = $ | |
439 | - | let baseAssetReserveAfter1 = $ | |
440 | - | let totalPositionSizeAfter1 = $ | |
446 | + | let $t01591816088 = updateReserve(_isAdd, quoteAssetAmountAdjusted, amountBaseAssetBoughtAbs) | |
447 | + | let quoteAssetReserveAfter1 = $t01591816088._1 | |
448 | + | let baseAssetReserveAfter1 = $t01591816088._2 | |
449 | + | let totalPositionSizeAfter1 = $t01591816088._3 | |
441 | 450 | let priceBefore = divd(muld(_qtAstR, _qtAstW), muld(_bsAstR, _bsAstW)) | |
442 | 451 | let marketPrice = divd(_quoteAssetAmount, amountBaseAssetBoughtAbs) | |
443 | 452 | let priceDiff = abs((priceBefore - marketPrice)) | |
465 | 474 | else 0 | |
466 | 475 | let rolloverFee = calcRolloverFee(_oldPositionMargin, _oldPositionLastUpdatedTimestamp) | |
467 | 476 | let signedMargin = (((_marginDelta - rolloverFee) - fundingPayment) + _oldPositionMargin) | |
468 | - | let $ | |
477 | + | let $t01875518882 = if ((0 > signedMargin)) | |
469 | 478 | then $Tuple2(0, abs(signedMargin)) | |
470 | 479 | else $Tuple2(abs(signedMargin), 0) | |
471 | - | let remainMargin = $ | |
472 | - | let badDebt = $ | |
480 | + | let remainMargin = $t01875518882._1 | |
481 | + | let badDebt = $t01875518882._2 | |
473 | 482 | $Tuple4(remainMargin, badDebt, fundingPayment, rolloverFee) | |
474 | 483 | } | |
475 | 484 | ||
487 | 496 | let quoteAssetDelta = abs((quoteAssetAfter - _quoteAssetReserve)) | |
488 | 497 | let quoteAssetSold = muld(quoteAssetDelta, _quoteAssetWeight) | |
489 | 498 | let maxPriceImpactValue = maxPriceImpact() | |
490 | - | let $ | |
491 | - | let quoteAssetReserveAfter1 = $ | |
492 | - | let baseAssetReserveAfter1 = $ | |
493 | - | let totalPositionSizeAfter1 = $ | |
499 | + | let $t02014420306 = updateReserve(!(_isAdd), quoteAssetDelta, _baseAssetAmount) | |
500 | + | let quoteAssetReserveAfter1 = $t02014420306._1 | |
501 | + | let baseAssetReserveAfter1 = $t02014420306._2 | |
502 | + | let totalPositionSizeAfter1 = $t02014420306._3 | |
494 | 503 | let marketPrice = divd(quoteAssetSold, _baseAssetAmount) | |
495 | 504 | let priceDiff = abs((priceBefore - marketPrice)) | |
496 | 505 | let priceImpact = (DECIMAL_UNIT - divd(priceBefore, (priceBefore + priceDiff))) | |
625 | 634 | ||
626 | 635 | ||
627 | 636 | func getPositionNotionalAndUnrealizedPnl (_trader,_direction,_option) = { | |
628 | - | let $ | |
629 | - | let positionSize = $ | |
630 | - | let positionMargin = $ | |
631 | - | let positionOpenNotional = $ | |
632 | - | let positionLstUpdCPF = $ | |
637 | + | let $t02819128331 = getPosition(_trader, _direction) | |
638 | + | let positionSize = $t02819128331._1 | |
639 | + | let positionMargin = $t02819128331._2 | |
640 | + | let positionOpenNotional = $t02819128331._3 | |
641 | + | let positionLstUpdCPF = $t02819128331._4 | |
633 | 642 | getPositionNotionalAndUnrealizedPnlByValues(positionSize, positionOpenNotional, qtAstR(), qtAstW(), bsAstR(), bsAstW(), _option) | |
634 | 643 | } | |
635 | 644 | ||
638 | 647 | ||
639 | 648 | ||
640 | 649 | func getMarginRatioByOption (_trader,_direction,_option) = { | |
641 | - | let $ | |
642 | - | let positionSize = $ | |
643 | - | let positionMargin = $ | |
644 | - | let pon = $ | |
645 | - | let positionLastUpdatedCPF = $ | |
646 | - | let positionTimestamp = $ | |
647 | - | let $ | |
648 | - | let positionNotional = $ | |
649 | - | let unrealizedPnl = $ | |
650 | - | let $ | |
651 | - | let remainMargin = $ | |
652 | - | let badDebt = $ | |
650 | + | let $t02886329016 = getPosition(_trader, _direction) | |
651 | + | let positionSize = $t02886329016._1 | |
652 | + | let positionMargin = $t02886329016._2 | |
653 | + | let pon = $t02886329016._3 | |
654 | + | let positionLastUpdatedCPF = $t02886329016._4 | |
655 | + | let positionTimestamp = $t02886329016._5 | |
656 | + | let $t02902229127 = getPositionNotionalAndUnrealizedPnl(_trader, _direction, _option) | |
657 | + | let positionNotional = $t02902229127._1 | |
658 | + | let unrealizedPnl = $t02902229127._2 | |
659 | + | let $t02913229344 = calcRemainMarginWithFundingPaymentAndRolloverFee(positionSize, positionMargin, positionLastUpdatedCPF, positionTimestamp, unrealizedPnl) | |
660 | + | let remainMargin = $t02913229344._1 | |
661 | + | let badDebt = $t02913229344._2 | |
653 | 662 | calcMarginRatio(remainMargin, badDebt, positionNotional) | |
654 | 663 | } | |
655 | 664 | ||
670 | 679 | ||
671 | 680 | ||
672 | 681 | func internalClosePosition (_trader,_direction,_size,_fee,_minQuoteAssetAmount,_addToMargin,_checkMaxPriceImpact,_liquidate) = { | |
673 | - | let $ | |
674 | - | let oldPositionSize = $ | |
675 | - | let oldPositionMargin = $ | |
676 | - | let oldPositionOpenNotional = $ | |
677 | - | let oldPositionLstUpdCPF = $ | |
678 | - | let oldPositionTimestamp = $ | |
682 | + | let $t03050730675 = getPosition(_trader, _direction) | |
683 | + | let oldPositionSize = $t03050730675._1 | |
684 | + | let oldPositionMargin = $t03050730675._2 | |
685 | + | let oldPositionOpenNotional = $t03050730675._3 | |
686 | + | let oldPositionLstUpdCPF = $t03050730675._4 | |
687 | + | let oldPositionTimestamp = $t03050730675._5 | |
679 | 688 | let isLongPosition = (oldPositionSize > 0) | |
680 | 689 | let absOldPositionSize = abs(oldPositionSize) | |
681 | 690 | if (if ((absOldPositionSize >= _size)) | |
683 | 692 | else false) | |
684 | 693 | then { | |
685 | 694 | let isPartialClose = (absOldPositionSize > _size) | |
686 | - | let $ | |
687 | - | let exchangedQuoteAssetAmount = $ | |
688 | - | let quoteAssetReserveAfter = $ | |
689 | - | let baseAssetReserveAfter = $ | |
690 | - | let totalPositionSizeAfter = $ | |
695 | + | let $t03096731418 = swapOutput((oldPositionSize > 0), _size, _checkMaxPriceImpact) | |
696 | + | let exchangedQuoteAssetAmount = $t03096731418._1 | |
697 | + | let quoteAssetReserveAfter = $t03096731418._2 | |
698 | + | let baseAssetReserveAfter = $t03096731418._3 | |
699 | + | let totalPositionSizeAfter = $t03096731418._4 | |
691 | 700 | let exchangedPositionSize = if ((oldPositionSize > 0)) | |
692 | 701 | then -(_size) | |
693 | 702 | else _size | |
694 | - | let $ | |
695 | - | let oldPositionNotional = $ | |
696 | - | let unrealizedPnl = $ | |
703 | + | let $t03163331857 = getPositionNotionalAndUnrealizedPnl(_trader, _direction, PNL_OPTION_SPOT) | |
704 | + | let oldPositionNotional = $t03163331857._1 | |
705 | + | let unrealizedPnl = $t03163331857._2 | |
697 | 706 | let realizedRatio = divd(abs(exchangedPositionSize), absOldPositionSize) | |
698 | 707 | let realizedPnl = muld(unrealizedPnl, realizedRatio) | |
699 | - | let $ | |
700 | - | let remainMarginBefore = $ | |
701 | - | let x1 = $ | |
702 | - | let x2 = $ | |
703 | - | let rolloverFee = $ | |
708 | + | let $t03219832444 = calcRemainMarginWithFundingPaymentAndRolloverFee(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, oldPositionTimestamp, unrealizedPnl) | |
709 | + | let remainMarginBefore = $t03219832444._1 | |
710 | + | let x1 = $t03219832444._2 | |
711 | + | let x2 = $t03219832444._3 | |
712 | + | let rolloverFee = $t03219832444._4 | |
704 | 713 | let positionBadDebt = calcRemainMarginWithFundingPaymentAndRolloverFee(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, oldPositionTimestamp, realizedPnl)._2 | |
705 | 714 | let realizedCloseFee = muld(muld(oldPositionNotional, realizedRatio), _fee) | |
706 | 715 | let unrealizedPnlAfter = (unrealizedPnl - realizedPnl) | |
708 | 717 | then ((oldPositionNotional - exchangedQuoteAssetAmount) - unrealizedPnlAfter) | |
709 | 718 | else ((unrealizedPnlAfter + oldPositionNotional) - exchangedQuoteAssetAmount) | |
710 | 719 | let newPositionSize = (oldPositionSize + exchangedPositionSize) | |
711 | - | let $ | |
720 | + | let $t03385034236 = if ((newPositionSize == 0)) | |
712 | 721 | then $Tuple2(0, 0) | |
713 | 722 | else $Tuple2(abs(remainOpenNotional), latestCumulativePremiumFraction(newPositionSize)) | |
714 | - | let newPositionOpenNotional = $ | |
715 | - | let newPositionLstUpdCPF = $ | |
723 | + | let newPositionOpenNotional = $t03385034236._1 | |
724 | + | let newPositionLstUpdCPF = $t03385034236._2 | |
716 | 725 | let openNotionalDelta = (oldPositionOpenNotional - newPositionOpenNotional) | |
717 | 726 | let marginRatio = getMarginRatioByOption(_trader, _direction, PNL_OPTION_SPOT) | |
718 | 727 | let newPositionMarginWithSameRatio = if ((oldPositionSize > 0)) | |
755 | 764 | then $Tuple2(qtAstR(), bsAstR()) | |
756 | 765 | else { | |
757 | 766 | let direction = (_positionSize > 0) | |
758 | - | let $ | |
759 | - | let currentNetMarketValue = $ | |
760 | - | let terminalQuoteAssetReserve = $ | |
761 | - | let terminalBaseAssetReserve = $ | |
767 | + | let $t03748337662 = swapOutput(direction, abs(_positionSize), false) | |
768 | + | let currentNetMarketValue = $t03748337662._1 | |
769 | + | let terminalQuoteAssetReserve = $t03748337662._2 | |
770 | + | let terminalBaseAssetReserve = $t03748337662._3 | |
762 | 771 | $Tuple2(terminalQuoteAssetReserve, terminalBaseAssetReserve) | |
763 | 772 | } | |
764 | 773 | } | |
843 | 852 | func getAdjustedFee (_artifactId,_baseFeeDiscount) = { | |
844 | 853 | let baseFeeRaw = fee() | |
845 | 854 | let baseFee = muld(baseFeeRaw, _baseFeeDiscount) | |
846 | - | let $ | |
855 | + | let $t04232642821 = if ((_artifactId != "")) | |
847 | 856 | then { | |
848 | 857 | let artifactKind = strA(nftManagerAddress(), toCompositeKey(k_token_type, _artifactId)) | |
849 | 858 | if ((artifactKind == FEE_REDUCTION_TOKEN_TYPE)) | |
855 | 864 | else throw("Invalid attached artifact") | |
856 | 865 | } | |
857 | 866 | else $Tuple2(baseFee, false) | |
858 | - | let adjustedFee = $ | |
859 | - | let burnArtifact = $ | |
867 | + | let adjustedFee = $t04232642821._1 | |
868 | + | let burnArtifact = $t04232642821._2 | |
860 | 869 | $Tuple2(adjustedFee, burnArtifact) | |
861 | 870 | } | |
862 | 871 | ||
871 | 880 | case _ => | |
872 | 881 | throw("Invalid computeFeeDiscount result") | |
873 | 882 | } | |
874 | - | let $ | |
875 | - | let adjustedFee = $ | |
876 | - | let burnArtifact = $ | |
883 | + | let $t04316743241 = getAdjustedFee(_artifactId, feeDiscount) | |
884 | + | let adjustedFee = $t04316743241._1 | |
885 | + | let burnArtifact = $t04316743241._2 | |
877 | 886 | $Tuple2(adjustedFee, burnArtifact) | |
878 | 887 | } | |
879 | 888 | else throw("Strict value is not equal to itself.") | |
931 | 940 | then true | |
932 | 941 | else (0 > _bsAstR)) | |
933 | 942 | then throw("Invalid amount to update reserves") | |
934 | - | else [IntegerEntry(k_quoteAssetReserve, _qtAstR), IntegerEntry(k_baseAssetReserve, _bsAstR)] | |
943 | + | else if (if ((_qtAstR != qtAstR0())) | |
944 | + | then true | |
945 | + | else (_bsAstR != bsAstR0())) | |
946 | + | then [IntegerEntry(k_quoteAssetReserve, _qtAstR), IntegerEntry(k_baseAssetReserve, _bsAstR)] | |
947 | + | else nil | |
935 | 948 | ||
936 | 949 | ||
937 | - | func updateAmmWeights (_qtAstW,_bsAstW) = [IntegerEntry(k_quoteAssetWeight, _qtAstW), IntegerEntry(k_baseAssetWeight, _bsAstW)] | |
950 | + | func updateAmmWeights (_qtAstW,_bsAstW) = if (if ((_qtAstW != qtAstW())) | |
951 | + | then true | |
952 | + | else (_bsAstW != bsAstW())) | |
953 | + | then [IntegerEntry(k_quoteAssetWeight, _qtAstW), IntegerEntry(k_baseAssetWeight, _bsAstW)] | |
954 | + | else nil | |
938 | 955 | ||
939 | 956 | ||
940 | 957 | func updateAmm (_qtAstR,_bsAstR,_totalPositionSizeAfter,_openInterestNotional,_totalLongPositionSize,_totalShortPositionSize,_totalLongOpenNotional,_totalShortOpenNotional) = { | |
960 | 977 | } | |
961 | 978 | ||
962 | 979 | ||
963 | - | func updateBalance ( | |
980 | + | func updateBalance (_balance) = if ((0 > _balance)) | |
964 | 981 | then throw("Balance") | |
965 | - | else [IntegerEntry(k_balance, i)] | |
982 | + | else if (if ((cbalance0() == 0)) | |
983 | + | then true | |
984 | + | else (cbalance0() != _balance)) | |
985 | + | then [IntegerEntry(k_balance, _balance)] | |
986 | + | else nil | |
966 | 987 | ||
967 | 988 | ||
968 | 989 | func transferFee (i) = [ScriptTransfer(stakingAddress(), i, quoteAsset())] | |
1015 | 1036 | let qtAstRAfter = (_qtAstR + _quoteAssetAmount) | |
1016 | 1037 | let baseAssetAmountToAdd = (divd(muld(qtAstRAfter, _qtAstW), price) - _bsAstR) | |
1017 | 1038 | let bsAstRAfter = (_bsAstR + baseAssetAmountToAdd) | |
1018 | - | let $ | |
1019 | - | let newQuoteAssetWeight = $ | |
1020 | - | let newBaseAssetWeight = $ | |
1021 | - | let marginToVault = $ | |
1039 | + | let $t05196652117 = getSyncTerminalPrice(getOraclePrice(), qtAstRAfter, bsAstRAfter) | |
1040 | + | let newQuoteAssetWeight = $t05196652117._1 | |
1041 | + | let newBaseAssetWeight = $t05196652117._2 | |
1042 | + | let marginToVault = $t05196652117._3 | |
1022 | 1043 | let doExchangePnL = if ((marginToVault != 0)) | |
1023 | 1044 | then { | |
1024 | 1045 | let doExchangePnL = invoke(vaultAddress(), "exchangeFreeAndLocked", [marginToVault], nil) | |
1163 | 1184 | else isMarketClosed()) | |
1164 | 1185 | then throw("Invalid increasePosition parameters") | |
1165 | 1186 | else { | |
1166 | - | let $ | |
1167 | - | let adjustedFee = $ | |
1168 | - | let burnArtifact = $ | |
1187 | + | let $t05849358642 = getForTraderWithArtifact(_trader, getArtifactId(i)) | |
1188 | + | let adjustedFee = $t05849358642._1 | |
1189 | + | let burnArtifact = $t05849358642._2 | |
1169 | 1190 | let _amount = divd(_rawAmount, (muld(adjustedFee, _leverage) + DECIMAL_UNIT)) | |
1170 | 1191 | let distributeFeeAmount = (_rawAmount - _amount) | |
1171 | 1192 | let referrerFeeAny = invoke(referralAddress(), "acceptPaymentWithLink", [_trader, _refLink], [AttachedPayment(quoteAsset(), distributeFeeAmount)]) | |
1178 | 1199 | throw("Invalid referrerFee") | |
1179 | 1200 | } | |
1180 | 1201 | let feeAmount = (distributeFeeAmount - referrerFee) | |
1181 | - | let $ | |
1182 | - | let oldPositionSize = $ | |
1183 | - | let oldPositionMargin = $ | |
1184 | - | let oldPositionOpenNotional = $ | |
1185 | - | let oldPositionLstUpdCPF = $ | |
1186 | - | let oldPositionTimestamp = $ | |
1202 | + | let $t05913859318 = getPosition(_trader, _direction) | |
1203 | + | let oldPositionSize = $t05913859318._1 | |
1204 | + | let oldPositionMargin = $t05913859318._2 | |
1205 | + | let oldPositionOpenNotional = $t05913859318._3 | |
1206 | + | let oldPositionLstUpdCPF = $t05913859318._4 | |
1207 | + | let oldPositionTimestamp = $t05913859318._5 | |
1187 | 1208 | let isNewPosition = (oldPositionSize == 0) | |
1188 | 1209 | let isSameDirection = if ((oldPositionSize > 0)) | |
1189 | 1210 | then (_direction == DIR_LONG) | |
1192 | 1213 | then isSameDirection | |
1193 | 1214 | else false | |
1194 | 1215 | let isAdd = (_direction == DIR_LONG) | |
1195 | - | let $ | |
1216 | + | let $t05960762740 = if (if (isNewPosition) | |
1196 | 1217 | then true | |
1197 | 1218 | else expandExisting) | |
1198 | 1219 | then { | |
1199 | 1220 | let openNotional = muld(_amount, _leverage) | |
1200 | - | let $ | |
1201 | - | let amountBaseAssetBought = $ | |
1202 | - | let quoteAssetReserveAfter = $ | |
1203 | - | let baseAssetReserveAfter = $ | |
1204 | - | let totalPositionSizeAfter = $ | |
1221 | + | let $t06011660289 = swapInput(isAdd, openNotional) | |
1222 | + | let amountBaseAssetBought = $t06011660289._1 | |
1223 | + | let quoteAssetReserveAfter = $t06011660289._2 | |
1224 | + | let baseAssetReserveAfter = $t06011660289._3 | |
1225 | + | let totalPositionSizeAfter = $t06011660289._4 | |
1205 | 1226 | if (if ((_minBaseAssetAmount != 0)) | |
1206 | 1227 | then (_minBaseAssetAmount > abs(amountBaseAssetBought)) | |
1207 | 1228 | else false) | |
1214 | 1235 | let totalShortOpenInterestAfter = (openInterestShort() + (if ((0 > newPositionSize)) | |
1215 | 1236 | then openNotional | |
1216 | 1237 | else 0)) | |
1217 | - | let $ | |
1218 | - | let remainMargin = $ | |
1219 | - | let x1 = $ | |
1220 | - | let x2 = $ | |
1221 | - | let rolloverFee = $ | |
1238 | + | let $t06083561110 = calcRemainMarginWithFundingPaymentAndRolloverFee(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, oldPositionTimestamp, _amount) | |
1239 | + | let remainMargin = $t06083561110._1 | |
1240 | + | let x1 = $t06083561110._2 | |
1241 | + | let x2 = $t06083561110._3 | |
1242 | + | let rolloverFee = $t06083561110._4 | |
1222 | 1243 | if (!(requireNotOverSpreadLimit(quoteAssetReserveAfter, baseAssetReserveAfter))) | |
1223 | 1244 | then throw("Over max spread limit") | |
1224 | 1245 | else if (!(requireNotOverMaxOpenNotional(totalLongOpenInterestAfter, totalShortOpenInterestAfter))) | |
1232 | 1253 | } | |
1233 | 1254 | else { | |
1234 | 1255 | let openNotional = muld(_amount, _leverage) | |
1235 | - | let $ | |
1236 | - | let oldPositionNotional = $ | |
1237 | - | let unrealizedPnl = $ | |
1256 | + | let $t06242862556 = getPositionNotionalAndUnrealizedPnl(toString(i.caller), _direction, PNL_OPTION_SPOT) | |
1257 | + | let oldPositionNotional = $t06242862556._1 | |
1258 | + | let unrealizedPnl = $t06242862556._2 | |
1238 | 1259 | if ((oldPositionNotional > openNotional)) | |
1239 | 1260 | then throw("Use decreasePosition to decrease position size") | |
1240 | 1261 | else throw("Close position first") | |
1241 | 1262 | } | |
1242 | - | let newPositionSize = $ | |
1243 | - | let newPositionRemainMargin = $ | |
1244 | - | let newPositionOpenNotional = $ | |
1245 | - | let newPositionLatestCPF = $ | |
1246 | - | let newPositionTimestamp = $ | |
1247 | - | let baseAssetReserveAfter = $ | |
1248 | - | let quoteAssetReserveAfter = $ | |
1249 | - | let totalPositionSizeAfter = $ | |
1250 | - | let openInterestNotionalAfter = $ | |
1251 | - | let totalLongAfter = $ | |
1252 | - | let totalShortAfter = $ | |
1253 | - | let totalLongOpenInterestAfter = $ | |
1254 | - | let totalShortOpenInterestAfter = $ | |
1255 | - | let rolloverFee = $ | |
1256 | - | let $ | |
1257 | - | let feeToStakers = $ | |
1258 | - | let feeToVault = $ | |
1263 | + | let newPositionSize = $t05960762740._1 | |
1264 | + | let newPositionRemainMargin = $t05960762740._2 | |
1265 | + | let newPositionOpenNotional = $t05960762740._3 | |
1266 | + | let newPositionLatestCPF = $t05960762740._4 | |
1267 | + | let newPositionTimestamp = $t05960762740._5 | |
1268 | + | let baseAssetReserveAfter = $t05960762740._6 | |
1269 | + | let quoteAssetReserveAfter = $t05960762740._7 | |
1270 | + | let totalPositionSizeAfter = $t05960762740._8 | |
1271 | + | let openInterestNotionalAfter = $t05960762740._9 | |
1272 | + | let totalLongAfter = $t05960762740._10 | |
1273 | + | let totalShortAfter = $t05960762740._11 | |
1274 | + | let totalLongOpenInterestAfter = $t05960762740._12 | |
1275 | + | let totalShortOpenInterestAfter = $t05960762740._13 | |
1276 | + | let rolloverFee = $t05960762740._14 | |
1277 | + | let $t06274662817 = distributeFee((feeAmount + rolloverFee)) | |
1278 | + | let feeToStakers = $t06274662817._1 | |
1279 | + | let feeToVault = $t06274662817._2 | |
1259 | 1280 | let stake = if ((_amount >= rolloverFee)) | |
1260 | 1281 | then invoke(vaultAddress(), "addLocked", nil, [AttachedPayment(quoteAsset(), (_amount - rolloverFee))]) | |
1261 | 1282 | else invoke(vaultAddress(), "withdrawLocked", [(rolloverFee - _amount)], nil) | |
1317 | 1338 | else isMarketClosed()) | |
1318 | 1339 | then throw("Invalid addMargin parameters") | |
1319 | 1340 | else { | |
1320 | - | let $ | |
1321 | - | let oldPositionSize = $ | |
1322 | - | let oldPositionMargin = $ | |
1323 | - | let oldPositionOpenNotional = $ | |
1324 | - | let oldPositionLstUpdCPF = $ | |
1325 | - | let oldPositionTimestamp = $ | |
1341 | + | let $t06515965339 = getPosition(_trader, _direction) | |
1342 | + | let oldPositionSize = $t06515965339._1 | |
1343 | + | let oldPositionMargin = $t06515965339._2 | |
1344 | + | let oldPositionOpenNotional = $t06515965339._3 | |
1345 | + | let oldPositionLstUpdCPF = $t06515965339._4 | |
1346 | + | let oldPositionTimestamp = $t06515965339._5 | |
1326 | 1347 | let stake = invoke(vaultAddress(), "addLocked", nil, [AttachedPayment(quoteAsset(), _amount)]) | |
1327 | 1348 | if ((stake == stake)) | |
1328 | 1349 | then { | |
1329 | 1350 | let rolloverFee = calcRolloverFee(oldPositionMargin, oldPositionTimestamp) | |
1330 | 1351 | let doTransferFeeToStakers = if ((rolloverFee > 0)) | |
1331 | 1352 | then { | |
1332 | - | let $ | |
1333 | - | let feeToStakers = $ | |
1334 | - | let feeToVault = $ | |
1353 | + | let $t06562465683 = distributeFee(rolloverFee) | |
1354 | + | let feeToStakers = $t06562465683._1 | |
1355 | + | let feeToVault = $t06562465683._2 | |
1335 | 1356 | let unstake = invoke(vaultAddress(), "withdrawLocked", [feeToStakers], nil) | |
1336 | 1357 | if ((unstake == unstake)) | |
1337 | 1358 | then { | |
1382 | 1403 | else isMarketClosed()) | |
1383 | 1404 | then throw("Invalid removeMargin parameters") | |
1384 | 1405 | else { | |
1385 | - | let $ | |
1386 | - | let oldPositionSize = $ | |
1387 | - | let oldPositionMargin = $ | |
1388 | - | let oldPositionOpenNotional = $ | |
1389 | - | let oldPositionLstUpdCPF = $ | |
1390 | - | let oldPositionTimestamp = $ | |
1391 | - | let $ | |
1392 | - | let remainMargin = $ | |
1393 | - | let badDebt = $ | |
1394 | - | let fundingPayment = $ | |
1395 | - | let rolloverFee = $ | |
1406 | + | let $t06718467364 = getPosition(_trader, _direction) | |
1407 | + | let oldPositionSize = $t06718467364._1 | |
1408 | + | let oldPositionMargin = $t06718467364._2 | |
1409 | + | let oldPositionOpenNotional = $t06718467364._3 | |
1410 | + | let oldPositionLstUpdCPF = $t06718467364._4 | |
1411 | + | let oldPositionTimestamp = $t06718467364._5 | |
1412 | + | let $t06737067619 = calcRemainMarginWithFundingPaymentAndRolloverFee(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, oldPositionTimestamp, -(_amount)) | |
1413 | + | let remainMargin = $t06737067619._1 | |
1414 | + | let badDebt = $t06737067619._2 | |
1415 | + | let fundingPayment = $t06737067619._3 | |
1416 | + | let rolloverFee = $t06737067619._4 | |
1396 | 1417 | if ((badDebt != 0)) | |
1397 | 1418 | then throw("Invalid removed margin amount") | |
1398 | 1419 | else { | |
1400 | 1421 | if (!(requireMoreMarginRatio(marginRatio, initMarginRatio(), true))) | |
1401 | 1422 | then throw(((("Too much margin removed: " + toString(marginRatio)) + " < ") + toString(initMarginRatio()))) | |
1402 | 1423 | else { | |
1403 | - | let $ | |
1404 | - | let feeToStakers = $ | |
1405 | - | let feeToVault = $ | |
1424 | + | let $t06800568064 = distributeFee(rolloverFee) | |
1425 | + | let feeToStakers = $t06800568064._1 | |
1426 | + | let feeToVault = $t06800568064._2 | |
1406 | 1427 | let doTransferFeeToStakers = if ((rolloverFee > 0)) | |
1407 | 1428 | then { | |
1408 | 1429 | let lockBadDebt = invoke(vaultAddress(), "exchangeFreeAndLocked", [-(feeToVault)], nil) | |
1460 | 1481 | then throw("Invalid closePosition parameters") | |
1461 | 1482 | else { | |
1462 | 1483 | let oldPositionTimestamp = getPosition(_trader, _direction)._5 | |
1463 | - | let $ | |
1464 | - | let newPositionSize = $ | |
1465 | - | let newPositionMargin = $ | |
1466 | - | let newPositionOpenNotional = $ | |
1467 | - | let newPositionLstUpdCPF = $ | |
1468 | - | let positionBadDebt = $ | |
1469 | - | let realizedPnl = $ | |
1470 | - | let marginToTrader = $ | |
1471 | - | let quoteAssetReserveAfter = $ | |
1472 | - | let baseAssetReserveAfter = $ | |
1473 | - | let totalPositionSizeAfter = $ | |
1474 | - | let openInterestNotionalAfter = $ | |
1475 | - | let totalLongAfter = $ | |
1476 | - | let totalShortAfter = $ | |
1477 | - | let totalLongOpenInterestAfter = $ | |
1478 | - | let totalShortOpenInterestAfter = $ | |
1479 | - | let realizedFee = $ | |
1484 | + | let $t07039971002 = internalClosePosition(_trader, _direction, _size, positionFee, _minQuoteAssetAmount, _addToMargin, true, true) | |
1485 | + | let newPositionSize = $t07039971002._1 | |
1486 | + | let newPositionMargin = $t07039971002._2 | |
1487 | + | let newPositionOpenNotional = $t07039971002._3 | |
1488 | + | let newPositionLstUpdCPF = $t07039971002._4 | |
1489 | + | let positionBadDebt = $t07039971002._5 | |
1490 | + | let realizedPnl = $t07039971002._6 | |
1491 | + | let marginToTrader = $t07039971002._7 | |
1492 | + | let quoteAssetReserveAfter = $t07039971002._8 | |
1493 | + | let baseAssetReserveAfter = $t07039971002._9 | |
1494 | + | let totalPositionSizeAfter = $t07039971002._10 | |
1495 | + | let openInterestNotionalAfter = $t07039971002._11 | |
1496 | + | let totalLongAfter = $t07039971002._12 | |
1497 | + | let totalShortAfter = $t07039971002._13 | |
1498 | + | let totalLongOpenInterestAfter = $t07039971002._14 | |
1499 | + | let totalShortOpenInterestAfter = $t07039971002._15 | |
1500 | + | let realizedFee = $t07039971002._16 | |
1480 | 1501 | if ((positionBadDebt > 0)) | |
1481 | 1502 | then throw("Invalid closePosition parameters: bad debt") | |
1482 | 1503 | else if ((oldPositionTimestamp >= lastTimestamp())) | |
1500 | 1521 | case _ => | |
1501 | 1522 | throw("Invalid referrerFee") | |
1502 | 1523 | } | |
1503 | - | let $ | |
1504 | - | let feeToStakers = $ | |
1505 | - | let feeToVault = $ | |
1524 | + | let $t07197472047 = distributeFee((realizedFee - referrerFee)) | |
1525 | + | let feeToStakers = $t07197472047._1 | |
1526 | + | let feeToVault = $t07197472047._2 | |
1506 | 1527 | let depositVault = invoke(vaultAddress(), "addFree", nil, [AttachedPayment(quoteAsset(), feeToVault)]) | |
1507 | 1528 | if ((depositVault == depositVault)) | |
1508 | 1529 | then { | |
1570 | 1591 | else false | |
1571 | 1592 | let oldPositionSize = getPosition(_trader, _direction)._1 | |
1572 | 1593 | let positionSizeAbs = abs(oldPositionSize) | |
1573 | - | let $ | |
1594 | + | let $t07464074963 = if (isPartialLiquidation) | |
1574 | 1595 | then { | |
1575 | 1596 | let liquidationSize = getPartialLiquidationAmount(_trader, oldPositionSize) | |
1576 | 1597 | let liquidationRatio = divd(abs(liquidationSize), positionSizeAbs) | |
1577 | 1598 | $Tuple2(liquidationRatio, abs(liquidationSize)) | |
1578 | 1599 | } | |
1579 | 1600 | else $Tuple2(0, positionSizeAbs) | |
1580 | - | let liquidationRatio = $ | |
1581 | - | let liquidationSize = $ | |
1582 | - | let $ | |
1601 | + | let liquidationRatio = $t07464074963._1 | |
1602 | + | let liquidationSize = $t07464074963._2 | |
1603 | + | let $t07496975625 = internalClosePosition(_trader, _direction, if (isPartialLiquidation) | |
1583 | 1604 | then liquidationSize | |
1584 | 1605 | else positionSizeAbs, liquidationFeeRatio(), 0, true, false, true) | |
1585 | - | let newPositionSize = $ | |
1586 | - | let newPositionMargin = $ | |
1587 | - | let newPositionOpenNotional = $ | |
1588 | - | let newPositionLstUpdCPF = $ | |
1589 | - | let positionBadDebt = $ | |
1590 | - | let realizedPnl = $ | |
1591 | - | let marginToTrader = $ | |
1592 | - | let quoteAssetReserveAfter = $ | |
1593 | - | let baseAssetReserveAfter = $ | |
1594 | - | let totalPositionSizeAfter = $ | |
1595 | - | let openInterestNotionalAfter = $ | |
1596 | - | let totalLongAfter = $ | |
1597 | - | let totalShortAfter = $ | |
1598 | - | let totalLongOpenInterestAfter = $ | |
1599 | - | let totalShortOpenInterestAfter = $ | |
1600 | - | let liquidationPenalty = $ | |
1606 | + | let newPositionSize = $t07496975625._1 | |
1607 | + | let newPositionMargin = $t07496975625._2 | |
1608 | + | let newPositionOpenNotional = $t07496975625._3 | |
1609 | + | let newPositionLstUpdCPF = $t07496975625._4 | |
1610 | + | let positionBadDebt = $t07496975625._5 | |
1611 | + | let realizedPnl = $t07496975625._6 | |
1612 | + | let marginToTrader = $t07496975625._7 | |
1613 | + | let quoteAssetReserveAfter = $t07496975625._8 | |
1614 | + | let baseAssetReserveAfter = $t07496975625._9 | |
1615 | + | let totalPositionSizeAfter = $t07496975625._10 | |
1616 | + | let openInterestNotionalAfter = $t07496975625._11 | |
1617 | + | let totalLongAfter = $t07496975625._12 | |
1618 | + | let totalShortAfter = $t07496975625._13 | |
1619 | + | let totalLongOpenInterestAfter = $t07496975625._14 | |
1620 | + | let totalShortOpenInterestAfter = $t07496975625._15 | |
1621 | + | let liquidationPenalty = $t07496975625._16 | |
1601 | 1622 | let feeToLiquidator = (liquidationPenalty / 2) | |
1602 | 1623 | let feeToVault = (liquidationPenalty - feeToLiquidator) | |
1603 | 1624 | let ammBalance = (cbalance() - liquidationPenalty) | |
1658 | 1679 | then throw(((("Invalid funding block timestamp: " + toString(lastTimestamp())) + " < ") + toString(fundingBlockTimestamp))) | |
1659 | 1680 | else { | |
1660 | 1681 | let underlyingPrice = getOraclePrice() | |
1661 | - | let $ | |
1662 | - | let shortPremiumFraction = $ | |
1663 | - | let longPremiumFraction = $ | |
1664 | - | let premiumToVault = $ | |
1682 | + | let $t07784377921 = getFunding() | |
1683 | + | let shortPremiumFraction = $t07784377921._1 | |
1684 | + | let longPremiumFraction = $t07784377921._2 | |
1685 | + | let premiumToVault = $t07784377921._3 | |
1665 | 1686 | let doPayFundingToVault = if ((premiumToVault > 0)) | |
1666 | 1687 | then { | |
1667 | 1688 | let doPayFundingToVault = invoke(vaultAddress(), "exchangeFreeAndLocked", [-(premiumToVault)], nil) | |
1716 | 1737 | func syncTerminalPriceToOracle () = { | |
1717 | 1738 | let _qtAstR = qtAstR() | |
1718 | 1739 | let _bsAstR = bsAstR() | |
1719 | - | let $ | |
1720 | - | let newQuoteAssetWeight = $ | |
1721 | - | let newBaseAssetWeight = $ | |
1722 | - | let marginToVault = $ | |
1740 | + | let $t07974480110 = getSyncTerminalPrice(getOraclePrice(), _qtAstR, _bsAstR) | |
1741 | + | let newQuoteAssetWeight = $t07974480110._1 | |
1742 | + | let newBaseAssetWeight = $t07974480110._2 | |
1743 | + | let marginToVault = $t07974480110._3 | |
1723 | 1744 | let marginToVaultAdj = if (if ((0 > marginToVault)) | |
1724 | 1745 | then (abs(marginToVault) > cbalance()) | |
1725 | 1746 | else false) | |
1784 | 1805 | let sync = invoke(this, "syncTerminalPriceToOracle", nil, nil) | |
1785 | 1806 | if ((sync == sync)) | |
1786 | 1807 | then { | |
1787 | - | let $ | |
1788 | - | let positionSize = $ | |
1789 | - | let positionMargin = $ | |
1790 | - | let pon = $ | |
1791 | - | let positionLstUpdCPF = $ | |
1792 | - | let positionTimestamp = $ | |
1793 | - | let $ | |
1794 | - | let positionNotional = $ | |
1795 | - | let unrealizedPnl = $ | |
1796 | - | let $ | |
1797 | - | let remainMargin = $ | |
1798 | - | let badDebt = $ | |
1799 | - | let fundingPayment = $ | |
1800 | - | let rolloverFee = $ | |
1808 | + | let $t08390484040 = getPosition(_trader, _direction) | |
1809 | + | let positionSize = $t08390484040._1 | |
1810 | + | let positionMargin = $t08390484040._2 | |
1811 | + | let pon = $t08390484040._3 | |
1812 | + | let positionLstUpdCPF = $t08390484040._4 | |
1813 | + | let positionTimestamp = $t08390484040._5 | |
1814 | + | let $t08404384156 = getPositionNotionalAndUnrealizedPnl(_trader, _direction, PNL_OPTION_SPOT) | |
1815 | + | let positionNotional = $t08404384156._1 | |
1816 | + | let unrealizedPnl = $t08404384156._2 | |
1817 | + | let $t08415984383 = calcRemainMarginWithFundingPaymentAndRolloverFee(positionSize, positionMargin, positionLstUpdCPF, positionTimestamp, unrealizedPnl) | |
1818 | + | let remainMargin = $t08415984383._1 | |
1819 | + | let badDebt = $t08415984383._2 | |
1820 | + | let fundingPayment = $t08415984383._3 | |
1821 | + | let rolloverFee = $t08415984383._4 | |
1801 | 1822 | throw(((((((s(remainMargin) + s(fundingPayment)) + s(getMarginRatio(_trader, _direction))) + s(unrealizedPnl)) + s(badDebt)) + s(positionNotional)) + s(rolloverFee))) | |
1802 | 1823 | } | |
1803 | 1824 | else throw("Strict value is not equal to itself.") | |
1819 | 1840 | ||
1820 | 1841 | @Callable(i) | |
1821 | 1842 | func view_getTerminalAmmPrice () = { | |
1822 | - | let $ | |
1823 | - | let terminalQuoteAssetReserve = $ | |
1824 | - | let terminalBaseAssetReserve = $ | |
1843 | + | let $t08511885199 = getTerminalAmmState() | |
1844 | + | let terminalQuoteAssetReserve = $t08511885199._1 | |
1845 | + | let terminalBaseAssetReserve = $t08511885199._2 | |
1825 | 1846 | let price = divd(muld(terminalQuoteAssetReserve, qtAstW()), muld(terminalBaseAssetReserve, bsAstW())) | |
1826 | 1847 | throw(toString(price)) | |
1827 | 1848 | } | |
1837 | 1858 | if ((sync == sync)) | |
1838 | 1859 | then { | |
1839 | 1860 | let underlyingPrice = getOraclePrice() | |
1840 | - | let $ | |
1841 | - | let shortPremiumFraction = $ | |
1842 | - | let longPremiumFraction = $ | |
1843 | - | let premiumToVault = $ | |
1861 | + | let $t08585185929 = getFunding() | |
1862 | + | let shortPremiumFraction = $t08585185929._1 | |
1863 | + | let longPremiumFraction = $t08585185929._2 | |
1864 | + | let premiumToVault = $t08585185929._3 | |
1844 | 1865 | let longFunding = divd(longPremiumFraction, underlyingPrice) | |
1845 | 1866 | let shortFunding = divd(shortPremiumFraction, underlyingPrice) | |
1846 | 1867 | throw(((((s(longFunding) + s(shortFunding)) + s(getSpotPrice())) + s(getOraclePrice())) + s(premiumToVault))) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let k_baseOracle = "k_baseOracle" | |
5 | 5 | ||
6 | 6 | let k_quoteOracle = "k_quoteOracle" | |
7 | 7 | ||
8 | 8 | let k_balance = "k_balance" | |
9 | 9 | ||
10 | 10 | let k_sequence = "k_sequence" | |
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_positionSequence = "k_positionSequence" | |
21 | 21 | ||
22 | 22 | let k_positionFee = "k_positionFee" | |
23 | 23 | ||
24 | 24 | let k_positionLastUpdatedTimestamp = "k_positionTimestamp" | |
25 | 25 | ||
26 | 26 | let k_initialized = "k_initialized" | |
27 | 27 | ||
28 | 28 | let k_paused = "k_paused" | |
29 | 29 | ||
30 | 30 | let k_closeOnly = "k_closeOnly" | |
31 | 31 | ||
32 | 32 | let k_fee = "k_fee" | |
33 | 33 | ||
34 | 34 | let k_rolloverFee = "k_rollover_fee" | |
35 | 35 | ||
36 | 36 | let k_fundingPeriod = "k_fundingPeriod" | |
37 | 37 | ||
38 | 38 | let k_initMarginRatio = "k_initMarginRatio" | |
39 | 39 | ||
40 | 40 | let k_maintenanceMarginRatio = "k_mmr" | |
41 | 41 | ||
42 | 42 | let k_liquidationFeeRatio = "k_liquidationFeeRatio" | |
43 | 43 | ||
44 | 44 | let k_partialLiquidationRatio = "k_partLiquidationRatio" | |
45 | 45 | ||
46 | 46 | let k_spreadLimit = "k_spreadLimit" | |
47 | 47 | ||
48 | 48 | let k_maxPriceImpact = "k_maxPriceImpact" | |
49 | 49 | ||
50 | 50 | let k_maxPriceSpread = "k_maxPriceSpread" | |
51 | 51 | ||
52 | 52 | let k_maxOpenNotional = "k_maxOpenNotional" | |
53 | 53 | ||
54 | 54 | let k_feeToStakersPercent = "k_feeToStakersPercent" | |
55 | 55 | ||
56 | 56 | let k_maxOracleDelay = "k_maxOracleDelay" | |
57 | 57 | ||
58 | 58 | let k_fundingMode = "k_fundingMode" | |
59 | 59 | ||
60 | 60 | let k_oracleMode = "k_oracleMode" | |
61 | 61 | ||
62 | 62 | let k_latestLongCumulativePremiumFraction = "k_latestLongPremiumFraction" | |
63 | 63 | ||
64 | 64 | let k_latestShortCumulativePremiumFraction = "k_latestShortPremiumFraction" | |
65 | 65 | ||
66 | 66 | let k_nextFundingBlock = "k_nextFundingBlockMinTimestamp" | |
67 | 67 | ||
68 | 68 | let k_longFundingRate = "k_longFundingRate" | |
69 | 69 | ||
70 | 70 | let k_shortFundingRate = "k_shortFundingRate" | |
71 | 71 | ||
72 | 72 | let k_quoteAssetReserve = "k_qtAstR" | |
73 | 73 | ||
74 | 74 | let k_baseAssetReserve = "k_bsAstR" | |
75 | 75 | ||
76 | 76 | let k_quoteAssetWeight = "k_qtAstW" | |
77 | 77 | ||
78 | 78 | let k_baseAssetWeight = "k_bsAstW" | |
79 | 79 | ||
80 | 80 | let k_totalPositionSize = "k_totalPositionSize" | |
81 | 81 | ||
82 | 82 | let k_totalLongPositionSize = "k_totalLongPositionSize" | |
83 | 83 | ||
84 | 84 | let k_totalShortPositionSize = "k_totalShortPositionSize" | |
85 | 85 | ||
86 | 86 | let k_openInterestNotional = "k_openInterestNotional" | |
87 | 87 | ||
88 | 88 | let k_openInterestShort = "k_openInterestShort" | |
89 | 89 | ||
90 | 90 | let k_openInterestLong = "k_openInterestLong" | |
91 | 91 | ||
92 | 92 | let k_lastTx = "k_lastTx" | |
93 | 93 | ||
94 | 94 | let k_coordinatorAddress = "k_coordinatorAddress" | |
95 | 95 | ||
96 | 96 | let k_vault_address = "k_vault_address" | |
97 | 97 | ||
98 | 98 | let k_admin_address = "k_admin_address" | |
99 | 99 | ||
100 | 100 | let k_quote_asset = "k_quote_asset" | |
101 | 101 | ||
102 | 102 | let k_staking_address = "k_staking_address" | |
103 | 103 | ||
104 | 104 | let k_miner_address = "k_miner_address" | |
105 | 105 | ||
106 | 106 | let k_orders_address = "k_orders_address" | |
107 | 107 | ||
108 | 108 | let k_referral_address = "k_referral_address" | |
109 | 109 | ||
110 | 110 | let k_nft_manager_address = "k_nft_manager_address" | |
111 | 111 | ||
112 | 112 | func toCompositeKey (_key,_address) = ((_key + "_") + _address) | |
113 | 113 | ||
114 | 114 | ||
115 | 115 | func coordinator () = valueOrErrorMessage(addressFromString(getStringValue(this, k_coordinatorAddress)), "Coordinator not set") | |
116 | 116 | ||
117 | 117 | ||
118 | 118 | func adminAddress () = addressFromString(getStringValue(coordinator(), k_admin_address)) | |
119 | 119 | ||
120 | 120 | ||
121 | 121 | func quoteAsset () = fromBase58String(getStringValue(coordinator(), k_quote_asset)) | |
122 | 122 | ||
123 | 123 | ||
124 | 124 | func stakingAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_staking_address)), "Staking not set") | |
125 | 125 | ||
126 | 126 | ||
127 | 127 | func vaultAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_vault_address)), "Vault not set") | |
128 | 128 | ||
129 | 129 | ||
130 | 130 | func minerAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_miner_address)), "Miner not set") | |
131 | 131 | ||
132 | 132 | ||
133 | 133 | func ordersAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_orders_address)), "Orders not set") | |
134 | 134 | ||
135 | 135 | ||
136 | 136 | func referralAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_referral_address)), "Referral not set") | |
137 | 137 | ||
138 | 138 | ||
139 | 139 | func nftManagerAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_nft_manager_address)), "NFT Manager not set") | |
140 | 140 | ||
141 | 141 | ||
142 | 142 | let k_token_param = "k_token_param" | |
143 | 143 | ||
144 | 144 | let k_token_type = "k_token_type" | |
145 | 145 | ||
146 | 146 | let FEE_REDUCTION_TOKEN_TYPE = "fee_reduction" | |
147 | 147 | ||
148 | 148 | let DIR_LONG = 1 | |
149 | 149 | ||
150 | 150 | let DIR_SHORT = 2 | |
151 | 151 | ||
152 | 152 | let SECONDS = 1000 | |
153 | 153 | ||
154 | 154 | let DECIMAL_NUMBERS = 6 | |
155 | 155 | ||
156 | 156 | let DECIMAL_UNIT = (1 * (((((10 * 10) * 10) * 10) * 10) * 10)) | |
157 | 157 | ||
158 | 158 | let MINUTES_IN_YEAR = (525600 * DECIMAL_UNIT) | |
159 | 159 | ||
160 | 160 | let ONE_DAY = (86400 * DECIMAL_UNIT) | |
161 | 161 | ||
162 | 162 | let PNL_OPTION_SPOT = 1 | |
163 | 163 | ||
164 | 164 | let PNL_OPTION_ORACLE = 2 | |
165 | 165 | ||
166 | 166 | let FUNDING_ASYMMETRIC = 1 | |
167 | 167 | ||
168 | 168 | let FUNDING_SYMMETRIC = 2 | |
169 | 169 | ||
170 | 170 | let ORACLE_PLAIN = 1 | |
171 | 171 | ||
172 | 172 | let ORACLE_JIT = 2 | |
173 | 173 | ||
174 | 174 | func s (_x) = (toString(_x) + ",") | |
175 | 175 | ||
176 | 176 | ||
177 | 177 | func divd (_x,_y) = fraction(_x, DECIMAL_UNIT, _y, HALFEVEN) | |
178 | 178 | ||
179 | 179 | ||
180 | 180 | func muld (_x,_y) = fraction(_x, _y, DECIMAL_UNIT, HALFEVEN) | |
181 | 181 | ||
182 | 182 | ||
183 | 183 | func bdivd (_x,_y) = fraction(_x, toBigInt(DECIMAL_UNIT), _y, HALFEVEN) | |
184 | 184 | ||
185 | 185 | ||
186 | 186 | func bmuld (_x,_y) = fraction(_x, _y, toBigInt(DECIMAL_UNIT), HALFEVEN) | |
187 | 187 | ||
188 | 188 | ||
189 | 189 | func abs (_x) = if ((_x > 0)) | |
190 | 190 | then _x | |
191 | 191 | else -(_x) | |
192 | 192 | ||
193 | 193 | ||
194 | 194 | func vmax (_x,_y) = if ((_x >= _y)) | |
195 | 195 | then _x | |
196 | 196 | else _y | |
197 | 197 | ||
198 | 198 | ||
199 | 199 | func int (k) = valueOrErrorMessage(getInteger(this, k), ("no value for " + k)) | |
200 | 200 | ||
201 | 201 | ||
202 | 202 | func intOr (k,def) = valueOrElse(getInteger(this, k), def) | |
203 | 203 | ||
204 | 204 | ||
205 | 205 | func strA (_address,_key) = { | |
206 | 206 | let val = valueOrErrorMessage(getString(_address, _key), ("No value for key " + _key)) | |
207 | 207 | val | |
208 | 208 | } | |
209 | 209 | ||
210 | 210 | ||
211 | 211 | func intA (_address,_key) = { | |
212 | 212 | let val = valueOrErrorMessage(getInteger(_address, _key), ("No value for key " + _key)) | |
213 | 213 | val | |
214 | 214 | } | |
215 | 215 | ||
216 | 216 | ||
217 | 217 | func cbalance () = int(k_balance) | |
218 | 218 | ||
219 | 219 | ||
220 | + | func cbalance0 () = intOr(k_balance, 0) | |
221 | + | ||
222 | + | ||
220 | 223 | func fee () = int(k_fee) | |
221 | 224 | ||
222 | 225 | ||
223 | 226 | func rolloverFeeRate () = int(k_rolloverFee) | |
224 | 227 | ||
225 | 228 | ||
226 | 229 | func initMarginRatio () = int(k_initMarginRatio) | |
227 | 230 | ||
228 | 231 | ||
229 | 232 | func qtAstR () = int(k_quoteAssetReserve) | |
230 | 233 | ||
231 | 234 | ||
235 | + | func qtAstR0 () = intOr(k_quoteAssetReserve, 0) | |
236 | + | ||
237 | + | ||
232 | 238 | func bsAstR () = int(k_baseAssetReserve) | |
239 | + | ||
240 | + | ||
241 | + | func bsAstR0 () = intOr(k_baseAssetReserve, 0) | |
233 | 242 | ||
234 | 243 | ||
235 | 244 | func qtAstW () = intOr(k_quoteAssetWeight, DECIMAL_UNIT) | |
236 | 245 | ||
237 | 246 | ||
238 | 247 | func bsAstW () = intOr(k_baseAssetWeight, DECIMAL_UNIT) | |
239 | 248 | ||
240 | 249 | ||
241 | 250 | func totalPositionSize () = int(k_totalPositionSize) | |
242 | 251 | ||
243 | 252 | ||
244 | 253 | func openInterestNotional () = int(k_openInterestNotional) | |
245 | 254 | ||
246 | 255 | ||
247 | 256 | func openInterestShort () = int(k_openInterestShort) | |
248 | 257 | ||
249 | 258 | ||
250 | 259 | func openInterestLong () = int(k_openInterestLong) | |
251 | 260 | ||
252 | 261 | ||
253 | 262 | func nextFundingBlockTimestamp () = int(k_nextFundingBlock) | |
254 | 263 | ||
255 | 264 | ||
256 | 265 | func fundingPeriodRaw () = int(k_fundingPeriod) | |
257 | 266 | ||
258 | 267 | ||
259 | 268 | func fundingPeriodDecimal () = (fundingPeriodRaw() * DECIMAL_UNIT) | |
260 | 269 | ||
261 | 270 | ||
262 | 271 | func fundingPeriodSeconds () = (fundingPeriodRaw() * SECONDS) | |
263 | 272 | ||
264 | 273 | ||
265 | 274 | func maintenanceMarginRatio () = int(k_maintenanceMarginRatio) | |
266 | 275 | ||
267 | 276 | ||
268 | 277 | func liquidationFeeRatio () = int(k_liquidationFeeRatio) | |
269 | 278 | ||
270 | 279 | ||
271 | 280 | func partialLiquidationRatio () = int(k_partialLiquidationRatio) | |
272 | 281 | ||
273 | 282 | ||
274 | 283 | func spreadLimit () = int(k_spreadLimit) | |
275 | 284 | ||
276 | 285 | ||
277 | 286 | func maxPriceImpact () = int(k_maxPriceImpact) | |
278 | 287 | ||
279 | 288 | ||
280 | 289 | func maxPriceSpread () = int(k_maxPriceSpread) | |
281 | 290 | ||
282 | 291 | ||
283 | 292 | func maxOpenNotional () = int(k_maxOpenNotional) | |
284 | 293 | ||
285 | 294 | ||
286 | 295 | func latestLongCumulativePremiumFraction () = int(k_latestLongCumulativePremiumFraction) | |
287 | 296 | ||
288 | 297 | ||
289 | 298 | func latestShortCumulativePremiumFraction () = int(k_latestShortCumulativePremiumFraction) | |
290 | 299 | ||
291 | 300 | ||
292 | 301 | func totalShortPositionSize () = int(k_totalShortPositionSize) | |
293 | 302 | ||
294 | 303 | ||
295 | 304 | func totalLongPositionSize () = int(k_totalLongPositionSize) | |
296 | 305 | ||
297 | 306 | ||
298 | 307 | func lastSequence () = intOr(k_sequence, 0) | |
299 | 308 | ||
300 | 309 | ||
301 | 310 | func feeToStakersPercent () = int(k_feeToStakersPercent) | |
302 | 311 | ||
303 | 312 | ||
304 | 313 | func maxOracleDelay () = int(k_maxOracleDelay) | |
305 | 314 | ||
306 | 315 | ||
307 | 316 | func fundingMode () = intOr(k_fundingMode, FUNDING_ASYMMETRIC) | |
308 | 317 | ||
309 | 318 | ||
310 | 319 | func oracleMode () = intOr(k_oracleMode, ORACLE_PLAIN) | |
311 | 320 | ||
312 | 321 | ||
313 | 322 | func lastTimestamp () = lastBlock.timestamp | |
314 | 323 | ||
315 | 324 | ||
316 | 325 | func getActualCaller (i) = valueOrElse(getString(ordersAddress(), "k_sender"), toString(i.caller)) | |
317 | 326 | ||
318 | 327 | ||
319 | 328 | func requireMoreMarginRatio (_marginRatio,_baseMarginRatio,_largerThanOrEqualTo) = { | |
320 | 329 | let remainingMarginRatio = (_marginRatio - _baseMarginRatio) | |
321 | 330 | if (if (_largerThanOrEqualTo) | |
322 | 331 | then (0 > remainingMarginRatio) | |
323 | 332 | else false) | |
324 | 333 | then throw(((("Invalid margin: " + toString(_marginRatio)) + " < ") + toString(_baseMarginRatio))) | |
325 | 334 | else if (if (!(_largerThanOrEqualTo)) | |
326 | 335 | then (remainingMarginRatio >= 0) | |
327 | 336 | else false) | |
328 | 337 | then throw(((("Invalid margin: " + toString(_marginRatio)) + " > ") + toString(_baseMarginRatio))) | |
329 | 338 | else true | |
330 | 339 | } | |
331 | 340 | ||
332 | 341 | ||
333 | 342 | func latestCumulativePremiumFraction (_positionSize) = if ((_positionSize == 0)) | |
334 | 343 | then throw("Should not be called with _positionSize == 0") | |
335 | 344 | else if ((_positionSize > 0)) | |
336 | 345 | then latestLongCumulativePremiumFraction() | |
337 | 346 | else latestShortCumulativePremiumFraction() | |
338 | 347 | ||
339 | 348 | ||
340 | 349 | func getPosition (_trader,_direction) = { | |
341 | 350 | let positionKey = ((_trader + "_") + toString(_direction)) | |
342 | 351 | let positionSizeOpt = getInteger(this, toCompositeKey(k_positionSize, positionKey)) | |
343 | 352 | match positionSizeOpt { | |
344 | 353 | case positionSize: Int => | |
345 | 354 | $Tuple5(positionSize, getIntegerValue(this, toCompositeKey(k_positionMargin, positionKey)), getIntegerValue(this, toCompositeKey(k_positionOpenNotional, positionKey)), getIntegerValue(this, toCompositeKey(k_positionLastUpdatedCumulativePremiumFraction, positionKey)), getIntegerValue(this, toCompositeKey(k_positionLastUpdatedTimestamp, positionKey))) | |
346 | 355 | case _ => | |
347 | 356 | $Tuple5(0, 0, 0, 0, 0) | |
348 | 357 | } | |
349 | 358 | } | |
350 | 359 | ||
351 | 360 | ||
352 | 361 | func getDirection (_positionSize) = if ((0 > _positionSize)) | |
353 | 362 | then DIR_SHORT | |
354 | 363 | else DIR_LONG | |
355 | 364 | ||
356 | 365 | ||
357 | 366 | func getPositionFee (_trader,_direction) = { | |
358 | 367 | let positionKey = ((_trader + "_") + toString(_direction)) | |
359 | 368 | let positionFeeOpt = getInteger(this, toCompositeKey(k_positionFee, positionKey)) | |
360 | 369 | match positionFeeOpt { | |
361 | 370 | case positionFee: Int => | |
362 | 371 | positionFee | |
363 | 372 | case _ => | |
364 | 373 | fee() | |
365 | 374 | } | |
366 | 375 | } | |
367 | 376 | ||
368 | 377 | ||
369 | 378 | func requireOpenPosition (_trader,_direction) = if ((getPosition(_trader, _direction)._1 == 0)) | |
370 | 379 | then throw("No open position") | |
371 | 380 | else true | |
372 | 381 | ||
373 | 382 | ||
374 | 383 | func getOracleData (key) = { | |
375 | 384 | let oracleDataStr = getString(this, key) | |
376 | 385 | if (if (isDefined(oracleDataStr)) | |
377 | 386 | then (value(oracleDataStr) != "") | |
378 | 387 | else false) | |
379 | 388 | then { | |
380 | 389 | let oracleData = split(value(oracleDataStr), ",") | |
381 | 390 | let oracleAddress = valueOrErrorMessage(addressFromString(oracleData[0]), ("Invalid oracle address in: " + value(oracleDataStr))) | |
382 | 391 | let priceKey = oracleData[1] | |
383 | 392 | let blockKey = oracleData[2] | |
384 | 393 | let openKey = oracleData[3] | |
385 | 394 | $Tuple4(oracleAddress, priceKey, blockKey, openKey) | |
386 | 395 | } | |
387 | 396 | else unit | |
388 | 397 | } | |
389 | 398 | ||
390 | 399 | ||
391 | 400 | func initialized () = valueOrElse(getBoolean(this, k_initialized), false) | |
392 | 401 | ||
393 | 402 | ||
394 | 403 | func paused () = valueOrElse(getBoolean(this, k_paused), false) | |
395 | 404 | ||
396 | 405 | ||
397 | 406 | func closeOnly () = valueOrElse(getBoolean(this, k_closeOnly), false) | |
398 | 407 | ||
399 | 408 | ||
400 | 409 | func updateReserve (_isAdd,_quoteAssetAmount,_baseAssetAmount) = if (_isAdd) | |
401 | 410 | then { | |
402 | 411 | let newBase = (bsAstR() - _baseAssetAmount) | |
403 | 412 | if ((0 >= newBase)) | |
404 | 413 | then throw("Tx lead to base asset reserve <= 0, revert") | |
405 | 414 | else $Tuple3((qtAstR() + _quoteAssetAmount), newBase, (totalPositionSize() + _baseAssetAmount)) | |
406 | 415 | } | |
407 | 416 | else { | |
408 | 417 | let newQuote = (qtAstR() - _quoteAssetAmount) | |
409 | 418 | if ((0 >= newQuote)) | |
410 | 419 | then throw("Tx lead to base quote reserve <= 0, revert") | |
411 | 420 | else $Tuple3(newQuote, (bsAstR() + _baseAssetAmount), (totalPositionSize() - _baseAssetAmount)) | |
412 | 421 | } | |
413 | 422 | ||
414 | 423 | ||
415 | 424 | func calcInvariant (_qtAstR,_bsAstR) = { | |
416 | 425 | let bqtAstR = toBigInt(_qtAstR) | |
417 | 426 | let bbsAstR = toBigInt(_bsAstR) | |
418 | 427 | bmuld(bqtAstR, bbsAstR) | |
419 | 428 | } | |
420 | 429 | ||
421 | 430 | ||
422 | 431 | func swapInput (_isAdd,_quoteAssetAmount) = { | |
423 | 432 | let _qtAstR = qtAstR() | |
424 | 433 | let _bsAstR = bsAstR() | |
425 | 434 | let _qtAstW = qtAstW() | |
426 | 435 | let _bsAstW = bsAstW() | |
427 | 436 | let quoteAssetAmountAdjusted = divd(_quoteAssetAmount, _qtAstW) | |
428 | 437 | let k = calcInvariant(_qtAstR, _bsAstR) | |
429 | 438 | let quoteAssetReserveAfter = if (_isAdd) | |
430 | 439 | then (_qtAstR + quoteAssetAmountAdjusted) | |
431 | 440 | else (_qtAstR - quoteAssetAmountAdjusted) | |
432 | 441 | let baseAssetReserveAfter = toInt(bdivd(k, toBigInt(quoteAssetReserveAfter))) | |
433 | 442 | let amountBaseAssetBoughtAbs = abs((baseAssetReserveAfter - _bsAstR)) | |
434 | 443 | let amountBaseAssetBought = if (_isAdd) | |
435 | 444 | then amountBaseAssetBoughtAbs | |
436 | 445 | else -(amountBaseAssetBoughtAbs) | |
437 | - | let $ | |
438 | - | let quoteAssetReserveAfter1 = $ | |
439 | - | let baseAssetReserveAfter1 = $ | |
440 | - | let totalPositionSizeAfter1 = $ | |
446 | + | let $t01591816088 = updateReserve(_isAdd, quoteAssetAmountAdjusted, amountBaseAssetBoughtAbs) | |
447 | + | let quoteAssetReserveAfter1 = $t01591816088._1 | |
448 | + | let baseAssetReserveAfter1 = $t01591816088._2 | |
449 | + | let totalPositionSizeAfter1 = $t01591816088._3 | |
441 | 450 | let priceBefore = divd(muld(_qtAstR, _qtAstW), muld(_bsAstR, _bsAstW)) | |
442 | 451 | let marketPrice = divd(_quoteAssetAmount, amountBaseAssetBoughtAbs) | |
443 | 452 | let priceDiff = abs((priceBefore - marketPrice)) | |
444 | 453 | let priceImpact = (DECIMAL_UNIT - divd(priceBefore, (priceBefore + priceDiff))) | |
445 | 454 | let maxPriceImpactValue = maxPriceImpact() | |
446 | 455 | if ((priceImpact > maxPriceImpactValue)) | |
447 | 456 | 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))) | |
448 | 457 | else $Tuple4(amountBaseAssetBought, quoteAssetReserveAfter1, baseAssetReserveAfter1, totalPositionSizeAfter1) | |
449 | 458 | } | |
450 | 459 | ||
451 | 460 | ||
452 | 461 | func calcRolloverFee (_oldPositionMargin,_oldPositionLastUpdatedTimestamp) = { | |
453 | 462 | let positionMinutes = ((((lastTimestamp() - _oldPositionLastUpdatedTimestamp) / 1000) / 60) * DECIMAL_UNIT) | |
454 | 463 | let rolloverFee = divd(muld(muld(_oldPositionMargin, positionMinutes), rolloverFeeRate()), MINUTES_IN_YEAR) | |
455 | 464 | rolloverFee | |
456 | 465 | } | |
457 | 466 | ||
458 | 467 | ||
459 | 468 | func calcRemainMarginWithFundingPaymentAndRolloverFee (_oldPositionSize,_oldPositionMargin,_oldPositionCumulativePremiumFraction,_oldPositionLastUpdatedTimestamp,_marginDelta) = { | |
460 | 469 | let fundingPayment = if ((_oldPositionSize != 0)) | |
461 | 470 | then { | |
462 | 471 | let _latestCumulativePremiumFraction = latestCumulativePremiumFraction(_oldPositionSize) | |
463 | 472 | muld((_latestCumulativePremiumFraction - _oldPositionCumulativePremiumFraction), _oldPositionSize) | |
464 | 473 | } | |
465 | 474 | else 0 | |
466 | 475 | let rolloverFee = calcRolloverFee(_oldPositionMargin, _oldPositionLastUpdatedTimestamp) | |
467 | 476 | let signedMargin = (((_marginDelta - rolloverFee) - fundingPayment) + _oldPositionMargin) | |
468 | - | let $ | |
477 | + | let $t01875518882 = if ((0 > signedMargin)) | |
469 | 478 | then $Tuple2(0, abs(signedMargin)) | |
470 | 479 | else $Tuple2(abs(signedMargin), 0) | |
471 | - | let remainMargin = $ | |
472 | - | let badDebt = $ | |
480 | + | let remainMargin = $t01875518882._1 | |
481 | + | let badDebt = $t01875518882._2 | |
473 | 482 | $Tuple4(remainMargin, badDebt, fundingPayment, rolloverFee) | |
474 | 483 | } | |
475 | 484 | ||
476 | 485 | ||
477 | 486 | func swapOutputWithReserves (_isAdd,_baseAssetAmount,_checkMaxPriceImpact,_quoteAssetReserve,_quoteAssetWeight,_baseAssetReserve,_baseAssetWeight) = { | |
478 | 487 | let priceBefore = divd(muld(_quoteAssetReserve, _quoteAssetWeight), muld(_baseAssetReserve, _baseAssetWeight)) | |
479 | 488 | if ((_baseAssetAmount == 0)) | |
480 | 489 | then throw("Invalid base asset amount") | |
481 | 490 | else { | |
482 | 491 | let k = calcInvariant(_quoteAssetReserve, _baseAssetReserve) | |
483 | 492 | let baseAssetPoolAmountAfter = if (_isAdd) | |
484 | 493 | then (_baseAssetReserve + _baseAssetAmount) | |
485 | 494 | else (_baseAssetReserve - _baseAssetAmount) | |
486 | 495 | let quoteAssetAfter = toInt(bdivd(k, toBigInt(baseAssetPoolAmountAfter))) | |
487 | 496 | let quoteAssetDelta = abs((quoteAssetAfter - _quoteAssetReserve)) | |
488 | 497 | let quoteAssetSold = muld(quoteAssetDelta, _quoteAssetWeight) | |
489 | 498 | let maxPriceImpactValue = maxPriceImpact() | |
490 | - | let $ | |
491 | - | let quoteAssetReserveAfter1 = $ | |
492 | - | let baseAssetReserveAfter1 = $ | |
493 | - | let totalPositionSizeAfter1 = $ | |
499 | + | let $t02014420306 = updateReserve(!(_isAdd), quoteAssetDelta, _baseAssetAmount) | |
500 | + | let quoteAssetReserveAfter1 = $t02014420306._1 | |
501 | + | let baseAssetReserveAfter1 = $t02014420306._2 | |
502 | + | let totalPositionSizeAfter1 = $t02014420306._3 | |
494 | 503 | let marketPrice = divd(quoteAssetSold, _baseAssetAmount) | |
495 | 504 | let priceDiff = abs((priceBefore - marketPrice)) | |
496 | 505 | let priceImpact = (DECIMAL_UNIT - divd(priceBefore, (priceBefore + priceDiff))) | |
497 | 506 | if (if ((priceImpact > maxPriceImpactValue)) | |
498 | 507 | then _checkMaxPriceImpact | |
499 | 508 | else false) | |
500 | 509 | 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))) | |
501 | 510 | else $Tuple7(quoteAssetSold, quoteAssetReserveAfter1, baseAssetReserveAfter1, totalPositionSizeAfter1, (totalLongPositionSize() - (if (_isAdd) | |
502 | 511 | then abs(_baseAssetAmount) | |
503 | 512 | else 0)), (totalShortPositionSize() - (if (!(_isAdd)) | |
504 | 513 | then abs(_baseAssetAmount) | |
505 | 514 | else 0)), priceImpact) | |
506 | 515 | } | |
507 | 516 | } | |
508 | 517 | ||
509 | 518 | ||
510 | 519 | func swapOutput (_isAdd,_baseAssetAmount,_checkMaxPriceImpact) = swapOutputWithReserves(_isAdd, _baseAssetAmount, _checkMaxPriceImpact, qtAstR(), qtAstW(), bsAstR(), bsAstW()) | |
511 | 520 | ||
512 | 521 | ||
513 | 522 | func getOraclePriceValue (oracle,priceKey,blockKey) = { | |
514 | 523 | let lastValue = valueOrErrorMessage(getInteger(oracle, priceKey), ((("Can not get oracle price. Oracle: " + toString(oracle)) + " key: ") + priceKey)) | |
515 | 524 | if ((blockKey != "")) | |
516 | 525 | then { | |
517 | 526 | let currentBlock = height | |
518 | 527 | let lastOracleBlock = valueOrErrorMessage(getInteger(oracle, blockKey), ((("Can not get oracle block. Oracle: " + toString(oracle)) + " key: ") + blockKey)) | |
519 | 528 | if (((currentBlock - lastOracleBlock) > maxOracleDelay())) | |
520 | 529 | then throw(((("Oracle stale data. Last oracle block: " + toString(lastOracleBlock)) + " current block: ") + toString(currentBlock))) | |
521 | 530 | else lastValue | |
522 | 531 | } | |
523 | 532 | else lastValue | |
524 | 533 | } | |
525 | 534 | ||
526 | 535 | ||
527 | 536 | func getOraclePrice () = { | |
528 | 537 | let baseOracle = valueOrErrorMessage(getOracleData(k_baseOracle), "No base asset oracle data") | |
529 | 538 | let baseOraclePrice = getOraclePriceValue(baseOracle._1, baseOracle._2, baseOracle._3) | |
530 | 539 | let quoteOracle = getOracleData(k_quoteOracle) | |
531 | 540 | let quoteOraclePrice = if (isDefined(quoteOracle)) | |
532 | 541 | then { | |
533 | 542 | let quoteOracleV = value(quoteOracle) | |
534 | 543 | getOraclePriceValue(quoteOracleV._1, quoteOracleV._2, quoteOracleV._3) | |
535 | 544 | } | |
536 | 545 | else DECIMAL_UNIT | |
537 | 546 | divd(baseOraclePrice, quoteOraclePrice) | |
538 | 547 | } | |
539 | 548 | ||
540 | 549 | ||
541 | 550 | func isMarketClosed () = { | |
542 | 551 | let baseOracle = valueOrErrorMessage(getOracleData(k_baseOracle), "No base asset oracle data") | |
543 | 552 | let oracle = baseOracle._1 | |
544 | 553 | let openKey = baseOracle._4 | |
545 | 554 | if ((openKey != "")) | |
546 | 555 | then { | |
547 | 556 | let isOpen = valueOrErrorMessage(getBoolean(oracle, openKey), ((("Can not get oracle is open/closed. Oracle: " + toString(oracle)) + " key: ") + openKey)) | |
548 | 557 | !(isOpen) | |
549 | 558 | } | |
550 | 559 | else false | |
551 | 560 | } | |
552 | 561 | ||
553 | 562 | ||
554 | 563 | func absPriceDiff (_oraclePrice,_quoteAssetReserve,_baseAssetReserve,_qtAstW,_bsAstW) = { | |
555 | 564 | let priceAfter = divd(muld(_quoteAssetReserve, _qtAstW), muld(_baseAssetReserve, _bsAstW)) | |
556 | 565 | let averagePrice = divd((_oraclePrice + priceAfter), (2 * DECIMAL_UNIT)) | |
557 | 566 | let absPriceDiff = divd(abs((_oraclePrice - priceAfter)), averagePrice) | |
558 | 567 | absPriceDiff | |
559 | 568 | } | |
560 | 569 | ||
561 | 570 | ||
562 | 571 | func requireNotOverSpreadLimit (_quoteAssetReserve,_baseAssetReserve) = { | |
563 | 572 | let oraclePrice = getOraclePrice() | |
564 | 573 | let _qtAstW = qtAstW() | |
565 | 574 | let _bsAstW = bsAstW() | |
566 | 575 | let absPriceDiffBefore = absPriceDiff(oraclePrice, qtAstR(), bsAstR(), _qtAstW, _bsAstW) | |
567 | 576 | let absPriceDiffAfter = absPriceDiff(oraclePrice, _quoteAssetReserve, _baseAssetReserve, _qtAstW, _bsAstW) | |
568 | 577 | if (if ((absPriceDiffAfter > maxPriceSpread())) | |
569 | 578 | then (absPriceDiffAfter > absPriceDiffBefore) | |
570 | 579 | else false) | |
571 | 580 | then throw(((("Price spread " + toString(absPriceDiffAfter)) + " > max price spread ") + toString(maxPriceSpread()))) | |
572 | 581 | else true | |
573 | 582 | } | |
574 | 583 | ||
575 | 584 | ||
576 | 585 | func requireNotOverMaxOpenNotional (_longOpenNotional,_shortOpenNotional) = { | |
577 | 586 | let _maxOpenNotional = maxOpenNotional() | |
578 | 587 | if ((_longOpenNotional > _maxOpenNotional)) | |
579 | 588 | then throw(((("Long open notional " + toString(_longOpenNotional)) + " > max open notional ") + toString(_maxOpenNotional))) | |
580 | 589 | else if ((_shortOpenNotional > _maxOpenNotional)) | |
581 | 590 | then throw(((("Short open notional " + toString(_shortOpenNotional)) + " > max open notional ") + toString(_maxOpenNotional))) | |
582 | 591 | else true | |
583 | 592 | } | |
584 | 593 | ||
585 | 594 | ||
586 | 595 | func getSpotPrice () = { | |
587 | 596 | let _quoteAssetReserve = qtAstR() | |
588 | 597 | let _baseAssetReserve = bsAstR() | |
589 | 598 | let _qtAstW = qtAstW() | |
590 | 599 | let _bsAstW = bsAstW() | |
591 | 600 | divd(muld(_quoteAssetReserve, _qtAstW), muld(_baseAssetReserve, _bsAstW)) | |
592 | 601 | } | |
593 | 602 | ||
594 | 603 | ||
595 | 604 | func isOverFluctuationLimit () = { | |
596 | 605 | let oraclePrice = getOraclePrice() | |
597 | 606 | let currentPrice = getSpotPrice() | |
598 | 607 | (divd(abs((oraclePrice - currentPrice)), oraclePrice) > spreadLimit()) | |
599 | 608 | } | |
600 | 609 | ||
601 | 610 | ||
602 | 611 | func getPositionAdjustedOpenNotional (_positionSize,_option,_quoteAssetReserve,_quoteAssetWeight,_baseAssetReserve,_baseAssetWeight) = { | |
603 | 612 | let positionSizeAbs = abs(_positionSize) | |
604 | 613 | let isShort = (0 > _positionSize) | |
605 | 614 | let positionNotional = if ((_option == PNL_OPTION_SPOT)) | |
606 | 615 | then { | |
607 | 616 | let outPositionNotional = swapOutputWithReserves(!(isShort), positionSizeAbs, false, _quoteAssetReserve, _quoteAssetWeight, _baseAssetReserve, _baseAssetWeight)._1 | |
608 | 617 | outPositionNotional | |
609 | 618 | } | |
610 | 619 | else muld(positionSizeAbs, getOraclePrice()) | |
611 | 620 | positionNotional | |
612 | 621 | } | |
613 | 622 | ||
614 | 623 | ||
615 | 624 | func getPositionNotionalAndUnrealizedPnlByValues (_positionSize,_positionOpenNotional,_quoteAssetReserve,_quoteAssetWeight,_baseAssetReserve,_baseAssetWeight,_option) = if ((_positionSize == 0)) | |
616 | 625 | then throw("Invalid position size") | |
617 | 626 | else { | |
618 | 627 | let isShort = (0 > _positionSize) | |
619 | 628 | let positionNotional = getPositionAdjustedOpenNotional(_positionSize, _option, _quoteAssetReserve, _quoteAssetWeight, _baseAssetReserve, _baseAssetWeight) | |
620 | 629 | let unrealizedPnl = if (isShort) | |
621 | 630 | then (_positionOpenNotional - positionNotional) | |
622 | 631 | else (positionNotional - _positionOpenNotional) | |
623 | 632 | $Tuple2(positionNotional, unrealizedPnl) | |
624 | 633 | } | |
625 | 634 | ||
626 | 635 | ||
627 | 636 | func getPositionNotionalAndUnrealizedPnl (_trader,_direction,_option) = { | |
628 | - | let $ | |
629 | - | let positionSize = $ | |
630 | - | let positionMargin = $ | |
631 | - | let positionOpenNotional = $ | |
632 | - | let positionLstUpdCPF = $ | |
637 | + | let $t02819128331 = getPosition(_trader, _direction) | |
638 | + | let positionSize = $t02819128331._1 | |
639 | + | let positionMargin = $t02819128331._2 | |
640 | + | let positionOpenNotional = $t02819128331._3 | |
641 | + | let positionLstUpdCPF = $t02819128331._4 | |
633 | 642 | getPositionNotionalAndUnrealizedPnlByValues(positionSize, positionOpenNotional, qtAstR(), qtAstW(), bsAstR(), bsAstW(), _option) | |
634 | 643 | } | |
635 | 644 | ||
636 | 645 | ||
637 | 646 | func calcMarginRatio (_remainMargin,_badDebt,_positionNotional) = divd((_remainMargin - _badDebt), _positionNotional) | |
638 | 647 | ||
639 | 648 | ||
640 | 649 | func getMarginRatioByOption (_trader,_direction,_option) = { | |
641 | - | let $ | |
642 | - | let positionSize = $ | |
643 | - | let positionMargin = $ | |
644 | - | let pon = $ | |
645 | - | let positionLastUpdatedCPF = $ | |
646 | - | let positionTimestamp = $ | |
647 | - | let $ | |
648 | - | let positionNotional = $ | |
649 | - | let unrealizedPnl = $ | |
650 | - | let $ | |
651 | - | let remainMargin = $ | |
652 | - | let badDebt = $ | |
650 | + | let $t02886329016 = getPosition(_trader, _direction) | |
651 | + | let positionSize = $t02886329016._1 | |
652 | + | let positionMargin = $t02886329016._2 | |
653 | + | let pon = $t02886329016._3 | |
654 | + | let positionLastUpdatedCPF = $t02886329016._4 | |
655 | + | let positionTimestamp = $t02886329016._5 | |
656 | + | let $t02902229127 = getPositionNotionalAndUnrealizedPnl(_trader, _direction, _option) | |
657 | + | let positionNotional = $t02902229127._1 | |
658 | + | let unrealizedPnl = $t02902229127._2 | |
659 | + | let $t02913229344 = calcRemainMarginWithFundingPaymentAndRolloverFee(positionSize, positionMargin, positionLastUpdatedCPF, positionTimestamp, unrealizedPnl) | |
660 | + | let remainMargin = $t02913229344._1 | |
661 | + | let badDebt = $t02913229344._2 | |
653 | 662 | calcMarginRatio(remainMargin, badDebt, positionNotional) | |
654 | 663 | } | |
655 | 664 | ||
656 | 665 | ||
657 | 666 | func getMarginRatio (_trader,_direction) = getMarginRatioByOption(_trader, _direction, PNL_OPTION_SPOT) | |
658 | 667 | ||
659 | 668 | ||
660 | 669 | func getPartialLiquidationAmount (_trader,_positionSize) = { | |
661 | 670 | let maximumRatio = vmax(partialLiquidationRatio(), (DECIMAL_UNIT - divd(getMarginRatio(_trader, getDirection(_positionSize)), maintenanceMarginRatio()))) | |
662 | 671 | let maxExchangedPositionSize = muld(abs(_positionSize), maximumRatio) | |
663 | 672 | let swapResult = swapOutput((_positionSize > 0), maxExchangedPositionSize, false) | |
664 | 673 | let maxExchangedQuoteAssetAmount = swapResult._1 | |
665 | 674 | let priceImpact = swapResult._7 | |
666 | 675 | if ((maxPriceImpact() > priceImpact)) | |
667 | 676 | then maxExchangedPositionSize | |
668 | 677 | else muld(abs(_positionSize), partialLiquidationRatio()) | |
669 | 678 | } | |
670 | 679 | ||
671 | 680 | ||
672 | 681 | func internalClosePosition (_trader,_direction,_size,_fee,_minQuoteAssetAmount,_addToMargin,_checkMaxPriceImpact,_liquidate) = { | |
673 | - | let $ | |
674 | - | let oldPositionSize = $ | |
675 | - | let oldPositionMargin = $ | |
676 | - | let oldPositionOpenNotional = $ | |
677 | - | let oldPositionLstUpdCPF = $ | |
678 | - | let oldPositionTimestamp = $ | |
682 | + | let $t03050730675 = getPosition(_trader, _direction) | |
683 | + | let oldPositionSize = $t03050730675._1 | |
684 | + | let oldPositionMargin = $t03050730675._2 | |
685 | + | let oldPositionOpenNotional = $t03050730675._3 | |
686 | + | let oldPositionLstUpdCPF = $t03050730675._4 | |
687 | + | let oldPositionTimestamp = $t03050730675._5 | |
679 | 688 | let isLongPosition = (oldPositionSize > 0) | |
680 | 689 | let absOldPositionSize = abs(oldPositionSize) | |
681 | 690 | if (if ((absOldPositionSize >= _size)) | |
682 | 691 | then (_size > 0) | |
683 | 692 | else false) | |
684 | 693 | then { | |
685 | 694 | let isPartialClose = (absOldPositionSize > _size) | |
686 | - | let $ | |
687 | - | let exchangedQuoteAssetAmount = $ | |
688 | - | let quoteAssetReserveAfter = $ | |
689 | - | let baseAssetReserveAfter = $ | |
690 | - | let totalPositionSizeAfter = $ | |
695 | + | let $t03096731418 = swapOutput((oldPositionSize > 0), _size, _checkMaxPriceImpact) | |
696 | + | let exchangedQuoteAssetAmount = $t03096731418._1 | |
697 | + | let quoteAssetReserveAfter = $t03096731418._2 | |
698 | + | let baseAssetReserveAfter = $t03096731418._3 | |
699 | + | let totalPositionSizeAfter = $t03096731418._4 | |
691 | 700 | let exchangedPositionSize = if ((oldPositionSize > 0)) | |
692 | 701 | then -(_size) | |
693 | 702 | else _size | |
694 | - | let $ | |
695 | - | let oldPositionNotional = $ | |
696 | - | let unrealizedPnl = $ | |
703 | + | let $t03163331857 = getPositionNotionalAndUnrealizedPnl(_trader, _direction, PNL_OPTION_SPOT) | |
704 | + | let oldPositionNotional = $t03163331857._1 | |
705 | + | let unrealizedPnl = $t03163331857._2 | |
697 | 706 | let realizedRatio = divd(abs(exchangedPositionSize), absOldPositionSize) | |
698 | 707 | let realizedPnl = muld(unrealizedPnl, realizedRatio) | |
699 | - | let $ | |
700 | - | let remainMarginBefore = $ | |
701 | - | let x1 = $ | |
702 | - | let x2 = $ | |
703 | - | let rolloverFee = $ | |
708 | + | let $t03219832444 = calcRemainMarginWithFundingPaymentAndRolloverFee(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, oldPositionTimestamp, unrealizedPnl) | |
709 | + | let remainMarginBefore = $t03219832444._1 | |
710 | + | let x1 = $t03219832444._2 | |
711 | + | let x2 = $t03219832444._3 | |
712 | + | let rolloverFee = $t03219832444._4 | |
704 | 713 | let positionBadDebt = calcRemainMarginWithFundingPaymentAndRolloverFee(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, oldPositionTimestamp, realizedPnl)._2 | |
705 | 714 | let realizedCloseFee = muld(muld(oldPositionNotional, realizedRatio), _fee) | |
706 | 715 | let unrealizedPnlAfter = (unrealizedPnl - realizedPnl) | |
707 | 716 | let remainOpenNotional = if ((oldPositionSize > 0)) | |
708 | 717 | then ((oldPositionNotional - exchangedQuoteAssetAmount) - unrealizedPnlAfter) | |
709 | 718 | else ((unrealizedPnlAfter + oldPositionNotional) - exchangedQuoteAssetAmount) | |
710 | 719 | let newPositionSize = (oldPositionSize + exchangedPositionSize) | |
711 | - | let $ | |
720 | + | let $t03385034236 = if ((newPositionSize == 0)) | |
712 | 721 | then $Tuple2(0, 0) | |
713 | 722 | else $Tuple2(abs(remainOpenNotional), latestCumulativePremiumFraction(newPositionSize)) | |
714 | - | let newPositionOpenNotional = $ | |
715 | - | let newPositionLstUpdCPF = $ | |
723 | + | let newPositionOpenNotional = $t03385034236._1 | |
724 | + | let newPositionLstUpdCPF = $t03385034236._2 | |
716 | 725 | let openNotionalDelta = (oldPositionOpenNotional - newPositionOpenNotional) | |
717 | 726 | let marginRatio = getMarginRatioByOption(_trader, _direction, PNL_OPTION_SPOT) | |
718 | 727 | let newPositionMarginWithSameRatio = if ((oldPositionSize > 0)) | |
719 | 728 | then (muld((newPositionOpenNotional + unrealizedPnlAfter), marginRatio) - unrealizedPnlAfter) | |
720 | 729 | else (muld((newPositionOpenNotional - unrealizedPnlAfter), marginRatio) - unrealizedPnlAfter) | |
721 | 730 | let marginToTraderRaw = ((remainMarginBefore - (newPositionMarginWithSameRatio + unrealizedPnlAfter)) - realizedCloseFee) | |
722 | 731 | let marginToTrader = if ((0 > marginToTraderRaw)) | |
723 | 732 | then if (_liquidate) | |
724 | 733 | then 0 | |
725 | 734 | else throw("Invalid internalClosePosition params: unable to pay fee") | |
726 | 735 | else marginToTraderRaw | |
727 | 736 | let newPositionMargin = if (_addToMargin) | |
728 | 737 | then (newPositionMarginWithSameRatio + marginToTrader) | |
729 | 738 | else newPositionMarginWithSameRatio | |
730 | 739 | if (if ((_minQuoteAssetAmount != 0)) | |
731 | 740 | then (_minQuoteAssetAmount > exchangedQuoteAssetAmount) | |
732 | 741 | else false) | |
733 | 742 | then throw(((("Limit error: " + toString(exchangedQuoteAssetAmount)) + " < ") + toString(_minQuoteAssetAmount))) | |
734 | 743 | else $Tuple17(newPositionSize, newPositionMargin, newPositionOpenNotional, newPositionLstUpdCPF, positionBadDebt, realizedPnl, if (if (_addToMargin) | |
735 | 744 | then isPartialClose | |
736 | 745 | else false) | |
737 | 746 | then 0 | |
738 | 747 | else marginToTrader, quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, (openInterestNotional() - openNotionalDelta), (totalLongPositionSize() - (if (isLongPosition) | |
739 | 748 | then abs(exchangedPositionSize) | |
740 | 749 | else 0)), (totalShortPositionSize() - (if (!(isLongPosition)) | |
741 | 750 | then abs(exchangedPositionSize) | |
742 | 751 | else 0)), (openInterestLong() - (if (isLongPosition) | |
743 | 752 | then openNotionalDelta | |
744 | 753 | else 0)), (openInterestShort() - (if (!(isLongPosition)) | |
745 | 754 | then openNotionalDelta | |
746 | 755 | else 0)), (realizedCloseFee + rolloverFee), exchangedQuoteAssetAmount) | |
747 | 756 | } | |
748 | 757 | else throw(((("Invalid internalClosePosition params: invalid position size: " + toString(_size)) + " max: ") + toString(absOldPositionSize))) | |
749 | 758 | } | |
750 | 759 | ||
751 | 760 | ||
752 | 761 | func getTerminalAmmState () = { | |
753 | 762 | let _positionSize = totalPositionSize() | |
754 | 763 | if ((_positionSize == 0)) | |
755 | 764 | then $Tuple2(qtAstR(), bsAstR()) | |
756 | 765 | else { | |
757 | 766 | let direction = (_positionSize > 0) | |
758 | - | let $ | |
759 | - | let currentNetMarketValue = $ | |
760 | - | let terminalQuoteAssetReserve = $ | |
761 | - | let terminalBaseAssetReserve = $ | |
767 | + | let $t03748337662 = swapOutput(direction, abs(_positionSize), false) | |
768 | + | let currentNetMarketValue = $t03748337662._1 | |
769 | + | let terminalQuoteAssetReserve = $t03748337662._2 | |
770 | + | let terminalBaseAssetReserve = $t03748337662._3 | |
762 | 771 | $Tuple2(terminalQuoteAssetReserve, terminalBaseAssetReserve) | |
763 | 772 | } | |
764 | 773 | } | |
765 | 774 | ||
766 | 775 | ||
767 | 776 | func getQuoteAssetWeight (baseAssetReserve,totalPositionSize,quoteAssetReserve,targetPrice) = { | |
768 | 777 | let b = toBigInt(baseAssetReserve) | |
769 | 778 | let sz = toBigInt(totalPositionSize) | |
770 | 779 | let q = toBigInt(quoteAssetReserve) | |
771 | 780 | let p = toBigInt(targetPrice) | |
772 | 781 | let k = bmuld(q, b) | |
773 | 782 | let newB = (b + sz) | |
774 | 783 | let newQ = bdivd(k, newB) | |
775 | 784 | let z = bdivd(newQ, newB) | |
776 | 785 | let result = bdivd(p, z) | |
777 | 786 | toInt(result) | |
778 | 787 | } | |
779 | 788 | ||
780 | 789 | ||
781 | 790 | func getSyncTerminalPrice (_terminalPrice,_qtAstR,_bsAstR) = { | |
782 | 791 | let _positionSize = totalPositionSize() | |
783 | 792 | if ((_positionSize == 0)) | |
784 | 793 | then { | |
785 | 794 | let newQtAstW = divd(muld(_terminalPrice, _bsAstR), _qtAstR) | |
786 | 795 | $Tuple3(newQtAstW, DECIMAL_UNIT, 0) | |
787 | 796 | } | |
788 | 797 | else { | |
789 | 798 | let direction = (_positionSize > 0) | |
790 | 799 | let currentNetMarketValue = swapOutput(direction, abs(_positionSize), false)._1 | |
791 | 800 | let newQtAstW = getQuoteAssetWeight(_bsAstR, _positionSize, _qtAstR, _terminalPrice) | |
792 | 801 | let newBsAstW = DECIMAL_UNIT | |
793 | 802 | let marginToVault = getPositionNotionalAndUnrealizedPnlByValues(_positionSize, currentNetMarketValue, _qtAstR, newQtAstW, _bsAstR, newBsAstW, PNL_OPTION_SPOT)._2 | |
794 | 803 | $Tuple3(newQtAstW, newBsAstW, marginToVault) | |
795 | 804 | } | |
796 | 805 | } | |
797 | 806 | ||
798 | 807 | ||
799 | 808 | func getFunding () = { | |
800 | 809 | let underlyingPrice = getOraclePrice() | |
801 | 810 | let spotPrice = getSpotPrice() | |
802 | 811 | let premium = (spotPrice - underlyingPrice) | |
803 | 812 | if (if (isMarketClosed()) | |
804 | 813 | then true | |
805 | 814 | else if ((fundingMode() == FUNDING_ASYMMETRIC)) | |
806 | 815 | then if ((totalShortPositionSize() == 0)) | |
807 | 816 | then true | |
808 | 817 | else (totalLongPositionSize() == 0) | |
809 | 818 | else false) | |
810 | 819 | then $Tuple3(0, 0, 0) | |
811 | 820 | else if ((0 > premium)) | |
812 | 821 | then { | |
813 | 822 | let shortPremiumFraction = divd(muld(premium, fundingPeriodDecimal()), ONE_DAY) | |
814 | 823 | if ((fundingMode() == FUNDING_ASYMMETRIC)) | |
815 | 824 | then { | |
816 | 825 | let longPremiumFraction = divd(muld(shortPremiumFraction, totalShortPositionSize()), totalLongPositionSize()) | |
817 | 826 | $Tuple3(shortPremiumFraction, longPremiumFraction, 0) | |
818 | 827 | } | |
819 | 828 | else { | |
820 | 829 | let shortTotalPremiumFraction = abs(muld(shortPremiumFraction, totalShortPositionSize())) | |
821 | 830 | let longTotalPremiumFraction = abs(muld(shortPremiumFraction, totalLongPositionSize())) | |
822 | 831 | let premiumToVault = (shortTotalPremiumFraction - longTotalPremiumFraction) | |
823 | 832 | $Tuple3(shortPremiumFraction, shortPremiumFraction, premiumToVault) | |
824 | 833 | } | |
825 | 834 | } | |
826 | 835 | else { | |
827 | 836 | let longPremiumFraction = divd(muld(premium, fundingPeriodDecimal()), ONE_DAY) | |
828 | 837 | if ((fundingMode() == FUNDING_ASYMMETRIC)) | |
829 | 838 | then { | |
830 | 839 | let shortPremiumFraction = divd(muld(longPremiumFraction, totalLongPositionSize()), totalShortPositionSize()) | |
831 | 840 | $Tuple3(shortPremiumFraction, longPremiumFraction, 0) | |
832 | 841 | } | |
833 | 842 | else { | |
834 | 843 | let longTotalPremiumFraction = abs(muld(longPremiumFraction, totalLongPositionSize())) | |
835 | 844 | let shortTotalPremiumFraction = abs(muld(longPremiumFraction, totalShortPositionSize())) | |
836 | 845 | let premiumToVault = (longTotalPremiumFraction - shortTotalPremiumFraction) | |
837 | 846 | $Tuple3(longPremiumFraction, longPremiumFraction, premiumToVault) | |
838 | 847 | } | |
839 | 848 | } | |
840 | 849 | } | |
841 | 850 | ||
842 | 851 | ||
843 | 852 | func getAdjustedFee (_artifactId,_baseFeeDiscount) = { | |
844 | 853 | let baseFeeRaw = fee() | |
845 | 854 | let baseFee = muld(baseFeeRaw, _baseFeeDiscount) | |
846 | - | let $ | |
855 | + | let $t04232642821 = if ((_artifactId != "")) | |
847 | 856 | then { | |
848 | 857 | let artifactKind = strA(nftManagerAddress(), toCompositeKey(k_token_type, _artifactId)) | |
849 | 858 | if ((artifactKind == FEE_REDUCTION_TOKEN_TYPE)) | |
850 | 859 | then { | |
851 | 860 | let reduction = intA(nftManagerAddress(), toCompositeKey(k_token_param, _artifactId)) | |
852 | 861 | let adjustedFee = muld(baseFee, reduction) | |
853 | 862 | $Tuple2(adjustedFee, true) | |
854 | 863 | } | |
855 | 864 | else throw("Invalid attached artifact") | |
856 | 865 | } | |
857 | 866 | else $Tuple2(baseFee, false) | |
858 | - | let adjustedFee = $ | |
859 | - | let burnArtifact = $ | |
867 | + | let adjustedFee = $t04232642821._1 | |
868 | + | let burnArtifact = $t04232642821._2 | |
860 | 869 | $Tuple2(adjustedFee, burnArtifact) | |
861 | 870 | } | |
862 | 871 | ||
863 | 872 | ||
864 | 873 | func getForTraderWithArtifact (_trader,_artifactId) = { | |
865 | 874 | let doGetFeeDiscount = invoke(minerAddress(), "computeFeeDiscount", [_trader], nil) | |
866 | 875 | if ((doGetFeeDiscount == doGetFeeDiscount)) | |
867 | 876 | then { | |
868 | 877 | let feeDiscount = match doGetFeeDiscount { | |
869 | 878 | case x: Int => | |
870 | 879 | x | |
871 | 880 | case _ => | |
872 | 881 | throw("Invalid computeFeeDiscount result") | |
873 | 882 | } | |
874 | - | let $ | |
875 | - | let adjustedFee = $ | |
876 | - | let burnArtifact = $ | |
883 | + | let $t04316743241 = getAdjustedFee(_artifactId, feeDiscount) | |
884 | + | let adjustedFee = $t04316743241._1 | |
885 | + | let burnArtifact = $t04316743241._2 | |
877 | 886 | $Tuple2(adjustedFee, burnArtifact) | |
878 | 887 | } | |
879 | 888 | else throw("Strict value is not equal to itself.") | |
880 | 889 | } | |
881 | 890 | ||
882 | 891 | ||
883 | 892 | func getArtifactId (i) = { | |
884 | 893 | let artifactId = if ((size(i.payments) > 1)) | |
885 | 894 | then toBase58String(valueOrErrorMessage(i.payments[1].assetId, "Invalid artifactId")) | |
886 | 895 | else "" | |
887 | 896 | artifactId | |
888 | 897 | } | |
889 | 898 | ||
890 | 899 | ||
891 | 900 | func distributeFee (_feeAmount) = { | |
892 | 901 | let feeToStakers = muld(_feeAmount, feeToStakersPercent()) | |
893 | 902 | let feeToVault = (_feeAmount - feeToStakers) | |
894 | 903 | $Tuple2(feeToStakers, feeToVault) | |
895 | 904 | } | |
896 | 905 | ||
897 | 906 | ||
898 | 907 | func updateSettings (_initMarginRatio,_mmr,_liquidationFeeRatio,_fundingPeriod,_fee,_spreadLimit,_maxPriceImpact,_partialLiquidationRatio,_maxPriceSpread,_maxOpenNotional,_feeToStakersPercent,_maxOracleDelay,_rolloverFee,_fundingMode,_oracleMode) = [IntegerEntry(k_initMarginRatio, _initMarginRatio), IntegerEntry(k_maintenanceMarginRatio, _mmr), IntegerEntry(k_liquidationFeeRatio, _liquidationFeeRatio), IntegerEntry(k_fundingPeriod, _fundingPeriod), IntegerEntry(k_fee, _fee), IntegerEntry(k_spreadLimit, _spreadLimit), IntegerEntry(k_maxPriceImpact, _maxPriceImpact), IntegerEntry(k_partialLiquidationRatio, _partialLiquidationRatio), IntegerEntry(k_maxPriceSpread, _maxPriceSpread), IntegerEntry(k_maxOpenNotional, _maxOpenNotional), IntegerEntry(k_feeToStakersPercent, _feeToStakersPercent), IntegerEntry(k_maxOracleDelay, _maxOracleDelay), IntegerEntry(k_rolloverFee, _rolloverFee), IntegerEntry(k_fundingMode, _fundingMode), IntegerEntry(k_oracleMode, _oracleMode)] | |
899 | 908 | ||
900 | 909 | ||
901 | 910 | 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)] | |
902 | 911 | ||
903 | 912 | ||
904 | 913 | func incrementPositionSequenceNumber (_isNewPosition,_trader,_direction) = { | |
905 | 914 | let positionKey = ((_trader + "_") + toString(_direction)) | |
906 | 915 | if (_isNewPosition) | |
907 | 916 | then { | |
908 | 917 | let currentSequence = lastSequence() | |
909 | 918 | [IntegerEntry(toCompositeKey(k_positionSequence, positionKey), (currentSequence + 1)), IntegerEntry(k_sequence, (currentSequence + 1))] | |
910 | 919 | } | |
911 | 920 | else nil | |
912 | 921 | } | |
913 | 922 | ||
914 | 923 | ||
915 | 924 | func updatePositionFee (_isNewPosition,_trader,_direction,_fee) = { | |
916 | 925 | let positionKey = ((_trader + "_") + toString(_direction)) | |
917 | 926 | if (_isNewPosition) | |
918 | 927 | then [IntegerEntry(toCompositeKey(k_positionFee, positionKey), _fee)] | |
919 | 928 | else nil | |
920 | 929 | } | |
921 | 930 | ||
922 | 931 | ||
923 | 932 | func updatePosition (_trader,_size,_margin,_openNotional,_latestCumulativePremiumFraction,_latestTimestamp) = { | |
924 | 933 | let direction = getDirection(_size) | |
925 | 934 | let positionKey = ((_trader + "_") + toString(direction)) | |
926 | 935 | [IntegerEntry(toCompositeKey(k_positionSize, positionKey), _size), IntegerEntry(toCompositeKey(k_positionMargin, positionKey), _margin), IntegerEntry(toCompositeKey(k_positionOpenNotional, positionKey), _openNotional), IntegerEntry(toCompositeKey(k_positionLastUpdatedCumulativePremiumFraction, positionKey), _latestCumulativePremiumFraction), IntegerEntry(toCompositeKey(k_positionLastUpdatedTimestamp, positionKey), _latestTimestamp)] | |
927 | 936 | } | |
928 | 937 | ||
929 | 938 | ||
930 | 939 | func updateAmmReserves (_qtAstR,_bsAstR) = if (if ((0 > _qtAstR)) | |
931 | 940 | then true | |
932 | 941 | else (0 > _bsAstR)) | |
933 | 942 | then throw("Invalid amount to update reserves") | |
934 | - | else [IntegerEntry(k_quoteAssetReserve, _qtAstR), IntegerEntry(k_baseAssetReserve, _bsAstR)] | |
943 | + | else if (if ((_qtAstR != qtAstR0())) | |
944 | + | then true | |
945 | + | else (_bsAstR != bsAstR0())) | |
946 | + | then [IntegerEntry(k_quoteAssetReserve, _qtAstR), IntegerEntry(k_baseAssetReserve, _bsAstR)] | |
947 | + | else nil | |
935 | 948 | ||
936 | 949 | ||
937 | - | func updateAmmWeights (_qtAstW,_bsAstW) = [IntegerEntry(k_quoteAssetWeight, _qtAstW), IntegerEntry(k_baseAssetWeight, _bsAstW)] | |
950 | + | func updateAmmWeights (_qtAstW,_bsAstW) = if (if ((_qtAstW != qtAstW())) | |
951 | + | then true | |
952 | + | else (_bsAstW != bsAstW())) | |
953 | + | then [IntegerEntry(k_quoteAssetWeight, _qtAstW), IntegerEntry(k_baseAssetWeight, _bsAstW)] | |
954 | + | else nil | |
938 | 955 | ||
939 | 956 | ||
940 | 957 | func updateAmm (_qtAstR,_bsAstR,_totalPositionSizeAfter,_openInterestNotional,_totalLongPositionSize,_totalShortPositionSize,_totalLongOpenNotional,_totalShortOpenNotional) = { | |
941 | 958 | let _qtAstW = qtAstW() | |
942 | 959 | let _bsAstW = bsAstW() | |
943 | 960 | if (((_totalLongPositionSize - _totalShortPositionSize) != _totalPositionSizeAfter)) | |
944 | 961 | then throw(((((("Invalid AMM state data: " + toString(_totalLongPositionSize)) + " + ") + toString(_totalShortPositionSize)) + " != ") + toString(_totalPositionSizeAfter))) | |
945 | 962 | else (updateAmmReserves(_qtAstR, _bsAstR) ++ [IntegerEntry(k_totalPositionSize, _totalPositionSizeAfter), IntegerEntry(k_openInterestNotional, _openInterestNotional), IntegerEntry(k_totalLongPositionSize, _totalLongPositionSize), IntegerEntry(k_totalShortPositionSize, _totalShortPositionSize), IntegerEntry(k_openInterestLong, _totalLongOpenNotional), IntegerEntry(k_openInterestShort, _totalShortOpenNotional)]) | |
946 | 963 | } | |
947 | 964 | ||
948 | 965 | ||
949 | 966 | func deletePosition (_trader,_direction) = { | |
950 | 967 | let positionKey = ((_trader + "_") + toString(_direction)) | |
951 | 968 | [DeleteEntry(toCompositeKey(k_positionSize, positionKey)), DeleteEntry(toCompositeKey(k_positionMargin, positionKey)), DeleteEntry(toCompositeKey(k_positionOpenNotional, positionKey)), DeleteEntry(toCompositeKey(k_positionLastUpdatedCumulativePremiumFraction, positionKey)), DeleteEntry(toCompositeKey(k_positionFee, positionKey)), DeleteEntry(toCompositeKey(k_positionLastUpdatedTimestamp, positionKey))] | |
952 | 969 | } | |
953 | 970 | ||
954 | 971 | ||
955 | 972 | func withdraw (_address,_amount) = { | |
956 | 973 | let balance = assetBalance(this, quoteAsset()) | |
957 | 974 | if ((_amount > balance)) | |
958 | 975 | then throw(((("Unable to withdraw " + toString(_amount)) + " from contract balance ") + toString(balance))) | |
959 | 976 | else [ScriptTransfer(_address, _amount, quoteAsset())] | |
960 | 977 | } | |
961 | 978 | ||
962 | 979 | ||
963 | - | func updateBalance ( | |
980 | + | func updateBalance (_balance) = if ((0 > _balance)) | |
964 | 981 | then throw("Balance") | |
965 | - | else [IntegerEntry(k_balance, i)] | |
982 | + | else if (if ((cbalance0() == 0)) | |
983 | + | then true | |
984 | + | else (cbalance0() != _balance)) | |
985 | + | then [IntegerEntry(k_balance, _balance)] | |
986 | + | else nil | |
966 | 987 | ||
967 | 988 | ||
968 | 989 | func transferFee (i) = [ScriptTransfer(stakingAddress(), i, quoteAsset())] | |
969 | 990 | ||
970 | 991 | ||
971 | 992 | func doBurnArtifact (_burnArtifact,i) = if (_burnArtifact) | |
972 | 993 | then [Burn(valueOrErrorMessage(i.payments[1].assetId, "Invalid artifact"), 1)] | |
973 | 994 | else nil | |
974 | 995 | ||
975 | 996 | ||
976 | 997 | @Callable(i) | |
977 | 998 | func pause () = if ((i.caller != adminAddress())) | |
978 | 999 | then throw("Invalid pause params") | |
979 | 1000 | else [BooleanEntry(k_paused, true)] | |
980 | 1001 | ||
981 | 1002 | ||
982 | 1003 | ||
983 | 1004 | @Callable(i) | |
984 | 1005 | func unpause () = if ((i.caller != adminAddress())) | |
985 | 1006 | then throw("Invalid unpause params") | |
986 | 1007 | else [BooleanEntry(k_paused, false)] | |
987 | 1008 | ||
988 | 1009 | ||
989 | 1010 | ||
990 | 1011 | @Callable(i) | |
991 | 1012 | func setCloseOnly () = if ((i.caller != adminAddress())) | |
992 | 1013 | then throw("Invalid setCloseOnly params") | |
993 | 1014 | else [BooleanEntry(k_closeOnly, true)] | |
994 | 1015 | ||
995 | 1016 | ||
996 | 1017 | ||
997 | 1018 | @Callable(i) | |
998 | 1019 | func unsetCloseOnly () = if ((i.caller != adminAddress())) | |
999 | 1020 | then throw("Invalid unsetCloseOnly params") | |
1000 | 1021 | else [BooleanEntry(k_closeOnly, false)] | |
1001 | 1022 | ||
1002 | 1023 | ||
1003 | 1024 | ||
1004 | 1025 | @Callable(i) | |
1005 | 1026 | func changeLiquidity (_quoteAssetAmount) = if (if ((i.caller != adminAddress())) | |
1006 | 1027 | then true | |
1007 | 1028 | else (_quoteAssetAmount == 0)) | |
1008 | 1029 | then throw("Invalid changeLiquidity params") | |
1009 | 1030 | else { | |
1010 | 1031 | let _qtAstR = qtAstR() | |
1011 | 1032 | let _bsAstR = bsAstR() | |
1012 | 1033 | let _qtAstW = qtAstW() | |
1013 | 1034 | let _bsAstW = bsAstW() | |
1014 | 1035 | let price = divd(muld(_qtAstR, _qtAstW), muld(_bsAstR, _bsAstW)) | |
1015 | 1036 | let qtAstRAfter = (_qtAstR + _quoteAssetAmount) | |
1016 | 1037 | let baseAssetAmountToAdd = (divd(muld(qtAstRAfter, _qtAstW), price) - _bsAstR) | |
1017 | 1038 | let bsAstRAfter = (_bsAstR + baseAssetAmountToAdd) | |
1018 | - | let $ | |
1019 | - | let newQuoteAssetWeight = $ | |
1020 | - | let newBaseAssetWeight = $ | |
1021 | - | let marginToVault = $ | |
1039 | + | let $t05196652117 = getSyncTerminalPrice(getOraclePrice(), qtAstRAfter, bsAstRAfter) | |
1040 | + | let newQuoteAssetWeight = $t05196652117._1 | |
1041 | + | let newBaseAssetWeight = $t05196652117._2 | |
1042 | + | let marginToVault = $t05196652117._3 | |
1022 | 1043 | let doExchangePnL = if ((marginToVault != 0)) | |
1023 | 1044 | then { | |
1024 | 1045 | let doExchangePnL = invoke(vaultAddress(), "exchangeFreeAndLocked", [marginToVault], nil) | |
1025 | 1046 | if ((doExchangePnL == doExchangePnL)) | |
1026 | 1047 | then nil | |
1027 | 1048 | else throw("Strict value is not equal to itself.") | |
1028 | 1049 | } | |
1029 | 1050 | else nil | |
1030 | 1051 | if ((doExchangePnL == doExchangePnL)) | |
1031 | 1052 | then (updateAmmReserves(qtAstRAfter, bsAstRAfter) ++ updateAmmWeights(newQuoteAssetWeight, newBaseAssetWeight)) | |
1032 | 1053 | else throw("Strict value is not equal to itself.") | |
1033 | 1054 | } | |
1034 | 1055 | ||
1035 | 1056 | ||
1036 | 1057 | ||
1037 | 1058 | @Callable(i) | |
1038 | 1059 | func changeSettings (_initMarginRatio,_mmr,_liquidationFeeRatio,_fundingPeriod,_fee,_spreadLimit,_maxPriceImpact,_partialLiquidationRatio,_maxPriceSpread,_maxOpenNotional,_feeToStakersPercent,_maxOracleDelay,_rolloverFee,_fundingMode,_oracleMode) = if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if ((0 >= _fundingPeriod)) | |
1039 | 1060 | then true | |
1040 | 1061 | else (0 >= _initMarginRatio)) | |
1041 | 1062 | then true | |
1042 | 1063 | else (0 >= _mmr)) | |
1043 | 1064 | then true | |
1044 | 1065 | else (0 >= _liquidationFeeRatio)) | |
1045 | 1066 | then true | |
1046 | 1067 | else (0 >= _fee)) | |
1047 | 1068 | then true | |
1048 | 1069 | else (0 >= _spreadLimit)) | |
1049 | 1070 | then true | |
1050 | 1071 | else (0 >= _maxPriceImpact)) | |
1051 | 1072 | then true | |
1052 | 1073 | else (0 >= _partialLiquidationRatio)) | |
1053 | 1074 | then true | |
1054 | 1075 | else (0 >= _maxPriceSpread)) | |
1055 | 1076 | then true | |
1056 | 1077 | else (0 >= _maxOpenNotional)) | |
1057 | 1078 | then true | |
1058 | 1079 | else (0 >= _feeToStakersPercent)) | |
1059 | 1080 | then true | |
1060 | 1081 | else (_feeToStakersPercent > DECIMAL_UNIT)) | |
1061 | 1082 | then true | |
1062 | 1083 | else (0 >= _maxOracleDelay)) | |
1063 | 1084 | then true | |
1064 | 1085 | else (0 >= _rolloverFee)) | |
1065 | 1086 | then true | |
1066 | 1087 | else if ((_fundingMode != FUNDING_SYMMETRIC)) | |
1067 | 1088 | then (_fundingMode != FUNDING_ASYMMETRIC) | |
1068 | 1089 | else false) | |
1069 | 1090 | then true | |
1070 | 1091 | else if ((_oracleMode != ORACLE_PLAIN)) | |
1071 | 1092 | then (_oracleMode != ORACLE_JIT) | |
1072 | 1093 | else false) | |
1073 | 1094 | then true | |
1074 | 1095 | else !(initialized())) | |
1075 | 1096 | then true | |
1076 | 1097 | else (i.caller != adminAddress())) | |
1077 | 1098 | then throw("Invalid changeSettings params") | |
1078 | 1099 | else updateSettings(_initMarginRatio, _mmr, _liquidationFeeRatio, _fundingPeriod, _fee, _spreadLimit, _maxPriceImpact, _partialLiquidationRatio, _maxPriceSpread, _maxOpenNotional, _feeToStakersPercent, _maxOracleDelay, _rolloverFee, _fundingMode, _oracleMode) | |
1079 | 1100 | ||
1080 | 1101 | ||
1081 | 1102 | ||
1082 | 1103 | @Callable(i) | |
1083 | 1104 | func initialize (_qtAstR,_bsAstR,_fundingPeriod,_initMarginRatio,_mmr,_liquidationFeeRatio,_fee,_baseOracleData,_quoteOracleData,_coordinator,_spreadLimit,_maxPriceImpact,_partialLiquidationRatio,_maxPriceSpread,_maxOpenNotional,_feeToStakersPercent,_maxOracleDelay,_rolloverFee,_fundingMode,_oracleMode) = if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if ((0 >= _qtAstR)) | |
1084 | 1105 | then true | |
1085 | 1106 | else (0 >= _bsAstR)) | |
1086 | 1107 | then true | |
1087 | 1108 | else (0 >= _fundingPeriod)) | |
1088 | 1109 | then true | |
1089 | 1110 | else (0 >= _initMarginRatio)) | |
1090 | 1111 | then true | |
1091 | 1112 | else (0 >= _mmr)) | |
1092 | 1113 | then true | |
1093 | 1114 | else (0 >= _liquidationFeeRatio)) | |
1094 | 1115 | then true | |
1095 | 1116 | else (0 >= _fee)) | |
1096 | 1117 | then true | |
1097 | 1118 | else (0 >= _spreadLimit)) | |
1098 | 1119 | then true | |
1099 | 1120 | else (0 >= _maxPriceImpact)) | |
1100 | 1121 | then true | |
1101 | 1122 | else (0 >= _partialLiquidationRatio)) | |
1102 | 1123 | then true | |
1103 | 1124 | else (0 >= _maxPriceSpread)) | |
1104 | 1125 | then true | |
1105 | 1126 | else (0 >= _maxOpenNotional)) | |
1106 | 1127 | then true | |
1107 | 1128 | else (0 >= _feeToStakersPercent)) | |
1108 | 1129 | then true | |
1109 | 1130 | else (_feeToStakersPercent > DECIMAL_UNIT)) | |
1110 | 1131 | then true | |
1111 | 1132 | else (0 > _maxOracleDelay)) | |
1112 | 1133 | then true | |
1113 | 1134 | else (0 >= _rolloverFee)) | |
1114 | 1135 | then true | |
1115 | 1136 | else if ((_fundingMode != FUNDING_SYMMETRIC)) | |
1116 | 1137 | then (_fundingMode != FUNDING_ASYMMETRIC) | |
1117 | 1138 | else false) | |
1118 | 1139 | then true | |
1119 | 1140 | else if ((_oracleMode != ORACLE_PLAIN)) | |
1120 | 1141 | then (_oracleMode != ORACLE_JIT) | |
1121 | 1142 | else false) | |
1122 | 1143 | then true | |
1123 | 1144 | else initialized()) | |
1124 | 1145 | then true | |
1125 | 1146 | else (i.caller != this)) | |
1126 | 1147 | then throw("Invalid initialize parameters") | |
1127 | 1148 | else ((((updateAmm(_qtAstR, _bsAstR, 0, 0, 0, 0, 0, 0) ++ updateSettings(_initMarginRatio, _mmr, _liquidationFeeRatio, _fundingPeriod, _fee, _spreadLimit, _maxPriceImpact, _partialLiquidationRatio, _maxPriceSpread, _maxOpenNotional, _feeToStakersPercent, _maxOracleDelay, _rolloverFee, _fundingMode, _oracleMode)) ++ updateFunding((lastTimestamp() + _fundingPeriod), 0, 0, 0, 0)) ++ updateBalance(0)) ++ [BooleanEntry(k_initialized, true), StringEntry(k_baseOracle, _baseOracleData), StringEntry(k_quoteOracle, _quoteOracleData), StringEntry(k_coordinatorAddress, toString(addressFromStringValue(_coordinator)))]) | |
1128 | 1149 | ||
1129 | 1150 | ||
1130 | 1151 | ||
1131 | 1152 | @Callable(i) | |
1132 | 1153 | func increasePosition (_direction,_leverage,_minBaseAssetAmount,_refLink,_priceUpdate) = { | |
1133 | 1154 | let updateOracle = invoke(this, "updateOracle", [_priceUpdate], nil) | |
1134 | 1155 | if ((updateOracle == updateOracle)) | |
1135 | 1156 | then { | |
1136 | 1157 | let sync = invoke(this, "syncTerminalPriceToOracle", nil, nil) | |
1137 | 1158 | if ((sync == sync)) | |
1138 | 1159 | then { | |
1139 | 1160 | let ensureCalledOnce = invoke(this, "ensureCalledOnce", nil, nil) | |
1140 | 1161 | if ((ensureCalledOnce == ensureCalledOnce)) | |
1141 | 1162 | then { | |
1142 | 1163 | let _trader = getActualCaller(i) | |
1143 | 1164 | let _rawAmount = i.payments[0].amount | |
1144 | 1165 | let _assetId = i.payments[0].assetId | |
1145 | 1166 | let _assetIdStr = toBase58String(value(_assetId)) | |
1146 | 1167 | let isQuoteAsset = (_assetId == quoteAsset()) | |
1147 | 1168 | if (if (if (if (if (if (if (if (if ((_direction != DIR_LONG)) | |
1148 | 1169 | then (_direction != DIR_SHORT) | |
1149 | 1170 | else false) | |
1150 | 1171 | then true | |
1151 | 1172 | else (0 >= _rawAmount)) | |
1152 | 1173 | then true | |
1153 | 1174 | else !(initialized())) | |
1154 | 1175 | then true | |
1155 | 1176 | else !(isQuoteAsset)) | |
1156 | 1177 | then true | |
1157 | 1178 | else !(requireMoreMarginRatio(divd(DECIMAL_UNIT, _leverage), initMarginRatio(), true))) | |
1158 | 1179 | then true | |
1159 | 1180 | else paused()) | |
1160 | 1181 | then true | |
1161 | 1182 | else closeOnly()) | |
1162 | 1183 | then true | |
1163 | 1184 | else isMarketClosed()) | |
1164 | 1185 | then throw("Invalid increasePosition parameters") | |
1165 | 1186 | else { | |
1166 | - | let $ | |
1167 | - | let adjustedFee = $ | |
1168 | - | let burnArtifact = $ | |
1187 | + | let $t05849358642 = getForTraderWithArtifact(_trader, getArtifactId(i)) | |
1188 | + | let adjustedFee = $t05849358642._1 | |
1189 | + | let burnArtifact = $t05849358642._2 | |
1169 | 1190 | let _amount = divd(_rawAmount, (muld(adjustedFee, _leverage) + DECIMAL_UNIT)) | |
1170 | 1191 | let distributeFeeAmount = (_rawAmount - _amount) | |
1171 | 1192 | let referrerFeeAny = invoke(referralAddress(), "acceptPaymentWithLink", [_trader, _refLink], [AttachedPayment(quoteAsset(), distributeFeeAmount)]) | |
1172 | 1193 | if ((referrerFeeAny == referrerFeeAny)) | |
1173 | 1194 | then { | |
1174 | 1195 | let referrerFee = match referrerFeeAny { | |
1175 | 1196 | case x: Int => | |
1176 | 1197 | x | |
1177 | 1198 | case _ => | |
1178 | 1199 | throw("Invalid referrerFee") | |
1179 | 1200 | } | |
1180 | 1201 | let feeAmount = (distributeFeeAmount - referrerFee) | |
1181 | - | let $ | |
1182 | - | let oldPositionSize = $ | |
1183 | - | let oldPositionMargin = $ | |
1184 | - | let oldPositionOpenNotional = $ | |
1185 | - | let oldPositionLstUpdCPF = $ | |
1186 | - | let oldPositionTimestamp = $ | |
1202 | + | let $t05913859318 = getPosition(_trader, _direction) | |
1203 | + | let oldPositionSize = $t05913859318._1 | |
1204 | + | let oldPositionMargin = $t05913859318._2 | |
1205 | + | let oldPositionOpenNotional = $t05913859318._3 | |
1206 | + | let oldPositionLstUpdCPF = $t05913859318._4 | |
1207 | + | let oldPositionTimestamp = $t05913859318._5 | |
1187 | 1208 | let isNewPosition = (oldPositionSize == 0) | |
1188 | 1209 | let isSameDirection = if ((oldPositionSize > 0)) | |
1189 | 1210 | then (_direction == DIR_LONG) | |
1190 | 1211 | else (_direction == DIR_SHORT) | |
1191 | 1212 | let expandExisting = if (!(isNewPosition)) | |
1192 | 1213 | then isSameDirection | |
1193 | 1214 | else false | |
1194 | 1215 | let isAdd = (_direction == DIR_LONG) | |
1195 | - | let $ | |
1216 | + | let $t05960762740 = if (if (isNewPosition) | |
1196 | 1217 | then true | |
1197 | 1218 | else expandExisting) | |
1198 | 1219 | then { | |
1199 | 1220 | let openNotional = muld(_amount, _leverage) | |
1200 | - | let $ | |
1201 | - | let amountBaseAssetBought = $ | |
1202 | - | let quoteAssetReserveAfter = $ | |
1203 | - | let baseAssetReserveAfter = $ | |
1204 | - | let totalPositionSizeAfter = $ | |
1221 | + | let $t06011660289 = swapInput(isAdd, openNotional) | |
1222 | + | let amountBaseAssetBought = $t06011660289._1 | |
1223 | + | let quoteAssetReserveAfter = $t06011660289._2 | |
1224 | + | let baseAssetReserveAfter = $t06011660289._3 | |
1225 | + | let totalPositionSizeAfter = $t06011660289._4 | |
1205 | 1226 | if (if ((_minBaseAssetAmount != 0)) | |
1206 | 1227 | then (_minBaseAssetAmount > abs(amountBaseAssetBought)) | |
1207 | 1228 | else false) | |
1208 | 1229 | then throw(((("Limit error: " + toString(abs(amountBaseAssetBought))) + " < ") + toString(_minBaseAssetAmount))) | |
1209 | 1230 | else { | |
1210 | 1231 | let newPositionSize = (oldPositionSize + amountBaseAssetBought) | |
1211 | 1232 | let totalLongOpenInterestAfter = (openInterestLong() + (if ((newPositionSize > 0)) | |
1212 | 1233 | then openNotional | |
1213 | 1234 | else 0)) | |
1214 | 1235 | let totalShortOpenInterestAfter = (openInterestShort() + (if ((0 > newPositionSize)) | |
1215 | 1236 | then openNotional | |
1216 | 1237 | else 0)) | |
1217 | - | let $ | |
1218 | - | let remainMargin = $ | |
1219 | - | let x1 = $ | |
1220 | - | let x2 = $ | |
1221 | - | let rolloverFee = $ | |
1238 | + | let $t06083561110 = calcRemainMarginWithFundingPaymentAndRolloverFee(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, oldPositionTimestamp, _amount) | |
1239 | + | let remainMargin = $t06083561110._1 | |
1240 | + | let x1 = $t06083561110._2 | |
1241 | + | let x2 = $t06083561110._3 | |
1242 | + | let rolloverFee = $t06083561110._4 | |
1222 | 1243 | if (!(requireNotOverSpreadLimit(quoteAssetReserveAfter, baseAssetReserveAfter))) | |
1223 | 1244 | then throw("Over max spread limit") | |
1224 | 1245 | else if (!(requireNotOverMaxOpenNotional(totalLongOpenInterestAfter, totalShortOpenInterestAfter))) | |
1225 | 1246 | then throw("Over max open notional") | |
1226 | 1247 | else $Tuple14(newPositionSize, remainMargin, (oldPositionOpenNotional + openNotional), latestCumulativePremiumFraction(newPositionSize), lastTimestamp(), baseAssetReserveAfter, quoteAssetReserveAfter, totalPositionSizeAfter, (openInterestNotional() + openNotional), (totalLongPositionSize() + (if ((newPositionSize > 0)) | |
1227 | 1248 | then abs(amountBaseAssetBought) | |
1228 | 1249 | else 0)), (totalShortPositionSize() + (if ((0 > newPositionSize)) | |
1229 | 1250 | then abs(amountBaseAssetBought) | |
1230 | 1251 | else 0)), totalLongOpenInterestAfter, totalShortOpenInterestAfter, rolloverFee) | |
1231 | 1252 | } | |
1232 | 1253 | } | |
1233 | 1254 | else { | |
1234 | 1255 | let openNotional = muld(_amount, _leverage) | |
1235 | - | let $ | |
1236 | - | let oldPositionNotional = $ | |
1237 | - | let unrealizedPnl = $ | |
1256 | + | let $t06242862556 = getPositionNotionalAndUnrealizedPnl(toString(i.caller), _direction, PNL_OPTION_SPOT) | |
1257 | + | let oldPositionNotional = $t06242862556._1 | |
1258 | + | let unrealizedPnl = $t06242862556._2 | |
1238 | 1259 | if ((oldPositionNotional > openNotional)) | |
1239 | 1260 | then throw("Use decreasePosition to decrease position size") | |
1240 | 1261 | else throw("Close position first") | |
1241 | 1262 | } | |
1242 | - | let newPositionSize = $ | |
1243 | - | let newPositionRemainMargin = $ | |
1244 | - | let newPositionOpenNotional = $ | |
1245 | - | let newPositionLatestCPF = $ | |
1246 | - | let newPositionTimestamp = $ | |
1247 | - | let baseAssetReserveAfter = $ | |
1248 | - | let quoteAssetReserveAfter = $ | |
1249 | - | let totalPositionSizeAfter = $ | |
1250 | - | let openInterestNotionalAfter = $ | |
1251 | - | let totalLongAfter = $ | |
1252 | - | let totalShortAfter = $ | |
1253 | - | let totalLongOpenInterestAfter = $ | |
1254 | - | let totalShortOpenInterestAfter = $ | |
1255 | - | let rolloverFee = $ | |
1256 | - | let $ | |
1257 | - | let feeToStakers = $ | |
1258 | - | let feeToVault = $ | |
1263 | + | let newPositionSize = $t05960762740._1 | |
1264 | + | let newPositionRemainMargin = $t05960762740._2 | |
1265 | + | let newPositionOpenNotional = $t05960762740._3 | |
1266 | + | let newPositionLatestCPF = $t05960762740._4 | |
1267 | + | let newPositionTimestamp = $t05960762740._5 | |
1268 | + | let baseAssetReserveAfter = $t05960762740._6 | |
1269 | + | let quoteAssetReserveAfter = $t05960762740._7 | |
1270 | + | let totalPositionSizeAfter = $t05960762740._8 | |
1271 | + | let openInterestNotionalAfter = $t05960762740._9 | |
1272 | + | let totalLongAfter = $t05960762740._10 | |
1273 | + | let totalShortAfter = $t05960762740._11 | |
1274 | + | let totalLongOpenInterestAfter = $t05960762740._12 | |
1275 | + | let totalShortOpenInterestAfter = $t05960762740._13 | |
1276 | + | let rolloverFee = $t05960762740._14 | |
1277 | + | let $t06274662817 = distributeFee((feeAmount + rolloverFee)) | |
1278 | + | let feeToStakers = $t06274662817._1 | |
1279 | + | let feeToVault = $t06274662817._2 | |
1259 | 1280 | let stake = if ((_amount >= rolloverFee)) | |
1260 | 1281 | then invoke(vaultAddress(), "addLocked", nil, [AttachedPayment(quoteAsset(), (_amount - rolloverFee))]) | |
1261 | 1282 | else invoke(vaultAddress(), "withdrawLocked", [(rolloverFee - _amount)], nil) | |
1262 | 1283 | if ((stake == stake)) | |
1263 | 1284 | then { | |
1264 | 1285 | let depositVault = invoke(vaultAddress(), "addFree", nil, [AttachedPayment(quoteAsset(), feeToVault)]) | |
1265 | 1286 | if ((depositVault == depositVault)) | |
1266 | 1287 | then { | |
1267 | 1288 | let notifyFee = invoke(minerAddress(), "notifyFees", [_trader, feeAmount], nil) | |
1268 | 1289 | if ((notifyFee == notifyFee)) | |
1269 | 1290 | then { | |
1270 | 1291 | let notifyNotional = invoke(minerAddress(), "notifyNotional", [_trader, newPositionOpenNotional], nil) | |
1271 | 1292 | if ((notifyNotional == notifyNotional)) | |
1272 | 1293 | then ((((((updatePosition(_trader, newPositionSize, newPositionRemainMargin, newPositionOpenNotional, newPositionLatestCPF, newPositionTimestamp) ++ incrementPositionSequenceNumber(isNewPosition, _trader, _direction)) ++ updatePositionFee(isNewPosition, _trader, _direction, adjustedFee)) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter, totalLongOpenInterestAfter, totalShortOpenInterestAfter)) ++ transferFee(feeToStakers)) ++ updateBalance(((cbalance() + _amount) - rolloverFee))) ++ doBurnArtifact(burnArtifact, i)) | |
1273 | 1294 | else throw("Strict value is not equal to itself.") | |
1274 | 1295 | } | |
1275 | 1296 | else throw("Strict value is not equal to itself.") | |
1276 | 1297 | } | |
1277 | 1298 | else throw("Strict value is not equal to itself.") | |
1278 | 1299 | } | |
1279 | 1300 | else throw("Strict value is not equal to itself.") | |
1280 | 1301 | } | |
1281 | 1302 | else throw("Strict value is not equal to itself.") | |
1282 | 1303 | } | |
1283 | 1304 | } | |
1284 | 1305 | else throw("Strict value is not equal to itself.") | |
1285 | 1306 | } | |
1286 | 1307 | else throw("Strict value is not equal to itself.") | |
1287 | 1308 | } | |
1288 | 1309 | else throw("Strict value is not equal to itself.") | |
1289 | 1310 | } | |
1290 | 1311 | ||
1291 | 1312 | ||
1292 | 1313 | ||
1293 | 1314 | @Callable(i) | |
1294 | 1315 | func addMargin (_direction,_priceUpdate) = { | |
1295 | 1316 | let updateOracle = invoke(this, "updateOracle", [_priceUpdate], nil) | |
1296 | 1317 | if ((updateOracle == updateOracle)) | |
1297 | 1318 | then { | |
1298 | 1319 | let sync = invoke(this, "syncTerminalPriceToOracle", nil, nil) | |
1299 | 1320 | if ((sync == sync)) | |
1300 | 1321 | then { | |
1301 | 1322 | let ensureCalledOnce = invoke(this, "ensureCalledOnce", nil, nil) | |
1302 | 1323 | if ((ensureCalledOnce == ensureCalledOnce)) | |
1303 | 1324 | then { | |
1304 | 1325 | let _trader = toString(i.caller) | |
1305 | 1326 | let _amount = i.payments[0].amount | |
1306 | 1327 | let _assetId = i.payments[0].assetId | |
1307 | 1328 | let _assetIdStr = toBase58String(value(_assetId)) | |
1308 | 1329 | let isQuoteAsset = (_assetId == quoteAsset()) | |
1309 | 1330 | if (if (if (if (if (!(isQuoteAsset)) | |
1310 | 1331 | then true | |
1311 | 1332 | else !(requireOpenPosition(toString(i.caller), _direction))) | |
1312 | 1333 | then true | |
1313 | 1334 | else !(initialized())) | |
1314 | 1335 | then true | |
1315 | 1336 | else paused()) | |
1316 | 1337 | then true | |
1317 | 1338 | else isMarketClosed()) | |
1318 | 1339 | then throw("Invalid addMargin parameters") | |
1319 | 1340 | else { | |
1320 | - | let $ | |
1321 | - | let oldPositionSize = $ | |
1322 | - | let oldPositionMargin = $ | |
1323 | - | let oldPositionOpenNotional = $ | |
1324 | - | let oldPositionLstUpdCPF = $ | |
1325 | - | let oldPositionTimestamp = $ | |
1341 | + | let $t06515965339 = getPosition(_trader, _direction) | |
1342 | + | let oldPositionSize = $t06515965339._1 | |
1343 | + | let oldPositionMargin = $t06515965339._2 | |
1344 | + | let oldPositionOpenNotional = $t06515965339._3 | |
1345 | + | let oldPositionLstUpdCPF = $t06515965339._4 | |
1346 | + | let oldPositionTimestamp = $t06515965339._5 | |
1326 | 1347 | let stake = invoke(vaultAddress(), "addLocked", nil, [AttachedPayment(quoteAsset(), _amount)]) | |
1327 | 1348 | if ((stake == stake)) | |
1328 | 1349 | then { | |
1329 | 1350 | let rolloverFee = calcRolloverFee(oldPositionMargin, oldPositionTimestamp) | |
1330 | 1351 | let doTransferFeeToStakers = if ((rolloverFee > 0)) | |
1331 | 1352 | then { | |
1332 | - | let $ | |
1333 | - | let feeToStakers = $ | |
1334 | - | let feeToVault = $ | |
1353 | + | let $t06562465683 = distributeFee(rolloverFee) | |
1354 | + | let feeToStakers = $t06562465683._1 | |
1355 | + | let feeToVault = $t06562465683._2 | |
1335 | 1356 | let unstake = invoke(vaultAddress(), "withdrawLocked", [feeToStakers], nil) | |
1336 | 1357 | if ((unstake == unstake)) | |
1337 | 1358 | then { | |
1338 | 1359 | let lockBadDebt = invoke(vaultAddress(), "exchangeFreeAndLocked", [-(feeToVault)], nil) | |
1339 | 1360 | if ((lockBadDebt == lockBadDebt)) | |
1340 | 1361 | then transferFee(feeToStakers) | |
1341 | 1362 | else throw("Strict value is not equal to itself.") | |
1342 | 1363 | } | |
1343 | 1364 | else throw("Strict value is not equal to itself.") | |
1344 | 1365 | } | |
1345 | 1366 | else nil | |
1346 | 1367 | if ((doTransferFeeToStakers == doTransferFeeToStakers)) | |
1347 | 1368 | then ((updatePosition(_trader, oldPositionSize, ((oldPositionMargin - rolloverFee) + _amount), oldPositionOpenNotional, oldPositionLstUpdCPF, lastTimestamp()) ++ updateBalance(((cbalance() + _amount) - rolloverFee))) ++ doTransferFeeToStakers) | |
1348 | 1369 | else throw("Strict value is not equal to itself.") | |
1349 | 1370 | } | |
1350 | 1371 | else throw("Strict value is not equal to itself.") | |
1351 | 1372 | } | |
1352 | 1373 | } | |
1353 | 1374 | else throw("Strict value is not equal to itself.") | |
1354 | 1375 | } | |
1355 | 1376 | else throw("Strict value is not equal to itself.") | |
1356 | 1377 | } | |
1357 | 1378 | else throw("Strict value is not equal to itself.") | |
1358 | 1379 | } | |
1359 | 1380 | ||
1360 | 1381 | ||
1361 | 1382 | ||
1362 | 1383 | @Callable(i) | |
1363 | 1384 | func removeMargin (_amount,_direction,_priceUpdate) = { | |
1364 | 1385 | let updateOracle = invoke(this, "updateOracle", [_priceUpdate], nil) | |
1365 | 1386 | if ((updateOracle == updateOracle)) | |
1366 | 1387 | then { | |
1367 | 1388 | let sync = invoke(this, "syncTerminalPriceToOracle", nil, nil) | |
1368 | 1389 | if ((sync == sync)) | |
1369 | 1390 | then { | |
1370 | 1391 | let ensureCalledOnce = invoke(this, "ensureCalledOnce", nil, nil) | |
1371 | 1392 | if ((ensureCalledOnce == ensureCalledOnce)) | |
1372 | 1393 | then { | |
1373 | 1394 | let _trader = toString(i.caller) | |
1374 | 1395 | if (if (if (if (if ((0 >= _amount)) | |
1375 | 1396 | then true | |
1376 | 1397 | else !(requireOpenPosition(_trader, _direction))) | |
1377 | 1398 | then true | |
1378 | 1399 | else !(initialized())) | |
1379 | 1400 | then true | |
1380 | 1401 | else paused()) | |
1381 | 1402 | then true | |
1382 | 1403 | else isMarketClosed()) | |
1383 | 1404 | then throw("Invalid removeMargin parameters") | |
1384 | 1405 | else { | |
1385 | - | let $ | |
1386 | - | let oldPositionSize = $ | |
1387 | - | let oldPositionMargin = $ | |
1388 | - | let oldPositionOpenNotional = $ | |
1389 | - | let oldPositionLstUpdCPF = $ | |
1390 | - | let oldPositionTimestamp = $ | |
1391 | - | let $ | |
1392 | - | let remainMargin = $ | |
1393 | - | let badDebt = $ | |
1394 | - | let fundingPayment = $ | |
1395 | - | let rolloverFee = $ | |
1406 | + | let $t06718467364 = getPosition(_trader, _direction) | |
1407 | + | let oldPositionSize = $t06718467364._1 | |
1408 | + | let oldPositionMargin = $t06718467364._2 | |
1409 | + | let oldPositionOpenNotional = $t06718467364._3 | |
1410 | + | let oldPositionLstUpdCPF = $t06718467364._4 | |
1411 | + | let oldPositionTimestamp = $t06718467364._5 | |
1412 | + | let $t06737067619 = calcRemainMarginWithFundingPaymentAndRolloverFee(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, oldPositionTimestamp, -(_amount)) | |
1413 | + | let remainMargin = $t06737067619._1 | |
1414 | + | let badDebt = $t06737067619._2 | |
1415 | + | let fundingPayment = $t06737067619._3 | |
1416 | + | let rolloverFee = $t06737067619._4 | |
1396 | 1417 | if ((badDebt != 0)) | |
1397 | 1418 | then throw("Invalid removed margin amount") | |
1398 | 1419 | else { | |
1399 | 1420 | let marginRatio = calcMarginRatio(remainMargin, badDebt, oldPositionOpenNotional) | |
1400 | 1421 | if (!(requireMoreMarginRatio(marginRatio, initMarginRatio(), true))) | |
1401 | 1422 | then throw(((("Too much margin removed: " + toString(marginRatio)) + " < ") + toString(initMarginRatio()))) | |
1402 | 1423 | else { | |
1403 | - | let $ | |
1404 | - | let feeToStakers = $ | |
1405 | - | let feeToVault = $ | |
1424 | + | let $t06800568064 = distributeFee(rolloverFee) | |
1425 | + | let feeToStakers = $t06800568064._1 | |
1426 | + | let feeToVault = $t06800568064._2 | |
1406 | 1427 | let doTransferFeeToStakers = if ((rolloverFee > 0)) | |
1407 | 1428 | then { | |
1408 | 1429 | let lockBadDebt = invoke(vaultAddress(), "exchangeFreeAndLocked", [-(feeToVault)], nil) | |
1409 | 1430 | if ((lockBadDebt == lockBadDebt)) | |
1410 | 1431 | then transferFee(feeToStakers) | |
1411 | 1432 | else throw("Strict value is not equal to itself.") | |
1412 | 1433 | } | |
1413 | 1434 | else nil | |
1414 | 1435 | if ((doTransferFeeToStakers == doTransferFeeToStakers)) | |
1415 | 1436 | then { | |
1416 | 1437 | let unstake = invoke(vaultAddress(), "withdrawLocked", [(_amount + feeToStakers)], nil) | |
1417 | 1438 | if ((unstake == unstake)) | |
1418 | 1439 | then (((updatePosition(_trader, oldPositionSize, remainMargin, oldPositionOpenNotional, latestCumulativePremiumFraction(oldPositionSize), lastTimestamp()) ++ withdraw(i.caller, _amount)) ++ updateBalance(((cbalance() - _amount) - rolloverFee))) ++ doTransferFeeToStakers) | |
1419 | 1440 | else throw("Strict value is not equal to itself.") | |
1420 | 1441 | } | |
1421 | 1442 | else throw("Strict value is not equal to itself.") | |
1422 | 1443 | } | |
1423 | 1444 | } | |
1424 | 1445 | } | |
1425 | 1446 | } | |
1426 | 1447 | else throw("Strict value is not equal to itself.") | |
1427 | 1448 | } | |
1428 | 1449 | else throw("Strict value is not equal to itself.") | |
1429 | 1450 | } | |
1430 | 1451 | else throw("Strict value is not equal to itself.") | |
1431 | 1452 | } | |
1432 | 1453 | ||
1433 | 1454 | ||
1434 | 1455 | ||
1435 | 1456 | @Callable(i) | |
1436 | 1457 | func closePosition (_size,_direction,_minQuoteAssetAmount,_addToMargin,_priceUpdate) = { | |
1437 | 1458 | let updateOracle = invoke(this, "updateOracle", [_priceUpdate], nil) | |
1438 | 1459 | if ((updateOracle == updateOracle)) | |
1439 | 1460 | then { | |
1440 | 1461 | let sync = invoke(this, "syncTerminalPriceToOracle", nil, nil) | |
1441 | 1462 | if ((sync == sync)) | |
1442 | 1463 | then { | |
1443 | 1464 | let ensureCalledOnce = invoke(this, "ensureCalledOnce", nil, nil) | |
1444 | 1465 | if ((ensureCalledOnce == ensureCalledOnce)) | |
1445 | 1466 | then { | |
1446 | 1467 | let _trader = getActualCaller(i) | |
1447 | 1468 | let _traderAddress = valueOrErrorMessage(addressFromString(_trader), "Invalid caller") | |
1448 | 1469 | let positionFee = getPositionFee(_trader, _direction) | |
1449 | 1470 | if (if (if (if (if (if (!(requireOpenPosition(_trader, _direction))) | |
1450 | 1471 | then true | |
1451 | 1472 | else !(initialized())) | |
1452 | 1473 | then true | |
1453 | 1474 | else paused()) | |
1454 | 1475 | then true | |
1455 | 1476 | else (0 >= _size)) | |
1456 | 1477 | then true | |
1457 | 1478 | else (0 > _minQuoteAssetAmount)) | |
1458 | 1479 | then true | |
1459 | 1480 | else isMarketClosed()) | |
1460 | 1481 | then throw("Invalid closePosition parameters") | |
1461 | 1482 | else { | |
1462 | 1483 | let oldPositionTimestamp = getPosition(_trader, _direction)._5 | |
1463 | - | let $ | |
1464 | - | let newPositionSize = $ | |
1465 | - | let newPositionMargin = $ | |
1466 | - | let newPositionOpenNotional = $ | |
1467 | - | let newPositionLstUpdCPF = $ | |
1468 | - | let positionBadDebt = $ | |
1469 | - | let realizedPnl = $ | |
1470 | - | let marginToTrader = $ | |
1471 | - | let quoteAssetReserveAfter = $ | |
1472 | - | let baseAssetReserveAfter = $ | |
1473 | - | let totalPositionSizeAfter = $ | |
1474 | - | let openInterestNotionalAfter = $ | |
1475 | - | let totalLongAfter = $ | |
1476 | - | let totalShortAfter = $ | |
1477 | - | let totalLongOpenInterestAfter = $ | |
1478 | - | let totalShortOpenInterestAfter = $ | |
1479 | - | let realizedFee = $ | |
1484 | + | let $t07039971002 = internalClosePosition(_trader, _direction, _size, positionFee, _minQuoteAssetAmount, _addToMargin, true, true) | |
1485 | + | let newPositionSize = $t07039971002._1 | |
1486 | + | let newPositionMargin = $t07039971002._2 | |
1487 | + | let newPositionOpenNotional = $t07039971002._3 | |
1488 | + | let newPositionLstUpdCPF = $t07039971002._4 | |
1489 | + | let positionBadDebt = $t07039971002._5 | |
1490 | + | let realizedPnl = $t07039971002._6 | |
1491 | + | let marginToTrader = $t07039971002._7 | |
1492 | + | let quoteAssetReserveAfter = $t07039971002._8 | |
1493 | + | let baseAssetReserveAfter = $t07039971002._9 | |
1494 | + | let totalPositionSizeAfter = $t07039971002._10 | |
1495 | + | let openInterestNotionalAfter = $t07039971002._11 | |
1496 | + | let totalLongAfter = $t07039971002._12 | |
1497 | + | let totalShortAfter = $t07039971002._13 | |
1498 | + | let totalLongOpenInterestAfter = $t07039971002._14 | |
1499 | + | let totalShortOpenInterestAfter = $t07039971002._15 | |
1500 | + | let realizedFee = $t07039971002._16 | |
1480 | 1501 | if ((positionBadDebt > 0)) | |
1481 | 1502 | then throw("Invalid closePosition parameters: bad debt") | |
1482 | 1503 | else if ((oldPositionTimestamp >= lastTimestamp())) | |
1483 | 1504 | then throw("Invalid closePosition parameters: wait at least 1 block before closing the position") | |
1484 | 1505 | else { | |
1485 | 1506 | let isPartialClose = (newPositionSize != 0) | |
1486 | 1507 | let withdrawAmount = (marginToTrader + realizedFee) | |
1487 | 1508 | let ammBalance = (cbalance() - withdrawAmount) | |
1488 | 1509 | let ammNewBalance = if ((0 > ammBalance)) | |
1489 | 1510 | then 0 | |
1490 | 1511 | else ammBalance | |
1491 | 1512 | let unstake = invoke(vaultAddress(), "withdrawLocked", [withdrawAmount], nil) | |
1492 | 1513 | if ((unstake == unstake)) | |
1493 | 1514 | then { | |
1494 | 1515 | let referrerFeeAny = invoke(referralAddress(), "acceptPayment", [_trader], [AttachedPayment(quoteAsset(), realizedFee)]) | |
1495 | 1516 | if ((referrerFeeAny == referrerFeeAny)) | |
1496 | 1517 | then { | |
1497 | 1518 | let referrerFee = match referrerFeeAny { | |
1498 | 1519 | case x: Int => | |
1499 | 1520 | x | |
1500 | 1521 | case _ => | |
1501 | 1522 | throw("Invalid referrerFee") | |
1502 | 1523 | } | |
1503 | - | let $ | |
1504 | - | let feeToStakers = $ | |
1505 | - | let feeToVault = $ | |
1524 | + | let $t07197472047 = distributeFee((realizedFee - referrerFee)) | |
1525 | + | let feeToStakers = $t07197472047._1 | |
1526 | + | let feeToVault = $t07197472047._2 | |
1506 | 1527 | let depositVault = invoke(vaultAddress(), "addFree", nil, [AttachedPayment(quoteAsset(), feeToVault)]) | |
1507 | 1528 | if ((depositVault == depositVault)) | |
1508 | 1529 | then { | |
1509 | 1530 | let notifyFee = invoke(minerAddress(), "notifyFees", [_trader, realizedFee], nil) | |
1510 | 1531 | if ((notifyFee == notifyFee)) | |
1511 | 1532 | then { | |
1512 | 1533 | let notifyNotional = invoke(minerAddress(), "notifyNotional", [_trader, newPositionOpenNotional], nil) | |
1513 | 1534 | if ((notifyNotional == notifyNotional)) | |
1514 | 1535 | then (((((if (isPartialClose) | |
1515 | 1536 | then updatePosition(_trader, newPositionSize, newPositionMargin, newPositionOpenNotional, newPositionLstUpdCPF, lastTimestamp()) | |
1516 | 1537 | else deletePosition(_trader, _direction)) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter, totalLongOpenInterestAfter, totalShortOpenInterestAfter)) ++ (if ((marginToTrader > 0)) | |
1517 | 1538 | then withdraw(_traderAddress, marginToTrader) | |
1518 | 1539 | else nil)) ++ updateBalance(ammNewBalance)) ++ transferFee(feeToStakers)) | |
1519 | 1540 | else throw("Strict value is not equal to itself.") | |
1520 | 1541 | } | |
1521 | 1542 | else throw("Strict value is not equal to itself.") | |
1522 | 1543 | } | |
1523 | 1544 | else throw("Strict value is not equal to itself.") | |
1524 | 1545 | } | |
1525 | 1546 | else throw("Strict value is not equal to itself.") | |
1526 | 1547 | } | |
1527 | 1548 | else throw("Strict value is not equal to itself.") | |
1528 | 1549 | } | |
1529 | 1550 | } | |
1530 | 1551 | } | |
1531 | 1552 | else throw("Strict value is not equal to itself.") | |
1532 | 1553 | } | |
1533 | 1554 | else throw("Strict value is not equal to itself.") | |
1534 | 1555 | } | |
1535 | 1556 | else throw("Strict value is not equal to itself.") | |
1536 | 1557 | } | |
1537 | 1558 | ||
1538 | 1559 | ||
1539 | 1560 | ||
1540 | 1561 | @Callable(i) | |
1541 | 1562 | func liquidate (_trader,_direction,_priceUpdate) = { | |
1542 | 1563 | let updateOracle = invoke(this, "updateOracle", [_priceUpdate], nil) | |
1543 | 1564 | if ((updateOracle == updateOracle)) | |
1544 | 1565 | then { | |
1545 | 1566 | let sync = invoke(this, "syncTerminalPriceToOracle", nil, nil) | |
1546 | 1567 | if ((sync == sync)) | |
1547 | 1568 | then { | |
1548 | 1569 | let spotMarginRatio = getMarginRatioByOption(_trader, _direction, PNL_OPTION_SPOT) | |
1549 | 1570 | let liquidationMarginRatio = if (isOverFluctuationLimit()) | |
1550 | 1571 | then { | |
1551 | 1572 | let oracleMarginRatio = getMarginRatioByOption(_trader, _direction, PNL_OPTION_ORACLE) | |
1552 | 1573 | vmax(spotMarginRatio, oracleMarginRatio) | |
1553 | 1574 | } | |
1554 | 1575 | else spotMarginRatio | |
1555 | 1576 | if (if (if (if (if (!(requireMoreMarginRatio(liquidationMarginRatio, maintenanceMarginRatio(), false))) | |
1556 | 1577 | then true | |
1557 | 1578 | else !(requireOpenPosition(_trader, _direction))) | |
1558 | 1579 | then true | |
1559 | 1580 | else !(initialized())) | |
1560 | 1581 | then true | |
1561 | 1582 | else paused()) | |
1562 | 1583 | then true | |
1563 | 1584 | else isMarketClosed()) | |
1564 | 1585 | then throw("Unable to liquidate") | |
1565 | 1586 | else { | |
1566 | 1587 | let isPartialLiquidation = if (if ((spotMarginRatio > liquidationFeeRatio())) | |
1567 | 1588 | then (partialLiquidationRatio() > 0) | |
1568 | 1589 | else false) | |
1569 | 1590 | then (DECIMAL_UNIT > partialLiquidationRatio()) | |
1570 | 1591 | else false | |
1571 | 1592 | let oldPositionSize = getPosition(_trader, _direction)._1 | |
1572 | 1593 | let positionSizeAbs = abs(oldPositionSize) | |
1573 | - | let $ | |
1594 | + | let $t07464074963 = if (isPartialLiquidation) | |
1574 | 1595 | then { | |
1575 | 1596 | let liquidationSize = getPartialLiquidationAmount(_trader, oldPositionSize) | |
1576 | 1597 | let liquidationRatio = divd(abs(liquidationSize), positionSizeAbs) | |
1577 | 1598 | $Tuple2(liquidationRatio, abs(liquidationSize)) | |
1578 | 1599 | } | |
1579 | 1600 | else $Tuple2(0, positionSizeAbs) | |
1580 | - | let liquidationRatio = $ | |
1581 | - | let liquidationSize = $ | |
1582 | - | let $ | |
1601 | + | let liquidationRatio = $t07464074963._1 | |
1602 | + | let liquidationSize = $t07464074963._2 | |
1603 | + | let $t07496975625 = internalClosePosition(_trader, _direction, if (isPartialLiquidation) | |
1583 | 1604 | then liquidationSize | |
1584 | 1605 | else positionSizeAbs, liquidationFeeRatio(), 0, true, false, true) | |
1585 | - | let newPositionSize = $ | |
1586 | - | let newPositionMargin = $ | |
1587 | - | let newPositionOpenNotional = $ | |
1588 | - | let newPositionLstUpdCPF = $ | |
1589 | - | let positionBadDebt = $ | |
1590 | - | let realizedPnl = $ | |
1591 | - | let marginToTrader = $ | |
1592 | - | let quoteAssetReserveAfter = $ | |
1593 | - | let baseAssetReserveAfter = $ | |
1594 | - | let totalPositionSizeAfter = $ | |
1595 | - | let openInterestNotionalAfter = $ | |
1596 | - | let totalLongAfter = $ | |
1597 | - | let totalShortAfter = $ | |
1598 | - | let totalLongOpenInterestAfter = $ | |
1599 | - | let totalShortOpenInterestAfter = $ | |
1600 | - | let liquidationPenalty = $ | |
1606 | + | let newPositionSize = $t07496975625._1 | |
1607 | + | let newPositionMargin = $t07496975625._2 | |
1608 | + | let newPositionOpenNotional = $t07496975625._3 | |
1609 | + | let newPositionLstUpdCPF = $t07496975625._4 | |
1610 | + | let positionBadDebt = $t07496975625._5 | |
1611 | + | let realizedPnl = $t07496975625._6 | |
1612 | + | let marginToTrader = $t07496975625._7 | |
1613 | + | let quoteAssetReserveAfter = $t07496975625._8 | |
1614 | + | let baseAssetReserveAfter = $t07496975625._9 | |
1615 | + | let totalPositionSizeAfter = $t07496975625._10 | |
1616 | + | let openInterestNotionalAfter = $t07496975625._11 | |
1617 | + | let totalLongAfter = $t07496975625._12 | |
1618 | + | let totalShortAfter = $t07496975625._13 | |
1619 | + | let totalLongOpenInterestAfter = $t07496975625._14 | |
1620 | + | let totalShortOpenInterestAfter = $t07496975625._15 | |
1621 | + | let liquidationPenalty = $t07496975625._16 | |
1601 | 1622 | let feeToLiquidator = (liquidationPenalty / 2) | |
1602 | 1623 | let feeToVault = (liquidationPenalty - feeToLiquidator) | |
1603 | 1624 | let ammBalance = (cbalance() - liquidationPenalty) | |
1604 | 1625 | let newAmmBalance = if ((0 > ammBalance)) | |
1605 | 1626 | then 0 | |
1606 | 1627 | else ammBalance | |
1607 | 1628 | let lockBadDebt = if ((positionBadDebt > 0)) | |
1608 | 1629 | then { | |
1609 | 1630 | let lockBadDebt = invoke(vaultAddress(), "exchangeFreeAndLocked", [(positionBadDebt + liquidationPenalty)], nil) | |
1610 | 1631 | if ((lockBadDebt == lockBadDebt)) | |
1611 | 1632 | then nil | |
1612 | 1633 | else throw("Strict value is not equal to itself.") | |
1613 | 1634 | } | |
1614 | 1635 | else nil | |
1615 | 1636 | if ((lockBadDebt == lockBadDebt)) | |
1616 | 1637 | then { | |
1617 | 1638 | let unstake = invoke(vaultAddress(), "withdrawLocked", [liquidationPenalty], nil) | |
1618 | 1639 | if ((unstake == unstake)) | |
1619 | 1640 | then { | |
1620 | 1641 | let depositInsurance = invoke(vaultAddress(), "addFree", nil, [AttachedPayment(quoteAsset(), feeToVault)]) | |
1621 | 1642 | if ((depositInsurance == depositInsurance)) | |
1622 | 1643 | then { | |
1623 | 1644 | let notifyNotional = invoke(minerAddress(), "notifyNotional", [_trader, newPositionOpenNotional], nil) | |
1624 | 1645 | if ((notifyNotional == notifyNotional)) | |
1625 | 1646 | then ((((if (isPartialLiquidation) | |
1626 | 1647 | then updatePosition(_trader, newPositionSize, newPositionMargin, newPositionOpenNotional, newPositionLstUpdCPF, lastTimestamp()) | |
1627 | 1648 | else deletePosition(_trader, _direction)) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter, totalLongOpenInterestAfter, totalShortOpenInterestAfter)) ++ withdraw(i.caller, feeToLiquidator)) ++ updateBalance(newAmmBalance)) | |
1628 | 1649 | else throw("Strict value is not equal to itself.") | |
1629 | 1650 | } | |
1630 | 1651 | else throw("Strict value is not equal to itself.") | |
1631 | 1652 | } | |
1632 | 1653 | else throw("Strict value is not equal to itself.") | |
1633 | 1654 | } | |
1634 | 1655 | else throw("Strict value is not equal to itself.") | |
1635 | 1656 | } | |
1636 | 1657 | } | |
1637 | 1658 | else throw("Strict value is not equal to itself.") | |
1638 | 1659 | } | |
1639 | 1660 | else throw("Strict value is not equal to itself.") | |
1640 | 1661 | } | |
1641 | 1662 | ||
1642 | 1663 | ||
1643 | 1664 | ||
1644 | 1665 | @Callable(i) | |
1645 | 1666 | func payFunding (_priceUpdate) = { | |
1646 | 1667 | let updateOracle = invoke(this, "updateOracle", [_priceUpdate], nil) | |
1647 | 1668 | if ((updateOracle == updateOracle)) | |
1648 | 1669 | then { | |
1649 | 1670 | let sync = invoke(this, "syncTerminalPriceToOracle", nil, nil) | |
1650 | 1671 | if ((sync == sync)) | |
1651 | 1672 | then { | |
1652 | 1673 | let fundingBlockTimestamp = nextFundingBlockTimestamp() | |
1653 | 1674 | if (if (if ((fundingBlockTimestamp > lastTimestamp())) | |
1654 | 1675 | then true | |
1655 | 1676 | else !(initialized())) | |
1656 | 1677 | then true | |
1657 | 1678 | else paused()) | |
1658 | 1679 | then throw(((("Invalid funding block timestamp: " + toString(lastTimestamp())) + " < ") + toString(fundingBlockTimestamp))) | |
1659 | 1680 | else { | |
1660 | 1681 | let underlyingPrice = getOraclePrice() | |
1661 | - | let $ | |
1662 | - | let shortPremiumFraction = $ | |
1663 | - | let longPremiumFraction = $ | |
1664 | - | let premiumToVault = $ | |
1682 | + | let $t07784377921 = getFunding() | |
1683 | + | let shortPremiumFraction = $t07784377921._1 | |
1684 | + | let longPremiumFraction = $t07784377921._2 | |
1685 | + | let premiumToVault = $t07784377921._3 | |
1665 | 1686 | let doPayFundingToVault = if ((premiumToVault > 0)) | |
1666 | 1687 | then { | |
1667 | 1688 | let doPayFundingToVault = invoke(vaultAddress(), "exchangeFreeAndLocked", [-(premiumToVault)], nil) | |
1668 | 1689 | if ((doPayFundingToVault == doPayFundingToVault)) | |
1669 | 1690 | then nil | |
1670 | 1691 | else throw("Strict value is not equal to itself.") | |
1671 | 1692 | } | |
1672 | 1693 | else nil | |
1673 | 1694 | if ((doPayFundingToVault == doPayFundingToVault)) | |
1674 | 1695 | then updateFunding((fundingBlockTimestamp + fundingPeriodSeconds()), (latestLongCumulativePremiumFraction() + longPremiumFraction), (latestShortCumulativePremiumFraction() + shortPremiumFraction), divd(longPremiumFraction, underlyingPrice), divd(shortPremiumFraction, underlyingPrice)) | |
1675 | 1696 | else throw("Strict value is not equal to itself.") | |
1676 | 1697 | } | |
1677 | 1698 | } | |
1678 | 1699 | else throw("Strict value is not equal to itself.") | |
1679 | 1700 | } | |
1680 | 1701 | else throw("Strict value is not equal to itself.") | |
1681 | 1702 | } | |
1682 | 1703 | ||
1683 | 1704 | ||
1684 | 1705 | ||
1685 | 1706 | @Callable(i) | |
1686 | 1707 | func updateOracle (_priceUpdate) = if ((oracleMode() == ORACLE_PLAIN)) | |
1687 | 1708 | then nil | |
1688 | 1709 | else { | |
1689 | 1710 | let priceUpdates = split_4C(_priceUpdate, "::") | |
1690 | 1711 | let baseOracle = valueOrErrorMessage(getOracleData(k_baseOracle), "No base asset oracle data") | |
1691 | 1712 | let baseOracleAddress = baseOracle._1 | |
1692 | 1713 | let doUpdateBaseOracle = invoke(baseOracleAddress, "updateData", [priceUpdates[0]], nil) | |
1693 | 1714 | if ((doUpdateBaseOracle == doUpdateBaseOracle)) | |
1694 | 1715 | then { | |
1695 | 1716 | let quoteOracle = getOracleData(k_quoteOracle) | |
1696 | 1717 | let doUpdateQuoteOracle = if (isDefined(quoteOracle)) | |
1697 | 1718 | then { | |
1698 | 1719 | let quoteOracleV = value(quoteOracle) | |
1699 | 1720 | let quoteOracleAddress = quoteOracleV._1 | |
1700 | 1721 | let doUpdateQuoteOracle = invoke(quoteOracleAddress, "updateData", [priceUpdates[1]], nil) | |
1701 | 1722 | if ((doUpdateQuoteOracle == doUpdateQuoteOracle)) | |
1702 | 1723 | then nil | |
1703 | 1724 | else throw("Strict value is not equal to itself.") | |
1704 | 1725 | } | |
1705 | 1726 | else nil | |
1706 | 1727 | if ((doUpdateQuoteOracle == doUpdateQuoteOracle)) | |
1707 | 1728 | then nil | |
1708 | 1729 | else throw("Strict value is not equal to itself.") | |
1709 | 1730 | } | |
1710 | 1731 | else throw("Strict value is not equal to itself.") | |
1711 | 1732 | } | |
1712 | 1733 | ||
1713 | 1734 | ||
1714 | 1735 | ||
1715 | 1736 | @Callable(i) | |
1716 | 1737 | func syncTerminalPriceToOracle () = { | |
1717 | 1738 | let _qtAstR = qtAstR() | |
1718 | 1739 | let _bsAstR = bsAstR() | |
1719 | - | let $ | |
1720 | - | let newQuoteAssetWeight = $ | |
1721 | - | let newBaseAssetWeight = $ | |
1722 | - | let marginToVault = $ | |
1740 | + | let $t07974480110 = getSyncTerminalPrice(getOraclePrice(), _qtAstR, _bsAstR) | |
1741 | + | let newQuoteAssetWeight = $t07974480110._1 | |
1742 | + | let newBaseAssetWeight = $t07974480110._2 | |
1743 | + | let marginToVault = $t07974480110._3 | |
1723 | 1744 | let marginToVaultAdj = if (if ((0 > marginToVault)) | |
1724 | 1745 | then (abs(marginToVault) > cbalance()) | |
1725 | 1746 | else false) | |
1726 | 1747 | then -(cbalance()) | |
1727 | 1748 | else marginToVault | |
1728 | 1749 | let doExchangePnL = if ((marginToVaultAdj != 0)) | |
1729 | 1750 | then { | |
1730 | 1751 | let doExchangePnL = invoke(vaultAddress(), "exchangeFreeAndLocked", [marginToVaultAdj], nil) | |
1731 | 1752 | if ((doExchangePnL == doExchangePnL)) | |
1732 | 1753 | then nil | |
1733 | 1754 | else throw("Strict value is not equal to itself.") | |
1734 | 1755 | } | |
1735 | 1756 | else nil | |
1736 | 1757 | if ((doExchangePnL == doExchangePnL)) | |
1737 | 1758 | then (updateBalance((cbalance() + marginToVaultAdj)) ++ updateAmmWeights(newQuoteAssetWeight, newBaseAssetWeight)) | |
1738 | 1759 | else throw("Strict value is not equal to itself.") | |
1739 | 1760 | } | |
1740 | 1761 | ||
1741 | 1762 | ||
1742 | 1763 | ||
1743 | 1764 | @Callable(i) | |
1744 | 1765 | func ensureCalledOnce () = if ((i.caller != this)) | |
1745 | 1766 | then throw("Invalid saveCurrentTxId parameters") | |
1746 | 1767 | else { | |
1747 | 1768 | let txId = toBase58String(i.transactionId) | |
1748 | 1769 | let lastTx = valueOrElse(getString(this, k_lastTx), "") | |
1749 | 1770 | if ((lastTx != txId)) | |
1750 | 1771 | then [StringEntry(k_lastTx, txId)] | |
1751 | 1772 | else throw("Can not call vAMM methods twice in one tx") | |
1752 | 1773 | } | |
1753 | 1774 | ||
1754 | 1775 | ||
1755 | 1776 | ||
1756 | 1777 | @Callable(i) | |
1757 | 1778 | func migratePosition (_trader) = { | |
1758 | 1779 | let positionSizeOpt = getInteger(this, toCompositeKey(k_positionSize, _trader)) | |
1759 | 1780 | if (if (isDefined(positionSizeOpt)) | |
1760 | 1781 | then isDefined(addressFromString(_trader)) | |
1761 | 1782 | else false) | |
1762 | 1783 | then { | |
1763 | 1784 | let pSize = getIntegerValue(this, toCompositeKey(k_positionSize, _trader)) | |
1764 | 1785 | let pMargin = getIntegerValue(this, toCompositeKey(k_positionMargin, _trader)) | |
1765 | 1786 | let pNotional = getIntegerValue(this, toCompositeKey(k_positionOpenNotional, _trader)) | |
1766 | 1787 | let pFraction = getIntegerValue(this, toCompositeKey(k_positionLastUpdatedCumulativePremiumFraction, _trader)) | |
1767 | 1788 | let pTimestamp = valueOrElse(getInteger(this, toCompositeKey(k_positionLastUpdatedTimestamp, _trader)), lastBlock.timestamp) | |
1768 | 1789 | let pFee = valueOrElse(getInteger(this, toCompositeKey(k_positionFee, _trader)), fee()) | |
1769 | 1790 | let pSequence = getIntegerValue(this, toCompositeKey(k_positionSequence, _trader)) | |
1770 | 1791 | let pDirection = getDirection(pSize) | |
1771 | 1792 | let positionKey = ((_trader + "_") + toString(pDirection)) | |
1772 | 1793 | [DeleteEntry(toCompositeKey(k_positionSize, _trader)), DeleteEntry(toCompositeKey(k_positionMargin, _trader)), DeleteEntry(toCompositeKey(k_positionOpenNotional, _trader)), DeleteEntry(toCompositeKey(k_positionLastUpdatedCumulativePremiumFraction, _trader)), DeleteEntry(toCompositeKey(k_positionLastUpdatedTimestamp, _trader)), DeleteEntry(toCompositeKey(k_positionFee, _trader)), DeleteEntry(toCompositeKey(k_positionSequence, _trader)), IntegerEntry(toCompositeKey(k_positionSize, positionKey), pSize), IntegerEntry(toCompositeKey(k_positionMargin, positionKey), pMargin), IntegerEntry(toCompositeKey(k_positionOpenNotional, positionKey), pNotional), IntegerEntry(toCompositeKey(k_positionLastUpdatedCumulativePremiumFraction, positionKey), pFraction), IntegerEntry(toCompositeKey(k_positionLastUpdatedTimestamp, positionKey), pTimestamp), IntegerEntry(toCompositeKey(k_positionFee, positionKey), pFee), IntegerEntry(toCompositeKey(k_positionSequence, positionKey), pSequence)] | |
1773 | 1794 | } | |
1774 | 1795 | else throw(("Nothing to migrate for " + _trader)) | |
1775 | 1796 | } | |
1776 | 1797 | ||
1777 | 1798 | ||
1778 | 1799 | ||
1779 | 1800 | @Callable(i) | |
1780 | 1801 | func view_calcRemainMarginWithFundingPayment (_trader,_direction,_priceUpdate) = { | |
1781 | 1802 | let updateOracle = invoke(this, "updateOracle", [_priceUpdate], nil) | |
1782 | 1803 | if ((updateOracle == updateOracle)) | |
1783 | 1804 | then { | |
1784 | 1805 | let sync = invoke(this, "syncTerminalPriceToOracle", nil, nil) | |
1785 | 1806 | if ((sync == sync)) | |
1786 | 1807 | then { | |
1787 | - | let $ | |
1788 | - | let positionSize = $ | |
1789 | - | let positionMargin = $ | |
1790 | - | let pon = $ | |
1791 | - | let positionLstUpdCPF = $ | |
1792 | - | let positionTimestamp = $ | |
1793 | - | let $ | |
1794 | - | let positionNotional = $ | |
1795 | - | let unrealizedPnl = $ | |
1796 | - | let $ | |
1797 | - | let remainMargin = $ | |
1798 | - | let badDebt = $ | |
1799 | - | let fundingPayment = $ | |
1800 | - | let rolloverFee = $ | |
1808 | + | let $t08390484040 = getPosition(_trader, _direction) | |
1809 | + | let positionSize = $t08390484040._1 | |
1810 | + | let positionMargin = $t08390484040._2 | |
1811 | + | let pon = $t08390484040._3 | |
1812 | + | let positionLstUpdCPF = $t08390484040._4 | |
1813 | + | let positionTimestamp = $t08390484040._5 | |
1814 | + | let $t08404384156 = getPositionNotionalAndUnrealizedPnl(_trader, _direction, PNL_OPTION_SPOT) | |
1815 | + | let positionNotional = $t08404384156._1 | |
1816 | + | let unrealizedPnl = $t08404384156._2 | |
1817 | + | let $t08415984383 = calcRemainMarginWithFundingPaymentAndRolloverFee(positionSize, positionMargin, positionLstUpdCPF, positionTimestamp, unrealizedPnl) | |
1818 | + | let remainMargin = $t08415984383._1 | |
1819 | + | let badDebt = $t08415984383._2 | |
1820 | + | let fundingPayment = $t08415984383._3 | |
1821 | + | let rolloverFee = $t08415984383._4 | |
1801 | 1822 | throw(((((((s(remainMargin) + s(fundingPayment)) + s(getMarginRatio(_trader, _direction))) + s(unrealizedPnl)) + s(badDebt)) + s(positionNotional)) + s(rolloverFee))) | |
1802 | 1823 | } | |
1803 | 1824 | else throw("Strict value is not equal to itself.") | |
1804 | 1825 | } | |
1805 | 1826 | else throw("Strict value is not equal to itself.") | |
1806 | 1827 | } | |
1807 | 1828 | ||
1808 | 1829 | ||
1809 | 1830 | ||
1810 | 1831 | @Callable(i) | |
1811 | 1832 | func view_getPegAdjustCost (_price) = { | |
1812 | 1833 | let _qtAstR = qtAstR() | |
1813 | 1834 | let _bsAstR = bsAstR() | |
1814 | 1835 | let result = getSyncTerminalPrice(_price, _qtAstR, _bsAstR) | |
1815 | 1836 | throw(toString(result._3)) | |
1816 | 1837 | } | |
1817 | 1838 | ||
1818 | 1839 | ||
1819 | 1840 | ||
1820 | 1841 | @Callable(i) | |
1821 | 1842 | func view_getTerminalAmmPrice () = { | |
1822 | - | let $ | |
1823 | - | let terminalQuoteAssetReserve = $ | |
1824 | - | let terminalBaseAssetReserve = $ | |
1843 | + | let $t08511885199 = getTerminalAmmState() | |
1844 | + | let terminalQuoteAssetReserve = $t08511885199._1 | |
1845 | + | let terminalBaseAssetReserve = $t08511885199._2 | |
1825 | 1846 | let price = divd(muld(terminalQuoteAssetReserve, qtAstW()), muld(terminalBaseAssetReserve, bsAstW())) | |
1826 | 1847 | throw(toString(price)) | |
1827 | 1848 | } | |
1828 | 1849 | ||
1829 | 1850 | ||
1830 | 1851 | ||
1831 | 1852 | @Callable(i) | |
1832 | 1853 | func view_getFunding (_priceUpdate) = { | |
1833 | 1854 | let updateOracle = invoke(this, "updateOracle", [_priceUpdate], nil) | |
1834 | 1855 | if ((updateOracle == updateOracle)) | |
1835 | 1856 | then { | |
1836 | 1857 | let sync = invoke(this, "syncTerminalPriceToOracle", nil, nil) | |
1837 | 1858 | if ((sync == sync)) | |
1838 | 1859 | then { | |
1839 | 1860 | let underlyingPrice = getOraclePrice() | |
1840 | - | let $ | |
1841 | - | let shortPremiumFraction = $ | |
1842 | - | let longPremiumFraction = $ | |
1843 | - | let premiumToVault = $ | |
1861 | + | let $t08585185929 = getFunding() | |
1862 | + | let shortPremiumFraction = $t08585185929._1 | |
1863 | + | let longPremiumFraction = $t08585185929._2 | |
1864 | + | let premiumToVault = $t08585185929._3 | |
1844 | 1865 | let longFunding = divd(longPremiumFraction, underlyingPrice) | |
1845 | 1866 | let shortFunding = divd(shortPremiumFraction, underlyingPrice) | |
1846 | 1867 | throw(((((s(longFunding) + s(shortFunding)) + s(getSpotPrice())) + s(getOraclePrice())) + s(premiumToVault))) | |
1847 | 1868 | } | |
1848 | 1869 | else throw("Strict value is not equal to itself.") | |
1849 | 1870 | } | |
1850 | 1871 | else throw("Strict value is not equal to itself.") | |
1851 | 1872 | } | |
1852 | 1873 | ||
1853 | 1874 | ||
1854 | 1875 | ||
1855 | 1876 | @Callable(i) | |
1856 | 1877 | func computeSpotPrice () = { | |
1857 | 1878 | let sync = invoke(this, "syncTerminalPriceToOracle", nil, nil) | |
1858 | 1879 | if ((sync == sync)) | |
1859 | 1880 | then { | |
1860 | 1881 | let result = getSpotPrice() | |
1861 | 1882 | $Tuple2(nil, result) | |
1862 | 1883 | } | |
1863 | 1884 | else throw("Strict value is not equal to itself.") | |
1864 | 1885 | } | |
1865 | 1886 | ||
1866 | 1887 | ||
1867 | 1888 | ||
1868 | 1889 | @Callable(i) | |
1869 | 1890 | func computeFeeForTraderWithArtifact (_trader,_artifactId) = { | |
1870 | 1891 | let result = getForTraderWithArtifact(_trader, _artifactId) | |
1871 | 1892 | $Tuple2(nil, result) | |
1872 | 1893 | } | |
1873 | 1894 | ||
1874 | 1895 | ||
1875 | 1896 | @Verifier(tx) | |
1876 | 1897 | func verify () = { | |
1877 | 1898 | let coordinatorStr = getString(this, k_coordinatorAddress) | |
1878 | 1899 | if (isDefined(coordinatorStr)) | |
1879 | 1900 | then { | |
1880 | 1901 | let admin = getString(addressFromStringValue(value(coordinatorStr)), k_admin_address) | |
1881 | 1902 | if (isDefined(admin)) | |
1882 | 1903 | then valueOrElse(getBoolean(addressFromStringValue(value(admin)), ((("status_" + toString(this)) + "_") + toBase58String(tx.id))), false) | |
1883 | 1904 | else throw("unable to verify: admin not set in coordinator") | |
1884 | 1905 | } | |
1885 | 1906 | else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
1886 | 1907 | } | |
1887 | 1908 |
github/deemru/w8io/026f985 307.82 ms ◑