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