tx · Cd4pK1LVmG87fzL3FZmTucckrDB6pBAUrnXXB6TSvakg 3MsNhK6uve98J6DeqbuwGFBRh9GoHPGUFgp: -0.02300000 Waves 2023.03.24 14:59 [2504060] smart account 3MsNhK6uve98J6DeqbuwGFBRh9GoHPGUFgp > SELF 0.00000000 Waves
{ "type": 13, "id": "Cd4pK1LVmG87fzL3FZmTucckrDB6pBAUrnXXB6TSvakg", "fee": 2300000, "feeAssetId": null, "timestamp": 1679659191341, "version": 2, "chainId": 84, "sender": "3MsNhK6uve98J6DeqbuwGFBRh9GoHPGUFgp", "senderPublicKey": "86RHVxKovtU7yKnepY8wKsd8niDxGAsiwuA1XA1DNqrS", "proofs": [ "5eKWx2Z9UL5gBnZ8M1MymBrKo8STpdtcRRqvUUBju2iJRfjpQpdVUKXQwW3aMFgbJXVfx5uT6whxJ3ssXn5zBGv6" ], "script": "base64:BgKrIQgCEgMKAQgSAwoBCBIECgIICBIJCgcBERERGAgYEgcKBRERERgIEgcKBQEBAQgIEgASAwoBCBIECgIIARIECgIIARIECgIIARIDCgEIEgYKBAgBCAESBQoDARgYEgMKARgSAwoBCBIAIgZTQ0FMRTgiBU1VTFQ4IgdTQ0FMRTE4IgZNVUxUMTgiA1NFUCIOUE9PTFdFSUdIVE1VTFQiCnplcm9CaWdJbnQiDmlkeFBvb2xBZGRyZXNzIg1pZHhQb29sU3RhdHVzIhBpZHhQb29sTFBBc3NldElkIg1pZHhBbXRBc3NldElkIg9pZHhQcmljZUFzc2V0SWQiDmlkeEFtdEFzc2V0RGNtIhBpZHhQcmljZUFzc2V0RGNtIg5pZHhJQW10QXNzZXRJZCIQaWR4SVByaWNlQXNzZXRJZCINaWR4TFBBc3NldERjbSIPZ2V0U3RyaW5nT3JGYWlsIgNrZXkiGGdldFN0cmluZ0J5QWRkcmVzc09yRmFpbCIHYWRkcmVzcyIMZ2V0SW50T3JaZXJvIgxnZXRJbnRPckZhaWwiCWFzQW55TGlzdCIDdmFsIgckbWF0Y2gwIgp2Y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FAXoCBFVuaXQIBQJkWA9zZW5kZXJQdWJsaWNLZXkJAAIBAgtNYXRjaCBlcnJvcgkA9AMDCAUCZFgJYm9keUJ5dGVzCQCRAwIIBQJkWAZwcm9vZnMAAAUCZFr6cd9q", "height": 2504060, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2TMrhaHAFL4qkKQvwy4vWHU3kmrS1xHW4eYYFXoLQag5 Next: 3F8svdZKqfrHECRNtLPTT2My2L9DSe5mKLDme55aQQHG Diff:
Old | New | Differences | |
---|---|---|---|
262 | 262 | let poolWeight = getIntegerValue(factoryDapp, keyFactoryPoolWeight(poolAddressStr)) | |
263 | 263 | let wxEmissionPerBlock = getIntOrFail(emissionDapp, keyEmissionRatePerBlockCurrent()) | |
264 | 264 | let wxEmissionPerBlockMax = getIntOrFail(emissionDapp, keyEmissionRatePerBlockMaxCurrent()) | |
265 | - | let boostMaxCoeff = 3 | |
265 | + | let boostMaxCoeff = { | |
266 | + | let @ = invoke(emissionDapp, "getBoostCoeffREADONLY", nil, nil) | |
267 | + | if ($isInstanceOf(@, "Int")) | |
268 | + | then @ | |
269 | + | else throw(($getType(@) + " couldn't be cast to Int")) | |
270 | + | } | |
266 | 271 | let poolWxEmissionPerBlock = (fraction(wxEmissionPerBlock, poolWeight, poolWeightMult) / boostMaxCoeff) | |
267 | 272 | let poolWxEmissionPerBlockMax = fraction(wxEmissionPerBlockMax, poolWeight, poolWeightMult) | |
268 | 273 | let maxFactor = (boostMaxCoeff * MULT8) | |
340 | 345 | let wxEmissionPerBlock = rewardData[0] | |
341 | 346 | let maxFactor = rewardData[1] | |
342 | 347 | let totalLpStaked = rewardData[2] | |
343 | - | $Tuple2(nil, makeString(["%d%d%d", toString(wxEmissionPerBlock), toString(maxFactor), toString(totalLpStaked)], SEP)) | |
348 | + | let votingResultStaked = { | |
349 | + | let @ = invoke(boostingDapp, "getVotingResultStakedREADONLY", [lpAssetId], nil) | |
350 | + | if ($isInstanceOf(@, "Int")) | |
351 | + | then @ | |
352 | + | else throw(($getType(@) + " couldn't be cast to Int")) | |
353 | + | } | |
354 | + | $Tuple2(nil, makeString(["%d%d%d%d", toString(wxEmissionPerBlock), toString(maxFactor), toString(totalLpStaked), toString(votingResultStaked)], SEP)) | |
344 | 355 | } | |
345 | 356 | ||
346 | 357 | ||
402 | 413 | ||
403 | 414 | @Callable(i) | |
404 | 415 | func calcBoostREADONLY (deltaWxAmount,deltaLockPeriodInBlocks,deltaLpAmount,lpAssetIdOpt,userAddressOpt) = { | |
416 | + | let boostCoeff = { | |
417 | + | let @ = invoke(emissionDapp, "getBoostCoeffREADONLY", nil, nil) | |
418 | + | if ($isInstanceOf(@, "Int")) | |
419 | + | then @ | |
420 | + | else throw(($getType(@) + " couldn't be cast to Int")) | |
421 | + | } | |
405 | 422 | let mathDapp = gwxRewardDapp | |
406 | 423 | let EMPTYSTR = "empty" | |
407 | 424 | let maxLockDurationInBlocks = parseIntValue(split(getStringByAddressOrFail(boostingDapp, keyBoostCfg()), SEP)[4]) | |
421 | 438 | let lockDurationNew = min([(remainingDuration + deltaLockPeriodInBlocks), maxLockDurationInBlocks]) | |
422 | 439 | let userCurrgWxAmount = asInt(asAnyList(invoke(boostingDapp, "gwxUserInfoREADONLY", [userAddressStr], nil))[0]) | |
423 | 440 | let gWxAmountStartNew = calcGwxAmountStartREADONLY(userAmountNew, lockDurationNew, maxLockDurationInBlocks)[0] | |
424 | - | let gWxParamsResultList = asAnyList(invoke(mathDapp, "calcGwxParamsREADONLY", [gWxAmountStartNew, height, lockDurationNew], nil)) | |
425 | - | let gWxAmountDiff = (gWxAmountStartNew - userCurrgWxAmount) | |
426 | - | let k = asInt(gWxParamsResultList[0]) | |
427 | - | let b = asInt(gWxParamsResultList[1]) | |
428 | - | let period = toString(asInt(gWxParamsResultList[2])) | |
429 | - | let totalMaxBoostIntegralKEY = keyTotalMaxBoostINTEGRAL() | |
430 | - | let userMaxBoostIntNew = ((gWxAmountStartNew * lockDurationNew) / 2) | |
431 | - | let totalMaxBoostInt = getIntOrZero(boostingDapp, totalMaxBoostIntegralKEY) | |
432 | 441 | let totalCachedGwx = { | |
433 | 442 | let @ = invoke(boostingDapp, "getTotalCachedGwxREADONLY", nil, nil) | |
434 | 443 | if ($isInstanceOf(@, "Int")) | |
441 | 450 | let stakedTotalKEY = keyStakedTotal(lpAssetIdStr) | |
442 | 451 | let stakedByUser = readStaked(stakingDapp, stakedByUserKEY) | |
443 | 452 | let stakedTotal = readStaked(stakingDapp, stakedTotalKEY) | |
444 | - | let stakedByUserNew = (stakedByUser + deltaLpAmount) | |
445 | - | let stakedTotalNew = (stakedTotal + deltaLpAmount) | |
446 | 453 | let poolWeight = if ((lpAssetIdStr != EMPTYSTR)) | |
447 | 454 | then { | |
448 | 455 | let poolAddressStr = valueOrErrorMessage(getString(factoryDapp, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr)) | |
449 | 456 | getIntegerValue(factoryDapp, keyFactoryPoolWeight(poolAddressStr)) | |
450 | 457 | } | |
451 | 458 | else 0 | |
452 | - | let poolWxEmissionPerBlockX3 = fraction(wxEmissionPerBlockX3, poolWeight, (POOLWEIGHTMULT * | |
453 | - | let wxPerLpX3 = if (( | |
454 | - | then fraction(poolWxEmissionPerBlockX3, MULT8, | |
459 | + | let poolWxEmissionPerBlockX3 = fraction(wxEmissionPerBlockX3, poolWeight, (POOLWEIGHTMULT * boostCoeff)) | |
460 | + | let wxPerLpX3 = if ((stakedTotal != 0)) | |
461 | + | then fraction(poolWxEmissionPerBlockX3, MULT8, stakedTotal) | |
455 | 462 | else 0 | |
456 | - | let userWxPerBlockX3 = fraction(wxPerLpX3, | |
457 | - | let boostEmissionPerBlockX3 = (poolWxEmissionPerBlockX3 * | |
458 | - | let tmpUserBoostPerBlockX3 = fraction( | |
459 | - | let userBoostPerBlockX3 = min([tmpUserBoostPerBlockX3, (userWxPerBlockX3 * | |
460 | - | let | |
463 | + | let userWxPerBlockX3 = fraction(wxPerLpX3, stakedByUser, MULT8) | |
464 | + | let boostEmissionPerBlockX3 = (poolWxEmissionPerBlockX3 * (boostCoeff - 1)) | |
465 | + | let tmpUserBoostPerBlockX3 = fraction(userCurrgWxAmount, boostEmissionPerBlockX3, totalCachedGwx) | |
466 | + | let userBoostPerBlockX3 = min([tmpUserBoostPerBlockX3, (userWxPerBlockX3 * (boostCoeff - 1))]) | |
467 | + | let userBoostCoeff = if ((userWxPerBlockX3 == 0)) | |
461 | 468 | then (1 * MULT8) | |
462 | 469 | else fraction((userBoostPerBlockX3 + userWxPerBlockX3), MULT8, userWxPerBlockX3) | |
463 | - | $Tuple2(nil, makeString(["%d%d%s", toString(gWxAmountStartNew), toString( | |
470 | + | $Tuple2(nil, makeString(["%d%d%s", toString(gWxAmountStartNew), toString(userBoostCoeff), "d"], SEP)) | |
464 | 471 | } | |
465 | 472 | ||
466 | 473 | ||
559 | 566 | let inPrAssetAmtX18 = fraction(inAmAssetAmtX18, curPriceX18, MULT18) | |
560 | 567 | let inPrAssetAmt = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [toString(inPrAssetAmtX18), priceAssetDcm], nil)) | |
561 | 568 | let res = invoke(poolAddress, "estimatePutOperationWrapperREADONLY", ["", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false], nil) | |
562 | - | let $ | |
569 | + | let $t02263122984 = match res { | |
563 | 570 | case _ => | |
564 | 571 | if (if (if ($isInstanceOf($match0._1, "Int")) | |
565 | 572 | then if ($isInstanceOf($match0._3, "Int")) | |
582 | 589 | } | |
583 | 590 | else throw("Couldn't cast types") | |
584 | 591 | } | |
585 | - | let calcLpAmt = $ | |
586 | - | let curPriceCalc = $ | |
587 | - | let amBalance = $ | |
588 | - | let prBalance = $ | |
589 | - | let lpEmission = $ | |
592 | + | let calcLpAmt = $t02263122984._1 | |
593 | + | let curPriceCalc = $t02263122984._2 | |
594 | + | let amBalance = $t02263122984._3 | |
595 | + | let prBalance = $t02263122984._4 | |
596 | + | let lpEmission = $t02263122984._5 | |
590 | 597 | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d", toString(calcLpAmt), toString(curPrice), toString(amBalance), toString(prBalance), toString(lpEmission), poolStatus, toString(inAmAssetAmt), toString(inPrAssetAmt)], SEP)) | |
591 | 598 | } | |
592 | 599 | ||
617 | 624 | let inAmAssetAmtX18 = fraction(inPrAssetAmtX18, MULT18, curPriceX18) | |
618 | 625 | let inAmAssetAmt = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [toString(inAmAssetAmtX18), amtAssetDcm], nil)) | |
619 | 626 | let res = invoke(poolAddress, "estimatePutOperationWrapperREADONLY", ["", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false], nil) | |
620 | - | let $ | |
627 | + | let $t02555725910 = match res { | |
621 | 628 | case _ => | |
622 | 629 | if (if (if ($isInstanceOf($match0._1, "Int")) | |
623 | 630 | then if ($isInstanceOf($match0._3, "Int")) | |
640 | 647 | } | |
641 | 648 | else throw("Couldn't cast types") | |
642 | 649 | } | |
643 | - | let calcLpAmt = $ | |
644 | - | let curPriceCalc = $ | |
645 | - | let amBalance = $ | |
646 | - | let prBalance = $ | |
647 | - | let lpEmission = $ | |
650 | + | let calcLpAmt = $t02555725910._1 | |
651 | + | let curPriceCalc = $t02555725910._2 | |
652 | + | let amBalance = $t02555725910._3 | |
653 | + | let prBalance = $t02555725910._4 | |
654 | + | let lpEmission = $t02555725910._5 | |
648 | 655 | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d", toString(calcLpAmt), toString(curPrice), toString(amBalance), toString(prBalance), toString(lpEmission), poolStatus, toString(inAmAssetAmt), toString(inPrAssetAmt)], SEP)) | |
649 | 656 | } | |
650 | 657 | ||
654 | 661 | func poolEvaluateGetREADONLY (paymentLpAssetId,paymentLpAmt) = { | |
655 | 662 | let poolAddress = addressFromStringValue(getStringByAddressOrFail(factoryDapp, keyFactoryLpAssetToPoolContractAddress(paymentLpAssetId))) | |
656 | 663 | let res = invoke(poolAddress, "estimateGetOperationWrapperREADONLY", ["", paymentLpAssetId, paymentLpAmt, toString(poolAddress)], nil) | |
657 | - | let $ | |
664 | + | let $t02660527022 = match res { | |
658 | 665 | case _ => | |
659 | 666 | if (if (if ($isInstanceOf($match0._1, "Int")) | |
660 | 667 | then if ($isInstanceOf($match0._2, "Int")) | |
683 | 690 | } | |
684 | 691 | else throw("Couldn't cast types") | |
685 | 692 | } | |
686 | - | let outAmAmt = $ | |
687 | - | let outPrAmt = $ | |
688 | - | let amBalance = $ | |
689 | - | let prBalance = $ | |
690 | - | let lpEmission = $ | |
691 | - | let curPrice = $ | |
692 | - | let poolStatus = $ | |
693 | + | let outAmAmt = $t02660527022._1 | |
694 | + | let outPrAmt = $t02660527022._2 | |
695 | + | let amBalance = $t02660527022._3 | |
696 | + | let prBalance = $t02660527022._4 | |
697 | + | let lpEmission = $t02660527022._5 | |
698 | + | let curPrice = $t02660527022._6 | |
699 | + | let poolStatus = $t02660527022._7 | |
693 | 700 | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d", toString(outAmAmt), toString(outPrAmt), toString(amBalance), toString(prBalance), toString(lpEmission), curPrice, poolStatus], SEP)) | |
694 | 701 | } | |
695 | 702 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let SCALE8 = 8 | |
5 | 5 | ||
6 | 6 | let MULT8 = 100000000 | |
7 | 7 | ||
8 | 8 | let SCALE18 = 18 | |
9 | 9 | ||
10 | 10 | let MULT18 = toBigInt(1000000000000000000) | |
11 | 11 | ||
12 | 12 | let SEP = "__" | |
13 | 13 | ||
14 | 14 | let POOLWEIGHTMULT = MULT8 | |
15 | 15 | ||
16 | 16 | let zeroBigInt = toBigInt(0) | |
17 | 17 | ||
18 | 18 | let idxPoolAddress = 1 | |
19 | 19 | ||
20 | 20 | let idxPoolStatus = 2 | |
21 | 21 | ||
22 | 22 | let idxPoolLPAssetId = 3 | |
23 | 23 | ||
24 | 24 | let idxAmtAssetId = 4 | |
25 | 25 | ||
26 | 26 | let idxPriceAssetId = 5 | |
27 | 27 | ||
28 | 28 | let idxAmtAssetDcm = 6 | |
29 | 29 | ||
30 | 30 | let idxPriceAssetDcm = 7 | |
31 | 31 | ||
32 | 32 | let idxIAmtAssetId = 8 | |
33 | 33 | ||
34 | 34 | let idxIPriceAssetId = 9 | |
35 | 35 | ||
36 | 36 | let idxLPAssetDcm = 10 | |
37 | 37 | ||
38 | 38 | func getStringOrFail (key) = valueOrErrorMessage(getString(key), (("mandatory this." + key) + " is not defined")) | |
39 | 39 | ||
40 | 40 | ||
41 | 41 | func getStringByAddressOrFail (address,key) = valueOrErrorMessage(getString(address, key), (((("mandatory " + toString(address)) + ".") + key) + " is not defined")) | |
42 | 42 | ||
43 | 43 | ||
44 | 44 | func getIntOrZero (address,key) = valueOrElse(getInteger(address, key), 0) | |
45 | 45 | ||
46 | 46 | ||
47 | 47 | func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), (("mandatory this." + key) + " is not defined")) | |
48 | 48 | ||
49 | 49 | ||
50 | 50 | func asAnyList (val) = match val { | |
51 | 51 | case valAnyLyst: List[Any] => | |
52 | 52 | valAnyLyst | |
53 | 53 | case _ => | |
54 | 54 | throw("fail to cast into List[Any]") | |
55 | 55 | } | |
56 | 56 | ||
57 | 57 | ||
58 | 58 | func asInt (val) = match val { | |
59 | 59 | case valInt: Int => | |
60 | 60 | valInt | |
61 | 61 | case _ => | |
62 | 62 | throw("fail to cast into Int") | |
63 | 63 | } | |
64 | 64 | ||
65 | 65 | ||
66 | 66 | func asString (val) = match val { | |
67 | 67 | case valStr: String => | |
68 | 68 | valStr | |
69 | 69 | case _ => | |
70 | 70 | throw("fail to cast into String") | |
71 | 71 | } | |
72 | 72 | ||
73 | 73 | ||
74 | 74 | func keyFactoryAddress () = "%s%s__config__factoryAddress" | |
75 | 75 | ||
76 | 76 | ||
77 | 77 | func keyManagerPublicKey () = "%s__managerPublicKey" | |
78 | 78 | ||
79 | 79 | ||
80 | 80 | func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey" | |
81 | 81 | ||
82 | 82 | ||
83 | 83 | let IdxFactoryCfgStakingDapp = 1 | |
84 | 84 | ||
85 | 85 | let IdxFactoryCfgBoostingDapp = 2 | |
86 | 86 | ||
87 | 87 | let IdxFactoryCfgIdoDapp = 3 | |
88 | 88 | ||
89 | 89 | let IdxFactoryCfgTeamDapp = 4 | |
90 | 90 | ||
91 | 91 | let IdxFactoryCfgEmissionDapp = 5 | |
92 | 92 | ||
93 | 93 | let IdxFactoryCfgRestDapp = 6 | |
94 | 94 | ||
95 | 95 | let IdxFactoryCfgSlippageDapp = 7 | |
96 | 96 | ||
97 | 97 | let IdxFactoryCfgGwxRewardDapp = 8 | |
98 | 98 | ||
99 | 99 | func keyFactoryCfg () = "%s__factoryConfig" | |
100 | 100 | ||
101 | 101 | ||
102 | 102 | func keyFactoryLp2AssetsMapping (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP) | |
103 | 103 | ||
104 | 104 | ||
105 | 105 | func keyFactoryLpList () = "%s__lpTokensList" | |
106 | 106 | ||
107 | 107 | ||
108 | 108 | func keyFactoryLpAssetToPoolContractAddress (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP) | |
109 | 109 | ||
110 | 110 | ||
111 | 111 | func keyFactoryPoolWeight (contractAddress) = makeString(["%s%s", "poolWeight", contractAddress], SEP) | |
112 | 112 | ||
113 | 113 | ||
114 | 114 | func readFactoryAddressOrFail () = addressFromStringValue(getStringOrFail(keyFactoryAddress())) | |
115 | 115 | ||
116 | 116 | ||
117 | 117 | func readLpList () = split(valueOrElse(getString(readFactoryAddressOrFail(), keyFactoryLpList()), ""), SEP) | |
118 | 118 | ||
119 | 119 | ||
120 | 120 | func readFactoryCfgOrFail (factory) = split(getStringByAddressOrFail(factory, keyFactoryCfg()), SEP) | |
121 | 121 | ||
122 | 122 | ||
123 | 123 | func getBoostingAddressOrFail (fCfg) = addressFromStringValue(fCfg[IdxFactoryCfgBoostingDapp]) | |
124 | 124 | ||
125 | 125 | ||
126 | 126 | func getEmissionAddressOrFail (fCfg) = addressFromStringValue(fCfg[IdxFactoryCfgEmissionDapp]) | |
127 | 127 | ||
128 | 128 | ||
129 | 129 | func getStakingAddressOrFail (fCfg) = addressFromStringValue(fCfg[IdxFactoryCfgStakingDapp]) | |
130 | 130 | ||
131 | 131 | ||
132 | 132 | func getGwxRewardAddressOrFail (fCfg) = addressFromStringValue(fCfg[IdxFactoryCfgGwxRewardDapp]) | |
133 | 133 | ||
134 | 134 | ||
135 | 135 | func keyBoostCfg () = "%s__config" | |
136 | 136 | ||
137 | 137 | ||
138 | 138 | func keyBoostingLockParamTotalAmount () = "%s%s__stats__activeTotalLocked" | |
139 | 139 | ||
140 | 140 | ||
141 | 141 | func keyBoostingStatsLocksDurationSumInBlocks () = "%s%s__stats__locksDurationSumInBlocks" | |
142 | 142 | ||
143 | 143 | ||
144 | 144 | func keyBoostingStatsLocksCount () = "%s%s__stats__locksCount" | |
145 | 145 | ||
146 | 146 | ||
147 | 147 | func keyBoostingStatsUsersCount () = "%s%s__stats__activeUsersCount" | |
148 | 148 | ||
149 | 149 | ||
150 | 150 | func keyUser2NumMapping (userAddress) = makeString(["%s%s%s__mapping__user2num", userAddress], SEP) | |
151 | 151 | ||
152 | 152 | ||
153 | 153 | func keyNum2UserMapping (num) = makeString(["%s%s%s__mapping__num2user", num], SEP) | |
154 | 154 | ||
155 | 155 | ||
156 | 156 | func keyLockParamUserAmount (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "amount"], SEP) | |
157 | 157 | ||
158 | 158 | ||
159 | 159 | func keyLockParamStartBlock (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "start"], SEP) | |
160 | 160 | ||
161 | 161 | ||
162 | 162 | func keyLockParamDuration (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "duration"], SEP) | |
163 | 163 | ||
164 | 164 | ||
165 | 165 | func keyLockParamK (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "k"], SEP) | |
166 | 166 | ||
167 | 167 | ||
168 | 168 | func keyLockParamB (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "b"], SEP) | |
169 | 169 | ||
170 | 170 | ||
171 | 171 | func keyLockParamByPeriodK (userNum,period) = makeString(["%s%d%s%d__paramByPeriod", userNum, "k", period], SEP) | |
172 | 172 | ||
173 | 173 | ||
174 | 174 | func keyLockParamByPeriodB (userNum,period) = makeString(["%s%d%s%d__paramByPeriod", userNum, "b", period], SEP) | |
175 | 175 | ||
176 | 176 | ||
177 | 177 | func keyUserBoostEmissionLastINTEGRAL (userNum) = makeString(["%s%d__userBoostEmissionLastInt", userNum], SEP) | |
178 | 178 | ||
179 | 179 | ||
180 | 180 | func keyUserMaxBoostINTEGRAL (userNum) = makeString(["%s%d__maxBoostInt", userNum], SEP) | |
181 | 181 | ||
182 | 182 | ||
183 | 183 | func keyTotalMaxBoostINTEGRAL () = "%s%s__maxBoostInt__total" | |
184 | 184 | ||
185 | 185 | ||
186 | 186 | func keyUserBoostAvalaibleToClaimTotal (userNum) = makeString(["%s%d__userBoostAvaliableToClaimTotal", userNum], SEP) | |
187 | 187 | ||
188 | 188 | ||
189 | 189 | func keyUserBoostClaimed (userNum) = makeString(["%s%d__userBoostClaimed", userNum], SEP) | |
190 | 190 | ||
191 | 191 | ||
192 | 192 | func keyTotalCachedGwx () = "%s%s__gwxCached__total" | |
193 | 193 | ||
194 | 194 | ||
195 | 195 | func keyStakedByUser (userAddressStr,lpAssetIdStr) = makeString(["%s%s%s__staked", userAddressStr, lpAssetIdStr], SEP) | |
196 | 196 | ||
197 | 197 | ||
198 | 198 | func keyStakedTotal (lpAssetIdStr) = ("%s%s%s__staked__total__" + lpAssetIdStr) | |
199 | 199 | ||
200 | 200 | ||
201 | 201 | func keyClaimedByUser (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimed", userAddressStr, lpAssetIdStr], SEP) | |
202 | 202 | ||
203 | 203 | ||
204 | 204 | func keyClaimedByUserMinReward (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimedMinReward", userAddressStr, lpAssetIdStr], SEP) | |
205 | 205 | ||
206 | 206 | ||
207 | 207 | func keyClaimedByUserBoostReward (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimedBoostReward", userAddressStr, lpAssetIdStr], SEP) | |
208 | 208 | ||
209 | 209 | ||
210 | 210 | func readStaked (stakingDapp,key) = valueOrElse(getInteger(stakingDapp, key), 0) | |
211 | 211 | ||
212 | 212 | ||
213 | 213 | func keyEmissionRatePerBlockCurrent () = "%s%s__ratePerBlock__current" | |
214 | 214 | ||
215 | 215 | ||
216 | 216 | func keyEmissionRatePerBlockMaxCurrent () = "%s%s__ratePerBlockMax__current" | |
217 | 217 | ||
218 | 218 | ||
219 | 219 | func keyEmissionStartBlock () = "%s%s__emission__startBlock" | |
220 | 220 | ||
221 | 221 | ||
222 | 222 | func keyEmissionDurationInBlocks () = "%s%s__emission__duration" | |
223 | 223 | ||
224 | 224 | ||
225 | 225 | func keyEmissionEndBlock () = "%s%s__emission__endBlock" | |
226 | 226 | ||
227 | 227 | ||
228 | 228 | func keyAddonAddr () = "%s__addonAddr" | |
229 | 229 | ||
230 | 230 | ||
231 | 231 | let factoryDapp = readFactoryAddressOrFail() | |
232 | 232 | ||
233 | 233 | let factoryCfg = readFactoryCfgOrFail(factoryDapp) | |
234 | 234 | ||
235 | 235 | let emissionDapp = getEmissionAddressOrFail(factoryCfg) | |
236 | 236 | ||
237 | 237 | let stakingDapp = getStakingAddressOrFail(factoryCfg) | |
238 | 238 | ||
239 | 239 | let gwxRewardDapp = getGwxRewardAddressOrFail(factoryCfg) | |
240 | 240 | ||
241 | 241 | let boostingDapp = getBoostingAddressOrFail(factoryCfg) | |
242 | 242 | ||
243 | 243 | func getPoolInFee (poolAddress) = { | |
244 | 244 | let @ = invoke(factoryDapp, "getInFeeREADONLY", [toString(poolAddress)], nil) | |
245 | 245 | if ($isInstanceOf(@, "Int")) | |
246 | 246 | then @ | |
247 | 247 | else throw(($getType(@) + " couldn't be cast to Int")) | |
248 | 248 | } | |
249 | 249 | ||
250 | 250 | ||
251 | 251 | func getPoolOutFee (poolAddress) = { | |
252 | 252 | let @ = invoke(factoryDapp, "getOutFeeREADONLY", [toString(poolAddress)], nil) | |
253 | 253 | if ($isInstanceOf(@, "Int")) | |
254 | 254 | then @ | |
255 | 255 | else throw(($getType(@) + " couldn't be cast to Int")) | |
256 | 256 | } | |
257 | 257 | ||
258 | 258 | ||
259 | 259 | func internalCurrentRewardRate (lpAssetId) = { | |
260 | 260 | let poolAddressStr = getStringByAddressOrFail(factoryDapp, keyFactoryLpAssetToPoolContractAddress(lpAssetId)) | |
261 | 261 | let poolWeightMult = MULT8 | |
262 | 262 | let poolWeight = getIntegerValue(factoryDapp, keyFactoryPoolWeight(poolAddressStr)) | |
263 | 263 | let wxEmissionPerBlock = getIntOrFail(emissionDapp, keyEmissionRatePerBlockCurrent()) | |
264 | 264 | let wxEmissionPerBlockMax = getIntOrFail(emissionDapp, keyEmissionRatePerBlockMaxCurrent()) | |
265 | - | let boostMaxCoeff = 3 | |
265 | + | let boostMaxCoeff = { | |
266 | + | let @ = invoke(emissionDapp, "getBoostCoeffREADONLY", nil, nil) | |
267 | + | if ($isInstanceOf(@, "Int")) | |
268 | + | then @ | |
269 | + | else throw(($getType(@) + " couldn't be cast to Int")) | |
270 | + | } | |
266 | 271 | let poolWxEmissionPerBlock = (fraction(wxEmissionPerBlock, poolWeight, poolWeightMult) / boostMaxCoeff) | |
267 | 272 | let poolWxEmissionPerBlockMax = fraction(wxEmissionPerBlockMax, poolWeight, poolWeightMult) | |
268 | 273 | let maxFactor = (boostMaxCoeff * MULT8) | |
269 | 274 | let totalLpStaked = getIntOrZero(stakingDapp, keyStakedTotal(lpAssetId)) | |
270 | 275 | [poolWxEmissionPerBlock, maxFactor, totalLpStaked] | |
271 | 276 | } | |
272 | 277 | ||
273 | 278 | ||
274 | 279 | func calcGwxAmountStartREADONLY (lockAmount,lockDuration,maxLockDuration) = { | |
275 | 280 | let coeffX8 = fraction(lockDuration, MULT8, maxLockDuration) | |
276 | 281 | let gWxAmountStart = fraction(lockAmount, coeffX8, MULT8) | |
277 | 282 | [gWxAmountStart] | |
278 | 283 | } | |
279 | 284 | ||
280 | 285 | ||
281 | 286 | func getKey (addr,key,type) = if ((type == "string")) | |
282 | 287 | then getStringValue(addr, key) | |
283 | 288 | else if ((type == "integer")) | |
284 | 289 | then toString(getIntegerValue(addr, key)) | |
285 | 290 | else if ((type == "boolean")) | |
286 | 291 | then toString(getBooleanValue(addr, key)) | |
287 | 292 | else throw("unknown type. expected string/integer/boolean") | |
288 | 293 | ||
289 | 294 | ||
290 | 295 | func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) { | |
291 | 296 | case s: String => | |
292 | 297 | fromBase58String(s) | |
293 | 298 | case _: Unit => | |
294 | 299 | unit | |
295 | 300 | case _ => | |
296 | 301 | throw("Match error") | |
297 | 302 | } | |
298 | 303 | ||
299 | 304 | ||
300 | 305 | func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) { | |
301 | 306 | case s: String => | |
302 | 307 | fromBase58String(s) | |
303 | 308 | case _: Unit => | |
304 | 309 | unit | |
305 | 310 | case _ => | |
306 | 311 | throw("Match error") | |
307 | 312 | } | |
308 | 313 | ||
309 | 314 | ||
310 | 315 | func mustManager (i) = { | |
311 | 316 | let pd = throw("Permission denied") | |
312 | 317 | match managerPublicKeyOrUnit() { | |
313 | 318 | case pk: ByteVector => | |
314 | 319 | if ((i.callerPublicKey == pk)) | |
315 | 320 | then true | |
316 | 321 | else pd | |
317 | 322 | case _: Unit => | |
318 | 323 | if ((i.caller == this)) | |
319 | 324 | then true | |
320 | 325 | else pd | |
321 | 326 | case _ => | |
322 | 327 | throw("Match error") | |
323 | 328 | } | |
324 | 329 | } | |
325 | 330 | ||
326 | 331 | ||
327 | 332 | @Callable(i) | |
328 | 333 | func constructor (factoryAddress) = { | |
329 | 334 | let checkCaller = mustManager(i) | |
330 | 335 | if ((checkCaller == checkCaller)) | |
331 | 336 | then [StringEntry(keyFactoryAddress(), factoryAddress)] | |
332 | 337 | else throw("Strict value is not equal to itself.") | |
333 | 338 | } | |
334 | 339 | ||
335 | 340 | ||
336 | 341 | ||
337 | 342 | @Callable(i) | |
338 | 343 | func currentRewardRateREADONLY (lpAssetId) = { | |
339 | 344 | let rewardData = internalCurrentRewardRate(lpAssetId) | |
340 | 345 | let wxEmissionPerBlock = rewardData[0] | |
341 | 346 | let maxFactor = rewardData[1] | |
342 | 347 | let totalLpStaked = rewardData[2] | |
343 | - | $Tuple2(nil, makeString(["%d%d%d", toString(wxEmissionPerBlock), toString(maxFactor), toString(totalLpStaked)], SEP)) | |
348 | + | let votingResultStaked = { | |
349 | + | let @ = invoke(boostingDapp, "getVotingResultStakedREADONLY", [lpAssetId], nil) | |
350 | + | if ($isInstanceOf(@, "Int")) | |
351 | + | then @ | |
352 | + | else throw(($getType(@) + " couldn't be cast to Int")) | |
353 | + | } | |
354 | + | $Tuple2(nil, makeString(["%d%d%d%d", toString(wxEmissionPerBlock), toString(maxFactor), toString(totalLpStaked), toString(votingResultStaked)], SEP)) | |
344 | 355 | } | |
345 | 356 | ||
346 | 357 | ||
347 | 358 | ||
348 | 359 | @Callable(i) | |
349 | 360 | func currentUserRewardRateREADONLY (lpAssetId,userAddress) = { | |
350 | 361 | let rewardData = internalCurrentRewardRate(lpAssetId) | |
351 | 362 | let wxEmissionPerBlock = rewardData[0] | |
352 | 363 | let maxFactor = rewardData[1] | |
353 | 364 | let totalLpStaked = rewardData[2] | |
354 | 365 | let lpStakedByUser = getIntOrZero(stakingDapp, keyStakedByUser(userAddress, lpAssetId)) | |
355 | 366 | let userClaimInfo = split(asString(invoke(stakingDapp, "claimWxREADONLY", [lpAssetId, userAddress], nil)), SEP) | |
356 | 367 | let minRewardPart = valueOrErrorMessage(parseInt(userClaimInfo[5]), "couldn't parse minRewardPart") | |
357 | 368 | let boostRewardPart = valueOrErrorMessage(parseInt(userClaimInfo[6]), "couldn't parse boostRewardPart") | |
358 | 369 | let debug = userClaimInfo[7] | |
359 | 370 | let boostingPower = if ((boostRewardPart == 0)) | |
360 | 371 | then (1 * MULT8) | |
361 | 372 | else fraction((minRewardPart + boostRewardPart), MULT8, minRewardPart) | |
362 | 373 | $Tuple2(nil, makeString(["%d%d%d%d%d%s", toString(wxEmissionPerBlock), toString(maxFactor), toString(totalLpStaked), toString(lpStakedByUser), toString(boostingPower), debug], SEP)) | |
363 | 374 | } | |
364 | 375 | ||
365 | 376 | ||
366 | 377 | ||
367 | 378 | @Callable(i) | |
368 | 379 | func calcBoostBulkInternalREADONLY (currentIter,deltaWxAmountBulk,deltaLockPeriodInBlocksBulk,deltaLpAmountBulk,lpAssetIdOptBulk,userAddressOpt,resAcc) = if ((currentIter == size(deltaWxAmountBulk))) | |
369 | 380 | then $Tuple2(nil, resAcc) | |
370 | 381 | else { | |
371 | 382 | let deltaWxAmount = deltaWxAmountBulk[currentIter] | |
372 | 383 | let deltaLockPeriodInBlocks = deltaLockPeriodInBlocksBulk[currentIter] | |
373 | 384 | let deltaLpAmount = deltaLpAmountBulk[currentIter] | |
374 | 385 | let lpAssetIdOpt = lpAssetIdOptBulk[currentIter] | |
375 | 386 | let info = { | |
376 | 387 | let @ = invoke(this, "calcBoostREADONLY", [deltaWxAmount, deltaLockPeriodInBlocks, deltaLpAmount, lpAssetIdOpt, userAddressOpt], nil) | |
377 | 388 | if ($isInstanceOf(@, "String")) | |
378 | 389 | then @ | |
379 | 390 | else throw(($getType(@) + " couldn't be cast to String")) | |
380 | 391 | } | |
381 | 392 | let res = (resAcc :+ info) | |
382 | 393 | let inv = { | |
383 | 394 | let @ = invoke(this, "calcBoostBulkInternalREADONLY", [(currentIter + 1), deltaWxAmountBulk, deltaLockPeriodInBlocksBulk, deltaLpAmountBulk, lpAssetIdOptBulk, userAddressOpt, res], nil) | |
384 | 395 | if ($isInstanceOf(@, "List[Any]")) | |
385 | 396 | then @ | |
386 | 397 | else throw(($getType(@) + " couldn't be cast to List[Any]")) | |
387 | 398 | } | |
388 | 399 | if ((inv == inv)) | |
389 | 400 | then $Tuple2(nil, inv) | |
390 | 401 | else throw("Strict value is not equal to itself.") | |
391 | 402 | } | |
392 | 403 | ||
393 | 404 | ||
394 | 405 | ||
395 | 406 | @Callable(i) | |
396 | 407 | func calcBoostBulkREADONLY (deltaWxAmount,deltaLockPeriodInBlocks,deltaLpAmount,lpAssetIdOpt,userAddressOpt) = { | |
397 | 408 | let res = invoke(this, "calcBoostBulkInternalREADONLY", [0, deltaWxAmount, deltaLockPeriodInBlocks, deltaLpAmount, lpAssetIdOpt, userAddressOpt, nil], nil) | |
398 | 409 | $Tuple2(nil, res) | |
399 | 410 | } | |
400 | 411 | ||
401 | 412 | ||
402 | 413 | ||
403 | 414 | @Callable(i) | |
404 | 415 | func calcBoostREADONLY (deltaWxAmount,deltaLockPeriodInBlocks,deltaLpAmount,lpAssetIdOpt,userAddressOpt) = { | |
416 | + | let boostCoeff = { | |
417 | + | let @ = invoke(emissionDapp, "getBoostCoeffREADONLY", nil, nil) | |
418 | + | if ($isInstanceOf(@, "Int")) | |
419 | + | then @ | |
420 | + | else throw(($getType(@) + " couldn't be cast to Int")) | |
421 | + | } | |
405 | 422 | let mathDapp = gwxRewardDapp | |
406 | 423 | let EMPTYSTR = "empty" | |
407 | 424 | let maxLockDurationInBlocks = parseIntValue(split(getStringByAddressOrFail(boostingDapp, keyBoostCfg()), SEP)[4]) | |
408 | 425 | let lpAssetIdStr = if ((lpAssetIdOpt == "")) | |
409 | 426 | then EMPTYSTR | |
410 | 427 | else lpAssetIdOpt | |
411 | 428 | let userAddressStr = if ((userAddressOpt == "")) | |
412 | 429 | then EMPTYSTR | |
413 | 430 | else userAddressOpt | |
414 | 431 | let userNumStr = valueOrElse(getString(boostingDapp, keyUser2NumMapping(userAddressOpt)), EMPTYSTR) | |
415 | 432 | let userAmount = valueOrElse(getInteger(boostingDapp, keyLockParamUserAmount(userNumStr)), 0) | |
416 | 433 | let lockStart = valueOrElse(getInteger(boostingDapp, keyLockParamStartBlock(userNumStr)), height) | |
417 | 434 | let lockDuration = valueOrElse(getInteger(boostingDapp, keyLockParamDuration(userNumStr)), 0) | |
418 | 435 | let lockEnd = (lockStart + lockDuration) | |
419 | 436 | let remainingDuration = max([(lockEnd - height), 0]) | |
420 | 437 | let userAmountNew = (userAmount + deltaWxAmount) | |
421 | 438 | let lockDurationNew = min([(remainingDuration + deltaLockPeriodInBlocks), maxLockDurationInBlocks]) | |
422 | 439 | let userCurrgWxAmount = asInt(asAnyList(invoke(boostingDapp, "gwxUserInfoREADONLY", [userAddressStr], nil))[0]) | |
423 | 440 | let gWxAmountStartNew = calcGwxAmountStartREADONLY(userAmountNew, lockDurationNew, maxLockDurationInBlocks)[0] | |
424 | - | let gWxParamsResultList = asAnyList(invoke(mathDapp, "calcGwxParamsREADONLY", [gWxAmountStartNew, height, lockDurationNew], nil)) | |
425 | - | let gWxAmountDiff = (gWxAmountStartNew - userCurrgWxAmount) | |
426 | - | let k = asInt(gWxParamsResultList[0]) | |
427 | - | let b = asInt(gWxParamsResultList[1]) | |
428 | - | let period = toString(asInt(gWxParamsResultList[2])) | |
429 | - | let totalMaxBoostIntegralKEY = keyTotalMaxBoostINTEGRAL() | |
430 | - | let userMaxBoostIntNew = ((gWxAmountStartNew * lockDurationNew) / 2) | |
431 | - | let totalMaxBoostInt = getIntOrZero(boostingDapp, totalMaxBoostIntegralKEY) | |
432 | 441 | let totalCachedGwx = { | |
433 | 442 | let @ = invoke(boostingDapp, "getTotalCachedGwxREADONLY", nil, nil) | |
434 | 443 | if ($isInstanceOf(@, "Int")) | |
435 | 444 | then @ | |
436 | 445 | else throw(($getType(@) + " couldn't be cast to Int")) | |
437 | 446 | } | |
438 | 447 | let MULT3 = 1000 | |
439 | 448 | let wxEmissionPerBlockX3 = (getIntOrFail(emissionDapp, keyEmissionRatePerBlockCurrent()) * MULT3) | |
440 | 449 | let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr) | |
441 | 450 | let stakedTotalKEY = keyStakedTotal(lpAssetIdStr) | |
442 | 451 | let stakedByUser = readStaked(stakingDapp, stakedByUserKEY) | |
443 | 452 | let stakedTotal = readStaked(stakingDapp, stakedTotalKEY) | |
444 | - | let stakedByUserNew = (stakedByUser + deltaLpAmount) | |
445 | - | let stakedTotalNew = (stakedTotal + deltaLpAmount) | |
446 | 453 | let poolWeight = if ((lpAssetIdStr != EMPTYSTR)) | |
447 | 454 | then { | |
448 | 455 | let poolAddressStr = valueOrErrorMessage(getString(factoryDapp, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr)) | |
449 | 456 | getIntegerValue(factoryDapp, keyFactoryPoolWeight(poolAddressStr)) | |
450 | 457 | } | |
451 | 458 | else 0 | |
452 | - | let poolWxEmissionPerBlockX3 = fraction(wxEmissionPerBlockX3, poolWeight, (POOLWEIGHTMULT * | |
453 | - | let wxPerLpX3 = if (( | |
454 | - | then fraction(poolWxEmissionPerBlockX3, MULT8, | |
459 | + | let poolWxEmissionPerBlockX3 = fraction(wxEmissionPerBlockX3, poolWeight, (POOLWEIGHTMULT * boostCoeff)) | |
460 | + | let wxPerLpX3 = if ((stakedTotal != 0)) | |
461 | + | then fraction(poolWxEmissionPerBlockX3, MULT8, stakedTotal) | |
455 | 462 | else 0 | |
456 | - | let userWxPerBlockX3 = fraction(wxPerLpX3, | |
457 | - | let boostEmissionPerBlockX3 = (poolWxEmissionPerBlockX3 * | |
458 | - | let tmpUserBoostPerBlockX3 = fraction( | |
459 | - | let userBoostPerBlockX3 = min([tmpUserBoostPerBlockX3, (userWxPerBlockX3 * | |
460 | - | let | |
463 | + | let userWxPerBlockX3 = fraction(wxPerLpX3, stakedByUser, MULT8) | |
464 | + | let boostEmissionPerBlockX3 = (poolWxEmissionPerBlockX3 * (boostCoeff - 1)) | |
465 | + | let tmpUserBoostPerBlockX3 = fraction(userCurrgWxAmount, boostEmissionPerBlockX3, totalCachedGwx) | |
466 | + | let userBoostPerBlockX3 = min([tmpUserBoostPerBlockX3, (userWxPerBlockX3 * (boostCoeff - 1))]) | |
467 | + | let userBoostCoeff = if ((userWxPerBlockX3 == 0)) | |
461 | 468 | then (1 * MULT8) | |
462 | 469 | else fraction((userBoostPerBlockX3 + userWxPerBlockX3), MULT8, userWxPerBlockX3) | |
463 | - | $Tuple2(nil, makeString(["%d%d%s", toString(gWxAmountStartNew), toString( | |
470 | + | $Tuple2(nil, makeString(["%d%d%s", toString(gWxAmountStartNew), toString(userBoostCoeff), "d"], SEP)) | |
464 | 471 | } | |
465 | 472 | ||
466 | 473 | ||
467 | 474 | ||
468 | 475 | @Callable(i) | |
469 | 476 | func wxEmissionStatsREADONLY () = { | |
470 | 477 | let ONEMULT = toString(MULT8) | |
471 | 478 | let ONE = "1" | |
472 | 479 | let wxEmissionPerBlock = getIntOrFail(emissionDapp, keyEmissionRatePerBlockCurrent()) | |
473 | 480 | let emissionStartBlock = getIntOrFail(emissionDapp, keyEmissionStartBlock()) | |
474 | 481 | let passedBlocks = if ((emissionStartBlock > height)) | |
475 | 482 | then 0 | |
476 | 483 | else (height - emissionStartBlock) | |
477 | 484 | let teamEmDuration = (1440 * 365) | |
478 | 485 | let teamEmMax = (201000000 * MULT8) | |
479 | 486 | let teamEm = if ((passedBlocks > teamEmDuration)) | |
480 | 487 | then teamEmMax | |
481 | 488 | else fraction(teamEmMax, passedBlocks, teamEmDuration) | |
482 | 489 | let totalWxReleased = ((wxEmissionPerBlock * passedBlocks) + teamEm) | |
483 | 490 | let totalWxLocked = getIntOrZero(boostingDapp, keyBoostingLockParamTotalAmount()) | |
484 | 491 | let locksDurationSumInBlocks = getIntOrZero(boostingDapp, keyBoostingStatsLocksDurationSumInBlocks()) | |
485 | 492 | let locksCount = getIntOrZero(boostingDapp, keyBoostingStatsLocksCount()) | |
486 | 493 | $Tuple2(nil, makeString(["%d%d%d%d", toString(totalWxReleased), toString(totalWxLocked), toString(locksDurationSumInBlocks), toString(locksCount)], SEP)) | |
487 | 494 | } | |
488 | 495 | ||
489 | 496 | ||
490 | 497 | ||
491 | 498 | @Callable(i) | |
492 | 499 | func poolStatsREADONLY (lpAsset) = { | |
493 | 500 | let poolAddress = addressFromStringValue(getStringByAddressOrFail(factoryDapp, keyFactoryLpAssetToPoolContractAddress(lpAsset))) | |
494 | 501 | let status = { | |
495 | 502 | let @ = invoke(factoryDapp, "getPoolStatusREADONLY", [toString(poolAddress)], nil) | |
496 | 503 | if ($isInstanceOf(@, "Int")) | |
497 | 504 | then @ | |
498 | 505 | else throw(($getType(@) + " couldn't be cast to Int")) | |
499 | 506 | } | |
500 | 507 | let tpl = "%d%d%d%d%d%d%d%d%d%s" | |
501 | 508 | if ((status == 4)) | |
502 | 509 | then $Tuple2(nil, makeString([tpl, toString(0), toString(0), toString(0), toString(0), toString(0), toString(0), toString(0), toString(0), toString(0), toString(false)], SEP)) | |
503 | 510 | else { | |
504 | 511 | let cfg = asAnyList(invoke(poolAddress, "getPoolConfigWrapperREADONLY", nil, nil)) | |
505 | 512 | let lpAssetId = fromBase58String(asString(cfg[idxPoolLPAssetId])) | |
506 | 513 | let amtAssetId = asString(cfg[idxAmtAssetId]) | |
507 | 514 | let priceAssetId = asString(cfg[idxPriceAssetId]) | |
508 | 515 | let iAmtAssetId = asString(cfg[idxIAmtAssetId]) | |
509 | 516 | let iPriceAssetId = asString(cfg[idxIPriceAssetId]) | |
510 | 517 | let amtAssetDcm = parseIntValue(asString(cfg[idxAmtAssetDcm])) | |
511 | 518 | let priceAssetDcm = parseIntValue(asString(cfg[idxPriceAssetDcm])) | |
512 | 519 | let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity | |
513 | 520 | let accAmtAssetBalance = asInt(invoke(poolAddress, "getAccBalanceWrapperREADONLY", [amtAssetId], nil)) | |
514 | 521 | let accPriceAssetBalance = asInt(invoke(poolAddress, "getAccBalanceWrapperREADONLY", [priceAssetId], nil)) | |
515 | 522 | let pricesList = if ((poolLPBalance == 0)) | |
516 | 523 | then [toString(zeroBigInt), toString(zeroBigInt), toString(zeroBigInt)] | |
517 | 524 | else asAnyList(invoke(poolAddress, "calcPricesWrapperREADONLY", [accAmtAssetBalance, accPriceAssetBalance, poolLPBalance], nil)) | |
518 | 525 | let curPrice = 0 | |
519 | 526 | let lpAmtAssetShare = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [pricesList[1], MULT8], nil)) | |
520 | 527 | let lpPriceAssetShare = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [pricesList[2], MULT8], nil)) | |
521 | 528 | let poolWeight = getIntegerValue(factoryDapp, keyFactoryPoolWeight(toString(poolAddress))) | |
522 | 529 | let inFee = getPoolInFee(poolAddress) | |
523 | 530 | let outFee = getPoolOutFee(poolAddress) | |
524 | 531 | let poolOneTokenOperationsDisabled = { | |
525 | 532 | let @ = invoke(factoryDapp, "isPoolOneTokenOperationsDisabledREADONLY", [toString(poolAddress)], nil) | |
526 | 533 | if ($isInstanceOf(@, "Boolean")) | |
527 | 534 | then @ | |
528 | 535 | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
529 | 536 | } | |
530 | 537 | let poolOneTokenOperationsEnabled = !(poolOneTokenOperationsDisabled) | |
531 | 538 | $Tuple2(nil, makeString([tpl, toString(accAmtAssetBalance), toString(accPriceAssetBalance), toString(poolLPBalance), toString(curPrice), toString(lpAmtAssetShare), toString(lpPriceAssetShare), toString(poolWeight), toString(inFee), toString(outFee), toString(poolOneTokenOperationsEnabled)], SEP)) | |
532 | 539 | } | |
533 | 540 | } | |
534 | 541 | ||
535 | 542 | ||
536 | 543 | ||
537 | 544 | @Callable(i) | |
538 | 545 | func poolEvaluatePutByAmountAssetREADONLY (lpAsset,inAmAssetAmt) = { | |
539 | 546 | let poolAddress = addressFromStringValue(getStringByAddressOrFail(factoryDapp, keyFactoryLpAssetToPoolContractAddress(lpAsset))) | |
540 | 547 | let cfg = asAnyList(invoke(poolAddress, "getPoolConfigWrapperREADONLY", nil, nil)) | |
541 | 548 | let lpAssetId = fromBase58String(asString(cfg[idxPoolLPAssetId])) | |
542 | 549 | let amAssetIdStr = asString(cfg[idxAmtAssetId]) | |
543 | 550 | let amAssetId = fromBase58String(amAssetIdStr) | |
544 | 551 | let prAssetIdStr = asString(cfg[idxPriceAssetId]) | |
545 | 552 | let prAssetId = fromBase58String(prAssetIdStr) | |
546 | 553 | let amtAssetDcm = parseIntValue(asString(cfg[idxAmtAssetDcm])) | |
547 | 554 | let priceAssetDcm = parseIntValue(asString(cfg[idxPriceAssetDcm])) | |
548 | 555 | let poolStatus = asString(cfg[idxPoolStatus]) | |
549 | 556 | let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity | |
550 | 557 | let accAmtAssetBalance = asInt(invoke(poolAddress, "getAccBalanceWrapperREADONLY", [amAssetIdStr], nil)) | |
551 | 558 | let accPriceAssetBalance = asInt(invoke(poolAddress, "getAccBalanceWrapperREADONLY", [prAssetIdStr], nil)) | |
552 | 559 | let amtAssetAmtX18 = parseBigIntValue(asString(invoke(poolAddress, "toX18WrapperREADONLY", [accAmtAssetBalance, amtAssetDcm], nil))) | |
553 | 560 | let priceAssetAmtX18 = parseBigIntValue(asString(invoke(poolAddress, "toX18WrapperREADONLY", [accPriceAssetBalance, priceAssetDcm], nil))) | |
554 | 561 | let curPriceX18 = if ((poolLPBalance == 0)) | |
555 | 562 | then zeroBigInt | |
556 | 563 | else parseBigIntValue(asString(invoke(poolAddress, "calcPriceBigIntWrapperREADONLY", [toString(priceAssetAmtX18), toString(amtAssetAmtX18)], nil))) | |
557 | 564 | let curPrice = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [toString(curPriceX18), MULT8], nil)) | |
558 | 565 | let inAmAssetAmtX18 = parseBigIntValue(asString(invoke(poolAddress, "toX18WrapperREADONLY", [inAmAssetAmt, amtAssetDcm], nil))) | |
559 | 566 | let inPrAssetAmtX18 = fraction(inAmAssetAmtX18, curPriceX18, MULT18) | |
560 | 567 | let inPrAssetAmt = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [toString(inPrAssetAmtX18), priceAssetDcm], nil)) | |
561 | 568 | let res = invoke(poolAddress, "estimatePutOperationWrapperREADONLY", ["", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false], nil) | |
562 | - | let $ | |
569 | + | let $t02263122984 = match res { | |
563 | 570 | case _ => | |
564 | 571 | if (if (if ($isInstanceOf($match0._1, "Int")) | |
565 | 572 | then if ($isInstanceOf($match0._3, "Int")) | |
566 | 573 | then if ($isInstanceOf($match0._4, "Int")) | |
567 | 574 | then if ($isInstanceOf($match0._5, "Int")) | |
568 | 575 | then $isInstanceOf($match0._6, "Int") | |
569 | 576 | else false | |
570 | 577 | else false | |
571 | 578 | else false | |
572 | 579 | else false) | |
573 | 580 | then (size($match0) == 13) | |
574 | 581 | else false) | |
575 | 582 | then { | |
576 | 583 | let calcLpAmt = $match0._1 | |
577 | 584 | let curPriceCalc = $match0._3 | |
578 | 585 | let amBalance = $match0._4 | |
579 | 586 | let prBalance = $match0._5 | |
580 | 587 | let lpEmission = $match0._6 | |
581 | 588 | $Tuple5(calcLpAmt, curPriceCalc, amBalance, prBalance, lpEmission) | |
582 | 589 | } | |
583 | 590 | else throw("Couldn't cast types") | |
584 | 591 | } | |
585 | - | let calcLpAmt = $ | |
586 | - | let curPriceCalc = $ | |
587 | - | let amBalance = $ | |
588 | - | let prBalance = $ | |
589 | - | let lpEmission = $ | |
592 | + | let calcLpAmt = $t02263122984._1 | |
593 | + | let curPriceCalc = $t02263122984._2 | |
594 | + | let amBalance = $t02263122984._3 | |
595 | + | let prBalance = $t02263122984._4 | |
596 | + | let lpEmission = $t02263122984._5 | |
590 | 597 | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d", toString(calcLpAmt), toString(curPrice), toString(amBalance), toString(prBalance), toString(lpEmission), poolStatus, toString(inAmAssetAmt), toString(inPrAssetAmt)], SEP)) | |
591 | 598 | } | |
592 | 599 | ||
593 | 600 | ||
594 | 601 | ||
595 | 602 | @Callable(i) | |
596 | 603 | func poolEvaluatePutByPriceAssetREADONLY (lpAsset,inPrAssetAmt) = { | |
597 | 604 | let poolAddress = addressFromStringValue(getStringByAddressOrFail(factoryDapp, keyFactoryLpAssetToPoolContractAddress(lpAsset))) | |
598 | 605 | let cfg = asAnyList(invoke(poolAddress, "getPoolConfigWrapperREADONLY", nil, nil)) | |
599 | 606 | let lpAssetId = fromBase58String(asString(cfg[idxPoolLPAssetId])) | |
600 | 607 | let amAssetIdStr = asString(cfg[idxAmtAssetId]) | |
601 | 608 | let amAssetId = fromBase58String(amAssetIdStr) | |
602 | 609 | let prAssetIdStr = asString(cfg[idxPriceAssetId]) | |
603 | 610 | let prAssetId = fromBase58String(prAssetIdStr) | |
604 | 611 | let amtAssetDcm = parseIntValue(asString(cfg[idxAmtAssetDcm])) | |
605 | 612 | let priceAssetDcm = parseIntValue(asString(cfg[idxPriceAssetDcm])) | |
606 | 613 | let poolStatus = asString(cfg[idxPoolStatus]) | |
607 | 614 | let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity | |
608 | 615 | let amBalanceRaw = asInt(invoke(poolAddress, "getAccBalanceWrapperREADONLY", [amAssetIdStr], nil)) | |
609 | 616 | let prBalanceRaw = asInt(invoke(poolAddress, "getAccBalanceWrapperREADONLY", [prAssetIdStr], nil)) | |
610 | 617 | let amBalanceRawX18 = parseBigIntValue(asString(invoke(poolAddress, "toX18WrapperREADONLY", [amBalanceRaw, amtAssetDcm], nil))) | |
611 | 618 | let prBalanceRawX18 = parseBigIntValue(asString(invoke(poolAddress, "toX18WrapperREADONLY", [prBalanceRaw, priceAssetDcm], nil))) | |
612 | 619 | let curPriceX18 = if ((poolLPBalance == 0)) | |
613 | 620 | then zeroBigInt | |
614 | 621 | else parseBigIntValue(asString(invoke(poolAddress, "calcPriceBigIntWrapperREADONLY", [toString(prBalanceRawX18), toString(amBalanceRawX18)], nil))) | |
615 | 622 | let curPrice = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [toString(curPriceX18), MULT8], nil)) | |
616 | 623 | let inPrAssetAmtX18 = parseBigIntValue(asString(invoke(poolAddress, "toX18WrapperREADONLY", [inPrAssetAmt, priceAssetDcm], nil))) | |
617 | 624 | let inAmAssetAmtX18 = fraction(inPrAssetAmtX18, MULT18, curPriceX18) | |
618 | 625 | let inAmAssetAmt = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [toString(inAmAssetAmtX18), amtAssetDcm], nil)) | |
619 | 626 | let res = invoke(poolAddress, "estimatePutOperationWrapperREADONLY", ["", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false], nil) | |
620 | - | let $ | |
627 | + | let $t02555725910 = match res { | |
621 | 628 | case _ => | |
622 | 629 | if (if (if ($isInstanceOf($match0._1, "Int")) | |
623 | 630 | then if ($isInstanceOf($match0._3, "Int")) | |
624 | 631 | then if ($isInstanceOf($match0._4, "Int")) | |
625 | 632 | then if ($isInstanceOf($match0._5, "Int")) | |
626 | 633 | then $isInstanceOf($match0._6, "Int") | |
627 | 634 | else false | |
628 | 635 | else false | |
629 | 636 | else false | |
630 | 637 | else false) | |
631 | 638 | then (size($match0) == 13) | |
632 | 639 | else false) | |
633 | 640 | then { | |
634 | 641 | let calcLpAmt = $match0._1 | |
635 | 642 | let curPriceCalc = $match0._3 | |
636 | 643 | let amBalance = $match0._4 | |
637 | 644 | let prBalance = $match0._5 | |
638 | 645 | let lpEmission = $match0._6 | |
639 | 646 | $Tuple5(calcLpAmt, curPriceCalc, amBalance, prBalance, lpEmission) | |
640 | 647 | } | |
641 | 648 | else throw("Couldn't cast types") | |
642 | 649 | } | |
643 | - | let calcLpAmt = $ | |
644 | - | let curPriceCalc = $ | |
645 | - | let amBalance = $ | |
646 | - | let prBalance = $ | |
647 | - | let lpEmission = $ | |
650 | + | let calcLpAmt = $t02555725910._1 | |
651 | + | let curPriceCalc = $t02555725910._2 | |
652 | + | let amBalance = $t02555725910._3 | |
653 | + | let prBalance = $t02555725910._4 | |
654 | + | let lpEmission = $t02555725910._5 | |
648 | 655 | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d", toString(calcLpAmt), toString(curPrice), toString(amBalance), toString(prBalance), toString(lpEmission), poolStatus, toString(inAmAssetAmt), toString(inPrAssetAmt)], SEP)) | |
649 | 656 | } | |
650 | 657 | ||
651 | 658 | ||
652 | 659 | ||
653 | 660 | @Callable(i) | |
654 | 661 | func poolEvaluateGetREADONLY (paymentLpAssetId,paymentLpAmt) = { | |
655 | 662 | let poolAddress = addressFromStringValue(getStringByAddressOrFail(factoryDapp, keyFactoryLpAssetToPoolContractAddress(paymentLpAssetId))) | |
656 | 663 | let res = invoke(poolAddress, "estimateGetOperationWrapperREADONLY", ["", paymentLpAssetId, paymentLpAmt, toString(poolAddress)], nil) | |
657 | - | let $ | |
664 | + | let $t02660527022 = match res { | |
658 | 665 | case _ => | |
659 | 666 | if (if (if ($isInstanceOf($match0._1, "Int")) | |
660 | 667 | then if ($isInstanceOf($match0._2, "Int")) | |
661 | 668 | then if ($isInstanceOf($match0._5, "Int")) | |
662 | 669 | then if ($isInstanceOf($match0._6, "Int")) | |
663 | 670 | then if ($isInstanceOf($match0._7, "Int")) | |
664 | 671 | then if ($isInstanceOf($match0._8, "String")) | |
665 | 672 | then $isInstanceOf($match0._9, "String") | |
666 | 673 | else false | |
667 | 674 | else false | |
668 | 675 | else false | |
669 | 676 | else false | |
670 | 677 | else false | |
671 | 678 | else false) | |
672 | 679 | then (size($match0) == 10) | |
673 | 680 | else false) | |
674 | 681 | then { | |
675 | 682 | let outAmAmt = $match0._1 | |
676 | 683 | let outPrAmt = $match0._2 | |
677 | 684 | let amBalance = $match0._5 | |
678 | 685 | let prBalance = $match0._6 | |
679 | 686 | let lpEmission = $match0._7 | |
680 | 687 | let curPrice = $match0._8 | |
681 | 688 | let poolStatus = $match0._9 | |
682 | 689 | $Tuple7(outAmAmt, outPrAmt, amBalance, prBalance, lpEmission, curPrice, poolStatus) | |
683 | 690 | } | |
684 | 691 | else throw("Couldn't cast types") | |
685 | 692 | } | |
686 | - | let outAmAmt = $ | |
687 | - | let outPrAmt = $ | |
688 | - | let amBalance = $ | |
689 | - | let prBalance = $ | |
690 | - | let lpEmission = $ | |
691 | - | let curPrice = $ | |
692 | - | let poolStatus = $ | |
693 | + | let outAmAmt = $t02660527022._1 | |
694 | + | let outPrAmt = $t02660527022._2 | |
695 | + | let amBalance = $t02660527022._3 | |
696 | + | let prBalance = $t02660527022._4 | |
697 | + | let lpEmission = $t02660527022._5 | |
698 | + | let curPrice = $t02660527022._6 | |
699 | + | let poolStatus = $t02660527022._7 | |
693 | 700 | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d", toString(outAmAmt), toString(outPrAmt), toString(amBalance), toString(prBalance), toString(lpEmission), curPrice, poolStatus], SEP)) | |
694 | 701 | } | |
695 | 702 | ||
696 | 703 | ||
697 | 704 | ||
698 | 705 | @Callable(i) | |
699 | 706 | func gwxUserInfoREADONLY (userAddress) = { | |
700 | 707 | let gwxUserInfoLIST = asAnyList(invoke(boostingDapp, "gwxUserInfoREADONLY", [userAddress], nil)) | |
701 | 708 | let gwxAmount = asInt(gwxUserInfoLIST[0]) | |
702 | 709 | $Tuple2(nil, makeString(["%d", toString(gwxAmount)], SEP)) | |
703 | 710 | } | |
704 | 711 | ||
705 | 712 | ||
706 | 713 | ||
707 | 714 | @Callable(i) | |
708 | 715 | func unstakeAndGetOneTknV2 (poolAddress,unstakeAmount,outAssetId,minOutAmount) = { | |
709 | 716 | let inv = invoke(addressFromStringValue(poolAddress), "unstakeAndGetOneTknV2", [unstakeAmount, outAssetId, minOutAmount], nil) | |
710 | 717 | if ((inv == inv)) | |
711 | 718 | then $Tuple2(nil, unit) | |
712 | 719 | else throw("Strict value is not equal to itself.") | |
713 | 720 | } | |
714 | 721 | ||
715 | 722 | ||
716 | 723 | ||
717 | 724 | @Callable(i) | |
718 | 725 | func getKeysBulkInternal (currentIter,keys,resAcc) = if ((currentIter == size(keys))) | |
719 | 726 | then $Tuple2(nil, resAcc) | |
720 | 727 | else { | |
721 | 728 | let k = split(keys[currentIter], "++") | |
722 | 729 | let addr = addressFromStringValue(k[0]) | |
723 | 730 | let key = k[1] | |
724 | 731 | let type = k[2] | |
725 | 732 | let val = getKey(addr, key, type) | |
726 | 733 | let res = (resAcc :+ val) | |
727 | 734 | let inv = invoke(this, "getKeysBulkInternal", [(currentIter + 1), keys, res], nil) | |
728 | 735 | if ((inv == inv)) | |
729 | 736 | then $Tuple2(nil, inv) | |
730 | 737 | else throw("Strict value is not equal to itself.") | |
731 | 738 | } | |
732 | 739 | ||
733 | 740 | ||
734 | 741 | ||
735 | 742 | @Callable(i) | |
736 | 743 | func getKeysBulk (keys) = { | |
737 | 744 | let res = invoke(this, "getKeysBulkInternal", [0, keys, nil], nil) | |
738 | 745 | $Tuple2(nil, res) | |
739 | 746 | } | |
740 | 747 | ||
741 | 748 | ||
742 | 749 | ||
743 | 750 | @Callable(i) | |
744 | 751 | func setManager (pendingManagerPublicKey) = { | |
745 | 752 | let checkCaller = mustManager(i) | |
746 | 753 | if ((checkCaller == checkCaller)) | |
747 | 754 | then { | |
748 | 755 | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
749 | 756 | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
750 | 757 | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
751 | 758 | else throw("Strict value is not equal to itself.") | |
752 | 759 | } | |
753 | 760 | else throw("Strict value is not equal to itself.") | |
754 | 761 | } | |
755 | 762 | ||
756 | 763 | ||
757 | 764 | ||
758 | 765 | @Callable(i) | |
759 | 766 | func confirmManager () = { | |
760 | 767 | let pm = pendingManagerPublicKeyOrUnit() | |
761 | 768 | let hasPM = if (isDefined(pm)) | |
762 | 769 | then true | |
763 | 770 | else throw("No pending manager") | |
764 | 771 | if ((hasPM == hasPM)) | |
765 | 772 | then { | |
766 | 773 | let checkPM = if ((i.callerPublicKey == value(pm))) | |
767 | 774 | then true | |
768 | 775 | else throw("You are not pending manager") | |
769 | 776 | if ((checkPM == checkPM)) | |
770 | 777 | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
771 | 778 | else throw("Strict value is not equal to itself.") | |
772 | 779 | } | |
773 | 780 | else throw("Strict value is not equal to itself.") | |
774 | 781 | } | |
775 | 782 | ||
776 | 783 | ||
777 | 784 | @Verifier(tx) | |
778 | 785 | func verify () = { | |
779 | 786 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
780 | 787 | case pk: ByteVector => | |
781 | 788 | pk | |
782 | 789 | case _: Unit => | |
783 | 790 | tx.senderPublicKey | |
784 | 791 | case _ => | |
785 | 792 | throw("Match error") | |
786 | 793 | } | |
787 | 794 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
788 | 795 | } | |
789 | 796 |
github/deemru/w8io/169f3d6 109.68 ms ◑