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