tx · FNZVPxjTJqMXdbmxZu2CkUHQrQsetpDJ4wFgrAKmkdsy 3MsNhK6uve98J6DeqbuwGFBRh9GoHPGUFgp: -0.02300000 Waves 2023.03.22 14:28 [2501163] smart account 3MsNhK6uve98J6DeqbuwGFBRh9GoHPGUFgp > SELF 0.00000000 Waves
{ "type": 13, "id": "FNZVPxjTJqMXdbmxZu2CkUHQrQsetpDJ4wFgrAKmkdsy", "fee": 2300000, "feeAssetId": null, "timestamp": 1679484560415, "version": 2, "chainId": 84, "sender": "3MsNhK6uve98J6DeqbuwGFBRh9GoHPGUFgp", "senderPublicKey": "86RHVxKovtU7yKnepY8wKsd8niDxGAsiwuA1XA1DNqrS", "proofs": [ "3RWMycTPtBk5sTZ9fUrRtfgYkFZ1xQY3NuPJ7yjz78HZttqrWcBDcv5vUALXKMCmGRM9wH1t9MtMfdDMQXL2U3aP" ], "script": "base64:BgKPIggCEgMKAQgSAwoBCBIECgIICBIJCgcBERERGAgYEgcKBRERERgIEgcKBQEBAQgIEgASAwoBCBIECgIIARIECgIIARIECgIIARIDCgEIEgYKBAgBCAESBQoDARgYEgMKARgSAwoBCBIAIgZTQ0FMRTgiBU1VTFQ4IgdTQ0FMRTE4IgZNVUxUMTgiA1NFUCIOUE9PTFdFSUdIVE1VTFQiCnplcm9CaWdJbnQiDmlkeFBvb2xBZGRyZXNzIg1pZHhQb29sU3RhdHVzIhBpZHhQb29sTFBBc3NldElkIg1pZHhBbXRBc3NldElkIg9pZHhQcmljZUFzc2V0SWQiDmlkeEFtdEFzc2V0RGNtIhBpZHhQcmljZUFzc2V0RGNtIg5pZHhJQW10QXNzZXRJZCIQaWR4SVByaWNlQXNzZXRJZCINaWR4TFBBc3NldERjbSIPZ2V0U3RyaW5nT3JGYWlsIgNrZXkiGGdldFN0cmluZ0J5QWRkcmVzc09yRmFpbCIHYWRkcmVzcyIMZ2V0SW50T3JaZXJvIgxnZXRJbnRPckZhaWwiCWFzQW55TGlzdCIDdmFsIgckbWF0Y2gw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0CAUCZWQPc2VuZGVyUHVibGljS2V5CQACAQILTWF0Y2ggZXJyb3IJAPQDAwgFAmVkCWJvZHlCeXRlcwkAkQMCCAUCZWQGcHJvb2ZzAAAFAmVm12kILA==", "height": 2501163, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Hy8UmssTBsV9tRnP3KGhEaZX5MQkVbccHxDRKAJW9eaL Next: FYd6ctx7BzVJKZKgNymUPxboVskUq6QN8ciBAUMsYGAy 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 = { | |
266 | - | let @ = invoke(emissionDapp, "getBoostCoeffREADONLY", nil, nil) | |
267 | - | if ($isInstanceOf(@, "Int")) | |
268 | - | then @ | |
269 | - | else throw(($getType(@) + " couldn't be cast to Int")) | |
270 | - | } | |
265 | + | let boostMaxCoeff = 3 | |
271 | 266 | let poolWxEmissionPerBlock = (fraction(wxEmissionPerBlock, poolWeight, poolWeightMult) / boostMaxCoeff) | |
272 | 267 | let poolWxEmissionPerBlockMax = fraction(wxEmissionPerBlockMax, poolWeight, poolWeightMult) | |
273 | 268 | let maxFactor = (boostMaxCoeff * MULT8) | |
345 | 340 | let wxEmissionPerBlock = rewardData[0] | |
346 | 341 | let maxFactor = rewardData[1] | |
347 | 342 | let totalLpStaked = rewardData[2] | |
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)) | |
343 | + | $Tuple2(nil, makeString(["%d%d%d", toString(wxEmissionPerBlock), toString(maxFactor), toString(totalLpStaked)], SEP)) | |
355 | 344 | } | |
356 | 345 | ||
357 | 346 | ||
413 | 402 | ||
414 | 403 | @Callable(i) | |
415 | 404 | 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 | - | } | |
422 | 405 | let mathDapp = gwxRewardDapp | |
423 | 406 | let EMPTYSTR = "empty" | |
424 | 407 | let maxLockDurationInBlocks = parseIntValue(split(getStringByAddressOrFail(boostingDapp, keyBoostCfg()), SEP)[4]) | |
438 | 421 | let lockDurationNew = min([(remainingDuration + deltaLockPeriodInBlocks), maxLockDurationInBlocks]) | |
439 | 422 | let userCurrgWxAmount = asInt(asAnyList(invoke(boostingDapp, "gwxUserInfoREADONLY", [userAddressStr], nil))[0]) | |
440 | 423 | 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) | |
441 | 432 | let totalCachedGwx = { | |
442 | 433 | let @ = invoke(boostingDapp, "getTotalCachedGwxREADONLY", nil, nil) | |
443 | 434 | if ($isInstanceOf(@, "Int")) | |
450 | 441 | let stakedTotalKEY = keyStakedTotal(lpAssetIdStr) | |
451 | 442 | let stakedByUser = readStaked(stakingDapp, stakedByUserKEY) | |
452 | 443 | let stakedTotal = readStaked(stakingDapp, stakedTotalKEY) | |
444 | + | let stakedByUserNew = (stakedByUser + deltaLpAmount) | |
445 | + | let stakedTotalNew = (stakedTotal + deltaLpAmount) | |
453 | 446 | let poolWeight = if ((lpAssetIdStr != EMPTYSTR)) | |
454 | 447 | then { | |
455 | 448 | let poolAddressStr = valueOrErrorMessage(getString(factoryDapp, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr)) | |
456 | 449 | getIntegerValue(factoryDapp, keyFactoryPoolWeight(poolAddressStr)) | |
457 | 450 | } | |
458 | 451 | else 0 | |
459 | - | let poolWxEmissionPerBlockX3 = fraction(wxEmissionPerBlockX3, poolWeight, (POOLWEIGHTMULT * | |
460 | - | let wxPerLpX3 = if (( | |
461 | - | then fraction(poolWxEmissionPerBlockX3, MULT8, | |
452 | + | let poolWxEmissionPerBlockX3 = fraction(wxEmissionPerBlockX3, poolWeight, (POOLWEIGHTMULT * 3)) | |
453 | + | let wxPerLpX3 = if ((stakedTotalNew != 0)) | |
454 | + | then fraction(poolWxEmissionPerBlockX3, MULT8, stakedTotalNew) | |
462 | 455 | else 0 | |
463 | - | let userWxPerBlockX3 = fraction(wxPerLpX3, | |
464 | - | let boostEmissionPerBlockX3 = (poolWxEmissionPerBlockX3 * | |
465 | - | let tmpUserBoostPerBlockX3 = fraction( | |
466 | - | let userBoostPerBlockX3 = min([tmpUserBoostPerBlockX3, (userWxPerBlockX3 * | |
467 | - | let | |
456 | + | let userWxPerBlockX3 = fraction(wxPerLpX3, stakedByUserNew, MULT8) | |
457 | + | let boostEmissionPerBlockX3 = (poolWxEmissionPerBlockX3 * 2) | |
458 | + | let tmpUserBoostPerBlockX3 = fraction(gWxAmountStartNew, boostEmissionPerBlockX3, (totalCachedGwx + gWxAmountDiff)) | |
459 | + | let userBoostPerBlockX3 = min([tmpUserBoostPerBlockX3, (userWxPerBlockX3 * 2)]) | |
460 | + | let boostCoeff = if ((userWxPerBlockX3 == 0)) | |
468 | 461 | then (1 * MULT8) | |
469 | 462 | else fraction((userBoostPerBlockX3 + userWxPerBlockX3), MULT8, userWxPerBlockX3) | |
470 | - | $Tuple2(nil, makeString(["%d%d%s", toString(gWxAmountStartNew), toString( | |
463 | + | $Tuple2(nil, makeString(["%d%d%s", toString(gWxAmountStartNew), toString(boostCoeff), "d"], SEP)) | |
471 | 464 | } | |
472 | 465 | ||
473 | 466 | ||
566 | 559 | let inPrAssetAmtX18 = fraction(inAmAssetAmtX18, curPriceX18, MULT18) | |
567 | 560 | let inPrAssetAmt = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [toString(inPrAssetAmtX18), priceAssetDcm], nil)) | |
568 | 561 | let res = invoke(poolAddress, "estimatePutOperationWrapperREADONLY", ["", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false], nil) | |
569 | - | let $ | |
562 | + | let $t02336423717 = match res { | |
570 | 563 | case _ => | |
571 | 564 | if (if (if ($isInstanceOf($match0._1, "Int")) | |
572 | 565 | then if ($isInstanceOf($match0._3, "Int")) | |
589 | 582 | } | |
590 | 583 | else throw("Couldn't cast types") | |
591 | 584 | } | |
592 | - | let calcLpAmt = $ | |
593 | - | let curPriceCalc = $ | |
594 | - | let amBalance = $ | |
595 | - | let prBalance = $ | |
596 | - | let lpEmission = $ | |
585 | + | let calcLpAmt = $t02336423717._1 | |
586 | + | let curPriceCalc = $t02336423717._2 | |
587 | + | let amBalance = $t02336423717._3 | |
588 | + | let prBalance = $t02336423717._4 | |
589 | + | let lpEmission = $t02336423717._5 | |
597 | 590 | $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)) | |
598 | 591 | } | |
599 | 592 | ||
624 | 617 | let inAmAssetAmtX18 = fraction(inPrAssetAmtX18, MULT18, curPriceX18) | |
625 | 618 | let inAmAssetAmt = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [toString(inAmAssetAmtX18), amtAssetDcm], nil)) | |
626 | 619 | let res = invoke(poolAddress, "estimatePutOperationWrapperREADONLY", ["", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false], nil) | |
627 | - | let $ | |
620 | + | let $t02629026643 = match res { | |
628 | 621 | case _ => | |
629 | 622 | if (if (if ($isInstanceOf($match0._1, "Int")) | |
630 | 623 | then if ($isInstanceOf($match0._3, "Int")) | |
647 | 640 | } | |
648 | 641 | else throw("Couldn't cast types") | |
649 | 642 | } | |
650 | - | let calcLpAmt = $ | |
651 | - | let curPriceCalc = $ | |
652 | - | let amBalance = $ | |
653 | - | let prBalance = $ | |
654 | - | let lpEmission = $ | |
643 | + | let calcLpAmt = $t02629026643._1 | |
644 | + | let curPriceCalc = $t02629026643._2 | |
645 | + | let amBalance = $t02629026643._3 | |
646 | + | let prBalance = $t02629026643._4 | |
647 | + | let lpEmission = $t02629026643._5 | |
655 | 648 | $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)) | |
656 | 649 | } | |
657 | 650 | ||
661 | 654 | func poolEvaluateGetREADONLY (paymentLpAssetId,paymentLpAmt) = { | |
662 | 655 | let poolAddress = addressFromStringValue(getStringByAddressOrFail(factoryDapp, keyFactoryLpAssetToPoolContractAddress(paymentLpAssetId))) | |
663 | 656 | let res = invoke(poolAddress, "estimateGetOperationWrapperREADONLY", ["", paymentLpAssetId, paymentLpAmt, toString(poolAddress)], nil) | |
664 | - | let $ | |
657 | + | let $t02733827755 = match res { | |
665 | 658 | case _ => | |
666 | 659 | if (if (if ($isInstanceOf($match0._1, "Int")) | |
667 | 660 | then if ($isInstanceOf($match0._2, "Int")) | |
690 | 683 | } | |
691 | 684 | else throw("Couldn't cast types") | |
692 | 685 | } | |
693 | - | let outAmAmt = $ | |
694 | - | let outPrAmt = $ | |
695 | - | let amBalance = $ | |
696 | - | let prBalance = $ | |
697 | - | let lpEmission = $ | |
698 | - | let curPrice = $ | |
699 | - | let poolStatus = $ | |
686 | + | let outAmAmt = $t02733827755._1 | |
687 | + | let outPrAmt = $t02733827755._2 | |
688 | + | let amBalance = $t02733827755._3 | |
689 | + | let prBalance = $t02733827755._4 | |
690 | + | let lpEmission = $t02733827755._5 | |
691 | + | let curPrice = $t02733827755._6 | |
692 | + | let poolStatus = $t02733827755._7 | |
700 | 693 | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d", toString(outAmAmt), toString(outPrAmt), toString(amBalance), toString(prBalance), toString(lpEmission), curPrice, poolStatus], SEP)) | |
701 | 694 | } | |
702 | 695 |
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 = { | |
266 | - | let @ = invoke(emissionDapp, "getBoostCoeffREADONLY", nil, nil) | |
267 | - | if ($isInstanceOf(@, "Int")) | |
268 | - | then @ | |
269 | - | else throw(($getType(@) + " couldn't be cast to Int")) | |
270 | - | } | |
265 | + | let boostMaxCoeff = 3 | |
271 | 266 | let poolWxEmissionPerBlock = (fraction(wxEmissionPerBlock, poolWeight, poolWeightMult) / boostMaxCoeff) | |
272 | 267 | let poolWxEmissionPerBlockMax = fraction(wxEmissionPerBlockMax, poolWeight, poolWeightMult) | |
273 | 268 | let maxFactor = (boostMaxCoeff * MULT8) | |
274 | 269 | let totalLpStaked = getIntOrZero(stakingDapp, keyStakedTotal(lpAssetId)) | |
275 | 270 | [poolWxEmissionPerBlock, maxFactor, totalLpStaked] | |
276 | 271 | } | |
277 | 272 | ||
278 | 273 | ||
279 | 274 | func calcGwxAmountStartREADONLY (lockAmount,lockDuration,maxLockDuration) = { | |
280 | 275 | let coeffX8 = fraction(lockDuration, MULT8, maxLockDuration) | |
281 | 276 | let gWxAmountStart = fraction(lockAmount, coeffX8, MULT8) | |
282 | 277 | [gWxAmountStart] | |
283 | 278 | } | |
284 | 279 | ||
285 | 280 | ||
286 | 281 | func getKey (addr,key,type) = if ((type == "string")) | |
287 | 282 | then getStringValue(addr, key) | |
288 | 283 | else if ((type == "integer")) | |
289 | 284 | then toString(getIntegerValue(addr, key)) | |
290 | 285 | else if ((type == "boolean")) | |
291 | 286 | then toString(getBooleanValue(addr, key)) | |
292 | 287 | else throw("unknown type. expected string/integer/boolean") | |
293 | 288 | ||
294 | 289 | ||
295 | 290 | func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) { | |
296 | 291 | case s: String => | |
297 | 292 | fromBase58String(s) | |
298 | 293 | case _: Unit => | |
299 | 294 | unit | |
300 | 295 | case _ => | |
301 | 296 | throw("Match error") | |
302 | 297 | } | |
303 | 298 | ||
304 | 299 | ||
305 | 300 | func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) { | |
306 | 301 | case s: String => | |
307 | 302 | fromBase58String(s) | |
308 | 303 | case _: Unit => | |
309 | 304 | unit | |
310 | 305 | case _ => | |
311 | 306 | throw("Match error") | |
312 | 307 | } | |
313 | 308 | ||
314 | 309 | ||
315 | 310 | func mustManager (i) = { | |
316 | 311 | let pd = throw("Permission denied") | |
317 | 312 | match managerPublicKeyOrUnit() { | |
318 | 313 | case pk: ByteVector => | |
319 | 314 | if ((i.callerPublicKey == pk)) | |
320 | 315 | then true | |
321 | 316 | else pd | |
322 | 317 | case _: Unit => | |
323 | 318 | if ((i.caller == this)) | |
324 | 319 | then true | |
325 | 320 | else pd | |
326 | 321 | case _ => | |
327 | 322 | throw("Match error") | |
328 | 323 | } | |
329 | 324 | } | |
330 | 325 | ||
331 | 326 | ||
332 | 327 | @Callable(i) | |
333 | 328 | func constructor (factoryAddress) = { | |
334 | 329 | let checkCaller = mustManager(i) | |
335 | 330 | if ((checkCaller == checkCaller)) | |
336 | 331 | then [StringEntry(keyFactoryAddress(), factoryAddress)] | |
337 | 332 | else throw("Strict value is not equal to itself.") | |
338 | 333 | } | |
339 | 334 | ||
340 | 335 | ||
341 | 336 | ||
342 | 337 | @Callable(i) | |
343 | 338 | func currentRewardRateREADONLY (lpAssetId) = { | |
344 | 339 | let rewardData = internalCurrentRewardRate(lpAssetId) | |
345 | 340 | let wxEmissionPerBlock = rewardData[0] | |
346 | 341 | let maxFactor = rewardData[1] | |
347 | 342 | let totalLpStaked = rewardData[2] | |
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)) | |
343 | + | $Tuple2(nil, makeString(["%d%d%d", toString(wxEmissionPerBlock), toString(maxFactor), toString(totalLpStaked)], SEP)) | |
355 | 344 | } | |
356 | 345 | ||
357 | 346 | ||
358 | 347 | ||
359 | 348 | @Callable(i) | |
360 | 349 | func currentUserRewardRateREADONLY (lpAssetId,userAddress) = { | |
361 | 350 | let rewardData = internalCurrentRewardRate(lpAssetId) | |
362 | 351 | let wxEmissionPerBlock = rewardData[0] | |
363 | 352 | let maxFactor = rewardData[1] | |
364 | 353 | let totalLpStaked = rewardData[2] | |
365 | 354 | let lpStakedByUser = getIntOrZero(stakingDapp, keyStakedByUser(userAddress, lpAssetId)) | |
366 | 355 | let userClaimInfo = split(asString(invoke(stakingDapp, "claimWxREADONLY", [lpAssetId, userAddress], nil)), SEP) | |
367 | 356 | let minRewardPart = valueOrErrorMessage(parseInt(userClaimInfo[5]), "couldn't parse minRewardPart") | |
368 | 357 | let boostRewardPart = valueOrErrorMessage(parseInt(userClaimInfo[6]), "couldn't parse boostRewardPart") | |
369 | 358 | let debug = userClaimInfo[7] | |
370 | 359 | let boostingPower = if ((boostRewardPart == 0)) | |
371 | 360 | then (1 * MULT8) | |
372 | 361 | else fraction((minRewardPart + boostRewardPart), MULT8, minRewardPart) | |
373 | 362 | $Tuple2(nil, makeString(["%d%d%d%d%d%s", toString(wxEmissionPerBlock), toString(maxFactor), toString(totalLpStaked), toString(lpStakedByUser), toString(boostingPower), debug], SEP)) | |
374 | 363 | } | |
375 | 364 | ||
376 | 365 | ||
377 | 366 | ||
378 | 367 | @Callable(i) | |
379 | 368 | func calcBoostBulkInternalREADONLY (currentIter,deltaWxAmountBulk,deltaLockPeriodInBlocksBulk,deltaLpAmountBulk,lpAssetIdOptBulk,userAddressOpt,resAcc) = if ((currentIter == size(deltaWxAmountBulk))) | |
380 | 369 | then $Tuple2(nil, resAcc) | |
381 | 370 | else { | |
382 | 371 | let deltaWxAmount = deltaWxAmountBulk[currentIter] | |
383 | 372 | let deltaLockPeriodInBlocks = deltaLockPeriodInBlocksBulk[currentIter] | |
384 | 373 | let deltaLpAmount = deltaLpAmountBulk[currentIter] | |
385 | 374 | let lpAssetIdOpt = lpAssetIdOptBulk[currentIter] | |
386 | 375 | let info = { | |
387 | 376 | let @ = invoke(this, "calcBoostREADONLY", [deltaWxAmount, deltaLockPeriodInBlocks, deltaLpAmount, lpAssetIdOpt, userAddressOpt], nil) | |
388 | 377 | if ($isInstanceOf(@, "String")) | |
389 | 378 | then @ | |
390 | 379 | else throw(($getType(@) + " couldn't be cast to String")) | |
391 | 380 | } | |
392 | 381 | let res = (resAcc :+ info) | |
393 | 382 | let inv = { | |
394 | 383 | let @ = invoke(this, "calcBoostBulkInternalREADONLY", [(currentIter + 1), deltaWxAmountBulk, deltaLockPeriodInBlocksBulk, deltaLpAmountBulk, lpAssetIdOptBulk, userAddressOpt, res], nil) | |
395 | 384 | if ($isInstanceOf(@, "List[Any]")) | |
396 | 385 | then @ | |
397 | 386 | else throw(($getType(@) + " couldn't be cast to List[Any]")) | |
398 | 387 | } | |
399 | 388 | if ((inv == inv)) | |
400 | 389 | then $Tuple2(nil, inv) | |
401 | 390 | else throw("Strict value is not equal to itself.") | |
402 | 391 | } | |
403 | 392 | ||
404 | 393 | ||
405 | 394 | ||
406 | 395 | @Callable(i) | |
407 | 396 | func calcBoostBulkREADONLY (deltaWxAmount,deltaLockPeriodInBlocks,deltaLpAmount,lpAssetIdOpt,userAddressOpt) = { | |
408 | 397 | let res = invoke(this, "calcBoostBulkInternalREADONLY", [0, deltaWxAmount, deltaLockPeriodInBlocks, deltaLpAmount, lpAssetIdOpt, userAddressOpt, nil], nil) | |
409 | 398 | $Tuple2(nil, res) | |
410 | 399 | } | |
411 | 400 | ||
412 | 401 | ||
413 | 402 | ||
414 | 403 | @Callable(i) | |
415 | 404 | 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 | - | } | |
422 | 405 | let mathDapp = gwxRewardDapp | |
423 | 406 | let EMPTYSTR = "empty" | |
424 | 407 | let maxLockDurationInBlocks = parseIntValue(split(getStringByAddressOrFail(boostingDapp, keyBoostCfg()), SEP)[4]) | |
425 | 408 | let lpAssetIdStr = if ((lpAssetIdOpt == "")) | |
426 | 409 | then EMPTYSTR | |
427 | 410 | else lpAssetIdOpt | |
428 | 411 | let userAddressStr = if ((userAddressOpt == "")) | |
429 | 412 | then EMPTYSTR | |
430 | 413 | else userAddressOpt | |
431 | 414 | let userNumStr = valueOrElse(getString(boostingDapp, keyUser2NumMapping(userAddressOpt)), EMPTYSTR) | |
432 | 415 | let userAmount = valueOrElse(getInteger(boostingDapp, keyLockParamUserAmount(userNumStr)), 0) | |
433 | 416 | let lockStart = valueOrElse(getInteger(boostingDapp, keyLockParamStartBlock(userNumStr)), height) | |
434 | 417 | let lockDuration = valueOrElse(getInteger(boostingDapp, keyLockParamDuration(userNumStr)), 0) | |
435 | 418 | let lockEnd = (lockStart + lockDuration) | |
436 | 419 | let remainingDuration = max([(lockEnd - height), 0]) | |
437 | 420 | let userAmountNew = (userAmount + deltaWxAmount) | |
438 | 421 | let lockDurationNew = min([(remainingDuration + deltaLockPeriodInBlocks), maxLockDurationInBlocks]) | |
439 | 422 | let userCurrgWxAmount = asInt(asAnyList(invoke(boostingDapp, "gwxUserInfoREADONLY", [userAddressStr], nil))[0]) | |
440 | 423 | 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) | |
441 | 432 | let totalCachedGwx = { | |
442 | 433 | let @ = invoke(boostingDapp, "getTotalCachedGwxREADONLY", nil, nil) | |
443 | 434 | if ($isInstanceOf(@, "Int")) | |
444 | 435 | then @ | |
445 | 436 | else throw(($getType(@) + " couldn't be cast to Int")) | |
446 | 437 | } | |
447 | 438 | let MULT3 = 1000 | |
448 | 439 | let wxEmissionPerBlockX3 = (getIntOrFail(emissionDapp, keyEmissionRatePerBlockCurrent()) * MULT3) | |
449 | 440 | let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr) | |
450 | 441 | let stakedTotalKEY = keyStakedTotal(lpAssetIdStr) | |
451 | 442 | let stakedByUser = readStaked(stakingDapp, stakedByUserKEY) | |
452 | 443 | let stakedTotal = readStaked(stakingDapp, stakedTotalKEY) | |
444 | + | let stakedByUserNew = (stakedByUser + deltaLpAmount) | |
445 | + | let stakedTotalNew = (stakedTotal + deltaLpAmount) | |
453 | 446 | let poolWeight = if ((lpAssetIdStr != EMPTYSTR)) | |
454 | 447 | then { | |
455 | 448 | let poolAddressStr = valueOrErrorMessage(getString(factoryDapp, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr)) | |
456 | 449 | getIntegerValue(factoryDapp, keyFactoryPoolWeight(poolAddressStr)) | |
457 | 450 | } | |
458 | 451 | else 0 | |
459 | - | let poolWxEmissionPerBlockX3 = fraction(wxEmissionPerBlockX3, poolWeight, (POOLWEIGHTMULT * | |
460 | - | let wxPerLpX3 = if (( | |
461 | - | then fraction(poolWxEmissionPerBlockX3, MULT8, | |
452 | + | let poolWxEmissionPerBlockX3 = fraction(wxEmissionPerBlockX3, poolWeight, (POOLWEIGHTMULT * 3)) | |
453 | + | let wxPerLpX3 = if ((stakedTotalNew != 0)) | |
454 | + | then fraction(poolWxEmissionPerBlockX3, MULT8, stakedTotalNew) | |
462 | 455 | else 0 | |
463 | - | let userWxPerBlockX3 = fraction(wxPerLpX3, | |
464 | - | let boostEmissionPerBlockX3 = (poolWxEmissionPerBlockX3 * | |
465 | - | let tmpUserBoostPerBlockX3 = fraction( | |
466 | - | let userBoostPerBlockX3 = min([tmpUserBoostPerBlockX3, (userWxPerBlockX3 * | |
467 | - | let | |
456 | + | let userWxPerBlockX3 = fraction(wxPerLpX3, stakedByUserNew, MULT8) | |
457 | + | let boostEmissionPerBlockX3 = (poolWxEmissionPerBlockX3 * 2) | |
458 | + | let tmpUserBoostPerBlockX3 = fraction(gWxAmountStartNew, boostEmissionPerBlockX3, (totalCachedGwx + gWxAmountDiff)) | |
459 | + | let userBoostPerBlockX3 = min([tmpUserBoostPerBlockX3, (userWxPerBlockX3 * 2)]) | |
460 | + | let boostCoeff = if ((userWxPerBlockX3 == 0)) | |
468 | 461 | then (1 * MULT8) | |
469 | 462 | else fraction((userBoostPerBlockX3 + userWxPerBlockX3), MULT8, userWxPerBlockX3) | |
470 | - | $Tuple2(nil, makeString(["%d%d%s", toString(gWxAmountStartNew), toString( | |
463 | + | $Tuple2(nil, makeString(["%d%d%s", toString(gWxAmountStartNew), toString(boostCoeff), "d"], SEP)) | |
471 | 464 | } | |
472 | 465 | ||
473 | 466 | ||
474 | 467 | ||
475 | 468 | @Callable(i) | |
476 | 469 | func wxEmissionStatsREADONLY () = { | |
477 | 470 | let ONEMULT = toString(MULT8) | |
478 | 471 | let ONE = "1" | |
479 | 472 | let wxEmissionPerBlock = getIntOrFail(emissionDapp, keyEmissionRatePerBlockCurrent()) | |
480 | 473 | let emissionStartBlock = getIntOrFail(emissionDapp, keyEmissionStartBlock()) | |
481 | 474 | let passedBlocks = if ((emissionStartBlock > height)) | |
482 | 475 | then 0 | |
483 | 476 | else (height - emissionStartBlock) | |
484 | 477 | let teamEmDuration = (1440 * 365) | |
485 | 478 | let teamEmMax = (201000000 * MULT8) | |
486 | 479 | let teamEm = if ((passedBlocks > teamEmDuration)) | |
487 | 480 | then teamEmMax | |
488 | 481 | else fraction(teamEmMax, passedBlocks, teamEmDuration) | |
489 | 482 | let totalWxReleased = ((wxEmissionPerBlock * passedBlocks) + teamEm) | |
490 | 483 | let totalWxLocked = getIntOrZero(boostingDapp, keyBoostingLockParamTotalAmount()) | |
491 | 484 | let locksDurationSumInBlocks = getIntOrZero(boostingDapp, keyBoostingStatsLocksDurationSumInBlocks()) | |
492 | 485 | let locksCount = getIntOrZero(boostingDapp, keyBoostingStatsLocksCount()) | |
493 | 486 | $Tuple2(nil, makeString(["%d%d%d%d", toString(totalWxReleased), toString(totalWxLocked), toString(locksDurationSumInBlocks), toString(locksCount)], SEP)) | |
494 | 487 | } | |
495 | 488 | ||
496 | 489 | ||
497 | 490 | ||
498 | 491 | @Callable(i) | |
499 | 492 | func poolStatsREADONLY (lpAsset) = { | |
500 | 493 | let poolAddress = addressFromStringValue(getStringByAddressOrFail(factoryDapp, keyFactoryLpAssetToPoolContractAddress(lpAsset))) | |
501 | 494 | let status = { | |
502 | 495 | let @ = invoke(factoryDapp, "getPoolStatusREADONLY", [toString(poolAddress)], nil) | |
503 | 496 | if ($isInstanceOf(@, "Int")) | |
504 | 497 | then @ | |
505 | 498 | else throw(($getType(@) + " couldn't be cast to Int")) | |
506 | 499 | } | |
507 | 500 | let tpl = "%d%d%d%d%d%d%d%d%d%s" | |
508 | 501 | if ((status == 4)) | |
509 | 502 | 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)) | |
510 | 503 | else { | |
511 | 504 | let cfg = asAnyList(invoke(poolAddress, "getPoolConfigWrapperREADONLY", nil, nil)) | |
512 | 505 | let lpAssetId = fromBase58String(asString(cfg[idxPoolLPAssetId])) | |
513 | 506 | let amtAssetId = asString(cfg[idxAmtAssetId]) | |
514 | 507 | let priceAssetId = asString(cfg[idxPriceAssetId]) | |
515 | 508 | let iAmtAssetId = asString(cfg[idxIAmtAssetId]) | |
516 | 509 | let iPriceAssetId = asString(cfg[idxIPriceAssetId]) | |
517 | 510 | let amtAssetDcm = parseIntValue(asString(cfg[idxAmtAssetDcm])) | |
518 | 511 | let priceAssetDcm = parseIntValue(asString(cfg[idxPriceAssetDcm])) | |
519 | 512 | let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity | |
520 | 513 | let accAmtAssetBalance = asInt(invoke(poolAddress, "getAccBalanceWrapperREADONLY", [amtAssetId], nil)) | |
521 | 514 | let accPriceAssetBalance = asInt(invoke(poolAddress, "getAccBalanceWrapperREADONLY", [priceAssetId], nil)) | |
522 | 515 | let pricesList = if ((poolLPBalance == 0)) | |
523 | 516 | then [toString(zeroBigInt), toString(zeroBigInt), toString(zeroBigInt)] | |
524 | 517 | else asAnyList(invoke(poolAddress, "calcPricesWrapperREADONLY", [accAmtAssetBalance, accPriceAssetBalance, poolLPBalance], nil)) | |
525 | 518 | let curPrice = 0 | |
526 | 519 | let lpAmtAssetShare = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [pricesList[1], MULT8], nil)) | |
527 | 520 | let lpPriceAssetShare = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [pricesList[2], MULT8], nil)) | |
528 | 521 | let poolWeight = getIntegerValue(factoryDapp, keyFactoryPoolWeight(toString(poolAddress))) | |
529 | 522 | let inFee = getPoolInFee(poolAddress) | |
530 | 523 | let outFee = getPoolOutFee(poolAddress) | |
531 | 524 | let poolOneTokenOperationsDisabled = { | |
532 | 525 | let @ = invoke(factoryDapp, "isPoolOneTokenOperationsDisabledREADONLY", [toString(poolAddress)], nil) | |
533 | 526 | if ($isInstanceOf(@, "Boolean")) | |
534 | 527 | then @ | |
535 | 528 | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
536 | 529 | } | |
537 | 530 | let poolOneTokenOperationsEnabled = !(poolOneTokenOperationsDisabled) | |
538 | 531 | $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)) | |
539 | 532 | } | |
540 | 533 | } | |
541 | 534 | ||
542 | 535 | ||
543 | 536 | ||
544 | 537 | @Callable(i) | |
545 | 538 | func poolEvaluatePutByAmountAssetREADONLY (lpAsset,inAmAssetAmt) = { | |
546 | 539 | let poolAddress = addressFromStringValue(getStringByAddressOrFail(factoryDapp, keyFactoryLpAssetToPoolContractAddress(lpAsset))) | |
547 | 540 | let cfg = asAnyList(invoke(poolAddress, "getPoolConfigWrapperREADONLY", nil, nil)) | |
548 | 541 | let lpAssetId = fromBase58String(asString(cfg[idxPoolLPAssetId])) | |
549 | 542 | let amAssetIdStr = asString(cfg[idxAmtAssetId]) | |
550 | 543 | let amAssetId = fromBase58String(amAssetIdStr) | |
551 | 544 | let prAssetIdStr = asString(cfg[idxPriceAssetId]) | |
552 | 545 | let prAssetId = fromBase58String(prAssetIdStr) | |
553 | 546 | let amtAssetDcm = parseIntValue(asString(cfg[idxAmtAssetDcm])) | |
554 | 547 | let priceAssetDcm = parseIntValue(asString(cfg[idxPriceAssetDcm])) | |
555 | 548 | let poolStatus = asString(cfg[idxPoolStatus]) | |
556 | 549 | let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity | |
557 | 550 | let accAmtAssetBalance = asInt(invoke(poolAddress, "getAccBalanceWrapperREADONLY", [amAssetIdStr], nil)) | |
558 | 551 | let accPriceAssetBalance = asInt(invoke(poolAddress, "getAccBalanceWrapperREADONLY", [prAssetIdStr], nil)) | |
559 | 552 | let amtAssetAmtX18 = parseBigIntValue(asString(invoke(poolAddress, "toX18WrapperREADONLY", [accAmtAssetBalance, amtAssetDcm], nil))) | |
560 | 553 | let priceAssetAmtX18 = parseBigIntValue(asString(invoke(poolAddress, "toX18WrapperREADONLY", [accPriceAssetBalance, priceAssetDcm], nil))) | |
561 | 554 | let curPriceX18 = if ((poolLPBalance == 0)) | |
562 | 555 | then zeroBigInt | |
563 | 556 | else parseBigIntValue(asString(invoke(poolAddress, "calcPriceBigIntWrapperREADONLY", [toString(priceAssetAmtX18), toString(amtAssetAmtX18)], nil))) | |
564 | 557 | let curPrice = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [toString(curPriceX18), MULT8], nil)) | |
565 | 558 | let inAmAssetAmtX18 = parseBigIntValue(asString(invoke(poolAddress, "toX18WrapperREADONLY", [inAmAssetAmt, amtAssetDcm], nil))) | |
566 | 559 | let inPrAssetAmtX18 = fraction(inAmAssetAmtX18, curPriceX18, MULT18) | |
567 | 560 | let inPrAssetAmt = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [toString(inPrAssetAmtX18), priceAssetDcm], nil)) | |
568 | 561 | let res = invoke(poolAddress, "estimatePutOperationWrapperREADONLY", ["", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false], nil) | |
569 | - | let $ | |
562 | + | let $t02336423717 = match res { | |
570 | 563 | case _ => | |
571 | 564 | if (if (if ($isInstanceOf($match0._1, "Int")) | |
572 | 565 | then if ($isInstanceOf($match0._3, "Int")) | |
573 | 566 | then if ($isInstanceOf($match0._4, "Int")) | |
574 | 567 | then if ($isInstanceOf($match0._5, "Int")) | |
575 | 568 | then $isInstanceOf($match0._6, "Int") | |
576 | 569 | else false | |
577 | 570 | else false | |
578 | 571 | else false | |
579 | 572 | else false) | |
580 | 573 | then (size($match0) == 13) | |
581 | 574 | else false) | |
582 | 575 | then { | |
583 | 576 | let calcLpAmt = $match0._1 | |
584 | 577 | let curPriceCalc = $match0._3 | |
585 | 578 | let amBalance = $match0._4 | |
586 | 579 | let prBalance = $match0._5 | |
587 | 580 | let lpEmission = $match0._6 | |
588 | 581 | $Tuple5(calcLpAmt, curPriceCalc, amBalance, prBalance, lpEmission) | |
589 | 582 | } | |
590 | 583 | else throw("Couldn't cast types") | |
591 | 584 | } | |
592 | - | let calcLpAmt = $ | |
593 | - | let curPriceCalc = $ | |
594 | - | let amBalance = $ | |
595 | - | let prBalance = $ | |
596 | - | let lpEmission = $ | |
585 | + | let calcLpAmt = $t02336423717._1 | |
586 | + | let curPriceCalc = $t02336423717._2 | |
587 | + | let amBalance = $t02336423717._3 | |
588 | + | let prBalance = $t02336423717._4 | |
589 | + | let lpEmission = $t02336423717._5 | |
597 | 590 | $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)) | |
598 | 591 | } | |
599 | 592 | ||
600 | 593 | ||
601 | 594 | ||
602 | 595 | @Callable(i) | |
603 | 596 | func poolEvaluatePutByPriceAssetREADONLY (lpAsset,inPrAssetAmt) = { | |
604 | 597 | let poolAddress = addressFromStringValue(getStringByAddressOrFail(factoryDapp, keyFactoryLpAssetToPoolContractAddress(lpAsset))) | |
605 | 598 | let cfg = asAnyList(invoke(poolAddress, "getPoolConfigWrapperREADONLY", nil, nil)) | |
606 | 599 | let lpAssetId = fromBase58String(asString(cfg[idxPoolLPAssetId])) | |
607 | 600 | let amAssetIdStr = asString(cfg[idxAmtAssetId]) | |
608 | 601 | let amAssetId = fromBase58String(amAssetIdStr) | |
609 | 602 | let prAssetIdStr = asString(cfg[idxPriceAssetId]) | |
610 | 603 | let prAssetId = fromBase58String(prAssetIdStr) | |
611 | 604 | let amtAssetDcm = parseIntValue(asString(cfg[idxAmtAssetDcm])) | |
612 | 605 | let priceAssetDcm = parseIntValue(asString(cfg[idxPriceAssetDcm])) | |
613 | 606 | let poolStatus = asString(cfg[idxPoolStatus]) | |
614 | 607 | let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity | |
615 | 608 | let amBalanceRaw = asInt(invoke(poolAddress, "getAccBalanceWrapperREADONLY", [amAssetIdStr], nil)) | |
616 | 609 | let prBalanceRaw = asInt(invoke(poolAddress, "getAccBalanceWrapperREADONLY", [prAssetIdStr], nil)) | |
617 | 610 | let amBalanceRawX18 = parseBigIntValue(asString(invoke(poolAddress, "toX18WrapperREADONLY", [amBalanceRaw, amtAssetDcm], nil))) | |
618 | 611 | let prBalanceRawX18 = parseBigIntValue(asString(invoke(poolAddress, "toX18WrapperREADONLY", [prBalanceRaw, priceAssetDcm], nil))) | |
619 | 612 | let curPriceX18 = if ((poolLPBalance == 0)) | |
620 | 613 | then zeroBigInt | |
621 | 614 | else parseBigIntValue(asString(invoke(poolAddress, "calcPriceBigIntWrapperREADONLY", [toString(prBalanceRawX18), toString(amBalanceRawX18)], nil))) | |
622 | 615 | let curPrice = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [toString(curPriceX18), MULT8], nil)) | |
623 | 616 | let inPrAssetAmtX18 = parseBigIntValue(asString(invoke(poolAddress, "toX18WrapperREADONLY", [inPrAssetAmt, priceAssetDcm], nil))) | |
624 | 617 | let inAmAssetAmtX18 = fraction(inPrAssetAmtX18, MULT18, curPriceX18) | |
625 | 618 | let inAmAssetAmt = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [toString(inAmAssetAmtX18), amtAssetDcm], nil)) | |
626 | 619 | let res = invoke(poolAddress, "estimatePutOperationWrapperREADONLY", ["", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false], nil) | |
627 | - | let $ | |
620 | + | let $t02629026643 = match res { | |
628 | 621 | case _ => | |
629 | 622 | if (if (if ($isInstanceOf($match0._1, "Int")) | |
630 | 623 | then if ($isInstanceOf($match0._3, "Int")) | |
631 | 624 | then if ($isInstanceOf($match0._4, "Int")) | |
632 | 625 | then if ($isInstanceOf($match0._5, "Int")) | |
633 | 626 | then $isInstanceOf($match0._6, "Int") | |
634 | 627 | else false | |
635 | 628 | else false | |
636 | 629 | else false | |
637 | 630 | else false) | |
638 | 631 | then (size($match0) == 13) | |
639 | 632 | else false) | |
640 | 633 | then { | |
641 | 634 | let calcLpAmt = $match0._1 | |
642 | 635 | let curPriceCalc = $match0._3 | |
643 | 636 | let amBalance = $match0._4 | |
644 | 637 | let prBalance = $match0._5 | |
645 | 638 | let lpEmission = $match0._6 | |
646 | 639 | $Tuple5(calcLpAmt, curPriceCalc, amBalance, prBalance, lpEmission) | |
647 | 640 | } | |
648 | 641 | else throw("Couldn't cast types") | |
649 | 642 | } | |
650 | - | let calcLpAmt = $ | |
651 | - | let curPriceCalc = $ | |
652 | - | let amBalance = $ | |
653 | - | let prBalance = $ | |
654 | - | let lpEmission = $ | |
643 | + | let calcLpAmt = $t02629026643._1 | |
644 | + | let curPriceCalc = $t02629026643._2 | |
645 | + | let amBalance = $t02629026643._3 | |
646 | + | let prBalance = $t02629026643._4 | |
647 | + | let lpEmission = $t02629026643._5 | |
655 | 648 | $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)) | |
656 | 649 | } | |
657 | 650 | ||
658 | 651 | ||
659 | 652 | ||
660 | 653 | @Callable(i) | |
661 | 654 | func poolEvaluateGetREADONLY (paymentLpAssetId,paymentLpAmt) = { | |
662 | 655 | let poolAddress = addressFromStringValue(getStringByAddressOrFail(factoryDapp, keyFactoryLpAssetToPoolContractAddress(paymentLpAssetId))) | |
663 | 656 | let res = invoke(poolAddress, "estimateGetOperationWrapperREADONLY", ["", paymentLpAssetId, paymentLpAmt, toString(poolAddress)], nil) | |
664 | - | let $ | |
657 | + | let $t02733827755 = match res { | |
665 | 658 | case _ => | |
666 | 659 | if (if (if ($isInstanceOf($match0._1, "Int")) | |
667 | 660 | then if ($isInstanceOf($match0._2, "Int")) | |
668 | 661 | then if ($isInstanceOf($match0._5, "Int")) | |
669 | 662 | then if ($isInstanceOf($match0._6, "Int")) | |
670 | 663 | then if ($isInstanceOf($match0._7, "Int")) | |
671 | 664 | then if ($isInstanceOf($match0._8, "String")) | |
672 | 665 | then $isInstanceOf($match0._9, "String") | |
673 | 666 | else false | |
674 | 667 | else false | |
675 | 668 | else false | |
676 | 669 | else false | |
677 | 670 | else false | |
678 | 671 | else false) | |
679 | 672 | then (size($match0) == 10) | |
680 | 673 | else false) | |
681 | 674 | then { | |
682 | 675 | let outAmAmt = $match0._1 | |
683 | 676 | let outPrAmt = $match0._2 | |
684 | 677 | let amBalance = $match0._5 | |
685 | 678 | let prBalance = $match0._6 | |
686 | 679 | let lpEmission = $match0._7 | |
687 | 680 | let curPrice = $match0._8 | |
688 | 681 | let poolStatus = $match0._9 | |
689 | 682 | $Tuple7(outAmAmt, outPrAmt, amBalance, prBalance, lpEmission, curPrice, poolStatus) | |
690 | 683 | } | |
691 | 684 | else throw("Couldn't cast types") | |
692 | 685 | } | |
693 | - | let outAmAmt = $ | |
694 | - | let outPrAmt = $ | |
695 | - | let amBalance = $ | |
696 | - | let prBalance = $ | |
697 | - | let lpEmission = $ | |
698 | - | let curPrice = $ | |
699 | - | let poolStatus = $ | |
686 | + | let outAmAmt = $t02733827755._1 | |
687 | + | let outPrAmt = $t02733827755._2 | |
688 | + | let amBalance = $t02733827755._3 | |
689 | + | let prBalance = $t02733827755._4 | |
690 | + | let lpEmission = $t02733827755._5 | |
691 | + | let curPrice = $t02733827755._6 | |
692 | + | let poolStatus = $t02733827755._7 | |
700 | 693 | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d", toString(outAmAmt), toString(outPrAmt), toString(amBalance), toString(prBalance), toString(lpEmission), curPrice, poolStatus], SEP)) | |
701 | 694 | } | |
702 | 695 | ||
703 | 696 | ||
704 | 697 | ||
705 | 698 | @Callable(i) | |
706 | 699 | func gwxUserInfoREADONLY (userAddress) = { | |
707 | 700 | let gwxUserInfoLIST = asAnyList(invoke(boostingDapp, "gwxUserInfoREADONLY", [userAddress], nil)) | |
708 | 701 | let gwxAmount = asInt(gwxUserInfoLIST[0]) | |
709 | 702 | $Tuple2(nil, makeString(["%d", toString(gwxAmount)], SEP)) | |
710 | 703 | } | |
711 | 704 | ||
712 | 705 | ||
713 | 706 | ||
714 | 707 | @Callable(i) | |
715 | 708 | func unstakeAndGetOneTknV2 (poolAddress,unstakeAmount,outAssetId,minOutAmount) = { | |
716 | 709 | let inv = invoke(addressFromStringValue(poolAddress), "unstakeAndGetOneTknV2", [unstakeAmount, outAssetId, minOutAmount], nil) | |
717 | 710 | if ((inv == inv)) | |
718 | 711 | then $Tuple2(nil, unit) | |
719 | 712 | else throw("Strict value is not equal to itself.") | |
720 | 713 | } | |
721 | 714 | ||
722 | 715 | ||
723 | 716 | ||
724 | 717 | @Callable(i) | |
725 | 718 | func getKeysBulkInternal (currentIter,keys,resAcc) = if ((currentIter == size(keys))) | |
726 | 719 | then $Tuple2(nil, resAcc) | |
727 | 720 | else { | |
728 | 721 | let k = split(keys[currentIter], "++") | |
729 | 722 | let addr = addressFromStringValue(k[0]) | |
730 | 723 | let key = k[1] | |
731 | 724 | let type = k[2] | |
732 | 725 | let val = getKey(addr, key, type) | |
733 | 726 | let res = (resAcc :+ val) | |
734 | 727 | let inv = invoke(this, "getKeysBulkInternal", [(currentIter + 1), keys, res], nil) | |
735 | 728 | if ((inv == inv)) | |
736 | 729 | then $Tuple2(nil, inv) | |
737 | 730 | else throw("Strict value is not equal to itself.") | |
738 | 731 | } | |
739 | 732 | ||
740 | 733 | ||
741 | 734 | ||
742 | 735 | @Callable(i) | |
743 | 736 | func getKeysBulk (keys) = { | |
744 | 737 | let res = invoke(this, "getKeysBulkInternal", [0, keys, nil], nil) | |
745 | 738 | $Tuple2(nil, res) | |
746 | 739 | } | |
747 | 740 | ||
748 | 741 | ||
749 | 742 | ||
750 | 743 | @Callable(i) | |
751 | 744 | func setManager (pendingManagerPublicKey) = { | |
752 | 745 | let checkCaller = mustManager(i) | |
753 | 746 | if ((checkCaller == checkCaller)) | |
754 | 747 | then { | |
755 | 748 | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
756 | 749 | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
757 | 750 | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
758 | 751 | else throw("Strict value is not equal to itself.") | |
759 | 752 | } | |
760 | 753 | else throw("Strict value is not equal to itself.") | |
761 | 754 | } | |
762 | 755 | ||
763 | 756 | ||
764 | 757 | ||
765 | 758 | @Callable(i) | |
766 | 759 | func confirmManager () = { | |
767 | 760 | let pm = pendingManagerPublicKeyOrUnit() | |
768 | 761 | let hasPM = if (isDefined(pm)) | |
769 | 762 | then true | |
770 | 763 | else throw("No pending manager") | |
771 | 764 | if ((hasPM == hasPM)) | |
772 | 765 | then { | |
773 | 766 | let checkPM = if ((i.callerPublicKey == value(pm))) | |
774 | 767 | then true | |
775 | 768 | else throw("You are not pending manager") | |
776 | 769 | if ((checkPM == checkPM)) | |
777 | 770 | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
778 | 771 | else throw("Strict value is not equal to itself.") | |
779 | 772 | } | |
780 | 773 | else throw("Strict value is not equal to itself.") | |
781 | 774 | } | |
782 | 775 | ||
783 | 776 | ||
784 | 777 | @Verifier(tx) | |
785 | 778 | func verify () = { | |
786 | 779 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
787 | 780 | case pk: ByteVector => | |
788 | 781 | pk | |
789 | 782 | case _: Unit => | |
790 | 783 | tx.senderPublicKey | |
791 | 784 | case _ => | |
792 | 785 | throw("Match error") | |
793 | 786 | } | |
794 | 787 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
795 | 788 | } | |
796 | 789 |
github/deemru/w8io/026f985 98.31 ms ◑