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