tx · 5HMiBS6JiQu9JCLuKC3vcJq1dySEYFFQoyDhnsmGt27g 3MvRWw2FPEimFCTGtK7qY9uAJbM7XJ4ZfJS: -0.04100000 Waves 2023.05.30 15:38 [2600714] smart account 3MvRWw2FPEimFCTGtK7qY9uAJbM7XJ4ZfJS > SELF 0.00000000 Waves
{ "type": 13, "id": "5HMiBS6JiQu9JCLuKC3vcJq1dySEYFFQoyDhnsmGt27g", "fee": 4100000, "feeAssetId": null, "timestamp": 1685450344949, "version": 2, "chainId": 84, "sender": "3MvRWw2FPEimFCTGtK7qY9uAJbM7XJ4ZfJS", "senderPublicKey": "HP8sssVq1866F7CaPQJwgFrt6fsqhQjKwM84cL1wjD2a", "proofs": [ "MhNnCUBKVCGaM82AV8QoTfMGAoeZvZstQ9UFqY1ygrX1Ub21d246C6KLKXS7VVWzUpqA35HZ5xGRyDuSDoPrD5n" ], "script": "base64:BgKRAQgCEgcKBQgBCAEBEgMKAQgSBAoCCAgSBQoDCAEIEgMKAQgSBAoCCAESBgoEAQgIARIFCgMBCAgSAwoBCBIGCgQIAQgIEgUKAwgIARIOCgwICAgBBBEYGBEBARgSCgoICAgIAQQIARgSDgoMCAgIAQQYGBgYGAEYEgoKCAgIAQEBAQEBEgYKBAgICAESBAoCCAhbAAdTRl9QT09MAgJTRgAHV1hfUE9PTAICV1gAD0NBUF9GRUVfTk9fTE9BTgIJY2FwTm9Mb2FuAAxDQVBfRkVFX0xPQU4CB2NhcExvYW4AFFNUT1BMT1NTX0ZFRV9OT19MT0FOAg5zdG9wTG9zc05vTG9hbgANU1RPUExPU1NfTE9BTgIMc3RvcExvc3NMb2FuAAhMT0FOX0ZFRQIEbG9hbgALTk9fTE9BTl9GRUUCBm5vTG9hbgAGTk9fRkVFAgVub0ZlZQAGU0NBTEU4AIDC1y8AB1NDQUxFMTAAgMivoCUACkZFRV9TQ0FMRTYAwIQ9ABRrU0ZQb29sQUFzc2V0QmFsYW5jZQIPQV9hc3NldF9iYWxhbmNlABRrU0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kA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tleceaaFM=", "height": 2600714, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 7eS7p2qcascyrRY5Cd1Ctg1LAVVmSSpAhUH83QsThSBa Next: 6TbKo8A2zLaJThrj13ersx3KLkfDtus8QY3kXiQUznos Diff:
Old | New | Differences | |
---|---|---|---|
568 | 568 | } | |
569 | 569 | ||
570 | 570 | ||
571 | + | func unstakeLP (pool,pType,shareId,amount) = { | |
572 | + | let $t01773918096 = if ((pType == SF_POOL)) | |
573 | + | then $Tuple3(getSFFarmingAddr(), "withdrawShareTokens", [pool, amount]) | |
574 | + | else if ((pType == WX_POOL)) | |
575 | + | then $Tuple3(getWXFarmingAddr(Address(fromBase58String(pool))), "unstake", [shareId, amount]) | |
576 | + | else throw("Wrong pool type") | |
577 | + | let farmAddr = $t01773918096._1 | |
578 | + | let fName = $t01773918096._2 | |
579 | + | let params = $t01773918096._3 | |
580 | + | let inv = invoke(farmAddr, fName, params, nil) | |
581 | + | if ((inv == inv)) | |
582 | + | then amount | |
583 | + | else throw("Strict value is not equal to itself.") | |
584 | + | } | |
585 | + | ||
586 | + | ||
571 | 587 | func capitalize (pool,pType,tokenId,tokenAmount) = { | |
572 | 588 | let poolAddr = Address(fromBase58String(pool)) | |
573 | - | let $ | |
574 | - | let AId = $ | |
575 | - | let BId = $ | |
576 | - | let balA = $ | |
577 | - | let balB = $ | |
578 | - | let shareId = $ | |
579 | - | let $ | |
589 | + | let $t01831318392 = getPoolData(poolAddr, pType) | |
590 | + | let AId = $t01831318392._1 | |
591 | + | let BId = $t01831318392._2 | |
592 | + | let balA = $t01831318392._3 | |
593 | + | let balB = $t01831318392._4 | |
594 | + | let shareId = $t01831318392._5 | |
595 | + | let $t01839518475 = if ((tokenId == AId)) | |
580 | 596 | then $Tuple2(tokenAmount, 0) | |
581 | 597 | else $Tuple2(0, tokenAmount) | |
582 | - | let pmtA = $ | |
583 | - | let pmtB = $ | |
584 | - | let $ | |
585 | - | let stakedAmount = $ | |
586 | - | let nf = $ | |
598 | + | let pmtA = $t01839518475._1 | |
599 | + | let pmtB = $t01839518475._2 | |
600 | + | let $t01847818582 = replenishByType(pType, pool, NO_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId) | |
601 | + | let stakedAmount = $t01847818582._1 | |
602 | + | let nf = $t01847818582._2 | |
587 | 603 | let curPoolInterestLoan = valueOrElse(getInteger(this, (pool + kPoolInterestLoan)), 0) | |
588 | 604 | let curPoolInterestNoLoan = valueOrElse(getInteger(this, (pool + kPoolInterestNoLoan)), 0) | |
589 | 605 | let totalShareAmount = getPoolTotalShare(pool) | |
599 | 615 | else 0 | |
600 | 616 | let axlyFeeLoan = fraction(stakedLoan, getAxlyFee(pool, CAP_FEE_LOAN), FEE_SCALE6) | |
601 | 617 | let axlyFeeNoLoan = fraction(stakedNoLoan, getAxlyFee(pool, CAP_FEE_NO_LOAN), FEE_SCALE6) | |
602 | - | ([IntegerEntry((pool + kPoolInterestLoan), newInterestLoan), IntegerEntry((pool + kPoolInterestNoLoan), newInterestNoLoan), IntegerEntry((pool + kPoolTotal), (((totalShareAmount + stakedAmount) - axlyFeeLoan) - axlyFeeNoLoan)), IntegerEntry((pool + kPoolTotalLoan), ((totalShareAmountWithLoan + stakedLoan) - axlyFeeLoan)), ScriptTransfer(moneyBox, (axlyFeeLoan + axlyFeeNoLoan), fromBase58String(shareId))] ++ getCursEntries(AId, BId, shareId)) | |
618 | + | let axlyFee = unstakeLP(pool, pType, shareId, (axlyFeeLoan + axlyFeeNoLoan)) | |
619 | + | if ((axlyFee == axlyFee)) | |
620 | + | 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)) | |
621 | + | else throw("Strict value is not equal to itself.") | |
603 | 622 | } | |
604 | 623 | ||
605 | 624 | ||
608 | 627 | let feeScale6 = 1000000 | |
609 | 628 | let fee = getIntegerValue(poolAddr, kSFPoolFee) | |
610 | 629 | let amntGetNoFee = fraction(amountTokenToGet, feeScale6, (feeScale6 - fee)) | |
611 | - | let $ | |
630 | + | let $t02047220760 = if ((assetTokenToGet == assetIdA)) | |
612 | 631 | then { | |
613 | 632 | let amountToPay = fraction(balA, amntGetNoFee, (balB - amntGetNoFee)) | |
614 | 633 | $Tuple2(amountToPay, assetIdB) | |
617 | 636 | let amountToPay = fraction(balB, amntGetNoFee, (balA - amntGetNoFee)) | |
618 | 637 | $Tuple2(amountToPay, assetIdA) | |
619 | 638 | } | |
620 | - | let amountToPay = $ | |
621 | - | let assetToPay = $ | |
639 | + | let amountToPay = $t02047220760._1 | |
640 | + | let assetToPay = $t02047220760._2 | |
622 | 641 | invoke(poolAddr, "callFunction", ["exchange", ["1"]], [AttachedPayment(assetIdFromStr(assetToPay), amountToPay)]) | |
623 | 642 | } | |
624 | 643 | ||
628 | 647 | let prFee = getIntegerValue(wxSwapContract, "%s__protocolFee") | |
629 | 648 | let pFee = getIntegerValue(wxSwapContract, "%s__poolFee") | |
630 | 649 | let feeScale = toBigInt(100000000) | |
631 | - | let $ | |
650 | + | let $t02123921547 = if ((assetTokenToGet == assetIdA)) | |
632 | 651 | then { | |
633 | 652 | let amountToPay = fraction(balA, amountTokenToGet, (balB - amountTokenToGet)) | |
634 | 653 | $Tuple2(amountToPay, assetIdB) | |
637 | 656 | let amountToPay = fraction(balB, amountTokenToGet, (balA - amountTokenToGet)) | |
638 | 657 | $Tuple2(amountToPay, assetIdA) | |
639 | 658 | } | |
640 | - | let amountToPay = $ | |
641 | - | let assetToPay = $ | |
659 | + | let amountToPay = $t02123921547._1 | |
660 | + | let assetToPay = $t02123921547._2 | |
642 | 661 | let amountToPayWithFee = toInt(fraction(toBigInt(amountToPay), feeScale, (feeScale - toBigInt((prFee + pFee))))) | |
643 | 662 | invoke(wxSwapContract, "swap", [1, assetTokenToGet, toString(this)], [AttachedPayment(assetIdFromStr(assetToPay), amountToPayWithFee)]) | |
644 | 663 | } | |
652 | 671 | func withdrawAmountCalc (pool,userCanWithdraw,debt,borrowAsset) = { | |
653 | 672 | let poolAddr = Address(fromBase58String(pool)) | |
654 | 673 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Unknown pool") | |
655 | - | let $ | |
656 | - | let assetIdA = $ | |
657 | - | let assetIdB = $ | |
658 | - | let balA = $ | |
659 | - | let balB = $ | |
660 | - | let shareId = $ | |
674 | + | let $t02241222488 = getPoolData(poolAddr, pType) | |
675 | + | let assetIdA = $t02241222488._1 | |
676 | + | let assetIdB = $t02241222488._2 | |
677 | + | let balA = $t02241222488._3 | |
678 | + | let balB = $t02241222488._4 | |
679 | + | let shareId = $t02241222488._5 | |
661 | 680 | let cBalABefore = accountBalance(assetIdFromStr(assetIdA)) | |
662 | 681 | if ((cBalABefore == cBalABefore)) | |
663 | 682 | then { | |
673 | 692 | then { | |
674 | 693 | let cBalAAfter = accountBalance(assetIdFromStr(assetIdA)) | |
675 | 694 | let cBalBAfter = accountBalance(assetIdFromStr(assetIdB)) | |
676 | - | let $ | |
677 | - | let tokensAmountA = $ | |
678 | - | let tokensAmountB = $ | |
679 | - | let $ | |
695 | + | let $t02300023089 = $Tuple2((cBalAAfter - cBalABefore), (cBalBAfter - cBalBBefore)) | |
696 | + | let tokensAmountA = $t02300023089._1 | |
697 | + | let tokensAmountB = $t02300023089._2 | |
698 | + | let $t02309223788 = if ((debt > 0)) | |
680 | 699 | then { | |
681 | 700 | let amountToGetEx = if (if ((borrowAsset == assetIdA)) | |
682 | 701 | then (debt > tokensAmountA) | |
699 | 718 | else throw("Strict value is not equal to itself.") | |
700 | 719 | } | |
701 | 720 | else $Tuple2(tokensAmountA, tokensAmountB) | |
702 | - | let toUserAmountA = $ | |
703 | - | let toUserAmountB = $ | |
721 | + | let toUserAmountA = $t02309223788._1 | |
722 | + | let toUserAmountB = $t02309223788._2 | |
704 | 723 | $Tuple7(toUserAmountA, assetIdA, toUserAmountB, assetIdB, cBalAAfter, cBalBAfter, shareId) | |
705 | 724 | } | |
706 | 725 | else throw("Strict value is not equal to itself.") | |
737 | 756 | else throw(($getType(@) + " couldn't be cast to Int")) | |
738 | 757 | } | |
739 | 758 | else 0 | |
740 | - | let $ | |
741 | - | if (($ | |
759 | + | let $t02527925432 = withdrawAmountCalc(pool, userCanWithdraw, debt, borrowAsset) | |
760 | + | if (($t02527925432 == $t02527925432)) | |
742 | 761 | then { | |
743 | - | let shareId = $ | |
744 | - | let cBalBAfter = $ | |
745 | - | let cBalAAfter = $ | |
746 | - | let assetIdB = $ | |
747 | - | let toUserAmountB = $ | |
748 | - | let assetIdA = $ | |
749 | - | let toUserAmountA = $ | |
762 | + | let shareId = $t02527925432._7 | |
763 | + | let cBalBAfter = $t02527925432._6 | |
764 | + | let cBalAAfter = $t02527925432._5 | |
765 | + | let assetIdB = $t02527925432._4 | |
766 | + | let toUserAmountB = $t02527925432._3 | |
767 | + | let assetIdA = $t02527925432._2 | |
768 | + | let toUserAmountA = $t02527925432._1 | |
750 | 769 | let closeDbtInv = if ((debt > 0)) | |
751 | 770 | then invoke(getLendSrvAddr(), "repayFor", [((user + "_") + posId)], [AttachedPayment(assetIdFromStr(borrowAsset), debt)]) | |
752 | 771 | else 0 | |
775 | 794 | } | |
776 | 795 | ||
777 | 796 | ||
778 | - | func unstakeLP (pool,pType,shareId,amount) = { | |
779 | - | let $t02613126488 = if ((pType == SF_POOL)) | |
780 | - | then $Tuple3(getSFFarmingAddr(), "withdrawShareTokens", [pool, amount]) | |
781 | - | else if ((pType == WX_POOL)) | |
782 | - | then $Tuple3(getWXFarmingAddr(Address(fromBase58String(pool))), "unstake", [shareId, amount]) | |
783 | - | else throw("Wrong pool type") | |
784 | - | let farmAddr = $t02613126488._1 | |
785 | - | let fName = $t02613126488._2 | |
786 | - | let params = $t02613126488._3 | |
787 | - | let inv = invoke(farmAddr, fName, params, nil) | |
788 | - | if ((inv == inv)) | |
789 | - | then amount | |
790 | - | else throw("Strict value is not equal to itself.") | |
791 | - | } | |
792 | - | ||
793 | - | ||
794 | 797 | @Callable(i) | |
795 | 798 | func replenishEVALONLY (pool,leverage,borrowAssetId,pmtA,pmtB) = if (if ((100 > leverage)) | |
796 | 799 | then true | |
798 | 801 | then throw("Leverage can't be <100 and >300") | |
799 | 802 | else { | |
800 | 803 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
801 | - | let $ | |
802 | - | let AId = $ | |
803 | - | let BId = $ | |
804 | - | let balA = $ | |
805 | - | let balB = $ | |
806 | - | let shareId = $ | |
804 | + | let $t02694427034 = getPoolData(Address(fromBase58String(pool)), pType) | |
805 | + | let AId = $t02694427034._1 | |
806 | + | let BId = $t02694427034._2 | |
807 | + | let balA = $t02694427034._3 | |
808 | + | let balB = $t02694427034._4 | |
809 | + | let shareId = $t02694427034._5 | |
807 | 810 | let borrowAmount = if ((leverage > 100)) | |
808 | 811 | then { | |
809 | 812 | let dPriceA = ( let @ = invoke(priceOracleAddr, "getTWAP60", [AId, false], nil) | |
848 | 851 | then throw("Leverage can't be <100 and >300") | |
849 | 852 | else { | |
850 | 853 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
851 | - | let $ | |
852 | - | let AId = $ | |
853 | - | let BId = $ | |
854 | - | let balA = $ | |
855 | - | let balB = $ | |
856 | - | let shareId = $ | |
857 | - | let $ | |
854 | + | let $t02905029140 = getPoolData(Address(fromBase58String(pool)), pType) | |
855 | + | let AId = $t02905029140._1 | |
856 | + | let BId = $t02905029140._2 | |
857 | + | let balA = $t02905029140._3 | |
858 | + | let balB = $t02905029140._4 | |
859 | + | let shareId = $t02905029140._5 | |
860 | + | let $t02914329780 = if ((size(i.payments) == 2)) | |
858 | 861 | then if ((assetIdToStr(i.payments[0].assetId) != AId)) | |
859 | 862 | then throw("Wrong payment asset A") | |
860 | 863 | else if ((assetIdToStr(i.payments[1].assetId) != BId)) | |
867 | 870 | then $Tuple4(0, AId, i.payments[0].amount, BId) | |
868 | 871 | else throw("Wrong payment") | |
869 | 872 | else throw("One or two payments expected") | |
870 | - | let pmtA = $ | |
871 | - | let pmtAssetA = $ | |
872 | - | let pmtB = $ | |
873 | - | let pmtAssetB = $ | |
873 | + | let pmtA = $t02914329780._1 | |
874 | + | let pmtAssetA = $t02914329780._2 | |
875 | + | let pmtB = $t02914329780._3 | |
876 | + | let pmtAssetB = $t02914329780._4 | |
874 | 877 | let newPosNum = getNewUserPositionNumber(pool, toString(i.caller)) | |
875 | 878 | if ((leverage > 100)) | |
876 | 879 | then { | |
905 | 908 | else throw("Strict value is not equal to itself.") | |
906 | 909 | } | |
907 | 910 | else { | |
908 | - | let $ | |
909 | - | let userStaked = $ | |
910 | - | let axlyFee = $ | |
911 | + | let $t03116331275 = replenishByType(pType, pool, NO_LOAN_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId) | |
912 | + | let userStaked = $t03116331275._1 | |
913 | + | let axlyFee = $t03116331275._2 | |
911 | 914 | (replenishEntries(pool, toString(i.caller), userStaked, axlyFee, newPosNum, shareId, pType, false) ++ getCursEntries(AId, BId, shareId)) | |
912 | 915 | } | |
913 | 916 | } | |
916 | 919 | ||
917 | 920 | @Callable(i) | |
918 | 921 | func replenishFromLand (requestId) = { | |
919 | - | let $ | |
920 | - | let user = $ | |
921 | - | let pool = $ | |
922 | - | let pmtA = $ | |
923 | - | let AId = $ | |
924 | - | let pmtB = $ | |
925 | - | let BId = $ | |
926 | - | let balA = $ | |
927 | - | let balB = $ | |
928 | - | let shareId = $ | |
929 | - | let bwAsset = $ | |
930 | - | let bwAmount = $ | |
922 | + | let $t03148631590 = parseRequest(requestId) | |
923 | + | let user = $t03148631590._1 | |
924 | + | let pool = $t03148631590._2 | |
925 | + | let pmtA = $t03148631590._3 | |
926 | + | let AId = $t03148631590._4 | |
927 | + | let pmtB = $t03148631590._5 | |
928 | + | let BId = $t03148631590._6 | |
929 | + | let balA = $t03148631590._7 | |
930 | + | let balB = $t03148631590._8 | |
931 | + | let shareId = $t03148631590._9 | |
932 | + | let bwAsset = $t03148631590._10 | |
933 | + | let bwAmount = $t03148631590._11 | |
931 | 934 | if ((size(i.payments) != 1)) | |
932 | 935 | then throw("Wrong payment size") | |
933 | 936 | else if (if ((assetIdToStr(i.payments[0].assetId) != bwAsset)) | |
935 | 938 | else (i.payments[0].amount != bwAmount)) | |
936 | 939 | then throw("Wrong payment") | |
937 | 940 | else { | |
938 | - | let $ | |
941 | + | let $t03178031904 = if ((AId == bwAsset)) | |
939 | 942 | then $Tuple2((pmtA + i.payments[0].amount), pmtB) | |
940 | 943 | else $Tuple2(pmtA, (pmtB + i.payments[0].amount)) | |
941 | - | let pmtAllA = $ | |
942 | - | let pmtAllB = $ | |
944 | + | let pmtAllA = $t03178031904._1 | |
945 | + | let pmtAllB = $t03178031904._2 | |
943 | 946 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Unknown pool") | |
944 | - | let $ | |
945 | - | let userStaked = $ | |
946 | - | let axlyFee = $ | |
947 | + | let $t03198632095 = replenishByType(pType, pool, LOAN_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId) | |
948 | + | let userStaked = $t03198632095._1 | |
949 | + | let axlyFee = $t03198632095._2 | |
947 | 950 | let posNum = getNewUserPositionNumber(pool, toString(i.caller)) | |
948 | 951 | let borrowEntries = [IntegerEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserBorrowAmount), bwAmount), StringEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserBorrowAssetId), bwAsset)] | |
949 | 952 | let entries = replenishEntries(pool, user, userStaked, axlyFee, posNum, shareId, pType, true) | |
1007 | 1010 | func liquidate (user,posId,liquidateAmount) = { | |
1008 | 1011 | let pool = valueOrErrorMessage(getString(this, (((user + "_") + posId) + kUserPositionPool)), "no position") | |
1009 | 1012 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
1010 | - | let $ | |
1011 | - | let AId = $ | |
1012 | - | let BId = $ | |
1013 | - | let balA = $ | |
1014 | - | let balB = $ | |
1015 | - | let shareId = $ | |
1013 | + | let $t03487834968 = getPoolData(Address(fromBase58String(pool)), pType) | |
1014 | + | let AId = $t03487834968._1 | |
1015 | + | let BId = $t03487834968._2 | |
1016 | + | let balA = $t03487834968._3 | |
1017 | + | let balB = $t03487834968._4 | |
1018 | + | let shareId = $t03487834968._5 | |
1016 | 1019 | let amount = unstakeLP(pool, pType, shareId, liquidateAmount) | |
1017 | 1020 | let borrowAmount = getIntegerValue(this, (((((pool + "_") + user) + "_") + posId) + kUserBorrowAmount)) | |
1018 | 1021 | let borrowAsset = getStringValue(this, (((((pool + "_") + user) + "_") + posId) + kUserBorrowAssetId)) | |
1026 | 1029 | ||
1027 | 1030 | @Callable(i) | |
1028 | 1031 | func capitalizeExKeeper (pool,type,tokenToId,amountToExchange,claim,amountsIn,addresses,assetsToReceive,estReceived,slippageTolerance,minReceived,options) = { | |
1029 | - | let $ | |
1032 | + | let $t03630836502 = if (claim) | |
1030 | 1033 | then claimFarmed(type, pool) | |
1031 | 1034 | else { | |
1032 | 1035 | let claimedAsset = if ((type == SF_POOL)) | |
1034 | 1037 | else WXID | |
1035 | 1038 | $Tuple2(amountToExchange, claimedAsset) | |
1036 | 1039 | } | |
1037 | - | let claimedAmount = $ | |
1038 | - | let claimedAsset = $ | |
1040 | + | let claimedAmount = $t03630836502._1 | |
1041 | + | let claimedAsset = $t03630836502._2 | |
1039 | 1042 | let exchangedAmount = exchangeKeeper(tokenToId, amountToExchange, claimedAsset, amountsIn, addresses, assetsToReceive, estReceived, slippageTolerance, minReceived, options) | |
1040 | 1043 | let change = (claimedAmount - amountToExchange) | |
1041 | 1044 | let changeEntry = if ((change > 0)) | |
1048 | 1051 | ||
1049 | 1052 | @Callable(i) | |
1050 | 1053 | func capitalizeExPuzzle (pool,type,tokenToId,amountToExchange,claim,routesStr,minToReceive,options) = { | |
1051 | - | let $ | |
1054 | + | let $t03715937353 = if (claim) | |
1052 | 1055 | then claimFarmed(type, pool) | |
1053 | 1056 | else { | |
1054 | 1057 | let claimedAsset = if ((type == SF_POOL)) | |
1056 | 1059 | else WXID | |
1057 | 1060 | $Tuple2(amountToExchange, claimedAsset) | |
1058 | 1061 | } | |
1059 | - | let claimedAmount = $ | |
1060 | - | let claimedAsset = $ | |
1062 | + | let claimedAmount = $t03715937353._1 | |
1063 | + | let claimedAsset = $t03715937353._2 | |
1061 | 1064 | let exchangedAmount = exchangePuzzle(tokenToId, amountToExchange, claimedAsset, routesStr, minToReceive, options) | |
1062 | 1065 | let change = (claimedAmount - amountToExchange) | |
1063 | 1066 | let changeEntry = if ((change > 0)) | |
1070 | 1073 | ||
1071 | 1074 | @Callable(i) | |
1072 | 1075 | func capitalizeExSwopFi (pool,type,tokenToId,amountToExchange,claim,exchangers,exchangersType,args1,args2,routingAssetsKeys,minAmountToReceive,options) = { | |
1073 | - | let $ | |
1076 | + | let $t03807638270 = if (claim) | |
1074 | 1077 | then claimFarmed(type, pool) | |
1075 | 1078 | else { | |
1076 | 1079 | let claimedAsset = if ((type == SF_POOL)) | |
1078 | 1081 | else WXID | |
1079 | 1082 | $Tuple2(amountToExchange, claimedAsset) | |
1080 | 1083 | } | |
1081 | - | let claimedAmount = $ | |
1082 | - | let claimedAsset = $ | |
1084 | + | let claimedAmount = $t03807638270._1 | |
1085 | + | let claimedAsset = $t03807638270._2 | |
1083 | 1086 | let exchangedAmount = exchangeSwopFi(tokenToId, amountToExchange, claimedAsset, exchangers, exchangersType, args1, args2, routingAssetsKeys, minAmountToReceive, options) | |
1084 | 1087 | let change = (claimedAmount - amountToExchange) | |
1085 | 1088 | let changeEntry = if ((change > 0)) | |
1096 | 1099 | else false) | |
1097 | 1100 | then throw("Wrong type") | |
1098 | 1101 | else { | |
1099 | - | let $ | |
1100 | - | let aId = $ | |
1101 | - | let bId = $ | |
1102 | - | let aBal = $ | |
1103 | - | let bBal = $ | |
1104 | - | let shareId = $ | |
1102 | + | let $t03896339057 = getPoolData(Address(fromBase58String(poolAddr)), type) | |
1103 | + | let aId = $t03896339057._1 | |
1104 | + | let bId = $t03896339057._2 | |
1105 | + | let aBal = $t03896339057._3 | |
1106 | + | let bBal = $t03896339057._4 | |
1107 | + | let shareId = $t03896339057._5 | |
1105 | 1108 | [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)] | |
1106 | 1109 | } | |
1107 | 1110 | ||
1110 | 1113 | @Callable(i) | |
1111 | 1114 | func capitalizeTest (pool,pType,tokenId,tokenAmount) = { | |
1112 | 1115 | let poolAddr = Address(fromBase58String(pool)) | |
1113 | - | let $ | |
1114 | - | let AId = $ | |
1115 | - | let BId = $ | |
1116 | - | let balA = $ | |
1117 | - | let balB = $ | |
1118 | - | let shareId = $ | |
1119 | - | let $ | |
1116 | + | let $t03985339932 = getPoolData(poolAddr, pType) | |
1117 | + | let AId = $t03985339932._1 | |
1118 | + | let BId = $t03985339932._2 | |
1119 | + | let balA = $t03985339932._3 | |
1120 | + | let balB = $t03985339932._4 | |
1121 | + | let shareId = $t03985339932._5 | |
1122 | + | let $t03993540015 = if ((tokenId == AId)) | |
1120 | 1123 | then $Tuple2(tokenAmount, 0) | |
1121 | 1124 | else $Tuple2(0, tokenAmount) | |
1122 | - | let pmtA = $ | |
1123 | - | let pmtB = $ | |
1124 | - | let $ | |
1125 | - | let stakedAmount = $ | |
1126 | - | let nf = $ | |
1125 | + | let pmtA = $t03993540015._1 | |
1126 | + | let pmtB = $t03993540015._2 | |
1127 | + | let $t04001840122 = replenishByType(pType, pool, NO_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId) | |
1128 | + | let stakedAmount = $t04001840122._1 | |
1129 | + | let nf = $t04001840122._2 | |
1127 | 1130 | let curPoolInterestLoan = valueOrElse(getInteger(this, (pool + kPoolInterestLoan)), 0) | |
1128 | 1131 | let curPoolInterestNoLoan = valueOrElse(getInteger(this, (pool + kPoolInterestNoLoan)), 0) | |
1129 | 1132 | let totalShareAmount = getPoolTotalShare(pool) | |
1139 | 1142 | else 0 | |
1140 | 1143 | let axlyFeeLoan = fraction(stakedLoan, getAxlyFee(pool, CAP_FEE_LOAN), FEE_SCALE6) | |
1141 | 1144 | let axlyFeeNoLoan = fraction(stakedNoLoan, getAxlyFee(pool, CAP_FEE_NO_LOAN), FEE_SCALE6) | |
1142 | - | ([IntegerEntry((pool + kPoolInterestLoan), newInterestLoan), IntegerEntry((pool + kPoolInterestNoLoan), newInterestNoLoan), IntegerEntry((pool + kPoolTotal), (((totalShareAmount + stakedAmount) - axlyFeeLoan) - axlyFeeNoLoan)), IntegerEntry((pool + kPoolTotalLoan), ((totalShareAmountWithLoan + stakedLoan) - axlyFeeLoan)), ScriptTransfer(moneyBox, (axlyFeeLoan + axlyFeeNoLoan), fromBase58String(shareId))] ++ getCursEntries(AId, BId, shareId)) | |
1145 | + | let axlyFee = unstakeLP(pool, pType, shareId, (axlyFeeLoan + axlyFeeNoLoan)) | |
1146 | + | if ((axlyFee == axlyFee)) | |
1147 | + | 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)) | |
1148 | + | else throw("Strict value is not equal to itself.") | |
1143 | 1149 | } | |
1144 | 1150 | ||
1145 | 1151 |
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 FEE_SCALE6 = 1000000 | |
27 | 27 | ||
28 | 28 | let kSFPoolAAssetBalance = "A_asset_balance" | |
29 | 29 | ||
30 | 30 | let kSFPoolBAssetBalance = "B_asset_balance" | |
31 | 31 | ||
32 | 32 | let kSFPoolAAssetId = "A_asset_id" | |
33 | 33 | ||
34 | 34 | let kSFPoolBAssetId = "B_asset_id" | |
35 | 35 | ||
36 | 36 | let kSFPoolShareId = "share_asset_id" | |
37 | 37 | ||
38 | 38 | let kSFPoolShareSupply = "share_asset_supply" | |
39 | 39 | ||
40 | 40 | let kSFPoolFee = "commission" | |
41 | 41 | ||
42 | 42 | let kUserPosition = "_user_position" | |
43 | 43 | ||
44 | 44 | let kUserPositionPool = "_user_position_pool" | |
45 | 45 | ||
46 | 46 | let kUserBorrowAmount = "_user_position_borrow_amount" | |
47 | 47 | ||
48 | 48 | let kUserBorrowAssetId = "_user_position_borrow_asset_id" | |
49 | 49 | ||
50 | 50 | let kUserPositionNum = "_user_position_number" | |
51 | 51 | ||
52 | 52 | let kUserPositionInterest = "_user_position_interest" | |
53 | 53 | ||
54 | 54 | let kPoolTotal = "_pool_total" | |
55 | 55 | ||
56 | 56 | let kPoolTotalLoan = "_pool_total_loan" | |
57 | 57 | ||
58 | 58 | let kPoolInterestLoan = "_pool_interest_loan" | |
59 | 59 | ||
60 | 60 | let kPoolInterestNoLoan = "_pool_interest_no_loan" | |
61 | 61 | ||
62 | 62 | let kAxlyInFeeWithoutLoan = "_axly_fee_without_loan" | |
63 | 63 | ||
64 | 64 | let kAxlyInFeeWithLoan = "_axly_fee_with_loan" | |
65 | 65 | ||
66 | 66 | let kAxlyNoLoanCapFee = "_axly_fee_cap_with_loan" | |
67 | 67 | ||
68 | 68 | let kAxlyWithLoanCapFee = "_axly_fee_cap_no_loan" | |
69 | 69 | ||
70 | 70 | let kAxlyStopLossNoLoanFee = "_axly_fee_stoploss_with_loan" | |
71 | 71 | ||
72 | 72 | let kAxlyStopLossLoanFee = "_axly_fee_stoploss_no_loan" | |
73 | 73 | ||
74 | 74 | let kRequestId = "_request_id" | |
75 | 75 | ||
76 | 76 | let kRequestIter = "requests_iter" | |
77 | 77 | ||
78 | 78 | let kPool = "pool_" | |
79 | 79 | ||
80 | 80 | let kSharePool = "_pool_share_id" | |
81 | 81 | ||
82 | 82 | let kPoolCapChange = "_pool_cap_change" | |
83 | 83 | ||
84 | 84 | let kTokenLastPrice = "_last_price" | |
85 | 85 | ||
86 | 86 | let kUserStopLoss = "_stop_loss" | |
87 | 87 | ||
88 | 88 | let kMoneyBox = "axly_money_box" | |
89 | 89 | ||
90 | 90 | let kSFFarmingAddr = "swopfi_farming_addr" | |
91 | 91 | ||
92 | 92 | let kLendService = "lend_service_addr" | |
93 | 93 | ||
94 | 94 | let kPriceOracle = "price_oracle" | |
95 | 95 | ||
96 | 96 | let kExContract = "exchange_contract" | |
97 | 97 | ||
98 | 98 | let kWxSwapContract = "wx_swap_contract" | |
99 | 99 | ||
100 | 100 | let moneyBox = Address(fromBase58String(valueOrErrorMessage(getString(this, kMoneyBox), "No axly moneyBox address"))) | |
101 | 101 | ||
102 | 102 | let exContract = Address(fromBase58String(valueOrErrorMessage(getString(this, kExContract), "No exchange contract address"))) | |
103 | 103 | ||
104 | 104 | let priceOracleAddr = Address(fromBase58String(valueOrErrorMessage(getString(this, kPriceOracle), "No price oracle address"))) | |
105 | 105 | ||
106 | 106 | let wxSwapContract = Address(fromBase58String(valueOrErrorMessage(getString(this, kWxSwapContract), "No wx swap address"))) | |
107 | 107 | ||
108 | 108 | let SWOPID = base58'4W19ndijcc2CsQa9HGW2dfXKTVXhnneWWttxXrtjPmEp' | |
109 | 109 | ||
110 | 110 | let WXID = base58'EMAMLxDnv3xiz8RXg8Btj33jcEw3wLczL3JKYYmuubpc' | |
111 | 111 | ||
112 | 112 | func isSelfCall (i) = if ((i.caller == this)) | |
113 | 113 | then unit | |
114 | 114 | else throw("Only contract itself can call this function") | |
115 | 115 | ||
116 | 116 | ||
117 | 117 | func accountBalance (assetId) = match assetId { | |
118 | 118 | case id: ByteVector => | |
119 | 119 | assetBalance(this, id) | |
120 | 120 | case waves: Unit => | |
121 | 121 | wavesBalance(this).available | |
122 | 122 | case _ => | |
123 | 123 | throw("Match error") | |
124 | 124 | } | |
125 | 125 | ||
126 | 126 | ||
127 | 127 | func getSFPoolData (poolAddr) = $Tuple5(valueOrErrorMessage(getString(poolAddr, kSFPoolAAssetId), "Can't get pool A asset id"), valueOrErrorMessage(getString(poolAddr, kSFPoolBAssetId), "Can't get pool B asset id"), valueOrErrorMessage(getInteger(poolAddr, kSFPoolAAssetBalance), "Can't get pool A asset balance"), valueOrErrorMessage(getInteger(poolAddr, kSFPoolBAssetBalance), "Can't get pool B asset balance"), valueOrErrorMessage(getString(poolAddr, kSFPoolShareId), "Can't get share asset id")) | |
128 | 128 | ||
129 | 129 | ||
130 | 130 | func getWXPoolData (poolAddr) = { | |
131 | 131 | let cfg = { | |
132 | 132 | let @ = invoke(poolAddr, "getPoolConfigWrapperREADONLY", nil, nil) | |
133 | 133 | if ($isInstanceOf(@, "List[Any]")) | |
134 | 134 | then @ | |
135 | 135 | else throw(($getType(@) + " couldn't be cast to List[Any]")) | |
136 | 136 | } | |
137 | 137 | if ((cfg == cfg)) | |
138 | 138 | then { | |
139 | 139 | let aId = valueOrErrorMessage({ | |
140 | 140 | let @ = cfg[4] | |
141 | 141 | if ($isInstanceOf(@, "String")) | |
142 | 142 | then @ | |
143 | 143 | else unit | |
144 | 144 | }, "Can't get pool A asset id") | |
145 | 145 | let bId = valueOrErrorMessage({ | |
146 | 146 | let @ = cfg[5] | |
147 | 147 | if ($isInstanceOf(@, "String")) | |
148 | 148 | then @ | |
149 | 149 | else unit | |
150 | 150 | }, "Can't get pool B asset id") | |
151 | 151 | let shareId = valueOrErrorMessage({ | |
152 | 152 | let @ = cfg[3] | |
153 | 153 | if ($isInstanceOf(@, "String")) | |
154 | 154 | then @ | |
155 | 155 | else unit | |
156 | 156 | }, "Can't get pool LP asset id") | |
157 | 157 | let balA = { | |
158 | 158 | let @ = invoke(poolAddr, "getAccBalanceWrapperREADONLY", [aId], nil) | |
159 | 159 | if ($isInstanceOf(@, "Int")) | |
160 | 160 | then @ | |
161 | 161 | else throw(($getType(@) + " couldn't be cast to Int")) | |
162 | 162 | } | |
163 | 163 | if ((balA == balA)) | |
164 | 164 | then { | |
165 | 165 | let balB = { | |
166 | 166 | let @ = invoke(poolAddr, "getAccBalanceWrapperREADONLY", [bId], nil) | |
167 | 167 | if ($isInstanceOf(@, "Int")) | |
168 | 168 | then @ | |
169 | 169 | else throw(($getType(@) + " couldn't be cast to Int")) | |
170 | 170 | } | |
171 | 171 | if ((balB == balB)) | |
172 | 172 | then $Tuple5(aId, bId, balA, balB, shareId) | |
173 | 173 | else throw("Strict value is not equal to itself.") | |
174 | 174 | } | |
175 | 175 | else throw("Strict value is not equal to itself.") | |
176 | 176 | } | |
177 | 177 | else throw("Strict value is not equal to itself.") | |
178 | 178 | } | |
179 | 179 | ||
180 | 180 | ||
181 | 181 | func getPoolData (poolAddr,type) = if ((type == SF_POOL)) | |
182 | 182 | then getSFPoolData(poolAddr) | |
183 | 183 | else if ((type == WX_POOL)) | |
184 | 184 | then getWXPoolData(poolAddr) | |
185 | 185 | else throw("Wrong pool type") | |
186 | 186 | ||
187 | 187 | ||
188 | 188 | func getShareSupply (poolAddr,type,shareId) = if ((type == SF_POOL)) | |
189 | 189 | then valueOrErrorMessage(getInteger(poolAddr, kSFPoolShareSupply), "Can't get share asset supply") | |
190 | 190 | else if ((type == WX_POOL)) | |
191 | 191 | then valueOrErrorMessage(assetInfo(fromBase58String(shareId)), "Wrong ShareId").quantity | |
192 | 192 | else throw("Wrong pool type") | |
193 | 193 | ||
194 | 194 | ||
195 | 195 | func getPoolTotalShare (pool) = valueOrElse(getInteger(this, (pool + kPoolTotal)), 0) | |
196 | 196 | ||
197 | 197 | ||
198 | 198 | func getPoolTotalShareWithLoan (pool) = valueOrElse(getInteger(this, (pool + kPoolTotalLoan)), 0) | |
199 | 199 | ||
200 | 200 | ||
201 | 201 | func getNewUserPositionNumber (pool,user) = (valueOrElse(getInteger(this, (user + kUserPositionNum)), 0) + 1) | |
202 | 202 | ||
203 | 203 | ||
204 | 204 | func getAxlyFee (pool,feeType) = if ((feeType == CAP_FEE_LOAN)) | |
205 | 205 | then getIntegerValue(this, (pool + kAxlyWithLoanCapFee)) | |
206 | 206 | else if ((feeType == CAP_FEE_NO_LOAN)) | |
207 | 207 | then getIntegerValue(this, (pool + kAxlyNoLoanCapFee)) | |
208 | 208 | else if ((feeType == LOAN_FEE)) | |
209 | 209 | then getIntegerValue(this, (pool + kAxlyInFeeWithLoan)) | |
210 | 210 | else if ((feeType == NO_LOAN_FEE)) | |
211 | 211 | then getIntegerValue(this, (pool + kAxlyInFeeWithoutLoan)) | |
212 | 212 | else if ((feeType == NO_FEE)) | |
213 | 213 | then 0 | |
214 | 214 | else throw("Wrong fee type") | |
215 | 215 | ||
216 | 216 | ||
217 | 217 | func getSFFarmingAddr () = Address(fromBase58String(valueOrErrorMessage(getString(this, kSFFarmingAddr), "Can't get swopfi farming addr"))) | |
218 | 218 | ||
219 | 219 | ||
220 | 220 | func getWXFarmingAddr (poolAddr) = { | |
221 | 221 | let fContract = Address(fromBase58String(valueOrErrorMessage(getString(poolAddr, "%s__factoryContract"), "Can't get WX factory contract addr"))) | |
222 | 222 | let factroyCfg = split(valueOrErrorMessage(getString(fContract, "%s__factoryConfig"), "Can't get WX factory cfg"), "__") | |
223 | 223 | Address(fromBase58String(factroyCfg[1])) | |
224 | 224 | } | |
225 | 225 | ||
226 | 226 | ||
227 | 227 | func getLendSrvAddr () = Address(fromBase58String(valueOrErrorMessage(getString(this, kLendService), "Can't get lend service addr"))) | |
228 | 228 | ||
229 | 229 | ||
230 | 230 | func assetIdToStr (assetId) = match assetId { | |
231 | 231 | case id: ByteVector => | |
232 | 232 | toBase58String(id) | |
233 | 233 | case waves: Unit => | |
234 | 234 | "WAVES" | |
235 | 235 | case _ => | |
236 | 236 | throw("Match error") | |
237 | 237 | } | |
238 | 238 | ||
239 | 239 | ||
240 | 240 | func assetIdFromStr (assetId) = if ((assetId == "WAVES")) | |
241 | 241 | then unit | |
242 | 242 | else fromBase58String(assetId) | |
243 | 243 | ||
244 | 244 | ||
245 | 245 | func getAssetDecimals (assetId) = if ((assetId == "WAVES")) | |
246 | 246 | then 8 | |
247 | 247 | else match assetInfo(fromBase58String(assetId)) { | |
248 | 248 | case asset: Asset => | |
249 | 249 | asset.decimals | |
250 | 250 | case _ => | |
251 | 251 | throw("Can't find asset") | |
252 | 252 | } | |
253 | 253 | ||
254 | 254 | ||
255 | 255 | func getAssetPrecition (assetId) = pow(10, 0, getAssetDecimals(assetId), 0, 0, DOWN) | |
256 | 256 | ||
257 | 257 | ||
258 | 258 | func getAssetsPrice (assetIds) = { | |
259 | 259 | func getPrices (a,assetId) = { | |
260 | 260 | let assetPrice = ( let @ = invoke(priceOracleAddr, "getTWAP60", [assetId, false], nil) | |
261 | 261 | if ($isInstanceOf(@, "(Int, Int)")) | |
262 | 262 | then @ | |
263 | 263 | else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._2 | |
264 | 264 | (a :+ assetPrice) | |
265 | 265 | } | |
266 | 266 | ||
267 | 267 | let $l = assetIds | |
268 | 268 | let $s = size($l) | |
269 | 269 | let $acc0 = nil | |
270 | 270 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
271 | 271 | then $a | |
272 | 272 | else getPrices($a, $l[$i]) | |
273 | 273 | ||
274 | 274 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
275 | 275 | then $a | |
276 | 276 | else throw("List size exceeds 100") | |
277 | 277 | ||
278 | 278 | $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($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), 51), 52), 53), 54), 55), 56), 57), 58), 59), 60), 61), 62), 63), 64), 65), 66), 67), 68), 69), 70), 71), 72), 73), 74), 75), 76), 77), 78), 79), 80), 81), 82), 83), 84), 85), 86), 87), 88), 89), 90), 91), 92), 93), 94), 95), 96), 97), 98), 99), 100) | |
279 | 279 | } | |
280 | 280 | ||
281 | 281 | ||
282 | 282 | func getSharePrice (shareIds) = { | |
283 | 283 | func getPrices (a,shareId) = { | |
284 | 284 | let pool = valueOrErrorMessage(getString(this, (shareId + kSharePool)), "Can't find pool addr by share id") | |
285 | 285 | let poolAddr = Address(fromBase58String(pool)) | |
286 | 286 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
287 | 287 | let $t084268491 = getPoolData(poolAddr, pType) | |
288 | 288 | let aId = $t084268491._1 | |
289 | 289 | let bId = $t084268491._2 | |
290 | 290 | let aBalance = $t084268491._3 | |
291 | 291 | let bBalance = $t084268491._4 | |
292 | 292 | let dPriceA = ( let @ = invoke(priceOracleAddr, "getTWAP60", [aId, false], nil) | |
293 | 293 | if ($isInstanceOf(@, "(Int, Int)")) | |
294 | 294 | then @ | |
295 | 295 | else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._2 | |
296 | 296 | let dPriceB = ( let @ = invoke(priceOracleAddr, "getTWAP60", [bId, false], nil) | |
297 | 297 | if ($isInstanceOf(@, "(Int, Int)")) | |
298 | 298 | then @ | |
299 | 299 | else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._2 | |
300 | 300 | let shareSupply = getShareSupply(poolAddr, pType, shareId) | |
301 | 301 | let APrecision = pow(10, 0, getAssetDecimals(aId), 0, 0, DOWN) | |
302 | 302 | let BPrecision = pow(10, 0, getAssetDecimals(bId), 0, 0, DOWN) | |
303 | 303 | let sharePrecision = pow(10, 0, getAssetDecimals(shareId), 0, 0, DOWN) | |
304 | 304 | let sum = (fraction(aBalance, dPriceA, APrecision) + fraction(bBalance, dPriceB, BPrecision)) | |
305 | 305 | let sharePrice = fraction(sum, sharePrecision, shareSupply) | |
306 | 306 | (a :+ sharePrice) | |
307 | 307 | } | |
308 | 308 | ||
309 | 309 | let $l = shareIds | |
310 | 310 | let $s = size($l) | |
311 | 311 | let $acc0 = nil | |
312 | 312 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
313 | 313 | then $a | |
314 | 314 | else getPrices($a, $l[$i]) | |
315 | 315 | ||
316 | 316 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
317 | 317 | then $a | |
318 | 318 | else throw("List size exceeds 50") | |
319 | 319 | ||
320 | 320 | $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) | |
321 | 321 | } | |
322 | 322 | ||
323 | 323 | ||
324 | 324 | func getCursEntries (aId,bId,shareId) = { | |
325 | 325 | let assetsPrices = getAssetsPrice([aId, bId]) | |
326 | 326 | let sharePrice = getSharePrice([shareId]) | |
327 | 327 | [IntegerEntry((aId + kTokenLastPrice), assetsPrices[0]), IntegerEntry((bId + kTokenLastPrice), assetsPrices[1]), IntegerEntry((shareId + kTokenLastPrice), sharePrice[0])] | |
328 | 328 | } | |
329 | 329 | ||
330 | 330 | ||
331 | 331 | func replenishSwopFi (pool,feeType,pmtA,pmtAssetA,pmtB,pmtAssetB,balA,balB,shareId) = { | |
332 | 332 | let shareBalanceBefore = accountBalance(fromBase58String(shareId)) | |
333 | 333 | if ((shareBalanceBefore == shareBalanceBefore)) | |
334 | 334 | then { | |
335 | 335 | let poolAddr = Address(fromBase58String(pool)) | |
336 | 336 | let ratioA = fraction(SCALE8, pmtA, balA) | |
337 | 337 | let ratioB = fraction(SCALE8, pmtB, balB) | |
338 | 338 | let $t0999610288 = if ((ratioB > ratioA)) | |
339 | 339 | then { | |
340 | 340 | let pmt = fraction(balB, ratioA, SCALE8, CEILING) | |
341 | 341 | $Tuple4(pmtA, pmt, (pmtB - pmt), pmtAssetB) | |
342 | 342 | } | |
343 | 343 | else { | |
344 | 344 | let pmt = fraction(balA, ratioB, SCALE8, CEILING) | |
345 | 345 | $Tuple4(pmt, pmtB, (pmtA - pmt), pmtAssetA) | |
346 | 346 | } | |
347 | 347 | let pmtAmountA = $t0999610288._1 | |
348 | 348 | let pmtAmountB = $t0999610288._2 | |
349 | 349 | let change = $t0999610288._3 | |
350 | 350 | let changeAssetId = $t0999610288._4 | |
351 | 351 | let inv1 = if (if ((pmtAmountA > 0)) | |
352 | 352 | then (pmtAmountB > 0) | |
353 | 353 | else false) | |
354 | 354 | then { | |
355 | 355 | let payments = [AttachedPayment(assetIdFromStr(pmtAssetA), pmtAmountA), AttachedPayment(assetIdFromStr(pmtAssetB), pmtAmountB)] | |
356 | 356 | invoke(poolAddr, "callFunction", ["replenishWithTwoTokens", ["false", "0"]], payments) | |
357 | 357 | } | |
358 | 358 | else 0 | |
359 | 359 | if ((inv1 == inv1)) | |
360 | 360 | then { | |
361 | 361 | let inv2 = if ((change > 0)) | |
362 | 362 | then { | |
363 | 363 | let payments = [AttachedPayment(assetIdFromStr(changeAssetId), change)] | |
364 | 364 | let vars = ["0", "false", "0"] | |
365 | 365 | invoke(poolAddr, "callFunction", ["replenishWithOneToken", vars], payments) | |
366 | 366 | } | |
367 | 367 | else 0 | |
368 | 368 | if ((inv2 == inv2)) | |
369 | 369 | then { | |
370 | 370 | let shareBalanceAfter = accountBalance(fromBase58String(shareId)) | |
371 | 371 | let totalStaked = (shareBalanceAfter - shareBalanceBefore) | |
372 | 372 | let axlyFeeAmount = fraction(totalStaked, getAxlyFee(pool, feeType), FEE_SCALE6) | |
373 | 373 | let userShareForStake = (totalStaked - axlyFeeAmount) | |
374 | 374 | if ((0 >= userShareForStake)) | |
375 | 375 | then throw("amount of staked sharetokens must be > 0") | |
376 | 376 | else { | |
377 | 377 | let inv3 = invoke(getSFFarmingAddr(), "lockShareTokens", [pool, 0], [AttachedPayment(fromBase58String(shareId), userShareForStake)]) | |
378 | 378 | if ((inv3 == inv3)) | |
379 | 379 | then $Tuple2(userShareForStake, axlyFeeAmount) | |
380 | 380 | else throw("Strict value is not equal to itself.") | |
381 | 381 | } | |
382 | 382 | } | |
383 | 383 | else throw("Strict value is not equal to itself.") | |
384 | 384 | } | |
385 | 385 | else throw("Strict value is not equal to itself.") | |
386 | 386 | } | |
387 | 387 | else throw("Strict value is not equal to itself.") | |
388 | 388 | } | |
389 | 389 | ||
390 | 390 | ||
391 | 391 | func replenishWX (pool,feeType,pmtA,pmtAssetA,pmtB,pmtAssetB,shareId) = { | |
392 | 392 | let poolAddr = Address(fromBase58String(pool)) | |
393 | 393 | let $t01173912588 = if (if ((pmtA > 0)) | |
394 | 394 | then (pmtB > 0) | |
395 | 395 | else false) | |
396 | 396 | then { | |
397 | 397 | let evalPutInA = split({ | |
398 | 398 | let @ = invoke(poolAddr, "evaluatePutByAmountAssetREADONLY", [pmtA], nil) | |
399 | 399 | if ($isInstanceOf(@, "String")) | |
400 | 400 | then @ | |
401 | 401 | else throw(($getType(@) + " couldn't be cast to String")) | |
402 | 402 | }, "__") | |
403 | 403 | if ((evalPutInA == evalPutInA)) | |
404 | 404 | then { | |
405 | 405 | let evalPutInB = split({ | |
406 | 406 | let @ = invoke(poolAddr, "evaluatePutByPriceAssetREADONLY", [pmtB], nil) | |
407 | 407 | if ($isInstanceOf(@, "String")) | |
408 | 408 | then @ | |
409 | 409 | else throw(($getType(@) + " couldn't be cast to String")) | |
410 | 410 | }, "__") | |
411 | 411 | if ((evalPutInB == evalPutInB)) | |
412 | 412 | then { | |
413 | 413 | let lpInA = parseIntValue(evalPutInA[1]) | |
414 | 414 | let lpInB = parseIntValue(evalPutInB[1]) | |
415 | 415 | if ((lpInB > lpInA)) | |
416 | 416 | then { | |
417 | 417 | let pmtInB = parseIntValue(evalPutInA[8]) | |
418 | 418 | $Tuple4(pmtA, pmtInB, (pmtB - pmtInB), pmtAssetB) | |
419 | 419 | } | |
420 | 420 | else { | |
421 | 421 | let pmtInA = parseIntValue(evalPutInB[7]) | |
422 | 422 | $Tuple4(pmtInA, pmtB, (pmtA - pmtInA), pmtAssetA) | |
423 | 423 | } | |
424 | 424 | } | |
425 | 425 | else throw("Strict value is not equal to itself.") | |
426 | 426 | } | |
427 | 427 | else throw("Strict value is not equal to itself.") | |
428 | 428 | } | |
429 | 429 | else if ((pmtA > 0)) | |
430 | 430 | then $Tuple4(pmtA, pmtB, pmtA, pmtAssetA) | |
431 | 431 | else if ((pmtB > 0)) | |
432 | 432 | then $Tuple4(pmtA, pmtB, pmtB, pmtAssetB) | |
433 | 433 | else throw("pmts must be > 0") | |
434 | 434 | let pmtAmountA = $t01173912588._1 | |
435 | 435 | let pmtAmountB = $t01173912588._2 | |
436 | 436 | let change = $t01173912588._3 | |
437 | 437 | let changeAssetId = $t01173912588._4 | |
438 | 438 | let shareBalanceBefore = accountBalance(fromBase58String(shareId)) | |
439 | 439 | if ((shareBalanceBefore == shareBalanceBefore)) | |
440 | 440 | then { | |
441 | 441 | let inv1 = if (if ((pmtAmountA > 0)) | |
442 | 442 | then (pmtAmountB > 0) | |
443 | 443 | else false) | |
444 | 444 | then { | |
445 | 445 | let payments = [AttachedPayment(assetIdFromStr(pmtAssetA), pmtAmountA), AttachedPayment(assetIdFromStr(pmtAssetB), pmtAmountB)] | |
446 | 446 | invoke(poolAddr, "put", [1000000, false], payments) | |
447 | 447 | } | |
448 | 448 | else 0 | |
449 | 449 | if ((inv1 == inv1)) | |
450 | 450 | then { | |
451 | 451 | let inv2 = if ((change > 0)) | |
452 | 452 | then { | |
453 | 453 | let payments = [AttachedPayment(assetIdFromStr(changeAssetId), change)] | |
454 | 454 | invoke(poolAddr, "putOneTkn", [0, false], payments) | |
455 | 455 | } | |
456 | 456 | else 0 | |
457 | 457 | if ((inv2 == inv2)) | |
458 | 458 | then { | |
459 | 459 | let shareBalanceAfter = accountBalance(fromBase58String(shareId)) | |
460 | 460 | let totalStaked = (shareBalanceAfter - shareBalanceBefore) | |
461 | 461 | let axlyFeeAmount = fraction(totalStaked, getAxlyFee(pool, feeType), FEE_SCALE6) | |
462 | 462 | let userShareForStake = (totalStaked - axlyFeeAmount) | |
463 | 463 | if ((0 >= userShareForStake)) | |
464 | 464 | then throw("amount of staked sharetokens must be > 0") | |
465 | 465 | else { | |
466 | 466 | let inv3 = invoke(getWXFarmingAddr(poolAddr), "stake", nil, [AttachedPayment(fromBase58String(shareId), userShareForStake)]) | |
467 | 467 | if ((inv3 == inv3)) | |
468 | 468 | then $Tuple2(userShareForStake, axlyFeeAmount) | |
469 | 469 | else throw("Strict value is not equal to itself.") | |
470 | 470 | } | |
471 | 471 | } | |
472 | 472 | else throw("Strict value is not equal to itself.") | |
473 | 473 | } | |
474 | 474 | else throw("Strict value is not equal to itself.") | |
475 | 475 | } | |
476 | 476 | else throw("Strict value is not equal to itself.") | |
477 | 477 | } | |
478 | 478 | ||
479 | 479 | ||
480 | 480 | func replenishByType (type,pool,feeType,pmtA,AId,pmtB,BId,balA,balB,shareId) = if ((type == SF_POOL)) | |
481 | 481 | then replenishSwopFi(pool, feeType, pmtA, AId, pmtB, BId, balA, balB, shareId) | |
482 | 482 | else if ((type == WX_POOL)) | |
483 | 483 | then replenishWX(pool, feeType, pmtA, AId, pmtB, BId, shareId) | |
484 | 484 | else throw("Wrong pool type") | |
485 | 485 | ||
486 | 486 | ||
487 | 487 | func replenishEntries (pool,user,stakedAmount,axlyFeeAmount,posNum,shareId,type,withLoan) = { | |
488 | 488 | let totalAmount = getPoolTotalShare(pool) | |
489 | 489 | let totalAmountLoan = getPoolTotalShareWithLoan(pool) | |
490 | 490 | let $t01460614844 = if (withLoan) | |
491 | 491 | then $Tuple2(getIntegerValue(this, (pool + kPoolInterestLoan)), (totalAmountLoan + stakedAmount)) | |
492 | 492 | else $Tuple2(getIntegerValue(this, (pool + kPoolInterestNoLoan)), totalAmountLoan) | |
493 | 493 | let curPoolInterest = $t01460614844._1 | |
494 | 494 | let totalStakedWithLoan = $t01460614844._2 | |
495 | 495 | [IntegerEntry((pool + kPoolTotal), (totalAmount + stakedAmount)), IntegerEntry((pool + kPoolTotalLoan), (totalAmountLoan + stakedAmount)), 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))] | |
496 | 496 | } | |
497 | 497 | ||
498 | 498 | ||
499 | 499 | func claimFarmed (type,pool) = if ((type == SF_POOL)) | |
500 | 500 | then { | |
501 | 501 | let balBefore = accountBalance(SWOPID) | |
502 | 502 | if ((balBefore == balBefore)) | |
503 | 503 | then { | |
504 | 504 | let inv = invoke(getSFFarmingAddr(), "claim", [pool], nil) | |
505 | 505 | if ((inv == inv)) | |
506 | 506 | then { | |
507 | 507 | let balAfter = accountBalance(SWOPID) | |
508 | 508 | $Tuple2((balAfter - balBefore), SWOPID) | |
509 | 509 | } | |
510 | 510 | else throw("Strict value is not equal to itself.") | |
511 | 511 | } | |
512 | 512 | else throw("Strict value is not equal to itself.") | |
513 | 513 | } | |
514 | 514 | else if ((type == WX_POOL)) | |
515 | 515 | then { | |
516 | 516 | let balBefore = accountBalance(WXID) | |
517 | 517 | if ((balBefore == balBefore)) | |
518 | 518 | then { | |
519 | 519 | let inv = invoke(getWXFarmingAddr(Address(fromBase58String(pool))), "claimWX", [pool], nil) | |
520 | 520 | if ((inv == inv)) | |
521 | 521 | then { | |
522 | 522 | let balAfter = accountBalance(WXID) | |
523 | 523 | $Tuple2((balAfter - balBefore), WXID) | |
524 | 524 | } | |
525 | 525 | else throw("Strict value is not equal to itself.") | |
526 | 526 | } | |
527 | 527 | else throw("Strict value is not equal to itself.") | |
528 | 528 | } | |
529 | 529 | else throw("Wrong pool type") | |
530 | 530 | ||
531 | 531 | ||
532 | 532 | func exchangeKeeper (toToken,pmtAmount,pmtAsset,amountsIn,addresses,assetsToReceive,estReceived,slippageTolerance,minReceived,options) = { | |
533 | 533 | let tokenBalanceBefore = accountBalance(assetIdFromStr(toToken)) | |
534 | 534 | if ((tokenBalanceBefore == tokenBalanceBefore)) | |
535 | 535 | then { | |
536 | 536 | let inv = invoke(exContract, "swap", [amountsIn, addresses, assetsToReceive, estReceived, slippageTolerance, minReceived, options], [AttachedPayment(pmtAsset, pmtAmount)]) | |
537 | 537 | if ((inv == inv)) | |
538 | 538 | then (accountBalance(assetIdFromStr(toToken)) - tokenBalanceBefore) | |
539 | 539 | else throw("Strict value is not equal to itself.") | |
540 | 540 | } | |
541 | 541 | else throw("Strict value is not equal to itself.") | |
542 | 542 | } | |
543 | 543 | ||
544 | 544 | ||
545 | 545 | func exchangePuzzle (toToken,pmtAmount,pmtAsset,routesStr,minToReceive,options) = { | |
546 | 546 | let tokenBalanceBefore = accountBalance(assetIdFromStr(toToken)) | |
547 | 547 | if ((tokenBalanceBefore == tokenBalanceBefore)) | |
548 | 548 | then { | |
549 | 549 | let inv = invoke(exContract, "puzzleSwap", [routesStr, minToReceive, options], [AttachedPayment(pmtAsset, pmtAmount)]) | |
550 | 550 | if ((inv == inv)) | |
551 | 551 | then (accountBalance(assetIdFromStr(toToken)) - tokenBalanceBefore) | |
552 | 552 | else throw("Strict value is not equal to itself.") | |
553 | 553 | } | |
554 | 554 | else throw("Strict value is not equal to itself.") | |
555 | 555 | } | |
556 | 556 | ||
557 | 557 | ||
558 | 558 | func exchangeSwopFi (toToken,pmtAmount,pmtAsset,exchangers,exchangersType,args1,args2,routingAssetsKeys,minAmountToReceive,options) = { | |
559 | 559 | let tokenBalanceBefore = accountBalance(assetIdFromStr(toToken)) | |
560 | 560 | if ((tokenBalanceBefore == tokenBalanceBefore)) | |
561 | 561 | then { | |
562 | 562 | let inv = invoke(exContract, "swopfiSwap", [exchangers, exchangersType, args1, args2, routingAssetsKeys, minAmountToReceive, options], [AttachedPayment(pmtAsset, pmtAmount)]) | |
563 | 563 | if ((inv == inv)) | |
564 | 564 | then (accountBalance(assetIdFromStr(toToken)) - tokenBalanceBefore) | |
565 | 565 | else throw("Strict value is not equal to itself.") | |
566 | 566 | } | |
567 | 567 | else throw("Strict value is not equal to itself.") | |
568 | 568 | } | |
569 | 569 | ||
570 | 570 | ||
571 | + | func unstakeLP (pool,pType,shareId,amount) = { | |
572 | + | let $t01773918096 = if ((pType == SF_POOL)) | |
573 | + | then $Tuple3(getSFFarmingAddr(), "withdrawShareTokens", [pool, amount]) | |
574 | + | else if ((pType == WX_POOL)) | |
575 | + | then $Tuple3(getWXFarmingAddr(Address(fromBase58String(pool))), "unstake", [shareId, amount]) | |
576 | + | else throw("Wrong pool type") | |
577 | + | let farmAddr = $t01773918096._1 | |
578 | + | let fName = $t01773918096._2 | |
579 | + | let params = $t01773918096._3 | |
580 | + | let inv = invoke(farmAddr, fName, params, nil) | |
581 | + | if ((inv == inv)) | |
582 | + | then amount | |
583 | + | else throw("Strict value is not equal to itself.") | |
584 | + | } | |
585 | + | ||
586 | + | ||
571 | 587 | func capitalize (pool,pType,tokenId,tokenAmount) = { | |
572 | 588 | let poolAddr = Address(fromBase58String(pool)) | |
573 | - | let $ | |
574 | - | let AId = $ | |
575 | - | let BId = $ | |
576 | - | let balA = $ | |
577 | - | let balB = $ | |
578 | - | let shareId = $ | |
579 | - | let $ | |
589 | + | let $t01831318392 = getPoolData(poolAddr, pType) | |
590 | + | let AId = $t01831318392._1 | |
591 | + | let BId = $t01831318392._2 | |
592 | + | let balA = $t01831318392._3 | |
593 | + | let balB = $t01831318392._4 | |
594 | + | let shareId = $t01831318392._5 | |
595 | + | let $t01839518475 = if ((tokenId == AId)) | |
580 | 596 | then $Tuple2(tokenAmount, 0) | |
581 | 597 | else $Tuple2(0, tokenAmount) | |
582 | - | let pmtA = $ | |
583 | - | let pmtB = $ | |
584 | - | let $ | |
585 | - | let stakedAmount = $ | |
586 | - | let nf = $ | |
598 | + | let pmtA = $t01839518475._1 | |
599 | + | let pmtB = $t01839518475._2 | |
600 | + | let $t01847818582 = replenishByType(pType, pool, NO_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId) | |
601 | + | let stakedAmount = $t01847818582._1 | |
602 | + | let nf = $t01847818582._2 | |
587 | 603 | let curPoolInterestLoan = valueOrElse(getInteger(this, (pool + kPoolInterestLoan)), 0) | |
588 | 604 | let curPoolInterestNoLoan = valueOrElse(getInteger(this, (pool + kPoolInterestNoLoan)), 0) | |
589 | 605 | let totalShareAmount = getPoolTotalShare(pool) | |
590 | 606 | let totalShareAmountWithLoan = getPoolTotalShareWithLoan(pool) | |
591 | 607 | let loanPercent = fraction(totalShareAmountWithLoan, SCALE8, totalShareAmount) | |
592 | 608 | let stakedLoan = fraction(stakedAmount, loanPercent, SCALE8) | |
593 | 609 | let stakedNoLoan = (stakedAmount - stakedLoan) | |
594 | 610 | let newInterestLoan = if ((totalShareAmountWithLoan > 0)) | |
595 | 611 | then (curPoolInterestLoan + fraction(stakedLoan, SCALE10, totalShareAmountWithLoan)) | |
596 | 612 | else 0 | |
597 | 613 | let newInterestNoLoan = if (((totalShareAmount - totalShareAmountWithLoan) > 0)) | |
598 | 614 | then (curPoolInterestNoLoan + fraction(stakedNoLoan, SCALE10, (totalShareAmount - totalShareAmountWithLoan))) | |
599 | 615 | else 0 | |
600 | 616 | let axlyFeeLoan = fraction(stakedLoan, getAxlyFee(pool, CAP_FEE_LOAN), FEE_SCALE6) | |
601 | 617 | let axlyFeeNoLoan = fraction(stakedNoLoan, getAxlyFee(pool, CAP_FEE_NO_LOAN), FEE_SCALE6) | |
602 | - | ([IntegerEntry((pool + kPoolInterestLoan), newInterestLoan), IntegerEntry((pool + kPoolInterestNoLoan), newInterestNoLoan), IntegerEntry((pool + kPoolTotal), (((totalShareAmount + stakedAmount) - axlyFeeLoan) - axlyFeeNoLoan)), IntegerEntry((pool + kPoolTotalLoan), ((totalShareAmountWithLoan + stakedLoan) - axlyFeeLoan)), ScriptTransfer(moneyBox, (axlyFeeLoan + axlyFeeNoLoan), fromBase58String(shareId))] ++ getCursEntries(AId, BId, shareId)) | |
618 | + | let axlyFee = unstakeLP(pool, pType, shareId, (axlyFeeLoan + axlyFeeNoLoan)) | |
619 | + | if ((axlyFee == axlyFee)) | |
620 | + | 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)) | |
621 | + | else throw("Strict value is not equal to itself.") | |
603 | 622 | } | |
604 | 623 | ||
605 | 624 | ||
606 | 625 | func exchangeDirectlySF (pool,assetIdA,assetIdB,balA,balB,amountTokenToGet,assetTokenToGet) = { | |
607 | 626 | let poolAddr = Address(fromBase58String(pool)) | |
608 | 627 | let feeScale6 = 1000000 | |
609 | 628 | let fee = getIntegerValue(poolAddr, kSFPoolFee) | |
610 | 629 | let amntGetNoFee = fraction(amountTokenToGet, feeScale6, (feeScale6 - fee)) | |
611 | - | let $ | |
630 | + | let $t02047220760 = if ((assetTokenToGet == assetIdA)) | |
612 | 631 | then { | |
613 | 632 | let amountToPay = fraction(balA, amntGetNoFee, (balB - amntGetNoFee)) | |
614 | 633 | $Tuple2(amountToPay, assetIdB) | |
615 | 634 | } | |
616 | 635 | else { | |
617 | 636 | let amountToPay = fraction(balB, amntGetNoFee, (balA - amntGetNoFee)) | |
618 | 637 | $Tuple2(amountToPay, assetIdA) | |
619 | 638 | } | |
620 | - | let amountToPay = $ | |
621 | - | let assetToPay = $ | |
639 | + | let amountToPay = $t02047220760._1 | |
640 | + | let assetToPay = $t02047220760._2 | |
622 | 641 | invoke(poolAddr, "callFunction", ["exchange", ["1"]], [AttachedPayment(assetIdFromStr(assetToPay), amountToPay)]) | |
623 | 642 | } | |
624 | 643 | ||
625 | 644 | ||
626 | 645 | func exchangeDirectlyWX (pool,assetIdA,assetIdB,balA,balB,amountTokenToGet,assetTokenToGet) = { | |
627 | 646 | let poolAddr = Address(fromBase58String(pool)) | |
628 | 647 | let prFee = getIntegerValue(wxSwapContract, "%s__protocolFee") | |
629 | 648 | let pFee = getIntegerValue(wxSwapContract, "%s__poolFee") | |
630 | 649 | let feeScale = toBigInt(100000000) | |
631 | - | let $ | |
650 | + | let $t02123921547 = if ((assetTokenToGet == assetIdA)) | |
632 | 651 | then { | |
633 | 652 | let amountToPay = fraction(balA, amountTokenToGet, (balB - amountTokenToGet)) | |
634 | 653 | $Tuple2(amountToPay, assetIdB) | |
635 | 654 | } | |
636 | 655 | else { | |
637 | 656 | let amountToPay = fraction(balB, amountTokenToGet, (balA - amountTokenToGet)) | |
638 | 657 | $Tuple2(amountToPay, assetIdA) | |
639 | 658 | } | |
640 | - | let amountToPay = $ | |
641 | - | let assetToPay = $ | |
659 | + | let amountToPay = $t02123921547._1 | |
660 | + | let assetToPay = $t02123921547._2 | |
642 | 661 | let amountToPayWithFee = toInt(fraction(toBigInt(amountToPay), feeScale, (feeScale - toBigInt((prFee + pFee))))) | |
643 | 662 | invoke(wxSwapContract, "swap", [1, assetTokenToGet, toString(this)], [AttachedPayment(assetIdFromStr(assetToPay), amountToPayWithFee)]) | |
644 | 663 | } | |
645 | 664 | ||
646 | 665 | ||
647 | 666 | func exchangeDirectly (type,pool,assetIdA,assetIdB,balA,balB,amountTokenToGet,assetTokenToGet) = if ((type == SF_POOL)) | |
648 | 667 | then exchangeDirectlySF(pool, assetIdA, assetIdB, balA, balB, amountTokenToGet, assetTokenToGet) | |
649 | 668 | else exchangeDirectlyWX(pool, assetIdA, assetIdB, balA, balB, amountTokenToGet, assetTokenToGet) | |
650 | 669 | ||
651 | 670 | ||
652 | 671 | func withdrawAmountCalc (pool,userCanWithdraw,debt,borrowAsset) = { | |
653 | 672 | let poolAddr = Address(fromBase58String(pool)) | |
654 | 673 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Unknown pool") | |
655 | - | let $ | |
656 | - | let assetIdA = $ | |
657 | - | let assetIdB = $ | |
658 | - | let balA = $ | |
659 | - | let balB = $ | |
660 | - | let shareId = $ | |
674 | + | let $t02241222488 = getPoolData(poolAddr, pType) | |
675 | + | let assetIdA = $t02241222488._1 | |
676 | + | let assetIdB = $t02241222488._2 | |
677 | + | let balA = $t02241222488._3 | |
678 | + | let balB = $t02241222488._4 | |
679 | + | let shareId = $t02241222488._5 | |
661 | 680 | let cBalABefore = accountBalance(assetIdFromStr(assetIdA)) | |
662 | 681 | if ((cBalABefore == cBalABefore)) | |
663 | 682 | then { | |
664 | 683 | let cBalBBefore = accountBalance(assetIdFromStr(assetIdB)) | |
665 | 684 | if ((cBalBBefore == cBalBBefore)) | |
666 | 685 | then { | |
667 | 686 | let inv = if ((pType == SF_POOL)) | |
668 | 687 | then invoke(poolAddr, "callFunction", ["withdraw", [toString(userCanWithdraw)]], nil) | |
669 | 688 | else if ((pType == WX_POOL)) | |
670 | 689 | then invoke(poolAddr, "unstakeAndGet", [userCanWithdraw], nil) | |
671 | 690 | else throw("Wrong position type") | |
672 | 691 | if ((inv == inv)) | |
673 | 692 | then { | |
674 | 693 | let cBalAAfter = accountBalance(assetIdFromStr(assetIdA)) | |
675 | 694 | let cBalBAfter = accountBalance(assetIdFromStr(assetIdB)) | |
676 | - | let $ | |
677 | - | let tokensAmountA = $ | |
678 | - | let tokensAmountB = $ | |
679 | - | let $ | |
695 | + | let $t02300023089 = $Tuple2((cBalAAfter - cBalABefore), (cBalBAfter - cBalBBefore)) | |
696 | + | let tokensAmountA = $t02300023089._1 | |
697 | + | let tokensAmountB = $t02300023089._2 | |
698 | + | let $t02309223788 = if ((debt > 0)) | |
680 | 699 | then { | |
681 | 700 | let amountToGetEx = if (if ((borrowAsset == assetIdA)) | |
682 | 701 | then (debt > tokensAmountA) | |
683 | 702 | else false) | |
684 | 703 | then (debt - tokensAmountA) | |
685 | 704 | else if (if ((borrowAsset == assetIdB)) | |
686 | 705 | then (debt > tokensAmountB) | |
687 | 706 | else false) | |
688 | 707 | then (debt - tokensAmountB) | |
689 | 708 | else 0 | |
690 | 709 | let exInv = if ((amountToGetEx > 0)) | |
691 | 710 | then exchangeDirectly(pType, pool, assetIdA, assetIdB, balA, balB, amountToGetEx, borrowAsset) | |
692 | 711 | else 0 | |
693 | 712 | if ((exInv == exInv)) | |
694 | 713 | then { | |
695 | 714 | let cBalAAfterRepay = accountBalance(assetIdFromStr(assetIdA)) | |
696 | 715 | let cBalBAfterRepay = accountBalance(assetIdFromStr(assetIdB)) | |
697 | 716 | $Tuple2((cBalAAfterRepay - cBalABefore), (cBalBAfterRepay - cBalBBefore)) | |
698 | 717 | } | |
699 | 718 | else throw("Strict value is not equal to itself.") | |
700 | 719 | } | |
701 | 720 | else $Tuple2(tokensAmountA, tokensAmountB) | |
702 | - | let toUserAmountA = $ | |
703 | - | let toUserAmountB = $ | |
721 | + | let toUserAmountA = $t02309223788._1 | |
722 | + | let toUserAmountB = $t02309223788._2 | |
704 | 723 | $Tuple7(toUserAmountA, assetIdA, toUserAmountB, assetIdB, cBalAAfter, cBalBAfter, shareId) | |
705 | 724 | } | |
706 | 725 | else throw("Strict value is not equal to itself.") | |
707 | 726 | } | |
708 | 727 | else throw("Strict value is not equal to itself.") | |
709 | 728 | } | |
710 | 729 | else throw("Strict value is not equal to itself.") | |
711 | 730 | } | |
712 | 731 | ||
713 | 732 | ||
714 | 733 | func userCanWithdrawShareCalc (user,pool,posId,borrowed) = { | |
715 | 734 | let pAmount = valueOrErrorMessage(getInteger(this, (((((pool + "_") + user) + "_") + posId) + kUserPosition)), "Unknown position") | |
716 | 735 | let userInterest = getIntegerValue(this, (((((pool + "_") + user) + "_") + posId) + kUserPositionInterest)) | |
717 | 736 | let poolInterest = if (borrowed) | |
718 | 737 | then getIntegerValue(this, (pool + kPoolInterestLoan)) | |
719 | 738 | else getIntegerValue(this, (pool + kPoolInterestNoLoan)) | |
720 | 739 | (pAmount + fraction(pAmount, (poolInterest - userInterest), SCALE10)) | |
721 | 740 | } | |
722 | 741 | ||
723 | 742 | ||
724 | 743 | func withdrawToUser (user,pool,posId,stopLoss) = { | |
725 | 744 | let pAmount = valueOrErrorMessage(getInteger(this, (((((pool + "_") + user) + "_") + posId) + kUserPosition)), "Unknown position") | |
726 | 745 | let userInterest = getIntegerValue(this, (((((pool + "_") + user) + "_") + posId) + kUserPositionInterest)) | |
727 | 746 | let borrowAmount = getIntegerValue(this, (((((pool + "_") + user) + "_") + posId) + kUserBorrowAmount)) | |
728 | 747 | let userCanWithdraw = userCanWithdrawShareCalc(user, pool, posId, (borrowAmount > 0)) | |
729 | 748 | let poolTotalShare = getPoolTotalShare(pool) | |
730 | 749 | let userAddr = Address(fromBase58String(user)) | |
731 | 750 | let borrowAsset = getStringValue(this, (((((pool + "_") + user) + "_") + posId) + kUserBorrowAssetId)) | |
732 | 751 | let debt = if ((borrowAmount > 0)) | |
733 | 752 | then { | |
734 | 753 | let @ = invoke(getLendSrvAddr(), "getAssetDebt", [false, ((((pool + "_") + user) + "_") + posId), borrowAsset], nil) | |
735 | 754 | if ($isInstanceOf(@, "Int")) | |
736 | 755 | then @ | |
737 | 756 | else throw(($getType(@) + " couldn't be cast to Int")) | |
738 | 757 | } | |
739 | 758 | else 0 | |
740 | - | let $ | |
741 | - | if (($ | |
759 | + | let $t02527925432 = withdrawAmountCalc(pool, userCanWithdraw, debt, borrowAsset) | |
760 | + | if (($t02527925432 == $t02527925432)) | |
742 | 761 | then { | |
743 | - | let shareId = $ | |
744 | - | let cBalBAfter = $ | |
745 | - | let cBalAAfter = $ | |
746 | - | let assetIdB = $ | |
747 | - | let toUserAmountB = $ | |
748 | - | let assetIdA = $ | |
749 | - | let toUserAmountA = $ | |
762 | + | let shareId = $t02527925432._7 | |
763 | + | let cBalBAfter = $t02527925432._6 | |
764 | + | let cBalAAfter = $t02527925432._5 | |
765 | + | let assetIdB = $t02527925432._4 | |
766 | + | let toUserAmountB = $t02527925432._3 | |
767 | + | let assetIdA = $t02527925432._2 | |
768 | + | let toUserAmountA = $t02527925432._1 | |
750 | 769 | let closeDbtInv = if ((debt > 0)) | |
751 | 770 | then invoke(getLendSrvAddr(), "repayFor", [((user + "_") + posId)], [AttachedPayment(assetIdFromStr(borrowAsset), debt)]) | |
752 | 771 | else 0 | |
753 | 772 | if ((closeDbtInv == closeDbtInv)) | |
754 | 773 | then ([DeleteEntry((((((pool + "_") + user) + "_") + posId) + kUserPosition)), DeleteEntry((((((pool + "_") + user) + "_") + posId) + kUserPositionInterest)), IntegerEntry((pool + kPoolTotal), (poolTotalShare - userCanWithdraw)), ScriptTransfer(userAddr, toUserAmountA, assetIdFromStr(assetIdA)), ScriptTransfer(userAddr, toUserAmountB, assetIdFromStr(assetIdB))] ++ getCursEntries(assetIdA, assetIdB, shareId)) | |
755 | 774 | else throw("Strict value is not equal to itself.") | |
756 | 775 | } | |
757 | 776 | else throw("Strict value is not equal to itself.") | |
758 | 777 | } | |
759 | 778 | ||
760 | 779 | ||
761 | 780 | func parseRequest (requestId) = { | |
762 | 781 | let request = split(valueOrErrorMessage(getString(this, (requestId + kRequestId)), ("No request with id " + requestId)), ",") | |
763 | 782 | let user = request[0] | |
764 | 783 | let pool = request[1] | |
765 | 784 | let pmtA = parseIntValue(request[2]) | |
766 | 785 | let AId = request[3] | |
767 | 786 | let pmtB = parseIntValue(request[4]) | |
768 | 787 | let BId = request[5] | |
769 | 788 | let balA = parseIntValue(request[6]) | |
770 | 789 | let balB = parseIntValue(request[7]) | |
771 | 790 | let shareId = request[8] | |
772 | 791 | let bwAsset = request[9] | |
773 | 792 | let bwAmount = parseIntValue(request[10]) | |
774 | 793 | $Tuple11(user, pool, pmtA, AId, pmtB, BId, balA, balB, shareId, bwAsset, bwAmount) | |
775 | 794 | } | |
776 | 795 | ||
777 | 796 | ||
778 | - | func unstakeLP (pool,pType,shareId,amount) = { | |
779 | - | let $t02613126488 = if ((pType == SF_POOL)) | |
780 | - | then $Tuple3(getSFFarmingAddr(), "withdrawShareTokens", [pool, amount]) | |
781 | - | else if ((pType == WX_POOL)) | |
782 | - | then $Tuple3(getWXFarmingAddr(Address(fromBase58String(pool))), "unstake", [shareId, amount]) | |
783 | - | else throw("Wrong pool type") | |
784 | - | let farmAddr = $t02613126488._1 | |
785 | - | let fName = $t02613126488._2 | |
786 | - | let params = $t02613126488._3 | |
787 | - | let inv = invoke(farmAddr, fName, params, nil) | |
788 | - | if ((inv == inv)) | |
789 | - | then amount | |
790 | - | else throw("Strict value is not equal to itself.") | |
791 | - | } | |
792 | - | ||
793 | - | ||
794 | 797 | @Callable(i) | |
795 | 798 | func replenishEVALONLY (pool,leverage,borrowAssetId,pmtA,pmtB) = if (if ((100 > leverage)) | |
796 | 799 | then true | |
797 | 800 | else (leverage > 300)) | |
798 | 801 | then throw("Leverage can't be <100 and >300") | |
799 | 802 | else { | |
800 | 803 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
801 | - | let $ | |
802 | - | let AId = $ | |
803 | - | let BId = $ | |
804 | - | let balA = $ | |
805 | - | let balB = $ | |
806 | - | let shareId = $ | |
804 | + | let $t02694427034 = getPoolData(Address(fromBase58String(pool)), pType) | |
805 | + | let AId = $t02694427034._1 | |
806 | + | let BId = $t02694427034._2 | |
807 | + | let balA = $t02694427034._3 | |
808 | + | let balB = $t02694427034._4 | |
809 | + | let shareId = $t02694427034._5 | |
807 | 810 | let borrowAmount = if ((leverage > 100)) | |
808 | 811 | then { | |
809 | 812 | let dPriceA = ( let @ = invoke(priceOracleAddr, "getTWAP60", [AId, false], nil) | |
810 | 813 | if ($isInstanceOf(@, "(Int, Int)")) | |
811 | 814 | then @ | |
812 | 815 | else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._2 | |
813 | 816 | let dPriceB = ( let @ = invoke(priceOracleAddr, "getTWAP60", [BId, false], nil) | |
814 | 817 | if ($isInstanceOf(@, "(Int, Int)")) | |
815 | 818 | then @ | |
816 | 819 | else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._2 | |
817 | 820 | let paydInDollar = (fraction(dPriceA, pmtA, pow(10, 0, getAssetDecimals(AId), 0, 0, DOWN)) + fraction(dPriceB, pmtB, pow(10, 0, getAssetDecimals(BId), 0, 0, DOWN))) | |
818 | 821 | fraction(paydInDollar, (leverage - 100), 100) | |
819 | 822 | } | |
820 | 823 | else $Tuple2(replenishByType(pType, pool, NO_LOAN_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId)._1, 0) | |
821 | 824 | nil | |
822 | 825 | } | |
823 | 826 | ||
824 | 827 | ||
825 | 828 | ||
826 | 829 | @Callable(i) | |
827 | 830 | func getShareAssetPriceREADONLY (shareId) = { | |
828 | 831 | let sharePrices = getSharePrice([shareId]) | |
829 | 832 | $Tuple2(nil, sharePrices[0]) | |
830 | 833 | } | |
831 | 834 | ||
832 | 835 | ||
833 | 836 | ||
834 | 837 | @Callable(i) | |
835 | 838 | func getUserPositionShareAmountREADONLY (user,posNum) = { | |
836 | 839 | let pool = valueOrErrorMessage(getString(this, (((user + "_") + posNum) + kUserPositionPool)), "Unknown position") | |
837 | 840 | let borrowAmount = getIntegerValue(this, (((((pool + "_") + user) + "_") + posNum) + kUserBorrowAmount)) | |
838 | 841 | let userCanWithdraw = userCanWithdrawShareCalc(user, pool, posNum, (borrowAmount > 0)) | |
839 | 842 | $Tuple2(nil, userCanWithdraw) | |
840 | 843 | } | |
841 | 844 | ||
842 | 845 | ||
843 | 846 | ||
844 | 847 | @Callable(i) | |
845 | 848 | func replenish (pool,leverage,borrowAssetId) = if (if ((100 > leverage)) | |
846 | 849 | then true | |
847 | 850 | else (leverage > 300)) | |
848 | 851 | then throw("Leverage can't be <100 and >300") | |
849 | 852 | else { | |
850 | 853 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
851 | - | let $ | |
852 | - | let AId = $ | |
853 | - | let BId = $ | |
854 | - | let balA = $ | |
855 | - | let balB = $ | |
856 | - | let shareId = $ | |
857 | - | let $ | |
854 | + | let $t02905029140 = getPoolData(Address(fromBase58String(pool)), pType) | |
855 | + | let AId = $t02905029140._1 | |
856 | + | let BId = $t02905029140._2 | |
857 | + | let balA = $t02905029140._3 | |
858 | + | let balB = $t02905029140._4 | |
859 | + | let shareId = $t02905029140._5 | |
860 | + | let $t02914329780 = if ((size(i.payments) == 2)) | |
858 | 861 | then if ((assetIdToStr(i.payments[0].assetId) != AId)) | |
859 | 862 | then throw("Wrong payment asset A") | |
860 | 863 | else if ((assetIdToStr(i.payments[1].assetId) != BId)) | |
861 | 864 | then throw("Wrong payment asset B") | |
862 | 865 | else $Tuple4(i.payments[0].amount, AId, i.payments[1].amount, BId) | |
863 | 866 | else if ((size(i.payments) == 1)) | |
864 | 867 | then if ((assetIdToStr(i.payments[0].assetId) == AId)) | |
865 | 868 | then $Tuple4(i.payments[0].amount, AId, 0, BId) | |
866 | 869 | else if ((assetIdToStr(i.payments[0].assetId) == BId)) | |
867 | 870 | then $Tuple4(0, AId, i.payments[0].amount, BId) | |
868 | 871 | else throw("Wrong payment") | |
869 | 872 | else throw("One or two payments expected") | |
870 | - | let pmtA = $ | |
871 | - | let pmtAssetA = $ | |
872 | - | let pmtB = $ | |
873 | - | let pmtAssetB = $ | |
873 | + | let pmtA = $t02914329780._1 | |
874 | + | let pmtAssetA = $t02914329780._2 | |
875 | + | let pmtB = $t02914329780._3 | |
876 | + | let pmtAssetB = $t02914329780._4 | |
874 | 877 | let newPosNum = getNewUserPositionNumber(pool, toString(i.caller)) | |
875 | 878 | if ((leverage > 100)) | |
876 | 879 | then { | |
877 | 880 | let dPriceA = ( let @ = invoke(priceOracleAddr, "getTWAP60", [pmtAssetA, false], nil) | |
878 | 881 | if ($isInstanceOf(@, "(Int, Int)")) | |
879 | 882 | then @ | |
880 | 883 | else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._2 | |
881 | 884 | let dPriceB = ( let @ = invoke(priceOracleAddr, "getTWAP60", [pmtAssetB, false], nil) | |
882 | 885 | if ($isInstanceOf(@, "(Int, Int)")) | |
883 | 886 | then @ | |
884 | 887 | else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._2 | |
885 | 888 | let paydInDollar = (fraction(dPriceA, pmtA, pow(10, 0, getAssetDecimals(pmtAssetA), 0, 0, DOWN)) + fraction(dPriceB, pmtB, pow(10, 0, getAssetDecimals(pmtAssetB), 0, 0, DOWN))) | |
886 | 889 | let borrowPrice = if ((borrowAssetId == AId)) | |
887 | 890 | then dPriceA | |
888 | 891 | else dPriceB | |
889 | 892 | let borrowAmount = (fraction(paydInDollar, (leverage - 100), 100) / borrowPrice) | |
890 | 893 | let request = makeString([toString(i.caller), pool, toString(pmtA), pmtAssetA, toString(pmtB), pmtAssetB, toString(balA), toString(balB), shareId, borrowAssetId, toString(borrowAmount)], ",") | |
891 | 894 | let newRequestId = { | |
892 | 895 | let @ = invoke(this, "createNewRequest", [request], nil) | |
893 | 896 | if ($isInstanceOf(@, "Int")) | |
894 | 897 | then @ | |
895 | 898 | else throw(($getType(@) + " couldn't be cast to Int")) | |
896 | 899 | } | |
897 | 900 | if ((newRequestId == newRequestId)) | |
898 | 901 | then { | |
899 | 902 | let args = [((toString(i.caller) + "_") + toString(newPosNum)), shareId, borrowAssetId, borrowAmount, toString(this), "replenishFromLand", toString(valueOrErrorMessage(newRequestId, "Can't create new request"))] | |
900 | 903 | let inv = reentrantInvoke(getLendSrvAddr(), "flashPosition", args, nil) | |
901 | 904 | if ((inv == inv)) | |
902 | 905 | then nil | |
903 | 906 | else throw("Strict value is not equal to itself.") | |
904 | 907 | } | |
905 | 908 | else throw("Strict value is not equal to itself.") | |
906 | 909 | } | |
907 | 910 | else { | |
908 | - | let $ | |
909 | - | let userStaked = $ | |
910 | - | let axlyFee = $ | |
911 | + | let $t03116331275 = replenishByType(pType, pool, NO_LOAN_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId) | |
912 | + | let userStaked = $t03116331275._1 | |
913 | + | let axlyFee = $t03116331275._2 | |
911 | 914 | (replenishEntries(pool, toString(i.caller), userStaked, axlyFee, newPosNum, shareId, pType, false) ++ getCursEntries(AId, BId, shareId)) | |
912 | 915 | } | |
913 | 916 | } | |
914 | 917 | ||
915 | 918 | ||
916 | 919 | ||
917 | 920 | @Callable(i) | |
918 | 921 | func replenishFromLand (requestId) = { | |
919 | - | let $ | |
920 | - | let user = $ | |
921 | - | let pool = $ | |
922 | - | let pmtA = $ | |
923 | - | let AId = $ | |
924 | - | let pmtB = $ | |
925 | - | let BId = $ | |
926 | - | let balA = $ | |
927 | - | let balB = $ | |
928 | - | let shareId = $ | |
929 | - | let bwAsset = $ | |
930 | - | let bwAmount = $ | |
922 | + | let $t03148631590 = parseRequest(requestId) | |
923 | + | let user = $t03148631590._1 | |
924 | + | let pool = $t03148631590._2 | |
925 | + | let pmtA = $t03148631590._3 | |
926 | + | let AId = $t03148631590._4 | |
927 | + | let pmtB = $t03148631590._5 | |
928 | + | let BId = $t03148631590._6 | |
929 | + | let balA = $t03148631590._7 | |
930 | + | let balB = $t03148631590._8 | |
931 | + | let shareId = $t03148631590._9 | |
932 | + | let bwAsset = $t03148631590._10 | |
933 | + | let bwAmount = $t03148631590._11 | |
931 | 934 | if ((size(i.payments) != 1)) | |
932 | 935 | then throw("Wrong payment size") | |
933 | 936 | else if (if ((assetIdToStr(i.payments[0].assetId) != bwAsset)) | |
934 | 937 | then true | |
935 | 938 | else (i.payments[0].amount != bwAmount)) | |
936 | 939 | then throw("Wrong payment") | |
937 | 940 | else { | |
938 | - | let $ | |
941 | + | let $t03178031904 = if ((AId == bwAsset)) | |
939 | 942 | then $Tuple2((pmtA + i.payments[0].amount), pmtB) | |
940 | 943 | else $Tuple2(pmtA, (pmtB + i.payments[0].amount)) | |
941 | - | let pmtAllA = $ | |
942 | - | let pmtAllB = $ | |
944 | + | let pmtAllA = $t03178031904._1 | |
945 | + | let pmtAllB = $t03178031904._2 | |
943 | 946 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Unknown pool") | |
944 | - | let $ | |
945 | - | let userStaked = $ | |
946 | - | let axlyFee = $ | |
947 | + | let $t03198632095 = replenishByType(pType, pool, LOAN_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId) | |
948 | + | let userStaked = $t03198632095._1 | |
949 | + | let axlyFee = $t03198632095._2 | |
947 | 950 | let posNum = getNewUserPositionNumber(pool, toString(i.caller)) | |
948 | 951 | let borrowEntries = [IntegerEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserBorrowAmount), bwAmount), StringEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserBorrowAssetId), bwAsset)] | |
949 | 952 | let entries = replenishEntries(pool, user, userStaked, axlyFee, posNum, shareId, pType, true) | |
950 | 953 | $Tuple2((((entries ++ getCursEntries(AId, BId, shareId)) ++ borrowEntries) :+ DeleteEntry((requestId + kRequestId))), userStaked) | |
951 | 954 | } | |
952 | 955 | } | |
953 | 956 | ||
954 | 957 | ||
955 | 958 | ||
956 | 959 | @Callable(i) | |
957 | 960 | func withdraw (pool,posId) = withdrawToUser(toString(i.caller), pool, toString(posId), false) | |
958 | 961 | ||
959 | 962 | ||
960 | 963 | ||
961 | 964 | @Callable(i) | |
962 | 965 | func createUpdateStopLoss (posId,poolId,assetId,price) = { | |
963 | 966 | let tokenOraclePrice = ( let @ = invoke(priceOracleAddr, "getTWAP60", [assetId, false], nil) | |
964 | 967 | if ($isInstanceOf(@, "(Int, Int)")) | |
965 | 968 | then @ | |
966 | 969 | else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._1 | |
967 | 970 | if (!(isDefined(getInteger(this, (((((poolId + "_") + toString(i.caller)) + "_") + toString(posId)) + kUserPosition))))) | |
968 | 971 | then throw("There are no user position") | |
969 | 972 | else if ((0 >= price)) | |
970 | 973 | then throw("Price must be greater than 0") | |
971 | 974 | else if ((price > tokenOraclePrice)) | |
972 | 975 | then throw("Price must be less than current token price") | |
973 | 976 | else [IntegerEntry((((((((toString(i.caller) + "_") + toString(posId)) + "_") + poolId) + "_") + assetId) + kUserStopLoss), price)] | |
974 | 977 | } | |
975 | 978 | ||
976 | 979 | ||
977 | 980 | ||
978 | 981 | @Callable(i) | |
979 | 982 | func deleteStopLoss (posId,poolId,assetId) = if (!(isDefined(getInteger(this, (((((((toString(i.caller) + "_") + toString(posId)) + "_") + poolId) + "_") + assetId) + kUserStopLoss))))) | |
980 | 983 | then throw("No entry") | |
981 | 984 | else [DeleteEntry((((((((toString(i.caller) + "_") + toString(posId)) + "_") + poolId) + "_") + assetId) + kUserStopLoss))] | |
982 | 985 | ||
983 | 986 | ||
984 | 987 | ||
985 | 988 | @Callable(i) | |
986 | 989 | func createNewRequest (params) = valueOrElse(isSelfCall(i), { | |
987 | 990 | let newRequestId = (valueOrElse(getInteger(this, kRequestIter), 0) + 1) | |
988 | 991 | $Tuple2([StringEntry((toString(newRequestId) + kRequestId), params), IntegerEntry(kRequestIter, newRequestId)], newRequestId) | |
989 | 992 | }) | |
990 | 993 | ||
991 | 994 | ||
992 | 995 | ||
993 | 996 | @Callable(i) | |
994 | 997 | func stopLoss (user,posId,pool,assetId) = { | |
995 | 998 | let tokenOraclePrice = ( let @ = invoke(priceOracleAddr, "getTWAP60", [assetId, false], nil) | |
996 | 999 | if ($isInstanceOf(@, "(Int, Int)")) | |
997 | 1000 | then @ | |
998 | 1001 | else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._1 | |
999 | 1002 | if (!(isDefined(getInteger(this, (((((((user + "_") + toString(posId)) + "_") + pool) + "_") + assetId) + kUserStopLoss))))) | |
1000 | 1003 | then throw("No entry") | |
1001 | 1004 | else (withdrawToUser(toString(i.caller), pool, toString(posId), true) :+ DeleteEntry((((((((user + "_") + toString(posId)) + "_") + pool) + "_") + assetId) + kUserStopLoss))) | |
1002 | 1005 | } | |
1003 | 1006 | ||
1004 | 1007 | ||
1005 | 1008 | ||
1006 | 1009 | @Callable(i) | |
1007 | 1010 | func liquidate (user,posId,liquidateAmount) = { | |
1008 | 1011 | let pool = valueOrErrorMessage(getString(this, (((user + "_") + posId) + kUserPositionPool)), "no position") | |
1009 | 1012 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
1010 | - | let $ | |
1011 | - | let AId = $ | |
1012 | - | let BId = $ | |
1013 | - | let balA = $ | |
1014 | - | let balB = $ | |
1015 | - | let shareId = $ | |
1013 | + | let $t03487834968 = getPoolData(Address(fromBase58String(pool)), pType) | |
1014 | + | let AId = $t03487834968._1 | |
1015 | + | let BId = $t03487834968._2 | |
1016 | + | let balA = $t03487834968._3 | |
1017 | + | let balB = $t03487834968._4 | |
1018 | + | let shareId = $t03487834968._5 | |
1016 | 1019 | let amount = unstakeLP(pool, pType, shareId, liquidateAmount) | |
1017 | 1020 | let borrowAmount = getIntegerValue(this, (((((pool + "_") + user) + "_") + posId) + kUserBorrowAmount)) | |
1018 | 1021 | let borrowAsset = getStringValue(this, (((((pool + "_") + user) + "_") + posId) + kUserBorrowAssetId)) | |
1019 | 1022 | let userCanWithdraw = userCanWithdrawShareCalc(user, pool, posId, (borrowAmount > 0)) | |
1020 | 1023 | if ((borrowAmount > 0)) | |
1021 | 1024 | then [IntegerEntry((((((pool + "_") + user) + "_") + posId) + kUserPositionInterest), getIntegerValue(this, (pool + kPoolInterestLoan))), IntegerEntry((pool + kPoolTotalLoan), (getPoolTotalShareWithLoan(pool) - liquidateAmount))] | |
1022 | 1025 | else ([IntegerEntry((((((pool + "_") + user) + "_") + posId) + kUserPositionInterest), getIntegerValue(this, (pool + kPoolInterestNoLoan)))] ++ [IntegerEntry((pool + kPoolTotal), (getPoolTotalShare(pool) - liquidateAmount)), IntegerEntry((((((pool + "_") + user) + "_") + posId) + kUserPosition), (userCanWithdraw - liquidateAmount)), ScriptTransfer(i.caller, amount, fromBase58String(shareId))]) | |
1023 | 1026 | } | |
1024 | 1027 | ||
1025 | 1028 | ||
1026 | 1029 | ||
1027 | 1030 | @Callable(i) | |
1028 | 1031 | func capitalizeExKeeper (pool,type,tokenToId,amountToExchange,claim,amountsIn,addresses,assetsToReceive,estReceived,slippageTolerance,minReceived,options) = { | |
1029 | - | let $ | |
1032 | + | let $t03630836502 = if (claim) | |
1030 | 1033 | then claimFarmed(type, pool) | |
1031 | 1034 | else { | |
1032 | 1035 | let claimedAsset = if ((type == SF_POOL)) | |
1033 | 1036 | then SWOPID | |
1034 | 1037 | else WXID | |
1035 | 1038 | $Tuple2(amountToExchange, claimedAsset) | |
1036 | 1039 | } | |
1037 | - | let claimedAmount = $ | |
1038 | - | let claimedAsset = $ | |
1040 | + | let claimedAmount = $t03630836502._1 | |
1041 | + | let claimedAsset = $t03630836502._2 | |
1039 | 1042 | let exchangedAmount = exchangeKeeper(tokenToId, amountToExchange, claimedAsset, amountsIn, addresses, assetsToReceive, estReceived, slippageTolerance, minReceived, options) | |
1040 | 1043 | let change = (claimedAmount - amountToExchange) | |
1041 | 1044 | let changeEntry = if ((change > 0)) | |
1042 | 1045 | then [IntegerEntry((pool + kPoolCapChange), (change + valueOrElse(getInteger(this, (pool + kPoolCapChange)), 0)))] | |
1043 | 1046 | else nil | |
1044 | 1047 | (capitalize(pool, type, tokenToId, exchangedAmount) ++ changeEntry) | |
1045 | 1048 | } | |
1046 | 1049 | ||
1047 | 1050 | ||
1048 | 1051 | ||
1049 | 1052 | @Callable(i) | |
1050 | 1053 | func capitalizeExPuzzle (pool,type,tokenToId,amountToExchange,claim,routesStr,minToReceive,options) = { | |
1051 | - | let $ | |
1054 | + | let $t03715937353 = if (claim) | |
1052 | 1055 | then claimFarmed(type, pool) | |
1053 | 1056 | else { | |
1054 | 1057 | let claimedAsset = if ((type == SF_POOL)) | |
1055 | 1058 | then SWOPID | |
1056 | 1059 | else WXID | |
1057 | 1060 | $Tuple2(amountToExchange, claimedAsset) | |
1058 | 1061 | } | |
1059 | - | let claimedAmount = $ | |
1060 | - | let claimedAsset = $ | |
1062 | + | let claimedAmount = $t03715937353._1 | |
1063 | + | let claimedAsset = $t03715937353._2 | |
1061 | 1064 | let exchangedAmount = exchangePuzzle(tokenToId, amountToExchange, claimedAsset, routesStr, minToReceive, options) | |
1062 | 1065 | let change = (claimedAmount - amountToExchange) | |
1063 | 1066 | let changeEntry = if ((change > 0)) | |
1064 | 1067 | then [IntegerEntry((pool + kPoolCapChange), (change + valueOrElse(getInteger(this, (pool + kPoolCapChange)), 0)))] | |
1065 | 1068 | else nil | |
1066 | 1069 | (capitalize(pool, type, tokenToId, exchangedAmount) ++ changeEntry) | |
1067 | 1070 | } | |
1068 | 1071 | ||
1069 | 1072 | ||
1070 | 1073 | ||
1071 | 1074 | @Callable(i) | |
1072 | 1075 | func capitalizeExSwopFi (pool,type,tokenToId,amountToExchange,claim,exchangers,exchangersType,args1,args2,routingAssetsKeys,minAmountToReceive,options) = { | |
1073 | - | let $ | |
1076 | + | let $t03807638270 = if (claim) | |
1074 | 1077 | then claimFarmed(type, pool) | |
1075 | 1078 | else { | |
1076 | 1079 | let claimedAsset = if ((type == SF_POOL)) | |
1077 | 1080 | then SWOPID | |
1078 | 1081 | else WXID | |
1079 | 1082 | $Tuple2(amountToExchange, claimedAsset) | |
1080 | 1083 | } | |
1081 | - | let claimedAmount = $ | |
1082 | - | let claimedAsset = $ | |
1084 | + | let claimedAmount = $t03807638270._1 | |
1085 | + | let claimedAsset = $t03807638270._2 | |
1083 | 1086 | let exchangedAmount = exchangeSwopFi(tokenToId, amountToExchange, claimedAsset, exchangers, exchangersType, args1, args2, routingAssetsKeys, minAmountToReceive, options) | |
1084 | 1087 | let change = (claimedAmount - amountToExchange) | |
1085 | 1088 | let changeEntry = if ((change > 0)) | |
1086 | 1089 | then [IntegerEntry((pool + kPoolCapChange), (change + valueOrElse(getInteger(this, (pool + kPoolCapChange)), 0)))] | |
1087 | 1090 | else nil | |
1088 | 1091 | (capitalize(pool, type, tokenToId, exchangedAmount) ++ changeEntry) | |
1089 | 1092 | } | |
1090 | 1093 | ||
1091 | 1094 | ||
1092 | 1095 | ||
1093 | 1096 | @Callable(i) | |
1094 | 1097 | func initNewPool (type,poolAddr,inFeeNoLoan,inFeeLoan,capFeeNoLoan,capFeeWithLoan,stoplossFeeNoLoan,stoplossFeeWithLoan) = if (if ((type != SF_POOL)) | |
1095 | 1098 | then (type != WX_POOL) | |
1096 | 1099 | else false) | |
1097 | 1100 | then throw("Wrong type") | |
1098 | 1101 | else { | |
1099 | - | let $ | |
1100 | - | let aId = $ | |
1101 | - | let bId = $ | |
1102 | - | let aBal = $ | |
1103 | - | let bBal = $ | |
1104 | - | let shareId = $ | |
1102 | + | let $t03896339057 = getPoolData(Address(fromBase58String(poolAddr)), type) | |
1103 | + | let aId = $t03896339057._1 | |
1104 | + | let bId = $t03896339057._2 | |
1105 | + | let aBal = $t03896339057._3 | |
1106 | + | let bBal = $t03896339057._4 | |
1107 | + | let shareId = $t03896339057._5 | |
1105 | 1108 | [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)] | |
1106 | 1109 | } | |
1107 | 1110 | ||
1108 | 1111 | ||
1109 | 1112 | ||
1110 | 1113 | @Callable(i) | |
1111 | 1114 | func capitalizeTest (pool,pType,tokenId,tokenAmount) = { | |
1112 | 1115 | let poolAddr = Address(fromBase58String(pool)) | |
1113 | - | let $ | |
1114 | - | let AId = $ | |
1115 | - | let BId = $ | |
1116 | - | let balA = $ | |
1117 | - | let balB = $ | |
1118 | - | let shareId = $ | |
1119 | - | let $ | |
1116 | + | let $t03985339932 = getPoolData(poolAddr, pType) | |
1117 | + | let AId = $t03985339932._1 | |
1118 | + | let BId = $t03985339932._2 | |
1119 | + | let balA = $t03985339932._3 | |
1120 | + | let balB = $t03985339932._4 | |
1121 | + | let shareId = $t03985339932._5 | |
1122 | + | let $t03993540015 = if ((tokenId == AId)) | |
1120 | 1123 | then $Tuple2(tokenAmount, 0) | |
1121 | 1124 | else $Tuple2(0, tokenAmount) | |
1122 | - | let pmtA = $ | |
1123 | - | let pmtB = $ | |
1124 | - | let $ | |
1125 | - | let stakedAmount = $ | |
1126 | - | let nf = $ | |
1125 | + | let pmtA = $t03993540015._1 | |
1126 | + | let pmtB = $t03993540015._2 | |
1127 | + | let $t04001840122 = replenishByType(pType, pool, NO_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId) | |
1128 | + | let stakedAmount = $t04001840122._1 | |
1129 | + | let nf = $t04001840122._2 | |
1127 | 1130 | let curPoolInterestLoan = valueOrElse(getInteger(this, (pool + kPoolInterestLoan)), 0) | |
1128 | 1131 | let curPoolInterestNoLoan = valueOrElse(getInteger(this, (pool + kPoolInterestNoLoan)), 0) | |
1129 | 1132 | let totalShareAmount = getPoolTotalShare(pool) | |
1130 | 1133 | let totalShareAmountWithLoan = getPoolTotalShareWithLoan(pool) | |
1131 | 1134 | let loanPercent = fraction(totalShareAmountWithLoan, SCALE8, totalShareAmount) | |
1132 | 1135 | let stakedLoan = fraction(stakedAmount, loanPercent, SCALE8) | |
1133 | 1136 | let stakedNoLoan = (stakedAmount - stakedLoan) | |
1134 | 1137 | let newInterestLoan = if ((totalShareAmountWithLoan > 0)) | |
1135 | 1138 | then (curPoolInterestLoan + fraction(stakedLoan, SCALE10, totalShareAmountWithLoan)) | |
1136 | 1139 | else 0 | |
1137 | 1140 | let newInterestNoLoan = if (((totalShareAmount - totalShareAmountWithLoan) > 0)) | |
1138 | 1141 | then (curPoolInterestNoLoan + fraction(stakedNoLoan, SCALE10, (totalShareAmount - totalShareAmountWithLoan))) | |
1139 | 1142 | else 0 | |
1140 | 1143 | let axlyFeeLoan = fraction(stakedLoan, getAxlyFee(pool, CAP_FEE_LOAN), FEE_SCALE6) | |
1141 | 1144 | let axlyFeeNoLoan = fraction(stakedNoLoan, getAxlyFee(pool, CAP_FEE_NO_LOAN), FEE_SCALE6) | |
1142 | - | ([IntegerEntry((pool + kPoolInterestLoan), newInterestLoan), IntegerEntry((pool + kPoolInterestNoLoan), newInterestNoLoan), IntegerEntry((pool + kPoolTotal), (((totalShareAmount + stakedAmount) - axlyFeeLoan) - axlyFeeNoLoan)), IntegerEntry((pool + kPoolTotalLoan), ((totalShareAmountWithLoan + stakedLoan) - axlyFeeLoan)), ScriptTransfer(moneyBox, (axlyFeeLoan + axlyFeeNoLoan), fromBase58String(shareId))] ++ getCursEntries(AId, BId, shareId)) | |
1145 | + | let axlyFee = unstakeLP(pool, pType, shareId, (axlyFeeLoan + axlyFeeNoLoan)) | |
1146 | + | if ((axlyFee == axlyFee)) | |
1147 | + | 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)) | |
1148 | + | else throw("Strict value is not equal to itself.") | |
1143 | 1149 | } | |
1144 | 1150 | ||
1145 | 1151 | ||
1146 | 1152 | ||
1147 | 1153 | @Callable(i) | |
1148 | 1154 | func claimFarmedTest (type,pool) = if ((type == SF_POOL)) | |
1149 | 1155 | then { | |
1150 | 1156 | let balBefore = accountBalance(SWOPID) | |
1151 | 1157 | if ((balBefore == balBefore)) | |
1152 | 1158 | then { | |
1153 | 1159 | let inv = invoke(getSFFarmingAddr(), "claim", [pool], nil) | |
1154 | 1160 | if ((inv == inv)) | |
1155 | 1161 | then { | |
1156 | 1162 | let balAfter = accountBalance(SWOPID) | |
1157 | 1163 | $Tuple2(nil, $Tuple2((balAfter - balBefore), SWOPID)) | |
1158 | 1164 | } | |
1159 | 1165 | else throw("Strict value is not equal to itself.") | |
1160 | 1166 | } | |
1161 | 1167 | else throw("Strict value is not equal to itself.") | |
1162 | 1168 | } | |
1163 | 1169 | else if ((type == WX_POOL)) | |
1164 | 1170 | then { | |
1165 | 1171 | let balBefore = accountBalance(WXID) | |
1166 | 1172 | if ((balBefore == balBefore)) | |
1167 | 1173 | then { | |
1168 | 1174 | let inv = invoke(getWXFarmingAddr(Address(fromBase58String(pool))), "claimWX", [pool], nil) | |
1169 | 1175 | if ((inv == inv)) | |
1170 | 1176 | then { | |
1171 | 1177 | let balAfter = accountBalance(WXID) | |
1172 | 1178 | $Tuple2(nil, $Tuple2((balAfter - balBefore), WXID)) | |
1173 | 1179 | } | |
1174 | 1180 | else throw("Strict value is not equal to itself.") | |
1175 | 1181 | } | |
1176 | 1182 | else throw("Strict value is not equal to itself.") | |
1177 | 1183 | } | |
1178 | 1184 | else throw("Wrong pool type") | |
1179 | 1185 | ||
1180 | 1186 | ||
1181 | 1187 | @Verifier(tx) | |
1182 | 1188 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
1183 | 1189 |
github/deemru/w8io/026f985 165.56 ms ◑