tx · D9R93wvrjVumiadztcugyjxbH4hBsCBuQmpxJpRZHtX5

3MuCofTkjmv397dEuRXE3pZxTb4zDWa96uo:  -0.05100000 Waves

2022.08.10 17:10 [2178443] smart account 3MuCofTkjmv397dEuRXE3pZxTb4zDWa96uo > SELF 0.00000000 Waves

{ "type": 13, "id": "D9R93wvrjVumiadztcugyjxbH4hBsCBuQmpxJpRZHtX5", "fee": 5100000, "feeAssetId": null, "timestamp": 1660140647085, "version": 2, "chainId": 84, "sender": "3MuCofTkjmv397dEuRXE3pZxTb4zDWa96uo", "senderPublicKey": "HGKkqEdKKPVXHMq25FyB6nm1kyvrixu1a8Av6wc9t5CG", "proofs": [ "58seL7Pgi18XQ5JDm8fs6rJaWaK8yQLbiGp9qPgmux9xtukzjM63fb3BeEgqnx32gTF9UVsuD922rqRBJmvf9oNH" ], "script": "base64:BgJZCAISABIAEgMKAQESAwoBARIJCgcBAQEBAQEBEg4KDAEBAQEBAQEICAgBARIFCgMBAQESBQoDAQEBEgASAwoBARIAEgMKAQgSABIDCgEIEgMKAQgSBAoCCAF3AAlrX29yYV9rZXkCCWtfb3JhX2tleQAPa19vcmFfYmxvY2tfa2V5Ag9rX29yYV9ibG9ja19rZXkABWtfb3JhAgVrX29yYQAJa19iYWxhbmNlAglrX2JhbGFuY2UADmtfcG9zaXRpb25TaXplAg5rX3Bvc2l0aW9uU2l6ZQAQa19wb3NpdGlvbk1hcmdpbgIQa19wb3NpdGlvbk1hcmdpbgAWa19wb3NpdGlvbk9wZW5Ob3Rpb25hbAIWa19wb3NpdGlvbk9wZW5Ob3Rpb25hbAAua19wb3NpdGlvbkxhc3RVcGRhdGVkQ3VtdWxhdGl2ZVByZW1pdW1GcmFjdGlvbgISa19wb3NpdGlvbkZyYWN0aW9uAA1rX2luaXRpYWxpemVkAg1rX2luaXRpYWxpemVkAAhrX3BhdXNlZAIIa19wYXVzZWQABWtfZmVlAgVrX2ZlZQAPa19mdW5kaW5nUGVyaW9kAg9rX2Z1bmRpb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ldXRyaW5vCQDMCAIFB19hbW91bnQJAMwIAgkA2AQBCQEKcXVvdGVBc3NldAAFA25pbAUDbmlsAwkAAAIFB3Vuc3Rha2UFB3Vuc3Rha2UJAM4IAgkBCHdpdGhkcmF3AgkBEUBleHRyTmF0aXZlKDEwNjIpAQUHX3RyYWRlcgUHX2Ftb3VudAkBDXVwZGF0ZUJhbGFuY2UBCQBlAgkBCGNiYWxhbmNlAAUHX2Ftb3VudAkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgECdHgBBnZlcmlmeQAJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAJAQ5hZG1pblB1YmxpY0tleQCMQVZE", "height": 2178443, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CEtTD3RcGxR4kaMChCRvFHnePB6sXuXfpBaYPk8hNfxo Next: D42gZu8kz6jcgbJkMUk4qsMnpbQaxo5VbcRv6HFzb2p8 Diff:
OldNewDifferences
381381 let oracle = valueOrErrorMessage(addressFromString(getStringValue(this, k_ora)), "")
382382 let priceKey = getStringValue(this, k_ora_key)
383383 let blockKey = getStringValue(this, k_ora_block_key)
384- let lastValue = getIntegerValue(oracle, priceKey)
384+ let lastValue = valueOrErrorMessage(getInteger(oracle, priceKey), ((("Can not get oracle price. Oracle: " + toString(oracle)) + " key: ") + priceKey))
385385 lastValue
386386 }
387387
401401
402402
403403 func getPositionNotionalAndUnrealizedPnl (_trader,_option) = {
404- let $t01605216180 = getPosition(_trader)
405- let positionSize = $t01605216180._1
406- let positionMargin = $t01605216180._2
407- let positionOpenNotional = $t01605216180._3
408- let positionLstUpdCPF = $t01605216180._4
404+ let $t01614716275 = getPosition(_trader)
405+ let positionSize = $t01614716275._1
406+ let positionMargin = $t01614716275._2
407+ let positionOpenNotional = $t01614716275._3
408+ let positionLstUpdCPF = $t01614716275._4
409409 let positionSizeAbs = abs(positionSize)
410410 if ((positionSizeAbs == 0))
411411 then throw("Invalid position size")
413413 let isShort = (0 > positionSize)
414414 let positionNotional = if ((_option == PNL_OPTION_SPOT))
415415 then {
416- let $t01642716534 = swapOutput(!(isShort), positionSizeAbs)
417- let outPositionNotional = $t01642716534._1
418- let x1 = $t01642716534._2
419- let x2 = $t01642716534._3
420- let x3 = $t01642716534._4
416+ let $t01652216629 = swapOutput(!(isShort), positionSizeAbs)
417+ let outPositionNotional = $t01652216629._1
418+ let x1 = $t01652216629._2
419+ let x2 = $t01652216629._3
420+ let x3 = $t01652216629._4
421421 outPositionNotional
422422 }
423423 else muld(positionSizeAbs, getOracleTwapPrice())
433433
434434
435435 func getMarginRatioByOption (_trader,_option) = {
436- let $t01720417315 = getPosition(_trader)
437- let positionSize = $t01720417315._1
438- let positionMargin = $t01720417315._2
439- let pon = $t01720417315._3
440- let positionLstUpdCPF = $t01720417315._4
441- let $t01732117414 = getPositionNotionalAndUnrealizedPnl(_trader, _option)
442- let positionNotional = $t01732117414._1
443- let unrealizedPnl = $t01732117414._2
444- let $t01741917585 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl)
445- let remainMargin = $t01741917585._1
446- let badDebt = $t01741917585._2
436+ let $t01729917410 = getPosition(_trader)
437+ let positionSize = $t01729917410._1
438+ let positionMargin = $t01729917410._2
439+ let pon = $t01729917410._3
440+ let positionLstUpdCPF = $t01729917410._4
441+ let $t01741617509 = getPositionNotionalAndUnrealizedPnl(_trader, _option)
442+ let positionNotional = $t01741617509._1
443+ let unrealizedPnl = $t01741617509._2
444+ let $t01751417680 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl)
445+ let remainMargin = $t01751417680._1
446+ let badDebt = $t01751417680._2
447447 calcMarginRatio(remainMargin, badDebt, positionNotional)
448448 }
449449
452452
453453
454454 func internalClosePosition (_trader) = {
455- let $t01790118029 = getPosition(_trader)
456- let positionSize = $t01790118029._1
457- let positionMargin = $t01790118029._2
458- let positionOpenNotional = $t01790118029._3
459- let positionLstUpdCPF = $t01790118029._4
460- let $t01803518122 = getPositionNotionalAndUnrealizedPnl(_trader, PNL_OPTION_SPOT)
461- let x1 = $t01803518122._1
462- let unrealizedPnl = $t01803518122._2
463- let $t01812718295 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl)
464- let remainMargin = $t01812718295._1
465- let badDebt = $t01812718295._2
455+ let $t01799618124 = getPosition(_trader)
456+ let positionSize = $t01799618124._1
457+ let positionMargin = $t01799618124._2
458+ let positionOpenNotional = $t01799618124._3
459+ let positionLstUpdCPF = $t01799618124._4
460+ let $t01813018217 = getPositionNotionalAndUnrealizedPnl(_trader, PNL_OPTION_SPOT)
461+ let x1 = $t01813018217._1
462+ let unrealizedPnl = $t01813018217._2
463+ let $t01822218390 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl)
464+ let remainMargin = $t01822218390._1
465+ let badDebt = $t01822218390._2
466466 let exchangedPositionSize = -(positionSize)
467467 let realizedPnl = unrealizedPnl
468468 let marginToVault = -(remainMargin)
469- let $t01842218703 = swapOutput((positionSize > 0), abs(positionSize))
470- let exchangedQuoteAssetAmount = $t01842218703._1
471- let quoteAssetReserveAfter = $t01842218703._2
472- let baseAssetReserveAfter = $t01842218703._3
473- let totalPositionSizeAfter = $t01842218703._4
474- let cumulativeNotionalAfter = $t01842218703._5
475- let totalLongAfter = $t01842218703._6
476- let totalShortAfter = $t01842218703._7
469+ let $t01851718798 = swapOutput((positionSize > 0), abs(positionSize))
470+ let exchangedQuoteAssetAmount = $t01851718798._1
471+ let quoteAssetReserveAfter = $t01851718798._2
472+ let baseAssetReserveAfter = $t01851718798._3
473+ let totalPositionSizeAfter = $t01851718798._4
474+ let cumulativeNotionalAfter = $t01851718798._5
475+ let totalLongAfter = $t01851718798._6
476+ let totalShortAfter = $t01851718798._7
477477 let openInterestNotionalAfter = (openInterestNotional() - positionOpenNotional)
478478 $Tuple12(exchangedPositionSize, badDebt, realizedPnl, marginToVault, quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, exchangedQuoteAssetAmount, totalLongAfter, totalShortAfter)
479479 }
672672 else paused())
673673 then throw("Invalid decreasePosition parameters")
674674 else {
675- let $t02961229764 = getPosition(toString(i.caller))
676- let oldPositionSize = $t02961229764._1
677- let oldPositionMargin = $t02961229764._2
678- let oldPositionOpenNotional = $t02961229764._3
679- let oldPositionLstUpdCPF = $t02961229764._4
675+ let $t02970729859 = getPosition(toString(i.caller))
676+ let oldPositionSize = $t02970729859._1
677+ let oldPositionMargin = $t02970729859._2
678+ let oldPositionOpenNotional = $t02970729859._3
679+ let oldPositionLstUpdCPF = $t02970729859._4
680680 let _direction = if ((oldPositionSize > 0))
681681 then DIR_SHORT
682682 else DIR_LONG
683683 let isAdd = (_direction == DIR_LONG)
684684 let openNotional = muld(_amount, _leverage)
685- let $t02993730053 = getPositionNotionalAndUnrealizedPnl(toString(i.caller), PNL_OPTION_SPOT)
686- let oldPositionNotional = $t02993730053._1
687- let unrealizedPnl = $t02993730053._2
688- let $t03005932608 = if ((oldPositionNotional > openNotional))
685+ let $t03003230148 = getPositionNotionalAndUnrealizedPnl(toString(i.caller), PNL_OPTION_SPOT)
686+ let oldPositionNotional = $t03003230148._1
687+ let unrealizedPnl = $t03003230148._2
688+ let $t03015432703 = if ((oldPositionNotional > openNotional))
689689 then {
690- let $t03043630655 = swapInput(isAdd, openNotional)
691- let exchangedPositionSize = $t03043630655._1
692- let quoteAssetReserveAfter = $t03043630655._2
693- let baseAssetReserveAfter = $t03043630655._3
694- let totalPositionSizeAfter = $t03043630655._4
695- let cumulativeNotionalAfter = $t03043630655._5
690+ let $t03053130750 = swapInput(isAdd, openNotional)
691+ let exchangedPositionSize = $t03053130750._1
692+ let quoteAssetReserveAfter = $t03053130750._2
693+ let baseAssetReserveAfter = $t03053130750._3
694+ let totalPositionSizeAfter = $t03053130750._4
695+ let cumulativeNotionalAfter = $t03053130750._5
696696 let exchangedPositionSizeAbs = abs(exchangedPositionSize)
697697 if (if ((_minBaseAssetAmount != 0))
698698 then (_minBaseAssetAmount > exchangedPositionSizeAbs)
700700 then throw(((("Too little base asset exchanged, got " + toString(exchangedPositionSizeAbs)) + " expected ") + toString(_minBaseAssetAmount)))
701701 else {
702702 let realizedPnl = divd(muld(unrealizedPnl, exchangedPositionSizeAbs), abs(oldPositionSize))
703- let $t03109231337 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, realizedPnl)
704- let remainMargin = $t03109231337._1
705- let badDebt = $t03109231337._2
706- let fundingPayment = $t03109231337._3
703+ let $t03118731432 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, realizedPnl)
704+ let remainMargin = $t03118731432._1
705+ let badDebt = $t03118731432._2
706+ let fundingPayment = $t03118731432._3
707707 let exchangedQuoteAssetAmount = openNotional
708708 let unrealizedPnlAfter = (unrealizedPnl - realizedPnl)
709709 let remainOpenNotional = if ((oldPositionSize > 0))
718718 }
719719 }
720720 else throw("Close position first")
721- let newPositionSize = $t03005932608._1
722- let newPositionRemainMargin = $t03005932608._2
723- let newPositionOpenNotional = $t03005932608._3
724- let newPositionLatestCPF = $t03005932608._4
725- let baseAssetReserveAfter = $t03005932608._5
726- let quoteAssetReserveAfter = $t03005932608._6
727- let totalPositionSizeAfter = $t03005932608._7
728- let cumulativeNotionalAfter = $t03005932608._8
729- let openInterestNotionalAfter = $t03005932608._9
730- let totalLongAfter = $t03005932608._10
731- let totalShortAfter = $t03005932608._11
721+ let newPositionSize = $t03015432703._1
722+ let newPositionRemainMargin = $t03015432703._2
723+ let newPositionOpenNotional = $t03015432703._3
724+ let newPositionLatestCPF = $t03015432703._4
725+ let baseAssetReserveAfter = $t03015432703._5
726+ let quoteAssetReserveAfter = $t03015432703._6
727+ let totalPositionSizeAfter = $t03015432703._7
728+ let cumulativeNotionalAfter = $t03015432703._8
729+ let openInterestNotionalAfter = $t03015432703._9
730+ let totalLongAfter = $t03015432703._10
731+ let totalShortAfter = $t03015432703._11
732732 let notifyNotional = invoke(minerAddress(), "notifyNotional", [toString(i.caller), newPositionOpenNotional], nil)
733733 if ((notifyNotional == notifyNotional))
734734 then (updatePosition(toString(i.caller), newPositionSize, newPositionRemainMargin, newPositionOpenNotional, newPositionLatestCPF) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter))
757757 else {
758758 let feeAmount = muld(_rawAmount, fee())
759759 let _amount = (_rawAmount - feeAmount)
760- let $t03372633878 = getPosition(toString(i.caller))
761- let oldPositionSize = $t03372633878._1
762- let oldPositionMargin = $t03372633878._2
763- let oldPositionOpenNotional = $t03372633878._3
764- let oldPositionLstUpdCPF = $t03372633878._4
760+ let $t03382133973 = getPosition(toString(i.caller))
761+ let oldPositionSize = $t03382133973._1
762+ let oldPositionMargin = $t03382133973._2
763+ let oldPositionOpenNotional = $t03382133973._3
764+ let oldPositionLstUpdCPF = $t03382133973._4
765765 let isNewPosition = (oldPositionSize == 0)
766766 let isSameDirection = if ((oldPositionSize > 0))
767767 then (_direction == DIR_LONG)
770770 then isSameDirection
771771 else false
772772 let isAdd = (_direction == DIR_LONG)
773- let $t03416736556 = if (if (isNewPosition)
773+ let $t03426236651 = if (if (isNewPosition)
774774 then true
775775 else expandExisting)
776776 then {
777777 let openNotional = muld(_amount, _leverage)
778- let $t03459134797 = swapInput(isAdd, openNotional)
779- let amountBaseAssetBought = $t03459134797._1
780- let quoteAssetReserveAfter = $t03459134797._2
781- let baseAssetReserveAfter = $t03459134797._3
782- let totalPositionSizeAfter = $t03459134797._4
783- let cumulativeNotionalAfter = $t03459134797._5
778+ let $t03468634892 = swapInput(isAdd, openNotional)
779+ let amountBaseAssetBought = $t03468634892._1
780+ let quoteAssetReserveAfter = $t03468634892._2
781+ let baseAssetReserveAfter = $t03468634892._3
782+ let totalPositionSizeAfter = $t03468634892._4
783+ let cumulativeNotionalAfter = $t03468634892._5
784784 if (if ((_minBaseAssetAmount != 0))
785785 then (_minBaseAssetAmount > abs(amountBaseAssetBought))
786786 else false)
788788 else {
789789 let newPositionSize = (oldPositionSize + amountBaseAssetBought)
790790 let increaseMarginRequirement = divd(openNotional, _leverage)
791- let $t03517835417 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, increaseMarginRequirement)
792- let remainMargin = $t03517835417._1
793- let x1 = $t03517835417._2
794- let x2 = $t03517835417._3
791+ let $t03527335512 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, increaseMarginRequirement)
792+ let remainMargin = $t03527335512._1
793+ let x1 = $t03527335512._2
794+ let x2 = $t03527335512._3
795795 $Tuple11(newPositionSize, remainMargin, (oldPositionOpenNotional + openNotional), latestCumulativePremiumFraction(newPositionSize), baseAssetReserveAfter, quoteAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, (openInterestNotional() + openNotional), (totalLongPositionSize() + (if ((newPositionSize > 0))
796796 then abs(amountBaseAssetBought)
797797 else 0)), (totalShortPositionSize() + (if ((0 > newPositionSize))
801801 }
802802 else {
803803 let openNotional = muld(_amount, _leverage)
804- let $t03624936365 = getPositionNotionalAndUnrealizedPnl(toString(i.caller), PNL_OPTION_SPOT)
805- let oldPositionNotional = $t03624936365._1
806- let unrealizedPnl = $t03624936365._2
804+ let $t03634436460 = getPositionNotionalAndUnrealizedPnl(toString(i.caller), PNL_OPTION_SPOT)
805+ let oldPositionNotional = $t03634436460._1
806+ let unrealizedPnl = $t03634436460._2
807807 if ((oldPositionNotional > openNotional))
808808 then throw("Use decreasePosition to decrease position size")
809809 else throw("Close position first")
810810 }
811- let newPositionSize = $t03416736556._1
812- let newPositionRemainMargin = $t03416736556._2
813- let newPositionOpenNotional = $t03416736556._3
814- let newPositionLatestCPF = $t03416736556._4
815- let baseAssetReserveAfter = $t03416736556._5
816- let quoteAssetReserveAfter = $t03416736556._6
817- let totalPositionSizeAfter = $t03416736556._7
818- let cumulativeNotionalAfter = $t03416736556._8
819- let openInterestNotionalAfter = $t03416736556._9
820- let totalLongAfter = $t03416736556._10
821- let totalShortAfter = $t03416736556._11
811+ let newPositionSize = $t03426236651._1
812+ let newPositionRemainMargin = $t03426236651._2
813+ let newPositionOpenNotional = $t03426236651._3
814+ let newPositionLatestCPF = $t03426236651._4
815+ let baseAssetReserveAfter = $t03426236651._5
816+ let quoteAssetReserveAfter = $t03426236651._6
817+ let totalPositionSizeAfter = $t03426236651._7
818+ let cumulativeNotionalAfter = $t03426236651._8
819+ let openInterestNotionalAfter = $t03426236651._9
820+ let totalLongAfter = $t03426236651._10
821+ let totalShortAfter = $t03426236651._11
822822 let feeToStakers = (feeAmount / 2)
823823 let feeToInsurance = (feeAmount - feeToStakers)
824824 let stake = invoke(quoteAssetStaking(), "lockNeutrinoSP", [toString(stakingAddress()), ALL_FEES], [AttachedPayment(quoteAsset(), _amount)])
859859 else {
860860 let feeAmount = muld(_rawAmount, fee())
861861 let _amount = (_rawAmount - feeAmount)
862- let $t03811238264 = getPosition(toString(i.caller))
863- let oldPositionSize = $t03811238264._1
864- let oldPositionMargin = $t03811238264._2
865- let oldPositionOpenNotional = $t03811238264._3
866- let oldPositionLstUpdCPF = $t03811238264._4
862+ let $t03820738359 = getPosition(toString(i.caller))
863+ let oldPositionSize = $t03820738359._1
864+ let oldPositionMargin = $t03820738359._2
865+ let oldPositionOpenNotional = $t03820738359._3
866+ let oldPositionLstUpdCPF = $t03820738359._4
867867 let feeToStakers = (feeAmount / 2)
868868 let feeToInsurance = (feeAmount - feeToStakers)
869869 let stake = invoke(quoteAssetStaking(), "lockNeutrinoSP", [toString(stakingAddress()), ALL_FEES], [AttachedPayment(quoteAsset(), _amount)])
895895 else paused())
896896 then throw("Invalid removeMargin parameters")
897897 else {
898- let $t03931339465 = getPosition(toString(i.caller))
899- let oldPositionSize = $t03931339465._1
900- let oldPositionMargin = $t03931339465._2
901- let oldPositionOpenNotional = $t03931339465._3
902- let oldPositionLstUpdCPF = $t03931339465._4
898+ let $t03940839560 = getPosition(toString(i.caller))
899+ let oldPositionSize = $t03940839560._1
900+ let oldPositionMargin = $t03940839560._2
901+ let oldPositionOpenNotional = $t03940839560._3
902+ let oldPositionLstUpdCPF = $t03940839560._4
903903 let marginDelta = -(_amount)
904- let $t03950239681 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, marginDelta)
905- let remainMargin = $t03950239681._1
906- let badDebt = $t03950239681._2
904+ let $t03959739776 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, marginDelta)
905+ let remainMargin = $t03959739776._1
906+ let badDebt = $t03959739776._2
907907 if ((badDebt != 0))
908908 then throw("Invalid removed margin amount")
909909 else {
929929 else paused())
930930 then throw("Invalid closePosition parameters")
931931 else {
932- let $t04077741161 = internalClosePosition(toString(i.caller))
933- let x1 = $t04077741161._1
934- let positionBadDebt = $t04077741161._2
935- let realizedPnl = $t04077741161._3
936- let marginToVault = $t04077741161._4
937- let quoteAssetReserveAfter = $t04077741161._5
938- let baseAssetReserveAfter = $t04077741161._6
939- let totalPositionSizeAfter = $t04077741161._7
940- let cumulativeNotionalAfter = $t04077741161._8
941- let openInterestNotionalAfter = $t04077741161._9
942- let x2 = $t04077741161._10
943- let totalLongAfter = $t04077741161._11
944- let totalShortAfter = $t04077741161._12
932+ let $t04087241256 = internalClosePosition(toString(i.caller))
933+ let x1 = $t04087241256._1
934+ let positionBadDebt = $t04087241256._2
935+ let realizedPnl = $t04087241256._3
936+ let marginToVault = $t04087241256._4
937+ let quoteAssetReserveAfter = $t04087241256._5
938+ let baseAssetReserveAfter = $t04087241256._6
939+ let totalPositionSizeAfter = $t04087241256._7
940+ let cumulativeNotionalAfter = $t04087241256._8
941+ let openInterestNotionalAfter = $t04087241256._9
942+ let x2 = $t04087241256._10
943+ let totalLongAfter = $t04087241256._11
944+ let totalShortAfter = $t04087241256._12
945945 if ((positionBadDebt > 0))
946946 then throw("Unable to close position with bad debt")
947947 else {
948948 let withdrawAmount = abs(marginToVault)
949949 let ammBalance = (cbalance() - withdrawAmount)
950- let $t04137041512 = if ((0 > ammBalance))
950+ let $t04146541607 = if ((0 > ammBalance))
951951 then $Tuple2(0, abs(ammBalance))
952952 else $Tuple2(ammBalance, 0)
953- let ammNewBalance = $t04137041512._1
954- let getFromInsurance = $t04137041512._2
953+ let ammNewBalance = $t04146541607._1
954+ let getFromInsurance = $t04146541607._2
955955 let x = if ((getFromInsurance > 0))
956956 then {
957957 let withdrawInsurance = invoke(insuranceAddress(), "withdraw", [getFromInsurance], nil)
996996 else paused())
997997 then throw("Unable to liquidate")
998998 else {
999- let $t04320243618 = internalClosePosition(_trader)
1000- let x1 = $t04320243618._1
1001- let badDebt = $t04320243618._2
1002- let x2 = $t04320243618._3
1003- let x3 = $t04320243618._4
1004- let quoteAssetReserveAfter = $t04320243618._5
1005- let baseAssetReserveAfter = $t04320243618._6
1006- let totalPositionSizeAfter = $t04320243618._7
1007- let cumulativeNotionalAfter = $t04320243618._8
1008- let openInterestNotionalAfter = $t04320243618._9
1009- let exchangedQuoteAssetAmount = $t04320243618._10
1010- let totalLongAfter = $t04320243618._11
1011- let totalShortAfter = $t04320243618._12
999+ let $t04329743713 = internalClosePosition(_trader)
1000+ let x1 = $t04329743713._1
1001+ let badDebt = $t04329743713._2
1002+ let x2 = $t04329743713._3
1003+ let x3 = $t04329743713._4
1004+ let quoteAssetReserveAfter = $t04329743713._5
1005+ let baseAssetReserveAfter = $t04329743713._6
1006+ let totalPositionSizeAfter = $t04329743713._7
1007+ let cumulativeNotionalAfter = $t04329743713._8
1008+ let openInterestNotionalAfter = $t04329743713._9
1009+ let exchangedQuoteAssetAmount = $t04329743713._10
1010+ let totalLongAfter = $t04329743713._11
1011+ let totalShortAfter = $t04329743713._12
10121012 let liquidationPenalty = muld(exchangedQuoteAssetAmount, liquidationFeeRatio())
10131013 let feeToLiquidator = (liquidationPenalty / 2)
10141014 let feeToInsurance = (liquidationPenalty - feeToLiquidator)
10151015 let ammBalance = (cbalance() - liquidationPenalty)
1016- let $t04401644151 = if ((0 > ammBalance))
1016+ let $t04411144246 = if ((0 > ammBalance))
10171017 then $Tuple2(0, abs(ammBalance))
10181018 else $Tuple2(ammBalance, 0)
1019- let newAmmBalance = $t04401644151._1
1020- let takeFromInsurance = $t04401644151._2
1019+ let newAmmBalance = $t04411144246._1
1020+ let takeFromInsurance = $t04411144246._2
10211021 let x = if ((takeFromInsurance > 0))
10221022 then {
10231023 let withdrawInsurance = invoke(insuranceAddress(), "withdraw", [takeFromInsurance], nil)
10621062 let underlyingPrice = getOracleTwapPrice()
10631063 let spotTwapPrice = getTwapSpotPrice()
10641064 let premium = (spotTwapPrice - underlyingPrice)
1065- let $t04564546980 = if (if ((totalShortPositionSize() == 0))
1065+ let $t04574047075 = if (if ((totalShortPositionSize() == 0))
10661066 then true
10671067 else (totalLongPositionSize() == 0))
10681068 then $Tuple2(0, 0)
10771077 let shortPremiumFraction = divd(muld(longPremiumFraction, totalLongPositionSize()), totalShortPositionSize())
10781078 $Tuple2(shortPremiumFraction, longPremiumFraction)
10791079 }
1080- let shortPremiumFraction = $t04564546980._1
1081- let longPremiumFraction = $t04564546980._2
1080+ let shortPremiumFraction = $t04574047075._1
1081+ let longPremiumFraction = $t04574047075._2
10821082 updateFunding((fundingBlockTimestamp + fundingPeriodSeconds()), (latestLongCumulativePremiumFraction() + longPremiumFraction), (latestShortCumulativePremiumFraction() + shortPremiumFraction), divd(longPremiumFraction, underlyingPrice), divd(shortPremiumFraction, underlyingPrice))
10831083 }
10841084 }
10871087
10881088 @Callable(i)
10891089 func v_get (_trader) = {
1090- let $t04735547408 = internalClosePosition(_trader)
1091- let x1 = $t04735547408._1
1092- let x2 = $t04735547408._2
1093- let x3 = $t04735547408._3
1094- let x4 = $t04735547408._4
1090+ let $t04745047503 = internalClosePosition(_trader)
1091+ let x1 = $t04745047503._1
1092+ let x2 = $t04745047503._2
1093+ let x3 = $t04745047503._3
1094+ let x4 = $t04745047503._4
10951095 throw((((s(x2) + s(x3)) + s(x4)) + s(getMarginRatio(_trader))))
10961096 }
10971097
10991099
11001100 @Callable(i)
11011101 func view_calcRemainMarginWithFundingPayment (_trader) = {
1102- let $t04755547666 = getPosition(_trader)
1103- let positionSize = $t04755547666._1
1104- let positionMargin = $t04755547666._2
1105- let pon = $t04755547666._3
1106- let positionLstUpdCPF = $t04755547666._4
1107- let $t04767147772 = getPositionNotionalAndUnrealizedPnl(_trader, PNL_OPTION_SPOT)
1108- let positionNotional = $t04767147772._1
1109- let unrealizedPnl = $t04767147772._2
1110- let $t04777747959 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl)
1111- let remainMargin = $t04777747959._1
1112- let badDebt = $t04777747959._2
1113- let fundingPayment = $t04777747959._3
1102+ let $t04765047761 = getPosition(_trader)
1103+ let positionSize = $t04765047761._1
1104+ let positionMargin = $t04765047761._2
1105+ let pon = $t04765047761._3
1106+ let positionLstUpdCPF = $t04765047761._4
1107+ let $t04776647867 = getPositionNotionalAndUnrealizedPnl(_trader, PNL_OPTION_SPOT)
1108+ let positionNotional = $t04776647867._1
1109+ let unrealizedPnl = $t04776647867._2
1110+ let $t04787248054 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl)
1111+ let remainMargin = $t04787248054._1
1112+ let badDebt = $t04787248054._2
1113+ let fundingPayment = $t04787248054._3
11141114 throw(((s(remainMargin) + s(fundingPayment)) + s(getMarginRatio(_trader))))
11151115 }
11161116
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let k_ora_key = "k_ora_key"
55
66 let k_ora_block_key = "k_ora_block_key"
77
88 let k_ora = "k_ora"
99
1010 let k_balance = "k_balance"
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_initialized = "k_initialized"
2121
2222 let k_paused = "k_paused"
2323
2424 let k_fee = "k_fee"
2525
2626 let k_fundingPeriod = "k_fundingPeriod"
2727
2828 let k_initMarginRatio = "k_initMarginRatio"
2929
3030 let k_maintenanceMarginRatio = "k_mmr"
3131
3232 let k_liquidationFeeRatio = "k_liquidationFeeRatio"
3333
3434 let k_spreadLimit = "k_spreadLimit"
3535
3636 let k_maxPriceImpact = "k_maxPriceImpact"
3737
3838 let k_lastDataStr = "k_lastDataStr"
3939
4040 let k_lastMinuteId = "k_lastMinuteId"
4141
4242 let k_twapDataLastCumulativePrice = "k_twapDataLastCumulativePrice"
4343
4444 let k_twapDataLastPrice = "k_twapDataLastPrice"
4545
4646 let k_twapDataPreviousMinuteId = "k_twapDataPreviousMinuteId"
4747
4848 let k_latestLongCumulativePremiumFraction = "k_latestLongPremiumFraction"
4949
5050 let k_latestShortCumulativePremiumFraction = "k_latestShortPremiumFraction"
5151
5252 let k_nextFundingBlock = "k_nextFundingBlockMinTimestamp"
5353
5454 let k_longFundingRate = "k_longFundingRate"
5555
5656 let k_shortFundingRate = "k_shortFundingRate"
5757
5858 let k_quoteAssetReserve = "k_qtAstR"
5959
6060 let k_baseAssetReserve = "k_bsAstR"
6161
6262 let k_totalPositionSize = "k_totalPositionSize"
6363
6464 let k_totalLongPositionSize = "k_totalLongPositionSize"
6565
6666 let k_totalShortPositionSize = "k_totalShortPositionSize"
6767
6868 let k_cumulativeNotional = "k_cumulativeNotional"
6969
7070 let k_openInterestNotional = "k_openInterestNotional"
7171
7272 let k_coordinatorAddress = "k_coordinatorAddress"
7373
7474 let k_insurance_address = "k_insurance_address"
7575
7676 let k_admin_address = "k_admin_address"
7777
7878 let k_admin_public_key = "k_admin_public_key"
7979
8080 let k_quote_asset = "k_quote_asset"
8181
8282 let k_quote_staking = "k_quote_staking"
8383
8484 let k_staking_address = "k_staking_address"
8585
8686 let k_miner_address = "k_miner_address"
8787
8888 func coordinator () = valueOrErrorMessage(addressFromString(getStringValue(this, k_coordinatorAddress)), "Coordinator not set")
8989
9090
9191 func adminAddress () = addressFromString(getStringValue(coordinator(), k_admin_address))
9292
9393
9494 func adminPublicKey () = fromBase58String(getStringValue(coordinator(), k_admin_public_key))
9595
9696
9797 func quoteAsset () = fromBase58String(getStringValue(coordinator(), k_quote_asset))
9898
9999
100100 func quoteAssetStaking () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_quote_staking)), "Quote asset staking not set")
101101
102102
103103 func stakingAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_staking_address)), "Insurance not set")
104104
105105
106106 func insuranceAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_insurance_address)), "Insurance not set")
107107
108108
109109 func minerAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_miner_address)), "Insurance not set")
110110
111111
112112 let DIR_LONG = 1
113113
114114 let DIR_SHORT = 2
115115
116116 let TWAP_INTERVAL = 15
117117
118118 let ORACLE_INTERVAL = 15
119119
120120 let SECONDS = 1000
121121
122122 let DECIMAL_UNIT = (1 * (((((10 * 10) * 10) * 10) * 10) * 10))
123123
124124 let ONE_DAY = (86400 * DECIMAL_UNIT)
125125
126126 let ALL_FEES = 100
127127
128128 let PNL_OPTION_SPOT = 1
129129
130130 let PNL_OPTION_ORACLE = 2
131131
132132 func s (_x) = (toString(_x) + ",")
133133
134134
135135 func divd (_x,_y) = fraction(_x, DECIMAL_UNIT, _y, HALFEVEN)
136136
137137
138138 func muld (_x,_y) = fraction(_x, _y, DECIMAL_UNIT, HALFEVEN)
139139
140140
141141 func abs (_x) = if ((_x > 0))
142142 then _x
143143 else -(_x)
144144
145145
146146 func vmax (_x,_y) = if ((_x >= _y))
147147 then _x
148148 else _y
149149
150150
151151 func toCompositeKey (_key,_address) = ((_key + "_") + _address)
152152
153153
154154 func listToStr (_list) = {
155155 func _join (accumulator,val) = ((accumulator + val) + ",")
156156
157157 let newListStr = {
158158 let $l = _list
159159 let $s = size($l)
160160 let $acc0 = ""
161161 func $f0_1 ($a,$i) = if (($i >= $s))
162162 then $a
163163 else _join($a, $l[$i])
164164
165165 func $f0_2 ($a,$i) = if (($i >= $s))
166166 then $a
167167 else throw("List size exceeds 20")
168168
169169 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20)
170170 }
171171 let newListStrU = dropRight(newListStr, 1)
172172 let newListStrR = if ((take(newListStrU, 1) == ","))
173173 then drop(newListStrU, 1)
174174 else newListStrU
175175 newListStrR
176176 }
177177
178178
179179 func strToList (_str) = split(_str, ",")
180180
181181
182182 func pushToQueue (_list,_maxSize,_value) = if ((size(_list) > _maxSize))
183183 then (removeByIndex(_list, 0) :+ _value)
184184 else (_list :+ _value)
185185
186186
187187 func int (k) = valueOrErrorMessage(getInteger(this, k), ("no value for " + k))
188188
189189
190190 func cbalance () = int(k_balance)
191191
192192
193193 func fee () = int(k_fee)
194194
195195
196196 func initMarginRatio () = int(k_initMarginRatio)
197197
198198
199199 func qtAstR () = int(k_quoteAssetReserve)
200200
201201
202202 func bsAstR () = int(k_baseAssetReserve)
203203
204204
205205 func totalPositionSize () = int(k_totalPositionSize)
206206
207207
208208 func cumulativeNotional () = int(k_cumulativeNotional)
209209
210210
211211 func openInterestNotional () = int(k_openInterestNotional)
212212
213213
214214 func nextFundingBlockTimestamp () = int(k_nextFundingBlock)
215215
216216
217217 func fundingPeriodRaw () = int(k_fundingPeriod)
218218
219219
220220 func fundingPeriodDecimal () = (fundingPeriodRaw() * DECIMAL_UNIT)
221221
222222
223223 func fundingPeriodSeconds () = (fundingPeriodRaw() * SECONDS)
224224
225225
226226 func maintenanceMarginRatio () = int(k_maintenanceMarginRatio)
227227
228228
229229 func liquidationFeeRatio () = int(k_liquidationFeeRatio)
230230
231231
232232 func spreadLimit () = int(k_spreadLimit)
233233
234234
235235 func maxPriceImpact () = int(k_maxPriceImpact)
236236
237237
238238 func latestLongCumulativePremiumFraction () = int(k_latestLongCumulativePremiumFraction)
239239
240240
241241 func latestShortCumulativePremiumFraction () = int(k_latestShortCumulativePremiumFraction)
242242
243243
244244 func totalShortPositionSize () = int(k_totalShortPositionSize)
245245
246246
247247 func totalLongPositionSize () = int(k_totalLongPositionSize)
248248
249249
250250 func requireMoreMarginRatio (_marginRatio,_baseMarginRatio,_largerThanOrEqualTo) = {
251251 let remainingMarginRatio = (_marginRatio - _baseMarginRatio)
252252 if (if (_largerThanOrEqualTo)
253253 then (0 > remainingMarginRatio)
254254 else false)
255255 then throw("Invalid margin")
256256 else if (if (!(_largerThanOrEqualTo))
257257 then (remainingMarginRatio >= 0)
258258 else false)
259259 then throw("Invalid margin")
260260 else true
261261 }
262262
263263
264264 func latestCumulativePremiumFraction (_positionSize) = if ((_positionSize == 0))
265265 then throw("Should not be called with _positionSize == 0")
266266 else if ((_positionSize > 0))
267267 then latestLongCumulativePremiumFraction()
268268 else latestShortCumulativePremiumFraction()
269269
270270
271271 func getPosition (_trader) = {
272272 let positionSizeOpt = getInteger(this, toCompositeKey(k_positionSize, _trader))
273273 match positionSizeOpt {
274274 case positionSize: Int =>
275275 $Tuple4(positionSize, getIntegerValue(this, toCompositeKey(k_positionMargin, _trader)), getIntegerValue(this, toCompositeKey(k_positionOpenNotional, _trader)), getIntegerValue(this, toCompositeKey(k_positionLastUpdatedCumulativePremiumFraction, _trader)))
276276 case _ =>
277277 $Tuple4(0, 0, 0, 0)
278278 }
279279 }
280280
281281
282282 func requireOpenPosition (_trader) = if ((getPosition(_trader)._1 == 0))
283283 then throw("No open position")
284284 else true
285285
286286
287287 func initialized () = valueOrElse(getBoolean(this, k_initialized), false)
288288
289289
290290 func paused () = valueOrElse(getBoolean(this, k_paused), false)
291291
292292
293293 func updateReserve (_isAdd,_quoteAssetAmount,_baseAssetAmount) = if (_isAdd)
294294 then {
295295 let newBase = (bsAstR() - _baseAssetAmount)
296296 if ((0 >= newBase))
297297 then throw("Tx lead to base asset reserve <= 0, revert")
298298 else $Tuple4((qtAstR() + _quoteAssetAmount), newBase, (totalPositionSize() + _baseAssetAmount), (cumulativeNotional() + _quoteAssetAmount))
299299 }
300300 else {
301301 let newQuote = (qtAstR() - _quoteAssetAmount)
302302 if ((0 >= newQuote))
303303 then throw("Tx lead to base quote reserve <= 0, revert")
304304 else $Tuple4(newQuote, (bsAstR() + _baseAssetAmount), (totalPositionSize() - _baseAssetAmount), (cumulativeNotional() - _quoteAssetAmount))
305305 }
306306
307307
308308 func swapInput (_isAdd,_quoteAssetAmount) = {
309309 let _qtAstR = qtAstR()
310310 let _bsAstR = bsAstR()
311311 let priceBefore = divd(_qtAstR, _bsAstR)
312312 let amountBaseAssetBoughtWithoutPriceImpact = muld(_quoteAssetAmount, priceBefore)
313313 let k = muld(_qtAstR, _bsAstR)
314314 let quoteAssetReserveAfter = if (_isAdd)
315315 then (_qtAstR + _quoteAssetAmount)
316316 else (_qtAstR - _quoteAssetAmount)
317317 let baseAssetReserveAfter = divd(k, quoteAssetReserveAfter)
318318 let amountBaseAssetBoughtAbs = abs((baseAssetReserveAfter - _bsAstR))
319319 let amountBaseAssetBought = if (_isAdd)
320320 then amountBaseAssetBoughtAbs
321321 else -(amountBaseAssetBoughtAbs)
322322 let priceImpact = ((amountBaseAssetBoughtWithoutPriceImpact - amountBaseAssetBoughtAbs) / amountBaseAssetBoughtWithoutPriceImpact)
323323 let maxPriceImpactValue = maxPriceImpact()
324324 if ((priceImpact > maxPriceImpactValue))
325325 then throw(((("Price impact " + toString(priceImpact)) + " > max price impact ") + toString(maxPriceImpactValue)))
326326 else {
327327 let $t01231212515 = updateReserve(_isAdd, _quoteAssetAmount, amountBaseAssetBoughtAbs)
328328 let quoteAssetReserveAfter1 = $t01231212515._1
329329 let baseAssetReserveAfter1 = $t01231212515._2
330330 let totalPositionSizeAfter1 = $t01231212515._3
331331 let cumulativeNotionalAfter1 = $t01231212515._4
332332 $Tuple5(amountBaseAssetBought, quoteAssetReserveAfter1, baseAssetReserveAfter1, totalPositionSizeAfter1, cumulativeNotionalAfter1)
333333 }
334334 }
335335
336336
337337 func calcRemainMarginWithFundingPayment (_oldPositionSize,_oldPositionMargin,_oldPositionCumulativePremiumFraction,_marginDelta) = {
338338 let fundingPayment = if ((_oldPositionSize != 0))
339339 then {
340340 let _latestCumulativePremiumFraction = latestCumulativePremiumFraction(_oldPositionSize)
341341 muld((_latestCumulativePremiumFraction - _oldPositionCumulativePremiumFraction), _oldPositionSize)
342342 }
343343 else 0
344344 let signedMargin = ((_marginDelta - fundingPayment) + _oldPositionMargin)
345345 let $t01326213389 = if ((0 > signedMargin))
346346 then $Tuple2(0, abs(signedMargin))
347347 else $Tuple2(abs(signedMargin), 0)
348348 let remainMargin = $t01326213389._1
349349 let badDebt = $t01326213389._2
350350 $Tuple3(remainMargin, badDebt, fundingPayment)
351351 }
352352
353353
354354 func swapOutput (_isAdd,_baseAssetAmount) = {
355355 let _quoteAssetReserve = qtAstR()
356356 let _baseAssetReserve = bsAstR()
357357 if ((_baseAssetAmount == 0))
358358 then throw("Invalid base asset amount")
359359 else {
360360 let k = muld(_quoteAssetReserve, _baseAssetReserve)
361361 let baseAssetPoolAmountAfter = if (_isAdd)
362362 then (_baseAssetReserve + _baseAssetAmount)
363363 else (_baseAssetReserve - _baseAssetAmount)
364364 let quoteAssetAfter = divd(k, baseAssetPoolAmountAfter)
365365 let quoteAssetSold = abs((quoteAssetAfter - _quoteAssetReserve))
366366 let $t01422714420 = updateReserve(!(_isAdd), quoteAssetSold, _baseAssetAmount)
367367 let quoteAssetReserveAfter1 = $t01422714420._1
368368 let baseAssetReserveAfter1 = $t01422714420._2
369369 let totalPositionSizeAfter1 = $t01422714420._3
370370 let cumulativeNotionalAfter1 = $t01422714420._4
371371 $Tuple7(quoteAssetSold, quoteAssetReserveAfter1, baseAssetReserveAfter1, totalPositionSizeAfter1, cumulativeNotionalAfter1, (totalLongPositionSize() - (if (_isAdd)
372372 then abs(_baseAssetAmount)
373373 else 0)), (totalShortPositionSize() - (if (!(_isAdd))
374374 then abs(_baseAssetAmount)
375375 else 0)))
376376 }
377377 }
378378
379379
380380 func getOracleTwapPrice () = {
381381 let oracle = valueOrErrorMessage(addressFromString(getStringValue(this, k_ora)), "")
382382 let priceKey = getStringValue(this, k_ora_key)
383383 let blockKey = getStringValue(this, k_ora_block_key)
384- let lastValue = getIntegerValue(oracle, priceKey)
384+ let lastValue = valueOrErrorMessage(getInteger(oracle, priceKey), ((("Can not get oracle price. Oracle: " + toString(oracle)) + " key: ") + priceKey))
385385 lastValue
386386 }
387387
388388
389389 func getSpotPrice () = {
390390 let _quoteAssetReserve = qtAstR()
391391 let _baseAssetReserve = bsAstR()
392392 divd(_quoteAssetReserve, _baseAssetReserve)
393393 }
394394
395395
396396 func isOverFluctuationLimit () = {
397397 let oraclePrice = getOracleTwapPrice()
398398 let currentPrice = getSpotPrice()
399399 (divd(abs((oraclePrice - currentPrice)), oraclePrice) > spreadLimit())
400400 }
401401
402402
403403 func getPositionNotionalAndUnrealizedPnl (_trader,_option) = {
404- let $t01605216180 = getPosition(_trader)
405- let positionSize = $t01605216180._1
406- let positionMargin = $t01605216180._2
407- let positionOpenNotional = $t01605216180._3
408- let positionLstUpdCPF = $t01605216180._4
404+ let $t01614716275 = getPosition(_trader)
405+ let positionSize = $t01614716275._1
406+ let positionMargin = $t01614716275._2
407+ let positionOpenNotional = $t01614716275._3
408+ let positionLstUpdCPF = $t01614716275._4
409409 let positionSizeAbs = abs(positionSize)
410410 if ((positionSizeAbs == 0))
411411 then throw("Invalid position size")
412412 else {
413413 let isShort = (0 > positionSize)
414414 let positionNotional = if ((_option == PNL_OPTION_SPOT))
415415 then {
416- let $t01642716534 = swapOutput(!(isShort), positionSizeAbs)
417- let outPositionNotional = $t01642716534._1
418- let x1 = $t01642716534._2
419- let x2 = $t01642716534._3
420- let x3 = $t01642716534._4
416+ let $t01652216629 = swapOutput(!(isShort), positionSizeAbs)
417+ let outPositionNotional = $t01652216629._1
418+ let x1 = $t01652216629._2
419+ let x2 = $t01652216629._3
420+ let x3 = $t01652216629._4
421421 outPositionNotional
422422 }
423423 else muld(positionSizeAbs, getOracleTwapPrice())
424424 let unrealizedPnl = if (isShort)
425425 then (positionOpenNotional - positionNotional)
426426 else (positionNotional - positionOpenNotional)
427427 $Tuple2(positionNotional, unrealizedPnl)
428428 }
429429 }
430430
431431
432432 func calcMarginRatio (_remainMargin,_badDebt,_positionNotional) = divd((_remainMargin - _badDebt), _positionNotional)
433433
434434
435435 func getMarginRatioByOption (_trader,_option) = {
436- let $t01720417315 = getPosition(_trader)
437- let positionSize = $t01720417315._1
438- let positionMargin = $t01720417315._2
439- let pon = $t01720417315._3
440- let positionLstUpdCPF = $t01720417315._4
441- let $t01732117414 = getPositionNotionalAndUnrealizedPnl(_trader, _option)
442- let positionNotional = $t01732117414._1
443- let unrealizedPnl = $t01732117414._2
444- let $t01741917585 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl)
445- let remainMargin = $t01741917585._1
446- let badDebt = $t01741917585._2
436+ let $t01729917410 = getPosition(_trader)
437+ let positionSize = $t01729917410._1
438+ let positionMargin = $t01729917410._2
439+ let pon = $t01729917410._3
440+ let positionLstUpdCPF = $t01729917410._4
441+ let $t01741617509 = getPositionNotionalAndUnrealizedPnl(_trader, _option)
442+ let positionNotional = $t01741617509._1
443+ let unrealizedPnl = $t01741617509._2
444+ let $t01751417680 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl)
445+ let remainMargin = $t01751417680._1
446+ let badDebt = $t01751417680._2
447447 calcMarginRatio(remainMargin, badDebt, positionNotional)
448448 }
449449
450450
451451 func getMarginRatio (_trader) = getMarginRatioByOption(_trader, PNL_OPTION_SPOT)
452452
453453
454454 func internalClosePosition (_trader) = {
455- let $t01790118029 = getPosition(_trader)
456- let positionSize = $t01790118029._1
457- let positionMargin = $t01790118029._2
458- let positionOpenNotional = $t01790118029._3
459- let positionLstUpdCPF = $t01790118029._4
460- let $t01803518122 = getPositionNotionalAndUnrealizedPnl(_trader, PNL_OPTION_SPOT)
461- let x1 = $t01803518122._1
462- let unrealizedPnl = $t01803518122._2
463- let $t01812718295 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl)
464- let remainMargin = $t01812718295._1
465- let badDebt = $t01812718295._2
455+ let $t01799618124 = getPosition(_trader)
456+ let positionSize = $t01799618124._1
457+ let positionMargin = $t01799618124._2
458+ let positionOpenNotional = $t01799618124._3
459+ let positionLstUpdCPF = $t01799618124._4
460+ let $t01813018217 = getPositionNotionalAndUnrealizedPnl(_trader, PNL_OPTION_SPOT)
461+ let x1 = $t01813018217._1
462+ let unrealizedPnl = $t01813018217._2
463+ let $t01822218390 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl)
464+ let remainMargin = $t01822218390._1
465+ let badDebt = $t01822218390._2
466466 let exchangedPositionSize = -(positionSize)
467467 let realizedPnl = unrealizedPnl
468468 let marginToVault = -(remainMargin)
469- let $t01842218703 = swapOutput((positionSize > 0), abs(positionSize))
470- let exchangedQuoteAssetAmount = $t01842218703._1
471- let quoteAssetReserveAfter = $t01842218703._2
472- let baseAssetReserveAfter = $t01842218703._3
473- let totalPositionSizeAfter = $t01842218703._4
474- let cumulativeNotionalAfter = $t01842218703._5
475- let totalLongAfter = $t01842218703._6
476- let totalShortAfter = $t01842218703._7
469+ let $t01851718798 = swapOutput((positionSize > 0), abs(positionSize))
470+ let exchangedQuoteAssetAmount = $t01851718798._1
471+ let quoteAssetReserveAfter = $t01851718798._2
472+ let baseAssetReserveAfter = $t01851718798._3
473+ let totalPositionSizeAfter = $t01851718798._4
474+ let cumulativeNotionalAfter = $t01851718798._5
475+ let totalLongAfter = $t01851718798._6
476+ let totalShortAfter = $t01851718798._7
477477 let openInterestNotionalAfter = (openInterestNotional() - positionOpenNotional)
478478 $Tuple12(exchangedPositionSize, badDebt, realizedPnl, marginToVault, quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, exchangedQuoteAssetAmount, totalLongAfter, totalShortAfter)
479479 }
480480
481481
482482 func getTwapSpotPrice () = {
483483 let minuteId = ((lastBlock.timestamp / 1000) / 60)
484484 let startMinuteId = (minuteId - TWAP_INTERVAL)
485485 let listStr = valueOrElse(getString(this, k_lastDataStr), "")
486486 let list = split(listStr, ",")
487487 func filterFn (accumulator,next) = if ((startMinuteId >= parseIntValue(next)))
488488 then (accumulator :+ parseIntValue(next))
489489 else accumulator
490490
491491 let listF = {
492492 let $l = list
493493 let $s = size($l)
494494 let $acc0 = nil
495495 func $f0_1 ($a,$i) = if (($i >= $s))
496496 then $a
497497 else filterFn($a, $l[$i])
498498
499499 func $f0_2 ($a,$i) = if (($i >= $s))
500500 then $a
501501 else throw("List size exceeds 20")
502502
503503 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20)
504504 }
505505 let maxIndex = if ((size(listF) > 0))
506506 then max(listF)
507507 else parseIntValue(list[0])
508508 let lastMinuteId = valueOrElse(getInteger(this, k_lastMinuteId), 0)
509509 let endLastCumulativePrice = valueOrElse(getInteger(this, ((k_twapDataLastCumulativePrice + "_") + toString(lastMinuteId))), 0)
510510 let endLastPrice = valueOrElse(getInteger(this, ((k_twapDataLastPrice + "_") + toString(lastMinuteId))), 0)
511511 let nowCumulativePrice = (endLastCumulativePrice + ((minuteId - lastMinuteId) * endLastPrice))
512512 let startLastCumulativePrice = valueOrElse(getInteger(this, ((k_twapDataLastCumulativePrice + "_") + toString(maxIndex))), 0)
513513 let startLastPrice = valueOrElse(getInteger(this, ((k_twapDataLastPrice + "_") + toString(maxIndex))), 0)
514514 let startCumulativePrice = (startLastCumulativePrice + ((startMinuteId - maxIndex) * startLastPrice))
515515 ((nowCumulativePrice - startCumulativePrice) / TWAP_INTERVAL)
516516 }
517517
518518
519519 func updateSettings (_initMarginRatio,_mmr,_liquidationFeeRatio,_fundingPeriod,_fee,_spreadLimit,_maxPriceImpact) = [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)]
520520
521521
522522 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)]
523523
524524
525525 func updatePosition (_address,_size,_margin,_openNotional,_latestCumulativePremiumFraction) = [IntegerEntry(toCompositeKey(k_positionSize, _address), _size), IntegerEntry(toCompositeKey(k_positionMargin, _address), _margin), IntegerEntry(toCompositeKey(k_positionOpenNotional, _address), _openNotional), IntegerEntry(toCompositeKey(k_positionLastUpdatedCumulativePremiumFraction, _address), _latestCumulativePremiumFraction)]
526526
527527
528528 func appendTwap (price) = {
529529 let minuteId = ((lastBlock.timestamp / 1000) / 60)
530530 let previousMinuteId = valueOrElse(getInteger(this, k_lastMinuteId), 0)
531531 if ((previousMinuteId > minuteId))
532532 then throw("TWAP out-of-order")
533533 else {
534534 let lastMinuteId = if ((previousMinuteId == 0))
535535 then minuteId
536536 else previousMinuteId
537537 if ((minuteId > previousMinuteId))
538538 then {
539539 let prevCumulativePrice = valueOrElse(getInteger(this, ((k_twapDataLastCumulativePrice + "_") + toString(previousMinuteId))), 0)
540540 let prevPrice = valueOrElse(getInteger(this, ((k_twapDataLastPrice + "_") + toString(previousMinuteId))), price)
541541 let lastCumulativePrice = (prevCumulativePrice + ((minuteId - lastMinuteId) * prevPrice))
542542 let list = pushToQueue(strToList(valueOrElse(getString(this, k_lastDataStr), "")), TWAP_INTERVAL, toString(minuteId))
543543 [IntegerEntry(toCompositeKey(k_twapDataLastCumulativePrice, toString(minuteId)), lastCumulativePrice), IntegerEntry(toCompositeKey(k_twapDataLastPrice, toString(minuteId)), price), IntegerEntry(toCompositeKey(k_twapDataPreviousMinuteId, toString(minuteId)), previousMinuteId), IntegerEntry(k_lastMinuteId, minuteId), StringEntry(k_lastDataStr, listToStr(list))]
544544 }
545545 else {
546546 let twapDataPreviousMinuteId = valueOrElse(getInteger(this, toCompositeKey(k_twapDataPreviousMinuteId, toString(minuteId))), 0)
547547 let prevCumulativePrice = valueOrElse(getInteger(this, toCompositeKey(k_twapDataLastCumulativePrice, toString(twapDataPreviousMinuteId))), 0)
548548 let prevPrice = valueOrElse(getInteger(this, toCompositeKey(k_twapDataLastPrice, toString(twapDataPreviousMinuteId))), price)
549549 let lastCumulativePrice = (prevCumulativePrice + ((minuteId - twapDataPreviousMinuteId) * prevPrice))
550550 [IntegerEntry(toCompositeKey(k_twapDataLastCumulativePrice, toString(minuteId)), lastCumulativePrice), IntegerEntry(toCompositeKey(k_twapDataLastPrice, toString(minuteId)), price)]
551551 }
552552 }
553553 }
554554
555555
556556 func updateAmmReserves (_qtAstR,_bsAstR) = [IntegerEntry(k_quoteAssetReserve, _qtAstR), IntegerEntry(k_baseAssetReserve, _bsAstR)]
557557
558558
559559 func updateAmm (_qtAstR,_bsAstR,_totalPositionSizeAfter,_cumulativeNotionalAfter,_openInterestNotional,_totalLongPositionSize,_totalShortPositionSize) = if (((_totalLongPositionSize - _totalShortPositionSize) != _totalPositionSizeAfter))
560560 then throw(((((("Invalid AMM state data: " + toString(_totalLongPositionSize)) + " + ") + toString(_totalShortPositionSize)) + " != ") + toString(_totalPositionSizeAfter)))
561561 else ((updateAmmReserves(_qtAstR, _bsAstR) ++ [IntegerEntry(k_totalPositionSize, _totalPositionSizeAfter), IntegerEntry(k_cumulativeNotional, _cumulativeNotionalAfter), IntegerEntry(k_openInterestNotional, _openInterestNotional), IntegerEntry(k_totalLongPositionSize, _totalLongPositionSize), IntegerEntry(k_totalShortPositionSize, _totalShortPositionSize)]) ++ appendTwap(divd(_qtAstR, _bsAstR)))
562562
563563
564564 func deletePosition (_address) = [DeleteEntry(toCompositeKey(k_positionSize, _address)), DeleteEntry(toCompositeKey(k_positionMargin, _address)), DeleteEntry(toCompositeKey(k_positionOpenNotional, _address)), DeleteEntry(toCompositeKey(k_positionLastUpdatedCumulativePremiumFraction, _address))]
565565
566566
567567 func withdraw (_address,_amount) = {
568568 let balance = assetBalance(this, quoteAsset())
569569 if ((_amount > balance))
570570 then throw(((("Unable to withdraw " + toString(_amount)) + " from contract balance ") + toString(balance)))
571571 else [ScriptTransfer(_address, _amount, quoteAsset())]
572572 }
573573
574574
575575 func updateBalance (i) = if ((0 > i))
576576 then throw("Balance")
577577 else [IntegerEntry(k_balance, i)]
578578
579579
580580 func transferFee (i) = [ScriptTransfer(stakingAddress(), i, quoteAsset())]
581581
582582
583583 @Callable(i)
584584 func pause () = if ((i.caller != adminAddress()))
585585 then throw("Invalid togglePause params")
586586 else [BooleanEntry(k_paused, true)]
587587
588588
589589
590590 @Callable(i)
591591 func unpause () = if ((i.caller != adminAddress()))
592592 then throw("Invalid togglePause params")
593593 else [BooleanEntry(k_paused, false)]
594594
595595
596596
597597 @Callable(i)
598598 func addLiquidity (_quoteAssetAmount) = if (if ((i.caller != adminAddress()))
599599 then true
600600 else (0 >= _quoteAssetAmount))
601601 then throw("Invalid addLiquidity params")
602602 else {
603603 let _qtAstR = qtAstR()
604604 let _bsAstR = bsAstR()
605605 let price = divd(_qtAstR, _bsAstR)
606606 let baseAssetAmountToAdd = divd(_quoteAssetAmount, price)
607607 let qtAstRAfter = (_qtAstR + _quoteAssetAmount)
608608 let bsAstRAfter = (_bsAstR + baseAssetAmountToAdd)
609609 updateAmmReserves(qtAstRAfter, bsAstRAfter)
610610 }
611611
612612
613613
614614 @Callable(i)
615615 func removeLiquidity (_quoteAssetAmount) = if (if ((i.caller != adminAddress()))
616616 then true
617617 else (0 >= _quoteAssetAmount))
618618 then throw("Invalid removeLiquidity params")
619619 else {
620620 let _qtAstR = qtAstR()
621621 let _bsAstR = bsAstR()
622622 let price = divd(_qtAstR, _bsAstR)
623623 let baseAssetAmountToRemove = divd(_quoteAssetAmount, price)
624624 let qtAstRAfter = (_qtAstR - _quoteAssetAmount)
625625 let bsAstRAfter = (_bsAstR - baseAssetAmountToRemove)
626626 updateAmmReserves(qtAstRAfter, bsAstRAfter)
627627 }
628628
629629
630630
631631 @Callable(i)
632632 func changeSettings (_initMarginRatio,_mmr,_liquidationFeeRatio,_fundingPeriod,_fee,_spreadLimit,_maxPriceImpact) = if ((i.caller != adminAddress()))
633633 then throw("Invalid changeSettings params")
634634 else updateSettings(_initMarginRatio, _mmr, _liquidationFeeRatio, _fundingPeriod, _fee, _spreadLimit, _maxPriceImpact)
635635
636636
637637
638638 @Callable(i)
639639 func initialize (_qtAstR,_bsAstR,_fundingPeriod,_initMarginRatio,_mmr,_liquidationFeeRatio,_fee,_oracle,_oracleKey,_coordinator,_spreadLimit,_maxPriceImpact) = if (if (if (if (if (if (if (if (if (if ((0 >= _qtAstR))
640640 then true
641641 else (0 >= _bsAstR))
642642 then true
643643 else (0 >= _fundingPeriod))
644644 then true
645645 else (0 >= _initMarginRatio))
646646 then true
647647 else (0 >= _mmr))
648648 then true
649649 else (0 >= _liquidationFeeRatio))
650650 then true
651651 else (0 >= _fee))
652652 then true
653653 else (0 >= _spreadLimit))
654654 then true
655655 else (0 >= _maxPriceImpact))
656656 then true
657657 else initialized())
658658 then throw("Invalid initialize parameters")
659659 else ((((updateAmm(_qtAstR, _bsAstR, 0, 0, 0, 0, 0) ++ updateSettings(_initMarginRatio, _mmr, _liquidationFeeRatio, _fundingPeriod, _fee, _spreadLimit, _maxPriceImpact)) ++ updateFunding((lastBlock.timestamp + _fundingPeriod), 0, 0, 0, 0)) ++ updateBalance(0)) ++ [BooleanEntry(k_initialized, true), StringEntry(k_ora, _oracle), StringEntry(k_ora_key, _oracleKey), StringEntry(k_coordinatorAddress, _coordinator)])
660660
661661
662662
663663 @Callable(i)
664664 func decreasePosition (_amount,_leverage,_minBaseAssetAmount) = if (if (if (if (if ((0 >= _amount))
665665 then true
666666 else !(initialized()))
667667 then true
668668 else !(requireMoreMarginRatio(divd(DECIMAL_UNIT, _leverage), initMarginRatio(), true)))
669669 then true
670670 else !(requireOpenPosition(toString(i.caller))))
671671 then true
672672 else paused())
673673 then throw("Invalid decreasePosition parameters")
674674 else {
675- let $t02961229764 = getPosition(toString(i.caller))
676- let oldPositionSize = $t02961229764._1
677- let oldPositionMargin = $t02961229764._2
678- let oldPositionOpenNotional = $t02961229764._3
679- let oldPositionLstUpdCPF = $t02961229764._4
675+ let $t02970729859 = getPosition(toString(i.caller))
676+ let oldPositionSize = $t02970729859._1
677+ let oldPositionMargin = $t02970729859._2
678+ let oldPositionOpenNotional = $t02970729859._3
679+ let oldPositionLstUpdCPF = $t02970729859._4
680680 let _direction = if ((oldPositionSize > 0))
681681 then DIR_SHORT
682682 else DIR_LONG
683683 let isAdd = (_direction == DIR_LONG)
684684 let openNotional = muld(_amount, _leverage)
685- let $t02993730053 = getPositionNotionalAndUnrealizedPnl(toString(i.caller), PNL_OPTION_SPOT)
686- let oldPositionNotional = $t02993730053._1
687- let unrealizedPnl = $t02993730053._2
688- let $t03005932608 = if ((oldPositionNotional > openNotional))
685+ let $t03003230148 = getPositionNotionalAndUnrealizedPnl(toString(i.caller), PNL_OPTION_SPOT)
686+ let oldPositionNotional = $t03003230148._1
687+ let unrealizedPnl = $t03003230148._2
688+ let $t03015432703 = if ((oldPositionNotional > openNotional))
689689 then {
690- let $t03043630655 = swapInput(isAdd, openNotional)
691- let exchangedPositionSize = $t03043630655._1
692- let quoteAssetReserveAfter = $t03043630655._2
693- let baseAssetReserveAfter = $t03043630655._3
694- let totalPositionSizeAfter = $t03043630655._4
695- let cumulativeNotionalAfter = $t03043630655._5
690+ let $t03053130750 = swapInput(isAdd, openNotional)
691+ let exchangedPositionSize = $t03053130750._1
692+ let quoteAssetReserveAfter = $t03053130750._2
693+ let baseAssetReserveAfter = $t03053130750._3
694+ let totalPositionSizeAfter = $t03053130750._4
695+ let cumulativeNotionalAfter = $t03053130750._5
696696 let exchangedPositionSizeAbs = abs(exchangedPositionSize)
697697 if (if ((_minBaseAssetAmount != 0))
698698 then (_minBaseAssetAmount > exchangedPositionSizeAbs)
699699 else false)
700700 then throw(((("Too little base asset exchanged, got " + toString(exchangedPositionSizeAbs)) + " expected ") + toString(_minBaseAssetAmount)))
701701 else {
702702 let realizedPnl = divd(muld(unrealizedPnl, exchangedPositionSizeAbs), abs(oldPositionSize))
703- let $t03109231337 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, realizedPnl)
704- let remainMargin = $t03109231337._1
705- let badDebt = $t03109231337._2
706- let fundingPayment = $t03109231337._3
703+ let $t03118731432 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, realizedPnl)
704+ let remainMargin = $t03118731432._1
705+ let badDebt = $t03118731432._2
706+ let fundingPayment = $t03118731432._3
707707 let exchangedQuoteAssetAmount = openNotional
708708 let unrealizedPnlAfter = (unrealizedPnl - realizedPnl)
709709 let remainOpenNotional = if ((oldPositionSize > 0))
710710 then ((oldPositionNotional - exchangedQuoteAssetAmount) - unrealizedPnlAfter)
711711 else ((unrealizedPnlAfter + oldPositionNotional) - exchangedQuoteAssetAmount)
712712 let newPositionSize = (oldPositionSize + exchangedPositionSize)
713713 $Tuple11(newPositionSize, remainMargin, abs(remainOpenNotional), latestCumulativePremiumFraction(newPositionSize), baseAssetReserveAfter, quoteAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, (openInterestNotional() - openNotional), (totalLongPositionSize() - (if ((newPositionSize > 0))
714714 then abs(exchangedPositionSize)
715715 else 0)), (totalShortPositionSize() - (if ((0 > newPositionSize))
716716 then abs(exchangedPositionSize)
717717 else 0)))
718718 }
719719 }
720720 else throw("Close position first")
721- let newPositionSize = $t03005932608._1
722- let newPositionRemainMargin = $t03005932608._2
723- let newPositionOpenNotional = $t03005932608._3
724- let newPositionLatestCPF = $t03005932608._4
725- let baseAssetReserveAfter = $t03005932608._5
726- let quoteAssetReserveAfter = $t03005932608._6
727- let totalPositionSizeAfter = $t03005932608._7
728- let cumulativeNotionalAfter = $t03005932608._8
729- let openInterestNotionalAfter = $t03005932608._9
730- let totalLongAfter = $t03005932608._10
731- let totalShortAfter = $t03005932608._11
721+ let newPositionSize = $t03015432703._1
722+ let newPositionRemainMargin = $t03015432703._2
723+ let newPositionOpenNotional = $t03015432703._3
724+ let newPositionLatestCPF = $t03015432703._4
725+ let baseAssetReserveAfter = $t03015432703._5
726+ let quoteAssetReserveAfter = $t03015432703._6
727+ let totalPositionSizeAfter = $t03015432703._7
728+ let cumulativeNotionalAfter = $t03015432703._8
729+ let openInterestNotionalAfter = $t03015432703._9
730+ let totalLongAfter = $t03015432703._10
731+ let totalShortAfter = $t03015432703._11
732732 let notifyNotional = invoke(minerAddress(), "notifyNotional", [toString(i.caller), newPositionOpenNotional], nil)
733733 if ((notifyNotional == notifyNotional))
734734 then (updatePosition(toString(i.caller), newPositionSize, newPositionRemainMargin, newPositionOpenNotional, newPositionLatestCPF) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter))
735735 else throw("Strict value is not equal to itself.")
736736 }
737737
738738
739739
740740 @Callable(i)
741741 func increasePosition (_direction,_leverage,_minBaseAssetAmount) = {
742742 let _rawAmount = i.payments[0].amount
743743 if (if (if (if (if (if (if ((_direction != DIR_LONG))
744744 then (_direction != DIR_SHORT)
745745 else false)
746746 then true
747747 else (0 >= _rawAmount))
748748 then true
749749 else !(initialized()))
750750 then true
751751 else (i.payments[0].assetId != quoteAsset()))
752752 then true
753753 else !(requireMoreMarginRatio(divd(DECIMAL_UNIT, _leverage), initMarginRatio(), true)))
754754 then true
755755 else paused())
756756 then throw("Invalid increasePosition parameters")
757757 else {
758758 let feeAmount = muld(_rawAmount, fee())
759759 let _amount = (_rawAmount - feeAmount)
760- let $t03372633878 = getPosition(toString(i.caller))
761- let oldPositionSize = $t03372633878._1
762- let oldPositionMargin = $t03372633878._2
763- let oldPositionOpenNotional = $t03372633878._3
764- let oldPositionLstUpdCPF = $t03372633878._4
760+ let $t03382133973 = getPosition(toString(i.caller))
761+ let oldPositionSize = $t03382133973._1
762+ let oldPositionMargin = $t03382133973._2
763+ let oldPositionOpenNotional = $t03382133973._3
764+ let oldPositionLstUpdCPF = $t03382133973._4
765765 let isNewPosition = (oldPositionSize == 0)
766766 let isSameDirection = if ((oldPositionSize > 0))
767767 then (_direction == DIR_LONG)
768768 else (_direction == DIR_SHORT)
769769 let expandExisting = if (!(isNewPosition))
770770 then isSameDirection
771771 else false
772772 let isAdd = (_direction == DIR_LONG)
773- let $t03416736556 = if (if (isNewPosition)
773+ let $t03426236651 = if (if (isNewPosition)
774774 then true
775775 else expandExisting)
776776 then {
777777 let openNotional = muld(_amount, _leverage)
778- let $t03459134797 = swapInput(isAdd, openNotional)
779- let amountBaseAssetBought = $t03459134797._1
780- let quoteAssetReserveAfter = $t03459134797._2
781- let baseAssetReserveAfter = $t03459134797._3
782- let totalPositionSizeAfter = $t03459134797._4
783- let cumulativeNotionalAfter = $t03459134797._5
778+ let $t03468634892 = swapInput(isAdd, openNotional)
779+ let amountBaseAssetBought = $t03468634892._1
780+ let quoteAssetReserveAfter = $t03468634892._2
781+ let baseAssetReserveAfter = $t03468634892._3
782+ let totalPositionSizeAfter = $t03468634892._4
783+ let cumulativeNotionalAfter = $t03468634892._5
784784 if (if ((_minBaseAssetAmount != 0))
785785 then (_minBaseAssetAmount > abs(amountBaseAssetBought))
786786 else false)
787787 then throw(((("Limit error: " + toString(abs(amountBaseAssetBought))) + " < ") + toString(_minBaseAssetAmount)))
788788 else {
789789 let newPositionSize = (oldPositionSize + amountBaseAssetBought)
790790 let increaseMarginRequirement = divd(openNotional, _leverage)
791- let $t03517835417 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, increaseMarginRequirement)
792- let remainMargin = $t03517835417._1
793- let x1 = $t03517835417._2
794- let x2 = $t03517835417._3
791+ let $t03527335512 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, increaseMarginRequirement)
792+ let remainMargin = $t03527335512._1
793+ let x1 = $t03527335512._2
794+ let x2 = $t03527335512._3
795795 $Tuple11(newPositionSize, remainMargin, (oldPositionOpenNotional + openNotional), latestCumulativePremiumFraction(newPositionSize), baseAssetReserveAfter, quoteAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, (openInterestNotional() + openNotional), (totalLongPositionSize() + (if ((newPositionSize > 0))
796796 then abs(amountBaseAssetBought)
797797 else 0)), (totalShortPositionSize() + (if ((0 > newPositionSize))
798798 then abs(amountBaseAssetBought)
799799 else 0)))
800800 }
801801 }
802802 else {
803803 let openNotional = muld(_amount, _leverage)
804- let $t03624936365 = getPositionNotionalAndUnrealizedPnl(toString(i.caller), PNL_OPTION_SPOT)
805- let oldPositionNotional = $t03624936365._1
806- let unrealizedPnl = $t03624936365._2
804+ let $t03634436460 = getPositionNotionalAndUnrealizedPnl(toString(i.caller), PNL_OPTION_SPOT)
805+ let oldPositionNotional = $t03634436460._1
806+ let unrealizedPnl = $t03634436460._2
807807 if ((oldPositionNotional > openNotional))
808808 then throw("Use decreasePosition to decrease position size")
809809 else throw("Close position first")
810810 }
811- let newPositionSize = $t03416736556._1
812- let newPositionRemainMargin = $t03416736556._2
813- let newPositionOpenNotional = $t03416736556._3
814- let newPositionLatestCPF = $t03416736556._4
815- let baseAssetReserveAfter = $t03416736556._5
816- let quoteAssetReserveAfter = $t03416736556._6
817- let totalPositionSizeAfter = $t03416736556._7
818- let cumulativeNotionalAfter = $t03416736556._8
819- let openInterestNotionalAfter = $t03416736556._9
820- let totalLongAfter = $t03416736556._10
821- let totalShortAfter = $t03416736556._11
811+ let newPositionSize = $t03426236651._1
812+ let newPositionRemainMargin = $t03426236651._2
813+ let newPositionOpenNotional = $t03426236651._3
814+ let newPositionLatestCPF = $t03426236651._4
815+ let baseAssetReserveAfter = $t03426236651._5
816+ let quoteAssetReserveAfter = $t03426236651._6
817+ let totalPositionSizeAfter = $t03426236651._7
818+ let cumulativeNotionalAfter = $t03426236651._8
819+ let openInterestNotionalAfter = $t03426236651._9
820+ let totalLongAfter = $t03426236651._10
821+ let totalShortAfter = $t03426236651._11
822822 let feeToStakers = (feeAmount / 2)
823823 let feeToInsurance = (feeAmount - feeToStakers)
824824 let stake = invoke(quoteAssetStaking(), "lockNeutrinoSP", [toString(stakingAddress()), ALL_FEES], [AttachedPayment(quoteAsset(), _amount)])
825825 if ((stake == stake))
826826 then {
827827 let depositInsurance = invoke(insuranceAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), feeToInsurance)])
828828 if ((depositInsurance == depositInsurance))
829829 then {
830830 let notifyFee = invoke(minerAddress(), "notifyFees", [toString(i.caller), feeAmount], nil)
831831 if ((notifyFee == notifyFee))
832832 then {
833833 let notifyNotional = invoke(minerAddress(), "notifyNotional", [toString(i.caller), newPositionOpenNotional], nil)
834834 if ((notifyNotional == notifyNotional))
835835 then (((updatePosition(toString(i.caller), newPositionSize, newPositionRemainMargin, newPositionOpenNotional, newPositionLatestCPF) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter)) ++ transferFee(feeToStakers)) ++ updateBalance((cbalance() + _amount)))
836836 else throw("Strict value is not equal to itself.")
837837 }
838838 else throw("Strict value is not equal to itself.")
839839 }
840840 else throw("Strict value is not equal to itself.")
841841 }
842842 else throw("Strict value is not equal to itself.")
843843 }
844844 }
845845
846846
847847
848848 @Callable(i)
849849 func addMargin () = {
850850 let _rawAmount = i.payments[0].amount
851851 if (if (if (if ((i.payments[0].assetId != quoteAsset()))
852852 then true
853853 else !(requireOpenPosition(toString(i.caller))))
854854 then true
855855 else !(initialized()))
856856 then true
857857 else paused())
858858 then throw("Invalid addMargin parameters")
859859 else {
860860 let feeAmount = muld(_rawAmount, fee())
861861 let _amount = (_rawAmount - feeAmount)
862- let $t03811238264 = getPosition(toString(i.caller))
863- let oldPositionSize = $t03811238264._1
864- let oldPositionMargin = $t03811238264._2
865- let oldPositionOpenNotional = $t03811238264._3
866- let oldPositionLstUpdCPF = $t03811238264._4
862+ let $t03820738359 = getPosition(toString(i.caller))
863+ let oldPositionSize = $t03820738359._1
864+ let oldPositionMargin = $t03820738359._2
865+ let oldPositionOpenNotional = $t03820738359._3
866+ let oldPositionLstUpdCPF = $t03820738359._4
867867 let feeToStakers = (feeAmount / 2)
868868 let feeToInsurance = (feeAmount - feeToStakers)
869869 let stake = invoke(quoteAssetStaking(), "lockNeutrinoSP", [toString(stakingAddress()), ALL_FEES], [AttachedPayment(quoteAsset(), _amount)])
870870 if ((stake == stake))
871871 then {
872872 let depositInsurance = invoke(insuranceAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), feeToInsurance)])
873873 if ((depositInsurance == depositInsurance))
874874 then {
875875 let notifyFee = invoke(minerAddress(), "notifyFees", [toString(i.caller), feeAmount], nil)
876876 if ((notifyFee == notifyFee))
877877 then ((updatePosition(toString(i.caller), oldPositionSize, (oldPositionMargin + _amount), oldPositionOpenNotional, oldPositionLstUpdCPF) ++ transferFee(feeToStakers)) ++ updateBalance((cbalance() + _amount)))
878878 else throw("Strict value is not equal to itself.")
879879 }
880880 else throw("Strict value is not equal to itself.")
881881 }
882882 else throw("Strict value is not equal to itself.")
883883 }
884884 }
885885
886886
887887
888888 @Callable(i)
889889 func removeMargin (_amount) = if (if (if (if ((0 >= _amount))
890890 then true
891891 else !(requireOpenPosition(toString(i.caller))))
892892 then true
893893 else !(initialized()))
894894 then true
895895 else paused())
896896 then throw("Invalid removeMargin parameters")
897897 else {
898- let $t03931339465 = getPosition(toString(i.caller))
899- let oldPositionSize = $t03931339465._1
900- let oldPositionMargin = $t03931339465._2
901- let oldPositionOpenNotional = $t03931339465._3
902- let oldPositionLstUpdCPF = $t03931339465._4
898+ let $t03940839560 = getPosition(toString(i.caller))
899+ let oldPositionSize = $t03940839560._1
900+ let oldPositionMargin = $t03940839560._2
901+ let oldPositionOpenNotional = $t03940839560._3
902+ let oldPositionLstUpdCPF = $t03940839560._4
903903 let marginDelta = -(_amount)
904- let $t03950239681 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, marginDelta)
905- let remainMargin = $t03950239681._1
906- let badDebt = $t03950239681._2
904+ let $t03959739776 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, marginDelta)
905+ let remainMargin = $t03959739776._1
906+ let badDebt = $t03959739776._2
907907 if ((badDebt != 0))
908908 then throw("Invalid removed margin amount")
909909 else {
910910 let marginRatio = calcMarginRatio(remainMargin, badDebt, oldPositionOpenNotional)
911911 if (!(requireMoreMarginRatio(marginRatio, initMarginRatio(), true)))
912912 then throw(((("Too much margin removed: " + toString(marginRatio)) + " < ") + toString(initMarginRatio())))
913913 else {
914914 let unstake = invoke(quoteAssetStaking(), "unlockNeutrino", [_amount, toBase58String(quoteAsset())], nil)
915915 if ((unstake == unstake))
916916 then ((updatePosition(toString(i.caller), oldPositionSize, remainMargin, oldPositionOpenNotional, latestCumulativePremiumFraction(oldPositionSize)) ++ withdraw(i.caller, _amount)) ++ updateBalance((cbalance() - _amount)))
917917 else throw("Strict value is not equal to itself.")
918918 }
919919 }
920920 }
921921
922922
923923
924924 @Callable(i)
925925 func closePosition () = if (if (if (!(requireOpenPosition(toString(i.caller))))
926926 then true
927927 else !(initialized()))
928928 then true
929929 else paused())
930930 then throw("Invalid closePosition parameters")
931931 else {
932- let $t04077741161 = internalClosePosition(toString(i.caller))
933- let x1 = $t04077741161._1
934- let positionBadDebt = $t04077741161._2
935- let realizedPnl = $t04077741161._3
936- let marginToVault = $t04077741161._4
937- let quoteAssetReserveAfter = $t04077741161._5
938- let baseAssetReserveAfter = $t04077741161._6
939- let totalPositionSizeAfter = $t04077741161._7
940- let cumulativeNotionalAfter = $t04077741161._8
941- let openInterestNotionalAfter = $t04077741161._9
942- let x2 = $t04077741161._10
943- let totalLongAfter = $t04077741161._11
944- let totalShortAfter = $t04077741161._12
932+ let $t04087241256 = internalClosePosition(toString(i.caller))
933+ let x1 = $t04087241256._1
934+ let positionBadDebt = $t04087241256._2
935+ let realizedPnl = $t04087241256._3
936+ let marginToVault = $t04087241256._4
937+ let quoteAssetReserveAfter = $t04087241256._5
938+ let baseAssetReserveAfter = $t04087241256._6
939+ let totalPositionSizeAfter = $t04087241256._7
940+ let cumulativeNotionalAfter = $t04087241256._8
941+ let openInterestNotionalAfter = $t04087241256._9
942+ let x2 = $t04087241256._10
943+ let totalLongAfter = $t04087241256._11
944+ let totalShortAfter = $t04087241256._12
945945 if ((positionBadDebt > 0))
946946 then throw("Unable to close position with bad debt")
947947 else {
948948 let withdrawAmount = abs(marginToVault)
949949 let ammBalance = (cbalance() - withdrawAmount)
950- let $t04137041512 = if ((0 > ammBalance))
950+ let $t04146541607 = if ((0 > ammBalance))
951951 then $Tuple2(0, abs(ammBalance))
952952 else $Tuple2(ammBalance, 0)
953- let ammNewBalance = $t04137041512._1
954- let getFromInsurance = $t04137041512._2
953+ let ammNewBalance = $t04146541607._1
954+ let getFromInsurance = $t04146541607._2
955955 let x = if ((getFromInsurance > 0))
956956 then {
957957 let withdrawInsurance = invoke(insuranceAddress(), "withdraw", [getFromInsurance], nil)
958958 if ((withdrawInsurance == withdrawInsurance))
959959 then nil
960960 else throw("Strict value is not equal to itself.")
961961 }
962962 else nil
963963 if ((x == x))
964964 then {
965965 let unstake = invoke(quoteAssetStaking(), "unlockNeutrino", [(withdrawAmount - getFromInsurance), toBase58String(quoteAsset())], nil)
966966 if ((unstake == unstake))
967967 then {
968968 let notifyNotional = invoke(minerAddress(), "notifyNotional", [toString(i.caller), 0], nil)
969969 if ((notifyNotional == notifyNotional))
970970 then (((deletePosition(toString(i.caller)) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter)) ++ withdraw(i.caller, withdrawAmount)) ++ updateBalance(ammNewBalance))
971971 else throw("Strict value is not equal to itself.")
972972 }
973973 else throw("Strict value is not equal to itself.")
974974 }
975975 else throw("Strict value is not equal to itself.")
976976 }
977977 }
978978
979979
980980
981981 @Callable(i)
982982 func liquidate (_trader) = {
983983 let spotMarginRatio = getMarginRatioByOption(_trader, PNL_OPTION_SPOT)
984984 let marginRatio = if (isOverFluctuationLimit())
985985 then {
986986 let oracleMarginRatio = getMarginRatioByOption(_trader, PNL_OPTION_ORACLE)
987987 vmax(spotMarginRatio, oracleMarginRatio)
988988 }
989989 else spotMarginRatio
990990 if (if (if (if (!(requireMoreMarginRatio(marginRatio, maintenanceMarginRatio(), false)))
991991 then true
992992 else !(requireOpenPosition(_trader)))
993993 then true
994994 else !(initialized()))
995995 then true
996996 else paused())
997997 then throw("Unable to liquidate")
998998 else {
999- let $t04320243618 = internalClosePosition(_trader)
1000- let x1 = $t04320243618._1
1001- let badDebt = $t04320243618._2
1002- let x2 = $t04320243618._3
1003- let x3 = $t04320243618._4
1004- let quoteAssetReserveAfter = $t04320243618._5
1005- let baseAssetReserveAfter = $t04320243618._6
1006- let totalPositionSizeAfter = $t04320243618._7
1007- let cumulativeNotionalAfter = $t04320243618._8
1008- let openInterestNotionalAfter = $t04320243618._9
1009- let exchangedQuoteAssetAmount = $t04320243618._10
1010- let totalLongAfter = $t04320243618._11
1011- let totalShortAfter = $t04320243618._12
999+ let $t04329743713 = internalClosePosition(_trader)
1000+ let x1 = $t04329743713._1
1001+ let badDebt = $t04329743713._2
1002+ let x2 = $t04329743713._3
1003+ let x3 = $t04329743713._4
1004+ let quoteAssetReserveAfter = $t04329743713._5
1005+ let baseAssetReserveAfter = $t04329743713._6
1006+ let totalPositionSizeAfter = $t04329743713._7
1007+ let cumulativeNotionalAfter = $t04329743713._8
1008+ let openInterestNotionalAfter = $t04329743713._9
1009+ let exchangedQuoteAssetAmount = $t04329743713._10
1010+ let totalLongAfter = $t04329743713._11
1011+ let totalShortAfter = $t04329743713._12
10121012 let liquidationPenalty = muld(exchangedQuoteAssetAmount, liquidationFeeRatio())
10131013 let feeToLiquidator = (liquidationPenalty / 2)
10141014 let feeToInsurance = (liquidationPenalty - feeToLiquidator)
10151015 let ammBalance = (cbalance() - liquidationPenalty)
1016- let $t04401644151 = if ((0 > ammBalance))
1016+ let $t04411144246 = if ((0 > ammBalance))
10171017 then $Tuple2(0, abs(ammBalance))
10181018 else $Tuple2(ammBalance, 0)
1019- let newAmmBalance = $t04401644151._1
1020- let takeFromInsurance = $t04401644151._2
1019+ let newAmmBalance = $t04411144246._1
1020+ let takeFromInsurance = $t04411144246._2
10211021 let x = if ((takeFromInsurance > 0))
10221022 then {
10231023 let withdrawInsurance = invoke(insuranceAddress(), "withdraw", [takeFromInsurance], nil)
10241024 if ((withdrawInsurance == withdrawInsurance))
10251025 then nil
10261026 else throw("Strict value is not equal to itself.")
10271027 }
10281028 else nil
10291029 if ((x == x))
10301030 then {
10311031 let unstake = invoke(quoteAssetStaking(), "unlockNeutrino", [(liquidationPenalty - takeFromInsurance), toBase58String(quoteAsset())], nil)
10321032 if ((unstake == unstake))
10331033 then {
10341034 let depositInsurance = invoke(insuranceAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), feeToInsurance)])
10351035 if ((depositInsurance == depositInsurance))
10361036 then {
10371037 let notifyNotional = invoke(minerAddress(), "notifyNotional", [_trader, 0], nil)
10381038 if ((notifyNotional == notifyNotional))
10391039 then (((deletePosition(_trader) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter)) ++ withdraw(i.caller, feeToLiquidator)) ++ updateBalance(newAmmBalance))
10401040 else throw("Strict value is not equal to itself.")
10411041 }
10421042 else throw("Strict value is not equal to itself.")
10431043 }
10441044 else throw("Strict value is not equal to itself.")
10451045 }
10461046 else throw("Strict value is not equal to itself.")
10471047 }
10481048 }
10491049
10501050
10511051
10521052 @Callable(i)
10531053 func payFunding () = {
10541054 let fundingBlockTimestamp = nextFundingBlockTimestamp()
10551055 if (if (if ((fundingBlockTimestamp > lastBlock.timestamp))
10561056 then true
10571057 else !(initialized()))
10581058 then true
10591059 else paused())
10601060 then throw(((("Invalid funding block timestamp: " + toString(lastBlock.timestamp)) + " < ") + toString(fundingBlockTimestamp)))
10611061 else {
10621062 let underlyingPrice = getOracleTwapPrice()
10631063 let spotTwapPrice = getTwapSpotPrice()
10641064 let premium = (spotTwapPrice - underlyingPrice)
1065- let $t04564546980 = if (if ((totalShortPositionSize() == 0))
1065+ let $t04574047075 = if (if ((totalShortPositionSize() == 0))
10661066 then true
10671067 else (totalLongPositionSize() == 0))
10681068 then $Tuple2(0, 0)
10691069 else if ((0 > premium))
10701070 then {
10711071 let shortPremiumFraction = divd(muld(premium, fundingPeriodDecimal()), ONE_DAY)
10721072 let longPremiumFraction = divd(muld(shortPremiumFraction, totalShortPositionSize()), totalLongPositionSize())
10731073 $Tuple2(shortPremiumFraction, longPremiumFraction)
10741074 }
10751075 else {
10761076 let longPremiumFraction = divd(muld(premium, fundingPeriodDecimal()), ONE_DAY)
10771077 let shortPremiumFraction = divd(muld(longPremiumFraction, totalLongPositionSize()), totalShortPositionSize())
10781078 $Tuple2(shortPremiumFraction, longPremiumFraction)
10791079 }
1080- let shortPremiumFraction = $t04564546980._1
1081- let longPremiumFraction = $t04564546980._2
1080+ let shortPremiumFraction = $t04574047075._1
1081+ let longPremiumFraction = $t04574047075._2
10821082 updateFunding((fundingBlockTimestamp + fundingPeriodSeconds()), (latestLongCumulativePremiumFraction() + longPremiumFraction), (latestShortCumulativePremiumFraction() + shortPremiumFraction), divd(longPremiumFraction, underlyingPrice), divd(shortPremiumFraction, underlyingPrice))
10831083 }
10841084 }
10851085
10861086
10871087
10881088 @Callable(i)
10891089 func v_get (_trader) = {
1090- let $t04735547408 = internalClosePosition(_trader)
1091- let x1 = $t04735547408._1
1092- let x2 = $t04735547408._2
1093- let x3 = $t04735547408._3
1094- let x4 = $t04735547408._4
1090+ let $t04745047503 = internalClosePosition(_trader)
1091+ let x1 = $t04745047503._1
1092+ let x2 = $t04745047503._2
1093+ let x3 = $t04745047503._3
1094+ let x4 = $t04745047503._4
10951095 throw((((s(x2) + s(x3)) + s(x4)) + s(getMarginRatio(_trader))))
10961096 }
10971097
10981098
10991099
11001100 @Callable(i)
11011101 func view_calcRemainMarginWithFundingPayment (_trader) = {
1102- let $t04755547666 = getPosition(_trader)
1103- let positionSize = $t04755547666._1
1104- let positionMargin = $t04755547666._2
1105- let pon = $t04755547666._3
1106- let positionLstUpdCPF = $t04755547666._4
1107- let $t04767147772 = getPositionNotionalAndUnrealizedPnl(_trader, PNL_OPTION_SPOT)
1108- let positionNotional = $t04767147772._1
1109- let unrealizedPnl = $t04767147772._2
1110- let $t04777747959 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl)
1111- let remainMargin = $t04777747959._1
1112- let badDebt = $t04777747959._2
1113- let fundingPayment = $t04777747959._3
1102+ let $t04765047761 = getPosition(_trader)
1103+ let positionSize = $t04765047761._1
1104+ let positionMargin = $t04765047761._2
1105+ let pon = $t04765047761._3
1106+ let positionLstUpdCPF = $t04765047761._4
1107+ let $t04776647867 = getPositionNotionalAndUnrealizedPnl(_trader, PNL_OPTION_SPOT)
1108+ let positionNotional = $t04776647867._1
1109+ let unrealizedPnl = $t04776647867._2
1110+ let $t04787248054 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl)
1111+ let remainMargin = $t04787248054._1
1112+ let badDebt = $t04787248054._2
1113+ let fundingPayment = $t04787248054._3
11141114 throw(((s(remainMargin) + s(fundingPayment)) + s(getMarginRatio(_trader))))
11151115 }
11161116
11171117
11181118
11191119 @Callable(i)
11201120 func forceMoveAsset (_trader,_amount) = if (if ((addressFromPublicKey(adminPublicKey()) != i.caller))
11211121 then true
11221122 else (0 > _amount))
11231123 then throw("Invalid forceMoveAsset parameters")
11241124 else {
11251125 let unstake = invoke(quoteAssetStaking(), "unlockNeutrino", [_amount, toBase58String(quoteAsset())], nil)
11261126 if ((unstake == unstake))
11271127 then (withdraw(addressFromStringValue(_trader), _amount) ++ updateBalance((cbalance() - _amount)))
11281128 else throw("Strict value is not equal to itself.")
11291129 }
11301130
11311131
11321132 @Verifier(tx)
11331133 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], adminPublicKey())
11341134

github/deemru/w8io/026f985 
161.21 ms