tx · 9YzorKuaByCHfGHzJ351tmEPHAbcpibYE6F5my6Cpokw 3MvRWw2FPEimFCTGtK7qY9uAJbM7XJ4ZfJS: -0.04400000 Waves 2023.06.05 17:43 [2609507] smart account 3MvRWw2FPEimFCTGtK7qY9uAJbM7XJ4ZfJS > SELF 0.00000000 Waves
{ "type": 13, "id": "9YzorKuaByCHfGHzJ351tmEPHAbcpibYE6F5my6Cpokw", "fee": 4400000, "feeAssetId": null, "timestamp": 1685976176943, "version": 2, "chainId": 84, "sender": "3MvRWw2FPEimFCTGtK7qY9uAJbM7XJ4ZfJS", "senderPublicKey": "HP8sssVq1866F7CaPQJwgFrt6fsqhQjKwM84cL1wjD2a", "proofs": [ "4whFbZq1dEXuBBtwUur2RLpvYuEdQsmoSav7AZPG8ydT2PmjRQWcU7nQ8HkXnJxmPza2CeT5sffQTVtfNYaqNEzd" ], "script": "base64:BgKRAQgCEgcKBQgBCAEBEgMKAQgSBAoCCAgSBQoDCAEIEgMKAQgSBAoCCAESBgoEAQgIARIFCgMBCAgSAwoBCBIGCgQIAQgIEgUKAwgIARIOCgwICAgBBBEYGBEBARgSCgoICAgIAQQIARgSDgoMCAgIAQQYGBgYGAEYEgoKCAgIAQEBAQEBEgYKBAgICAESBAoCCAhfAAdTRl9QT09MAgJTRgAHV1hfUE9PTAICV1gAD0NBUF9GRUVfTk9fTE9BTgIJY2FwTm9Mb2FuAAxDQVBfRkVFX0xPQU4CB2NhcExvYW4AFFNUT1BMT1NTX0ZFRV9OT19MT0FOAg5zdG9wTG9zc05vTG9hbgANU1RPUExPU1NfTE9BTgIMc3RvcExvc3NMb2FuAAhMT0FOX0ZFRQIEbG9hbgALTk9fTE9BTl9GRUUCBm5vTG9hbgAGTk9fRkVFAgVub0ZlZQAGU0NBTEU4AIDC1y8AB1NDQUxFMTAAgMivoCUACkZFRV9TQ0FMRTYAwIQ9ABRrU0ZQb29sQUFzc2V0QmFsYW5jZQIPQV9hc3NldF9iYWxhbmNlABRrU0ZQb29sQ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AACBQR0eXBlBQdXWF9QT09MBAliYWxCZWZvcmUJAQ5hY2NvdW50QmFsYW5jZQEFBFdYSUQDCQAAAgUJYmFsQmVmb3JlBQliYWxCZWZvcmUEA2ludgkA/AcECQEQZ2V0V1hGYXJtaW5nQWRkcgEJAQdBZGRyZXNzAQkA2QQBBQRwb29sAgdjbGFpbVdYCQDMCAIFBHBvb2wFA25pbAUDbmlsAwkAAAIFA2ludgUDaW52BAhiYWxBZnRlcgkBDmFjY291bnRCYWxhbmNlAQUEV1hJRAkAlAoCBQNuaWwJAJQKAgkAZQIFCGJhbEFmdGVyBQliYWxCZWZvcmUFBFdYSUQJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAIBAg9Xcm9uZyBwb29sIHR5cGUBAnR4AQZ2ZXJpZnkACQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACAUCdHgPc2VuZGVyUHVibGljS2V5E2HzHw==", "height": 2609507, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3ieZeCgH8yz4RSxkTeTXdxnV7xdqT6UNNKYhwouedg4Z Next: GFF7qZ7YhMkxuEKB3J76QAqus64HtdhXtmK7paxdrekH Diff:
Old | New | Differences | |
---|---|---|---|
474 | 474 | let poolAddr = addressFromStringValue(pool) | |
475 | 475 | if ((pType == SF_POOL)) | |
476 | 476 | then { | |
477 | - | let args = [toString(pmtA), toString(pmtB), "0"] | |
478 | 477 | let inv = { | |
479 | - | let @ = invoke(poolAddr, "callFunction", ["calcLPReplanishDiffPropREADONLY", | |
478 | + | let @ = invoke(poolAddr, "callFunction", ["calcLPReplanishDiffPropREADONLY", [toString(pmtA), toString(pmtB), "0"]], nil) | |
480 | 479 | if ($isInstanceOf(@, "(Int, Int, Int, Int, Int, ByteVector|Unit)")) | |
481 | 480 | then @ | |
482 | 481 | else throw(($getType(@) + " couldn't be cast to (Int, Int, Int, Int, Int, ByteVector|Unit)")) | |
487 | 486 | } | |
488 | 487 | else if ((pType == WX_POOL)) | |
489 | 488 | then { | |
490 | - | let $ | |
489 | + | let $t01491915260 = if (if ((pmtA > 0)) | |
491 | 490 | then (pmtB > 0) | |
492 | 491 | else false) | |
493 | 492 | then { | |
494 | - | let $ | |
495 | - | let pmtInA = $ | |
496 | - | let pmtInB = $ | |
497 | - | let change = $ | |
498 | - | let changeId = $ | |
499 | - | let lpAmount = $ | |
493 | + | let $t01500015126 = calcReplenishByTwoTokens(pType, poolAddr, pmtA, aId, pmtB, bId, balA, balB) | |
494 | + | let pmtInA = $t01500015126._1 | |
495 | + | let pmtInB = $t01500015126._2 | |
496 | + | let change = $t01500015126._3 | |
497 | + | let changeId = $t01500015126._4 | |
498 | + | let lpAmount = $t01500015126._5 | |
500 | 499 | $Tuple3(change, changeId, lpAmount) | |
501 | 500 | } | |
502 | 501 | else if ((pmtA > 0)) | |
503 | 502 | then $Tuple3(pmtA, aId, 0) | |
504 | 503 | else $Tuple3(pmtB, bId, 0) | |
505 | - | let change = $ | |
506 | - | let changeId = $ | |
507 | - | let lpTwo = $ | |
504 | + | let change = $t01491915260._1 | |
505 | + | let changeId = $t01491915260._2 | |
506 | + | let lpTwo = $t01491915260._3 | |
508 | 507 | let lpOne = if ((change > 0)) | |
509 | 508 | then { | |
510 | 509 | let inv = { | |
526 | 525 | ||
527 | 526 | func calcWithdrawLPVirt (pType,pool,lpAmount,shareId,aId,bId,balA,balB,borrowAmount,borrowAssetId) = { | |
528 | 527 | let poolAddr = addressFromStringValue(pool) | |
529 | - | let $ | |
528 | + | let $t01574616187 = if ((pType == SF_POOL)) | |
530 | 529 | then { | |
531 | 530 | let inv = { | |
532 | 531 | let @ = invoke(poolAddr, "callFunction", ["withdrawREADONLY", [toString(lpAmount)]], nil) | |
551 | 550 | else throw("Strict value is not equal to itself.") | |
552 | 551 | } | |
553 | 552 | else throw("Wrong pool type") | |
554 | - | let getAmountA = $ | |
555 | - | let getAmountB = $ | |
553 | + | let getAmountA = $t01574616187._1 | |
554 | + | let getAmountB = $t01574616187._2 | |
556 | 555 | if ((borrowAmount > 0)) | |
557 | 556 | then { | |
558 | 557 | let amountToGetEx = if (if ((borrowAssetId == aId)) | |
564 | 563 | else false) | |
565 | 564 | then (borrowAmount - getAmountB) | |
566 | 565 | else 0 | |
567 | - | let $ | |
566 | + | let $t01649016805 = if ((amountToGetEx > 0)) | |
568 | 567 | then if ((pType == SF_POOL)) | |
569 | 568 | then calcAmountToPaySF(pool, aId, bId, balA, balB, amountToGetEx, borrowAssetId) | |
570 | 569 | else calcAmountToPayWX(pool, aId, bId, balA, balB, amountToGetEx, borrowAssetId) | |
571 | 570 | else $Tuple2("", 0) | |
572 | - | let assetToPay = $ | |
573 | - | let amountToPay = $ | |
571 | + | let assetToPay = $t01649016805._1 | |
572 | + | let amountToPay = $t01649016805._2 | |
574 | 573 | if ((borrowAssetId == aId)) | |
575 | 574 | then $Tuple2(((getAmountA + amountToGetEx) - borrowAmount), (getAmountB - amountToPay)) | |
576 | 575 | else $Tuple2((getAmountA - amountToPay), ((getAmountB + amountToGetEx) - borrowAmount)) | |
617 | 616 | if ((lpBalanceBefore == lpBalanceBefore)) | |
618 | 617 | then { | |
619 | 618 | let poolAddr = addressFromStringValue(pool) | |
620 | - | let $ | |
619 | + | let $t01801518431 = if (if ((pmtA > 0)) | |
621 | 620 | then (pmtB > 0) | |
622 | 621 | else false) | |
623 | 622 | then { | |
624 | - | let $ | |
625 | - | let pmtInA = $ | |
626 | - | let pmtInB = $ | |
627 | - | let change = $ | |
628 | - | let changeId = $ | |
623 | + | let $t01808118197 = calcReplenishByTwoTokens(pType, poolAddr, pmtA, aId, pmtB, bId, balA, balB) | |
624 | + | let pmtInA = $t01808118197._1 | |
625 | + | let pmtInB = $t01808118197._2 | |
626 | + | let change = $t01808118197._3 | |
627 | + | let changeId = $t01808118197._4 | |
629 | 628 | let inv = replenishTwoTokensByType(poolAddr, pType, pmtInA, aId, pmtInB, bId) | |
630 | 629 | if ((inv == inv)) | |
631 | 630 | then $Tuple2(change, changeId) | |
636 | 635 | else if ((pmtB > 0)) | |
637 | 636 | then $Tuple2(pmtB, bId) | |
638 | 637 | else throw("pmts must be > 0") | |
639 | - | let change = $ | |
640 | - | let changeId = $ | |
638 | + | let change = $t01801518431._1 | |
639 | + | let changeId = $t01801518431._2 | |
641 | 640 | let inv = if ((change > 0)) | |
642 | 641 | then replenishOneTokenByType(poolAddr, pType, change, changeId) | |
643 | 642 | else nil | |
665 | 664 | func replenishEntries (pool,user,stakedAmount,axlyFeeAmount,posNum,shareId,type,withLoan) = { | |
666 | 665 | let totalAmount = getPoolTotalShare(pool) | |
667 | 666 | let totalAmountLoan = getPoolTotalShareWithLoan(pool) | |
668 | - | let $ | |
667 | + | let $t01928919527 = if (withLoan) | |
669 | 668 | then $Tuple2(getIntegerValue(this, (pool + kPoolInterestLoan)), (totalAmountLoan + stakedAmount)) | |
670 | 669 | else $Tuple2(getIntegerValue(this, (pool + kPoolInterestNoLoan)), totalAmountLoan) | |
671 | - | let curPoolInterest = $ | |
672 | - | let totalStakedWithLoan = $ | |
670 | + | let curPoolInterest = $t01928919527._1 | |
671 | + | let totalStakedWithLoan = $t01928919527._2 | |
673 | 672 | [IntegerEntry((pool + kPoolTotal), (totalAmount + stakedAmount)), IntegerEntry((pool + kPoolTotalLoan), totalStakedWithLoan), IntegerEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserPosition), stakedAmount), IntegerEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserPositionInterest), curPoolInterest), StringEntry((((user + "_") + toString(posNum)) + kUserPositionPool), pool), IntegerEntry((user + kUserPositionNum), posNum), ScriptTransfer(moneyBox, axlyFeeAmount, fromBase58String(shareId))] | |
674 | 673 | } | |
675 | 674 | ||
715 | 714 | ||
716 | 715 | func capitalize (pool,pType,tokenId,tokenAmount) = { | |
717 | 716 | let poolAddr = Address(fromBase58String(pool)) | |
718 | - | let $ | |
719 | - | let AId = $ | |
720 | - | let BId = $ | |
721 | - | let balA = $ | |
722 | - | let balB = $ | |
723 | - | let shareId = $ | |
724 | - | let $ | |
717 | + | let $t02187821957 = getPoolData(poolAddr, pType) | |
718 | + | let AId = $t02187821957._1 | |
719 | + | let BId = $t02187821957._2 | |
720 | + | let balA = $t02187821957._3 | |
721 | + | let balB = $t02187821957._4 | |
722 | + | let shareId = $t02187821957._5 | |
723 | + | let $t02196022040 = if ((tokenId == AId)) | |
725 | 724 | then $Tuple2(tokenAmount, 0) | |
726 | 725 | else $Tuple2(0, tokenAmount) | |
727 | - | let pmtA = $ | |
728 | - | let pmtB = $ | |
729 | - | let $ | |
730 | - | let stakedAmount = $ | |
731 | - | let nf = $ | |
726 | + | let pmtA = $t02196022040._1 | |
727 | + | let pmtB = $t02196022040._2 | |
728 | + | let $t02204322147 = replenishByType(pType, pool, NO_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId) | |
729 | + | let stakedAmount = $t02204322147._1 | |
730 | + | let nf = $t02204322147._2 | |
732 | 731 | let curPoolInterestLoan = valueOrElse(getInteger(this, (pool + kPoolInterestLoan)), 0) | |
733 | 732 | let curPoolInterestNoLoan = valueOrElse(getInteger(this, (pool + kPoolInterestNoLoan)), 0) | |
734 | 733 | let totalShareAmount = getPoolTotalShare(pool) | |
754 | 753 | func withdrawAmountCalc (pool,userCanWithdraw,debt,borrowAsset) = { | |
755 | 754 | let poolAddr = Address(fromBase58String(pool)) | |
756 | 755 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Unknown pool") | |
757 | - | let $ | |
758 | - | let assetIdA = $ | |
759 | - | let assetIdB = $ | |
760 | - | let balA = $ | |
761 | - | let balB = $ | |
762 | - | let shareId = $ | |
756 | + | let $t02391523991 = getPoolData(poolAddr, pType) | |
757 | + | let assetIdA = $t02391523991._1 | |
758 | + | let assetIdB = $t02391523991._2 | |
759 | + | let balA = $t02391523991._3 | |
760 | + | let balB = $t02391523991._4 | |
761 | + | let shareId = $t02391523991._5 | |
763 | 762 | let cBalABefore = accountBalance(assetIdFromStr(assetIdA)) | |
764 | 763 | if ((cBalABefore == cBalABefore)) | |
765 | 764 | then { | |
778 | 777 | then { | |
779 | 778 | let cBalAAfter = accountBalance(assetIdFromStr(assetIdA)) | |
780 | 779 | let cBalBAfter = accountBalance(assetIdFromStr(assetIdB)) | |
781 | - | let $ | |
782 | - | let tokensAmountA = $ | |
783 | - | let tokensAmountB = $ | |
784 | - | let $ | |
780 | + | let $t02455424643 = $Tuple2((cBalAAfter - cBalABefore), (cBalBAfter - cBalBBefore)) | |
781 | + | let tokensAmountA = $t02455424643._1 | |
782 | + | let tokensAmountB = $t02455424643._2 | |
783 | + | let $t02464625342 = if ((debt > 0)) | |
785 | 784 | then { | |
786 | 785 | let amountToGetEx = if (if ((borrowAsset == assetIdA)) | |
787 | 786 | then (debt > tokensAmountA) | |
804 | 803 | else throw("Strict value is not equal to itself.") | |
805 | 804 | } | |
806 | 805 | else $Tuple2(tokensAmountA, tokensAmountB) | |
807 | - | let toUserAmountA = $ | |
808 | - | let toUserAmountB = $ | |
806 | + | let toUserAmountA = $t02464625342._1 | |
807 | + | let toUserAmountB = $t02464625342._2 | |
809 | 808 | $Tuple7(toUserAmountA, assetIdA, toUserAmountB, assetIdB, cBalAAfter, cBalBAfter, shareId) | |
810 | 809 | } | |
811 | 810 | else throw("Strict value is not equal to itself.") | |
842 | 841 | else throw(($getType(@) + " couldn't be cast to Int")) | |
843 | 842 | } | |
844 | 843 | else 0 | |
845 | - | let $ | |
846 | - | if (($ | |
844 | + | let $t02685427007 = withdrawAmountCalc(pool, userCanWithdraw, debt, borrowAsset) | |
845 | + | if (($t02685427007 == $t02685427007)) | |
847 | 846 | then { | |
848 | - | let shareId = $ | |
849 | - | let cBalBAfter = $ | |
850 | - | let cBalAAfter = $ | |
851 | - | let assetIdB = $ | |
852 | - | let toUserAmountB = $ | |
853 | - | let assetIdA = $ | |
854 | - | let toUserAmountA = $ | |
847 | + | let shareId = $t02685427007._7 | |
848 | + | let cBalBAfter = $t02685427007._6 | |
849 | + | let cBalAAfter = $t02685427007._5 | |
850 | + | let assetIdB = $t02685427007._4 | |
851 | + | let toUserAmountB = $t02685427007._3 | |
852 | + | let assetIdA = $t02685427007._2 | |
853 | + | let toUserAmountA = $t02685427007._1 | |
855 | 854 | let closeDbtInv = if ((debt > 0)) | |
856 | 855 | then invoke(getLendSrvAddr(), "repayFor", [((user + "_") + posId)], [AttachedPayment(assetIdFromStr(borrowAsset), debt)]) | |
857 | 856 | else 0 | |
887 | 886 | then throw("Leverage can't be <100 and >300") | |
888 | 887 | else { | |
889 | 888 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
890 | - | let $ | |
891 | - | let AId = $ | |
892 | - | let BId = $ | |
893 | - | let balA = $ | |
894 | - | let balB = $ | |
895 | - | let shareId = $ | |
889 | + | let $t02851928609 = getPoolData(Address(fromBase58String(pool)), pType) | |
890 | + | let AId = $t02851928609._1 | |
891 | + | let BId = $t02851928609._2 | |
892 | + | let balA = $t02851928609._3 | |
893 | + | let balB = $t02851928609._4 | |
894 | + | let shareId = $t02851928609._5 | |
896 | 895 | let borrowAmount = if ((leverage > 100)) | |
897 | 896 | then { | |
898 | 897 | let dPriceA = ( let @ = invoke(priceOracleAddr, "getTWAP60", [AId, false], nil) | |
910 | 909 | (fraction(paydInDollar, (leverage - 100), 100) / borrowPrice) | |
911 | 910 | } | |
912 | 911 | else 0 | |
913 | - | let $ | |
912 | + | let $t02917829290 = if ((borrowAssetId == AId)) | |
914 | 913 | then $Tuple2((pmtA + borrowAmount), pmtB) | |
915 | 914 | else $Tuple2(pmtA, (pmtB + borrowAmount)) | |
916 | - | let payInA = $ | |
917 | - | let payInB = $ | |
915 | + | let payInA = $t02917829290._1 | |
916 | + | let payInB = $t02917829290._2 | |
918 | 917 | let lpAmount = calcReplanishLPVirt(pType, pool, pmtA, AId, pmtB, BId, balA, balB) | |
919 | - | let $ | |
920 | - | if (($ | |
918 | + | let $t02938329518 = calcWithdrawLPVirt(pType, pool, lpAmount, shareId, AId, BId, balA, balB, borrowAmount, borrowAssetId) | |
919 | + | if (($t02938329518 == $t02938329518)) | |
921 | 920 | then { | |
922 | - | let amountGetB = $ | |
923 | - | let amountGetA = $ | |
921 | + | let amountGetB = $t02938329518._2 | |
922 | + | let amountGetA = $t02938329518._1 | |
924 | 923 | let ratioBefore = fraction(balB, SCALE8, balA) | |
925 | 924 | let ratioAfter = fraction((balB - amountGetB), SCALE8, (balA - amountGetA)) | |
926 | 925 | let impact = (SCALE8 - fraction(ratioBefore, SCALE8, ratioAfter)) | |
959 | 958 | then throw("Leverage can't be <100 and >300") | |
960 | 959 | else { | |
961 | 960 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
962 | - | let $ | |
963 | - | let AId = $ | |
964 | - | let BId = $ | |
965 | - | let balA = $ | |
966 | - | let balB = $ | |
967 | - | let shareId = $ | |
968 | - | let $ | |
961 | + | let $t03066030750 = getPoolData(Address(fromBase58String(pool)), pType) | |
962 | + | let AId = $t03066030750._1 | |
963 | + | let BId = $t03066030750._2 | |
964 | + | let balA = $t03066030750._3 | |
965 | + | let balB = $t03066030750._4 | |
966 | + | let shareId = $t03066030750._5 | |
967 | + | let $t03075331390 = if ((size(i.payments) == 2)) | |
969 | 968 | then if ((assetIdToStr(i.payments[0].assetId) != AId)) | |
970 | 969 | then throw("Wrong payment asset A") | |
971 | 970 | else if ((assetIdToStr(i.payments[1].assetId) != BId)) | |
978 | 977 | then $Tuple4(0, AId, i.payments[0].amount, BId) | |
979 | 978 | else throw("Wrong payment") | |
980 | 979 | else throw("One or two payments expected") | |
981 | - | let pmtA = $ | |
982 | - | let pmtAssetA = $ | |
983 | - | let pmtB = $ | |
984 | - | let pmtAssetB = $ | |
980 | + | let pmtA = $t03075331390._1 | |
981 | + | let pmtAssetA = $t03075331390._2 | |
982 | + | let pmtB = $t03075331390._3 | |
983 | + | let pmtAssetB = $t03075331390._4 | |
985 | 984 | let newPosNum = getNewUserPositionNumber(pool, toString(i.caller)) | |
986 | 985 | if ((leverage > 100)) | |
987 | 986 | then { | |
1016 | 1015 | else throw("Strict value is not equal to itself.") | |
1017 | 1016 | } | |
1018 | 1017 | else { | |
1019 | - | let $ | |
1020 | - | let userStaked = $ | |
1021 | - | let axlyFee = $ | |
1018 | + | let $t03277332885 = replenishByType(pType, pool, NO_LOAN_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId) | |
1019 | + | let userStaked = $t03277332885._1 | |
1020 | + | let axlyFee = $t03277332885._2 | |
1022 | 1021 | (replenishEntries(pool, toString(i.caller), userStaked, axlyFee, newPosNum, shareId, pType, false) ++ getCursEntries(AId, BId, shareId)) | |
1023 | 1022 | } | |
1024 | 1023 | } | |
1027 | 1026 | ||
1028 | 1027 | @Callable(i) | |
1029 | 1028 | func replenishFromLand (requestId) = { | |
1030 | - | let $ | |
1031 | - | let user = $ | |
1032 | - | let pool = $ | |
1033 | - | let pmtA = $ | |
1034 | - | let AId = $ | |
1035 | - | let pmtB = $ | |
1036 | - | let BId = $ | |
1037 | - | let balA = $ | |
1038 | - | let balB = $ | |
1039 | - | let shareId = $ | |
1040 | - | let bwAsset = $ | |
1041 | - | let bwAmount = $ | |
1029 | + | let $t03309633200 = parseRequest(requestId) | |
1030 | + | let user = $t03309633200._1 | |
1031 | + | let pool = $t03309633200._2 | |
1032 | + | let pmtA = $t03309633200._3 | |
1033 | + | let AId = $t03309633200._4 | |
1034 | + | let pmtB = $t03309633200._5 | |
1035 | + | let BId = $t03309633200._6 | |
1036 | + | let balA = $t03309633200._7 | |
1037 | + | let balB = $t03309633200._8 | |
1038 | + | let shareId = $t03309633200._9 | |
1039 | + | let bwAsset = $t03309633200._10 | |
1040 | + | let bwAmount = $t03309633200._11 | |
1042 | 1041 | if ((size(i.payments) != 1)) | |
1043 | 1042 | then throw("Wrong payment size") | |
1044 | 1043 | else if (if ((assetIdToStr(i.payments[0].assetId) != bwAsset)) | |
1046 | 1045 | else (i.payments[0].amount != bwAmount)) | |
1047 | 1046 | then throw("Wrong payment") | |
1048 | 1047 | else { | |
1049 | - | let $ | |
1048 | + | let $t03339033514 = if ((AId == bwAsset)) | |
1050 | 1049 | then $Tuple2((pmtA + i.payments[0].amount), pmtB) | |
1051 | 1050 | else $Tuple2(pmtA, (pmtB + i.payments[0].amount)) | |
1052 | - | let pmtAllA = $ | |
1053 | - | let pmtAllB = $ | |
1051 | + | let pmtAllA = $t03339033514._1 | |
1052 | + | let pmtAllB = $t03339033514._2 | |
1054 | 1053 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Unknown pool") | |
1055 | - | let $ | |
1056 | - | let userStaked = $ | |
1057 | - | let axlyFee = $ | |
1054 | + | let $t03359633705 = replenishByType(pType, pool, LOAN_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId) | |
1055 | + | let userStaked = $t03359633705._1 | |
1056 | + | let axlyFee = $t03359633705._2 | |
1058 | 1057 | let posNum = getNewUserPositionNumber(pool, toString(i.caller)) | |
1059 | 1058 | let borrowEntries = [IntegerEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserBorrowAmount), bwAmount), StringEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserBorrowAssetId), bwAsset)] | |
1060 | 1059 | let entries = replenishEntries(pool, user, userStaked, axlyFee, posNum, shareId, pType, true) | |
1118 | 1117 | func liquidate (user,posId,liquidateAmount) = { | |
1119 | 1118 | let pool = valueOrErrorMessage(getString(this, (((user + "_") + posId) + kUserPositionPool)), "no position") | |
1120 | 1119 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
1121 | - | let $ | |
1122 | - | let AId = $ | |
1123 | - | let BId = $ | |
1124 | - | let balA = $ | |
1125 | - | let balB = $ | |
1126 | - | let shareId = $ | |
1120 | + | let $t03648836578 = getPoolData(Address(fromBase58String(pool)), pType) | |
1121 | + | let AId = $t03648836578._1 | |
1122 | + | let BId = $t03648836578._2 | |
1123 | + | let balA = $t03648836578._3 | |
1124 | + | let balB = $t03648836578._4 | |
1125 | + | let shareId = $t03648836578._5 | |
1127 | 1126 | let amount = unstakeLP(pool, pType, shareId, liquidateAmount) | |
1128 | 1127 | let borrowAmount = getIntegerValue(this, (((((pool + "_") + user) + "_") + posId) + kUserBorrowAmount)) | |
1129 | 1128 | let borrowAsset = getStringValue(this, (((((pool + "_") + user) + "_") + posId) + kUserBorrowAssetId)) | |
1137 | 1136 | ||
1138 | 1137 | @Callable(i) | |
1139 | 1138 | func capitalizeExKeeper (pool,type,tokenToId,amountToExchange,claim,amountsIn,addresses,assetsToReceive,estReceived,slippageTolerance,minReceived,options) = { | |
1140 | - | let $ | |
1139 | + | let $t03781338007 = if (claim) | |
1141 | 1140 | then claimFarmed(type, pool) | |
1142 | 1141 | else { | |
1143 | 1142 | let claimedAsset = if ((type == SF_POOL)) | |
1145 | 1144 | else WXID | |
1146 | 1145 | $Tuple2(amountToExchange, claimedAsset) | |
1147 | 1146 | } | |
1148 | - | let claimedAmount = $ | |
1149 | - | let claimedAsset = $ | |
1147 | + | let claimedAmount = $t03781338007._1 | |
1148 | + | let claimedAsset = $t03781338007._2 | |
1150 | 1149 | let exchangedAmount = exchangeKeeper(tokenToId, amountToExchange, claimedAsset, amountsIn, addresses, assetsToReceive, estReceived, slippageTolerance, minReceived, options) | |
1151 | 1150 | let change = (claimedAmount - amountToExchange) | |
1152 | 1151 | let changeEntry = if ((change > 0)) | |
1159 | 1158 | ||
1160 | 1159 | @Callable(i) | |
1161 | 1160 | func capitalizeExPuzzle (pool,type,tokenToId,amountToExchange,claim,routesStr,minToReceive,options) = { | |
1162 | - | let $ | |
1161 | + | let $t03866438858 = if (claim) | |
1163 | 1162 | then claimFarmed(type, pool) | |
1164 | 1163 | else { | |
1165 | 1164 | let claimedAsset = if ((type == SF_POOL)) | |
1167 | 1166 | else WXID | |
1168 | 1167 | $Tuple2(amountToExchange, claimedAsset) | |
1169 | 1168 | } | |
1170 | - | let claimedAmount = $ | |
1171 | - | let claimedAsset = $ | |
1169 | + | let claimedAmount = $t03866438858._1 | |
1170 | + | let claimedAsset = $t03866438858._2 | |
1172 | 1171 | let exchangedAmount = exchangePuzzle(tokenToId, amountToExchange, claimedAsset, routesStr, minToReceive, options) | |
1173 | 1172 | let change = (claimedAmount - amountToExchange) | |
1174 | 1173 | let changeEntry = if ((change > 0)) | |
1181 | 1180 | ||
1182 | 1181 | @Callable(i) | |
1183 | 1182 | func capitalizeExSwopFi (pool,type,tokenToId,amountToExchange,claim,exchangers,exchangersType,args1,args2,routingAssetsKeys,minAmountToReceive,options) = { | |
1184 | - | let $ | |
1183 | + | let $t03958139775 = if (claim) | |
1185 | 1184 | then claimFarmed(type, pool) | |
1186 | 1185 | else { | |
1187 | 1186 | let claimedAsset = if ((type == SF_POOL)) | |
1189 | 1188 | else WXID | |
1190 | 1189 | $Tuple2(amountToExchange, claimedAsset) | |
1191 | 1190 | } | |
1192 | - | let claimedAmount = $ | |
1193 | - | let claimedAsset = $ | |
1191 | + | let claimedAmount = $t03958139775._1 | |
1192 | + | let claimedAsset = $t03958139775._2 | |
1194 | 1193 | let exchangedAmount = exchangeSwopFi(tokenToId, amountToExchange, claimedAsset, exchangers, exchangersType, args1, args2, routingAssetsKeys, minAmountToReceive, options) | |
1195 | 1194 | let change = (claimedAmount - amountToExchange) | |
1196 | 1195 | let changeEntry = if ((change > 0)) | |
1207 | 1206 | else false) | |
1208 | 1207 | then throw("Wrong type") | |
1209 | 1208 | else { | |
1210 | - | let $ | |
1211 | - | let aId = $ | |
1212 | - | let bId = $ | |
1213 | - | let aBal = $ | |
1214 | - | let bBal = $ | |
1215 | - | let shareId = $ | |
1209 | + | let $t04046840562 = getPoolData(Address(fromBase58String(poolAddr)), type) | |
1210 | + | let aId = $t04046840562._1 | |
1211 | + | let bId = $t04046840562._2 | |
1212 | + | let aBal = $t04046840562._3 | |
1213 | + | let bBal = $t04046840562._4 | |
1214 | + | let shareId = $t04046840562._5 | |
1216 | 1215 | [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)] | |
1217 | 1216 | } | |
1218 | 1217 | ||
1221 | 1220 | @Callable(i) | |
1222 | 1221 | func capitalizeTest (pool,pType,tokenId,tokenAmount) = { | |
1223 | 1222 | let poolAddr = Address(fromBase58String(pool)) | |
1224 | - | let $ | |
1225 | - | let AId = $ | |
1226 | - | let BId = $ | |
1227 | - | let balA = $ | |
1228 | - | let balB = $ | |
1229 | - | let shareId = $ | |
1230 | - | let $ | |
1223 | + | let $t04135841437 = getPoolData(poolAddr, pType) | |
1224 | + | let AId = $t04135841437._1 | |
1225 | + | let BId = $t04135841437._2 | |
1226 | + | let balA = $t04135841437._3 | |
1227 | + | let balB = $t04135841437._4 | |
1228 | + | let shareId = $t04135841437._5 | |
1229 | + | let $t04144041520 = if ((tokenId == AId)) | |
1231 | 1230 | then $Tuple2(tokenAmount, 0) | |
1232 | 1231 | else $Tuple2(0, tokenAmount) | |
1233 | - | let pmtA = $ | |
1234 | - | let pmtB = $ | |
1235 | - | let $ | |
1236 | - | let stakedAmount = $ | |
1237 | - | let nf = $ | |
1232 | + | let pmtA = $t04144041520._1 | |
1233 | + | let pmtB = $t04144041520._2 | |
1234 | + | let $t04152341627 = replenishByType(pType, pool, NO_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId) | |
1235 | + | let stakedAmount = $t04152341627._1 | |
1236 | + | let nf = $t04152341627._2 | |
1238 | 1237 | let curPoolInterestLoan = valueOrElse(getInteger(this, (pool + kPoolInterestLoan)), 0) | |
1239 | 1238 | let curPoolInterestNoLoan = valueOrElse(getInteger(this, (pool + kPoolInterestNoLoan)), 0) | |
1240 | 1239 | let totalShareAmount = getPoolTotalShare(pool) |
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 $t084298494 = getPoolData(poolAddr, pType) | |
288 | 288 | let aId = $t084298494._1 | |
289 | 289 | let bId = $t084298494._2 | |
290 | 290 | let aBalance = $t084298494._3 | |
291 | 291 | let bBalance = $t084298494._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 calcReplenishByTwoTokens (pType,poolAddr,pmtA,aId,pmtB,bId,balA,balB) = { | |
332 | 332 | let $t096669971 = if ((pType == SF_POOL)) | |
333 | 333 | then $Tuple2(nil, nil) | |
334 | 334 | else $Tuple2(split({ | |
335 | 335 | let @ = invoke(poolAddr, "evaluatePutByAmountAssetREADONLY", [pmtA], nil) | |
336 | 336 | if ($isInstanceOf(@, "String")) | |
337 | 337 | then @ | |
338 | 338 | else throw(($getType(@) + " couldn't be cast to String")) | |
339 | 339 | }, "__"), split({ | |
340 | 340 | let @ = invoke(poolAddr, "evaluatePutByPriceAssetREADONLY", [pmtB], nil) | |
341 | 341 | if ($isInstanceOf(@, "String")) | |
342 | 342 | then @ | |
343 | 343 | else throw(($getType(@) + " couldn't be cast to String")) | |
344 | 344 | }, "__")) | |
345 | 345 | if (($t096669971 == $t096669971)) | |
346 | 346 | then { | |
347 | 347 | let evalPutInB = $t096669971._2 | |
348 | 348 | let evalPutInA = $t096669971._1 | |
349 | 349 | let $t0998110177 = if ((pType == SF_POOL)) | |
350 | 350 | then $Tuple2(fraction(SCALE8, pmtA, balA), fraction(SCALE8, pmtB, balB)) | |
351 | 351 | else $Tuple2(parseIntValue(evalPutInA[1]), parseIntValue(evalPutInB[1])) | |
352 | 352 | let ratioA = $t0998110177._1 | |
353 | 353 | let ratioB = $t0998110177._2 | |
354 | 354 | let $t01018310666 = if ((ratioB > ratioA)) | |
355 | 355 | then { | |
356 | 356 | let pmt = if ((pType == SF_POOL)) | |
357 | 357 | then fraction(balB, ratioA, SCALE8, CEILING) | |
358 | 358 | else parseIntValue(evalPutInA[8]) | |
359 | 359 | $Tuple5(pmtA, pmt, (pmtB - pmt), bId, ratioB) | |
360 | 360 | } | |
361 | 361 | else { | |
362 | 362 | let pmt = if ((pType == SF_POOL)) | |
363 | 363 | then fraction(balA, ratioB, SCALE8, CEILING) | |
364 | 364 | else parseIntValue(evalPutInB[8]) | |
365 | 365 | $Tuple5(pmtA, pmtB, (pmtA - pmt), aId, ratioA) | |
366 | 366 | } | |
367 | 367 | let pmtInA = $t01018310666._1 | |
368 | 368 | let pmtInB = $t01018310666._2 | |
369 | 369 | let change = $t01018310666._3 | |
370 | 370 | let changeAssetId = $t01018310666._4 | |
371 | 371 | let lp = $t01018310666._5 | |
372 | 372 | $Tuple5(pmtInA, pmtInB, change, changeAssetId, lp) | |
373 | 373 | } | |
374 | 374 | else throw("Strict value is not equal to itself.") | |
375 | 375 | } | |
376 | 376 | ||
377 | 377 | ||
378 | 378 | func replenishTwoTokensByType (poolAddr,pType,pmtA,aId,pmtB,bId) = { | |
379 | 379 | let payments = [AttachedPayment(assetIdFromStr(aId), pmtA), AttachedPayment(assetIdFromStr(bId), pmtB)] | |
380 | 380 | if ((pType == SF_POOL)) | |
381 | 381 | then invoke(poolAddr, "callFunction", ["replenishWithTwoTokens", ["false", "0"]], payments) | |
382 | 382 | else invoke(poolAddr, "put", [1000000, false], payments) | |
383 | 383 | } | |
384 | 384 | ||
385 | 385 | ||
386 | 386 | func replenishOneTokenByType (poolAddr,pType,pmt,pmtId) = { | |
387 | 387 | let payments = [AttachedPayment(assetIdFromStr(pmtId), pmt)] | |
388 | 388 | if ((pType == SF_POOL)) | |
389 | 389 | then invoke(poolAddr, "callFunction", ["replenishWithOneToken", ["0", "false", "0"]], payments) | |
390 | 390 | else invoke(poolAddr, "putOneTkn", [0, false], payments) | |
391 | 391 | } | |
392 | 392 | ||
393 | 393 | ||
394 | 394 | func stakeLP (pool,pType,shareId,amount) = { | |
395 | 395 | let payments = [AttachedPayment(fromBase58String(shareId), amount)] | |
396 | 396 | if ((pType == SF_POOL)) | |
397 | 397 | then invoke(getSFFarmingAddr(), "lockShareTokens", [pool, 0], payments) | |
398 | 398 | else invoke(getWXFarmingAddr(addressFromStringValue(pool)), "stake", nil, payments) | |
399 | 399 | } | |
400 | 400 | ||
401 | 401 | ||
402 | 402 | func unstakeLP (pool,pType,shareId,amount) = { | |
403 | 403 | let $t01189612253 = if ((pType == SF_POOL)) | |
404 | 404 | then $Tuple3(getSFFarmingAddr(), "withdrawShareTokens", [pool, amount]) | |
405 | 405 | else if ((pType == WX_POOL)) | |
406 | 406 | then $Tuple3(getWXFarmingAddr(Address(fromBase58String(pool))), "unstake", [shareId, amount]) | |
407 | 407 | else throw("Wrong pool type") | |
408 | 408 | let farmAddr = $t01189612253._1 | |
409 | 409 | let fName = $t01189612253._2 | |
410 | 410 | let params = $t01189612253._3 | |
411 | 411 | let inv = invoke(farmAddr, fName, params, nil) | |
412 | 412 | if ((inv == inv)) | |
413 | 413 | then amount | |
414 | 414 | else throw("Strict value is not equal to itself.") | |
415 | 415 | } | |
416 | 416 | ||
417 | 417 | ||
418 | 418 | func calcAmountToPaySF (pool,assetIdA,assetIdB,balA,balB,amountTokenToGet,assetTokenToGet) = { | |
419 | 419 | let poolAddr = Address(fromBase58String(pool)) | |
420 | 420 | let feeScale6 = 1000000 | |
421 | 421 | let fee = getIntegerValue(poolAddr, kSFPoolFee) | |
422 | 422 | let amntGetNoFee = fraction(amountTokenToGet, feeScale6, (feeScale6 - fee)) | |
423 | 423 | let $t01266612954 = if ((assetTokenToGet == assetIdA)) | |
424 | 424 | then { | |
425 | 425 | let amountToPay = fraction(balA, amntGetNoFee, (balB - amntGetNoFee)) | |
426 | 426 | $Tuple2(amountToPay, assetIdB) | |
427 | 427 | } | |
428 | 428 | else { | |
429 | 429 | let amountToPay = fraction(balB, amntGetNoFee, (balA - amntGetNoFee)) | |
430 | 430 | $Tuple2(amountToPay, assetIdA) | |
431 | 431 | } | |
432 | 432 | let amountToPay = $t01266612954._1 | |
433 | 433 | let assetToPay = $t01266612954._2 | |
434 | 434 | $Tuple2(assetToPay, amountToPay) | |
435 | 435 | } | |
436 | 436 | ||
437 | 437 | ||
438 | 438 | func calcAmountToPayWX (pool,assetIdA,assetIdB,balA,balB,amountTokenToGet,assetTokenToGet) = { | |
439 | 439 | let prFee = getIntegerValue(wxSwapContract, "%s__protocolFee") | |
440 | 440 | let pFee = getIntegerValue(wxSwapContract, "%s__poolFee") | |
441 | 441 | let feeScale = toBigInt(100000000) | |
442 | 442 | let $t01329313601 = if ((assetTokenToGet == assetIdA)) | |
443 | 443 | then { | |
444 | 444 | let amountToPay = fraction(balA, amountTokenToGet, (balB - amountTokenToGet)) | |
445 | 445 | $Tuple2(amountToPay, assetIdB) | |
446 | 446 | } | |
447 | 447 | else { | |
448 | 448 | let amountToPay = fraction(balB, amountTokenToGet, (balA - amountTokenToGet)) | |
449 | 449 | $Tuple2(amountToPay, assetIdA) | |
450 | 450 | } | |
451 | 451 | let amountToPay = $t01329313601._1 | |
452 | 452 | let assetToPay = $t01329313601._2 | |
453 | 453 | let amountToPayWithFee = toInt(fraction(toBigInt(amountToPay), feeScale, (feeScale - toBigInt((prFee + pFee))))) | |
454 | 454 | $Tuple2(assetToPay, amountToPayWithFee) | |
455 | 455 | } | |
456 | 456 | ||
457 | 457 | ||
458 | 458 | func exchangeDirectly (type,pool,assetIdA,assetIdB,balA,balB,amountTokenToGet,assetTokenToGet) = if ((type == SF_POOL)) | |
459 | 459 | then { | |
460 | 460 | let $t01393914061 = calcAmountToPaySF(pool, assetIdA, assetIdB, balA, balB, amountTokenToGet, assetTokenToGet) | |
461 | 461 | let assetToPay = $t01393914061._1 | |
462 | 462 | let amountToPay = $t01393914061._2 | |
463 | 463 | invoke(addressFromStringValue(pool), "callFunction", ["exchange", ["1"]], [AttachedPayment(assetIdFromStr(assetToPay), amountToPay)]) | |
464 | 464 | } | |
465 | 465 | else { | |
466 | 466 | let $t01421214334 = calcAmountToPayWX(pool, assetIdA, assetIdB, balA, balB, amountTokenToGet, assetTokenToGet) | |
467 | 467 | let assetToPay = $t01421214334._1 | |
468 | 468 | let amountToPay = $t01421214334._2 | |
469 | 469 | invoke(wxSwapContract, "swap", [1, assetTokenToGet, toString(this)], [AttachedPayment(assetIdFromStr(assetToPay), amountToPay)]) | |
470 | 470 | } | |
471 | 471 | ||
472 | 472 | ||
473 | 473 | func calcReplanishLPVirt (pType,pool,pmtA,aId,pmtB,bId,balA,balB) = { | |
474 | 474 | let poolAddr = addressFromStringValue(pool) | |
475 | 475 | if ((pType == SF_POOL)) | |
476 | 476 | then { | |
477 | - | let args = [toString(pmtA), toString(pmtB), "0"] | |
478 | 477 | let inv = { | |
479 | - | let @ = invoke(poolAddr, "callFunction", ["calcLPReplanishDiffPropREADONLY", | |
478 | + | let @ = invoke(poolAddr, "callFunction", ["calcLPReplanishDiffPropREADONLY", [toString(pmtA), toString(pmtB), "0"]], nil) | |
480 | 479 | if ($isInstanceOf(@, "(Int, Int, Int, Int, Int, ByteVector|Unit)")) | |
481 | 480 | then @ | |
482 | 481 | else throw(($getType(@) + " couldn't be cast to (Int, Int, Int, Int, Int, ByteVector|Unit)")) | |
483 | 482 | } | |
484 | 483 | if ((inv == inv)) | |
485 | 484 | then inv._1 | |
486 | 485 | else throw("Strict value is not equal to itself.") | |
487 | 486 | } | |
488 | 487 | else if ((pType == WX_POOL)) | |
489 | 488 | then { | |
490 | - | let $ | |
489 | + | let $t01491915260 = if (if ((pmtA > 0)) | |
491 | 490 | then (pmtB > 0) | |
492 | 491 | else false) | |
493 | 492 | then { | |
494 | - | let $ | |
495 | - | let pmtInA = $ | |
496 | - | let pmtInB = $ | |
497 | - | let change = $ | |
498 | - | let changeId = $ | |
499 | - | let lpAmount = $ | |
493 | + | let $t01500015126 = calcReplenishByTwoTokens(pType, poolAddr, pmtA, aId, pmtB, bId, balA, balB) | |
494 | + | let pmtInA = $t01500015126._1 | |
495 | + | let pmtInB = $t01500015126._2 | |
496 | + | let change = $t01500015126._3 | |
497 | + | let changeId = $t01500015126._4 | |
498 | + | let lpAmount = $t01500015126._5 | |
500 | 499 | $Tuple3(change, changeId, lpAmount) | |
501 | 500 | } | |
502 | 501 | else if ((pmtA > 0)) | |
503 | 502 | then $Tuple3(pmtA, aId, 0) | |
504 | 503 | else $Tuple3(pmtB, bId, 0) | |
505 | - | let change = $ | |
506 | - | let changeId = $ | |
507 | - | let lpTwo = $ | |
504 | + | let change = $t01491915260._1 | |
505 | + | let changeId = $t01491915260._2 | |
506 | + | let lpTwo = $t01491915260._3 | |
508 | 507 | let lpOne = if ((change > 0)) | |
509 | 508 | then { | |
510 | 509 | let inv = { | |
511 | 510 | let @ = invoke(poolAddr, "putOneTknREADONLY", [changeId, change], nil) | |
512 | 511 | if ($isInstanceOf(@, "(Int, Int, Int)")) | |
513 | 512 | then @ | |
514 | 513 | else throw(($getType(@) + " couldn't be cast to (Int, Int, Int)")) | |
515 | 514 | } | |
516 | 515 | if ((inv == inv)) | |
517 | 516 | then inv._1 | |
518 | 517 | else throw("Strict value is not equal to itself.") | |
519 | 518 | } | |
520 | 519 | else 0 | |
521 | 520 | (lpTwo + lpOne) | |
522 | 521 | } | |
523 | 522 | else throw("Wrong pool type") | |
524 | 523 | } | |
525 | 524 | ||
526 | 525 | ||
527 | 526 | func calcWithdrawLPVirt (pType,pool,lpAmount,shareId,aId,bId,balA,balB,borrowAmount,borrowAssetId) = { | |
528 | 527 | let poolAddr = addressFromStringValue(pool) | |
529 | - | let $ | |
528 | + | let $t01574616187 = if ((pType == SF_POOL)) | |
530 | 529 | then { | |
531 | 530 | let inv = { | |
532 | 531 | let @ = invoke(poolAddr, "callFunction", ["withdrawREADONLY", [toString(lpAmount)]], nil) | |
533 | 532 | if ($isInstanceOf(@, "(Int, Int)")) | |
534 | 533 | then @ | |
535 | 534 | else throw(($getType(@) + " couldn't be cast to (Int, Int)")) | |
536 | 535 | } | |
537 | 536 | if ((inv == inv)) | |
538 | 537 | then $Tuple2(inv._1, inv._2) | |
539 | 538 | else throw("Strict value is not equal to itself.") | |
540 | 539 | } | |
541 | 540 | else if ((pType == WX_POOL)) | |
542 | 541 | then { | |
543 | 542 | let get = split({ | |
544 | 543 | let @ = invoke(poolAddr, "evaluateGetREADONLY", [shareId, lpAmount], nil) | |
545 | 544 | if ($isInstanceOf(@, "String")) | |
546 | 545 | then @ | |
547 | 546 | else throw(($getType(@) + " couldn't be cast to String")) | |
548 | 547 | }, "__") | |
549 | 548 | if ((get == get)) | |
550 | 549 | then $Tuple2(parseIntValue(get[1]), parseIntValue(get[2])) | |
551 | 550 | else throw("Strict value is not equal to itself.") | |
552 | 551 | } | |
553 | 552 | else throw("Wrong pool type") | |
554 | - | let getAmountA = $ | |
555 | - | let getAmountB = $ | |
553 | + | let getAmountA = $t01574616187._1 | |
554 | + | let getAmountB = $t01574616187._2 | |
556 | 555 | if ((borrowAmount > 0)) | |
557 | 556 | then { | |
558 | 557 | let amountToGetEx = if (if ((borrowAssetId == aId)) | |
559 | 558 | then (borrowAmount > getAmountA) | |
560 | 559 | else false) | |
561 | 560 | then (borrowAmount - getAmountA) | |
562 | 561 | else if (if ((borrowAssetId == bId)) | |
563 | 562 | then (borrowAmount > getAmountB) | |
564 | 563 | else false) | |
565 | 564 | then (borrowAmount - getAmountB) | |
566 | 565 | else 0 | |
567 | - | let $ | |
566 | + | let $t01649016805 = if ((amountToGetEx > 0)) | |
568 | 567 | then if ((pType == SF_POOL)) | |
569 | 568 | then calcAmountToPaySF(pool, aId, bId, balA, balB, amountToGetEx, borrowAssetId) | |
570 | 569 | else calcAmountToPayWX(pool, aId, bId, balA, balB, amountToGetEx, borrowAssetId) | |
571 | 570 | else $Tuple2("", 0) | |
572 | - | let assetToPay = $ | |
573 | - | let amountToPay = $ | |
571 | + | let assetToPay = $t01649016805._1 | |
572 | + | let amountToPay = $t01649016805._2 | |
574 | 573 | if ((borrowAssetId == aId)) | |
575 | 574 | then $Tuple2(((getAmountA + amountToGetEx) - borrowAmount), (getAmountB - amountToPay)) | |
576 | 575 | else $Tuple2((getAmountA - amountToPay), ((getAmountB + amountToGetEx) - borrowAmount)) | |
577 | 576 | } | |
578 | 577 | else $Tuple2(getAmountA, getAmountB) | |
579 | 578 | } | |
580 | 579 | ||
581 | 580 | ||
582 | 581 | func claimFarmed (type,pool) = if ((type == SF_POOL)) | |
583 | 582 | then { | |
584 | 583 | let balBefore = accountBalance(SWOPID) | |
585 | 584 | if ((balBefore == balBefore)) | |
586 | 585 | then { | |
587 | 586 | let inv = invoke(getSFFarmingAddr(), "claim", [pool], nil) | |
588 | 587 | if ((inv == inv)) | |
589 | 588 | then { | |
590 | 589 | let balAfter = accountBalance(SWOPID) | |
591 | 590 | $Tuple2((balAfter - balBefore), SWOPID) | |
592 | 591 | } | |
593 | 592 | else throw("Strict value is not equal to itself.") | |
594 | 593 | } | |
595 | 594 | else throw("Strict value is not equal to itself.") | |
596 | 595 | } | |
597 | 596 | else if ((type == WX_POOL)) | |
598 | 597 | then { | |
599 | 598 | let balBefore = accountBalance(WXID) | |
600 | 599 | if ((balBefore == balBefore)) | |
601 | 600 | then { | |
602 | 601 | let inv = invoke(getWXFarmingAddr(Address(fromBase58String(pool))), "claimWX", [pool], nil) | |
603 | 602 | if ((inv == inv)) | |
604 | 603 | then { | |
605 | 604 | let balAfter = accountBalance(WXID) | |
606 | 605 | $Tuple2((balAfter - balBefore), WXID) | |
607 | 606 | } | |
608 | 607 | else throw("Strict value is not equal to itself.") | |
609 | 608 | } | |
610 | 609 | else throw("Strict value is not equal to itself.") | |
611 | 610 | } | |
612 | 611 | else throw("Wrong pool type") | |
613 | 612 | ||
614 | 613 | ||
615 | 614 | func replenishByType (pType,pool,feeType,pmtA,aId,pmtB,bId,balA,balB,LPId) = { | |
616 | 615 | let lpBalanceBefore = accountBalance(fromBase58String(LPId)) | |
617 | 616 | if ((lpBalanceBefore == lpBalanceBefore)) | |
618 | 617 | then { | |
619 | 618 | let poolAddr = addressFromStringValue(pool) | |
620 | - | let $ | |
619 | + | let $t01801518431 = if (if ((pmtA > 0)) | |
621 | 620 | then (pmtB > 0) | |
622 | 621 | else false) | |
623 | 622 | then { | |
624 | - | let $ | |
625 | - | let pmtInA = $ | |
626 | - | let pmtInB = $ | |
627 | - | let change = $ | |
628 | - | let changeId = $ | |
623 | + | let $t01808118197 = calcReplenishByTwoTokens(pType, poolAddr, pmtA, aId, pmtB, bId, balA, balB) | |
624 | + | let pmtInA = $t01808118197._1 | |
625 | + | let pmtInB = $t01808118197._2 | |
626 | + | let change = $t01808118197._3 | |
627 | + | let changeId = $t01808118197._4 | |
629 | 628 | let inv = replenishTwoTokensByType(poolAddr, pType, pmtInA, aId, pmtInB, bId) | |
630 | 629 | if ((inv == inv)) | |
631 | 630 | then $Tuple2(change, changeId) | |
632 | 631 | else throw("Strict value is not equal to itself.") | |
633 | 632 | } | |
634 | 633 | else if ((pmtA > 0)) | |
635 | 634 | then $Tuple2(pmtA, aId) | |
636 | 635 | else if ((pmtB > 0)) | |
637 | 636 | then $Tuple2(pmtB, bId) | |
638 | 637 | else throw("pmts must be > 0") | |
639 | - | let change = $ | |
640 | - | let changeId = $ | |
638 | + | let change = $t01801518431._1 | |
639 | + | let changeId = $t01801518431._2 | |
641 | 640 | let inv = if ((change > 0)) | |
642 | 641 | then replenishOneTokenByType(poolAddr, pType, change, changeId) | |
643 | 642 | else nil | |
644 | 643 | if ((inv == inv)) | |
645 | 644 | then { | |
646 | 645 | let lpBalanceAfter = accountBalance(fromBase58String(LPId)) | |
647 | 646 | let totalStaked = (lpBalanceAfter - lpBalanceBefore) | |
648 | 647 | let axlyFeeAmount = fraction(totalStaked, getAxlyFee(pool, feeType), FEE_SCALE6) | |
649 | 648 | let userShareForStake = (totalStaked - axlyFeeAmount) | |
650 | 649 | if ((0 >= userShareForStake)) | |
651 | 650 | then throw("amount of staked sharetokens must be > 0") | |
652 | 651 | else { | |
653 | 652 | let invLP = stakeLP(pool, pType, LPId, userShareForStake) | |
654 | 653 | if ((invLP == invLP)) | |
655 | 654 | then $Tuple2(userShareForStake, axlyFeeAmount) | |
656 | 655 | else throw("Strict value is not equal to itself.") | |
657 | 656 | } | |
658 | 657 | } | |
659 | 658 | else throw("Strict value is not equal to itself.") | |
660 | 659 | } | |
661 | 660 | else throw("Strict value is not equal to itself.") | |
662 | 661 | } | |
663 | 662 | ||
664 | 663 | ||
665 | 664 | func replenishEntries (pool,user,stakedAmount,axlyFeeAmount,posNum,shareId,type,withLoan) = { | |
666 | 665 | let totalAmount = getPoolTotalShare(pool) | |
667 | 666 | let totalAmountLoan = getPoolTotalShareWithLoan(pool) | |
668 | - | let $ | |
667 | + | let $t01928919527 = if (withLoan) | |
669 | 668 | then $Tuple2(getIntegerValue(this, (pool + kPoolInterestLoan)), (totalAmountLoan + stakedAmount)) | |
670 | 669 | else $Tuple2(getIntegerValue(this, (pool + kPoolInterestNoLoan)), totalAmountLoan) | |
671 | - | let curPoolInterest = $ | |
672 | - | let totalStakedWithLoan = $ | |
670 | + | let curPoolInterest = $t01928919527._1 | |
671 | + | let totalStakedWithLoan = $t01928919527._2 | |
673 | 672 | [IntegerEntry((pool + kPoolTotal), (totalAmount + stakedAmount)), IntegerEntry((pool + kPoolTotalLoan), totalStakedWithLoan), IntegerEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserPosition), stakedAmount), IntegerEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserPositionInterest), curPoolInterest), StringEntry((((user + "_") + toString(posNum)) + kUserPositionPool), pool), IntegerEntry((user + kUserPositionNum), posNum), ScriptTransfer(moneyBox, axlyFeeAmount, fromBase58String(shareId))] | |
674 | 673 | } | |
675 | 674 | ||
676 | 675 | ||
677 | 676 | func exchangeKeeper (toToken,pmtAmount,pmtAsset,amountsIn,addresses,assetsToReceive,estReceived,slippageTolerance,minReceived,options) = { | |
678 | 677 | let tokenBalanceBefore = accountBalance(assetIdFromStr(toToken)) | |
679 | 678 | if ((tokenBalanceBefore == tokenBalanceBefore)) | |
680 | 679 | then { | |
681 | 680 | let inv = invoke(exContract, "swap", [amountsIn, addresses, assetsToReceive, estReceived, slippageTolerance, minReceived, options], [AttachedPayment(pmtAsset, pmtAmount)]) | |
682 | 681 | if ((inv == inv)) | |
683 | 682 | then (accountBalance(assetIdFromStr(toToken)) - tokenBalanceBefore) | |
684 | 683 | else throw("Strict value is not equal to itself.") | |
685 | 684 | } | |
686 | 685 | else throw("Strict value is not equal to itself.") | |
687 | 686 | } | |
688 | 687 | ||
689 | 688 | ||
690 | 689 | func exchangePuzzle (toToken,pmtAmount,pmtAsset,routesStr,minToReceive,options) = { | |
691 | 690 | let tokenBalanceBefore = accountBalance(assetIdFromStr(toToken)) | |
692 | 691 | if ((tokenBalanceBefore == tokenBalanceBefore)) | |
693 | 692 | then { | |
694 | 693 | let inv = invoke(exContract, "puzzleSwap", [routesStr, minToReceive, options], [AttachedPayment(pmtAsset, pmtAmount)]) | |
695 | 694 | if ((inv == inv)) | |
696 | 695 | then (accountBalance(assetIdFromStr(toToken)) - tokenBalanceBefore) | |
697 | 696 | else throw("Strict value is not equal to itself.") | |
698 | 697 | } | |
699 | 698 | else throw("Strict value is not equal to itself.") | |
700 | 699 | } | |
701 | 700 | ||
702 | 701 | ||
703 | 702 | func exchangeSwopFi (toToken,pmtAmount,pmtAsset,exchangers,exchangersType,args1,args2,routingAssetsKeys,minAmountToReceive,options) = { | |
704 | 703 | let tokenBalanceBefore = accountBalance(assetIdFromStr(toToken)) | |
705 | 704 | if ((tokenBalanceBefore == tokenBalanceBefore)) | |
706 | 705 | then { | |
707 | 706 | let inv = invoke(exContract, "swopfiSwap", [exchangers, exchangersType, args1, args2, routingAssetsKeys, minAmountToReceive, options], [AttachedPayment(pmtAsset, pmtAmount)]) | |
708 | 707 | if ((inv == inv)) | |
709 | 708 | then (accountBalance(assetIdFromStr(toToken)) - tokenBalanceBefore) | |
710 | 709 | else throw("Strict value is not equal to itself.") | |
711 | 710 | } | |
712 | 711 | else throw("Strict value is not equal to itself.") | |
713 | 712 | } | |
714 | 713 | ||
715 | 714 | ||
716 | 715 | func capitalize (pool,pType,tokenId,tokenAmount) = { | |
717 | 716 | let poolAddr = Address(fromBase58String(pool)) | |
718 | - | let $ | |
719 | - | let AId = $ | |
720 | - | let BId = $ | |
721 | - | let balA = $ | |
722 | - | let balB = $ | |
723 | - | let shareId = $ | |
724 | - | let $ | |
717 | + | let $t02187821957 = getPoolData(poolAddr, pType) | |
718 | + | let AId = $t02187821957._1 | |
719 | + | let BId = $t02187821957._2 | |
720 | + | let balA = $t02187821957._3 | |
721 | + | let balB = $t02187821957._4 | |
722 | + | let shareId = $t02187821957._5 | |
723 | + | let $t02196022040 = if ((tokenId == AId)) | |
725 | 724 | then $Tuple2(tokenAmount, 0) | |
726 | 725 | else $Tuple2(0, tokenAmount) | |
727 | - | let pmtA = $ | |
728 | - | let pmtB = $ | |
729 | - | let $ | |
730 | - | let stakedAmount = $ | |
731 | - | let nf = $ | |
726 | + | let pmtA = $t02196022040._1 | |
727 | + | let pmtB = $t02196022040._2 | |
728 | + | let $t02204322147 = replenishByType(pType, pool, NO_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId) | |
729 | + | let stakedAmount = $t02204322147._1 | |
730 | + | let nf = $t02204322147._2 | |
732 | 731 | let curPoolInterestLoan = valueOrElse(getInteger(this, (pool + kPoolInterestLoan)), 0) | |
733 | 732 | let curPoolInterestNoLoan = valueOrElse(getInteger(this, (pool + kPoolInterestNoLoan)), 0) | |
734 | 733 | let totalShareAmount = getPoolTotalShare(pool) | |
735 | 734 | let totalShareAmountWithLoan = getPoolTotalShareWithLoan(pool) | |
736 | 735 | let loanPercent = fraction(totalShareAmountWithLoan, SCALE8, totalShareAmount) | |
737 | 736 | let stakedLoan = fraction(stakedAmount, loanPercent, SCALE8) | |
738 | 737 | let stakedNoLoan = (stakedAmount - stakedLoan) | |
739 | 738 | let newInterestLoan = if ((totalShareAmountWithLoan > 0)) | |
740 | 739 | then (curPoolInterestLoan + fraction(stakedLoan, SCALE10, totalShareAmountWithLoan)) | |
741 | 740 | else 0 | |
742 | 741 | let newInterestNoLoan = if (((totalShareAmount - totalShareAmountWithLoan) > 0)) | |
743 | 742 | then (curPoolInterestNoLoan + fraction(stakedNoLoan, SCALE10, (totalShareAmount - totalShareAmountWithLoan))) | |
744 | 743 | else 0 | |
745 | 744 | let axlyFeeLoan = fraction(stakedLoan, getAxlyFee(pool, CAP_FEE_LOAN), FEE_SCALE6) | |
746 | 745 | let axlyFeeNoLoan = fraction(stakedNoLoan, getAxlyFee(pool, CAP_FEE_NO_LOAN), FEE_SCALE6) | |
747 | 746 | let axlyFee = unstakeLP(pool, pType, shareId, (axlyFeeLoan + axlyFeeNoLoan)) | |
748 | 747 | if ((axlyFee == axlyFee)) | |
749 | 748 | 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)) | |
750 | 749 | else throw("Strict value is not equal to itself.") | |
751 | 750 | } | |
752 | 751 | ||
753 | 752 | ||
754 | 753 | func withdrawAmountCalc (pool,userCanWithdraw,debt,borrowAsset) = { | |
755 | 754 | let poolAddr = Address(fromBase58String(pool)) | |
756 | 755 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Unknown pool") | |
757 | - | let $ | |
758 | - | let assetIdA = $ | |
759 | - | let assetIdB = $ | |
760 | - | let balA = $ | |
761 | - | let balB = $ | |
762 | - | let shareId = $ | |
756 | + | let $t02391523991 = getPoolData(poolAddr, pType) | |
757 | + | let assetIdA = $t02391523991._1 | |
758 | + | let assetIdB = $t02391523991._2 | |
759 | + | let balA = $t02391523991._3 | |
760 | + | let balB = $t02391523991._4 | |
761 | + | let shareId = $t02391523991._5 | |
763 | 762 | let cBalABefore = accountBalance(assetIdFromStr(assetIdA)) | |
764 | 763 | if ((cBalABefore == cBalABefore)) | |
765 | 764 | then { | |
766 | 765 | let cBalBBefore = accountBalance(assetIdFromStr(assetIdB)) | |
767 | 766 | if ((cBalBBefore == cBalBBefore)) | |
768 | 767 | then { | |
769 | 768 | let inv = if ((pType == SF_POOL)) | |
770 | 769 | then invoke(poolAddr, "callFunction", ["withdraw", [toString(userCanWithdraw)]], nil) | |
771 | 770 | else { | |
772 | 771 | let inv = unstakeLP(pool, pType, shareId, userCanWithdraw) | |
773 | 772 | if ((inv == inv)) | |
774 | 773 | then invoke(poolAddr, "get", nil, [AttachedPayment(assetIdFromStr(shareId), userCanWithdraw)]) | |
775 | 774 | else throw("Strict value is not equal to itself.") | |
776 | 775 | } | |
777 | 776 | if ((inv == inv)) | |
778 | 777 | then { | |
779 | 778 | let cBalAAfter = accountBalance(assetIdFromStr(assetIdA)) | |
780 | 779 | let cBalBAfter = accountBalance(assetIdFromStr(assetIdB)) | |
781 | - | let $ | |
782 | - | let tokensAmountA = $ | |
783 | - | let tokensAmountB = $ | |
784 | - | let $ | |
780 | + | let $t02455424643 = $Tuple2((cBalAAfter - cBalABefore), (cBalBAfter - cBalBBefore)) | |
781 | + | let tokensAmountA = $t02455424643._1 | |
782 | + | let tokensAmountB = $t02455424643._2 | |
783 | + | let $t02464625342 = if ((debt > 0)) | |
785 | 784 | then { | |
786 | 785 | let amountToGetEx = if (if ((borrowAsset == assetIdA)) | |
787 | 786 | then (debt > tokensAmountA) | |
788 | 787 | else false) | |
789 | 788 | then (debt - tokensAmountA) | |
790 | 789 | else if (if ((borrowAsset == assetIdB)) | |
791 | 790 | then (debt > tokensAmountB) | |
792 | 791 | else false) | |
793 | 792 | then (debt - tokensAmountB) | |
794 | 793 | else 0 | |
795 | 794 | let exInv = if ((amountToGetEx > 0)) | |
796 | 795 | then exchangeDirectly(pType, pool, assetIdA, assetIdB, balA, balB, amountToGetEx, borrowAsset) | |
797 | 796 | else 0 | |
798 | 797 | if ((exInv == exInv)) | |
799 | 798 | then { | |
800 | 799 | let cBalAAfterRepay = accountBalance(assetIdFromStr(assetIdA)) | |
801 | 800 | let cBalBAfterRepay = accountBalance(assetIdFromStr(assetIdB)) | |
802 | 801 | $Tuple2((cBalAAfterRepay - cBalABefore), (cBalBAfterRepay - cBalBBefore)) | |
803 | 802 | } | |
804 | 803 | else throw("Strict value is not equal to itself.") | |
805 | 804 | } | |
806 | 805 | else $Tuple2(tokensAmountA, tokensAmountB) | |
807 | - | let toUserAmountA = $ | |
808 | - | let toUserAmountB = $ | |
806 | + | let toUserAmountA = $t02464625342._1 | |
807 | + | let toUserAmountB = $t02464625342._2 | |
809 | 808 | $Tuple7(toUserAmountA, assetIdA, toUserAmountB, assetIdB, cBalAAfter, cBalBAfter, shareId) | |
810 | 809 | } | |
811 | 810 | else throw("Strict value is not equal to itself.") | |
812 | 811 | } | |
813 | 812 | else throw("Strict value is not equal to itself.") | |
814 | 813 | } | |
815 | 814 | else throw("Strict value is not equal to itself.") | |
816 | 815 | } | |
817 | 816 | ||
818 | 817 | ||
819 | 818 | func userCanWithdrawShareCalc (user,pool,posId,borrowed) = { | |
820 | 819 | let pAmount = valueOrErrorMessage(getInteger(this, (((((pool + "_") + user) + "_") + posId) + kUserPosition)), "Unknown position") | |
821 | 820 | let userInterest = getIntegerValue(this, (((((pool + "_") + user) + "_") + posId) + kUserPositionInterest)) | |
822 | 821 | let poolInterest = if (borrowed) | |
823 | 822 | then getIntegerValue(this, (pool + kPoolInterestLoan)) | |
824 | 823 | else getIntegerValue(this, (pool + kPoolInterestNoLoan)) | |
825 | 824 | (pAmount + fraction(pAmount, (poolInterest - userInterest), SCALE10)) | |
826 | 825 | } | |
827 | 826 | ||
828 | 827 | ||
829 | 828 | func withdrawToUser (user,pool,posId,stopLoss) = { | |
830 | 829 | let pAmount = valueOrErrorMessage(getInteger(this, (((((pool + "_") + user) + "_") + posId) + kUserPosition)), "Unknown position") | |
831 | 830 | let userInterest = getIntegerValue(this, (((((pool + "_") + user) + "_") + posId) + kUserPositionInterest)) | |
832 | 831 | let borrowAmount = valueOrElse(getInteger(this, (((((pool + "_") + user) + "_") + posId) + kUserBorrowAmount)), 0) | |
833 | 832 | let userCanWithdraw = userCanWithdrawShareCalc(user, pool, posId, (borrowAmount > 0)) | |
834 | 833 | let poolTotalShare = getPoolTotalShare(pool) | |
835 | 834 | let userAddr = Address(fromBase58String(user)) | |
836 | 835 | let borrowAsset = valueOrElse(getString(this, (((((pool + "_") + user) + "_") + posId) + kUserBorrowAssetId)), "") | |
837 | 836 | let debt = if ((borrowAmount > 0)) | |
838 | 837 | then { | |
839 | 838 | let @ = invoke(getLendSrvAddr(), "getAssetDebt", [false, ((((pool + "_") + user) + "_") + posId), borrowAsset], nil) | |
840 | 839 | if ($isInstanceOf(@, "Int")) | |
841 | 840 | then @ | |
842 | 841 | else throw(($getType(@) + " couldn't be cast to Int")) | |
843 | 842 | } | |
844 | 843 | else 0 | |
845 | - | let $ | |
846 | - | if (($ | |
844 | + | let $t02685427007 = withdrawAmountCalc(pool, userCanWithdraw, debt, borrowAsset) | |
845 | + | if (($t02685427007 == $t02685427007)) | |
847 | 846 | then { | |
848 | - | let shareId = $ | |
849 | - | let cBalBAfter = $ | |
850 | - | let cBalAAfter = $ | |
851 | - | let assetIdB = $ | |
852 | - | let toUserAmountB = $ | |
853 | - | let assetIdA = $ | |
854 | - | let toUserAmountA = $ | |
847 | + | let shareId = $t02685427007._7 | |
848 | + | let cBalBAfter = $t02685427007._6 | |
849 | + | let cBalAAfter = $t02685427007._5 | |
850 | + | let assetIdB = $t02685427007._4 | |
851 | + | let toUserAmountB = $t02685427007._3 | |
852 | + | let assetIdA = $t02685427007._2 | |
853 | + | let toUserAmountA = $t02685427007._1 | |
855 | 854 | let closeDbtInv = if ((debt > 0)) | |
856 | 855 | then invoke(getLendSrvAddr(), "repayFor", [((user + "_") + posId)], [AttachedPayment(assetIdFromStr(borrowAsset), debt)]) | |
857 | 856 | else 0 | |
858 | 857 | if ((closeDbtInv == closeDbtInv)) | |
859 | 858 | 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)) | |
860 | 859 | else throw("Strict value is not equal to itself.") | |
861 | 860 | } | |
862 | 861 | else throw("Strict value is not equal to itself.") | |
863 | 862 | } | |
864 | 863 | ||
865 | 864 | ||
866 | 865 | func parseRequest (requestId) = { | |
867 | 866 | let request = split(valueOrErrorMessage(getString(this, (requestId + kRequestId)), ("No request with id " + requestId)), ",") | |
868 | 867 | let user = request[0] | |
869 | 868 | let pool = request[1] | |
870 | 869 | let pmtA = parseIntValue(request[2]) | |
871 | 870 | let AId = request[3] | |
872 | 871 | let pmtB = parseIntValue(request[4]) | |
873 | 872 | let BId = request[5] | |
874 | 873 | let balA = parseIntValue(request[6]) | |
875 | 874 | let balB = parseIntValue(request[7]) | |
876 | 875 | let shareId = request[8] | |
877 | 876 | let bwAsset = request[9] | |
878 | 877 | let bwAmount = parseIntValue(request[10]) | |
879 | 878 | $Tuple11(user, pool, pmtA, AId, pmtB, BId, balA, balB, shareId, bwAsset, bwAmount) | |
880 | 879 | } | |
881 | 880 | ||
882 | 881 | ||
883 | 882 | @Callable(i) | |
884 | 883 | func replenishEVALONLY (pool,leverage,borrowAssetId,pmtA,pmtB) = if (if ((100 > leverage)) | |
885 | 884 | then true | |
886 | 885 | else (leverage > 300)) | |
887 | 886 | then throw("Leverage can't be <100 and >300") | |
888 | 887 | else { | |
889 | 888 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
890 | - | let $ | |
891 | - | let AId = $ | |
892 | - | let BId = $ | |
893 | - | let balA = $ | |
894 | - | let balB = $ | |
895 | - | let shareId = $ | |
889 | + | let $t02851928609 = getPoolData(Address(fromBase58String(pool)), pType) | |
890 | + | let AId = $t02851928609._1 | |
891 | + | let BId = $t02851928609._2 | |
892 | + | let balA = $t02851928609._3 | |
893 | + | let balB = $t02851928609._4 | |
894 | + | let shareId = $t02851928609._5 | |
896 | 895 | let borrowAmount = if ((leverage > 100)) | |
897 | 896 | then { | |
898 | 897 | let dPriceA = ( let @ = invoke(priceOracleAddr, "getTWAP60", [AId, false], nil) | |
899 | 898 | if ($isInstanceOf(@, "(Int, Int)")) | |
900 | 899 | then @ | |
901 | 900 | else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._2 | |
902 | 901 | let dPriceB = ( let @ = invoke(priceOracleAddr, "getTWAP60", [BId, false], nil) | |
903 | 902 | if ($isInstanceOf(@, "(Int, Int)")) | |
904 | 903 | then @ | |
905 | 904 | else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._2 | |
906 | 905 | let paydInDollar = (fraction(dPriceA, pmtA, pow(10, 0, getAssetDecimals(AId), 0, 0, DOWN)) + fraction(dPriceB, pmtB, pow(10, 0, getAssetDecimals(BId), 0, 0, DOWN))) | |
907 | 906 | let borrowPrice = if ((borrowAssetId == AId)) | |
908 | 907 | then dPriceA | |
909 | 908 | else dPriceB | |
910 | 909 | (fraction(paydInDollar, (leverage - 100), 100) / borrowPrice) | |
911 | 910 | } | |
912 | 911 | else 0 | |
913 | - | let $ | |
912 | + | let $t02917829290 = if ((borrowAssetId == AId)) | |
914 | 913 | then $Tuple2((pmtA + borrowAmount), pmtB) | |
915 | 914 | else $Tuple2(pmtA, (pmtB + borrowAmount)) | |
916 | - | let payInA = $ | |
917 | - | let payInB = $ | |
915 | + | let payInA = $t02917829290._1 | |
916 | + | let payInB = $t02917829290._2 | |
918 | 917 | let lpAmount = calcReplanishLPVirt(pType, pool, pmtA, AId, pmtB, BId, balA, balB) | |
919 | - | let $ | |
920 | - | if (($ | |
918 | + | let $t02938329518 = calcWithdrawLPVirt(pType, pool, lpAmount, shareId, AId, BId, balA, balB, borrowAmount, borrowAssetId) | |
919 | + | if (($t02938329518 == $t02938329518)) | |
921 | 920 | then { | |
922 | - | let amountGetB = $ | |
923 | - | let amountGetA = $ | |
921 | + | let amountGetB = $t02938329518._2 | |
922 | + | let amountGetA = $t02938329518._1 | |
924 | 923 | let ratioBefore = fraction(balB, SCALE8, balA) | |
925 | 924 | let ratioAfter = fraction((balB - amountGetB), SCALE8, (balA - amountGetA)) | |
926 | 925 | let impact = (SCALE8 - fraction(ratioBefore, SCALE8, ratioAfter)) | |
927 | 926 | let imcatMod = if ((0 > impact)) | |
928 | 927 | then (impact * -1) | |
929 | 928 | else impact | |
930 | 929 | $Tuple2(nil, [amountGetA, amountGetB, imcatMod]) | |
931 | 930 | } | |
932 | 931 | else throw("Strict value is not equal to itself.") | |
933 | 932 | } | |
934 | 933 | ||
935 | 934 | ||
936 | 935 | ||
937 | 936 | @Callable(i) | |
938 | 937 | func getShareAssetPriceREADONLY (shareId) = { | |
939 | 938 | let sharePrices = getSharePrice([shareId]) | |
940 | 939 | $Tuple2(nil, sharePrices[0]) | |
941 | 940 | } | |
942 | 941 | ||
943 | 942 | ||
944 | 943 | ||
945 | 944 | @Callable(i) | |
946 | 945 | func getUserPositionShareAmountREADONLY (user,posNum) = { | |
947 | 946 | let pool = valueOrErrorMessage(getString(this, (((user + "_") + posNum) + kUserPositionPool)), "Unknown position") | |
948 | 947 | let borrowAmount = getIntegerValue(this, (((((pool + "_") + user) + "_") + posNum) + kUserBorrowAmount)) | |
949 | 948 | let userCanWithdraw = userCanWithdrawShareCalc(user, pool, posNum, (borrowAmount > 0)) | |
950 | 949 | $Tuple2(nil, userCanWithdraw) | |
951 | 950 | } | |
952 | 951 | ||
953 | 952 | ||
954 | 953 | ||
955 | 954 | @Callable(i) | |
956 | 955 | func replenish (pool,leverage,borrowAssetId) = if (if ((100 > leverage)) | |
957 | 956 | then true | |
958 | 957 | else (leverage > 300)) | |
959 | 958 | then throw("Leverage can't be <100 and >300") | |
960 | 959 | else { | |
961 | 960 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
962 | - | let $ | |
963 | - | let AId = $ | |
964 | - | let BId = $ | |
965 | - | let balA = $ | |
966 | - | let balB = $ | |
967 | - | let shareId = $ | |
968 | - | let $ | |
961 | + | let $t03066030750 = getPoolData(Address(fromBase58String(pool)), pType) | |
962 | + | let AId = $t03066030750._1 | |
963 | + | let BId = $t03066030750._2 | |
964 | + | let balA = $t03066030750._3 | |
965 | + | let balB = $t03066030750._4 | |
966 | + | let shareId = $t03066030750._5 | |
967 | + | let $t03075331390 = if ((size(i.payments) == 2)) | |
969 | 968 | then if ((assetIdToStr(i.payments[0].assetId) != AId)) | |
970 | 969 | then throw("Wrong payment asset A") | |
971 | 970 | else if ((assetIdToStr(i.payments[1].assetId) != BId)) | |
972 | 971 | then throw("Wrong payment asset B") | |
973 | 972 | else $Tuple4(i.payments[0].amount, AId, i.payments[1].amount, BId) | |
974 | 973 | else if ((size(i.payments) == 1)) | |
975 | 974 | then if ((assetIdToStr(i.payments[0].assetId) == AId)) | |
976 | 975 | then $Tuple4(i.payments[0].amount, AId, 0, BId) | |
977 | 976 | else if ((assetIdToStr(i.payments[0].assetId) == BId)) | |
978 | 977 | then $Tuple4(0, AId, i.payments[0].amount, BId) | |
979 | 978 | else throw("Wrong payment") | |
980 | 979 | else throw("One or two payments expected") | |
981 | - | let pmtA = $ | |
982 | - | let pmtAssetA = $ | |
983 | - | let pmtB = $ | |
984 | - | let pmtAssetB = $ | |
980 | + | let pmtA = $t03075331390._1 | |
981 | + | let pmtAssetA = $t03075331390._2 | |
982 | + | let pmtB = $t03075331390._3 | |
983 | + | let pmtAssetB = $t03075331390._4 | |
985 | 984 | let newPosNum = getNewUserPositionNumber(pool, toString(i.caller)) | |
986 | 985 | if ((leverage > 100)) | |
987 | 986 | then { | |
988 | 987 | let dPriceA = ( let @ = invoke(priceOracleAddr, "getTWAP60", [pmtAssetA, false], nil) | |
989 | 988 | if ($isInstanceOf(@, "(Int, Int)")) | |
990 | 989 | then @ | |
991 | 990 | else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._2 | |
992 | 991 | let dPriceB = ( let @ = invoke(priceOracleAddr, "getTWAP60", [pmtAssetB, false], nil) | |
993 | 992 | if ($isInstanceOf(@, "(Int, Int)")) | |
994 | 993 | then @ | |
995 | 994 | else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._2 | |
996 | 995 | let paydInDollar = (fraction(dPriceA, pmtA, pow(10, 0, getAssetDecimals(pmtAssetA), 0, 0, DOWN)) + fraction(dPriceB, pmtB, pow(10, 0, getAssetDecimals(pmtAssetB), 0, 0, DOWN))) | |
997 | 996 | let borrowPrice = if ((borrowAssetId == AId)) | |
998 | 997 | then dPriceA | |
999 | 998 | else dPriceB | |
1000 | 999 | let borrowAmount = (fraction(paydInDollar, (leverage - 100), 100) / borrowPrice) | |
1001 | 1000 | let request = makeString([toString(i.caller), pool, toString(pmtA), pmtAssetA, toString(pmtB), pmtAssetB, toString(balA), toString(balB), shareId, borrowAssetId, toString(borrowAmount)], ",") | |
1002 | 1001 | let newRequestId = { | |
1003 | 1002 | let @ = invoke(this, "createNewRequest", [request], nil) | |
1004 | 1003 | if ($isInstanceOf(@, "Int")) | |
1005 | 1004 | then @ | |
1006 | 1005 | else throw(($getType(@) + " couldn't be cast to Int")) | |
1007 | 1006 | } | |
1008 | 1007 | if ((newRequestId == newRequestId)) | |
1009 | 1008 | then { | |
1010 | 1009 | let args = [((toString(i.caller) + "_") + toString(newPosNum)), shareId, borrowAssetId, borrowAmount, toString(this), "replenishFromLand", toString(valueOrErrorMessage(newRequestId, "Can't create new request"))] | |
1011 | 1010 | let inv = reentrantInvoke(getLendSrvAddr(), "flashPosition", args, nil) | |
1012 | 1011 | if ((inv == inv)) | |
1013 | 1012 | then nil | |
1014 | 1013 | else throw("Strict value is not equal to itself.") | |
1015 | 1014 | } | |
1016 | 1015 | else throw("Strict value is not equal to itself.") | |
1017 | 1016 | } | |
1018 | 1017 | else { | |
1019 | - | let $ | |
1020 | - | let userStaked = $ | |
1021 | - | let axlyFee = $ | |
1018 | + | let $t03277332885 = replenishByType(pType, pool, NO_LOAN_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId) | |
1019 | + | let userStaked = $t03277332885._1 | |
1020 | + | let axlyFee = $t03277332885._2 | |
1022 | 1021 | (replenishEntries(pool, toString(i.caller), userStaked, axlyFee, newPosNum, shareId, pType, false) ++ getCursEntries(AId, BId, shareId)) | |
1023 | 1022 | } | |
1024 | 1023 | } | |
1025 | 1024 | ||
1026 | 1025 | ||
1027 | 1026 | ||
1028 | 1027 | @Callable(i) | |
1029 | 1028 | func replenishFromLand (requestId) = { | |
1030 | - | let $ | |
1031 | - | let user = $ | |
1032 | - | let pool = $ | |
1033 | - | let pmtA = $ | |
1034 | - | let AId = $ | |
1035 | - | let pmtB = $ | |
1036 | - | let BId = $ | |
1037 | - | let balA = $ | |
1038 | - | let balB = $ | |
1039 | - | let shareId = $ | |
1040 | - | let bwAsset = $ | |
1041 | - | let bwAmount = $ | |
1029 | + | let $t03309633200 = parseRequest(requestId) | |
1030 | + | let user = $t03309633200._1 | |
1031 | + | let pool = $t03309633200._2 | |
1032 | + | let pmtA = $t03309633200._3 | |
1033 | + | let AId = $t03309633200._4 | |
1034 | + | let pmtB = $t03309633200._5 | |
1035 | + | let BId = $t03309633200._6 | |
1036 | + | let balA = $t03309633200._7 | |
1037 | + | let balB = $t03309633200._8 | |
1038 | + | let shareId = $t03309633200._9 | |
1039 | + | let bwAsset = $t03309633200._10 | |
1040 | + | let bwAmount = $t03309633200._11 | |
1042 | 1041 | if ((size(i.payments) != 1)) | |
1043 | 1042 | then throw("Wrong payment size") | |
1044 | 1043 | else if (if ((assetIdToStr(i.payments[0].assetId) != bwAsset)) | |
1045 | 1044 | then true | |
1046 | 1045 | else (i.payments[0].amount != bwAmount)) | |
1047 | 1046 | then throw("Wrong payment") | |
1048 | 1047 | else { | |
1049 | - | let $ | |
1048 | + | let $t03339033514 = if ((AId == bwAsset)) | |
1050 | 1049 | then $Tuple2((pmtA + i.payments[0].amount), pmtB) | |
1051 | 1050 | else $Tuple2(pmtA, (pmtB + i.payments[0].amount)) | |
1052 | - | let pmtAllA = $ | |
1053 | - | let pmtAllB = $ | |
1051 | + | let pmtAllA = $t03339033514._1 | |
1052 | + | let pmtAllB = $t03339033514._2 | |
1054 | 1053 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Unknown pool") | |
1055 | - | let $ | |
1056 | - | let userStaked = $ | |
1057 | - | let axlyFee = $ | |
1054 | + | let $t03359633705 = replenishByType(pType, pool, LOAN_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId) | |
1055 | + | let userStaked = $t03359633705._1 | |
1056 | + | let axlyFee = $t03359633705._2 | |
1058 | 1057 | let posNum = getNewUserPositionNumber(pool, toString(i.caller)) | |
1059 | 1058 | let borrowEntries = [IntegerEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserBorrowAmount), bwAmount), StringEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserBorrowAssetId), bwAsset)] | |
1060 | 1059 | let entries = replenishEntries(pool, user, userStaked, axlyFee, posNum, shareId, pType, true) | |
1061 | 1060 | $Tuple2((((entries ++ getCursEntries(AId, BId, shareId)) ++ borrowEntries) :+ DeleteEntry((requestId + kRequestId))), userStaked) | |
1062 | 1061 | } | |
1063 | 1062 | } | |
1064 | 1063 | ||
1065 | 1064 | ||
1066 | 1065 | ||
1067 | 1066 | @Callable(i) | |
1068 | 1067 | func withdraw (pool,posId) = withdrawToUser(toString(i.caller), pool, toString(posId), false) | |
1069 | 1068 | ||
1070 | 1069 | ||
1071 | 1070 | ||
1072 | 1071 | @Callable(i) | |
1073 | 1072 | func createUpdateStopLoss (posId,poolId,assetId,price) = { | |
1074 | 1073 | let tokenOraclePrice = ( let @ = invoke(priceOracleAddr, "getTWAP60", [assetId, false], nil) | |
1075 | 1074 | if ($isInstanceOf(@, "(Int, Int)")) | |
1076 | 1075 | then @ | |
1077 | 1076 | else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._1 | |
1078 | 1077 | if (!(isDefined(getInteger(this, (((((poolId + "_") + toString(i.caller)) + "_") + toString(posId)) + kUserPosition))))) | |
1079 | 1078 | then throw("There are no user position") | |
1080 | 1079 | else if ((0 >= price)) | |
1081 | 1080 | then throw("Price must be greater than 0") | |
1082 | 1081 | else if ((price > tokenOraclePrice)) | |
1083 | 1082 | then throw("Price must be less than current token price") | |
1084 | 1083 | else [IntegerEntry((((((((toString(i.caller) + "_") + toString(posId)) + "_") + poolId) + "_") + assetId) + kUserStopLoss), price)] | |
1085 | 1084 | } | |
1086 | 1085 | ||
1087 | 1086 | ||
1088 | 1087 | ||
1089 | 1088 | @Callable(i) | |
1090 | 1089 | func deleteStopLoss (posId,poolId,assetId) = if (!(isDefined(getInteger(this, (((((((toString(i.caller) + "_") + toString(posId)) + "_") + poolId) + "_") + assetId) + kUserStopLoss))))) | |
1091 | 1090 | then throw("No entry") | |
1092 | 1091 | else [DeleteEntry((((((((toString(i.caller) + "_") + toString(posId)) + "_") + poolId) + "_") + assetId) + kUserStopLoss))] | |
1093 | 1092 | ||
1094 | 1093 | ||
1095 | 1094 | ||
1096 | 1095 | @Callable(i) | |
1097 | 1096 | func createNewRequest (params) = valueOrElse(isSelfCall(i), { | |
1098 | 1097 | let newRequestId = (valueOrElse(getInteger(this, kRequestIter), 0) + 1) | |
1099 | 1098 | $Tuple2([StringEntry((toString(newRequestId) + kRequestId), params), IntegerEntry(kRequestIter, newRequestId)], newRequestId) | |
1100 | 1099 | }) | |
1101 | 1100 | ||
1102 | 1101 | ||
1103 | 1102 | ||
1104 | 1103 | @Callable(i) | |
1105 | 1104 | func stopLoss (user,posId,pool,assetId) = { | |
1106 | 1105 | let tokenOraclePrice = ( let @ = invoke(priceOracleAddr, "getTWAP60", [assetId, false], nil) | |
1107 | 1106 | if ($isInstanceOf(@, "(Int, Int)")) | |
1108 | 1107 | then @ | |
1109 | 1108 | else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._1 | |
1110 | 1109 | if (!(isDefined(getInteger(this, (((((((user + "_") + toString(posId)) + "_") + pool) + "_") + assetId) + kUserStopLoss))))) | |
1111 | 1110 | then throw("No entry") | |
1112 | 1111 | else (withdrawToUser(toString(i.caller), pool, toString(posId), true) :+ DeleteEntry((((((((user + "_") + toString(posId)) + "_") + pool) + "_") + assetId) + kUserStopLoss))) | |
1113 | 1112 | } | |
1114 | 1113 | ||
1115 | 1114 | ||
1116 | 1115 | ||
1117 | 1116 | @Callable(i) | |
1118 | 1117 | func liquidate (user,posId,liquidateAmount) = { | |
1119 | 1118 | let pool = valueOrErrorMessage(getString(this, (((user + "_") + posId) + kUserPositionPool)), "no position") | |
1120 | 1119 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
1121 | - | let $ | |
1122 | - | let AId = $ | |
1123 | - | let BId = $ | |
1124 | - | let balA = $ | |
1125 | - | let balB = $ | |
1126 | - | let shareId = $ | |
1120 | + | let $t03648836578 = getPoolData(Address(fromBase58String(pool)), pType) | |
1121 | + | let AId = $t03648836578._1 | |
1122 | + | let BId = $t03648836578._2 | |
1123 | + | let balA = $t03648836578._3 | |
1124 | + | let balB = $t03648836578._4 | |
1125 | + | let shareId = $t03648836578._5 | |
1127 | 1126 | let amount = unstakeLP(pool, pType, shareId, liquidateAmount) | |
1128 | 1127 | let borrowAmount = getIntegerValue(this, (((((pool + "_") + user) + "_") + posId) + kUserBorrowAmount)) | |
1129 | 1128 | let borrowAsset = getStringValue(this, (((((pool + "_") + user) + "_") + posId) + kUserBorrowAssetId)) | |
1130 | 1129 | let userCanWithdraw = userCanWithdrawShareCalc(user, pool, posId, (borrowAmount > 0)) | |
1131 | 1130 | if ((borrowAmount == 0)) | |
1132 | 1131 | then throw("You can't liquidate position without borrow") | |
1133 | 1132 | else [IntegerEntry((((((pool + "_") + user) + "_") + posId) + kUserPositionInterest), getIntegerValue(this, (pool + kPoolInterestLoan))), IntegerEntry((pool + kPoolTotalLoan), (getPoolTotalShareWithLoan(pool) - liquidateAmount)), IntegerEntry((pool + kPoolTotal), (getPoolTotalShare(pool) - liquidateAmount)), IntegerEntry((((((pool + "_") + user) + "_") + posId) + kUserPosition), (userCanWithdraw - liquidateAmount)), ScriptTransfer(i.caller, amount, fromBase58String(shareId))] | |
1134 | 1133 | } | |
1135 | 1134 | ||
1136 | 1135 | ||
1137 | 1136 | ||
1138 | 1137 | @Callable(i) | |
1139 | 1138 | func capitalizeExKeeper (pool,type,tokenToId,amountToExchange,claim,amountsIn,addresses,assetsToReceive,estReceived,slippageTolerance,minReceived,options) = { | |
1140 | - | let $ | |
1139 | + | let $t03781338007 = if (claim) | |
1141 | 1140 | then claimFarmed(type, pool) | |
1142 | 1141 | else { | |
1143 | 1142 | let claimedAsset = if ((type == SF_POOL)) | |
1144 | 1143 | then SWOPID | |
1145 | 1144 | else WXID | |
1146 | 1145 | $Tuple2(amountToExchange, claimedAsset) | |
1147 | 1146 | } | |
1148 | - | let claimedAmount = $ | |
1149 | - | let claimedAsset = $ | |
1147 | + | let claimedAmount = $t03781338007._1 | |
1148 | + | let claimedAsset = $t03781338007._2 | |
1150 | 1149 | let exchangedAmount = exchangeKeeper(tokenToId, amountToExchange, claimedAsset, amountsIn, addresses, assetsToReceive, estReceived, slippageTolerance, minReceived, options) | |
1151 | 1150 | let change = (claimedAmount - amountToExchange) | |
1152 | 1151 | let changeEntry = if ((change > 0)) | |
1153 | 1152 | then [IntegerEntry((pool + kPoolCapChange), (change + valueOrElse(getInteger(this, (pool + kPoolCapChange)), 0)))] | |
1154 | 1153 | else nil | |
1155 | 1154 | (capitalize(pool, type, tokenToId, exchangedAmount) ++ changeEntry) | |
1156 | 1155 | } | |
1157 | 1156 | ||
1158 | 1157 | ||
1159 | 1158 | ||
1160 | 1159 | @Callable(i) | |
1161 | 1160 | func capitalizeExPuzzle (pool,type,tokenToId,amountToExchange,claim,routesStr,minToReceive,options) = { | |
1162 | - | let $ | |
1161 | + | let $t03866438858 = if (claim) | |
1163 | 1162 | then claimFarmed(type, pool) | |
1164 | 1163 | else { | |
1165 | 1164 | let claimedAsset = if ((type == SF_POOL)) | |
1166 | 1165 | then SWOPID | |
1167 | 1166 | else WXID | |
1168 | 1167 | $Tuple2(amountToExchange, claimedAsset) | |
1169 | 1168 | } | |
1170 | - | let claimedAmount = $ | |
1171 | - | let claimedAsset = $ | |
1169 | + | let claimedAmount = $t03866438858._1 | |
1170 | + | let claimedAsset = $t03866438858._2 | |
1172 | 1171 | let exchangedAmount = exchangePuzzle(tokenToId, amountToExchange, claimedAsset, routesStr, minToReceive, options) | |
1173 | 1172 | let change = (claimedAmount - amountToExchange) | |
1174 | 1173 | let changeEntry = if ((change > 0)) | |
1175 | 1174 | then [IntegerEntry((pool + kPoolCapChange), (change + valueOrElse(getInteger(this, (pool + kPoolCapChange)), 0)))] | |
1176 | 1175 | else nil | |
1177 | 1176 | (capitalize(pool, type, tokenToId, exchangedAmount) ++ changeEntry) | |
1178 | 1177 | } | |
1179 | 1178 | ||
1180 | 1179 | ||
1181 | 1180 | ||
1182 | 1181 | @Callable(i) | |
1183 | 1182 | func capitalizeExSwopFi (pool,type,tokenToId,amountToExchange,claim,exchangers,exchangersType,args1,args2,routingAssetsKeys,minAmountToReceive,options) = { | |
1184 | - | let $ | |
1183 | + | let $t03958139775 = if (claim) | |
1185 | 1184 | then claimFarmed(type, pool) | |
1186 | 1185 | else { | |
1187 | 1186 | let claimedAsset = if ((type == SF_POOL)) | |
1188 | 1187 | then SWOPID | |
1189 | 1188 | else WXID | |
1190 | 1189 | $Tuple2(amountToExchange, claimedAsset) | |
1191 | 1190 | } | |
1192 | - | let claimedAmount = $ | |
1193 | - | let claimedAsset = $ | |
1191 | + | let claimedAmount = $t03958139775._1 | |
1192 | + | let claimedAsset = $t03958139775._2 | |
1194 | 1193 | let exchangedAmount = exchangeSwopFi(tokenToId, amountToExchange, claimedAsset, exchangers, exchangersType, args1, args2, routingAssetsKeys, minAmountToReceive, options) | |
1195 | 1194 | let change = (claimedAmount - amountToExchange) | |
1196 | 1195 | let changeEntry = if ((change > 0)) | |
1197 | 1196 | then [IntegerEntry((pool + kPoolCapChange), (change + valueOrElse(getInteger(this, (pool + kPoolCapChange)), 0)))] | |
1198 | 1197 | else nil | |
1199 | 1198 | (capitalize(pool, type, tokenToId, exchangedAmount) ++ changeEntry) | |
1200 | 1199 | } | |
1201 | 1200 | ||
1202 | 1201 | ||
1203 | 1202 | ||
1204 | 1203 | @Callable(i) | |
1205 | 1204 | func initNewPool (type,poolAddr,inFeeNoLoan,inFeeLoan,capFeeNoLoan,capFeeWithLoan,stoplossFeeNoLoan,stoplossFeeWithLoan) = if (if ((type != SF_POOL)) | |
1206 | 1205 | then (type != WX_POOL) | |
1207 | 1206 | else false) | |
1208 | 1207 | then throw("Wrong type") | |
1209 | 1208 | else { | |
1210 | - | let $ | |
1211 | - | let aId = $ | |
1212 | - | let bId = $ | |
1213 | - | let aBal = $ | |
1214 | - | let bBal = $ | |
1215 | - | let shareId = $ | |
1209 | + | let $t04046840562 = getPoolData(Address(fromBase58String(poolAddr)), type) | |
1210 | + | let aId = $t04046840562._1 | |
1211 | + | let bId = $t04046840562._2 | |
1212 | + | let aBal = $t04046840562._3 | |
1213 | + | let bBal = $t04046840562._4 | |
1214 | + | let shareId = $t04046840562._5 | |
1216 | 1215 | [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)] | |
1217 | 1216 | } | |
1218 | 1217 | ||
1219 | 1218 | ||
1220 | 1219 | ||
1221 | 1220 | @Callable(i) | |
1222 | 1221 | func capitalizeTest (pool,pType,tokenId,tokenAmount) = { | |
1223 | 1222 | let poolAddr = Address(fromBase58String(pool)) | |
1224 | - | let $ | |
1225 | - | let AId = $ | |
1226 | - | let BId = $ | |
1227 | - | let balA = $ | |
1228 | - | let balB = $ | |
1229 | - | let shareId = $ | |
1230 | - | let $ | |
1223 | + | let $t04135841437 = getPoolData(poolAddr, pType) | |
1224 | + | let AId = $t04135841437._1 | |
1225 | + | let BId = $t04135841437._2 | |
1226 | + | let balA = $t04135841437._3 | |
1227 | + | let balB = $t04135841437._4 | |
1228 | + | let shareId = $t04135841437._5 | |
1229 | + | let $t04144041520 = if ((tokenId == AId)) | |
1231 | 1230 | then $Tuple2(tokenAmount, 0) | |
1232 | 1231 | else $Tuple2(0, tokenAmount) | |
1233 | - | let pmtA = $ | |
1234 | - | let pmtB = $ | |
1235 | - | let $ | |
1236 | - | let stakedAmount = $ | |
1237 | - | let nf = $ | |
1232 | + | let pmtA = $t04144041520._1 | |
1233 | + | let pmtB = $t04144041520._2 | |
1234 | + | let $t04152341627 = replenishByType(pType, pool, NO_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId) | |
1235 | + | let stakedAmount = $t04152341627._1 | |
1236 | + | let nf = $t04152341627._2 | |
1238 | 1237 | let curPoolInterestLoan = valueOrElse(getInteger(this, (pool + kPoolInterestLoan)), 0) | |
1239 | 1238 | let curPoolInterestNoLoan = valueOrElse(getInteger(this, (pool + kPoolInterestNoLoan)), 0) | |
1240 | 1239 | let totalShareAmount = getPoolTotalShare(pool) | |
1241 | 1240 | let totalShareAmountWithLoan = getPoolTotalShareWithLoan(pool) | |
1242 | 1241 | let loanPercent = fraction(totalShareAmountWithLoan, SCALE8, totalShareAmount) | |
1243 | 1242 | let stakedLoan = fraction(stakedAmount, loanPercent, SCALE8) | |
1244 | 1243 | let stakedNoLoan = (stakedAmount - stakedLoan) | |
1245 | 1244 | let newInterestLoan = if ((totalShareAmountWithLoan > 0)) | |
1246 | 1245 | then (curPoolInterestLoan + fraction(stakedLoan, SCALE10, totalShareAmountWithLoan)) | |
1247 | 1246 | else 0 | |
1248 | 1247 | let newInterestNoLoan = if (((totalShareAmount - totalShareAmountWithLoan) > 0)) | |
1249 | 1248 | then (curPoolInterestNoLoan + fraction(stakedNoLoan, SCALE10, (totalShareAmount - totalShareAmountWithLoan))) | |
1250 | 1249 | else 0 | |
1251 | 1250 | let axlyFeeLoan = fraction(stakedLoan, getAxlyFee(pool, CAP_FEE_LOAN), FEE_SCALE6) | |
1252 | 1251 | let axlyFeeNoLoan = fraction(stakedNoLoan, getAxlyFee(pool, CAP_FEE_NO_LOAN), FEE_SCALE6) | |
1253 | 1252 | let axlyFee = unstakeLP(pool, pType, shareId, (axlyFeeLoan + axlyFeeNoLoan)) | |
1254 | 1253 | if ((axlyFee == axlyFee)) | |
1255 | 1254 | 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)) | |
1256 | 1255 | else throw("Strict value is not equal to itself.") | |
1257 | 1256 | } | |
1258 | 1257 | ||
1259 | 1258 | ||
1260 | 1259 | ||
1261 | 1260 | @Callable(i) | |
1262 | 1261 | func claimFarmedTest (type,pool) = if ((type == SF_POOL)) | |
1263 | 1262 | then { | |
1264 | 1263 | let balBefore = accountBalance(SWOPID) | |
1265 | 1264 | if ((balBefore == balBefore)) | |
1266 | 1265 | then { | |
1267 | 1266 | let inv = invoke(getSFFarmingAddr(), "claim", [pool], nil) | |
1268 | 1267 | if ((inv == inv)) | |
1269 | 1268 | then { | |
1270 | 1269 | let balAfter = accountBalance(SWOPID) | |
1271 | 1270 | $Tuple2(nil, $Tuple2((balAfter - balBefore), SWOPID)) | |
1272 | 1271 | } | |
1273 | 1272 | else throw("Strict value is not equal to itself.") | |
1274 | 1273 | } | |
1275 | 1274 | else throw("Strict value is not equal to itself.") | |
1276 | 1275 | } | |
1277 | 1276 | else if ((type == WX_POOL)) | |
1278 | 1277 | then { | |
1279 | 1278 | let balBefore = accountBalance(WXID) | |
1280 | 1279 | if ((balBefore == balBefore)) | |
1281 | 1280 | then { | |
1282 | 1281 | let inv = invoke(getWXFarmingAddr(Address(fromBase58String(pool))), "claimWX", [pool], nil) | |
1283 | 1282 | if ((inv == inv)) | |
1284 | 1283 | then { | |
1285 | 1284 | let balAfter = accountBalance(WXID) | |
1286 | 1285 | $Tuple2(nil, $Tuple2((balAfter - balBefore), WXID)) | |
1287 | 1286 | } | |
1288 | 1287 | else throw("Strict value is not equal to itself.") | |
1289 | 1288 | } | |
1290 | 1289 | else throw("Strict value is not equal to itself.") | |
1291 | 1290 | } | |
1292 | 1291 | else throw("Wrong pool type") | |
1293 | 1292 | ||
1294 | 1293 | ||
1295 | 1294 | @Verifier(tx) | |
1296 | 1295 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
1297 | 1296 |
github/deemru/w8io/026f985 201.91 ms ◑