tx · Dt9S8L3VVTzCiDHRFZHgiwLuQKTB1HBhAvDFvw6MfmS8

3N7rPu8fJbSU4LaBm6xXpC6Q1mFMipUgcRQ:  -0.06500000 Waves

2022.11.10 12:46 [2310890] smart account 3N7rPu8fJbSU4LaBm6xXpC6Q1mFMipUgcRQ > SELF 0.00000000 Waves

{ "type": 13, "id": "Dt9S8L3VVTzCiDHRFZHgiwLuQKTB1HBhAvDFvw6MfmS8", "fee": 6500000, "feeAssetId": null, "timestamp": 1668073627202, "version": 2, "chainId": 84, "sender": "3N7rPu8fJbSU4LaBm6xXpC6Q1mFMipUgcRQ", "senderPublicKey": "9aasfTpGq8rpV4uUB9KaaHqqSrzvEw9t4pzXqv5N6BNr", "proofs": [ "TnzYXCZCZujykKZgkRKu7JxGRsUMYrqwMryzVjkyRNZf3HBuL2q7mWMNbLWeGdPbSBan3F6VCjnEWwTPueEiwWB" ], "script": "base64:BgJ2CAISABIAEgMKAQESAwoBARILCgkBAQEBAQEBAQESEAoOAQEBAQEBAQgICAEBAQESAwoBARIFCgMBAQESBgoEAQEBCBIAEgMKAQESABIDCgEIEgASBAoCCAESAwoBARIAEgMKAQgSAwoBCBIDCgEBEgASAwoBCKEBAAlrX29yYV9rZXkCCWtfb3JhX2tleQAPa19vcmFfYmxvY2tfa2V5Ag9rX29yYV9ibG9ja19rZXkABWtfb3JhAgVrX29yYQAJa19iYWxhbmNlAglrX2JhbGFuY2UADmtfcG9zaXRpb25TaXplAg5rX3Bvc2l0aW9uU2l6ZQAQa19wb3NpdGlvbk1hcmdpbgIQa19wb3NpdGlvbk1hcmdpbgAWa19wb3NpdGlvbk9wZW5Ob3Rpb25hbAIWa19wb3NpdGlvbk9wZW5Ob3Rpb25hbAAua19wb3NpdGlvbkxhc3RVcGRhdGVkQ3VtdWxhdGl2ZVByZW1pdW1GcmFjdGlvbgISa19wb3NpdGlvbkZyYWN0aW9uABRrX3Bvc2l0aW9uQ2xvc2VkRGF0ZQIUa19wb3NpdGlvbkNsb3N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HJlbWl1bUZyYWN0aW9uBQ91bmRlcmx5aW5nUHJpY2UEDHNob3J0RnVuZGluZwkBBGRpdmQCBRRzaG9ydFByZW1pdW1GcmFjdGlvbgUPdW5kZXJseWluZ1ByaWNlCQACAQkArAICCQCsAgIJAKwCAgkBAXMBBQtsb25nRnVuZGluZwkBAXMBBQxzaG9ydEZ1bmRpbmcJAQFzAQkBEGdldFR3YXBTcG90UHJpY2UACQEBcwEJARJnZXRPcmFjbGVUd2FwUHJpY2UAAWkBGHZpZXdfZ2V0Qm9ycm93ZWRCeVRyYWRlcgEHX3RyYWRlcgQNJHQwNzI4NzA3MjkyNAkBE2dldEJvcnJvd2VkQnlUcmFkZXIBBQdfdHJhZGVyBAhib3Jyb3dlZAgFDSR0MDcyODcwNzI5MjQCXzEEB2Fzc2V0SWQIBQ0kdDA3Mjg3MDcyOTI0Al8yCQACAQkArAICCQEBcwEFCGJvcnJvd2VkBQdhc3NldElkAQJ0eAEGdmVyaWZ5AAkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAkBDmFkbWluUHVibGljS2V5AMmgpy8=", "height": 2310890, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 38W6FSb2hLwZ9kAc7499bDQRPxctX6mYThJh1AaoE5dk Next: none Diff:
OldNewDifferences
1818 let k_positionLastUpdatedCumulativePremiumFraction = "k_positionFraction"
1919
2020 let k_positionClosedDate = "k_positionClosedDate"
21+
22+let k_positionAsset = "k_positionAsset"
2123
2224 let k_initialized = "k_initialized"
2325
9799
98100 let k_manager_address = "k_manager_address"
99101
102+let k_collateral_address = "k_collateral_address"
103+
104+let k_exchange_address = "k_exchange_address"
105+
100106 let k_nft_manager_address = "k_nft_manager_address"
107+
108+let k_trader_market_asset_collateral = "k_trader_market_asset_collateral"
109+
110+func toCompositeKey (_key,_address) = ((_key + "_") + _address)
111+
101112
102113 func coordinator () = valueOrErrorMessage(addressFromString(getStringValue(this, k_coordinatorAddress)), "Coordinator not set")
103114
133144
134145
135146 func nftManagerAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_nft_manager_address)), "NFT Manager not set")
147+
148+
149+func collateralAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_collateral_address)), "Collateral Manager not set")
150+
151+
152+func swapAddress () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(coordinator(), k_exchange_address), "No swap address")), "Invalid swap address")
153+
154+
155+let k_whitelist_asset = "k_whitelist_asset"
156+
157+func isWhitelistAsset (_assetId) = valueOrElse(getBoolean(collateralAddress(), toCompositeKey(k_whitelist_asset, _assetId)), false)
136158
137159
138160 let k_token_param = "k_token_param"
178200 func vmax (_x,_y) = if ((_x >= _y))
179201 then _x
180202 else _y
181-
182-
183-func toCompositeKey (_key,_address) = ((_key + "_") + _address)
184203
185204
186205 func listToStr (_list) = {
332351 }
333352
334353
354+func getPositionAsset (_trader) = {
355+ let positionAssetOpt = getString(this, toCompositeKey(k_positionAsset, _trader))
356+ match positionAssetOpt {
357+ case positionAsset: String =>
358+ positionAsset
359+ case _ =>
360+ toBase58String(quoteAsset())
361+ }
362+ }
363+
364+
335365 func requireOpenPosition (_trader) = if ((getPosition(_trader)._1 == 0))
336366 then throw("No open position")
337367 else true
370400 let amountBaseAssetBought = if (_isAdd)
371401 then amountBaseAssetBoughtAbs
372402 else -(amountBaseAssetBoughtAbs)
373- let $t01366013853 = updateReserve(_isAdd, _quoteAssetAmount, amountBaseAssetBoughtAbs)
374- let quoteAssetReserveAfter1 = $t01366013853._1
375- let baseAssetReserveAfter1 = $t01366013853._2
376- let totalPositionSizeAfter1 = $t01366013853._3
377- let cumulativeNotionalAfter1 = $t01366013853._4
403+ let $t01497415167 = updateReserve(_isAdd, _quoteAssetAmount, amountBaseAssetBoughtAbs)
404+ let quoteAssetReserveAfter1 = $t01497415167._1
405+ let baseAssetReserveAfter1 = $t01497415167._2
406+ let totalPositionSizeAfter1 = $t01497415167._3
407+ let cumulativeNotionalAfter1 = $t01497415167._4
378408 let priceBefore = divd(_qtAstR, _bsAstR)
379409 let marketPrice = divd(_quoteAssetAmount, amountBaseAssetBoughtAbs)
380410 let priceDiff = abs((priceBefore - marketPrice))
394424 }
395425 else 0
396426 let signedMargin = ((_marginDelta - fundingPayment) + _oldPositionMargin)
397- let $t01534415471 = if ((0 > signedMargin))
427+ let $t01665816785 = if ((0 > signedMargin))
398428 then $Tuple2(0, abs(signedMargin))
399429 else $Tuple2(abs(signedMargin), 0)
400- let remainMargin = $t01534415471._1
401- let badDebt = $t01534415471._2
430+ let remainMargin = $t01665816785._1
431+ let badDebt = $t01665816785._2
402432 $Tuple3(remainMargin, badDebt, fundingPayment)
403433 }
404434
415445 let quoteAssetAfter = divd(k, baseAssetPoolAmountAfter)
416446 let quoteAssetSold = abs((quoteAssetAfter - _quoteAssetReserve))
417447 let maxPriceImpactValue = maxPriceImpact()
418- let $t01644816641 = updateReserve(!(_isAdd), quoteAssetSold, _baseAssetAmount)
419- let quoteAssetReserveAfter1 = $t01644816641._1
420- let baseAssetReserveAfter1 = $t01644816641._2
421- let totalPositionSizeAfter1 = $t01644816641._3
422- let cumulativeNotionalAfter1 = $t01644816641._4
448+ let $t01776217955 = updateReserve(!(_isAdd), quoteAssetSold, _baseAssetAmount)
449+ let quoteAssetReserveAfter1 = $t01776217955._1
450+ let baseAssetReserveAfter1 = $t01776217955._2
451+ let totalPositionSizeAfter1 = $t01776217955._3
452+ let cumulativeNotionalAfter1 = $t01776217955._4
423453 let marketPrice = divd(quoteAssetSold, _baseAssetAmount)
424454 let priceDiff = abs((priceBefore - marketPrice))
425455 let priceImpact = (DECIMAL_UNIT - divd(priceBefore, (priceBefore + priceDiff)))
478508 let isShort = (0 > _positionSize)
479509 let positionNotional = if ((_option == PNL_OPTION_SPOT))
480510 then {
481- let $t01985920030 = swapOutputWithReserves(!(isShort), positionSizeAbs, false, _quoteAssetReserve, _baseAssetReserve)
482- let outPositionNotional = $t01985920030._1
483- let x1 = $t01985920030._2
484- let x2 = $t01985920030._3
485- let x3 = $t01985920030._4
511+ let $t02117321344 = swapOutputWithReserves(!(isShort), positionSizeAbs, false, _quoteAssetReserve, _baseAssetReserve)
512+ let outPositionNotional = $t02117321344._1
513+ let x1 = $t02117321344._2
514+ let x2 = $t02117321344._3
515+ let x3 = $t02117321344._4
486516 outPositionNotional
487517 }
488518 else muld(positionSizeAbs, getOracleTwapPrice())
503533
504534
505535 func getPositionNotionalAndUnrealizedPnl (_trader,_option) = {
506- let $t02134721475 = getPosition(_trader)
507- let positionSize = $t02134721475._1
508- let positionMargin = $t02134721475._2
509- let positionOpenNotional = $t02134721475._3
510- let positionLstUpdCPF = $t02134721475._4
536+ let $t02266122789 = getPosition(_trader)
537+ let positionSize = $t02266122789._1
538+ let positionMargin = $t02266122789._2
539+ let positionOpenNotional = $t02266122789._3
540+ let positionLstUpdCPF = $t02266122789._4
511541 getPositionNotionalAndUnrealizedPnlByValues(positionSize, positionOpenNotional, qtAstR(), bsAstR(), _option)
512542 }
513543
516546
517547
518548 func getMarginRatioByOption (_trader,_option) = {
519- let $t02195622067 = getPosition(_trader)
520- let positionSize = $t02195622067._1
521- let positionMargin = $t02195622067._2
522- let pon = $t02195622067._3
523- let positionLstUpdCPF = $t02195622067._4
524- let $t02207322166 = getPositionNotionalAndUnrealizedPnl(_trader, _option)
525- let positionNotional = $t02207322166._1
526- let unrealizedPnl = $t02207322166._2
527- let $t02217122337 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl)
528- let remainMargin = $t02217122337._1
529- let badDebt = $t02217122337._2
549+ let $t02327023381 = getPosition(_trader)
550+ let positionSize = $t02327023381._1
551+ let positionMargin = $t02327023381._2
552+ let pon = $t02327023381._3
553+ let positionLstUpdCPF = $t02327023381._4
554+ let $t02338723480 = getPositionNotionalAndUnrealizedPnl(_trader, _option)
555+ let positionNotional = $t02338723480._1
556+ let unrealizedPnl = $t02338723480._2
557+ let $t02348523651 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl)
558+ let remainMargin = $t02348523651._1
559+ let badDebt = $t02348523651._2
530560 calcMarginRatio(remainMargin, badDebt, positionNotional)
531561 }
532562
551581
552582
553583 func internalClosePosition (_trader,_checkMaxPriceImpact) = {
554- let $t02357023698 = getPosition(_trader)
555- let positionSize = $t02357023698._1
556- let positionMargin = $t02357023698._2
557- let positionOpenNotional = $t02357023698._3
558- let positionLstUpdCPF = $t02357023698._4
584+ let $t02488425012 = getPosition(_trader)
585+ let positionSize = $t02488425012._1
586+ let positionMargin = $t02488425012._2
587+ let positionOpenNotional = $t02488425012._3
588+ let positionLstUpdCPF = $t02488425012._4
559589 let unrealizedPnl = getPositionNotionalAndUnrealizedPnl(_trader, PNL_OPTION_SPOT)._2
560- let $t02379323961 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl)
561- let remainMargin = $t02379323961._1
562- let badDebt = $t02379323961._2
590+ let $t02510725275 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl)
591+ let remainMargin = $t02510725275._1
592+ let badDebt = $t02510725275._2
563593 let exchangedPositionSize = -(positionSize)
564594 let realizedPnl = unrealizedPnl
565595 let marginToVault = -(remainMargin)
566- let $t02408824399 = swapOutput((positionSize > 0), abs(positionSize), _checkMaxPriceImpact)
567- let exchangedQuoteAssetAmount = $t02408824399._1
568- let quoteAssetReserveAfter = $t02408824399._2
569- let baseAssetReserveAfter = $t02408824399._3
570- let totalPositionSizeAfter = $t02408824399._4
571- let cumulativeNotionalAfter = $t02408824399._5
572- let totalLongAfter = $t02408824399._6
573- let totalShortAfter = $t02408824399._7
596+ let $t02540225713 = swapOutput((positionSize > 0), abs(positionSize), _checkMaxPriceImpact)
597+ let exchangedQuoteAssetAmount = $t02540225713._1
598+ let quoteAssetReserveAfter = $t02540225713._2
599+ let baseAssetReserveAfter = $t02540225713._3
600+ let totalPositionSizeAfter = $t02540225713._4
601+ let cumulativeNotionalAfter = $t02540225713._5
602+ let totalLongAfter = $t02540225713._6
603+ let totalShortAfter = $t02540225713._7
574604 let openInterestNotionalAfter = (openInterestNotional() - positionOpenNotional)
575605 $Tuple12(exchangedPositionSize, badDebt, realizedPnl, marginToVault, quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, exchangedQuoteAssetAmount, totalLongAfter, totalShortAfter)
576606 }
648678
649679 func getAdjustedFee (i) = {
650680 let baseFee = fee()
651- let $t02806228670 = if ((size(i.payments) > 1))
681+ let $t02937629984 = if ((size(i.payments) > 1))
652682 then {
653683 let artifactId = toBase58String(valueOrErrorMessage(i.payments[1].assetId, "Invalid attached artifact"))
654684 let artifactKind = strA(nftManagerAddress(), toCompositeKey(k_token_type, artifactId))
661691 else throw("Invalid attached artifact")
662692 }
663693 else $Tuple2(baseFee, false)
664- let adjustedFee = $t02806228670._1
665- let burnArtifact = $t02806228670._2
694+ let adjustedFee = $t02937629984._1
695+ let burnArtifact = $t02937629984._2
666696 $Tuple2(adjustedFee, burnArtifact)
667697 }
668698
671701
672702
673703 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)]
704+
705+
706+func updatePositionAsset (_address,_assetId) = [StringEntry(toCompositeKey(k_positionAsset, _address), _assetId)]
674707
675708
676709 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)]
712745 else ((updateAmmReserves(_qtAstR, _bsAstR) ++ [IntegerEntry(k_totalPositionSize, _totalPositionSizeAfter), IntegerEntry(k_cumulativeNotional, _cumulativeNotionalAfter), IntegerEntry(k_openInterestNotional, _openInterestNotional), IntegerEntry(k_totalLongPositionSize, _totalLongPositionSize), IntegerEntry(k_totalShortPositionSize, _totalShortPositionSize)]) ++ appendTwap(divd(_qtAstR, _bsAstR)))
713746
714747
715-func deletePosition (_address) = [DeleteEntry(toCompositeKey(k_positionSize, _address)), DeleteEntry(toCompositeKey(k_positionMargin, _address)), DeleteEntry(toCompositeKey(k_positionOpenNotional, _address)), DeleteEntry(toCompositeKey(k_positionLastUpdatedCumulativePremiumFraction, _address)), IntegerEntry(toCompositeKey(k_positionClosedDate, _address), lastBlock.timestamp)]
748+func deletePosition (_address) = [DeleteEntry(toCompositeKey(k_positionSize, _address)), DeleteEntry(toCompositeKey(k_positionMargin, _address)), DeleteEntry(toCompositeKey(k_positionOpenNotional, _address)), DeleteEntry(toCompositeKey(k_positionLastUpdatedCumulativePremiumFraction, _address)), DeleteEntry(toCompositeKey(k_positionAsset, _address)), IntegerEntry(toCompositeKey(k_positionClosedDate, _address), lastBlock.timestamp)]
716749
717750
718751 func withdraw (_address,_amount) = {
734767 func doBurnArtifact (_burnArtifact,i) = if (_burnArtifact)
735768 then [Burn(valueOrErrorMessage(i.payments[1].assetId, "Invalid artifact"), 1)]
736769 else nil
770+
771+
772+func isSameAssetOrNoPosition (_trader,_assetId) = {
773+ let oldPositionSize = getPosition(_trader)._1
774+ if ((oldPositionSize == 0))
775+ then true
776+ else (getPositionAsset(_trader) == _assetId)
777+ }
778+
779+
780+func isSameAsset (_trader,_assetId) = (getPositionAsset(_trader) == _assetId)
781+
782+
783+func getBorrowedByTraderInMarketKey (_amm,_assetId,_trader) = ((((((k_trader_market_asset_collateral + "_") + _amm) + "_") + _assetId) + "_") + _trader)
784+
785+
786+func getBorrowedByTrader (_trader) = {
787+ let positionAsset = getPositionAsset(_trader)
788+ if ((positionAsset == toBase58String(quoteAsset())))
789+ then $Tuple2(0, positionAsset)
790+ else {
791+ let key = getBorrowedByTraderInMarketKey(toString(this), positionAsset, _trader)
792+ let borrow = valueOrElse(getInteger(collateralAddress(), key), 0)
793+ $Tuple2(borrow, positionAsset)
794+ }
795+ }
737796
738797
739798 @Callable(i)
841900 else paused())
842901 then throw("Invalid decreasePosition parameters")
843902 else {
844- let $t03908539237 = getPosition(toString(i.caller))
845- let oldPositionSize = $t03908539237._1
846- let oldPositionMargin = $t03908539237._2
847- let oldPositionOpenNotional = $t03908539237._3
848- let oldPositionLstUpdCPF = $t03908539237._4
903+ let $t04149241644 = getPosition(toString(i.caller))
904+ let oldPositionSize = $t04149241644._1
905+ let oldPositionMargin = $t04149241644._2
906+ let oldPositionOpenNotional = $t04149241644._3
907+ let oldPositionLstUpdCPF = $t04149241644._4
849908 let _direction = if ((oldPositionSize > 0))
850909 then DIR_SHORT
851910 else DIR_LONG
852911 let isAdd = (_direction == DIR_LONG)
853912 let openNotional = muld(_amount, _leverage)
854- let $t03941039526 = getPositionNotionalAndUnrealizedPnl(toString(i.caller), PNL_OPTION_SPOT)
855- let oldPositionNotional = $t03941039526._1
856- let unrealizedPnl = $t03941039526._2
857- let $t03953242081 = if ((oldPositionNotional > openNotional))
913+ let $t04181741933 = getPositionNotionalAndUnrealizedPnl(toString(i.caller), PNL_OPTION_SPOT)
914+ let oldPositionNotional = $t04181741933._1
915+ let unrealizedPnl = $t04181741933._2
916+ let $t04193944488 = if ((oldPositionNotional > openNotional))
858917 then {
859- let $t03990940128 = swapInput(isAdd, openNotional)
860- let exchangedPositionSize = $t03990940128._1
861- let quoteAssetReserveAfter = $t03990940128._2
862- let baseAssetReserveAfter = $t03990940128._3
863- let totalPositionSizeAfter = $t03990940128._4
864- let cumulativeNotionalAfter = $t03990940128._5
918+ let $t04231642535 = swapInput(isAdd, openNotional)
919+ let exchangedPositionSize = $t04231642535._1
920+ let quoteAssetReserveAfter = $t04231642535._2
921+ let baseAssetReserveAfter = $t04231642535._3
922+ let totalPositionSizeAfter = $t04231642535._4
923+ let cumulativeNotionalAfter = $t04231642535._5
865924 let exchangedPositionSizeAbs = abs(exchangedPositionSize)
866925 if (if ((_minBaseAssetAmount != 0))
867926 then (_minBaseAssetAmount > exchangedPositionSizeAbs)
869928 then throw(((("Too little base asset exchanged, got " + toString(exchangedPositionSizeAbs)) + " expected ") + toString(_minBaseAssetAmount)))
870929 else {
871930 let realizedPnl = divd(muld(unrealizedPnl, exchangedPositionSizeAbs), abs(oldPositionSize))
872- let $t04056540810 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, realizedPnl)
873- let remainMargin = $t04056540810._1
874- let badDebt = $t04056540810._2
875- let fundingPayment = $t04056540810._3
931+ let $t04297243217 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, realizedPnl)
932+ let remainMargin = $t04297243217._1
933+ let badDebt = $t04297243217._2
934+ let fundingPayment = $t04297243217._3
876935 let exchangedQuoteAssetAmount = openNotional
877936 let unrealizedPnlAfter = (unrealizedPnl - realizedPnl)
878937 let remainOpenNotional = if ((oldPositionSize > 0))
887946 }
888947 }
889948 else throw("Close position first")
890- let newPositionSize = $t03953242081._1
891- let newPositionRemainMargin = $t03953242081._2
892- let newPositionOpenNotional = $t03953242081._3
893- let newPositionLatestCPF = $t03953242081._4
894- let baseAssetReserveAfter = $t03953242081._5
895- let quoteAssetReserveAfter = $t03953242081._6
896- let totalPositionSizeAfter = $t03953242081._7
897- let cumulativeNotionalAfter = $t03953242081._8
898- let openInterestNotionalAfter = $t03953242081._9
899- let totalLongAfter = $t03953242081._10
900- let totalShortAfter = $t03953242081._11
949+ let newPositionSize = $t04193944488._1
950+ let newPositionRemainMargin = $t04193944488._2
951+ let newPositionOpenNotional = $t04193944488._3
952+ let newPositionLatestCPF = $t04193944488._4
953+ let baseAssetReserveAfter = $t04193944488._5
954+ let quoteAssetReserveAfter = $t04193944488._6
955+ let totalPositionSizeAfter = $t04193944488._7
956+ let cumulativeNotionalAfter = $t04193944488._8
957+ let openInterestNotionalAfter = $t04193944488._9
958+ let totalLongAfter = $t04193944488._10
959+ let totalShortAfter = $t04193944488._11
901960 let notifyNotional = invoke(minerAddress(), "notifyNotional", [toString(i.caller), newPositionOpenNotional], nil)
902961 if ((notifyNotional == notifyNotional))
903962 then (updatePosition(toString(i.caller), newPositionSize, newPositionRemainMargin, newPositionOpenNotional, newPositionLatestCPF) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter))
908967
909968 @Callable(i)
910969 func increasePosition (_direction,_leverage,_minBaseAssetAmount,_refLink) = {
970+ let _trader = toString(i.caller)
911971 let _rawAmount = i.payments[0].amount
912- if (if (if (if (if (if (if ((_direction != DIR_LONG))
972+ let _assetId = i.payments[0].assetId
973+ let _assetIdStr = toBase58String(value(_assetId))
974+ let isQuoteAsset = (_assetId == quoteAsset())
975+ let isCollateralAsset = isWhitelistAsset(_assetIdStr)
976+ if (if (if (if (if (if (if (if ((_direction != DIR_LONG))
913977 then (_direction != DIR_SHORT)
914978 else false)
915979 then true
917981 then true
918982 else !(initialized()))
919983 then true
920- else (i.payments[0].assetId != quoteAsset()))
984+ else if (!(isQuoteAsset))
985+ then !(isCollateralAsset)
986+ else false)
987+ then true
988+ else !(isSameAssetOrNoPosition(_trader, _assetIdStr)))
921989 then true
922990 else !(requireMoreMarginRatio(divd(DECIMAL_UNIT, _leverage), initMarginRatio(), true)))
923991 then true
924992 else paused())
925993 then throw("Invalid increasePosition parameters")
926994 else {
927- let _trader = toString(i.caller)
928995 let baseFee = fee()
929- let $t04319643247 = getAdjustedFee(i)
930- let adjustedFee = $t04319643247._1
931- let burnArtifact = $t04319643247._2
996+ let $t04585045901 = getAdjustedFee(i)
997+ let adjustedFee = $t04585045901._1
998+ let burnArtifact = $t04585045901._2
932999 let rawFeeAmount = muld(_rawAmount, adjustedFee)
933- let referrerFeeAny = invoke(referralAddress(), "acceptPaymentWithLink", [_trader, _refLink], [AttachedPayment(quoteAsset(), rawFeeAmount)])
934- if ((referrerFeeAny == referrerFeeAny))
1000+ let _amount = (_rawAmount - rawFeeAmount)
1001+ let distributeFeeAmount = if (isCollateralAsset)
9351002 then {
936- let referrerFee = match referrerFeeAny {
937- case x: Int =>
938- x
939- case _ =>
940- throw("Invalid referrerFee")
1003+ let doBorrow = invoke(collateralAddress(), "borrow", [_trader], [AttachedPayment(_assetId, _amount)])
1004+ if ((doBorrow == doBorrow))
1005+ then {
1006+ let balanceBefore = assetBalance(this, quoteAsset())
1007+ if ((balanceBefore == balanceBefore))
1008+ then {
1009+ let doSwap = invoke(swapAddress(), "swap", [toBase58String(quoteAsset()), 0], [AttachedPayment(_assetId, rawFeeAmount)])
1010+ if ((doSwap == doSwap))
1011+ then {
1012+ let balanceAfter = assetBalance(this, quoteAsset())
1013+ if ((balanceAfter == balanceAfter))
1014+ then {
1015+ let exchangedAmount = (balanceAfter - balanceBefore)
1016+ if ((exchangedAmount == exchangedAmount))
1017+ then exchangedAmount
1018+ else throw("Strict value is not equal to itself.")
1019+ }
1020+ else throw("Strict value is not equal to itself.")
1021+ }
1022+ else throw("Strict value is not equal to itself.")
1023+ }
1024+ else throw("Strict value is not equal to itself.")
1025+ }
1026+ else throw("Strict value is not equal to itself.")
9411027 }
942- let _amount = (_rawAmount - rawFeeAmount)
943- let feeAmount = (rawFeeAmount - referrerFee)
944- let $t04369643836 = getPosition(_trader)
945- let oldPositionSize = $t04369643836._1
946- let oldPositionMargin = $t04369643836._2
947- let oldPositionOpenNotional = $t04369643836._3
948- let oldPositionLstUpdCPF = $t04369643836._4
949- let isNewPosition = (oldPositionSize == 0)
950- let isSameDirection = if ((oldPositionSize > 0))
951- then (_direction == DIR_LONG)
952- else (_direction == DIR_SHORT)
953- let expandExisting = if (!(isNewPosition))
954- then isSameDirection
955- else false
956- let isAdd = (_direction == DIR_LONG)
957- let $t04412546710 = if (if (isNewPosition)
958- then true
959- else expandExisting)
1028+ else rawFeeAmount
1029+ if ((distributeFeeAmount == distributeFeeAmount))
1030+ then {
1031+ let referrerFeeAny = invoke(referralAddress(), "acceptPaymentWithLink", [_trader, _refLink], [AttachedPayment(quoteAsset(), distributeFeeAmount)])
1032+ if ((referrerFeeAny == referrerFeeAny))
9601033 then {
961- let openNotional = muld(_amount, _leverage)
962- let $t04454944755 = swapInput(isAdd, openNotional)
963- let amountBaseAssetBought = $t04454944755._1
964- let quoteAssetReserveAfter = $t04454944755._2
965- let baseAssetReserveAfter = $t04454944755._3
966- let totalPositionSizeAfter = $t04454944755._4
967- let cumulativeNotionalAfter = $t04454944755._5
968- if (if ((_minBaseAssetAmount != 0))
969- then (_minBaseAssetAmount > abs(amountBaseAssetBought))
970- else false)
971- then throw(((("Limit error: " + toString(abs(amountBaseAssetBought))) + " < ") + toString(_minBaseAssetAmount)))
1034+ let referrerFee = match referrerFeeAny {
1035+ case x: Int =>
1036+ x
1037+ case _ =>
1038+ throw("Invalid referrerFee")
1039+ }
1040+ let feeAmount = (distributeFeeAmount - referrerFee)
1041+ let $t04721747357 = getPosition(_trader)
1042+ let oldPositionSize = $t04721747357._1
1043+ let oldPositionMargin = $t04721747357._2
1044+ let oldPositionOpenNotional = $t04721747357._3
1045+ let oldPositionLstUpdCPF = $t04721747357._4
1046+ let isNewPosition = (oldPositionSize == 0)
1047+ let isSameDirection = if ((oldPositionSize > 0))
1048+ then (_direction == DIR_LONG)
1049+ else (_direction == DIR_SHORT)
1050+ let expandExisting = if (!(isNewPosition))
1051+ then isSameDirection
1052+ else false
1053+ let isAdd = (_direction == DIR_LONG)
1054+ let $t04764650231 = if (if (isNewPosition)
1055+ then true
1056+ else expandExisting)
1057+ then {
1058+ let openNotional = muld(_amount, _leverage)
1059+ let $t04807048276 = swapInput(isAdd, openNotional)
1060+ let amountBaseAssetBought = $t04807048276._1
1061+ let quoteAssetReserveAfter = $t04807048276._2
1062+ let baseAssetReserveAfter = $t04807048276._3
1063+ let totalPositionSizeAfter = $t04807048276._4
1064+ let cumulativeNotionalAfter = $t04807048276._5
1065+ if (if ((_minBaseAssetAmount != 0))
1066+ then (_minBaseAssetAmount > abs(amountBaseAssetBought))
1067+ else false)
1068+ then throw(((("Limit error: " + toString(abs(amountBaseAssetBought))) + " < ") + toString(_minBaseAssetAmount)))
1069+ else {
1070+ let newPositionSize = (oldPositionSize + amountBaseAssetBought)
1071+ let increaseMarginRequirement = divd(openNotional, _leverage)
1072+ let $t04865748896 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, increaseMarginRequirement)
1073+ let remainMargin = $t04865748896._1
1074+ let x1 = $t04865748896._2
1075+ let x2 = $t04865748896._3
1076+ if (!(requireNotOverSpreadLimit(quoteAssetReserveAfter, baseAssetReserveAfter)))
1077+ then throw("Over max spread limit")
1078+ else $Tuple11(newPositionSize, remainMargin, (oldPositionOpenNotional + openNotional), latestCumulativePremiumFraction(newPositionSize), baseAssetReserveAfter, quoteAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, (openInterestNotional() + openNotional), (totalLongPositionSize() + (if ((newPositionSize > 0))
1079+ then abs(amountBaseAssetBought)
1080+ else 0)), (totalShortPositionSize() + (if ((0 > newPositionSize))
1081+ then abs(amountBaseAssetBought)
1082+ else 0)))
1083+ }
1084+ }
9721085 else {
973- let newPositionSize = (oldPositionSize + amountBaseAssetBought)
974- let increaseMarginRequirement = divd(openNotional, _leverage)
975- let $t04513645375 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, increaseMarginRequirement)
976- let remainMargin = $t04513645375._1
977- let x1 = $t04513645375._2
978- let x2 = $t04513645375._3
979- if (!(requireNotOverSpreadLimit(quoteAssetReserveAfter, baseAssetReserveAfter)))
980- then throw("Over max spread limit")
981- else $Tuple11(newPositionSize, remainMargin, (oldPositionOpenNotional + openNotional), latestCumulativePremiumFraction(newPositionSize), baseAssetReserveAfter, quoteAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, (openInterestNotional() + openNotional), (totalLongPositionSize() + (if ((newPositionSize > 0))
982- then abs(amountBaseAssetBought)
983- else 0)), (totalShortPositionSize() + (if ((0 > newPositionSize))
984- then abs(amountBaseAssetBought)
985- else 0)))
1086+ let openNotional = muld(_amount, _leverage)
1087+ let $t04992450040 = getPositionNotionalAndUnrealizedPnl(toString(i.caller), PNL_OPTION_SPOT)
1088+ let oldPositionNotional = $t04992450040._1
1089+ let unrealizedPnl = $t04992450040._2
1090+ if ((oldPositionNotional > openNotional))
1091+ then throw("Use decreasePosition to decrease position size")
1092+ else throw("Close position first")
9861093 }
987- }
988- else {
989- let openNotional = muld(_amount, _leverage)
990- let $t04640346519 = getPositionNotionalAndUnrealizedPnl(toString(i.caller), PNL_OPTION_SPOT)
991- let oldPositionNotional = $t04640346519._1
992- let unrealizedPnl = $t04640346519._2
993- if ((oldPositionNotional > openNotional))
994- then throw("Use decreasePosition to decrease position size")
995- else throw("Close position first")
996- }
997- let newPositionSize = $t04412546710._1
998- let newPositionRemainMargin = $t04412546710._2
999- let newPositionOpenNotional = $t04412546710._3
1000- let newPositionLatestCPF = $t04412546710._4
1001- let baseAssetReserveAfter = $t04412546710._5
1002- let quoteAssetReserveAfter = $t04412546710._6
1003- let totalPositionSizeAfter = $t04412546710._7
1004- let cumulativeNotionalAfter = $t04412546710._8
1005- let openInterestNotionalAfter = $t04412546710._9
1006- let totalLongAfter = $t04412546710._10
1007- let totalShortAfter = $t04412546710._11
1008- let feeToStakers = (feeAmount / 2)
1009- let feeToInsurance = (feeAmount - feeToStakers)
1010- let stake = invoke(managerAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), _amount)])
1011- if ((stake == stake))
1012- then {
1013- let depositInsurance = invoke(insuranceAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), feeToInsurance)])
1014- if ((depositInsurance == depositInsurance))
1094+ let newPositionSize = $t04764650231._1
1095+ let newPositionRemainMargin = $t04764650231._2
1096+ let newPositionOpenNotional = $t04764650231._3
1097+ let newPositionLatestCPF = $t04764650231._4
1098+ let baseAssetReserveAfter = $t04764650231._5
1099+ let quoteAssetReserveAfter = $t04764650231._6
1100+ let totalPositionSizeAfter = $t04764650231._7
1101+ let cumulativeNotionalAfter = $t04764650231._8
1102+ let openInterestNotionalAfter = $t04764650231._9
1103+ let totalLongAfter = $t04764650231._10
1104+ let totalShortAfter = $t04764650231._11
1105+ let feeToStakers = (feeAmount / 2)
1106+ let feeToInsurance = (feeAmount - feeToStakers)
1107+ let stake = invoke(managerAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), _amount)])
1108+ if ((stake == stake))
10151109 then {
1016- let notifyFee = invoke(minerAddress(), "notifyFees", [_trader, feeAmount], nil)
1017- if ((notifyFee == notifyFee))
1110+ let depositInsurance = invoke(insuranceAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), feeToInsurance)])
1111+ if ((depositInsurance == depositInsurance))
10181112 then {
1019- let notifyNotional = invoke(minerAddress(), "notifyNotional", [_trader, newPositionOpenNotional], nil)
1020- if ((notifyNotional == notifyNotional))
1021- then ((((updatePosition(_trader, newPositionSize, newPositionRemainMargin, newPositionOpenNotional, newPositionLatestCPF) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter)) ++ transferFee(feeToStakers)) ++ updateBalance((cbalance() + _amount))) ++ doBurnArtifact(burnArtifact, i))
1113+ let notifyFee = invoke(minerAddress(), "notifyFees", [_trader, feeAmount], nil)
1114+ if ((notifyFee == notifyFee))
1115+ then {
1116+ let notifyNotional = invoke(minerAddress(), "notifyNotional", [_trader, newPositionOpenNotional], nil)
1117+ if ((notifyNotional == notifyNotional))
1118+ then (((((updatePosition(_trader, newPositionSize, newPositionRemainMargin, newPositionOpenNotional, newPositionLatestCPF) ++ updatePositionAsset(_trader, _assetIdStr)) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter)) ++ transferFee(feeToStakers)) ++ updateBalance((cbalance() + _amount))) ++ doBurnArtifact(burnArtifact, i))
1119+ else throw("Strict value is not equal to itself.")
1120+ }
10221121 else throw("Strict value is not equal to itself.")
10231122 }
10241123 else throw("Strict value is not equal to itself.")
10351134
10361135 @Callable(i)
10371136 func addMargin () = {
1137+ let _trader = toString(i.caller)
10381138 let _rawAmount = i.payments[0].amount
1039- if (if (if (if ((i.payments[0].assetId != quoteAsset()))
1139+ let _assetId = i.payments[0].assetId
1140+ let _assetIdStr = toBase58String(value(_assetId))
1141+ let isQuoteAsset = (_assetId == quoteAsset())
1142+ let isCollateralAsset = isWhitelistAsset(_assetIdStr)
1143+ if (if (if (if (if (if (!(isQuoteAsset))
1144+ then !(isCollateralAsset)
1145+ else false)
10401146 then true
10411147 else !(requireOpenPosition(toString(i.caller))))
1148+ then true
1149+ else !(isSameAsset(_trader, _assetIdStr)))
10421150 then true
10431151 else !(initialized()))
10441152 then true
10451153 else paused())
10461154 then throw("Invalid addMargin parameters")
10471155 else {
1048- let _trader = toString(i.caller)
1049- let $t04817848229 = getAdjustedFee(i)
1050- let adjustedFee = $t04817848229._1
1051- let burnArtifact = $t04817848229._2
1156+ let $t05198752038 = getAdjustedFee(i)
1157+ let adjustedFee = $t05198752038._1
1158+ let burnArtifact = $t05198752038._2
10521159 let rawFeeAmount = muld(_rawAmount, adjustedFee)
1053- let referrerFeeAny = invoke(referralAddress(), "acceptPayment", [_trader], [AttachedPayment(quoteAsset(), rawFeeAmount)])
1054- if ((referrerFeeAny == referrerFeeAny))
1160+ let _amount = (_rawAmount - rawFeeAmount)
1161+ let distributeFeeAmount = if (isCollateralAsset)
10551162 then {
1056- let referrerFee = match referrerFeeAny {
1057- case x: Int =>
1058- x
1059- case _ =>
1060- throw("Invalid referrerFee")
1163+ let doBorrow = invoke(collateralAddress(), "borrow", [_trader], [AttachedPayment(_assetId, _amount)])
1164+ if ((doBorrow == doBorrow))
1165+ then {
1166+ let balanceBefore = assetBalance(this, quoteAsset())
1167+ if ((balanceBefore == balanceBefore))
1168+ then {
1169+ let doSwap = invoke(swapAddress(), "swap", [toBase58String(quoteAsset()), 0], [AttachedPayment(_assetId, rawFeeAmount)])
1170+ if ((doSwap == doSwap))
1171+ then {
1172+ let balanceAfter = assetBalance(this, quoteAsset())
1173+ if ((balanceAfter == balanceAfter))
1174+ then {
1175+ let exchangedAmount = (balanceAfter - balanceBefore)
1176+ if ((exchangedAmount == exchangedAmount))
1177+ then exchangedAmount
1178+ else throw("Strict value is not equal to itself.")
1179+ }
1180+ else throw("Strict value is not equal to itself.")
1181+ }
1182+ else throw("Strict value is not equal to itself.")
1183+ }
1184+ else throw("Strict value is not equal to itself.")
1185+ }
1186+ else throw("Strict value is not equal to itself.")
10611187 }
1062- let feeAmount = (rawFeeAmount - referrerFee)
1063- let _amount = (_rawAmount - rawFeeAmount)
1064- let $t04866148801 = getPosition(_trader)
1065- let oldPositionSize = $t04866148801._1
1066- let oldPositionMargin = $t04866148801._2
1067- let oldPositionOpenNotional = $t04866148801._3
1068- let oldPositionLstUpdCPF = $t04866148801._4
1069- let feeToStakers = (feeAmount / 2)
1070- let feeToInsurance = (feeAmount - feeToStakers)
1071- let stake = invoke(managerAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), _amount)])
1072- if ((stake == stake))
1188+ else rawFeeAmount
1189+ if ((distributeFeeAmount == distributeFeeAmount))
1190+ then {
1191+ let referrerFeeAny = invoke(referralAddress(), "acceptPayment", [_trader], [AttachedPayment(quoteAsset(), distributeFeeAmount)])
1192+ if ((referrerFeeAny == referrerFeeAny))
10731193 then {
1074- let depositInsurance = invoke(insuranceAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), feeToInsurance)])
1075- if ((depositInsurance == depositInsurance))
1194+ let referrerFee = match referrerFeeAny {
1195+ case x: Int =>
1196+ x
1197+ case _ =>
1198+ throw("Invalid referrerFee")
1199+ }
1200+ let feeAmount = (distributeFeeAmount - referrerFee)
1201+ let $t05333753477 = getPosition(_trader)
1202+ let oldPositionSize = $t05333753477._1
1203+ let oldPositionMargin = $t05333753477._2
1204+ let oldPositionOpenNotional = $t05333753477._3
1205+ let oldPositionLstUpdCPF = $t05333753477._4
1206+ let feeToStakers = (feeAmount / 2)
1207+ let feeToInsurance = (feeAmount - feeToStakers)
1208+ let stake = invoke(managerAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), _amount)])
1209+ if ((stake == stake))
10761210 then {
1077- let notifyFee = invoke(minerAddress(), "notifyFees", [_trader, feeAmount], nil)
1078- if ((notifyFee == notifyFee))
1079- then (((updatePosition(_trader, oldPositionSize, (oldPositionMargin + _amount), oldPositionOpenNotional, oldPositionLstUpdCPF) ++ transferFee(feeToStakers)) ++ updateBalance((cbalance() + _amount))) ++ doBurnArtifact(burnArtifact, i))
1211+ let depositInsurance = invoke(insuranceAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), feeToInsurance)])
1212+ if ((depositInsurance == depositInsurance))
1213+ then {
1214+ let notifyFee = invoke(minerAddress(), "notifyFees", [_trader, feeAmount], nil)
1215+ if ((notifyFee == notifyFee))
1216+ then (((updatePosition(_trader, oldPositionSize, (oldPositionMargin + _amount), oldPositionOpenNotional, oldPositionLstUpdCPF) ++ transferFee(feeToStakers)) ++ updateBalance((cbalance() + _amount))) ++ doBurnArtifact(burnArtifact, i))
1217+ else throw("Strict value is not equal to itself.")
1218+ }
10801219 else throw("Strict value is not equal to itself.")
10811220 }
10821221 else throw("Strict value is not equal to itself.")
10901229
10911230
10921231 @Callable(i)
1093-func removeMargin (_amount) = if (if (if (if ((0 >= _amount))
1094- then true
1095- else !(requireOpenPosition(toString(i.caller))))
1096- then true
1097- else !(initialized()))
1098- then true
1099- else paused())
1100- then throw("Invalid removeMargin parameters")
1101- else {
1102- let $t04982049972 = getPosition(toString(i.caller))
1103- let oldPositionSize = $t04982049972._1
1104- let oldPositionMargin = $t04982049972._2
1105- let oldPositionOpenNotional = $t04982049972._3
1106- let oldPositionLstUpdCPF = $t04982049972._4
1107- let marginDelta = -(_amount)
1108- let $t05000950188 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, marginDelta)
1109- let remainMargin = $t05000950188._1
1110- let badDebt = $t05000950188._2
1111- if ((badDebt != 0))
1112- then throw("Invalid removed margin amount")
1113- else {
1114- let marginRatio = calcMarginRatio(remainMargin, badDebt, oldPositionOpenNotional)
1115- if (!(requireMoreMarginRatio(marginRatio, initMarginRatio(), true)))
1116- then throw(((("Too much margin removed: " + toString(marginRatio)) + " < ") + toString(initMarginRatio())))
1117- else {
1118- let unstake = invoke(managerAddress(), "withdraw", [toBase58String(quoteAsset()), _amount], nil)
1119- if ((unstake == unstake))
1120- then ((updatePosition(toString(i.caller), oldPositionSize, remainMargin, oldPositionOpenNotional, latestCumulativePremiumFraction(oldPositionSize)) ++ withdraw(i.caller, _amount)) ++ updateBalance((cbalance() - _amount)))
1121- else throw("Strict value is not equal to itself.")
1122- }
1123- }
1124- }
1232+func removeMargin (_amount) = {
1233+ let _trader = toString(i.caller)
1234+ if (if (if (if ((0 >= _amount))
1235+ then true
1236+ else !(requireOpenPosition(_trader)))
1237+ then true
1238+ else !(initialized()))
1239+ then true
1240+ else paused())
1241+ then throw("Invalid removeMargin parameters")
1242+ else {
1243+ let $t05452054660 = getPosition(_trader)
1244+ let oldPositionSize = $t05452054660._1
1245+ let oldPositionMargin = $t05452054660._2
1246+ let oldPositionOpenNotional = $t05452054660._3
1247+ let oldPositionLstUpdCPF = $t05452054660._4
1248+ let marginDelta = -(_amount)
1249+ let $t05469754876 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, marginDelta)
1250+ let remainMargin = $t05469754876._1
1251+ let badDebt = $t05469754876._2
1252+ if ((badDebt != 0))
1253+ then throw("Invalid removed margin amount")
1254+ else {
1255+ let marginRatio = calcMarginRatio(remainMargin, badDebt, oldPositionOpenNotional)
1256+ if (!(requireMoreMarginRatio(marginRatio, initMarginRatio(), true)))
1257+ then throw(((("Too much margin removed: " + toString(marginRatio)) + " < ") + toString(initMarginRatio())))
1258+ else {
1259+ let quoteAssetStr = toBase58String(quoteAsset())
1260+ let $t05532055374 = getBorrowedByTrader(_trader)
1261+ let borrowed = $t05532055374._1
1262+ let assetId = $t05532055374._2
1263+ let toRepay = if ((_amount > borrowed))
1264+ then borrowed
1265+ else _amount
1266+ let toWithdraw = if ((borrowed > _amount))
1267+ then 0
1268+ else (_amount - borrowed)
1269+ let finalBorrow = (borrowed - toRepay)
1270+ let switchPositionToQuote = if ((finalBorrow > 0))
1271+ then nil
1272+ else updatePositionAsset(_trader, quoteAssetStr)
1273+ let doSanityCheck = if (((toRepay + toWithdraw) != _amount))
1274+ then throw(((((("toRepay=" + toString(toRepay)) + " + toWithdraw=") + toString(toWithdraw)) + " != ") + toString(_amount)))
1275+ else nil
1276+ if ((doSanityCheck == doSanityCheck))
1277+ then {
1278+ let doUnstake = invoke(managerAddress(), "withdraw", [quoteAssetStr, _amount], nil)
1279+ if ((doUnstake == doUnstake))
1280+ then {
1281+ let returnCollateralAction = if ((toRepay > 0))
1282+ then {
1283+ let doRepay = invoke(collateralAddress(), "repay", [_trader, assetId], [AttachedPayment(quoteAsset(), toRepay)])
1284+ if ((doRepay == doRepay))
1285+ then [ScriptTransfer(i.caller, toRepay, fromBase58String(assetId))]
1286+ else throw("Strict value is not equal to itself.")
1287+ }
1288+ else nil
1289+ if ((returnCollateralAction == returnCollateralAction))
1290+ then (updatePosition(_trader, oldPositionSize, remainMargin, oldPositionOpenNotional, latestCumulativePremiumFraction(oldPositionSize)) ++ (if ((toWithdraw > 0))
1291+ then withdraw(i.caller, toWithdraw)
1292+ else (((nil ++ updateBalance((cbalance() - _amount))) ++ switchPositionToQuote) ++ returnCollateralAction)))
1293+ else throw("Strict value is not equal to itself.")
1294+ }
1295+ else throw("Strict value is not equal to itself.")
1296+ }
1297+ else throw("Strict value is not equal to itself.")
1298+ }
1299+ }
1300+ }
1301+ }
11251302
11261303
11271304
11281305 @Callable(i)
11291306 func closePosition () = {
1130- let caller = getActualCaller(i)
1131- let callerAddress = valueOrErrorMessage(addressFromString(caller), "Invalid caller")
1132- if (if (if (!(requireOpenPosition(caller)))
1307+ let _trader = getActualCaller(i)
1308+ let _traderAddress = valueOrErrorMessage(addressFromString(_trader), "Invalid caller")
1309+ if (if (if (!(requireOpenPosition(_trader)))
11331310 then true
11341311 else !(initialized()))
11351312 then true
11361313 else paused())
11371314 then throw("Invalid closePosition parameters")
11381315 else {
1139- let $t05138251759 = internalClosePosition(caller, true)
1140- let x1 = $t05138251759._1
1141- let positionBadDebt = $t05138251759._2
1142- let realizedPnl = $t05138251759._3
1143- let marginToVault = $t05138251759._4
1144- let quoteAssetReserveAfter = $t05138251759._5
1145- let baseAssetReserveAfter = $t05138251759._6
1146- let totalPositionSizeAfter = $t05138251759._7
1147- let cumulativeNotionalAfter = $t05138251759._8
1148- let openInterestNotionalAfter = $t05138251759._9
1149- let x2 = $t05138251759._10
1150- let totalLongAfter = $t05138251759._11
1151- let totalShortAfter = $t05138251759._12
1316+ let $t05756657944 = internalClosePosition(_trader, true)
1317+ let x1 = $t05756657944._1
1318+ let positionBadDebt = $t05756657944._2
1319+ let realizedPnl = $t05756657944._3
1320+ let marginToVault = $t05756657944._4
1321+ let quoteAssetReserveAfter = $t05756657944._5
1322+ let baseAssetReserveAfter = $t05756657944._6
1323+ let totalPositionSizeAfter = $t05756657944._7
1324+ let cumulativeNotionalAfter = $t05756657944._8
1325+ let openInterestNotionalAfter = $t05756657944._9
1326+ let x2 = $t05756657944._10
1327+ let totalLongAfter = $t05756657944._11
1328+ let totalShortAfter = $t05756657944._12
11521329 if ((positionBadDebt > 0))
11531330 then throw("Unable to close position with bad debt")
11541331 else {
11551332 let withdrawAmount = abs(marginToVault)
11561333 let ammBalance = (cbalance() - withdrawAmount)
1157- let $t05196852110 = if ((0 > ammBalance))
1334+ let $t05815358295 = if ((0 > ammBalance))
11581335 then $Tuple2(0, abs(ammBalance))
11591336 else $Tuple2(ammBalance, 0)
1160- let ammNewBalance = $t05196852110._1
1161- let getFromInsurance = $t05196852110._2
1337+ let ammNewBalance = $t05815358295._1
1338+ let getFromInsurance = $t05815358295._2
11621339 let x = if ((getFromInsurance > 0))
11631340 then {
11641341 let withdrawInsurance = invoke(insuranceAddress(), "withdraw", [getFromInsurance], nil)
11721349 let unstake = invoke(managerAddress(), "withdraw", [toBase58String(quoteAsset()), (withdrawAmount - getFromInsurance)], nil)
11731350 if ((unstake == unstake))
11741351 then {
1175- let notifyNotional = invoke(minerAddress(), "notifyNotional", [caller, 0], nil)
1176- if ((notifyNotional == notifyNotional))
1177- then (((deletePosition(caller) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter)) ++ withdraw(callerAddress, withdrawAmount)) ++ updateBalance(ammNewBalance))
1352+ let $t05879758851 = getBorrowedByTrader(_trader)
1353+ let borrowed = $t05879758851._1
1354+ let assetId = $t05879758851._2
1355+ let $t05886659783 = if ((borrowed > 0))
1356+ then if ((withdrawAmount >= borrowed))
1357+ then {
1358+ let doRepay = invoke(collateralAddress(), "repay", [_trader, assetId], [AttachedPayment(quoteAsset(), borrowed)])
1359+ if ((doRepay == doRepay))
1360+ then $Tuple2([ScriptTransfer(_traderAddress, borrowed, fromBase58String(assetId))], (withdrawAmount - borrowed))
1361+ else throw("Strict value is not equal to itself.")
1362+ }
1363+ else {
1364+ let realizeAndClose = invoke(collateralAddress(), "realizePartiallyAndClose", [_trader, assetId], [AttachedPayment(quoteAsset(), withdrawAmount)])
1365+ if ((realizeAndClose == realizeAndClose))
1366+ then $Tuple2([ScriptTransfer(_traderAddress, withdrawAmount, fromBase58String(assetId))], 0)
1367+ else throw("Strict value is not equal to itself.")
1368+ }
1369+ else $Tuple2(nil, withdrawAmount)
1370+ if (($t05886659783 == $t05886659783))
1371+ then {
1372+ let quoteWithdrawAmount = $t05886659783._2
1373+ let sendCollateralAction = $t05886659783._1
1374+ let notifyNotional = invoke(minerAddress(), "notifyNotional", [_trader, 0], nil)
1375+ if ((notifyNotional == notifyNotional))
1376+ then ((deletePosition(_trader) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter)) ++ (if ((quoteWithdrawAmount > 0))
1377+ then withdraw(_traderAddress, quoteWithdrawAmount)
1378+ else ((nil ++ updateBalance(ammNewBalance)) ++ sendCollateralAction)))
1379+ else throw("Strict value is not equal to itself.")
1380+ }
11781381 else throw("Strict value is not equal to itself.")
11791382 }
11801383 else throw("Strict value is not equal to itself.")
12091412 then (DECIMAL_UNIT > partialLiquidationRatio())
12101413 else false)
12111414 then {
1212- let $t05418154331 = getPosition(_trader)
1213- let oldPositionSize = $t05418154331._1
1214- let oldPositionMargin = $t05418154331._2
1215- let oldPositionOpenNotional = $t05418154331._3
1216- let oldPositionLstUpdCPF = $t05418154331._4
1415+ let $t06148361633 = getPosition(_trader)
1416+ let oldPositionSize = $t06148361633._1
1417+ let oldPositionMargin = $t06148361633._2
1418+ let oldPositionOpenNotional = $t06148361633._3
1419+ let oldPositionLstUpdCPF = $t06148361633._4
12171420 let _direction = if ((oldPositionSize > 0))
12181421 then DIR_SHORT
12191422 else DIR_LONG
12201423 let isAdd = (_direction == DIR_LONG)
12211424 let exchangedQuoteAssetAmount = getPartialLiquidationAmount(_trader, oldPositionSize)
1222- let $t05455654660 = getPositionNotionalAndUnrealizedPnl(_trader, PNL_OPTION_SPOT)
1223- let oldPositionNotional = $t05455654660._1
1224- let unrealizedPnl = $t05455654660._2
1225- let $t05466854958 = swapInput(isAdd, exchangedQuoteAssetAmount)
1226- let exchangedPositionSize = $t05466854958._1
1227- let quoteAssetReserveAfter = $t05466854958._2
1228- let baseAssetReserveAfter = $t05466854958._3
1229- let totalPositionSizeAfter = $t05466854958._4
1230- let cumulativeNotionalAfter = $t05466854958._5
1231- let realizedPnl = divd(muld(unrealizedPnl, abs(exchangedPositionSize)), abs(oldPositionSize))
1232- let $t05506555298 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, realizedPnl)
1233- let remainMargin = $t05506555298._1
1234- let badDebt = $t05506555298._2
1235- let fundingPayment = $t05506555298._3
1425+ let $t06185861962 = getPositionNotionalAndUnrealizedPnl(_trader, PNL_OPTION_SPOT)
1426+ let oldPositionNotional = $t06185861962._1
1427+ let unrealizedPnl = $t06185861962._2
1428+ let $t06197062202 = swapInput(isAdd, exchangedQuoteAssetAmount)
1429+ let exchangedPositionSize = $t06197062202._1
1430+ let quoteAssetReserveAfter = $t06197062202._2
1431+ let baseAssetReserveAfter = $t06197062202._3
1432+ let totalPositionSizeAfter = $t06197062202._4
1433+ let cumulativeNotionalAfter = $t06197062202._5
1434+ let liquidationRatio = divd(abs(exchangedPositionSize), abs(oldPositionSize))
1435+ let realizedPnl = muld(unrealizedPnl, liquidationRatio)
1436+ let $t06241362646 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, realizedPnl)
1437+ let remainMargin = $t06241362646._1
1438+ let badDebt = $t06241362646._2
1439+ let fundingPayment = $t06241362646._3
12361440 let unrealizedPnlAfter = (unrealizedPnl - realizedPnl)
12371441 let remainOpenNotional = if ((oldPositionSize > 0))
12381442 then ((oldPositionNotional - exchangedQuoteAssetAmount) - unrealizedPnlAfter)
12461450 let newPositionLstUpdCPF = latestCumulativePremiumFraction(newPositionSize)
12471451 let openInterestNotionalAfter = (openInterestNotional() - exchangedQuoteAssetAmount)
12481452 let ammBalance = (cbalance() - liquidationPenalty)
1249- let $t05647156614 = if ((0 > ammBalance))
1453+ let $t06381963962 = if ((0 > ammBalance))
12501454 then $Tuple2(0, abs(ammBalance))
12511455 else $Tuple2(ammBalance, 0)
1252- let newAmmBalance = $t05647156614._1
1253- let takeFromInsurance = $t05647156614._2
1254- let x = if ((takeFromInsurance > 0))
1456+ let newAmmBalance = $t06381963962._1
1457+ let takeFromInsurance = $t06381963962._2
1458+ let $t06397064024 = getBorrowedByTrader(_trader)
1459+ let borrowed = $t06397064024._1
1460+ let assetId = $t06397064024._2
1461+ let doLiquidateCollateral = if ((borrowed > 0))
12551462 then {
1256- let withdrawInsurance = invoke(insuranceAddress(), "withdraw", [takeFromInsurance], nil)
1257- if ((withdrawInsurance == withdrawInsurance))
1463+ let collateralToSell = muld(borrowed, liquidationRatio)
1464+ let realizeAndClose = invoke(collateralAddress(), "realizePartially", [_trader, assetId, collateralToSell], nil)
1465+ if ((realizeAndClose == realizeAndClose))
12581466 then nil
12591467 else throw("Strict value is not equal to itself.")
12601468 }
12611469 else nil
1262- if ((x == x))
1470+ if ((doLiquidateCollateral == doLiquidateCollateral))
12631471 then {
1264- let unstake = invoke(managerAddress(), "withdraw", [toBase58String(quoteAsset()), (liquidationPenalty - takeFromInsurance)], nil)
1265- if ((unstake == unstake))
1472+ let x = if ((takeFromInsurance > 0))
12661473 then {
1267- let depositInsurance = invoke(insuranceAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), feeToInsurance)])
1268- if ((depositInsurance == depositInsurance))
1474+ let withdrawInsurance = invoke(insuranceAddress(), "withdraw", [takeFromInsurance], nil)
1475+ if ((withdrawInsurance == withdrawInsurance))
1476+ then nil
1477+ else throw("Strict value is not equal to itself.")
1478+ }
1479+ else nil
1480+ if ((x == x))
1481+ then {
1482+ let unstake = invoke(managerAddress(), "withdraw", [toBase58String(quoteAsset()), (liquidationPenalty - takeFromInsurance)], nil)
1483+ if ((unstake == unstake))
12691484 then {
1270- let notifyNotional = invoke(minerAddress(), "notifyNotional", [_trader, newPositionOpenNotional], nil)
1271- if ((notifyNotional == notifyNotional))
1272- then (((updatePosition(_trader, newPositionSize, newPositionMargin, newPositionOpenNotional, newPositionLstUpdCPF) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, (totalLongPositionSize() - (if ((newPositionSize > 0))
1273- then abs(exchangedPositionSize)
1274- else 0)), (totalShortPositionSize() - (if ((0 > newPositionSize))
1275- then abs(exchangedPositionSize)
1276- else 0)))) ++ withdraw(i.caller, feeToLiquidator)) ++ updateBalance(newAmmBalance))
1485+ let depositInsurance = invoke(insuranceAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), feeToInsurance)])
1486+ if ((depositInsurance == depositInsurance))
1487+ then {
1488+ let notifyNotional = invoke(minerAddress(), "notifyNotional", [_trader, newPositionOpenNotional], nil)
1489+ if ((notifyNotional == notifyNotional))
1490+ then (((updatePosition(_trader, newPositionSize, newPositionMargin, newPositionOpenNotional, newPositionLstUpdCPF) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, (totalLongPositionSize() - (if ((newPositionSize > 0))
1491+ then abs(exchangedPositionSize)
1492+ else 0)), (totalShortPositionSize() - (if ((0 > newPositionSize))
1493+ then abs(exchangedPositionSize)
1494+ else 0)))) ++ withdraw(i.caller, feeToLiquidator)) ++ updateBalance(newAmmBalance))
1495+ else throw("Strict value is not equal to itself.")
1496+ }
12771497 else throw("Strict value is not equal to itself.")
12781498 }
12791499 else throw("Strict value is not equal to itself.")
12831503 else throw("Strict value is not equal to itself.")
12841504 }
12851505 else {
1286- let $t05806158516 = internalClosePosition(_trader, false)
1287- let x1 = $t05806158516._1
1288- let badDebt = $t05806158516._2
1289- let x2 = $t05806158516._3
1290- let x3 = $t05806158516._4
1291- let quoteAssetReserveAfter = $t05806158516._5
1292- let baseAssetReserveAfter = $t05806158516._6
1293- let totalPositionSizeAfter = $t05806158516._7
1294- let cumulativeNotionalAfter = $t05806158516._8
1295- let openInterestNotionalAfter = $t05806158516._9
1296- let exchangedQuoteAssetAmount = $t05806158516._10
1297- let totalLongAfter = $t05806158516._11
1298- let totalShortAfter = $t05806158516._12
1506+ let $t06586666321 = internalClosePosition(_trader, false)
1507+ let x1 = $t06586666321._1
1508+ let badDebt = $t06586666321._2
1509+ let x2 = $t06586666321._3
1510+ let x3 = $t06586666321._4
1511+ let quoteAssetReserveAfter = $t06586666321._5
1512+ let baseAssetReserveAfter = $t06586666321._6
1513+ let totalPositionSizeAfter = $t06586666321._7
1514+ let cumulativeNotionalAfter = $t06586666321._8
1515+ let openInterestNotionalAfter = $t06586666321._9
1516+ let exchangedQuoteAssetAmount = $t06586666321._10
1517+ let totalLongAfter = $t06586666321._11
1518+ let totalShortAfter = $t06586666321._12
12991519 let liquidationPenalty = muld(exchangedQuoteAssetAmount, liquidationFeeRatio())
13001520 let feeToLiquidator = (liquidationPenalty / 2)
13011521 let feeToInsurance = (liquidationPenalty - feeToLiquidator)
13021522 let ammBalance = (cbalance() - liquidationPenalty)
1303- let $t05892859071 = if ((0 > ammBalance))
1523+ let $t06673366876 = if ((0 > ammBalance))
13041524 then $Tuple2(0, abs(ammBalance))
13051525 else $Tuple2(ammBalance, 0)
1306- let newAmmBalance = $t05892859071._1
1307- let takeFromInsurance = $t05892859071._2
1308- let x = if ((takeFromInsurance > 0))
1526+ let newAmmBalance = $t06673366876._1
1527+ let takeFromInsurance = $t06673366876._2
1528+ let $t06688466938 = getBorrowedByTrader(_trader)
1529+ let borrowed = $t06688466938._1
1530+ let assetId = $t06688466938._2
1531+ let doLiquidateCollateral = if ((borrowed > 0))
13091532 then {
1310- let withdrawInsurance = invoke(insuranceAddress(), "withdraw", [takeFromInsurance], nil)
1311- if ((withdrawInsurance == withdrawInsurance))
1533+ let realizeAndClose = invoke(collateralAddress(), "realizePartiallyAndClose", [_trader, assetId], nil)
1534+ if ((realizeAndClose == realizeAndClose))
13121535 then nil
13131536 else throw("Strict value is not equal to itself.")
13141537 }
13151538 else nil
1316- if ((x == x))
1539+ if ((doLiquidateCollateral == doLiquidateCollateral))
13171540 then {
1318- let unstake = invoke(managerAddress(), "withdraw", [toBase58String(quoteAsset()), (liquidationPenalty - takeFromInsurance)], nil)
1319- if ((unstake == unstake))
1541+ let x = if ((takeFromInsurance > 0))
13201542 then {
1321- let depositInsurance = invoke(insuranceAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), feeToInsurance)])
1322- if ((depositInsurance == depositInsurance))
1543+ let withdrawInsurance = invoke(insuranceAddress(), "withdraw", [takeFromInsurance], nil)
1544+ if ((withdrawInsurance == withdrawInsurance))
1545+ then nil
1546+ else throw("Strict value is not equal to itself.")
1547+ }
1548+ else nil
1549+ if ((x == x))
1550+ then {
1551+ let unstake = invoke(managerAddress(), "withdraw", [toBase58String(quoteAsset()), (liquidationPenalty - takeFromInsurance)], nil)
1552+ if ((unstake == unstake))
13231553 then {
1324- let notifyNotional = invoke(minerAddress(), "notifyNotional", [_trader, 0], nil)
1325- if ((notifyNotional == notifyNotional))
1326- then (((deletePosition(_trader) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter)) ++ withdraw(i.caller, feeToLiquidator)) ++ updateBalance(newAmmBalance))
1554+ let depositInsurance = invoke(insuranceAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), feeToInsurance)])
1555+ if ((depositInsurance == depositInsurance))
1556+ then {
1557+ let notifyNotional = invoke(minerAddress(), "notifyNotional", [_trader, 0], nil)
1558+ if ((notifyNotional == notifyNotional))
1559+ then (((deletePosition(_trader) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter)) ++ withdraw(i.caller, feeToLiquidator)) ++ updateBalance(newAmmBalance))
1560+ else throw("Strict value is not equal to itself.")
1561+ }
13271562 else throw("Strict value is not equal to itself.")
13281563 }
13291564 else throw("Strict value is not equal to itself.")
13471582 then throw(((("Invalid funding block timestamp: " + toString(lastBlock.timestamp)) + " < ") + toString(fundingBlockTimestamp)))
13481583 else {
13491584 let underlyingPrice = getOracleTwapPrice()
1350- let $t06055760619 = getFunding()
1351- let shortPremiumFraction = $t06055760619._1
1352- let longPremiumFraction = $t06055760619._2
1585+ let $t06873668798 = getFunding()
1586+ let shortPremiumFraction = $t06873668798._1
1587+ let longPremiumFraction = $t06873668798._2
13531588 updateFunding((fundingBlockTimestamp + fundingPeriodSeconds()), (latestLongCumulativePremiumFraction() + longPremiumFraction), (latestShortCumulativePremiumFraction() + shortPremiumFraction), divd(longPremiumFraction, underlyingPrice), divd(shortPremiumFraction, underlyingPrice))
13541589 }
13551590 }
13761611 else (0 > _price))
13771612 then throw("Invalid adjustPeg parameters")
13781613 else {
1379- let $t06161061696 = getPegAdjustCost(_price)
1380- let newQuoteAssetReserve = $t06161061696._1
1381- let pegChangeCost = $t06161061696._2
1614+ let $t06978969875 = getPegAdjustCost(_price)
1615+ let newQuoteAssetReserve = $t06978969875._1
1616+ let pegChangeCost = $t06978969875._2
13821617 if ((pegChangeCost == 0))
13831618 then throw("Nothing to adjust")
13841619 else if ((pegChangeCost > 0))
14201655
14211656 @Callable(i)
14221657 func v_get (_trader) = {
1423- let $t06333763397 = internalClosePosition(_trader, false)
1424- let x1 = $t06333763397._1
1425- let x2 = $t06333763397._2
1426- let x3 = $t06333763397._3
1427- let x4 = $t06333763397._4
1658+ let $t07151671576 = internalClosePosition(_trader, false)
1659+ let x1 = $t07151671576._1
1660+ let x2 = $t07151671576._2
1661+ let x3 = $t07151671576._3
1662+ let x4 = $t07151671576._4
14281663 throw((((s(x2) + s(x3)) + s(x4)) + s(getMarginRatio(_trader))))
14291664 }
14301665
14321667
14331668 @Callable(i)
14341669 func view_calcRemainMarginWithFundingPayment (_trader) = {
1435- let $t06354463655 = getPosition(_trader)
1436- let positionSize = $t06354463655._1
1437- let positionMargin = $t06354463655._2
1438- let pon = $t06354463655._3
1439- let positionLstUpdCPF = $t06354463655._4
1440- let $t06366063761 = getPositionNotionalAndUnrealizedPnl(_trader, PNL_OPTION_SPOT)
1441- let positionNotional = $t06366063761._1
1442- let unrealizedPnl = $t06366063761._2
1443- let $t06376663948 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl)
1444- let remainMargin = $t06376663948._1
1445- let badDebt = $t06376663948._2
1446- let fundingPayment = $t06376663948._3
1670+ let $t07172371834 = getPosition(_trader)
1671+ let positionSize = $t07172371834._1
1672+ let positionMargin = $t07172371834._2
1673+ let pon = $t07172371834._3
1674+ let positionLstUpdCPF = $t07172371834._4
1675+ let $t07183971940 = getPositionNotionalAndUnrealizedPnl(_trader, PNL_OPTION_SPOT)
1676+ let positionNotional = $t07183971940._1
1677+ let unrealizedPnl = $t07183971940._2
1678+ let $t07194572127 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl)
1679+ let remainMargin = $t07194572127._1
1680+ let badDebt = $t07194572127._2
1681+ let fundingPayment = $t07194572127._3
14471682 throw((((((s(remainMargin) + s(fundingPayment)) + s(getMarginRatio(_trader))) + s(unrealizedPnl)) + s(badDebt)) + s(positionNotional)))
14481683 }
14491684
14601695 @Callable(i)
14611696 func view_getFunding () = {
14621697 let underlyingPrice = getOracleTwapPrice()
1463- let $t06433964401 = getFunding()
1464- let shortPremiumFraction = $t06433964401._1
1465- let longPremiumFraction = $t06433964401._2
1698+ let $t07251872580 = getFunding()
1699+ let shortPremiumFraction = $t07251872580._1
1700+ let longPremiumFraction = $t07251872580._2
14661701 let longFunding = divd(longPremiumFraction, underlyingPrice)
14671702 let shortFunding = divd(shortPremiumFraction, underlyingPrice)
14681703 throw((((s(longFunding) + s(shortFunding)) + s(getTwapSpotPrice())) + s(getOracleTwapPrice())))
1704+ }
1705+
1706+
1707+
1708+@Callable(i)
1709+func view_getBorrowedByTrader (_trader) = {
1710+ let $t07287072924 = getBorrowedByTrader(_trader)
1711+ let borrowed = $t07287072924._1
1712+ let assetId = $t07287072924._2
1713+ throw((s(borrowed) + assetId))
14691714 }
14701715
14711716
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let k_ora_key = "k_ora_key"
55
66 let k_ora_block_key = "k_ora_block_key"
77
88 let k_ora = "k_ora"
99
1010 let k_balance = "k_balance"
1111
1212 let k_positionSize = "k_positionSize"
1313
1414 let k_positionMargin = "k_positionMargin"
1515
1616 let k_positionOpenNotional = "k_positionOpenNotional"
1717
1818 let k_positionLastUpdatedCumulativePremiumFraction = "k_positionFraction"
1919
2020 let k_positionClosedDate = "k_positionClosedDate"
21+
22+let k_positionAsset = "k_positionAsset"
2123
2224 let k_initialized = "k_initialized"
2325
2426 let k_paused = "k_paused"
2527
2628 let k_fee = "k_fee"
2729
2830 let k_fundingPeriod = "k_fundingPeriod"
2931
3032 let k_initMarginRatio = "k_initMarginRatio"
3133
3234 let k_maintenanceMarginRatio = "k_mmr"
3335
3436 let k_liquidationFeeRatio = "k_liquidationFeeRatio"
3537
3638 let k_partialLiquidationRatio = "k_partLiquidationRatio"
3739
3840 let k_spreadLimit = "k_spreadLimit"
3941
4042 let k_maxPriceImpact = "k_maxPriceImpact"
4143
4244 let k_maxPriceSpread = "k_maxPriceSpread"
4345
4446 let k_lastDataStr = "k_lastDataStr"
4547
4648 let k_lastMinuteId = "k_lastMinuteId"
4749
4850 let k_twapDataLastCumulativePrice = "k_twapDataLastCumulativePrice"
4951
5052 let k_twapDataLastPrice = "k_twapDataLastPrice"
5153
5254 let k_twapDataPreviousMinuteId = "k_twapDataPreviousMinuteId"
5355
5456 let k_latestLongCumulativePremiumFraction = "k_latestLongPremiumFraction"
5557
5658 let k_latestShortCumulativePremiumFraction = "k_latestShortPremiumFraction"
5759
5860 let k_nextFundingBlock = "k_nextFundingBlockMinTimestamp"
5961
6062 let k_longFundingRate = "k_longFundingRate"
6163
6264 let k_shortFundingRate = "k_shortFundingRate"
6365
6466 let k_quoteAssetReserve = "k_qtAstR"
6567
6668 let k_baseAssetReserve = "k_bsAstR"
6769
6870 let k_totalPositionSize = "k_totalPositionSize"
6971
7072 let k_totalLongPositionSize = "k_totalLongPositionSize"
7173
7274 let k_totalShortPositionSize = "k_totalShortPositionSize"
7375
7476 let k_cumulativeNotional = "k_cumulativeNotional"
7577
7678 let k_openInterestNotional = "k_openInterestNotional"
7779
7880 let k_coordinatorAddress = "k_coordinatorAddress"
7981
8082 let k_insurance_address = "k_insurance_address"
8183
8284 let k_admin_address = "k_admin_address"
8385
8486 let k_admin_public_key = "k_admin_public_key"
8587
8688 let k_quote_asset = "k_quote_asset"
8789
8890 let k_quote_staking = "k_quote_staking"
8991
9092 let k_staking_address = "k_staking_address"
9193
9294 let k_miner_address = "k_miner_address"
9395
9496 let k_orders_address = "k_orders_address"
9597
9698 let k_referral_address = "k_referral_address"
9799
98100 let k_manager_address = "k_manager_address"
99101
102+let k_collateral_address = "k_collateral_address"
103+
104+let k_exchange_address = "k_exchange_address"
105+
100106 let k_nft_manager_address = "k_nft_manager_address"
107+
108+let k_trader_market_asset_collateral = "k_trader_market_asset_collateral"
109+
110+func toCompositeKey (_key,_address) = ((_key + "_") + _address)
111+
101112
102113 func coordinator () = valueOrErrorMessage(addressFromString(getStringValue(this, k_coordinatorAddress)), "Coordinator not set")
103114
104115
105116 func adminAddress () = addressFromString(getStringValue(coordinator(), k_admin_address))
106117
107118
108119 func adminPublicKey () = fromBase58String(getStringValue(coordinator(), k_admin_public_key))
109120
110121
111122 func quoteAsset () = fromBase58String(getStringValue(coordinator(), k_quote_asset))
112123
113124
114125 func quoteAssetStaking () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_quote_staking)), "Quote asset staking not set")
115126
116127
117128 func stakingAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_staking_address)), "Staking not set")
118129
119130
120131 func insuranceAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_insurance_address)), "Insurance not set")
121132
122133
123134 func minerAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_miner_address)), "Miner not set")
124135
125136
126137 func ordersAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_orders_address)), "Orders not set")
127138
128139
129140 func referralAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_referral_address)), "Referral not set")
130141
131142
132143 func managerAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_manager_address)), "Manager not set")
133144
134145
135146 func nftManagerAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_nft_manager_address)), "NFT Manager not set")
147+
148+
149+func collateralAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_collateral_address)), "Collateral Manager not set")
150+
151+
152+func swapAddress () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(coordinator(), k_exchange_address), "No swap address")), "Invalid swap address")
153+
154+
155+let k_whitelist_asset = "k_whitelist_asset"
156+
157+func isWhitelistAsset (_assetId) = valueOrElse(getBoolean(collateralAddress(), toCompositeKey(k_whitelist_asset, _assetId)), false)
136158
137159
138160 let k_token_param = "k_token_param"
139161
140162 let k_token_type = "k_token_type"
141163
142164 let FEE_REDUCTION_TOKEN_TYPE = "fee_reduction"
143165
144166 let DIR_LONG = 1
145167
146168 let DIR_SHORT = 2
147169
148170 let TWAP_INTERVAL = 15
149171
150172 let ORACLE_INTERVAL = 15
151173
152174 let SECONDS = 1000
153175
154176 let DECIMAL_UNIT = (1 * (((((10 * 10) * 10) * 10) * 10) * 10))
155177
156178 let ONE_DAY = (86400 * DECIMAL_UNIT)
157179
158180 let ALL_FEES = 100
159181
160182 let PNL_OPTION_SPOT = 1
161183
162184 let PNL_OPTION_ORACLE = 2
163185
164186 func s (_x) = (toString(_x) + ",")
165187
166188
167189 func divd (_x,_y) = fraction(_x, DECIMAL_UNIT, _y, HALFEVEN)
168190
169191
170192 func muld (_x,_y) = fraction(_x, _y, DECIMAL_UNIT, HALFEVEN)
171193
172194
173195 func abs (_x) = if ((_x > 0))
174196 then _x
175197 else -(_x)
176198
177199
178200 func vmax (_x,_y) = if ((_x >= _y))
179201 then _x
180202 else _y
181-
182-
183-func toCompositeKey (_key,_address) = ((_key + "_") + _address)
184203
185204
186205 func listToStr (_list) = {
187206 func _join (accumulator,val) = ((accumulator + val) + ",")
188207
189208 let newListStr = {
190209 let $l = _list
191210 let $s = size($l)
192211 let $acc0 = ""
193212 func $f0_1 ($a,$i) = if (($i >= $s))
194213 then $a
195214 else _join($a, $l[$i])
196215
197216 func $f0_2 ($a,$i) = if (($i >= $s))
198217 then $a
199218 else throw("List size exceeds 20")
200219
201220 $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)
202221 }
203222 let newListStrU = dropRight(newListStr, 1)
204223 let newListStrR = if ((take(newListStrU, 1) == ","))
205224 then drop(newListStrU, 1)
206225 else newListStrU
207226 newListStrR
208227 }
209228
210229
211230 func strToList (_str) = split(_str, ",")
212231
213232
214233 func pushToQueue (_list,_maxSize,_value) = if ((size(_list) > _maxSize))
215234 then (removeByIndex(_list, 0) :+ _value)
216235 else (_list :+ _value)
217236
218237
219238 func int (k) = valueOrErrorMessage(getInteger(this, k), ("no value for " + k))
220239
221240
222241 func strA (_address,_key) = {
223242 let val = valueOrErrorMessage(getString(_address, _key), ("No value for key " + _key))
224243 val
225244 }
226245
227246
228247 func intA (_address,_key) = {
229248 let val = valueOrErrorMessage(getInteger(_address, _key), ("No value for key " + _key))
230249 val
231250 }
232251
233252
234253 func cbalance () = int(k_balance)
235254
236255
237256 func fee () = int(k_fee)
238257
239258
240259 func initMarginRatio () = int(k_initMarginRatio)
241260
242261
243262 func qtAstR () = int(k_quoteAssetReserve)
244263
245264
246265 func bsAstR () = int(k_baseAssetReserve)
247266
248267
249268 func totalPositionSize () = int(k_totalPositionSize)
250269
251270
252271 func cumulativeNotional () = int(k_cumulativeNotional)
253272
254273
255274 func openInterestNotional () = int(k_openInterestNotional)
256275
257276
258277 func nextFundingBlockTimestamp () = int(k_nextFundingBlock)
259278
260279
261280 func fundingPeriodRaw () = int(k_fundingPeriod)
262281
263282
264283 func fundingPeriodDecimal () = (fundingPeriodRaw() * DECIMAL_UNIT)
265284
266285
267286 func fundingPeriodSeconds () = (fundingPeriodRaw() * SECONDS)
268287
269288
270289 func maintenanceMarginRatio () = int(k_maintenanceMarginRatio)
271290
272291
273292 func liquidationFeeRatio () = int(k_liquidationFeeRatio)
274293
275294
276295 func partialLiquidationRatio () = int(k_partialLiquidationRatio)
277296
278297
279298 func spreadLimit () = int(k_spreadLimit)
280299
281300
282301 func maxPriceImpact () = int(k_maxPriceImpact)
283302
284303
285304 func maxPriceSpread () = int(k_maxPriceSpread)
286305
287306
288307 func latestLongCumulativePremiumFraction () = int(k_latestLongCumulativePremiumFraction)
289308
290309
291310 func latestShortCumulativePremiumFraction () = int(k_latestShortCumulativePremiumFraction)
292311
293312
294313 func totalShortPositionSize () = int(k_totalShortPositionSize)
295314
296315
297316 func totalLongPositionSize () = int(k_totalLongPositionSize)
298317
299318
300319 func getActualCaller (i) = valueOrElse(getString(ordersAddress(), "k_sender"), toString(i.caller))
301320
302321
303322 func requireMoreMarginRatio (_marginRatio,_baseMarginRatio,_largerThanOrEqualTo) = {
304323 let remainingMarginRatio = (_marginRatio - _baseMarginRatio)
305324 if (if (_largerThanOrEqualTo)
306325 then (0 > remainingMarginRatio)
307326 else false)
308327 then throw("Invalid margin")
309328 else if (if (!(_largerThanOrEqualTo))
310329 then (remainingMarginRatio >= 0)
311330 else false)
312331 then throw("Invalid margin")
313332 else true
314333 }
315334
316335
317336 func latestCumulativePremiumFraction (_positionSize) = if ((_positionSize == 0))
318337 then throw("Should not be called with _positionSize == 0")
319338 else if ((_positionSize > 0))
320339 then latestLongCumulativePremiumFraction()
321340 else latestShortCumulativePremiumFraction()
322341
323342
324343 func getPosition (_trader) = {
325344 let positionSizeOpt = getInteger(this, toCompositeKey(k_positionSize, _trader))
326345 match positionSizeOpt {
327346 case positionSize: Int =>
328347 $Tuple4(positionSize, getIntegerValue(this, toCompositeKey(k_positionMargin, _trader)), getIntegerValue(this, toCompositeKey(k_positionOpenNotional, _trader)), getIntegerValue(this, toCompositeKey(k_positionLastUpdatedCumulativePremiumFraction, _trader)))
329348 case _ =>
330349 $Tuple4(0, 0, 0, 0)
331350 }
332351 }
333352
334353
354+func getPositionAsset (_trader) = {
355+ let positionAssetOpt = getString(this, toCompositeKey(k_positionAsset, _trader))
356+ match positionAssetOpt {
357+ case positionAsset: String =>
358+ positionAsset
359+ case _ =>
360+ toBase58String(quoteAsset())
361+ }
362+ }
363+
364+
335365 func requireOpenPosition (_trader) = if ((getPosition(_trader)._1 == 0))
336366 then throw("No open position")
337367 else true
338368
339369
340370 func initialized () = valueOrElse(getBoolean(this, k_initialized), false)
341371
342372
343373 func paused () = valueOrElse(getBoolean(this, k_paused), false)
344374
345375
346376 func updateReserve (_isAdd,_quoteAssetAmount,_baseAssetAmount) = if (_isAdd)
347377 then {
348378 let newBase = (bsAstR() - _baseAssetAmount)
349379 if ((0 >= newBase))
350380 then throw("Tx lead to base asset reserve <= 0, revert")
351381 else $Tuple4((qtAstR() + _quoteAssetAmount), newBase, (totalPositionSize() + _baseAssetAmount), (cumulativeNotional() + _quoteAssetAmount))
352382 }
353383 else {
354384 let newQuote = (qtAstR() - _quoteAssetAmount)
355385 if ((0 >= newQuote))
356386 then throw("Tx lead to base quote reserve <= 0, revert")
357387 else $Tuple4(newQuote, (bsAstR() + _baseAssetAmount), (totalPositionSize() - _baseAssetAmount), (cumulativeNotional() - _quoteAssetAmount))
358388 }
359389
360390
361391 func swapInput (_isAdd,_quoteAssetAmount) = {
362392 let _qtAstR = qtAstR()
363393 let _bsAstR = bsAstR()
364394 let k = muld(_qtAstR, _bsAstR)
365395 let quoteAssetReserveAfter = if (_isAdd)
366396 then (_qtAstR + _quoteAssetAmount)
367397 else (_qtAstR - _quoteAssetAmount)
368398 let baseAssetReserveAfter = divd(k, quoteAssetReserveAfter)
369399 let amountBaseAssetBoughtAbs = abs((baseAssetReserveAfter - _bsAstR))
370400 let amountBaseAssetBought = if (_isAdd)
371401 then amountBaseAssetBoughtAbs
372402 else -(amountBaseAssetBoughtAbs)
373- let $t01366013853 = updateReserve(_isAdd, _quoteAssetAmount, amountBaseAssetBoughtAbs)
374- let quoteAssetReserveAfter1 = $t01366013853._1
375- let baseAssetReserveAfter1 = $t01366013853._2
376- let totalPositionSizeAfter1 = $t01366013853._3
377- let cumulativeNotionalAfter1 = $t01366013853._4
403+ let $t01497415167 = updateReserve(_isAdd, _quoteAssetAmount, amountBaseAssetBoughtAbs)
404+ let quoteAssetReserveAfter1 = $t01497415167._1
405+ let baseAssetReserveAfter1 = $t01497415167._2
406+ let totalPositionSizeAfter1 = $t01497415167._3
407+ let cumulativeNotionalAfter1 = $t01497415167._4
378408 let priceBefore = divd(_qtAstR, _bsAstR)
379409 let marketPrice = divd(_quoteAssetAmount, amountBaseAssetBoughtAbs)
380410 let priceDiff = abs((priceBefore - marketPrice))
381411 let priceImpact = (DECIMAL_UNIT - divd(priceBefore, (priceBefore + priceDiff)))
382412 let maxPriceImpactValue = maxPriceImpact()
383413 if ((priceImpact > maxPriceImpactValue))
384414 then throw(((((((((((((("Price impact " + toString(priceImpact)) + " > max price impact ") + toString(maxPriceImpactValue)) + " before quote asset: ") + toString(_qtAstR)) + " before base asset: ") + toString(_bsAstR)) + " quote asset amount to exchange: ") + toString(_quoteAssetAmount)) + " price before: ") + toString(priceBefore)) + " marketPrice: ") + toString(marketPrice)))
385415 else $Tuple5(amountBaseAssetBought, quoteAssetReserveAfter1, baseAssetReserveAfter1, totalPositionSizeAfter1, cumulativeNotionalAfter1)
386416 }
387417
388418
389419 func calcRemainMarginWithFundingPayment (_oldPositionSize,_oldPositionMargin,_oldPositionCumulativePremiumFraction,_marginDelta) = {
390420 let fundingPayment = if ((_oldPositionSize != 0))
391421 then {
392422 let _latestCumulativePremiumFraction = latestCumulativePremiumFraction(_oldPositionSize)
393423 muld((_latestCumulativePremiumFraction - _oldPositionCumulativePremiumFraction), _oldPositionSize)
394424 }
395425 else 0
396426 let signedMargin = ((_marginDelta - fundingPayment) + _oldPositionMargin)
397- let $t01534415471 = if ((0 > signedMargin))
427+ let $t01665816785 = if ((0 > signedMargin))
398428 then $Tuple2(0, abs(signedMargin))
399429 else $Tuple2(abs(signedMargin), 0)
400- let remainMargin = $t01534415471._1
401- let badDebt = $t01534415471._2
430+ let remainMargin = $t01665816785._1
431+ let badDebt = $t01665816785._2
402432 $Tuple3(remainMargin, badDebt, fundingPayment)
403433 }
404434
405435
406436 func swapOutputWithReserves (_isAdd,_baseAssetAmount,_checkMaxPriceImpact,_quoteAssetReserve,_baseAssetReserve) = {
407437 let priceBefore = divd(_quoteAssetReserve, _baseAssetReserve)
408438 if ((_baseAssetAmount == 0))
409439 then throw("Invalid base asset amount")
410440 else {
411441 let k = muld(_quoteAssetReserve, _baseAssetReserve)
412442 let baseAssetPoolAmountAfter = if (_isAdd)
413443 then (_baseAssetReserve + _baseAssetAmount)
414444 else (_baseAssetReserve - _baseAssetAmount)
415445 let quoteAssetAfter = divd(k, baseAssetPoolAmountAfter)
416446 let quoteAssetSold = abs((quoteAssetAfter - _quoteAssetReserve))
417447 let maxPriceImpactValue = maxPriceImpact()
418- let $t01644816641 = updateReserve(!(_isAdd), quoteAssetSold, _baseAssetAmount)
419- let quoteAssetReserveAfter1 = $t01644816641._1
420- let baseAssetReserveAfter1 = $t01644816641._2
421- let totalPositionSizeAfter1 = $t01644816641._3
422- let cumulativeNotionalAfter1 = $t01644816641._4
448+ let $t01776217955 = updateReserve(!(_isAdd), quoteAssetSold, _baseAssetAmount)
449+ let quoteAssetReserveAfter1 = $t01776217955._1
450+ let baseAssetReserveAfter1 = $t01776217955._2
451+ let totalPositionSizeAfter1 = $t01776217955._3
452+ let cumulativeNotionalAfter1 = $t01776217955._4
423453 let marketPrice = divd(quoteAssetSold, _baseAssetAmount)
424454 let priceDiff = abs((priceBefore - marketPrice))
425455 let priceImpact = (DECIMAL_UNIT - divd(priceBefore, (priceBefore + priceDiff)))
426456 if (if ((priceImpact > maxPriceImpactValue))
427457 then _checkMaxPriceImpact
428458 else false)
429459 then throw(((((((((((((("Price impact " + toString(priceImpact)) + " > max price impact ") + toString(maxPriceImpactValue)) + " before quote asset: ") + toString(_quoteAssetReserve)) + " before base asset: ") + toString(_baseAssetReserve)) + " base asset amount to exchange: ") + toString(_baseAssetAmount)) + " price before: ") + toString(priceBefore)) + " market price: ") + toString(marketPrice)))
430460 else $Tuple8(quoteAssetSold, quoteAssetReserveAfter1, baseAssetReserveAfter1, totalPositionSizeAfter1, cumulativeNotionalAfter1, (totalLongPositionSize() - (if (_isAdd)
431461 then abs(_baseAssetAmount)
432462 else 0)), (totalShortPositionSize() - (if (!(_isAdd))
433463 then abs(_baseAssetAmount)
434464 else 0)), priceImpact)
435465 }
436466 }
437467
438468
439469 func swapOutput (_isAdd,_baseAssetAmount,_checkMaxPriceImpact) = swapOutputWithReserves(_isAdd, _baseAssetAmount, _checkMaxPriceImpact, qtAstR(), bsAstR())
440470
441471
442472 func getOracleTwapPrice () = {
443473 let oracle = valueOrErrorMessage(addressFromString(getStringValue(this, k_ora)), "")
444474 let priceKey = getStringValue(this, k_ora_key)
445475 let blockKey = getStringValue(this, k_ora_block_key)
446476 let lastValue = valueOrErrorMessage(getInteger(oracle, priceKey), ((("Can not get oracle price. Oracle: " + toString(oracle)) + " key: ") + priceKey))
447477 lastValue
448478 }
449479
450480
451481 func requireNotOverSpreadLimit (_quoteAssetReserve,_baseAssetReserve) = {
452482 let oraclePrice = getOracleTwapPrice()
453483 let priceAfter = divd(_quoteAssetReserve, _baseAssetReserve)
454484 let averagePrice = divd((oraclePrice + priceAfter), (2 * DECIMAL_UNIT))
455485 let absPriceDiff = divd(abs((oraclePrice - priceAfter)), averagePrice)
456486 if ((absPriceDiff > maxPriceSpread()))
457487 then throw(((("Price spread " + toString(absPriceDiff)) + " > max price spread ") + toString(maxPriceSpread())))
458488 else true
459489 }
460490
461491
462492 func getSpotPrice () = {
463493 let _quoteAssetReserve = qtAstR()
464494 let _baseAssetReserve = bsAstR()
465495 divd(_quoteAssetReserve, _baseAssetReserve)
466496 }
467497
468498
469499 func isOverFluctuationLimit () = {
470500 let oraclePrice = getOracleTwapPrice()
471501 let currentPrice = getSpotPrice()
472502 (divd(abs((oraclePrice - currentPrice)), oraclePrice) > spreadLimit())
473503 }
474504
475505
476506 func getPositionAdjustedOpenNotional (_positionSize,_option,_quoteAssetReserve,_baseAssetReserve) = {
477507 let positionSizeAbs = abs(_positionSize)
478508 let isShort = (0 > _positionSize)
479509 let positionNotional = if ((_option == PNL_OPTION_SPOT))
480510 then {
481- let $t01985920030 = swapOutputWithReserves(!(isShort), positionSizeAbs, false, _quoteAssetReserve, _baseAssetReserve)
482- let outPositionNotional = $t01985920030._1
483- let x1 = $t01985920030._2
484- let x2 = $t01985920030._3
485- let x3 = $t01985920030._4
511+ let $t02117321344 = swapOutputWithReserves(!(isShort), positionSizeAbs, false, _quoteAssetReserve, _baseAssetReserve)
512+ let outPositionNotional = $t02117321344._1
513+ let x1 = $t02117321344._2
514+ let x2 = $t02117321344._3
515+ let x3 = $t02117321344._4
486516 outPositionNotional
487517 }
488518 else muld(positionSizeAbs, getOracleTwapPrice())
489519 positionNotional
490520 }
491521
492522
493523 func getPositionNotionalAndUnrealizedPnlByValues (_positionSize,_positionOpenNotional,_quoteAssetReserve,_baseAssetReserve,_option) = if ((_positionSize == 0))
494524 then throw("Invalid position size")
495525 else {
496526 let isShort = (0 > _positionSize)
497527 let positionNotional = getPositionAdjustedOpenNotional(_positionSize, _option, _quoteAssetReserve, _baseAssetReserve)
498528 let unrealizedPnl = if (isShort)
499529 then (_positionOpenNotional - positionNotional)
500530 else (positionNotional - _positionOpenNotional)
501531 $Tuple2(positionNotional, unrealizedPnl)
502532 }
503533
504534
505535 func getPositionNotionalAndUnrealizedPnl (_trader,_option) = {
506- let $t02134721475 = getPosition(_trader)
507- let positionSize = $t02134721475._1
508- let positionMargin = $t02134721475._2
509- let positionOpenNotional = $t02134721475._3
510- let positionLstUpdCPF = $t02134721475._4
536+ let $t02266122789 = getPosition(_trader)
537+ let positionSize = $t02266122789._1
538+ let positionMargin = $t02266122789._2
539+ let positionOpenNotional = $t02266122789._3
540+ let positionLstUpdCPF = $t02266122789._4
511541 getPositionNotionalAndUnrealizedPnlByValues(positionSize, positionOpenNotional, qtAstR(), bsAstR(), _option)
512542 }
513543
514544
515545 func calcMarginRatio (_remainMargin,_badDebt,_positionNotional) = divd((_remainMargin - _badDebt), _positionNotional)
516546
517547
518548 func getMarginRatioByOption (_trader,_option) = {
519- let $t02195622067 = getPosition(_trader)
520- let positionSize = $t02195622067._1
521- let positionMargin = $t02195622067._2
522- let pon = $t02195622067._3
523- let positionLstUpdCPF = $t02195622067._4
524- let $t02207322166 = getPositionNotionalAndUnrealizedPnl(_trader, _option)
525- let positionNotional = $t02207322166._1
526- let unrealizedPnl = $t02207322166._2
527- let $t02217122337 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl)
528- let remainMargin = $t02217122337._1
529- let badDebt = $t02217122337._2
549+ let $t02327023381 = getPosition(_trader)
550+ let positionSize = $t02327023381._1
551+ let positionMargin = $t02327023381._2
552+ let pon = $t02327023381._3
553+ let positionLstUpdCPF = $t02327023381._4
554+ let $t02338723480 = getPositionNotionalAndUnrealizedPnl(_trader, _option)
555+ let positionNotional = $t02338723480._1
556+ let unrealizedPnl = $t02338723480._2
557+ let $t02348523651 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl)
558+ let remainMargin = $t02348523651._1
559+ let badDebt = $t02348523651._2
530560 calcMarginRatio(remainMargin, badDebt, positionNotional)
531561 }
532562
533563
534564 func getMarginRatio (_trader) = getMarginRatioByOption(_trader, PNL_OPTION_SPOT)
535565
536566
537567 func getPartialLiquidationAmount (_trader,_positionSize) = {
538568 let maximumRatio = vmax(partialLiquidationRatio(), (DECIMAL_UNIT - divd(getMarginRatio(_trader), maintenanceMarginRatio())))
539569 let maxExchangedPositionSize = muld(abs(_positionSize), maximumRatio)
540570 let swapResult = swapOutput((_positionSize > 0), maxExchangedPositionSize, false)
541571 let maxExchangedQuoteAssetAmount = swapResult._1
542572 let priceImpact = swapResult._8
543573 if ((maxPriceImpact() > priceImpact))
544574 then maxExchangedQuoteAssetAmount
545575 else {
546576 let exchangedPositionSize = muld(abs(_positionSize), partialLiquidationRatio())
547577 let exchangedQuoteAssetAmount = swapOutput((_positionSize > 0), exchangedPositionSize, false)._1
548578 exchangedQuoteAssetAmount
549579 }
550580 }
551581
552582
553583 func internalClosePosition (_trader,_checkMaxPriceImpact) = {
554- let $t02357023698 = getPosition(_trader)
555- let positionSize = $t02357023698._1
556- let positionMargin = $t02357023698._2
557- let positionOpenNotional = $t02357023698._3
558- let positionLstUpdCPF = $t02357023698._4
584+ let $t02488425012 = getPosition(_trader)
585+ let positionSize = $t02488425012._1
586+ let positionMargin = $t02488425012._2
587+ let positionOpenNotional = $t02488425012._3
588+ let positionLstUpdCPF = $t02488425012._4
559589 let unrealizedPnl = getPositionNotionalAndUnrealizedPnl(_trader, PNL_OPTION_SPOT)._2
560- let $t02379323961 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl)
561- let remainMargin = $t02379323961._1
562- let badDebt = $t02379323961._2
590+ let $t02510725275 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl)
591+ let remainMargin = $t02510725275._1
592+ let badDebt = $t02510725275._2
563593 let exchangedPositionSize = -(positionSize)
564594 let realizedPnl = unrealizedPnl
565595 let marginToVault = -(remainMargin)
566- let $t02408824399 = swapOutput((positionSize > 0), abs(positionSize), _checkMaxPriceImpact)
567- let exchangedQuoteAssetAmount = $t02408824399._1
568- let quoteAssetReserveAfter = $t02408824399._2
569- let baseAssetReserveAfter = $t02408824399._3
570- let totalPositionSizeAfter = $t02408824399._4
571- let cumulativeNotionalAfter = $t02408824399._5
572- let totalLongAfter = $t02408824399._6
573- let totalShortAfter = $t02408824399._7
596+ let $t02540225713 = swapOutput((positionSize > 0), abs(positionSize), _checkMaxPriceImpact)
597+ let exchangedQuoteAssetAmount = $t02540225713._1
598+ let quoteAssetReserveAfter = $t02540225713._2
599+ let baseAssetReserveAfter = $t02540225713._3
600+ let totalPositionSizeAfter = $t02540225713._4
601+ let cumulativeNotionalAfter = $t02540225713._5
602+ let totalLongAfter = $t02540225713._6
603+ let totalShortAfter = $t02540225713._7
574604 let openInterestNotionalAfter = (openInterestNotional() - positionOpenNotional)
575605 $Tuple12(exchangedPositionSize, badDebt, realizedPnl, marginToVault, quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, exchangedQuoteAssetAmount, totalLongAfter, totalShortAfter)
576606 }
577607
578608
579609 func getTwapSpotPrice () = {
580610 let minuteId = ((lastBlock.timestamp / 1000) / 60)
581611 let startMinuteId = (minuteId - TWAP_INTERVAL)
582612 let listStr = valueOrElse(getString(this, k_lastDataStr), "")
583613 let list = split(listStr, ",")
584614 func filterFn (accumulator,next) = if ((startMinuteId >= parseIntValue(next)))
585615 then (accumulator :+ parseIntValue(next))
586616 else accumulator
587617
588618 let listF = {
589619 let $l = list
590620 let $s = size($l)
591621 let $acc0 = nil
592622 func $f0_1 ($a,$i) = if (($i >= $s))
593623 then $a
594624 else filterFn($a, $l[$i])
595625
596626 func $f0_2 ($a,$i) = if (($i >= $s))
597627 then $a
598628 else throw("List size exceeds 20")
599629
600630 $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)
601631 }
602632 let maxIndex = if ((size(listF) > 0))
603633 then max(listF)
604634 else parseIntValue(list[0])
605635 let lastMinuteId = valueOrElse(getInteger(this, k_lastMinuteId), 0)
606636 let endLastCumulativePrice = valueOrElse(getInteger(this, ((k_twapDataLastCumulativePrice + "_") + toString(lastMinuteId))), 0)
607637 let endLastPrice = valueOrElse(getInteger(this, ((k_twapDataLastPrice + "_") + toString(lastMinuteId))), 0)
608638 let nowCumulativePrice = (endLastCumulativePrice + ((minuteId - lastMinuteId) * endLastPrice))
609639 let startLastCumulativePrice = valueOrElse(getInteger(this, ((k_twapDataLastCumulativePrice + "_") + toString(maxIndex))), 0)
610640 let startLastPrice = valueOrElse(getInteger(this, ((k_twapDataLastPrice + "_") + toString(maxIndex))), 0)
611641 let startCumulativePrice = (startLastCumulativePrice + ((startMinuteId - maxIndex) * startLastPrice))
612642 ((nowCumulativePrice - startCumulativePrice) / TWAP_INTERVAL)
613643 }
614644
615645
616646 func getPegAdjustCost (_price) = {
617647 let _positionSize = totalPositionSize()
618648 let direction = (_positionSize > 0)
619649 let currentNetMarketValue = swapOutput(direction, abs(_positionSize), false)._1
620650 let baseAssetReserve = bsAstR()
621651 let newQuoteAssetReserve = muld(baseAssetReserve, _price)
622652 let cost = getPositionNotionalAndUnrealizedPnlByValues(_positionSize, currentNetMarketValue, newQuoteAssetReserve, baseAssetReserve, PNL_OPTION_SPOT)._2
623653 $Tuple2(newQuoteAssetReserve, cost)
624654 }
625655
626656
627657 func getFunding () = {
628658 let underlyingPrice = getOracleTwapPrice()
629659 let spotTwapPrice = getTwapSpotPrice()
630660 let premium = (spotTwapPrice - underlyingPrice)
631661 if (if ((totalShortPositionSize() == 0))
632662 then true
633663 else (totalLongPositionSize() == 0))
634664 then $Tuple2(0, 0)
635665 else if ((0 > premium))
636666 then {
637667 let shortPremiumFraction = divd(muld(premium, fundingPeriodDecimal()), ONE_DAY)
638668 let longPremiumFraction = divd(muld(shortPremiumFraction, totalShortPositionSize()), totalLongPositionSize())
639669 $Tuple2(shortPremiumFraction, longPremiumFraction)
640670 }
641671 else {
642672 let longPremiumFraction = divd(muld(premium, fundingPeriodDecimal()), ONE_DAY)
643673 let shortPremiumFraction = divd(muld(longPremiumFraction, totalLongPositionSize()), totalShortPositionSize())
644674 $Tuple2(shortPremiumFraction, longPremiumFraction)
645675 }
646676 }
647677
648678
649679 func getAdjustedFee (i) = {
650680 let baseFee = fee()
651- let $t02806228670 = if ((size(i.payments) > 1))
681+ let $t02937629984 = if ((size(i.payments) > 1))
652682 then {
653683 let artifactId = toBase58String(valueOrErrorMessage(i.payments[1].assetId, "Invalid attached artifact"))
654684 let artifactKind = strA(nftManagerAddress(), toCompositeKey(k_token_type, artifactId))
655685 if ((artifactKind == FEE_REDUCTION_TOKEN_TYPE))
656686 then {
657687 let reduction = intA(nftManagerAddress(), toCompositeKey(k_token_param, artifactId))
658688 let adjustedFee = muld(baseFee, reduction)
659689 $Tuple2(adjustedFee, true)
660690 }
661691 else throw("Invalid attached artifact")
662692 }
663693 else $Tuple2(baseFee, false)
664- let adjustedFee = $t02806228670._1
665- let burnArtifact = $t02806228670._2
694+ let adjustedFee = $t02937629984._1
695+ let burnArtifact = $t02937629984._2
666696 $Tuple2(adjustedFee, burnArtifact)
667697 }
668698
669699
670700 func updateSettings (_initMarginRatio,_mmr,_liquidationFeeRatio,_fundingPeriod,_fee,_spreadLimit,_maxPriceImpact,_partialLiquidationRatio,_maxPriceSpread) = [IntegerEntry(k_initMarginRatio, _initMarginRatio), IntegerEntry(k_maintenanceMarginRatio, _mmr), IntegerEntry(k_liquidationFeeRatio, _liquidationFeeRatio), IntegerEntry(k_fundingPeriod, _fundingPeriod), IntegerEntry(k_fee, _fee), IntegerEntry(k_spreadLimit, _spreadLimit), IntegerEntry(k_maxPriceImpact, _maxPriceImpact), IntegerEntry(k_partialLiquidationRatio, _partialLiquidationRatio), IntegerEntry(k_maxPriceSpread, _maxPriceSpread)]
671701
672702
673703 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)]
704+
705+
706+func updatePositionAsset (_address,_assetId) = [StringEntry(toCompositeKey(k_positionAsset, _address), _assetId)]
674707
675708
676709 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)]
677710
678711
679712 func appendTwap (price) = {
680713 let minuteId = ((lastBlock.timestamp / 1000) / 60)
681714 let previousMinuteId = valueOrElse(getInteger(this, k_lastMinuteId), 0)
682715 if ((previousMinuteId > minuteId))
683716 then throw("TWAP out-of-order")
684717 else {
685718 let lastMinuteId = if ((previousMinuteId == 0))
686719 then minuteId
687720 else previousMinuteId
688721 if ((minuteId > previousMinuteId))
689722 then {
690723 let prevCumulativePrice = valueOrElse(getInteger(this, ((k_twapDataLastCumulativePrice + "_") + toString(previousMinuteId))), 0)
691724 let prevPrice = valueOrElse(getInteger(this, ((k_twapDataLastPrice + "_") + toString(previousMinuteId))), price)
692725 let lastCumulativePrice = (prevCumulativePrice + ((minuteId - lastMinuteId) * prevPrice))
693726 let list = pushToQueue(strToList(valueOrElse(getString(this, k_lastDataStr), "")), TWAP_INTERVAL, toString(minuteId))
694727 [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))]
695728 }
696729 else {
697730 let twapDataPreviousMinuteId = valueOrElse(getInteger(this, toCompositeKey(k_twapDataPreviousMinuteId, toString(minuteId))), 0)
698731 let prevCumulativePrice = valueOrElse(getInteger(this, toCompositeKey(k_twapDataLastCumulativePrice, toString(twapDataPreviousMinuteId))), 0)
699732 let prevPrice = valueOrElse(getInteger(this, toCompositeKey(k_twapDataLastPrice, toString(twapDataPreviousMinuteId))), price)
700733 let lastCumulativePrice = (prevCumulativePrice + ((minuteId - twapDataPreviousMinuteId) * prevPrice))
701734 [IntegerEntry(toCompositeKey(k_twapDataLastCumulativePrice, toString(minuteId)), lastCumulativePrice), IntegerEntry(toCompositeKey(k_twapDataLastPrice, toString(minuteId)), price)]
702735 }
703736 }
704737 }
705738
706739
707740 func updateAmmReserves (_qtAstR,_bsAstR) = [IntegerEntry(k_quoteAssetReserve, _qtAstR), IntegerEntry(k_baseAssetReserve, _bsAstR)]
708741
709742
710743 func updateAmm (_qtAstR,_bsAstR,_totalPositionSizeAfter,_cumulativeNotionalAfter,_openInterestNotional,_totalLongPositionSize,_totalShortPositionSize) = if (((_totalLongPositionSize - _totalShortPositionSize) != _totalPositionSizeAfter))
711744 then throw(((((("Invalid AMM state data: " + toString(_totalLongPositionSize)) + " + ") + toString(_totalShortPositionSize)) + " != ") + toString(_totalPositionSizeAfter)))
712745 else ((updateAmmReserves(_qtAstR, _bsAstR) ++ [IntegerEntry(k_totalPositionSize, _totalPositionSizeAfter), IntegerEntry(k_cumulativeNotional, _cumulativeNotionalAfter), IntegerEntry(k_openInterestNotional, _openInterestNotional), IntegerEntry(k_totalLongPositionSize, _totalLongPositionSize), IntegerEntry(k_totalShortPositionSize, _totalShortPositionSize)]) ++ appendTwap(divd(_qtAstR, _bsAstR)))
713746
714747
715-func deletePosition (_address) = [DeleteEntry(toCompositeKey(k_positionSize, _address)), DeleteEntry(toCompositeKey(k_positionMargin, _address)), DeleteEntry(toCompositeKey(k_positionOpenNotional, _address)), DeleteEntry(toCompositeKey(k_positionLastUpdatedCumulativePremiumFraction, _address)), IntegerEntry(toCompositeKey(k_positionClosedDate, _address), lastBlock.timestamp)]
748+func deletePosition (_address) = [DeleteEntry(toCompositeKey(k_positionSize, _address)), DeleteEntry(toCompositeKey(k_positionMargin, _address)), DeleteEntry(toCompositeKey(k_positionOpenNotional, _address)), DeleteEntry(toCompositeKey(k_positionLastUpdatedCumulativePremiumFraction, _address)), DeleteEntry(toCompositeKey(k_positionAsset, _address)), IntegerEntry(toCompositeKey(k_positionClosedDate, _address), lastBlock.timestamp)]
716749
717750
718751 func withdraw (_address,_amount) = {
719752 let balance = assetBalance(this, quoteAsset())
720753 if ((_amount > balance))
721754 then throw(((("Unable to withdraw " + toString(_amount)) + " from contract balance ") + toString(balance)))
722755 else [ScriptTransfer(_address, _amount, quoteAsset())]
723756 }
724757
725758
726759 func updateBalance (i) = if ((0 > i))
727760 then throw("Balance")
728761 else [IntegerEntry(k_balance, i)]
729762
730763
731764 func transferFee (i) = [ScriptTransfer(stakingAddress(), i, quoteAsset())]
732765
733766
734767 func doBurnArtifact (_burnArtifact,i) = if (_burnArtifact)
735768 then [Burn(valueOrErrorMessage(i.payments[1].assetId, "Invalid artifact"), 1)]
736769 else nil
770+
771+
772+func isSameAssetOrNoPosition (_trader,_assetId) = {
773+ let oldPositionSize = getPosition(_trader)._1
774+ if ((oldPositionSize == 0))
775+ then true
776+ else (getPositionAsset(_trader) == _assetId)
777+ }
778+
779+
780+func isSameAsset (_trader,_assetId) = (getPositionAsset(_trader) == _assetId)
781+
782+
783+func getBorrowedByTraderInMarketKey (_amm,_assetId,_trader) = ((((((k_trader_market_asset_collateral + "_") + _amm) + "_") + _assetId) + "_") + _trader)
784+
785+
786+func getBorrowedByTrader (_trader) = {
787+ let positionAsset = getPositionAsset(_trader)
788+ if ((positionAsset == toBase58String(quoteAsset())))
789+ then $Tuple2(0, positionAsset)
790+ else {
791+ let key = getBorrowedByTraderInMarketKey(toString(this), positionAsset, _trader)
792+ let borrow = valueOrElse(getInteger(collateralAddress(), key), 0)
793+ $Tuple2(borrow, positionAsset)
794+ }
795+ }
737796
738797
739798 @Callable(i)
740799 func pause () = if ((i.caller != adminAddress()))
741800 then throw("Invalid togglePause params")
742801 else [BooleanEntry(k_paused, true)]
743802
744803
745804
746805 @Callable(i)
747806 func unpause () = if ((i.caller != adminAddress()))
748807 then throw("Invalid togglePause params")
749808 else [BooleanEntry(k_paused, false)]
750809
751810
752811
753812 @Callable(i)
754813 func addLiquidity (_quoteAssetAmount) = if (if ((i.caller != adminAddress()))
755814 then true
756815 else (0 >= _quoteAssetAmount))
757816 then throw("Invalid addLiquidity params")
758817 else {
759818 let _qtAstR = qtAstR()
760819 let _bsAstR = bsAstR()
761820 let price = divd(_qtAstR, _bsAstR)
762821 let baseAssetAmountToAdd = divd(_quoteAssetAmount, price)
763822 let qtAstRAfter = (_qtAstR + _quoteAssetAmount)
764823 let bsAstRAfter = (_bsAstR + baseAssetAmountToAdd)
765824 updateAmmReserves(qtAstRAfter, bsAstRAfter)
766825 }
767826
768827
769828
770829 @Callable(i)
771830 func removeLiquidity (_quoteAssetAmount) = if (if ((i.caller != adminAddress()))
772831 then true
773832 else (0 >= _quoteAssetAmount))
774833 then throw("Invalid removeLiquidity params")
775834 else {
776835 let _qtAstR = qtAstR()
777836 let _bsAstR = bsAstR()
778837 let price = divd(_qtAstR, _bsAstR)
779838 let baseAssetAmountToRemove = divd(_quoteAssetAmount, price)
780839 let qtAstRAfter = (_qtAstR - _quoteAssetAmount)
781840 let bsAstRAfter = (_bsAstR - baseAssetAmountToRemove)
782841 updateAmmReserves(qtAstRAfter, bsAstRAfter)
783842 }
784843
785844
786845
787846 @Callable(i)
788847 func changeSettings (_initMarginRatio,_mmr,_liquidationFeeRatio,_fundingPeriod,_fee,_spreadLimit,_maxPriceImpact,_partialLiquidationRatio,_maxPriceSpread) = if ((i.caller != adminAddress()))
789848 then throw("Invalid changeSettings params")
790849 else updateSettings(_initMarginRatio, _mmr, _liquidationFeeRatio, _fundingPeriod, _fee, _spreadLimit, _maxPriceImpact, _partialLiquidationRatio, _maxPriceSpread)
791850
792851
793852
794853 @Callable(i)
795854 func initialize (_qtAstR,_bsAstR,_fundingPeriod,_initMarginRatio,_mmr,_liquidationFeeRatio,_fee,_oracle,_oracleKey,_coordinator,_spreadLimit,_maxPriceImpact,_partialLiquidationRatio,_maxPriceSpread) = if (if (if (if (if (if (if (if (if (if (if (if ((0 >= _qtAstR))
796855 then true
797856 else (0 >= _bsAstR))
798857 then true
799858 else (0 >= _fundingPeriod))
800859 then true
801860 else (0 >= _initMarginRatio))
802861 then true
803862 else (0 >= _mmr))
804863 then true
805864 else (0 >= _liquidationFeeRatio))
806865 then true
807866 else (0 >= _fee))
808867 then true
809868 else (0 >= _spreadLimit))
810869 then true
811870 else (0 >= _maxPriceImpact))
812871 then true
813872 else (0 >= _partialLiquidationRatio))
814873 then true
815874 else (0 >= _maxPriceSpread))
816875 then true
817876 else initialized())
818877 then throw("Invalid initialize parameters")
819878 else ((((updateAmm(_qtAstR, _bsAstR, 0, 0, 0, 0, 0) ++ updateSettings(_initMarginRatio, _mmr, _liquidationFeeRatio, _fundingPeriod, _fee, _spreadLimit, _maxPriceImpact, _partialLiquidationRatio, _maxPriceSpread)) ++ updateFunding((lastBlock.timestamp + _fundingPeriod), 0, 0, 0, 0)) ++ updateBalance(0)) ++ [BooleanEntry(k_initialized, true), StringEntry(k_ora, _oracle), StringEntry(k_ora_key, _oracleKey), StringEntry(k_coordinatorAddress, _coordinator)])
820879
821880
822881
823882 @Callable(i)
824883 func setInitMarginRatio (_initMarginRatio) = if (if ((0 >= _initMarginRatio))
825884 then true
826885 else !(initialized()))
827886 then throw("Invalid setInitMarginRatio parameters")
828887 else updateSettings(_initMarginRatio, maintenanceMarginRatio(), liquidationFeeRatio(), fundingPeriodRaw(), fee(), spreadLimit(), maxPriceImpact(), partialLiquidationRatio(), maxPriceSpread())
829888
830889
831890
832891 @Callable(i)
833892 func decreasePosition (_amount,_leverage,_minBaseAssetAmount) = if (if (if (if (if ((0 >= _amount))
834893 then true
835894 else !(initialized()))
836895 then true
837896 else !(requireMoreMarginRatio(divd(DECIMAL_UNIT, _leverage), initMarginRatio(), true)))
838897 then true
839898 else !(requireOpenPosition(toString(i.caller))))
840899 then true
841900 else paused())
842901 then throw("Invalid decreasePosition parameters")
843902 else {
844- let $t03908539237 = getPosition(toString(i.caller))
845- let oldPositionSize = $t03908539237._1
846- let oldPositionMargin = $t03908539237._2
847- let oldPositionOpenNotional = $t03908539237._3
848- let oldPositionLstUpdCPF = $t03908539237._4
903+ let $t04149241644 = getPosition(toString(i.caller))
904+ let oldPositionSize = $t04149241644._1
905+ let oldPositionMargin = $t04149241644._2
906+ let oldPositionOpenNotional = $t04149241644._3
907+ let oldPositionLstUpdCPF = $t04149241644._4
849908 let _direction = if ((oldPositionSize > 0))
850909 then DIR_SHORT
851910 else DIR_LONG
852911 let isAdd = (_direction == DIR_LONG)
853912 let openNotional = muld(_amount, _leverage)
854- let $t03941039526 = getPositionNotionalAndUnrealizedPnl(toString(i.caller), PNL_OPTION_SPOT)
855- let oldPositionNotional = $t03941039526._1
856- let unrealizedPnl = $t03941039526._2
857- let $t03953242081 = if ((oldPositionNotional > openNotional))
913+ let $t04181741933 = getPositionNotionalAndUnrealizedPnl(toString(i.caller), PNL_OPTION_SPOT)
914+ let oldPositionNotional = $t04181741933._1
915+ let unrealizedPnl = $t04181741933._2
916+ let $t04193944488 = if ((oldPositionNotional > openNotional))
858917 then {
859- let $t03990940128 = swapInput(isAdd, openNotional)
860- let exchangedPositionSize = $t03990940128._1
861- let quoteAssetReserveAfter = $t03990940128._2
862- let baseAssetReserveAfter = $t03990940128._3
863- let totalPositionSizeAfter = $t03990940128._4
864- let cumulativeNotionalAfter = $t03990940128._5
918+ let $t04231642535 = swapInput(isAdd, openNotional)
919+ let exchangedPositionSize = $t04231642535._1
920+ let quoteAssetReserveAfter = $t04231642535._2
921+ let baseAssetReserveAfter = $t04231642535._3
922+ let totalPositionSizeAfter = $t04231642535._4
923+ let cumulativeNotionalAfter = $t04231642535._5
865924 let exchangedPositionSizeAbs = abs(exchangedPositionSize)
866925 if (if ((_minBaseAssetAmount != 0))
867926 then (_minBaseAssetAmount > exchangedPositionSizeAbs)
868927 else false)
869928 then throw(((("Too little base asset exchanged, got " + toString(exchangedPositionSizeAbs)) + " expected ") + toString(_minBaseAssetAmount)))
870929 else {
871930 let realizedPnl = divd(muld(unrealizedPnl, exchangedPositionSizeAbs), abs(oldPositionSize))
872- let $t04056540810 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, realizedPnl)
873- let remainMargin = $t04056540810._1
874- let badDebt = $t04056540810._2
875- let fundingPayment = $t04056540810._3
931+ let $t04297243217 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, realizedPnl)
932+ let remainMargin = $t04297243217._1
933+ let badDebt = $t04297243217._2
934+ let fundingPayment = $t04297243217._3
876935 let exchangedQuoteAssetAmount = openNotional
877936 let unrealizedPnlAfter = (unrealizedPnl - realizedPnl)
878937 let remainOpenNotional = if ((oldPositionSize > 0))
879938 then ((oldPositionNotional - exchangedQuoteAssetAmount) - unrealizedPnlAfter)
880939 else ((unrealizedPnlAfter + oldPositionNotional) - exchangedQuoteAssetAmount)
881940 let newPositionSize = (oldPositionSize + exchangedPositionSize)
882941 $Tuple11(newPositionSize, remainMargin, abs(remainOpenNotional), latestCumulativePremiumFraction(newPositionSize), baseAssetReserveAfter, quoteAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, (openInterestNotional() - openNotional), (totalLongPositionSize() - (if ((newPositionSize > 0))
883942 then abs(exchangedPositionSize)
884943 else 0)), (totalShortPositionSize() - (if ((0 > newPositionSize))
885944 then abs(exchangedPositionSize)
886945 else 0)))
887946 }
888947 }
889948 else throw("Close position first")
890- let newPositionSize = $t03953242081._1
891- let newPositionRemainMargin = $t03953242081._2
892- let newPositionOpenNotional = $t03953242081._3
893- let newPositionLatestCPF = $t03953242081._4
894- let baseAssetReserveAfter = $t03953242081._5
895- let quoteAssetReserveAfter = $t03953242081._6
896- let totalPositionSizeAfter = $t03953242081._7
897- let cumulativeNotionalAfter = $t03953242081._8
898- let openInterestNotionalAfter = $t03953242081._9
899- let totalLongAfter = $t03953242081._10
900- let totalShortAfter = $t03953242081._11
949+ let newPositionSize = $t04193944488._1
950+ let newPositionRemainMargin = $t04193944488._2
951+ let newPositionOpenNotional = $t04193944488._3
952+ let newPositionLatestCPF = $t04193944488._4
953+ let baseAssetReserveAfter = $t04193944488._5
954+ let quoteAssetReserveAfter = $t04193944488._6
955+ let totalPositionSizeAfter = $t04193944488._7
956+ let cumulativeNotionalAfter = $t04193944488._8
957+ let openInterestNotionalAfter = $t04193944488._9
958+ let totalLongAfter = $t04193944488._10
959+ let totalShortAfter = $t04193944488._11
901960 let notifyNotional = invoke(minerAddress(), "notifyNotional", [toString(i.caller), newPositionOpenNotional], nil)
902961 if ((notifyNotional == notifyNotional))
903962 then (updatePosition(toString(i.caller), newPositionSize, newPositionRemainMargin, newPositionOpenNotional, newPositionLatestCPF) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter))
904963 else throw("Strict value is not equal to itself.")
905964 }
906965
907966
908967
909968 @Callable(i)
910969 func increasePosition (_direction,_leverage,_minBaseAssetAmount,_refLink) = {
970+ let _trader = toString(i.caller)
911971 let _rawAmount = i.payments[0].amount
912- if (if (if (if (if (if (if ((_direction != DIR_LONG))
972+ let _assetId = i.payments[0].assetId
973+ let _assetIdStr = toBase58String(value(_assetId))
974+ let isQuoteAsset = (_assetId == quoteAsset())
975+ let isCollateralAsset = isWhitelistAsset(_assetIdStr)
976+ if (if (if (if (if (if (if (if ((_direction != DIR_LONG))
913977 then (_direction != DIR_SHORT)
914978 else false)
915979 then true
916980 else (0 >= _rawAmount))
917981 then true
918982 else !(initialized()))
919983 then true
920- else (i.payments[0].assetId != quoteAsset()))
984+ else if (!(isQuoteAsset))
985+ then !(isCollateralAsset)
986+ else false)
987+ then true
988+ else !(isSameAssetOrNoPosition(_trader, _assetIdStr)))
921989 then true
922990 else !(requireMoreMarginRatio(divd(DECIMAL_UNIT, _leverage), initMarginRatio(), true)))
923991 then true
924992 else paused())
925993 then throw("Invalid increasePosition parameters")
926994 else {
927- let _trader = toString(i.caller)
928995 let baseFee = fee()
929- let $t04319643247 = getAdjustedFee(i)
930- let adjustedFee = $t04319643247._1
931- let burnArtifact = $t04319643247._2
996+ let $t04585045901 = getAdjustedFee(i)
997+ let adjustedFee = $t04585045901._1
998+ let burnArtifact = $t04585045901._2
932999 let rawFeeAmount = muld(_rawAmount, adjustedFee)
933- let referrerFeeAny = invoke(referralAddress(), "acceptPaymentWithLink", [_trader, _refLink], [AttachedPayment(quoteAsset(), rawFeeAmount)])
934- if ((referrerFeeAny == referrerFeeAny))
1000+ let _amount = (_rawAmount - rawFeeAmount)
1001+ let distributeFeeAmount = if (isCollateralAsset)
9351002 then {
936- let referrerFee = match referrerFeeAny {
937- case x: Int =>
938- x
939- case _ =>
940- throw("Invalid referrerFee")
1003+ let doBorrow = invoke(collateralAddress(), "borrow", [_trader], [AttachedPayment(_assetId, _amount)])
1004+ if ((doBorrow == doBorrow))
1005+ then {
1006+ let balanceBefore = assetBalance(this, quoteAsset())
1007+ if ((balanceBefore == balanceBefore))
1008+ then {
1009+ let doSwap = invoke(swapAddress(), "swap", [toBase58String(quoteAsset()), 0], [AttachedPayment(_assetId, rawFeeAmount)])
1010+ if ((doSwap == doSwap))
1011+ then {
1012+ let balanceAfter = assetBalance(this, quoteAsset())
1013+ if ((balanceAfter == balanceAfter))
1014+ then {
1015+ let exchangedAmount = (balanceAfter - balanceBefore)
1016+ if ((exchangedAmount == exchangedAmount))
1017+ then exchangedAmount
1018+ else throw("Strict value is not equal to itself.")
1019+ }
1020+ else throw("Strict value is not equal to itself.")
1021+ }
1022+ else throw("Strict value is not equal to itself.")
1023+ }
1024+ else throw("Strict value is not equal to itself.")
1025+ }
1026+ else throw("Strict value is not equal to itself.")
9411027 }
942- let _amount = (_rawAmount - rawFeeAmount)
943- let feeAmount = (rawFeeAmount - referrerFee)
944- let $t04369643836 = getPosition(_trader)
945- let oldPositionSize = $t04369643836._1
946- let oldPositionMargin = $t04369643836._2
947- let oldPositionOpenNotional = $t04369643836._3
948- let oldPositionLstUpdCPF = $t04369643836._4
949- let isNewPosition = (oldPositionSize == 0)
950- let isSameDirection = if ((oldPositionSize > 0))
951- then (_direction == DIR_LONG)
952- else (_direction == DIR_SHORT)
953- let expandExisting = if (!(isNewPosition))
954- then isSameDirection
955- else false
956- let isAdd = (_direction == DIR_LONG)
957- let $t04412546710 = if (if (isNewPosition)
958- then true
959- else expandExisting)
1028+ else rawFeeAmount
1029+ if ((distributeFeeAmount == distributeFeeAmount))
1030+ then {
1031+ let referrerFeeAny = invoke(referralAddress(), "acceptPaymentWithLink", [_trader, _refLink], [AttachedPayment(quoteAsset(), distributeFeeAmount)])
1032+ if ((referrerFeeAny == referrerFeeAny))
9601033 then {
961- let openNotional = muld(_amount, _leverage)
962- let $t04454944755 = swapInput(isAdd, openNotional)
963- let amountBaseAssetBought = $t04454944755._1
964- let quoteAssetReserveAfter = $t04454944755._2
965- let baseAssetReserveAfter = $t04454944755._3
966- let totalPositionSizeAfter = $t04454944755._4
967- let cumulativeNotionalAfter = $t04454944755._5
968- if (if ((_minBaseAssetAmount != 0))
969- then (_minBaseAssetAmount > abs(amountBaseAssetBought))
970- else false)
971- then throw(((("Limit error: " + toString(abs(amountBaseAssetBought))) + " < ") + toString(_minBaseAssetAmount)))
1034+ let referrerFee = match referrerFeeAny {
1035+ case x: Int =>
1036+ x
1037+ case _ =>
1038+ throw("Invalid referrerFee")
1039+ }
1040+ let feeAmount = (distributeFeeAmount - referrerFee)
1041+ let $t04721747357 = getPosition(_trader)
1042+ let oldPositionSize = $t04721747357._1
1043+ let oldPositionMargin = $t04721747357._2
1044+ let oldPositionOpenNotional = $t04721747357._3
1045+ let oldPositionLstUpdCPF = $t04721747357._4
1046+ let isNewPosition = (oldPositionSize == 0)
1047+ let isSameDirection = if ((oldPositionSize > 0))
1048+ then (_direction == DIR_LONG)
1049+ else (_direction == DIR_SHORT)
1050+ let expandExisting = if (!(isNewPosition))
1051+ then isSameDirection
1052+ else false
1053+ let isAdd = (_direction == DIR_LONG)
1054+ let $t04764650231 = if (if (isNewPosition)
1055+ then true
1056+ else expandExisting)
1057+ then {
1058+ let openNotional = muld(_amount, _leverage)
1059+ let $t04807048276 = swapInput(isAdd, openNotional)
1060+ let amountBaseAssetBought = $t04807048276._1
1061+ let quoteAssetReserveAfter = $t04807048276._2
1062+ let baseAssetReserveAfter = $t04807048276._3
1063+ let totalPositionSizeAfter = $t04807048276._4
1064+ let cumulativeNotionalAfter = $t04807048276._5
1065+ if (if ((_minBaseAssetAmount != 0))
1066+ then (_minBaseAssetAmount > abs(amountBaseAssetBought))
1067+ else false)
1068+ then throw(((("Limit error: " + toString(abs(amountBaseAssetBought))) + " < ") + toString(_minBaseAssetAmount)))
1069+ else {
1070+ let newPositionSize = (oldPositionSize + amountBaseAssetBought)
1071+ let increaseMarginRequirement = divd(openNotional, _leverage)
1072+ let $t04865748896 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, increaseMarginRequirement)
1073+ let remainMargin = $t04865748896._1
1074+ let x1 = $t04865748896._2
1075+ let x2 = $t04865748896._3
1076+ if (!(requireNotOverSpreadLimit(quoteAssetReserveAfter, baseAssetReserveAfter)))
1077+ then throw("Over max spread limit")
1078+ else $Tuple11(newPositionSize, remainMargin, (oldPositionOpenNotional + openNotional), latestCumulativePremiumFraction(newPositionSize), baseAssetReserveAfter, quoteAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, (openInterestNotional() + openNotional), (totalLongPositionSize() + (if ((newPositionSize > 0))
1079+ then abs(amountBaseAssetBought)
1080+ else 0)), (totalShortPositionSize() + (if ((0 > newPositionSize))
1081+ then abs(amountBaseAssetBought)
1082+ else 0)))
1083+ }
1084+ }
9721085 else {
973- let newPositionSize = (oldPositionSize + amountBaseAssetBought)
974- let increaseMarginRequirement = divd(openNotional, _leverage)
975- let $t04513645375 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, increaseMarginRequirement)
976- let remainMargin = $t04513645375._1
977- let x1 = $t04513645375._2
978- let x2 = $t04513645375._3
979- if (!(requireNotOverSpreadLimit(quoteAssetReserveAfter, baseAssetReserveAfter)))
980- then throw("Over max spread limit")
981- else $Tuple11(newPositionSize, remainMargin, (oldPositionOpenNotional + openNotional), latestCumulativePremiumFraction(newPositionSize), baseAssetReserveAfter, quoteAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, (openInterestNotional() + openNotional), (totalLongPositionSize() + (if ((newPositionSize > 0))
982- then abs(amountBaseAssetBought)
983- else 0)), (totalShortPositionSize() + (if ((0 > newPositionSize))
984- then abs(amountBaseAssetBought)
985- else 0)))
1086+ let openNotional = muld(_amount, _leverage)
1087+ let $t04992450040 = getPositionNotionalAndUnrealizedPnl(toString(i.caller), PNL_OPTION_SPOT)
1088+ let oldPositionNotional = $t04992450040._1
1089+ let unrealizedPnl = $t04992450040._2
1090+ if ((oldPositionNotional > openNotional))
1091+ then throw("Use decreasePosition to decrease position size")
1092+ else throw("Close position first")
9861093 }
987- }
988- else {
989- let openNotional = muld(_amount, _leverage)
990- let $t04640346519 = getPositionNotionalAndUnrealizedPnl(toString(i.caller), PNL_OPTION_SPOT)
991- let oldPositionNotional = $t04640346519._1
992- let unrealizedPnl = $t04640346519._2
993- if ((oldPositionNotional > openNotional))
994- then throw("Use decreasePosition to decrease position size")
995- else throw("Close position first")
996- }
997- let newPositionSize = $t04412546710._1
998- let newPositionRemainMargin = $t04412546710._2
999- let newPositionOpenNotional = $t04412546710._3
1000- let newPositionLatestCPF = $t04412546710._4
1001- let baseAssetReserveAfter = $t04412546710._5
1002- let quoteAssetReserveAfter = $t04412546710._6
1003- let totalPositionSizeAfter = $t04412546710._7
1004- let cumulativeNotionalAfter = $t04412546710._8
1005- let openInterestNotionalAfter = $t04412546710._9
1006- let totalLongAfter = $t04412546710._10
1007- let totalShortAfter = $t04412546710._11
1008- let feeToStakers = (feeAmount / 2)
1009- let feeToInsurance = (feeAmount - feeToStakers)
1010- let stake = invoke(managerAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), _amount)])
1011- if ((stake == stake))
1012- then {
1013- let depositInsurance = invoke(insuranceAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), feeToInsurance)])
1014- if ((depositInsurance == depositInsurance))
1094+ let newPositionSize = $t04764650231._1
1095+ let newPositionRemainMargin = $t04764650231._2
1096+ let newPositionOpenNotional = $t04764650231._3
1097+ let newPositionLatestCPF = $t04764650231._4
1098+ let baseAssetReserveAfter = $t04764650231._5
1099+ let quoteAssetReserveAfter = $t04764650231._6
1100+ let totalPositionSizeAfter = $t04764650231._7
1101+ let cumulativeNotionalAfter = $t04764650231._8
1102+ let openInterestNotionalAfter = $t04764650231._9
1103+ let totalLongAfter = $t04764650231._10
1104+ let totalShortAfter = $t04764650231._11
1105+ let feeToStakers = (feeAmount / 2)
1106+ let feeToInsurance = (feeAmount - feeToStakers)
1107+ let stake = invoke(managerAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), _amount)])
1108+ if ((stake == stake))
10151109 then {
1016- let notifyFee = invoke(minerAddress(), "notifyFees", [_trader, feeAmount], nil)
1017- if ((notifyFee == notifyFee))
1110+ let depositInsurance = invoke(insuranceAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), feeToInsurance)])
1111+ if ((depositInsurance == depositInsurance))
10181112 then {
1019- let notifyNotional = invoke(minerAddress(), "notifyNotional", [_trader, newPositionOpenNotional], nil)
1020- if ((notifyNotional == notifyNotional))
1021- then ((((updatePosition(_trader, newPositionSize, newPositionRemainMargin, newPositionOpenNotional, newPositionLatestCPF) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter)) ++ transferFee(feeToStakers)) ++ updateBalance((cbalance() + _amount))) ++ doBurnArtifact(burnArtifact, i))
1113+ let notifyFee = invoke(minerAddress(), "notifyFees", [_trader, feeAmount], nil)
1114+ if ((notifyFee == notifyFee))
1115+ then {
1116+ let notifyNotional = invoke(minerAddress(), "notifyNotional", [_trader, newPositionOpenNotional], nil)
1117+ if ((notifyNotional == notifyNotional))
1118+ then (((((updatePosition(_trader, newPositionSize, newPositionRemainMargin, newPositionOpenNotional, newPositionLatestCPF) ++ updatePositionAsset(_trader, _assetIdStr)) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter)) ++ transferFee(feeToStakers)) ++ updateBalance((cbalance() + _amount))) ++ doBurnArtifact(burnArtifact, i))
1119+ else throw("Strict value is not equal to itself.")
1120+ }
10221121 else throw("Strict value is not equal to itself.")
10231122 }
10241123 else throw("Strict value is not equal to itself.")
10251124 }
10261125 else throw("Strict value is not equal to itself.")
10271126 }
10281127 else throw("Strict value is not equal to itself.")
10291128 }
10301129 else throw("Strict value is not equal to itself.")
10311130 }
10321131 }
10331132
10341133
10351134
10361135 @Callable(i)
10371136 func addMargin () = {
1137+ let _trader = toString(i.caller)
10381138 let _rawAmount = i.payments[0].amount
1039- if (if (if (if ((i.payments[0].assetId != quoteAsset()))
1139+ let _assetId = i.payments[0].assetId
1140+ let _assetIdStr = toBase58String(value(_assetId))
1141+ let isQuoteAsset = (_assetId == quoteAsset())
1142+ let isCollateralAsset = isWhitelistAsset(_assetIdStr)
1143+ if (if (if (if (if (if (!(isQuoteAsset))
1144+ then !(isCollateralAsset)
1145+ else false)
10401146 then true
10411147 else !(requireOpenPosition(toString(i.caller))))
1148+ then true
1149+ else !(isSameAsset(_trader, _assetIdStr)))
10421150 then true
10431151 else !(initialized()))
10441152 then true
10451153 else paused())
10461154 then throw("Invalid addMargin parameters")
10471155 else {
1048- let _trader = toString(i.caller)
1049- let $t04817848229 = getAdjustedFee(i)
1050- let adjustedFee = $t04817848229._1
1051- let burnArtifact = $t04817848229._2
1156+ let $t05198752038 = getAdjustedFee(i)
1157+ let adjustedFee = $t05198752038._1
1158+ let burnArtifact = $t05198752038._2
10521159 let rawFeeAmount = muld(_rawAmount, adjustedFee)
1053- let referrerFeeAny = invoke(referralAddress(), "acceptPayment", [_trader], [AttachedPayment(quoteAsset(), rawFeeAmount)])
1054- if ((referrerFeeAny == referrerFeeAny))
1160+ let _amount = (_rawAmount - rawFeeAmount)
1161+ let distributeFeeAmount = if (isCollateralAsset)
10551162 then {
1056- let referrerFee = match referrerFeeAny {
1057- case x: Int =>
1058- x
1059- case _ =>
1060- throw("Invalid referrerFee")
1163+ let doBorrow = invoke(collateralAddress(), "borrow", [_trader], [AttachedPayment(_assetId, _amount)])
1164+ if ((doBorrow == doBorrow))
1165+ then {
1166+ let balanceBefore = assetBalance(this, quoteAsset())
1167+ if ((balanceBefore == balanceBefore))
1168+ then {
1169+ let doSwap = invoke(swapAddress(), "swap", [toBase58String(quoteAsset()), 0], [AttachedPayment(_assetId, rawFeeAmount)])
1170+ if ((doSwap == doSwap))
1171+ then {
1172+ let balanceAfter = assetBalance(this, quoteAsset())
1173+ if ((balanceAfter == balanceAfter))
1174+ then {
1175+ let exchangedAmount = (balanceAfter - balanceBefore)
1176+ if ((exchangedAmount == exchangedAmount))
1177+ then exchangedAmount
1178+ else throw("Strict value is not equal to itself.")
1179+ }
1180+ else throw("Strict value is not equal to itself.")
1181+ }
1182+ else throw("Strict value is not equal to itself.")
1183+ }
1184+ else throw("Strict value is not equal to itself.")
1185+ }
1186+ else throw("Strict value is not equal to itself.")
10611187 }
1062- let feeAmount = (rawFeeAmount - referrerFee)
1063- let _amount = (_rawAmount - rawFeeAmount)
1064- let $t04866148801 = getPosition(_trader)
1065- let oldPositionSize = $t04866148801._1
1066- let oldPositionMargin = $t04866148801._2
1067- let oldPositionOpenNotional = $t04866148801._3
1068- let oldPositionLstUpdCPF = $t04866148801._4
1069- let feeToStakers = (feeAmount / 2)
1070- let feeToInsurance = (feeAmount - feeToStakers)
1071- let stake = invoke(managerAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), _amount)])
1072- if ((stake == stake))
1188+ else rawFeeAmount
1189+ if ((distributeFeeAmount == distributeFeeAmount))
1190+ then {
1191+ let referrerFeeAny = invoke(referralAddress(), "acceptPayment", [_trader], [AttachedPayment(quoteAsset(), distributeFeeAmount)])
1192+ if ((referrerFeeAny == referrerFeeAny))
10731193 then {
1074- let depositInsurance = invoke(insuranceAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), feeToInsurance)])
1075- if ((depositInsurance == depositInsurance))
1194+ let referrerFee = match referrerFeeAny {
1195+ case x: Int =>
1196+ x
1197+ case _ =>
1198+ throw("Invalid referrerFee")
1199+ }
1200+ let feeAmount = (distributeFeeAmount - referrerFee)
1201+ let $t05333753477 = getPosition(_trader)
1202+ let oldPositionSize = $t05333753477._1
1203+ let oldPositionMargin = $t05333753477._2
1204+ let oldPositionOpenNotional = $t05333753477._3
1205+ let oldPositionLstUpdCPF = $t05333753477._4
1206+ let feeToStakers = (feeAmount / 2)
1207+ let feeToInsurance = (feeAmount - feeToStakers)
1208+ let stake = invoke(managerAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), _amount)])
1209+ if ((stake == stake))
10761210 then {
1077- let notifyFee = invoke(minerAddress(), "notifyFees", [_trader, feeAmount], nil)
1078- if ((notifyFee == notifyFee))
1079- then (((updatePosition(_trader, oldPositionSize, (oldPositionMargin + _amount), oldPositionOpenNotional, oldPositionLstUpdCPF) ++ transferFee(feeToStakers)) ++ updateBalance((cbalance() + _amount))) ++ doBurnArtifact(burnArtifact, i))
1211+ let depositInsurance = invoke(insuranceAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), feeToInsurance)])
1212+ if ((depositInsurance == depositInsurance))
1213+ then {
1214+ let notifyFee = invoke(minerAddress(), "notifyFees", [_trader, feeAmount], nil)
1215+ if ((notifyFee == notifyFee))
1216+ then (((updatePosition(_trader, oldPositionSize, (oldPositionMargin + _amount), oldPositionOpenNotional, oldPositionLstUpdCPF) ++ transferFee(feeToStakers)) ++ updateBalance((cbalance() + _amount))) ++ doBurnArtifact(burnArtifact, i))
1217+ else throw("Strict value is not equal to itself.")
1218+ }
10801219 else throw("Strict value is not equal to itself.")
10811220 }
10821221 else throw("Strict value is not equal to itself.")
10831222 }
10841223 else throw("Strict value is not equal to itself.")
10851224 }
10861225 else throw("Strict value is not equal to itself.")
10871226 }
10881227 }
10891228
10901229
10911230
10921231 @Callable(i)
1093-func removeMargin (_amount) = if (if (if (if ((0 >= _amount))
1094- then true
1095- else !(requireOpenPosition(toString(i.caller))))
1096- then true
1097- else !(initialized()))
1098- then true
1099- else paused())
1100- then throw("Invalid removeMargin parameters")
1101- else {
1102- let $t04982049972 = getPosition(toString(i.caller))
1103- let oldPositionSize = $t04982049972._1
1104- let oldPositionMargin = $t04982049972._2
1105- let oldPositionOpenNotional = $t04982049972._3
1106- let oldPositionLstUpdCPF = $t04982049972._4
1107- let marginDelta = -(_amount)
1108- let $t05000950188 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, marginDelta)
1109- let remainMargin = $t05000950188._1
1110- let badDebt = $t05000950188._2
1111- if ((badDebt != 0))
1112- then throw("Invalid removed margin amount")
1113- else {
1114- let marginRatio = calcMarginRatio(remainMargin, badDebt, oldPositionOpenNotional)
1115- if (!(requireMoreMarginRatio(marginRatio, initMarginRatio(), true)))
1116- then throw(((("Too much margin removed: " + toString(marginRatio)) + " < ") + toString(initMarginRatio())))
1117- else {
1118- let unstake = invoke(managerAddress(), "withdraw", [toBase58String(quoteAsset()), _amount], nil)
1119- if ((unstake == unstake))
1120- then ((updatePosition(toString(i.caller), oldPositionSize, remainMargin, oldPositionOpenNotional, latestCumulativePremiumFraction(oldPositionSize)) ++ withdraw(i.caller, _amount)) ++ updateBalance((cbalance() - _amount)))
1121- else throw("Strict value is not equal to itself.")
1122- }
1123- }
1124- }
1232+func removeMargin (_amount) = {
1233+ let _trader = toString(i.caller)
1234+ if (if (if (if ((0 >= _amount))
1235+ then true
1236+ else !(requireOpenPosition(_trader)))
1237+ then true
1238+ else !(initialized()))
1239+ then true
1240+ else paused())
1241+ then throw("Invalid removeMargin parameters")
1242+ else {
1243+ let $t05452054660 = getPosition(_trader)
1244+ let oldPositionSize = $t05452054660._1
1245+ let oldPositionMargin = $t05452054660._2
1246+ let oldPositionOpenNotional = $t05452054660._3
1247+ let oldPositionLstUpdCPF = $t05452054660._4
1248+ let marginDelta = -(_amount)
1249+ let $t05469754876 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, marginDelta)
1250+ let remainMargin = $t05469754876._1
1251+ let badDebt = $t05469754876._2
1252+ if ((badDebt != 0))
1253+ then throw("Invalid removed margin amount")
1254+ else {
1255+ let marginRatio = calcMarginRatio(remainMargin, badDebt, oldPositionOpenNotional)
1256+ if (!(requireMoreMarginRatio(marginRatio, initMarginRatio(), true)))
1257+ then throw(((("Too much margin removed: " + toString(marginRatio)) + " < ") + toString(initMarginRatio())))
1258+ else {
1259+ let quoteAssetStr = toBase58String(quoteAsset())
1260+ let $t05532055374 = getBorrowedByTrader(_trader)
1261+ let borrowed = $t05532055374._1
1262+ let assetId = $t05532055374._2
1263+ let toRepay = if ((_amount > borrowed))
1264+ then borrowed
1265+ else _amount
1266+ let toWithdraw = if ((borrowed > _amount))
1267+ then 0
1268+ else (_amount - borrowed)
1269+ let finalBorrow = (borrowed - toRepay)
1270+ let switchPositionToQuote = if ((finalBorrow > 0))
1271+ then nil
1272+ else updatePositionAsset(_trader, quoteAssetStr)
1273+ let doSanityCheck = if (((toRepay + toWithdraw) != _amount))
1274+ then throw(((((("toRepay=" + toString(toRepay)) + " + toWithdraw=") + toString(toWithdraw)) + " != ") + toString(_amount)))
1275+ else nil
1276+ if ((doSanityCheck == doSanityCheck))
1277+ then {
1278+ let doUnstake = invoke(managerAddress(), "withdraw", [quoteAssetStr, _amount], nil)
1279+ if ((doUnstake == doUnstake))
1280+ then {
1281+ let returnCollateralAction = if ((toRepay > 0))
1282+ then {
1283+ let doRepay = invoke(collateralAddress(), "repay", [_trader, assetId], [AttachedPayment(quoteAsset(), toRepay)])
1284+ if ((doRepay == doRepay))
1285+ then [ScriptTransfer(i.caller, toRepay, fromBase58String(assetId))]
1286+ else throw("Strict value is not equal to itself.")
1287+ }
1288+ else nil
1289+ if ((returnCollateralAction == returnCollateralAction))
1290+ then (updatePosition(_trader, oldPositionSize, remainMargin, oldPositionOpenNotional, latestCumulativePremiumFraction(oldPositionSize)) ++ (if ((toWithdraw > 0))
1291+ then withdraw(i.caller, toWithdraw)
1292+ else (((nil ++ updateBalance((cbalance() - _amount))) ++ switchPositionToQuote) ++ returnCollateralAction)))
1293+ else throw("Strict value is not equal to itself.")
1294+ }
1295+ else throw("Strict value is not equal to itself.")
1296+ }
1297+ else throw("Strict value is not equal to itself.")
1298+ }
1299+ }
1300+ }
1301+ }
11251302
11261303
11271304
11281305 @Callable(i)
11291306 func closePosition () = {
1130- let caller = getActualCaller(i)
1131- let callerAddress = valueOrErrorMessage(addressFromString(caller), "Invalid caller")
1132- if (if (if (!(requireOpenPosition(caller)))
1307+ let _trader = getActualCaller(i)
1308+ let _traderAddress = valueOrErrorMessage(addressFromString(_trader), "Invalid caller")
1309+ if (if (if (!(requireOpenPosition(_trader)))
11331310 then true
11341311 else !(initialized()))
11351312 then true
11361313 else paused())
11371314 then throw("Invalid closePosition parameters")
11381315 else {
1139- let $t05138251759 = internalClosePosition(caller, true)
1140- let x1 = $t05138251759._1
1141- let positionBadDebt = $t05138251759._2
1142- let realizedPnl = $t05138251759._3
1143- let marginToVault = $t05138251759._4
1144- let quoteAssetReserveAfter = $t05138251759._5
1145- let baseAssetReserveAfter = $t05138251759._6
1146- let totalPositionSizeAfter = $t05138251759._7
1147- let cumulativeNotionalAfter = $t05138251759._8
1148- let openInterestNotionalAfter = $t05138251759._9
1149- let x2 = $t05138251759._10
1150- let totalLongAfter = $t05138251759._11
1151- let totalShortAfter = $t05138251759._12
1316+ let $t05756657944 = internalClosePosition(_trader, true)
1317+ let x1 = $t05756657944._1
1318+ let positionBadDebt = $t05756657944._2
1319+ let realizedPnl = $t05756657944._3
1320+ let marginToVault = $t05756657944._4
1321+ let quoteAssetReserveAfter = $t05756657944._5
1322+ let baseAssetReserveAfter = $t05756657944._6
1323+ let totalPositionSizeAfter = $t05756657944._7
1324+ let cumulativeNotionalAfter = $t05756657944._8
1325+ let openInterestNotionalAfter = $t05756657944._9
1326+ let x2 = $t05756657944._10
1327+ let totalLongAfter = $t05756657944._11
1328+ let totalShortAfter = $t05756657944._12
11521329 if ((positionBadDebt > 0))
11531330 then throw("Unable to close position with bad debt")
11541331 else {
11551332 let withdrawAmount = abs(marginToVault)
11561333 let ammBalance = (cbalance() - withdrawAmount)
1157- let $t05196852110 = if ((0 > ammBalance))
1334+ let $t05815358295 = if ((0 > ammBalance))
11581335 then $Tuple2(0, abs(ammBalance))
11591336 else $Tuple2(ammBalance, 0)
1160- let ammNewBalance = $t05196852110._1
1161- let getFromInsurance = $t05196852110._2
1337+ let ammNewBalance = $t05815358295._1
1338+ let getFromInsurance = $t05815358295._2
11621339 let x = if ((getFromInsurance > 0))
11631340 then {
11641341 let withdrawInsurance = invoke(insuranceAddress(), "withdraw", [getFromInsurance], nil)
11651342 if ((withdrawInsurance == withdrawInsurance))
11661343 then nil
11671344 else throw("Strict value is not equal to itself.")
11681345 }
11691346 else nil
11701347 if ((x == x))
11711348 then {
11721349 let unstake = invoke(managerAddress(), "withdraw", [toBase58String(quoteAsset()), (withdrawAmount - getFromInsurance)], nil)
11731350 if ((unstake == unstake))
11741351 then {
1175- let notifyNotional = invoke(minerAddress(), "notifyNotional", [caller, 0], nil)
1176- if ((notifyNotional == notifyNotional))
1177- then (((deletePosition(caller) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter)) ++ withdraw(callerAddress, withdrawAmount)) ++ updateBalance(ammNewBalance))
1352+ let $t05879758851 = getBorrowedByTrader(_trader)
1353+ let borrowed = $t05879758851._1
1354+ let assetId = $t05879758851._2
1355+ let $t05886659783 = if ((borrowed > 0))
1356+ then if ((withdrawAmount >= borrowed))
1357+ then {
1358+ let doRepay = invoke(collateralAddress(), "repay", [_trader, assetId], [AttachedPayment(quoteAsset(), borrowed)])
1359+ if ((doRepay == doRepay))
1360+ then $Tuple2([ScriptTransfer(_traderAddress, borrowed, fromBase58String(assetId))], (withdrawAmount - borrowed))
1361+ else throw("Strict value is not equal to itself.")
1362+ }
1363+ else {
1364+ let realizeAndClose = invoke(collateralAddress(), "realizePartiallyAndClose", [_trader, assetId], [AttachedPayment(quoteAsset(), withdrawAmount)])
1365+ if ((realizeAndClose == realizeAndClose))
1366+ then $Tuple2([ScriptTransfer(_traderAddress, withdrawAmount, fromBase58String(assetId))], 0)
1367+ else throw("Strict value is not equal to itself.")
1368+ }
1369+ else $Tuple2(nil, withdrawAmount)
1370+ if (($t05886659783 == $t05886659783))
1371+ then {
1372+ let quoteWithdrawAmount = $t05886659783._2
1373+ let sendCollateralAction = $t05886659783._1
1374+ let notifyNotional = invoke(minerAddress(), "notifyNotional", [_trader, 0], nil)
1375+ if ((notifyNotional == notifyNotional))
1376+ then ((deletePosition(_trader) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter)) ++ (if ((quoteWithdrawAmount > 0))
1377+ then withdraw(_traderAddress, quoteWithdrawAmount)
1378+ else ((nil ++ updateBalance(ammNewBalance)) ++ sendCollateralAction)))
1379+ else throw("Strict value is not equal to itself.")
1380+ }
11781381 else throw("Strict value is not equal to itself.")
11791382 }
11801383 else throw("Strict value is not equal to itself.")
11811384 }
11821385 else throw("Strict value is not equal to itself.")
11831386 }
11841387 }
11851388 }
11861389
11871390
11881391
11891392 @Callable(i)
11901393 func liquidate (_trader) = {
11911394 let spotMarginRatio = getMarginRatioByOption(_trader, PNL_OPTION_SPOT)
11921395 let marginRatio = if (isOverFluctuationLimit())
11931396 then {
11941397 let oracleMarginRatio = getMarginRatioByOption(_trader, PNL_OPTION_ORACLE)
11951398 vmax(spotMarginRatio, oracleMarginRatio)
11961399 }
11971400 else spotMarginRatio
11981401 if (if (if (if (!(requireMoreMarginRatio(marginRatio, maintenanceMarginRatio(), false)))
11991402 then true
12001403 else !(requireOpenPosition(_trader)))
12011404 then true
12021405 else !(initialized()))
12031406 then true
12041407 else paused())
12051408 then throw("Unable to liquidate")
12061409 else if (if (if ((spotMarginRatio > liquidationFeeRatio()))
12071410 then (partialLiquidationRatio() > 0)
12081411 else false)
12091412 then (DECIMAL_UNIT > partialLiquidationRatio())
12101413 else false)
12111414 then {
1212- let $t05418154331 = getPosition(_trader)
1213- let oldPositionSize = $t05418154331._1
1214- let oldPositionMargin = $t05418154331._2
1215- let oldPositionOpenNotional = $t05418154331._3
1216- let oldPositionLstUpdCPF = $t05418154331._4
1415+ let $t06148361633 = getPosition(_trader)
1416+ let oldPositionSize = $t06148361633._1
1417+ let oldPositionMargin = $t06148361633._2
1418+ let oldPositionOpenNotional = $t06148361633._3
1419+ let oldPositionLstUpdCPF = $t06148361633._4
12171420 let _direction = if ((oldPositionSize > 0))
12181421 then DIR_SHORT
12191422 else DIR_LONG
12201423 let isAdd = (_direction == DIR_LONG)
12211424 let exchangedQuoteAssetAmount = getPartialLiquidationAmount(_trader, oldPositionSize)
1222- let $t05455654660 = getPositionNotionalAndUnrealizedPnl(_trader, PNL_OPTION_SPOT)
1223- let oldPositionNotional = $t05455654660._1
1224- let unrealizedPnl = $t05455654660._2
1225- let $t05466854958 = swapInput(isAdd, exchangedQuoteAssetAmount)
1226- let exchangedPositionSize = $t05466854958._1
1227- let quoteAssetReserveAfter = $t05466854958._2
1228- let baseAssetReserveAfter = $t05466854958._3
1229- let totalPositionSizeAfter = $t05466854958._4
1230- let cumulativeNotionalAfter = $t05466854958._5
1231- let realizedPnl = divd(muld(unrealizedPnl, abs(exchangedPositionSize)), abs(oldPositionSize))
1232- let $t05506555298 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, realizedPnl)
1233- let remainMargin = $t05506555298._1
1234- let badDebt = $t05506555298._2
1235- let fundingPayment = $t05506555298._3
1425+ let $t06185861962 = getPositionNotionalAndUnrealizedPnl(_trader, PNL_OPTION_SPOT)
1426+ let oldPositionNotional = $t06185861962._1
1427+ let unrealizedPnl = $t06185861962._2
1428+ let $t06197062202 = swapInput(isAdd, exchangedQuoteAssetAmount)
1429+ let exchangedPositionSize = $t06197062202._1
1430+ let quoteAssetReserveAfter = $t06197062202._2
1431+ let baseAssetReserveAfter = $t06197062202._3
1432+ let totalPositionSizeAfter = $t06197062202._4
1433+ let cumulativeNotionalAfter = $t06197062202._5
1434+ let liquidationRatio = divd(abs(exchangedPositionSize), abs(oldPositionSize))
1435+ let realizedPnl = muld(unrealizedPnl, liquidationRatio)
1436+ let $t06241362646 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, realizedPnl)
1437+ let remainMargin = $t06241362646._1
1438+ let badDebt = $t06241362646._2
1439+ let fundingPayment = $t06241362646._3
12361440 let unrealizedPnlAfter = (unrealizedPnl - realizedPnl)
12371441 let remainOpenNotional = if ((oldPositionSize > 0))
12381442 then ((oldPositionNotional - exchangedQuoteAssetAmount) - unrealizedPnlAfter)
12391443 else ((unrealizedPnlAfter + oldPositionNotional) - exchangedQuoteAssetAmount)
12401444 let liquidationPenalty = muld(exchangedQuoteAssetAmount, liquidationFeeRatio())
12411445 let feeToLiquidator = (liquidationPenalty / 2)
12421446 let feeToInsurance = (liquidationPenalty - feeToLiquidator)
12431447 let newPositionMargin = (remainMargin - liquidationPenalty)
12441448 let newPositionSize = (oldPositionSize + exchangedPositionSize)
12451449 let newPositionOpenNotional = abs(remainOpenNotional)
12461450 let newPositionLstUpdCPF = latestCumulativePremiumFraction(newPositionSize)
12471451 let openInterestNotionalAfter = (openInterestNotional() - exchangedQuoteAssetAmount)
12481452 let ammBalance = (cbalance() - liquidationPenalty)
1249- let $t05647156614 = if ((0 > ammBalance))
1453+ let $t06381963962 = if ((0 > ammBalance))
12501454 then $Tuple2(0, abs(ammBalance))
12511455 else $Tuple2(ammBalance, 0)
1252- let newAmmBalance = $t05647156614._1
1253- let takeFromInsurance = $t05647156614._2
1254- let x = if ((takeFromInsurance > 0))
1456+ let newAmmBalance = $t06381963962._1
1457+ let takeFromInsurance = $t06381963962._2
1458+ let $t06397064024 = getBorrowedByTrader(_trader)
1459+ let borrowed = $t06397064024._1
1460+ let assetId = $t06397064024._2
1461+ let doLiquidateCollateral = if ((borrowed > 0))
12551462 then {
1256- let withdrawInsurance = invoke(insuranceAddress(), "withdraw", [takeFromInsurance], nil)
1257- if ((withdrawInsurance == withdrawInsurance))
1463+ let collateralToSell = muld(borrowed, liquidationRatio)
1464+ let realizeAndClose = invoke(collateralAddress(), "realizePartially", [_trader, assetId, collateralToSell], nil)
1465+ if ((realizeAndClose == realizeAndClose))
12581466 then nil
12591467 else throw("Strict value is not equal to itself.")
12601468 }
12611469 else nil
1262- if ((x == x))
1470+ if ((doLiquidateCollateral == doLiquidateCollateral))
12631471 then {
1264- let unstake = invoke(managerAddress(), "withdraw", [toBase58String(quoteAsset()), (liquidationPenalty - takeFromInsurance)], nil)
1265- if ((unstake == unstake))
1472+ let x = if ((takeFromInsurance > 0))
12661473 then {
1267- let depositInsurance = invoke(insuranceAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), feeToInsurance)])
1268- if ((depositInsurance == depositInsurance))
1474+ let withdrawInsurance = invoke(insuranceAddress(), "withdraw", [takeFromInsurance], nil)
1475+ if ((withdrawInsurance == withdrawInsurance))
1476+ then nil
1477+ else throw("Strict value is not equal to itself.")
1478+ }
1479+ else nil
1480+ if ((x == x))
1481+ then {
1482+ let unstake = invoke(managerAddress(), "withdraw", [toBase58String(quoteAsset()), (liquidationPenalty - takeFromInsurance)], nil)
1483+ if ((unstake == unstake))
12691484 then {
1270- let notifyNotional = invoke(minerAddress(), "notifyNotional", [_trader, newPositionOpenNotional], nil)
1271- if ((notifyNotional == notifyNotional))
1272- then (((updatePosition(_trader, newPositionSize, newPositionMargin, newPositionOpenNotional, newPositionLstUpdCPF) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, (totalLongPositionSize() - (if ((newPositionSize > 0))
1273- then abs(exchangedPositionSize)
1274- else 0)), (totalShortPositionSize() - (if ((0 > newPositionSize))
1275- then abs(exchangedPositionSize)
1276- else 0)))) ++ withdraw(i.caller, feeToLiquidator)) ++ updateBalance(newAmmBalance))
1485+ let depositInsurance = invoke(insuranceAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), feeToInsurance)])
1486+ if ((depositInsurance == depositInsurance))
1487+ then {
1488+ let notifyNotional = invoke(minerAddress(), "notifyNotional", [_trader, newPositionOpenNotional], nil)
1489+ if ((notifyNotional == notifyNotional))
1490+ then (((updatePosition(_trader, newPositionSize, newPositionMargin, newPositionOpenNotional, newPositionLstUpdCPF) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, (totalLongPositionSize() - (if ((newPositionSize > 0))
1491+ then abs(exchangedPositionSize)
1492+ else 0)), (totalShortPositionSize() - (if ((0 > newPositionSize))
1493+ then abs(exchangedPositionSize)
1494+ else 0)))) ++ withdraw(i.caller, feeToLiquidator)) ++ updateBalance(newAmmBalance))
1495+ else throw("Strict value is not equal to itself.")
1496+ }
12771497 else throw("Strict value is not equal to itself.")
12781498 }
12791499 else throw("Strict value is not equal to itself.")
12801500 }
12811501 else throw("Strict value is not equal to itself.")
12821502 }
12831503 else throw("Strict value is not equal to itself.")
12841504 }
12851505 else {
1286- let $t05806158516 = internalClosePosition(_trader, false)
1287- let x1 = $t05806158516._1
1288- let badDebt = $t05806158516._2
1289- let x2 = $t05806158516._3
1290- let x3 = $t05806158516._4
1291- let quoteAssetReserveAfter = $t05806158516._5
1292- let baseAssetReserveAfter = $t05806158516._6
1293- let totalPositionSizeAfter = $t05806158516._7
1294- let cumulativeNotionalAfter = $t05806158516._8
1295- let openInterestNotionalAfter = $t05806158516._9
1296- let exchangedQuoteAssetAmount = $t05806158516._10
1297- let totalLongAfter = $t05806158516._11
1298- let totalShortAfter = $t05806158516._12
1506+ let $t06586666321 = internalClosePosition(_trader, false)
1507+ let x1 = $t06586666321._1
1508+ let badDebt = $t06586666321._2
1509+ let x2 = $t06586666321._3
1510+ let x3 = $t06586666321._4
1511+ let quoteAssetReserveAfter = $t06586666321._5
1512+ let baseAssetReserveAfter = $t06586666321._6
1513+ let totalPositionSizeAfter = $t06586666321._7
1514+ let cumulativeNotionalAfter = $t06586666321._8
1515+ let openInterestNotionalAfter = $t06586666321._9
1516+ let exchangedQuoteAssetAmount = $t06586666321._10
1517+ let totalLongAfter = $t06586666321._11
1518+ let totalShortAfter = $t06586666321._12
12991519 let liquidationPenalty = muld(exchangedQuoteAssetAmount, liquidationFeeRatio())
13001520 let feeToLiquidator = (liquidationPenalty / 2)
13011521 let feeToInsurance = (liquidationPenalty - feeToLiquidator)
13021522 let ammBalance = (cbalance() - liquidationPenalty)
1303- let $t05892859071 = if ((0 > ammBalance))
1523+ let $t06673366876 = if ((0 > ammBalance))
13041524 then $Tuple2(0, abs(ammBalance))
13051525 else $Tuple2(ammBalance, 0)
1306- let newAmmBalance = $t05892859071._1
1307- let takeFromInsurance = $t05892859071._2
1308- let x = if ((takeFromInsurance > 0))
1526+ let newAmmBalance = $t06673366876._1
1527+ let takeFromInsurance = $t06673366876._2
1528+ let $t06688466938 = getBorrowedByTrader(_trader)
1529+ let borrowed = $t06688466938._1
1530+ let assetId = $t06688466938._2
1531+ let doLiquidateCollateral = if ((borrowed > 0))
13091532 then {
1310- let withdrawInsurance = invoke(insuranceAddress(), "withdraw", [takeFromInsurance], nil)
1311- if ((withdrawInsurance == withdrawInsurance))
1533+ let realizeAndClose = invoke(collateralAddress(), "realizePartiallyAndClose", [_trader, assetId], nil)
1534+ if ((realizeAndClose == realizeAndClose))
13121535 then nil
13131536 else throw("Strict value is not equal to itself.")
13141537 }
13151538 else nil
1316- if ((x == x))
1539+ if ((doLiquidateCollateral == doLiquidateCollateral))
13171540 then {
1318- let unstake = invoke(managerAddress(), "withdraw", [toBase58String(quoteAsset()), (liquidationPenalty - takeFromInsurance)], nil)
1319- if ((unstake == unstake))
1541+ let x = if ((takeFromInsurance > 0))
13201542 then {
1321- let depositInsurance = invoke(insuranceAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), feeToInsurance)])
1322- if ((depositInsurance == depositInsurance))
1543+ let withdrawInsurance = invoke(insuranceAddress(), "withdraw", [takeFromInsurance], nil)
1544+ if ((withdrawInsurance == withdrawInsurance))
1545+ then nil
1546+ else throw("Strict value is not equal to itself.")
1547+ }
1548+ else nil
1549+ if ((x == x))
1550+ then {
1551+ let unstake = invoke(managerAddress(), "withdraw", [toBase58String(quoteAsset()), (liquidationPenalty - takeFromInsurance)], nil)
1552+ if ((unstake == unstake))
13231553 then {
1324- let notifyNotional = invoke(minerAddress(), "notifyNotional", [_trader, 0], nil)
1325- if ((notifyNotional == notifyNotional))
1326- then (((deletePosition(_trader) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter)) ++ withdraw(i.caller, feeToLiquidator)) ++ updateBalance(newAmmBalance))
1554+ let depositInsurance = invoke(insuranceAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), feeToInsurance)])
1555+ if ((depositInsurance == depositInsurance))
1556+ then {
1557+ let notifyNotional = invoke(minerAddress(), "notifyNotional", [_trader, 0], nil)
1558+ if ((notifyNotional == notifyNotional))
1559+ then (((deletePosition(_trader) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter)) ++ withdraw(i.caller, feeToLiquidator)) ++ updateBalance(newAmmBalance))
1560+ else throw("Strict value is not equal to itself.")
1561+ }
13271562 else throw("Strict value is not equal to itself.")
13281563 }
13291564 else throw("Strict value is not equal to itself.")
13301565 }
13311566 else throw("Strict value is not equal to itself.")
13321567 }
13331568 else throw("Strict value is not equal to itself.")
13341569 }
13351570 }
13361571
13371572
13381573
13391574 @Callable(i)
13401575 func payFunding () = {
13411576 let fundingBlockTimestamp = nextFundingBlockTimestamp()
13421577 if (if (if ((fundingBlockTimestamp > lastBlock.timestamp))
13431578 then true
13441579 else !(initialized()))
13451580 then true
13461581 else paused())
13471582 then throw(((("Invalid funding block timestamp: " + toString(lastBlock.timestamp)) + " < ") + toString(fundingBlockTimestamp)))
13481583 else {
13491584 let underlyingPrice = getOracleTwapPrice()
1350- let $t06055760619 = getFunding()
1351- let shortPremiumFraction = $t06055760619._1
1352- let longPremiumFraction = $t06055760619._2
1585+ let $t06873668798 = getFunding()
1586+ let shortPremiumFraction = $t06873668798._1
1587+ let longPremiumFraction = $t06873668798._2
13531588 updateFunding((fundingBlockTimestamp + fundingPeriodSeconds()), (latestLongCumulativePremiumFraction() + longPremiumFraction), (latestShortCumulativePremiumFraction() + shortPremiumFraction), divd(longPremiumFraction, underlyingPrice), divd(shortPremiumFraction, underlyingPrice))
13541589 }
13551590 }
13561591
13571592
13581593
13591594 @Callable(i)
13601595 func forceMoveAsset (_trader,_amount) = if (if ((addressFromPublicKey(adminPublicKey()) != i.caller))
13611596 then true
13621597 else (0 > _amount))
13631598 then throw("Invalid forceMoveAsset parameters")
13641599 else {
13651600 let unstake = invoke(managerAddress(), "withdraw", [toBase58String(quoteAsset()), _amount], nil)
13661601 if ((unstake == unstake))
13671602 then (withdraw(addressFromStringValue(_trader), _amount) ++ updateBalance((cbalance() - _amount)))
13681603 else throw("Strict value is not equal to itself.")
13691604 }
13701605
13711606
13721607
13731608 @Callable(i)
13741609 func adjustPeg (_price) = if (if ((addressFromPublicKey(adminPublicKey()) != i.caller))
13751610 then true
13761611 else (0 > _price))
13771612 then throw("Invalid adjustPeg parameters")
13781613 else {
1379- let $t06161061696 = getPegAdjustCost(_price)
1380- let newQuoteAssetReserve = $t06161061696._1
1381- let pegChangeCost = $t06161061696._2
1614+ let $t06978969875 = getPegAdjustCost(_price)
1615+ let newQuoteAssetReserve = $t06978969875._1
1616+ let pegChangeCost = $t06978969875._2
13821617 if ((pegChangeCost == 0))
13831618 then throw("Nothing to adjust")
13841619 else if ((pegChangeCost > 0))
13851620 then updateAmmReserves(newQuoteAssetReserve, bsAstR())
13861621 else {
13871622 let unstake = invoke(managerAddress(), "withdraw", [toBase58String(quoteAsset()), abs(pegChangeCost)], nil)
13881623 if ((unstake == unstake))
13891624 then {
13901625 let depositInsurance = invoke(insuranceAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), abs(pegChangeCost))])
13911626 if ((depositInsurance == depositInsurance))
13921627 then (updateBalance((cbalance() - abs(pegChangeCost))) ++ updateAmmReserves(newQuoteAssetReserve, bsAstR()))
13931628 else throw("Strict value is not equal to itself.")
13941629 }
13951630 else throw("Strict value is not equal to itself.")
13961631 }
13971632 }
13981633
13991634
14001635
14011636 @Callable(i)
14021637 func migrateLiquidity () = {
14031638 let amount = cbalance()
14041639 if ((amount > 0))
14051640 then {
14061641 let unstake = invoke(quoteAssetStaking(), "unlockNeutrino", [amount, toBase58String(quoteAsset())], nil)
14071642 if ((unstake == unstake))
14081643 then {
14091644 let stake = invoke(managerAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), amount)])
14101645 if ((stake == stake))
14111646 then nil
14121647 else throw("Strict value is not equal to itself.")
14131648 }
14141649 else throw("Strict value is not equal to itself.")
14151650 }
14161651 else nil
14171652 }
14181653
14191654
14201655
14211656 @Callable(i)
14221657 func v_get (_trader) = {
1423- let $t06333763397 = internalClosePosition(_trader, false)
1424- let x1 = $t06333763397._1
1425- let x2 = $t06333763397._2
1426- let x3 = $t06333763397._3
1427- let x4 = $t06333763397._4
1658+ let $t07151671576 = internalClosePosition(_trader, false)
1659+ let x1 = $t07151671576._1
1660+ let x2 = $t07151671576._2
1661+ let x3 = $t07151671576._3
1662+ let x4 = $t07151671576._4
14281663 throw((((s(x2) + s(x3)) + s(x4)) + s(getMarginRatio(_trader))))
14291664 }
14301665
14311666
14321667
14331668 @Callable(i)
14341669 func view_calcRemainMarginWithFundingPayment (_trader) = {
1435- let $t06354463655 = getPosition(_trader)
1436- let positionSize = $t06354463655._1
1437- let positionMargin = $t06354463655._2
1438- let pon = $t06354463655._3
1439- let positionLstUpdCPF = $t06354463655._4
1440- let $t06366063761 = getPositionNotionalAndUnrealizedPnl(_trader, PNL_OPTION_SPOT)
1441- let positionNotional = $t06366063761._1
1442- let unrealizedPnl = $t06366063761._2
1443- let $t06376663948 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl)
1444- let remainMargin = $t06376663948._1
1445- let badDebt = $t06376663948._2
1446- let fundingPayment = $t06376663948._3
1670+ let $t07172371834 = getPosition(_trader)
1671+ let positionSize = $t07172371834._1
1672+ let positionMargin = $t07172371834._2
1673+ let pon = $t07172371834._3
1674+ let positionLstUpdCPF = $t07172371834._4
1675+ let $t07183971940 = getPositionNotionalAndUnrealizedPnl(_trader, PNL_OPTION_SPOT)
1676+ let positionNotional = $t07183971940._1
1677+ let unrealizedPnl = $t07183971940._2
1678+ let $t07194572127 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl)
1679+ let remainMargin = $t07194572127._1
1680+ let badDebt = $t07194572127._2
1681+ let fundingPayment = $t07194572127._3
14471682 throw((((((s(remainMargin) + s(fundingPayment)) + s(getMarginRatio(_trader))) + s(unrealizedPnl)) + s(badDebt)) + s(positionNotional)))
14481683 }
14491684
14501685
14511686
14521687 @Callable(i)
14531688 func view_getPegAdjustCost (_price) = {
14541689 let cost = getPegAdjustCost(_price)
14551690 throw(toString(cost._2))
14561691 }
14571692
14581693
14591694
14601695 @Callable(i)
14611696 func view_getFunding () = {
14621697 let underlyingPrice = getOracleTwapPrice()
1463- let $t06433964401 = getFunding()
1464- let shortPremiumFraction = $t06433964401._1
1465- let longPremiumFraction = $t06433964401._2
1698+ let $t07251872580 = getFunding()
1699+ let shortPremiumFraction = $t07251872580._1
1700+ let longPremiumFraction = $t07251872580._2
14661701 let longFunding = divd(longPremiumFraction, underlyingPrice)
14671702 let shortFunding = divd(shortPremiumFraction, underlyingPrice)
14681703 throw((((s(longFunding) + s(shortFunding)) + s(getTwapSpotPrice())) + s(getOracleTwapPrice())))
1704+ }
1705+
1706+
1707+
1708+@Callable(i)
1709+func view_getBorrowedByTrader (_trader) = {
1710+ let $t07287072924 = getBorrowedByTrader(_trader)
1711+ let borrowed = $t07287072924._1
1712+ let assetId = $t07287072924._2
1713+ throw((s(borrowed) + assetId))
14691714 }
14701715
14711716
14721717 @Verifier(tx)
14731718 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], adminPublicKey())
14741719

github/deemru/w8io/026f985 
219.90 ms