tx · FxVCrpoJFb2gwrAJBhMAeUvSjuGMv8pTNvFKARVw2ixj 3MvRWw2FPEimFCTGtK7qY9uAJbM7XJ4ZfJS: -0.04900000 Waves 2023.07.26 14:15 [2682754] smart account 3MvRWw2FPEimFCTGtK7qY9uAJbM7XJ4ZfJS > SELF 0.00000000 Waves
{ "type": 13, "id": "FxVCrpoJFb2gwrAJBhMAeUvSjuGMv8pTNvFKARVw2ixj", "fee": 4900000, "feeAssetId": null, "timestamp": 1690370123672, "version": 2, "chainId": 84, "sender": "3MvRWw2FPEimFCTGtK7qY9uAJbM7XJ4ZfJS", "senderPublicKey": "HP8sssVq1866F7CaPQJwgFrt6fsqhQjKwM84cL1wjD2a", "proofs": [ "48mSuPxuJ2EKhM6FyZRq4FuG9sPAh4TNBfsTeuBMwDgYG4PJMX9cRpk326Grexo3ftQz7ZX8S7utVs6QzC6tyfFo" ], "script": "base64:BgKmAQgCEgMKAQgSBAoCCAgSBQoDCBgYEgUKAwgBCBIECgIIARIGCgQBCAgBEgUKAwEICBILCgkICAgICAgICAgSAwoBCBIDCgEIEgUKAwgIARIGCgQIAQgIEg0KCwgIAQQRGBgRAQEYEgkKBwgIAQQIARgSDQoLCAgBBBgYGBgYARgSCwoJCAgBAQEBAQEEEgASABIAEgASABIAEgASABIDCgEIEgMKAQh4AAdTRl9QT09MAgJTRgAHV1hfUE9PTAICV1gAD0NBUF9GRUVfTk9fTE9BTgIJY2FwTm9Mb2FuAAxDQVBfRkVFX0xPQU4CB2NhcExvYW4AFFNUT1BMT1NTX0ZFRV9OT19MT0FOAg5zdG9wTG9zc05vTG9hbgANU1RPUExPU1NfTE9BTgIMc3RvcExvc3NMb2FuAAhMT0FOX0ZFRQIEbG9hbgALTk9fTE9BTl9GRUUCBm5vTG9hbgAGTk9fRkVFAgVub0ZlZQAGU0NBTEU4AIDC1y8AB1NDQUxFMTAAgMivoCUAB1NDQUxFMTYJALYCAQCAgIT+pt7hEQAKRkVFX1NDQUxFNgDAhD0AFGtT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wb29sCQELdmFsdWVPckVsc2UCCQELaXNBZG1pbkNhbGwBBQFpAwkBASEBCQEJaXNEZWZpbmVkAQkAnQgCBQR0aGlzCQCsAgIFBWtQb29sBQRwb29sCQACAQIMVW5rbm93biBwb29sAwkBC3ZhbHVlT3JFbHNlAgkAmwgCBQR0aGlzCQCsAgIFBHBvb2wFC2tQb29sQWN0aXZlBgkAAgECE1Bvb2wgYWxyZWFkeSBhY3RpdmUJAMwIAgkBDEJvb2xlYW5FbnRyeQIJAKwCAgUEcG9vbAULa1Bvb2xBY3RpdmUGBQNuaWwBaQEMc2h1dGRvd25Qb29sAQRwb29sCQELdmFsdWVPckVsc2UCCQELaXNBZG1pbkNhbGwBBQFpAwkBASEBCQEJaXNEZWZpbmVkAQkAnQgCBQR0aGlzCQCsAgIFBWtQb29sBQRwb29sCQACAQIMVW5rbm93biBwb29sAwkBASEBCQELdmFsdWVPckVsc2UCCQCbCAIFBHRoaXMJAKwCAgUEcG9vbAULa1Bvb2xBY3RpdmUGCQACAQIVUG9vbCBhbHJlYWR5IHNodXRkb3duCQDMCAIJAQxCb29sZWFuRW50cnkCCQCsAgIFBHBvb2wFC2tQb29sQWN0aXZlBwUDbmlsAQJ0eAEGdmVyaWZ5AAkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tleRJCVT4=", "height": 2682754, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: D97jizeEhZxPwBSwduiLFhDvKB5FZPNXe86phef7QfcF Next: 4opCmweNFJvfGjV1kBC5K5Kgyr2up5W19rX3J8B4rERv Diff:
Old | New | Differences | |
---|---|---|---|
534 | 534 | } | |
535 | 535 | ||
536 | 536 | ||
537 | + | func getWXSwapFees (pool) = { | |
538 | + | let poolAddr = addressFromStringValue(pool) | |
539 | + | let fContract = addressFromStringValue(valueOrErrorMessage(getString(poolAddr, "%s__factoryContract"), "Can't get WX factory contract addr")) | |
540 | + | let poolFeeDefault = value(getInteger(wxSwapContract, "%s__poolFee")) | |
541 | + | let protocolFeeDefault = value(getInteger(wxSwapContract, "%s__protocolFee")) | |
542 | + | match invoke(fContract, "getSwapFeeREADONLY", [toString(poolAddr)], nil) { | |
543 | + | case fees: (Int, Int) => | |
544 | + | $Tuple2(fees._1, fees._2) | |
545 | + | case _ => | |
546 | + | $Tuple2(poolFeeDefault, protocolFeeDefault) | |
547 | + | } | |
548 | + | } | |
549 | + | ||
550 | + | ||
537 | 551 | func calcAmountToPayWX (pool,assetIdA,assetIdB,balA,balB,amountTokenToGet,assetTokenToGet) = { | |
538 | - | let prFee = getIntegerValue(wxSwapContract, "%s__protocolFee") | |
539 | - | let pFee = getIntegerValue(wxSwapContract, "%s__poolFee") | |
552 | + | let $t01618416223 = getWXSwapFees(pool) | |
553 | + | let pFee = $t01618416223._1 | |
554 | + | let prFee = $t01618416223._2 | |
540 | 555 | let feeScale = toBigInt(100000000) | |
541 | - | let $ | |
556 | + | let $t01626316571 = if ((assetTokenToGet == assetIdA)) | |
542 | 557 | then { | |
543 | 558 | let amountToPay = fraction(amountTokenToGet, balB, (balA - amountTokenToGet)) | |
544 | 559 | $Tuple2(amountToPay, assetIdB) | |
547 | 562 | let amountToPay = fraction(amountTokenToGet, balA, (balB - amountTokenToGet)) | |
548 | 563 | $Tuple2(amountToPay, assetIdA) | |
549 | 564 | } | |
550 | - | let amountToPay = $ | |
551 | - | let assetToPay = $ | |
565 | + | let amountToPay = $t01626316571._1 | |
566 | + | let assetToPay = $t01626316571._2 | |
552 | 567 | let amountToPayWithFee = toInt(fraction(toBigInt(amountToPay), feeScale, (feeScale - toBigInt((prFee + pFee))), CEILING)) | |
553 | 568 | $Tuple2(assetToPay, amountToPayWithFee) | |
554 | 569 | } | |
556 | 571 | ||
557 | 572 | func exchangeDirectly (pType,pool,assetIdA,assetIdB,balA,balB,amountTokenToGet,assetTokenToGet) = if ((pType == SF_POOL)) | |
558 | 573 | then { | |
559 | - | let $ | |
560 | - | let assetToPay = $ | |
561 | - | let amountToPay = $ | |
574 | + | let $t01691817040 = calcAmountToPaySF(pool, assetIdA, assetIdB, balA, balB, amountTokenToGet, assetTokenToGet) | |
575 | + | let assetToPay = $t01691817040._1 | |
576 | + | let amountToPay = $t01691817040._2 | |
562 | 577 | invoke(addressFromStringValue(pool), "callFunction", ["exchange", [toString(amountTokenToGet)]], [AttachedPayment(assetIdFromStr(assetToPay), amountToPay)]) | |
563 | 578 | } | |
564 | 579 | else if ((pType == WX_POOL)) | |
565 | 580 | then { | |
566 | - | let $ | |
567 | - | let assetToPay = $ | |
568 | - | let amountToPay = $ | |
581 | + | let $t01724017362 = calcAmountToPayWX(pool, assetIdA, assetIdB, balA, balB, amountTokenToGet, assetTokenToGet) | |
582 | + | let assetToPay = $t01724017362._1 | |
583 | + | let amountToPay = $t01724017362._2 | |
569 | 584 | invoke(wxSwapContract, "swap", [amountTokenToGet, assetTokenToGet, toString(this)], [AttachedPayment(assetIdFromStr(assetToPay), amountToPay)]) | |
570 | 585 | } | |
571 | 586 | else unknownPoolType() | |
572 | 587 | ||
573 | 588 | ||
574 | 589 | func calcWithdrawLPFromPoolVirt (poolAddr,pType,shareId,userCanWithdraw) = { | |
575 | - | let $ | |
590 | + | let $t01764918113 = if ((pType == SF_POOL)) | |
576 | 591 | then { | |
577 | 592 | let inv = { | |
578 | 593 | let @ = invoke(poolAddr, "callFunction", ["withdrawREADONLY", [toString(userCanWithdraw)]], nil) | |
607 | 622 | else throw("Strict value is not equal to itself.") | |
608 | 623 | } | |
609 | 624 | else unknownPoolType() | |
610 | - | let amountA = $ | |
611 | - | let amountB = $ | |
625 | + | let amountA = $t01764918113._1 | |
626 | + | let amountB = $t01764918113._2 | |
612 | 627 | $Tuple2(amountA, amountB) | |
613 | 628 | } | |
614 | 629 | ||
651 | 666 | if ((lpBalanceBefore == lpBalanceBefore)) | |
652 | 667 | then { | |
653 | 668 | let poolAddr = addressFromStringValue(pool) | |
654 | - | let $ | |
669 | + | let $t01907819494 = if (if ((pmtA > 0)) | |
655 | 670 | then (pmtB > 0) | |
656 | 671 | else false) | |
657 | 672 | then { | |
658 | - | let $ | |
659 | - | let pmtInA = $ | |
660 | - | let pmtInB = $ | |
661 | - | let change = $ | |
662 | - | let changeId = $ | |
673 | + | let $t01914419260 = calcReplenishByTwoTokens(pType, poolAddr, pmtA, aId, pmtB, bId, balA, balB) | |
674 | + | let pmtInA = $t01914419260._1 | |
675 | + | let pmtInB = $t01914419260._2 | |
676 | + | let change = $t01914419260._3 | |
677 | + | let changeId = $t01914419260._4 | |
663 | 678 | let inv = replenishTwoTokensByType(poolAddr, pType, pmtInA, aId, pmtInB, bId) | |
664 | 679 | if ((inv == inv)) | |
665 | 680 | then $Tuple2(change, changeId) | |
670 | 685 | else if ((pmtB > 0)) | |
671 | 686 | then $Tuple2(pmtB, bId) | |
672 | 687 | else throw("pmts must be > 0") | |
673 | - | let change = $ | |
674 | - | let changeId = $ | |
688 | + | let change = $t01907819494._1 | |
689 | + | let changeId = $t01907819494._2 | |
675 | 690 | let inv = if ((change > 0)) | |
676 | 691 | then replenishOneTokenByType(poolAddr, pType, change, changeId) | |
677 | 692 | else nil | |
699 | 714 | func replenishEntries (pool,user,stakedAmount,axlyFeeAmount,posNum,shareId,type,withLoan) = { | |
700 | 715 | let totalAmount = getPoolTotalShare(pool) | |
701 | 716 | let totalAmountLoan = getPoolTotalShareWithLoan(pool) | |
702 | - | let $ | |
717 | + | let $t02035220590 = if (withLoan) | |
703 | 718 | then $Tuple2(getIntegerValue(this, (pool + kPoolInterestLoan)), (totalAmountLoan + stakedAmount)) | |
704 | 719 | else $Tuple2(getIntegerValue(this, (pool + kPoolInterestNoLoan)), totalAmountLoan) | |
705 | - | let curPoolInterest = $ | |
706 | - | let totalStakedWithLoan = $ | |
720 | + | let curPoolInterest = $t02035220590._1 | |
721 | + | let totalStakedWithLoan = $t02035220590._2 | |
707 | 722 | [IntegerEntry((pool + kPoolTotal), (totalAmount + stakedAmount)), IntegerEntry((pool + kPoolTotalLoan), totalStakedWithLoan), IntegerEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserPosition), stakedAmount), IntegerEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserPositionInterest), curPoolInterest), StringEntry((((user + "_") + toString(posNum)) + kUserPositionPool), pool), IntegerEntry((user + kUserPositionNum), posNum), ScriptTransfer(moneyBox, axlyFeeAmount, fromBase58String(shareId))] | |
708 | 723 | } | |
709 | 724 | ||
749 | 764 | ||
750 | 765 | func capitalize (pool,pType,tokenId,tokenAmount) = { | |
751 | 766 | let poolAddr = Address(fromBase58String(pool)) | |
752 | - | let $ | |
753 | - | let AId = $ | |
754 | - | let BId = $ | |
755 | - | let balA = $ | |
756 | - | let balB = $ | |
757 | - | let shareId = $ | |
767 | + | let $t02294123007 = getPoolData(poolAddr, pType) | |
768 | + | let AId = $t02294123007._1 | |
769 | + | let BId = $t02294123007._2 | |
770 | + | let balA = $t02294123007._3 | |
771 | + | let balB = $t02294123007._4 | |
772 | + | let shareId = $t02294123007._5 | |
758 | 773 | if (if ((tokenId != AId)) | |
759 | 774 | then (tokenId != BId) | |
760 | 775 | else false) | |
761 | 776 | then throw("Wrong asset") | |
762 | 777 | else { | |
763 | - | let $ | |
778 | + | let $t02309223172 = if ((tokenId == AId)) | |
764 | 779 | then $Tuple2(tokenAmount, 0) | |
765 | 780 | else $Tuple2(0, tokenAmount) | |
766 | - | let pmtA = $ | |
767 | - | let pmtB = $ | |
768 | - | let $ | |
769 | - | let stakedAmount = $ | |
770 | - | let nf = $ | |
781 | + | let pmtA = $t02309223172._1 | |
782 | + | let pmtB = $t02309223172._2 | |
783 | + | let $t02317523279 = replenishByType(pType, pool, NO_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId) | |
784 | + | let stakedAmount = $t02317523279._1 | |
785 | + | let nf = $t02317523279._2 | |
771 | 786 | let curPoolInterestLoan = valueOrElse(getInteger(this, (pool + kPoolInterestLoan)), 0) | |
772 | 787 | let curPoolInterestNoLoan = valueOrElse(getInteger(this, (pool + kPoolInterestNoLoan)), 0) | |
773 | 788 | let totalShareAmount = getPoolTotalShare(pool) | |
794 | 809 | func withdrawAmountCalc (pool,userCanWithdraw,debt,borrowAsset,stopLossFee) = { | |
795 | 810 | let poolAddr = Address(fromBase58String(pool)) | |
796 | 811 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Unknown pool") | |
797 | - | let $ | |
798 | - | let assetIdA = $ | |
799 | - | let assetIdB = $ | |
800 | - | let balA = $ | |
801 | - | let balB = $ | |
802 | - | let shareId = $ | |
812 | + | let $t02506925145 = getPoolData(poolAddr, pType) | |
813 | + | let assetIdA = $t02506925145._1 | |
814 | + | let assetIdB = $t02506925145._2 | |
815 | + | let balA = $t02506925145._3 | |
816 | + | let balB = $t02506925145._4 | |
817 | + | let shareId = $t02506925145._5 | |
803 | 818 | let cBalABefore = accountBalance(assetIdFromStr(assetIdA)) | |
804 | 819 | if ((cBalABefore == cBalABefore)) | |
805 | 820 | then { | |
825 | 840 | then { | |
826 | 841 | let cBalAAfter = accountBalance(assetIdFromStr(assetIdA)) | |
827 | 842 | let cBalBAfter = accountBalance(assetIdFromStr(assetIdB)) | |
828 | - | let $ | |
829 | - | let tokensAmountA = $ | |
830 | - | let tokensAmountB = $ | |
831 | - | let $ | |
843 | + | let $t02583825927 = $Tuple2((cBalAAfter - cBalABefore), (cBalBAfter - cBalBBefore)) | |
844 | + | let tokensAmountA = $t02583825927._1 | |
845 | + | let tokensAmountB = $t02583825927._2 | |
846 | + | let $t02593026784 = if ((debt > 0)) | |
832 | 847 | then { | |
833 | 848 | let amountToGetEx = if (if ((borrowAsset == assetIdA)) | |
834 | 849 | then (debt > tokensAmountA) | |
853 | 868 | else throw("Strict value is not equal to itself.") | |
854 | 869 | } | |
855 | 870 | else $Tuple2(tokensAmountA, tokensAmountB) | |
856 | - | let toUserA = $ | |
857 | - | let toUserB = $ | |
871 | + | let toUserA = $t02593026784._1 | |
872 | + | let toUserB = $t02593026784._2 | |
858 | 873 | $Tuple5(toUserA, assetIdA, toUserB, assetIdB, shareId) | |
859 | 874 | } | |
860 | 875 | else throw("Strict value is not equal to itself.") | |
882 | 897 | let poolTotalShare = getPoolTotalShare(pool) | |
883 | 898 | let userAddr = Address(fromBase58String(user)) | |
884 | 899 | let borrowAsset = valueOrElse(getString(this, (((((pool + "_") + user) + "_") + posId) + kUserBorrowAssetId)), "") | |
885 | - | let $ | |
900 | + | let $t02798228216 = if ((borrowAmount > 0)) | |
886 | 901 | then $Tuple2({ | |
887 | 902 | let @ = invoke(getLendSrvAddr(), "getAssetDebt", [false, ((user + "_") + posId), borrowAsset], nil) | |
888 | 903 | if ($isInstanceOf(@, "Int")) | |
890 | 905 | else throw(($getType(@) + " couldn't be cast to Int")) | |
891 | 906 | }, STOPLOSS_LOAN) | |
892 | 907 | else $Tuple2(0, STOPLOSS_FEE_NO_LOAN) | |
893 | - | let debt = $ | |
894 | - | let feeType = $ | |
908 | + | let debt = $t02798228216._1 | |
909 | + | let feeType = $t02798228216._2 | |
895 | 910 | let stopLossFee = if (stopLoss) | |
896 | 911 | then fraction(userCanWithdraw, getAxlyFee(pool, feeType), FEE_SCALE6) | |
897 | 912 | else 0 | |
898 | - | let $ | |
899 | - | if (($ | |
913 | + | let $t02833328489 = withdrawAmountCalc(pool, (userCanWithdraw - stopLossFee), debt, borrowAsset, stopLossFee) | |
914 | + | if (($t02833328489 == $t02833328489)) | |
900 | 915 | then { | |
901 | - | let shareId = $ | |
902 | - | let assetIdB = $ | |
903 | - | let toUserAmountB = $ | |
904 | - | let assetIdA = $ | |
905 | - | let toUserAmountA = $ | |
916 | + | let shareId = $t02833328489._5 | |
917 | + | let assetIdB = $t02833328489._4 | |
918 | + | let toUserAmountB = $t02833328489._3 | |
919 | + | let assetIdA = $t02833328489._2 | |
920 | + | let toUserAmountA = $t02833328489._1 | |
906 | 921 | let closeDbtInv = if ((debt > 0)) | |
907 | 922 | then invoke(getLendSrvAddr(), "repayFor", [((user + "_") + posId)], [AttachedPayment(assetIdFromStr(borrowAsset), debt)]) | |
908 | 923 | else 0 | |
944 | 959 | let decPrA = pow(10, 0, getAssetDecimals(aId), 0, 0, DOWN) | |
945 | 960 | let decPrB = pow(10, 0, getAssetDecimals(bId), 0, 0, DOWN) | |
946 | 961 | let paydInDollar = (fraction(dPriceA, pmtA, decPrA) + fraction(dPriceB, pmtB, decPrB)) | |
947 | - | let $ | |
962 | + | let $t03055230649 = if ((borrowId == aId)) | |
948 | 963 | then $Tuple2(dPriceA, decPrA) | |
949 | 964 | else $Tuple2(dPriceB, decPrB) | |
950 | - | let borrowPrice = $ | |
951 | - | let borrowDecPr = $ | |
965 | + | let borrowPrice = $t03055230649._1 | |
966 | + | let borrowDecPr = $t03055230649._2 | |
952 | 967 | fraction(fraction(paydInDollar, (leverage - 100), 100), borrowDecPr, borrowPrice) | |
953 | 968 | } | |
954 | 969 | ||
977 | 992 | ||
978 | 993 | ||
979 | 994 | func claimAndCheckAmntEx (pool,pType,claim,amountToExchange,change) = { | |
980 | - | let $ | |
995 | + | let $t03166331950 = if (claim) | |
981 | 996 | then claimFarmed(pType, pool) | |
982 | 997 | else { | |
983 | 998 | let claimedAsset = if ((pType == SF_POOL)) | |
987 | 1002 | else unknownPoolType() | |
988 | 1003 | $Tuple2(amountToExchange, claimedAsset) | |
989 | 1004 | } | |
990 | - | let claimAmount = $ | |
991 | - | let claimAsset = $ | |
1005 | + | let claimAmount = $t03166331950._1 | |
1006 | + | let claimAsset = $t03166331950._2 | |
992 | 1007 | let bal = accountBalance(claimAsset) | |
993 | 1008 | if (if ((amountToExchange > (claimAmount + change))) | |
994 | 1009 | then true | |
1019 | 1034 | @Callable(i) | |
1020 | 1035 | func getUserPositionREADONLY (user,pools,posNum) = { | |
1021 | 1036 | func userPos (a,pool) = { | |
1022 | - | let $t03243632480 = a | |
1023 | - | let wAmountsA = $t03243632480._1 | |
1024 | - | let wAmountsB = $t03243632480._2 | |
1025 | - | let debts = $t03243632480._3 | |
1026 | - | let index = $t03243632480._4 | |
1027 | - | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
1028 | - | let $t03257232662 = getPoolData(Address(fromBase58String(pool)), pType) | |
1029 | - | let AId = $t03257232662._1 | |
1030 | - | let BId = $t03257232662._2 | |
1031 | - | let balA = $t03257232662._3 | |
1032 | - | let balB = $t03257232662._4 | |
1033 | - | let shareId = $t03257232662._5 | |
1034 | - | let borrowAmount = valueOrElse(getInteger(this, (((((pool + "_") + user) + "_") + posNum[index]) + kUserBorrowAmount)), 0) | |
1037 | + | let $t03293833008 = a | |
1038 | + | let wAmountsA = $t03293833008._1 | |
1039 | + | let wAmountsB = $t03293833008._2 | |
1040 | + | let debts = $t03293833008._3 | |
1041 | + | let eqWAmountsA = $t03293833008._4 | |
1042 | + | let eqWAmountsB = $t03293833008._5 | |
1043 | + | let index = $t03293833008._6 | |
1035 | 1044 | if (!(isDefined(getInteger(this, (((((pool + "_") + user) + "_") + posNum[index]) + kUserPosition))))) | |
1036 | - | then $ | |
1045 | + | then $Tuple6((wAmountsA :+ 0), (wAmountsB :+ 0), (debts :+ 0), (eqWAmountsA :+ 0), (eqWAmountsB :+ 0), (index + 1)) | |
1037 | 1046 | else { | |
1047 | + | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
1048 | + | let $t03328733377 = getPoolData(Address(fromBase58String(pool)), pType) | |
1049 | + | let AId = $t03328733377._1 | |
1050 | + | let BId = $t03328733377._2 | |
1051 | + | let balA = $t03328733377._3 | |
1052 | + | let balB = $t03328733377._4 | |
1053 | + | let shareId = $t03328733377._5 | |
1054 | + | let borrowAmount = valueOrElse(getInteger(this, (((((pool + "_") + user) + "_") + posNum[index]) + kUserBorrowAmount)), 0) | |
1038 | 1055 | let userCanWithdraw = userCanWithdrawShareCalc(user, pool, posNum[index], (borrowAmount > 0)) | |
1039 | - | let $ | |
1040 | - | let wAmountA = $ | |
1041 | - | let wAmountB = $ | |
1056 | + | let $t03359333713 = calcWithdrawLPFromPoolVirt(Address(fromBase58String(pool)), pType, shareId, userCanWithdraw) | |
1057 | + | let wAmountA = $t03359333713._1 | |
1058 | + | let wAmountB = $t03359333713._2 | |
1042 | 1059 | if ((borrowAmount > 0)) | |
1043 | 1060 | then { | |
1044 | 1061 | let borrowAsset = getStringValue(this, (((((pool + "_") + user) + "_") + posNum[index]) + kUserBorrowAssetId)) | |
1049 | 1066 | else throw(($getType(@) + " couldn't be cast to Int")) | |
1050 | 1067 | } | |
1051 | 1068 | if ((debt == debt)) | |
1052 | - | then $Tuple4((wAmountsA :+ wAmountA), (wAmountsB :+ wAmountB), (debts :+ debt), (index + 1)) | |
1069 | + | then { | |
1070 | + | let $t03399734281 = if ((pType == SF_POOL)) | |
1071 | + | then calcAmountToPaySF(pool, AId, BId, balA, balB, debt, borrowAsset) | |
1072 | + | else if ((pType == WX_POOL)) | |
1073 | + | then calcAmountToPayWX(pool, AId, BId, balA, balB, debt, borrowAsset) | |
1074 | + | else unknownPoolType() | |
1075 | + | let assetToPay = $t03399734281._1 | |
1076 | + | let amountToPay = $t03399734281._2 | |
1077 | + | let $t03428834434 = if ((assetToPay == BId)) | |
1078 | + | then $Tuple2((wAmountA - debt), (wAmountB - amountToPay)) | |
1079 | + | else $Tuple2((wAmountA - amountToPay), (wAmountB - debt)) | |
1080 | + | let eqWAmountA = $t03428834434._1 | |
1081 | + | let eqWAmountB = $t03428834434._2 | |
1082 | + | $Tuple6((wAmountsA :+ wAmountA), (wAmountsB :+ wAmountB), (debts :+ debt), (eqWAmountsA :+ eqWAmountA), (eqWAmountsB :+ eqWAmountB), (index + 1)) | |
1083 | + | } | |
1053 | 1084 | else throw("Strict value is not equal to itself.") | |
1054 | 1085 | } | |
1055 | - | else $ | |
1086 | + | else $Tuple6((wAmountsA :+ wAmountA), (wAmountsB :+ wAmountB), debts, (wAmountsA :+ wAmountA), (wAmountsB :+ wAmountB), (index + 1)) | |
1056 | 1087 | } | |
1057 | 1088 | } | |
1058 | 1089 | ||
1059 | - | let $ | |
1090 | + | let $t03468934800 = { | |
1060 | 1091 | let $l = pools | |
1061 | 1092 | let $s = size($l) | |
1062 | - | let $acc0 = $ | |
1093 | + | let $acc0 = $Tuple6(nil, nil, nil, nil, nil, 0) | |
1063 | 1094 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
1064 | 1095 | then $a | |
1065 | 1096 | else userPos($a, $l[$i]) | |
1070 | 1101 | ||
1071 | 1102 | $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) | |
1072 | 1103 | } | |
1073 | - | let wAmountsA = $t03356033637._1 | |
1074 | - | let wAmountsB = $t03356033637._2 | |
1075 | - | let debts = $t03356033637._3 | |
1076 | - | $Tuple2(nil, $Tuple3(wAmountsA, wAmountsB, debts)) | |
1104 | + | let wAmountsA = $t03468934800._1 | |
1105 | + | let wAmountsB = $t03468934800._2 | |
1106 | + | let debts = $t03468934800._3 | |
1107 | + | let eqWAmountsA = $t03468934800._4 | |
1108 | + | let eqWAmountsB = $t03468934800._5 | |
1109 | + | $Tuple2(nil, $Tuple5(wAmountsA, wAmountsB, debts, eqWAmountsA, eqWAmountsB)) | |
1077 | 1110 | } | |
1078 | 1111 | ||
1079 | 1112 | ||
1080 | 1113 | ||
1081 | 1114 | @Callable(i) | |
1082 | - | func replenish (pool,leverage,borrowId) = valueOrElse(isActiveForUsers(), if (if ((100 > leverage)) | |
1083 | - | then true | |
1084 | - | else (leverage > 300)) | |
1085 | - | then throw("Leverage can't be <100 and >300") | |
1086 | - | else if (if (!(getBooleanValue(this, (pool + kPoolCanBorrow)))) | |
1087 | - | then (leverage > 100) | |
1088 | - | else false) | |
1089 | - | then throw("You can't borrow in this pool") | |
1090 | - | else { | |
1091 | - | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
1092 | - | let $t03412634216 = getPoolData(Address(fromBase58String(pool)), pType) | |
1093 | - | let AId = $t03412634216._1 | |
1094 | - | let BId = $t03412634216._2 | |
1095 | - | let balA = $t03412634216._3 | |
1096 | - | let balB = $t03412634216._4 | |
1097 | - | let shareId = $t03412634216._5 | |
1098 | - | if (if ((borrowId != AId)) | |
1099 | - | then (borrowId != BId) | |
1115 | + | func replenish (pool,leverage,borrowId) = valueOrElse(isActiveForUsers(), { | |
1116 | + | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
1117 | + | if (!(isPoolActive(pool, pType))) | |
1118 | + | then throw("Pool not active at this moment") | |
1119 | + | else if (if ((100 > leverage)) | |
1120 | + | then true | |
1121 | + | else (leverage > 300)) | |
1122 | + | then throw("Leverage can't be <100 and >300") | |
1123 | + | else if (if (!(getBooleanValue(this, (pool + kPoolCanBorrow)))) | |
1124 | + | then (leverage > 100) | |
1100 | 1125 | else false) | |
1101 | - | then throw(" | |
1126 | + | then throw("You can't borrow in this pool") | |
1102 | 1127 | else { | |
1103 | - | let $t03429734356 = parseReplenishPmts(i.payments, AId, BId) | |
1104 | - | let pmtA = $t03429734356._1 | |
1105 | - | let pmtB = $t03429734356._2 | |
1106 | - | let user = toString(i.caller) | |
1107 | - | let newPosNum = getNewUserPositionNumber(user) | |
1108 | - | if ((leverage > 100)) | |
1109 | - | then { | |
1110 | - | let borrowAmount = calcBorrowAmount(pmtA, pmtB, AId, BId, leverage, borrowId) | |
1111 | - | let request = makeString([user, pool, toString(pmtA), AId, toString(pmtB), BId, toString(balA), toString(balB), shareId, borrowId, toString(borrowAmount)], ",") | |
1112 | - | let newRequestId = { | |
1113 | - | let @ = invoke(this, "createNewRequest", [request], nil) | |
1114 | - | if ($isInstanceOf(@, "Int")) | |
1115 | - | then @ | |
1116 | - | else throw(($getType(@) + " couldn't be cast to Int")) | |
1117 | - | } | |
1118 | - | if ((newRequestId == newRequestId)) | |
1128 | + | let $t03539835488 = getPoolData(Address(fromBase58String(pool)), pType) | |
1129 | + | let AId = $t03539835488._1 | |
1130 | + | let BId = $t03539835488._2 | |
1131 | + | let balA = $t03539835488._3 | |
1132 | + | let balB = $t03539835488._4 | |
1133 | + | let shareId = $t03539835488._5 | |
1134 | + | if (if ((borrowId != AId)) | |
1135 | + | then (borrowId != BId) | |
1136 | + | else false) | |
1137 | + | then throw("Wrong borrow asset") | |
1138 | + | else { | |
1139 | + | let $t03556935628 = parseReplenishPmts(i.payments, AId, BId) | |
1140 | + | let pmtA = $t03556935628._1 | |
1141 | + | let pmtB = $t03556935628._2 | |
1142 | + | let user = toString(i.caller) | |
1143 | + | let newPosNum = getNewUserPositionNumber(user) | |
1144 | + | if ((leverage > 100)) | |
1119 | 1145 | then { | |
1120 | - | let args = [((user + "_") + toString(newPosNum)), shareId, borrowId, borrowAmount, toString(this), "replenishFromLand", toString(valueOrErrorMessage(newRequestId, "Can't create new request"))] | |
1121 | - | let inv = reentrantInvoke(getLendSrvAddr(), "flashPosition", args, nil) | |
1122 | - | if ((inv == inv)) | |
1146 | + | let borrowAmount = calcBorrowAmount(pmtA, pmtB, AId, BId, leverage, borrowId) | |
1147 | + | let request = makeString([user, pool, toString(pmtA), AId, toString(pmtB), BId, toString(balA), toString(balB), shareId, borrowId, toString(borrowAmount)], ",") | |
1148 | + | let newRequestId = { | |
1149 | + | let @ = invoke(this, "createNewRequest", [request], nil) | |
1150 | + | if ($isInstanceOf(@, "Int")) | |
1151 | + | then @ | |
1152 | + | else throw(($getType(@) + " couldn't be cast to Int")) | |
1153 | + | } | |
1154 | + | if ((newRequestId == newRequestId)) | |
1123 | 1155 | then { | |
1124 | - | let | |
1125 | - | let | |
1126 | - | if (( | |
1156 | + | let args = [((user + "_") + toString(newPosNum)), shareId, borrowId, borrowAmount, toString(this), "replenishFromLand", toString(valueOrErrorMessage(newRequestId, "Can't create new request"))] | |
1157 | + | let inv = reentrantInvoke(getLendSrvAddr(), "flashPosition", args, nil) | |
1158 | + | if ((inv == inv)) | |
1127 | 1159 | then { | |
1128 | - | let newBalB = $t03534535439._2 | |
1129 | - | let newBalA = $t03534535439._1 | |
1130 | - | let prImpact = calcPriceImpact(balA, balB, newBalA, newBalB) | |
1131 | - | let $t03550935624 = calcWithdrawLPFromPoolVirt(Address(fromBase58String(pool)), pType, shareId, userStaked) | |
1132 | - | let wAmountA = $t03550935624._1 | |
1133 | - | let wAmountB = $t03550935624._2 | |
1134 | - | $Tuple2(nil, [prImpact, wAmountA, wAmountB]) | |
1160 | + | let userStaked = getIntegerValue(this, (((((pool + "_") + user) + "_") + toString(newPosNum)) + kUserPosition)) | |
1161 | + | let $t03661736711 = getPoolBalances(Address(fromBase58String(pool)), pType, AId, BId) | |
1162 | + | if (($t03661736711 == $t03661736711)) | |
1163 | + | then { | |
1164 | + | let newBalB = $t03661736711._2 | |
1165 | + | let newBalA = $t03661736711._1 | |
1166 | + | let prImpact = calcPriceImpact(balA, balB, newBalA, newBalB) | |
1167 | + | let $t03678136896 = calcWithdrawLPFromPoolVirt(Address(fromBase58String(pool)), pType, shareId, userStaked) | |
1168 | + | let wAmountA = $t03678136896._1 | |
1169 | + | let wAmountB = $t03678136896._2 | |
1170 | + | $Tuple2(nil, [prImpact, wAmountA, wAmountB]) | |
1171 | + | } | |
1172 | + | else throw("Strict value is not equal to itself.") | |
1135 | 1173 | } | |
1136 | 1174 | else throw("Strict value is not equal to itself.") | |
1137 | 1175 | } | |
1138 | 1176 | else throw("Strict value is not equal to itself.") | |
1139 | 1177 | } | |
1140 | - | else throw("Strict value is not equal to itself.") | |
1141 | - | } | |
1142 | - | else { | |
1143 | - | let $t03567735792 = replenishByType(pType, pool, NO_LOAN_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId) | |
1144 | - | if (($t03567735792 == $t03567735792)) | |
1145 | - | then { | |
1146 | - | let axlyFee = $t03567735792._2 | |
1147 | - | let userStaked = $t03567735792._1 | |
1148 | - | let $t03579835892 = getPoolBalances(Address(fromBase58String(pool)), pType, AId, BId) | |
1149 | - | if (($t03579835892 == $t03579835892)) | |
1178 | + | else { | |
1179 | + | let $t03694937064 = replenishByType(pType, pool, NO_LOAN_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId) | |
1180 | + | if (($t03694937064 == $t03694937064)) | |
1150 | 1181 | then { | |
1151 | - | let newBalB = $t03579835892._2 | |
1152 | - | let newBalA = $t03579835892._1 | |
1153 | - | let prImpact = calcPriceImpact(balA, balB, newBalA, newBalB) | |
1154 | - | let $t03596236077 = calcWithdrawLPFromPoolVirt(Address(fromBase58String(pool)), pType, shareId, userStaked) | |
1155 | - | let wAmountA = $t03596236077._1 | |
1156 | - | let wAmountB = $t03596236077._2 | |
1157 | - | $Tuple2((replenishEntries(pool, user, userStaked, axlyFee, newPosNum, shareId, pType, false) ++ getCursEntries(AId, BId, shareId, [toString(wAmountA), toString(wAmountB)])), [prImpact, wAmountA, wAmountB]) | |
1182 | + | let axlyFee = $t03694937064._2 | |
1183 | + | let userStaked = $t03694937064._1 | |
1184 | + | let $t03707037164 = getPoolBalances(Address(fromBase58String(pool)), pType, AId, BId) | |
1185 | + | if (($t03707037164 == $t03707037164)) | |
1186 | + | then { | |
1187 | + | let newBalB = $t03707037164._2 | |
1188 | + | let newBalA = $t03707037164._1 | |
1189 | + | let prImpact = calcPriceImpact(balA, balB, newBalA, newBalB) | |
1190 | + | let $t03723437349 = calcWithdrawLPFromPoolVirt(Address(fromBase58String(pool)), pType, shareId, userStaked) | |
1191 | + | let wAmountA = $t03723437349._1 | |
1192 | + | let wAmountB = $t03723437349._2 | |
1193 | + | $Tuple2((replenishEntries(pool, user, userStaked, axlyFee, newPosNum, shareId, pType, false) ++ getCursEntries(AId, BId, shareId, [toString(wAmountA), toString(wAmountB)])), [prImpact, wAmountA, wAmountB]) | |
1194 | + | } | |
1195 | + | else throw("Strict value is not equal to itself.") | |
1158 | 1196 | } | |
1159 | 1197 | else throw("Strict value is not equal to itself.") | |
1160 | 1198 | } | |
1161 | - | else throw("Strict value is not equal to itself.") | |
1162 | 1199 | } | |
1163 | 1200 | } | |
1164 | - | ||
1201 | + | }) | |
1165 | 1202 | ||
1166 | 1203 | ||
1167 | 1204 | ||
1168 | 1205 | @Callable(i) | |
1169 | - | func withdraw (pool,posId) = valueOrElse(isActiveForUsers(), withdrawToUser(toString(i.caller), pool, toString(posId), false)) | |
1206 | + | func withdraw (pool,posId) = valueOrElse(isActiveForUsers(), { | |
1207 | + | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
1208 | + | if (!(isPoolActive(pool, pType))) | |
1209 | + | then throw("Pool not active at this moment") | |
1210 | + | else withdrawToUser(toString(i.caller), pool, toString(posId), false) | |
1211 | + | }) | |
1170 | 1212 | ||
1171 | 1213 | ||
1172 | 1214 | ||
1173 | 1215 | @Callable(i) | |
1174 | 1216 | func createUpdateStopLoss (posId,poolId,assetId,price) = valueOrElse(isActiveForUsers(), { | |
1175 | 1217 | let tokenOraclePrice = getIntegerValue(priceOracleAddr, (assetId + kPriceInOracle)) | |
1176 | - | if (!(isDefined(getInteger(this, (((((poolId + "_") + toString(i.caller)) + "_") + toString(posId)) + kUserPosition))))) | |
1177 | - | then throw("There are no user position") | |
1178 | - | else if ((0 >= price)) | |
1179 | - | then throw("Price must be greater than 0") | |
1180 | - | else if ((price > tokenOraclePrice)) | |
1181 | - | then throw("Price must be less than current token price") | |
1182 | - | else [IntegerEntry((((((((toString(i.caller) + "_") + toString(posId)) + "_") + poolId) + "_") + assetId) + kUserStopLoss), price)] | |
1218 | + | let pType = valueOrErrorMessage(getString(this, (kPool + poolId)), "Pool is not inited") | |
1219 | + | if (!(isPoolActive(poolId, pType))) | |
1220 | + | then throw("Pool not active at this moment") | |
1221 | + | else if (!(isDefined(getInteger(this, (((((poolId + "_") + toString(i.caller)) + "_") + toString(posId)) + kUserPosition))))) | |
1222 | + | then throw("There are no user position") | |
1223 | + | else if ((0 >= price)) | |
1224 | + | then throw("Price must be greater than 0") | |
1225 | + | else if ((price > tokenOraclePrice)) | |
1226 | + | then throw("Price must be less than current token price") | |
1227 | + | else [IntegerEntry((((((((toString(i.caller) + "_") + toString(posId)) + "_") + poolId) + "_") + assetId) + kUserStopLoss), price)] | |
1183 | 1228 | }) | |
1184 | 1229 | ||
1185 | 1230 | ||
1186 | 1231 | ||
1187 | 1232 | @Callable(i) | |
1188 | - | func deleteStopLoss (posId,poolId,assetId) = valueOrElse(isActiveForUsers(), if (!(isDefined(getInteger(this, (((((((toString(i.caller) + "_") + toString(posId)) + "_") + poolId) + "_") + assetId) + kUserStopLoss))))) | |
1189 | - | then throw("No entry") | |
1190 | - | else [DeleteEntry((((((((toString(i.caller) + "_") + toString(posId)) + "_") + poolId) + "_") + assetId) + kUserStopLoss))]) | |
1233 | + | func deleteStopLoss (posId,poolId,assetId) = valueOrElse(isActiveForUsers(), { | |
1234 | + | let pType = valueOrErrorMessage(getString(this, (kPool + poolId)), "Pool is not inited") | |
1235 | + | if (!(isPoolActive(poolId, pType))) | |
1236 | + | then throw("Pool not active at this moment") | |
1237 | + | else if (!(isDefined(getInteger(this, (((((((toString(i.caller) + "_") + toString(posId)) + "_") + poolId) + "_") + assetId) + kUserStopLoss))))) | |
1238 | + | then throw("No entry") | |
1239 | + | else [DeleteEntry((((((((toString(i.caller) + "_") + toString(posId)) + "_") + poolId) + "_") + assetId) + kUserStopLoss))] | |
1240 | + | }) | |
1191 | 1241 | ||
1192 | 1242 | ||
1193 | 1243 | ||
1194 | 1244 | @Callable(i) | |
1195 | - | func init (moneyBoxAddr,sfFarmingAddr,lendAddr,priceOracleAddr,keeperExContract,wxSwapContract,swopAssetId,wxAssetId,adminPubKey) = if ((toString(i.caller) != "3PG42y6FgT8zM3uX5tEDxJF5rqX8AKGJRAR")) | |
1196 | - | then throw("Only admin can call this function") | |
1197 | - | else if (isDefined(getString(kAdminCallPK))) | |
1198 | - | then throw("Already inited") | |
1199 | - | else [StringEntry(kMoneyBox, moneyBoxAddr), StringEntry(kSFFarmingAddr, sfFarmingAddr), StringEntry(kLendService, lendAddr), StringEntry(kPriceOracle, priceOracleAddr), StringEntry(kExContract, keeperExContract), StringEntry(kWxSwapContract, wxSwapContract), StringEntry(kSwopId, swopAssetId), StringEntry(kWxId, wxAssetId), StringEntry(kAdminCallPK, adminPubKey)] | |
1245 | + | func init (moneyBoxAddr,sfFarmingAddr,lendAddr,priceOracleAddr,keeperExContract,wxSwapContract,swopAssetId,wxAssetId,adminPubKey) = valueOrElse(isSelfCall(i), if (isDefined(getString(kAdminCallPK))) | |
1246 | + | then throw("Already inited") | |
1247 | + | else if (!(isDefined(addressFromString(moneyBoxAddr)))) | |
1248 | + | then throw("moneyBoxAddr is not correct address") | |
1249 | + | else if (!(isDefined(addressFromString(sfFarmingAddr)))) | |
1250 | + | then throw("sfFarmingAddr is not correct address") | |
1251 | + | else if (!(isDefined(addressFromString(lendAddr)))) | |
1252 | + | then throw("lendAddr is not correct address") | |
1253 | + | else if (!(isDefined(addressFromString(priceOracleAddr)))) | |
1254 | + | then throw("priceOracleAddr is not correct address") | |
1255 | + | else if (!(isDefined(addressFromString(keeperExContract)))) | |
1256 | + | then throw("keeperExContract is not correct address") | |
1257 | + | else if (!(isDefined(assetInfo(fromBase58String(swopAssetId))))) | |
1258 | + | then throw("swopAssetId is not correct asset id") | |
1259 | + | else if (!(isDefined(assetInfo(fromBase58String(wxAssetId))))) | |
1260 | + | then throw("swopAssetId is not correct asset id") | |
1261 | + | else if ((size(fromBase58String(adminPubKey)) != 32)) | |
1262 | + | then throw("adminPubKey is not correct") | |
1263 | + | else [StringEntry(kMoneyBox, moneyBoxAddr), StringEntry(kSFFarmingAddr, sfFarmingAddr), StringEntry(kLendService, lendAddr), StringEntry(kPriceOracle, priceOracleAddr), StringEntry(kExContract, keeperExContract), StringEntry(kWxSwapContract, wxSwapContract), StringEntry(kSwopId, swopAssetId), StringEntry(kWxId, wxAssetId), StringEntry(kAdminCallPK, adminPubKey)]) | |
1200 | 1264 | ||
1201 | 1265 | ||
1202 | 1266 | ||
1210 | 1274 | ||
1211 | 1275 | @Callable(i) | |
1212 | 1276 | func replenishFromLand (requestId) = valueOrElse(isActive(), valueOrElse(isLandCall(i), { | |
1213 | - | let $ | |
1214 | - | let user = $ | |
1215 | - | let pool = $ | |
1216 | - | let pmtA = $ | |
1217 | - | let AId = $ | |
1218 | - | let pmtB = $ | |
1219 | - | let BId = $ | |
1220 | - | let balA = $ | |
1221 | - | let balB = $ | |
1222 | - | let shareId = $ | |
1223 | - | let bwAsset = $ | |
1224 | - | let bwAmount = $ | |
1277 | + | let $t04139841502 = parseRequest(requestId) | |
1278 | + | let user = $t04139841502._1 | |
1279 | + | let pool = $t04139841502._2 | |
1280 | + | let pmtA = $t04139841502._3 | |
1281 | + | let AId = $t04139841502._4 | |
1282 | + | let pmtB = $t04139841502._5 | |
1283 | + | let BId = $t04139841502._6 | |
1284 | + | let balA = $t04139841502._7 | |
1285 | + | let balB = $t04139841502._8 | |
1286 | + | let shareId = $t04139841502._9 | |
1287 | + | let bwAsset = $t04139841502._10 | |
1288 | + | let bwAmount = $t04139841502._11 | |
1225 | 1289 | if ((size(i.payments) != 1)) | |
1226 | 1290 | then throw("Wrong payment size") | |
1227 | 1291 | else if (if ((assetIdToStr(i.payments[0].assetId) != bwAsset)) | |
1229 | 1293 | else (i.payments[0].amount != bwAmount)) | |
1230 | 1294 | then throw("Wrong payment") | |
1231 | 1295 | else { | |
1232 | - | let $ | |
1296 | + | let $t04169241792 = if ((AId == bwAsset)) | |
1233 | 1297 | then $Tuple2((pmtA + bwAmount), pmtB) | |
1234 | 1298 | else $Tuple2(pmtA, (pmtB + bwAmount)) | |
1235 | - | let pmtAllA = $ | |
1236 | - | let pmtAllB = $ | |
1299 | + | let pmtAllA = $t04169241792._1 | |
1300 | + | let pmtAllB = $t04169241792._2 | |
1237 | 1301 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Unknown pool") | |
1238 | - | let $ | |
1239 | - | let userStaked = $ | |
1240 | - | let axlyFee = $ | |
1302 | + | let $t04187441989 = replenishByType(pType, pool, LOAN_FEE, pmtAllA, AId, pmtAllB, BId, balA, balB, shareId) | |
1303 | + | let userStaked = $t04187441989._1 | |
1304 | + | let axlyFee = $t04187441989._2 | |
1241 | 1305 | let posNum = getNewUserPositionNumber(user) | |
1242 | 1306 | let borrowEntries = [IntegerEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserBorrowAmount), bwAmount), StringEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserBorrowAssetId), bwAsset)] | |
1243 | 1307 | let entries = replenishEntries(pool, user, userStaked, axlyFee, posNum, shareId, pType, true) | |
1244 | - | let $ | |
1245 | - | let wAmountA = $ | |
1246 | - | let wAmountB = $ | |
1308 | + | let $t04234942464 = calcWithdrawLPFromPoolVirt(Address(fromBase58String(pool)), pType, shareId, userStaked) | |
1309 | + | let wAmountA = $t04234942464._1 | |
1310 | + | let wAmountB = $t04234942464._2 | |
1247 | 1311 | $Tuple2((((entries ++ getCursEntries(AId, BId, shareId, [toString(wAmountA), toString(wAmountB)])) ++ borrowEntries) :+ DeleteEntry((requestId + kRequestId))), userStaked) | |
1248 | 1312 | } | |
1249 | 1313 | })) | |
1254 | 1318 | func liquidate (user,posId,liquidateAmount) = valueOrElse(isActive(), valueOrElse(isLandCall(i), { | |
1255 | 1319 | let pool = valueOrErrorMessage(getString(this, (((user + "_") + posId) + kUserPositionPool)), "no position") | |
1256 | 1320 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
1257 | - | let $ | |
1258 | - | let AId = $ | |
1259 | - | let BId = $ | |
1260 | - | let balA = $ | |
1261 | - | let balB = $ | |
1262 | - | let shareId = $ | |
1321 | + | let $t04298543075 = getPoolData(Address(fromBase58String(pool)), pType) | |
1322 | + | let AId = $t04298543075._1 | |
1323 | + | let BId = $t04298543075._2 | |
1324 | + | let balA = $t04298543075._3 | |
1325 | + | let balB = $t04298543075._4 | |
1326 | + | let shareId = $t04298543075._5 | |
1263 | 1327 | let amount = unstakeLP(pool, pType, shareId, liquidateAmount) | |
1264 | 1328 | let borrowAmount = getIntegerValue(this, (((((pool + "_") + user) + "_") + posId) + kUserBorrowAmount)) | |
1265 | 1329 | let borrowAsset = getStringValue(this, (((((pool + "_") + user) + "_") + posId) + kUserBorrowAssetId)) | |
1276 | 1340 | @Callable(i) | |
1277 | 1341 | func stopLoss (user,posId,pool,assetId) = valueOrElse(isActive(), valueOrElse(isAdminCall(i), { | |
1278 | 1342 | let tokenOraclePrice = getIntegerValue(priceOracleAddr, (assetId + kPriceInOracle)) | |
1279 | - | if ((tokenOraclePrice > tokenOraclePrice)) | |
1343 | + | let stopLossPrice = valueOrErrorMessage(getInteger(this, (((((((user + "_") + toString(posId)) + "_") + pool) + "_") + assetId) + kUserStopLoss)), "No entry") | |
1344 | + | if ((tokenOraclePrice > stopLossPrice)) | |
1280 | 1345 | then throw("Token price greater stop loss price") | |
1281 | - | else if (!(isDefined(getInteger(this, (((((((user + "_") + toString(posId)) + "_") + pool) + "_") + assetId) + kUserStopLoss))))) | |
1282 | - | then throw("No entry") | |
1283 | - | else { | |
1284 | - | let res = withdrawToUser(user, pool, toString(posId), true) | |
1285 | - | $Tuple2((res._1 :+ DeleteEntry((((((((user + "_") + toString(posId)) + "_") + pool) + "_") + assetId) + kUserStopLoss))), res._2) | |
1286 | - | } | |
1346 | + | else { | |
1347 | + | let res = withdrawToUser(user, pool, toString(posId), true) | |
1348 | + | $Tuple2((res._1 :+ DeleteEntry((((((((user + "_") + toString(posId)) + "_") + pool) + "_") + assetId) + kUserStopLoss))), res._2) | |
1349 | + | } | |
1287 | 1350 | })) | |
1288 | 1351 | ||
1289 | 1352 | ||
1292 | 1355 | func capitalizeExKeeper (pool,tokenToId,amountToExchange,claim,amountsIn,addresses,assetsToReceive,estReceived,slippageTolerance,minReceived,options) = valueOrElse(isActive(), valueOrElse(isAdminCall(i), { | |
1293 | 1356 | let pType = getStringValue(this, (kPool + pool)) | |
1294 | 1357 | let change = valueOrElse(getInteger(this, (pool + kPoolCapChange)), 0) | |
1295 | - | let $ | |
1296 | - | let claimedAmount = $ | |
1297 | - | let claimedAsset = $ | |
1358 | + | let $t04521845319 = claimAndCheckAmntEx(pool, pType, claim, amountToExchange, change) | |
1359 | + | let claimedAmount = $t04521845319._1 | |
1360 | + | let claimedAsset = $t04521845319._2 | |
1298 | 1361 | let exchangedAmount = exchangeKeeper(tokenToId, amountToExchange, claimedAsset, amountsIn, addresses, assetsToReceive, estReceived, slippageTolerance, minReceived, options) | |
1299 | 1362 | let newChange = ((claimedAmount + change) - amountToExchange) | |
1300 | 1363 | let changeEntry = if ((newChange >= 0)) | |
1309 | 1372 | func capitalizeExPuzzle (pool,tokenToId,amountToExchange,claim,routesStr,minToReceive,options) = valueOrElse(isActive(), valueOrElse(isAdminCall(i), { | |
1310 | 1373 | let pType = getStringValue(this, (kPool + pool)) | |
1311 | 1374 | let change = valueOrElse(getInteger(this, (pool + kPoolCapChange)), 0) | |
1312 | - | let $ | |
1313 | - | let claimedAmount = $ | |
1314 | - | let claimedAsset = $ | |
1375 | + | let $t04609446195 = claimAndCheckAmntEx(pool, pType, claim, amountToExchange, change) | |
1376 | + | let claimedAmount = $t04609446195._1 | |
1377 | + | let claimedAsset = $t04609446195._2 | |
1315 | 1378 | let exchangedAmount = exchangePuzzle(tokenToId, amountToExchange, claimedAsset, routesStr, minToReceive, options) | |
1316 | 1379 | let newChange = ((claimedAmount + change) - amountToExchange) | |
1317 | 1380 | let changeEntry = if ((newChange >= 0)) | |
1326 | 1389 | func capitalizeExSwopFi (pool,tokenToId,amountToExchange,claim,exchangers,exchangersType,args1,args2,routingAssetsKeys,minAmountToReceive,options) = valueOrElse(isActive(), valueOrElse(isAdminCall(i), { | |
1327 | 1390 | let pType = getStringValue(this, (kPool + pool)) | |
1328 | 1391 | let change = valueOrElse(getInteger(this, (pool + kPoolCapChange)), 0) | |
1329 | - | let $ | |
1330 | - | let claimedAmount = $ | |
1331 | - | let claimedAsset = $ | |
1392 | + | let $t04703747138 = claimAndCheckAmntEx(pool, pType, claim, amountToExchange, change) | |
1393 | + | let claimedAmount = $t04703747138._1 | |
1394 | + | let claimedAsset = $t04703747138._2 | |
1332 | 1395 | let exchangedAmount = exchangeSwopFi(tokenToId, amountToExchange, claimedAsset, exchangers, exchangersType, args1, args2, routingAssetsKeys, minAmountToReceive, options) | |
1333 | 1396 | let newChange = ((claimedAmount + change) - amountToExchange) | |
1334 | 1397 | let changeEntry = if ((newChange >= 0)) | |
1345 | 1408 | else false) | |
1346 | 1409 | then throw("Wrong type") | |
1347 | 1410 | else { | |
1348 | - | let $ | |
1349 | - | let aId = $ | |
1350 | - | let bId = $ | |
1351 | - | let aBal = $ | |
1352 | - | let bBal = $ | |
1353 | - | let shareId = $ | |
1411 | + | let $t04786947963 = getPoolData(Address(fromBase58String(poolAddr)), type) | |
1412 | + | let aId = $t04786947963._1 | |
1413 | + | let bId = $t04786947963._2 | |
1414 | + | let aBal = $t04786947963._3 | |
1415 | + | let bBal = $t04786947963._4 | |
1416 | + | let shareId = $t04786947963._5 | |
1354 | 1417 | if ((0 > inFeeNoLoan)) | |
1355 | 1418 | then throw("inFeeNoLoan must be greater than 0") | |
1356 | 1419 | else if ((0 > inFeeLoan)) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let SF_POOL = "SF" | |
5 | 5 | ||
6 | 6 | let WX_POOL = "WX" | |
7 | 7 | ||
8 | 8 | let CAP_FEE_NO_LOAN = "capNoLoan" | |
9 | 9 | ||
10 | 10 | let CAP_FEE_LOAN = "capLoan" | |
11 | 11 | ||
12 | 12 | let STOPLOSS_FEE_NO_LOAN = "stopLossNoLoan" | |
13 | 13 | ||
14 | 14 | let STOPLOSS_LOAN = "stopLossLoan" | |
15 | 15 | ||
16 | 16 | let LOAN_FEE = "loan" | |
17 | 17 | ||
18 | 18 | let NO_LOAN_FEE = "noLoan" | |
19 | 19 | ||
20 | 20 | let NO_FEE = "noFee" | |
21 | 21 | ||
22 | 22 | let SCALE8 = 100000000 | |
23 | 23 | ||
24 | 24 | let SCALE10 = 10000000000 | |
25 | 25 | ||
26 | 26 | let SCALE16 = toBigInt(10000000000000000) | |
27 | 27 | ||
28 | 28 | let FEE_SCALE6 = 1000000 | |
29 | 29 | ||
30 | 30 | let kSFPoolAAssetBalance = "A_asset_balance" | |
31 | 31 | ||
32 | 32 | let kSFPoolBAssetBalance = "B_asset_balance" | |
33 | 33 | ||
34 | 34 | let kSFPoolAAssetId = "A_asset_id" | |
35 | 35 | ||
36 | 36 | let kSFPoolBAssetId = "B_asset_id" | |
37 | 37 | ||
38 | 38 | let kSFPoolShareId = "share_asset_id" | |
39 | 39 | ||
40 | 40 | let kSFPoolShareSupply = "share_asset_supply" | |
41 | 41 | ||
42 | 42 | let kSFPoolFee = "commission" | |
43 | 43 | ||
44 | 44 | let kUserPosition = "_userPosition" | |
45 | 45 | ||
46 | 46 | let kUserPositionPool = "_userPositionPool" | |
47 | 47 | ||
48 | 48 | let kUserBorrowAmount = "_userPositionBorrowAmount" | |
49 | 49 | ||
50 | 50 | let kUserBorrowAssetId = "_userPositionBorrowAssetId" | |
51 | 51 | ||
52 | 52 | let kUserPositionNum = "_userPositionNumber" | |
53 | 53 | ||
54 | 54 | let kUserPositionInterest = "_userPositionInterest" | |
55 | 55 | ||
56 | 56 | let kPoolTotal = "_poolTotal" | |
57 | 57 | ||
58 | 58 | let kPoolTotalLoan = "_poolTotalLoan" | |
59 | 59 | ||
60 | 60 | let kPoolInterestLoan = "_poolInterestLoan" | |
61 | 61 | ||
62 | 62 | let kPoolInterestNoLoan = "_poolInterestNoLoan" | |
63 | 63 | ||
64 | 64 | let kPoolCanBorrow = "_poolCanBorrow" | |
65 | 65 | ||
66 | 66 | let kAxlyInFeeWithoutLoan = "_axlyFeeNoLoan" | |
67 | 67 | ||
68 | 68 | let kAxlyInFeeWithLoan = "_axlyFeeWithLoan" | |
69 | 69 | ||
70 | 70 | let kAxlyNoLoanCapFee = "_axlyFeeCapWithLoan" | |
71 | 71 | ||
72 | 72 | let kAxlyWithLoanCapFee = "_axlyFeeCapNoLoan" | |
73 | 73 | ||
74 | 74 | let kAxlyStopLossNoLoanFee = "_axlyFeeStoplossWithLoan" | |
75 | 75 | ||
76 | 76 | let kAxlyStopLossLoanFee = "_axlyFeeStoplossNoLoan" | |
77 | 77 | ||
78 | 78 | let kRequestId = "_request_id" | |
79 | 79 | ||
80 | 80 | let kRequestIter = "requests_iter" | |
81 | 81 | ||
82 | 82 | let kPool = "pool_" | |
83 | 83 | ||
84 | 84 | let kSharePool = "_poolShareId" | |
85 | 85 | ||
86 | 86 | let kPoolCapChange = "_poolCapChange" | |
87 | 87 | ||
88 | 88 | let kTokenLastPrice = "last_price" | |
89 | 89 | ||
90 | 90 | let kPriceInOracle = "_twap5B" | |
91 | 91 | ||
92 | 92 | let kActive = "active" | |
93 | 93 | ||
94 | 94 | let kActiveUsers = "activeUsers" | |
95 | 95 | ||
96 | 96 | let kActiveSFWX = "_active" | |
97 | 97 | ||
98 | 98 | let kPoolActive = "_activePool" | |
99 | 99 | ||
100 | 100 | let kUserStopLoss = "_stopLoss" | |
101 | 101 | ||
102 | 102 | let kMoneyBox = "axly_money_box" | |
103 | 103 | ||
104 | 104 | let kSFFarmingAddr = "swopfi_farming_addr" | |
105 | 105 | ||
106 | 106 | let kLendService = "lend_service_addr" | |
107 | 107 | ||
108 | 108 | let kAdminCallPK = "admin_call_pub_key" | |
109 | 109 | ||
110 | 110 | let kPriceOracle = "price_oracle" | |
111 | 111 | ||
112 | 112 | let kExContract = "exchange_contract" | |
113 | 113 | ||
114 | 114 | let kWxSwapContract = "wx_swap_contract" | |
115 | 115 | ||
116 | 116 | let kSwopId = "swop_id" | |
117 | 117 | ||
118 | 118 | let kWxId = "wx_id" | |
119 | 119 | ||
120 | 120 | let moneyBox = Address(fromBase58String(valueOrErrorMessage(getString(this, kMoneyBox), "No axly moneyBox address"))) | |
121 | 121 | ||
122 | 122 | let exContract = Address(fromBase58String(valueOrErrorMessage(getString(this, kExContract), "No exchange contract address"))) | |
123 | 123 | ||
124 | 124 | let priceOracleAddr = Address(fromBase58String(valueOrErrorMessage(getString(this, kPriceOracle), "No price oracle address"))) | |
125 | 125 | ||
126 | 126 | let wxSwapContract = Address(fromBase58String(valueOrErrorMessage(getString(this, kWxSwapContract), "No wx swap address"))) | |
127 | 127 | ||
128 | 128 | let SWOPID = fromBase58String(valueOrErrorMessage(getString(this, kSwopId), "No swop id")) | |
129 | 129 | ||
130 | 130 | let WXID = fromBase58String(valueOrErrorMessage(getString(this, kWxId), "No wx id")) | |
131 | 131 | ||
132 | 132 | func unknownPoolType () = throw("Wrong pool type") | |
133 | 133 | ||
134 | 134 | ||
135 | 135 | func getLendSrvAddr () = Address(fromBase58String(valueOrErrorMessage(getString(this, kLendService), "Can't get lend service addr"))) | |
136 | 136 | ||
137 | 137 | ||
138 | 138 | func getAdminCallAddr () = addressFromPublicKey(fromBase58String(valueOrErrorMessage(getString(this, kAdminCallPK), "Can't get admin addr"))) | |
139 | 139 | ||
140 | 140 | ||
141 | 141 | func isAdminCall (i) = if ((i.caller == getAdminCallAddr())) | |
142 | 142 | then unit | |
143 | 143 | else throw("Only admin can call this function") | |
144 | 144 | ||
145 | 145 | ||
146 | 146 | func isSelfCall (i) = if ((i.caller == this)) | |
147 | 147 | then unit | |
148 | 148 | else throw("Only contract itself can call this function") | |
149 | 149 | ||
150 | 150 | ||
151 | 151 | func isLandCall (i) = if ((i.caller == getLendSrvAddr())) | |
152 | 152 | then unit | |
153 | 153 | else throw("Only land contract can call this function") | |
154 | 154 | ||
155 | 155 | ||
156 | 156 | func isActive () = if ((valueOrElse(getBoolean(this, kActive), true) == true)) | |
157 | 157 | then unit | |
158 | 158 | else throw("DApp is inactive at this moment") | |
159 | 159 | ||
160 | 160 | ||
161 | 161 | func isActiveForUsers () = if (if (valueOrElse(getBoolean(this, kActive), true)) | |
162 | 162 | then (valueOrElse(getBoolean(this, kActiveUsers), true) == true) | |
163 | 163 | else false) | |
164 | 164 | then unit | |
165 | 165 | else throw("DApp is inactive for users at this moment") | |
166 | 166 | ||
167 | 167 | ||
168 | 168 | func isPoolActive (pool,type) = { | |
169 | 169 | let WXSFActive = valueOrElse(getBoolean(this, (type + kActiveSFWX)), true) | |
170 | 170 | let poolActive = valueOrElse(getBoolean(this, (pool + kPoolActive)), true) | |
171 | 171 | if (if (WXSFActive) | |
172 | 172 | then poolActive | |
173 | 173 | else false) | |
174 | 174 | then true | |
175 | 175 | else false | |
176 | 176 | } | |
177 | 177 | ||
178 | 178 | ||
179 | 179 | func accountBalance (assetId) = match assetId { | |
180 | 180 | case id: ByteVector => | |
181 | 181 | assetBalance(this, id) | |
182 | 182 | case waves: Unit => | |
183 | 183 | wavesBalance(this).available | |
184 | 184 | case _ => | |
185 | 185 | throw("Match error") | |
186 | 186 | } | |
187 | 187 | ||
188 | 188 | ||
189 | 189 | func getSFPoolBalances (poolAddr) = $Tuple2(valueOrErrorMessage(getInteger(poolAddr, kSFPoolAAssetBalance), "Can't get pool A asset balance"), valueOrErrorMessage(getInteger(poolAddr, kSFPoolBAssetBalance), "Can't get pool B asset balance")) | |
190 | 190 | ||
191 | 191 | ||
192 | 192 | func getWXPoolBalances (poolAddr,aId,bId) = $Tuple2({ | |
193 | 193 | let @ = invoke(poolAddr, "getAccBalanceWrapperREADONLY", [aId], nil) | |
194 | 194 | if ($isInstanceOf(@, "Int")) | |
195 | 195 | then @ | |
196 | 196 | else throw(($getType(@) + " couldn't be cast to Int")) | |
197 | 197 | }, { | |
198 | 198 | let @ = invoke(poolAddr, "getAccBalanceWrapperREADONLY", [bId], nil) | |
199 | 199 | if ($isInstanceOf(@, "Int")) | |
200 | 200 | then @ | |
201 | 201 | else throw(($getType(@) + " couldn't be cast to Int")) | |
202 | 202 | }) | |
203 | 203 | ||
204 | 204 | ||
205 | 205 | func getPoolBalances (poolAddr,type,aId,bId) = if ((type == SF_POOL)) | |
206 | 206 | then getSFPoolBalances(poolAddr) | |
207 | 207 | else if ((type == WX_POOL)) | |
208 | 208 | then getWXPoolBalances(poolAddr, aId, bId) | |
209 | 209 | else unknownPoolType() | |
210 | 210 | ||
211 | 211 | ||
212 | 212 | func getSFPoolData (poolAddr) = { | |
213 | 213 | let $t070647113 = getSFPoolBalances(poolAddr) | |
214 | 214 | if (($t070647113 == $t070647113)) | |
215 | 215 | then { | |
216 | 216 | let balB = $t070647113._2 | |
217 | 217 | let balA = $t070647113._1 | |
218 | 218 | $Tuple5(valueOrErrorMessage(getString(poolAddr, kSFPoolAAssetId), "Can't get pool A asset id"), valueOrErrorMessage(getString(poolAddr, kSFPoolBAssetId), "Can't get pool B asset id"), balA, balB, valueOrErrorMessage(getString(poolAddr, kSFPoolShareId), "Can't get share asset id")) | |
219 | 219 | } | |
220 | 220 | else throw("Strict value is not equal to itself.") | |
221 | 221 | } | |
222 | 222 | ||
223 | 223 | ||
224 | 224 | func getWXPoolData (poolAddr) = { | |
225 | 225 | let cfg = { | |
226 | 226 | let @ = invoke(poolAddr, "getPoolConfigWrapperREADONLY", nil, nil) | |
227 | 227 | if ($isInstanceOf(@, "List[Any]")) | |
228 | 228 | then @ | |
229 | 229 | else throw(($getType(@) + " couldn't be cast to List[Any]")) | |
230 | 230 | } | |
231 | 231 | if ((cfg == cfg)) | |
232 | 232 | then { | |
233 | 233 | let aId = valueOrErrorMessage({ | |
234 | 234 | let @ = cfg[4] | |
235 | 235 | if ($isInstanceOf(@, "String")) | |
236 | 236 | then @ | |
237 | 237 | else unit | |
238 | 238 | }, "Can't get pool A asset id") | |
239 | 239 | let bId = valueOrErrorMessage({ | |
240 | 240 | let @ = cfg[5] | |
241 | 241 | if ($isInstanceOf(@, "String")) | |
242 | 242 | then @ | |
243 | 243 | else unit | |
244 | 244 | }, "Can't get pool B asset id") | |
245 | 245 | let shareId = valueOrErrorMessage({ | |
246 | 246 | let @ = cfg[3] | |
247 | 247 | if ($isInstanceOf(@, "String")) | |
248 | 248 | then @ | |
249 | 249 | else unit | |
250 | 250 | }, "Can't get pool LP asset id") | |
251 | 251 | let $t078107869 = getWXPoolBalances(poolAddr, aId, bId) | |
252 | 252 | if (($t078107869 == $t078107869)) | |
253 | 253 | then { | |
254 | 254 | let balB = $t078107869._2 | |
255 | 255 | let balA = $t078107869._1 | |
256 | 256 | $Tuple5(aId, bId, balA, balB, shareId) | |
257 | 257 | } | |
258 | 258 | else throw("Strict value is not equal to itself.") | |
259 | 259 | } | |
260 | 260 | else throw("Strict value is not equal to itself.") | |
261 | 261 | } | |
262 | 262 | ||
263 | 263 | ||
264 | 264 | func getPoolData (poolAddr,type) = if ((type == SF_POOL)) | |
265 | 265 | then getSFPoolData(poolAddr) | |
266 | 266 | else if ((type == WX_POOL)) | |
267 | 267 | then getWXPoolData(poolAddr) | |
268 | 268 | else unknownPoolType() | |
269 | 269 | ||
270 | 270 | ||
271 | 271 | func getShareSupply (poolAddr,type,shareId) = if ((type == SF_POOL)) | |
272 | 272 | then valueOrErrorMessage(getInteger(poolAddr, kSFPoolShareSupply), "Can't get share asset supply") | |
273 | 273 | else if ((type == WX_POOL)) | |
274 | 274 | then valueOrErrorMessage(assetInfo(fromBase58String(shareId)), "Wrong ShareId").quantity | |
275 | 275 | else unknownPoolType() | |
276 | 276 | ||
277 | 277 | ||
278 | 278 | func getPoolTotalShare (pool) = valueOrElse(getInteger(this, (pool + kPoolTotal)), 0) | |
279 | 279 | ||
280 | 280 | ||
281 | 281 | func getPoolTotalShareWithLoan (pool) = valueOrElse(getInteger(this, (pool + kPoolTotalLoan)), 0) | |
282 | 282 | ||
283 | 283 | ||
284 | 284 | func getNewUserPositionNumber (user) = (valueOrElse(getInteger(this, (user + kUserPositionNum)), 0) + 1) | |
285 | 285 | ||
286 | 286 | ||
287 | 287 | func getAxlyFee (pool,feeType) = if ((feeType == CAP_FEE_LOAN)) | |
288 | 288 | then getIntegerValue(this, (pool + kAxlyWithLoanCapFee)) | |
289 | 289 | else if ((feeType == CAP_FEE_NO_LOAN)) | |
290 | 290 | then getIntegerValue(this, (pool + kAxlyNoLoanCapFee)) | |
291 | 291 | else if ((feeType == LOAN_FEE)) | |
292 | 292 | then getIntegerValue(this, (pool + kAxlyInFeeWithLoan)) | |
293 | 293 | else if ((feeType == NO_LOAN_FEE)) | |
294 | 294 | then getIntegerValue(this, (pool + kAxlyInFeeWithoutLoan)) | |
295 | 295 | else if ((feeType == NO_FEE)) | |
296 | 296 | then 0 | |
297 | 297 | else throw("Wrong fee type") | |
298 | 298 | ||
299 | 299 | ||
300 | 300 | func getSFFarmingAddr () = Address(fromBase58String(valueOrErrorMessage(getString(this, kSFFarmingAddr), "Can't get swopfi farming addr"))) | |
301 | 301 | ||
302 | 302 | ||
303 | 303 | func getWXFarmingAddr (poolAddr) = { | |
304 | 304 | let fContract = Address(fromBase58String(valueOrErrorMessage(getString(poolAddr, "%s__factoryContract"), "Can't get WX factory contract addr"))) | |
305 | 305 | let factroyCfg = split(valueOrErrorMessage(getString(fContract, "%s__factoryConfig"), "Can't get WX factory cfg"), "__") | |
306 | 306 | Address(fromBase58String(factroyCfg[1])) | |
307 | 307 | } | |
308 | 308 | ||
309 | 309 | ||
310 | 310 | func assetIdToStr (assetId) = match assetId { | |
311 | 311 | case id: ByteVector => | |
312 | 312 | toBase58String(id) | |
313 | 313 | case waves: Unit => | |
314 | 314 | "WAVES" | |
315 | 315 | case _ => | |
316 | 316 | throw("Not Asset id") | |
317 | 317 | } | |
318 | 318 | ||
319 | 319 | ||
320 | 320 | func assetIdFromStr (assetId) = if ((assetId == "WAVES")) | |
321 | 321 | then unit | |
322 | 322 | else fromBase58String(assetId) | |
323 | 323 | ||
324 | 324 | ||
325 | 325 | func getAssetDecimals (assetId) = if ((assetId == "WAVES")) | |
326 | 326 | then 8 | |
327 | 327 | else match assetInfo(fromBase58String(assetId)) { | |
328 | 328 | case asset: Asset => | |
329 | 329 | asset.decimals | |
330 | 330 | case _ => | |
331 | 331 | throw("Can't find asset") | |
332 | 332 | } | |
333 | 333 | ||
334 | 334 | ||
335 | 335 | func getAssetPrecition (assetId) = pow(10, 0, getAssetDecimals(assetId), 0, 0, DOWN) | |
336 | 336 | ||
337 | 337 | ||
338 | 338 | func getAssetsPrice (assetIds) = { | |
339 | 339 | func getPrices (a,assetId) = { | |
340 | 340 | let assetPrice = getIntegerValue(priceOracleAddr, (assetId + kPriceInOracle)) | |
341 | 341 | (a :+ assetPrice) | |
342 | 342 | } | |
343 | 343 | ||
344 | 344 | let $l = assetIds | |
345 | 345 | let $s = size($l) | |
346 | 346 | let $acc0 = nil | |
347 | 347 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
348 | 348 | then $a | |
349 | 349 | else getPrices($a, $l[$i]) | |
350 | 350 | ||
351 | 351 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
352 | 352 | then $a | |
353 | 353 | else throw("List size exceeds 50") | |
354 | 354 | ||
355 | 355 | $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($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($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), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50) | |
356 | 356 | } | |
357 | 357 | ||
358 | 358 | ||
359 | 359 | func getSharePrice (shareId) = { | |
360 | 360 | let pool = valueOrErrorMessage(getString(this, (shareId + kSharePool)), "Can't find pool addr by share id") | |
361 | 361 | let poolAddr = Address(fromBase58String(pool)) | |
362 | 362 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
363 | 363 | let $t01084710912 = getPoolData(poolAddr, pType) | |
364 | 364 | let aId = $t01084710912._1 | |
365 | 365 | let bId = $t01084710912._2 | |
366 | 366 | let aBalance = $t01084710912._3 | |
367 | 367 | let bBalance = $t01084710912._4 | |
368 | 368 | let dPriceA = getIntegerValue(priceOracleAddr, (aId + kPriceInOracle)) | |
369 | 369 | let dPriceB = getIntegerValue(priceOracleAddr, (bId + kPriceInOracle)) | |
370 | 370 | let shareSupply = getShareSupply(poolAddr, pType, shareId) | |
371 | 371 | let APrecision = pow(10, 0, getAssetDecimals(aId), 0, 0, DOWN) | |
372 | 372 | let BPrecision = pow(10, 0, getAssetDecimals(bId), 0, 0, DOWN) | |
373 | 373 | let sharePrecision = pow(10, 0, getAssetDecimals(shareId), 0, 0, DOWN) | |
374 | 374 | let sum = (fraction(aBalance, dPriceA, APrecision) + fraction(bBalance, dPriceB, BPrecision)) | |
375 | 375 | fraction(sum, sharePrecision, shareSupply) | |
376 | 376 | } | |
377 | 377 | ||
378 | 378 | ||
379 | 379 | func getSharePrices (shareIds) = { | |
380 | 380 | func getPrices (a,shareId) = (a :+ getSharePrice(shareId)) | |
381 | 381 | ||
382 | 382 | let $l = shareIds | |
383 | 383 | let $s = size($l) | |
384 | 384 | let $acc0 = nil | |
385 | 385 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
386 | 386 | then $a | |
387 | 387 | else getPrices($a, $l[$i]) | |
388 | 388 | ||
389 | 389 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
390 | 390 | then $a | |
391 | 391 | else throw("List size exceeds 20") | |
392 | 392 | ||
393 | 393 | $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) | |
394 | 394 | } | |
395 | 395 | ||
396 | 396 | ||
397 | 397 | func getCursEntries (aId,bId,shareId,wAmounts) = { | |
398 | 398 | let assetsPrices = getAssetsPrice([aId, bId]) | |
399 | 399 | let sharePrice = getSharePrice(shareId) | |
400 | 400 | let prices = ([toString(assetsPrices[0]), toString(assetsPrices[1]), toString(sharePrice)] ++ wAmounts) | |
401 | 401 | [StringEntry(kTokenLastPrice, makeString(prices, ","))] | |
402 | 402 | } | |
403 | 403 | ||
404 | 404 | ||
405 | 405 | func calcReplenishByTwoTokens (pType,poolAddr,pmtA,aId,pmtB,bId,balA,balB) = if ((pType == SF_POOL)) | |
406 | 406 | then { | |
407 | 407 | let repl = { | |
408 | 408 | let @ = invoke(poolAddr, "callFunction", ["calcLPReplenishTwoTokensREADONLY", [toString(pmtA), toString(pmtB)]], nil) | |
409 | 409 | if ($isInstanceOf(@, "List[Any]")) | |
410 | 410 | then @ | |
411 | 411 | else throw(($getType(@) + " couldn't be cast to List[Any]")) | |
412 | 412 | } | |
413 | 413 | if ((repl == repl)) | |
414 | 414 | then $Tuple5({ | |
415 | 415 | let @ = repl[3] | |
416 | 416 | if ($isInstanceOf(@, "Int")) | |
417 | 417 | then @ | |
418 | 418 | else throw(($getType(@) + " couldn't be cast to Int")) | |
419 | 419 | }, { | |
420 | 420 | let @ = repl[4] | |
421 | 421 | if ($isInstanceOf(@, "Int")) | |
422 | 422 | then @ | |
423 | 423 | else throw(($getType(@) + " couldn't be cast to Int")) | |
424 | 424 | }, { | |
425 | 425 | let @ = repl[1] | |
426 | 426 | if ($isInstanceOf(@, "Int")) | |
427 | 427 | then @ | |
428 | 428 | else throw(($getType(@) + " couldn't be cast to Int")) | |
429 | 429 | }, assetIdToStr(repl[2]), { | |
430 | 430 | let @ = repl[0] | |
431 | 431 | if ($isInstanceOf(@, "Int")) | |
432 | 432 | then @ | |
433 | 433 | else throw(($getType(@) + " couldn't be cast to Int")) | |
434 | 434 | }) | |
435 | 435 | else throw("Strict value is not equal to itself.") | |
436 | 436 | } | |
437 | 437 | else if ((pType == WX_POOL)) | |
438 | 438 | then { | |
439 | 439 | let $t01245712707 = $Tuple2(split({ | |
440 | 440 | let @ = invoke(poolAddr, "evaluatePutByAmountAssetREADONLY", [pmtA], nil) | |
441 | 441 | if ($isInstanceOf(@, "String")) | |
442 | 442 | then @ | |
443 | 443 | else throw(($getType(@) + " couldn't be cast to String")) | |
444 | 444 | }, "__"), split({ | |
445 | 445 | let @ = invoke(poolAddr, "evaluatePutByPriceAssetREADONLY", [pmtB], nil) | |
446 | 446 | if ($isInstanceOf(@, "String")) | |
447 | 447 | then @ | |
448 | 448 | else throw(($getType(@) + " couldn't be cast to String")) | |
449 | 449 | }, "__")) | |
450 | 450 | if (($t01245712707 == $t01245712707)) | |
451 | 451 | then { | |
452 | 452 | let evalPutInB = $t01245712707._2 | |
453 | 453 | let evalPutInA = $t01245712707._1 | |
454 | 454 | let lpInA = parseIntValue(evalPutInA[1]) | |
455 | 455 | let lpInB = parseIntValue(evalPutInB[1]) | |
456 | 456 | if ((lpInB > lpInA)) | |
457 | 457 | then { | |
458 | 458 | let pmt = parseIntValue(evalPutInA[8]) | |
459 | 459 | $Tuple5(pmtA, pmt, (pmtB - pmt), bId, lpInB) | |
460 | 460 | } | |
461 | 461 | else { | |
462 | 462 | let pmt = parseIntValue(evalPutInB[7]) | |
463 | 463 | $Tuple5(pmt, pmtB, (pmtA - pmt), aId, lpInA) | |
464 | 464 | } | |
465 | 465 | } | |
466 | 466 | else throw("Strict value is not equal to itself.") | |
467 | 467 | } | |
468 | 468 | else unknownPoolType() | |
469 | 469 | ||
470 | 470 | ||
471 | 471 | func replenishTwoTokensByType (poolAddr,pType,pmtA,aId,pmtB,bId) = { | |
472 | 472 | let payments = [AttachedPayment(assetIdFromStr(aId), pmtA), AttachedPayment(assetIdFromStr(bId), pmtB)] | |
473 | 473 | if ((pType == SF_POOL)) | |
474 | 474 | then invoke(poolAddr, "callFunction", ["replenishWithTwoTokens", ["false", "0"]], payments) | |
475 | 475 | else if ((pType == WX_POOL)) | |
476 | 476 | then invoke(poolAddr, "put", [1000000, false], payments) | |
477 | 477 | else unknownPoolType() | |
478 | 478 | } | |
479 | 479 | ||
480 | 480 | ||
481 | 481 | func replenishOneTokenByType (poolAddr,pType,pmt,pmtId) = { | |
482 | 482 | let payments = [AttachedPayment(assetIdFromStr(pmtId), pmt)] | |
483 | 483 | if ((pType == SF_POOL)) | |
484 | 484 | then invoke(poolAddr, "callFunction", ["replenishWithOneToken", ["0", "false", "0"]], payments) | |
485 | 485 | else if ((pType == WX_POOL)) | |
486 | 486 | then invoke(poolAddr, "putOneTkn", [0, false], payments) | |
487 | 487 | else unknownPoolType() | |
488 | 488 | } | |
489 | 489 | ||
490 | 490 | ||
491 | 491 | func stakeLP (pool,pType,shareId,amount) = { | |
492 | 492 | let payments = [AttachedPayment(fromBase58String(shareId), amount)] | |
493 | 493 | if ((pType == SF_POOL)) | |
494 | 494 | then invoke(getSFFarmingAddr(), "lockShareTokens", [pool, 0], payments) | |
495 | 495 | else if ((pType == WX_POOL)) | |
496 | 496 | then invoke(getWXFarmingAddr(addressFromStringValue(pool)), "stake", nil, payments) | |
497 | 497 | else unknownPoolType() | |
498 | 498 | } | |
499 | 499 | ||
500 | 500 | ||
501 | 501 | func unstakeLP (pool,pType,shareId,amount) = { | |
502 | 502 | let $t01436614716 = if ((pType == SF_POOL)) | |
503 | 503 | then $Tuple3(getSFFarmingAddr(), "withdrawShareTokens", [pool, amount]) | |
504 | 504 | else if ((pType == WX_POOL)) | |
505 | 505 | then $Tuple3(getWXFarmingAddr(Address(fromBase58String(pool))), "unstake", [shareId, amount]) | |
506 | 506 | else unknownPoolType() | |
507 | 507 | let farmAddr = $t01436614716._1 | |
508 | 508 | let fName = $t01436614716._2 | |
509 | 509 | let params = $t01436614716._3 | |
510 | 510 | let inv = invoke(farmAddr, fName, params, nil) | |
511 | 511 | if ((inv == inv)) | |
512 | 512 | then amount | |
513 | 513 | else throw("Strict value is not equal to itself.") | |
514 | 514 | } | |
515 | 515 | ||
516 | 516 | ||
517 | 517 | func calcAmountToPaySF (pool,assetIdA,assetIdB,balA,balB,amountTokenToGet,assetTokenToGet) = { | |
518 | 518 | let poolAddr = Address(fromBase58String(pool)) | |
519 | 519 | let feeScale6 = 1000000 | |
520 | 520 | let fee = getIntegerValue(poolAddr, kSFPoolFee) | |
521 | 521 | let amntGetNoFee = fraction(amountTokenToGet, feeScale6, (feeScale6 - fee), CEILING) | |
522 | 522 | let $t01513815444 = if ((assetTokenToGet == assetIdA)) | |
523 | 523 | then { | |
524 | 524 | let amountToPay = fraction(amntGetNoFee, balB, (balA - amntGetNoFee), CEILING) | |
525 | 525 | $Tuple2(amountToPay, assetIdB) | |
526 | 526 | } | |
527 | 527 | else { | |
528 | 528 | let amountToPay = fraction(amntGetNoFee, balA, (balB - amntGetNoFee), CEILING) | |
529 | 529 | $Tuple2(amountToPay, assetIdA) | |
530 | 530 | } | |
531 | 531 | let amountToPay = $t01513815444._1 | |
532 | 532 | let assetToPay = $t01513815444._2 | |
533 | 533 | $Tuple2(assetToPay, amountToPay) | |
534 | 534 | } | |
535 | 535 | ||
536 | 536 | ||
537 | + | func getWXSwapFees (pool) = { | |
538 | + | let poolAddr = addressFromStringValue(pool) | |
539 | + | let fContract = addressFromStringValue(valueOrErrorMessage(getString(poolAddr, "%s__factoryContract"), "Can't get WX factory contract addr")) | |
540 | + | let poolFeeDefault = value(getInteger(wxSwapContract, "%s__poolFee")) | |
541 | + | let protocolFeeDefault = value(getInteger(wxSwapContract, "%s__protocolFee")) | |
542 | + | match invoke(fContract, "getSwapFeeREADONLY", [toString(poolAddr)], nil) { | |
543 | + | case fees: (Int, Int) => | |
544 | + | $Tuple2(fees._1, fees._2) | |
545 | + | case _ => | |
546 | + | $Tuple2(poolFeeDefault, protocolFeeDefault) | |
547 | + | } | |
548 | + | } | |
549 | + | ||
550 | + | ||
537 | 551 | func calcAmountToPayWX (pool,assetIdA,assetIdB,balA,balB,amountTokenToGet,assetTokenToGet) = { | |
538 | - | let prFee = getIntegerValue(wxSwapContract, "%s__protocolFee") | |
539 | - | let pFee = getIntegerValue(wxSwapContract, "%s__poolFee") | |
552 | + | let $t01618416223 = getWXSwapFees(pool) | |
553 | + | let pFee = $t01618416223._1 | |
554 | + | let prFee = $t01618416223._2 | |
540 | 555 | let feeScale = toBigInt(100000000) | |
541 | - | let $ | |
556 | + | let $t01626316571 = if ((assetTokenToGet == assetIdA)) | |
542 | 557 | then { | |
543 | 558 | let amountToPay = fraction(amountTokenToGet, balB, (balA - amountTokenToGet)) | |
544 | 559 | $Tuple2(amountToPay, assetIdB) | |
545 | 560 | } | |
546 | 561 | else { | |
547 | 562 | let amountToPay = fraction(amountTokenToGet, balA, (balB - amountTokenToGet)) | |
548 | 563 | $Tuple2(amountToPay, assetIdA) | |
549 | 564 | } | |
550 | - | let amountToPay = $ | |
551 | - | let assetToPay = $ | |
565 | + | let amountToPay = $t01626316571._1 | |
566 | + | let assetToPay = $t01626316571._2 | |
552 | 567 | let amountToPayWithFee = toInt(fraction(toBigInt(amountToPay), feeScale, (feeScale - toBigInt((prFee + pFee))), CEILING)) | |
553 | 568 | $Tuple2(assetToPay, amountToPayWithFee) | |
554 | 569 | } | |
555 | 570 | ||
556 | 571 | ||
557 | 572 | func exchangeDirectly (pType,pool,assetIdA,assetIdB,balA,balB,amountTokenToGet,assetTokenToGet) = if ((pType == SF_POOL)) | |
558 | 573 | then { | |
559 | - | let $ | |
560 | - | let assetToPay = $ | |
561 | - | let amountToPay = $ | |
574 | + | let $t01691817040 = calcAmountToPaySF(pool, assetIdA, assetIdB, balA, balB, amountTokenToGet, assetTokenToGet) | |
575 | + | let assetToPay = $t01691817040._1 | |
576 | + | let amountToPay = $t01691817040._2 | |
562 | 577 | invoke(addressFromStringValue(pool), "callFunction", ["exchange", [toString(amountTokenToGet)]], [AttachedPayment(assetIdFromStr(assetToPay), amountToPay)]) | |
563 | 578 | } | |
564 | 579 | else if ((pType == WX_POOL)) | |
565 | 580 | then { | |
566 | - | let $ | |
567 | - | let assetToPay = $ | |
568 | - | let amountToPay = $ | |
581 | + | let $t01724017362 = calcAmountToPayWX(pool, assetIdA, assetIdB, balA, balB, amountTokenToGet, assetTokenToGet) | |
582 | + | let assetToPay = $t01724017362._1 | |
583 | + | let amountToPay = $t01724017362._2 | |
569 | 584 | invoke(wxSwapContract, "swap", [amountTokenToGet, assetTokenToGet, toString(this)], [AttachedPayment(assetIdFromStr(assetToPay), amountToPay)]) | |
570 | 585 | } | |
571 | 586 | else unknownPoolType() | |
572 | 587 | ||
573 | 588 | ||
574 | 589 | func calcWithdrawLPFromPoolVirt (poolAddr,pType,shareId,userCanWithdraw) = { | |
575 | - | let $ | |
590 | + | let $t01764918113 = if ((pType == SF_POOL)) | |
576 | 591 | then { | |
577 | 592 | let inv = { | |
578 | 593 | let @ = invoke(poolAddr, "callFunction", ["withdrawREADONLY", [toString(userCanWithdraw)]], nil) | |
579 | 594 | if ($isInstanceOf(@, "List[Any]")) | |
580 | 595 | then @ | |
581 | 596 | else throw(($getType(@) + " couldn't be cast to List[Any]")) | |
582 | 597 | } | |
583 | 598 | if ((inv == inv)) | |
584 | 599 | then $Tuple2({ | |
585 | 600 | let @ = inv[0] | |
586 | 601 | if ($isInstanceOf(@, "Int")) | |
587 | 602 | then @ | |
588 | 603 | else throw(($getType(@) + " couldn't be cast to Int")) | |
589 | 604 | }, { | |
590 | 605 | let @ = inv[1] | |
591 | 606 | if ($isInstanceOf(@, "Int")) | |
592 | 607 | then @ | |
593 | 608 | else throw(($getType(@) + " couldn't be cast to Int")) | |
594 | 609 | }) | |
595 | 610 | else throw("Strict value is not equal to itself.") | |
596 | 611 | } | |
597 | 612 | else if ((pType == WX_POOL)) | |
598 | 613 | then { | |
599 | 614 | let inv = split({ | |
600 | 615 | let @ = invoke(poolAddr, "evaluateGetREADONLY", [shareId, userCanWithdraw], nil) | |
601 | 616 | if ($isInstanceOf(@, "String")) | |
602 | 617 | then @ | |
603 | 618 | else throw(($getType(@) + " couldn't be cast to String")) | |
604 | 619 | }, "__") | |
605 | 620 | if ((inv == inv)) | |
606 | 621 | then $Tuple2(parseIntValue(inv[1]), parseIntValue(inv[2])) | |
607 | 622 | else throw("Strict value is not equal to itself.") | |
608 | 623 | } | |
609 | 624 | else unknownPoolType() | |
610 | - | let amountA = $ | |
611 | - | let amountB = $ | |
625 | + | let amountA = $t01764918113._1 | |
626 | + | let amountB = $t01764918113._2 | |
612 | 627 | $Tuple2(amountA, amountB) | |
613 | 628 | } | |
614 | 629 | ||
615 | 630 | ||
616 | 631 | func claimFarmed (pType,pool) = if ((pType == SF_POOL)) | |
617 | 632 | then { | |
618 | 633 | let balBefore = accountBalance(SWOPID) | |
619 | 634 | if ((balBefore == balBefore)) | |
620 | 635 | then { | |
621 | 636 | let inv = invoke(getSFFarmingAddr(), "claim", [pool], nil) | |
622 | 637 | if ((inv == inv)) | |
623 | 638 | then { | |
624 | 639 | let balAfter = accountBalance(SWOPID) | |
625 | 640 | $Tuple2((balAfter - balBefore), SWOPID) | |
626 | 641 | } | |
627 | 642 | else throw("Strict value is not equal to itself.") | |
628 | 643 | } | |
629 | 644 | else throw("Strict value is not equal to itself.") | |
630 | 645 | } | |
631 | 646 | else if ((pType == WX_POOL)) | |
632 | 647 | then { | |
633 | 648 | let balBefore = accountBalance(WXID) | |
634 | 649 | if ((balBefore == balBefore)) | |
635 | 650 | then { | |
636 | 651 | let inv = invoke(getWXFarmingAddr(Address(fromBase58String(pool))), "claimWX", [pool], nil) | |
637 | 652 | if ((inv == inv)) | |
638 | 653 | then { | |
639 | 654 | let balAfter = accountBalance(WXID) | |
640 | 655 | $Tuple2((balAfter - balBefore), WXID) | |
641 | 656 | } | |
642 | 657 | else throw("Strict value is not equal to itself.") | |
643 | 658 | } | |
644 | 659 | else throw("Strict value is not equal to itself.") | |
645 | 660 | } | |
646 | 661 | else unknownPoolType() | |
647 | 662 | ||
648 | 663 | ||
649 | 664 | func replenishByType (pType,pool,feeType,pmtA,aId,pmtB,bId,balA,balB,LPId) = { | |
650 | 665 | let lpBalanceBefore = accountBalance(fromBase58String(LPId)) | |
651 | 666 | if ((lpBalanceBefore == lpBalanceBefore)) | |
652 | 667 | then { | |
653 | 668 | let poolAddr = addressFromStringValue(pool) | |
654 | - | let $ | |
669 | + | let $t01907819494 = if (if ((pmtA > 0)) | |
655 | 670 | then (pmtB > 0) | |
656 | 671 | else false) | |
657 | 672 | then { | |
658 | - | let $ | |
659 | - | let pmtInA = $ | |
660 | - | let pmtInB = $ | |
661 | - | let change = $ | |
662 | - | let changeId = $ | |
673 | + | let $t01914419260 = calcReplenishByTwoTokens(pType, poolAddr, pmtA, aId, pmtB, bId, balA, balB) | |
674 | + | let pmtInA = $t01914419260._1 | |
675 | + | let pmtInB = $t01914419260._2 | |
676 | + | let change = $t01914419260._3 | |
677 | + | let changeId = $t01914419260._4 | |
663 | 678 | let inv = replenishTwoTokensByType(poolAddr, pType, pmtInA, aId, pmtInB, bId) | |
664 | 679 | if ((inv == inv)) | |
665 | 680 | then $Tuple2(change, changeId) | |
666 | 681 | else throw("Strict value is not equal to itself.") | |
667 | 682 | } | |
668 | 683 | else if ((pmtA > 0)) | |
669 | 684 | then $Tuple2(pmtA, aId) | |
670 | 685 | else if ((pmtB > 0)) | |
671 | 686 | then $Tuple2(pmtB, bId) | |
672 | 687 | else throw("pmts must be > 0") | |
673 | - | let change = $ | |
674 | - | let changeId = $ | |
688 | + | let change = $t01907819494._1 | |
689 | + | let changeId = $t01907819494._2 | |
675 | 690 | let inv = if ((change > 0)) | |
676 | 691 | then replenishOneTokenByType(poolAddr, pType, change, changeId) | |
677 | 692 | else nil | |
678 | 693 | if ((inv == inv)) | |
679 | 694 | then { | |
680 | 695 | let lpBalanceAfter = accountBalance(fromBase58String(LPId)) | |
681 | 696 | let totalStaked = (lpBalanceAfter - lpBalanceBefore) | |
682 | 697 | let axlyFeeAmount = fraction(totalStaked, getAxlyFee(pool, feeType), FEE_SCALE6) | |
683 | 698 | let userShareForStake = (totalStaked - axlyFeeAmount) | |
684 | 699 | if ((0 >= userShareForStake)) | |
685 | 700 | then throw("amount of staked sharetokens must be > 0") | |
686 | 701 | else { | |
687 | 702 | let invLP = stakeLP(pool, pType, LPId, userShareForStake) | |
688 | 703 | if ((invLP == invLP)) | |
689 | 704 | then $Tuple2(userShareForStake, axlyFeeAmount) | |
690 | 705 | else throw("Strict value is not equal to itself.") | |
691 | 706 | } | |
692 | 707 | } | |
693 | 708 | else throw("Strict value is not equal to itself.") | |
694 | 709 | } | |
695 | 710 | else throw("Strict value is not equal to itself.") | |
696 | 711 | } | |
697 | 712 | ||
698 | 713 | ||
699 | 714 | func replenishEntries (pool,user,stakedAmount,axlyFeeAmount,posNum,shareId,type,withLoan) = { | |
700 | 715 | let totalAmount = getPoolTotalShare(pool) | |
701 | 716 | let totalAmountLoan = getPoolTotalShareWithLoan(pool) | |
702 | - | let $ | |
717 | + | let $t02035220590 = if (withLoan) | |
703 | 718 | then $Tuple2(getIntegerValue(this, (pool + kPoolInterestLoan)), (totalAmountLoan + stakedAmount)) | |
704 | 719 | else $Tuple2(getIntegerValue(this, (pool + kPoolInterestNoLoan)), totalAmountLoan) | |
705 | - | let curPoolInterest = $ | |
706 | - | let totalStakedWithLoan = $ | |
720 | + | let curPoolInterest = $t02035220590._1 | |
721 | + | let totalStakedWithLoan = $t02035220590._2 | |
707 | 722 | [IntegerEntry((pool + kPoolTotal), (totalAmount + stakedAmount)), IntegerEntry((pool + kPoolTotalLoan), totalStakedWithLoan), IntegerEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserPosition), stakedAmount), IntegerEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserPositionInterest), curPoolInterest), StringEntry((((user + "_") + toString(posNum)) + kUserPositionPool), pool), IntegerEntry((user + kUserPositionNum), posNum), ScriptTransfer(moneyBox, axlyFeeAmount, fromBase58String(shareId))] | |
708 | 723 | } | |
709 | 724 | ||
710 | 725 | ||
711 | 726 | func exchangeKeeper (toToken,pmtAmount,pmtAsset,amountsIn,addresses,assetsToReceive,estReceived,slippageTolerance,minReceived,options) = { | |
712 | 727 | let tokenBalanceBefore = accountBalance(assetIdFromStr(toToken)) | |
713 | 728 | if ((tokenBalanceBefore == tokenBalanceBefore)) | |
714 | 729 | then { | |
715 | 730 | let inv = invoke(exContract, "swap", [amountsIn, addresses, assetsToReceive, estReceived, slippageTolerance, minReceived, options], [AttachedPayment(pmtAsset, pmtAmount)]) | |
716 | 731 | if ((inv == inv)) | |
717 | 732 | then (accountBalance(assetIdFromStr(toToken)) - tokenBalanceBefore) | |
718 | 733 | else throw("Strict value is not equal to itself.") | |
719 | 734 | } | |
720 | 735 | else throw("Strict value is not equal to itself.") | |
721 | 736 | } | |
722 | 737 | ||
723 | 738 | ||
724 | 739 | func exchangePuzzle (toToken,pmtAmount,pmtAsset,routesStr,minToReceive,options) = { | |
725 | 740 | let tokenBalanceBefore = accountBalance(assetIdFromStr(toToken)) | |
726 | 741 | if ((tokenBalanceBefore == tokenBalanceBefore)) | |
727 | 742 | then { | |
728 | 743 | let inv = invoke(exContract, "puzzleSwap", [routesStr, minToReceive, options], [AttachedPayment(pmtAsset, pmtAmount)]) | |
729 | 744 | if ((inv == inv)) | |
730 | 745 | then (accountBalance(assetIdFromStr(toToken)) - tokenBalanceBefore) | |
731 | 746 | else throw("Strict value is not equal to itself.") | |
732 | 747 | } | |
733 | 748 | else throw("Strict value is not equal to itself.") | |
734 | 749 | } | |
735 | 750 | ||
736 | 751 | ||
737 | 752 | func exchangeSwopFi (toToken,pmtAmount,pmtAsset,exchangers,exchangersType,args1,args2,routingAssetsKeys,minAmountToReceive,options) = { | |
738 | 753 | let tokenBalanceBefore = accountBalance(assetIdFromStr(toToken)) | |
739 | 754 | if ((tokenBalanceBefore == tokenBalanceBefore)) | |
740 | 755 | then { | |
741 | 756 | let inv = invoke(exContract, "swopfiSwap", [exchangers, exchangersType, args1, args2, routingAssetsKeys, minAmountToReceive, options], [AttachedPayment(pmtAsset, pmtAmount)]) | |
742 | 757 | if ((inv == inv)) | |
743 | 758 | then (accountBalance(assetIdFromStr(toToken)) - tokenBalanceBefore) | |
744 | 759 | else throw("Strict value is not equal to itself.") | |
745 | 760 | } | |
746 | 761 | else throw("Strict value is not equal to itself.") | |
747 | 762 | } | |
748 | 763 | ||
749 | 764 | ||
750 | 765 | func capitalize (pool,pType,tokenId,tokenAmount) = { | |
751 | 766 | let poolAddr = Address(fromBase58String(pool)) | |
752 | - | let $ | |
753 | - | let AId = $ | |
754 | - | let BId = $ | |
755 | - | let balA = $ | |
756 | - | let balB = $ | |
757 | - | let shareId = $ | |
767 | + | let $t02294123007 = getPoolData(poolAddr, pType) | |
768 | + | let AId = $t02294123007._1 | |
769 | + | let BId = $t02294123007._2 | |
770 | + | let balA = $t02294123007._3 | |
771 | + | let balB = $t02294123007._4 | |
772 | + | let shareId = $t02294123007._5 | |
758 | 773 | if (if ((tokenId != AId)) | |
759 | 774 | then (tokenId != BId) | |
760 | 775 | else false) | |
761 | 776 | then throw("Wrong asset") | |
762 | 777 | else { | |
763 | - | let $ | |
778 | + | let $t02309223172 = if ((tokenId == AId)) | |
764 | 779 | then $Tuple2(tokenAmount, 0) | |
765 | 780 | else $Tuple2(0, tokenAmount) | |
766 | - | let pmtA = $ | |
767 | - | let pmtB = $ | |
768 | - | let $ | |
769 | - | let stakedAmount = $ | |
770 | - | let nf = $ | |
781 | + | let pmtA = $t02309223172._1 | |
782 | + | let pmtB = $t02309223172._2 | |
783 | + | let $t02317523279 = replenishByType(pType, pool, NO_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId) | |
784 | + | let stakedAmount = $t02317523279._1 | |
785 | + | let nf = $t02317523279._2 | |
771 | 786 | let curPoolInterestLoan = valueOrElse(getInteger(this, (pool + kPoolInterestLoan)), 0) | |
772 | 787 | let curPoolInterestNoLoan = valueOrElse(getInteger(this, (pool + kPoolInterestNoLoan)), 0) | |
773 | 788 | let totalShareAmount = getPoolTotalShare(pool) | |
774 | 789 | let totalShareAmountWithLoan = getPoolTotalShareWithLoan(pool) | |
775 | 790 | let loanPercent = fraction(totalShareAmountWithLoan, SCALE8, totalShareAmount) | |
776 | 791 | let stakedLoan = fraction(stakedAmount, loanPercent, SCALE8) | |
777 | 792 | let stakedNoLoan = (stakedAmount - stakedLoan) | |
778 | 793 | let newInterestLoan = if ((totalShareAmountWithLoan > 0)) | |
779 | 794 | then (curPoolInterestLoan + fraction(stakedLoan, SCALE10, totalShareAmountWithLoan)) | |
780 | 795 | else 0 | |
781 | 796 | let newInterestNoLoan = if (((totalShareAmount - totalShareAmountWithLoan) > 0)) | |
782 | 797 | then (curPoolInterestNoLoan + fraction(stakedNoLoan, SCALE10, (totalShareAmount - totalShareAmountWithLoan))) | |
783 | 798 | else 0 | |
784 | 799 | let axlyFeeLoan = fraction(stakedLoan, getAxlyFee(pool, CAP_FEE_LOAN), FEE_SCALE6) | |
785 | 800 | let axlyFeeNoLoan = fraction(stakedNoLoan, getAxlyFee(pool, CAP_FEE_NO_LOAN), FEE_SCALE6) | |
786 | 801 | let axlyFee = unstakeLP(pool, pType, shareId, (axlyFeeLoan + axlyFeeNoLoan)) | |
787 | 802 | if ((axlyFee == axlyFee)) | |
788 | 803 | then ([IntegerEntry((pool + kPoolInterestLoan), newInterestLoan), IntegerEntry((pool + kPoolInterestNoLoan), newInterestNoLoan), IntegerEntry((pool + kPoolTotal), ((totalShareAmount + stakedAmount) - axlyFee)), IntegerEntry((pool + kPoolTotalLoan), ((totalShareAmountWithLoan + stakedLoan) - axlyFeeLoan)), ScriptTransfer(moneyBox, (axlyFeeLoan + axlyFeeNoLoan), fromBase58String(shareId))] ++ getCursEntries(AId, BId, shareId, nil)) | |
789 | 804 | else throw("Strict value is not equal to itself.") | |
790 | 805 | } | |
791 | 806 | } | |
792 | 807 | ||
793 | 808 | ||
794 | 809 | func withdrawAmountCalc (pool,userCanWithdraw,debt,borrowAsset,stopLossFee) = { | |
795 | 810 | let poolAddr = Address(fromBase58String(pool)) | |
796 | 811 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Unknown pool") | |
797 | - | let $ | |
798 | - | let assetIdA = $ | |
799 | - | let assetIdB = $ | |
800 | - | let balA = $ | |
801 | - | let balB = $ | |
802 | - | let shareId = $ | |
812 | + | let $t02506925145 = getPoolData(poolAddr, pType) | |
813 | + | let assetIdA = $t02506925145._1 | |
814 | + | let assetIdB = $t02506925145._2 | |
815 | + | let balA = $t02506925145._3 | |
816 | + | let balB = $t02506925145._4 | |
817 | + | let shareId = $t02506925145._5 | |
803 | 818 | let cBalABefore = accountBalance(assetIdFromStr(assetIdA)) | |
804 | 819 | if ((cBalABefore == cBalABefore)) | |
805 | 820 | then { | |
806 | 821 | let cBalBBefore = accountBalance(assetIdFromStr(assetIdB)) | |
807 | 822 | if ((cBalBBefore == cBalBBefore)) | |
808 | 823 | then { | |
809 | 824 | let inv = if ((pType == SF_POOL)) | |
810 | 825 | then { | |
811 | 826 | let inv = unstakeLP(pool, pType, shareId, stopLossFee) | |
812 | 827 | if ((inv == inv)) | |
813 | 828 | then invoke(poolAddr, "callFunction", ["withdraw", [toString(userCanWithdraw)]], nil) | |
814 | 829 | else throw("Strict value is not equal to itself.") | |
815 | 830 | } | |
816 | 831 | else if ((pType == WX_POOL)) | |
817 | 832 | then { | |
818 | 833 | let inv = unstakeLP(pool, pType, shareId, (userCanWithdraw + stopLossFee)) | |
819 | 834 | if ((inv == inv)) | |
820 | 835 | then invoke(poolAddr, "get", nil, [AttachedPayment(assetIdFromStr(shareId), userCanWithdraw)]) | |
821 | 836 | else throw("Strict value is not equal to itself.") | |
822 | 837 | } | |
823 | 838 | else unknownPoolType() | |
824 | 839 | if ((inv == inv)) | |
825 | 840 | then { | |
826 | 841 | let cBalAAfter = accountBalance(assetIdFromStr(assetIdA)) | |
827 | 842 | let cBalBAfter = accountBalance(assetIdFromStr(assetIdB)) | |
828 | - | let $ | |
829 | - | let tokensAmountA = $ | |
830 | - | let tokensAmountB = $ | |
831 | - | let $ | |
843 | + | let $t02583825927 = $Tuple2((cBalAAfter - cBalABefore), (cBalBAfter - cBalBBefore)) | |
844 | + | let tokensAmountA = $t02583825927._1 | |
845 | + | let tokensAmountB = $t02583825927._2 | |
846 | + | let $t02593026784 = if ((debt > 0)) | |
832 | 847 | then { | |
833 | 848 | let amountToGetEx = if (if ((borrowAsset == assetIdA)) | |
834 | 849 | then (debt > tokensAmountA) | |
835 | 850 | else false) | |
836 | 851 | then (debt - tokensAmountA) | |
837 | 852 | else if (if ((borrowAsset == assetIdB)) | |
838 | 853 | then (debt > tokensAmountB) | |
839 | 854 | else false) | |
840 | 855 | then (debt - tokensAmountB) | |
841 | 856 | else 0 | |
842 | 857 | let exInv = if ((amountToGetEx > 0)) | |
843 | 858 | then exchangeDirectly(pType, pool, assetIdA, assetIdB, (balA - tokensAmountA), (balB - tokensAmountB), amountToGetEx, borrowAsset) | |
844 | 859 | else nil | |
845 | 860 | if ((exInv == exInv)) | |
846 | 861 | then { | |
847 | 862 | let cBalAAfterRepay = accountBalance(assetIdFromStr(assetIdA)) | |
848 | 863 | let cBalBAfterRepay = accountBalance(assetIdFromStr(assetIdB)) | |
849 | 864 | if ((borrowAsset == assetIdA)) | |
850 | 865 | then $Tuple2(((cBalAAfterRepay - cBalABefore) - debt), (cBalBAfterRepay - cBalBBefore)) | |
851 | 866 | else $Tuple2((cBalAAfterRepay - cBalABefore), ((cBalBAfterRepay - cBalBBefore) - debt)) | |
852 | 867 | } | |
853 | 868 | else throw("Strict value is not equal to itself.") | |
854 | 869 | } | |
855 | 870 | else $Tuple2(tokensAmountA, tokensAmountB) | |
856 | - | let toUserA = $ | |
857 | - | let toUserB = $ | |
871 | + | let toUserA = $t02593026784._1 | |
872 | + | let toUserB = $t02593026784._2 | |
858 | 873 | $Tuple5(toUserA, assetIdA, toUserB, assetIdB, shareId) | |
859 | 874 | } | |
860 | 875 | else throw("Strict value is not equal to itself.") | |
861 | 876 | } | |
862 | 877 | else throw("Strict value is not equal to itself.") | |
863 | 878 | } | |
864 | 879 | else throw("Strict value is not equal to itself.") | |
865 | 880 | } | |
866 | 881 | ||
867 | 882 | ||
868 | 883 | func userCanWithdrawShareCalc (user,pool,posId,borrowed) = { | |
869 | 884 | let pAmount = valueOrErrorMessage(getInteger(this, (((((pool + "_") + user) + "_") + posId) + kUserPosition)), "Unknown position") | |
870 | 885 | let userInterest = getIntegerValue(this, (((((pool + "_") + user) + "_") + posId) + kUserPositionInterest)) | |
871 | 886 | let poolInterest = if (borrowed) | |
872 | 887 | then getIntegerValue(this, (pool + kPoolInterestLoan)) | |
873 | 888 | else getIntegerValue(this, (pool + kPoolInterestNoLoan)) | |
874 | 889 | (pAmount + fraction(pAmount, (poolInterest - userInterest), SCALE10)) | |
875 | 890 | } | |
876 | 891 | ||
877 | 892 | ||
878 | 893 | func withdrawToUser (user,pool,posId,stopLoss) = { | |
879 | 894 | let pAmount = valueOrErrorMessage(getInteger(this, (((((pool + "_") + user) + "_") + posId) + kUserPosition)), "Unknown position") | |
880 | 895 | let borrowAmount = valueOrElse(getInteger(this, (((((pool + "_") + user) + "_") + posId) + kUserBorrowAmount)), 0) | |
881 | 896 | let userCanWithdraw = userCanWithdrawShareCalc(user, pool, posId, (borrowAmount > 0)) | |
882 | 897 | let poolTotalShare = getPoolTotalShare(pool) | |
883 | 898 | let userAddr = Address(fromBase58String(user)) | |
884 | 899 | let borrowAsset = valueOrElse(getString(this, (((((pool + "_") + user) + "_") + posId) + kUserBorrowAssetId)), "") | |
885 | - | let $ | |
900 | + | let $t02798228216 = if ((borrowAmount > 0)) | |
886 | 901 | then $Tuple2({ | |
887 | 902 | let @ = invoke(getLendSrvAddr(), "getAssetDebt", [false, ((user + "_") + posId), borrowAsset], nil) | |
888 | 903 | if ($isInstanceOf(@, "Int")) | |
889 | 904 | then @ | |
890 | 905 | else throw(($getType(@) + " couldn't be cast to Int")) | |
891 | 906 | }, STOPLOSS_LOAN) | |
892 | 907 | else $Tuple2(0, STOPLOSS_FEE_NO_LOAN) | |
893 | - | let debt = $ | |
894 | - | let feeType = $ | |
908 | + | let debt = $t02798228216._1 | |
909 | + | let feeType = $t02798228216._2 | |
895 | 910 | let stopLossFee = if (stopLoss) | |
896 | 911 | then fraction(userCanWithdraw, getAxlyFee(pool, feeType), FEE_SCALE6) | |
897 | 912 | else 0 | |
898 | - | let $ | |
899 | - | if (($ | |
913 | + | let $t02833328489 = withdrawAmountCalc(pool, (userCanWithdraw - stopLossFee), debt, borrowAsset, stopLossFee) | |
914 | + | if (($t02833328489 == $t02833328489)) | |
900 | 915 | then { | |
901 | - | let shareId = $ | |
902 | - | let assetIdB = $ | |
903 | - | let toUserAmountB = $ | |
904 | - | let assetIdA = $ | |
905 | - | let toUserAmountA = $ | |
916 | + | let shareId = $t02833328489._5 | |
917 | + | let assetIdB = $t02833328489._4 | |
918 | + | let toUserAmountB = $t02833328489._3 | |
919 | + | let assetIdA = $t02833328489._2 | |
920 | + | let toUserAmountA = $t02833328489._1 | |
906 | 921 | let closeDbtInv = if ((debt > 0)) | |
907 | 922 | then invoke(getLendSrvAddr(), "repayFor", [((user + "_") + posId)], [AttachedPayment(assetIdFromStr(borrowAsset), debt)]) | |
908 | 923 | else 0 | |
909 | 924 | if ((closeDbtInv == closeDbtInv)) | |
910 | 925 | then { | |
911 | 926 | let entries = ([DeleteEntry((((((pool + "_") + user) + "_") + posId) + kUserPosition)), DeleteEntry((((user + "_") + posId) + kUserPositionPool)), DeleteEntry((((((pool + "_") + user) + "_") + posId) + kUserBorrowAmount)), DeleteEntry((((((pool + "_") + user) + "_") + posId) + kUserBorrowAssetId)), DeleteEntry((((((pool + "_") + user) + "_") + posId) + kUserPositionInterest)), IntegerEntry((pool + kPoolTotal), ((poolTotalShare - userCanWithdraw) - stopLossFee)), ScriptTransfer(userAddr, toUserAmountA, assetIdFromStr(assetIdA)), ScriptTransfer(userAddr, toUserAmountB, assetIdFromStr(assetIdB)), ScriptTransfer(moneyBox, stopLossFee, fromBase58String(shareId))] ++ getCursEntries(assetIdA, assetIdB, shareId, nil)) | |
912 | 927 | $Tuple2(entries, [toUserAmountA, toUserAmountB]) | |
913 | 928 | } | |
914 | 929 | else throw("Strict value is not equal to itself.") | |
915 | 930 | } | |
916 | 931 | else throw("Strict value is not equal to itself.") | |
917 | 932 | } | |
918 | 933 | ||
919 | 934 | ||
920 | 935 | func parseRequest (requestId) = { | |
921 | 936 | let request = split(valueOrErrorMessage(getString(this, (requestId + kRequestId)), ("No request with id " + requestId)), ",") | |
922 | 937 | let user = request[0] | |
923 | 938 | let pool = request[1] | |
924 | 939 | let pmtA = parseIntValue(request[2]) | |
925 | 940 | let AId = request[3] | |
926 | 941 | let pmtB = parseIntValue(request[4]) | |
927 | 942 | let BId = request[5] | |
928 | 943 | let balA = parseIntValue(request[6]) | |
929 | 944 | let balB = parseIntValue(request[7]) | |
930 | 945 | let shareId = request[8] | |
931 | 946 | let bwAsset = request[9] | |
932 | 947 | let bwAmount = parseIntValue(request[10]) | |
933 | 948 | $Tuple11(user, pool, pmtA, AId, pmtB, BId, balA, balB, shareId, bwAsset, bwAmount) | |
934 | 949 | } | |
935 | 950 | ||
936 | 951 | ||
937 | 952 | func calcBorrowAmount (pmtA,pmtB,aId,bId,leverage,borrowId) = if (if ((borrowId != aId)) | |
938 | 953 | then (borrowId != bId) | |
939 | 954 | else false) | |
940 | 955 | then throw("Wrong borrow asset") | |
941 | 956 | else { | |
942 | 957 | let dPriceA = getIntegerValue(priceOracleAddr, (aId + kPriceInOracle)) | |
943 | 958 | let dPriceB = getIntegerValue(priceOracleAddr, (bId + kPriceInOracle)) | |
944 | 959 | let decPrA = pow(10, 0, getAssetDecimals(aId), 0, 0, DOWN) | |
945 | 960 | let decPrB = pow(10, 0, getAssetDecimals(bId), 0, 0, DOWN) | |
946 | 961 | let paydInDollar = (fraction(dPriceA, pmtA, decPrA) + fraction(dPriceB, pmtB, decPrB)) | |
947 | - | let $ | |
962 | + | let $t03055230649 = if ((borrowId == aId)) | |
948 | 963 | then $Tuple2(dPriceA, decPrA) | |
949 | 964 | else $Tuple2(dPriceB, decPrB) | |
950 | - | let borrowPrice = $ | |
951 | - | let borrowDecPr = $ | |
965 | + | let borrowPrice = $t03055230649._1 | |
966 | + | let borrowDecPr = $t03055230649._2 | |
952 | 967 | fraction(fraction(paydInDollar, (leverage - 100), 100), borrowDecPr, borrowPrice) | |
953 | 968 | } | |
954 | 969 | ||
955 | 970 | ||
956 | 971 | func parseReplenishPmts (pmts,AId,BId) = if ((size(pmts) == 2)) | |
957 | 972 | then if ((assetIdToStr(pmts[0].assetId) != AId)) | |
958 | 973 | then throw("Wrong payment asset A") | |
959 | 974 | else if ((assetIdToStr(pmts[1].assetId) != BId)) | |
960 | 975 | then throw("Wrong payment asset B") | |
961 | 976 | else $Tuple2(pmts[0].amount, pmts[1].amount) | |
962 | 977 | else if ((size(pmts) == 1)) | |
963 | 978 | then if ((assetIdToStr(pmts[0].assetId) == AId)) | |
964 | 979 | then $Tuple2(pmts[0].amount, 0) | |
965 | 980 | else if ((assetIdToStr(pmts[0].assetId) == BId)) | |
966 | 981 | then $Tuple2(0, pmts[0].amount) | |
967 | 982 | else throw("Wrong payment") | |
968 | 983 | else throw("One or two payments expected") | |
969 | 984 | ||
970 | 985 | ||
971 | 986 | func calcPriceImpact (balA,balB,newBalA,newBalB) = { | |
972 | 987 | let pri = ((SCALE8 - fraction(fraction(balB, SCALE8, balA), SCALE8, fraction(newBalB, SCALE8, newBalA))) * 100) | |
973 | 988 | if ((0 > pri)) | |
974 | 989 | then (pri * -1) | |
975 | 990 | else pri | |
976 | 991 | } | |
977 | 992 | ||
978 | 993 | ||
979 | 994 | func claimAndCheckAmntEx (pool,pType,claim,amountToExchange,change) = { | |
980 | - | let $ | |
995 | + | let $t03166331950 = if (claim) | |
981 | 996 | then claimFarmed(pType, pool) | |
982 | 997 | else { | |
983 | 998 | let claimedAsset = if ((pType == SF_POOL)) | |
984 | 999 | then SWOPID | |
985 | 1000 | else if ((pType == WX_POOL)) | |
986 | 1001 | then WXID | |
987 | 1002 | else unknownPoolType() | |
988 | 1003 | $Tuple2(amountToExchange, claimedAsset) | |
989 | 1004 | } | |
990 | - | let claimAmount = $ | |
991 | - | let claimAsset = $ | |
1005 | + | let claimAmount = $t03166331950._1 | |
1006 | + | let claimAsset = $t03166331950._2 | |
992 | 1007 | let bal = accountBalance(claimAsset) | |
993 | 1008 | if (if ((amountToExchange > (claimAmount + change))) | |
994 | 1009 | then true | |
995 | 1010 | else (amountToExchange > bal)) | |
996 | 1011 | then throw("To big amount to exchange") | |
997 | 1012 | else $Tuple2(claimAmount, claimAsset) | |
998 | 1013 | } | |
999 | 1014 | ||
1000 | 1015 | ||
1001 | 1016 | @Callable(i) | |
1002 | 1017 | func getShareAssetPriceREADONLY (shareId) = { | |
1003 | 1018 | let sharePrices = getSharePrice(shareId) | |
1004 | 1019 | $Tuple2(nil, sharePrices) | |
1005 | 1020 | } | |
1006 | 1021 | ||
1007 | 1022 | ||
1008 | 1023 | ||
1009 | 1024 | @Callable(i) | |
1010 | 1025 | func getUserPositionShareAmountREADONLY (user,posNum) = { | |
1011 | 1026 | let pool = valueOrErrorMessage(getString(this, (((user + "_") + posNum) + kUserPositionPool)), "Unknown position") | |
1012 | 1027 | let borrowAmount = getIntegerValue(this, (((((pool + "_") + user) + "_") + posNum) + kUserBorrowAmount)) | |
1013 | 1028 | let userCanWithdraw = userCanWithdrawShareCalc(user, pool, posNum, (borrowAmount > 0)) | |
1014 | 1029 | $Tuple2(nil, userCanWithdraw) | |
1015 | 1030 | } | |
1016 | 1031 | ||
1017 | 1032 | ||
1018 | 1033 | ||
1019 | 1034 | @Callable(i) | |
1020 | 1035 | func getUserPositionREADONLY (user,pools,posNum) = { | |
1021 | 1036 | func userPos (a,pool) = { | |
1022 | - | let $t03243632480 = a | |
1023 | - | let wAmountsA = $t03243632480._1 | |
1024 | - | let wAmountsB = $t03243632480._2 | |
1025 | - | let debts = $t03243632480._3 | |
1026 | - | let index = $t03243632480._4 | |
1027 | - | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
1028 | - | let $t03257232662 = getPoolData(Address(fromBase58String(pool)), pType) | |
1029 | - | let AId = $t03257232662._1 | |
1030 | - | let BId = $t03257232662._2 | |
1031 | - | let balA = $t03257232662._3 | |
1032 | - | let balB = $t03257232662._4 | |
1033 | - | let shareId = $t03257232662._5 | |
1034 | - | let borrowAmount = valueOrElse(getInteger(this, (((((pool + "_") + user) + "_") + posNum[index]) + kUserBorrowAmount)), 0) | |
1037 | + | let $t03293833008 = a | |
1038 | + | let wAmountsA = $t03293833008._1 | |
1039 | + | let wAmountsB = $t03293833008._2 | |
1040 | + | let debts = $t03293833008._3 | |
1041 | + | let eqWAmountsA = $t03293833008._4 | |
1042 | + | let eqWAmountsB = $t03293833008._5 | |
1043 | + | let index = $t03293833008._6 | |
1035 | 1044 | if (!(isDefined(getInteger(this, (((((pool + "_") + user) + "_") + posNum[index]) + kUserPosition))))) | |
1036 | - | then $ | |
1045 | + | then $Tuple6((wAmountsA :+ 0), (wAmountsB :+ 0), (debts :+ 0), (eqWAmountsA :+ 0), (eqWAmountsB :+ 0), (index + 1)) | |
1037 | 1046 | else { | |
1047 | + | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
1048 | + | let $t03328733377 = getPoolData(Address(fromBase58String(pool)), pType) | |
1049 | + | let AId = $t03328733377._1 | |
1050 | + | let BId = $t03328733377._2 | |
1051 | + | let balA = $t03328733377._3 | |
1052 | + | let balB = $t03328733377._4 | |
1053 | + | let shareId = $t03328733377._5 | |
1054 | + | let borrowAmount = valueOrElse(getInteger(this, (((((pool + "_") + user) + "_") + posNum[index]) + kUserBorrowAmount)), 0) | |
1038 | 1055 | let userCanWithdraw = userCanWithdrawShareCalc(user, pool, posNum[index], (borrowAmount > 0)) | |
1039 | - | let $ | |
1040 | - | let wAmountA = $ | |
1041 | - | let wAmountB = $ | |
1056 | + | let $t03359333713 = calcWithdrawLPFromPoolVirt(Address(fromBase58String(pool)), pType, shareId, userCanWithdraw) | |
1057 | + | let wAmountA = $t03359333713._1 | |
1058 | + | let wAmountB = $t03359333713._2 | |
1042 | 1059 | if ((borrowAmount > 0)) | |
1043 | 1060 | then { | |
1044 | 1061 | let borrowAsset = getStringValue(this, (((((pool + "_") + user) + "_") + posNum[index]) + kUserBorrowAssetId)) | |
1045 | 1062 | let debt = { | |
1046 | 1063 | let @ = invoke(getLendSrvAddr(), "getAssetDebt", [false, ((user + "_") + posNum[index]), borrowAsset], nil) | |
1047 | 1064 | if ($isInstanceOf(@, "Int")) | |
1048 | 1065 | then @ | |
1049 | 1066 | else throw(($getType(@) + " couldn't be cast to Int")) | |
1050 | 1067 | } | |
1051 | 1068 | if ((debt == debt)) | |
1052 | - | then $Tuple4((wAmountsA :+ wAmountA), (wAmountsB :+ wAmountB), (debts :+ debt), (index + 1)) | |
1069 | + | then { | |
1070 | + | let $t03399734281 = if ((pType == SF_POOL)) | |
1071 | + | then calcAmountToPaySF(pool, AId, BId, balA, balB, debt, borrowAsset) | |
1072 | + | else if ((pType == WX_POOL)) | |
1073 | + | then calcAmountToPayWX(pool, AId, BId, balA, balB, debt, borrowAsset) | |
1074 | + | else unknownPoolType() | |
1075 | + | let assetToPay = $t03399734281._1 | |
1076 | + | let amountToPay = $t03399734281._2 | |
1077 | + | let $t03428834434 = if ((assetToPay == BId)) | |
1078 | + | then $Tuple2((wAmountA - debt), (wAmountB - amountToPay)) | |
1079 | + | else $Tuple2((wAmountA - amountToPay), (wAmountB - debt)) | |
1080 | + | let eqWAmountA = $t03428834434._1 | |
1081 | + | let eqWAmountB = $t03428834434._2 | |
1082 | + | $Tuple6((wAmountsA :+ wAmountA), (wAmountsB :+ wAmountB), (debts :+ debt), (eqWAmountsA :+ eqWAmountA), (eqWAmountsB :+ eqWAmountB), (index + 1)) | |
1083 | + | } | |
1053 | 1084 | else throw("Strict value is not equal to itself.") | |
1054 | 1085 | } | |
1055 | - | else $ | |
1086 | + | else $Tuple6((wAmountsA :+ wAmountA), (wAmountsB :+ wAmountB), debts, (wAmountsA :+ wAmountA), (wAmountsB :+ wAmountB), (index + 1)) | |
1056 | 1087 | } | |
1057 | 1088 | } | |
1058 | 1089 | ||
1059 | - | let $ | |
1090 | + | let $t03468934800 = { | |
1060 | 1091 | let $l = pools | |
1061 | 1092 | let $s = size($l) | |
1062 | - | let $acc0 = $ | |
1093 | + | let $acc0 = $Tuple6(nil, nil, nil, nil, nil, 0) | |
1063 | 1094 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
1064 | 1095 | then $a | |
1065 | 1096 | else userPos($a, $l[$i]) | |
1066 | 1097 | ||
1067 | 1098 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
1068 | 1099 | then $a | |
1069 | 1100 | else throw("List size exceeds 20") | |
1070 | 1101 | ||
1071 | 1102 | $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) | |
1072 | 1103 | } | |
1073 | - | let wAmountsA = $t03356033637._1 | |
1074 | - | let wAmountsB = $t03356033637._2 | |
1075 | - | let debts = $t03356033637._3 | |
1076 | - | $Tuple2(nil, $Tuple3(wAmountsA, wAmountsB, debts)) | |
1104 | + | let wAmountsA = $t03468934800._1 | |
1105 | + | let wAmountsB = $t03468934800._2 | |
1106 | + | let debts = $t03468934800._3 | |
1107 | + | let eqWAmountsA = $t03468934800._4 | |
1108 | + | let eqWAmountsB = $t03468934800._5 | |
1109 | + | $Tuple2(nil, $Tuple5(wAmountsA, wAmountsB, debts, eqWAmountsA, eqWAmountsB)) | |
1077 | 1110 | } | |
1078 | 1111 | ||
1079 | 1112 | ||
1080 | 1113 | ||
1081 | 1114 | @Callable(i) | |
1082 | - | func replenish (pool,leverage,borrowId) = valueOrElse(isActiveForUsers(), if (if ((100 > leverage)) | |
1083 | - | then true | |
1084 | - | else (leverage > 300)) | |
1085 | - | then throw("Leverage can't be <100 and >300") | |
1086 | - | else if (if (!(getBooleanValue(this, (pool + kPoolCanBorrow)))) | |
1087 | - | then (leverage > 100) | |
1088 | - | else false) | |
1089 | - | then throw("You can't borrow in this pool") | |
1090 | - | else { | |
1091 | - | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
1092 | - | let $t03412634216 = getPoolData(Address(fromBase58String(pool)), pType) | |
1093 | - | let AId = $t03412634216._1 | |
1094 | - | let BId = $t03412634216._2 | |
1095 | - | let balA = $t03412634216._3 | |
1096 | - | let balB = $t03412634216._4 | |
1097 | - | let shareId = $t03412634216._5 | |
1098 | - | if (if ((borrowId != AId)) | |
1099 | - | then (borrowId != BId) | |
1115 | + | func replenish (pool,leverage,borrowId) = valueOrElse(isActiveForUsers(), { | |
1116 | + | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
1117 | + | if (!(isPoolActive(pool, pType))) | |
1118 | + | then throw("Pool not active at this moment") | |
1119 | + | else if (if ((100 > leverage)) | |
1120 | + | then true | |
1121 | + | else (leverage > 300)) | |
1122 | + | then throw("Leverage can't be <100 and >300") | |
1123 | + | else if (if (!(getBooleanValue(this, (pool + kPoolCanBorrow)))) | |
1124 | + | then (leverage > 100) | |
1100 | 1125 | else false) | |
1101 | - | then throw(" | |
1126 | + | then throw("You can't borrow in this pool") | |
1102 | 1127 | else { | |
1103 | - | let $t03429734356 = parseReplenishPmts(i.payments, AId, BId) | |
1104 | - | let pmtA = $t03429734356._1 | |
1105 | - | let pmtB = $t03429734356._2 | |
1106 | - | let user = toString(i.caller) | |
1107 | - | let newPosNum = getNewUserPositionNumber(user) | |
1108 | - | if ((leverage > 100)) | |
1109 | - | then { | |
1110 | - | let borrowAmount = calcBorrowAmount(pmtA, pmtB, AId, BId, leverage, borrowId) | |
1111 | - | let request = makeString([user, pool, toString(pmtA), AId, toString(pmtB), BId, toString(balA), toString(balB), shareId, borrowId, toString(borrowAmount)], ",") | |
1112 | - | let newRequestId = { | |
1113 | - | let @ = invoke(this, "createNewRequest", [request], nil) | |
1114 | - | if ($isInstanceOf(@, "Int")) | |
1115 | - | then @ | |
1116 | - | else throw(($getType(@) + " couldn't be cast to Int")) | |
1117 | - | } | |
1118 | - | if ((newRequestId == newRequestId)) | |
1128 | + | let $t03539835488 = getPoolData(Address(fromBase58String(pool)), pType) | |
1129 | + | let AId = $t03539835488._1 | |
1130 | + | let BId = $t03539835488._2 | |
1131 | + | let balA = $t03539835488._3 | |
1132 | + | let balB = $t03539835488._4 | |
1133 | + | let shareId = $t03539835488._5 | |
1134 | + | if (if ((borrowId != AId)) | |
1135 | + | then (borrowId != BId) | |
1136 | + | else false) | |
1137 | + | then throw("Wrong borrow asset") | |
1138 | + | else { | |
1139 | + | let $t03556935628 = parseReplenishPmts(i.payments, AId, BId) | |
1140 | + | let pmtA = $t03556935628._1 | |
1141 | + | let pmtB = $t03556935628._2 | |
1142 | + | let user = toString(i.caller) | |
1143 | + | let newPosNum = getNewUserPositionNumber(user) | |
1144 | + | if ((leverage > 100)) | |
1119 | 1145 | then { | |
1120 | - | let args = [((user + "_") + toString(newPosNum)), shareId, borrowId, borrowAmount, toString(this), "replenishFromLand", toString(valueOrErrorMessage(newRequestId, "Can't create new request"))] | |
1121 | - | let inv = reentrantInvoke(getLendSrvAddr(), "flashPosition", args, nil) | |
1122 | - | if ((inv == inv)) | |
1146 | + | let borrowAmount = calcBorrowAmount(pmtA, pmtB, AId, BId, leverage, borrowId) | |
1147 | + | let request = makeString([user, pool, toString(pmtA), AId, toString(pmtB), BId, toString(balA), toString(balB), shareId, borrowId, toString(borrowAmount)], ",") | |
1148 | + | let newRequestId = { | |
1149 | + | let @ = invoke(this, "createNewRequest", [request], nil) | |
1150 | + | if ($isInstanceOf(@, "Int")) | |
1151 | + | then @ | |
1152 | + | else throw(($getType(@) + " couldn't be cast to Int")) | |
1153 | + | } | |
1154 | + | if ((newRequestId == newRequestId)) | |
1123 | 1155 | then { | |
1124 | - | let | |
1125 | - | let | |
1126 | - | if (( | |
1156 | + | let args = [((user + "_") + toString(newPosNum)), shareId, borrowId, borrowAmount, toString(this), "replenishFromLand", toString(valueOrErrorMessage(newRequestId, "Can't create new request"))] | |
1157 | + | let inv = reentrantInvoke(getLendSrvAddr(), "flashPosition", args, nil) | |
1158 | + | if ((inv == inv)) | |
1127 | 1159 | then { | |
1128 | - | let newBalB = $t03534535439._2 | |
1129 | - | let newBalA = $t03534535439._1 | |
1130 | - | let prImpact = calcPriceImpact(balA, balB, newBalA, newBalB) | |
1131 | - | let $t03550935624 = calcWithdrawLPFromPoolVirt(Address(fromBase58String(pool)), pType, shareId, userStaked) | |
1132 | - | let wAmountA = $t03550935624._1 | |
1133 | - | let wAmountB = $t03550935624._2 | |
1134 | - | $Tuple2(nil, [prImpact, wAmountA, wAmountB]) | |
1160 | + | let userStaked = getIntegerValue(this, (((((pool + "_") + user) + "_") + toString(newPosNum)) + kUserPosition)) | |
1161 | + | let $t03661736711 = getPoolBalances(Address(fromBase58String(pool)), pType, AId, BId) | |
1162 | + | if (($t03661736711 == $t03661736711)) | |
1163 | + | then { | |
1164 | + | let newBalB = $t03661736711._2 | |
1165 | + | let newBalA = $t03661736711._1 | |
1166 | + | let prImpact = calcPriceImpact(balA, balB, newBalA, newBalB) | |
1167 | + | let $t03678136896 = calcWithdrawLPFromPoolVirt(Address(fromBase58String(pool)), pType, shareId, userStaked) | |
1168 | + | let wAmountA = $t03678136896._1 | |
1169 | + | let wAmountB = $t03678136896._2 | |
1170 | + | $Tuple2(nil, [prImpact, wAmountA, wAmountB]) | |
1171 | + | } | |
1172 | + | else throw("Strict value is not equal to itself.") | |
1135 | 1173 | } | |
1136 | 1174 | else throw("Strict value is not equal to itself.") | |
1137 | 1175 | } | |
1138 | 1176 | else throw("Strict value is not equal to itself.") | |
1139 | 1177 | } | |
1140 | - | else throw("Strict value is not equal to itself.") | |
1141 | - | } | |
1142 | - | else { | |
1143 | - | let $t03567735792 = replenishByType(pType, pool, NO_LOAN_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId) | |
1144 | - | if (($t03567735792 == $t03567735792)) | |
1145 | - | then { | |
1146 | - | let axlyFee = $t03567735792._2 | |
1147 | - | let userStaked = $t03567735792._1 | |
1148 | - | let $t03579835892 = getPoolBalances(Address(fromBase58String(pool)), pType, AId, BId) | |
1149 | - | if (($t03579835892 == $t03579835892)) | |
1178 | + | else { | |
1179 | + | let $t03694937064 = replenishByType(pType, pool, NO_LOAN_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId) | |
1180 | + | if (($t03694937064 == $t03694937064)) | |
1150 | 1181 | then { | |
1151 | - | let newBalB = $t03579835892._2 | |
1152 | - | let newBalA = $t03579835892._1 | |
1153 | - | let prImpact = calcPriceImpact(balA, balB, newBalA, newBalB) | |
1154 | - | let $t03596236077 = calcWithdrawLPFromPoolVirt(Address(fromBase58String(pool)), pType, shareId, userStaked) | |
1155 | - | let wAmountA = $t03596236077._1 | |
1156 | - | let wAmountB = $t03596236077._2 | |
1157 | - | $Tuple2((replenishEntries(pool, user, userStaked, axlyFee, newPosNum, shareId, pType, false) ++ getCursEntries(AId, BId, shareId, [toString(wAmountA), toString(wAmountB)])), [prImpact, wAmountA, wAmountB]) | |
1182 | + | let axlyFee = $t03694937064._2 | |
1183 | + | let userStaked = $t03694937064._1 | |
1184 | + | let $t03707037164 = getPoolBalances(Address(fromBase58String(pool)), pType, AId, BId) | |
1185 | + | if (($t03707037164 == $t03707037164)) | |
1186 | + | then { | |
1187 | + | let newBalB = $t03707037164._2 | |
1188 | + | let newBalA = $t03707037164._1 | |
1189 | + | let prImpact = calcPriceImpact(balA, balB, newBalA, newBalB) | |
1190 | + | let $t03723437349 = calcWithdrawLPFromPoolVirt(Address(fromBase58String(pool)), pType, shareId, userStaked) | |
1191 | + | let wAmountA = $t03723437349._1 | |
1192 | + | let wAmountB = $t03723437349._2 | |
1193 | + | $Tuple2((replenishEntries(pool, user, userStaked, axlyFee, newPosNum, shareId, pType, false) ++ getCursEntries(AId, BId, shareId, [toString(wAmountA), toString(wAmountB)])), [prImpact, wAmountA, wAmountB]) | |
1194 | + | } | |
1195 | + | else throw("Strict value is not equal to itself.") | |
1158 | 1196 | } | |
1159 | 1197 | else throw("Strict value is not equal to itself.") | |
1160 | 1198 | } | |
1161 | - | else throw("Strict value is not equal to itself.") | |
1162 | 1199 | } | |
1163 | 1200 | } | |
1164 | - | ||
1201 | + | }) | |
1165 | 1202 | ||
1166 | 1203 | ||
1167 | 1204 | ||
1168 | 1205 | @Callable(i) | |
1169 | - | func withdraw (pool,posId) = valueOrElse(isActiveForUsers(), withdrawToUser(toString(i.caller), pool, toString(posId), false)) | |
1206 | + | func withdraw (pool,posId) = valueOrElse(isActiveForUsers(), { | |
1207 | + | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
1208 | + | if (!(isPoolActive(pool, pType))) | |
1209 | + | then throw("Pool not active at this moment") | |
1210 | + | else withdrawToUser(toString(i.caller), pool, toString(posId), false) | |
1211 | + | }) | |
1170 | 1212 | ||
1171 | 1213 | ||
1172 | 1214 | ||
1173 | 1215 | @Callable(i) | |
1174 | 1216 | func createUpdateStopLoss (posId,poolId,assetId,price) = valueOrElse(isActiveForUsers(), { | |
1175 | 1217 | let tokenOraclePrice = getIntegerValue(priceOracleAddr, (assetId + kPriceInOracle)) | |
1176 | - | if (!(isDefined(getInteger(this, (((((poolId + "_") + toString(i.caller)) + "_") + toString(posId)) + kUserPosition))))) | |
1177 | - | then throw("There are no user position") | |
1178 | - | else if ((0 >= price)) | |
1179 | - | then throw("Price must be greater than 0") | |
1180 | - | else if ((price > tokenOraclePrice)) | |
1181 | - | then throw("Price must be less than current token price") | |
1182 | - | else [IntegerEntry((((((((toString(i.caller) + "_") + toString(posId)) + "_") + poolId) + "_") + assetId) + kUserStopLoss), price)] | |
1218 | + | let pType = valueOrErrorMessage(getString(this, (kPool + poolId)), "Pool is not inited") | |
1219 | + | if (!(isPoolActive(poolId, pType))) | |
1220 | + | then throw("Pool not active at this moment") | |
1221 | + | else if (!(isDefined(getInteger(this, (((((poolId + "_") + toString(i.caller)) + "_") + toString(posId)) + kUserPosition))))) | |
1222 | + | then throw("There are no user position") | |
1223 | + | else if ((0 >= price)) | |
1224 | + | then throw("Price must be greater than 0") | |
1225 | + | else if ((price > tokenOraclePrice)) | |
1226 | + | then throw("Price must be less than current token price") | |
1227 | + | else [IntegerEntry((((((((toString(i.caller) + "_") + toString(posId)) + "_") + poolId) + "_") + assetId) + kUserStopLoss), price)] | |
1183 | 1228 | }) | |
1184 | 1229 | ||
1185 | 1230 | ||
1186 | 1231 | ||
1187 | 1232 | @Callable(i) | |
1188 | - | func deleteStopLoss (posId,poolId,assetId) = valueOrElse(isActiveForUsers(), if (!(isDefined(getInteger(this, (((((((toString(i.caller) + "_") + toString(posId)) + "_") + poolId) + "_") + assetId) + kUserStopLoss))))) | |
1189 | - | then throw("No entry") | |
1190 | - | else [DeleteEntry((((((((toString(i.caller) + "_") + toString(posId)) + "_") + poolId) + "_") + assetId) + kUserStopLoss))]) | |
1233 | + | func deleteStopLoss (posId,poolId,assetId) = valueOrElse(isActiveForUsers(), { | |
1234 | + | let pType = valueOrErrorMessage(getString(this, (kPool + poolId)), "Pool is not inited") | |
1235 | + | if (!(isPoolActive(poolId, pType))) | |
1236 | + | then throw("Pool not active at this moment") | |
1237 | + | else if (!(isDefined(getInteger(this, (((((((toString(i.caller) + "_") + toString(posId)) + "_") + poolId) + "_") + assetId) + kUserStopLoss))))) | |
1238 | + | then throw("No entry") | |
1239 | + | else [DeleteEntry((((((((toString(i.caller) + "_") + toString(posId)) + "_") + poolId) + "_") + assetId) + kUserStopLoss))] | |
1240 | + | }) | |
1191 | 1241 | ||
1192 | 1242 | ||
1193 | 1243 | ||
1194 | 1244 | @Callable(i) | |
1195 | - | func init (moneyBoxAddr,sfFarmingAddr,lendAddr,priceOracleAddr,keeperExContract,wxSwapContract,swopAssetId,wxAssetId,adminPubKey) = if ((toString(i.caller) != "3PG42y6FgT8zM3uX5tEDxJF5rqX8AKGJRAR")) | |
1196 | - | then throw("Only admin can call this function") | |
1197 | - | else if (isDefined(getString(kAdminCallPK))) | |
1198 | - | then throw("Already inited") | |
1199 | - | else [StringEntry(kMoneyBox, moneyBoxAddr), StringEntry(kSFFarmingAddr, sfFarmingAddr), StringEntry(kLendService, lendAddr), StringEntry(kPriceOracle, priceOracleAddr), StringEntry(kExContract, keeperExContract), StringEntry(kWxSwapContract, wxSwapContract), StringEntry(kSwopId, swopAssetId), StringEntry(kWxId, wxAssetId), StringEntry(kAdminCallPK, adminPubKey)] | |
1245 | + | func init (moneyBoxAddr,sfFarmingAddr,lendAddr,priceOracleAddr,keeperExContract,wxSwapContract,swopAssetId,wxAssetId,adminPubKey) = valueOrElse(isSelfCall(i), if (isDefined(getString(kAdminCallPK))) | |
1246 | + | then throw("Already inited") | |
1247 | + | else if (!(isDefined(addressFromString(moneyBoxAddr)))) | |
1248 | + | then throw("moneyBoxAddr is not correct address") | |
1249 | + | else if (!(isDefined(addressFromString(sfFarmingAddr)))) | |
1250 | + | then throw("sfFarmingAddr is not correct address") | |
1251 | + | else if (!(isDefined(addressFromString(lendAddr)))) | |
1252 | + | then throw("lendAddr is not correct address") | |
1253 | + | else if (!(isDefined(addressFromString(priceOracleAddr)))) | |
1254 | + | then throw("priceOracleAddr is not correct address") | |
1255 | + | else if (!(isDefined(addressFromString(keeperExContract)))) | |
1256 | + | then throw("keeperExContract is not correct address") | |
1257 | + | else if (!(isDefined(assetInfo(fromBase58String(swopAssetId))))) | |
1258 | + | then throw("swopAssetId is not correct asset id") | |
1259 | + | else if (!(isDefined(assetInfo(fromBase58String(wxAssetId))))) | |
1260 | + | then throw("swopAssetId is not correct asset id") | |
1261 | + | else if ((size(fromBase58String(adminPubKey)) != 32)) | |
1262 | + | then throw("adminPubKey is not correct") | |
1263 | + | else [StringEntry(kMoneyBox, moneyBoxAddr), StringEntry(kSFFarmingAddr, sfFarmingAddr), StringEntry(kLendService, lendAddr), StringEntry(kPriceOracle, priceOracleAddr), StringEntry(kExContract, keeperExContract), StringEntry(kWxSwapContract, wxSwapContract), StringEntry(kSwopId, swopAssetId), StringEntry(kWxId, wxAssetId), StringEntry(kAdminCallPK, adminPubKey)]) | |
1200 | 1264 | ||
1201 | 1265 | ||
1202 | 1266 | ||
1203 | 1267 | @Callable(i) | |
1204 | 1268 | func createNewRequest (params) = valueOrElse(isSelfCall(i), { | |
1205 | 1269 | let newRequestId = (valueOrElse(getInteger(this, kRequestIter), 0) + 1) | |
1206 | 1270 | $Tuple2([StringEntry((toString(newRequestId) + kRequestId), params), IntegerEntry(kRequestIter, newRequestId)], newRequestId) | |
1207 | 1271 | }) | |
1208 | 1272 | ||
1209 | 1273 | ||
1210 | 1274 | ||
1211 | 1275 | @Callable(i) | |
1212 | 1276 | func replenishFromLand (requestId) = valueOrElse(isActive(), valueOrElse(isLandCall(i), { | |
1213 | - | let $ | |
1214 | - | let user = $ | |
1215 | - | let pool = $ | |
1216 | - | let pmtA = $ | |
1217 | - | let AId = $ | |
1218 | - | let pmtB = $ | |
1219 | - | let BId = $ | |
1220 | - | let balA = $ | |
1221 | - | let balB = $ | |
1222 | - | let shareId = $ | |
1223 | - | let bwAsset = $ | |
1224 | - | let bwAmount = $ | |
1277 | + | let $t04139841502 = parseRequest(requestId) | |
1278 | + | let user = $t04139841502._1 | |
1279 | + | let pool = $t04139841502._2 | |
1280 | + | let pmtA = $t04139841502._3 | |
1281 | + | let AId = $t04139841502._4 | |
1282 | + | let pmtB = $t04139841502._5 | |
1283 | + | let BId = $t04139841502._6 | |
1284 | + | let balA = $t04139841502._7 | |
1285 | + | let balB = $t04139841502._8 | |
1286 | + | let shareId = $t04139841502._9 | |
1287 | + | let bwAsset = $t04139841502._10 | |
1288 | + | let bwAmount = $t04139841502._11 | |
1225 | 1289 | if ((size(i.payments) != 1)) | |
1226 | 1290 | then throw("Wrong payment size") | |
1227 | 1291 | else if (if ((assetIdToStr(i.payments[0].assetId) != bwAsset)) | |
1228 | 1292 | then true | |
1229 | 1293 | else (i.payments[0].amount != bwAmount)) | |
1230 | 1294 | then throw("Wrong payment") | |
1231 | 1295 | else { | |
1232 | - | let $ | |
1296 | + | let $t04169241792 = if ((AId == bwAsset)) | |
1233 | 1297 | then $Tuple2((pmtA + bwAmount), pmtB) | |
1234 | 1298 | else $Tuple2(pmtA, (pmtB + bwAmount)) | |
1235 | - | let pmtAllA = $ | |
1236 | - | let pmtAllB = $ | |
1299 | + | let pmtAllA = $t04169241792._1 | |
1300 | + | let pmtAllB = $t04169241792._2 | |
1237 | 1301 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Unknown pool") | |
1238 | - | let $ | |
1239 | - | let userStaked = $ | |
1240 | - | let axlyFee = $ | |
1302 | + | let $t04187441989 = replenishByType(pType, pool, LOAN_FEE, pmtAllA, AId, pmtAllB, BId, balA, balB, shareId) | |
1303 | + | let userStaked = $t04187441989._1 | |
1304 | + | let axlyFee = $t04187441989._2 | |
1241 | 1305 | let posNum = getNewUserPositionNumber(user) | |
1242 | 1306 | let borrowEntries = [IntegerEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserBorrowAmount), bwAmount), StringEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserBorrowAssetId), bwAsset)] | |
1243 | 1307 | let entries = replenishEntries(pool, user, userStaked, axlyFee, posNum, shareId, pType, true) | |
1244 | - | let $ | |
1245 | - | let wAmountA = $ | |
1246 | - | let wAmountB = $ | |
1308 | + | let $t04234942464 = calcWithdrawLPFromPoolVirt(Address(fromBase58String(pool)), pType, shareId, userStaked) | |
1309 | + | let wAmountA = $t04234942464._1 | |
1310 | + | let wAmountB = $t04234942464._2 | |
1247 | 1311 | $Tuple2((((entries ++ getCursEntries(AId, BId, shareId, [toString(wAmountA), toString(wAmountB)])) ++ borrowEntries) :+ DeleteEntry((requestId + kRequestId))), userStaked) | |
1248 | 1312 | } | |
1249 | 1313 | })) | |
1250 | 1314 | ||
1251 | 1315 | ||
1252 | 1316 | ||
1253 | 1317 | @Callable(i) | |
1254 | 1318 | func liquidate (user,posId,liquidateAmount) = valueOrElse(isActive(), valueOrElse(isLandCall(i), { | |
1255 | 1319 | let pool = valueOrErrorMessage(getString(this, (((user + "_") + posId) + kUserPositionPool)), "no position") | |
1256 | 1320 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
1257 | - | let $ | |
1258 | - | let AId = $ | |
1259 | - | let BId = $ | |
1260 | - | let balA = $ | |
1261 | - | let balB = $ | |
1262 | - | let shareId = $ | |
1321 | + | let $t04298543075 = getPoolData(Address(fromBase58String(pool)), pType) | |
1322 | + | let AId = $t04298543075._1 | |
1323 | + | let BId = $t04298543075._2 | |
1324 | + | let balA = $t04298543075._3 | |
1325 | + | let balB = $t04298543075._4 | |
1326 | + | let shareId = $t04298543075._5 | |
1263 | 1327 | let amount = unstakeLP(pool, pType, shareId, liquidateAmount) | |
1264 | 1328 | let borrowAmount = getIntegerValue(this, (((((pool + "_") + user) + "_") + posId) + kUserBorrowAmount)) | |
1265 | 1329 | let borrowAsset = getStringValue(this, (((((pool + "_") + user) + "_") + posId) + kUserBorrowAssetId)) | |
1266 | 1330 | let userCanWithdraw = userCanWithdrawShareCalc(user, pool, posId, (borrowAmount > 0)) | |
1267 | 1331 | if ((liquidateAmount > userCanWithdraw)) | |
1268 | 1332 | then throw("You can't liquidate more than user have") | |
1269 | 1333 | else if ((borrowAmount == 0)) | |
1270 | 1334 | then throw("You can't liquidate position without borrow") | |
1271 | 1335 | else [IntegerEntry((((((pool + "_") + user) + "_") + posId) + kUserPositionInterest), getIntegerValue(this, (pool + kPoolInterestLoan))), IntegerEntry((pool + kPoolTotalLoan), (getPoolTotalShareWithLoan(pool) - liquidateAmount)), IntegerEntry((pool + kPoolTotal), (getPoolTotalShare(pool) - liquidateAmount)), IntegerEntry((((((pool + "_") + user) + "_") + posId) + kUserPosition), (userCanWithdraw - liquidateAmount)), ScriptTransfer(i.caller, amount, fromBase58String(shareId))] | |
1272 | 1336 | })) | |
1273 | 1337 | ||
1274 | 1338 | ||
1275 | 1339 | ||
1276 | 1340 | @Callable(i) | |
1277 | 1341 | func stopLoss (user,posId,pool,assetId) = valueOrElse(isActive(), valueOrElse(isAdminCall(i), { | |
1278 | 1342 | let tokenOraclePrice = getIntegerValue(priceOracleAddr, (assetId + kPriceInOracle)) | |
1279 | - | if ((tokenOraclePrice > tokenOraclePrice)) | |
1343 | + | let stopLossPrice = valueOrErrorMessage(getInteger(this, (((((((user + "_") + toString(posId)) + "_") + pool) + "_") + assetId) + kUserStopLoss)), "No entry") | |
1344 | + | if ((tokenOraclePrice > stopLossPrice)) | |
1280 | 1345 | then throw("Token price greater stop loss price") | |
1281 | - | else if (!(isDefined(getInteger(this, (((((((user + "_") + toString(posId)) + "_") + pool) + "_") + assetId) + kUserStopLoss))))) | |
1282 | - | then throw("No entry") | |
1283 | - | else { | |
1284 | - | let res = withdrawToUser(user, pool, toString(posId), true) | |
1285 | - | $Tuple2((res._1 :+ DeleteEntry((((((((user + "_") + toString(posId)) + "_") + pool) + "_") + assetId) + kUserStopLoss))), res._2) | |
1286 | - | } | |
1346 | + | else { | |
1347 | + | let res = withdrawToUser(user, pool, toString(posId), true) | |
1348 | + | $Tuple2((res._1 :+ DeleteEntry((((((((user + "_") + toString(posId)) + "_") + pool) + "_") + assetId) + kUserStopLoss))), res._2) | |
1349 | + | } | |
1287 | 1350 | })) | |
1288 | 1351 | ||
1289 | 1352 | ||
1290 | 1353 | ||
1291 | 1354 | @Callable(i) | |
1292 | 1355 | func capitalizeExKeeper (pool,tokenToId,amountToExchange,claim,amountsIn,addresses,assetsToReceive,estReceived,slippageTolerance,minReceived,options) = valueOrElse(isActive(), valueOrElse(isAdminCall(i), { | |
1293 | 1356 | let pType = getStringValue(this, (kPool + pool)) | |
1294 | 1357 | let change = valueOrElse(getInteger(this, (pool + kPoolCapChange)), 0) | |
1295 | - | let $ | |
1296 | - | let claimedAmount = $ | |
1297 | - | let claimedAsset = $ | |
1358 | + | let $t04521845319 = claimAndCheckAmntEx(pool, pType, claim, amountToExchange, change) | |
1359 | + | let claimedAmount = $t04521845319._1 | |
1360 | + | let claimedAsset = $t04521845319._2 | |
1298 | 1361 | let exchangedAmount = exchangeKeeper(tokenToId, amountToExchange, claimedAsset, amountsIn, addresses, assetsToReceive, estReceived, slippageTolerance, minReceived, options) | |
1299 | 1362 | let newChange = ((claimedAmount + change) - amountToExchange) | |
1300 | 1363 | let changeEntry = if ((newChange >= 0)) | |
1301 | 1364 | then [IntegerEntry((pool + kPoolCapChange), newChange)] | |
1302 | 1365 | else nil | |
1303 | 1366 | (capitalize(pool, pType, tokenToId, exchangedAmount) ++ changeEntry) | |
1304 | 1367 | })) | |
1305 | 1368 | ||
1306 | 1369 | ||
1307 | 1370 | ||
1308 | 1371 | @Callable(i) | |
1309 | 1372 | func capitalizeExPuzzle (pool,tokenToId,amountToExchange,claim,routesStr,minToReceive,options) = valueOrElse(isActive(), valueOrElse(isAdminCall(i), { | |
1310 | 1373 | let pType = getStringValue(this, (kPool + pool)) | |
1311 | 1374 | let change = valueOrElse(getInteger(this, (pool + kPoolCapChange)), 0) | |
1312 | - | let $ | |
1313 | - | let claimedAmount = $ | |
1314 | - | let claimedAsset = $ | |
1375 | + | let $t04609446195 = claimAndCheckAmntEx(pool, pType, claim, amountToExchange, change) | |
1376 | + | let claimedAmount = $t04609446195._1 | |
1377 | + | let claimedAsset = $t04609446195._2 | |
1315 | 1378 | let exchangedAmount = exchangePuzzle(tokenToId, amountToExchange, claimedAsset, routesStr, minToReceive, options) | |
1316 | 1379 | let newChange = ((claimedAmount + change) - amountToExchange) | |
1317 | 1380 | let changeEntry = if ((newChange >= 0)) | |
1318 | 1381 | then [IntegerEntry((pool + kPoolCapChange), newChange)] | |
1319 | 1382 | else nil | |
1320 | 1383 | (capitalize(pool, pType, tokenToId, exchangedAmount) ++ changeEntry) | |
1321 | 1384 | })) | |
1322 | 1385 | ||
1323 | 1386 | ||
1324 | 1387 | ||
1325 | 1388 | @Callable(i) | |
1326 | 1389 | func capitalizeExSwopFi (pool,tokenToId,amountToExchange,claim,exchangers,exchangersType,args1,args2,routingAssetsKeys,minAmountToReceive,options) = valueOrElse(isActive(), valueOrElse(isAdminCall(i), { | |
1327 | 1390 | let pType = getStringValue(this, (kPool + pool)) | |
1328 | 1391 | let change = valueOrElse(getInteger(this, (pool + kPoolCapChange)), 0) | |
1329 | - | let $ | |
1330 | - | let claimedAmount = $ | |
1331 | - | let claimedAsset = $ | |
1392 | + | let $t04703747138 = claimAndCheckAmntEx(pool, pType, claim, amountToExchange, change) | |
1393 | + | let claimedAmount = $t04703747138._1 | |
1394 | + | let claimedAsset = $t04703747138._2 | |
1332 | 1395 | let exchangedAmount = exchangeSwopFi(tokenToId, amountToExchange, claimedAsset, exchangers, exchangersType, args1, args2, routingAssetsKeys, minAmountToReceive, options) | |
1333 | 1396 | let newChange = ((claimedAmount + change) - amountToExchange) | |
1334 | 1397 | let changeEntry = if ((newChange >= 0)) | |
1335 | 1398 | then [IntegerEntry((pool + kPoolCapChange), newChange)] | |
1336 | 1399 | else nil | |
1337 | 1400 | (capitalize(pool, pType, tokenToId, exchangedAmount) ++ changeEntry) | |
1338 | 1401 | })) | |
1339 | 1402 | ||
1340 | 1403 | ||
1341 | 1404 | ||
1342 | 1405 | @Callable(i) | |
1343 | 1406 | func initNewPool (type,poolAddr,inFeeNoLoan,inFeeLoan,capFeeNoLoan,capFeeWithLoan,stoplossFeeNoLoan,stoplossFeeWithLoan,canBorrow) = valueOrElse(isActive(), valueOrElse(isAdminCall(i), if (if ((type != SF_POOL)) | |
1344 | 1407 | then (type != WX_POOL) | |
1345 | 1408 | else false) | |
1346 | 1409 | then throw("Wrong type") | |
1347 | 1410 | else { | |
1348 | - | let $ | |
1349 | - | let aId = $ | |
1350 | - | let bId = $ | |
1351 | - | let aBal = $ | |
1352 | - | let bBal = $ | |
1353 | - | let shareId = $ | |
1411 | + | let $t04786947963 = getPoolData(Address(fromBase58String(poolAddr)), type) | |
1412 | + | let aId = $t04786947963._1 | |
1413 | + | let bId = $t04786947963._2 | |
1414 | + | let aBal = $t04786947963._3 | |
1415 | + | let bBal = $t04786947963._4 | |
1416 | + | let shareId = $t04786947963._5 | |
1354 | 1417 | if ((0 > inFeeNoLoan)) | |
1355 | 1418 | then throw("inFeeNoLoan must be greater than 0") | |
1356 | 1419 | else if ((0 > inFeeLoan)) | |
1357 | 1420 | then throw("inFeeLoan must be greater than 0") | |
1358 | 1421 | else if ((0 > capFeeNoLoan)) | |
1359 | 1422 | then throw("capFeeNoLoan must be greater than 0") | |
1360 | 1423 | else if ((0 > capFeeWithLoan)) | |
1361 | 1424 | then throw("capFeeWithLoan must be greater than 0") | |
1362 | 1425 | else if ((0 > stoplossFeeNoLoan)) | |
1363 | 1426 | then throw("stoplossFeeNoLoan must be greater than 0") | |
1364 | 1427 | else if ((0 > stoplossFeeWithLoan)) | |
1365 | 1428 | then throw("stoplossFeeWithLoan must be greater than 0") | |
1366 | 1429 | else [IntegerEntry((poolAddr + kAxlyInFeeWithoutLoan), inFeeNoLoan), IntegerEntry((poolAddr + kAxlyInFeeWithLoan), inFeeLoan), IntegerEntry((poolAddr + kAxlyNoLoanCapFee), capFeeNoLoan), IntegerEntry((poolAddr + kAxlyWithLoanCapFee), capFeeWithLoan), IntegerEntry((poolAddr + kAxlyStopLossNoLoanFee), stoplossFeeNoLoan), IntegerEntry((poolAddr + kAxlyStopLossLoanFee), stoplossFeeWithLoan), IntegerEntry((poolAddr + kPoolInterestLoan), 0), IntegerEntry((poolAddr + kPoolInterestNoLoan), 0), StringEntry((kPool + poolAddr), type), StringEntry((shareId + kSharePool), poolAddr), BooleanEntry((poolAddr + kPoolCanBorrow), canBorrow)] | |
1367 | 1430 | })) | |
1368 | 1431 | ||
1369 | 1432 | ||
1370 | 1433 | ||
1371 | 1434 | @Callable(i) | |
1372 | 1435 | func activate () = valueOrElse(isAdminCall(i), if (valueOrElse(getBoolean(this, kActive), true)) | |
1373 | 1436 | then throw("dApp already active") | |
1374 | 1437 | else [BooleanEntry(kActive, true)]) | |
1375 | 1438 | ||
1376 | 1439 | ||
1377 | 1440 | ||
1378 | 1441 | @Callable(i) | |
1379 | 1442 | func shutdown () = valueOrElse(isAdminCall(i), if (!(valueOrElse(getBoolean(this, kActive), true))) | |
1380 | 1443 | then throw("dApp already shutdown") | |
1381 | 1444 | else [BooleanEntry(kActive, false)]) | |
1382 | 1445 | ||
1383 | 1446 | ||
1384 | 1447 | ||
1385 | 1448 | @Callable(i) | |
1386 | 1449 | func activateForUsers () = valueOrElse(isAdminCall(i), if (valueOrElse(getBoolean(this, kActiveUsers), true)) | |
1387 | 1450 | then throw("dApp already active for users") | |
1388 | 1451 | else [BooleanEntry(kActiveUsers, true)]) | |
1389 | 1452 | ||
1390 | 1453 | ||
1391 | 1454 | ||
1392 | 1455 | @Callable(i) | |
1393 | 1456 | func shutdownForUsers () = valueOrElse(isAdminCall(i), if (!(valueOrElse(getBoolean(this, kActiveUsers), true))) | |
1394 | 1457 | then throw("dApp already shutdown for users") | |
1395 | 1458 | else [BooleanEntry(kActiveUsers, false)]) | |
1396 | 1459 | ||
1397 | 1460 | ||
1398 | 1461 | ||
1399 | 1462 | @Callable(i) | |
1400 | 1463 | func activateSF () = valueOrElse(isAdminCall(i), if (valueOrElse(getBoolean(this, (SF_POOL + kActiveSFWX)), true)) | |
1401 | 1464 | then throw("SWOPFI already active") | |
1402 | 1465 | else [BooleanEntry((SF_POOL + kActiveSFWX), true)]) | |
1403 | 1466 | ||
1404 | 1467 | ||
1405 | 1468 | ||
1406 | 1469 | @Callable(i) | |
1407 | 1470 | func shutdownSF () = valueOrElse(isAdminCall(i), if (!(valueOrElse(getBoolean(this, (SF_POOL + kActiveSFWX)), true))) | |
1408 | 1471 | then throw("SWOPFI already shutdown") | |
1409 | 1472 | else [BooleanEntry((SF_POOL + kActiveSFWX), false)]) | |
1410 | 1473 | ||
1411 | 1474 | ||
1412 | 1475 | ||
1413 | 1476 | @Callable(i) | |
1414 | 1477 | func activateWX () = valueOrElse(isAdminCall(i), if (valueOrElse(getBoolean(this, (WX_POOL + kActiveSFWX)), true)) | |
1415 | 1478 | then throw("WX already active") | |
1416 | 1479 | else [BooleanEntry((WX_POOL + kActiveSFWX), true)]) | |
1417 | 1480 | ||
1418 | 1481 | ||
1419 | 1482 | ||
1420 | 1483 | @Callable(i) | |
1421 | 1484 | func shutdownWX () = valueOrElse(isAdminCall(i), if (!(valueOrElse(getBoolean(this, (WX_POOL + kActiveSFWX)), true))) | |
1422 | 1485 | then throw("WX already shutdown") | |
1423 | 1486 | else [BooleanEntry((WX_POOL + kActiveSFWX), false)]) | |
1424 | 1487 | ||
1425 | 1488 | ||
1426 | 1489 | ||
1427 | 1490 | @Callable(i) | |
1428 | 1491 | func activatePool (pool) = valueOrElse(isAdminCall(i), if (!(isDefined(getString(this, (kPool + pool))))) | |
1429 | 1492 | then throw("Unknown pool") | |
1430 | 1493 | else if (valueOrElse(getBoolean(this, (pool + kPoolActive)), true)) | |
1431 | 1494 | then throw("Pool already active") | |
1432 | 1495 | else [BooleanEntry((pool + kPoolActive), true)]) | |
1433 | 1496 | ||
1434 | 1497 | ||
1435 | 1498 | ||
1436 | 1499 | @Callable(i) | |
1437 | 1500 | func shutdownPool (pool) = valueOrElse(isAdminCall(i), if (!(isDefined(getString(this, (kPool + pool))))) | |
1438 | 1501 | then throw("Unknown pool") | |
1439 | 1502 | else if (!(valueOrElse(getBoolean(this, (pool + kPoolActive)), true))) | |
1440 | 1503 | then throw("Pool already shutdown") | |
1441 | 1504 | else [BooleanEntry((pool + kPoolActive), false)]) | |
1442 | 1505 | ||
1443 | 1506 | ||
1444 | 1507 | @Verifier(tx) | |
1445 | 1508 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
1446 | 1509 |
github/deemru/w8io/026f985 202.59 ms ◑