tx · 3AoK9So1owfXP6XzU44uLeZRduwiJgSHAfQyh3j159Nb

3NBH3LGg2DsaEtyBr495XEdaFuiLYSNyr3k:  -0.05100000 Waves

2022.08.17 00:03 [2187539] smart account 3NBH3LGg2DsaEtyBr495XEdaFuiLYSNyr3k > SELF 0.00000000 Waves

{ "type": 13, "id": "3AoK9So1owfXP6XzU44uLeZRduwiJgSHAfQyh3j159Nb", "fee": 5100000, "feeAssetId": null, "timestamp": 1660683875138, "version": 2, "chainId": 84, "sender": "3NBH3LGg2DsaEtyBr495XEdaFuiLYSNyr3k", "senderPublicKey": "6rHNfG82m33YnDLzeMuCFn5XNvbNwGhR4ovSFhgJvbxP", "proofs": [ "4cVJTaYAG1uqKytoAgSUnWhEkxPJDx4rXCrtErMwtpJfXtJbPPqpKLcV2iyTTPBymLmkTL2qjULroUf2e9b9Tynh" ], "script": "base64:BgJZCAISABIAEgMKAQESAwoBARIJCgcBAQEBAQEBEg4KDAEBAQEBAQEICAgBARIFCgMBAQESBQoDAQEBEgASAwoBARIAEgMKAQgSABIDCgEIEgMKAQgSBAoCCAF3AAlrX29yYV9rZXkCCWtfb3JhX2tleQAPa19vcmFfYmxvY2tfa2V5Ag9rX29yYV9ibG9ja19rZXkABWtfb3JhAgVrX29yYQAJa19iYWxhbmNlAglrX2JhbGFuY2UADmtfcG9zaXRpb25TaXplAg5rX3Bvc2l0aW9uU2l6ZQAQa19wb3NpdGlvbk1hcmdpbgIQa19wb3NpdGlvbk1hcmdpbgAWa19wb3NpdGlvbk9wZW5Ob3Rpb25hbAIWa19wb3NpdGlvbk9wZW5Ob3Rpb25hbAAua19wb3NpdGlvbkxhc3RVcGRhdGVkQ3VtdWxhdGl2ZVByZW1pdW1GcmFjdGlvbgISa19wb3NpdGlvbkZyYWN0aW9uAA1rX2luaXRpYWxpemVkAg1rX2luaXRpYWxpemVkAAhrX3BhdXNlZAIIa19wYXVzZWQABWtfZmVlAgVrX2ZlZQAPa19mdW5kaW5nUGVyaW9kAg9rX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Z2luUmF0aW8BBQdfdHJhZGVyCQEBcwEFDXVucmVhbGl6ZWRQbmwJAQFzAQUHYmFkRGVidAFpAQ5mb3JjZU1vdmVBc3NldAIHX3RyYWRlcgdfYW1vdW50AwMJAQIhPQIJAKcIAQkBDmFkbWluUHVibGljS2V5AAgFAWkGY2FsbGVyBgkAZgIAAAUHX2Ftb3VudAkAAgECIUludmFsaWQgZm9yY2VNb3ZlQXNzZXQgcGFyYW1ldGVycwQHdW5zdGFrZQkA/AcECQERcXVvdGVBc3NldFN0YWtpbmcAAg51bmxvY2tOZXV0cmlubwkAzAgCBQdfYW1vdW50CQDMCAIJANgEAQkBCnF1b3RlQXNzZXQABQNuaWwFA25pbAMJAAACBQd1bnN0YWtlBQd1bnN0YWtlCQDOCAIJAQh3aXRoZHJhdwIJARFAZXh0ck5hdGl2ZSgxMDYyKQEFB190cmFkZXIFB19hbW91bnQJAQ11cGRhdGVCYWxhbmNlAQkAZQIJAQhjYmFsYW5jZQAFB19hbW91bnQJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4BAnR4AQZ2ZXJpZnkACQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACQEOYWRtaW5QdWJsaWNLZXkAwTjzEQ==", "height": 2187539, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5ixotgNUPBZphgERR1UQrbRe4rTLTjGuD1hMEgZShq6A Next: CC6i1UfHxpLJ8LysdnJY5VWkhStDUZyyUneuNfmzpKCk Diff:
OldNewDifferences
113113
114114 let DIR_SHORT = 2
115115
116-let FUNDING_BLOCK_INTERVAL = 60
117-
118116 let TWAP_INTERVAL = 15
119117
120118 let ORACLE_INTERVAL = 15
122120 let SECONDS = 1000
123121
124122 let DECIMAL_UNIT = (1 * (((((10 * 10) * 10) * 10) * 10) * 10))
125-
126-let HUNDRED_PERCENT = (100 * DECIMAL_UNIT)
127123
128124 let ONE_DAY = (86400 * DECIMAL_UNIT)
129125
312308 func swapInput (_isAdd,_quoteAssetAmount) = {
313309 let _qtAstR = qtAstR()
314310 let _bsAstR = bsAstR()
315- let priceBefore = divd(_qtAstR, _bsAstR)
316- let amountBaseAssetBoughtWithoutPriceImpact = muld(_quoteAssetAmount, priceBefore)
317311 let k = muld(_qtAstR, _bsAstR)
318312 let quoteAssetReserveAfter = if (_isAdd)
319313 then (_qtAstR + _quoteAssetAmount)
323317 let amountBaseAssetBought = if (_isAdd)
324318 then amountBaseAssetBoughtAbs
325319 else -(amountBaseAssetBoughtAbs)
326- let priceImpact = ((amountBaseAssetBoughtWithoutPriceImpact - amountBaseAssetBoughtAbs) / amountBaseAssetBoughtWithoutPriceImpact)
320+ let $t01183712030 = updateReserve(_isAdd, _quoteAssetAmount, amountBaseAssetBoughtAbs)
321+ let quoteAssetReserveAfter1 = $t01183712030._1
322+ let baseAssetReserveAfter1 = $t01183712030._2
323+ let totalPositionSizeAfter1 = $t01183712030._3
324+ let cumulativeNotionalAfter1 = $t01183712030._4
325+ let priceBefore = divd(_qtAstR, _bsAstR)
326+ let marketPrice = divd(_quoteAssetAmount, amountBaseAssetBoughtAbs)
327+ let priceDiff = abs((priceBefore - marketPrice))
328+ let priceImpact = (DECIMAL_UNIT - divd(priceBefore, (priceBefore + priceDiff)))
327329 let maxPriceImpactValue = maxPriceImpact()
328330 if ((priceImpact > maxPriceImpactValue))
329- then throw(((("Price impact " + toString(priceImpact)) + " > max price impact ") + toString(maxPriceImpactValue)))
330- else {
331- let $t01236812571 = updateReserve(_isAdd, _quoteAssetAmount, amountBaseAssetBoughtAbs)
332- let quoteAssetReserveAfter1 = $t01236812571._1
333- let baseAssetReserveAfter1 = $t01236812571._2
334- let totalPositionSizeAfter1 = $t01236812571._3
335- let cumulativeNotionalAfter1 = $t01236812571._4
336- $Tuple5(amountBaseAssetBought, quoteAssetReserveAfter1, baseAssetReserveAfter1, totalPositionSizeAfter1, cumulativeNotionalAfter1)
337- }
331+ 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)))
332+ else $Tuple5(amountBaseAssetBought, quoteAssetReserveAfter1, baseAssetReserveAfter1, totalPositionSizeAfter1, cumulativeNotionalAfter1)
338333 }
339334
340335
346341 }
347342 else 0
348343 let signedMargin = ((_marginDelta - fundingPayment) + _oldPositionMargin)
349- let $t01331813445 = if ((0 > signedMargin))
344+ let $t01352113648 = if ((0 > signedMargin))
350345 then $Tuple2(0, abs(signedMargin))
351346 else $Tuple2(abs(signedMargin), 0)
352- let remainMargin = $t01331813445._1
353- let badDebt = $t01331813445._2
347+ let remainMargin = $t01352113648._1
348+ let badDebt = $t01352113648._2
354349 $Tuple3(remainMargin, badDebt, fundingPayment)
355350 }
356351
357352
358-func swapOutput (_isAdd,_baseAssetAmount) = {
353+func swapOutput (_isAdd,_baseAssetAmount,_checkMaxPriceImpact) = {
359354 let _quoteAssetReserve = qtAstR()
360355 let _baseAssetReserve = bsAstR()
356+ let priceBefore = divd(_quoteAssetReserve, _baseAssetReserve)
361357 if ((_baseAssetAmount == 0))
362358 then throw("Invalid base asset amount")
363359 else {
367363 else (_baseAssetReserve - _baseAssetAmount)
368364 let quoteAssetAfter = divd(k, baseAssetPoolAmountAfter)
369365 let quoteAssetSold = abs((quoteAssetAfter - _quoteAssetReserve))
370- let $t01428314476 = updateReserve(!(_isAdd), quoteAssetSold, _baseAssetAmount)
371- let quoteAssetReserveAfter1 = $t01428314476._1
372- let baseAssetReserveAfter1 = $t01428314476._2
373- let totalPositionSizeAfter1 = $t01428314476._3
374- let cumulativeNotionalAfter1 = $t01428314476._4
375- $Tuple7(quoteAssetSold, quoteAssetReserveAfter1, baseAssetReserveAfter1, totalPositionSizeAfter1, cumulativeNotionalAfter1, (totalLongPositionSize() - (if (_isAdd)
376- then abs(_baseAssetAmount)
377- else 0)), (totalShortPositionSize() - (if (!(_isAdd))
378- then abs(_baseAssetAmount)
379- else 0)))
366+ let maxPriceImpactValue = maxPriceImpact()
367+ let $t01463214825 = updateReserve(!(_isAdd), quoteAssetSold, _baseAssetAmount)
368+ let quoteAssetReserveAfter1 = $t01463214825._1
369+ let baseAssetReserveAfter1 = $t01463214825._2
370+ let totalPositionSizeAfter1 = $t01463214825._3
371+ let cumulativeNotionalAfter1 = $t01463214825._4
372+ let marketPrice = divd(quoteAssetSold, _baseAssetAmount)
373+ let priceDiff = abs((priceBefore - marketPrice))
374+ let priceImpact = (DECIMAL_UNIT - divd(priceBefore, (priceBefore + priceDiff)))
375+ if (if ((priceImpact > maxPriceImpactValue))
376+ then _checkMaxPriceImpact
377+ else false)
378+ 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)))
379+ else $Tuple7(quoteAssetSold, quoteAssetReserveAfter1, baseAssetReserveAfter1, totalPositionSizeAfter1, cumulativeNotionalAfter1, (totalLongPositionSize() - (if (_isAdd)
380+ then abs(_baseAssetAmount)
381+ else 0)), (totalShortPositionSize() - (if (!(_isAdd))
382+ then abs(_baseAssetAmount)
383+ else 0)))
380384 }
381385 }
382386
385389 let oracle = valueOrErrorMessage(addressFromString(getStringValue(this, k_ora)), "")
386390 let priceKey = getStringValue(this, k_ora_key)
387391 let blockKey = getStringValue(this, k_ora_block_key)
388- let lastValue = getIntegerValue(oracle, priceKey)
392+ let lastValue = valueOrErrorMessage(getInteger(oracle, priceKey), ((("Can not get oracle price. Oracle: " + toString(oracle)) + " key: ") + priceKey))
389393 lastValue
390394 }
391395
405409
406410
407411 func getPositionNotionalAndUnrealizedPnl (_trader,_option) = {
408- let $t01610816236 = getPosition(_trader)
409- let positionSize = $t01610816236._1
410- let positionMargin = $t01610816236._2
411- let positionOpenNotional = $t01610816236._3
412- let positionLstUpdCPF = $t01610816236._4
412+ let $t01729317421 = getPosition(_trader)
413+ let positionSize = $t01729317421._1
414+ let positionMargin = $t01729317421._2
415+ let positionOpenNotional = $t01729317421._3
416+ let positionLstUpdCPF = $t01729317421._4
413417 let positionSizeAbs = abs(positionSize)
414418 if ((positionSizeAbs == 0))
415419 then throw("Invalid position size")
417421 let isShort = (0 > positionSize)
418422 let positionNotional = if ((_option == PNL_OPTION_SPOT))
419423 then {
420- let $t01648316590 = swapOutput(!(isShort), positionSizeAbs)
421- let outPositionNotional = $t01648316590._1
422- let x1 = $t01648316590._2
423- let x2 = $t01648316590._3
424- let x3 = $t01648316590._4
424+ let $t01766817792 = swapOutput(!(isShort), positionSizeAbs, false)
425+ let outPositionNotional = $t01766817792._1
426+ let x1 = $t01766817792._2
427+ let x2 = $t01766817792._3
428+ let x3 = $t01766817792._4
425429 outPositionNotional
426430 }
427431 else muld(positionSizeAbs, getOracleTwapPrice())
437441
438442
439443 func getMarginRatioByOption (_trader,_option) = {
440- let $t01726017371 = getPosition(_trader)
441- let positionSize = $t01726017371._1
442- let positionMargin = $t01726017371._2
443- let pon = $t01726017371._3
444- let positionLstUpdCPF = $t01726017371._4
445- let $t01737717470 = getPositionNotionalAndUnrealizedPnl(_trader, _option)
446- let positionNotional = $t01737717470._1
447- let unrealizedPnl = $t01737717470._2
448- let $t01747517641 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl)
449- let remainMargin = $t01747517641._1
450- let badDebt = $t01747517641._2
444+ let $t01846218573 = getPosition(_trader)
445+ let positionSize = $t01846218573._1
446+ let positionMargin = $t01846218573._2
447+ let pon = $t01846218573._3
448+ let positionLstUpdCPF = $t01846218573._4
449+ let $t01857918672 = getPositionNotionalAndUnrealizedPnl(_trader, _option)
450+ let positionNotional = $t01857918672._1
451+ let unrealizedPnl = $t01857918672._2
452+ let $t01867718843 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl)
453+ let remainMargin = $t01867718843._1
454+ let badDebt = $t01867718843._2
451455 calcMarginRatio(remainMargin, badDebt, positionNotional)
452456 }
453457
455459 func getMarginRatio (_trader) = getMarginRatioByOption(_trader, PNL_OPTION_SPOT)
456460
457461
458-func internalClosePosition (_trader) = {
459- let $t01795718085 = getPosition(_trader)
460- let positionSize = $t01795718085._1
461- let positionMargin = $t01795718085._2
462- let positionOpenNotional = $t01795718085._3
463- let positionLstUpdCPF = $t01795718085._4
464- let $t01809118178 = getPositionNotionalAndUnrealizedPnl(_trader, PNL_OPTION_SPOT)
465- let x1 = $t01809118178._1
466- let unrealizedPnl = $t01809118178._2
467- let $t01818318351 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl)
468- let remainMargin = $t01818318351._1
469- let badDebt = $t01818318351._2
462+func internalClosePosition (_trader,_checkMaxPriceImpact) = {
463+ let $t01919019318 = getPosition(_trader)
464+ let positionSize = $t01919019318._1
465+ let positionMargin = $t01919019318._2
466+ let positionOpenNotional = $t01919019318._3
467+ let positionLstUpdCPF = $t01919019318._4
468+ let $t01932419411 = getPositionNotionalAndUnrealizedPnl(_trader, PNL_OPTION_SPOT)
469+ let x1 = $t01932419411._1
470+ let unrealizedPnl = $t01932419411._2
471+ let $t01941619584 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl)
472+ let remainMargin = $t01941619584._1
473+ let badDebt = $t01941619584._2
470474 let exchangedPositionSize = -(positionSize)
471475 let realizedPnl = unrealizedPnl
472476 let marginToVault = -(remainMargin)
473- let $t01847818759 = swapOutput((positionSize > 0), abs(positionSize))
474- let exchangedQuoteAssetAmount = $t01847818759._1
475- let quoteAssetReserveAfter = $t01847818759._2
476- let baseAssetReserveAfter = $t01847818759._3
477- let totalPositionSizeAfter = $t01847818759._4
478- let cumulativeNotionalAfter = $t01847818759._5
479- let totalLongAfter = $t01847818759._6
480- let totalShortAfter = $t01847818759._7
477+ let $t01971120022 = swapOutput((positionSize > 0), abs(positionSize), _checkMaxPriceImpact)
478+ let exchangedQuoteAssetAmount = $t01971120022._1
479+ let quoteAssetReserveAfter = $t01971120022._2
480+ let baseAssetReserveAfter = $t01971120022._3
481+ let totalPositionSizeAfter = $t01971120022._4
482+ let cumulativeNotionalAfter = $t01971120022._5
483+ let totalLongAfter = $t01971120022._6
484+ let totalShortAfter = $t01971120022._7
481485 let openInterestNotionalAfter = (openInterestNotional() - positionOpenNotional)
482486 $Tuple12(exchangedPositionSize, badDebt, realizedPnl, marginToVault, quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, exchangedQuoteAssetAmount, totalLongAfter, totalShortAfter)
483487 }
557561 }
558562
559563
564+func updateAmmReserves (_qtAstR,_bsAstR) = [IntegerEntry(k_quoteAssetReserve, _qtAstR), IntegerEntry(k_baseAssetReserve, _bsAstR)]
565+
566+
560567 func updateAmm (_qtAstR,_bsAstR,_totalPositionSizeAfter,_cumulativeNotionalAfter,_openInterestNotional,_totalLongPositionSize,_totalShortPositionSize) = if (((_totalLongPositionSize - _totalShortPositionSize) != _totalPositionSizeAfter))
561568 then throw(((((("Invalid AMM state data: " + toString(_totalLongPositionSize)) + " + ") + toString(_totalShortPositionSize)) + " != ") + toString(_totalPositionSizeAfter)))
562- else ([IntegerEntry(k_quoteAssetReserve, _qtAstR), IntegerEntry(k_baseAssetReserve, _bsAstR), IntegerEntry(k_totalPositionSize, _totalPositionSizeAfter), IntegerEntry(k_cumulativeNotional, _cumulativeNotionalAfter), IntegerEntry(k_openInterestNotional, _openInterestNotional), IntegerEntry(k_totalLongPositionSize, _totalLongPositionSize), IntegerEntry(k_totalShortPositionSize, _totalShortPositionSize)] ++ appendTwap(divd(_qtAstR, _bsAstR)))
569+ 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)))
563570
564571
565572 func deletePosition (_address) = [DeleteEntry(toCompositeKey(k_positionSize, _address)), DeleteEntry(toCompositeKey(k_positionMargin, _address)), DeleteEntry(toCompositeKey(k_positionOpenNotional, _address)), DeleteEntry(toCompositeKey(k_positionLastUpdatedCumulativePremiumFraction, _address))]
596603
597604
598605 @Callable(i)
606+func addLiquidity (_quoteAssetAmount) = if (if ((i.caller != adminAddress()))
607+ then true
608+ else (0 >= _quoteAssetAmount))
609+ then throw("Invalid addLiquidity params")
610+ else {
611+ let _qtAstR = qtAstR()
612+ let _bsAstR = bsAstR()
613+ let price = divd(_qtAstR, _bsAstR)
614+ let baseAssetAmountToAdd = divd(_quoteAssetAmount, price)
615+ let qtAstRAfter = (_qtAstR + _quoteAssetAmount)
616+ let bsAstRAfter = (_bsAstR + baseAssetAmountToAdd)
617+ updateAmmReserves(qtAstRAfter, bsAstRAfter)
618+ }
619+
620+
621+
622+@Callable(i)
623+func removeLiquidity (_quoteAssetAmount) = if (if ((i.caller != adminAddress()))
624+ then true
625+ else (0 >= _quoteAssetAmount))
626+ then throw("Invalid removeLiquidity params")
627+ else {
628+ let _qtAstR = qtAstR()
629+ let _bsAstR = bsAstR()
630+ let price = divd(_qtAstR, _bsAstR)
631+ let baseAssetAmountToRemove = divd(_quoteAssetAmount, price)
632+ let qtAstRAfter = (_qtAstR - _quoteAssetAmount)
633+ let bsAstRAfter = (_bsAstR - baseAssetAmountToRemove)
634+ updateAmmReserves(qtAstRAfter, bsAstRAfter)
635+ }
636+
637+
638+
639+@Callable(i)
599640 func changeSettings (_initMarginRatio,_mmr,_liquidationFeeRatio,_fundingPeriod,_fee,_spreadLimit,_maxPriceImpact) = if ((i.caller != adminAddress()))
600641 then throw("Invalid changeSettings params")
601642 else updateSettings(_initMarginRatio, _mmr, _liquidationFeeRatio, _fundingPeriod, _fee, _spreadLimit, _maxPriceImpact)
628669
629670
630671 @Callable(i)
631-func decreasePosition (_amount,_leverage,_minBaseAssetAmount) = if (if (if (if (if (if ((0 >= _amount))
632- then true
633- else if (((1 * DECIMAL_UNIT) > _leverage))
634- then true
635- else (_leverage > (3 * DECIMAL_UNIT)))
672+func decreasePosition (_amount,_leverage,_minBaseAssetAmount) = if (if (if (if (if ((0 >= _amount))
636673 then true
637674 else !(initialized()))
638675 then true
643680 else paused())
644681 then throw("Invalid decreasePosition parameters")
645682 else {
646- let $t02860028752 = getPosition(toString(i.caller))
647- let oldPositionSize = $t02860028752._1
648- let oldPositionMargin = $t02860028752._2
649- let oldPositionOpenNotional = $t02860028752._3
650- let oldPositionLstUpdCPF = $t02860028752._4
683+ let $t03093131083 = getPosition(toString(i.caller))
684+ let oldPositionSize = $t03093131083._1
685+ let oldPositionMargin = $t03093131083._2
686+ let oldPositionOpenNotional = $t03093131083._3
687+ let oldPositionLstUpdCPF = $t03093131083._4
651688 let _direction = if ((oldPositionSize > 0))
652689 then DIR_SHORT
653690 else DIR_LONG
654691 let isAdd = (_direction == DIR_LONG)
655692 let openNotional = muld(_amount, _leverage)
656- let $t02892529041 = getPositionNotionalAndUnrealizedPnl(toString(i.caller), PNL_OPTION_SPOT)
657- let oldPositionNotional = $t02892529041._1
658- let unrealizedPnl = $t02892529041._2
659- let $t02904731596 = if ((oldPositionNotional > openNotional))
693+ let $t03125631372 = getPositionNotionalAndUnrealizedPnl(toString(i.caller), PNL_OPTION_SPOT)
694+ let oldPositionNotional = $t03125631372._1
695+ let unrealizedPnl = $t03125631372._2
696+ let $t03137833927 = if ((oldPositionNotional > openNotional))
660697 then {
661- let $t02942429643 = swapInput(isAdd, openNotional)
662- let exchangedPositionSize = $t02942429643._1
663- let quoteAssetReserveAfter = $t02942429643._2
664- let baseAssetReserveAfter = $t02942429643._3
665- let totalPositionSizeAfter = $t02942429643._4
666- let cumulativeNotionalAfter = $t02942429643._5
698+ let $t03175531974 = swapInput(isAdd, openNotional)
699+ let exchangedPositionSize = $t03175531974._1
700+ let quoteAssetReserveAfter = $t03175531974._2
701+ let baseAssetReserveAfter = $t03175531974._3
702+ let totalPositionSizeAfter = $t03175531974._4
703+ let cumulativeNotionalAfter = $t03175531974._5
667704 let exchangedPositionSizeAbs = abs(exchangedPositionSize)
668705 if (if ((_minBaseAssetAmount != 0))
669706 then (_minBaseAssetAmount > exchangedPositionSizeAbs)
671708 then throw(((("Too little base asset exchanged, got " + toString(exchangedPositionSizeAbs)) + " expected ") + toString(_minBaseAssetAmount)))
672709 else {
673710 let realizedPnl = divd(muld(unrealizedPnl, exchangedPositionSizeAbs), abs(oldPositionSize))
674- let $t03008030325 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, realizedPnl)
675- let remainMargin = $t03008030325._1
676- let badDebt = $t03008030325._2
677- let fundingPayment = $t03008030325._3
711+ let $t03241132656 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, realizedPnl)
712+ let remainMargin = $t03241132656._1
713+ let badDebt = $t03241132656._2
714+ let fundingPayment = $t03241132656._3
678715 let exchangedQuoteAssetAmount = openNotional
679716 let unrealizedPnlAfter = (unrealizedPnl - realizedPnl)
680717 let remainOpenNotional = if ((oldPositionSize > 0))
689726 }
690727 }
691728 else throw("Close position first")
692- let newPositionSize = $t02904731596._1
693- let newPositionRemainMargin = $t02904731596._2
694- let newPositionOpenNotional = $t02904731596._3
695- let newPositionLatestCPF = $t02904731596._4
696- let baseAssetReserveAfter = $t02904731596._5
697- let quoteAssetReserveAfter = $t02904731596._6
698- let totalPositionSizeAfter = $t02904731596._7
699- let cumulativeNotionalAfter = $t02904731596._8
700- let openInterestNotionalAfter = $t02904731596._9
701- let totalLongAfter = $t02904731596._10
702- let totalShortAfter = $t02904731596._11
729+ let newPositionSize = $t03137833927._1
730+ let newPositionRemainMargin = $t03137833927._2
731+ let newPositionOpenNotional = $t03137833927._3
732+ let newPositionLatestCPF = $t03137833927._4
733+ let baseAssetReserveAfter = $t03137833927._5
734+ let quoteAssetReserveAfter = $t03137833927._6
735+ let totalPositionSizeAfter = $t03137833927._7
736+ let cumulativeNotionalAfter = $t03137833927._8
737+ let openInterestNotionalAfter = $t03137833927._9
738+ let totalLongAfter = $t03137833927._10
739+ let totalShortAfter = $t03137833927._11
703740 let notifyNotional = invoke(minerAddress(), "notifyNotional", [toString(i.caller), newPositionOpenNotional], nil)
704741 if ((notifyNotional == notifyNotional))
705742 then (updatePosition(toString(i.caller), newPositionSize, newPositionRemainMargin, newPositionOpenNotional, newPositionLatestCPF) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter))
711748 @Callable(i)
712749 func increasePosition (_direction,_leverage,_minBaseAssetAmount) = {
713750 let _rawAmount = i.payments[0].amount
714- if (if (if (if (if (if (if (if ((_direction != DIR_LONG))
751+ if (if (if (if (if (if (if ((_direction != DIR_LONG))
715752 then (_direction != DIR_SHORT)
716753 else false)
717754 then true
718755 else (0 >= _rawAmount))
719- then true
720- else if (((1 * DECIMAL_UNIT) > _leverage))
721- then true
722- else (_leverage > (3 * DECIMAL_UNIT)))
723756 then true
724757 else !(initialized()))
725758 then true
732765 else {
733766 let feeAmount = muld(_rawAmount, fee())
734767 let _amount = (_rawAmount - feeAmount)
735- let $t03278432936 = getPosition(toString(i.caller))
736- let oldPositionSize = $t03278432936._1
737- let oldPositionMargin = $t03278432936._2
738- let oldPositionOpenNotional = $t03278432936._3
739- let oldPositionLstUpdCPF = $t03278432936._4
768+ let $t03504535197 = getPosition(toString(i.caller))
769+ let oldPositionSize = $t03504535197._1
770+ let oldPositionMargin = $t03504535197._2
771+ let oldPositionOpenNotional = $t03504535197._3
772+ let oldPositionLstUpdCPF = $t03504535197._4
740773 let isNewPosition = (oldPositionSize == 0)
741774 let isSameDirection = if ((oldPositionSize > 0))
742775 then (_direction == DIR_LONG)
745778 then isSameDirection
746779 else false
747780 let isAdd = (_direction == DIR_LONG)
748- let $t03322535614 = if (if (isNewPosition)
781+ let $t03548637875 = if (if (isNewPosition)
749782 then true
750783 else expandExisting)
751784 then {
752785 let openNotional = muld(_amount, _leverage)
753- let $t03364933855 = swapInput(isAdd, openNotional)
754- let amountBaseAssetBought = $t03364933855._1
755- let quoteAssetReserveAfter = $t03364933855._2
756- let baseAssetReserveAfter = $t03364933855._3
757- let totalPositionSizeAfter = $t03364933855._4
758- let cumulativeNotionalAfter = $t03364933855._5
786+ let $t03591036116 = swapInput(isAdd, openNotional)
787+ let amountBaseAssetBought = $t03591036116._1
788+ let quoteAssetReserveAfter = $t03591036116._2
789+ let baseAssetReserveAfter = $t03591036116._3
790+ let totalPositionSizeAfter = $t03591036116._4
791+ let cumulativeNotionalAfter = $t03591036116._5
759792 if (if ((_minBaseAssetAmount != 0))
760793 then (_minBaseAssetAmount > abs(amountBaseAssetBought))
761794 else false)
763796 else {
764797 let newPositionSize = (oldPositionSize + amountBaseAssetBought)
765798 let increaseMarginRequirement = divd(openNotional, _leverage)
766- let $t03423634475 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, increaseMarginRequirement)
767- let remainMargin = $t03423634475._1
768- let x1 = $t03423634475._2
769- let x2 = $t03423634475._3
799+ let $t03649736736 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, increaseMarginRequirement)
800+ let remainMargin = $t03649736736._1
801+ let x1 = $t03649736736._2
802+ let x2 = $t03649736736._3
770803 $Tuple11(newPositionSize, remainMargin, (oldPositionOpenNotional + openNotional), latestCumulativePremiumFraction(newPositionSize), baseAssetReserveAfter, quoteAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, (openInterestNotional() + openNotional), (totalLongPositionSize() + (if ((newPositionSize > 0))
771804 then abs(amountBaseAssetBought)
772805 else 0)), (totalShortPositionSize() + (if ((0 > newPositionSize))
776809 }
777810 else {
778811 let openNotional = muld(_amount, _leverage)
779- let $t03530735423 = getPositionNotionalAndUnrealizedPnl(toString(i.caller), PNL_OPTION_SPOT)
780- let oldPositionNotional = $t03530735423._1
781- let unrealizedPnl = $t03530735423._2
812+ let $t03756837684 = getPositionNotionalAndUnrealizedPnl(toString(i.caller), PNL_OPTION_SPOT)
813+ let oldPositionNotional = $t03756837684._1
814+ let unrealizedPnl = $t03756837684._2
782815 if ((oldPositionNotional > openNotional))
783816 then throw("Use decreasePosition to decrease position size")
784817 else throw("Close position first")
785818 }
786- let newPositionSize = $t03322535614._1
787- let newPositionRemainMargin = $t03322535614._2
788- let newPositionOpenNotional = $t03322535614._3
789- let newPositionLatestCPF = $t03322535614._4
790- let baseAssetReserveAfter = $t03322535614._5
791- let quoteAssetReserveAfter = $t03322535614._6
792- let totalPositionSizeAfter = $t03322535614._7
793- let cumulativeNotionalAfter = $t03322535614._8
794- let openInterestNotionalAfter = $t03322535614._9
795- let totalLongAfter = $t03322535614._10
796- let totalShortAfter = $t03322535614._11
819+ let newPositionSize = $t03548637875._1
820+ let newPositionRemainMargin = $t03548637875._2
821+ let newPositionOpenNotional = $t03548637875._3
822+ let newPositionLatestCPF = $t03548637875._4
823+ let baseAssetReserveAfter = $t03548637875._5
824+ let quoteAssetReserveAfter = $t03548637875._6
825+ let totalPositionSizeAfter = $t03548637875._7
826+ let cumulativeNotionalAfter = $t03548637875._8
827+ let openInterestNotionalAfter = $t03548637875._9
828+ let totalLongAfter = $t03548637875._10
829+ let totalShortAfter = $t03548637875._11
797830 let feeToStakers = (feeAmount / 2)
798831 let feeToInsurance = (feeAmount - feeToStakers)
799832 let stake = invoke(quoteAssetStaking(), "lockNeutrinoSP", [toString(stakingAddress()), ALL_FEES], [AttachedPayment(quoteAsset(), _amount)])
834867 else {
835868 let feeAmount = muld(_rawAmount, fee())
836869 let _amount = (_rawAmount - feeAmount)
837- let $t03717037322 = getPosition(toString(i.caller))
838- let oldPositionSize = $t03717037322._1
839- let oldPositionMargin = $t03717037322._2
840- let oldPositionOpenNotional = $t03717037322._3
841- let oldPositionLstUpdCPF = $t03717037322._4
870+ let $t03943139583 = getPosition(toString(i.caller))
871+ let oldPositionSize = $t03943139583._1
872+ let oldPositionMargin = $t03943139583._2
873+ let oldPositionOpenNotional = $t03943139583._3
874+ let oldPositionLstUpdCPF = $t03943139583._4
842875 let feeToStakers = (feeAmount / 2)
843876 let feeToInsurance = (feeAmount - feeToStakers)
844877 let stake = invoke(quoteAssetStaking(), "lockNeutrinoSP", [toString(stakingAddress()), ALL_FEES], [AttachedPayment(quoteAsset(), _amount)])
870903 else paused())
871904 then throw("Invalid removeMargin parameters")
872905 else {
873- let $t03837138523 = getPosition(toString(i.caller))
874- let oldPositionSize = $t03837138523._1
875- let oldPositionMargin = $t03837138523._2
876- let oldPositionOpenNotional = $t03837138523._3
877- let oldPositionLstUpdCPF = $t03837138523._4
906+ let $t04063240784 = getPosition(toString(i.caller))
907+ let oldPositionSize = $t04063240784._1
908+ let oldPositionMargin = $t04063240784._2
909+ let oldPositionOpenNotional = $t04063240784._3
910+ let oldPositionLstUpdCPF = $t04063240784._4
878911 let marginDelta = -(_amount)
879- let $t03856038739 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, marginDelta)
880- let remainMargin = $t03856038739._1
881- let badDebt = $t03856038739._2
912+ let $t04082141000 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, marginDelta)
913+ let remainMargin = $t04082141000._1
914+ let badDebt = $t04082141000._2
882915 if ((badDebt != 0))
883916 then throw("Invalid removed margin amount")
884917 else {
904937 else paused())
905938 then throw("Invalid closePosition parameters")
906939 else {
907- let $t03983540219 = internalClosePosition(toString(i.caller))
908- let x1 = $t03983540219._1
909- let positionBadDebt = $t03983540219._2
910- let realizedPnl = $t03983540219._3
911- let marginToVault = $t03983540219._4
912- let quoteAssetReserveAfter = $t03983540219._5
913- let baseAssetReserveAfter = $t03983540219._6
914- let totalPositionSizeAfter = $t03983540219._7
915- let cumulativeNotionalAfter = $t03983540219._8
916- let openInterestNotionalAfter = $t03983540219._9
917- let x2 = $t03983540219._10
918- let totalLongAfter = $t03983540219._11
919- let totalShortAfter = $t03983540219._12
940+ let $t04209642486 = internalClosePosition(toString(i.caller), true)
941+ let x1 = $t04209642486._1
942+ let positionBadDebt = $t04209642486._2
943+ let realizedPnl = $t04209642486._3
944+ let marginToVault = $t04209642486._4
945+ let quoteAssetReserveAfter = $t04209642486._5
946+ let baseAssetReserveAfter = $t04209642486._6
947+ let totalPositionSizeAfter = $t04209642486._7
948+ let cumulativeNotionalAfter = $t04209642486._8
949+ let openInterestNotionalAfter = $t04209642486._9
950+ let x2 = $t04209642486._10
951+ let totalLongAfter = $t04209642486._11
952+ let totalShortAfter = $t04209642486._12
920953 if ((positionBadDebt > 0))
921954 then throw("Unable to close position with bad debt")
922955 else {
923956 let withdrawAmount = abs(marginToVault)
924957 let ammBalance = (cbalance() - withdrawAmount)
925- let $t04042840570 = if ((0 > ammBalance))
958+ let $t04269542837 = if ((0 > ammBalance))
926959 then $Tuple2(0, abs(ammBalance))
927960 else $Tuple2(ammBalance, 0)
928- let ammNewBalance = $t04042840570._1
929- let getFromInsurance = $t04042840570._2
961+ let ammNewBalance = $t04269542837._1
962+ let getFromInsurance = $t04269542837._2
930963 let x = if ((getFromInsurance > 0))
931964 then {
932965 let withdrawInsurance = invoke(insuranceAddress(), "withdraw", [getFromInsurance], nil)
9711004 else paused())
9721005 then throw("Unable to liquidate")
9731006 else {
974- let $t04226042676 = internalClosePosition(_trader)
975- let x1 = $t04226042676._1
976- let badDebt = $t04226042676._2
977- let x2 = $t04226042676._3
978- let x3 = $t04226042676._4
979- let quoteAssetReserveAfter = $t04226042676._5
980- let baseAssetReserveAfter = $t04226042676._6
981- let totalPositionSizeAfter = $t04226042676._7
982- let cumulativeNotionalAfter = $t04226042676._8
983- let openInterestNotionalAfter = $t04226042676._9
984- let exchangedQuoteAssetAmount = $t04226042676._10
985- let totalLongAfter = $t04226042676._11
986- let totalShortAfter = $t04226042676._12
1007+ let $t04452744950 = internalClosePosition(_trader, false)
1008+ let x1 = $t04452744950._1
1009+ let badDebt = $t04452744950._2
1010+ let x2 = $t04452744950._3
1011+ let x3 = $t04452744950._4
1012+ let quoteAssetReserveAfter = $t04452744950._5
1013+ let baseAssetReserveAfter = $t04452744950._6
1014+ let totalPositionSizeAfter = $t04452744950._7
1015+ let cumulativeNotionalAfter = $t04452744950._8
1016+ let openInterestNotionalAfter = $t04452744950._9
1017+ let exchangedQuoteAssetAmount = $t04452744950._10
1018+ let totalLongAfter = $t04452744950._11
1019+ let totalShortAfter = $t04452744950._12
9871020 let liquidationPenalty = muld(exchangedQuoteAssetAmount, liquidationFeeRatio())
9881021 let feeToLiquidator = (liquidationPenalty / 2)
9891022 let feeToInsurance = (liquidationPenalty - feeToLiquidator)
9901023 let ammBalance = (cbalance() - liquidationPenalty)
991- let $t04307443209 = if ((0 > ammBalance))
1024+ let $t04534845483 = if ((0 > ammBalance))
9921025 then $Tuple2(0, abs(ammBalance))
9931026 else $Tuple2(ammBalance, 0)
994- let newAmmBalance = $t04307443209._1
995- let takeFromInsurance = $t04307443209._2
1027+ let newAmmBalance = $t04534845483._1
1028+ let takeFromInsurance = $t04534845483._2
9961029 let x = if ((takeFromInsurance > 0))
9971030 then {
9981031 let withdrawInsurance = invoke(insuranceAddress(), "withdraw", [takeFromInsurance], nil)
10371070 let underlyingPrice = getOracleTwapPrice()
10381071 let spotTwapPrice = getTwapSpotPrice()
10391072 let premium = (spotTwapPrice - underlyingPrice)
1040- let $t04470346038 = if (if ((totalShortPositionSize() == 0))
1073+ let $t04697748312 = if (if ((totalShortPositionSize() == 0))
10411074 then true
10421075 else (totalLongPositionSize() == 0))
10431076 then $Tuple2(0, 0)
10521085 let shortPremiumFraction = divd(muld(longPremiumFraction, totalLongPositionSize()), totalShortPositionSize())
10531086 $Tuple2(shortPremiumFraction, longPremiumFraction)
10541087 }
1055- let shortPremiumFraction = $t04470346038._1
1056- let longPremiumFraction = $t04470346038._2
1088+ let shortPremiumFraction = $t04697748312._1
1089+ let longPremiumFraction = $t04697748312._2
10571090 updateFunding((fundingBlockTimestamp + fundingPeriodSeconds()), (latestLongCumulativePremiumFraction() + longPremiumFraction), (latestShortCumulativePremiumFraction() + shortPremiumFraction), divd(longPremiumFraction, underlyingPrice), divd(shortPremiumFraction, underlyingPrice))
10581091 }
10591092 }
10621095
10631096 @Callable(i)
10641097 func v_get (_trader) = {
1065- let $t04641346466 = internalClosePosition(_trader)
1066- let x1 = $t04641346466._1
1067- let x2 = $t04641346466._2
1068- let x3 = $t04641346466._3
1069- let x4 = $t04641346466._4
1098+ let $t04868748747 = internalClosePosition(_trader, false)
1099+ let x1 = $t04868748747._1
1100+ let x2 = $t04868748747._2
1101+ let x3 = $t04868748747._3
1102+ let x4 = $t04868748747._4
10701103 throw((((s(x2) + s(x3)) + s(x4)) + s(getMarginRatio(_trader))))
10711104 }
10721105
10741107
10751108 @Callable(i)
10761109 func view_calcRemainMarginWithFundingPayment (_trader) = {
1077- let $t04661346724 = getPosition(_trader)
1078- let positionSize = $t04661346724._1
1079- let positionMargin = $t04661346724._2
1080- let pon = $t04661346724._3
1081- let positionLstUpdCPF = $t04661346724._4
1082- let $t04672946830 = getPositionNotionalAndUnrealizedPnl(_trader, PNL_OPTION_SPOT)
1083- let positionNotional = $t04672946830._1
1084- let unrealizedPnl = $t04672946830._2
1085- let $t04683547017 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl)
1086- let remainMargin = $t04683547017._1
1087- let badDebt = $t04683547017._2
1088- let fundingPayment = $t04683547017._3
1089- throw(((s(remainMargin) + s(fundingPayment)) + s(getMarginRatio(_trader))))
1110+ let $t04889449005 = getPosition(_trader)
1111+ let positionSize = $t04889449005._1
1112+ let positionMargin = $t04889449005._2
1113+ let pon = $t04889449005._3
1114+ let positionLstUpdCPF = $t04889449005._4
1115+ let $t04901049111 = getPositionNotionalAndUnrealizedPnl(_trader, PNL_OPTION_SPOT)
1116+ let positionNotional = $t04901049111._1
1117+ let unrealizedPnl = $t04901049111._2
1118+ let $t04911649298 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl)
1119+ let remainMargin = $t04911649298._1
1120+ let badDebt = $t04911649298._2
1121+ let fundingPayment = $t04911649298._3
1122+ throw(((((s(remainMargin) + s(fundingPayment)) + s(getMarginRatio(_trader))) + s(unrealizedPnl)) + s(badDebt)))
10901123 }
10911124
10921125
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let k_ora_key = "k_ora_key"
55
66 let k_ora_block_key = "k_ora_block_key"
77
88 let k_ora = "k_ora"
99
1010 let k_balance = "k_balance"
1111
1212 let k_positionSize = "k_positionSize"
1313
1414 let k_positionMargin = "k_positionMargin"
1515
1616 let k_positionOpenNotional = "k_positionOpenNotional"
1717
1818 let k_positionLastUpdatedCumulativePremiumFraction = "k_positionFraction"
1919
2020 let k_initialized = "k_initialized"
2121
2222 let k_paused = "k_paused"
2323
2424 let k_fee = "k_fee"
2525
2626 let k_fundingPeriod = "k_fundingPeriod"
2727
2828 let k_initMarginRatio = "k_initMarginRatio"
2929
3030 let k_maintenanceMarginRatio = "k_mmr"
3131
3232 let k_liquidationFeeRatio = "k_liquidationFeeRatio"
3333
3434 let k_spreadLimit = "k_spreadLimit"
3535
3636 let k_maxPriceImpact = "k_maxPriceImpact"
3737
3838 let k_lastDataStr = "k_lastDataStr"
3939
4040 let k_lastMinuteId = "k_lastMinuteId"
4141
4242 let k_twapDataLastCumulativePrice = "k_twapDataLastCumulativePrice"
4343
4444 let k_twapDataLastPrice = "k_twapDataLastPrice"
4545
4646 let k_twapDataPreviousMinuteId = "k_twapDataPreviousMinuteId"
4747
4848 let k_latestLongCumulativePremiumFraction = "k_latestLongPremiumFraction"
4949
5050 let k_latestShortCumulativePremiumFraction = "k_latestShortPremiumFraction"
5151
5252 let k_nextFundingBlock = "k_nextFundingBlockMinTimestamp"
5353
5454 let k_longFundingRate = "k_longFundingRate"
5555
5656 let k_shortFundingRate = "k_shortFundingRate"
5757
5858 let k_quoteAssetReserve = "k_qtAstR"
5959
6060 let k_baseAssetReserve = "k_bsAstR"
6161
6262 let k_totalPositionSize = "k_totalPositionSize"
6363
6464 let k_totalLongPositionSize = "k_totalLongPositionSize"
6565
6666 let k_totalShortPositionSize = "k_totalShortPositionSize"
6767
6868 let k_cumulativeNotional = "k_cumulativeNotional"
6969
7070 let k_openInterestNotional = "k_openInterestNotional"
7171
7272 let k_coordinatorAddress = "k_coordinatorAddress"
7373
7474 let k_insurance_address = "k_insurance_address"
7575
7676 let k_admin_address = "k_admin_address"
7777
7878 let k_admin_public_key = "k_admin_public_key"
7979
8080 let k_quote_asset = "k_quote_asset"
8181
8282 let k_quote_staking = "k_quote_staking"
8383
8484 let k_staking_address = "k_staking_address"
8585
8686 let k_miner_address = "k_miner_address"
8787
8888 func coordinator () = valueOrErrorMessage(addressFromString(getStringValue(this, k_coordinatorAddress)), "Coordinator not set")
8989
9090
9191 func adminAddress () = addressFromString(getStringValue(coordinator(), k_admin_address))
9292
9393
9494 func adminPublicKey () = fromBase58String(getStringValue(coordinator(), k_admin_public_key))
9595
9696
9797 func quoteAsset () = fromBase58String(getStringValue(coordinator(), k_quote_asset))
9898
9999
100100 func quoteAssetStaking () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_quote_staking)), "Quote asset staking not set")
101101
102102
103103 func stakingAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_staking_address)), "Insurance not set")
104104
105105
106106 func insuranceAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_insurance_address)), "Insurance not set")
107107
108108
109109 func minerAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_miner_address)), "Insurance not set")
110110
111111
112112 let DIR_LONG = 1
113113
114114 let DIR_SHORT = 2
115115
116-let FUNDING_BLOCK_INTERVAL = 60
117-
118116 let TWAP_INTERVAL = 15
119117
120118 let ORACLE_INTERVAL = 15
121119
122120 let SECONDS = 1000
123121
124122 let DECIMAL_UNIT = (1 * (((((10 * 10) * 10) * 10) * 10) * 10))
125-
126-let HUNDRED_PERCENT = (100 * DECIMAL_UNIT)
127123
128124 let ONE_DAY = (86400 * DECIMAL_UNIT)
129125
130126 let ALL_FEES = 100
131127
132128 let PNL_OPTION_SPOT = 1
133129
134130 let PNL_OPTION_ORACLE = 2
135131
136132 func s (_x) = (toString(_x) + ",")
137133
138134
139135 func divd (_x,_y) = fraction(_x, DECIMAL_UNIT, _y, HALFEVEN)
140136
141137
142138 func muld (_x,_y) = fraction(_x, _y, DECIMAL_UNIT, HALFEVEN)
143139
144140
145141 func abs (_x) = if ((_x > 0))
146142 then _x
147143 else -(_x)
148144
149145
150146 func vmax (_x,_y) = if ((_x >= _y))
151147 then _x
152148 else _y
153149
154150
155151 func toCompositeKey (_key,_address) = ((_key + "_") + _address)
156152
157153
158154 func listToStr (_list) = {
159155 func _join (accumulator,val) = ((accumulator + val) + ",")
160156
161157 let newListStr = {
162158 let $l = _list
163159 let $s = size($l)
164160 let $acc0 = ""
165161 func $f0_1 ($a,$i) = if (($i >= $s))
166162 then $a
167163 else _join($a, $l[$i])
168164
169165 func $f0_2 ($a,$i) = if (($i >= $s))
170166 then $a
171167 else throw("List size exceeds 20")
172168
173169 $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)
174170 }
175171 let newListStrU = dropRight(newListStr, 1)
176172 let newListStrR = if ((take(newListStrU, 1) == ","))
177173 then drop(newListStrU, 1)
178174 else newListStrU
179175 newListStrR
180176 }
181177
182178
183179 func strToList (_str) = split(_str, ",")
184180
185181
186182 func pushToQueue (_list,_maxSize,_value) = if ((size(_list) > _maxSize))
187183 then (removeByIndex(_list, 0) :+ _value)
188184 else (_list :+ _value)
189185
190186
191187 func int (k) = valueOrErrorMessage(getInteger(this, k), ("no value for " + k))
192188
193189
194190 func cbalance () = int(k_balance)
195191
196192
197193 func fee () = int(k_fee)
198194
199195
200196 func initMarginRatio () = int(k_initMarginRatio)
201197
202198
203199 func qtAstR () = int(k_quoteAssetReserve)
204200
205201
206202 func bsAstR () = int(k_baseAssetReserve)
207203
208204
209205 func totalPositionSize () = int(k_totalPositionSize)
210206
211207
212208 func cumulativeNotional () = int(k_cumulativeNotional)
213209
214210
215211 func openInterestNotional () = int(k_openInterestNotional)
216212
217213
218214 func nextFundingBlockTimestamp () = int(k_nextFundingBlock)
219215
220216
221217 func fundingPeriodRaw () = int(k_fundingPeriod)
222218
223219
224220 func fundingPeriodDecimal () = (fundingPeriodRaw() * DECIMAL_UNIT)
225221
226222
227223 func fundingPeriodSeconds () = (fundingPeriodRaw() * SECONDS)
228224
229225
230226 func maintenanceMarginRatio () = int(k_maintenanceMarginRatio)
231227
232228
233229 func liquidationFeeRatio () = int(k_liquidationFeeRatio)
234230
235231
236232 func spreadLimit () = int(k_spreadLimit)
237233
238234
239235 func maxPriceImpact () = int(k_maxPriceImpact)
240236
241237
242238 func latestLongCumulativePremiumFraction () = int(k_latestLongCumulativePremiumFraction)
243239
244240
245241 func latestShortCumulativePremiumFraction () = int(k_latestShortCumulativePremiumFraction)
246242
247243
248244 func totalShortPositionSize () = int(k_totalShortPositionSize)
249245
250246
251247 func totalLongPositionSize () = int(k_totalLongPositionSize)
252248
253249
254250 func requireMoreMarginRatio (_marginRatio,_baseMarginRatio,_largerThanOrEqualTo) = {
255251 let remainingMarginRatio = (_marginRatio - _baseMarginRatio)
256252 if (if (_largerThanOrEqualTo)
257253 then (0 > remainingMarginRatio)
258254 else false)
259255 then throw("Invalid margin")
260256 else if (if (!(_largerThanOrEqualTo))
261257 then (remainingMarginRatio >= 0)
262258 else false)
263259 then throw("Invalid margin")
264260 else true
265261 }
266262
267263
268264 func latestCumulativePremiumFraction (_positionSize) = if ((_positionSize == 0))
269265 then throw("Should not be called with _positionSize == 0")
270266 else if ((_positionSize > 0))
271267 then latestLongCumulativePremiumFraction()
272268 else latestShortCumulativePremiumFraction()
273269
274270
275271 func getPosition (_trader) = {
276272 let positionSizeOpt = getInteger(this, toCompositeKey(k_positionSize, _trader))
277273 match positionSizeOpt {
278274 case positionSize: Int =>
279275 $Tuple4(positionSize, getIntegerValue(this, toCompositeKey(k_positionMargin, _trader)), getIntegerValue(this, toCompositeKey(k_positionOpenNotional, _trader)), getIntegerValue(this, toCompositeKey(k_positionLastUpdatedCumulativePremiumFraction, _trader)))
280276 case _ =>
281277 $Tuple4(0, 0, 0, 0)
282278 }
283279 }
284280
285281
286282 func requireOpenPosition (_trader) = if ((getPosition(_trader)._1 == 0))
287283 then throw("No open position")
288284 else true
289285
290286
291287 func initialized () = valueOrElse(getBoolean(this, k_initialized), false)
292288
293289
294290 func paused () = valueOrElse(getBoolean(this, k_paused), false)
295291
296292
297293 func updateReserve (_isAdd,_quoteAssetAmount,_baseAssetAmount) = if (_isAdd)
298294 then {
299295 let newBase = (bsAstR() - _baseAssetAmount)
300296 if ((0 >= newBase))
301297 then throw("Tx lead to base asset reserve <= 0, revert")
302298 else $Tuple4((qtAstR() + _quoteAssetAmount), newBase, (totalPositionSize() + _baseAssetAmount), (cumulativeNotional() + _quoteAssetAmount))
303299 }
304300 else {
305301 let newQuote = (qtAstR() - _quoteAssetAmount)
306302 if ((0 >= newQuote))
307303 then throw("Tx lead to base quote reserve <= 0, revert")
308304 else $Tuple4(newQuote, (bsAstR() + _baseAssetAmount), (totalPositionSize() - _baseAssetAmount), (cumulativeNotional() - _quoteAssetAmount))
309305 }
310306
311307
312308 func swapInput (_isAdd,_quoteAssetAmount) = {
313309 let _qtAstR = qtAstR()
314310 let _bsAstR = bsAstR()
315- let priceBefore = divd(_qtAstR, _bsAstR)
316- let amountBaseAssetBoughtWithoutPriceImpact = muld(_quoteAssetAmount, priceBefore)
317311 let k = muld(_qtAstR, _bsAstR)
318312 let quoteAssetReserveAfter = if (_isAdd)
319313 then (_qtAstR + _quoteAssetAmount)
320314 else (_qtAstR - _quoteAssetAmount)
321315 let baseAssetReserveAfter = divd(k, quoteAssetReserveAfter)
322316 let amountBaseAssetBoughtAbs = abs((baseAssetReserveAfter - _bsAstR))
323317 let amountBaseAssetBought = if (_isAdd)
324318 then amountBaseAssetBoughtAbs
325319 else -(amountBaseAssetBoughtAbs)
326- let priceImpact = ((amountBaseAssetBoughtWithoutPriceImpact - amountBaseAssetBoughtAbs) / amountBaseAssetBoughtWithoutPriceImpact)
320+ let $t01183712030 = updateReserve(_isAdd, _quoteAssetAmount, amountBaseAssetBoughtAbs)
321+ let quoteAssetReserveAfter1 = $t01183712030._1
322+ let baseAssetReserveAfter1 = $t01183712030._2
323+ let totalPositionSizeAfter1 = $t01183712030._3
324+ let cumulativeNotionalAfter1 = $t01183712030._4
325+ let priceBefore = divd(_qtAstR, _bsAstR)
326+ let marketPrice = divd(_quoteAssetAmount, amountBaseAssetBoughtAbs)
327+ let priceDiff = abs((priceBefore - marketPrice))
328+ let priceImpact = (DECIMAL_UNIT - divd(priceBefore, (priceBefore + priceDiff)))
327329 let maxPriceImpactValue = maxPriceImpact()
328330 if ((priceImpact > maxPriceImpactValue))
329- then throw(((("Price impact " + toString(priceImpact)) + " > max price impact ") + toString(maxPriceImpactValue)))
330- else {
331- let $t01236812571 = updateReserve(_isAdd, _quoteAssetAmount, amountBaseAssetBoughtAbs)
332- let quoteAssetReserveAfter1 = $t01236812571._1
333- let baseAssetReserveAfter1 = $t01236812571._2
334- let totalPositionSizeAfter1 = $t01236812571._3
335- let cumulativeNotionalAfter1 = $t01236812571._4
336- $Tuple5(amountBaseAssetBought, quoteAssetReserveAfter1, baseAssetReserveAfter1, totalPositionSizeAfter1, cumulativeNotionalAfter1)
337- }
331+ 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)))
332+ else $Tuple5(amountBaseAssetBought, quoteAssetReserveAfter1, baseAssetReserveAfter1, totalPositionSizeAfter1, cumulativeNotionalAfter1)
338333 }
339334
340335
341336 func calcRemainMarginWithFundingPayment (_oldPositionSize,_oldPositionMargin,_oldPositionCumulativePremiumFraction,_marginDelta) = {
342337 let fundingPayment = if ((_oldPositionSize != 0))
343338 then {
344339 let _latestCumulativePremiumFraction = latestCumulativePremiumFraction(_oldPositionSize)
345340 muld((_latestCumulativePremiumFraction - _oldPositionCumulativePremiumFraction), _oldPositionSize)
346341 }
347342 else 0
348343 let signedMargin = ((_marginDelta - fundingPayment) + _oldPositionMargin)
349- let $t01331813445 = if ((0 > signedMargin))
344+ let $t01352113648 = if ((0 > signedMargin))
350345 then $Tuple2(0, abs(signedMargin))
351346 else $Tuple2(abs(signedMargin), 0)
352- let remainMargin = $t01331813445._1
353- let badDebt = $t01331813445._2
347+ let remainMargin = $t01352113648._1
348+ let badDebt = $t01352113648._2
354349 $Tuple3(remainMargin, badDebt, fundingPayment)
355350 }
356351
357352
358-func swapOutput (_isAdd,_baseAssetAmount) = {
353+func swapOutput (_isAdd,_baseAssetAmount,_checkMaxPriceImpact) = {
359354 let _quoteAssetReserve = qtAstR()
360355 let _baseAssetReserve = bsAstR()
356+ let priceBefore = divd(_quoteAssetReserve, _baseAssetReserve)
361357 if ((_baseAssetAmount == 0))
362358 then throw("Invalid base asset amount")
363359 else {
364360 let k = muld(_quoteAssetReserve, _baseAssetReserve)
365361 let baseAssetPoolAmountAfter = if (_isAdd)
366362 then (_baseAssetReserve + _baseAssetAmount)
367363 else (_baseAssetReserve - _baseAssetAmount)
368364 let quoteAssetAfter = divd(k, baseAssetPoolAmountAfter)
369365 let quoteAssetSold = abs((quoteAssetAfter - _quoteAssetReserve))
370- let $t01428314476 = updateReserve(!(_isAdd), quoteAssetSold, _baseAssetAmount)
371- let quoteAssetReserveAfter1 = $t01428314476._1
372- let baseAssetReserveAfter1 = $t01428314476._2
373- let totalPositionSizeAfter1 = $t01428314476._3
374- let cumulativeNotionalAfter1 = $t01428314476._4
375- $Tuple7(quoteAssetSold, quoteAssetReserveAfter1, baseAssetReserveAfter1, totalPositionSizeAfter1, cumulativeNotionalAfter1, (totalLongPositionSize() - (if (_isAdd)
376- then abs(_baseAssetAmount)
377- else 0)), (totalShortPositionSize() - (if (!(_isAdd))
378- then abs(_baseAssetAmount)
379- else 0)))
366+ let maxPriceImpactValue = maxPriceImpact()
367+ let $t01463214825 = updateReserve(!(_isAdd), quoteAssetSold, _baseAssetAmount)
368+ let quoteAssetReserveAfter1 = $t01463214825._1
369+ let baseAssetReserveAfter1 = $t01463214825._2
370+ let totalPositionSizeAfter1 = $t01463214825._3
371+ let cumulativeNotionalAfter1 = $t01463214825._4
372+ let marketPrice = divd(quoteAssetSold, _baseAssetAmount)
373+ let priceDiff = abs((priceBefore - marketPrice))
374+ let priceImpact = (DECIMAL_UNIT - divd(priceBefore, (priceBefore + priceDiff)))
375+ if (if ((priceImpact > maxPriceImpactValue))
376+ then _checkMaxPriceImpact
377+ else false)
378+ 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)))
379+ else $Tuple7(quoteAssetSold, quoteAssetReserveAfter1, baseAssetReserveAfter1, totalPositionSizeAfter1, cumulativeNotionalAfter1, (totalLongPositionSize() - (if (_isAdd)
380+ then abs(_baseAssetAmount)
381+ else 0)), (totalShortPositionSize() - (if (!(_isAdd))
382+ then abs(_baseAssetAmount)
383+ else 0)))
380384 }
381385 }
382386
383387
384388 func getOracleTwapPrice () = {
385389 let oracle = valueOrErrorMessage(addressFromString(getStringValue(this, k_ora)), "")
386390 let priceKey = getStringValue(this, k_ora_key)
387391 let blockKey = getStringValue(this, k_ora_block_key)
388- let lastValue = getIntegerValue(oracle, priceKey)
392+ let lastValue = valueOrErrorMessage(getInteger(oracle, priceKey), ((("Can not get oracle price. Oracle: " + toString(oracle)) + " key: ") + priceKey))
389393 lastValue
390394 }
391395
392396
393397 func getSpotPrice () = {
394398 let _quoteAssetReserve = qtAstR()
395399 let _baseAssetReserve = bsAstR()
396400 divd(_quoteAssetReserve, _baseAssetReserve)
397401 }
398402
399403
400404 func isOverFluctuationLimit () = {
401405 let oraclePrice = getOracleTwapPrice()
402406 let currentPrice = getSpotPrice()
403407 (divd(abs((oraclePrice - currentPrice)), oraclePrice) > spreadLimit())
404408 }
405409
406410
407411 func getPositionNotionalAndUnrealizedPnl (_trader,_option) = {
408- let $t01610816236 = getPosition(_trader)
409- let positionSize = $t01610816236._1
410- let positionMargin = $t01610816236._2
411- let positionOpenNotional = $t01610816236._3
412- let positionLstUpdCPF = $t01610816236._4
412+ let $t01729317421 = getPosition(_trader)
413+ let positionSize = $t01729317421._1
414+ let positionMargin = $t01729317421._2
415+ let positionOpenNotional = $t01729317421._3
416+ let positionLstUpdCPF = $t01729317421._4
413417 let positionSizeAbs = abs(positionSize)
414418 if ((positionSizeAbs == 0))
415419 then throw("Invalid position size")
416420 else {
417421 let isShort = (0 > positionSize)
418422 let positionNotional = if ((_option == PNL_OPTION_SPOT))
419423 then {
420- let $t01648316590 = swapOutput(!(isShort), positionSizeAbs)
421- let outPositionNotional = $t01648316590._1
422- let x1 = $t01648316590._2
423- let x2 = $t01648316590._3
424- let x3 = $t01648316590._4
424+ let $t01766817792 = swapOutput(!(isShort), positionSizeAbs, false)
425+ let outPositionNotional = $t01766817792._1
426+ let x1 = $t01766817792._2
427+ let x2 = $t01766817792._3
428+ let x3 = $t01766817792._4
425429 outPositionNotional
426430 }
427431 else muld(positionSizeAbs, getOracleTwapPrice())
428432 let unrealizedPnl = if (isShort)
429433 then (positionOpenNotional - positionNotional)
430434 else (positionNotional - positionOpenNotional)
431435 $Tuple2(positionNotional, unrealizedPnl)
432436 }
433437 }
434438
435439
436440 func calcMarginRatio (_remainMargin,_badDebt,_positionNotional) = divd((_remainMargin - _badDebt), _positionNotional)
437441
438442
439443 func getMarginRatioByOption (_trader,_option) = {
440- let $t01726017371 = getPosition(_trader)
441- let positionSize = $t01726017371._1
442- let positionMargin = $t01726017371._2
443- let pon = $t01726017371._3
444- let positionLstUpdCPF = $t01726017371._4
445- let $t01737717470 = getPositionNotionalAndUnrealizedPnl(_trader, _option)
446- let positionNotional = $t01737717470._1
447- let unrealizedPnl = $t01737717470._2
448- let $t01747517641 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl)
449- let remainMargin = $t01747517641._1
450- let badDebt = $t01747517641._2
444+ let $t01846218573 = getPosition(_trader)
445+ let positionSize = $t01846218573._1
446+ let positionMargin = $t01846218573._2
447+ let pon = $t01846218573._3
448+ let positionLstUpdCPF = $t01846218573._4
449+ let $t01857918672 = getPositionNotionalAndUnrealizedPnl(_trader, _option)
450+ let positionNotional = $t01857918672._1
451+ let unrealizedPnl = $t01857918672._2
452+ let $t01867718843 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl)
453+ let remainMargin = $t01867718843._1
454+ let badDebt = $t01867718843._2
451455 calcMarginRatio(remainMargin, badDebt, positionNotional)
452456 }
453457
454458
455459 func getMarginRatio (_trader) = getMarginRatioByOption(_trader, PNL_OPTION_SPOT)
456460
457461
458-func internalClosePosition (_trader) = {
459- let $t01795718085 = getPosition(_trader)
460- let positionSize = $t01795718085._1
461- let positionMargin = $t01795718085._2
462- let positionOpenNotional = $t01795718085._3
463- let positionLstUpdCPF = $t01795718085._4
464- let $t01809118178 = getPositionNotionalAndUnrealizedPnl(_trader, PNL_OPTION_SPOT)
465- let x1 = $t01809118178._1
466- let unrealizedPnl = $t01809118178._2
467- let $t01818318351 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl)
468- let remainMargin = $t01818318351._1
469- let badDebt = $t01818318351._2
462+func internalClosePosition (_trader,_checkMaxPriceImpact) = {
463+ let $t01919019318 = getPosition(_trader)
464+ let positionSize = $t01919019318._1
465+ let positionMargin = $t01919019318._2
466+ let positionOpenNotional = $t01919019318._3
467+ let positionLstUpdCPF = $t01919019318._4
468+ let $t01932419411 = getPositionNotionalAndUnrealizedPnl(_trader, PNL_OPTION_SPOT)
469+ let x1 = $t01932419411._1
470+ let unrealizedPnl = $t01932419411._2
471+ let $t01941619584 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl)
472+ let remainMargin = $t01941619584._1
473+ let badDebt = $t01941619584._2
470474 let exchangedPositionSize = -(positionSize)
471475 let realizedPnl = unrealizedPnl
472476 let marginToVault = -(remainMargin)
473- let $t01847818759 = swapOutput((positionSize > 0), abs(positionSize))
474- let exchangedQuoteAssetAmount = $t01847818759._1
475- let quoteAssetReserveAfter = $t01847818759._2
476- let baseAssetReserveAfter = $t01847818759._3
477- let totalPositionSizeAfter = $t01847818759._4
478- let cumulativeNotionalAfter = $t01847818759._5
479- let totalLongAfter = $t01847818759._6
480- let totalShortAfter = $t01847818759._7
477+ let $t01971120022 = swapOutput((positionSize > 0), abs(positionSize), _checkMaxPriceImpact)
478+ let exchangedQuoteAssetAmount = $t01971120022._1
479+ let quoteAssetReserveAfter = $t01971120022._2
480+ let baseAssetReserveAfter = $t01971120022._3
481+ let totalPositionSizeAfter = $t01971120022._4
482+ let cumulativeNotionalAfter = $t01971120022._5
483+ let totalLongAfter = $t01971120022._6
484+ let totalShortAfter = $t01971120022._7
481485 let openInterestNotionalAfter = (openInterestNotional() - positionOpenNotional)
482486 $Tuple12(exchangedPositionSize, badDebt, realizedPnl, marginToVault, quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, exchangedQuoteAssetAmount, totalLongAfter, totalShortAfter)
483487 }
484488
485489
486490 func getTwapSpotPrice () = {
487491 let minuteId = ((lastBlock.timestamp / 1000) / 60)
488492 let startMinuteId = (minuteId - TWAP_INTERVAL)
489493 let listStr = valueOrElse(getString(this, k_lastDataStr), "")
490494 let list = split(listStr, ",")
491495 func filterFn (accumulator,next) = if ((startMinuteId >= parseIntValue(next)))
492496 then (accumulator :+ parseIntValue(next))
493497 else accumulator
494498
495499 let listF = {
496500 let $l = list
497501 let $s = size($l)
498502 let $acc0 = nil
499503 func $f0_1 ($a,$i) = if (($i >= $s))
500504 then $a
501505 else filterFn($a, $l[$i])
502506
503507 func $f0_2 ($a,$i) = if (($i >= $s))
504508 then $a
505509 else throw("List size exceeds 20")
506510
507511 $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)
508512 }
509513 let maxIndex = if ((size(listF) > 0))
510514 then max(listF)
511515 else parseIntValue(list[0])
512516 let lastMinuteId = valueOrElse(getInteger(this, k_lastMinuteId), 0)
513517 let endLastCumulativePrice = valueOrElse(getInteger(this, ((k_twapDataLastCumulativePrice + "_") + toString(lastMinuteId))), 0)
514518 let endLastPrice = valueOrElse(getInteger(this, ((k_twapDataLastPrice + "_") + toString(lastMinuteId))), 0)
515519 let nowCumulativePrice = (endLastCumulativePrice + ((minuteId - lastMinuteId) * endLastPrice))
516520 let startLastCumulativePrice = valueOrElse(getInteger(this, ((k_twapDataLastCumulativePrice + "_") + toString(maxIndex))), 0)
517521 let startLastPrice = valueOrElse(getInteger(this, ((k_twapDataLastPrice + "_") + toString(maxIndex))), 0)
518522 let startCumulativePrice = (startLastCumulativePrice + ((startMinuteId - maxIndex) * startLastPrice))
519523 ((nowCumulativePrice - startCumulativePrice) / TWAP_INTERVAL)
520524 }
521525
522526
523527 func updateSettings (_initMarginRatio,_mmr,_liquidationFeeRatio,_fundingPeriod,_fee,_spreadLimit,_maxPriceImpact) = [IntegerEntry(k_initMarginRatio, _initMarginRatio), IntegerEntry(k_maintenanceMarginRatio, _mmr), IntegerEntry(k_liquidationFeeRatio, _liquidationFeeRatio), IntegerEntry(k_fundingPeriod, _fundingPeriod), IntegerEntry(k_fee, _fee), IntegerEntry(k_spreadLimit, _spreadLimit), IntegerEntry(k_maxPriceImpact, _maxPriceImpact)]
524528
525529
526530 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)]
527531
528532
529533 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)]
530534
531535
532536 func appendTwap (price) = {
533537 let minuteId = ((lastBlock.timestamp / 1000) / 60)
534538 let previousMinuteId = valueOrElse(getInteger(this, k_lastMinuteId), 0)
535539 if ((previousMinuteId > minuteId))
536540 then throw("TWAP out-of-order")
537541 else {
538542 let lastMinuteId = if ((previousMinuteId == 0))
539543 then minuteId
540544 else previousMinuteId
541545 if ((minuteId > previousMinuteId))
542546 then {
543547 let prevCumulativePrice = valueOrElse(getInteger(this, ((k_twapDataLastCumulativePrice + "_") + toString(previousMinuteId))), 0)
544548 let prevPrice = valueOrElse(getInteger(this, ((k_twapDataLastPrice + "_") + toString(previousMinuteId))), price)
545549 let lastCumulativePrice = (prevCumulativePrice + ((minuteId - lastMinuteId) * prevPrice))
546550 let list = pushToQueue(strToList(valueOrElse(getString(this, k_lastDataStr), "")), TWAP_INTERVAL, toString(minuteId))
547551 [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))]
548552 }
549553 else {
550554 let twapDataPreviousMinuteId = valueOrElse(getInteger(this, toCompositeKey(k_twapDataPreviousMinuteId, toString(minuteId))), 0)
551555 let prevCumulativePrice = valueOrElse(getInteger(this, toCompositeKey(k_twapDataLastCumulativePrice, toString(twapDataPreviousMinuteId))), 0)
552556 let prevPrice = valueOrElse(getInteger(this, toCompositeKey(k_twapDataLastPrice, toString(twapDataPreviousMinuteId))), price)
553557 let lastCumulativePrice = (prevCumulativePrice + ((minuteId - twapDataPreviousMinuteId) * prevPrice))
554558 [IntegerEntry(toCompositeKey(k_twapDataLastCumulativePrice, toString(minuteId)), lastCumulativePrice), IntegerEntry(toCompositeKey(k_twapDataLastPrice, toString(minuteId)), price)]
555559 }
556560 }
557561 }
558562
559563
564+func updateAmmReserves (_qtAstR,_bsAstR) = [IntegerEntry(k_quoteAssetReserve, _qtAstR), IntegerEntry(k_baseAssetReserve, _bsAstR)]
565+
566+
560567 func updateAmm (_qtAstR,_bsAstR,_totalPositionSizeAfter,_cumulativeNotionalAfter,_openInterestNotional,_totalLongPositionSize,_totalShortPositionSize) = if (((_totalLongPositionSize - _totalShortPositionSize) != _totalPositionSizeAfter))
561568 then throw(((((("Invalid AMM state data: " + toString(_totalLongPositionSize)) + " + ") + toString(_totalShortPositionSize)) + " != ") + toString(_totalPositionSizeAfter)))
562- else ([IntegerEntry(k_quoteAssetReserve, _qtAstR), IntegerEntry(k_baseAssetReserve, _bsAstR), IntegerEntry(k_totalPositionSize, _totalPositionSizeAfter), IntegerEntry(k_cumulativeNotional, _cumulativeNotionalAfter), IntegerEntry(k_openInterestNotional, _openInterestNotional), IntegerEntry(k_totalLongPositionSize, _totalLongPositionSize), IntegerEntry(k_totalShortPositionSize, _totalShortPositionSize)] ++ appendTwap(divd(_qtAstR, _bsAstR)))
569+ 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)))
563570
564571
565572 func deletePosition (_address) = [DeleteEntry(toCompositeKey(k_positionSize, _address)), DeleteEntry(toCompositeKey(k_positionMargin, _address)), DeleteEntry(toCompositeKey(k_positionOpenNotional, _address)), DeleteEntry(toCompositeKey(k_positionLastUpdatedCumulativePremiumFraction, _address))]
566573
567574
568575 func withdraw (_address,_amount) = {
569576 let balance = assetBalance(this, quoteAsset())
570577 if ((_amount > balance))
571578 then throw(((("Unable to withdraw " + toString(_amount)) + " from contract balance ") + toString(balance)))
572579 else [ScriptTransfer(_address, _amount, quoteAsset())]
573580 }
574581
575582
576583 func updateBalance (i) = if ((0 > i))
577584 then throw("Balance")
578585 else [IntegerEntry(k_balance, i)]
579586
580587
581588 func transferFee (i) = [ScriptTransfer(stakingAddress(), i, quoteAsset())]
582589
583590
584591 @Callable(i)
585592 func pause () = if ((i.caller != adminAddress()))
586593 then throw("Invalid togglePause params")
587594 else [BooleanEntry(k_paused, true)]
588595
589596
590597
591598 @Callable(i)
592599 func unpause () = if ((i.caller != adminAddress()))
593600 then throw("Invalid togglePause params")
594601 else [BooleanEntry(k_paused, false)]
595602
596603
597604
598605 @Callable(i)
606+func addLiquidity (_quoteAssetAmount) = if (if ((i.caller != adminAddress()))
607+ then true
608+ else (0 >= _quoteAssetAmount))
609+ then throw("Invalid addLiquidity params")
610+ else {
611+ let _qtAstR = qtAstR()
612+ let _bsAstR = bsAstR()
613+ let price = divd(_qtAstR, _bsAstR)
614+ let baseAssetAmountToAdd = divd(_quoteAssetAmount, price)
615+ let qtAstRAfter = (_qtAstR + _quoteAssetAmount)
616+ let bsAstRAfter = (_bsAstR + baseAssetAmountToAdd)
617+ updateAmmReserves(qtAstRAfter, bsAstRAfter)
618+ }
619+
620+
621+
622+@Callable(i)
623+func removeLiquidity (_quoteAssetAmount) = if (if ((i.caller != adminAddress()))
624+ then true
625+ else (0 >= _quoteAssetAmount))
626+ then throw("Invalid removeLiquidity params")
627+ else {
628+ let _qtAstR = qtAstR()
629+ let _bsAstR = bsAstR()
630+ let price = divd(_qtAstR, _bsAstR)
631+ let baseAssetAmountToRemove = divd(_quoteAssetAmount, price)
632+ let qtAstRAfter = (_qtAstR - _quoteAssetAmount)
633+ let bsAstRAfter = (_bsAstR - baseAssetAmountToRemove)
634+ updateAmmReserves(qtAstRAfter, bsAstRAfter)
635+ }
636+
637+
638+
639+@Callable(i)
599640 func changeSettings (_initMarginRatio,_mmr,_liquidationFeeRatio,_fundingPeriod,_fee,_spreadLimit,_maxPriceImpact) = if ((i.caller != adminAddress()))
600641 then throw("Invalid changeSettings params")
601642 else updateSettings(_initMarginRatio, _mmr, _liquidationFeeRatio, _fundingPeriod, _fee, _spreadLimit, _maxPriceImpact)
602643
603644
604645
605646 @Callable(i)
606647 func initialize (_qtAstR,_bsAstR,_fundingPeriod,_initMarginRatio,_mmr,_liquidationFeeRatio,_fee,_oracle,_oracleKey,_coordinator,_spreadLimit,_maxPriceImpact) = if (if (if (if (if (if (if (if (if (if ((0 >= _qtAstR))
607648 then true
608649 else (0 >= _bsAstR))
609650 then true
610651 else (0 >= _fundingPeriod))
611652 then true
612653 else (0 >= _initMarginRatio))
613654 then true
614655 else (0 >= _mmr))
615656 then true
616657 else (0 >= _liquidationFeeRatio))
617658 then true
618659 else (0 >= _fee))
619660 then true
620661 else (0 >= _spreadLimit))
621662 then true
622663 else (0 >= _maxPriceImpact))
623664 then true
624665 else initialized())
625666 then throw("Invalid initialize parameters")
626667 else ((((updateAmm(_qtAstR, _bsAstR, 0, 0, 0, 0, 0) ++ updateSettings(_initMarginRatio, _mmr, _liquidationFeeRatio, _fundingPeriod, _fee, _spreadLimit, _maxPriceImpact)) ++ updateFunding((lastBlock.timestamp + _fundingPeriod), 0, 0, 0, 0)) ++ updateBalance(0)) ++ [BooleanEntry(k_initialized, true), StringEntry(k_ora, _oracle), StringEntry(k_ora_key, _oracleKey), StringEntry(k_coordinatorAddress, _coordinator)])
627668
628669
629670
630671 @Callable(i)
631-func decreasePosition (_amount,_leverage,_minBaseAssetAmount) = if (if (if (if (if (if ((0 >= _amount))
632- then true
633- else if (((1 * DECIMAL_UNIT) > _leverage))
634- then true
635- else (_leverage > (3 * DECIMAL_UNIT)))
672+func decreasePosition (_amount,_leverage,_minBaseAssetAmount) = if (if (if (if (if ((0 >= _amount))
636673 then true
637674 else !(initialized()))
638675 then true
639676 else !(requireMoreMarginRatio(divd(DECIMAL_UNIT, _leverage), initMarginRatio(), true)))
640677 then true
641678 else !(requireOpenPosition(toString(i.caller))))
642679 then true
643680 else paused())
644681 then throw("Invalid decreasePosition parameters")
645682 else {
646- let $t02860028752 = getPosition(toString(i.caller))
647- let oldPositionSize = $t02860028752._1
648- let oldPositionMargin = $t02860028752._2
649- let oldPositionOpenNotional = $t02860028752._3
650- let oldPositionLstUpdCPF = $t02860028752._4
683+ let $t03093131083 = getPosition(toString(i.caller))
684+ let oldPositionSize = $t03093131083._1
685+ let oldPositionMargin = $t03093131083._2
686+ let oldPositionOpenNotional = $t03093131083._3
687+ let oldPositionLstUpdCPF = $t03093131083._4
651688 let _direction = if ((oldPositionSize > 0))
652689 then DIR_SHORT
653690 else DIR_LONG
654691 let isAdd = (_direction == DIR_LONG)
655692 let openNotional = muld(_amount, _leverage)
656- let $t02892529041 = getPositionNotionalAndUnrealizedPnl(toString(i.caller), PNL_OPTION_SPOT)
657- let oldPositionNotional = $t02892529041._1
658- let unrealizedPnl = $t02892529041._2
659- let $t02904731596 = if ((oldPositionNotional > openNotional))
693+ let $t03125631372 = getPositionNotionalAndUnrealizedPnl(toString(i.caller), PNL_OPTION_SPOT)
694+ let oldPositionNotional = $t03125631372._1
695+ let unrealizedPnl = $t03125631372._2
696+ let $t03137833927 = if ((oldPositionNotional > openNotional))
660697 then {
661- let $t02942429643 = swapInput(isAdd, openNotional)
662- let exchangedPositionSize = $t02942429643._1
663- let quoteAssetReserveAfter = $t02942429643._2
664- let baseAssetReserveAfter = $t02942429643._3
665- let totalPositionSizeAfter = $t02942429643._4
666- let cumulativeNotionalAfter = $t02942429643._5
698+ let $t03175531974 = swapInput(isAdd, openNotional)
699+ let exchangedPositionSize = $t03175531974._1
700+ let quoteAssetReserveAfter = $t03175531974._2
701+ let baseAssetReserveAfter = $t03175531974._3
702+ let totalPositionSizeAfter = $t03175531974._4
703+ let cumulativeNotionalAfter = $t03175531974._5
667704 let exchangedPositionSizeAbs = abs(exchangedPositionSize)
668705 if (if ((_minBaseAssetAmount != 0))
669706 then (_minBaseAssetAmount > exchangedPositionSizeAbs)
670707 else false)
671708 then throw(((("Too little base asset exchanged, got " + toString(exchangedPositionSizeAbs)) + " expected ") + toString(_minBaseAssetAmount)))
672709 else {
673710 let realizedPnl = divd(muld(unrealizedPnl, exchangedPositionSizeAbs), abs(oldPositionSize))
674- let $t03008030325 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, realizedPnl)
675- let remainMargin = $t03008030325._1
676- let badDebt = $t03008030325._2
677- let fundingPayment = $t03008030325._3
711+ let $t03241132656 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, realizedPnl)
712+ let remainMargin = $t03241132656._1
713+ let badDebt = $t03241132656._2
714+ let fundingPayment = $t03241132656._3
678715 let exchangedQuoteAssetAmount = openNotional
679716 let unrealizedPnlAfter = (unrealizedPnl - realizedPnl)
680717 let remainOpenNotional = if ((oldPositionSize > 0))
681718 then ((oldPositionNotional - exchangedQuoteAssetAmount) - unrealizedPnlAfter)
682719 else ((unrealizedPnlAfter + oldPositionNotional) - exchangedQuoteAssetAmount)
683720 let newPositionSize = (oldPositionSize + exchangedPositionSize)
684721 $Tuple11(newPositionSize, remainMargin, abs(remainOpenNotional), latestCumulativePremiumFraction(newPositionSize), baseAssetReserveAfter, quoteAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, (openInterestNotional() - openNotional), (totalLongPositionSize() - (if ((newPositionSize > 0))
685722 then abs(exchangedPositionSize)
686723 else 0)), (totalShortPositionSize() - (if ((0 > newPositionSize))
687724 then abs(exchangedPositionSize)
688725 else 0)))
689726 }
690727 }
691728 else throw("Close position first")
692- let newPositionSize = $t02904731596._1
693- let newPositionRemainMargin = $t02904731596._2
694- let newPositionOpenNotional = $t02904731596._3
695- let newPositionLatestCPF = $t02904731596._4
696- let baseAssetReserveAfter = $t02904731596._5
697- let quoteAssetReserveAfter = $t02904731596._6
698- let totalPositionSizeAfter = $t02904731596._7
699- let cumulativeNotionalAfter = $t02904731596._8
700- let openInterestNotionalAfter = $t02904731596._9
701- let totalLongAfter = $t02904731596._10
702- let totalShortAfter = $t02904731596._11
729+ let newPositionSize = $t03137833927._1
730+ let newPositionRemainMargin = $t03137833927._2
731+ let newPositionOpenNotional = $t03137833927._3
732+ let newPositionLatestCPF = $t03137833927._4
733+ let baseAssetReserveAfter = $t03137833927._5
734+ let quoteAssetReserveAfter = $t03137833927._6
735+ let totalPositionSizeAfter = $t03137833927._7
736+ let cumulativeNotionalAfter = $t03137833927._8
737+ let openInterestNotionalAfter = $t03137833927._9
738+ let totalLongAfter = $t03137833927._10
739+ let totalShortAfter = $t03137833927._11
703740 let notifyNotional = invoke(minerAddress(), "notifyNotional", [toString(i.caller), newPositionOpenNotional], nil)
704741 if ((notifyNotional == notifyNotional))
705742 then (updatePosition(toString(i.caller), newPositionSize, newPositionRemainMargin, newPositionOpenNotional, newPositionLatestCPF) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter))
706743 else throw("Strict value is not equal to itself.")
707744 }
708745
709746
710747
711748 @Callable(i)
712749 func increasePosition (_direction,_leverage,_minBaseAssetAmount) = {
713750 let _rawAmount = i.payments[0].amount
714- if (if (if (if (if (if (if (if ((_direction != DIR_LONG))
751+ if (if (if (if (if (if (if ((_direction != DIR_LONG))
715752 then (_direction != DIR_SHORT)
716753 else false)
717754 then true
718755 else (0 >= _rawAmount))
719- then true
720- else if (((1 * DECIMAL_UNIT) > _leverage))
721- then true
722- else (_leverage > (3 * DECIMAL_UNIT)))
723756 then true
724757 else !(initialized()))
725758 then true
726759 else (i.payments[0].assetId != quoteAsset()))
727760 then true
728761 else !(requireMoreMarginRatio(divd(DECIMAL_UNIT, _leverage), initMarginRatio(), true)))
729762 then true
730763 else paused())
731764 then throw("Invalid increasePosition parameters")
732765 else {
733766 let feeAmount = muld(_rawAmount, fee())
734767 let _amount = (_rawAmount - feeAmount)
735- let $t03278432936 = getPosition(toString(i.caller))
736- let oldPositionSize = $t03278432936._1
737- let oldPositionMargin = $t03278432936._2
738- let oldPositionOpenNotional = $t03278432936._3
739- let oldPositionLstUpdCPF = $t03278432936._4
768+ let $t03504535197 = getPosition(toString(i.caller))
769+ let oldPositionSize = $t03504535197._1
770+ let oldPositionMargin = $t03504535197._2
771+ let oldPositionOpenNotional = $t03504535197._3
772+ let oldPositionLstUpdCPF = $t03504535197._4
740773 let isNewPosition = (oldPositionSize == 0)
741774 let isSameDirection = if ((oldPositionSize > 0))
742775 then (_direction == DIR_LONG)
743776 else (_direction == DIR_SHORT)
744777 let expandExisting = if (!(isNewPosition))
745778 then isSameDirection
746779 else false
747780 let isAdd = (_direction == DIR_LONG)
748- let $t03322535614 = if (if (isNewPosition)
781+ let $t03548637875 = if (if (isNewPosition)
749782 then true
750783 else expandExisting)
751784 then {
752785 let openNotional = muld(_amount, _leverage)
753- let $t03364933855 = swapInput(isAdd, openNotional)
754- let amountBaseAssetBought = $t03364933855._1
755- let quoteAssetReserveAfter = $t03364933855._2
756- let baseAssetReserveAfter = $t03364933855._3
757- let totalPositionSizeAfter = $t03364933855._4
758- let cumulativeNotionalAfter = $t03364933855._5
786+ let $t03591036116 = swapInput(isAdd, openNotional)
787+ let amountBaseAssetBought = $t03591036116._1
788+ let quoteAssetReserveAfter = $t03591036116._2
789+ let baseAssetReserveAfter = $t03591036116._3
790+ let totalPositionSizeAfter = $t03591036116._4
791+ let cumulativeNotionalAfter = $t03591036116._5
759792 if (if ((_minBaseAssetAmount != 0))
760793 then (_minBaseAssetAmount > abs(amountBaseAssetBought))
761794 else false)
762795 then throw(((("Limit error: " + toString(abs(amountBaseAssetBought))) + " < ") + toString(_minBaseAssetAmount)))
763796 else {
764797 let newPositionSize = (oldPositionSize + amountBaseAssetBought)
765798 let increaseMarginRequirement = divd(openNotional, _leverage)
766- let $t03423634475 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, increaseMarginRequirement)
767- let remainMargin = $t03423634475._1
768- let x1 = $t03423634475._2
769- let x2 = $t03423634475._3
799+ let $t03649736736 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, increaseMarginRequirement)
800+ let remainMargin = $t03649736736._1
801+ let x1 = $t03649736736._2
802+ let x2 = $t03649736736._3
770803 $Tuple11(newPositionSize, remainMargin, (oldPositionOpenNotional + openNotional), latestCumulativePremiumFraction(newPositionSize), baseAssetReserveAfter, quoteAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, (openInterestNotional() + openNotional), (totalLongPositionSize() + (if ((newPositionSize > 0))
771804 then abs(amountBaseAssetBought)
772805 else 0)), (totalShortPositionSize() + (if ((0 > newPositionSize))
773806 then abs(amountBaseAssetBought)
774807 else 0)))
775808 }
776809 }
777810 else {
778811 let openNotional = muld(_amount, _leverage)
779- let $t03530735423 = getPositionNotionalAndUnrealizedPnl(toString(i.caller), PNL_OPTION_SPOT)
780- let oldPositionNotional = $t03530735423._1
781- let unrealizedPnl = $t03530735423._2
812+ let $t03756837684 = getPositionNotionalAndUnrealizedPnl(toString(i.caller), PNL_OPTION_SPOT)
813+ let oldPositionNotional = $t03756837684._1
814+ let unrealizedPnl = $t03756837684._2
782815 if ((oldPositionNotional > openNotional))
783816 then throw("Use decreasePosition to decrease position size")
784817 else throw("Close position first")
785818 }
786- let newPositionSize = $t03322535614._1
787- let newPositionRemainMargin = $t03322535614._2
788- let newPositionOpenNotional = $t03322535614._3
789- let newPositionLatestCPF = $t03322535614._4
790- let baseAssetReserveAfter = $t03322535614._5
791- let quoteAssetReserveAfter = $t03322535614._6
792- let totalPositionSizeAfter = $t03322535614._7
793- let cumulativeNotionalAfter = $t03322535614._8
794- let openInterestNotionalAfter = $t03322535614._9
795- let totalLongAfter = $t03322535614._10
796- let totalShortAfter = $t03322535614._11
819+ let newPositionSize = $t03548637875._1
820+ let newPositionRemainMargin = $t03548637875._2
821+ let newPositionOpenNotional = $t03548637875._3
822+ let newPositionLatestCPF = $t03548637875._4
823+ let baseAssetReserveAfter = $t03548637875._5
824+ let quoteAssetReserveAfter = $t03548637875._6
825+ let totalPositionSizeAfter = $t03548637875._7
826+ let cumulativeNotionalAfter = $t03548637875._8
827+ let openInterestNotionalAfter = $t03548637875._9
828+ let totalLongAfter = $t03548637875._10
829+ let totalShortAfter = $t03548637875._11
797830 let feeToStakers = (feeAmount / 2)
798831 let feeToInsurance = (feeAmount - feeToStakers)
799832 let stake = invoke(quoteAssetStaking(), "lockNeutrinoSP", [toString(stakingAddress()), ALL_FEES], [AttachedPayment(quoteAsset(), _amount)])
800833 if ((stake == stake))
801834 then {
802835 let depositInsurance = invoke(insuranceAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), feeToInsurance)])
803836 if ((depositInsurance == depositInsurance))
804837 then {
805838 let notifyFee = invoke(minerAddress(), "notifyFees", [toString(i.caller), feeAmount], nil)
806839 if ((notifyFee == notifyFee))
807840 then {
808841 let notifyNotional = invoke(minerAddress(), "notifyNotional", [toString(i.caller), newPositionOpenNotional], nil)
809842 if ((notifyNotional == notifyNotional))
810843 then (((updatePosition(toString(i.caller), newPositionSize, newPositionRemainMargin, newPositionOpenNotional, newPositionLatestCPF) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter)) ++ transferFee(feeToStakers)) ++ updateBalance((cbalance() + _amount)))
811844 else throw("Strict value is not equal to itself.")
812845 }
813846 else throw("Strict value is not equal to itself.")
814847 }
815848 else throw("Strict value is not equal to itself.")
816849 }
817850 else throw("Strict value is not equal to itself.")
818851 }
819852 }
820853
821854
822855
823856 @Callable(i)
824857 func addMargin () = {
825858 let _rawAmount = i.payments[0].amount
826859 if (if (if (if ((i.payments[0].assetId != quoteAsset()))
827860 then true
828861 else !(requireOpenPosition(toString(i.caller))))
829862 then true
830863 else !(initialized()))
831864 then true
832865 else paused())
833866 then throw("Invalid addMargin parameters")
834867 else {
835868 let feeAmount = muld(_rawAmount, fee())
836869 let _amount = (_rawAmount - feeAmount)
837- let $t03717037322 = getPosition(toString(i.caller))
838- let oldPositionSize = $t03717037322._1
839- let oldPositionMargin = $t03717037322._2
840- let oldPositionOpenNotional = $t03717037322._3
841- let oldPositionLstUpdCPF = $t03717037322._4
870+ let $t03943139583 = getPosition(toString(i.caller))
871+ let oldPositionSize = $t03943139583._1
872+ let oldPositionMargin = $t03943139583._2
873+ let oldPositionOpenNotional = $t03943139583._3
874+ let oldPositionLstUpdCPF = $t03943139583._4
842875 let feeToStakers = (feeAmount / 2)
843876 let feeToInsurance = (feeAmount - feeToStakers)
844877 let stake = invoke(quoteAssetStaking(), "lockNeutrinoSP", [toString(stakingAddress()), ALL_FEES], [AttachedPayment(quoteAsset(), _amount)])
845878 if ((stake == stake))
846879 then {
847880 let depositInsurance = invoke(insuranceAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), feeToInsurance)])
848881 if ((depositInsurance == depositInsurance))
849882 then {
850883 let notifyFee = invoke(minerAddress(), "notifyFees", [toString(i.caller), feeAmount], nil)
851884 if ((notifyFee == notifyFee))
852885 then ((updatePosition(toString(i.caller), oldPositionSize, (oldPositionMargin + _amount), oldPositionOpenNotional, oldPositionLstUpdCPF) ++ transferFee(feeToStakers)) ++ updateBalance((cbalance() + _amount)))
853886 else throw("Strict value is not equal to itself.")
854887 }
855888 else throw("Strict value is not equal to itself.")
856889 }
857890 else throw("Strict value is not equal to itself.")
858891 }
859892 }
860893
861894
862895
863896 @Callable(i)
864897 func removeMargin (_amount) = if (if (if (if ((0 >= _amount))
865898 then true
866899 else !(requireOpenPosition(toString(i.caller))))
867900 then true
868901 else !(initialized()))
869902 then true
870903 else paused())
871904 then throw("Invalid removeMargin parameters")
872905 else {
873- let $t03837138523 = getPosition(toString(i.caller))
874- let oldPositionSize = $t03837138523._1
875- let oldPositionMargin = $t03837138523._2
876- let oldPositionOpenNotional = $t03837138523._3
877- let oldPositionLstUpdCPF = $t03837138523._4
906+ let $t04063240784 = getPosition(toString(i.caller))
907+ let oldPositionSize = $t04063240784._1
908+ let oldPositionMargin = $t04063240784._2
909+ let oldPositionOpenNotional = $t04063240784._3
910+ let oldPositionLstUpdCPF = $t04063240784._4
878911 let marginDelta = -(_amount)
879- let $t03856038739 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, marginDelta)
880- let remainMargin = $t03856038739._1
881- let badDebt = $t03856038739._2
912+ let $t04082141000 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, marginDelta)
913+ let remainMargin = $t04082141000._1
914+ let badDebt = $t04082141000._2
882915 if ((badDebt != 0))
883916 then throw("Invalid removed margin amount")
884917 else {
885918 let marginRatio = calcMarginRatio(remainMargin, badDebt, oldPositionOpenNotional)
886919 if (!(requireMoreMarginRatio(marginRatio, initMarginRatio(), true)))
887920 then throw(((("Too much margin removed: " + toString(marginRatio)) + " < ") + toString(initMarginRatio())))
888921 else {
889922 let unstake = invoke(quoteAssetStaking(), "unlockNeutrino", [_amount, toBase58String(quoteAsset())], nil)
890923 if ((unstake == unstake))
891924 then ((updatePosition(toString(i.caller), oldPositionSize, remainMargin, oldPositionOpenNotional, latestCumulativePremiumFraction(oldPositionSize)) ++ withdraw(i.caller, _amount)) ++ updateBalance((cbalance() - _amount)))
892925 else throw("Strict value is not equal to itself.")
893926 }
894927 }
895928 }
896929
897930
898931
899932 @Callable(i)
900933 func closePosition () = if (if (if (!(requireOpenPosition(toString(i.caller))))
901934 then true
902935 else !(initialized()))
903936 then true
904937 else paused())
905938 then throw("Invalid closePosition parameters")
906939 else {
907- let $t03983540219 = internalClosePosition(toString(i.caller))
908- let x1 = $t03983540219._1
909- let positionBadDebt = $t03983540219._2
910- let realizedPnl = $t03983540219._3
911- let marginToVault = $t03983540219._4
912- let quoteAssetReserveAfter = $t03983540219._5
913- let baseAssetReserveAfter = $t03983540219._6
914- let totalPositionSizeAfter = $t03983540219._7
915- let cumulativeNotionalAfter = $t03983540219._8
916- let openInterestNotionalAfter = $t03983540219._9
917- let x2 = $t03983540219._10
918- let totalLongAfter = $t03983540219._11
919- let totalShortAfter = $t03983540219._12
940+ let $t04209642486 = internalClosePosition(toString(i.caller), true)
941+ let x1 = $t04209642486._1
942+ let positionBadDebt = $t04209642486._2
943+ let realizedPnl = $t04209642486._3
944+ let marginToVault = $t04209642486._4
945+ let quoteAssetReserveAfter = $t04209642486._5
946+ let baseAssetReserveAfter = $t04209642486._6
947+ let totalPositionSizeAfter = $t04209642486._7
948+ let cumulativeNotionalAfter = $t04209642486._8
949+ let openInterestNotionalAfter = $t04209642486._9
950+ let x2 = $t04209642486._10
951+ let totalLongAfter = $t04209642486._11
952+ let totalShortAfter = $t04209642486._12
920953 if ((positionBadDebt > 0))
921954 then throw("Unable to close position with bad debt")
922955 else {
923956 let withdrawAmount = abs(marginToVault)
924957 let ammBalance = (cbalance() - withdrawAmount)
925- let $t04042840570 = if ((0 > ammBalance))
958+ let $t04269542837 = if ((0 > ammBalance))
926959 then $Tuple2(0, abs(ammBalance))
927960 else $Tuple2(ammBalance, 0)
928- let ammNewBalance = $t04042840570._1
929- let getFromInsurance = $t04042840570._2
961+ let ammNewBalance = $t04269542837._1
962+ let getFromInsurance = $t04269542837._2
930963 let x = if ((getFromInsurance > 0))
931964 then {
932965 let withdrawInsurance = invoke(insuranceAddress(), "withdraw", [getFromInsurance], nil)
933966 if ((withdrawInsurance == withdrawInsurance))
934967 then nil
935968 else throw("Strict value is not equal to itself.")
936969 }
937970 else nil
938971 if ((x == x))
939972 then {
940973 let unstake = invoke(quoteAssetStaking(), "unlockNeutrino", [(withdrawAmount - getFromInsurance), toBase58String(quoteAsset())], nil)
941974 if ((unstake == unstake))
942975 then {
943976 let notifyNotional = invoke(minerAddress(), "notifyNotional", [toString(i.caller), 0], nil)
944977 if ((notifyNotional == notifyNotional))
945978 then (((deletePosition(toString(i.caller)) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter)) ++ withdraw(i.caller, withdrawAmount)) ++ updateBalance(ammNewBalance))
946979 else throw("Strict value is not equal to itself.")
947980 }
948981 else throw("Strict value is not equal to itself.")
949982 }
950983 else throw("Strict value is not equal to itself.")
951984 }
952985 }
953986
954987
955988
956989 @Callable(i)
957990 func liquidate (_trader) = {
958991 let spotMarginRatio = getMarginRatioByOption(_trader, PNL_OPTION_SPOT)
959992 let marginRatio = if (isOverFluctuationLimit())
960993 then {
961994 let oracleMarginRatio = getMarginRatioByOption(_trader, PNL_OPTION_ORACLE)
962995 vmax(spotMarginRatio, oracleMarginRatio)
963996 }
964997 else spotMarginRatio
965998 if (if (if (if (!(requireMoreMarginRatio(marginRatio, maintenanceMarginRatio(), false)))
966999 then true
9671000 else !(requireOpenPosition(_trader)))
9681001 then true
9691002 else !(initialized()))
9701003 then true
9711004 else paused())
9721005 then throw("Unable to liquidate")
9731006 else {
974- let $t04226042676 = internalClosePosition(_trader)
975- let x1 = $t04226042676._1
976- let badDebt = $t04226042676._2
977- let x2 = $t04226042676._3
978- let x3 = $t04226042676._4
979- let quoteAssetReserveAfter = $t04226042676._5
980- let baseAssetReserveAfter = $t04226042676._6
981- let totalPositionSizeAfter = $t04226042676._7
982- let cumulativeNotionalAfter = $t04226042676._8
983- let openInterestNotionalAfter = $t04226042676._9
984- let exchangedQuoteAssetAmount = $t04226042676._10
985- let totalLongAfter = $t04226042676._11
986- let totalShortAfter = $t04226042676._12
1007+ let $t04452744950 = internalClosePosition(_trader, false)
1008+ let x1 = $t04452744950._1
1009+ let badDebt = $t04452744950._2
1010+ let x2 = $t04452744950._3
1011+ let x3 = $t04452744950._4
1012+ let quoteAssetReserveAfter = $t04452744950._5
1013+ let baseAssetReserveAfter = $t04452744950._6
1014+ let totalPositionSizeAfter = $t04452744950._7
1015+ let cumulativeNotionalAfter = $t04452744950._8
1016+ let openInterestNotionalAfter = $t04452744950._9
1017+ let exchangedQuoteAssetAmount = $t04452744950._10
1018+ let totalLongAfter = $t04452744950._11
1019+ let totalShortAfter = $t04452744950._12
9871020 let liquidationPenalty = muld(exchangedQuoteAssetAmount, liquidationFeeRatio())
9881021 let feeToLiquidator = (liquidationPenalty / 2)
9891022 let feeToInsurance = (liquidationPenalty - feeToLiquidator)
9901023 let ammBalance = (cbalance() - liquidationPenalty)
991- let $t04307443209 = if ((0 > ammBalance))
1024+ let $t04534845483 = if ((0 > ammBalance))
9921025 then $Tuple2(0, abs(ammBalance))
9931026 else $Tuple2(ammBalance, 0)
994- let newAmmBalance = $t04307443209._1
995- let takeFromInsurance = $t04307443209._2
1027+ let newAmmBalance = $t04534845483._1
1028+ let takeFromInsurance = $t04534845483._2
9961029 let x = if ((takeFromInsurance > 0))
9971030 then {
9981031 let withdrawInsurance = invoke(insuranceAddress(), "withdraw", [takeFromInsurance], nil)
9991032 if ((withdrawInsurance == withdrawInsurance))
10001033 then nil
10011034 else throw("Strict value is not equal to itself.")
10021035 }
10031036 else nil
10041037 if ((x == x))
10051038 then {
10061039 let unstake = invoke(quoteAssetStaking(), "unlockNeutrino", [(liquidationPenalty - takeFromInsurance), toBase58String(quoteAsset())], nil)
10071040 if ((unstake == unstake))
10081041 then {
10091042 let depositInsurance = invoke(insuranceAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), feeToInsurance)])
10101043 if ((depositInsurance == depositInsurance))
10111044 then {
10121045 let notifyNotional = invoke(minerAddress(), "notifyNotional", [_trader, 0], nil)
10131046 if ((notifyNotional == notifyNotional))
10141047 then (((deletePosition(_trader) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter)) ++ withdraw(i.caller, feeToLiquidator)) ++ updateBalance(newAmmBalance))
10151048 else throw("Strict value is not equal to itself.")
10161049 }
10171050 else throw("Strict value is not equal to itself.")
10181051 }
10191052 else throw("Strict value is not equal to itself.")
10201053 }
10211054 else throw("Strict value is not equal to itself.")
10221055 }
10231056 }
10241057
10251058
10261059
10271060 @Callable(i)
10281061 func payFunding () = {
10291062 let fundingBlockTimestamp = nextFundingBlockTimestamp()
10301063 if (if (if ((fundingBlockTimestamp > lastBlock.timestamp))
10311064 then true
10321065 else !(initialized()))
10331066 then true
10341067 else paused())
10351068 then throw(((("Invalid funding block timestamp: " + toString(lastBlock.timestamp)) + " < ") + toString(fundingBlockTimestamp)))
10361069 else {
10371070 let underlyingPrice = getOracleTwapPrice()
10381071 let spotTwapPrice = getTwapSpotPrice()
10391072 let premium = (spotTwapPrice - underlyingPrice)
1040- let $t04470346038 = if (if ((totalShortPositionSize() == 0))
1073+ let $t04697748312 = if (if ((totalShortPositionSize() == 0))
10411074 then true
10421075 else (totalLongPositionSize() == 0))
10431076 then $Tuple2(0, 0)
10441077 else if ((0 > premium))
10451078 then {
10461079 let shortPremiumFraction = divd(muld(premium, fundingPeriodDecimal()), ONE_DAY)
10471080 let longPremiumFraction = divd(muld(shortPremiumFraction, totalShortPositionSize()), totalLongPositionSize())
10481081 $Tuple2(shortPremiumFraction, longPremiumFraction)
10491082 }
10501083 else {
10511084 let longPremiumFraction = divd(muld(premium, fundingPeriodDecimal()), ONE_DAY)
10521085 let shortPremiumFraction = divd(muld(longPremiumFraction, totalLongPositionSize()), totalShortPositionSize())
10531086 $Tuple2(shortPremiumFraction, longPremiumFraction)
10541087 }
1055- let shortPremiumFraction = $t04470346038._1
1056- let longPremiumFraction = $t04470346038._2
1088+ let shortPremiumFraction = $t04697748312._1
1089+ let longPremiumFraction = $t04697748312._2
10571090 updateFunding((fundingBlockTimestamp + fundingPeriodSeconds()), (latestLongCumulativePremiumFraction() + longPremiumFraction), (latestShortCumulativePremiumFraction() + shortPremiumFraction), divd(longPremiumFraction, underlyingPrice), divd(shortPremiumFraction, underlyingPrice))
10581091 }
10591092 }
10601093
10611094
10621095
10631096 @Callable(i)
10641097 func v_get (_trader) = {
1065- let $t04641346466 = internalClosePosition(_trader)
1066- let x1 = $t04641346466._1
1067- let x2 = $t04641346466._2
1068- let x3 = $t04641346466._3
1069- let x4 = $t04641346466._4
1098+ let $t04868748747 = internalClosePosition(_trader, false)
1099+ let x1 = $t04868748747._1
1100+ let x2 = $t04868748747._2
1101+ let x3 = $t04868748747._3
1102+ let x4 = $t04868748747._4
10701103 throw((((s(x2) + s(x3)) + s(x4)) + s(getMarginRatio(_trader))))
10711104 }
10721105
10731106
10741107
10751108 @Callable(i)
10761109 func view_calcRemainMarginWithFundingPayment (_trader) = {
1077- let $t04661346724 = getPosition(_trader)
1078- let positionSize = $t04661346724._1
1079- let positionMargin = $t04661346724._2
1080- let pon = $t04661346724._3
1081- let positionLstUpdCPF = $t04661346724._4
1082- let $t04672946830 = getPositionNotionalAndUnrealizedPnl(_trader, PNL_OPTION_SPOT)
1083- let positionNotional = $t04672946830._1
1084- let unrealizedPnl = $t04672946830._2
1085- let $t04683547017 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl)
1086- let remainMargin = $t04683547017._1
1087- let badDebt = $t04683547017._2
1088- let fundingPayment = $t04683547017._3
1089- throw(((s(remainMargin) + s(fundingPayment)) + s(getMarginRatio(_trader))))
1110+ let $t04889449005 = getPosition(_trader)
1111+ let positionSize = $t04889449005._1
1112+ let positionMargin = $t04889449005._2
1113+ let pon = $t04889449005._3
1114+ let positionLstUpdCPF = $t04889449005._4
1115+ let $t04901049111 = getPositionNotionalAndUnrealizedPnl(_trader, PNL_OPTION_SPOT)
1116+ let positionNotional = $t04901049111._1
1117+ let unrealizedPnl = $t04901049111._2
1118+ let $t04911649298 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl)
1119+ let remainMargin = $t04911649298._1
1120+ let badDebt = $t04911649298._2
1121+ let fundingPayment = $t04911649298._3
1122+ throw(((((s(remainMargin) + s(fundingPayment)) + s(getMarginRatio(_trader))) + s(unrealizedPnl)) + s(badDebt)))
10901123 }
10911124
10921125
10931126
10941127 @Callable(i)
10951128 func forceMoveAsset (_trader,_amount) = if (if ((addressFromPublicKey(adminPublicKey()) != i.caller))
10961129 then true
10971130 else (0 > _amount))
10981131 then throw("Invalid forceMoveAsset parameters")
10991132 else {
11001133 let unstake = invoke(quoteAssetStaking(), "unlockNeutrino", [_amount, toBase58String(quoteAsset())], nil)
11011134 if ((unstake == unstake))
11021135 then (withdraw(addressFromStringValue(_trader), _amount) ++ updateBalance((cbalance() - _amount)))
11031136 else throw("Strict value is not equal to itself.")
11041137 }
11051138
11061139
11071140 @Verifier(tx)
11081141 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], adminPublicKey())
11091142

github/deemru/w8io/873ac7e 
170.68 ms