tx · 6BN3B5soyB5SvJajNnN1eSMdckF5Pqo7QJRZss3rWDdw

3MxWJGTCWgdocKWm6HtaMmPK9XtQGq2Mvth:  -0.07500000 Waves

2023.07.04 16:58 [2651247] smart account 3MxWJGTCWgdocKWm6HtaMmPK9XtQGq2Mvth > SELF 0.00000000 Waves

{ "type": 13, "id": "6BN3B5soyB5SvJajNnN1eSMdckF5Pqo7QJRZss3rWDdw", "fee": 7500000, "feeAssetId": null, "timestamp": 1688479121990, "version": 2, "chainId": 84, "sender": "3MxWJGTCWgdocKWm6HtaMmPK9XtQGq2Mvth", "senderPublicKey": "5NE1ZN16YK71DG5UJPwBwA7VxbPzgup2NwEDd6duMfkQ", "proofs": [ "pVW4XTBvpV4qFh3tvc1tmqNrbKD9ZQ3pEfQaLPx556vTqQY7c7yjYACGeGhJGPGoVZUrBRa84QneneNwqXqQHDt" ], "script": "base64:BgKUAQgCEgASABIAEgASAwoBARIVChMBAQEBAQEBAQEBAQEBAQEICAEBEhgKFgEBAQEBAQEICAgBAQEBAQEBAQEBAQESBwoFAQEBCAgSBAoCAQgSBQoDAQEIEgcKBQEBAQQIEgUKAwgBCBIDCgEIEgMKAQgSABIAEgMKAQgSBQoDCAEIEgMKAQESABIDCgEIEgASBAoCCAi9AQAMa19iYXNlT3JhY2xlAgxrX2Jhc2VPcmFjbGUADWtfcXVvdGVPcmFjbGUCDWtfcXVvdGVPcmFjbGUACWtfYmFsYW5jZQIJa19iYWxhbmNlAAprX3NlcXVlbmNlAgprX3NlcXVlbmNlAA5rX3Bvc2l0aW9uU2l6ZQIOa19wb3NpdGlvblNpemUAEGtfcG9zaXRpb25NYXJnaW4CEGtfcG9zaXRpb25NYXJnaW4AFmtfcG9zaXRpb25PcGVuTm90aW9uYWwCFmtfcG9zaXRpb25PcGVuTm90aW9uYWwALmtfcG9zaXRpb25MYXN0VXBkYXRlZEN1bXVsYXRpdmVQcmVtaXVtRnJhY3Rpb24CEmtfcG9zaXRpb25GcmFjdGlvbgASa19wb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dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tleeHuyL4=", "height": 2651247, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 87mY3CH1ceWuhcGGKMtPEKvSXcNfRctj5dWnjrtEBTHx Next: CjfLqxRcmhQWcrtrSMArhBPkdMe6XuxsXbfzs9XzR9vR Diff:
OldNewDifferences
3737
3838 let k_initMarginRatio = "k_initMarginRatio"
3939
40+let k_minInitMarginRatio = "k_minInitMarginRatio"
41+
4042 let k_maintenanceMarginRatio = "k_mmr"
4143
4244 let k_liquidationFeeRatio = "k_liquidationFeeRatio"
5860 let k_fundingMode = "k_fundingMode"
5961
6062 let k_oracleMode = "k_oracleMode"
63+
64+let k_positionMode = "k_positionMode"
6165
6266 let k_latestLongCumulativePremiumFraction = "k_latestLongPremiumFraction"
6367
171175
172176 let ORACLE_JIT = 2
173177
178+let POSITION_DIRECT = 1
179+
180+let POSITION_ORDER = 2
181+
174182 func s (_x) = (toString(_x) + ",")
175183
176184
227235
228236
229237 func initMarginRatio () = int(k_initMarginRatio)
238+
239+
240+func minInitMarginRatio () = intOr(k_minInitMarginRatio, DECIMAL_UNIT)
230241
231242
232243 func qtAstR () = int(k_quoteAssetReserve)
317328
318329
319330 func oracleMode () = intOr(k_oracleMode, ORACLE_PLAIN)
331+
332+
333+func positionMode () = intOr(k_positionMode, POSITION_DIRECT)
320334
321335
322336 func lastTimestamp () = lastBlock.timestamp
443457 let amountBaseAssetBought = if (_isAdd)
444458 then amountBaseAssetBoughtAbs
445459 else -(amountBaseAssetBoughtAbs)
446- let $t01592616096 = updateReserve(_isAdd, quoteAssetAmountAdjusted, amountBaseAssetBoughtAbs)
447- let quoteAssetReserveAfter1 = $t01592616096._1
448- let baseAssetReserveAfter1 = $t01592616096._2
449- let totalPositionSizeAfter1 = $t01592616096._3
460+ let $t01636716537 = updateReserve(_isAdd, quoteAssetAmountAdjusted, amountBaseAssetBoughtAbs)
461+ let quoteAssetReserveAfter1 = $t01636716537._1
462+ let baseAssetReserveAfter1 = $t01636716537._2
463+ let totalPositionSizeAfter1 = $t01636716537._3
450464 let priceBefore = divd(muld(_qtAstR, _qtAstW), muld(_bsAstR, _bsAstW))
451465 let marketPrice = divd(_quoteAssetAmount, amountBaseAssetBoughtAbs)
452466 let priceDiff = abs((priceBefore - marketPrice))
474488 else 0
475489 let rolloverFee = calcRolloverFee(_oldPositionMargin, _oldPositionLastUpdatedTimestamp)
476490 let signedMargin = (((_marginDelta - rolloverFee) - fundingPayment) + _oldPositionMargin)
477- let $t01876318890 = if ((0 > signedMargin))
491+ let $t01920419331 = if ((0 > signedMargin))
478492 then $Tuple2(0, abs(signedMargin))
479493 else $Tuple2(abs(signedMargin), 0)
480- let remainMargin = $t01876318890._1
481- let badDebt = $t01876318890._2
494+ let remainMargin = $t01920419331._1
495+ let badDebt = $t01920419331._2
482496 $Tuple4(remainMargin, badDebt, fundingPayment, rolloverFee)
483497 }
484498
496510 let quoteAssetDelta = abs((quoteAssetAfter - _quoteAssetReserve))
497511 let quoteAssetSold = muld(quoteAssetDelta, _quoteAssetWeight)
498512 let maxPriceImpactValue = maxPriceImpact()
499- let $t02015220314 = updateReserve(!(_isAdd), quoteAssetDelta, _baseAssetAmount)
500- let quoteAssetReserveAfter1 = $t02015220314._1
501- let baseAssetReserveAfter1 = $t02015220314._2
502- let totalPositionSizeAfter1 = $t02015220314._3
513+ let $t02059320755 = updateReserve(!(_isAdd), quoteAssetDelta, _baseAssetAmount)
514+ let quoteAssetReserveAfter1 = $t02059320755._1
515+ let baseAssetReserveAfter1 = $t02059320755._2
516+ let totalPositionSizeAfter1 = $t02059320755._3
503517 let marketPrice = divd(quoteAssetSold, _baseAssetAmount)
504518 let priceDiff = abs((priceBefore - marketPrice))
505519 let priceImpact = (DECIMAL_UNIT - divd(priceBefore, (priceBefore + priceDiff)))
592606 }
593607
594608
609+func requireSenderCanWorkWithPositions (_caller) = if ((positionMode() == POSITION_ORDER))
610+ then (_caller == ordersAddress())
611+ else true
612+
613+
595614 func getSpotPrice () = {
596615 let _quoteAssetReserve = qtAstR()
597616 let _baseAssetReserve = bsAstR()
634653
635654
636655 func getPositionNotionalAndUnrealizedPnl (_trader,_direction,_option) = {
637- let $t02819928339 = getPosition(_trader, _direction)
638- let positionSize = $t02819928339._1
639- let positionMargin = $t02819928339._2
640- let positionOpenNotional = $t02819928339._3
641- let positionLstUpdCPF = $t02819928339._4
656+ let $t02889629036 = getPosition(_trader, _direction)
657+ let positionSize = $t02889629036._1
658+ let positionMargin = $t02889629036._2
659+ let positionOpenNotional = $t02889629036._3
660+ let positionLstUpdCPF = $t02889629036._4
642661 getPositionNotionalAndUnrealizedPnlByValues(positionSize, positionOpenNotional, qtAstR(), qtAstW(), bsAstR(), bsAstW(), _option)
643662 }
644663
647666
648667
649668 func getMarginRatioByOption (_trader,_direction,_option) = {
650- let $t02887129024 = getPosition(_trader, _direction)
651- let positionSize = $t02887129024._1
652- let positionMargin = $t02887129024._2
653- let pon = $t02887129024._3
654- let positionLastUpdatedCPF = $t02887129024._4
655- let positionTimestamp = $t02887129024._5
656- let $t02903029135 = getPositionNotionalAndUnrealizedPnl(_trader, _direction, _option)
657- let positionNotional = $t02903029135._1
658- let unrealizedPnl = $t02903029135._2
659- let $t02914029352 = calcRemainMarginWithFundingPaymentAndRolloverFee(positionSize, positionMargin, positionLastUpdatedCPF, positionTimestamp, unrealizedPnl)
660- let remainMargin = $t02914029352._1
661- let badDebt = $t02914029352._2
669+ let $t02956829721 = getPosition(_trader, _direction)
670+ let positionSize = $t02956829721._1
671+ let positionMargin = $t02956829721._2
672+ let pon = $t02956829721._3
673+ let positionLastUpdatedCPF = $t02956829721._4
674+ let positionTimestamp = $t02956829721._5
675+ let $t02972729832 = getPositionNotionalAndUnrealizedPnl(_trader, _direction, _option)
676+ let positionNotional = $t02972729832._1
677+ let unrealizedPnl = $t02972729832._2
678+ let $t02983730049 = calcRemainMarginWithFundingPaymentAndRolloverFee(positionSize, positionMargin, positionLastUpdatedCPF, positionTimestamp, unrealizedPnl)
679+ let remainMargin = $t02983730049._1
680+ let badDebt = $t02983730049._2
662681 calcMarginRatio(remainMargin, badDebt, positionNotional)
663682 }
664683
679698
680699
681700 func internalClosePosition (_trader,_direction,_size,_fee,_minQuoteAssetAmount,_addToMargin,_checkMaxPriceImpact,_liquidate) = {
682- let $t03051530683 = getPosition(_trader, _direction)
683- let oldPositionSize = $t03051530683._1
684- let oldPositionMargin = $t03051530683._2
685- let oldPositionOpenNotional = $t03051530683._3
686- let oldPositionLstUpdCPF = $t03051530683._4
687- let oldPositionTimestamp = $t03051530683._5
701+ let $t03121231380 = getPosition(_trader, _direction)
702+ let oldPositionSize = $t03121231380._1
703+ let oldPositionMargin = $t03121231380._2
704+ let oldPositionOpenNotional = $t03121231380._3
705+ let oldPositionLstUpdCPF = $t03121231380._4
706+ let oldPositionTimestamp = $t03121231380._5
688707 let isLongPosition = (oldPositionSize > 0)
689708 let absOldPositionSize = abs(oldPositionSize)
690709 if (if ((absOldPositionSize >= _size))
692711 else false)
693712 then {
694713 let isPartialClose = (absOldPositionSize > _size)
695- let $t03097531426 = swapOutput((oldPositionSize > 0), _size, _checkMaxPriceImpact)
696- let exchangedQuoteAssetAmount = $t03097531426._1
697- let quoteAssetReserveAfter = $t03097531426._2
698- let baseAssetReserveAfter = $t03097531426._3
699- let totalPositionSizeAfter = $t03097531426._4
714+ let $t03167232123 = swapOutput((oldPositionSize > 0), _size, _checkMaxPriceImpact)
715+ let exchangedQuoteAssetAmount = $t03167232123._1
716+ let quoteAssetReserveAfter = $t03167232123._2
717+ let baseAssetReserveAfter = $t03167232123._3
718+ let totalPositionSizeAfter = $t03167232123._4
700719 let exchangedPositionSize = if ((oldPositionSize > 0))
701720 then -(_size)
702721 else _size
703- let $t03164131865 = getPositionNotionalAndUnrealizedPnl(_trader, _direction, PNL_OPTION_SPOT)
704- let oldPositionNotional = $t03164131865._1
705- let unrealizedPnl = $t03164131865._2
722+ let $t03233832562 = getPositionNotionalAndUnrealizedPnl(_trader, _direction, PNL_OPTION_SPOT)
723+ let oldPositionNotional = $t03233832562._1
724+ let unrealizedPnl = $t03233832562._2
706725 let realizedRatio = divd(abs(exchangedPositionSize), absOldPositionSize)
707726 let realizedPnl = muld(unrealizedPnl, realizedRatio)
708- let $t03220632452 = calcRemainMarginWithFundingPaymentAndRolloverFee(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, oldPositionTimestamp, unrealizedPnl)
709- let remainMarginBefore = $t03220632452._1
710- let x1 = $t03220632452._2
711- let x2 = $t03220632452._3
712- let rolloverFee = $t03220632452._4
727+ let $t03290333149 = calcRemainMarginWithFundingPaymentAndRolloverFee(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, oldPositionTimestamp, unrealizedPnl)
728+ let remainMarginBefore = $t03290333149._1
729+ let x1 = $t03290333149._2
730+ let x2 = $t03290333149._3
731+ let rolloverFee = $t03290333149._4
713732 let positionBadDebt = calcRemainMarginWithFundingPaymentAndRolloverFee(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, oldPositionTimestamp, realizedPnl)._2
714733 let realizedCloseFee = muld(muld(oldPositionNotional, realizedRatio), _fee)
715734 let unrealizedPnlAfter = (unrealizedPnl - realizedPnl)
717736 then ((oldPositionNotional - exchangedQuoteAssetAmount) - unrealizedPnlAfter)
718737 else ((unrealizedPnlAfter + oldPositionNotional) - exchangedQuoteAssetAmount)
719738 let newPositionSize = (oldPositionSize + exchangedPositionSize)
720- let $t03385834244 = if ((newPositionSize == 0))
739+ let $t03455534941 = if ((newPositionSize == 0))
721740 then $Tuple2(0, 0)
722741 else $Tuple2(abs(remainOpenNotional), latestCumulativePremiumFraction(newPositionSize))
723- let newPositionOpenNotional = $t03385834244._1
724- let newPositionLstUpdCPF = $t03385834244._2
742+ let newPositionOpenNotional = $t03455534941._1
743+ let newPositionLstUpdCPF = $t03455534941._2
725744 let openNotionalDelta = (oldPositionOpenNotional - newPositionOpenNotional)
726745 let marginRatio = getMarginRatioByOption(_trader, _direction, PNL_OPTION_SPOT)
727746 let newPositionMarginWithSameRatio = if ((oldPositionSize > 0))
764783 then $Tuple2(qtAstR(), bsAstR())
765784 else {
766785 let direction = (_positionSize > 0)
767- let $t03749137670 = swapOutput(direction, abs(_positionSize), false)
768- let currentNetMarketValue = $t03749137670._1
769- let terminalQuoteAssetReserve = $t03749137670._2
770- let terminalBaseAssetReserve = $t03749137670._3
786+ let $t03818838367 = swapOutput(direction, abs(_positionSize), false)
787+ let currentNetMarketValue = $t03818838367._1
788+ let terminalQuoteAssetReserve = $t03818838367._2
789+ let terminalBaseAssetReserve = $t03818838367._3
771790 $Tuple2(terminalQuoteAssetReserve, terminalBaseAssetReserve)
772791 }
773792 }
852871 func getAdjustedFee (_artifactId,_baseFeeDiscount) = {
853872 let baseFeeRaw = fee()
854873 let baseFee = muld(baseFeeRaw, _baseFeeDiscount)
855- let $t04233442829 = if ((_artifactId != ""))
874+ let $t04303143526 = if ((_artifactId != ""))
856875 then {
857876 let artifactKind = strA(nftManagerAddress(), toCompositeKey(k_token_type, _artifactId))
858877 if ((artifactKind == FEE_REDUCTION_TOKEN_TYPE))
864883 else throw("Invalid attached artifact")
865884 }
866885 else $Tuple2(baseFee, false)
867- let adjustedFee = $t04233442829._1
868- let burnArtifact = $t04233442829._2
886+ let adjustedFee = $t04303143526._1
887+ let burnArtifact = $t04303143526._2
869888 $Tuple2(adjustedFee, burnArtifact)
870889 }
871890
880899 case _ =>
881900 throw("Invalid computeFeeDiscount result")
882901 }
883- let $t04317543249 = getAdjustedFee(_artifactId, feeDiscount)
884- let adjustedFee = $t04317543249._1
885- let burnArtifact = $t04317543249._2
902+ let $t04387243946 = getAdjustedFee(_artifactId, feeDiscount)
903+ let adjustedFee = $t04387243946._1
904+ let burnArtifact = $t04387243946._2
886905 $Tuple2(adjustedFee, burnArtifact)
887906 }
888907 else throw("Strict value is not equal to itself.")
904923 }
905924
906925
907-func updateSettings (_initMarginRatio,_mmr,_liquidationFeeRatio,_fundingPeriod,_fee,_spreadLimit,_maxPriceImpact,_partialLiquidationRatio,_maxPriceSpread,_maxOpenNotional,_feeToStakersPercent,_maxOracleDelay,_rolloverFee,_fundingMode,_oracleMode) = [IntegerEntry(k_initMarginRatio, _initMarginRatio), IntegerEntry(k_maintenanceMarginRatio, _mmr), IntegerEntry(k_liquidationFeeRatio, _liquidationFeeRatio), IntegerEntry(k_fundingPeriod, _fundingPeriod), IntegerEntry(k_fee, _fee), IntegerEntry(k_spreadLimit, _spreadLimit), IntegerEntry(k_maxPriceImpact, _maxPriceImpact), IntegerEntry(k_partialLiquidationRatio, _partialLiquidationRatio), IntegerEntry(k_maxPriceSpread, _maxPriceSpread), IntegerEntry(k_maxOpenNotional, _maxOpenNotional), IntegerEntry(k_feeToStakersPercent, _feeToStakersPercent), IntegerEntry(k_maxOracleDelay, _maxOracleDelay), IntegerEntry(k_rolloverFee, _rolloverFee), IntegerEntry(k_fundingMode, _fundingMode), IntegerEntry(k_oracleMode, _oracleMode)]
926+func updateSettings (_initMarginRatio,_mmr,_liquidationFeeRatio,_fundingPeriod,_fee,_spreadLimit,_maxPriceImpact,_partialLiquidationRatio,_maxPriceSpread,_maxOpenNotional,_feeToStakersPercent,_maxOracleDelay,_rolloverFee,_fundingMode,_oracleMode,_minInitMarginRatio,_positionMode) = [IntegerEntry(k_initMarginRatio, _initMarginRatio), IntegerEntry(k_minInitMarginRatio, _minInitMarginRatio), IntegerEntry(k_maintenanceMarginRatio, _mmr), IntegerEntry(k_liquidationFeeRatio, _liquidationFeeRatio), IntegerEntry(k_fundingPeriod, _fundingPeriod), IntegerEntry(k_fee, _fee), IntegerEntry(k_spreadLimit, _spreadLimit), IntegerEntry(k_maxPriceImpact, _maxPriceImpact), IntegerEntry(k_partialLiquidationRatio, _partialLiquidationRatio), IntegerEntry(k_maxPriceSpread, _maxPriceSpread), IntegerEntry(k_maxOpenNotional, _maxOpenNotional), IntegerEntry(k_feeToStakersPercent, _feeToStakersPercent), IntegerEntry(k_maxOracleDelay, _maxOracleDelay), IntegerEntry(k_rolloverFee, _rolloverFee), IntegerEntry(k_fundingMode, _fundingMode), IntegerEntry(k_oracleMode, _oracleMode), IntegerEntry(k_positionMode, _positionMode)]
908927
909928
910929 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)]
10361055 let qtAstRAfter = (_qtAstR + _quoteAssetAmount)
10371056 let baseAssetAmountToAdd = (divd(muld(qtAstRAfter, _qtAstW), price) - _bsAstR)
10381057 let bsAstRAfter = (_bsAstR + baseAssetAmountToAdd)
1039- let $t05197452125 = getSyncTerminalPrice(getOraclePrice(), qtAstRAfter, bsAstRAfter)
1040- let newQuoteAssetWeight = $t05197452125._1
1041- let newBaseAssetWeight = $t05197452125._2
1042- let marginToVault = $t05197452125._3
1058+ let $t05283152982 = getSyncTerminalPrice(getOraclePrice(), qtAstRAfter, bsAstRAfter)
1059+ let newQuoteAssetWeight = $t05283152982._1
1060+ let newBaseAssetWeight = $t05283152982._2
1061+ let marginToVault = $t05283152982._3
10431062 let doExchangePnL = if ((marginToVault != 0))
10441063 then {
10451064 let doExchangePnL = invoke(vaultAddress(), "exchangeFreeAndLocked", [marginToVault], nil)
10561075
10571076
10581077 @Callable(i)
1059-func changeSettings (_initMarginRatio,_mmr,_liquidationFeeRatio,_fundingPeriod,_fee,_spreadLimit,_maxPriceImpact,_partialLiquidationRatio,_maxPriceSpread,_maxOpenNotional,_feeToStakersPercent,_maxOracleDelay,_rolloverFee,_fundingMode,_oracleMode,_baseOracleData,_quoteOracleData) = if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if ((0 >= _fundingPeriod))
1078+func changeSettings (_initMarginRatio,_mmr,_liquidationFeeRatio,_fundingPeriod,_fee,_spreadLimit,_maxPriceImpact,_partialLiquidationRatio,_maxPriceSpread,_maxOpenNotional,_feeToStakersPercent,_maxOracleDelay,_rolloverFee,_fundingMode,_oracleMode,_baseOracleData,_quoteOracleData,_minInitMarginRatio,_positionMode) = if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if ((0 >= _fundingPeriod))
10601079 then true
10611080 else (0 >= _initMarginRatio))
10621081 then true
1063- else (0 >= _mmr))
1082+ else (_initMarginRatio > DECIMAL_UNIT))
10641083 then true
1065- else (0 >= _liquidationFeeRatio))
1084+ else (0 >= _minInitMarginRatio))
10661085 then true
1067- else (0 >= _fee))
1086+ else (_minInitMarginRatio > DECIMAL_UNIT))
10681087 then true
1069- else (0 >= _spreadLimit))
1070- then true
1071- else (0 >= _maxPriceImpact))
1072- then true
1073- else (0 >= _partialLiquidationRatio))
1074- then true
1075- else (0 >= _maxPriceSpread))
1076- then true
1077- else (0 >= _maxOpenNotional))
1078- then true
1079- else (0 >= _feeToStakersPercent))
1080- then true
1081- else (_feeToStakersPercent > DECIMAL_UNIT))
1082- then true
1083- else (0 >= _maxOracleDelay))
1084- then true
1085- else (0 >= _rolloverFee))
1086- then true
1087- else if ((_fundingMode != FUNDING_SYMMETRIC))
1088- then (_fundingMode != FUNDING_ASYMMETRIC)
1089- else false)
1090- then true
1091- else if ((_oracleMode != ORACLE_PLAIN))
1092- then (_oracleMode != ORACLE_JIT)
1093- else false)
1094- then true
1095- else !(initialized()))
1096- then true
1097- else (i.caller != adminAddress()))
1098- then throw("Invalid changeSettings params")
1099- else (updateSettings(_initMarginRatio, _mmr, _liquidationFeeRatio, _fundingPeriod, _fee, _spreadLimit, _maxPriceImpact, _partialLiquidationRatio, _maxPriceSpread, _maxOpenNotional, _feeToStakersPercent, _maxOracleDelay, _rolloverFee, _fundingMode, _oracleMode) ++ [StringEntry(k_baseOracle, _baseOracleData), StringEntry(k_quoteOracle, _quoteOracleData)])
1100-
1101-
1102-
1103-@Callable(i)
1104-func initialize (_qtAstR,_bsAstR,_fundingPeriod,_initMarginRatio,_mmr,_liquidationFeeRatio,_fee,_baseOracleData,_quoteOracleData,_coordinator,_spreadLimit,_maxPriceImpact,_partialLiquidationRatio,_maxPriceSpread,_maxOpenNotional,_feeToStakersPercent,_maxOracleDelay,_rolloverFee,_fundingMode,_oracleMode) = if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if ((0 >= _qtAstR))
1105- then true
1106- else (0 >= _bsAstR))
1107- then true
1108- else (0 >= _fundingPeriod))
1109- then true
1110- else (0 >= _initMarginRatio))
1088+ else (_initMarginRatio > _minInitMarginRatio))
11111089 then true
11121090 else (0 >= _mmr))
11131091 then true
11411119 then (_oracleMode != ORACLE_JIT)
11421120 else false)
11431121 then true
1122+ else if ((_positionMode != POSITION_DIRECT))
1123+ then (_positionMode != POSITION_ORDER)
1124+ else false)
1125+ then true
1126+ else !(initialized()))
1127+ then true
1128+ else (i.caller != adminAddress()))
1129+ then throw("Invalid changeSettings params")
1130+ else (updateSettings(_initMarginRatio, _mmr, _liquidationFeeRatio, _fundingPeriod, _fee, _spreadLimit, _maxPriceImpact, _partialLiquidationRatio, _maxPriceSpread, _maxOpenNotional, _feeToStakersPercent, _maxOracleDelay, _rolloverFee, _fundingMode, _oracleMode, _minInitMarginRatio, _positionMode) ++ [StringEntry(k_baseOracle, _baseOracleData), StringEntry(k_quoteOracle, _quoteOracleData)])
1131+
1132+
1133+
1134+@Callable(i)
1135+func initialize (_qtAstR,_bsAstR,_fundingPeriod,_initMarginRatio,_mmr,_liquidationFeeRatio,_fee,_baseOracleData,_quoteOracleData,_coordinator,_spreadLimit,_maxPriceImpact,_partialLiquidationRatio,_maxPriceSpread,_maxOpenNotional,_feeToStakersPercent,_maxOracleDelay,_rolloverFee,_fundingMode,_oracleMode,_minInitMarginRatio,_positionMode) = if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if ((0 >= _qtAstR))
1136+ then true
1137+ else (0 >= _bsAstR))
1138+ then true
1139+ else (0 >= _fundingPeriod))
1140+ then true
1141+ else (0 >= _initMarginRatio))
1142+ then true
1143+ else (_initMarginRatio > DECIMAL_UNIT))
1144+ then true
1145+ else (0 >= _minInitMarginRatio))
1146+ then true
1147+ else (_minInitMarginRatio > DECIMAL_UNIT))
1148+ then true
1149+ else (_initMarginRatio > _minInitMarginRatio))
1150+ then true
1151+ else (0 >= _mmr))
1152+ then true
1153+ else (0 >= _liquidationFeeRatio))
1154+ then true
1155+ else (0 >= _fee))
1156+ then true
1157+ else (0 >= _spreadLimit))
1158+ then true
1159+ else (0 >= _maxPriceImpact))
1160+ then true
1161+ else (0 >= _partialLiquidationRatio))
1162+ then true
1163+ else (0 >= _maxPriceSpread))
1164+ then true
1165+ else (0 >= _maxOpenNotional))
1166+ then true
1167+ else (0 >= _feeToStakersPercent))
1168+ then true
1169+ else (_feeToStakersPercent > DECIMAL_UNIT))
1170+ then true
1171+ else (0 > _maxOracleDelay))
1172+ then true
1173+ else (0 >= _rolloverFee))
1174+ then true
1175+ else if ((_fundingMode != FUNDING_SYMMETRIC))
1176+ then (_fundingMode != FUNDING_ASYMMETRIC)
1177+ else false)
1178+ then true
1179+ else if ((_oracleMode != ORACLE_PLAIN))
1180+ then (_oracleMode != ORACLE_JIT)
1181+ else false)
1182+ then true
1183+ else if ((_positionMode != POSITION_DIRECT))
1184+ then (_positionMode != POSITION_ORDER)
1185+ else false)
1186+ then true
11441187 else initialized())
11451188 then true
11461189 else (i.caller != this))
11471190 then throw("Invalid initialize parameters")
1148- else ((((updateAmm(_qtAstR, _bsAstR, 0, 0, 0, 0, 0, 0) ++ updateSettings(_initMarginRatio, _mmr, _liquidationFeeRatio, _fundingPeriod, _fee, _spreadLimit, _maxPriceImpact, _partialLiquidationRatio, _maxPriceSpread, _maxOpenNotional, _feeToStakersPercent, _maxOracleDelay, _rolloverFee, _fundingMode, _oracleMode)) ++ updateFunding((lastTimestamp() + _fundingPeriod), 0, 0, 0, 0)) ++ updateBalance(0)) ++ [BooleanEntry(k_initialized, true), StringEntry(k_baseOracle, _baseOracleData), StringEntry(k_quoteOracle, _quoteOracleData), StringEntry(k_coordinatorAddress, toString(addressFromStringValue(_coordinator)))])
1191+ else ((((updateAmm(_qtAstR, _bsAstR, 0, 0, 0, 0, 0, 0) ++ updateSettings(_initMarginRatio, _mmr, _liquidationFeeRatio, _fundingPeriod, _fee, _spreadLimit, _maxPriceImpact, _partialLiquidationRatio, _maxPriceSpread, _maxOpenNotional, _feeToStakersPercent, _maxOracleDelay, _rolloverFee, _fundingMode, _oracleMode, _minInitMarginRatio, _positionMode)) ++ updateFunding((lastTimestamp() + _fundingPeriod), 0, 0, 0, 0)) ++ updateBalance(0)) ++ [BooleanEntry(k_initialized, true), StringEntry(k_baseOracle, _baseOracleData), StringEntry(k_quoteOracle, _quoteOracleData), StringEntry(k_coordinatorAddress, toString(addressFromStringValue(_coordinator)))])
11491192
11501193
11511194
11651208 let _assetId = i.payments[0].assetId
11661209 let _assetIdStr = toBase58String(value(_assetId))
11671210 let isQuoteAsset = (_assetId == quoteAsset())
1168- if (if (if (if (if (if (if (if (if ((_direction != DIR_LONG))
1211+ if (if (if (if (if (if (if (if (if (if (if ((_direction != DIR_LONG))
11691212 then (_direction != DIR_SHORT)
11701213 else false)
11711214 then true
11771220 then true
11781221 else !(requireMoreMarginRatio(divd(DECIMAL_UNIT, _leverage), initMarginRatio(), true)))
11791222 then true
1223+ else !(requireMoreMarginRatio(divd(DECIMAL_UNIT, _leverage), minInitMarginRatio(), false)))
1224+ then true
1225+ else !(requireSenderCanWorkWithPositions(i.caller)))
1226+ then true
11801227 else paused())
11811228 then true
11821229 else closeOnly())
11841231 else isMarketClosed())
11851232 then throw("Invalid increasePosition parameters")
11861233 else {
1187- let $t05867658825 = getForTraderWithArtifact(_trader, getArtifactId(i))
1188- let adjustedFee = $t05867658825._1
1189- let burnArtifact = $t05867658825._2
1234+ let $t06032160470 = getForTraderWithArtifact(_trader, getArtifactId(i))
1235+ let adjustedFee = $t06032160470._1
1236+ let burnArtifact = $t06032160470._2
11901237 let _amount = divd(_rawAmount, (muld(adjustedFee, _leverage) + DECIMAL_UNIT))
11911238 let distributeFeeAmount = (_rawAmount - _amount)
11921239 let referrerFeeAny = invoke(referralAddress(), "acceptPaymentWithLink", [_trader, _refLink], [AttachedPayment(quoteAsset(), distributeFeeAmount)])
11991246 throw("Invalid referrerFee")
12001247 }
12011248 let feeAmount = (distributeFeeAmount - referrerFee)
1202- let $t05932159501 = getPosition(_trader, _direction)
1203- let oldPositionSize = $t05932159501._1
1204- let oldPositionMargin = $t05932159501._2
1205- let oldPositionOpenNotional = $t05932159501._3
1206- let oldPositionLstUpdCPF = $t05932159501._4
1207- let oldPositionTimestamp = $t05932159501._5
1249+ let $t06096661146 = getPosition(_trader, _direction)
1250+ let oldPositionSize = $t06096661146._1
1251+ let oldPositionMargin = $t06096661146._2
1252+ let oldPositionOpenNotional = $t06096661146._3
1253+ let oldPositionLstUpdCPF = $t06096661146._4
1254+ let oldPositionTimestamp = $t06096661146._5
12081255 let isNewPosition = (oldPositionSize == 0)
12091256 let isSameDirection = if ((oldPositionSize > 0))
12101257 then (_direction == DIR_LONG)
12131260 then isSameDirection
12141261 else false
12151262 let isAdd = (_direction == DIR_LONG)
1216- let $t05979062923 = if (if (isNewPosition)
1263+ let $t06143564568 = if (if (isNewPosition)
12171264 then true
12181265 else expandExisting)
12191266 then {
12201267 let openNotional = muld(_amount, _leverage)
1221- let $t06029960472 = swapInput(isAdd, openNotional)
1222- let amountBaseAssetBought = $t06029960472._1
1223- let quoteAssetReserveAfter = $t06029960472._2
1224- let baseAssetReserveAfter = $t06029960472._3
1225- let totalPositionSizeAfter = $t06029960472._4
1268+ let $t06194462117 = swapInput(isAdd, openNotional)
1269+ let amountBaseAssetBought = $t06194462117._1
1270+ let quoteAssetReserveAfter = $t06194462117._2
1271+ let baseAssetReserveAfter = $t06194462117._3
1272+ let totalPositionSizeAfter = $t06194462117._4
12261273 if (if ((_minBaseAssetAmount != 0))
12271274 then (_minBaseAssetAmount > abs(amountBaseAssetBought))
12281275 else false)
12351282 let totalShortOpenInterestAfter = (openInterestShort() + (if ((0 > newPositionSize))
12361283 then openNotional
12371284 else 0))
1238- let $t06101861293 = calcRemainMarginWithFundingPaymentAndRolloverFee(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, oldPositionTimestamp, _amount)
1239- let remainMargin = $t06101861293._1
1240- let x1 = $t06101861293._2
1241- let x2 = $t06101861293._3
1242- let rolloverFee = $t06101861293._4
1285+ let $t06266362938 = calcRemainMarginWithFundingPaymentAndRolloverFee(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, oldPositionTimestamp, _amount)
1286+ let remainMargin = $t06266362938._1
1287+ let x1 = $t06266362938._2
1288+ let x2 = $t06266362938._3
1289+ let rolloverFee = $t06266362938._4
12431290 if (!(requireNotOverSpreadLimit(quoteAssetReserveAfter, baseAssetReserveAfter)))
12441291 then throw("Over max spread limit")
12451292 else if (!(requireNotOverMaxOpenNotional(totalLongOpenInterestAfter, totalShortOpenInterestAfter)))
12531300 }
12541301 else {
12551302 let openNotional = muld(_amount, _leverage)
1256- let $t06261162739 = getPositionNotionalAndUnrealizedPnl(toString(i.caller), _direction, PNL_OPTION_SPOT)
1257- let oldPositionNotional = $t06261162739._1
1258- let unrealizedPnl = $t06261162739._2
1303+ let $t06425664384 = getPositionNotionalAndUnrealizedPnl(toString(i.caller), _direction, PNL_OPTION_SPOT)
1304+ let oldPositionNotional = $t06425664384._1
1305+ let unrealizedPnl = $t06425664384._2
12591306 if ((oldPositionNotional > openNotional))
12601307 then throw("Use decreasePosition to decrease position size")
12611308 else throw("Close position first")
12621309 }
1263- let newPositionSize = $t05979062923._1
1264- let newPositionRemainMargin = $t05979062923._2
1265- let newPositionOpenNotional = $t05979062923._3
1266- let newPositionLatestCPF = $t05979062923._4
1267- let newPositionTimestamp = $t05979062923._5
1268- let baseAssetReserveAfter = $t05979062923._6
1269- let quoteAssetReserveAfter = $t05979062923._7
1270- let totalPositionSizeAfter = $t05979062923._8
1271- let openInterestNotionalAfter = $t05979062923._9
1272- let totalLongAfter = $t05979062923._10
1273- let totalShortAfter = $t05979062923._11
1274- let totalLongOpenInterestAfter = $t05979062923._12
1275- let totalShortOpenInterestAfter = $t05979062923._13
1276- let rolloverFee = $t05979062923._14
1277- let $t06292963000 = distributeFee((feeAmount + rolloverFee))
1278- let feeToStakers = $t06292963000._1
1279- let feeToVault = $t06292963000._2
1310+ let newPositionSize = $t06143564568._1
1311+ let newPositionRemainMargin = $t06143564568._2
1312+ let newPositionOpenNotional = $t06143564568._3
1313+ let newPositionLatestCPF = $t06143564568._4
1314+ let newPositionTimestamp = $t06143564568._5
1315+ let baseAssetReserveAfter = $t06143564568._6
1316+ let quoteAssetReserveAfter = $t06143564568._7
1317+ let totalPositionSizeAfter = $t06143564568._8
1318+ let openInterestNotionalAfter = $t06143564568._9
1319+ let totalLongAfter = $t06143564568._10
1320+ let totalShortAfter = $t06143564568._11
1321+ let totalLongOpenInterestAfter = $t06143564568._12
1322+ let totalShortOpenInterestAfter = $t06143564568._13
1323+ let rolloverFee = $t06143564568._14
1324+ let $t06457464645 = distributeFee((feeAmount + rolloverFee))
1325+ let feeToStakers = $t06457464645._1
1326+ let feeToVault = $t06457464645._2
12801327 let stake = if ((_amount >= rolloverFee))
12811328 then invoke(vaultAddress(), "addLocked", nil, [AttachedPayment(quoteAsset(), (_amount - rolloverFee))])
12821329 else invoke(vaultAddress(), "withdrawLocked", [(rolloverFee - _amount)], nil)
13381385 else isMarketClosed())
13391386 then throw("Invalid addMargin parameters")
13401387 else {
1341- let $t06534265522 = getPosition(_trader, _direction)
1342- let oldPositionSize = $t06534265522._1
1343- let oldPositionMargin = $t06534265522._2
1344- let oldPositionOpenNotional = $t06534265522._3
1345- let oldPositionLstUpdCPF = $t06534265522._4
1346- let oldPositionTimestamp = $t06534265522._5
1388+ let $t06698767167 = getPosition(_trader, _direction)
1389+ let oldPositionSize = $t06698767167._1
1390+ let oldPositionMargin = $t06698767167._2
1391+ let oldPositionOpenNotional = $t06698767167._3
1392+ let oldPositionLstUpdCPF = $t06698767167._4
1393+ let oldPositionTimestamp = $t06698767167._5
13471394 let stake = invoke(vaultAddress(), "addLocked", nil, [AttachedPayment(quoteAsset(), _amount)])
13481395 if ((stake == stake))
13491396 then {
1350- let rolloverFee = calcRolloverFee(oldPositionMargin, oldPositionTimestamp)
1351- let doTransferFeeToStakers = if ((rolloverFee > 0))
1397+ let $t06730767533 = calcRemainMarginWithFundingPaymentAndRolloverFee(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, oldPositionTimestamp, _amount)
1398+ let remainMargin = $t06730767533._1
1399+ let badDebt = $t06730767533._2
1400+ let rolloverFee = $t06730767533._3
1401+ let marginRatio = calcMarginRatio(remainMargin, badDebt, oldPositionOpenNotional)
1402+ let checkMinMargin = requireMoreMarginRatio(marginRatio, minInitMarginRatio(), false)
1403+ if ((checkMinMargin == checkMinMargin))
13521404 then {
1353- let $t06580765866 = distributeFee(rolloverFee)
1354- let feeToStakers = $t06580765866._1
1355- let feeToVault = $t06580765866._2
1356- let unstake = invoke(vaultAddress(), "withdrawLocked", [feeToStakers], nil)
1357- if ((unstake == unstake))
1405+ let doTransferFeeToStakers = if ((rolloverFee > 0))
13581406 then {
1359- let lockBadDebt = invoke(vaultAddress(), "exchangeFreeAndLocked", [-(feeToVault)], nil)
1360- if ((lockBadDebt == lockBadDebt))
1361- then transferFee(feeToStakers)
1407+ let $t06778967848 = distributeFee(rolloverFee)
1408+ let feeToStakers = $t06778967848._1
1409+ let feeToVault = $t06778967848._2
1410+ let unstake = invoke(vaultAddress(), "withdrawLocked", [feeToStakers], nil)
1411+ if ((unstake == unstake))
1412+ then {
1413+ let lockBadDebt = invoke(vaultAddress(), "exchangeFreeAndLocked", [-(feeToVault)], nil)
1414+ if ((lockBadDebt == lockBadDebt))
1415+ then transferFee(feeToStakers)
1416+ else throw("Strict value is not equal to itself.")
1417+ }
13621418 else throw("Strict value is not equal to itself.")
13631419 }
1420+ else nil
1421+ if ((doTransferFeeToStakers == doTransferFeeToStakers))
1422+ then ((updatePosition(_trader, oldPositionSize, ((oldPositionMargin - rolloverFee) + _amount), oldPositionOpenNotional, oldPositionLstUpdCPF, lastTimestamp()) ++ updateBalance(((cbalance() + _amount) - rolloverFee))) ++ doTransferFeeToStakers)
13641423 else throw("Strict value is not equal to itself.")
13651424 }
1366- else nil
1367- if ((doTransferFeeToStakers == doTransferFeeToStakers))
1368- then ((updatePosition(_trader, oldPositionSize, ((oldPositionMargin - rolloverFee) + _amount), oldPositionOpenNotional, oldPositionLstUpdCPF, lastTimestamp()) ++ updateBalance(((cbalance() + _amount) - rolloverFee))) ++ doTransferFeeToStakers)
13691425 else throw("Strict value is not equal to itself.")
13701426 }
13711427 else throw("Strict value is not equal to itself.")
14031459 else isMarketClosed())
14041460 then throw("Invalid removeMargin parameters")
14051461 else {
1406- let $t06736767547 = getPosition(_trader, _direction)
1407- let oldPositionSize = $t06736767547._1
1408- let oldPositionMargin = $t06736767547._2
1409- let oldPositionOpenNotional = $t06736767547._3
1410- let oldPositionLstUpdCPF = $t06736767547._4
1411- let oldPositionTimestamp = $t06736767547._5
1412- let $t06755367802 = calcRemainMarginWithFundingPaymentAndRolloverFee(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, oldPositionTimestamp, -(_amount))
1413- let remainMargin = $t06755367802._1
1414- let badDebt = $t06755367802._2
1415- let fundingPayment = $t06755367802._3
1416- let rolloverFee = $t06755367802._4
1462+ let $t06934969529 = getPosition(_trader, _direction)
1463+ let oldPositionSize = $t06934969529._1
1464+ let oldPositionMargin = $t06934969529._2
1465+ let oldPositionOpenNotional = $t06934969529._3
1466+ let oldPositionLstUpdCPF = $t06934969529._4
1467+ let oldPositionTimestamp = $t06934969529._5
1468+ let $t06953569784 = calcRemainMarginWithFundingPaymentAndRolloverFee(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, oldPositionTimestamp, -(_amount))
1469+ let remainMargin = $t06953569784._1
1470+ let badDebt = $t06953569784._2
1471+ let fundingPayment = $t06953569784._3
1472+ let rolloverFee = $t06953569784._4
14171473 if ((badDebt != 0))
14181474 then throw("Invalid removed margin amount")
14191475 else {
14211477 if (!(requireMoreMarginRatio(marginRatio, initMarginRatio(), true)))
14221478 then throw(((("Too much margin removed: " + toString(marginRatio)) + " < ") + toString(initMarginRatio())))
14231479 else {
1424- let $t06818868247 = distributeFee(rolloverFee)
1425- let feeToStakers = $t06818868247._1
1426- let feeToVault = $t06818868247._2
1480+ let $t07017070229 = distributeFee(rolloverFee)
1481+ let feeToStakers = $t07017070229._1
1482+ let feeToVault = $t07017070229._2
14271483 let doTransferFeeToStakers = if ((rolloverFee > 0))
14281484 then {
14291485 let lockBadDebt = invoke(vaultAddress(), "exchangeFreeAndLocked", [-(feeToVault)], nil)
14811537 then throw("Invalid closePosition parameters")
14821538 else {
14831539 let oldPositionTimestamp = getPosition(_trader, _direction)._5
1484- let $t07058271185 = internalClosePosition(_trader, _direction, _size, positionFee, _minQuoteAssetAmount, _addToMargin, true, true)
1485- let newPositionSize = $t07058271185._1
1486- let newPositionMargin = $t07058271185._2
1487- let newPositionOpenNotional = $t07058271185._3
1488- let newPositionLstUpdCPF = $t07058271185._4
1489- let positionBadDebt = $t07058271185._5
1490- let realizedPnl = $t07058271185._6
1491- let marginToTrader = $t07058271185._7
1492- let quoteAssetReserveAfter = $t07058271185._8
1493- let baseAssetReserveAfter = $t07058271185._9
1494- let totalPositionSizeAfter = $t07058271185._10
1495- let openInterestNotionalAfter = $t07058271185._11
1496- let totalLongAfter = $t07058271185._12
1497- let totalShortAfter = $t07058271185._13
1498- let totalLongOpenInterestAfter = $t07058271185._14
1499- let totalShortOpenInterestAfter = $t07058271185._15
1500- let realizedFee = $t07058271185._16
1540+ let $t07256473167 = internalClosePosition(_trader, _direction, _size, positionFee, _minQuoteAssetAmount, _addToMargin, true, true)
1541+ let newPositionSize = $t07256473167._1
1542+ let newPositionMargin = $t07256473167._2
1543+ let newPositionOpenNotional = $t07256473167._3
1544+ let newPositionLstUpdCPF = $t07256473167._4
1545+ let positionBadDebt = $t07256473167._5
1546+ let realizedPnl = $t07256473167._6
1547+ let marginToTrader = $t07256473167._7
1548+ let quoteAssetReserveAfter = $t07256473167._8
1549+ let baseAssetReserveAfter = $t07256473167._9
1550+ let totalPositionSizeAfter = $t07256473167._10
1551+ let openInterestNotionalAfter = $t07256473167._11
1552+ let totalLongAfter = $t07256473167._12
1553+ let totalShortAfter = $t07256473167._13
1554+ let totalLongOpenInterestAfter = $t07256473167._14
1555+ let totalShortOpenInterestAfter = $t07256473167._15
1556+ let realizedFee = $t07256473167._16
15011557 if ((positionBadDebt > 0))
15021558 then throw("Invalid closePosition parameters: bad debt")
15031559 else if ((oldPositionTimestamp >= lastTimestamp()))
15211577 case _ =>
15221578 throw("Invalid referrerFee")
15231579 }
1524- let $t07215772230 = distributeFee((realizedFee - referrerFee))
1525- let feeToStakers = $t07215772230._1
1526- let feeToVault = $t07215772230._2
1580+ let $t07413974212 = distributeFee((realizedFee - referrerFee))
1581+ let feeToStakers = $t07413974212._1
1582+ let feeToVault = $t07413974212._2
15271583 let depositVault = invoke(vaultAddress(), "addFree", nil, [AttachedPayment(quoteAsset(), feeToVault)])
15281584 if ((depositVault == depositVault))
15291585 then {
15911647 else false
15921648 let oldPositionSize = getPosition(_trader, _direction)._1
15931649 let positionSizeAbs = abs(oldPositionSize)
1594- let $t07482375146 = if (isPartialLiquidation)
1650+ let $t07680577128 = if (isPartialLiquidation)
15951651 then {
15961652 let liquidationSize = getPartialLiquidationAmount(_trader, oldPositionSize)
15971653 let liquidationRatio = divd(abs(liquidationSize), positionSizeAbs)
15981654 $Tuple2(liquidationRatio, abs(liquidationSize))
15991655 }
16001656 else $Tuple2(0, positionSizeAbs)
1601- let liquidationRatio = $t07482375146._1
1602- let liquidationSize = $t07482375146._2
1603- let $t07515275808 = internalClosePosition(_trader, _direction, if (isPartialLiquidation)
1657+ let liquidationRatio = $t07680577128._1
1658+ let liquidationSize = $t07680577128._2
1659+ let $t07713477790 = internalClosePosition(_trader, _direction, if (isPartialLiquidation)
16041660 then liquidationSize
16051661 else positionSizeAbs, liquidationFeeRatio(), 0, true, false, true)
1606- let newPositionSize = $t07515275808._1
1607- let newPositionMargin = $t07515275808._2
1608- let newPositionOpenNotional = $t07515275808._3
1609- let newPositionLstUpdCPF = $t07515275808._4
1610- let positionBadDebt = $t07515275808._5
1611- let realizedPnl = $t07515275808._6
1612- let marginToTrader = $t07515275808._7
1613- let quoteAssetReserveAfter = $t07515275808._8
1614- let baseAssetReserveAfter = $t07515275808._9
1615- let totalPositionSizeAfter = $t07515275808._10
1616- let openInterestNotionalAfter = $t07515275808._11
1617- let totalLongAfter = $t07515275808._12
1618- let totalShortAfter = $t07515275808._13
1619- let totalLongOpenInterestAfter = $t07515275808._14
1620- let totalShortOpenInterestAfter = $t07515275808._15
1621- let liquidationPenalty = $t07515275808._16
1662+ let newPositionSize = $t07713477790._1
1663+ let newPositionMargin = $t07713477790._2
1664+ let newPositionOpenNotional = $t07713477790._3
1665+ let newPositionLstUpdCPF = $t07713477790._4
1666+ let positionBadDebt = $t07713477790._5
1667+ let realizedPnl = $t07713477790._6
1668+ let marginToTrader = $t07713477790._7
1669+ let quoteAssetReserveAfter = $t07713477790._8
1670+ let baseAssetReserveAfter = $t07713477790._9
1671+ let totalPositionSizeAfter = $t07713477790._10
1672+ let openInterestNotionalAfter = $t07713477790._11
1673+ let totalLongAfter = $t07713477790._12
1674+ let totalShortAfter = $t07713477790._13
1675+ let totalLongOpenInterestAfter = $t07713477790._14
1676+ let totalShortOpenInterestAfter = $t07713477790._15
1677+ let liquidationPenalty = $t07713477790._16
16221678 let feeToLiquidator = (liquidationPenalty / 2)
16231679 let feeToVault = (liquidationPenalty - feeToLiquidator)
16241680 let ammBalance = (cbalance() - liquidationPenalty)
16791735 then throw(((("Invalid funding block timestamp: " + toString(lastTimestamp())) + " < ") + toString(fundingBlockTimestamp)))
16801736 else {
16811737 let underlyingPrice = getOraclePrice()
1682- let $t07802678104 = getFunding()
1683- let shortPremiumFraction = $t07802678104._1
1684- let longPremiumFraction = $t07802678104._2
1685- let premiumToVault = $t07802678104._3
1738+ let $t08000880086 = getFunding()
1739+ let shortPremiumFraction = $t08000880086._1
1740+ let longPremiumFraction = $t08000880086._2
1741+ let premiumToVault = $t08000880086._3
16861742 let doPayFundingToVault = if ((premiumToVault > 0))
16871743 then {
16881744 let doPayFundingToVault = invoke(vaultAddress(), "exchangeFreeAndLocked", [-(premiumToVault)], nil)
17371793 func syncTerminalPriceToOracle () = {
17381794 let _qtAstR = qtAstR()
17391795 let _bsAstR = bsAstR()
1740- let $t07992180287 = getSyncTerminalPrice(getOraclePrice(), _qtAstR, _bsAstR)
1741- let newQuoteAssetWeight = $t07992180287._1
1742- let newBaseAssetWeight = $t07992180287._2
1743- let marginToVault = $t07992180287._3
1796+ let $t08190382269 = getSyncTerminalPrice(getOraclePrice(), _qtAstR, _bsAstR)
1797+ let newQuoteAssetWeight = $t08190382269._1
1798+ let newBaseAssetWeight = $t08190382269._2
1799+ let marginToVault = $t08190382269._3
17441800 let marginToVaultAdj = if (if ((0 > marginToVault))
17451801 then (abs(marginToVault) > cbalance())
17461802 else false)
18051861 let sync = invoke(this, "syncTerminalPriceToOracle", nil, nil)
18061862 if ((sync == sync))
18071863 then {
1808- let $t08408184217 = getPosition(_trader, _direction)
1809- let positionSize = $t08408184217._1
1810- let positionMargin = $t08408184217._2
1811- let pon = $t08408184217._3
1812- let positionLstUpdCPF = $t08408184217._4
1813- let positionTimestamp = $t08408184217._5
1814- let $t08422084333 = getPositionNotionalAndUnrealizedPnl(_trader, _direction, PNL_OPTION_SPOT)
1815- let positionNotional = $t08422084333._1
1816- let unrealizedPnl = $t08422084333._2
1817- let $t08433684560 = calcRemainMarginWithFundingPaymentAndRolloverFee(positionSize, positionMargin, positionLstUpdCPF, positionTimestamp, unrealizedPnl)
1818- let remainMargin = $t08433684560._1
1819- let badDebt = $t08433684560._2
1820- let fundingPayment = $t08433684560._3
1821- let rolloverFee = $t08433684560._4
1864+ let $t08606386199 = getPosition(_trader, _direction)
1865+ let positionSize = $t08606386199._1
1866+ let positionMargin = $t08606386199._2
1867+ let pon = $t08606386199._3
1868+ let positionLstUpdCPF = $t08606386199._4
1869+ let positionTimestamp = $t08606386199._5
1870+ let $t08620286315 = getPositionNotionalAndUnrealizedPnl(_trader, _direction, PNL_OPTION_SPOT)
1871+ let positionNotional = $t08620286315._1
1872+ let unrealizedPnl = $t08620286315._2
1873+ let $t08631886542 = calcRemainMarginWithFundingPaymentAndRolloverFee(positionSize, positionMargin, positionLstUpdCPF, positionTimestamp, unrealizedPnl)
1874+ let remainMargin = $t08631886542._1
1875+ let badDebt = $t08631886542._2
1876+ let fundingPayment = $t08631886542._3
1877+ let rolloverFee = $t08631886542._4
18221878 throw(((((((s(remainMargin) + s(fundingPayment)) + s(getMarginRatio(_trader, _direction))) + s(unrealizedPnl)) + s(badDebt)) + s(positionNotional)) + s(rolloverFee)))
18231879 }
18241880 else throw("Strict value is not equal to itself.")
18401896
18411897 @Callable(i)
18421898 func view_getTerminalAmmPrice () = {
1843- let $t08529585376 = getTerminalAmmState()
1844- let terminalQuoteAssetReserve = $t08529585376._1
1845- let terminalBaseAssetReserve = $t08529585376._2
1899+ let $t08727787358 = getTerminalAmmState()
1900+ let terminalQuoteAssetReserve = $t08727787358._1
1901+ let terminalBaseAssetReserve = $t08727787358._2
18461902 let price = divd(muld(terminalQuoteAssetReserve, qtAstW()), muld(terminalBaseAssetReserve, bsAstW()))
18471903 throw(toString(price))
18481904 }
18581914 if ((sync == sync))
18591915 then {
18601916 let underlyingPrice = getOraclePrice()
1861- let $t08602886106 = getFunding()
1862- let shortPremiumFraction = $t08602886106._1
1863- let longPremiumFraction = $t08602886106._2
1864- let premiumToVault = $t08602886106._3
1917+ let $t08801088088 = getFunding()
1918+ let shortPremiumFraction = $t08801088088._1
1919+ let longPremiumFraction = $t08801088088._2
1920+ let premiumToVault = $t08801088088._3
18651921 let longFunding = divd(longPremiumFraction, underlyingPrice)
18661922 let shortFunding = divd(shortPremiumFraction, underlyingPrice)
18671923 throw(((((s(longFunding) + s(shortFunding)) + s(getSpotPrice())) + s(getOraclePrice())) + s(premiumToVault)))
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let k_baseOracle = "k_baseOracle"
55
66 let k_quoteOracle = "k_quoteOracle"
77
88 let k_balance = "k_balance"
99
1010 let k_sequence = "k_sequence"
1111
1212 let k_positionSize = "k_positionSize"
1313
1414 let k_positionMargin = "k_positionMargin"
1515
1616 let k_positionOpenNotional = "k_positionOpenNotional"
1717
1818 let k_positionLastUpdatedCumulativePremiumFraction = "k_positionFraction"
1919
2020 let k_positionSequence = "k_positionSequence"
2121
2222 let k_positionFee = "k_positionFee"
2323
2424 let k_positionLastUpdatedTimestamp = "k_positionTimestamp"
2525
2626 let k_initialized = "k_initialized"
2727
2828 let k_paused = "k_paused"
2929
3030 let k_closeOnly = "k_closeOnly"
3131
3232 let k_fee = "k_fee"
3333
3434 let k_rolloverFee = "k_rollover_fee"
3535
3636 let k_fundingPeriod = "k_fundingPeriod"
3737
3838 let k_initMarginRatio = "k_initMarginRatio"
3939
40+let k_minInitMarginRatio = "k_minInitMarginRatio"
41+
4042 let k_maintenanceMarginRatio = "k_mmr"
4143
4244 let k_liquidationFeeRatio = "k_liquidationFeeRatio"
4345
4446 let k_partialLiquidationRatio = "k_partLiquidationRatio"
4547
4648 let k_spreadLimit = "k_spreadLimit"
4749
4850 let k_maxPriceImpact = "k_maxPriceImpact"
4951
5052 let k_maxPriceSpread = "k_maxPriceSpread"
5153
5254 let k_maxOpenNotional = "k_maxOpenNotional"
5355
5456 let k_feeToStakersPercent = "k_feeToStakersPercent"
5557
5658 let k_maxOracleDelay = "k_maxOracleDelay"
5759
5860 let k_fundingMode = "k_fundingMode"
5961
6062 let k_oracleMode = "k_oracleMode"
63+
64+let k_positionMode = "k_positionMode"
6165
6266 let k_latestLongCumulativePremiumFraction = "k_latestLongPremiumFraction"
6367
6468 let k_latestShortCumulativePremiumFraction = "k_latestShortPremiumFraction"
6569
6670 let k_nextFundingBlock = "k_nextFundingBlockMinTimestamp"
6771
6872 let k_longFundingRate = "k_longFundingRate"
6973
7074 let k_shortFundingRate = "k_shortFundingRate"
7175
7276 let k_quoteAssetReserve = "k_qtAstR"
7377
7478 let k_baseAssetReserve = "k_bsAstR"
7579
7680 let k_quoteAssetWeight = "k_qtAstW"
7781
7882 let k_baseAssetWeight = "k_bsAstW"
7983
8084 let k_totalPositionSize = "k_totalPositionSize"
8185
8286 let k_totalLongPositionSize = "k_totalLongPositionSize"
8387
8488 let k_totalShortPositionSize = "k_totalShortPositionSize"
8589
8690 let k_openInterestNotional = "k_openInterestNotional"
8791
8892 let k_openInterestShort = "k_openInterestShort"
8993
9094 let k_openInterestLong = "k_openInterestLong"
9195
9296 let k_lastTx = "k_lastTx"
9397
9498 let k_coordinatorAddress = "k_coordinatorAddress"
9599
96100 let k_vault_address = "k_vault_address"
97101
98102 let k_admin_address = "k_admin_address"
99103
100104 let k_quote_asset = "k_quote_asset"
101105
102106 let k_staking_address = "k_staking_address"
103107
104108 let k_miner_address = "k_miner_address"
105109
106110 let k_orders_address = "k_orders_address"
107111
108112 let k_referral_address = "k_referral_address"
109113
110114 let k_nft_manager_address = "k_nft_manager_address"
111115
112116 func toCompositeKey (_key,_address) = ((_key + "_") + _address)
113117
114118
115119 func coordinator () = valueOrErrorMessage(addressFromString(getStringValue(this, k_coordinatorAddress)), "Coordinator not set")
116120
117121
118122 func adminAddress () = addressFromString(getStringValue(coordinator(), k_admin_address))
119123
120124
121125 func quoteAsset () = fromBase58String(getStringValue(coordinator(), k_quote_asset))
122126
123127
124128 func stakingAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_staking_address)), "Staking not set")
125129
126130
127131 func vaultAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_vault_address)), "Vault not set")
128132
129133
130134 func minerAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_miner_address)), "Miner not set")
131135
132136
133137 func ordersAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_orders_address)), "Orders not set")
134138
135139
136140 func referralAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_referral_address)), "Referral not set")
137141
138142
139143 func nftManagerAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_nft_manager_address)), "NFT Manager not set")
140144
141145
142146 let k_token_param = "k_token_param"
143147
144148 let k_token_type = "k_token_type"
145149
146150 let FEE_REDUCTION_TOKEN_TYPE = "fee_reduction"
147151
148152 let DIR_LONG = 1
149153
150154 let DIR_SHORT = 2
151155
152156 let SECONDS = 1000
153157
154158 let DECIMAL_NUMBERS = 6
155159
156160 let DECIMAL_UNIT = (1 * (((((10 * 10) * 10) * 10) * 10) * 10))
157161
158162 let MINUTES_IN_YEAR = (525600 * DECIMAL_UNIT)
159163
160164 let ONE_DAY = (86400 * DECIMAL_UNIT)
161165
162166 let PNL_OPTION_SPOT = 1
163167
164168 let PNL_OPTION_ORACLE = 2
165169
166170 let FUNDING_ASYMMETRIC = 1
167171
168172 let FUNDING_SYMMETRIC = 2
169173
170174 let ORACLE_PLAIN = 1
171175
172176 let ORACLE_JIT = 2
173177
178+let POSITION_DIRECT = 1
179+
180+let POSITION_ORDER = 2
181+
174182 func s (_x) = (toString(_x) + ",")
175183
176184
177185 func divd (_x,_y) = fraction(_x, DECIMAL_UNIT, _y, HALFEVEN)
178186
179187
180188 func muld (_x,_y) = fraction(_x, _y, DECIMAL_UNIT, HALFEVEN)
181189
182190
183191 func bdivd (_x,_y) = fraction(_x, toBigInt(DECIMAL_UNIT), _y, HALFEVEN)
184192
185193
186194 func bmuld (_x,_y) = fraction(_x, _y, toBigInt(DECIMAL_UNIT), HALFEVEN)
187195
188196
189197 func abs (_x) = if ((_x > 0))
190198 then _x
191199 else -(_x)
192200
193201
194202 func vmax (_x,_y) = if ((_x >= _y))
195203 then _x
196204 else _y
197205
198206
199207 func int (k) = valueOrErrorMessage(getInteger(this, k), ("no value for " + k))
200208
201209
202210 func intOr (k,def) = valueOrElse(getInteger(this, k), def)
203211
204212
205213 func strA (_address,_key) = {
206214 let val = valueOrErrorMessage(getString(_address, _key), ("No value for key " + _key))
207215 val
208216 }
209217
210218
211219 func intA (_address,_key) = {
212220 let val = valueOrErrorMessage(getInteger(_address, _key), ("No value for key " + _key))
213221 val
214222 }
215223
216224
217225 func cbalance () = int(k_balance)
218226
219227
220228 func cbalance0 () = intOr(k_balance, 0)
221229
222230
223231 func fee () = int(k_fee)
224232
225233
226234 func rolloverFeeRate () = int(k_rolloverFee)
227235
228236
229237 func initMarginRatio () = int(k_initMarginRatio)
238+
239+
240+func minInitMarginRatio () = intOr(k_minInitMarginRatio, DECIMAL_UNIT)
230241
231242
232243 func qtAstR () = int(k_quoteAssetReserve)
233244
234245
235246 func qtAstR0 () = intOr(k_quoteAssetReserve, 0)
236247
237248
238249 func bsAstR () = int(k_baseAssetReserve)
239250
240251
241252 func bsAstR0 () = intOr(k_baseAssetReserve, 0)
242253
243254
244255 func qtAstW () = intOr(k_quoteAssetWeight, DECIMAL_UNIT)
245256
246257
247258 func bsAstW () = intOr(k_baseAssetWeight, DECIMAL_UNIT)
248259
249260
250261 func totalPositionSize () = int(k_totalPositionSize)
251262
252263
253264 func openInterestNotional () = int(k_openInterestNotional)
254265
255266
256267 func openInterestShort () = int(k_openInterestShort)
257268
258269
259270 func openInterestLong () = int(k_openInterestLong)
260271
261272
262273 func nextFundingBlockTimestamp () = int(k_nextFundingBlock)
263274
264275
265276 func fundingPeriodRaw () = int(k_fundingPeriod)
266277
267278
268279 func fundingPeriodDecimal () = (fundingPeriodRaw() * DECIMAL_UNIT)
269280
270281
271282 func fundingPeriodSeconds () = (fundingPeriodRaw() * SECONDS)
272283
273284
274285 func maintenanceMarginRatio () = int(k_maintenanceMarginRatio)
275286
276287
277288 func liquidationFeeRatio () = int(k_liquidationFeeRatio)
278289
279290
280291 func partialLiquidationRatio () = int(k_partialLiquidationRatio)
281292
282293
283294 func spreadLimit () = int(k_spreadLimit)
284295
285296
286297 func maxPriceImpact () = int(k_maxPriceImpact)
287298
288299
289300 func maxPriceSpread () = int(k_maxPriceSpread)
290301
291302
292303 func maxOpenNotional () = int(k_maxOpenNotional)
293304
294305
295306 func latestLongCumulativePremiumFraction () = int(k_latestLongCumulativePremiumFraction)
296307
297308
298309 func latestShortCumulativePremiumFraction () = int(k_latestShortCumulativePremiumFraction)
299310
300311
301312 func totalShortPositionSize () = int(k_totalShortPositionSize)
302313
303314
304315 func totalLongPositionSize () = int(k_totalLongPositionSize)
305316
306317
307318 func lastSequence () = intOr(k_sequence, 0)
308319
309320
310321 func feeToStakersPercent () = int(k_feeToStakersPercent)
311322
312323
313324 func maxOracleDelay () = int(k_maxOracleDelay)
314325
315326
316327 func fundingMode () = intOr(k_fundingMode, FUNDING_ASYMMETRIC)
317328
318329
319330 func oracleMode () = intOr(k_oracleMode, ORACLE_PLAIN)
331+
332+
333+func positionMode () = intOr(k_positionMode, POSITION_DIRECT)
320334
321335
322336 func lastTimestamp () = lastBlock.timestamp
323337
324338
325339 func getActualCaller (i) = valueOrElse(getString(ordersAddress(), "k_sender"), toString(i.caller))
326340
327341
328342 func requireMoreMarginRatio (_marginRatio,_baseMarginRatio,_largerThanOrEqualTo) = {
329343 let remainingMarginRatio = (_marginRatio - _baseMarginRatio)
330344 if (if (_largerThanOrEqualTo)
331345 then (0 > remainingMarginRatio)
332346 else false)
333347 then throw(((("Invalid margin: " + toString(_marginRatio)) + " < ") + toString(_baseMarginRatio)))
334348 else if (if (!(_largerThanOrEqualTo))
335349 then (remainingMarginRatio >= 0)
336350 else false)
337351 then throw(((("Invalid margin: " + toString(_marginRatio)) + " > ") + toString(_baseMarginRatio)))
338352 else true
339353 }
340354
341355
342356 func latestCumulativePremiumFraction (_positionSize) = if ((_positionSize == 0))
343357 then throw("Should not be called with _positionSize == 0")
344358 else if ((_positionSize > 0))
345359 then latestLongCumulativePremiumFraction()
346360 else latestShortCumulativePremiumFraction()
347361
348362
349363 func getPosition (_trader,_direction) = {
350364 let positionKey = ((_trader + "_") + toString(_direction))
351365 let positionSizeOpt = getInteger(this, toCompositeKey(k_positionSize, positionKey))
352366 match positionSizeOpt {
353367 case positionSize: Int =>
354368 $Tuple5(positionSize, getIntegerValue(this, toCompositeKey(k_positionMargin, positionKey)), getIntegerValue(this, toCompositeKey(k_positionOpenNotional, positionKey)), getIntegerValue(this, toCompositeKey(k_positionLastUpdatedCumulativePremiumFraction, positionKey)), getIntegerValue(this, toCompositeKey(k_positionLastUpdatedTimestamp, positionKey)))
355369 case _ =>
356370 $Tuple5(0, 0, 0, 0, 0)
357371 }
358372 }
359373
360374
361375 func getDirection (_positionSize) = if ((0 > _positionSize))
362376 then DIR_SHORT
363377 else DIR_LONG
364378
365379
366380 func getPositionFee (_trader,_direction) = {
367381 let positionKey = ((_trader + "_") + toString(_direction))
368382 let positionFeeOpt = getInteger(this, toCompositeKey(k_positionFee, positionKey))
369383 match positionFeeOpt {
370384 case positionFee: Int =>
371385 positionFee
372386 case _ =>
373387 fee()
374388 }
375389 }
376390
377391
378392 func requireOpenPosition (_trader,_direction) = if ((getPosition(_trader, _direction)._1 == 0))
379393 then throw("No open position")
380394 else true
381395
382396
383397 func getOracleData (key) = {
384398 let oracleDataStr = getString(this, key)
385399 if (if (isDefined(oracleDataStr))
386400 then (value(oracleDataStr) != "")
387401 else false)
388402 then {
389403 let oracleData = split(value(oracleDataStr), ",")
390404 let oracleAddress = valueOrErrorMessage(addressFromString(oracleData[0]), ("Invalid oracle address in: " + value(oracleDataStr)))
391405 let priceKey = oracleData[1]
392406 let blockKey = oracleData[2]
393407 let openKey = oracleData[3]
394408 $Tuple4(oracleAddress, priceKey, blockKey, openKey)
395409 }
396410 else unit
397411 }
398412
399413
400414 func initialized () = valueOrElse(getBoolean(this, k_initialized), false)
401415
402416
403417 func paused () = valueOrElse(getBoolean(this, k_paused), false)
404418
405419
406420 func closeOnly () = valueOrElse(getBoolean(this, k_closeOnly), false)
407421
408422
409423 func updateReserve (_isAdd,_quoteAssetAmount,_baseAssetAmount) = if (_isAdd)
410424 then {
411425 let newBase = (bsAstR() - _baseAssetAmount)
412426 if ((0 >= newBase))
413427 then throw("Tx lead to base asset reserve <= 0, revert")
414428 else $Tuple3((qtAstR() + _quoteAssetAmount), newBase, (totalPositionSize() + _baseAssetAmount))
415429 }
416430 else {
417431 let newQuote = (qtAstR() - _quoteAssetAmount)
418432 if ((0 >= newQuote))
419433 then throw("Tx lead to base quote reserve <= 0, revert")
420434 else $Tuple3(newQuote, (bsAstR() + _baseAssetAmount), (totalPositionSize() - _baseAssetAmount))
421435 }
422436
423437
424438 func calcInvariant (_qtAstR,_bsAstR) = {
425439 let bqtAstR = toBigInt(_qtAstR)
426440 let bbsAstR = toBigInt(_bsAstR)
427441 bmuld(bqtAstR, bbsAstR)
428442 }
429443
430444
431445 func swapInput (_isAdd,_quoteAssetAmount) = {
432446 let _qtAstR = qtAstR()
433447 let _bsAstR = bsAstR()
434448 let _qtAstW = qtAstW()
435449 let _bsAstW = bsAstW()
436450 let quoteAssetAmountAdjusted = divd(_quoteAssetAmount, _qtAstW)
437451 let k = calcInvariant(_qtAstR, _bsAstR)
438452 let quoteAssetReserveAfter = if (_isAdd)
439453 then (_qtAstR + quoteAssetAmountAdjusted)
440454 else (_qtAstR - quoteAssetAmountAdjusted)
441455 let baseAssetReserveAfter = toInt(bdivd(k, toBigInt(quoteAssetReserveAfter)))
442456 let amountBaseAssetBoughtAbs = abs((baseAssetReserveAfter - _bsAstR))
443457 let amountBaseAssetBought = if (_isAdd)
444458 then amountBaseAssetBoughtAbs
445459 else -(amountBaseAssetBoughtAbs)
446- let $t01592616096 = updateReserve(_isAdd, quoteAssetAmountAdjusted, amountBaseAssetBoughtAbs)
447- let quoteAssetReserveAfter1 = $t01592616096._1
448- let baseAssetReserveAfter1 = $t01592616096._2
449- let totalPositionSizeAfter1 = $t01592616096._3
460+ let $t01636716537 = updateReserve(_isAdd, quoteAssetAmountAdjusted, amountBaseAssetBoughtAbs)
461+ let quoteAssetReserveAfter1 = $t01636716537._1
462+ let baseAssetReserveAfter1 = $t01636716537._2
463+ let totalPositionSizeAfter1 = $t01636716537._3
450464 let priceBefore = divd(muld(_qtAstR, _qtAstW), muld(_bsAstR, _bsAstW))
451465 let marketPrice = divd(_quoteAssetAmount, amountBaseAssetBoughtAbs)
452466 let priceDiff = abs((priceBefore - marketPrice))
453467 let priceImpact = (DECIMAL_UNIT - divd(priceBefore, (priceBefore + priceDiff)))
454468 let maxPriceImpactValue = maxPriceImpact()
455469 if ((priceImpact > maxPriceImpactValue))
456470 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)))
457471 else $Tuple4(amountBaseAssetBought, quoteAssetReserveAfter1, baseAssetReserveAfter1, totalPositionSizeAfter1)
458472 }
459473
460474
461475 func calcRolloverFee (_oldPositionMargin,_oldPositionLastUpdatedTimestamp) = {
462476 let positionMinutes = ((((lastTimestamp() - _oldPositionLastUpdatedTimestamp) / 1000) / 60) * DECIMAL_UNIT)
463477 let rolloverFee = divd(muld(muld(_oldPositionMargin, positionMinutes), rolloverFeeRate()), MINUTES_IN_YEAR)
464478 rolloverFee
465479 }
466480
467481
468482 func calcRemainMarginWithFundingPaymentAndRolloverFee (_oldPositionSize,_oldPositionMargin,_oldPositionCumulativePremiumFraction,_oldPositionLastUpdatedTimestamp,_marginDelta) = {
469483 let fundingPayment = if ((_oldPositionSize != 0))
470484 then {
471485 let _latestCumulativePremiumFraction = latestCumulativePremiumFraction(_oldPositionSize)
472486 muld((_latestCumulativePremiumFraction - _oldPositionCumulativePremiumFraction), _oldPositionSize)
473487 }
474488 else 0
475489 let rolloverFee = calcRolloverFee(_oldPositionMargin, _oldPositionLastUpdatedTimestamp)
476490 let signedMargin = (((_marginDelta - rolloverFee) - fundingPayment) + _oldPositionMargin)
477- let $t01876318890 = if ((0 > signedMargin))
491+ let $t01920419331 = if ((0 > signedMargin))
478492 then $Tuple2(0, abs(signedMargin))
479493 else $Tuple2(abs(signedMargin), 0)
480- let remainMargin = $t01876318890._1
481- let badDebt = $t01876318890._2
494+ let remainMargin = $t01920419331._1
495+ let badDebt = $t01920419331._2
482496 $Tuple4(remainMargin, badDebt, fundingPayment, rolloverFee)
483497 }
484498
485499
486500 func swapOutputWithReserves (_isAdd,_baseAssetAmount,_checkMaxPriceImpact,_quoteAssetReserve,_quoteAssetWeight,_baseAssetReserve,_baseAssetWeight) = {
487501 let priceBefore = divd(muld(_quoteAssetReserve, _quoteAssetWeight), muld(_baseAssetReserve, _baseAssetWeight))
488502 if ((_baseAssetAmount == 0))
489503 then throw("Invalid base asset amount")
490504 else {
491505 let k = calcInvariant(_quoteAssetReserve, _baseAssetReserve)
492506 let baseAssetPoolAmountAfter = if (_isAdd)
493507 then (_baseAssetReserve + _baseAssetAmount)
494508 else (_baseAssetReserve - _baseAssetAmount)
495509 let quoteAssetAfter = toInt(bdivd(k, toBigInt(baseAssetPoolAmountAfter)))
496510 let quoteAssetDelta = abs((quoteAssetAfter - _quoteAssetReserve))
497511 let quoteAssetSold = muld(quoteAssetDelta, _quoteAssetWeight)
498512 let maxPriceImpactValue = maxPriceImpact()
499- let $t02015220314 = updateReserve(!(_isAdd), quoteAssetDelta, _baseAssetAmount)
500- let quoteAssetReserveAfter1 = $t02015220314._1
501- let baseAssetReserveAfter1 = $t02015220314._2
502- let totalPositionSizeAfter1 = $t02015220314._3
513+ let $t02059320755 = updateReserve(!(_isAdd), quoteAssetDelta, _baseAssetAmount)
514+ let quoteAssetReserveAfter1 = $t02059320755._1
515+ let baseAssetReserveAfter1 = $t02059320755._2
516+ let totalPositionSizeAfter1 = $t02059320755._3
503517 let marketPrice = divd(quoteAssetSold, _baseAssetAmount)
504518 let priceDiff = abs((priceBefore - marketPrice))
505519 let priceImpact = (DECIMAL_UNIT - divd(priceBefore, (priceBefore + priceDiff)))
506520 if (if ((priceImpact > maxPriceImpactValue))
507521 then _checkMaxPriceImpact
508522 else false)
509523 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)))
510524 else $Tuple7(quoteAssetSold, quoteAssetReserveAfter1, baseAssetReserveAfter1, totalPositionSizeAfter1, (totalLongPositionSize() - (if (_isAdd)
511525 then abs(_baseAssetAmount)
512526 else 0)), (totalShortPositionSize() - (if (!(_isAdd))
513527 then abs(_baseAssetAmount)
514528 else 0)), priceImpact)
515529 }
516530 }
517531
518532
519533 func swapOutput (_isAdd,_baseAssetAmount,_checkMaxPriceImpact) = swapOutputWithReserves(_isAdd, _baseAssetAmount, _checkMaxPriceImpact, qtAstR(), qtAstW(), bsAstR(), bsAstW())
520534
521535
522536 func getOraclePriceValue (oracle,priceKey,blockKey) = {
523537 let lastValue = valueOrErrorMessage(getInteger(oracle, priceKey), ((("Can not get oracle price. Oracle: " + toString(oracle)) + " key: ") + priceKey))
524538 if ((blockKey != ""))
525539 then {
526540 let currentBlock = height
527541 let lastOracleBlock = valueOrErrorMessage(getInteger(oracle, blockKey), ((("Can not get oracle block. Oracle: " + toString(oracle)) + " key: ") + blockKey))
528542 if (((currentBlock - lastOracleBlock) > maxOracleDelay()))
529543 then throw(((("Oracle stale data. Last oracle block: " + toString(lastOracleBlock)) + " current block: ") + toString(currentBlock)))
530544 else lastValue
531545 }
532546 else lastValue
533547 }
534548
535549
536550 func getOraclePrice () = {
537551 let baseOracle = valueOrErrorMessage(getOracleData(k_baseOracle), "No base asset oracle data")
538552 let baseOraclePrice = getOraclePriceValue(baseOracle._1, baseOracle._2, baseOracle._3)
539553 let quoteOracle = getOracleData(k_quoteOracle)
540554 let quoteOraclePrice = if (isDefined(quoteOracle))
541555 then {
542556 let quoteOracleV = value(quoteOracle)
543557 getOraclePriceValue(quoteOracleV._1, quoteOracleV._2, quoteOracleV._3)
544558 }
545559 else DECIMAL_UNIT
546560 divd(baseOraclePrice, quoteOraclePrice)
547561 }
548562
549563
550564 func isMarketClosed () = {
551565 let baseOracle = valueOrErrorMessage(getOracleData(k_baseOracle), "No base asset oracle data")
552566 let oracle = baseOracle._1
553567 let openKey = baseOracle._4
554568 if ((openKey != ""))
555569 then {
556570 let isOpen = valueOrErrorMessage(getBoolean(oracle, openKey), ((("Can not get oracle is open/closed. Oracle: " + toString(oracle)) + " key: ") + openKey))
557571 !(isOpen)
558572 }
559573 else false
560574 }
561575
562576
563577 func absPriceDiff (_oraclePrice,_quoteAssetReserve,_baseAssetReserve,_qtAstW,_bsAstW) = {
564578 let priceAfter = divd(muld(_quoteAssetReserve, _qtAstW), muld(_baseAssetReserve, _bsAstW))
565579 let averagePrice = divd((_oraclePrice + priceAfter), (2 * DECIMAL_UNIT))
566580 let absPriceDiff = divd(abs((_oraclePrice - priceAfter)), averagePrice)
567581 absPriceDiff
568582 }
569583
570584
571585 func requireNotOverSpreadLimit (_quoteAssetReserve,_baseAssetReserve) = {
572586 let oraclePrice = getOraclePrice()
573587 let _qtAstW = qtAstW()
574588 let _bsAstW = bsAstW()
575589 let absPriceDiffBefore = absPriceDiff(oraclePrice, qtAstR(), bsAstR(), _qtAstW, _bsAstW)
576590 let absPriceDiffAfter = absPriceDiff(oraclePrice, _quoteAssetReserve, _baseAssetReserve, _qtAstW, _bsAstW)
577591 if (if ((absPriceDiffAfter > maxPriceSpread()))
578592 then (absPriceDiffAfter > absPriceDiffBefore)
579593 else false)
580594 then throw(((("Price spread " + toString(absPriceDiffAfter)) + " > max price spread ") + toString(maxPriceSpread())))
581595 else true
582596 }
583597
584598
585599 func requireNotOverMaxOpenNotional (_longOpenNotional,_shortOpenNotional) = {
586600 let _maxOpenNotional = maxOpenNotional()
587601 if ((_longOpenNotional > _maxOpenNotional))
588602 then throw(((("Long open notional " + toString(_longOpenNotional)) + " > max open notional ") + toString(_maxOpenNotional)))
589603 else if ((_shortOpenNotional > _maxOpenNotional))
590604 then throw(((("Short open notional " + toString(_shortOpenNotional)) + " > max open notional ") + toString(_maxOpenNotional)))
591605 else true
592606 }
593607
594608
609+func requireSenderCanWorkWithPositions (_caller) = if ((positionMode() == POSITION_ORDER))
610+ then (_caller == ordersAddress())
611+ else true
612+
613+
595614 func getSpotPrice () = {
596615 let _quoteAssetReserve = qtAstR()
597616 let _baseAssetReserve = bsAstR()
598617 let _qtAstW = qtAstW()
599618 let _bsAstW = bsAstW()
600619 divd(muld(_quoteAssetReserve, _qtAstW), muld(_baseAssetReserve, _bsAstW))
601620 }
602621
603622
604623 func isOverFluctuationLimit () = {
605624 let oraclePrice = getOraclePrice()
606625 let currentPrice = getSpotPrice()
607626 (divd(abs((oraclePrice - currentPrice)), oraclePrice) > spreadLimit())
608627 }
609628
610629
611630 func getPositionAdjustedOpenNotional (_positionSize,_option,_quoteAssetReserve,_quoteAssetWeight,_baseAssetReserve,_baseAssetWeight) = {
612631 let positionSizeAbs = abs(_positionSize)
613632 let isShort = (0 > _positionSize)
614633 let positionNotional = if ((_option == PNL_OPTION_SPOT))
615634 then {
616635 let outPositionNotional = swapOutputWithReserves(!(isShort), positionSizeAbs, false, _quoteAssetReserve, _quoteAssetWeight, _baseAssetReserve, _baseAssetWeight)._1
617636 outPositionNotional
618637 }
619638 else muld(positionSizeAbs, getOraclePrice())
620639 positionNotional
621640 }
622641
623642
624643 func getPositionNotionalAndUnrealizedPnlByValues (_positionSize,_positionOpenNotional,_quoteAssetReserve,_quoteAssetWeight,_baseAssetReserve,_baseAssetWeight,_option) = if ((_positionSize == 0))
625644 then throw("Invalid position size")
626645 else {
627646 let isShort = (0 > _positionSize)
628647 let positionNotional = getPositionAdjustedOpenNotional(_positionSize, _option, _quoteAssetReserve, _quoteAssetWeight, _baseAssetReserve, _baseAssetWeight)
629648 let unrealizedPnl = if (isShort)
630649 then (_positionOpenNotional - positionNotional)
631650 else (positionNotional - _positionOpenNotional)
632651 $Tuple2(positionNotional, unrealizedPnl)
633652 }
634653
635654
636655 func getPositionNotionalAndUnrealizedPnl (_trader,_direction,_option) = {
637- let $t02819928339 = getPosition(_trader, _direction)
638- let positionSize = $t02819928339._1
639- let positionMargin = $t02819928339._2
640- let positionOpenNotional = $t02819928339._3
641- let positionLstUpdCPF = $t02819928339._4
656+ let $t02889629036 = getPosition(_trader, _direction)
657+ let positionSize = $t02889629036._1
658+ let positionMargin = $t02889629036._2
659+ let positionOpenNotional = $t02889629036._3
660+ let positionLstUpdCPF = $t02889629036._4
642661 getPositionNotionalAndUnrealizedPnlByValues(positionSize, positionOpenNotional, qtAstR(), qtAstW(), bsAstR(), bsAstW(), _option)
643662 }
644663
645664
646665 func calcMarginRatio (_remainMargin,_badDebt,_positionNotional) = divd((_remainMargin - _badDebt), _positionNotional)
647666
648667
649668 func getMarginRatioByOption (_trader,_direction,_option) = {
650- let $t02887129024 = getPosition(_trader, _direction)
651- let positionSize = $t02887129024._1
652- let positionMargin = $t02887129024._2
653- let pon = $t02887129024._3
654- let positionLastUpdatedCPF = $t02887129024._4
655- let positionTimestamp = $t02887129024._5
656- let $t02903029135 = getPositionNotionalAndUnrealizedPnl(_trader, _direction, _option)
657- let positionNotional = $t02903029135._1
658- let unrealizedPnl = $t02903029135._2
659- let $t02914029352 = calcRemainMarginWithFundingPaymentAndRolloverFee(positionSize, positionMargin, positionLastUpdatedCPF, positionTimestamp, unrealizedPnl)
660- let remainMargin = $t02914029352._1
661- let badDebt = $t02914029352._2
669+ let $t02956829721 = getPosition(_trader, _direction)
670+ let positionSize = $t02956829721._1
671+ let positionMargin = $t02956829721._2
672+ let pon = $t02956829721._3
673+ let positionLastUpdatedCPF = $t02956829721._4
674+ let positionTimestamp = $t02956829721._5
675+ let $t02972729832 = getPositionNotionalAndUnrealizedPnl(_trader, _direction, _option)
676+ let positionNotional = $t02972729832._1
677+ let unrealizedPnl = $t02972729832._2
678+ let $t02983730049 = calcRemainMarginWithFundingPaymentAndRolloverFee(positionSize, positionMargin, positionLastUpdatedCPF, positionTimestamp, unrealizedPnl)
679+ let remainMargin = $t02983730049._1
680+ let badDebt = $t02983730049._2
662681 calcMarginRatio(remainMargin, badDebt, positionNotional)
663682 }
664683
665684
666685 func getMarginRatio (_trader,_direction) = getMarginRatioByOption(_trader, _direction, PNL_OPTION_SPOT)
667686
668687
669688 func getPartialLiquidationAmount (_trader,_positionSize) = {
670689 let maximumRatio = vmax(partialLiquidationRatio(), (DECIMAL_UNIT - divd(getMarginRatio(_trader, getDirection(_positionSize)), maintenanceMarginRatio())))
671690 let maxExchangedPositionSize = muld(abs(_positionSize), maximumRatio)
672691 let swapResult = swapOutput((_positionSize > 0), maxExchangedPositionSize, false)
673692 let maxExchangedQuoteAssetAmount = swapResult._1
674693 let priceImpact = swapResult._7
675694 if ((maxPriceImpact() > priceImpact))
676695 then maxExchangedPositionSize
677696 else muld(abs(_positionSize), partialLiquidationRatio())
678697 }
679698
680699
681700 func internalClosePosition (_trader,_direction,_size,_fee,_minQuoteAssetAmount,_addToMargin,_checkMaxPriceImpact,_liquidate) = {
682- let $t03051530683 = getPosition(_trader, _direction)
683- let oldPositionSize = $t03051530683._1
684- let oldPositionMargin = $t03051530683._2
685- let oldPositionOpenNotional = $t03051530683._3
686- let oldPositionLstUpdCPF = $t03051530683._4
687- let oldPositionTimestamp = $t03051530683._5
701+ let $t03121231380 = getPosition(_trader, _direction)
702+ let oldPositionSize = $t03121231380._1
703+ let oldPositionMargin = $t03121231380._2
704+ let oldPositionOpenNotional = $t03121231380._3
705+ let oldPositionLstUpdCPF = $t03121231380._4
706+ let oldPositionTimestamp = $t03121231380._5
688707 let isLongPosition = (oldPositionSize > 0)
689708 let absOldPositionSize = abs(oldPositionSize)
690709 if (if ((absOldPositionSize >= _size))
691710 then (_size > 0)
692711 else false)
693712 then {
694713 let isPartialClose = (absOldPositionSize > _size)
695- let $t03097531426 = swapOutput((oldPositionSize > 0), _size, _checkMaxPriceImpact)
696- let exchangedQuoteAssetAmount = $t03097531426._1
697- let quoteAssetReserveAfter = $t03097531426._2
698- let baseAssetReserveAfter = $t03097531426._3
699- let totalPositionSizeAfter = $t03097531426._4
714+ let $t03167232123 = swapOutput((oldPositionSize > 0), _size, _checkMaxPriceImpact)
715+ let exchangedQuoteAssetAmount = $t03167232123._1
716+ let quoteAssetReserveAfter = $t03167232123._2
717+ let baseAssetReserveAfter = $t03167232123._3
718+ let totalPositionSizeAfter = $t03167232123._4
700719 let exchangedPositionSize = if ((oldPositionSize > 0))
701720 then -(_size)
702721 else _size
703- let $t03164131865 = getPositionNotionalAndUnrealizedPnl(_trader, _direction, PNL_OPTION_SPOT)
704- let oldPositionNotional = $t03164131865._1
705- let unrealizedPnl = $t03164131865._2
722+ let $t03233832562 = getPositionNotionalAndUnrealizedPnl(_trader, _direction, PNL_OPTION_SPOT)
723+ let oldPositionNotional = $t03233832562._1
724+ let unrealizedPnl = $t03233832562._2
706725 let realizedRatio = divd(abs(exchangedPositionSize), absOldPositionSize)
707726 let realizedPnl = muld(unrealizedPnl, realizedRatio)
708- let $t03220632452 = calcRemainMarginWithFundingPaymentAndRolloverFee(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, oldPositionTimestamp, unrealizedPnl)
709- let remainMarginBefore = $t03220632452._1
710- let x1 = $t03220632452._2
711- let x2 = $t03220632452._3
712- let rolloverFee = $t03220632452._4
727+ let $t03290333149 = calcRemainMarginWithFundingPaymentAndRolloverFee(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, oldPositionTimestamp, unrealizedPnl)
728+ let remainMarginBefore = $t03290333149._1
729+ let x1 = $t03290333149._2
730+ let x2 = $t03290333149._3
731+ let rolloverFee = $t03290333149._4
713732 let positionBadDebt = calcRemainMarginWithFundingPaymentAndRolloverFee(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, oldPositionTimestamp, realizedPnl)._2
714733 let realizedCloseFee = muld(muld(oldPositionNotional, realizedRatio), _fee)
715734 let unrealizedPnlAfter = (unrealizedPnl - realizedPnl)
716735 let remainOpenNotional = if ((oldPositionSize > 0))
717736 then ((oldPositionNotional - exchangedQuoteAssetAmount) - unrealizedPnlAfter)
718737 else ((unrealizedPnlAfter + oldPositionNotional) - exchangedQuoteAssetAmount)
719738 let newPositionSize = (oldPositionSize + exchangedPositionSize)
720- let $t03385834244 = if ((newPositionSize == 0))
739+ let $t03455534941 = if ((newPositionSize == 0))
721740 then $Tuple2(0, 0)
722741 else $Tuple2(abs(remainOpenNotional), latestCumulativePremiumFraction(newPositionSize))
723- let newPositionOpenNotional = $t03385834244._1
724- let newPositionLstUpdCPF = $t03385834244._2
742+ let newPositionOpenNotional = $t03455534941._1
743+ let newPositionLstUpdCPF = $t03455534941._2
725744 let openNotionalDelta = (oldPositionOpenNotional - newPositionOpenNotional)
726745 let marginRatio = getMarginRatioByOption(_trader, _direction, PNL_OPTION_SPOT)
727746 let newPositionMarginWithSameRatio = if ((oldPositionSize > 0))
728747 then (muld((newPositionOpenNotional + unrealizedPnlAfter), marginRatio) - unrealizedPnlAfter)
729748 else (muld((newPositionOpenNotional - unrealizedPnlAfter), marginRatio) - unrealizedPnlAfter)
730749 let marginToTraderRaw = ((remainMarginBefore - (newPositionMarginWithSameRatio + unrealizedPnlAfter)) - realizedCloseFee)
731750 let marginToTrader = if ((0 > marginToTraderRaw))
732751 then if (_liquidate)
733752 then 0
734753 else throw("Invalid internalClosePosition params: unable to pay fee")
735754 else marginToTraderRaw
736755 let newPositionMargin = if (_addToMargin)
737756 then (newPositionMarginWithSameRatio + marginToTrader)
738757 else newPositionMarginWithSameRatio
739758 if (if ((_minQuoteAssetAmount != 0))
740759 then (_minQuoteAssetAmount > exchangedQuoteAssetAmount)
741760 else false)
742761 then throw(((("Limit error: " + toString(exchangedQuoteAssetAmount)) + " < ") + toString(_minQuoteAssetAmount)))
743762 else $Tuple17(newPositionSize, newPositionMargin, newPositionOpenNotional, newPositionLstUpdCPF, positionBadDebt, realizedPnl, if (if (_addToMargin)
744763 then isPartialClose
745764 else false)
746765 then 0
747766 else marginToTrader, quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, (openInterestNotional() - openNotionalDelta), (totalLongPositionSize() - (if (isLongPosition)
748767 then abs(exchangedPositionSize)
749768 else 0)), (totalShortPositionSize() - (if (!(isLongPosition))
750769 then abs(exchangedPositionSize)
751770 else 0)), (openInterestLong() - (if (isLongPosition)
752771 then openNotionalDelta
753772 else 0)), (openInterestShort() - (if (!(isLongPosition))
754773 then openNotionalDelta
755774 else 0)), (realizedCloseFee + rolloverFee), exchangedQuoteAssetAmount)
756775 }
757776 else throw(((("Invalid internalClosePosition params: invalid position size: " + toString(_size)) + " max: ") + toString(absOldPositionSize)))
758777 }
759778
760779
761780 func getTerminalAmmState () = {
762781 let _positionSize = totalPositionSize()
763782 if ((_positionSize == 0))
764783 then $Tuple2(qtAstR(), bsAstR())
765784 else {
766785 let direction = (_positionSize > 0)
767- let $t03749137670 = swapOutput(direction, abs(_positionSize), false)
768- let currentNetMarketValue = $t03749137670._1
769- let terminalQuoteAssetReserve = $t03749137670._2
770- let terminalBaseAssetReserve = $t03749137670._3
786+ let $t03818838367 = swapOutput(direction, abs(_positionSize), false)
787+ let currentNetMarketValue = $t03818838367._1
788+ let terminalQuoteAssetReserve = $t03818838367._2
789+ let terminalBaseAssetReserve = $t03818838367._3
771790 $Tuple2(terminalQuoteAssetReserve, terminalBaseAssetReserve)
772791 }
773792 }
774793
775794
776795 func getQuoteAssetWeight (baseAssetReserve,totalPositionSize,quoteAssetReserve,targetPrice) = {
777796 let b = toBigInt(baseAssetReserve)
778797 let sz = toBigInt(totalPositionSize)
779798 let q = toBigInt(quoteAssetReserve)
780799 let p = toBigInt(targetPrice)
781800 let k = bmuld(q, b)
782801 let newB = (b + sz)
783802 let newQ = bdivd(k, newB)
784803 let z = bdivd(newQ, newB)
785804 let result = bdivd(p, z)
786805 toInt(result)
787806 }
788807
789808
790809 func getSyncTerminalPrice (_terminalPrice,_qtAstR,_bsAstR) = {
791810 let _positionSize = totalPositionSize()
792811 if ((_positionSize == 0))
793812 then {
794813 let newQtAstW = divd(muld(_terminalPrice, _bsAstR), _qtAstR)
795814 $Tuple3(newQtAstW, DECIMAL_UNIT, 0)
796815 }
797816 else {
798817 let direction = (_positionSize > 0)
799818 let currentNetMarketValue = swapOutput(direction, abs(_positionSize), false)._1
800819 let newQtAstW = getQuoteAssetWeight(_bsAstR, _positionSize, _qtAstR, _terminalPrice)
801820 let newBsAstW = DECIMAL_UNIT
802821 let marginToVault = getPositionNotionalAndUnrealizedPnlByValues(_positionSize, currentNetMarketValue, _qtAstR, newQtAstW, _bsAstR, newBsAstW, PNL_OPTION_SPOT)._2
803822 $Tuple3(newQtAstW, newBsAstW, marginToVault)
804823 }
805824 }
806825
807826
808827 func getFunding () = {
809828 let underlyingPrice = getOraclePrice()
810829 let spotPrice = getSpotPrice()
811830 let premium = (spotPrice - underlyingPrice)
812831 if (if (isMarketClosed())
813832 then true
814833 else if ((fundingMode() == FUNDING_ASYMMETRIC))
815834 then if ((totalShortPositionSize() == 0))
816835 then true
817836 else (totalLongPositionSize() == 0)
818837 else false)
819838 then $Tuple3(0, 0, 0)
820839 else if ((0 > premium))
821840 then {
822841 let shortPremiumFraction = divd(muld(premium, fundingPeriodDecimal()), ONE_DAY)
823842 if ((fundingMode() == FUNDING_ASYMMETRIC))
824843 then {
825844 let longPremiumFraction = divd(muld(shortPremiumFraction, totalShortPositionSize()), totalLongPositionSize())
826845 $Tuple3(shortPremiumFraction, longPremiumFraction, 0)
827846 }
828847 else {
829848 let shortTotalPremiumFraction = abs(muld(shortPremiumFraction, totalShortPositionSize()))
830849 let longTotalPremiumFraction = abs(muld(shortPremiumFraction, totalLongPositionSize()))
831850 let premiumToVault = (shortTotalPremiumFraction - longTotalPremiumFraction)
832851 $Tuple3(shortPremiumFraction, shortPremiumFraction, premiumToVault)
833852 }
834853 }
835854 else {
836855 let longPremiumFraction = divd(muld(premium, fundingPeriodDecimal()), ONE_DAY)
837856 if ((fundingMode() == FUNDING_ASYMMETRIC))
838857 then {
839858 let shortPremiumFraction = divd(muld(longPremiumFraction, totalLongPositionSize()), totalShortPositionSize())
840859 $Tuple3(shortPremiumFraction, longPremiumFraction, 0)
841860 }
842861 else {
843862 let longTotalPremiumFraction = abs(muld(longPremiumFraction, totalLongPositionSize()))
844863 let shortTotalPremiumFraction = abs(muld(longPremiumFraction, totalShortPositionSize()))
845864 let premiumToVault = (longTotalPremiumFraction - shortTotalPremiumFraction)
846865 $Tuple3(longPremiumFraction, longPremiumFraction, premiumToVault)
847866 }
848867 }
849868 }
850869
851870
852871 func getAdjustedFee (_artifactId,_baseFeeDiscount) = {
853872 let baseFeeRaw = fee()
854873 let baseFee = muld(baseFeeRaw, _baseFeeDiscount)
855- let $t04233442829 = if ((_artifactId != ""))
874+ let $t04303143526 = if ((_artifactId != ""))
856875 then {
857876 let artifactKind = strA(nftManagerAddress(), toCompositeKey(k_token_type, _artifactId))
858877 if ((artifactKind == FEE_REDUCTION_TOKEN_TYPE))
859878 then {
860879 let reduction = intA(nftManagerAddress(), toCompositeKey(k_token_param, _artifactId))
861880 let adjustedFee = muld(baseFee, reduction)
862881 $Tuple2(adjustedFee, true)
863882 }
864883 else throw("Invalid attached artifact")
865884 }
866885 else $Tuple2(baseFee, false)
867- let adjustedFee = $t04233442829._1
868- let burnArtifact = $t04233442829._2
886+ let adjustedFee = $t04303143526._1
887+ let burnArtifact = $t04303143526._2
869888 $Tuple2(adjustedFee, burnArtifact)
870889 }
871890
872891
873892 func getForTraderWithArtifact (_trader,_artifactId) = {
874893 let doGetFeeDiscount = invoke(minerAddress(), "computeFeeDiscount", [_trader], nil)
875894 if ((doGetFeeDiscount == doGetFeeDiscount))
876895 then {
877896 let feeDiscount = match doGetFeeDiscount {
878897 case x: Int =>
879898 x
880899 case _ =>
881900 throw("Invalid computeFeeDiscount result")
882901 }
883- let $t04317543249 = getAdjustedFee(_artifactId, feeDiscount)
884- let adjustedFee = $t04317543249._1
885- let burnArtifact = $t04317543249._2
902+ let $t04387243946 = getAdjustedFee(_artifactId, feeDiscount)
903+ let adjustedFee = $t04387243946._1
904+ let burnArtifact = $t04387243946._2
886905 $Tuple2(adjustedFee, burnArtifact)
887906 }
888907 else throw("Strict value is not equal to itself.")
889908 }
890909
891910
892911 func getArtifactId (i) = {
893912 let artifactId = if ((size(i.payments) > 1))
894913 then toBase58String(valueOrErrorMessage(i.payments[1].assetId, "Invalid artifactId"))
895914 else ""
896915 artifactId
897916 }
898917
899918
900919 func distributeFee (_feeAmount) = {
901920 let feeToStakers = muld(_feeAmount, feeToStakersPercent())
902921 let feeToVault = (_feeAmount - feeToStakers)
903922 $Tuple2(feeToStakers, feeToVault)
904923 }
905924
906925
907-func updateSettings (_initMarginRatio,_mmr,_liquidationFeeRatio,_fundingPeriod,_fee,_spreadLimit,_maxPriceImpact,_partialLiquidationRatio,_maxPriceSpread,_maxOpenNotional,_feeToStakersPercent,_maxOracleDelay,_rolloverFee,_fundingMode,_oracleMode) = [IntegerEntry(k_initMarginRatio, _initMarginRatio), IntegerEntry(k_maintenanceMarginRatio, _mmr), IntegerEntry(k_liquidationFeeRatio, _liquidationFeeRatio), IntegerEntry(k_fundingPeriod, _fundingPeriod), IntegerEntry(k_fee, _fee), IntegerEntry(k_spreadLimit, _spreadLimit), IntegerEntry(k_maxPriceImpact, _maxPriceImpact), IntegerEntry(k_partialLiquidationRatio, _partialLiquidationRatio), IntegerEntry(k_maxPriceSpread, _maxPriceSpread), IntegerEntry(k_maxOpenNotional, _maxOpenNotional), IntegerEntry(k_feeToStakersPercent, _feeToStakersPercent), IntegerEntry(k_maxOracleDelay, _maxOracleDelay), IntegerEntry(k_rolloverFee, _rolloverFee), IntegerEntry(k_fundingMode, _fundingMode), IntegerEntry(k_oracleMode, _oracleMode)]
926+func updateSettings (_initMarginRatio,_mmr,_liquidationFeeRatio,_fundingPeriod,_fee,_spreadLimit,_maxPriceImpact,_partialLiquidationRatio,_maxPriceSpread,_maxOpenNotional,_feeToStakersPercent,_maxOracleDelay,_rolloverFee,_fundingMode,_oracleMode,_minInitMarginRatio,_positionMode) = [IntegerEntry(k_initMarginRatio, _initMarginRatio), IntegerEntry(k_minInitMarginRatio, _minInitMarginRatio), IntegerEntry(k_maintenanceMarginRatio, _mmr), IntegerEntry(k_liquidationFeeRatio, _liquidationFeeRatio), IntegerEntry(k_fundingPeriod, _fundingPeriod), IntegerEntry(k_fee, _fee), IntegerEntry(k_spreadLimit, _spreadLimit), IntegerEntry(k_maxPriceImpact, _maxPriceImpact), IntegerEntry(k_partialLiquidationRatio, _partialLiquidationRatio), IntegerEntry(k_maxPriceSpread, _maxPriceSpread), IntegerEntry(k_maxOpenNotional, _maxOpenNotional), IntegerEntry(k_feeToStakersPercent, _feeToStakersPercent), IntegerEntry(k_maxOracleDelay, _maxOracleDelay), IntegerEntry(k_rolloverFee, _rolloverFee), IntegerEntry(k_fundingMode, _fundingMode), IntegerEntry(k_oracleMode, _oracleMode), IntegerEntry(k_positionMode, _positionMode)]
908927
909928
910929 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)]
911930
912931
913932 func incrementPositionSequenceNumber (_isNewPosition,_trader,_direction) = {
914933 let positionKey = ((_trader + "_") + toString(_direction))
915934 if (_isNewPosition)
916935 then {
917936 let currentSequence = lastSequence()
918937 [IntegerEntry(toCompositeKey(k_positionSequence, positionKey), (currentSequence + 1)), IntegerEntry(k_sequence, (currentSequence + 1))]
919938 }
920939 else nil
921940 }
922941
923942
924943 func updatePositionFee (_isNewPosition,_trader,_direction,_fee) = {
925944 let positionKey = ((_trader + "_") + toString(_direction))
926945 if (_isNewPosition)
927946 then [IntegerEntry(toCompositeKey(k_positionFee, positionKey), _fee)]
928947 else nil
929948 }
930949
931950
932951 func updatePosition (_trader,_size,_margin,_openNotional,_latestCumulativePremiumFraction,_latestTimestamp) = {
933952 let direction = getDirection(_size)
934953 let positionKey = ((_trader + "_") + toString(direction))
935954 [IntegerEntry(toCompositeKey(k_positionSize, positionKey), _size), IntegerEntry(toCompositeKey(k_positionMargin, positionKey), _margin), IntegerEntry(toCompositeKey(k_positionOpenNotional, positionKey), _openNotional), IntegerEntry(toCompositeKey(k_positionLastUpdatedCumulativePremiumFraction, positionKey), _latestCumulativePremiumFraction), IntegerEntry(toCompositeKey(k_positionLastUpdatedTimestamp, positionKey), _latestTimestamp)]
936955 }
937956
938957
939958 func updateAmmReserves (_qtAstR,_bsAstR) = if (if ((0 > _qtAstR))
940959 then true
941960 else (0 > _bsAstR))
942961 then throw("Invalid amount to update reserves")
943962 else if (if ((_qtAstR != qtAstR0()))
944963 then true
945964 else (_bsAstR != bsAstR0()))
946965 then [IntegerEntry(k_quoteAssetReserve, _qtAstR), IntegerEntry(k_baseAssetReserve, _bsAstR)]
947966 else nil
948967
949968
950969 func updateAmmWeights (_qtAstW,_bsAstW) = if (if ((_qtAstW != qtAstW()))
951970 then true
952971 else (_bsAstW != bsAstW()))
953972 then [IntegerEntry(k_quoteAssetWeight, _qtAstW), IntegerEntry(k_baseAssetWeight, _bsAstW)]
954973 else nil
955974
956975
957976 func updateAmm (_qtAstR,_bsAstR,_totalPositionSizeAfter,_openInterestNotional,_totalLongPositionSize,_totalShortPositionSize,_totalLongOpenNotional,_totalShortOpenNotional) = {
958977 let _qtAstW = qtAstW()
959978 let _bsAstW = bsAstW()
960979 if (((_totalLongPositionSize - _totalShortPositionSize) != _totalPositionSizeAfter))
961980 then throw(((((("Invalid AMM state data: " + toString(_totalLongPositionSize)) + " - ") + toString(_totalShortPositionSize)) + " != ") + toString(_totalPositionSizeAfter)))
962981 else (updateAmmReserves(_qtAstR, _bsAstR) ++ [IntegerEntry(k_totalPositionSize, _totalPositionSizeAfter), IntegerEntry(k_openInterestNotional, _openInterestNotional), IntegerEntry(k_totalLongPositionSize, _totalLongPositionSize), IntegerEntry(k_totalShortPositionSize, _totalShortPositionSize), IntegerEntry(k_openInterestLong, _totalLongOpenNotional), IntegerEntry(k_openInterestShort, _totalShortOpenNotional)])
963982 }
964983
965984
966985 func deletePosition (_trader,_direction) = {
967986 let positionKey = ((_trader + "_") + toString(_direction))
968987 [DeleteEntry(toCompositeKey(k_positionSize, positionKey)), DeleteEntry(toCompositeKey(k_positionMargin, positionKey)), DeleteEntry(toCompositeKey(k_positionOpenNotional, positionKey)), DeleteEntry(toCompositeKey(k_positionLastUpdatedCumulativePremiumFraction, positionKey)), DeleteEntry(toCompositeKey(k_positionFee, positionKey)), DeleteEntry(toCompositeKey(k_positionLastUpdatedTimestamp, positionKey))]
969988 }
970989
971990
972991 func withdraw (_address,_amount) = {
973992 let balance = assetBalance(this, quoteAsset())
974993 if ((_amount > balance))
975994 then throw(((("Unable to withdraw " + toString(_amount)) + " from contract balance ") + toString(balance)))
976995 else [ScriptTransfer(_address, _amount, quoteAsset())]
977996 }
978997
979998
980999 func updateBalance (_balance) = if ((0 > _balance))
9811000 then throw("Balance")
9821001 else if (if ((cbalance0() == 0))
9831002 then true
9841003 else (cbalance0() != _balance))
9851004 then [IntegerEntry(k_balance, _balance)]
9861005 else nil
9871006
9881007
9891008 func transferFee (i) = [ScriptTransfer(stakingAddress(), i, quoteAsset())]
9901009
9911010
9921011 func doBurnArtifact (_burnArtifact,i) = if (_burnArtifact)
9931012 then [Burn(valueOrErrorMessage(i.payments[1].assetId, "Invalid artifact"), 1)]
9941013 else nil
9951014
9961015
9971016 @Callable(i)
9981017 func pause () = if ((i.caller != adminAddress()))
9991018 then throw("Invalid pause params")
10001019 else [BooleanEntry(k_paused, true)]
10011020
10021021
10031022
10041023 @Callable(i)
10051024 func unpause () = if ((i.caller != adminAddress()))
10061025 then throw("Invalid unpause params")
10071026 else [BooleanEntry(k_paused, false)]
10081027
10091028
10101029
10111030 @Callable(i)
10121031 func setCloseOnly () = if ((i.caller != adminAddress()))
10131032 then throw("Invalid setCloseOnly params")
10141033 else [BooleanEntry(k_closeOnly, true)]
10151034
10161035
10171036
10181037 @Callable(i)
10191038 func unsetCloseOnly () = if ((i.caller != adminAddress()))
10201039 then throw("Invalid unsetCloseOnly params")
10211040 else [BooleanEntry(k_closeOnly, false)]
10221041
10231042
10241043
10251044 @Callable(i)
10261045 func changeLiquidity (_quoteAssetAmount) = if (if ((i.caller != adminAddress()))
10271046 then true
10281047 else (_quoteAssetAmount == 0))
10291048 then throw("Invalid changeLiquidity params")
10301049 else {
10311050 let _qtAstR = qtAstR()
10321051 let _bsAstR = bsAstR()
10331052 let _qtAstW = qtAstW()
10341053 let _bsAstW = bsAstW()
10351054 let price = divd(muld(_qtAstR, _qtAstW), muld(_bsAstR, _bsAstW))
10361055 let qtAstRAfter = (_qtAstR + _quoteAssetAmount)
10371056 let baseAssetAmountToAdd = (divd(muld(qtAstRAfter, _qtAstW), price) - _bsAstR)
10381057 let bsAstRAfter = (_bsAstR + baseAssetAmountToAdd)
1039- let $t05197452125 = getSyncTerminalPrice(getOraclePrice(), qtAstRAfter, bsAstRAfter)
1040- let newQuoteAssetWeight = $t05197452125._1
1041- let newBaseAssetWeight = $t05197452125._2
1042- let marginToVault = $t05197452125._3
1058+ let $t05283152982 = getSyncTerminalPrice(getOraclePrice(), qtAstRAfter, bsAstRAfter)
1059+ let newQuoteAssetWeight = $t05283152982._1
1060+ let newBaseAssetWeight = $t05283152982._2
1061+ let marginToVault = $t05283152982._3
10431062 let doExchangePnL = if ((marginToVault != 0))
10441063 then {
10451064 let doExchangePnL = invoke(vaultAddress(), "exchangeFreeAndLocked", [marginToVault], nil)
10461065 if ((doExchangePnL == doExchangePnL))
10471066 then nil
10481067 else throw("Strict value is not equal to itself.")
10491068 }
10501069 else nil
10511070 if ((doExchangePnL == doExchangePnL))
10521071 then (updateAmmReserves(qtAstRAfter, bsAstRAfter) ++ updateAmmWeights(newQuoteAssetWeight, newBaseAssetWeight))
10531072 else throw("Strict value is not equal to itself.")
10541073 }
10551074
10561075
10571076
10581077 @Callable(i)
1059-func changeSettings (_initMarginRatio,_mmr,_liquidationFeeRatio,_fundingPeriod,_fee,_spreadLimit,_maxPriceImpact,_partialLiquidationRatio,_maxPriceSpread,_maxOpenNotional,_feeToStakersPercent,_maxOracleDelay,_rolloverFee,_fundingMode,_oracleMode,_baseOracleData,_quoteOracleData) = if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if ((0 >= _fundingPeriod))
1078+func changeSettings (_initMarginRatio,_mmr,_liquidationFeeRatio,_fundingPeriod,_fee,_spreadLimit,_maxPriceImpact,_partialLiquidationRatio,_maxPriceSpread,_maxOpenNotional,_feeToStakersPercent,_maxOracleDelay,_rolloverFee,_fundingMode,_oracleMode,_baseOracleData,_quoteOracleData,_minInitMarginRatio,_positionMode) = if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if ((0 >= _fundingPeriod))
10601079 then true
10611080 else (0 >= _initMarginRatio))
10621081 then true
1063- else (0 >= _mmr))
1082+ else (_initMarginRatio > DECIMAL_UNIT))
10641083 then true
1065- else (0 >= _liquidationFeeRatio))
1084+ else (0 >= _minInitMarginRatio))
10661085 then true
1067- else (0 >= _fee))
1086+ else (_minInitMarginRatio > DECIMAL_UNIT))
10681087 then true
1069- else (0 >= _spreadLimit))
1070- then true
1071- else (0 >= _maxPriceImpact))
1072- then true
1073- else (0 >= _partialLiquidationRatio))
1074- then true
1075- else (0 >= _maxPriceSpread))
1076- then true
1077- else (0 >= _maxOpenNotional))
1078- then true
1079- else (0 >= _feeToStakersPercent))
1080- then true
1081- else (_feeToStakersPercent > DECIMAL_UNIT))
1082- then true
1083- else (0 >= _maxOracleDelay))
1084- then true
1085- else (0 >= _rolloverFee))
1086- then true
1087- else if ((_fundingMode != FUNDING_SYMMETRIC))
1088- then (_fundingMode != FUNDING_ASYMMETRIC)
1089- else false)
1090- then true
1091- else if ((_oracleMode != ORACLE_PLAIN))
1092- then (_oracleMode != ORACLE_JIT)
1093- else false)
1094- then true
1095- else !(initialized()))
1096- then true
1097- else (i.caller != adminAddress()))
1098- then throw("Invalid changeSettings params")
1099- else (updateSettings(_initMarginRatio, _mmr, _liquidationFeeRatio, _fundingPeriod, _fee, _spreadLimit, _maxPriceImpact, _partialLiquidationRatio, _maxPriceSpread, _maxOpenNotional, _feeToStakersPercent, _maxOracleDelay, _rolloverFee, _fundingMode, _oracleMode) ++ [StringEntry(k_baseOracle, _baseOracleData), StringEntry(k_quoteOracle, _quoteOracleData)])
1100-
1101-
1102-
1103-@Callable(i)
1104-func initialize (_qtAstR,_bsAstR,_fundingPeriod,_initMarginRatio,_mmr,_liquidationFeeRatio,_fee,_baseOracleData,_quoteOracleData,_coordinator,_spreadLimit,_maxPriceImpact,_partialLiquidationRatio,_maxPriceSpread,_maxOpenNotional,_feeToStakersPercent,_maxOracleDelay,_rolloverFee,_fundingMode,_oracleMode) = if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if ((0 >= _qtAstR))
1105- then true
1106- else (0 >= _bsAstR))
1107- then true
1108- else (0 >= _fundingPeriod))
1109- then true
1110- else (0 >= _initMarginRatio))
1088+ else (_initMarginRatio > _minInitMarginRatio))
11111089 then true
11121090 else (0 >= _mmr))
11131091 then true
11141092 else (0 >= _liquidationFeeRatio))
11151093 then true
11161094 else (0 >= _fee))
11171095 then true
11181096 else (0 >= _spreadLimit))
11191097 then true
11201098 else (0 >= _maxPriceImpact))
11211099 then true
11221100 else (0 >= _partialLiquidationRatio))
11231101 then true
11241102 else (0 >= _maxPriceSpread))
11251103 then true
11261104 else (0 >= _maxOpenNotional))
11271105 then true
11281106 else (0 >= _feeToStakersPercent))
11291107 then true
11301108 else (_feeToStakersPercent > DECIMAL_UNIT))
11311109 then true
11321110 else (0 > _maxOracleDelay))
11331111 then true
11341112 else (0 >= _rolloverFee))
11351113 then true
11361114 else if ((_fundingMode != FUNDING_SYMMETRIC))
11371115 then (_fundingMode != FUNDING_ASYMMETRIC)
11381116 else false)
11391117 then true
11401118 else if ((_oracleMode != ORACLE_PLAIN))
11411119 then (_oracleMode != ORACLE_JIT)
11421120 else false)
11431121 then true
1122+ else if ((_positionMode != POSITION_DIRECT))
1123+ then (_positionMode != POSITION_ORDER)
1124+ else false)
1125+ then true
1126+ else !(initialized()))
1127+ then true
1128+ else (i.caller != adminAddress()))
1129+ then throw("Invalid changeSettings params")
1130+ else (updateSettings(_initMarginRatio, _mmr, _liquidationFeeRatio, _fundingPeriod, _fee, _spreadLimit, _maxPriceImpact, _partialLiquidationRatio, _maxPriceSpread, _maxOpenNotional, _feeToStakersPercent, _maxOracleDelay, _rolloverFee, _fundingMode, _oracleMode, _minInitMarginRatio, _positionMode) ++ [StringEntry(k_baseOracle, _baseOracleData), StringEntry(k_quoteOracle, _quoteOracleData)])
1131+
1132+
1133+
1134+@Callable(i)
1135+func initialize (_qtAstR,_bsAstR,_fundingPeriod,_initMarginRatio,_mmr,_liquidationFeeRatio,_fee,_baseOracleData,_quoteOracleData,_coordinator,_spreadLimit,_maxPriceImpact,_partialLiquidationRatio,_maxPriceSpread,_maxOpenNotional,_feeToStakersPercent,_maxOracleDelay,_rolloverFee,_fundingMode,_oracleMode,_minInitMarginRatio,_positionMode) = if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if ((0 >= _qtAstR))
1136+ then true
1137+ else (0 >= _bsAstR))
1138+ then true
1139+ else (0 >= _fundingPeriod))
1140+ then true
1141+ else (0 >= _initMarginRatio))
1142+ then true
1143+ else (_initMarginRatio > DECIMAL_UNIT))
1144+ then true
1145+ else (0 >= _minInitMarginRatio))
1146+ then true
1147+ else (_minInitMarginRatio > DECIMAL_UNIT))
1148+ then true
1149+ else (_initMarginRatio > _minInitMarginRatio))
1150+ then true
1151+ else (0 >= _mmr))
1152+ then true
1153+ else (0 >= _liquidationFeeRatio))
1154+ then true
1155+ else (0 >= _fee))
1156+ then true
1157+ else (0 >= _spreadLimit))
1158+ then true
1159+ else (0 >= _maxPriceImpact))
1160+ then true
1161+ else (0 >= _partialLiquidationRatio))
1162+ then true
1163+ else (0 >= _maxPriceSpread))
1164+ then true
1165+ else (0 >= _maxOpenNotional))
1166+ then true
1167+ else (0 >= _feeToStakersPercent))
1168+ then true
1169+ else (_feeToStakersPercent > DECIMAL_UNIT))
1170+ then true
1171+ else (0 > _maxOracleDelay))
1172+ then true
1173+ else (0 >= _rolloverFee))
1174+ then true
1175+ else if ((_fundingMode != FUNDING_SYMMETRIC))
1176+ then (_fundingMode != FUNDING_ASYMMETRIC)
1177+ else false)
1178+ then true
1179+ else if ((_oracleMode != ORACLE_PLAIN))
1180+ then (_oracleMode != ORACLE_JIT)
1181+ else false)
1182+ then true
1183+ else if ((_positionMode != POSITION_DIRECT))
1184+ then (_positionMode != POSITION_ORDER)
1185+ else false)
1186+ then true
11441187 else initialized())
11451188 then true
11461189 else (i.caller != this))
11471190 then throw("Invalid initialize parameters")
1148- else ((((updateAmm(_qtAstR, _bsAstR, 0, 0, 0, 0, 0, 0) ++ updateSettings(_initMarginRatio, _mmr, _liquidationFeeRatio, _fundingPeriod, _fee, _spreadLimit, _maxPriceImpact, _partialLiquidationRatio, _maxPriceSpread, _maxOpenNotional, _feeToStakersPercent, _maxOracleDelay, _rolloverFee, _fundingMode, _oracleMode)) ++ updateFunding((lastTimestamp() + _fundingPeriod), 0, 0, 0, 0)) ++ updateBalance(0)) ++ [BooleanEntry(k_initialized, true), StringEntry(k_baseOracle, _baseOracleData), StringEntry(k_quoteOracle, _quoteOracleData), StringEntry(k_coordinatorAddress, toString(addressFromStringValue(_coordinator)))])
1191+ else ((((updateAmm(_qtAstR, _bsAstR, 0, 0, 0, 0, 0, 0) ++ updateSettings(_initMarginRatio, _mmr, _liquidationFeeRatio, _fundingPeriod, _fee, _spreadLimit, _maxPriceImpact, _partialLiquidationRatio, _maxPriceSpread, _maxOpenNotional, _feeToStakersPercent, _maxOracleDelay, _rolloverFee, _fundingMode, _oracleMode, _minInitMarginRatio, _positionMode)) ++ updateFunding((lastTimestamp() + _fundingPeriod), 0, 0, 0, 0)) ++ updateBalance(0)) ++ [BooleanEntry(k_initialized, true), StringEntry(k_baseOracle, _baseOracleData), StringEntry(k_quoteOracle, _quoteOracleData), StringEntry(k_coordinatorAddress, toString(addressFromStringValue(_coordinator)))])
11491192
11501193
11511194
11521195 @Callable(i)
11531196 func increasePosition (_direction,_leverage,_minBaseAssetAmount,_refLink,_priceUpdate) = {
11541197 let updateOracle = invoke(this, "updateOracle", [_priceUpdate], nil)
11551198 if ((updateOracle == updateOracle))
11561199 then {
11571200 let sync = invoke(this, "syncTerminalPriceToOracle", nil, nil)
11581201 if ((sync == sync))
11591202 then {
11601203 let ensureCalledOnce = invoke(this, "ensureCalledOnce", nil, nil)
11611204 if ((ensureCalledOnce == ensureCalledOnce))
11621205 then {
11631206 let _trader = getActualCaller(i)
11641207 let _rawAmount = i.payments[0].amount
11651208 let _assetId = i.payments[0].assetId
11661209 let _assetIdStr = toBase58String(value(_assetId))
11671210 let isQuoteAsset = (_assetId == quoteAsset())
1168- if (if (if (if (if (if (if (if (if ((_direction != DIR_LONG))
1211+ if (if (if (if (if (if (if (if (if (if (if ((_direction != DIR_LONG))
11691212 then (_direction != DIR_SHORT)
11701213 else false)
11711214 then true
11721215 else (0 >= _rawAmount))
11731216 then true
11741217 else !(initialized()))
11751218 then true
11761219 else !(isQuoteAsset))
11771220 then true
11781221 else !(requireMoreMarginRatio(divd(DECIMAL_UNIT, _leverage), initMarginRatio(), true)))
11791222 then true
1223+ else !(requireMoreMarginRatio(divd(DECIMAL_UNIT, _leverage), minInitMarginRatio(), false)))
1224+ then true
1225+ else !(requireSenderCanWorkWithPositions(i.caller)))
1226+ then true
11801227 else paused())
11811228 then true
11821229 else closeOnly())
11831230 then true
11841231 else isMarketClosed())
11851232 then throw("Invalid increasePosition parameters")
11861233 else {
1187- let $t05867658825 = getForTraderWithArtifact(_trader, getArtifactId(i))
1188- let adjustedFee = $t05867658825._1
1189- let burnArtifact = $t05867658825._2
1234+ let $t06032160470 = getForTraderWithArtifact(_trader, getArtifactId(i))
1235+ let adjustedFee = $t06032160470._1
1236+ let burnArtifact = $t06032160470._2
11901237 let _amount = divd(_rawAmount, (muld(adjustedFee, _leverage) + DECIMAL_UNIT))
11911238 let distributeFeeAmount = (_rawAmount - _amount)
11921239 let referrerFeeAny = invoke(referralAddress(), "acceptPaymentWithLink", [_trader, _refLink], [AttachedPayment(quoteAsset(), distributeFeeAmount)])
11931240 if ((referrerFeeAny == referrerFeeAny))
11941241 then {
11951242 let referrerFee = match referrerFeeAny {
11961243 case x: Int =>
11971244 x
11981245 case _ =>
11991246 throw("Invalid referrerFee")
12001247 }
12011248 let feeAmount = (distributeFeeAmount - referrerFee)
1202- let $t05932159501 = getPosition(_trader, _direction)
1203- let oldPositionSize = $t05932159501._1
1204- let oldPositionMargin = $t05932159501._2
1205- let oldPositionOpenNotional = $t05932159501._3
1206- let oldPositionLstUpdCPF = $t05932159501._4
1207- let oldPositionTimestamp = $t05932159501._5
1249+ let $t06096661146 = getPosition(_trader, _direction)
1250+ let oldPositionSize = $t06096661146._1
1251+ let oldPositionMargin = $t06096661146._2
1252+ let oldPositionOpenNotional = $t06096661146._3
1253+ let oldPositionLstUpdCPF = $t06096661146._4
1254+ let oldPositionTimestamp = $t06096661146._5
12081255 let isNewPosition = (oldPositionSize == 0)
12091256 let isSameDirection = if ((oldPositionSize > 0))
12101257 then (_direction == DIR_LONG)
12111258 else (_direction == DIR_SHORT)
12121259 let expandExisting = if (!(isNewPosition))
12131260 then isSameDirection
12141261 else false
12151262 let isAdd = (_direction == DIR_LONG)
1216- let $t05979062923 = if (if (isNewPosition)
1263+ let $t06143564568 = if (if (isNewPosition)
12171264 then true
12181265 else expandExisting)
12191266 then {
12201267 let openNotional = muld(_amount, _leverage)
1221- let $t06029960472 = swapInput(isAdd, openNotional)
1222- let amountBaseAssetBought = $t06029960472._1
1223- let quoteAssetReserveAfter = $t06029960472._2
1224- let baseAssetReserveAfter = $t06029960472._3
1225- let totalPositionSizeAfter = $t06029960472._4
1268+ let $t06194462117 = swapInput(isAdd, openNotional)
1269+ let amountBaseAssetBought = $t06194462117._1
1270+ let quoteAssetReserveAfter = $t06194462117._2
1271+ let baseAssetReserveAfter = $t06194462117._3
1272+ let totalPositionSizeAfter = $t06194462117._4
12261273 if (if ((_minBaseAssetAmount != 0))
12271274 then (_minBaseAssetAmount > abs(amountBaseAssetBought))
12281275 else false)
12291276 then throw(((("Limit error: " + toString(abs(amountBaseAssetBought))) + " < ") + toString(_minBaseAssetAmount)))
12301277 else {
12311278 let newPositionSize = (oldPositionSize + amountBaseAssetBought)
12321279 let totalLongOpenInterestAfter = (openInterestLong() + (if ((newPositionSize > 0))
12331280 then openNotional
12341281 else 0))
12351282 let totalShortOpenInterestAfter = (openInterestShort() + (if ((0 > newPositionSize))
12361283 then openNotional
12371284 else 0))
1238- let $t06101861293 = calcRemainMarginWithFundingPaymentAndRolloverFee(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, oldPositionTimestamp, _amount)
1239- let remainMargin = $t06101861293._1
1240- let x1 = $t06101861293._2
1241- let x2 = $t06101861293._3
1242- let rolloverFee = $t06101861293._4
1285+ let $t06266362938 = calcRemainMarginWithFundingPaymentAndRolloverFee(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, oldPositionTimestamp, _amount)
1286+ let remainMargin = $t06266362938._1
1287+ let x1 = $t06266362938._2
1288+ let x2 = $t06266362938._3
1289+ let rolloverFee = $t06266362938._4
12431290 if (!(requireNotOverSpreadLimit(quoteAssetReserveAfter, baseAssetReserveAfter)))
12441291 then throw("Over max spread limit")
12451292 else if (!(requireNotOverMaxOpenNotional(totalLongOpenInterestAfter, totalShortOpenInterestAfter)))
12461293 then throw("Over max open notional")
12471294 else $Tuple14(newPositionSize, remainMargin, (oldPositionOpenNotional + openNotional), latestCumulativePremiumFraction(newPositionSize), lastTimestamp(), baseAssetReserveAfter, quoteAssetReserveAfter, totalPositionSizeAfter, (openInterestNotional() + openNotional), (totalLongPositionSize() + (if ((newPositionSize > 0))
12481295 then abs(amountBaseAssetBought)
12491296 else 0)), (totalShortPositionSize() + (if ((0 > newPositionSize))
12501297 then abs(amountBaseAssetBought)
12511298 else 0)), totalLongOpenInterestAfter, totalShortOpenInterestAfter, rolloverFee)
12521299 }
12531300 }
12541301 else {
12551302 let openNotional = muld(_amount, _leverage)
1256- let $t06261162739 = getPositionNotionalAndUnrealizedPnl(toString(i.caller), _direction, PNL_OPTION_SPOT)
1257- let oldPositionNotional = $t06261162739._1
1258- let unrealizedPnl = $t06261162739._2
1303+ let $t06425664384 = getPositionNotionalAndUnrealizedPnl(toString(i.caller), _direction, PNL_OPTION_SPOT)
1304+ let oldPositionNotional = $t06425664384._1
1305+ let unrealizedPnl = $t06425664384._2
12591306 if ((oldPositionNotional > openNotional))
12601307 then throw("Use decreasePosition to decrease position size")
12611308 else throw("Close position first")
12621309 }
1263- let newPositionSize = $t05979062923._1
1264- let newPositionRemainMargin = $t05979062923._2
1265- let newPositionOpenNotional = $t05979062923._3
1266- let newPositionLatestCPF = $t05979062923._4
1267- let newPositionTimestamp = $t05979062923._5
1268- let baseAssetReserveAfter = $t05979062923._6
1269- let quoteAssetReserveAfter = $t05979062923._7
1270- let totalPositionSizeAfter = $t05979062923._8
1271- let openInterestNotionalAfter = $t05979062923._9
1272- let totalLongAfter = $t05979062923._10
1273- let totalShortAfter = $t05979062923._11
1274- let totalLongOpenInterestAfter = $t05979062923._12
1275- let totalShortOpenInterestAfter = $t05979062923._13
1276- let rolloverFee = $t05979062923._14
1277- let $t06292963000 = distributeFee((feeAmount + rolloverFee))
1278- let feeToStakers = $t06292963000._1
1279- let feeToVault = $t06292963000._2
1310+ let newPositionSize = $t06143564568._1
1311+ let newPositionRemainMargin = $t06143564568._2
1312+ let newPositionOpenNotional = $t06143564568._3
1313+ let newPositionLatestCPF = $t06143564568._4
1314+ let newPositionTimestamp = $t06143564568._5
1315+ let baseAssetReserveAfter = $t06143564568._6
1316+ let quoteAssetReserveAfter = $t06143564568._7
1317+ let totalPositionSizeAfter = $t06143564568._8
1318+ let openInterestNotionalAfter = $t06143564568._9
1319+ let totalLongAfter = $t06143564568._10
1320+ let totalShortAfter = $t06143564568._11
1321+ let totalLongOpenInterestAfter = $t06143564568._12
1322+ let totalShortOpenInterestAfter = $t06143564568._13
1323+ let rolloverFee = $t06143564568._14
1324+ let $t06457464645 = distributeFee((feeAmount + rolloverFee))
1325+ let feeToStakers = $t06457464645._1
1326+ let feeToVault = $t06457464645._2
12801327 let stake = if ((_amount >= rolloverFee))
12811328 then invoke(vaultAddress(), "addLocked", nil, [AttachedPayment(quoteAsset(), (_amount - rolloverFee))])
12821329 else invoke(vaultAddress(), "withdrawLocked", [(rolloverFee - _amount)], nil)
12831330 if ((stake == stake))
12841331 then {
12851332 let depositVault = invoke(vaultAddress(), "addFree", nil, [AttachedPayment(quoteAsset(), feeToVault)])
12861333 if ((depositVault == depositVault))
12871334 then {
12881335 let notifyFee = invoke(minerAddress(), "notifyFees", [_trader, feeAmount], nil)
12891336 if ((notifyFee == notifyFee))
12901337 then {
12911338 let notifyNotional = invoke(minerAddress(), "notifyNotional", [_trader, newPositionOpenNotional], nil)
12921339 if ((notifyNotional == notifyNotional))
12931340 then ((((((updatePosition(_trader, newPositionSize, newPositionRemainMargin, newPositionOpenNotional, newPositionLatestCPF, newPositionTimestamp) ++ incrementPositionSequenceNumber(isNewPosition, _trader, _direction)) ++ updatePositionFee(isNewPosition, _trader, _direction, adjustedFee)) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter, totalLongOpenInterestAfter, totalShortOpenInterestAfter)) ++ transferFee(feeToStakers)) ++ updateBalance(((cbalance() + _amount) - rolloverFee))) ++ doBurnArtifact(burnArtifact, i))
12941341 else throw("Strict value is not equal to itself.")
12951342 }
12961343 else throw("Strict value is not equal to itself.")
12971344 }
12981345 else throw("Strict value is not equal to itself.")
12991346 }
13001347 else throw("Strict value is not equal to itself.")
13011348 }
13021349 else throw("Strict value is not equal to itself.")
13031350 }
13041351 }
13051352 else throw("Strict value is not equal to itself.")
13061353 }
13071354 else throw("Strict value is not equal to itself.")
13081355 }
13091356 else throw("Strict value is not equal to itself.")
13101357 }
13111358
13121359
13131360
13141361 @Callable(i)
13151362 func addMargin (_direction,_priceUpdate) = {
13161363 let updateOracle = invoke(this, "updateOracle", [_priceUpdate], nil)
13171364 if ((updateOracle == updateOracle))
13181365 then {
13191366 let sync = invoke(this, "syncTerminalPriceToOracle", nil, nil)
13201367 if ((sync == sync))
13211368 then {
13221369 let ensureCalledOnce = invoke(this, "ensureCalledOnce", nil, nil)
13231370 if ((ensureCalledOnce == ensureCalledOnce))
13241371 then {
13251372 let _trader = toString(i.caller)
13261373 let _amount = i.payments[0].amount
13271374 let _assetId = i.payments[0].assetId
13281375 let _assetIdStr = toBase58String(value(_assetId))
13291376 let isQuoteAsset = (_assetId == quoteAsset())
13301377 if (if (if (if (if (!(isQuoteAsset))
13311378 then true
13321379 else !(requireOpenPosition(toString(i.caller), _direction)))
13331380 then true
13341381 else !(initialized()))
13351382 then true
13361383 else paused())
13371384 then true
13381385 else isMarketClosed())
13391386 then throw("Invalid addMargin parameters")
13401387 else {
1341- let $t06534265522 = getPosition(_trader, _direction)
1342- let oldPositionSize = $t06534265522._1
1343- let oldPositionMargin = $t06534265522._2
1344- let oldPositionOpenNotional = $t06534265522._3
1345- let oldPositionLstUpdCPF = $t06534265522._4
1346- let oldPositionTimestamp = $t06534265522._5
1388+ let $t06698767167 = getPosition(_trader, _direction)
1389+ let oldPositionSize = $t06698767167._1
1390+ let oldPositionMargin = $t06698767167._2
1391+ let oldPositionOpenNotional = $t06698767167._3
1392+ let oldPositionLstUpdCPF = $t06698767167._4
1393+ let oldPositionTimestamp = $t06698767167._5
13471394 let stake = invoke(vaultAddress(), "addLocked", nil, [AttachedPayment(quoteAsset(), _amount)])
13481395 if ((stake == stake))
13491396 then {
1350- let rolloverFee = calcRolloverFee(oldPositionMargin, oldPositionTimestamp)
1351- let doTransferFeeToStakers = if ((rolloverFee > 0))
1397+ let $t06730767533 = calcRemainMarginWithFundingPaymentAndRolloverFee(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, oldPositionTimestamp, _amount)
1398+ let remainMargin = $t06730767533._1
1399+ let badDebt = $t06730767533._2
1400+ let rolloverFee = $t06730767533._3
1401+ let marginRatio = calcMarginRatio(remainMargin, badDebt, oldPositionOpenNotional)
1402+ let checkMinMargin = requireMoreMarginRatio(marginRatio, minInitMarginRatio(), false)
1403+ if ((checkMinMargin == checkMinMargin))
13521404 then {
1353- let $t06580765866 = distributeFee(rolloverFee)
1354- let feeToStakers = $t06580765866._1
1355- let feeToVault = $t06580765866._2
1356- let unstake = invoke(vaultAddress(), "withdrawLocked", [feeToStakers], nil)
1357- if ((unstake == unstake))
1405+ let doTransferFeeToStakers = if ((rolloverFee > 0))
13581406 then {
1359- let lockBadDebt = invoke(vaultAddress(), "exchangeFreeAndLocked", [-(feeToVault)], nil)
1360- if ((lockBadDebt == lockBadDebt))
1361- then transferFee(feeToStakers)
1407+ let $t06778967848 = distributeFee(rolloverFee)
1408+ let feeToStakers = $t06778967848._1
1409+ let feeToVault = $t06778967848._2
1410+ let unstake = invoke(vaultAddress(), "withdrawLocked", [feeToStakers], nil)
1411+ if ((unstake == unstake))
1412+ then {
1413+ let lockBadDebt = invoke(vaultAddress(), "exchangeFreeAndLocked", [-(feeToVault)], nil)
1414+ if ((lockBadDebt == lockBadDebt))
1415+ then transferFee(feeToStakers)
1416+ else throw("Strict value is not equal to itself.")
1417+ }
13621418 else throw("Strict value is not equal to itself.")
13631419 }
1420+ else nil
1421+ if ((doTransferFeeToStakers == doTransferFeeToStakers))
1422+ then ((updatePosition(_trader, oldPositionSize, ((oldPositionMargin - rolloverFee) + _amount), oldPositionOpenNotional, oldPositionLstUpdCPF, lastTimestamp()) ++ updateBalance(((cbalance() + _amount) - rolloverFee))) ++ doTransferFeeToStakers)
13641423 else throw("Strict value is not equal to itself.")
13651424 }
1366- else nil
1367- if ((doTransferFeeToStakers == doTransferFeeToStakers))
1368- then ((updatePosition(_trader, oldPositionSize, ((oldPositionMargin - rolloverFee) + _amount), oldPositionOpenNotional, oldPositionLstUpdCPF, lastTimestamp()) ++ updateBalance(((cbalance() + _amount) - rolloverFee))) ++ doTransferFeeToStakers)
13691425 else throw("Strict value is not equal to itself.")
13701426 }
13711427 else throw("Strict value is not equal to itself.")
13721428 }
13731429 }
13741430 else throw("Strict value is not equal to itself.")
13751431 }
13761432 else throw("Strict value is not equal to itself.")
13771433 }
13781434 else throw("Strict value is not equal to itself.")
13791435 }
13801436
13811437
13821438
13831439 @Callable(i)
13841440 func removeMargin (_amount,_direction,_priceUpdate) = {
13851441 let updateOracle = invoke(this, "updateOracle", [_priceUpdate], nil)
13861442 if ((updateOracle == updateOracle))
13871443 then {
13881444 let sync = invoke(this, "syncTerminalPriceToOracle", nil, nil)
13891445 if ((sync == sync))
13901446 then {
13911447 let ensureCalledOnce = invoke(this, "ensureCalledOnce", nil, nil)
13921448 if ((ensureCalledOnce == ensureCalledOnce))
13931449 then {
13941450 let _trader = toString(i.caller)
13951451 if (if (if (if (if ((0 >= _amount))
13961452 then true
13971453 else !(requireOpenPosition(_trader, _direction)))
13981454 then true
13991455 else !(initialized()))
14001456 then true
14011457 else paused())
14021458 then true
14031459 else isMarketClosed())
14041460 then throw("Invalid removeMargin parameters")
14051461 else {
1406- let $t06736767547 = getPosition(_trader, _direction)
1407- let oldPositionSize = $t06736767547._1
1408- let oldPositionMargin = $t06736767547._2
1409- let oldPositionOpenNotional = $t06736767547._3
1410- let oldPositionLstUpdCPF = $t06736767547._4
1411- let oldPositionTimestamp = $t06736767547._5
1412- let $t06755367802 = calcRemainMarginWithFundingPaymentAndRolloverFee(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, oldPositionTimestamp, -(_amount))
1413- let remainMargin = $t06755367802._1
1414- let badDebt = $t06755367802._2
1415- let fundingPayment = $t06755367802._3
1416- let rolloverFee = $t06755367802._4
1462+ let $t06934969529 = getPosition(_trader, _direction)
1463+ let oldPositionSize = $t06934969529._1
1464+ let oldPositionMargin = $t06934969529._2
1465+ let oldPositionOpenNotional = $t06934969529._3
1466+ let oldPositionLstUpdCPF = $t06934969529._4
1467+ let oldPositionTimestamp = $t06934969529._5
1468+ let $t06953569784 = calcRemainMarginWithFundingPaymentAndRolloverFee(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, oldPositionTimestamp, -(_amount))
1469+ let remainMargin = $t06953569784._1
1470+ let badDebt = $t06953569784._2
1471+ let fundingPayment = $t06953569784._3
1472+ let rolloverFee = $t06953569784._4
14171473 if ((badDebt != 0))
14181474 then throw("Invalid removed margin amount")
14191475 else {
14201476 let marginRatio = calcMarginRatio(remainMargin, badDebt, oldPositionOpenNotional)
14211477 if (!(requireMoreMarginRatio(marginRatio, initMarginRatio(), true)))
14221478 then throw(((("Too much margin removed: " + toString(marginRatio)) + " < ") + toString(initMarginRatio())))
14231479 else {
1424- let $t06818868247 = distributeFee(rolloverFee)
1425- let feeToStakers = $t06818868247._1
1426- let feeToVault = $t06818868247._2
1480+ let $t07017070229 = distributeFee(rolloverFee)
1481+ let feeToStakers = $t07017070229._1
1482+ let feeToVault = $t07017070229._2
14271483 let doTransferFeeToStakers = if ((rolloverFee > 0))
14281484 then {
14291485 let lockBadDebt = invoke(vaultAddress(), "exchangeFreeAndLocked", [-(feeToVault)], nil)
14301486 if ((lockBadDebt == lockBadDebt))
14311487 then transferFee(feeToStakers)
14321488 else throw("Strict value is not equal to itself.")
14331489 }
14341490 else nil
14351491 if ((doTransferFeeToStakers == doTransferFeeToStakers))
14361492 then {
14371493 let unstake = invoke(vaultAddress(), "withdrawLocked", [(_amount + feeToStakers)], nil)
14381494 if ((unstake == unstake))
14391495 then (((updatePosition(_trader, oldPositionSize, remainMargin, oldPositionOpenNotional, latestCumulativePremiumFraction(oldPositionSize), lastTimestamp()) ++ withdraw(i.caller, _amount)) ++ updateBalance(((cbalance() - _amount) - rolloverFee))) ++ doTransferFeeToStakers)
14401496 else throw("Strict value is not equal to itself.")
14411497 }
14421498 else throw("Strict value is not equal to itself.")
14431499 }
14441500 }
14451501 }
14461502 }
14471503 else throw("Strict value is not equal to itself.")
14481504 }
14491505 else throw("Strict value is not equal to itself.")
14501506 }
14511507 else throw("Strict value is not equal to itself.")
14521508 }
14531509
14541510
14551511
14561512 @Callable(i)
14571513 func closePosition (_size,_direction,_minQuoteAssetAmount,_addToMargin,_priceUpdate) = {
14581514 let updateOracle = invoke(this, "updateOracle", [_priceUpdate], nil)
14591515 if ((updateOracle == updateOracle))
14601516 then {
14611517 let sync = invoke(this, "syncTerminalPriceToOracle", nil, nil)
14621518 if ((sync == sync))
14631519 then {
14641520 let ensureCalledOnce = invoke(this, "ensureCalledOnce", nil, nil)
14651521 if ((ensureCalledOnce == ensureCalledOnce))
14661522 then {
14671523 let _trader = getActualCaller(i)
14681524 let _traderAddress = valueOrErrorMessage(addressFromString(_trader), "Invalid caller")
14691525 let positionFee = getPositionFee(_trader, _direction)
14701526 if (if (if (if (if (if (!(requireOpenPosition(_trader, _direction)))
14711527 then true
14721528 else !(initialized()))
14731529 then true
14741530 else paused())
14751531 then true
14761532 else (0 >= _size))
14771533 then true
14781534 else (0 > _minQuoteAssetAmount))
14791535 then true
14801536 else isMarketClosed())
14811537 then throw("Invalid closePosition parameters")
14821538 else {
14831539 let oldPositionTimestamp = getPosition(_trader, _direction)._5
1484- let $t07058271185 = internalClosePosition(_trader, _direction, _size, positionFee, _minQuoteAssetAmount, _addToMargin, true, true)
1485- let newPositionSize = $t07058271185._1
1486- let newPositionMargin = $t07058271185._2
1487- let newPositionOpenNotional = $t07058271185._3
1488- let newPositionLstUpdCPF = $t07058271185._4
1489- let positionBadDebt = $t07058271185._5
1490- let realizedPnl = $t07058271185._6
1491- let marginToTrader = $t07058271185._7
1492- let quoteAssetReserveAfter = $t07058271185._8
1493- let baseAssetReserveAfter = $t07058271185._9
1494- let totalPositionSizeAfter = $t07058271185._10
1495- let openInterestNotionalAfter = $t07058271185._11
1496- let totalLongAfter = $t07058271185._12
1497- let totalShortAfter = $t07058271185._13
1498- let totalLongOpenInterestAfter = $t07058271185._14
1499- let totalShortOpenInterestAfter = $t07058271185._15
1500- let realizedFee = $t07058271185._16
1540+ let $t07256473167 = internalClosePosition(_trader, _direction, _size, positionFee, _minQuoteAssetAmount, _addToMargin, true, true)
1541+ let newPositionSize = $t07256473167._1
1542+ let newPositionMargin = $t07256473167._2
1543+ let newPositionOpenNotional = $t07256473167._3
1544+ let newPositionLstUpdCPF = $t07256473167._4
1545+ let positionBadDebt = $t07256473167._5
1546+ let realizedPnl = $t07256473167._6
1547+ let marginToTrader = $t07256473167._7
1548+ let quoteAssetReserveAfter = $t07256473167._8
1549+ let baseAssetReserveAfter = $t07256473167._9
1550+ let totalPositionSizeAfter = $t07256473167._10
1551+ let openInterestNotionalAfter = $t07256473167._11
1552+ let totalLongAfter = $t07256473167._12
1553+ let totalShortAfter = $t07256473167._13
1554+ let totalLongOpenInterestAfter = $t07256473167._14
1555+ let totalShortOpenInterestAfter = $t07256473167._15
1556+ let realizedFee = $t07256473167._16
15011557 if ((positionBadDebt > 0))
15021558 then throw("Invalid closePosition parameters: bad debt")
15031559 else if ((oldPositionTimestamp >= lastTimestamp()))
15041560 then throw("Invalid closePosition parameters: wait at least 1 block before closing the position")
15051561 else {
15061562 let isPartialClose = (newPositionSize != 0)
15071563 let withdrawAmount = (marginToTrader + realizedFee)
15081564 let ammBalance = (cbalance() - withdrawAmount)
15091565 let ammNewBalance = if ((0 > ammBalance))
15101566 then 0
15111567 else ammBalance
15121568 let unstake = invoke(vaultAddress(), "withdrawLocked", [withdrawAmount], nil)
15131569 if ((unstake == unstake))
15141570 then {
15151571 let referrerFeeAny = invoke(referralAddress(), "acceptPayment", [_trader], [AttachedPayment(quoteAsset(), realizedFee)])
15161572 if ((referrerFeeAny == referrerFeeAny))
15171573 then {
15181574 let referrerFee = match referrerFeeAny {
15191575 case x: Int =>
15201576 x
15211577 case _ =>
15221578 throw("Invalid referrerFee")
15231579 }
1524- let $t07215772230 = distributeFee((realizedFee - referrerFee))
1525- let feeToStakers = $t07215772230._1
1526- let feeToVault = $t07215772230._2
1580+ let $t07413974212 = distributeFee((realizedFee - referrerFee))
1581+ let feeToStakers = $t07413974212._1
1582+ let feeToVault = $t07413974212._2
15271583 let depositVault = invoke(vaultAddress(), "addFree", nil, [AttachedPayment(quoteAsset(), feeToVault)])
15281584 if ((depositVault == depositVault))
15291585 then {
15301586 let notifyFee = invoke(minerAddress(), "notifyFees", [_trader, realizedFee], nil)
15311587 if ((notifyFee == notifyFee))
15321588 then {
15331589 let notifyNotional = invoke(minerAddress(), "notifyNotional", [_trader, newPositionOpenNotional], nil)
15341590 if ((notifyNotional == notifyNotional))
15351591 then (((((if (isPartialClose)
15361592 then updatePosition(_trader, newPositionSize, newPositionMargin, newPositionOpenNotional, newPositionLstUpdCPF, lastTimestamp())
15371593 else deletePosition(_trader, _direction)) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter, totalLongOpenInterestAfter, totalShortOpenInterestAfter)) ++ (if ((marginToTrader > 0))
15381594 then withdraw(_traderAddress, marginToTrader)
15391595 else nil)) ++ updateBalance(ammNewBalance)) ++ transferFee(feeToStakers))
15401596 else throw("Strict value is not equal to itself.")
15411597 }
15421598 else throw("Strict value is not equal to itself.")
15431599 }
15441600 else throw("Strict value is not equal to itself.")
15451601 }
15461602 else throw("Strict value is not equal to itself.")
15471603 }
15481604 else throw("Strict value is not equal to itself.")
15491605 }
15501606 }
15511607 }
15521608 else throw("Strict value is not equal to itself.")
15531609 }
15541610 else throw("Strict value is not equal to itself.")
15551611 }
15561612 else throw("Strict value is not equal to itself.")
15571613 }
15581614
15591615
15601616
15611617 @Callable(i)
15621618 func liquidate (_trader,_direction,_priceUpdate) = {
15631619 let updateOracle = invoke(this, "updateOracle", [_priceUpdate], nil)
15641620 if ((updateOracle == updateOracle))
15651621 then {
15661622 let sync = invoke(this, "syncTerminalPriceToOracle", nil, nil)
15671623 if ((sync == sync))
15681624 then {
15691625 let spotMarginRatio = getMarginRatioByOption(_trader, _direction, PNL_OPTION_SPOT)
15701626 let liquidationMarginRatio = if (isOverFluctuationLimit())
15711627 then {
15721628 let oracleMarginRatio = getMarginRatioByOption(_trader, _direction, PNL_OPTION_ORACLE)
15731629 vmax(spotMarginRatio, oracleMarginRatio)
15741630 }
15751631 else spotMarginRatio
15761632 if (if (if (if (if (!(requireMoreMarginRatio(liquidationMarginRatio, maintenanceMarginRatio(), false)))
15771633 then true
15781634 else !(requireOpenPosition(_trader, _direction)))
15791635 then true
15801636 else !(initialized()))
15811637 then true
15821638 else paused())
15831639 then true
15841640 else isMarketClosed())
15851641 then throw("Unable to liquidate")
15861642 else {
15871643 let isPartialLiquidation = if (if ((spotMarginRatio > liquidationFeeRatio()))
15881644 then (partialLiquidationRatio() > 0)
15891645 else false)
15901646 then (DECIMAL_UNIT > partialLiquidationRatio())
15911647 else false
15921648 let oldPositionSize = getPosition(_trader, _direction)._1
15931649 let positionSizeAbs = abs(oldPositionSize)
1594- let $t07482375146 = if (isPartialLiquidation)
1650+ let $t07680577128 = if (isPartialLiquidation)
15951651 then {
15961652 let liquidationSize = getPartialLiquidationAmount(_trader, oldPositionSize)
15971653 let liquidationRatio = divd(abs(liquidationSize), positionSizeAbs)
15981654 $Tuple2(liquidationRatio, abs(liquidationSize))
15991655 }
16001656 else $Tuple2(0, positionSizeAbs)
1601- let liquidationRatio = $t07482375146._1
1602- let liquidationSize = $t07482375146._2
1603- let $t07515275808 = internalClosePosition(_trader, _direction, if (isPartialLiquidation)
1657+ let liquidationRatio = $t07680577128._1
1658+ let liquidationSize = $t07680577128._2
1659+ let $t07713477790 = internalClosePosition(_trader, _direction, if (isPartialLiquidation)
16041660 then liquidationSize
16051661 else positionSizeAbs, liquidationFeeRatio(), 0, true, false, true)
1606- let newPositionSize = $t07515275808._1
1607- let newPositionMargin = $t07515275808._2
1608- let newPositionOpenNotional = $t07515275808._3
1609- let newPositionLstUpdCPF = $t07515275808._4
1610- let positionBadDebt = $t07515275808._5
1611- let realizedPnl = $t07515275808._6
1612- let marginToTrader = $t07515275808._7
1613- let quoteAssetReserveAfter = $t07515275808._8
1614- let baseAssetReserveAfter = $t07515275808._9
1615- let totalPositionSizeAfter = $t07515275808._10
1616- let openInterestNotionalAfter = $t07515275808._11
1617- let totalLongAfter = $t07515275808._12
1618- let totalShortAfter = $t07515275808._13
1619- let totalLongOpenInterestAfter = $t07515275808._14
1620- let totalShortOpenInterestAfter = $t07515275808._15
1621- let liquidationPenalty = $t07515275808._16
1662+ let newPositionSize = $t07713477790._1
1663+ let newPositionMargin = $t07713477790._2
1664+ let newPositionOpenNotional = $t07713477790._3
1665+ let newPositionLstUpdCPF = $t07713477790._4
1666+ let positionBadDebt = $t07713477790._5
1667+ let realizedPnl = $t07713477790._6
1668+ let marginToTrader = $t07713477790._7
1669+ let quoteAssetReserveAfter = $t07713477790._8
1670+ let baseAssetReserveAfter = $t07713477790._9
1671+ let totalPositionSizeAfter = $t07713477790._10
1672+ let openInterestNotionalAfter = $t07713477790._11
1673+ let totalLongAfter = $t07713477790._12
1674+ let totalShortAfter = $t07713477790._13
1675+ let totalLongOpenInterestAfter = $t07713477790._14
1676+ let totalShortOpenInterestAfter = $t07713477790._15
1677+ let liquidationPenalty = $t07713477790._16
16221678 let feeToLiquidator = (liquidationPenalty / 2)
16231679 let feeToVault = (liquidationPenalty - feeToLiquidator)
16241680 let ammBalance = (cbalance() - liquidationPenalty)
16251681 let newAmmBalance = if ((0 > ammBalance))
16261682 then 0
16271683 else ammBalance
16281684 let lockBadDebt = if ((positionBadDebt > 0))
16291685 then {
16301686 let lockBadDebt = invoke(vaultAddress(), "exchangeFreeAndLocked", [(positionBadDebt + liquidationPenalty)], nil)
16311687 if ((lockBadDebt == lockBadDebt))
16321688 then nil
16331689 else throw("Strict value is not equal to itself.")
16341690 }
16351691 else nil
16361692 if ((lockBadDebt == lockBadDebt))
16371693 then {
16381694 let unstake = invoke(vaultAddress(), "withdrawLocked", [liquidationPenalty], nil)
16391695 if ((unstake == unstake))
16401696 then {
16411697 let depositInsurance = invoke(vaultAddress(), "addFree", nil, [AttachedPayment(quoteAsset(), feeToVault)])
16421698 if ((depositInsurance == depositInsurance))
16431699 then {
16441700 let notifyNotional = invoke(minerAddress(), "notifyNotional", [_trader, newPositionOpenNotional], nil)
16451701 if ((notifyNotional == notifyNotional))
16461702 then ((((if (isPartialLiquidation)
16471703 then updatePosition(_trader, newPositionSize, newPositionMargin, newPositionOpenNotional, newPositionLstUpdCPF, lastTimestamp())
16481704 else deletePosition(_trader, _direction)) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter, totalLongOpenInterestAfter, totalShortOpenInterestAfter)) ++ withdraw(i.caller, feeToLiquidator)) ++ updateBalance(newAmmBalance))
16491705 else throw("Strict value is not equal to itself.")
16501706 }
16511707 else throw("Strict value is not equal to itself.")
16521708 }
16531709 else throw("Strict value is not equal to itself.")
16541710 }
16551711 else throw("Strict value is not equal to itself.")
16561712 }
16571713 }
16581714 else throw("Strict value is not equal to itself.")
16591715 }
16601716 else throw("Strict value is not equal to itself.")
16611717 }
16621718
16631719
16641720
16651721 @Callable(i)
16661722 func payFunding (_priceUpdate) = {
16671723 let updateOracle = invoke(this, "updateOracle", [_priceUpdate], nil)
16681724 if ((updateOracle == updateOracle))
16691725 then {
16701726 let sync = invoke(this, "syncTerminalPriceToOracle", nil, nil)
16711727 if ((sync == sync))
16721728 then {
16731729 let fundingBlockTimestamp = nextFundingBlockTimestamp()
16741730 if (if (if ((fundingBlockTimestamp > lastTimestamp()))
16751731 then true
16761732 else !(initialized()))
16771733 then true
16781734 else paused())
16791735 then throw(((("Invalid funding block timestamp: " + toString(lastTimestamp())) + " < ") + toString(fundingBlockTimestamp)))
16801736 else {
16811737 let underlyingPrice = getOraclePrice()
1682- let $t07802678104 = getFunding()
1683- let shortPremiumFraction = $t07802678104._1
1684- let longPremiumFraction = $t07802678104._2
1685- let premiumToVault = $t07802678104._3
1738+ let $t08000880086 = getFunding()
1739+ let shortPremiumFraction = $t08000880086._1
1740+ let longPremiumFraction = $t08000880086._2
1741+ let premiumToVault = $t08000880086._3
16861742 let doPayFundingToVault = if ((premiumToVault > 0))
16871743 then {
16881744 let doPayFundingToVault = invoke(vaultAddress(), "exchangeFreeAndLocked", [-(premiumToVault)], nil)
16891745 if ((doPayFundingToVault == doPayFundingToVault))
16901746 then nil
16911747 else throw("Strict value is not equal to itself.")
16921748 }
16931749 else nil
16941750 if ((doPayFundingToVault == doPayFundingToVault))
16951751 then updateFunding((fundingBlockTimestamp + fundingPeriodSeconds()), (latestLongCumulativePremiumFraction() + longPremiumFraction), (latestShortCumulativePremiumFraction() + shortPremiumFraction), divd(longPremiumFraction, underlyingPrice), divd(shortPremiumFraction, underlyingPrice))
16961752 else throw("Strict value is not equal to itself.")
16971753 }
16981754 }
16991755 else throw("Strict value is not equal to itself.")
17001756 }
17011757 else throw("Strict value is not equal to itself.")
17021758 }
17031759
17041760
17051761
17061762 @Callable(i)
17071763 func updateOracle (_priceUpdate) = if ((oracleMode() == ORACLE_PLAIN))
17081764 then nil
17091765 else {
17101766 let priceUpdates = split_4C(_priceUpdate, "::")
17111767 let baseOracle = valueOrErrorMessage(getOracleData(k_baseOracle), "No base asset oracle data")
17121768 let baseOracleAddress = baseOracle._1
17131769 let doUpdateBaseOracle = invoke(baseOracleAddress, "updateData", [priceUpdates[0]], nil)
17141770 if ((doUpdateBaseOracle == doUpdateBaseOracle))
17151771 then {
17161772 let quoteOracle = getOracleData(k_quoteOracle)
17171773 let doUpdateQuoteOracle = if (isDefined(quoteOracle))
17181774 then {
17191775 let quoteOracleV = value(quoteOracle)
17201776 let quoteOracleAddress = quoteOracleV._1
17211777 let doUpdateQuoteOracle = invoke(quoteOracleAddress, "updateData", [priceUpdates[1]], nil)
17221778 if ((doUpdateQuoteOracle == doUpdateQuoteOracle))
17231779 then nil
17241780 else throw("Strict value is not equal to itself.")
17251781 }
17261782 else nil
17271783 if ((doUpdateQuoteOracle == doUpdateQuoteOracle))
17281784 then nil
17291785 else throw("Strict value is not equal to itself.")
17301786 }
17311787 else throw("Strict value is not equal to itself.")
17321788 }
17331789
17341790
17351791
17361792 @Callable(i)
17371793 func syncTerminalPriceToOracle () = {
17381794 let _qtAstR = qtAstR()
17391795 let _bsAstR = bsAstR()
1740- let $t07992180287 = getSyncTerminalPrice(getOraclePrice(), _qtAstR, _bsAstR)
1741- let newQuoteAssetWeight = $t07992180287._1
1742- let newBaseAssetWeight = $t07992180287._2
1743- let marginToVault = $t07992180287._3
1796+ let $t08190382269 = getSyncTerminalPrice(getOraclePrice(), _qtAstR, _bsAstR)
1797+ let newQuoteAssetWeight = $t08190382269._1
1798+ let newBaseAssetWeight = $t08190382269._2
1799+ let marginToVault = $t08190382269._3
17441800 let marginToVaultAdj = if (if ((0 > marginToVault))
17451801 then (abs(marginToVault) > cbalance())
17461802 else false)
17471803 then -(cbalance())
17481804 else marginToVault
17491805 let doExchangePnL = if ((marginToVaultAdj != 0))
17501806 then {
17511807 let doExchangePnL = invoke(vaultAddress(), "exchangeFreeAndLocked", [marginToVaultAdj], nil)
17521808 if ((doExchangePnL == doExchangePnL))
17531809 then nil
17541810 else throw("Strict value is not equal to itself.")
17551811 }
17561812 else nil
17571813 if ((doExchangePnL == doExchangePnL))
17581814 then (updateBalance((cbalance() + marginToVaultAdj)) ++ updateAmmWeights(newQuoteAssetWeight, newBaseAssetWeight))
17591815 else throw("Strict value is not equal to itself.")
17601816 }
17611817
17621818
17631819
17641820 @Callable(i)
17651821 func ensureCalledOnce () = if ((i.caller != this))
17661822 then throw("Invalid saveCurrentTxId parameters")
17671823 else {
17681824 let txId = toBase58String(i.transactionId)
17691825 let lastTx = valueOrElse(getString(this, k_lastTx), "")
17701826 if ((lastTx != txId))
17711827 then [StringEntry(k_lastTx, txId)]
17721828 else throw("Can not call vAMM methods twice in one tx")
17731829 }
17741830
17751831
17761832
17771833 @Callable(i)
17781834 func migratePosition (_trader) = {
17791835 let positionSizeOpt = getInteger(this, toCompositeKey(k_positionSize, _trader))
17801836 if (if (isDefined(positionSizeOpt))
17811837 then isDefined(addressFromString(_trader))
17821838 else false)
17831839 then {
17841840 let pSize = getIntegerValue(this, toCompositeKey(k_positionSize, _trader))
17851841 let pMargin = getIntegerValue(this, toCompositeKey(k_positionMargin, _trader))
17861842 let pNotional = getIntegerValue(this, toCompositeKey(k_positionOpenNotional, _trader))
17871843 let pFraction = getIntegerValue(this, toCompositeKey(k_positionLastUpdatedCumulativePremiumFraction, _trader))
17881844 let pTimestamp = valueOrElse(getInteger(this, toCompositeKey(k_positionLastUpdatedTimestamp, _trader)), lastBlock.timestamp)
17891845 let pFee = valueOrElse(getInteger(this, toCompositeKey(k_positionFee, _trader)), fee())
17901846 let pSequence = getIntegerValue(this, toCompositeKey(k_positionSequence, _trader))
17911847 let pDirection = getDirection(pSize)
17921848 let positionKey = ((_trader + "_") + toString(pDirection))
17931849 [DeleteEntry(toCompositeKey(k_positionSize, _trader)), DeleteEntry(toCompositeKey(k_positionMargin, _trader)), DeleteEntry(toCompositeKey(k_positionOpenNotional, _trader)), DeleteEntry(toCompositeKey(k_positionLastUpdatedCumulativePremiumFraction, _trader)), DeleteEntry(toCompositeKey(k_positionLastUpdatedTimestamp, _trader)), DeleteEntry(toCompositeKey(k_positionFee, _trader)), DeleteEntry(toCompositeKey(k_positionSequence, _trader)), IntegerEntry(toCompositeKey(k_positionSize, positionKey), pSize), IntegerEntry(toCompositeKey(k_positionMargin, positionKey), pMargin), IntegerEntry(toCompositeKey(k_positionOpenNotional, positionKey), pNotional), IntegerEntry(toCompositeKey(k_positionLastUpdatedCumulativePremiumFraction, positionKey), pFraction), IntegerEntry(toCompositeKey(k_positionLastUpdatedTimestamp, positionKey), pTimestamp), IntegerEntry(toCompositeKey(k_positionFee, positionKey), pFee), IntegerEntry(toCompositeKey(k_positionSequence, positionKey), pSequence)]
17941850 }
17951851 else throw(("Nothing to migrate for " + _trader))
17961852 }
17971853
17981854
17991855
18001856 @Callable(i)
18011857 func view_calcRemainMarginWithFundingPayment (_trader,_direction,_priceUpdate) = {
18021858 let updateOracle = invoke(this, "updateOracle", [_priceUpdate], nil)
18031859 if ((updateOracle == updateOracle))
18041860 then {
18051861 let sync = invoke(this, "syncTerminalPriceToOracle", nil, nil)
18061862 if ((sync == sync))
18071863 then {
1808- let $t08408184217 = getPosition(_trader, _direction)
1809- let positionSize = $t08408184217._1
1810- let positionMargin = $t08408184217._2
1811- let pon = $t08408184217._3
1812- let positionLstUpdCPF = $t08408184217._4
1813- let positionTimestamp = $t08408184217._5
1814- let $t08422084333 = getPositionNotionalAndUnrealizedPnl(_trader, _direction, PNL_OPTION_SPOT)
1815- let positionNotional = $t08422084333._1
1816- let unrealizedPnl = $t08422084333._2
1817- let $t08433684560 = calcRemainMarginWithFundingPaymentAndRolloverFee(positionSize, positionMargin, positionLstUpdCPF, positionTimestamp, unrealizedPnl)
1818- let remainMargin = $t08433684560._1
1819- let badDebt = $t08433684560._2
1820- let fundingPayment = $t08433684560._3
1821- let rolloverFee = $t08433684560._4
1864+ let $t08606386199 = getPosition(_trader, _direction)
1865+ let positionSize = $t08606386199._1
1866+ let positionMargin = $t08606386199._2
1867+ let pon = $t08606386199._3
1868+ let positionLstUpdCPF = $t08606386199._4
1869+ let positionTimestamp = $t08606386199._5
1870+ let $t08620286315 = getPositionNotionalAndUnrealizedPnl(_trader, _direction, PNL_OPTION_SPOT)
1871+ let positionNotional = $t08620286315._1
1872+ let unrealizedPnl = $t08620286315._2
1873+ let $t08631886542 = calcRemainMarginWithFundingPaymentAndRolloverFee(positionSize, positionMargin, positionLstUpdCPF, positionTimestamp, unrealizedPnl)
1874+ let remainMargin = $t08631886542._1
1875+ let badDebt = $t08631886542._2
1876+ let fundingPayment = $t08631886542._3
1877+ let rolloverFee = $t08631886542._4
18221878 throw(((((((s(remainMargin) + s(fundingPayment)) + s(getMarginRatio(_trader, _direction))) + s(unrealizedPnl)) + s(badDebt)) + s(positionNotional)) + s(rolloverFee)))
18231879 }
18241880 else throw("Strict value is not equal to itself.")
18251881 }
18261882 else throw("Strict value is not equal to itself.")
18271883 }
18281884
18291885
18301886
18311887 @Callable(i)
18321888 func view_getPegAdjustCost (_price) = {
18331889 let _qtAstR = qtAstR()
18341890 let _bsAstR = bsAstR()
18351891 let result = getSyncTerminalPrice(_price, _qtAstR, _bsAstR)
18361892 throw(toString(result._3))
18371893 }
18381894
18391895
18401896
18411897 @Callable(i)
18421898 func view_getTerminalAmmPrice () = {
1843- let $t08529585376 = getTerminalAmmState()
1844- let terminalQuoteAssetReserve = $t08529585376._1
1845- let terminalBaseAssetReserve = $t08529585376._2
1899+ let $t08727787358 = getTerminalAmmState()
1900+ let terminalQuoteAssetReserve = $t08727787358._1
1901+ let terminalBaseAssetReserve = $t08727787358._2
18461902 let price = divd(muld(terminalQuoteAssetReserve, qtAstW()), muld(terminalBaseAssetReserve, bsAstW()))
18471903 throw(toString(price))
18481904 }
18491905
18501906
18511907
18521908 @Callable(i)
18531909 func view_getFunding (_priceUpdate) = {
18541910 let updateOracle = invoke(this, "updateOracle", [_priceUpdate], nil)
18551911 if ((updateOracle == updateOracle))
18561912 then {
18571913 let sync = invoke(this, "syncTerminalPriceToOracle", nil, nil)
18581914 if ((sync == sync))
18591915 then {
18601916 let underlyingPrice = getOraclePrice()
1861- let $t08602886106 = getFunding()
1862- let shortPremiumFraction = $t08602886106._1
1863- let longPremiumFraction = $t08602886106._2
1864- let premiumToVault = $t08602886106._3
1917+ let $t08801088088 = getFunding()
1918+ let shortPremiumFraction = $t08801088088._1
1919+ let longPremiumFraction = $t08801088088._2
1920+ let premiumToVault = $t08801088088._3
18651921 let longFunding = divd(longPremiumFraction, underlyingPrice)
18661922 let shortFunding = divd(shortPremiumFraction, underlyingPrice)
18671923 throw(((((s(longFunding) + s(shortFunding)) + s(getSpotPrice())) + s(getOraclePrice())) + s(premiumToVault)))
18681924 }
18691925 else throw("Strict value is not equal to itself.")
18701926 }
18711927 else throw("Strict value is not equal to itself.")
18721928 }
18731929
18741930
18751931
18761932 @Callable(i)
18771933 func computeSpotPrice () = {
18781934 let sync = invoke(this, "syncTerminalPriceToOracle", nil, nil)
18791935 if ((sync == sync))
18801936 then {
18811937 let result = getSpotPrice()
18821938 $Tuple2(nil, result)
18831939 }
18841940 else throw("Strict value is not equal to itself.")
18851941 }
18861942
18871943
18881944
18891945 @Callable(i)
18901946 func computeFeeForTraderWithArtifact (_trader,_artifactId) = {
18911947 let result = getForTraderWithArtifact(_trader, _artifactId)
18921948 $Tuple2(nil, result)
18931949 }
18941950
18951951
18961952 @Verifier(tx)
18971953 func verify () = {
18981954 let coordinatorStr = getString(this, k_coordinatorAddress)
18991955 if (isDefined(coordinatorStr))
19001956 then {
19011957 let admin = getString(addressFromStringValue(value(coordinatorStr)), k_admin_address)
19021958 if (isDefined(admin))
19031959 then valueOrElse(getBoolean(addressFromStringValue(value(admin)), ((("status_" + toString(this)) + "_") + toBase58String(tx.id))), false)
19041960 else throw("unable to verify: admin not set in coordinator")
19051961 }
19061962 else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
19071963 }
19081964

github/deemru/w8io/026f985 
358.81 ms