tx · 4J4TzApuukBCCo4YSPXpTxmFLDWAFGu2vYfR6MFjJMFC

3N8G95pEaYEhZ4U3m3UrzpEzwBFn5vvXsZH:  -0.05100000 Waves

2022.08.02 16:54 [2166952] smart account 3N8G95pEaYEhZ4U3m3UrzpEzwBFn5vvXsZH > SELF 0.00000000 Waves

{ "type": 13, "id": "4J4TzApuukBCCo4YSPXpTxmFLDWAFGu2vYfR6MFjJMFC", "fee": 5100000, "feeAssetId": null, "timestamp": 1659448464653, "version": 2, "chainId": 84, "sender": "3N8G95pEaYEhZ4U3m3UrzpEzwBFn5vvXsZH", "senderPublicKey": "Hj6oyH6As5UWo8fZ1K4hPsEY7nxH3MvhBqDD6axiwjXs", "proofs": [ "4NXWue515yKY4ENEj5kLMSniWygiMvpbsToxzxyfCm4xUX388D2EsnAdzQQDP7Bv5e41NCMw7d7VJRN19GLRnQKC" ], "script": "base64:BgJPCAISABIAEgkKBwEBAQEBAQESDgoMAQEBAQEBAQgICAEBEgUKAwEBARIFCgMBAQESABIDCgEBEgASAwoBCBIAEgMKAQgSAwoBCBIECgIIAXgACWtfb3JhX2tleQIJa19vcmFfa2V5AA9rX29yYV9ibG9ja19rZXkCD2tfb3JhX2Jsb2NrX2tleQAFa19vcmECBWtfb3JhAAlrX2JhbGFuY2UCCWtfYmFsYW5jZQAOa19wb3NpdGlvblNpemUCDmtfcG9zaXRpb25TaXplABBrX3Bvc2l0aW9uTWFyZ2luAhBrX3Bvc2l0aW9uTWFyZ2luABZrX3Bvc2l0aW9uT3Blbk5vdGlvbmFsAhZrX3Bvc2l0aW9uT3Blbk5vdGlvbmFsAC5rX3Bvc2l0aW9uTGFzdFVwZGF0ZWRDdW11bGF0aXZlUHJlbWl1bUZyYWN0aW9uAhJrX3Bvc2l0aW9uRnJhY3Rpb24ADWtfaW5pdGlhbGl6ZWQCDWtfaW5pdGlhbGl6ZWQACGtfcGF1c2VkAghrX3BhdXNlZAAFa19mZWUCBWtfZmVlAA9rX2Z1bmRpbmdQZX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W91bnQJAMwIAgkA2AQBCQEKcXVvdGVBc3NldAAFA25pbAUDbmlsAwkAAAIFB3Vuc3Rha2UFB3Vuc3Rha2UJAM4IAgkBCHdpdGhkcmF3AgkBEUBleHRyTmF0aXZlKDEwNjIpAQUHX3RyYWRlcgUHX2Ftb3VudAkBDXVwZGF0ZUJhbGFuY2UBCQBlAgkBCGNiYWxhbmNlAAUHX2Ftb3VudAkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgECdHgBBnZlcmlmeQAJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAJAQ5hZG1pblB1YmxpY0tleQCD1+UI", "height": 2166952, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 91v8xQ5aRYVhg5gC1PqePck5ZM6JcGbw5ELvRK9AJ639 Next: Ei9tbgMjGRJbCZMHUkWYzyzJTiQ9XsvKgd1TTUVrLTvn Diff:
OldNewDifferences
1-{-# STDLIB_VERSION 5 #-}
1+{-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let k_ora_key = "k_ora_key"
8383
8484 let k_staking_address = "k_staking_address"
8585
86+let k_miner_address = "k_miner_address"
87+
8688 func coordinator () = valueOrErrorMessage(addressFromString(getStringValue(this, k_coordinatorAddress)), "Coordinator not set")
8789
8890
102104
103105
104106 func insuranceAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_insurance_address)), "Insurance not set")
107+
108+
109+func minerAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_miner_address)), "Insurance not set")
105110
106111
107112 let DIR_LONG = 1
323328 if ((priceImpact > maxPriceImpactValue))
324329 then throw(((("Price impact " + toString(priceImpact)) + " > max price impact ") + toString(maxPriceImpactValue)))
325330 else {
326- let $t01215412357 = updateReserve(_isAdd, _quoteAssetAmount, amountBaseAssetBoughtAbs)
327- let quoteAssetReserveAfter1 = $t01215412357._1
328- let baseAssetReserveAfter1 = $t01215412357._2
329- let totalPositionSizeAfter1 = $t01215412357._3
330- let cumulativeNotionalAfter1 = $t01215412357._4
331+ let $t01236812571 = updateReserve(_isAdd, _quoteAssetAmount, amountBaseAssetBoughtAbs)
332+ let quoteAssetReserveAfter1 = $t01236812571._1
333+ let baseAssetReserveAfter1 = $t01236812571._2
334+ let totalPositionSizeAfter1 = $t01236812571._3
335+ let cumulativeNotionalAfter1 = $t01236812571._4
331336 $Tuple5(amountBaseAssetBought, quoteAssetReserveAfter1, baseAssetReserveAfter1, totalPositionSizeAfter1, cumulativeNotionalAfter1)
332337 }
333338 }
341346 }
342347 else 0
343348 let signedMargin = ((_marginDelta - fundingPayment) + _oldPositionMargin)
344- let $t01310413231 = if ((0 > signedMargin))
349+ let $t01331813445 = if ((0 > signedMargin))
345350 then $Tuple2(0, abs(signedMargin))
346351 else $Tuple2(abs(signedMargin), 0)
347- let remainMargin = $t01310413231._1
348- let badDebt = $t01310413231._2
352+ let remainMargin = $t01331813445._1
353+ let badDebt = $t01331813445._2
349354 $Tuple3(remainMargin, badDebt, fundingPayment)
350355 }
351356
362367 else (_baseAssetReserve - _baseAssetAmount)
363368 let quoteAssetAfter = divd(k, baseAssetPoolAmountAfter)
364369 let quoteAssetSold = abs((quoteAssetAfter - _quoteAssetReserve))
365- let $t01406914262 = updateReserve(!(_isAdd), quoteAssetSold, _baseAssetAmount)
366- let quoteAssetReserveAfter1 = $t01406914262._1
367- let baseAssetReserveAfter1 = $t01406914262._2
368- let totalPositionSizeAfter1 = $t01406914262._3
369- let cumulativeNotionalAfter1 = $t01406914262._4
370+ let $t01428314476 = updateReserve(!(_isAdd), quoteAssetSold, _baseAssetAmount)
371+ let quoteAssetReserveAfter1 = $t01428314476._1
372+ let baseAssetReserveAfter1 = $t01428314476._2
373+ let totalPositionSizeAfter1 = $t01428314476._3
374+ let cumulativeNotionalAfter1 = $t01428314476._4
370375 $Tuple7(quoteAssetSold, quoteAssetReserveAfter1, baseAssetReserveAfter1, totalPositionSizeAfter1, cumulativeNotionalAfter1, (totalLongPositionSize() - (if (_isAdd)
371376 then abs(_baseAssetAmount)
372377 else 0)), (totalShortPositionSize() - (if (!(_isAdd))
400405
401406
402407 func getPositionNotionalAndUnrealizedPnl (_trader,_option) = {
403- let $t01589416022 = getPosition(_trader)
404- let positionSize = $t01589416022._1
405- let positionMargin = $t01589416022._2
406- let positionOpenNotional = $t01589416022._3
407- let positionLstUpdCPF = $t01589416022._4
408+ let $t01610816236 = getPosition(_trader)
409+ let positionSize = $t01610816236._1
410+ let positionMargin = $t01610816236._2
411+ let positionOpenNotional = $t01610816236._3
412+ let positionLstUpdCPF = $t01610816236._4
408413 let positionSizeAbs = abs(positionSize)
409414 if ((positionSizeAbs == 0))
410415 then throw("Invalid position size")
412417 let isShort = (0 > positionSize)
413418 let positionNotional = if ((_option == PNL_OPTION_SPOT))
414419 then {
415- let $t01626916376 = swapOutput(!(isShort), positionSizeAbs)
416- let outPositionNotional = $t01626916376._1
417- let x1 = $t01626916376._2
418- let x2 = $t01626916376._3
419- let x3 = $t01626916376._4
420+ let $t01648316590 = swapOutput(!(isShort), positionSizeAbs)
421+ let outPositionNotional = $t01648316590._1
422+ let x1 = $t01648316590._2
423+ let x2 = $t01648316590._3
424+ let x3 = $t01648316590._4
420425 outPositionNotional
421426 }
422427 else muld(positionSizeAbs, getOracleTwapPrice())
432437
433438
434439 func getMarginRatioByOption (_trader,_option) = {
435- let $t01704617157 = getPosition(_trader)
436- let positionSize = $t01704617157._1
437- let positionMargin = $t01704617157._2
438- let pon = $t01704617157._3
439- let positionLstUpdCPF = $t01704617157._4
440- let $t01716317256 = getPositionNotionalAndUnrealizedPnl(_trader, _option)
441- let positionNotional = $t01716317256._1
442- let unrealizedPnl = $t01716317256._2
443- let $t01726117427 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl)
444- let remainMargin = $t01726117427._1
445- let badDebt = $t01726117427._2
440+ let $t01726017371 = getPosition(_trader)
441+ let positionSize = $t01726017371._1
442+ let positionMargin = $t01726017371._2
443+ let pon = $t01726017371._3
444+ let positionLstUpdCPF = $t01726017371._4
445+ let $t01737717470 = getPositionNotionalAndUnrealizedPnl(_trader, _option)
446+ let positionNotional = $t01737717470._1
447+ let unrealizedPnl = $t01737717470._2
448+ let $t01747517641 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl)
449+ let remainMargin = $t01747517641._1
450+ let badDebt = $t01747517641._2
446451 calcMarginRatio(remainMargin, badDebt, positionNotional)
447452 }
448453
451456
452457
453458 func internalClosePosition (_trader) = {
454- let $t01774317871 = getPosition(_trader)
455- let positionSize = $t01774317871._1
456- let positionMargin = $t01774317871._2
457- let positionOpenNotional = $t01774317871._3
458- let positionLstUpdCPF = $t01774317871._4
459- let $t01787717964 = getPositionNotionalAndUnrealizedPnl(_trader, PNL_OPTION_SPOT)
460- let x1 = $t01787717964._1
461- let unrealizedPnl = $t01787717964._2
462- let $t01796918137 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl)
463- let remainMargin = $t01796918137._1
464- let badDebt = $t01796918137._2
459+ let $t01795718085 = getPosition(_trader)
460+ let positionSize = $t01795718085._1
461+ let positionMargin = $t01795718085._2
462+ let positionOpenNotional = $t01795718085._3
463+ let positionLstUpdCPF = $t01795718085._4
464+ let $t01809118178 = getPositionNotionalAndUnrealizedPnl(_trader, PNL_OPTION_SPOT)
465+ let x1 = $t01809118178._1
466+ let unrealizedPnl = $t01809118178._2
467+ let $t01818318351 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl)
468+ let remainMargin = $t01818318351._1
469+ let badDebt = $t01818318351._2
465470 let exchangedPositionSize = -(positionSize)
466471 let realizedPnl = unrealizedPnl
467472 let marginToVault = -(remainMargin)
468- let $t01826418545 = swapOutput((positionSize > 0), abs(positionSize))
469- let exchangedQuoteAssetAmount = $t01826418545._1
470- let quoteAssetReserveAfter = $t01826418545._2
471- let baseAssetReserveAfter = $t01826418545._3
472- let totalPositionSizeAfter = $t01826418545._4
473- let cumulativeNotionalAfter = $t01826418545._5
474- let totalLongAfter = $t01826418545._6
475- let totalShortAfter = $t01826418545._7
473+ let $t01847818759 = swapOutput((positionSize > 0), abs(positionSize))
474+ let exchangedQuoteAssetAmount = $t01847818759._1
475+ let quoteAssetReserveAfter = $t01847818759._2
476+ let baseAssetReserveAfter = $t01847818759._3
477+ let totalPositionSizeAfter = $t01847818759._4
478+ let cumulativeNotionalAfter = $t01847818759._5
479+ let totalLongAfter = $t01847818759._6
480+ let totalShortAfter = $t01847818759._7
476481 let openInterestNotionalAfter = (openInterestNotional() - positionOpenNotional)
477482 $Tuple12(exchangedPositionSize, badDebt, realizedPnl, marginToVault, quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, exchangedQuoteAssetAmount, totalLongAfter, totalShortAfter)
478483 }
638643 else paused())
639644 then throw("Invalid decreasePosition parameters")
640645 else {
641- let $t02838628538 = getPosition(toString(i.caller))
642- let oldPositionSize = $t02838628538._1
643- let oldPositionMargin = $t02838628538._2
644- let oldPositionOpenNotional = $t02838628538._3
645- let oldPositionLstUpdCPF = $t02838628538._4
646+ let $t02860028752 = getPosition(toString(i.caller))
647+ let oldPositionSize = $t02860028752._1
648+ let oldPositionMargin = $t02860028752._2
649+ let oldPositionOpenNotional = $t02860028752._3
650+ let oldPositionLstUpdCPF = $t02860028752._4
646651 let _direction = if ((oldPositionSize > 0))
647652 then DIR_SHORT
648653 else DIR_LONG
649654 let isAdd = (_direction == DIR_LONG)
650655 let openNotional = muld(_amount, _leverage)
651- let $t02871128827 = getPositionNotionalAndUnrealizedPnl(toString(i.caller), PNL_OPTION_SPOT)
652- let oldPositionNotional = $t02871128827._1
653- let unrealizedPnl = $t02871128827._2
654- let $t02883331382 = if ((oldPositionNotional > openNotional))
656+ let $t02892529041 = getPositionNotionalAndUnrealizedPnl(toString(i.caller), PNL_OPTION_SPOT)
657+ let oldPositionNotional = $t02892529041._1
658+ let unrealizedPnl = $t02892529041._2
659+ let $t02904731596 = if ((oldPositionNotional > openNotional))
655660 then {
656- let $t02921029429 = swapInput(isAdd, openNotional)
657- let exchangedPositionSize = $t02921029429._1
658- let quoteAssetReserveAfter = $t02921029429._2
659- let baseAssetReserveAfter = $t02921029429._3
660- let totalPositionSizeAfter = $t02921029429._4
661- let cumulativeNotionalAfter = $t02921029429._5
661+ let $t02942429643 = swapInput(isAdd, openNotional)
662+ let exchangedPositionSize = $t02942429643._1
663+ let quoteAssetReserveAfter = $t02942429643._2
664+ let baseAssetReserveAfter = $t02942429643._3
665+ let totalPositionSizeAfter = $t02942429643._4
666+ let cumulativeNotionalAfter = $t02942429643._5
662667 let exchangedPositionSizeAbs = abs(exchangedPositionSize)
663668 if (if ((_minBaseAssetAmount != 0))
664669 then (_minBaseAssetAmount > exchangedPositionSizeAbs)
666671 then throw(((("Too little base asset exchanged, got " + toString(exchangedPositionSizeAbs)) + " expected ") + toString(_minBaseAssetAmount)))
667672 else {
668673 let realizedPnl = divd(muld(unrealizedPnl, exchangedPositionSizeAbs), abs(oldPositionSize))
669- let $t02986630111 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, realizedPnl)
670- let remainMargin = $t02986630111._1
671- let badDebt = $t02986630111._2
672- let fundingPayment = $t02986630111._3
674+ let $t03008030325 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, realizedPnl)
675+ let remainMargin = $t03008030325._1
676+ let badDebt = $t03008030325._2
677+ let fundingPayment = $t03008030325._3
673678 let exchangedQuoteAssetAmount = openNotional
674679 let unrealizedPnlAfter = (unrealizedPnl - realizedPnl)
675680 let remainOpenNotional = if ((oldPositionSize > 0))
684689 }
685690 }
686691 else throw("Close position first")
687- let newPositionSize = $t02883331382._1
688- let newPositionRemainMargin = $t02883331382._2
689- let newPositionOpenNotional = $t02883331382._3
690- let newPositionLatestCPF = $t02883331382._4
691- let baseAssetReserveAfter = $t02883331382._5
692- let quoteAssetReserveAfter = $t02883331382._6
693- let totalPositionSizeAfter = $t02883331382._7
694- let cumulativeNotionalAfter = $t02883331382._8
695- let openInterestNotionalAfter = $t02883331382._9
696- let totalLongAfter = $t02883331382._10
697- let totalShortAfter = $t02883331382._11
698- (updatePosition(toString(i.caller), newPositionSize, newPositionRemainMargin, newPositionOpenNotional, newPositionLatestCPF) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter))
692+ let newPositionSize = $t02904731596._1
693+ let newPositionRemainMargin = $t02904731596._2
694+ let newPositionOpenNotional = $t02904731596._3
695+ let newPositionLatestCPF = $t02904731596._4
696+ let baseAssetReserveAfter = $t02904731596._5
697+ let quoteAssetReserveAfter = $t02904731596._6
698+ let totalPositionSizeAfter = $t02904731596._7
699+ let cumulativeNotionalAfter = $t02904731596._8
700+ let openInterestNotionalAfter = $t02904731596._9
701+ let totalLongAfter = $t02904731596._10
702+ let totalShortAfter = $t02904731596._11
703+ let notifyNotional = invoke(minerAddress(), "notifyNotional", [toString(i.caller), newPositionOpenNotional], nil)
704+ if ((notifyNotional == notifyNotional))
705+ then (updatePosition(toString(i.caller), newPositionSize, newPositionRemainMargin, newPositionOpenNotional, newPositionLatestCPF) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter))
706+ else throw("Strict value is not equal to itself.")
699707 }
700708
701709
724732 else {
725733 let feeAmount = muld(_rawAmount, fee())
726734 let _amount = (_rawAmount - feeAmount)
727- let $t03241832570 = getPosition(toString(i.caller))
728- let oldPositionSize = $t03241832570._1
729- let oldPositionMargin = $t03241832570._2
730- let oldPositionOpenNotional = $t03241832570._3
731- let oldPositionLstUpdCPF = $t03241832570._4
735+ let $t03278432936 = getPosition(toString(i.caller))
736+ let oldPositionSize = $t03278432936._1
737+ let oldPositionMargin = $t03278432936._2
738+ let oldPositionOpenNotional = $t03278432936._3
739+ let oldPositionLstUpdCPF = $t03278432936._4
732740 let isNewPosition = (oldPositionSize == 0)
733741 let isSameDirection = if ((oldPositionSize > 0))
734742 then (_direction == DIR_LONG)
737745 then isSameDirection
738746 else false
739747 let isAdd = (_direction == DIR_LONG)
740- let $t03285935248 = if (if (isNewPosition)
748+ let $t03322535614 = if (if (isNewPosition)
741749 then true
742750 else expandExisting)
743751 then {
744752 let openNotional = muld(_amount, _leverage)
745- let $t03328333489 = swapInput(isAdd, openNotional)
746- let amountBaseAssetBought = $t03328333489._1
747- let quoteAssetReserveAfter = $t03328333489._2
748- let baseAssetReserveAfter = $t03328333489._3
749- let totalPositionSizeAfter = $t03328333489._4
750- let cumulativeNotionalAfter = $t03328333489._5
753+ let $t03364933855 = swapInput(isAdd, openNotional)
754+ let amountBaseAssetBought = $t03364933855._1
755+ let quoteAssetReserveAfter = $t03364933855._2
756+ let baseAssetReserveAfter = $t03364933855._3
757+ let totalPositionSizeAfter = $t03364933855._4
758+ let cumulativeNotionalAfter = $t03364933855._5
751759 if (if ((_minBaseAssetAmount != 0))
752760 then (_minBaseAssetAmount > abs(amountBaseAssetBought))
753761 else false)
755763 else {
756764 let newPositionSize = (oldPositionSize + amountBaseAssetBought)
757765 let increaseMarginRequirement = divd(openNotional, _leverage)
758- let $t03387034109 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, increaseMarginRequirement)
759- let remainMargin = $t03387034109._1
760- let x1 = $t03387034109._2
761- let x2 = $t03387034109._3
766+ let $t03423634475 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, increaseMarginRequirement)
767+ let remainMargin = $t03423634475._1
768+ let x1 = $t03423634475._2
769+ let x2 = $t03423634475._3
762770 $Tuple11(newPositionSize, remainMargin, (oldPositionOpenNotional + openNotional), latestCumulativePremiumFraction(newPositionSize), baseAssetReserveAfter, quoteAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, (openInterestNotional() + openNotional), (totalLongPositionSize() + (if ((newPositionSize > 0))
763771 then abs(amountBaseAssetBought)
764772 else 0)), (totalShortPositionSize() + (if ((0 > newPositionSize))
768776 }
769777 else {
770778 let openNotional = muld(_amount, _leverage)
771- let $t03494135057 = getPositionNotionalAndUnrealizedPnl(toString(i.caller), PNL_OPTION_SPOT)
772- let oldPositionNotional = $t03494135057._1
773- let unrealizedPnl = $t03494135057._2
779+ let $t03530735423 = getPositionNotionalAndUnrealizedPnl(toString(i.caller), PNL_OPTION_SPOT)
780+ let oldPositionNotional = $t03530735423._1
781+ let unrealizedPnl = $t03530735423._2
774782 if ((oldPositionNotional > openNotional))
775783 then throw("Use decreasePosition to decrease position size")
776784 else throw("Close position first")
777785 }
778- let newPositionSize = $t03285935248._1
779- let newPositionRemainMargin = $t03285935248._2
780- let newPositionOpenNotional = $t03285935248._3
781- let newPositionLatestCPF = $t03285935248._4
782- let baseAssetReserveAfter = $t03285935248._5
783- let quoteAssetReserveAfter = $t03285935248._6
784- let totalPositionSizeAfter = $t03285935248._7
785- let cumulativeNotionalAfter = $t03285935248._8
786- let openInterestNotionalAfter = $t03285935248._9
787- let totalLongAfter = $t03285935248._10
788- let totalShortAfter = $t03285935248._11
786+ let newPositionSize = $t03322535614._1
787+ let newPositionRemainMargin = $t03322535614._2
788+ let newPositionOpenNotional = $t03322535614._3
789+ let newPositionLatestCPF = $t03322535614._4
790+ let baseAssetReserveAfter = $t03322535614._5
791+ let quoteAssetReserveAfter = $t03322535614._6
792+ let totalPositionSizeAfter = $t03322535614._7
793+ let cumulativeNotionalAfter = $t03322535614._8
794+ let openInterestNotionalAfter = $t03322535614._9
795+ let totalLongAfter = $t03322535614._10
796+ let totalShortAfter = $t03322535614._11
789797 let feeToStakers = (feeAmount / 2)
790798 let feeToInsurance = (feeAmount - feeToStakers)
791799 let stake = invoke(quoteAssetStaking(), "lockNeutrinoSP", [toString(stakingAddress()), ALL_FEES], [AttachedPayment(quoteAsset(), _amount)])
793801 then {
794802 let depositInsurance = invoke(insuranceAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), feeToInsurance)])
795803 if ((depositInsurance == depositInsurance))
796- then (((updatePosition(toString(i.caller), newPositionSize, newPositionRemainMargin, newPositionOpenNotional, newPositionLatestCPF) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter)) ++ transferFee(feeToStakers)) ++ updateBalance((cbalance() + _amount)))
804+ then {
805+ let notifyFee = invoke(minerAddress(), "notifyFees", [toString(i.caller), feeAmount], nil)
806+ if ((notifyFee == notifyFee))
807+ then {
808+ let notifyNotional = invoke(minerAddress(), "notifyNotional", [toString(i.caller), newPositionOpenNotional], nil)
809+ if ((notifyNotional == notifyNotional))
810+ then (((updatePosition(toString(i.caller), newPositionSize, newPositionRemainMargin, newPositionOpenNotional, newPositionLatestCPF) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter)) ++ transferFee(feeToStakers)) ++ updateBalance((cbalance() + _amount)))
811+ else throw("Strict value is not equal to itself.")
812+ }
813+ else throw("Strict value is not equal to itself.")
814+ }
797815 else throw("Strict value is not equal to itself.")
798816 }
799817 else throw("Strict value is not equal to itself.")
816834 else {
817835 let feeAmount = muld(_rawAmount, fee())
818836 let _amount = (_rawAmount - feeAmount)
819- let $t03652436676 = getPosition(toString(i.caller))
820- let oldPositionSize = $t03652436676._1
821- let oldPositionMargin = $t03652436676._2
822- let oldPositionOpenNotional = $t03652436676._3
823- let oldPositionLstUpdCPF = $t03652436676._4
837+ let $t03717037322 = getPosition(toString(i.caller))
838+ let oldPositionSize = $t03717037322._1
839+ let oldPositionMargin = $t03717037322._2
840+ let oldPositionOpenNotional = $t03717037322._3
841+ let oldPositionLstUpdCPF = $t03717037322._4
824842 let feeToStakers = (feeAmount / 2)
825843 let feeToInsurance = (feeAmount - feeToStakers)
826844 let stake = invoke(quoteAssetStaking(), "lockNeutrinoSP", [toString(stakingAddress()), ALL_FEES], [AttachedPayment(quoteAsset(), _amount)])
828846 then {
829847 let depositInsurance = invoke(insuranceAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), feeToInsurance)])
830848 if ((depositInsurance == depositInsurance))
831- then ((updatePosition(toString(i.caller), oldPositionSize, (oldPositionMargin + _amount), oldPositionOpenNotional, oldPositionLstUpdCPF) ++ transferFee(feeToStakers)) ++ updateBalance((cbalance() + _amount)))
849+ then {
850+ let notifyFee = invoke(minerAddress(), "notifyFees", [toString(i.caller), feeAmount], nil)
851+ if ((notifyFee == notifyFee))
852+ then ((updatePosition(toString(i.caller), oldPositionSize, (oldPositionMargin + _amount), oldPositionOpenNotional, oldPositionLstUpdCPF) ++ transferFee(feeToStakers)) ++ updateBalance((cbalance() + _amount)))
853+ else throw("Strict value is not equal to itself.")
854+ }
832855 else throw("Strict value is not equal to itself.")
833856 }
834857 else throw("Strict value is not equal to itself.")
847870 else paused())
848871 then throw("Invalid removeMargin parameters")
849872 else {
850- let $t03759637748 = getPosition(toString(i.caller))
851- let oldPositionSize = $t03759637748._1
852- let oldPositionMargin = $t03759637748._2
853- let oldPositionOpenNotional = $t03759637748._3
854- let oldPositionLstUpdCPF = $t03759637748._4
873+ let $t03837138523 = getPosition(toString(i.caller))
874+ let oldPositionSize = $t03837138523._1
875+ let oldPositionMargin = $t03837138523._2
876+ let oldPositionOpenNotional = $t03837138523._3
877+ let oldPositionLstUpdCPF = $t03837138523._4
855878 let marginDelta = -(_amount)
856- let $t03778537964 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, marginDelta)
857- let remainMargin = $t03778537964._1
858- let badDebt = $t03778537964._2
879+ let $t03856038739 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, marginDelta)
880+ let remainMargin = $t03856038739._1
881+ let badDebt = $t03856038739._2
859882 if ((badDebt != 0))
860883 then throw("Invalid removed margin amount")
861884 else {
881904 else paused())
882905 then throw("Invalid closePosition parameters")
883906 else {
884- let $t03906039444 = internalClosePosition(toString(i.caller))
885- let x1 = $t03906039444._1
886- let positionBadDebt = $t03906039444._2
887- let realizedPnl = $t03906039444._3
888- let marginToVault = $t03906039444._4
889- let quoteAssetReserveAfter = $t03906039444._5
890- let baseAssetReserveAfter = $t03906039444._6
891- let totalPositionSizeAfter = $t03906039444._7
892- let cumulativeNotionalAfter = $t03906039444._8
893- let openInterestNotionalAfter = $t03906039444._9
894- let x2 = $t03906039444._10
895- let totalLongAfter = $t03906039444._11
896- let totalShortAfter = $t03906039444._12
907+ let $t03983540219 = internalClosePosition(toString(i.caller))
908+ let x1 = $t03983540219._1
909+ let positionBadDebt = $t03983540219._2
910+ let realizedPnl = $t03983540219._3
911+ let marginToVault = $t03983540219._4
912+ let quoteAssetReserveAfter = $t03983540219._5
913+ let baseAssetReserveAfter = $t03983540219._6
914+ let totalPositionSizeAfter = $t03983540219._7
915+ let cumulativeNotionalAfter = $t03983540219._8
916+ let openInterestNotionalAfter = $t03983540219._9
917+ let x2 = $t03983540219._10
918+ let totalLongAfter = $t03983540219._11
919+ let totalShortAfter = $t03983540219._12
897920 if ((positionBadDebt > 0))
898921 then throw("Unable to close position with bad debt")
899922 else {
900923 let withdrawAmount = abs(marginToVault)
901924 let ammBalance = (cbalance() - withdrawAmount)
902- let $t03965339795 = if ((0 > ammBalance))
925+ let $t04042840570 = if ((0 > ammBalance))
903926 then $Tuple2(0, abs(ammBalance))
904927 else $Tuple2(ammBalance, 0)
905- let ammNewBalance = $t03965339795._1
906- let getFromInsurance = $t03965339795._2
928+ let ammNewBalance = $t04042840570._1
929+ let getFromInsurance = $t04042840570._2
907930 let x = if ((getFromInsurance > 0))
908931 then {
909932 let withdrawInsurance = invoke(insuranceAddress(), "withdraw", [getFromInsurance], nil)
916939 then {
917940 let unstake = invoke(quoteAssetStaking(), "unlockNeutrino", [(withdrawAmount - getFromInsurance), toBase58String(quoteAsset())], nil)
918941 if ((unstake == unstake))
919- then (((deletePosition(toString(i.caller)) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter)) ++ withdraw(i.caller, withdrawAmount)) ++ updateBalance(ammNewBalance))
942+ then {
943+ let notifyNotional = invoke(minerAddress(), "notifyNotional", [toString(i.caller), 0], nil)
944+ if ((notifyNotional == notifyNotional))
945+ then (((deletePosition(toString(i.caller)) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter)) ++ withdraw(i.caller, withdrawAmount)) ++ updateBalance(ammNewBalance))
946+ else throw("Strict value is not equal to itself.")
947+ }
920948 else throw("Strict value is not equal to itself.")
921949 }
922950 else throw("Strict value is not equal to itself.")
943971 else paused())
944972 then throw("Unable to liquidate")
945973 else {
946- let $t04134341759 = internalClosePosition(_trader)
947- let x1 = $t04134341759._1
948- let badDebt = $t04134341759._2
949- let x2 = $t04134341759._3
950- let x3 = $t04134341759._4
951- let quoteAssetReserveAfter = $t04134341759._5
952- let baseAssetReserveAfter = $t04134341759._6
953- let totalPositionSizeAfter = $t04134341759._7
954- let cumulativeNotionalAfter = $t04134341759._8
955- let openInterestNotionalAfter = $t04134341759._9
956- let exchangedQuoteAssetAmount = $t04134341759._10
957- let totalLongAfter = $t04134341759._11
958- let totalShortAfter = $t04134341759._12
974+ let $t04226042676 = internalClosePosition(_trader)
975+ let x1 = $t04226042676._1
976+ let badDebt = $t04226042676._2
977+ let x2 = $t04226042676._3
978+ let x3 = $t04226042676._4
979+ let quoteAssetReserveAfter = $t04226042676._5
980+ let baseAssetReserveAfter = $t04226042676._6
981+ let totalPositionSizeAfter = $t04226042676._7
982+ let cumulativeNotionalAfter = $t04226042676._8
983+ let openInterestNotionalAfter = $t04226042676._9
984+ let exchangedQuoteAssetAmount = $t04226042676._10
985+ let totalLongAfter = $t04226042676._11
986+ let totalShortAfter = $t04226042676._12
959987 let liquidationPenalty = muld(exchangedQuoteAssetAmount, liquidationFeeRatio())
960988 let feeToLiquidator = (liquidationPenalty / 2)
961989 let feeToInsurance = (liquidationPenalty - feeToLiquidator)
962990 let ammBalance = (cbalance() - liquidationPenalty)
963- let $t04215742292 = if ((0 > ammBalance))
991+ let $t04307443209 = if ((0 > ammBalance))
964992 then $Tuple2(0, abs(ammBalance))
965993 else $Tuple2(ammBalance, 0)
966- let newAmmBalance = $t04215742292._1
967- let takeFromInsurance = $t04215742292._2
994+ let newAmmBalance = $t04307443209._1
995+ let takeFromInsurance = $t04307443209._2
968996 let x = if ((takeFromInsurance > 0))
969997 then {
970998 let withdrawInsurance = invoke(insuranceAddress(), "withdraw", [takeFromInsurance], nil)
9801008 then {
9811009 let depositInsurance = invoke(insuranceAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), feeToInsurance)])
9821010 if ((depositInsurance == depositInsurance))
983- then (((deletePosition(_trader) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter)) ++ withdraw(i.caller, feeToLiquidator)) ++ updateBalance(newAmmBalance))
1011+ then {
1012+ let notifyNotional = invoke(minerAddress(), "notifyNotional", [_trader, 0], nil)
1013+ if ((notifyNotional == notifyNotional))
1014+ then (((deletePosition(_trader) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter)) ++ withdraw(i.caller, feeToLiquidator)) ++ updateBalance(newAmmBalance))
1015+ else throw("Strict value is not equal to itself.")
1016+ }
9841017 else throw("Strict value is not equal to itself.")
9851018 }
9861019 else throw("Strict value is not equal to itself.")
10041037 let underlyingPrice = getOracleTwapPrice()
10051038 let spotTwapPrice = getTwapSpotPrice()
10061039 let premium = (spotTwapPrice - underlyingPrice)
1007- let $t04366845003 = if (if ((totalShortPositionSize() == 0))
1040+ let $t04470346038 = if (if ((totalShortPositionSize() == 0))
10081041 then true
10091042 else (totalLongPositionSize() == 0))
10101043 then $Tuple2(0, 0)
10191052 let shortPremiumFraction = divd(muld(longPremiumFraction, totalLongPositionSize()), totalShortPositionSize())
10201053 $Tuple2(shortPremiumFraction, longPremiumFraction)
10211054 }
1022- let shortPremiumFraction = $t04366845003._1
1023- let longPremiumFraction = $t04366845003._2
1055+ let shortPremiumFraction = $t04470346038._1
1056+ let longPremiumFraction = $t04470346038._2
10241057 updateFunding((fundingBlockTimestamp + fundingPeriodSeconds()), (latestLongCumulativePremiumFraction() + longPremiumFraction), (latestShortCumulativePremiumFraction() + shortPremiumFraction), divd(longPremiumFraction, underlyingPrice), divd(shortPremiumFraction, underlyingPrice))
10251058 }
10261059 }
10291062
10301063 @Callable(i)
10311064 func v_get (_trader) = {
1032- let $t04537845431 = internalClosePosition(_trader)
1033- let x1 = $t04537845431._1
1034- let x2 = $t04537845431._2
1035- let x3 = $t04537845431._3
1036- let x4 = $t04537845431._4
1065+ let $t04641346466 = internalClosePosition(_trader)
1066+ let x1 = $t04641346466._1
1067+ let x2 = $t04641346466._2
1068+ let x3 = $t04641346466._3
1069+ let x4 = $t04641346466._4
10371070 throw((((s(x2) + s(x3)) + s(x4)) + s(getMarginRatio(_trader))))
10381071 }
10391072
10411074
10421075 @Callable(i)
10431076 func view_calcRemainMarginWithFundingPayment (_trader) = {
1044- let $t04557845689 = getPosition(_trader)
1045- let positionSize = $t04557845689._1
1046- let positionMargin = $t04557845689._2
1047- let pon = $t04557845689._3
1048- let positionLstUpdCPF = $t04557845689._4
1049- let $t04569445795 = getPositionNotionalAndUnrealizedPnl(_trader, PNL_OPTION_SPOT)
1050- let positionNotional = $t04569445795._1
1051- let unrealizedPnl = $t04569445795._2
1052- let $t04580045982 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl)
1053- let remainMargin = $t04580045982._1
1054- let badDebt = $t04580045982._2
1055- let fundingPayment = $t04580045982._3
1077+ let $t04661346724 = getPosition(_trader)
1078+ let positionSize = $t04661346724._1
1079+ let positionMargin = $t04661346724._2
1080+ let pon = $t04661346724._3
1081+ let positionLstUpdCPF = $t04661346724._4
1082+ let $t04672946830 = getPositionNotionalAndUnrealizedPnl(_trader, PNL_OPTION_SPOT)
1083+ let positionNotional = $t04672946830._1
1084+ let unrealizedPnl = $t04672946830._2
1085+ let $t04683547017 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl)
1086+ let remainMargin = $t04683547017._1
1087+ let badDebt = $t04683547017._2
1088+ let fundingPayment = $t04683547017._3
10561089 throw(((s(remainMargin) + s(fundingPayment)) + s(getMarginRatio(_trader))))
10571090 }
1091+
1092+
1093+
1094+@Callable(i)
1095+func forceMoveAsset (_trader,_amount) = if (if ((addressFromPublicKey(adminPublicKey()) != i.caller))
1096+ then true
1097+ else (0 > _amount))
1098+ then throw("Invalid forceMoveAsset parameters")
1099+ else {
1100+ let unstake = invoke(quoteAssetStaking(), "unlockNeutrino", [_amount, toBase58String(quoteAsset())], nil)
1101+ if ((unstake == unstake))
1102+ then (withdraw(addressFromStringValue(_trader), _amount) ++ updateBalance((cbalance() - _amount)))
1103+ else throw("Strict value is not equal to itself.")
1104+ }
10581105
10591106
10601107 @Verifier(tx)
Full:
OldNewDifferences
1-{-# STDLIB_VERSION 5 #-}
1+{-# 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
86+let k_miner_address = "k_miner_address"
87+
8688 func coordinator () = valueOrErrorMessage(addressFromString(getStringValue(this, k_coordinatorAddress)), "Coordinator not set")
8789
8890
8991 func adminAddress () = addressFromString(getStringValue(coordinator(), k_admin_address))
9092
9193
9294 func adminPublicKey () = fromBase58String(getStringValue(coordinator(), k_admin_public_key))
9395
9496
9597 func quoteAsset () = fromBase58String(getStringValue(coordinator(), k_quote_asset))
9698
9799
98100 func quoteAssetStaking () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_quote_staking)), "Quote asset staking not set")
99101
100102
101103 func stakingAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_staking_address)), "Insurance not set")
102104
103105
104106 func insuranceAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_insurance_address)), "Insurance not set")
107+
108+
109+func minerAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_miner_address)), "Insurance not set")
105110
106111
107112 let DIR_LONG = 1
108113
109114 let DIR_SHORT = 2
110115
111116 let FUNDING_BLOCK_INTERVAL = 60
112117
113118 let TWAP_INTERVAL = 15
114119
115120 let ORACLE_INTERVAL = 15
116121
117122 let SECONDS = 1000
118123
119124 let DECIMAL_UNIT = (1 * (((((10 * 10) * 10) * 10) * 10) * 10))
120125
121126 let HUNDRED_PERCENT = (100 * DECIMAL_UNIT)
122127
123128 let ONE_DAY = (86400 * DECIMAL_UNIT)
124129
125130 let ALL_FEES = 100
126131
127132 let PNL_OPTION_SPOT = 1
128133
129134 let PNL_OPTION_ORACLE = 2
130135
131136 func s (_x) = (toString(_x) + ",")
132137
133138
134139 func divd (_x,_y) = fraction(_x, DECIMAL_UNIT, _y, HALFEVEN)
135140
136141
137142 func muld (_x,_y) = fraction(_x, _y, DECIMAL_UNIT, HALFEVEN)
138143
139144
140145 func abs (_x) = if ((_x > 0))
141146 then _x
142147 else -(_x)
143148
144149
145150 func vmax (_x,_y) = if ((_x >= _y))
146151 then _x
147152 else _y
148153
149154
150155 func toCompositeKey (_key,_address) = ((_key + "_") + _address)
151156
152157
153158 func listToStr (_list) = {
154159 func _join (accumulator,val) = ((accumulator + val) + ",")
155160
156161 let newListStr = {
157162 let $l = _list
158163 let $s = size($l)
159164 let $acc0 = ""
160165 func $f0_1 ($a,$i) = if (($i >= $s))
161166 then $a
162167 else _join($a, $l[$i])
163168
164169 func $f0_2 ($a,$i) = if (($i >= $s))
165170 then $a
166171 else throw("List size exceeds 20")
167172
168173 $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)
169174 }
170175 let newListStrU = dropRight(newListStr, 1)
171176 let newListStrR = if ((take(newListStrU, 1) == ","))
172177 then drop(newListStrU, 1)
173178 else newListStrU
174179 newListStrR
175180 }
176181
177182
178183 func strToList (_str) = split(_str, ",")
179184
180185
181186 func pushToQueue (_list,_maxSize,_value) = if ((size(_list) > _maxSize))
182187 then (removeByIndex(_list, 0) :+ _value)
183188 else (_list :+ _value)
184189
185190
186191 func int (k) = valueOrErrorMessage(getInteger(this, k), ("no value for " + k))
187192
188193
189194 func cbalance () = int(k_balance)
190195
191196
192197 func fee () = int(k_fee)
193198
194199
195200 func initMarginRatio () = int(k_initMarginRatio)
196201
197202
198203 func qtAstR () = int(k_quoteAssetReserve)
199204
200205
201206 func bsAstR () = int(k_baseAssetReserve)
202207
203208
204209 func totalPositionSize () = int(k_totalPositionSize)
205210
206211
207212 func cumulativeNotional () = int(k_cumulativeNotional)
208213
209214
210215 func openInterestNotional () = int(k_openInterestNotional)
211216
212217
213218 func nextFundingBlockTimestamp () = int(k_nextFundingBlock)
214219
215220
216221 func fundingPeriodRaw () = int(k_fundingPeriod)
217222
218223
219224 func fundingPeriodDecimal () = (fundingPeriodRaw() * DECIMAL_UNIT)
220225
221226
222227 func fundingPeriodSeconds () = (fundingPeriodRaw() * SECONDS)
223228
224229
225230 func maintenanceMarginRatio () = int(k_maintenanceMarginRatio)
226231
227232
228233 func liquidationFeeRatio () = int(k_liquidationFeeRatio)
229234
230235
231236 func spreadLimit () = int(k_spreadLimit)
232237
233238
234239 func maxPriceImpact () = int(k_maxPriceImpact)
235240
236241
237242 func latestLongCumulativePremiumFraction () = int(k_latestLongCumulativePremiumFraction)
238243
239244
240245 func latestShortCumulativePremiumFraction () = int(k_latestShortCumulativePremiumFraction)
241246
242247
243248 func totalShortPositionSize () = int(k_totalShortPositionSize)
244249
245250
246251 func totalLongPositionSize () = int(k_totalLongPositionSize)
247252
248253
249254 func requireMoreMarginRatio (_marginRatio,_baseMarginRatio,_largerThanOrEqualTo) = {
250255 let remainingMarginRatio = (_marginRatio - _baseMarginRatio)
251256 if (if (_largerThanOrEqualTo)
252257 then (0 > remainingMarginRatio)
253258 else false)
254259 then throw("Invalid margin")
255260 else if (if (!(_largerThanOrEqualTo))
256261 then (remainingMarginRatio >= 0)
257262 else false)
258263 then throw("Invalid margin")
259264 else true
260265 }
261266
262267
263268 func latestCumulativePremiumFraction (_positionSize) = if ((_positionSize == 0))
264269 then throw("Should not be called with _positionSize == 0")
265270 else if ((_positionSize > 0))
266271 then latestLongCumulativePremiumFraction()
267272 else latestShortCumulativePremiumFraction()
268273
269274
270275 func getPosition (_trader) = {
271276 let positionSizeOpt = getInteger(this, toCompositeKey(k_positionSize, _trader))
272277 match positionSizeOpt {
273278 case positionSize: Int =>
274279 $Tuple4(positionSize, getIntegerValue(this, toCompositeKey(k_positionMargin, _trader)), getIntegerValue(this, toCompositeKey(k_positionOpenNotional, _trader)), getIntegerValue(this, toCompositeKey(k_positionLastUpdatedCumulativePremiumFraction, _trader)))
275280 case _ =>
276281 $Tuple4(0, 0, 0, 0)
277282 }
278283 }
279284
280285
281286 func requireOpenPosition (_trader) = if ((getPosition(_trader)._1 == 0))
282287 then throw("No open position")
283288 else true
284289
285290
286291 func initialized () = valueOrElse(getBoolean(this, k_initialized), false)
287292
288293
289294 func paused () = valueOrElse(getBoolean(this, k_paused), false)
290295
291296
292297 func updateReserve (_isAdd,_quoteAssetAmount,_baseAssetAmount) = if (_isAdd)
293298 then {
294299 let newBase = (bsAstR() - _baseAssetAmount)
295300 if ((0 >= newBase))
296301 then throw("Tx lead to base asset reserve <= 0, revert")
297302 else $Tuple4((qtAstR() + _quoteAssetAmount), newBase, (totalPositionSize() + _baseAssetAmount), (cumulativeNotional() + _quoteAssetAmount))
298303 }
299304 else {
300305 let newQuote = (qtAstR() - _quoteAssetAmount)
301306 if ((0 >= newQuote))
302307 then throw("Tx lead to base quote reserve <= 0, revert")
303308 else $Tuple4(newQuote, (bsAstR() + _baseAssetAmount), (totalPositionSize() - _baseAssetAmount), (cumulativeNotional() - _quoteAssetAmount))
304309 }
305310
306311
307312 func swapInput (_isAdd,_quoteAssetAmount) = {
308313 let _qtAstR = qtAstR()
309314 let _bsAstR = bsAstR()
310315 let priceBefore = divd(_qtAstR, _bsAstR)
311316 let amountBaseAssetBoughtWithoutPriceImpact = muld(_quoteAssetAmount, priceBefore)
312317 let k = muld(_qtAstR, _bsAstR)
313318 let quoteAssetReserveAfter = if (_isAdd)
314319 then (_qtAstR + _quoteAssetAmount)
315320 else (_qtAstR - _quoteAssetAmount)
316321 let baseAssetReserveAfter = divd(k, quoteAssetReserveAfter)
317322 let amountBaseAssetBoughtAbs = abs((baseAssetReserveAfter - _bsAstR))
318323 let amountBaseAssetBought = if (_isAdd)
319324 then amountBaseAssetBoughtAbs
320325 else -(amountBaseAssetBoughtAbs)
321326 let priceImpact = ((amountBaseAssetBoughtWithoutPriceImpact - amountBaseAssetBoughtAbs) / amountBaseAssetBoughtWithoutPriceImpact)
322327 let maxPriceImpactValue = maxPriceImpact()
323328 if ((priceImpact > maxPriceImpactValue))
324329 then throw(((("Price impact " + toString(priceImpact)) + " > max price impact ") + toString(maxPriceImpactValue)))
325330 else {
326- let $t01215412357 = updateReserve(_isAdd, _quoteAssetAmount, amountBaseAssetBoughtAbs)
327- let quoteAssetReserveAfter1 = $t01215412357._1
328- let baseAssetReserveAfter1 = $t01215412357._2
329- let totalPositionSizeAfter1 = $t01215412357._3
330- let cumulativeNotionalAfter1 = $t01215412357._4
331+ let $t01236812571 = updateReserve(_isAdd, _quoteAssetAmount, amountBaseAssetBoughtAbs)
332+ let quoteAssetReserveAfter1 = $t01236812571._1
333+ let baseAssetReserveAfter1 = $t01236812571._2
334+ let totalPositionSizeAfter1 = $t01236812571._3
335+ let cumulativeNotionalAfter1 = $t01236812571._4
331336 $Tuple5(amountBaseAssetBought, quoteAssetReserveAfter1, baseAssetReserveAfter1, totalPositionSizeAfter1, cumulativeNotionalAfter1)
332337 }
333338 }
334339
335340
336341 func calcRemainMarginWithFundingPayment (_oldPositionSize,_oldPositionMargin,_oldPositionCumulativePremiumFraction,_marginDelta) = {
337342 let fundingPayment = if ((_oldPositionSize != 0))
338343 then {
339344 let _latestCumulativePremiumFraction = latestCumulativePremiumFraction(_oldPositionSize)
340345 muld((_latestCumulativePremiumFraction - _oldPositionCumulativePremiumFraction), _oldPositionSize)
341346 }
342347 else 0
343348 let signedMargin = ((_marginDelta - fundingPayment) + _oldPositionMargin)
344- let $t01310413231 = if ((0 > signedMargin))
349+ let $t01331813445 = if ((0 > signedMargin))
345350 then $Tuple2(0, abs(signedMargin))
346351 else $Tuple2(abs(signedMargin), 0)
347- let remainMargin = $t01310413231._1
348- let badDebt = $t01310413231._2
352+ let remainMargin = $t01331813445._1
353+ let badDebt = $t01331813445._2
349354 $Tuple3(remainMargin, badDebt, fundingPayment)
350355 }
351356
352357
353358 func swapOutput (_isAdd,_baseAssetAmount) = {
354359 let _quoteAssetReserve = qtAstR()
355360 let _baseAssetReserve = bsAstR()
356361 if ((_baseAssetAmount == 0))
357362 then throw("Invalid base asset amount")
358363 else {
359364 let k = muld(_quoteAssetReserve, _baseAssetReserve)
360365 let baseAssetPoolAmountAfter = if (_isAdd)
361366 then (_baseAssetReserve + _baseAssetAmount)
362367 else (_baseAssetReserve - _baseAssetAmount)
363368 let quoteAssetAfter = divd(k, baseAssetPoolAmountAfter)
364369 let quoteAssetSold = abs((quoteAssetAfter - _quoteAssetReserve))
365- let $t01406914262 = updateReserve(!(_isAdd), quoteAssetSold, _baseAssetAmount)
366- let quoteAssetReserveAfter1 = $t01406914262._1
367- let baseAssetReserveAfter1 = $t01406914262._2
368- let totalPositionSizeAfter1 = $t01406914262._3
369- let cumulativeNotionalAfter1 = $t01406914262._4
370+ let $t01428314476 = updateReserve(!(_isAdd), quoteAssetSold, _baseAssetAmount)
371+ let quoteAssetReserveAfter1 = $t01428314476._1
372+ let baseAssetReserveAfter1 = $t01428314476._2
373+ let totalPositionSizeAfter1 = $t01428314476._3
374+ let cumulativeNotionalAfter1 = $t01428314476._4
370375 $Tuple7(quoteAssetSold, quoteAssetReserveAfter1, baseAssetReserveAfter1, totalPositionSizeAfter1, cumulativeNotionalAfter1, (totalLongPositionSize() - (if (_isAdd)
371376 then abs(_baseAssetAmount)
372377 else 0)), (totalShortPositionSize() - (if (!(_isAdd))
373378 then abs(_baseAssetAmount)
374379 else 0)))
375380 }
376381 }
377382
378383
379384 func getOracleTwapPrice () = {
380385 let oracle = valueOrErrorMessage(addressFromString(getStringValue(this, k_ora)), "")
381386 let priceKey = getStringValue(this, k_ora_key)
382387 let blockKey = getStringValue(this, k_ora_block_key)
383388 let lastValue = getIntegerValue(oracle, priceKey)
384389 lastValue
385390 }
386391
387392
388393 func getSpotPrice () = {
389394 let _quoteAssetReserve = qtAstR()
390395 let _baseAssetReserve = bsAstR()
391396 divd(_quoteAssetReserve, _baseAssetReserve)
392397 }
393398
394399
395400 func isOverFluctuationLimit () = {
396401 let oraclePrice = getOracleTwapPrice()
397402 let currentPrice = getSpotPrice()
398403 (divd(abs((oraclePrice - currentPrice)), oraclePrice) > spreadLimit())
399404 }
400405
401406
402407 func getPositionNotionalAndUnrealizedPnl (_trader,_option) = {
403- let $t01589416022 = getPosition(_trader)
404- let positionSize = $t01589416022._1
405- let positionMargin = $t01589416022._2
406- let positionOpenNotional = $t01589416022._3
407- let positionLstUpdCPF = $t01589416022._4
408+ let $t01610816236 = getPosition(_trader)
409+ let positionSize = $t01610816236._1
410+ let positionMargin = $t01610816236._2
411+ let positionOpenNotional = $t01610816236._3
412+ let positionLstUpdCPF = $t01610816236._4
408413 let positionSizeAbs = abs(positionSize)
409414 if ((positionSizeAbs == 0))
410415 then throw("Invalid position size")
411416 else {
412417 let isShort = (0 > positionSize)
413418 let positionNotional = if ((_option == PNL_OPTION_SPOT))
414419 then {
415- let $t01626916376 = swapOutput(!(isShort), positionSizeAbs)
416- let outPositionNotional = $t01626916376._1
417- let x1 = $t01626916376._2
418- let x2 = $t01626916376._3
419- let x3 = $t01626916376._4
420+ let $t01648316590 = swapOutput(!(isShort), positionSizeAbs)
421+ let outPositionNotional = $t01648316590._1
422+ let x1 = $t01648316590._2
423+ let x2 = $t01648316590._3
424+ let x3 = $t01648316590._4
420425 outPositionNotional
421426 }
422427 else muld(positionSizeAbs, getOracleTwapPrice())
423428 let unrealizedPnl = if (isShort)
424429 then (positionOpenNotional - positionNotional)
425430 else (positionNotional - positionOpenNotional)
426431 $Tuple2(positionNotional, unrealizedPnl)
427432 }
428433 }
429434
430435
431436 func calcMarginRatio (_remainMargin,_badDebt,_positionNotional) = divd((_remainMargin - _badDebt), _positionNotional)
432437
433438
434439 func getMarginRatioByOption (_trader,_option) = {
435- let $t01704617157 = getPosition(_trader)
436- let positionSize = $t01704617157._1
437- let positionMargin = $t01704617157._2
438- let pon = $t01704617157._3
439- let positionLstUpdCPF = $t01704617157._4
440- let $t01716317256 = getPositionNotionalAndUnrealizedPnl(_trader, _option)
441- let positionNotional = $t01716317256._1
442- let unrealizedPnl = $t01716317256._2
443- let $t01726117427 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl)
444- let remainMargin = $t01726117427._1
445- let badDebt = $t01726117427._2
440+ let $t01726017371 = getPosition(_trader)
441+ let positionSize = $t01726017371._1
442+ let positionMargin = $t01726017371._2
443+ let pon = $t01726017371._3
444+ let positionLstUpdCPF = $t01726017371._4
445+ let $t01737717470 = getPositionNotionalAndUnrealizedPnl(_trader, _option)
446+ let positionNotional = $t01737717470._1
447+ let unrealizedPnl = $t01737717470._2
448+ let $t01747517641 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl)
449+ let remainMargin = $t01747517641._1
450+ let badDebt = $t01747517641._2
446451 calcMarginRatio(remainMargin, badDebt, positionNotional)
447452 }
448453
449454
450455 func getMarginRatio (_trader) = getMarginRatioByOption(_trader, PNL_OPTION_SPOT)
451456
452457
453458 func internalClosePosition (_trader) = {
454- let $t01774317871 = getPosition(_trader)
455- let positionSize = $t01774317871._1
456- let positionMargin = $t01774317871._2
457- let positionOpenNotional = $t01774317871._3
458- let positionLstUpdCPF = $t01774317871._4
459- let $t01787717964 = getPositionNotionalAndUnrealizedPnl(_trader, PNL_OPTION_SPOT)
460- let x1 = $t01787717964._1
461- let unrealizedPnl = $t01787717964._2
462- let $t01796918137 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl)
463- let remainMargin = $t01796918137._1
464- let badDebt = $t01796918137._2
459+ let $t01795718085 = getPosition(_trader)
460+ let positionSize = $t01795718085._1
461+ let positionMargin = $t01795718085._2
462+ let positionOpenNotional = $t01795718085._3
463+ let positionLstUpdCPF = $t01795718085._4
464+ let $t01809118178 = getPositionNotionalAndUnrealizedPnl(_trader, PNL_OPTION_SPOT)
465+ let x1 = $t01809118178._1
466+ let unrealizedPnl = $t01809118178._2
467+ let $t01818318351 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl)
468+ let remainMargin = $t01818318351._1
469+ let badDebt = $t01818318351._2
465470 let exchangedPositionSize = -(positionSize)
466471 let realizedPnl = unrealizedPnl
467472 let marginToVault = -(remainMargin)
468- let $t01826418545 = swapOutput((positionSize > 0), abs(positionSize))
469- let exchangedQuoteAssetAmount = $t01826418545._1
470- let quoteAssetReserveAfter = $t01826418545._2
471- let baseAssetReserveAfter = $t01826418545._3
472- let totalPositionSizeAfter = $t01826418545._4
473- let cumulativeNotionalAfter = $t01826418545._5
474- let totalLongAfter = $t01826418545._6
475- let totalShortAfter = $t01826418545._7
473+ let $t01847818759 = swapOutput((positionSize > 0), abs(positionSize))
474+ let exchangedQuoteAssetAmount = $t01847818759._1
475+ let quoteAssetReserveAfter = $t01847818759._2
476+ let baseAssetReserveAfter = $t01847818759._3
477+ let totalPositionSizeAfter = $t01847818759._4
478+ let cumulativeNotionalAfter = $t01847818759._5
479+ let totalLongAfter = $t01847818759._6
480+ let totalShortAfter = $t01847818759._7
476481 let openInterestNotionalAfter = (openInterestNotional() - positionOpenNotional)
477482 $Tuple12(exchangedPositionSize, badDebt, realizedPnl, marginToVault, quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, exchangedQuoteAssetAmount, totalLongAfter, totalShortAfter)
478483 }
479484
480485
481486 func getTwapSpotPrice () = {
482487 let minuteId = ((lastBlock.timestamp / 1000) / 60)
483488 let startMinuteId = (minuteId - TWAP_INTERVAL)
484489 let listStr = valueOrElse(getString(this, k_lastDataStr), "")
485490 let list = split(listStr, ",")
486491 func filterFn (accumulator,next) = if ((startMinuteId >= parseIntValue(next)))
487492 then (accumulator :+ parseIntValue(next))
488493 else accumulator
489494
490495 let listF = {
491496 let $l = list
492497 let $s = size($l)
493498 let $acc0 = nil
494499 func $f0_1 ($a,$i) = if (($i >= $s))
495500 then $a
496501 else filterFn($a, $l[$i])
497502
498503 func $f0_2 ($a,$i) = if (($i >= $s))
499504 then $a
500505 else throw("List size exceeds 20")
501506
502507 $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)
503508 }
504509 let maxIndex = if ((size(listF) > 0))
505510 then max(listF)
506511 else parseIntValue(list[0])
507512 let lastMinuteId = valueOrElse(getInteger(this, k_lastMinuteId), 0)
508513 let endLastCumulativePrice = valueOrElse(getInteger(this, ((k_twapDataLastCumulativePrice + "_") + toString(lastMinuteId))), 0)
509514 let endLastPrice = valueOrElse(getInteger(this, ((k_twapDataLastPrice + "_") + toString(lastMinuteId))), 0)
510515 let nowCumulativePrice = (endLastCumulativePrice + ((minuteId - lastMinuteId) * endLastPrice))
511516 let startLastCumulativePrice = valueOrElse(getInteger(this, ((k_twapDataLastCumulativePrice + "_") + toString(maxIndex))), 0)
512517 let startLastPrice = valueOrElse(getInteger(this, ((k_twapDataLastPrice + "_") + toString(maxIndex))), 0)
513518 let startCumulativePrice = (startLastCumulativePrice + ((startMinuteId - maxIndex) * startLastPrice))
514519 ((nowCumulativePrice - startCumulativePrice) / TWAP_INTERVAL)
515520 }
516521
517522
518523 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)]
519524
520525
521526 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)]
522527
523528
524529 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)]
525530
526531
527532 func appendTwap (price) = {
528533 let minuteId = ((lastBlock.timestamp / 1000) / 60)
529534 let previousMinuteId = valueOrElse(getInteger(this, k_lastMinuteId), 0)
530535 if ((previousMinuteId > minuteId))
531536 then throw("TWAP out-of-order")
532537 else {
533538 let lastMinuteId = if ((previousMinuteId == 0))
534539 then minuteId
535540 else previousMinuteId
536541 if ((minuteId > previousMinuteId))
537542 then {
538543 let prevCumulativePrice = valueOrElse(getInteger(this, ((k_twapDataLastCumulativePrice + "_") + toString(previousMinuteId))), 0)
539544 let prevPrice = valueOrElse(getInteger(this, ((k_twapDataLastPrice + "_") + toString(previousMinuteId))), price)
540545 let lastCumulativePrice = (prevCumulativePrice + ((minuteId - lastMinuteId) * prevPrice))
541546 let list = pushToQueue(strToList(valueOrElse(getString(this, k_lastDataStr), "")), TWAP_INTERVAL, toString(minuteId))
542547 [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))]
543548 }
544549 else {
545550 let twapDataPreviousMinuteId = valueOrElse(getInteger(this, toCompositeKey(k_twapDataPreviousMinuteId, toString(minuteId))), 0)
546551 let prevCumulativePrice = valueOrElse(getInteger(this, toCompositeKey(k_twapDataLastCumulativePrice, toString(twapDataPreviousMinuteId))), 0)
547552 let prevPrice = valueOrElse(getInteger(this, toCompositeKey(k_twapDataLastPrice, toString(twapDataPreviousMinuteId))), price)
548553 let lastCumulativePrice = (prevCumulativePrice + ((minuteId - twapDataPreviousMinuteId) * prevPrice))
549554 [IntegerEntry(toCompositeKey(k_twapDataLastCumulativePrice, toString(minuteId)), lastCumulativePrice), IntegerEntry(toCompositeKey(k_twapDataLastPrice, toString(minuteId)), price)]
550555 }
551556 }
552557 }
553558
554559
555560 func updateAmm (_qtAstR,_bsAstR,_totalPositionSizeAfter,_cumulativeNotionalAfter,_openInterestNotional,_totalLongPositionSize,_totalShortPositionSize) = if (((_totalLongPositionSize - _totalShortPositionSize) != _totalPositionSizeAfter))
556561 then throw(((((("Invalid AMM state data: " + toString(_totalLongPositionSize)) + " + ") + toString(_totalShortPositionSize)) + " != ") + toString(_totalPositionSizeAfter)))
557562 else ([IntegerEntry(k_quoteAssetReserve, _qtAstR), IntegerEntry(k_baseAssetReserve, _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)))
558563
559564
560565 func deletePosition (_address) = [DeleteEntry(toCompositeKey(k_positionSize, _address)), DeleteEntry(toCompositeKey(k_positionMargin, _address)), DeleteEntry(toCompositeKey(k_positionOpenNotional, _address)), DeleteEntry(toCompositeKey(k_positionLastUpdatedCumulativePremiumFraction, _address))]
561566
562567
563568 func withdraw (_address,_amount) = {
564569 let balance = assetBalance(this, quoteAsset())
565570 if ((_amount > balance))
566571 then throw(((("Unable to withdraw " + toString(_amount)) + " from contract balance ") + toString(balance)))
567572 else [ScriptTransfer(_address, _amount, quoteAsset())]
568573 }
569574
570575
571576 func updateBalance (i) = if ((0 > i))
572577 then throw("Balance")
573578 else [IntegerEntry(k_balance, i)]
574579
575580
576581 func transferFee (i) = [ScriptTransfer(stakingAddress(), i, quoteAsset())]
577582
578583
579584 @Callable(i)
580585 func pause () = if ((i.caller != adminAddress()))
581586 then throw("Invalid togglePause params")
582587 else [BooleanEntry(k_paused, true)]
583588
584589
585590
586591 @Callable(i)
587592 func unpause () = if ((i.caller != adminAddress()))
588593 then throw("Invalid togglePause params")
589594 else [BooleanEntry(k_paused, false)]
590595
591596
592597
593598 @Callable(i)
594599 func changeSettings (_initMarginRatio,_mmr,_liquidationFeeRatio,_fundingPeriod,_fee,_spreadLimit,_maxPriceImpact) = if ((i.caller != adminAddress()))
595600 then throw("Invalid changeSettings params")
596601 else updateSettings(_initMarginRatio, _mmr, _liquidationFeeRatio, _fundingPeriod, _fee, _spreadLimit, _maxPriceImpact)
597602
598603
599604
600605 @Callable(i)
601606 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))
602607 then true
603608 else (0 >= _bsAstR))
604609 then true
605610 else (0 >= _fundingPeriod))
606611 then true
607612 else (0 >= _initMarginRatio))
608613 then true
609614 else (0 >= _mmr))
610615 then true
611616 else (0 >= _liquidationFeeRatio))
612617 then true
613618 else (0 >= _fee))
614619 then true
615620 else (0 >= _spreadLimit))
616621 then true
617622 else (0 >= _maxPriceImpact))
618623 then true
619624 else initialized())
620625 then throw("Invalid initialize parameters")
621626 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)])
622627
623628
624629
625630 @Callable(i)
626631 func decreasePosition (_amount,_leverage,_minBaseAssetAmount) = if (if (if (if (if (if ((0 >= _amount))
627632 then true
628633 else if (((1 * DECIMAL_UNIT) > _leverage))
629634 then true
630635 else (_leverage > (3 * DECIMAL_UNIT)))
631636 then true
632637 else !(initialized()))
633638 then true
634639 else !(requireMoreMarginRatio(divd(DECIMAL_UNIT, _leverage), initMarginRatio(), true)))
635640 then true
636641 else !(requireOpenPosition(toString(i.caller))))
637642 then true
638643 else paused())
639644 then throw("Invalid decreasePosition parameters")
640645 else {
641- let $t02838628538 = getPosition(toString(i.caller))
642- let oldPositionSize = $t02838628538._1
643- let oldPositionMargin = $t02838628538._2
644- let oldPositionOpenNotional = $t02838628538._3
645- let oldPositionLstUpdCPF = $t02838628538._4
646+ let $t02860028752 = getPosition(toString(i.caller))
647+ let oldPositionSize = $t02860028752._1
648+ let oldPositionMargin = $t02860028752._2
649+ let oldPositionOpenNotional = $t02860028752._3
650+ let oldPositionLstUpdCPF = $t02860028752._4
646651 let _direction = if ((oldPositionSize > 0))
647652 then DIR_SHORT
648653 else DIR_LONG
649654 let isAdd = (_direction == DIR_LONG)
650655 let openNotional = muld(_amount, _leverage)
651- let $t02871128827 = getPositionNotionalAndUnrealizedPnl(toString(i.caller), PNL_OPTION_SPOT)
652- let oldPositionNotional = $t02871128827._1
653- let unrealizedPnl = $t02871128827._2
654- let $t02883331382 = if ((oldPositionNotional > openNotional))
656+ let $t02892529041 = getPositionNotionalAndUnrealizedPnl(toString(i.caller), PNL_OPTION_SPOT)
657+ let oldPositionNotional = $t02892529041._1
658+ let unrealizedPnl = $t02892529041._2
659+ let $t02904731596 = if ((oldPositionNotional > openNotional))
655660 then {
656- let $t02921029429 = swapInput(isAdd, openNotional)
657- let exchangedPositionSize = $t02921029429._1
658- let quoteAssetReserveAfter = $t02921029429._2
659- let baseAssetReserveAfter = $t02921029429._3
660- let totalPositionSizeAfter = $t02921029429._4
661- let cumulativeNotionalAfter = $t02921029429._5
661+ let $t02942429643 = swapInput(isAdd, openNotional)
662+ let exchangedPositionSize = $t02942429643._1
663+ let quoteAssetReserveAfter = $t02942429643._2
664+ let baseAssetReserveAfter = $t02942429643._3
665+ let totalPositionSizeAfter = $t02942429643._4
666+ let cumulativeNotionalAfter = $t02942429643._5
662667 let exchangedPositionSizeAbs = abs(exchangedPositionSize)
663668 if (if ((_minBaseAssetAmount != 0))
664669 then (_minBaseAssetAmount > exchangedPositionSizeAbs)
665670 else false)
666671 then throw(((("Too little base asset exchanged, got " + toString(exchangedPositionSizeAbs)) + " expected ") + toString(_minBaseAssetAmount)))
667672 else {
668673 let realizedPnl = divd(muld(unrealizedPnl, exchangedPositionSizeAbs), abs(oldPositionSize))
669- let $t02986630111 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, realizedPnl)
670- let remainMargin = $t02986630111._1
671- let badDebt = $t02986630111._2
672- let fundingPayment = $t02986630111._3
674+ let $t03008030325 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, realizedPnl)
675+ let remainMargin = $t03008030325._1
676+ let badDebt = $t03008030325._2
677+ let fundingPayment = $t03008030325._3
673678 let exchangedQuoteAssetAmount = openNotional
674679 let unrealizedPnlAfter = (unrealizedPnl - realizedPnl)
675680 let remainOpenNotional = if ((oldPositionSize > 0))
676681 then ((oldPositionNotional - exchangedQuoteAssetAmount) - unrealizedPnlAfter)
677682 else ((unrealizedPnlAfter + oldPositionNotional) - exchangedQuoteAssetAmount)
678683 let newPositionSize = (oldPositionSize + exchangedPositionSize)
679684 $Tuple11(newPositionSize, remainMargin, abs(remainOpenNotional), latestCumulativePremiumFraction(newPositionSize), baseAssetReserveAfter, quoteAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, (openInterestNotional() - openNotional), (totalLongPositionSize() - (if ((newPositionSize > 0))
680685 then abs(exchangedPositionSize)
681686 else 0)), (totalShortPositionSize() - (if ((0 > newPositionSize))
682687 then abs(exchangedPositionSize)
683688 else 0)))
684689 }
685690 }
686691 else throw("Close position first")
687- let newPositionSize = $t02883331382._1
688- let newPositionRemainMargin = $t02883331382._2
689- let newPositionOpenNotional = $t02883331382._3
690- let newPositionLatestCPF = $t02883331382._4
691- let baseAssetReserveAfter = $t02883331382._5
692- let quoteAssetReserveAfter = $t02883331382._6
693- let totalPositionSizeAfter = $t02883331382._7
694- let cumulativeNotionalAfter = $t02883331382._8
695- let openInterestNotionalAfter = $t02883331382._9
696- let totalLongAfter = $t02883331382._10
697- let totalShortAfter = $t02883331382._11
698- (updatePosition(toString(i.caller), newPositionSize, newPositionRemainMargin, newPositionOpenNotional, newPositionLatestCPF) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter))
692+ let newPositionSize = $t02904731596._1
693+ let newPositionRemainMargin = $t02904731596._2
694+ let newPositionOpenNotional = $t02904731596._3
695+ let newPositionLatestCPF = $t02904731596._4
696+ let baseAssetReserveAfter = $t02904731596._5
697+ let quoteAssetReserveAfter = $t02904731596._6
698+ let totalPositionSizeAfter = $t02904731596._7
699+ let cumulativeNotionalAfter = $t02904731596._8
700+ let openInterestNotionalAfter = $t02904731596._9
701+ let totalLongAfter = $t02904731596._10
702+ let totalShortAfter = $t02904731596._11
703+ let notifyNotional = invoke(minerAddress(), "notifyNotional", [toString(i.caller), newPositionOpenNotional], nil)
704+ if ((notifyNotional == notifyNotional))
705+ then (updatePosition(toString(i.caller), newPositionSize, newPositionRemainMargin, newPositionOpenNotional, newPositionLatestCPF) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter))
706+ else throw("Strict value is not equal to itself.")
699707 }
700708
701709
702710
703711 @Callable(i)
704712 func increasePosition (_direction,_leverage,_minBaseAssetAmount) = {
705713 let _rawAmount = i.payments[0].amount
706714 if (if (if (if (if (if (if (if ((_direction != DIR_LONG))
707715 then (_direction != DIR_SHORT)
708716 else false)
709717 then true
710718 else (0 >= _rawAmount))
711719 then true
712720 else if (((1 * DECIMAL_UNIT) > _leverage))
713721 then true
714722 else (_leverage > (3 * DECIMAL_UNIT)))
715723 then true
716724 else !(initialized()))
717725 then true
718726 else (i.payments[0].assetId != quoteAsset()))
719727 then true
720728 else !(requireMoreMarginRatio(divd(DECIMAL_UNIT, _leverage), initMarginRatio(), true)))
721729 then true
722730 else paused())
723731 then throw("Invalid increasePosition parameters")
724732 else {
725733 let feeAmount = muld(_rawAmount, fee())
726734 let _amount = (_rawAmount - feeAmount)
727- let $t03241832570 = getPosition(toString(i.caller))
728- let oldPositionSize = $t03241832570._1
729- let oldPositionMargin = $t03241832570._2
730- let oldPositionOpenNotional = $t03241832570._3
731- let oldPositionLstUpdCPF = $t03241832570._4
735+ let $t03278432936 = getPosition(toString(i.caller))
736+ let oldPositionSize = $t03278432936._1
737+ let oldPositionMargin = $t03278432936._2
738+ let oldPositionOpenNotional = $t03278432936._3
739+ let oldPositionLstUpdCPF = $t03278432936._4
732740 let isNewPosition = (oldPositionSize == 0)
733741 let isSameDirection = if ((oldPositionSize > 0))
734742 then (_direction == DIR_LONG)
735743 else (_direction == DIR_SHORT)
736744 let expandExisting = if (!(isNewPosition))
737745 then isSameDirection
738746 else false
739747 let isAdd = (_direction == DIR_LONG)
740- let $t03285935248 = if (if (isNewPosition)
748+ let $t03322535614 = if (if (isNewPosition)
741749 then true
742750 else expandExisting)
743751 then {
744752 let openNotional = muld(_amount, _leverage)
745- let $t03328333489 = swapInput(isAdd, openNotional)
746- let amountBaseAssetBought = $t03328333489._1
747- let quoteAssetReserveAfter = $t03328333489._2
748- let baseAssetReserveAfter = $t03328333489._3
749- let totalPositionSizeAfter = $t03328333489._4
750- let cumulativeNotionalAfter = $t03328333489._5
753+ let $t03364933855 = swapInput(isAdd, openNotional)
754+ let amountBaseAssetBought = $t03364933855._1
755+ let quoteAssetReserveAfter = $t03364933855._2
756+ let baseAssetReserveAfter = $t03364933855._3
757+ let totalPositionSizeAfter = $t03364933855._4
758+ let cumulativeNotionalAfter = $t03364933855._5
751759 if (if ((_minBaseAssetAmount != 0))
752760 then (_minBaseAssetAmount > abs(amountBaseAssetBought))
753761 else false)
754762 then throw(((("Limit error: " + toString(abs(amountBaseAssetBought))) + " < ") + toString(_minBaseAssetAmount)))
755763 else {
756764 let newPositionSize = (oldPositionSize + amountBaseAssetBought)
757765 let increaseMarginRequirement = divd(openNotional, _leverage)
758- let $t03387034109 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, increaseMarginRequirement)
759- let remainMargin = $t03387034109._1
760- let x1 = $t03387034109._2
761- let x2 = $t03387034109._3
766+ let $t03423634475 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, increaseMarginRequirement)
767+ let remainMargin = $t03423634475._1
768+ let x1 = $t03423634475._2
769+ let x2 = $t03423634475._3
762770 $Tuple11(newPositionSize, remainMargin, (oldPositionOpenNotional + openNotional), latestCumulativePremiumFraction(newPositionSize), baseAssetReserveAfter, quoteAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, (openInterestNotional() + openNotional), (totalLongPositionSize() + (if ((newPositionSize > 0))
763771 then abs(amountBaseAssetBought)
764772 else 0)), (totalShortPositionSize() + (if ((0 > newPositionSize))
765773 then abs(amountBaseAssetBought)
766774 else 0)))
767775 }
768776 }
769777 else {
770778 let openNotional = muld(_amount, _leverage)
771- let $t03494135057 = getPositionNotionalAndUnrealizedPnl(toString(i.caller), PNL_OPTION_SPOT)
772- let oldPositionNotional = $t03494135057._1
773- let unrealizedPnl = $t03494135057._2
779+ let $t03530735423 = getPositionNotionalAndUnrealizedPnl(toString(i.caller), PNL_OPTION_SPOT)
780+ let oldPositionNotional = $t03530735423._1
781+ let unrealizedPnl = $t03530735423._2
774782 if ((oldPositionNotional > openNotional))
775783 then throw("Use decreasePosition to decrease position size")
776784 else throw("Close position first")
777785 }
778- let newPositionSize = $t03285935248._1
779- let newPositionRemainMargin = $t03285935248._2
780- let newPositionOpenNotional = $t03285935248._3
781- let newPositionLatestCPF = $t03285935248._4
782- let baseAssetReserveAfter = $t03285935248._5
783- let quoteAssetReserveAfter = $t03285935248._6
784- let totalPositionSizeAfter = $t03285935248._7
785- let cumulativeNotionalAfter = $t03285935248._8
786- let openInterestNotionalAfter = $t03285935248._9
787- let totalLongAfter = $t03285935248._10
788- let totalShortAfter = $t03285935248._11
786+ let newPositionSize = $t03322535614._1
787+ let newPositionRemainMargin = $t03322535614._2
788+ let newPositionOpenNotional = $t03322535614._3
789+ let newPositionLatestCPF = $t03322535614._4
790+ let baseAssetReserveAfter = $t03322535614._5
791+ let quoteAssetReserveAfter = $t03322535614._6
792+ let totalPositionSizeAfter = $t03322535614._7
793+ let cumulativeNotionalAfter = $t03322535614._8
794+ let openInterestNotionalAfter = $t03322535614._9
795+ let totalLongAfter = $t03322535614._10
796+ let totalShortAfter = $t03322535614._11
789797 let feeToStakers = (feeAmount / 2)
790798 let feeToInsurance = (feeAmount - feeToStakers)
791799 let stake = invoke(quoteAssetStaking(), "lockNeutrinoSP", [toString(stakingAddress()), ALL_FEES], [AttachedPayment(quoteAsset(), _amount)])
792800 if ((stake == stake))
793801 then {
794802 let depositInsurance = invoke(insuranceAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), feeToInsurance)])
795803 if ((depositInsurance == depositInsurance))
796- then (((updatePosition(toString(i.caller), newPositionSize, newPositionRemainMargin, newPositionOpenNotional, newPositionLatestCPF) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter)) ++ transferFee(feeToStakers)) ++ updateBalance((cbalance() + _amount)))
804+ then {
805+ let notifyFee = invoke(minerAddress(), "notifyFees", [toString(i.caller), feeAmount], nil)
806+ if ((notifyFee == notifyFee))
807+ then {
808+ let notifyNotional = invoke(minerAddress(), "notifyNotional", [toString(i.caller), newPositionOpenNotional], nil)
809+ if ((notifyNotional == notifyNotional))
810+ then (((updatePosition(toString(i.caller), newPositionSize, newPositionRemainMargin, newPositionOpenNotional, newPositionLatestCPF) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter)) ++ transferFee(feeToStakers)) ++ updateBalance((cbalance() + _amount)))
811+ else throw("Strict value is not equal to itself.")
812+ }
813+ else throw("Strict value is not equal to itself.")
814+ }
797815 else throw("Strict value is not equal to itself.")
798816 }
799817 else throw("Strict value is not equal to itself.")
800818 }
801819 }
802820
803821
804822
805823 @Callable(i)
806824 func addMargin () = {
807825 let _rawAmount = i.payments[0].amount
808826 if (if (if (if ((i.payments[0].assetId != quoteAsset()))
809827 then true
810828 else !(requireOpenPosition(toString(i.caller))))
811829 then true
812830 else !(initialized()))
813831 then true
814832 else paused())
815833 then throw("Invalid addMargin parameters")
816834 else {
817835 let feeAmount = muld(_rawAmount, fee())
818836 let _amount = (_rawAmount - feeAmount)
819- let $t03652436676 = getPosition(toString(i.caller))
820- let oldPositionSize = $t03652436676._1
821- let oldPositionMargin = $t03652436676._2
822- let oldPositionOpenNotional = $t03652436676._3
823- let oldPositionLstUpdCPF = $t03652436676._4
837+ let $t03717037322 = getPosition(toString(i.caller))
838+ let oldPositionSize = $t03717037322._1
839+ let oldPositionMargin = $t03717037322._2
840+ let oldPositionOpenNotional = $t03717037322._3
841+ let oldPositionLstUpdCPF = $t03717037322._4
824842 let feeToStakers = (feeAmount / 2)
825843 let feeToInsurance = (feeAmount - feeToStakers)
826844 let stake = invoke(quoteAssetStaking(), "lockNeutrinoSP", [toString(stakingAddress()), ALL_FEES], [AttachedPayment(quoteAsset(), _amount)])
827845 if ((stake == stake))
828846 then {
829847 let depositInsurance = invoke(insuranceAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), feeToInsurance)])
830848 if ((depositInsurance == depositInsurance))
831- then ((updatePosition(toString(i.caller), oldPositionSize, (oldPositionMargin + _amount), oldPositionOpenNotional, oldPositionLstUpdCPF) ++ transferFee(feeToStakers)) ++ updateBalance((cbalance() + _amount)))
849+ then {
850+ let notifyFee = invoke(minerAddress(), "notifyFees", [toString(i.caller), feeAmount], nil)
851+ if ((notifyFee == notifyFee))
852+ then ((updatePosition(toString(i.caller), oldPositionSize, (oldPositionMargin + _amount), oldPositionOpenNotional, oldPositionLstUpdCPF) ++ transferFee(feeToStakers)) ++ updateBalance((cbalance() + _amount)))
853+ else throw("Strict value is not equal to itself.")
854+ }
832855 else throw("Strict value is not equal to itself.")
833856 }
834857 else throw("Strict value is not equal to itself.")
835858 }
836859 }
837860
838861
839862
840863 @Callable(i)
841864 func removeMargin (_amount) = if (if (if (if ((0 >= _amount))
842865 then true
843866 else !(requireOpenPosition(toString(i.caller))))
844867 then true
845868 else !(initialized()))
846869 then true
847870 else paused())
848871 then throw("Invalid removeMargin parameters")
849872 else {
850- let $t03759637748 = getPosition(toString(i.caller))
851- let oldPositionSize = $t03759637748._1
852- let oldPositionMargin = $t03759637748._2
853- let oldPositionOpenNotional = $t03759637748._3
854- let oldPositionLstUpdCPF = $t03759637748._4
873+ let $t03837138523 = getPosition(toString(i.caller))
874+ let oldPositionSize = $t03837138523._1
875+ let oldPositionMargin = $t03837138523._2
876+ let oldPositionOpenNotional = $t03837138523._3
877+ let oldPositionLstUpdCPF = $t03837138523._4
855878 let marginDelta = -(_amount)
856- let $t03778537964 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, marginDelta)
857- let remainMargin = $t03778537964._1
858- let badDebt = $t03778537964._2
879+ let $t03856038739 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, marginDelta)
880+ let remainMargin = $t03856038739._1
881+ let badDebt = $t03856038739._2
859882 if ((badDebt != 0))
860883 then throw("Invalid removed margin amount")
861884 else {
862885 let marginRatio = calcMarginRatio(remainMargin, badDebt, oldPositionOpenNotional)
863886 if (!(requireMoreMarginRatio(marginRatio, initMarginRatio(), true)))
864887 then throw(((("Too much margin removed: " + toString(marginRatio)) + " < ") + toString(initMarginRatio())))
865888 else {
866889 let unstake = invoke(quoteAssetStaking(), "unlockNeutrino", [_amount, toBase58String(quoteAsset())], nil)
867890 if ((unstake == unstake))
868891 then ((updatePosition(toString(i.caller), oldPositionSize, remainMargin, oldPositionOpenNotional, latestCumulativePremiumFraction(oldPositionSize)) ++ withdraw(i.caller, _amount)) ++ updateBalance((cbalance() - _amount)))
869892 else throw("Strict value is not equal to itself.")
870893 }
871894 }
872895 }
873896
874897
875898
876899 @Callable(i)
877900 func closePosition () = if (if (if (!(requireOpenPosition(toString(i.caller))))
878901 then true
879902 else !(initialized()))
880903 then true
881904 else paused())
882905 then throw("Invalid closePosition parameters")
883906 else {
884- let $t03906039444 = internalClosePosition(toString(i.caller))
885- let x1 = $t03906039444._1
886- let positionBadDebt = $t03906039444._2
887- let realizedPnl = $t03906039444._3
888- let marginToVault = $t03906039444._4
889- let quoteAssetReserveAfter = $t03906039444._5
890- let baseAssetReserveAfter = $t03906039444._6
891- let totalPositionSizeAfter = $t03906039444._7
892- let cumulativeNotionalAfter = $t03906039444._8
893- let openInterestNotionalAfter = $t03906039444._9
894- let x2 = $t03906039444._10
895- let totalLongAfter = $t03906039444._11
896- let totalShortAfter = $t03906039444._12
907+ let $t03983540219 = internalClosePosition(toString(i.caller))
908+ let x1 = $t03983540219._1
909+ let positionBadDebt = $t03983540219._2
910+ let realizedPnl = $t03983540219._3
911+ let marginToVault = $t03983540219._4
912+ let quoteAssetReserveAfter = $t03983540219._5
913+ let baseAssetReserveAfter = $t03983540219._6
914+ let totalPositionSizeAfter = $t03983540219._7
915+ let cumulativeNotionalAfter = $t03983540219._8
916+ let openInterestNotionalAfter = $t03983540219._9
917+ let x2 = $t03983540219._10
918+ let totalLongAfter = $t03983540219._11
919+ let totalShortAfter = $t03983540219._12
897920 if ((positionBadDebt > 0))
898921 then throw("Unable to close position with bad debt")
899922 else {
900923 let withdrawAmount = abs(marginToVault)
901924 let ammBalance = (cbalance() - withdrawAmount)
902- let $t03965339795 = if ((0 > ammBalance))
925+ let $t04042840570 = if ((0 > ammBalance))
903926 then $Tuple2(0, abs(ammBalance))
904927 else $Tuple2(ammBalance, 0)
905- let ammNewBalance = $t03965339795._1
906- let getFromInsurance = $t03965339795._2
928+ let ammNewBalance = $t04042840570._1
929+ let getFromInsurance = $t04042840570._2
907930 let x = if ((getFromInsurance > 0))
908931 then {
909932 let withdrawInsurance = invoke(insuranceAddress(), "withdraw", [getFromInsurance], nil)
910933 if ((withdrawInsurance == withdrawInsurance))
911934 then nil
912935 else throw("Strict value is not equal to itself.")
913936 }
914937 else nil
915938 if ((x == x))
916939 then {
917940 let unstake = invoke(quoteAssetStaking(), "unlockNeutrino", [(withdrawAmount - getFromInsurance), toBase58String(quoteAsset())], nil)
918941 if ((unstake == unstake))
919- then (((deletePosition(toString(i.caller)) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter)) ++ withdraw(i.caller, withdrawAmount)) ++ updateBalance(ammNewBalance))
942+ then {
943+ let notifyNotional = invoke(minerAddress(), "notifyNotional", [toString(i.caller), 0], nil)
944+ if ((notifyNotional == notifyNotional))
945+ then (((deletePosition(toString(i.caller)) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter)) ++ withdraw(i.caller, withdrawAmount)) ++ updateBalance(ammNewBalance))
946+ else throw("Strict value is not equal to itself.")
947+ }
920948 else throw("Strict value is not equal to itself.")
921949 }
922950 else throw("Strict value is not equal to itself.")
923951 }
924952 }
925953
926954
927955
928956 @Callable(i)
929957 func liquidate (_trader) = {
930958 let spotMarginRatio = getMarginRatioByOption(_trader, PNL_OPTION_SPOT)
931959 let marginRatio = if (isOverFluctuationLimit())
932960 then {
933961 let oracleMarginRatio = getMarginRatioByOption(_trader, PNL_OPTION_ORACLE)
934962 vmax(spotMarginRatio, oracleMarginRatio)
935963 }
936964 else spotMarginRatio
937965 if (if (if (if (!(requireMoreMarginRatio(marginRatio, maintenanceMarginRatio(), false)))
938966 then true
939967 else !(requireOpenPosition(_trader)))
940968 then true
941969 else !(initialized()))
942970 then true
943971 else paused())
944972 then throw("Unable to liquidate")
945973 else {
946- let $t04134341759 = internalClosePosition(_trader)
947- let x1 = $t04134341759._1
948- let badDebt = $t04134341759._2
949- let x2 = $t04134341759._3
950- let x3 = $t04134341759._4
951- let quoteAssetReserveAfter = $t04134341759._5
952- let baseAssetReserveAfter = $t04134341759._6
953- let totalPositionSizeAfter = $t04134341759._7
954- let cumulativeNotionalAfter = $t04134341759._8
955- let openInterestNotionalAfter = $t04134341759._9
956- let exchangedQuoteAssetAmount = $t04134341759._10
957- let totalLongAfter = $t04134341759._11
958- let totalShortAfter = $t04134341759._12
974+ let $t04226042676 = internalClosePosition(_trader)
975+ let x1 = $t04226042676._1
976+ let badDebt = $t04226042676._2
977+ let x2 = $t04226042676._3
978+ let x3 = $t04226042676._4
979+ let quoteAssetReserveAfter = $t04226042676._5
980+ let baseAssetReserveAfter = $t04226042676._6
981+ let totalPositionSizeAfter = $t04226042676._7
982+ let cumulativeNotionalAfter = $t04226042676._8
983+ let openInterestNotionalAfter = $t04226042676._9
984+ let exchangedQuoteAssetAmount = $t04226042676._10
985+ let totalLongAfter = $t04226042676._11
986+ let totalShortAfter = $t04226042676._12
959987 let liquidationPenalty = muld(exchangedQuoteAssetAmount, liquidationFeeRatio())
960988 let feeToLiquidator = (liquidationPenalty / 2)
961989 let feeToInsurance = (liquidationPenalty - feeToLiquidator)
962990 let ammBalance = (cbalance() - liquidationPenalty)
963- let $t04215742292 = if ((0 > ammBalance))
991+ let $t04307443209 = if ((0 > ammBalance))
964992 then $Tuple2(0, abs(ammBalance))
965993 else $Tuple2(ammBalance, 0)
966- let newAmmBalance = $t04215742292._1
967- let takeFromInsurance = $t04215742292._2
994+ let newAmmBalance = $t04307443209._1
995+ let takeFromInsurance = $t04307443209._2
968996 let x = if ((takeFromInsurance > 0))
969997 then {
970998 let withdrawInsurance = invoke(insuranceAddress(), "withdraw", [takeFromInsurance], nil)
971999 if ((withdrawInsurance == withdrawInsurance))
9721000 then nil
9731001 else throw("Strict value is not equal to itself.")
9741002 }
9751003 else nil
9761004 if ((x == x))
9771005 then {
9781006 let unstake = invoke(quoteAssetStaking(), "unlockNeutrino", [(liquidationPenalty - takeFromInsurance), toBase58String(quoteAsset())], nil)
9791007 if ((unstake == unstake))
9801008 then {
9811009 let depositInsurance = invoke(insuranceAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), feeToInsurance)])
9821010 if ((depositInsurance == depositInsurance))
983- then (((deletePosition(_trader) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter)) ++ withdraw(i.caller, feeToLiquidator)) ++ updateBalance(newAmmBalance))
1011+ then {
1012+ let notifyNotional = invoke(minerAddress(), "notifyNotional", [_trader, 0], nil)
1013+ if ((notifyNotional == notifyNotional))
1014+ then (((deletePosition(_trader) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter)) ++ withdraw(i.caller, feeToLiquidator)) ++ updateBalance(newAmmBalance))
1015+ else throw("Strict value is not equal to itself.")
1016+ }
9841017 else throw("Strict value is not equal to itself.")
9851018 }
9861019 else throw("Strict value is not equal to itself.")
9871020 }
9881021 else throw("Strict value is not equal to itself.")
9891022 }
9901023 }
9911024
9921025
9931026
9941027 @Callable(i)
9951028 func payFunding () = {
9961029 let fundingBlockTimestamp = nextFundingBlockTimestamp()
9971030 if (if (if ((fundingBlockTimestamp > lastBlock.timestamp))
9981031 then true
9991032 else !(initialized()))
10001033 then true
10011034 else paused())
10021035 then throw(((("Invalid funding block timestamp: " + toString(lastBlock.timestamp)) + " < ") + toString(fundingBlockTimestamp)))
10031036 else {
10041037 let underlyingPrice = getOracleTwapPrice()
10051038 let spotTwapPrice = getTwapSpotPrice()
10061039 let premium = (spotTwapPrice - underlyingPrice)
1007- let $t04366845003 = if (if ((totalShortPositionSize() == 0))
1040+ let $t04470346038 = if (if ((totalShortPositionSize() == 0))
10081041 then true
10091042 else (totalLongPositionSize() == 0))
10101043 then $Tuple2(0, 0)
10111044 else if ((0 > premium))
10121045 then {
10131046 let shortPremiumFraction = divd(muld(premium, fundingPeriodDecimal()), ONE_DAY)
10141047 let longPremiumFraction = divd(muld(shortPremiumFraction, totalShortPositionSize()), totalLongPositionSize())
10151048 $Tuple2(shortPremiumFraction, longPremiumFraction)
10161049 }
10171050 else {
10181051 let longPremiumFraction = divd(muld(premium, fundingPeriodDecimal()), ONE_DAY)
10191052 let shortPremiumFraction = divd(muld(longPremiumFraction, totalLongPositionSize()), totalShortPositionSize())
10201053 $Tuple2(shortPremiumFraction, longPremiumFraction)
10211054 }
1022- let shortPremiumFraction = $t04366845003._1
1023- let longPremiumFraction = $t04366845003._2
1055+ let shortPremiumFraction = $t04470346038._1
1056+ let longPremiumFraction = $t04470346038._2
10241057 updateFunding((fundingBlockTimestamp + fundingPeriodSeconds()), (latestLongCumulativePremiumFraction() + longPremiumFraction), (latestShortCumulativePremiumFraction() + shortPremiumFraction), divd(longPremiumFraction, underlyingPrice), divd(shortPremiumFraction, underlyingPrice))
10251058 }
10261059 }
10271060
10281061
10291062
10301063 @Callable(i)
10311064 func v_get (_trader) = {
1032- let $t04537845431 = internalClosePosition(_trader)
1033- let x1 = $t04537845431._1
1034- let x2 = $t04537845431._2
1035- let x3 = $t04537845431._3
1036- let x4 = $t04537845431._4
1065+ let $t04641346466 = internalClosePosition(_trader)
1066+ let x1 = $t04641346466._1
1067+ let x2 = $t04641346466._2
1068+ let x3 = $t04641346466._3
1069+ let x4 = $t04641346466._4
10371070 throw((((s(x2) + s(x3)) + s(x4)) + s(getMarginRatio(_trader))))
10381071 }
10391072
10401073
10411074
10421075 @Callable(i)
10431076 func view_calcRemainMarginWithFundingPayment (_trader) = {
1044- let $t04557845689 = getPosition(_trader)
1045- let positionSize = $t04557845689._1
1046- let positionMargin = $t04557845689._2
1047- let pon = $t04557845689._3
1048- let positionLstUpdCPF = $t04557845689._4
1049- let $t04569445795 = getPositionNotionalAndUnrealizedPnl(_trader, PNL_OPTION_SPOT)
1050- let positionNotional = $t04569445795._1
1051- let unrealizedPnl = $t04569445795._2
1052- let $t04580045982 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl)
1053- let remainMargin = $t04580045982._1
1054- let badDebt = $t04580045982._2
1055- let fundingPayment = $t04580045982._3
1077+ let $t04661346724 = getPosition(_trader)
1078+ let positionSize = $t04661346724._1
1079+ let positionMargin = $t04661346724._2
1080+ let pon = $t04661346724._3
1081+ let positionLstUpdCPF = $t04661346724._4
1082+ let $t04672946830 = getPositionNotionalAndUnrealizedPnl(_trader, PNL_OPTION_SPOT)
1083+ let positionNotional = $t04672946830._1
1084+ let unrealizedPnl = $t04672946830._2
1085+ let $t04683547017 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl)
1086+ let remainMargin = $t04683547017._1
1087+ let badDebt = $t04683547017._2
1088+ let fundingPayment = $t04683547017._3
10561089 throw(((s(remainMargin) + s(fundingPayment)) + s(getMarginRatio(_trader))))
10571090 }
1091+
1092+
1093+
1094+@Callable(i)
1095+func forceMoveAsset (_trader,_amount) = if (if ((addressFromPublicKey(adminPublicKey()) != i.caller))
1096+ then true
1097+ else (0 > _amount))
1098+ then throw("Invalid forceMoveAsset parameters")
1099+ else {
1100+ let unstake = invoke(quoteAssetStaking(), "unlockNeutrino", [_amount, toBase58String(quoteAsset())], nil)
1101+ if ((unstake == unstake))
1102+ then (withdraw(addressFromStringValue(_trader), _amount) ++ updateBalance((cbalance() - _amount)))
1103+ else throw("Strict value is not equal to itself.")
1104+ }
10581105
10591106
10601107 @Verifier(tx)
10611108 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], adminPublicKey())
10621109

github/deemru/w8io/169f3d6 
201.55 ms