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