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