tx · 3Fk2KfwHLRibW9g4DvSGvAHjtHiaGeD1x3jBGN91vo8b

3N2M4PztorHwrfENp7D6LhYGgGodjiD1fjn:  -0.02300000 Waves

2023.08.24 15:26 [2724717] smart account 3N2M4PztorHwrfENp7D6LhYGgGodjiD1fjn > SELF 0.00000000 Waves

{ "type": 13, "id": "3Fk2KfwHLRibW9g4DvSGvAHjtHiaGeD1x3jBGN91vo8b", "fee": 2300000, "feeAssetId": null, "timestamp": 1692879966827, "version": 2, "chainId": 84, "sender": "3N2M4PztorHwrfENp7D6LhYGgGodjiD1fjn", "senderPublicKey": "Fj9LPkCtmW3pDnVU6wPQnvqpZJCBieWSvZqY5FAGeCyp", "proofs": [ "4tvCrdM4PVJ8vixBPWnSyBSBqvNDwxHiUWN3527eda41L4dfuk4oRoEc1BZrqfLni4dX6LnyNfQwhM7kAhJExaZW", "2QDytcJo1kvmyWFsAFpAN3wKcPeEeGLA4TV1eqaP3ZP7R8jbaf5CAeq1EMcdanCCzviuxt6LUmynjbS1XYpysGTS" ], "script": "base64:BgIhCAISABIAEgQKAggIEgMKAQgSBwoFCAgIAQESAwoBCBIAUQAGU0NBTEU4AIDC1y8AC0xFTkRFUlNfQVBSCQDMCAIAlgEJAMwIAgB4CQDMCAIAZAkAzAgCAFAJAMwIAgA8CQDMCAIAKAkAzAgCAB4JAMwIAgAUCQDMCAIACgUDbmlsABNMRU5ERVJTX0FQUl9QRVJJT0RTCQDMCAICAzEtMQkAzAgCAgMyLTIJAMwIAgIDMy0zCQDMCAICAzQtNAkAzAgCAgM1LTgJAMwIAgIEOS0xMgkAzAgCAgcxNCAtIDE2CQDMCAICBTE3LTIwCQDMCAICBjIwLTEwNAUDbmlsABNMRU5ERVJTX01BWF9QRVJJT0RTAGgABkxQX0FQUgkAzAgCAJYBCQDMCAIAeAkAzAgCAGQJAMwIAgBQCQDMCAIAPAkAzAgCACgFA25pbAAOTFBfQVBSX1BFUklPRFMJAMwIAgIDMS0xCQDMCAICAzItMgkAzAgC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cnRIZWlnaHQJAMwIAgUGaGVpZ2h0BQNuaWwBAnR4AQZ2ZXJpZnkABBNtdWx0aVNpZ25lZEJ5QWRtaW5zBBJhZG1pblB1YktleTFTaWduZWQDCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAABQhhZG1pbjFQSwABAAAEEmFkbWluUHViS2V5MlNpZ25lZAMJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAEFCGFkbWluMlBLAAEAAAQSYWRtaW5QdWJLZXkzU2lnbmVkAwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAgUIYWRtaW4zUEsAAQAACQBnAgkAZAIJAGQCBRJhZG1pblB1YktleTFTaWduZWQFEmFkbWluUHViS2V5MlNpZ25lZAUSYWRtaW5QdWJLZXkzU2lnbmVkAAIEByRtYXRjaDAFAnR4AwkAAQIFByRtYXRjaDACF0ludm9rZVNjcmlwdFRyYW5zYWN0aW9uBANpbnYFByRtYXRjaDAEBmlzU2VsZgkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tleQQKaXNSaWdodEZlZQMJAAACCAUDaW52A2ZlZQCg9zYJAAACCAUDaW52CmZlZUFzc2V0SWQFBHVuaXQHBAppc0luaXRDYWxsCQAAAggFA2ludghmdW5jdGlvbgIEaW5pdAQMaXNub1BheW1lbnRzCQAAAgkAkAMBCAUDaW52CHBheW1lbnRzAAADAwMDBQppc1JpZ2h0RmVlBQppc0luaXRDYWxsBwUGaXNTZWxmBwUMaXNub1BheW1lbnRzBwYFE211bHRpU2lnbmVkQnlBZG1pbnMFE211bHRpU2lnbmVkQnlBZG1pbnPjznVf", "height": 2724717, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: GpxJnAjmHNE1LqjAupRpKFsGEheKm3N5bkM7NLr3SeM7 Next: 2dh898hSMEeoAvR25DE53RCGXkHrz6yz86qyw8fANhKh Diff:
OldNewDifferences
55
66 let LENDERS_APR = [150, 120, 100, 80, 60, 40, 30, 20, 10]
77
8-let LENDERS_APR_PERIODS = ["1-1", "2-2", "3-3", "4-4", "5-8", "9-12", "14-16", "17-20", "20-104"]
8+let LENDERS_APR_PERIODS = ["1-1", "2-2", "3-3", "4-4", "5-8", "9-12", "14 - 16", "17-20", "20-104"]
99
1010 let LENDERS_MAX_PERIODS = 104
1111
3333
3434 let kTokenRewardPerBlock = "_tokenRewardPerBlock"
3535
36-let kLastUpdatePeriod = "rewardUpdatePeriod"
36+let kRewardUpdateHeight = "rewardUpdateHeight"
3737
3838 let kUserLendInterest = "_userLandInterest"
3939
115115
116116 let periodLength = getIntegerValue(this, kPeriodLength)
117117
118+let curPeriod = ((height - startHeight) / periodLength)
119+
118120 let lendMaxAmount = getIntegerValue(tokenContract, kLendersMaxAmount)
119121
120122 let lendMaxPeriodAmount = (lendMaxAmount / LENDERS_MAX_PERIODS)
174176
175177 func getAdoptedAPRByPeriod (period,aprPeriods,apr) = {
176178 func for (a,aperiod) = {
177- let $t053625384 = a
178- let index = $t053625384._1
179- let found = $t053625384._2
179+ let $t054205442 = a
180+ let index = $t054205442._1
181+ let found = $t054205442._2
180182 let ft = split(aperiod, "-")
181- let $t054215484 = $Tuple2(parseIntValue(ft[0]), parseIntValue(ft[1]))
182- let from = $t054215484._1
183- let to = $t054215484._2
183+ let $t054795542 = $Tuple2(parseIntValue(ft[0]), parseIntValue(ft[1]))
184+ let from = $t054795542._1
185+ let to = $t054795542._2
184186 if (found)
185187 then a
186188 else if (if ((period >= from))
190192 else $Tuple2((index + 1), false)
191193 }
192194
193- let $t056215687 = {
195+ let $t056795745 = {
194196 let $l = LENDERS_APR_PERIODS
195197 let $s = size($l)
196198 let $acc0 = $Tuple2(0, false)
204206
205207 $f0_2($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)
206208 }
207- let index = $t056215687._1
208- let found = $t056215687._2
209+ let index = $t056795745._1
210+ let found = $t056795745._2
209211 if (found)
210212 then fraction((LENDERS_APR[index] * SCALE8), 7, 365)
211213 else 0
214216
215217 func getTotalSupplyAllTokens () = {
216218 func for (a,tokenId) = {
217- let $t058755931 = a
218- let totalSupply = $t058755931._1
219- let totalSupplyUsd = $t058755931._2
220- let totalSupplyUsdAll = $t058755931._3
219+ let $t059335989 = a
220+ let totalSupply = $t059335989._1
221+ let totalSupplyUsd = $t059335989._2
222+ let totalSupplyUsdAll = $t059335989._3
221223 let tSupply = valueOrElse(getInteger(lendContract, (kLendTokenSupply + tokenId)), 0)
222224 let assetPrice = getAssetPrice(tokenId)
223225 let assetPrecision = getAssetPrecision(tokenId)
248250 }
249251
250252
251-func calcNewTokenInterest (tokenId,totalSupply) = if ((startHeight >= height))
253+func calcNewTokenInterest (tokenId,totalSupply) = if ((height >= startHeight))
252254 then 0
253255 else {
254256 let rewardPerBlock = getIntegerValue(this, (tokenId + kTokenRewardPerBlock))
262264 }
263265
264266
265-func calcNewLpInterest (totalSupply) = if ((startHeight >= height))
267+func calcNewLpInterest (totalSupply) = if ((height >= startHeight))
266268 then 0
267269 else {
268270 let rewardPerBlock = valueOrElse(getInteger(this, kLpRewardPerBlock), 0)
291293 func calcLpUserReward (user) = {
292294 let totalSupply = valueOrElse(getInteger(sfFarmingContract, (axlyPool + kSFTotalSupply)), 0)
293295 let tokenInterest = calcNewLpInterest(totalSupply)
294- let userSupply = valueOrElse(getInteger(sfFarmingContract, (((axlyPool + "_") + user) + kSFUserTotalSupply)), 0)
296+ let userSupply = valueOrElse(getInteger(lendContract, (((axlyPool + "_") + user) + kSFUserTotalSupply)), 0)
295297 let userTokenInterest = valueOrElse(getInteger(this, (user + kUserLpInterest)), if ((userSupply == 0))
296298 then tokenInterest
297299 else 0)
302304
303305 func claimLenderRewardsCommon (user,readOnly) = {
304306 func claim (a,tokenId) = {
305- let $t088208864 = a
306- let tokenIds = $t088208864._1
307- let cAmount = $t088208864._2
308- let total = $t088208864._3
309- let enteries = $t088208864._4
307+ let $t088738917 = a
308+ let tokenIds = $t088738917._1
309+ let cAmount = $t088738917._2
310+ let total = $t088738917._3
311+ let enteries = $t088738917._4
310312 let userAvailableClaim = valueOrElse(getInteger(this, (((tokenId + "_") + user) + kUserLendAvailableClaim)), 0)
311- let $t089779056 = calcLendUserReward(user, tokenId)
312- let uReward = $t089779056._1
313- let newTokenInterest = $t089779056._2
314- let userSupply = $t089779056._3
313+ let $t090309109 = calcLendUserReward(user, tokenId)
314+ let uReward = $t090309109._1
315+ let newTokenInterest = $t090309109._2
316+ let userSupply = $t090309109._3
315317 let totalToClaim = (userAvailableClaim + uReward)
316318 if (if ((totalToClaim > 0))
317319 then true
344346
345347 func claimLpRewardsCommon (user,readOnly) = {
346348 let userAvailableClaim = valueOrElse(getInteger(this, (user + kUserLpAvailableClaim)), 0)
347- let $t0998810053 = calcLpUserReward(user)
348- let uReward = $t0998810053._1
349- let newLpInterest = $t0998810053._2
350- let userSupply = $t0998810053._3
349+ let $t01004110106 = calcLpUserReward(user)
350+ let uReward = $t01004110106._1
351+ let newLpInterest = $t01004110106._2
352+ let userSupply = $t01004110106._3
351353 let totalToClaim = (userAvailableClaim + uReward)
352354 if (if (readOnly)
353355 then true
386388 let lpId = getStringValue(addressFromStringValue(axlyPool), kLpId)
387389 let lpPrecision = getAssetPrecision(lpId)
388390 let lpPrice = {
389- let @ = invoke(mainContract, "getShareAssetPriceREADONLY", [lpId], nil)
391+ let @ = ({
392+ let @ = invoke(mainContract, "getShareAssetPriceREADONLY", [[lpId]], nil)
393+ if ($isInstanceOf(@, "List[Any]"))
394+ then @
395+ else throw(($getType(@) + " couldn't be cast to List[Any]"))
396+ })[0]
390397 if ($isInstanceOf(@, "Int"))
391398 then @
392399 else throw(($getType(@) + " couldn't be cast to Int"))
433440 @Callable(i)
434441 func lendAction (user,tokenId) = valueOrElse(isLandCall(i), {
435442 let userAvailableClaim = valueOrElse(getInteger(this, (tokenId + kUserLendAvailableClaim)), 0)
436- let $t01240112468 = calcLendUserReward(user, tokenId)
437- let uReward = $t01240112468._1
438- let newTokenInterest = $t01240112468._2
439-[IntegerEntry((((user + "_") + tokenId) + kUserLendInterest), newTokenInterest), IntegerEntry((((user + "_") + tokenId) + kUserLendAvailableClaim), (userAvailableClaim + uReward)), IntegerEntry((tokenId + kTokenInterest), newTokenInterest), IntegerEntry((tokenId + kTokenInterestHeight), height)]
443+ let $t01247712544 = calcLendUserReward(user, tokenId)
444+ let uReward = $t01247712544._1
445+ let newTokenInterest = $t01247712544._2
446+[IntegerEntry((((tokenId + "_") + user) + kUserLendInterest), newTokenInterest), IntegerEntry((((tokenId + "_") + user) + kUserLendAvailableClaim), (userAvailableClaim + uReward)), IntegerEntry((tokenId + kTokenInterest), newTokenInterest), IntegerEntry((tokenId + kTokenInterestHeight), height)]
440447 })
441448
442449
444451 @Callable(i)
445452 func lpAction (user) = valueOrElse(isSFFarmingCall(i), {
446453 let userAvailableClaim = valueOrElse(getInteger(this, kUserLpAvailableClaim), 0)
447- let $t01293312986 = calcLpUserReward(user)
448- let uReward = $t01293312986._1
449- let newLpInterest = $t01293312986._2
454+ let $t01300913062 = calcLpUserReward(user)
455+ let uReward = $t01300913062._1
456+ let newLpInterest = $t01300913062._2
450457 [IntegerEntry((user + kUserLpInterest), newLpInterest), IntegerEntry((user + kUserLpAvailableClaim), (userAvailableClaim + uReward)), IntegerEntry((user + kLpInterest), newLpInterest), IntegerEntry((user + kLpInterestHeight), height)]
451458 })
452459
475482
476483 @Callable(i)
477484 func updateRewards () = valueOrElse(isOperatorCall(i), {
478- let lastUpdatePeriod = valueOrElse(getInteger(this, kLastUpdatePeriod), 0)
479- let calcPeriod = (((height - startHeight) / periodLength) + 1)
480- let curPeriod = if ((0 >= calcPeriod))
481- then 1
482- else calcPeriod
483- if ((curPeriod > 104))
484- then throw("max period is 104")
485- else if (if ((lastUpdatePeriod >= curPeriod))
486- then (lastUpdatePeriod != 0)
487- else false)
488- then throw("rewards alredy updated in this period")
489- else {
490- let $t01494415024 = getTotalSupplyAllTokens()
491- let totalSupply = $t01494415024._1
492- let totalSupplyUsd = $t01494415024._2
493- let totalSupplyUsdAll = $t01494415024._3
494- let axlyPrice = getAssetPrice(axlyId)
495- let axlyPrecision = getAssetPrecision(axlyId)
496- let maxAPR = getAdoptedAPRByPeriod(curPeriod, LENDERS_APR_PERIODS, LENDERS_APR)
497- func updateReward (a,tokenId) = {
498- let $t01527315317 = a
499- let enteries = $t01527315317._1
500- let totalPeriodReward = $t01527315317._2
501- let index = $t01527315317._3
502- if ((totalSupply[index] == 0))
503- then $Tuple3((enteries ++ [IntegerEntry((tokenId + kPrevLendTokenSupply), totalSupply[index]), IntegerEntry((tokenId + kTokenRewardPerBlock), 0), IntegerEntry((tokenId + kTokenInterest), calcNewTokenInterest(tokenId, totalSupply[index])), IntegerEntry((tokenId + kTokenInterestHeight), max([startHeight, height]))]), totalPeriodReward, (index + 1))
504- else {
505- let share = fraction(totalSupplyUsd[index], SCALE8, totalSupplyUsdAll)
506- let maxReward = fraction(share, lendMaxPeriodAmount, SCALE8)
507- let maxRewardUsd = fraction(maxReward, axlyPrice, axlyPrecision)
508- let prevTotalSupply = valueOrElse(getInteger(this, (tokenId + kPrevLendTokenSupply)), 0)
509- let rtCoef = if (if ((prevTotalSupply == 0))
510- then true
511- else (totalSupply[index] == 0))
512- then 0
513- else (fraction(totalSupply[index], SCALE8, prevTotalSupply) - SCALE8)
514- let reward = ((min([(maxAPR * (SCALE8 + max([rtCoef, 0]))), fraction(maxAPR, (15 * SCALE8), 10)]) / SCALE8) / 100)
515- let rewardUsd = min([maxRewardUsd, fraction(totalSupplyUsd[index], reward, SCALE8)])
516- let rewardPeriod = fraction(rewardUsd, axlyPrecision, axlyPrice)
517- let rewardPerBlock = (rewardPeriod / periodLength)
518- $Tuple3((enteries ++ [IntegerEntry((tokenId + kPrevLendTokenSupply), totalSupply[index]), IntegerEntry((tokenId + kTokenRewardPerBlock), rewardPerBlock), IntegerEntry((tokenId + kTokenInterest), calcNewTokenInterest(tokenId, totalSupply[index])), IntegerEntry((tokenId + kTokenInterestHeight), max([startHeight, height]))]), (totalPeriodReward + rewardPeriod), (index + 1))
519- }
520- }
485+ let lastUpdateHeight = valueOrElse(getInteger(this, kRewardUpdateHeight), 0)
486+ if (((lastUpdateHeight + periodLength) > height))
487+ then throw("rewards alredy updated in this period")
488+ else {
489+ let $t01482914909 = getTotalSupplyAllTokens()
490+ let totalSupply = $t01482914909._1
491+ let totalSupplyUsd = $t01482914909._2
492+ let totalSupplyUsdAll = $t01482914909._3
493+ let axlyPrice = getAssetPrice(axlyId)
494+ let axlyPrecision = getAssetPrecision(axlyId)
495+ let maxAPR = getAdoptedAPRByPeriod(curPeriod, LENDERS_APR_PERIODS, LENDERS_APR)
496+ func updateReward (a,tokenId) = {
497+ let $t01515315178 = a
498+ let enteries = $t01515315178._1
499+ let index = $t01515315178._2
500+ if ((totalSupply[index] == 0))
501+ then $Tuple2((enteries ++ [IntegerEntry((tokenId + kPrevLendTokenSupply), totalSupply[index]), IntegerEntry((tokenId + kTokenRewardPerBlock), 0), IntegerEntry((tokenId + kTokenInterest), calcNewTokenInterest(tokenId, totalSupply[index])), IntegerEntry((tokenId + kTokenInterestHeight), max([startHeight, height]))]), (index + 1))
502+ else {
503+ let share = fraction(totalSupplyUsd[index], SCALE8, totalSupplyUsdAll)
504+ let maxReward = fraction(share, lendMaxPeriodAmount, SCALE8)
505+ let maxRewardUsd = fraction(maxReward, axlyPrice, axlyPrecision)
506+ let prevTotalSupply = valueOrElse(getInteger(this, kPrevLendTokenSupply), 0)
507+ let rtCoef = if (if ((prevTotalSupply == 0))
508+ then true
509+ else (totalSupply[index] == 0))
510+ then 0
511+ else fraction(prevTotalSupply, SCALE8, totalSupply[index])
512+ let reward = (min([(maxAPR * (SCALE8 + rtCoef)), fraction(maxAPR, (15 * SCALE8), 10)]) / SCALE8)
513+ let rewardUsd = min([maxRewardUsd, fraction(totalSupplyUsd[index], reward, SCALE8)])
514+ let rewardPeriod = fraction(rewardUsd, axlyPrecision, axlyPrice)
515+ let rewardPerBlock = (rewardPeriod / periodLength)
516+ $Tuple2((enteries ++ [IntegerEntry((tokenId + kPrevLendTokenSupply), totalSupply[index]), IntegerEntry((tokenId + kTokenRewardPerBlock), rewardPerBlock), IntegerEntry((tokenId + kTokenInterest), calcNewTokenInterest(tokenId, totalSupply[index])), IntegerEntry((tokenId + kTokenInterestHeight), max([startHeight, height]))]), (index + 1))
517+ }
518+ }
521519
522- let $t01700917101 = {
523- let $l = getAllTokens()
524- let $s = size($l)
525- let $acc0 = $Tuple3(nil, 0, 0)
526- func $f0_1 ($a,$i) = if (($i >= $s))
527- then $a
528- else updateReward($a, $l[$i])
520+ let $t01676516842 = {
521+ let $l = getAllTokens()
522+ let $s = size($l)
523+ let $acc0 = $Tuple2(nil, 0)
524+ func $f0_1 ($a,$i) = if (($i >= $s))
525+ then $a
526+ else updateReward($a, $l[$i])
529527
530- func $f0_2 ($a,$i) = if (($i >= $s))
531- then $a
532- else throw("List size exceeds 30")
528+ func $f0_2 ($a,$i) = if (($i >= $s))
529+ then $a
530+ else throw("List size exceeds 30")
533531
534- $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($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)
535- }
536- let tokensEnteries = $t01700917101._1
537- let totalTokenReward = $t01700917101._2
538- let lpMaxAPR = getAdoptedAPRByPeriod(curPeriod, LP_APR_PERIODS, LP_APR)
539- let lpTotalSupply = getIntegerValue(sfFarmingContract, (axlyPool + kSFTotalSupply))
540- let preLPSupply = valueOrElse(getInteger(this, kPrevLPSupply), 0)
541- let lpId = getStringValue(addressFromStringValue(axlyPool), kLpId)
542- let lpPrecision = getAssetPrecision(lpId)
543- let lpPrice = {
544- let @ = invoke(mainContract, "getShareAssetPriceREADONLY", [lpId], nil)
545- if ($isInstanceOf(@, "Int"))
546- then @
547- else throw(($getType(@) + " couldn't be cast to Int"))
548- }
549- let lpTotalSupplyUsd = fraction(lpTotalSupply, lpPrice, lpPrecision)
550- let maxLPRewardUsd = fraction(lpMaxPeriodAmount, axlyPrice, axlyPrecision)
551- let rtLPCoef = if (if ((preLPSupply == 0))
552- then true
553- else (lpTotalSupply == 0))
554- then 0
555- else (fraction(lpTotalSupply, SCALE8, preLPSupply) - SCALE8)
556- let rewardLp = ((min([(lpMaxAPR * (SCALE8 + max([rtLPCoef, 0]))), fraction(lpMaxAPR, (15 * SCALE8), 10)]) / SCALE8) / 100)
557- let rewardLpUsd = min([maxLPRewardUsd, fraction(lpTotalSupplyUsd, rewardLp, SCALE8)])
558- let rewardLpPeriod = fraction(rewardLpUsd, axlyPrecision, axlyPrice)
559- let rewardLpPerBlock = (rewardLpPeriod / periodLength)
560- let burnLend = (lendMaxPeriodAmount - totalTokenReward)
561- let burnLp = (lpMaxPeriodAmount - rewardLpPeriod)
562- let inv = invoke(tokenContract, "withdrawLpReward", [(burnLend + burnLp), toString(this)], nil)
563- if ((inv == inv))
564- then {
565- let lpEnteries = if ((12 >= curPeriod))
566- then [IntegerEntry(kPrevLPSupply, lpTotalSupply), IntegerEntry(kLpRewardPerBlock, rewardLpPerBlock), IntegerEntry(kLpInterest, calcNewLpInterest(lpTotalSupply)), IntegerEntry(kLpInterestHeight, max([startHeight, height])), ScriptTransfer(Address(base58'3MsXJ3BesPECkYejzBQGHZPJT8GVYy4Fd3Q'), burnLend, fromBase58String(axlyId)), ScriptTransfer(Address(base58'3MsXJ3BesPECkYejzBQGHZPJT8GVYy4Fd3Q'), burnLp, fromBase58String(axlyId))]
567- else nil
568- ((lpEnteries ++ tokensEnteries) :+ IntegerEntry(kLastUpdatePeriod, curPeriod))
569- }
570- else throw("Strict value is not equal to itself.")
532+ $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($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)
571533 }
534+ let tokensEnteries = $t01676516842._1
535+ let index = $t01676516842._2
536+ let lpMaxAPR = getAdoptedAPRByPeriod(curPeriod, LP_APR_PERIODS, LP_APR)
537+ let lpTotalSupply = getIntegerValue(sfFarmingContract, (axlyPool + kSFTotalSupply))
538+ let preLPSupply = valueOrElse(getInteger(this, kPrevLPSupply), 0)
539+ let lpId = getStringValue(addressFromStringValue(axlyPool), kLpId)
540+ let lpPrecision = getAssetPrecision(lpId)
541+ let lpPrice = {
542+ let @ = invoke(mainContract, "getShareAssetPriceREADONLY", [lpId], nil)
543+ if ($isInstanceOf(@, "Int"))
544+ then @
545+ else throw(($getType(@) + " couldn't be cast to Int"))
546+ }
547+ let lpTotalSupplyUsd = fraction(lpTotalSupply, lpPrice, lpPrecision)
548+ let maxLPRewardUsd = fraction(lpMaxPeriodAmount, axlyPrice, axlyPrecision)
549+ let rtLPCoef = if (if ((preLPSupply == 0))
550+ then true
551+ else (lpTotalSupply == 0))
552+ then 0
553+ else fraction(preLPSupply, SCALE8, lpTotalSupply)
554+ let rewardLp = (min([(lpMaxAPR * (SCALE8 + rtLPCoef)), fraction(lpMaxAPR, (15 * SCALE8), 10)]) / SCALE8)
555+ let rewardLpUsd = min([maxLPRewardUsd, fraction(lpTotalSupplyUsd, rewardLp, SCALE8)])
556+ let rewardLpPeriod = fraction(rewardLpUsd, axlyPrice, axlyPrecision)
557+ let rewardLpPerBlock = (rewardLpPeriod / periodLength)
558+ let lpEnteries = [IntegerEntry(kPrevLPSupply, lpTotalSupply), IntegerEntry(kLpRewardPerBlock, rewardLpPerBlock), IntegerEntry(kLpInterest, calcNewLpInterest(lpTotalSupply)), IntegerEntry(kLpInterestHeight, max([startHeight, height]))]
559+ ((lpEnteries ++ tokensEnteries) :+ IntegerEntry(kRewardUpdateHeight, max([startHeight, height])))
560+ }
572561 })
573562
574563
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SCALE8 = 100000000
55
66 let LENDERS_APR = [150, 120, 100, 80, 60, 40, 30, 20, 10]
77
8-let LENDERS_APR_PERIODS = ["1-1", "2-2", "3-3", "4-4", "5-8", "9-12", "14-16", "17-20", "20-104"]
8+let LENDERS_APR_PERIODS = ["1-1", "2-2", "3-3", "4-4", "5-8", "9-12", "14 - 16", "17-20", "20-104"]
99
1010 let LENDERS_MAX_PERIODS = 104
1111
1212 let LP_APR = [150, 120, 100, 80, 60, 40]
1313
1414 let LP_APR_PERIODS = ["1-1", "2-2", "3-3", "4-4", "5-8", "9-12"]
1515
1616 let LP_MAX_PERIODS = 12
1717
1818 let kStartHeight = "startHeight"
1919
2020 let kPeriodLength = "periodLength"
2121
2222 let kLendersMaxAmount = "lendRewardsAmount"
2323
2424 let kLPMaxAmount = "lpRewardAmount"
2525
2626 let kTokens = "tokens"
2727
2828 let kUserSupply = "_userTotalSupply"
2929
3030 let kTokenInterest = "_tokenInterest"
3131
3232 let kTokenInterestHeight = "_tokenInterestHeight"
3333
3434 let kTokenRewardPerBlock = "_tokenRewardPerBlock"
3535
36-let kLastUpdatePeriod = "rewardUpdatePeriod"
36+let kRewardUpdateHeight = "rewardUpdateHeight"
3737
3838 let kUserLendInterest = "_userLandInterest"
3939
4040 let kUserLendAvailableClaim = "_userLendAvailableClaim"
4141
4242 let kUserLpAvailableClaim = "_userLpAvailableClaim"
4343
4444 let kLpInterest = "lpInterest"
4545
4646 let kLpInterestHeight = "lpInterestHeight"
4747
4848 let kPrevLPSupply = "prevLPTotalSupply"
4949
5050 let kLpRewardPerBlock = "lpRewardPerBlock"
5151
5252 let kUserLpInterest = "_userLpInterest"
5353
5454 let kPriceInOracle = "_twap5B"
5555
5656 let kPrevLendTokenSupply = "_prevLendTotalSupply"
5757
5858 let kAXLYTokenId = "axlyTokenId"
5959
6060 let kLendTokenSupply = "total_supplied_"
6161
6262 let kLendUserSupply = "_supplied_"
6363
6464 let kLendSetupTokens = "setup_tokens"
6565
6666 let kSFTotalSupply = "_total_share_tokens_locked"
6767
6868 let kSFUserTotalSupply = "_share_tokens_locked"
6969
7070 let kAxlyPool = "axlyPool"
7171
7272 let kLpId = "share_asset_id"
7373
7474 let kPriceOracle = "price_oracle"
7575
7676 let kAxlyMainContract = "mainContract"
7777
7878 let kAxlyTokenomicContract = "tokenomicContract"
7979
8080 let kSFFarmingContract = "swopfi_farming_addr"
8181
8282 let kLendContract = "lend_service_addr"
8383
8484 let kAdmin1PK = "group1_admin1_pub_key"
8585
8686 let kAdmin2PK = "group1_admin2_pub_key"
8787
8888 let kAdmin3PK = "group1_admin3_pub_key"
8989
9090 let kOperatorCallPK = "admin_call_pub_key"
9191
9292 let axlyPool = valueOrErrorMessage(getString(this, kAxlyPool), "Can't get axlyPool key")
9393
9494 let mainContract = addressFromStringValue(valueOrErrorMessage(getString(this, kAxlyMainContract), "Can't get mainContact key"))
9595
9696 let tokenContract = addressFromStringValue(valueOrErrorMessage(getString(this, kAxlyTokenomicContract), "Can't get tokenomicContract key"))
9797
9898 let lendContract = addressFromStringValue(valueOrErrorMessage(getString(mainContract, kLendContract), "Can't get lend_service_addr key"))
9999
100100 let sfFarmingContract = addressFromStringValue(valueOrErrorMessage(getString(mainContract, kSFFarmingContract), "Can't get swopfi_farming_addr key"))
101101
102102 let priceOracleAddr = addressFromStringValue(valueOrErrorMessage(getString(mainContract, kPriceOracle), "Can't get price_oracle key"))
103103
104104 let admin1PK = fromBase58String(valueOrErrorMessage(getString(mainContract, kAdmin1PK), "Can't get admin1PK"))
105105
106106 let admin2PK = fromBase58String(valueOrErrorMessage(getString(mainContract, kAdmin2PK), "Can't get admin2PK"))
107107
108108 let admin3PK = fromBase58String(valueOrErrorMessage(getString(mainContract, kAdmin3PK), "Can't get operatorPK"))
109109
110110 let operatorPK = fromBase58String(valueOrErrorMessage(getString(this, kOperatorCallPK), "Can't get operatorPK"))
111111
112112 let axlyId = valueOrErrorMessage(getString(tokenContract, kAXLYTokenId), "Can't get Axly token id")
113113
114114 let startHeight = getIntegerValue(this, kStartHeight)
115115
116116 let periodLength = getIntegerValue(this, kPeriodLength)
117117
118+let curPeriod = ((height - startHeight) / periodLength)
119+
118120 let lendMaxAmount = getIntegerValue(tokenContract, kLendersMaxAmount)
119121
120122 let lendMaxPeriodAmount = (lendMaxAmount / LENDERS_MAX_PERIODS)
121123
122124 let lpMaxAmount = getIntegerValue(tokenContract, kLPMaxAmount)
123125
124126 let lpMaxPeriodAmount = (lpMaxAmount / LP_MAX_PERIODS)
125127
126128 func isAdminCall (i) = if (containsElement([admin1PK, admin2PK, admin3PK], i.callerPublicKey))
127129 then unit
128130 else throw("Only admin group1 can call this function")
129131
130132
131133 func isSelfCall (i) = if ((i.caller == this))
132134 then unit
133135 else throw("Only contract itself can call this function")
134136
135137
136138 func isOperatorCall (i) = if ((i.callerPublicKey == operatorPK))
137139 then unit
138140 else throw("Only operator can call this function")
139141
140142
141143 func isLandCall (i) = if ((i.caller == lendContract))
142144 then unit
143145 else throw("Only land contract can call this function")
144146
145147
146148 func isSFFarmingCall (i) = if ((i.caller == sfFarmingContract))
147149 then unit
148150 else throw("Only land contract can call this function")
149151
150152
151153 func getAllTokens () = {
152154 let tokens = valueOrElse(getString(this, kTokens), "")
153155 if ((tokens == ""))
154156 then nil
155157 else split(tokens, ",")
156158 }
157159
158160
159161 func getAssetPrice (assetId) = getIntegerValue(priceOracleAddr, (assetId + kPriceInOracle))
160162
161163
162164 func getAssetDecimals (assetId) = if ((assetId == "WAVES"))
163165 then 8
164166 else match assetInfo(fromBase58String(assetId)) {
165167 case asset: Asset =>
166168 asset.decimals
167169 case _ =>
168170 throw("Can't find asset")
169171 }
170172
171173
172174 func getAssetPrecision (assetId) = pow(10, 0, getAssetDecimals(assetId), 0, 0, DOWN)
173175
174176
175177 func getAdoptedAPRByPeriod (period,aprPeriods,apr) = {
176178 func for (a,aperiod) = {
177- let $t053625384 = a
178- let index = $t053625384._1
179- let found = $t053625384._2
179+ let $t054205442 = a
180+ let index = $t054205442._1
181+ let found = $t054205442._2
180182 let ft = split(aperiod, "-")
181- let $t054215484 = $Tuple2(parseIntValue(ft[0]), parseIntValue(ft[1]))
182- let from = $t054215484._1
183- let to = $t054215484._2
183+ let $t054795542 = $Tuple2(parseIntValue(ft[0]), parseIntValue(ft[1]))
184+ let from = $t054795542._1
185+ let to = $t054795542._2
184186 if (found)
185187 then a
186188 else if (if ((period >= from))
187189 then (to >= period)
188190 else false)
189191 then $Tuple2(index, true)
190192 else $Tuple2((index + 1), false)
191193 }
192194
193- let $t056215687 = {
195+ let $t056795745 = {
194196 let $l = LENDERS_APR_PERIODS
195197 let $s = size($l)
196198 let $acc0 = $Tuple2(0, false)
197199 func $f0_1 ($a,$i) = if (($i >= $s))
198200 then $a
199201 else for($a, $l[$i])
200202
201203 func $f0_2 ($a,$i) = if (($i >= $s))
202204 then $a
203205 else throw("List size exceeds 9")
204206
205207 $f0_2($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)
206208 }
207- let index = $t056215687._1
208- let found = $t056215687._2
209+ let index = $t056795745._1
210+ let found = $t056795745._2
209211 if (found)
210212 then fraction((LENDERS_APR[index] * SCALE8), 7, 365)
211213 else 0
212214 }
213215
214216
215217 func getTotalSupplyAllTokens () = {
216218 func for (a,tokenId) = {
217- let $t058755931 = a
218- let totalSupply = $t058755931._1
219- let totalSupplyUsd = $t058755931._2
220- let totalSupplyUsdAll = $t058755931._3
219+ let $t059335989 = a
220+ let totalSupply = $t059335989._1
221+ let totalSupplyUsd = $t059335989._2
222+ let totalSupplyUsdAll = $t059335989._3
221223 let tSupply = valueOrElse(getInteger(lendContract, (kLendTokenSupply + tokenId)), 0)
222224 let assetPrice = getAssetPrice(tokenId)
223225 let assetPrecision = getAssetPrecision(tokenId)
224226 let tSupplyUsd = fraction(tSupply, assetPrice, assetPrecision)
225227 $Tuple3((totalSupply :+ tSupply), (totalSupplyUsd :+ tSupplyUsd), (totalSupplyUsdAll + tSupplyUsd))
226228 }
227229
228230 let $l = getAllTokens()
229231 let $s = size($l)
230232 let $acc0 = $Tuple3(nil, nil, 0)
231233 func $f0_1 ($a,$i) = if (($i >= $s))
232234 then $a
233235 else for($a, $l[$i])
234236
235237 func $f0_2 ($a,$i) = if (($i >= $s))
236238 then $a
237239 else throw("List size exceeds 30")
238240
239241 $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($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)
240242 }
241243
242244
243245 func getTotalSupplyUsd (tokenId) = {
244246 let tSupply = valueOrElse(getInteger(lendContract, (kLendTokenSupply + tokenId)), 0)
245247 let assetPrice = getAssetPrice(tokenId)
246248 let assetPrecision = getAssetPrecision(tokenId)
247249 fraction(tSupply, assetPrice, assetPrecision)
248250 }
249251
250252
251-func calcNewTokenInterest (tokenId,totalSupply) = if ((startHeight >= height))
253+func calcNewTokenInterest (tokenId,totalSupply) = if ((height >= startHeight))
252254 then 0
253255 else {
254256 let rewardPerBlock = getIntegerValue(this, (tokenId + kTokenRewardPerBlock))
255257 let oldInterest = getIntegerValue(this, (tokenId + kTokenInterest))
256258 let updateHeight = getIntegerValue(this, (tokenId + kTokenInterestHeight))
257259 let reward = ((height - updateHeight) * rewardPerBlock)
258260 let interest = if ((totalSupply > 0))
259261 then fraction(reward, SCALE8, totalSupply)
260262 else 0
261263 (oldInterest + interest)
262264 }
263265
264266
265-func calcNewLpInterest (totalSupply) = if ((startHeight >= height))
267+func calcNewLpInterest (totalSupply) = if ((height >= startHeight))
266268 then 0
267269 else {
268270 let rewardPerBlock = valueOrElse(getInteger(this, kLpRewardPerBlock), 0)
269271 let oldInterest = valueOrElse(getInteger(this, kLpInterest), 0)
270272 let updateHeight = valueOrElse(getInteger(this, kLpInterestHeight), height)
271273 let reward = ((height - updateHeight) * rewardPerBlock)
272274 let interest = if ((totalSupply > 0))
273275 then fraction(reward, SCALE8, totalSupply)
274276 else 0
275277 (oldInterest + interest)
276278 }
277279
278280
279281 func calcLendUserReward (user,tokenId) = {
280282 let totalSupply = valueOrElse(getInteger(lendContract, (kLendTokenSupply + tokenId)), 0)
281283 let tokenInterest = calcNewTokenInterest(tokenId, totalSupply)
282284 let userSupply = valueOrElse(getInteger(lendContract, ((user + kLendUserSupply) + tokenId)), 0)
283285 let userTokenInterest = valueOrElse(getInteger(this, (((tokenId + "_") + user) + kUserLendInterest)), if ((userSupply == 0))
284286 then tokenInterest
285287 else 0)
286288 let reward = fraction(userSupply, (tokenInterest - userTokenInterest), SCALE8)
287289 $Tuple3(reward, tokenInterest, userSupply)
288290 }
289291
290292
291293 func calcLpUserReward (user) = {
292294 let totalSupply = valueOrElse(getInteger(sfFarmingContract, (axlyPool + kSFTotalSupply)), 0)
293295 let tokenInterest = calcNewLpInterest(totalSupply)
294- let userSupply = valueOrElse(getInteger(sfFarmingContract, (((axlyPool + "_") + user) + kSFUserTotalSupply)), 0)
296+ let userSupply = valueOrElse(getInteger(lendContract, (((axlyPool + "_") + user) + kSFUserTotalSupply)), 0)
295297 let userTokenInterest = valueOrElse(getInteger(this, (user + kUserLpInterest)), if ((userSupply == 0))
296298 then tokenInterest
297299 else 0)
298300 let reward = fraction(userSupply, (tokenInterest - userTokenInterest), SCALE8)
299301 $Tuple3(reward, tokenInterest, userSupply)
300302 }
301303
302304
303305 func claimLenderRewardsCommon (user,readOnly) = {
304306 func claim (a,tokenId) = {
305- let $t088208864 = a
306- let tokenIds = $t088208864._1
307- let cAmount = $t088208864._2
308- let total = $t088208864._3
309- let enteries = $t088208864._4
307+ let $t088738917 = a
308+ let tokenIds = $t088738917._1
309+ let cAmount = $t088738917._2
310+ let total = $t088738917._3
311+ let enteries = $t088738917._4
310312 let userAvailableClaim = valueOrElse(getInteger(this, (((tokenId + "_") + user) + kUserLendAvailableClaim)), 0)
311- let $t089779056 = calcLendUserReward(user, tokenId)
312- let uReward = $t089779056._1
313- let newTokenInterest = $t089779056._2
314- let userSupply = $t089779056._3
313+ let $t090309109 = calcLendUserReward(user, tokenId)
314+ let uReward = $t090309109._1
315+ let newTokenInterest = $t090309109._2
316+ let userSupply = $t090309109._3
315317 let totalToClaim = (userAvailableClaim + uReward)
316318 if (if ((totalToClaim > 0))
317319 then true
318320 else (userSupply > 0))
319321 then {
320322 let newEntreries = if (if (readOnly)
321323 then true
322324 else (totalToClaim == 0))
323325 then enteries
324326 else (enteries ++ [IntegerEntry((((tokenId + "_") + user) + kUserLendInterest), newTokenInterest), IntegerEntry((((tokenId + "_") + user) + kUserLendAvailableClaim), 0), IntegerEntry((tokenId + kTokenInterest), newTokenInterest), IntegerEntry((tokenId + kTokenInterestHeight), height)])
325327 $Tuple4((tokenIds :+ tokenId), (cAmount :+ totalToClaim), (total + totalToClaim), newEntreries)
326328 }
327329 else $Tuple4(tokenIds, cAmount, total, enteries)
328330 }
329331
330332 let $l = getAllTokens()
331333 let $s = size($l)
332334 let $acc0 = $Tuple4(nil, nil, 0, nil)
333335 func $f0_1 ($a,$i) = if (($i >= $s))
334336 then $a
335337 else claim($a, $l[$i])
336338
337339 func $f0_2 ($a,$i) = if (($i >= $s))
338340 then $a
339341 else throw("List size exceeds 30")
340342
341343 $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($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)
342344 }
343345
344346
345347 func claimLpRewardsCommon (user,readOnly) = {
346348 let userAvailableClaim = valueOrElse(getInteger(this, (user + kUserLpAvailableClaim)), 0)
347- let $t0998810053 = calcLpUserReward(user)
348- let uReward = $t0998810053._1
349- let newLpInterest = $t0998810053._2
350- let userSupply = $t0998810053._3
349+ let $t01004110106 = calcLpUserReward(user)
350+ let uReward = $t01004110106._1
351+ let newLpInterest = $t01004110106._2
352+ let userSupply = $t01004110106._3
351353 let totalToClaim = (userAvailableClaim + uReward)
352354 if (if (readOnly)
353355 then true
354356 else (totalToClaim == 0))
355357 then $Tuple2(totalToClaim, nil)
356358 else $Tuple2(totalToClaim, [IntegerEntry((user + kUserLpInterest), newLpInterest), IntegerEntry((user + kUserLpAvailableClaim), 0), IntegerEntry(kLpInterest, newLpInterest), IntegerEntry(kLpInterestHeight, height)])
357359 }
358360
359361
360362 func getTokensAPRs () = {
361363 let axlyPrice = getAssetPrice(axlyId)
362364 let axlyPrecision = getAssetPrecision(axlyId)
363365 func tokensAprs (apr,tokenId) = {
364366 let rwpb = valueOrElse(getInteger(this, (tokenId + kTokenRewardPerBlock)), 0)
365367 let rwpbUsd = fraction(rwpb, axlyPrice, axlyPrecision)
366368 let rwYear = ((rwpbUsd * periodLength) * 52)
367369 let totalSupplyUsd = getTotalSupplyUsd(tokenId)
368370 (apr :+ fraction(rwYear, SCALE8, totalSupplyUsd))
369371 }
370372
371373 let aprs = {
372374 let $l = getAllTokens()
373375 let $s = size($l)
374376 let $acc0 = nil
375377 func $f0_1 ($a,$i) = if (($i >= $s))
376378 then $a
377379 else tokensAprs($a, $l[$i])
378380
379381 func $f0_2 ($a,$i) = if (($i >= $s))
380382 then $a
381383 else throw("List size exceeds 30")
382384
383385 $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($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)
384386 }
385387 let lpTotalSupply = getIntegerValue(sfFarmingContract, (axlyPool + kSFTotalSupply))
386388 let lpId = getStringValue(addressFromStringValue(axlyPool), kLpId)
387389 let lpPrecision = getAssetPrecision(lpId)
388390 let lpPrice = {
389- let @ = invoke(mainContract, "getShareAssetPriceREADONLY", [lpId], nil)
391+ let @ = ({
392+ let @ = invoke(mainContract, "getShareAssetPriceREADONLY", [[lpId]], nil)
393+ if ($isInstanceOf(@, "List[Any]"))
394+ then @
395+ else throw(($getType(@) + " couldn't be cast to List[Any]"))
396+ })[0]
390397 if ($isInstanceOf(@, "Int"))
391398 then @
392399 else throw(($getType(@) + " couldn't be cast to Int"))
393400 }
394401 let lpTotalSupplyUsd = fraction(lpTotalSupply, lpPrice, lpPrecision)
395402 let rwpb = valueOrElse(getInteger(this, kLpRewardPerBlock), 0)
396403 let rwpbUsd = fraction(rwpb, axlyPrice, axlyPrecision)
397404 let rwYear = ((rwpbUsd * periodLength) * 52)
398405 let lpApr = fraction(rwYear, SCALE8, lpTotalSupplyUsd)
399406 $Tuple3(getAllTokens(), aprs, lpApr)
400407 }
401408
402409
403410 @Callable(i)
404411 func claimLenderRewards () = {
405412 let claimRes = claimLenderRewardsCommon(toString(i.caller), false)
406413 if ((claimRes._3 == 0))
407414 then throw("claim amount must be greater than 0")
408415 else {
409416 let inv = invoke(tokenContract, "withdrawLendReward", [claimRes._3, toString(i.caller)], nil)
410417 if ((inv == inv))
411418 then claimRes._4
412419 else throw("Strict value is not equal to itself.")
413420 }
414421 }
415422
416423
417424
418425 @Callable(i)
419426 func claimLpRewards () = {
420427 let claimRes = claimLpRewardsCommon(toString(i.caller), false)
421428 if ((claimRes._1 == 0))
422429 then throw("claim amount must be greater than 0")
423430 else {
424431 let inv = invoke(tokenContract, "withdrawLpReward", [claimRes._1, toString(i.caller)], nil)
425432 if ((inv == inv))
426433 then claimRes._2
427434 else throw("Strict value is not equal to itself.")
428435 }
429436 }
430437
431438
432439
433440 @Callable(i)
434441 func lendAction (user,tokenId) = valueOrElse(isLandCall(i), {
435442 let userAvailableClaim = valueOrElse(getInteger(this, (tokenId + kUserLendAvailableClaim)), 0)
436- let $t01240112468 = calcLendUserReward(user, tokenId)
437- let uReward = $t01240112468._1
438- let newTokenInterest = $t01240112468._2
439-[IntegerEntry((((user + "_") + tokenId) + kUserLendInterest), newTokenInterest), IntegerEntry((((user + "_") + tokenId) + kUserLendAvailableClaim), (userAvailableClaim + uReward)), IntegerEntry((tokenId + kTokenInterest), newTokenInterest), IntegerEntry((tokenId + kTokenInterestHeight), height)]
443+ let $t01247712544 = calcLendUserReward(user, tokenId)
444+ let uReward = $t01247712544._1
445+ let newTokenInterest = $t01247712544._2
446+[IntegerEntry((((tokenId + "_") + user) + kUserLendInterest), newTokenInterest), IntegerEntry((((tokenId + "_") + user) + kUserLendAvailableClaim), (userAvailableClaim + uReward)), IntegerEntry((tokenId + kTokenInterest), newTokenInterest), IntegerEntry((tokenId + kTokenInterestHeight), height)]
440447 })
441448
442449
443450
444451 @Callable(i)
445452 func lpAction (user) = valueOrElse(isSFFarmingCall(i), {
446453 let userAvailableClaim = valueOrElse(getInteger(this, kUserLpAvailableClaim), 0)
447- let $t01293312986 = calcLpUserReward(user)
448- let uReward = $t01293312986._1
449- let newLpInterest = $t01293312986._2
454+ let $t01300913062 = calcLpUserReward(user)
455+ let uReward = $t01300913062._1
456+ let newLpInterest = $t01300913062._2
450457 [IntegerEntry((user + kUserLpInterest), newLpInterest), IntegerEntry((user + kUserLpAvailableClaim), (userAvailableClaim + uReward)), IntegerEntry((user + kLpInterest), newLpInterest), IntegerEntry((user + kLpInterestHeight), height)]
451458 })
452459
453460
454461
455462 @Callable(i)
456463 func init (axlyMainContractAddr,axlyTokenomicContractAddr,axlyPoolAddr,farmingStartHeight,periodLength) = valueOrElse(isSelfCall(i), if (!(isDefined(addressFromString(axlyMainContractAddr))))
457464 then throw("Wrong farming address")
458465 else if (!(isDefined(addressFromString(axlyTokenomicContractAddr))))
459466 then throw("Wrong main contract address")
460467 else [StringEntry(kAxlyMainContract, axlyMainContractAddr), StringEntry(kAxlyTokenomicContract, axlyTokenomicContractAddr), StringEntry(kAxlyPool, axlyPoolAddr), IntegerEntry(kStartHeight, farmingStartHeight), IntegerEntry(kPeriodLength, periodLength)])
461468
462469
463470
464471 @Callable(i)
465472 func initNewToken (tokenId) = valueOrElse(isAdminCall(i), if (isDefined(getInteger(this, (tokenId + kTokenInterest))))
466473 then throw("token already inited")
467474 else if (!(contains(getStringValue(lendContract, kLendSetupTokens), tokenId)))
468475 then throw("no token on landing")
469476 else {
470477 let newAllTokens = (getAllTokens() :+ tokenId)
471478 [IntegerEntry((tokenId + kTokenInterest), 0), IntegerEntry((tokenId + kTokenInterestHeight), max([startHeight, height])), StringEntry(kTokens, makeString(newAllTokens, ",")), IntegerEntry((tokenId + kTokenRewardPerBlock), 0)]
472479 })
473480
474481
475482
476483 @Callable(i)
477484 func updateRewards () = valueOrElse(isOperatorCall(i), {
478- let lastUpdatePeriod = valueOrElse(getInteger(this, kLastUpdatePeriod), 0)
479- let calcPeriod = (((height - startHeight) / periodLength) + 1)
480- let curPeriod = if ((0 >= calcPeriod))
481- then 1
482- else calcPeriod
483- if ((curPeriod > 104))
484- then throw("max period is 104")
485- else if (if ((lastUpdatePeriod >= curPeriod))
486- then (lastUpdatePeriod != 0)
487- else false)
488- then throw("rewards alredy updated in this period")
489- else {
490- let $t01494415024 = getTotalSupplyAllTokens()
491- let totalSupply = $t01494415024._1
492- let totalSupplyUsd = $t01494415024._2
493- let totalSupplyUsdAll = $t01494415024._3
494- let axlyPrice = getAssetPrice(axlyId)
495- let axlyPrecision = getAssetPrecision(axlyId)
496- let maxAPR = getAdoptedAPRByPeriod(curPeriod, LENDERS_APR_PERIODS, LENDERS_APR)
497- func updateReward (a,tokenId) = {
498- let $t01527315317 = a
499- let enteries = $t01527315317._1
500- let totalPeriodReward = $t01527315317._2
501- let index = $t01527315317._3
502- if ((totalSupply[index] == 0))
503- then $Tuple3((enteries ++ [IntegerEntry((tokenId + kPrevLendTokenSupply), totalSupply[index]), IntegerEntry((tokenId + kTokenRewardPerBlock), 0), IntegerEntry((tokenId + kTokenInterest), calcNewTokenInterest(tokenId, totalSupply[index])), IntegerEntry((tokenId + kTokenInterestHeight), max([startHeight, height]))]), totalPeriodReward, (index + 1))
504- else {
505- let share = fraction(totalSupplyUsd[index], SCALE8, totalSupplyUsdAll)
506- let maxReward = fraction(share, lendMaxPeriodAmount, SCALE8)
507- let maxRewardUsd = fraction(maxReward, axlyPrice, axlyPrecision)
508- let prevTotalSupply = valueOrElse(getInteger(this, (tokenId + kPrevLendTokenSupply)), 0)
509- let rtCoef = if (if ((prevTotalSupply == 0))
510- then true
511- else (totalSupply[index] == 0))
512- then 0
513- else (fraction(totalSupply[index], SCALE8, prevTotalSupply) - SCALE8)
514- let reward = ((min([(maxAPR * (SCALE8 + max([rtCoef, 0]))), fraction(maxAPR, (15 * SCALE8), 10)]) / SCALE8) / 100)
515- let rewardUsd = min([maxRewardUsd, fraction(totalSupplyUsd[index], reward, SCALE8)])
516- let rewardPeriod = fraction(rewardUsd, axlyPrecision, axlyPrice)
517- let rewardPerBlock = (rewardPeriod / periodLength)
518- $Tuple3((enteries ++ [IntegerEntry((tokenId + kPrevLendTokenSupply), totalSupply[index]), IntegerEntry((tokenId + kTokenRewardPerBlock), rewardPerBlock), IntegerEntry((tokenId + kTokenInterest), calcNewTokenInterest(tokenId, totalSupply[index])), IntegerEntry((tokenId + kTokenInterestHeight), max([startHeight, height]))]), (totalPeriodReward + rewardPeriod), (index + 1))
519- }
520- }
485+ let lastUpdateHeight = valueOrElse(getInteger(this, kRewardUpdateHeight), 0)
486+ if (((lastUpdateHeight + periodLength) > height))
487+ then throw("rewards alredy updated in this period")
488+ else {
489+ let $t01482914909 = getTotalSupplyAllTokens()
490+ let totalSupply = $t01482914909._1
491+ let totalSupplyUsd = $t01482914909._2
492+ let totalSupplyUsdAll = $t01482914909._3
493+ let axlyPrice = getAssetPrice(axlyId)
494+ let axlyPrecision = getAssetPrecision(axlyId)
495+ let maxAPR = getAdoptedAPRByPeriod(curPeriod, LENDERS_APR_PERIODS, LENDERS_APR)
496+ func updateReward (a,tokenId) = {
497+ let $t01515315178 = a
498+ let enteries = $t01515315178._1
499+ let index = $t01515315178._2
500+ if ((totalSupply[index] == 0))
501+ then $Tuple2((enteries ++ [IntegerEntry((tokenId + kPrevLendTokenSupply), totalSupply[index]), IntegerEntry((tokenId + kTokenRewardPerBlock), 0), IntegerEntry((tokenId + kTokenInterest), calcNewTokenInterest(tokenId, totalSupply[index])), IntegerEntry((tokenId + kTokenInterestHeight), max([startHeight, height]))]), (index + 1))
502+ else {
503+ let share = fraction(totalSupplyUsd[index], SCALE8, totalSupplyUsdAll)
504+ let maxReward = fraction(share, lendMaxPeriodAmount, SCALE8)
505+ let maxRewardUsd = fraction(maxReward, axlyPrice, axlyPrecision)
506+ let prevTotalSupply = valueOrElse(getInteger(this, kPrevLendTokenSupply), 0)
507+ let rtCoef = if (if ((prevTotalSupply == 0))
508+ then true
509+ else (totalSupply[index] == 0))
510+ then 0
511+ else fraction(prevTotalSupply, SCALE8, totalSupply[index])
512+ let reward = (min([(maxAPR * (SCALE8 + rtCoef)), fraction(maxAPR, (15 * SCALE8), 10)]) / SCALE8)
513+ let rewardUsd = min([maxRewardUsd, fraction(totalSupplyUsd[index], reward, SCALE8)])
514+ let rewardPeriod = fraction(rewardUsd, axlyPrecision, axlyPrice)
515+ let rewardPerBlock = (rewardPeriod / periodLength)
516+ $Tuple2((enteries ++ [IntegerEntry((tokenId + kPrevLendTokenSupply), totalSupply[index]), IntegerEntry((tokenId + kTokenRewardPerBlock), rewardPerBlock), IntegerEntry((tokenId + kTokenInterest), calcNewTokenInterest(tokenId, totalSupply[index])), IntegerEntry((tokenId + kTokenInterestHeight), max([startHeight, height]))]), (index + 1))
517+ }
518+ }
521519
522- let $t01700917101 = {
523- let $l = getAllTokens()
524- let $s = size($l)
525- let $acc0 = $Tuple3(nil, 0, 0)
526- func $f0_1 ($a,$i) = if (($i >= $s))
527- then $a
528- else updateReward($a, $l[$i])
520+ let $t01676516842 = {
521+ let $l = getAllTokens()
522+ let $s = size($l)
523+ let $acc0 = $Tuple2(nil, 0)
524+ func $f0_1 ($a,$i) = if (($i >= $s))
525+ then $a
526+ else updateReward($a, $l[$i])
529527
530- func $f0_2 ($a,$i) = if (($i >= $s))
531- then $a
532- else throw("List size exceeds 30")
528+ func $f0_2 ($a,$i) = if (($i >= $s))
529+ then $a
530+ else throw("List size exceeds 30")
533531
534- $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($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)
535- }
536- let tokensEnteries = $t01700917101._1
537- let totalTokenReward = $t01700917101._2
538- let lpMaxAPR = getAdoptedAPRByPeriod(curPeriod, LP_APR_PERIODS, LP_APR)
539- let lpTotalSupply = getIntegerValue(sfFarmingContract, (axlyPool + kSFTotalSupply))
540- let preLPSupply = valueOrElse(getInteger(this, kPrevLPSupply), 0)
541- let lpId = getStringValue(addressFromStringValue(axlyPool), kLpId)
542- let lpPrecision = getAssetPrecision(lpId)
543- let lpPrice = {
544- let @ = invoke(mainContract, "getShareAssetPriceREADONLY", [lpId], nil)
545- if ($isInstanceOf(@, "Int"))
546- then @
547- else throw(($getType(@) + " couldn't be cast to Int"))
548- }
549- let lpTotalSupplyUsd = fraction(lpTotalSupply, lpPrice, lpPrecision)
550- let maxLPRewardUsd = fraction(lpMaxPeriodAmount, axlyPrice, axlyPrecision)
551- let rtLPCoef = if (if ((preLPSupply == 0))
552- then true
553- else (lpTotalSupply == 0))
554- then 0
555- else (fraction(lpTotalSupply, SCALE8, preLPSupply) - SCALE8)
556- let rewardLp = ((min([(lpMaxAPR * (SCALE8 + max([rtLPCoef, 0]))), fraction(lpMaxAPR, (15 * SCALE8), 10)]) / SCALE8) / 100)
557- let rewardLpUsd = min([maxLPRewardUsd, fraction(lpTotalSupplyUsd, rewardLp, SCALE8)])
558- let rewardLpPeriod = fraction(rewardLpUsd, axlyPrecision, axlyPrice)
559- let rewardLpPerBlock = (rewardLpPeriod / periodLength)
560- let burnLend = (lendMaxPeriodAmount - totalTokenReward)
561- let burnLp = (lpMaxPeriodAmount - rewardLpPeriod)
562- let inv = invoke(tokenContract, "withdrawLpReward", [(burnLend + burnLp), toString(this)], nil)
563- if ((inv == inv))
564- then {
565- let lpEnteries = if ((12 >= curPeriod))
566- then [IntegerEntry(kPrevLPSupply, lpTotalSupply), IntegerEntry(kLpRewardPerBlock, rewardLpPerBlock), IntegerEntry(kLpInterest, calcNewLpInterest(lpTotalSupply)), IntegerEntry(kLpInterestHeight, max([startHeight, height])), ScriptTransfer(Address(base58'3MsXJ3BesPECkYejzBQGHZPJT8GVYy4Fd3Q'), burnLend, fromBase58String(axlyId)), ScriptTransfer(Address(base58'3MsXJ3BesPECkYejzBQGHZPJT8GVYy4Fd3Q'), burnLp, fromBase58String(axlyId))]
567- else nil
568- ((lpEnteries ++ tokensEnteries) :+ IntegerEntry(kLastUpdatePeriod, curPeriod))
569- }
570- else throw("Strict value is not equal to itself.")
532+ $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($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)
571533 }
534+ let tokensEnteries = $t01676516842._1
535+ let index = $t01676516842._2
536+ let lpMaxAPR = getAdoptedAPRByPeriod(curPeriod, LP_APR_PERIODS, LP_APR)
537+ let lpTotalSupply = getIntegerValue(sfFarmingContract, (axlyPool + kSFTotalSupply))
538+ let preLPSupply = valueOrElse(getInteger(this, kPrevLPSupply), 0)
539+ let lpId = getStringValue(addressFromStringValue(axlyPool), kLpId)
540+ let lpPrecision = getAssetPrecision(lpId)
541+ let lpPrice = {
542+ let @ = invoke(mainContract, "getShareAssetPriceREADONLY", [lpId], nil)
543+ if ($isInstanceOf(@, "Int"))
544+ then @
545+ else throw(($getType(@) + " couldn't be cast to Int"))
546+ }
547+ let lpTotalSupplyUsd = fraction(lpTotalSupply, lpPrice, lpPrecision)
548+ let maxLPRewardUsd = fraction(lpMaxPeriodAmount, axlyPrice, axlyPrecision)
549+ let rtLPCoef = if (if ((preLPSupply == 0))
550+ then true
551+ else (lpTotalSupply == 0))
552+ then 0
553+ else fraction(preLPSupply, SCALE8, lpTotalSupply)
554+ let rewardLp = (min([(lpMaxAPR * (SCALE8 + rtLPCoef)), fraction(lpMaxAPR, (15 * SCALE8), 10)]) / SCALE8)
555+ let rewardLpUsd = min([maxLPRewardUsd, fraction(lpTotalSupplyUsd, rewardLp, SCALE8)])
556+ let rewardLpPeriod = fraction(rewardLpUsd, axlyPrice, axlyPrecision)
557+ let rewardLpPerBlock = (rewardLpPeriod / periodLength)
558+ let lpEnteries = [IntegerEntry(kPrevLPSupply, lpTotalSupply), IntegerEntry(kLpRewardPerBlock, rewardLpPerBlock), IntegerEntry(kLpInterest, calcNewLpInterest(lpTotalSupply)), IntegerEntry(kLpInterestHeight, max([startHeight, height]))]
559+ ((lpEnteries ++ tokensEnteries) :+ IntegerEntry(kRewardUpdateHeight, max([startHeight, height])))
560+ }
572561 })
573562
574563
575564 @Verifier(tx)
576565 func verify () = {
577566 let multiSignedByAdmins = {
578567 let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], admin1PK))
579568 then 1
580569 else 0
581570 let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], admin2PK))
582571 then 1
583572 else 0
584573 let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], admin3PK))
585574 then 1
586575 else 0
587576 (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2)
588577 }
589578 match tx {
590579 case inv: InvokeScriptTransaction =>
591580 let isSelf = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
592581 let isRightFee = if ((inv.fee == 900000))
593582 then (inv.feeAssetId == unit)
594583 else false
595584 let isInitCall = (inv.function == "init")
596585 let isnoPayments = (size(inv.payments) == 0)
597586 if (if (if (if (isRightFee)
598587 then isInitCall
599588 else false)
600589 then isSelf
601590 else false)
602591 then isnoPayments
603592 else false)
604593 then true
605594 else multiSignedByAdmins
606595 case _ =>
607596 multiSignedByAdmins
608597 }
609598 }
610599

github/deemru/w8io/026f985 
96.96 ms