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