tx · FuSgDV6SfcmmPtZSfHjrwEpJySTKm1qH2RLL9vaahj3Z 3N8G95pEaYEhZ4U3m3UrzpEzwBFn5vvXsZH: -0.05000000 Waves 2022.07.02 22:12 [2122442] smart account 3N8G95pEaYEhZ4U3m3UrzpEzwBFn5vvXsZH > SELF 0.00000000 Waves
{ "type": 13, "id": "FuSgDV6SfcmmPtZSfHjrwEpJySTKm1qH2RLL9vaahj3Z", "fee": 5000000, "feeAssetId": null, "timestamp": 1656789153930, "version": 2, "chainId": 84, "sender": "3N8G95pEaYEhZ4U3m3UrzpEzwBFn5vvXsZH", "senderPublicKey": "Hj6oyH6As5UWo8fZ1K4hPsEY7nxH3MvhBqDD6axiwjXs", "proofs": [ "3QfnGKzD47cAQTZd2UUaqg6khN3Cqs3rxiBLwuuNfcaRb7cxMoLTHfdLDZBWpPgci9GT4vMHwB8AJza3gBVm77Lt" ], "script": "base64:AAIFAAAAAAAAAEoIAhIAEgASCQoHAQEBAQEBARIOCgwBAQEBAQEBCAgIAQESBgoEAQEBARIFCgMBAQESABIDCgEBEgASAwoBCBIAEgMKAQgSAwoBCAAAAHAAAAAACWtfb3JhX2tleQIAAAAJa19vcmFfa2V5AAAAAA9rX29yYV9ibG9ja19rZXkCAAAAD2tfb3JhX2Jsb2NrX2tleQAAAAAFa19vcmECAAAABWtfb3JhAAAAAAlrX2JhbGFuY2UCAAAACWtfYmFsYW5jZQAAAAAOa19wb3NpdGlvblNpemUCAAAADmtfcG9zaXRpb25TaXplAAAAABBrX3Bvc2l0aW9uTWFyZ2luAgAAABBrX3Bvc2l0aW9uTWFyZ2luAAAAABZrX3Bvc2l0aW9uT3Blbk5vdGlvbmFsAgAAABZrX3Bvc2l0aW9uT3Blbk5vdGlvbmFsAAAAAC5rX3Bvc2l0aW9uTGFzdFVwZGF0ZWRDdW11bGF0aXZlUHJlbWl1bUZyYWN0aW9uAgAAABJrX3Bvc2l0aW9uRnJhY3Rpb24AAAAADWtfaW5pdGlhbGl6ZWQCAAAAD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QAAAA0kdDA0NDMwODQ0NDkwAAAAAl8zCQAAAgAAAAEJAAEsAAAAAgkAASwAAAACCQEAAAABcwAAAAEFAAAADHJlbWFpbk1hcmdpbgkBAAAAAXMAAAABBQAAAA5mdW5kaW5nUGF5bWVudAkBAAAAAXMAAAABCQEAAAAOZ2V0TWFyZ2luUmF0aW8AAAABBQAAAAdfdHJhZGVyAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAJAQAAAA5hZG1pblB1YmxpY0tleQAAAACJypcF", "height": 2122442, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9UZ7omFNbh8d4fPBqHZFKVdFFALUGNMofNZtDSoC8Xp3 Next: FYSNibP2BnGQCBdyEbDb9NWMDYi5X2o4CJ61M9HTTZ8e Diff:
Old | New | Differences | |
---|---|---|---|
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let k_ora_key = "k_ora_key" | |
5 | + | ||
6 | + | let k_ora_block_key = "k_ora_block_key" | |
5 | 7 | ||
6 | 8 | let k_ora = "k_ora" | |
7 | 9 | ||
107 | 109 | let FUNDING_BLOCK_INTERVAL = 60 | |
108 | 110 | ||
109 | 111 | let TWAP_INTERVAL = 15 | |
112 | + | ||
113 | + | let ORACLE_INTERVAL = 15 | |
110 | 114 | ||
111 | 115 | let SECONDS = 1000 | |
112 | 116 | ||
279 | 283 | if ((priceImpact > maxPriceImpactValue)) | |
280 | 284 | then throw(((("Price impact " + toString(priceImpact)) + " > max price impact ") + toString(maxPriceImpactValue))) | |
281 | 285 | else { | |
282 | - | let $ | |
283 | - | let quoteAssetReserveAfter1 = $ | |
284 | - | let baseAssetReserveAfter1 = $ | |
285 | - | let totalPositionSizeAfter1 = $ | |
286 | - | let cumulativeNotionalAfter1 = $ | |
286 | + | let $t01143211635 = updateReserve(_isAdd, _quoteAssetAmount, amountBaseAssetBoughtAbs) | |
287 | + | let quoteAssetReserveAfter1 = $t01143211635._1 | |
288 | + | let baseAssetReserveAfter1 = $t01143211635._2 | |
289 | + | let totalPositionSizeAfter1 = $t01143211635._3 | |
290 | + | let cumulativeNotionalAfter1 = $t01143211635._4 | |
287 | 291 | $Tuple5(amountBaseAssetBought, quoteAssetReserveAfter1, baseAssetReserveAfter1, totalPositionSizeAfter1, cumulativeNotionalAfter1) | |
288 | 292 | } | |
289 | 293 | } | |
297 | 301 | } | |
298 | 302 | else 0 | |
299 | 303 | let signedMargin = ((_marginDelta - fundingPayment) + _oldPositionMargin) | |
300 | - | let $ | |
304 | + | let $t01238212509 = if ((0 > signedMargin)) | |
301 | 305 | then $Tuple2(0, abs(signedMargin)) | |
302 | 306 | else $Tuple2(abs(signedMargin), 0) | |
303 | - | let remainMargin = $ | |
304 | - | let badDebt = $ | |
307 | + | let remainMargin = $t01238212509._1 | |
308 | + | let badDebt = $t01238212509._2 | |
305 | 309 | $Tuple3(remainMargin, badDebt, fundingPayment) | |
306 | 310 | } | |
307 | 311 | ||
318 | 322 | else (_baseAssetReserve - _baseAssetAmount) | |
319 | 323 | let quoteAssetAfter = divd(k, baseAssetPoolAmountAfter) | |
320 | 324 | let quoteAssetSold = abs((quoteAssetAfter - _quoteAssetReserve)) | |
321 | - | let $ | |
322 | - | let quoteAssetReserveAfter1 = $ | |
323 | - | let baseAssetReserveAfter1 = $ | |
324 | - | let totalPositionSizeAfter1 = $ | |
325 | - | let cumulativeNotionalAfter1 = $ | |
325 | + | let $t01334713540 = updateReserve(!(_isAdd), quoteAssetSold, _baseAssetAmount) | |
326 | + | let quoteAssetReserveAfter1 = $t01334713540._1 | |
327 | + | let baseAssetReserveAfter1 = $t01334713540._2 | |
328 | + | let totalPositionSizeAfter1 = $t01334713540._3 | |
329 | + | let cumulativeNotionalAfter1 = $t01334713540._4 | |
326 | 330 | $Tuple7(quoteAssetSold, quoteAssetReserveAfter1, baseAssetReserveAfter1, totalPositionSizeAfter1, cumulativeNotionalAfter1, (totalLongPositionSize() - (if (_isAdd) | |
327 | 331 | then abs(_baseAssetAmount) | |
328 | 332 | else 0)), (totalShortPositionSize() - (if (!(_isAdd)) | |
335 | 339 | func getOracleTwapPrice () = { | |
336 | 340 | let oracle = valueOrErrorMessage(addressFromString(getStringValue(this, k_ora)), "") | |
337 | 341 | let priceKey = getStringValue(this, k_ora_key) | |
338 | - | getIntegerValue(oracle, priceKey) | |
342 | + | let blockKey = getStringValue(this, k_ora_block_key) | |
343 | + | let lastValue = getIntegerValue(oracle, priceKey) | |
344 | + | lastValue | |
339 | 345 | } | |
340 | 346 | ||
341 | 347 | ||
354 | 360 | ||
355 | 361 | ||
356 | 362 | func getPositionNotionalAndUnrealizedPnl (_trader,_option) = { | |
357 | - | let $ | |
358 | - | let positionSize = $ | |
359 | - | let positionMargin = $ | |
360 | - | let positionOpenNotional = $ | |
361 | - | let positionLstUpdCPF = $ | |
363 | + | let $t01517215300 = getPosition(_trader) | |
364 | + | let positionSize = $t01517215300._1 | |
365 | + | let positionMargin = $t01517215300._2 | |
366 | + | let positionOpenNotional = $t01517215300._3 | |
367 | + | let positionLstUpdCPF = $t01517215300._4 | |
362 | 368 | let positionSizeAbs = abs(positionSize) | |
363 | 369 | if ((positionSizeAbs == 0)) | |
364 | 370 | then throw("Invalid position size") | |
366 | 372 | let isShort = (0 > positionSize) | |
367 | 373 | let positionNotional = if ((_option == PNL_OPTION_SPOT)) | |
368 | 374 | then { | |
369 | - | let $ | |
370 | - | let outPositionNotional = $ | |
371 | - | let x1 = $ | |
372 | - | let x2 = $ | |
373 | - | let x3 = $ | |
375 | + | let $t01554715654 = swapOutput(!(isShort), positionSizeAbs) | |
376 | + | let outPositionNotional = $t01554715654._1 | |
377 | + | let x1 = $t01554715654._2 | |
378 | + | let x2 = $t01554715654._3 | |
379 | + | let x3 = $t01554715654._4 | |
374 | 380 | outPositionNotional | |
375 | 381 | } | |
376 | 382 | else (positionSizeAbs * getOracleTwapPrice()) | |
383 | 389 | ||
384 | 390 | ||
385 | 391 | func getMarginRatioByOption (_trader,_option) = { | |
386 | - | let $ | |
387 | - | let positionSize = $ | |
388 | - | let positionMargin = $ | |
389 | - | let pon = $ | |
390 | - | let positionLstUpdCPF = $ | |
391 | - | let $ | |
392 | - | let positionNotional = $ | |
393 | - | let unrealizedPnl = $ | |
394 | - | let $ | |
395 | - | let remainMargin = $ | |
396 | - | let badDebt = $ | |
392 | + | let $t01614916260 = getPosition(_trader) | |
393 | + | let positionSize = $t01614916260._1 | |
394 | + | let positionMargin = $t01614916260._2 | |
395 | + | let pon = $t01614916260._3 | |
396 | + | let positionLstUpdCPF = $t01614916260._4 | |
397 | + | let $t01626616359 = getPositionNotionalAndUnrealizedPnl(_trader, _option) | |
398 | + | let positionNotional = $t01626616359._1 | |
399 | + | let unrealizedPnl = $t01626616359._2 | |
400 | + | let $t01636416530 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl) | |
401 | + | let remainMargin = $t01636416530._1 | |
402 | + | let badDebt = $t01636416530._2 | |
397 | 403 | divd((remainMargin - badDebt), positionNotional) | |
398 | 404 | } | |
399 | 405 | ||
402 | 408 | ||
403 | 409 | ||
404 | 410 | func internalClosePosition (_trader) = { | |
405 | - | let $ | |
406 | - | let positionSize = $ | |
407 | - | let positionMargin = $ | |
408 | - | let pon = $ | |
409 | - | let positionLstUpdCPF = $ | |
410 | - | let $ | |
411 | - | let x1 = $ | |
412 | - | let unrealizedPnl = $ | |
413 | - | let $ | |
414 | - | let remainMargin = $ | |
415 | - | let badDebt = $ | |
411 | + | let $t01683616947 = getPosition(_trader) | |
412 | + | let positionSize = $t01683616947._1 | |
413 | + | let positionMargin = $t01683616947._2 | |
414 | + | let pon = $t01683616947._3 | |
415 | + | let positionLstUpdCPF = $t01683616947._4 | |
416 | + | let $t01695317040 = getPositionNotionalAndUnrealizedPnl(_trader, PNL_OPTION_SPOT) | |
417 | + | let x1 = $t01695317040._1 | |
418 | + | let unrealizedPnl = $t01695317040._2 | |
419 | + | let $t01704517213 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl) | |
420 | + | let remainMargin = $t01704517213._1 | |
421 | + | let badDebt = $t01704517213._2 | |
416 | 422 | let exchangedPositionSize = -(positionSize) | |
417 | 423 | let realizedPnl = unrealizedPnl | |
418 | 424 | let marginToVault = -(remainMargin) | |
419 | - | let $ | |
420 | - | let exchangedQuoteAssetAmount = $ | |
421 | - | let quoteAssetReserveAfter = $ | |
422 | - | let baseAssetReserveAfter = $ | |
423 | - | let totalPositionSizeAfter = $ | |
424 | - | let cumulativeNotionalAfter = $ | |
425 | - | let totalLongAfter = $ | |
426 | - | let totalShortAfter = $ | |
425 | + | let $t01734017621 = swapOutput((positionSize > 0), abs(positionSize)) | |
426 | + | let exchangedQuoteAssetAmount = $t01734017621._1 | |
427 | + | let quoteAssetReserveAfter = $t01734017621._2 | |
428 | + | let baseAssetReserveAfter = $t01734017621._3 | |
429 | + | let totalPositionSizeAfter = $t01734017621._4 | |
430 | + | let cumulativeNotionalAfter = $t01734017621._5 | |
431 | + | let totalLongAfter = $t01734017621._6 | |
432 | + | let totalShortAfter = $t01734017621._7 | |
427 | 433 | let openInterestNotionalAfter = (openInterestNotional() - pon) | |
428 | 434 | $Tuple12(exchangedPositionSize, badDebt, realizedPnl, marginToVault, quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, exchangedQuoteAssetAmount, totalLongAfter, totalShortAfter) | |
429 | 435 | } | |
607 | 613 | else paused()) | |
608 | 614 | then throw("Invalid decreasePosition parameters") | |
609 | 615 | else { | |
610 | - | let $ | |
611 | - | let oldPositionSize = $ | |
612 | - | let oldPositionMargin = $ | |
613 | - | let oldPositionOpenNotional = $ | |
614 | - | let oldPositionLstUpdCPF = $ | |
616 | + | let $t02680126953 = getPosition(toString(i.caller)) | |
617 | + | let oldPositionSize = $t02680126953._1 | |
618 | + | let oldPositionMargin = $t02680126953._2 | |
619 | + | let oldPositionOpenNotional = $t02680126953._3 | |
620 | + | let oldPositionLstUpdCPF = $t02680126953._4 | |
615 | 621 | let isNewPosition = (oldPositionSize == 0) | |
616 | 622 | let isSameDirection = if ((oldPositionSize > 0)) | |
617 | 623 | then (_direction == DIR_LONG) | |
620 | 626 | then isSameDirection | |
621 | 627 | else false | |
622 | 628 | let isAdd = (_direction == DIR_LONG) | |
623 | - | let $ | |
629 | + | let $t02724230280 = if (if (isNewPosition) | |
624 | 630 | then true | |
625 | 631 | else expandExisting) | |
626 | 632 | then throw("Use increasePosition to open new or increase position") | |
627 | 633 | else { | |
628 | 634 | let openNotional = muld(_amount, _leverage) | |
629 | - | let $ | |
630 | - | let oldPositionNotional = $ | |
631 | - | let unrealizedPnl = $ | |
635 | + | let $t02774827864 = getPositionNotionalAndUnrealizedPnl(toString(i.caller), PNL_OPTION_SPOT) | |
636 | + | let oldPositionNotional = $t02774827864._1 | |
637 | + | let unrealizedPnl = $t02774827864._2 | |
632 | 638 | if ((oldPositionNotional > openNotional)) | |
633 | 639 | then { | |
634 | - | let $ | |
635 | - | let exchangedPositionSize = $ | |
636 | - | let quoteAssetReserveAfter = $ | |
637 | - | let baseAssetReserveAfter = $ | |
638 | - | let totalPositionSizeAfter = $ | |
639 | - | let cumulativeNotionalAfter = $ | |
640 | + | let $t02792628156 = swapInput(isAdd, openNotional) | |
641 | + | let exchangedPositionSize = $t02792628156._1 | |
642 | + | let quoteAssetReserveAfter = $t02792628156._2 | |
643 | + | let baseAssetReserveAfter = $t02792628156._3 | |
644 | + | let totalPositionSizeAfter = $t02792628156._4 | |
645 | + | let cumulativeNotionalAfter = $t02792628156._5 | |
640 | 646 | let exchangedPositionSizeAbs = abs(exchangedPositionSize) | |
641 | 647 | if (if ((_minBaseAssetAmount != 0)) | |
642 | 648 | then (_minBaseAssetAmount > exchangedPositionSizeAbs) | |
646 | 652 | let realizedPnl = if ((oldPositionSize != 0)) | |
647 | 653 | then divd(muld(unrealizedPnl, exchangedPositionSizeAbs), oldPositionSize) | |
648 | 654 | else 0 | |
649 | - | let $ | |
650 | - | let remainMargin = $ | |
651 | - | let badDebt = $ | |
652 | - | let fundingPayment = $ | |
655 | + | let $t02869628953 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, realizedPnl) | |
656 | + | let remainMargin = $t02869628953._1 | |
657 | + | let badDebt = $t02869628953._2 | |
658 | + | let fundingPayment = $t02869628953._3 | |
653 | 659 | let exchangedQuoteAssetAmount = openNotional | |
654 | 660 | let unrealizedPnlAfter = (unrealizedPnl - realizedPnl) | |
655 | 661 | let remainOpenNotional = if ((oldPositionSize > 0)) | |
665 | 671 | } | |
666 | 672 | else throw("Close position first") | |
667 | 673 | } | |
668 | - | let newPositionSize = $ | |
669 | - | let newPositionRemainMargin = $ | |
670 | - | let newPositionOpenNotional = $ | |
671 | - | let newPositionLatestCPF = $ | |
672 | - | let baseAssetReserveAfter = $ | |
673 | - | let quoteAssetReserveAfter = $ | |
674 | - | let totalPositionSizeAfter = $ | |
675 | - | let cumulativeNotionalAfter = $ | |
676 | - | let openInterestNotionalAfter = $ | |
677 | - | let totalLongAfter = $ | |
678 | - | let totalShortAfter = $ | |
674 | + | let newPositionSize = $t02724230280._1 | |
675 | + | let newPositionRemainMargin = $t02724230280._2 | |
676 | + | let newPositionOpenNotional = $t02724230280._3 | |
677 | + | let newPositionLatestCPF = $t02724230280._4 | |
678 | + | let baseAssetReserveAfter = $t02724230280._5 | |
679 | + | let quoteAssetReserveAfter = $t02724230280._6 | |
680 | + | let totalPositionSizeAfter = $t02724230280._7 | |
681 | + | let cumulativeNotionalAfter = $t02724230280._8 | |
682 | + | let openInterestNotionalAfter = $t02724230280._9 | |
683 | + | let totalLongAfter = $t02724230280._10 | |
684 | + | let totalShortAfter = $t02724230280._11 | |
679 | 685 | (updatePosition(toString(i.caller), newPositionSize, newPositionRemainMargin, newPositionOpenNotional, newPositionLatestCPF) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter)) | |
680 | 686 | } | |
681 | 687 | ||
705 | 711 | else { | |
706 | 712 | let feeAmount = muld(_rawAmount, fee()) | |
707 | 713 | let _amount = (_rawAmount - feeAmount) | |
708 | - | let $ | |
709 | - | let oldPositionSize = $ | |
710 | - | let oldPositionMargin = $ | |
711 | - | let oldPositionOpenNotional = $ | |
714 | + | let $t03131631440 = getPosition(toString(i.caller)) | |
715 | + | let oldPositionSize = $t03131631440._1 | |
716 | + | let oldPositionMargin = $t03131631440._2 | |
717 | + | let oldPositionOpenNotional = $t03131631440._3 | |
712 | 718 | let isNewPosition = (oldPositionSize == 0) | |
713 | 719 | let isSameDirection = if ((oldPositionSize > 0)) | |
714 | 720 | then (_direction == DIR_LONG) | |
717 | 723 | then isSameDirection | |
718 | 724 | else false | |
719 | 725 | let isAdd = (_direction == DIR_LONG) | |
720 | - | let $ | |
726 | + | let $t03172934196 = if (if (isNewPosition) | |
721 | 727 | then true | |
722 | 728 | else expandExisting) | |
723 | 729 | then { | |
724 | 730 | let openNotional = muld(_amount, _leverage) | |
725 | - | let $ | |
726 | - | let amountBaseAssetBought = $ | |
727 | - | let quoteAssetReserveAfter = $ | |
728 | - | let baseAssetReserveAfter = $ | |
729 | - | let totalPositionSizeAfter = $ | |
730 | - | let cumulativeNotionalAfter = $ | |
731 | + | let $t03215332359 = swapInput(isAdd, openNotional) | |
732 | + | let amountBaseAssetBought = $t03215332359._1 | |
733 | + | let quoteAssetReserveAfter = $t03215332359._2 | |
734 | + | let baseAssetReserveAfter = $t03215332359._3 | |
735 | + | let totalPositionSizeAfter = $t03215332359._4 | |
736 | + | let cumulativeNotionalAfter = $t03215332359._5 | |
731 | 737 | if (if ((_minBaseAssetAmount != 0)) | |
732 | 738 | then (_minBaseAssetAmount > abs(amountBaseAssetBought)) | |
733 | 739 | else false) | |
736 | 742 | let newPositionSize = (oldPositionSize + amountBaseAssetBought) | |
737 | 743 | let positionLstUpdCPF = latestCumulativePremiumFraction(newPositionSize) | |
738 | 744 | let increaseMarginRequirement = divd(openNotional, _leverage) | |
739 | - | let $ | |
740 | - | let remainMargin = $ | |
741 | - | let x1 = $ | |
742 | - | let x2 = $ | |
745 | + | let $t03282133057 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, positionLstUpdCPF, increaseMarginRequirement) | |
746 | + | let remainMargin = $t03282133057._1 | |
747 | + | let x1 = $t03282133057._2 | |
748 | + | let x2 = $t03282133057._3 | |
743 | 749 | $Tuple11(newPositionSize, remainMargin, (oldPositionOpenNotional + openNotional), latestCumulativePremiumFraction(newPositionSize), baseAssetReserveAfter, quoteAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, (openInterestNotional() + openNotional), (totalLongPositionSize() + (if ((newPositionSize > 0)) | |
744 | 750 | then abs(amountBaseAssetBought) | |
745 | 751 | else 0)), (totalShortPositionSize() + (if ((0 > newPositionSize)) | |
749 | 755 | } | |
750 | 756 | else { | |
751 | 757 | let openNotional = muld(_amount, _leverage) | |
752 | - | let $ | |
753 | - | let oldPositionNotional = $ | |
754 | - | let unrealizedPnl = $ | |
758 | + | let $t03388934005 = getPositionNotionalAndUnrealizedPnl(toString(i.caller), PNL_OPTION_SPOT) | |
759 | + | let oldPositionNotional = $t03388934005._1 | |
760 | + | let unrealizedPnl = $t03388934005._2 | |
755 | 761 | if ((oldPositionNotional > openNotional)) | |
756 | 762 | then throw("Use decreasePosition to decrease position size") | |
757 | 763 | else throw("Close position first") | |
758 | 764 | } | |
759 | - | let newPositionSize = $ | |
760 | - | let newPositionRemainMargin = $ | |
761 | - | let newPositionOpenNotional = $ | |
762 | - | let newPositionLatestCPF = $ | |
763 | - | let baseAssetReserveAfter = $ | |
764 | - | let quoteAssetReserveAfter = $ | |
765 | - | let totalPositionSizeAfter = $ | |
766 | - | let cumulativeNotionalAfter = $ | |
767 | - | let openInterestNotionalAfter = $ | |
768 | - | let totalLongAfter = $ | |
769 | - | let totalShortAfter = $ | |
765 | + | let newPositionSize = $t03172934196._1 | |
766 | + | let newPositionRemainMargin = $t03172934196._2 | |
767 | + | let newPositionOpenNotional = $t03172934196._3 | |
768 | + | let newPositionLatestCPF = $t03172934196._4 | |
769 | + | let baseAssetReserveAfter = $t03172934196._5 | |
770 | + | let quoteAssetReserveAfter = $t03172934196._6 | |
771 | + | let totalPositionSizeAfter = $t03172934196._7 | |
772 | + | let cumulativeNotionalAfter = $t03172934196._8 | |
773 | + | let openInterestNotionalAfter = $t03172934196._9 | |
774 | + | let totalLongAfter = $t03172934196._10 | |
775 | + | let totalShortAfter = $t03172934196._11 | |
770 | 776 | let feeToStakers = (feeAmount / 2) | |
771 | 777 | let feeToInsurance = (feeAmount - feeToStakers) | |
772 | 778 | let stake = invoke(quoteAssetStaking(), "lockNeutrinoSP", [toString(stakingAddress()), ALL_FEES], [AttachedPayment(quoteAsset(), _amount)]) | |
797 | 803 | else { | |
798 | 804 | let feeAmount = muld(_rawAmount, fee()) | |
799 | 805 | let _amount = (_rawAmount - feeAmount) | |
800 | - | let $ | |
801 | - | let oldPositionSize = $ | |
802 | - | let oldPositionMargin = $ | |
803 | - | let oldPositionOpenNotional = $ | |
804 | - | let oldPositionLstUpdCPF = $ | |
806 | + | let $t03547235624 = getPosition(toString(i.caller)) | |
807 | + | let oldPositionSize = $t03547235624._1 | |
808 | + | let oldPositionMargin = $t03547235624._2 | |
809 | + | let oldPositionOpenNotional = $t03547235624._3 | |
810 | + | let oldPositionLstUpdCPF = $t03547235624._4 | |
805 | 811 | let feeToStakers = (feeAmount / 2) | |
806 | 812 | let feeToInsurance = (feeAmount - feeToStakers) | |
807 | 813 | let stake = invoke(quoteAssetStaking(), "lockNeutrinoSP", [toString(stakingAddress()), ALL_FEES], [AttachedPayment(quoteAsset(), _amount)]) | |
828 | 834 | else paused()) | |
829 | 835 | then throw("Invalid removeMargin parameters") | |
830 | 836 | else { | |
831 | - | let $ | |
832 | - | let oldPositionSize = $ | |
833 | - | let oldPositionMargin = $ | |
834 | - | let oldPositionOpenNotional = $ | |
835 | - | let oldPositionLstUpdCPF = $ | |
837 | + | let $t03654436696 = getPosition(toString(i.caller)) | |
838 | + | let oldPositionSize = $t03654436696._1 | |
839 | + | let oldPositionMargin = $t03654436696._2 | |
840 | + | let oldPositionOpenNotional = $t03654436696._3 | |
841 | + | let oldPositionLstUpdCPF = $t03654436696._4 | |
836 | 842 | let marginDelta = -(_amount) | |
837 | - | let $ | |
838 | - | let remainMargin = $ | |
839 | - | let badDebt = $ | |
843 | + | let $t03673336912 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, marginDelta) | |
844 | + | let remainMargin = $t03673336912._1 | |
845 | + | let badDebt = $t03673336912._2 | |
840 | 846 | if ((badDebt != 0)) | |
841 | 847 | then throw("Invalid added margin amount") | |
842 | 848 | else { | |
857 | 863 | else paused()) | |
858 | 864 | then throw("Invalid closePosition parameters") | |
859 | 865 | else { | |
860 | - | let $ | |
861 | - | let x1 = $ | |
862 | - | let positionBadDebt = $ | |
863 | - | let realizedPnl = $ | |
864 | - | let marginToVault = $ | |
865 | - | let quoteAssetReserveAfter = $ | |
866 | - | let baseAssetReserveAfter = $ | |
867 | - | let totalPositionSizeAfter = $ | |
868 | - | let cumulativeNotionalAfter = $ | |
869 | - | let openInterestNotionalAfter = $ | |
870 | - | let x2 = $ | |
871 | - | let totalLongAfter = $ | |
872 | - | let totalShortAfter = $ | |
866 | + | let $t03767238056 = internalClosePosition(toString(i.caller)) | |
867 | + | let x1 = $t03767238056._1 | |
868 | + | let positionBadDebt = $t03767238056._2 | |
869 | + | let realizedPnl = $t03767238056._3 | |
870 | + | let marginToVault = $t03767238056._4 | |
871 | + | let quoteAssetReserveAfter = $t03767238056._5 | |
872 | + | let baseAssetReserveAfter = $t03767238056._6 | |
873 | + | let totalPositionSizeAfter = $t03767238056._7 | |
874 | + | let cumulativeNotionalAfter = $t03767238056._8 | |
875 | + | let openInterestNotionalAfter = $t03767238056._9 | |
876 | + | let x2 = $t03767238056._10 | |
877 | + | let totalLongAfter = $t03767238056._11 | |
878 | + | let totalShortAfter = $t03767238056._12 | |
873 | 879 | if ((positionBadDebt > 0)) | |
874 | 880 | then throw("Unable to close position with bad debt") | |
875 | 881 | else { | |
876 | 882 | let withdrawAmount = abs(marginToVault) | |
877 | 883 | let ammBalance = (cbalance() - withdrawAmount) | |
878 | - | let $ | |
884 | + | let $t03826538407 = if ((0 > ammBalance)) | |
879 | 885 | then $Tuple2(0, abs(ammBalance)) | |
880 | 886 | else $Tuple2(ammBalance, 0) | |
881 | - | let ammNewBalance = $ | |
882 | - | let getFromInsurance = $ | |
887 | + | let ammNewBalance = $t03826538407._1 | |
888 | + | let getFromInsurance = $t03826538407._2 | |
883 | 889 | let x = if ((getFromInsurance > 0)) | |
884 | 890 | then { | |
885 | 891 | let withdrawInsurance = invoke(insuranceAddress(), "withdraw", [getFromInsurance], nil) | |
915 | 921 | else paused()) | |
916 | 922 | then throw("Unable to liquidate") | |
917 | 923 | else { | |
918 | - | let $ | |
919 | - | let x1 = $ | |
920 | - | let badDebt = $ | |
921 | - | let x2 = $ | |
922 | - | let marginToVault = $ | |
923 | - | let quoteAssetReserveAfter = $ | |
924 | - | let baseAssetReserveAfter = $ | |
925 | - | let totalPositionSizeAfter = $ | |
926 | - | let cumulativeNotionalAfter = $ | |
927 | - | let openInterestNotionalAfter = $ | |
928 | - | let exchangedQuoteAssetAmount = $ | |
929 | - | let totalLongAfter = $ | |
930 | - | let totalShortAfter = $ | |
924 | + | let $t03984640273 = internalClosePosition(_trader) | |
925 | + | let x1 = $t03984640273._1 | |
926 | + | let badDebt = $t03984640273._2 | |
927 | + | let x2 = $t03984640273._3 | |
928 | + | let marginToVault = $t03984640273._4 | |
929 | + | let quoteAssetReserveAfter = $t03984640273._5 | |
930 | + | let baseAssetReserveAfter = $t03984640273._6 | |
931 | + | let totalPositionSizeAfter = $t03984640273._7 | |
932 | + | let cumulativeNotionalAfter = $t03984640273._8 | |
933 | + | let openInterestNotionalAfter = $t03984640273._9 | |
934 | + | let exchangedQuoteAssetAmount = $t03984640273._10 | |
935 | + | let totalLongAfter = $t03984640273._11 | |
936 | + | let totalShortAfter = $t03984640273._12 | |
931 | 937 | let liquidationPenalty = muld(exchangedQuoteAssetAmount, liquidationFeeRatio()) | |
932 | 938 | let feeToLiquidator = (liquidationPenalty / 2) | |
933 | 939 | let feeToInsurance = (liquidationPenalty - feeToLiquidator) | |
934 | 940 | let ammBadDebt = (cbalance() - liquidationPenalty) | |
935 | - | let $ | |
941 | + | let $t04067140806 = if ((0 > ammBadDebt)) | |
936 | 942 | then $Tuple2(0, abs(ammBadDebt)) | |
937 | 943 | else $Tuple2(ammBadDebt, 0) | |
938 | - | let newAmmBalance = $ | |
939 | - | let takeFromInsurance = $ | |
944 | + | let newAmmBalance = $t04067140806._1 | |
945 | + | let takeFromInsurance = $t04067140806._2 | |
940 | 946 | let x = if ((takeFromInsurance > 0)) | |
941 | 947 | then { | |
942 | 948 | let withdrawInsurance = invoke(insuranceAddress(), "withdraw", [takeFromInsurance], nil) | |
976 | 982 | let underlyingPrice = getOracleTwapPrice() | |
977 | 983 | let spotTwapPrice = getTwapSpotPrice() | |
978 | 984 | let premium = (spotTwapPrice - underlyingPrice) | |
979 | - | let $ | |
985 | + | let $t04217643511 = if (if ((totalShortPositionSize() == 0)) | |
980 | 986 | then true | |
981 | 987 | else (totalLongPositionSize() == 0)) | |
982 | - | then $ | |
988 | + | then $Tuple2(0, 0) | |
983 | 989 | else if ((0 > premium)) | |
984 | 990 | then { | |
985 | 991 | let shortPremiumFraction = divd(muld(premium, fundingPeriodDecimal()), ONE_DAY) | |
986 | - | let shortFundingRate = divd(shortPremiumFraction, underlyingPrice) | |
987 | 992 | let longPremiumFraction = divd(muld(shortPremiumFraction, totalShortPositionSize()), totalLongPositionSize()) | |
988 | - | let longFundingRate = divd(muld(longPremiumFraction, HUNDRED_PERCENT), underlyingPrice) | |
989 | - | $Tuple4(shortPremiumFraction, longPremiumFraction, shortFundingRate, longFundingRate) | |
993 | + | $Tuple2(shortPremiumFraction, longPremiumFraction) | |
990 | 994 | } | |
991 | 995 | else { | |
992 | 996 | let longPremiumFraction = divd(muld(premium, fundingPeriodDecimal()), ONE_DAY) | |
993 | - | let longFundingRate = divd(longPremiumFraction, underlyingPrice) | |
994 | 997 | let shortPremiumFraction = divd(muld(longPremiumFraction, totalLongPositionSize()), totalShortPositionSize()) | |
995 | - | let shortFundingRate = divd(muld(shortPremiumFraction, HUNDRED_PERCENT), underlyingPrice) | |
996 | - | $Tuple4(shortPremiumFraction, longPremiumFraction, shortFundingRate, longFundingRate) | |
998 | + | $Tuple2(shortPremiumFraction, longPremiumFraction) | |
997 | 999 | } | |
998 | - | let shortPremiumFraction = $t04171443510._1 | |
999 | - | let longPremiumFraction = $t04171443510._2 | |
1000 | - | let shortFundingRate = $t04171443510._3 | |
1001 | - | let longFundingRate = $t04171443510._4 | |
1002 | - | updateFunding((fundingBlockTimestamp + fundingPeriodSeconds()), (latestLongCumulativePremiumFraction() + longPremiumFraction), (latestShortCumulativePremiumFraction() + shortPremiumFraction), longFundingRate, shortFundingRate) | |
1000 | + | let shortPremiumFraction = $t04217643511._1 | |
1001 | + | let longPremiumFraction = $t04217643511._2 | |
1002 | + | updateFunding((fundingBlockTimestamp + fundingPeriodSeconds()), (latestLongCumulativePremiumFraction() + longPremiumFraction), (latestShortCumulativePremiumFraction() + shortPremiumFraction), divd(longPremiumFraction, underlyingPrice), divd(shortPremiumFraction, underlyingPrice)) | |
1003 | 1003 | } | |
1004 | 1004 | } | |
1005 | 1005 | ||
1007 | 1007 | ||
1008 | 1008 | @Callable(i) | |
1009 | 1009 | func v_get (_trader) = { | |
1010 | - | let $ | |
1011 | - | let x1 = $ | |
1012 | - | let x2 = $ | |
1013 | - | let x3 = $ | |
1014 | - | let x4 = $ | |
1010 | + | let $t04388643939 = internalClosePosition(_trader) | |
1011 | + | let x1 = $t04388643939._1 | |
1012 | + | let x2 = $t04388643939._2 | |
1013 | + | let x3 = $t04388643939._3 | |
1014 | + | let x4 = $t04388643939._4 | |
1015 | 1015 | throw((((s(x2) + s(x3)) + s(x4)) + s(getMarginRatio(_trader)))) | |
1016 | 1016 | } | |
1017 | 1017 | ||
1019 | 1019 | ||
1020 | 1020 | @Callable(i) | |
1021 | 1021 | func view_calcRemainMarginWithFundingPayment (_trader) = { | |
1022 | - | let $ | |
1023 | - | let positionSize = $ | |
1024 | - | let positionMargin = $ | |
1025 | - | let pon = $ | |
1026 | - | let positionLstUpdCPF = $ | |
1027 | - | let $ | |
1028 | - | let positionNotional = $ | |
1029 | - | let unrealizedPnl = $ | |
1030 | - | let $ | |
1031 | - | let remainMargin = $ | |
1032 | - | let badDebt = $ | |
1033 | - | let fundingPayment = $ | |
1022 | + | let $t04408644197 = getPosition(_trader) | |
1023 | + | let positionSize = $t04408644197._1 | |
1024 | + | let positionMargin = $t04408644197._2 | |
1025 | + | let pon = $t04408644197._3 | |
1026 | + | let positionLstUpdCPF = $t04408644197._4 | |
1027 | + | let $t04420244303 = getPositionNotionalAndUnrealizedPnl(_trader, PNL_OPTION_SPOT) | |
1028 | + | let positionNotional = $t04420244303._1 | |
1029 | + | let unrealizedPnl = $t04420244303._2 | |
1030 | + | let $t04430844490 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl) | |
1031 | + | let remainMargin = $t04430844490._1 | |
1032 | + | let badDebt = $t04430844490._2 | |
1033 | + | let fundingPayment = $t04430844490._3 | |
1034 | 1034 | throw(((s(remainMargin) + s(fundingPayment)) + s(getMarginRatio(_trader)))) | |
1035 | 1035 | } | |
1036 | 1036 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let k_ora_key = "k_ora_key" | |
5 | + | ||
6 | + | let k_ora_block_key = "k_ora_block_key" | |
5 | 7 | ||
6 | 8 | let k_ora = "k_ora" | |
7 | 9 | ||
8 | 10 | let k_balance = "k_balance" | |
9 | 11 | ||
10 | 12 | let k_positionSize = "k_positionSize" | |
11 | 13 | ||
12 | 14 | let k_positionMargin = "k_positionMargin" | |
13 | 15 | ||
14 | 16 | let k_positionOpenNotional = "k_positionOpenNotional" | |
15 | 17 | ||
16 | 18 | let k_positionLastUpdatedCumulativePremiumFraction = "k_positionFraction" | |
17 | 19 | ||
18 | 20 | let k_initialized = "k_initialized" | |
19 | 21 | ||
20 | 22 | let k_paused = "k_paused" | |
21 | 23 | ||
22 | 24 | let k_fee = "k_fee" | |
23 | 25 | ||
24 | 26 | let k_fundingPeriod = "k_fundingPeriod" | |
25 | 27 | ||
26 | 28 | let k_initMarginRatio = "k_initMarginRatio" | |
27 | 29 | ||
28 | 30 | let k_maintenanceMarginRatio = "k_mmr" | |
29 | 31 | ||
30 | 32 | let k_liquidationFeeRatio = "k_liquidationFeeRatio" | |
31 | 33 | ||
32 | 34 | let k_spreadLimit = "k_spreadLimit" | |
33 | 35 | ||
34 | 36 | let k_maxPriceImpact = "k_maxPriceImpact" | |
35 | 37 | ||
36 | 38 | let k_lastDataStr = "k_lastDataStr" | |
37 | 39 | ||
38 | 40 | let k_lastMinuteId = "k_lastMinuteId" | |
39 | 41 | ||
40 | 42 | let k_twapDataLastCumulativePrice = "k_twapDataLastCumulativePrice" | |
41 | 43 | ||
42 | 44 | let k_twapDataLastPrice = "k_twapDataLastPrice" | |
43 | 45 | ||
44 | 46 | let k_latestLongCumulativePremiumFraction = "k_latestLongPremiumFraction" | |
45 | 47 | ||
46 | 48 | let k_latestShortCumulativePremiumFraction = "k_latestShortPremiumFraction" | |
47 | 49 | ||
48 | 50 | let k_nextFundingBlock = "k_nextFundingBlockMinTimestamp" | |
49 | 51 | ||
50 | 52 | let k_longFundingRate = "k_longFundingRate" | |
51 | 53 | ||
52 | 54 | let k_shortFundingRate = "k_shortFundingRate" | |
53 | 55 | ||
54 | 56 | let k_quoteAssetReserve = "k_qtAstR" | |
55 | 57 | ||
56 | 58 | let k_baseAssetReserve = "k_bsAstR" | |
57 | 59 | ||
58 | 60 | let k_totalPositionSize = "k_totalPositionSize" | |
59 | 61 | ||
60 | 62 | let k_totalLongPositionSize = "k_totalLongPositionSize" | |
61 | 63 | ||
62 | 64 | let k_totalShortPositionSize = "k_totalShortPositionSize" | |
63 | 65 | ||
64 | 66 | let k_cumulativeNotional = "k_cumulativeNotional" | |
65 | 67 | ||
66 | 68 | let k_openInterestNotional = "k_openInterestNotional" | |
67 | 69 | ||
68 | 70 | let k_coordinatorAddress = "k_coordinatorAddress" | |
69 | 71 | ||
70 | 72 | let k_insurance_address = "k_insurance_address" | |
71 | 73 | ||
72 | 74 | let k_admin_address = "k_admin_address" | |
73 | 75 | ||
74 | 76 | let k_admin_public_key = "k_admin_public_key" | |
75 | 77 | ||
76 | 78 | let k_quote_asset = "k_quote_asset" | |
77 | 79 | ||
78 | 80 | let k_quote_staking = "k_quote_staking" | |
79 | 81 | ||
80 | 82 | let k_staking_address = "k_staking_address" | |
81 | 83 | ||
82 | 84 | func coordinator () = valueOrErrorMessage(addressFromString(getStringValue(this, k_coordinatorAddress)), "Coordinator not set") | |
83 | 85 | ||
84 | 86 | ||
85 | 87 | func adminAddress () = addressFromString(getStringValue(coordinator(), k_admin_address)) | |
86 | 88 | ||
87 | 89 | ||
88 | 90 | func adminPublicKey () = fromBase58String(getStringValue(coordinator(), k_admin_public_key)) | |
89 | 91 | ||
90 | 92 | ||
91 | 93 | func quoteAsset () = fromBase58String(getStringValue(coordinator(), k_quote_asset)) | |
92 | 94 | ||
93 | 95 | ||
94 | 96 | func quoteAssetStaking () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_quote_staking)), "Quote asset staking not set") | |
95 | 97 | ||
96 | 98 | ||
97 | 99 | func stakingAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_staking_address)), "Insurance not set") | |
98 | 100 | ||
99 | 101 | ||
100 | 102 | func insuranceAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_insurance_address)), "Insurance not set") | |
101 | 103 | ||
102 | 104 | ||
103 | 105 | let DIR_LONG = 1 | |
104 | 106 | ||
105 | 107 | let DIR_SHORT = 2 | |
106 | 108 | ||
107 | 109 | let FUNDING_BLOCK_INTERVAL = 60 | |
108 | 110 | ||
109 | 111 | let TWAP_INTERVAL = 15 | |
112 | + | ||
113 | + | let ORACLE_INTERVAL = 15 | |
110 | 114 | ||
111 | 115 | let SECONDS = 1000 | |
112 | 116 | ||
113 | 117 | let DECIMAL_UNIT = (1 * (((((10 * 10) * 10) * 10) * 10) * 10)) | |
114 | 118 | ||
115 | 119 | let HUNDRED_PERCENT = (100 * DECIMAL_UNIT) | |
116 | 120 | ||
117 | 121 | let ONE_DAY = (86400 * DECIMAL_UNIT) | |
118 | 122 | ||
119 | 123 | let ALL_FEES = 100 | |
120 | 124 | ||
121 | 125 | let PNL_OPTION_SPOT = 1 | |
122 | 126 | ||
123 | 127 | let PNL_OPTION_ORACLE = 2 | |
124 | 128 | ||
125 | 129 | func s (_x) = (toString(_x) + ",") | |
126 | 130 | ||
127 | 131 | ||
128 | 132 | func divd (_x,_y) = fraction(_x, DECIMAL_UNIT, _y, HALFEVEN) | |
129 | 133 | ||
130 | 134 | ||
131 | 135 | func muld (_x,_y) = fraction(_x, _y, DECIMAL_UNIT, HALFEVEN) | |
132 | 136 | ||
133 | 137 | ||
134 | 138 | func abs (_x) = if ((_x > 0)) | |
135 | 139 | then _x | |
136 | 140 | else -(_x) | |
137 | 141 | ||
138 | 142 | ||
139 | 143 | func toCompositeKey (_key,_address) = ((_key + "_") + _address) | |
140 | 144 | ||
141 | 145 | ||
142 | 146 | func int (k) = valueOrErrorMessage(getInteger(this, k), ("no value for " + k)) | |
143 | 147 | ||
144 | 148 | ||
145 | 149 | func cbalance () = int(k_balance) | |
146 | 150 | ||
147 | 151 | ||
148 | 152 | func fee () = int(k_fee) | |
149 | 153 | ||
150 | 154 | ||
151 | 155 | func initMarginRatio () = int(k_initMarginRatio) | |
152 | 156 | ||
153 | 157 | ||
154 | 158 | func qtAstR () = int(k_quoteAssetReserve) | |
155 | 159 | ||
156 | 160 | ||
157 | 161 | func bsAstR () = int(k_baseAssetReserve) | |
158 | 162 | ||
159 | 163 | ||
160 | 164 | func totalPositionSize () = int(k_totalPositionSize) | |
161 | 165 | ||
162 | 166 | ||
163 | 167 | func cumulativeNotional () = int(k_cumulativeNotional) | |
164 | 168 | ||
165 | 169 | ||
166 | 170 | func openInterestNotional () = int(k_openInterestNotional) | |
167 | 171 | ||
168 | 172 | ||
169 | 173 | func nextFundingBlockTimestamp () = int(k_nextFundingBlock) | |
170 | 174 | ||
171 | 175 | ||
172 | 176 | func fundingPeriodRaw () = int(k_fundingPeriod) | |
173 | 177 | ||
174 | 178 | ||
175 | 179 | func fundingPeriodDecimal () = (fundingPeriodRaw() * DECIMAL_UNIT) | |
176 | 180 | ||
177 | 181 | ||
178 | 182 | func fundingPeriodSeconds () = (fundingPeriodRaw() * SECONDS) | |
179 | 183 | ||
180 | 184 | ||
181 | 185 | func maintenanceMarginRatio () = int(k_maintenanceMarginRatio) | |
182 | 186 | ||
183 | 187 | ||
184 | 188 | func liquidationFeeRatio () = int(k_liquidationFeeRatio) | |
185 | 189 | ||
186 | 190 | ||
187 | 191 | func spreadLimit () = int(k_spreadLimit) | |
188 | 192 | ||
189 | 193 | ||
190 | 194 | func maxPriceImpact () = int(k_maxPriceImpact) | |
191 | 195 | ||
192 | 196 | ||
193 | 197 | func latestLongCumulativePremiumFraction () = int(k_latestLongCumulativePremiumFraction) | |
194 | 198 | ||
195 | 199 | ||
196 | 200 | func latestShortCumulativePremiumFraction () = int(k_latestShortCumulativePremiumFraction) | |
197 | 201 | ||
198 | 202 | ||
199 | 203 | func totalShortPositionSize () = int(k_totalShortPositionSize) | |
200 | 204 | ||
201 | 205 | ||
202 | 206 | func totalLongPositionSize () = int(k_totalLongPositionSize) | |
203 | 207 | ||
204 | 208 | ||
205 | 209 | func requireMoreMarginRatio (_marginRatio,_baseMarginRatio,_largerThanOrEqualTo) = { | |
206 | 210 | let remainingMarginRatio = (_marginRatio - _baseMarginRatio) | |
207 | 211 | if (if (_largerThanOrEqualTo) | |
208 | 212 | then (0 > remainingMarginRatio) | |
209 | 213 | else false) | |
210 | 214 | then throw("Invalid margin") | |
211 | 215 | else if (if (!(_largerThanOrEqualTo)) | |
212 | 216 | then (remainingMarginRatio >= 0) | |
213 | 217 | else false) | |
214 | 218 | then throw("Invalid margin") | |
215 | 219 | else true | |
216 | 220 | } | |
217 | 221 | ||
218 | 222 | ||
219 | 223 | func latestCumulativePremiumFraction (_positionSize) = if ((_positionSize == 0)) | |
220 | 224 | then throw("Should not be called with _positionSize == 0") | |
221 | 225 | else if ((_positionSize > 0)) | |
222 | 226 | then latestLongCumulativePremiumFraction() | |
223 | 227 | else latestShortCumulativePremiumFraction() | |
224 | 228 | ||
225 | 229 | ||
226 | 230 | func getPosition (_trader) = { | |
227 | 231 | let positionSizeOpt = getInteger(this, toCompositeKey(k_positionSize, _trader)) | |
228 | 232 | match positionSizeOpt { | |
229 | 233 | case positionSize: Int => | |
230 | 234 | $Tuple4(positionSize, getIntegerValue(this, toCompositeKey(k_positionMargin, _trader)), getIntegerValue(this, toCompositeKey(k_positionOpenNotional, _trader)), getIntegerValue(this, toCompositeKey(k_positionLastUpdatedCumulativePremiumFraction, _trader))) | |
231 | 235 | case _ => | |
232 | 236 | $Tuple4(0, 0, 0, 0) | |
233 | 237 | } | |
234 | 238 | } | |
235 | 239 | ||
236 | 240 | ||
237 | 241 | func requireOpenPosition (_trader) = if ((getPosition(_trader)._1 == 0)) | |
238 | 242 | then throw("No open position") | |
239 | 243 | else true | |
240 | 244 | ||
241 | 245 | ||
242 | 246 | func initialized () = valueOrElse(getBoolean(this, k_initialized), false) | |
243 | 247 | ||
244 | 248 | ||
245 | 249 | func paused () = valueOrElse(getBoolean(this, k_paused), false) | |
246 | 250 | ||
247 | 251 | ||
248 | 252 | func updateReserve (_isAdd,_quoteAssetAmount,_baseAssetAmount) = if (_isAdd) | |
249 | 253 | then { | |
250 | 254 | let newBase = (bsAstR() - _baseAssetAmount) | |
251 | 255 | if ((0 >= newBase)) | |
252 | 256 | then throw("Tx lead to base asset reserve <= 0, revert") | |
253 | 257 | else $Tuple4((qtAstR() + _quoteAssetAmount), newBase, (totalPositionSize() + _baseAssetAmount), (cumulativeNotional() + _quoteAssetAmount)) | |
254 | 258 | } | |
255 | 259 | else { | |
256 | 260 | let newQuote = (qtAstR() - _quoteAssetAmount) | |
257 | 261 | if ((0 >= newQuote)) | |
258 | 262 | then throw("Tx lead to base quote reserve <= 0, revert") | |
259 | 263 | else $Tuple4(newQuote, (bsAstR() + _baseAssetAmount), (totalPositionSize() - _baseAssetAmount), (cumulativeNotional() - _quoteAssetAmount)) | |
260 | 264 | } | |
261 | 265 | ||
262 | 266 | ||
263 | 267 | func swapInput (_isAdd,_quoteAssetAmount) = { | |
264 | 268 | let _qtAstR = qtAstR() | |
265 | 269 | let _bsAstR = bsAstR() | |
266 | 270 | let priceBefore = divd(_qtAstR, _bsAstR) | |
267 | 271 | let amountBaseAssetBoughtWithoutPriceImpact = muld(_quoteAssetAmount, priceBefore) | |
268 | 272 | let k = muld(_qtAstR, _bsAstR) | |
269 | 273 | let quoteAssetReserveAfter = if (_isAdd) | |
270 | 274 | then (_qtAstR + _quoteAssetAmount) | |
271 | 275 | else (_qtAstR - _quoteAssetAmount) | |
272 | 276 | let baseAssetReserveAfter = divd(k, quoteAssetReserveAfter) | |
273 | 277 | let amountBaseAssetBoughtAbs = abs((baseAssetReserveAfter - _bsAstR)) | |
274 | 278 | let amountBaseAssetBought = if (_isAdd) | |
275 | 279 | then amountBaseAssetBoughtAbs | |
276 | 280 | else -(amountBaseAssetBoughtAbs) | |
277 | 281 | let priceImpact = ((amountBaseAssetBoughtWithoutPriceImpact - amountBaseAssetBoughtAbs) / amountBaseAssetBoughtWithoutPriceImpact) | |
278 | 282 | let maxPriceImpactValue = maxPriceImpact() | |
279 | 283 | if ((priceImpact > maxPriceImpactValue)) | |
280 | 284 | then throw(((("Price impact " + toString(priceImpact)) + " > max price impact ") + toString(maxPriceImpactValue))) | |
281 | 285 | else { | |
282 | - | let $ | |
283 | - | let quoteAssetReserveAfter1 = $ | |
284 | - | let baseAssetReserveAfter1 = $ | |
285 | - | let totalPositionSizeAfter1 = $ | |
286 | - | let cumulativeNotionalAfter1 = $ | |
286 | + | let $t01143211635 = updateReserve(_isAdd, _quoteAssetAmount, amountBaseAssetBoughtAbs) | |
287 | + | let quoteAssetReserveAfter1 = $t01143211635._1 | |
288 | + | let baseAssetReserveAfter1 = $t01143211635._2 | |
289 | + | let totalPositionSizeAfter1 = $t01143211635._3 | |
290 | + | let cumulativeNotionalAfter1 = $t01143211635._4 | |
287 | 291 | $Tuple5(amountBaseAssetBought, quoteAssetReserveAfter1, baseAssetReserveAfter1, totalPositionSizeAfter1, cumulativeNotionalAfter1) | |
288 | 292 | } | |
289 | 293 | } | |
290 | 294 | ||
291 | 295 | ||
292 | 296 | func calcRemainMarginWithFundingPayment (_oldPositionSize,_oldPositionMargin,_oldPositionCumulativePremiumFraction,_marginDelta) = { | |
293 | 297 | let fundingPayment = if ((_oldPositionSize != 0)) | |
294 | 298 | then { | |
295 | 299 | let _latestCumulativePremiumFraction = latestCumulativePremiumFraction(_oldPositionSize) | |
296 | 300 | muld((_latestCumulativePremiumFraction - _oldPositionCumulativePremiumFraction), _oldPositionSize) | |
297 | 301 | } | |
298 | 302 | else 0 | |
299 | 303 | let signedMargin = ((_marginDelta - fundingPayment) + _oldPositionMargin) | |
300 | - | let $ | |
304 | + | let $t01238212509 = if ((0 > signedMargin)) | |
301 | 305 | then $Tuple2(0, abs(signedMargin)) | |
302 | 306 | else $Tuple2(abs(signedMargin), 0) | |
303 | - | let remainMargin = $ | |
304 | - | let badDebt = $ | |
307 | + | let remainMargin = $t01238212509._1 | |
308 | + | let badDebt = $t01238212509._2 | |
305 | 309 | $Tuple3(remainMargin, badDebt, fundingPayment) | |
306 | 310 | } | |
307 | 311 | ||
308 | 312 | ||
309 | 313 | func swapOutput (_isAdd,_baseAssetAmount) = { | |
310 | 314 | let _quoteAssetReserve = qtAstR() | |
311 | 315 | let _baseAssetReserve = bsAstR() | |
312 | 316 | if ((_baseAssetAmount == 0)) | |
313 | 317 | then throw("Invalid base asset amount") | |
314 | 318 | else { | |
315 | 319 | let k = muld(_quoteAssetReserve, _baseAssetReserve) | |
316 | 320 | let baseAssetPoolAmountAfter = if (_isAdd) | |
317 | 321 | then (_baseAssetReserve + _baseAssetAmount) | |
318 | 322 | else (_baseAssetReserve - _baseAssetAmount) | |
319 | 323 | let quoteAssetAfter = divd(k, baseAssetPoolAmountAfter) | |
320 | 324 | let quoteAssetSold = abs((quoteAssetAfter - _quoteAssetReserve)) | |
321 | - | let $ | |
322 | - | let quoteAssetReserveAfter1 = $ | |
323 | - | let baseAssetReserveAfter1 = $ | |
324 | - | let totalPositionSizeAfter1 = $ | |
325 | - | let cumulativeNotionalAfter1 = $ | |
325 | + | let $t01334713540 = updateReserve(!(_isAdd), quoteAssetSold, _baseAssetAmount) | |
326 | + | let quoteAssetReserveAfter1 = $t01334713540._1 | |
327 | + | let baseAssetReserveAfter1 = $t01334713540._2 | |
328 | + | let totalPositionSizeAfter1 = $t01334713540._3 | |
329 | + | let cumulativeNotionalAfter1 = $t01334713540._4 | |
326 | 330 | $Tuple7(quoteAssetSold, quoteAssetReserveAfter1, baseAssetReserveAfter1, totalPositionSizeAfter1, cumulativeNotionalAfter1, (totalLongPositionSize() - (if (_isAdd) | |
327 | 331 | then abs(_baseAssetAmount) | |
328 | 332 | else 0)), (totalShortPositionSize() - (if (!(_isAdd)) | |
329 | 333 | then abs(_baseAssetAmount) | |
330 | 334 | else 0))) | |
331 | 335 | } | |
332 | 336 | } | |
333 | 337 | ||
334 | 338 | ||
335 | 339 | func getOracleTwapPrice () = { | |
336 | 340 | let oracle = valueOrErrorMessage(addressFromString(getStringValue(this, k_ora)), "") | |
337 | 341 | let priceKey = getStringValue(this, k_ora_key) | |
338 | - | getIntegerValue(oracle, priceKey) | |
342 | + | let blockKey = getStringValue(this, k_ora_block_key) | |
343 | + | let lastValue = getIntegerValue(oracle, priceKey) | |
344 | + | lastValue | |
339 | 345 | } | |
340 | 346 | ||
341 | 347 | ||
342 | 348 | func getSpotPrice () = { | |
343 | 349 | let _quoteAssetReserve = qtAstR() | |
344 | 350 | let _baseAssetReserve = bsAstR() | |
345 | 351 | divd(_quoteAssetReserve, _baseAssetReserve) | |
346 | 352 | } | |
347 | 353 | ||
348 | 354 | ||
349 | 355 | func isOverFluctuationLimit () = { | |
350 | 356 | let oraclePrice = getOracleTwapPrice() | |
351 | 357 | let currentPrice = getSpotPrice() | |
352 | 358 | (divd(abs((oraclePrice - currentPrice)), oraclePrice) > spreadLimit()) | |
353 | 359 | } | |
354 | 360 | ||
355 | 361 | ||
356 | 362 | func getPositionNotionalAndUnrealizedPnl (_trader,_option) = { | |
357 | - | let $ | |
358 | - | let positionSize = $ | |
359 | - | let positionMargin = $ | |
360 | - | let positionOpenNotional = $ | |
361 | - | let positionLstUpdCPF = $ | |
363 | + | let $t01517215300 = getPosition(_trader) | |
364 | + | let positionSize = $t01517215300._1 | |
365 | + | let positionMargin = $t01517215300._2 | |
366 | + | let positionOpenNotional = $t01517215300._3 | |
367 | + | let positionLstUpdCPF = $t01517215300._4 | |
362 | 368 | let positionSizeAbs = abs(positionSize) | |
363 | 369 | if ((positionSizeAbs == 0)) | |
364 | 370 | then throw("Invalid position size") | |
365 | 371 | else { | |
366 | 372 | let isShort = (0 > positionSize) | |
367 | 373 | let positionNotional = if ((_option == PNL_OPTION_SPOT)) | |
368 | 374 | then { | |
369 | - | let $ | |
370 | - | let outPositionNotional = $ | |
371 | - | let x1 = $ | |
372 | - | let x2 = $ | |
373 | - | let x3 = $ | |
375 | + | let $t01554715654 = swapOutput(!(isShort), positionSizeAbs) | |
376 | + | let outPositionNotional = $t01554715654._1 | |
377 | + | let x1 = $t01554715654._2 | |
378 | + | let x2 = $t01554715654._3 | |
379 | + | let x3 = $t01554715654._4 | |
374 | 380 | outPositionNotional | |
375 | 381 | } | |
376 | 382 | else (positionSizeAbs * getOracleTwapPrice()) | |
377 | 383 | let unrealizedPnl = if (isShort) | |
378 | 384 | then (positionOpenNotional - positionNotional) | |
379 | 385 | else (positionNotional - positionOpenNotional) | |
380 | 386 | $Tuple2(positionNotional, unrealizedPnl) | |
381 | 387 | } | |
382 | 388 | } | |
383 | 389 | ||
384 | 390 | ||
385 | 391 | func getMarginRatioByOption (_trader,_option) = { | |
386 | - | let $ | |
387 | - | let positionSize = $ | |
388 | - | let positionMargin = $ | |
389 | - | let pon = $ | |
390 | - | let positionLstUpdCPF = $ | |
391 | - | let $ | |
392 | - | let positionNotional = $ | |
393 | - | let unrealizedPnl = $ | |
394 | - | let $ | |
395 | - | let remainMargin = $ | |
396 | - | let badDebt = $ | |
392 | + | let $t01614916260 = getPosition(_trader) | |
393 | + | let positionSize = $t01614916260._1 | |
394 | + | let positionMargin = $t01614916260._2 | |
395 | + | let pon = $t01614916260._3 | |
396 | + | let positionLstUpdCPF = $t01614916260._4 | |
397 | + | let $t01626616359 = getPositionNotionalAndUnrealizedPnl(_trader, _option) | |
398 | + | let positionNotional = $t01626616359._1 | |
399 | + | let unrealizedPnl = $t01626616359._2 | |
400 | + | let $t01636416530 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl) | |
401 | + | let remainMargin = $t01636416530._1 | |
402 | + | let badDebt = $t01636416530._2 | |
397 | 403 | divd((remainMargin - badDebt), positionNotional) | |
398 | 404 | } | |
399 | 405 | ||
400 | 406 | ||
401 | 407 | func getMarginRatio (_trader) = getMarginRatioByOption(_trader, PNL_OPTION_SPOT) | |
402 | 408 | ||
403 | 409 | ||
404 | 410 | func internalClosePosition (_trader) = { | |
405 | - | let $ | |
406 | - | let positionSize = $ | |
407 | - | let positionMargin = $ | |
408 | - | let pon = $ | |
409 | - | let positionLstUpdCPF = $ | |
410 | - | let $ | |
411 | - | let x1 = $ | |
412 | - | let unrealizedPnl = $ | |
413 | - | let $ | |
414 | - | let remainMargin = $ | |
415 | - | let badDebt = $ | |
411 | + | let $t01683616947 = getPosition(_trader) | |
412 | + | let positionSize = $t01683616947._1 | |
413 | + | let positionMargin = $t01683616947._2 | |
414 | + | let pon = $t01683616947._3 | |
415 | + | let positionLstUpdCPF = $t01683616947._4 | |
416 | + | let $t01695317040 = getPositionNotionalAndUnrealizedPnl(_trader, PNL_OPTION_SPOT) | |
417 | + | let x1 = $t01695317040._1 | |
418 | + | let unrealizedPnl = $t01695317040._2 | |
419 | + | let $t01704517213 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl) | |
420 | + | let remainMargin = $t01704517213._1 | |
421 | + | let badDebt = $t01704517213._2 | |
416 | 422 | let exchangedPositionSize = -(positionSize) | |
417 | 423 | let realizedPnl = unrealizedPnl | |
418 | 424 | let marginToVault = -(remainMargin) | |
419 | - | let $ | |
420 | - | let exchangedQuoteAssetAmount = $ | |
421 | - | let quoteAssetReserveAfter = $ | |
422 | - | let baseAssetReserveAfter = $ | |
423 | - | let totalPositionSizeAfter = $ | |
424 | - | let cumulativeNotionalAfter = $ | |
425 | - | let totalLongAfter = $ | |
426 | - | let totalShortAfter = $ | |
425 | + | let $t01734017621 = swapOutput((positionSize > 0), abs(positionSize)) | |
426 | + | let exchangedQuoteAssetAmount = $t01734017621._1 | |
427 | + | let quoteAssetReserveAfter = $t01734017621._2 | |
428 | + | let baseAssetReserveAfter = $t01734017621._3 | |
429 | + | let totalPositionSizeAfter = $t01734017621._4 | |
430 | + | let cumulativeNotionalAfter = $t01734017621._5 | |
431 | + | let totalLongAfter = $t01734017621._6 | |
432 | + | let totalShortAfter = $t01734017621._7 | |
427 | 433 | let openInterestNotionalAfter = (openInterestNotional() - pon) | |
428 | 434 | $Tuple12(exchangedPositionSize, badDebt, realizedPnl, marginToVault, quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, exchangedQuoteAssetAmount, totalLongAfter, totalShortAfter) | |
429 | 435 | } | |
430 | 436 | ||
431 | 437 | ||
432 | 438 | func getTwapSpotPrice () = { | |
433 | 439 | let minuteId = ((lastBlock.timestamp / 1000) / 60) | |
434 | 440 | let startMinuteId = (minuteId - TWAP_INTERVAL) | |
435 | 441 | let listStr = valueOrElse(getString(this, k_lastDataStr), "") | |
436 | 442 | let list = split(listStr, ",") | |
437 | 443 | func filterFn (accumulator,next) = if ((startMinuteId >= parseIntValue(next))) | |
438 | 444 | then (accumulator :+ parseIntValue(next)) | |
439 | 445 | else accumulator | |
440 | 446 | ||
441 | 447 | let listF = { | |
442 | 448 | let $l = list | |
443 | 449 | let $s = size($l) | |
444 | 450 | let $acc0 = nil | |
445 | 451 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
446 | 452 | then $a | |
447 | 453 | else filterFn($a, $l[$i]) | |
448 | 454 | ||
449 | 455 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
450 | 456 | then $a | |
451 | 457 | else throw("List size exceeds 20") | |
452 | 458 | ||
453 | 459 | $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) | |
454 | 460 | } | |
455 | 461 | let maxIndex = if ((size(listF) > 0)) | |
456 | 462 | then max(listF) | |
457 | 463 | else parseIntValue(list[0]) | |
458 | 464 | let lastMinuteId = valueOrElse(getInteger(this, k_lastMinuteId), 0) | |
459 | 465 | let endLastCumulativePrice = valueOrElse(getInteger(this, ((k_twapDataLastCumulativePrice + "_") + toString(lastMinuteId))), 0) | |
460 | 466 | let endLastPrice = valueOrElse(getInteger(this, ((k_twapDataLastPrice + "_") + toString(lastMinuteId))), 0) | |
461 | 467 | let nowCumulativePrice = (endLastCumulativePrice + ((minuteId - lastMinuteId) * endLastPrice)) | |
462 | 468 | let startLastCumulativePrice = valueOrElse(getInteger(this, ((k_twapDataLastCumulativePrice + "_") + toString(maxIndex))), 0) | |
463 | 469 | let startLastPrice = valueOrElse(getInteger(this, ((k_twapDataLastPrice + "_") + toString(maxIndex))), 0) | |
464 | 470 | let startCumulativePrice = (startLastCumulativePrice + ((startMinuteId - maxIndex) * startLastPrice)) | |
465 | 471 | ((nowCumulativePrice - startCumulativePrice) / TWAP_INTERVAL) | |
466 | 472 | } | |
467 | 473 | ||
468 | 474 | ||
469 | 475 | 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)] | |
470 | 476 | ||
471 | 477 | ||
472 | 478 | 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)] | |
473 | 479 | ||
474 | 480 | ||
475 | 481 | 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)] | |
476 | 482 | ||
477 | 483 | ||
478 | 484 | func appendTwap (price) = { | |
479 | 485 | let minuteId = ((lastBlock.timestamp / 1000) / 60) | |
480 | 486 | let previousMinuteId = valueOrElse(getInteger(this, k_lastMinuteId), 0) | |
481 | 487 | if ((previousMinuteId > minuteId)) | |
482 | 488 | then throw("TWAP out-of-order") | |
483 | 489 | else { | |
484 | 490 | let lastMinuteId = if ((previousMinuteId == 0)) | |
485 | 491 | then minuteId | |
486 | 492 | else previousMinuteId | |
487 | 493 | let listStr = valueOrElse(getString(this, k_lastDataStr), "") | |
488 | 494 | let oldList = split(listStr, ",") | |
489 | 495 | let list = if ((size(oldList) > TWAP_INTERVAL)) | |
490 | 496 | then (removeByIndex(oldList, 0) :+ toString(minuteId)) | |
491 | 497 | else (oldList :+ toString(minuteId)) | |
492 | 498 | let prevCumulativePrice = valueOrElse(getInteger(this, ((k_twapDataLastCumulativePrice + "_") + toString(previousMinuteId))), 0) | |
493 | 499 | let prevPrice = valueOrElse(getInteger(this, ((k_twapDataLastPrice + "_") + toString(previousMinuteId))), price) | |
494 | 500 | let lastCumulativePrice = (prevCumulativePrice + ((minuteId - lastMinuteId) * prevPrice)) | |
495 | 501 | func join (accumulator,val) = ((accumulator + val) + ",") | |
496 | 502 | ||
497 | 503 | let newListStr = { | |
498 | 504 | let $l = list | |
499 | 505 | let $s = size($l) | |
500 | 506 | let $acc0 = "" | |
501 | 507 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
502 | 508 | then $a | |
503 | 509 | else join($a, $l[$i]) | |
504 | 510 | ||
505 | 511 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
506 | 512 | then $a | |
507 | 513 | else throw("List size exceeds 20") | |
508 | 514 | ||
509 | 515 | $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) | |
510 | 516 | } | |
511 | 517 | let newListStrU = dropRight(newListStr, 1) | |
512 | 518 | let newListStrR = if ((take(newListStrU, 1) == ",")) | |
513 | 519 | then drop(newListStrU, 1) | |
514 | 520 | else newListStrU | |
515 | 521 | [IntegerEntry(((k_twapDataLastCumulativePrice + "_") + toString(minuteId)), lastCumulativePrice), IntegerEntry(((k_twapDataLastPrice + "_") + toString(minuteId)), price), IntegerEntry(k_lastMinuteId, minuteId), StringEntry(k_lastDataStr, newListStrR)] | |
516 | 522 | } | |
517 | 523 | } | |
518 | 524 | ||
519 | 525 | ||
520 | 526 | func updateAmm (_qtAstR,_bsAstR,_totalPositionSizeAfter,_cumulativeNotionalAfter,_openInterestNotional,_totalLongPositionSize,_totalShortPositionSize) = if (((_totalLongPositionSize - _totalShortPositionSize) != _totalPositionSizeAfter)) | |
521 | 527 | then throw(((((("Invalid AMM state data: " + toString(_totalLongPositionSize)) + " + ") + toString(_totalShortPositionSize)) + " != ") + toString(_totalPositionSizeAfter))) | |
522 | 528 | 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))) | |
523 | 529 | ||
524 | 530 | ||
525 | 531 | func deletePosition (_address) = [DeleteEntry(toCompositeKey(k_positionSize, _address)), DeleteEntry(toCompositeKey(k_positionMargin, _address)), DeleteEntry(toCompositeKey(k_positionOpenNotional, _address)), DeleteEntry(toCompositeKey(k_positionLastUpdatedCumulativePremiumFraction, _address))] | |
526 | 532 | ||
527 | 533 | ||
528 | 534 | func withdraw (_address,_amount) = { | |
529 | 535 | let balance = assetBalance(this, quoteAsset()) | |
530 | 536 | if ((_amount > balance)) | |
531 | 537 | then throw(((("Unable to withdraw " + toString(_amount)) + " from contract balance ") + toString(balance))) | |
532 | 538 | else [ScriptTransfer(_address, _amount, quoteAsset())] | |
533 | 539 | } | |
534 | 540 | ||
535 | 541 | ||
536 | 542 | func updateBalance (i) = if ((0 > i)) | |
537 | 543 | then throw("Balance") | |
538 | 544 | else [IntegerEntry(k_balance, i)] | |
539 | 545 | ||
540 | 546 | ||
541 | 547 | func transferFee (i) = [ScriptTransfer(stakingAddress(), i, quoteAsset())] | |
542 | 548 | ||
543 | 549 | ||
544 | 550 | @Callable(i) | |
545 | 551 | func pause () = if ((i.caller != adminAddress())) | |
546 | 552 | then throw("Invalid togglePause params") | |
547 | 553 | else [BooleanEntry(k_paused, true)] | |
548 | 554 | ||
549 | 555 | ||
550 | 556 | ||
551 | 557 | @Callable(i) | |
552 | 558 | func unpause () = if ((i.caller != adminAddress())) | |
553 | 559 | then throw("Invalid togglePause params") | |
554 | 560 | else [BooleanEntry(k_paused, false)] | |
555 | 561 | ||
556 | 562 | ||
557 | 563 | ||
558 | 564 | @Callable(i) | |
559 | 565 | func changeSettings (_initMarginRatio,_mmr,_liquidationFeeRatio,_fundingPeriod,_fee,_spreadLimit,_maxPriceImpact) = if ((i.caller != adminAddress())) | |
560 | 566 | then throw("Invalid changeSettings params") | |
561 | 567 | else updateSettings(_initMarginRatio, _mmr, _liquidationFeeRatio, _fundingPeriod, _fee, _spreadLimit, _maxPriceImpact) | |
562 | 568 | ||
563 | 569 | ||
564 | 570 | ||
565 | 571 | @Callable(i) | |
566 | 572 | 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)) | |
567 | 573 | then true | |
568 | 574 | else (0 >= _bsAstR)) | |
569 | 575 | then true | |
570 | 576 | else (0 >= _fundingPeriod)) | |
571 | 577 | then true | |
572 | 578 | else (0 >= _initMarginRatio)) | |
573 | 579 | then true | |
574 | 580 | else (0 >= _mmr)) | |
575 | 581 | then true | |
576 | 582 | else (0 >= _liquidationFeeRatio)) | |
577 | 583 | then true | |
578 | 584 | else (0 >= _fee)) | |
579 | 585 | then true | |
580 | 586 | else (0 >= _spreadLimit)) | |
581 | 587 | then true | |
582 | 588 | else (0 >= _maxPriceImpact)) | |
583 | 589 | then true | |
584 | 590 | else initialized()) | |
585 | 591 | then throw("Invalid initialize parameters") | |
586 | 592 | 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)]) | |
587 | 593 | ||
588 | 594 | ||
589 | 595 | ||
590 | 596 | @Callable(i) | |
591 | 597 | func decreasePosition (_direction,_amount,_leverage,_minBaseAssetAmount) = if (if (if (if (if (if (if (if ((_direction != DIR_LONG)) | |
592 | 598 | then (_direction != DIR_SHORT) | |
593 | 599 | else false) | |
594 | 600 | then true | |
595 | 601 | else (0 >= _amount)) | |
596 | 602 | then true | |
597 | 603 | else if (((1 * DECIMAL_UNIT) > _leverage)) | |
598 | 604 | then true | |
599 | 605 | else (_leverage > (3 * DECIMAL_UNIT))) | |
600 | 606 | then true | |
601 | 607 | else !(initialized())) | |
602 | 608 | then true | |
603 | 609 | else !(requireMoreMarginRatio(divd(DECIMAL_UNIT, _leverage), initMarginRatio(), true))) | |
604 | 610 | then true | |
605 | 611 | else !(requireOpenPosition(toString(i.caller)))) | |
606 | 612 | then true | |
607 | 613 | else paused()) | |
608 | 614 | then throw("Invalid decreasePosition parameters") | |
609 | 615 | else { | |
610 | - | let $ | |
611 | - | let oldPositionSize = $ | |
612 | - | let oldPositionMargin = $ | |
613 | - | let oldPositionOpenNotional = $ | |
614 | - | let oldPositionLstUpdCPF = $ | |
616 | + | let $t02680126953 = getPosition(toString(i.caller)) | |
617 | + | let oldPositionSize = $t02680126953._1 | |
618 | + | let oldPositionMargin = $t02680126953._2 | |
619 | + | let oldPositionOpenNotional = $t02680126953._3 | |
620 | + | let oldPositionLstUpdCPF = $t02680126953._4 | |
615 | 621 | let isNewPosition = (oldPositionSize == 0) | |
616 | 622 | let isSameDirection = if ((oldPositionSize > 0)) | |
617 | 623 | then (_direction == DIR_LONG) | |
618 | 624 | else (_direction == DIR_SHORT) | |
619 | 625 | let expandExisting = if (!(isNewPosition)) | |
620 | 626 | then isSameDirection | |
621 | 627 | else false | |
622 | 628 | let isAdd = (_direction == DIR_LONG) | |
623 | - | let $ | |
629 | + | let $t02724230280 = if (if (isNewPosition) | |
624 | 630 | then true | |
625 | 631 | else expandExisting) | |
626 | 632 | then throw("Use increasePosition to open new or increase position") | |
627 | 633 | else { | |
628 | 634 | let openNotional = muld(_amount, _leverage) | |
629 | - | let $ | |
630 | - | let oldPositionNotional = $ | |
631 | - | let unrealizedPnl = $ | |
635 | + | let $t02774827864 = getPositionNotionalAndUnrealizedPnl(toString(i.caller), PNL_OPTION_SPOT) | |
636 | + | let oldPositionNotional = $t02774827864._1 | |
637 | + | let unrealizedPnl = $t02774827864._2 | |
632 | 638 | if ((oldPositionNotional > openNotional)) | |
633 | 639 | then { | |
634 | - | let $ | |
635 | - | let exchangedPositionSize = $ | |
636 | - | let quoteAssetReserveAfter = $ | |
637 | - | let baseAssetReserveAfter = $ | |
638 | - | let totalPositionSizeAfter = $ | |
639 | - | let cumulativeNotionalAfter = $ | |
640 | + | let $t02792628156 = swapInput(isAdd, openNotional) | |
641 | + | let exchangedPositionSize = $t02792628156._1 | |
642 | + | let quoteAssetReserveAfter = $t02792628156._2 | |
643 | + | let baseAssetReserveAfter = $t02792628156._3 | |
644 | + | let totalPositionSizeAfter = $t02792628156._4 | |
645 | + | let cumulativeNotionalAfter = $t02792628156._5 | |
640 | 646 | let exchangedPositionSizeAbs = abs(exchangedPositionSize) | |
641 | 647 | if (if ((_minBaseAssetAmount != 0)) | |
642 | 648 | then (_minBaseAssetAmount > exchangedPositionSizeAbs) | |
643 | 649 | else false) | |
644 | 650 | then throw(((("Too little base asset exchanged, got " + toString(exchangedPositionSizeAbs)) + " expected ") + toString(_minBaseAssetAmount))) | |
645 | 651 | else { | |
646 | 652 | let realizedPnl = if ((oldPositionSize != 0)) | |
647 | 653 | then divd(muld(unrealizedPnl, exchangedPositionSizeAbs), oldPositionSize) | |
648 | 654 | else 0 | |
649 | - | let $ | |
650 | - | let remainMargin = $ | |
651 | - | let badDebt = $ | |
652 | - | let fundingPayment = $ | |
655 | + | let $t02869628953 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, realizedPnl) | |
656 | + | let remainMargin = $t02869628953._1 | |
657 | + | let badDebt = $t02869628953._2 | |
658 | + | let fundingPayment = $t02869628953._3 | |
653 | 659 | let exchangedQuoteAssetAmount = openNotional | |
654 | 660 | let unrealizedPnlAfter = (unrealizedPnl - realizedPnl) | |
655 | 661 | let remainOpenNotional = if ((oldPositionSize > 0)) | |
656 | 662 | then ((oldPositionNotional - exchangedQuoteAssetAmount) - unrealizedPnlAfter) | |
657 | 663 | else ((unrealizedPnlAfter + oldPositionNotional) - exchangedQuoteAssetAmount) | |
658 | 664 | let newPositionSize = (oldPositionSize + exchangedPositionSize) | |
659 | 665 | $Tuple11(newPositionSize, remainMargin, abs(remainOpenNotional), latestCumulativePremiumFraction(newPositionSize), baseAssetReserveAfter, quoteAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, (openInterestNotional() - openNotional), (totalLongPositionSize() - (if ((newPositionSize > 0)) | |
660 | 666 | then abs(exchangedPositionSize) | |
661 | 667 | else 0)), (totalShortPositionSize() - (if ((0 > newPositionSize)) | |
662 | 668 | then abs(exchangedPositionSize) | |
663 | 669 | else 0))) | |
664 | 670 | } | |
665 | 671 | } | |
666 | 672 | else throw("Close position first") | |
667 | 673 | } | |
668 | - | let newPositionSize = $ | |
669 | - | let newPositionRemainMargin = $ | |
670 | - | let newPositionOpenNotional = $ | |
671 | - | let newPositionLatestCPF = $ | |
672 | - | let baseAssetReserveAfter = $ | |
673 | - | let quoteAssetReserveAfter = $ | |
674 | - | let totalPositionSizeAfter = $ | |
675 | - | let cumulativeNotionalAfter = $ | |
676 | - | let openInterestNotionalAfter = $ | |
677 | - | let totalLongAfter = $ | |
678 | - | let totalShortAfter = $ | |
674 | + | let newPositionSize = $t02724230280._1 | |
675 | + | let newPositionRemainMargin = $t02724230280._2 | |
676 | + | let newPositionOpenNotional = $t02724230280._3 | |
677 | + | let newPositionLatestCPF = $t02724230280._4 | |
678 | + | let baseAssetReserveAfter = $t02724230280._5 | |
679 | + | let quoteAssetReserveAfter = $t02724230280._6 | |
680 | + | let totalPositionSizeAfter = $t02724230280._7 | |
681 | + | let cumulativeNotionalAfter = $t02724230280._8 | |
682 | + | let openInterestNotionalAfter = $t02724230280._9 | |
683 | + | let totalLongAfter = $t02724230280._10 | |
684 | + | let totalShortAfter = $t02724230280._11 | |
679 | 685 | (updatePosition(toString(i.caller), newPositionSize, newPositionRemainMargin, newPositionOpenNotional, newPositionLatestCPF) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter)) | |
680 | 686 | } | |
681 | 687 | ||
682 | 688 | ||
683 | 689 | ||
684 | 690 | @Callable(i) | |
685 | 691 | func increasePosition (_direction,_leverage,_minBaseAssetAmount) = { | |
686 | 692 | let _rawAmount = i.payments[0].amount | |
687 | 693 | if (if (if (if (if (if (if (if ((_direction != DIR_LONG)) | |
688 | 694 | then (_direction != DIR_SHORT) | |
689 | 695 | else false) | |
690 | 696 | then true | |
691 | 697 | else (0 >= _rawAmount)) | |
692 | 698 | then true | |
693 | 699 | else if (((1 * DECIMAL_UNIT) > _leverage)) | |
694 | 700 | then true | |
695 | 701 | else (_leverage > (3 * DECIMAL_UNIT))) | |
696 | 702 | then true | |
697 | 703 | else !(initialized())) | |
698 | 704 | then true | |
699 | 705 | else (i.payments[0].assetId != quoteAsset())) | |
700 | 706 | then true | |
701 | 707 | else !(requireMoreMarginRatio(divd(DECIMAL_UNIT, _leverage), initMarginRatio(), true))) | |
702 | 708 | then true | |
703 | 709 | else paused()) | |
704 | 710 | then throw("Invalid increasePosition parameters") | |
705 | 711 | else { | |
706 | 712 | let feeAmount = muld(_rawAmount, fee()) | |
707 | 713 | let _amount = (_rawAmount - feeAmount) | |
708 | - | let $ | |
709 | - | let oldPositionSize = $ | |
710 | - | let oldPositionMargin = $ | |
711 | - | let oldPositionOpenNotional = $ | |
714 | + | let $t03131631440 = getPosition(toString(i.caller)) | |
715 | + | let oldPositionSize = $t03131631440._1 | |
716 | + | let oldPositionMargin = $t03131631440._2 | |
717 | + | let oldPositionOpenNotional = $t03131631440._3 | |
712 | 718 | let isNewPosition = (oldPositionSize == 0) | |
713 | 719 | let isSameDirection = if ((oldPositionSize > 0)) | |
714 | 720 | then (_direction == DIR_LONG) | |
715 | 721 | else (_direction == DIR_SHORT) | |
716 | 722 | let expandExisting = if (!(isNewPosition)) | |
717 | 723 | then isSameDirection | |
718 | 724 | else false | |
719 | 725 | let isAdd = (_direction == DIR_LONG) | |
720 | - | let $ | |
726 | + | let $t03172934196 = if (if (isNewPosition) | |
721 | 727 | then true | |
722 | 728 | else expandExisting) | |
723 | 729 | then { | |
724 | 730 | let openNotional = muld(_amount, _leverage) | |
725 | - | let $ | |
726 | - | let amountBaseAssetBought = $ | |
727 | - | let quoteAssetReserveAfter = $ | |
728 | - | let baseAssetReserveAfter = $ | |
729 | - | let totalPositionSizeAfter = $ | |
730 | - | let cumulativeNotionalAfter = $ | |
731 | + | let $t03215332359 = swapInput(isAdd, openNotional) | |
732 | + | let amountBaseAssetBought = $t03215332359._1 | |
733 | + | let quoteAssetReserveAfter = $t03215332359._2 | |
734 | + | let baseAssetReserveAfter = $t03215332359._3 | |
735 | + | let totalPositionSizeAfter = $t03215332359._4 | |
736 | + | let cumulativeNotionalAfter = $t03215332359._5 | |
731 | 737 | if (if ((_minBaseAssetAmount != 0)) | |
732 | 738 | then (_minBaseAssetAmount > abs(amountBaseAssetBought)) | |
733 | 739 | else false) | |
734 | 740 | then throw(((("Limit error: " + toString(abs(amountBaseAssetBought))) + " < ") + toString(_minBaseAssetAmount))) | |
735 | 741 | else { | |
736 | 742 | let newPositionSize = (oldPositionSize + amountBaseAssetBought) | |
737 | 743 | let positionLstUpdCPF = latestCumulativePremiumFraction(newPositionSize) | |
738 | 744 | let increaseMarginRequirement = divd(openNotional, _leverage) | |
739 | - | let $ | |
740 | - | let remainMargin = $ | |
741 | - | let x1 = $ | |
742 | - | let x2 = $ | |
745 | + | let $t03282133057 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, positionLstUpdCPF, increaseMarginRequirement) | |
746 | + | let remainMargin = $t03282133057._1 | |
747 | + | let x1 = $t03282133057._2 | |
748 | + | let x2 = $t03282133057._3 | |
743 | 749 | $Tuple11(newPositionSize, remainMargin, (oldPositionOpenNotional + openNotional), latestCumulativePremiumFraction(newPositionSize), baseAssetReserveAfter, quoteAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, (openInterestNotional() + openNotional), (totalLongPositionSize() + (if ((newPositionSize > 0)) | |
744 | 750 | then abs(amountBaseAssetBought) | |
745 | 751 | else 0)), (totalShortPositionSize() + (if ((0 > newPositionSize)) | |
746 | 752 | then abs(amountBaseAssetBought) | |
747 | 753 | else 0))) | |
748 | 754 | } | |
749 | 755 | } | |
750 | 756 | else { | |
751 | 757 | let openNotional = muld(_amount, _leverage) | |
752 | - | let $ | |
753 | - | let oldPositionNotional = $ | |
754 | - | let unrealizedPnl = $ | |
758 | + | let $t03388934005 = getPositionNotionalAndUnrealizedPnl(toString(i.caller), PNL_OPTION_SPOT) | |
759 | + | let oldPositionNotional = $t03388934005._1 | |
760 | + | let unrealizedPnl = $t03388934005._2 | |
755 | 761 | if ((oldPositionNotional > openNotional)) | |
756 | 762 | then throw("Use decreasePosition to decrease position size") | |
757 | 763 | else throw("Close position first") | |
758 | 764 | } | |
759 | - | let newPositionSize = $ | |
760 | - | let newPositionRemainMargin = $ | |
761 | - | let newPositionOpenNotional = $ | |
762 | - | let newPositionLatestCPF = $ | |
763 | - | let baseAssetReserveAfter = $ | |
764 | - | let quoteAssetReserveAfter = $ | |
765 | - | let totalPositionSizeAfter = $ | |
766 | - | let cumulativeNotionalAfter = $ | |
767 | - | let openInterestNotionalAfter = $ | |
768 | - | let totalLongAfter = $ | |
769 | - | let totalShortAfter = $ | |
765 | + | let newPositionSize = $t03172934196._1 | |
766 | + | let newPositionRemainMargin = $t03172934196._2 | |
767 | + | let newPositionOpenNotional = $t03172934196._3 | |
768 | + | let newPositionLatestCPF = $t03172934196._4 | |
769 | + | let baseAssetReserveAfter = $t03172934196._5 | |
770 | + | let quoteAssetReserveAfter = $t03172934196._6 | |
771 | + | let totalPositionSizeAfter = $t03172934196._7 | |
772 | + | let cumulativeNotionalAfter = $t03172934196._8 | |
773 | + | let openInterestNotionalAfter = $t03172934196._9 | |
774 | + | let totalLongAfter = $t03172934196._10 | |
775 | + | let totalShortAfter = $t03172934196._11 | |
770 | 776 | let feeToStakers = (feeAmount / 2) | |
771 | 777 | let feeToInsurance = (feeAmount - feeToStakers) | |
772 | 778 | let stake = invoke(quoteAssetStaking(), "lockNeutrinoSP", [toString(stakingAddress()), ALL_FEES], [AttachedPayment(quoteAsset(), _amount)]) | |
773 | 779 | if ((stake == stake)) | |
774 | 780 | then { | |
775 | 781 | let depositInsurance = invoke(insuranceAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), feeToInsurance)]) | |
776 | 782 | if ((depositInsurance == depositInsurance)) | |
777 | 783 | then (((updatePosition(toString(i.caller), newPositionSize, newPositionRemainMargin, newPositionOpenNotional, newPositionLatestCPF) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter)) ++ transferFee(feeToStakers)) ++ updateBalance((cbalance() + _amount))) | |
778 | 784 | else throw("Strict value is not equal to itself.") | |
779 | 785 | } | |
780 | 786 | else throw("Strict value is not equal to itself.") | |
781 | 787 | } | |
782 | 788 | } | |
783 | 789 | ||
784 | 790 | ||
785 | 791 | ||
786 | 792 | @Callable(i) | |
787 | 793 | func addMargin () = { | |
788 | 794 | let _rawAmount = i.payments[0].amount | |
789 | 795 | if (if (if (if ((i.payments[0].assetId != quoteAsset())) | |
790 | 796 | then true | |
791 | 797 | else !(requireOpenPosition(toString(i.caller)))) | |
792 | 798 | then true | |
793 | 799 | else !(initialized())) | |
794 | 800 | then true | |
795 | 801 | else paused()) | |
796 | 802 | then throw("Invalid addMargin parameters") | |
797 | 803 | else { | |
798 | 804 | let feeAmount = muld(_rawAmount, fee()) | |
799 | 805 | let _amount = (_rawAmount - feeAmount) | |
800 | - | let $ | |
801 | - | let oldPositionSize = $ | |
802 | - | let oldPositionMargin = $ | |
803 | - | let oldPositionOpenNotional = $ | |
804 | - | let oldPositionLstUpdCPF = $ | |
806 | + | let $t03547235624 = getPosition(toString(i.caller)) | |
807 | + | let oldPositionSize = $t03547235624._1 | |
808 | + | let oldPositionMargin = $t03547235624._2 | |
809 | + | let oldPositionOpenNotional = $t03547235624._3 | |
810 | + | let oldPositionLstUpdCPF = $t03547235624._4 | |
805 | 811 | let feeToStakers = (feeAmount / 2) | |
806 | 812 | let feeToInsurance = (feeAmount - feeToStakers) | |
807 | 813 | let stake = invoke(quoteAssetStaking(), "lockNeutrinoSP", [toString(stakingAddress()), ALL_FEES], [AttachedPayment(quoteAsset(), _amount)]) | |
808 | 814 | if ((stake == stake)) | |
809 | 815 | then { | |
810 | 816 | let depositInsurance = invoke(insuranceAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), feeToInsurance)]) | |
811 | 817 | if ((depositInsurance == depositInsurance)) | |
812 | 818 | then ((updatePosition(toString(i.caller), oldPositionSize, (oldPositionMargin + _amount), oldPositionOpenNotional, oldPositionLstUpdCPF) ++ transferFee(feeToStakers)) ++ updateBalance((cbalance() + _amount))) | |
813 | 819 | else throw("Strict value is not equal to itself.") | |
814 | 820 | } | |
815 | 821 | else throw("Strict value is not equal to itself.") | |
816 | 822 | } | |
817 | 823 | } | |
818 | 824 | ||
819 | 825 | ||
820 | 826 | ||
821 | 827 | @Callable(i) | |
822 | 828 | func removeMargin (_amount) = if (if (if (if ((0 >= _amount)) | |
823 | 829 | then true | |
824 | 830 | else !(requireOpenPosition(toString(i.caller)))) | |
825 | 831 | then true | |
826 | 832 | else !(initialized())) | |
827 | 833 | then true | |
828 | 834 | else paused()) | |
829 | 835 | then throw("Invalid removeMargin parameters") | |
830 | 836 | else { | |
831 | - | let $ | |
832 | - | let oldPositionSize = $ | |
833 | - | let oldPositionMargin = $ | |
834 | - | let oldPositionOpenNotional = $ | |
835 | - | let oldPositionLstUpdCPF = $ | |
837 | + | let $t03654436696 = getPosition(toString(i.caller)) | |
838 | + | let oldPositionSize = $t03654436696._1 | |
839 | + | let oldPositionMargin = $t03654436696._2 | |
840 | + | let oldPositionOpenNotional = $t03654436696._3 | |
841 | + | let oldPositionLstUpdCPF = $t03654436696._4 | |
836 | 842 | let marginDelta = -(_amount) | |
837 | - | let $ | |
838 | - | let remainMargin = $ | |
839 | - | let badDebt = $ | |
843 | + | let $t03673336912 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, marginDelta) | |
844 | + | let remainMargin = $t03673336912._1 | |
845 | + | let badDebt = $t03673336912._2 | |
840 | 846 | if ((badDebt != 0)) | |
841 | 847 | then throw("Invalid added margin amount") | |
842 | 848 | else { | |
843 | 849 | let unstake = invoke(quoteAssetStaking(), "unlockNeutrino", [_amount, toBase58String(quoteAsset())], nil) | |
844 | 850 | if ((unstake == unstake)) | |
845 | 851 | then ((updatePosition(toString(i.caller), oldPositionSize, remainMargin, oldPositionOpenNotional, latestCumulativePremiumFraction(oldPositionSize)) ++ withdraw(i.caller, _amount)) ++ updateBalance((cbalance() - _amount))) | |
846 | 852 | else throw("Strict value is not equal to itself.") | |
847 | 853 | } | |
848 | 854 | } | |
849 | 855 | ||
850 | 856 | ||
851 | 857 | ||
852 | 858 | @Callable(i) | |
853 | 859 | func closePosition () = if (if (if (!(requireOpenPosition(toString(i.caller)))) | |
854 | 860 | then true | |
855 | 861 | else !(initialized())) | |
856 | 862 | then true | |
857 | 863 | else paused()) | |
858 | 864 | then throw("Invalid closePosition parameters") | |
859 | 865 | else { | |
860 | - | let $ | |
861 | - | let x1 = $ | |
862 | - | let positionBadDebt = $ | |
863 | - | let realizedPnl = $ | |
864 | - | let marginToVault = $ | |
865 | - | let quoteAssetReserveAfter = $ | |
866 | - | let baseAssetReserveAfter = $ | |
867 | - | let totalPositionSizeAfter = $ | |
868 | - | let cumulativeNotionalAfter = $ | |
869 | - | let openInterestNotionalAfter = $ | |
870 | - | let x2 = $ | |
871 | - | let totalLongAfter = $ | |
872 | - | let totalShortAfter = $ | |
866 | + | let $t03767238056 = internalClosePosition(toString(i.caller)) | |
867 | + | let x1 = $t03767238056._1 | |
868 | + | let positionBadDebt = $t03767238056._2 | |
869 | + | let realizedPnl = $t03767238056._3 | |
870 | + | let marginToVault = $t03767238056._4 | |
871 | + | let quoteAssetReserveAfter = $t03767238056._5 | |
872 | + | let baseAssetReserveAfter = $t03767238056._6 | |
873 | + | let totalPositionSizeAfter = $t03767238056._7 | |
874 | + | let cumulativeNotionalAfter = $t03767238056._8 | |
875 | + | let openInterestNotionalAfter = $t03767238056._9 | |
876 | + | let x2 = $t03767238056._10 | |
877 | + | let totalLongAfter = $t03767238056._11 | |
878 | + | let totalShortAfter = $t03767238056._12 | |
873 | 879 | if ((positionBadDebt > 0)) | |
874 | 880 | then throw("Unable to close position with bad debt") | |
875 | 881 | else { | |
876 | 882 | let withdrawAmount = abs(marginToVault) | |
877 | 883 | let ammBalance = (cbalance() - withdrawAmount) | |
878 | - | let $ | |
884 | + | let $t03826538407 = if ((0 > ammBalance)) | |
879 | 885 | then $Tuple2(0, abs(ammBalance)) | |
880 | 886 | else $Tuple2(ammBalance, 0) | |
881 | - | let ammNewBalance = $ | |
882 | - | let getFromInsurance = $ | |
887 | + | let ammNewBalance = $t03826538407._1 | |
888 | + | let getFromInsurance = $t03826538407._2 | |
883 | 889 | let x = if ((getFromInsurance > 0)) | |
884 | 890 | then { | |
885 | 891 | let withdrawInsurance = invoke(insuranceAddress(), "withdraw", [getFromInsurance], nil) | |
886 | 892 | if ((withdrawInsurance == withdrawInsurance)) | |
887 | 893 | then nil | |
888 | 894 | else throw("Strict value is not equal to itself.") | |
889 | 895 | } | |
890 | 896 | else nil | |
891 | 897 | if ((x == x)) | |
892 | 898 | then { | |
893 | 899 | let unstake = invoke(quoteAssetStaking(), "unlockNeutrino", [(withdrawAmount - getFromInsurance), toBase58String(quoteAsset())], nil) | |
894 | 900 | if ((unstake == unstake)) | |
895 | 901 | then (((deletePosition(toString(i.caller)) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter)) ++ withdraw(i.caller, withdrawAmount)) ++ updateBalance(ammNewBalance)) | |
896 | 902 | else throw("Strict value is not equal to itself.") | |
897 | 903 | } | |
898 | 904 | else throw("Strict value is not equal to itself.") | |
899 | 905 | } | |
900 | 906 | } | |
901 | 907 | ||
902 | 908 | ||
903 | 909 | ||
904 | 910 | @Callable(i) | |
905 | 911 | func liquidate (_trader) = { | |
906 | 912 | let marginRatio = if (isOverFluctuationLimit()) | |
907 | 913 | then getMarginRatioByOption(_trader, PNL_OPTION_ORACLE) | |
908 | 914 | else getMarginRatioByOption(_trader, PNL_OPTION_SPOT) | |
909 | 915 | if (if (if (if (!(requireMoreMarginRatio(marginRatio, maintenanceMarginRatio(), false))) | |
910 | 916 | then true | |
911 | 917 | else !(requireOpenPosition(_trader))) | |
912 | 918 | then true | |
913 | 919 | else !(initialized())) | |
914 | 920 | then true | |
915 | 921 | else paused()) | |
916 | 922 | then throw("Unable to liquidate") | |
917 | 923 | else { | |
918 | - | let $ | |
919 | - | let x1 = $ | |
920 | - | let badDebt = $ | |
921 | - | let x2 = $ | |
922 | - | let marginToVault = $ | |
923 | - | let quoteAssetReserveAfter = $ | |
924 | - | let baseAssetReserveAfter = $ | |
925 | - | let totalPositionSizeAfter = $ | |
926 | - | let cumulativeNotionalAfter = $ | |
927 | - | let openInterestNotionalAfter = $ | |
928 | - | let exchangedQuoteAssetAmount = $ | |
929 | - | let totalLongAfter = $ | |
930 | - | let totalShortAfter = $ | |
924 | + | let $t03984640273 = internalClosePosition(_trader) | |
925 | + | let x1 = $t03984640273._1 | |
926 | + | let badDebt = $t03984640273._2 | |
927 | + | let x2 = $t03984640273._3 | |
928 | + | let marginToVault = $t03984640273._4 | |
929 | + | let quoteAssetReserveAfter = $t03984640273._5 | |
930 | + | let baseAssetReserveAfter = $t03984640273._6 | |
931 | + | let totalPositionSizeAfter = $t03984640273._7 | |
932 | + | let cumulativeNotionalAfter = $t03984640273._8 | |
933 | + | let openInterestNotionalAfter = $t03984640273._9 | |
934 | + | let exchangedQuoteAssetAmount = $t03984640273._10 | |
935 | + | let totalLongAfter = $t03984640273._11 | |
936 | + | let totalShortAfter = $t03984640273._12 | |
931 | 937 | let liquidationPenalty = muld(exchangedQuoteAssetAmount, liquidationFeeRatio()) | |
932 | 938 | let feeToLiquidator = (liquidationPenalty / 2) | |
933 | 939 | let feeToInsurance = (liquidationPenalty - feeToLiquidator) | |
934 | 940 | let ammBadDebt = (cbalance() - liquidationPenalty) | |
935 | - | let $ | |
941 | + | let $t04067140806 = if ((0 > ammBadDebt)) | |
936 | 942 | then $Tuple2(0, abs(ammBadDebt)) | |
937 | 943 | else $Tuple2(ammBadDebt, 0) | |
938 | - | let newAmmBalance = $ | |
939 | - | let takeFromInsurance = $ | |
944 | + | let newAmmBalance = $t04067140806._1 | |
945 | + | let takeFromInsurance = $t04067140806._2 | |
940 | 946 | let x = if ((takeFromInsurance > 0)) | |
941 | 947 | then { | |
942 | 948 | let withdrawInsurance = invoke(insuranceAddress(), "withdraw", [takeFromInsurance], nil) | |
943 | 949 | if ((withdrawInsurance == withdrawInsurance)) | |
944 | 950 | then nil | |
945 | 951 | else throw("Strict value is not equal to itself.") | |
946 | 952 | } | |
947 | 953 | else nil | |
948 | 954 | if ((x == x)) | |
949 | 955 | then { | |
950 | 956 | let depositInsurance = invoke(insuranceAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), feeToInsurance)]) | |
951 | 957 | if ((depositInsurance == depositInsurance)) | |
952 | 958 | then { | |
953 | 959 | let unstake = invoke(quoteAssetStaking(), "unlockNeutrino", [(feeToLiquidator - takeFromInsurance), toBase58String(quoteAsset())], nil) | |
954 | 960 | if ((unstake == unstake)) | |
955 | 961 | then (((deletePosition(_trader) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter)) ++ withdraw(i.caller, feeToLiquidator)) ++ updateBalance(ammBadDebt)) | |
956 | 962 | else throw("Strict value is not equal to itself.") | |
957 | 963 | } | |
958 | 964 | else throw("Strict value is not equal to itself.") | |
959 | 965 | } | |
960 | 966 | else throw("Strict value is not equal to itself.") | |
961 | 967 | } | |
962 | 968 | } | |
963 | 969 | ||
964 | 970 | ||
965 | 971 | ||
966 | 972 | @Callable(i) | |
967 | 973 | func payFunding () = { | |
968 | 974 | let fundingBlockTimestamp = nextFundingBlockTimestamp() | |
969 | 975 | if (if (if ((fundingBlockTimestamp > lastBlock.timestamp)) | |
970 | 976 | then true | |
971 | 977 | else !(initialized())) | |
972 | 978 | then true | |
973 | 979 | else paused()) | |
974 | 980 | then throw(((("Invalid funding block timestamp: " + toString(lastBlock.timestamp)) + " < ") + toString(fundingBlockTimestamp))) | |
975 | 981 | else { | |
976 | 982 | let underlyingPrice = getOracleTwapPrice() | |
977 | 983 | let spotTwapPrice = getTwapSpotPrice() | |
978 | 984 | let premium = (spotTwapPrice - underlyingPrice) | |
979 | - | let $ | |
985 | + | let $t04217643511 = if (if ((totalShortPositionSize() == 0)) | |
980 | 986 | then true | |
981 | 987 | else (totalLongPositionSize() == 0)) | |
982 | - | then $ | |
988 | + | then $Tuple2(0, 0) | |
983 | 989 | else if ((0 > premium)) | |
984 | 990 | then { | |
985 | 991 | let shortPremiumFraction = divd(muld(premium, fundingPeriodDecimal()), ONE_DAY) | |
986 | - | let shortFundingRate = divd(shortPremiumFraction, underlyingPrice) | |
987 | 992 | let longPremiumFraction = divd(muld(shortPremiumFraction, totalShortPositionSize()), totalLongPositionSize()) | |
988 | - | let longFundingRate = divd(muld(longPremiumFraction, HUNDRED_PERCENT), underlyingPrice) | |
989 | - | $Tuple4(shortPremiumFraction, longPremiumFraction, shortFundingRate, longFundingRate) | |
993 | + | $Tuple2(shortPremiumFraction, longPremiumFraction) | |
990 | 994 | } | |
991 | 995 | else { | |
992 | 996 | let longPremiumFraction = divd(muld(premium, fundingPeriodDecimal()), ONE_DAY) | |
993 | - | let longFundingRate = divd(longPremiumFraction, underlyingPrice) | |
994 | 997 | let shortPremiumFraction = divd(muld(longPremiumFraction, totalLongPositionSize()), totalShortPositionSize()) | |
995 | - | let shortFundingRate = divd(muld(shortPremiumFraction, HUNDRED_PERCENT), underlyingPrice) | |
996 | - | $Tuple4(shortPremiumFraction, longPremiumFraction, shortFundingRate, longFundingRate) | |
998 | + | $Tuple2(shortPremiumFraction, longPremiumFraction) | |
997 | 999 | } | |
998 | - | let shortPremiumFraction = $t04171443510._1 | |
999 | - | let longPremiumFraction = $t04171443510._2 | |
1000 | - | let shortFundingRate = $t04171443510._3 | |
1001 | - | let longFundingRate = $t04171443510._4 | |
1002 | - | updateFunding((fundingBlockTimestamp + fundingPeriodSeconds()), (latestLongCumulativePremiumFraction() + longPremiumFraction), (latestShortCumulativePremiumFraction() + shortPremiumFraction), longFundingRate, shortFundingRate) | |
1000 | + | let shortPremiumFraction = $t04217643511._1 | |
1001 | + | let longPremiumFraction = $t04217643511._2 | |
1002 | + | updateFunding((fundingBlockTimestamp + fundingPeriodSeconds()), (latestLongCumulativePremiumFraction() + longPremiumFraction), (latestShortCumulativePremiumFraction() + shortPremiumFraction), divd(longPremiumFraction, underlyingPrice), divd(shortPremiumFraction, underlyingPrice)) | |
1003 | 1003 | } | |
1004 | 1004 | } | |
1005 | 1005 | ||
1006 | 1006 | ||
1007 | 1007 | ||
1008 | 1008 | @Callable(i) | |
1009 | 1009 | func v_get (_trader) = { | |
1010 | - | let $ | |
1011 | - | let x1 = $ | |
1012 | - | let x2 = $ | |
1013 | - | let x3 = $ | |
1014 | - | let x4 = $ | |
1010 | + | let $t04388643939 = internalClosePosition(_trader) | |
1011 | + | let x1 = $t04388643939._1 | |
1012 | + | let x2 = $t04388643939._2 | |
1013 | + | let x3 = $t04388643939._3 | |
1014 | + | let x4 = $t04388643939._4 | |
1015 | 1015 | throw((((s(x2) + s(x3)) + s(x4)) + s(getMarginRatio(_trader)))) | |
1016 | 1016 | } | |
1017 | 1017 | ||
1018 | 1018 | ||
1019 | 1019 | ||
1020 | 1020 | @Callable(i) | |
1021 | 1021 | func view_calcRemainMarginWithFundingPayment (_trader) = { | |
1022 | - | let $ | |
1023 | - | let positionSize = $ | |
1024 | - | let positionMargin = $ | |
1025 | - | let pon = $ | |
1026 | - | let positionLstUpdCPF = $ | |
1027 | - | let $ | |
1028 | - | let positionNotional = $ | |
1029 | - | let unrealizedPnl = $ | |
1030 | - | let $ | |
1031 | - | let remainMargin = $ | |
1032 | - | let badDebt = $ | |
1033 | - | let fundingPayment = $ | |
1022 | + | let $t04408644197 = getPosition(_trader) | |
1023 | + | let positionSize = $t04408644197._1 | |
1024 | + | let positionMargin = $t04408644197._2 | |
1025 | + | let pon = $t04408644197._3 | |
1026 | + | let positionLstUpdCPF = $t04408644197._4 | |
1027 | + | let $t04420244303 = getPositionNotionalAndUnrealizedPnl(_trader, PNL_OPTION_SPOT) | |
1028 | + | let positionNotional = $t04420244303._1 | |
1029 | + | let unrealizedPnl = $t04420244303._2 | |
1030 | + | let $t04430844490 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl) | |
1031 | + | let remainMargin = $t04430844490._1 | |
1032 | + | let badDebt = $t04430844490._2 | |
1033 | + | let fundingPayment = $t04430844490._3 | |
1034 | 1034 | throw(((s(remainMargin) + s(fundingPayment)) + s(getMarginRatio(_trader)))) | |
1035 | 1035 | } | |
1036 | 1036 | ||
1037 | 1037 | ||
1038 | 1038 | @Verifier(tx) | |
1039 | 1039 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], adminPublicKey()) | |
1040 | 1040 |
github/deemru/w8io/026f985 519.19 ms ◑