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:BgKPIggCEgMKAQgSAwoBCBIECgIICBIJCgcBERERGAgYEgcKBRERERgIEgcKBQEBAQgIEgASAwoBCBIECgIIARIECgIIARIECgIIARIDCgEIEgYKBAgBCAESBQoDARgYEgMKARgSAwoBCBIAIgZTQ0FMRTgiBU1VTFQ4IgdTQ0FMRTE4IgZNVUxUMTgiA1NFUCIOUE9PTFdFSUdIVE1VTFQiCnplcm9CaWdJbnQiDmlkeFBvb2xBZGRyZXNzIg1pZHhQb29sU3RhdHVzIhBpZHhQb29sTFBBc3NldElkIg1pZHhBbXRBc3NldElkIg9pZHhQcmljZUFzc2V0SWQiDmlkeEFtdEFzc2V0RGNtIhBpZHhQcmljZUFzc2V0RGNtIg5pZHhJQW10QXNzZXRJZCIQaWR4SVByaWNlQXNzZXRJZCINaWR4TFBBc3NldERjbSIPZ2V0U3RyaW5nT3JGYWlsIgNrZXkiGGdldFN0cmluZ0J5QWRkcmVzc09yRmFpbCIHYWRkcmVzcyIMZ2V0SW50T3JaZXJvIgxnZXRJbnRPckZhaWwiCWFzQW55TGlzdCIDdmFsIgckbWF0Y2g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ml0CAUCZWQPc2VuZGVyUHVibGljS2V5CQACAQILTWF0Y2ggZXJyb3IJAPQDAwgFAmVkCWJvZHlCeXRlcwkAkQMCCAUCZWQGcHJvb2ZzAAAFAmVm12kILA==", "height": 2501163, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Hy8UmssTBsV9tRnP3KGhEaZX5MQkVbccHxDRKAJW9eaL Next: FYd6ctx7BzVJKZKgNymUPxboVskUq6QN8ciBAUMsYGAy Diff:
OldNewDifferences
262262 let poolWeight = getIntegerValue(factoryDapp, keyFactoryPoolWeight(poolAddressStr))
263263 let wxEmissionPerBlock = getIntOrFail(emissionDapp, keyEmissionRatePerBlockCurrent())
264264 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
271266 let poolWxEmissionPerBlock = (fraction(wxEmissionPerBlock, poolWeight, poolWeightMult) / boostMaxCoeff)
272267 let poolWxEmissionPerBlockMax = fraction(wxEmissionPerBlockMax, poolWeight, poolWeightMult)
273268 let maxFactor = (boostMaxCoeff * MULT8)
345340 let wxEmissionPerBlock = rewardData[0]
346341 let maxFactor = rewardData[1]
347342 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))
355344 }
356345
357346
413402
414403 @Callable(i)
415404 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- }
422405 let mathDapp = gwxRewardDapp
423406 let EMPTYSTR = "empty"
424407 let maxLockDurationInBlocks = parseIntValue(split(getStringByAddressOrFail(boostingDapp, keyBoostCfg()), SEP)[4])
438421 let lockDurationNew = min([(remainingDuration + deltaLockPeriodInBlocks), maxLockDurationInBlocks])
439422 let userCurrgWxAmount = asInt(asAnyList(invoke(boostingDapp, "gwxUserInfoREADONLY", [userAddressStr], nil))[0])
440423 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)
441432 let totalCachedGwx = {
442433 let @ = invoke(boostingDapp, "getTotalCachedGwxREADONLY", nil, nil)
443434 if ($isInstanceOf(@, "Int"))
450441 let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
451442 let stakedByUser = readStaked(stakingDapp, stakedByUserKEY)
452443 let stakedTotal = readStaked(stakingDapp, stakedTotalKEY)
444+ let stakedByUserNew = (stakedByUser + deltaLpAmount)
445+ let stakedTotalNew = (stakedTotal + deltaLpAmount)
453446 let poolWeight = if ((lpAssetIdStr != EMPTYSTR))
454447 then {
455448 let poolAddressStr = valueOrErrorMessage(getString(factoryDapp, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr))
456449 getIntegerValue(factoryDapp, keyFactoryPoolWeight(poolAddressStr))
457450 }
458451 else 0
459- let poolWxEmissionPerBlockX3 = fraction(wxEmissionPerBlockX3, poolWeight, (POOLWEIGHTMULT * boostCoeff))
460- let wxPerLpX3 = if ((stakedTotal != 0))
461- then fraction(poolWxEmissionPerBlockX3, MULT8, stakedTotal)
452+ let poolWxEmissionPerBlockX3 = fraction(wxEmissionPerBlockX3, poolWeight, (POOLWEIGHTMULT * 3))
453+ let wxPerLpX3 = if ((stakedTotalNew != 0))
454+ then fraction(poolWxEmissionPerBlockX3, MULT8, stakedTotalNew)
462455 else 0
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))
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))
468461 then (1 * MULT8)
469462 else fraction((userBoostPerBlockX3 + userWxPerBlockX3), MULT8, userWxPerBlockX3)
470- $Tuple2(nil, makeString(["%d%d%s", toString(gWxAmountStartNew), toString(userBoostCoeff), "d"], SEP))
463+ $Tuple2(nil, makeString(["%d%d%s", toString(gWxAmountStartNew), toString(boostCoeff), "d"], SEP))
471464 }
472465
473466
566559 let inPrAssetAmtX18 = fraction(inAmAssetAmtX18, curPriceX18, MULT18)
567560 let inPrAssetAmt = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [toString(inPrAssetAmtX18), priceAssetDcm], nil))
568561 let res = invoke(poolAddress, "estimatePutOperationWrapperREADONLY", ["", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false], nil)
569- let $t02263122984 = match res {
562+ let $t02336423717 = match res {
570563 case _ =>
571564 if (if (if ($isInstanceOf($match0._1, "Int"))
572565 then if ($isInstanceOf($match0._3, "Int"))
589582 }
590583 else throw("Couldn't cast types")
591584 }
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
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
597590 $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))
598591 }
599592
624617 let inAmAssetAmtX18 = fraction(inPrAssetAmtX18, MULT18, curPriceX18)
625618 let inAmAssetAmt = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [toString(inAmAssetAmtX18), amtAssetDcm], nil))
626619 let res = invoke(poolAddress, "estimatePutOperationWrapperREADONLY", ["", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false], nil)
627- let $t02555725910 = match res {
620+ let $t02629026643 = match res {
628621 case _ =>
629622 if (if (if ($isInstanceOf($match0._1, "Int"))
630623 then if ($isInstanceOf($match0._3, "Int"))
647640 }
648641 else throw("Couldn't cast types")
649642 }
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
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
655648 $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))
656649 }
657650
661654 func poolEvaluateGetREADONLY (paymentLpAssetId,paymentLpAmt) = {
662655 let poolAddress = addressFromStringValue(getStringByAddressOrFail(factoryDapp, keyFactoryLpAssetToPoolContractAddress(paymentLpAssetId)))
663656 let res = invoke(poolAddress, "estimateGetOperationWrapperREADONLY", ["", paymentLpAssetId, paymentLpAmt, toString(poolAddress)], nil)
664- let $t02660527022 = match res {
657+ let $t02733827755 = match res {
665658 case _ =>
666659 if (if (if ($isInstanceOf($match0._1, "Int"))
667660 then if ($isInstanceOf($match0._2, "Int"))
690683 }
691684 else throw("Couldn't cast types")
692685 }
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
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
700693 $Tuple2(nil, makeString(["%d%d%d%d%d%d%d", toString(outAmAmt), toString(outPrAmt), toString(amBalance), toString(prBalance), toString(lpEmission), curPrice, poolStatus], SEP))
701694 }
702695
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SCALE8 = 8
55
66 let MULT8 = 100000000
77
88 let SCALE18 = 18
99
1010 let MULT18 = toBigInt(1000000000000000000)
1111
1212 let SEP = "__"
1313
1414 let POOLWEIGHTMULT = MULT8
1515
1616 let zeroBigInt = toBigInt(0)
1717
1818 let idxPoolAddress = 1
1919
2020 let idxPoolStatus = 2
2121
2222 let idxPoolLPAssetId = 3
2323
2424 let idxAmtAssetId = 4
2525
2626 let idxPriceAssetId = 5
2727
2828 let idxAmtAssetDcm = 6
2929
3030 let idxPriceAssetDcm = 7
3131
3232 let idxIAmtAssetId = 8
3333
3434 let idxIPriceAssetId = 9
3535
3636 let idxLPAssetDcm = 10
3737
3838 func getStringOrFail (key) = valueOrErrorMessage(getString(key), (("mandatory this." + key) + " is not defined"))
3939
4040
4141 func getStringByAddressOrFail (address,key) = valueOrErrorMessage(getString(address, key), (((("mandatory " + toString(address)) + ".") + key) + " is not defined"))
4242
4343
4444 func getIntOrZero (address,key) = valueOrElse(getInteger(address, key), 0)
4545
4646
4747 func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), (("mandatory this." + key) + " is not defined"))
4848
4949
5050 func asAnyList (val) = match val {
5151 case valAnyLyst: List[Any] =>
5252 valAnyLyst
5353 case _ =>
5454 throw("fail to cast into List[Any]")
5555 }
5656
5757
5858 func asInt (val) = match val {
5959 case valInt: Int =>
6060 valInt
6161 case _ =>
6262 throw("fail to cast into Int")
6363 }
6464
6565
6666 func asString (val) = match val {
6767 case valStr: String =>
6868 valStr
6969 case _ =>
7070 throw("fail to cast into String")
7171 }
7272
7373
7474 func keyFactoryAddress () = "%s%s__config__factoryAddress"
7575
7676
7777 func keyManagerPublicKey () = "%s__managerPublicKey"
7878
7979
8080 func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey"
8181
8282
8383 let IdxFactoryCfgStakingDapp = 1
8484
8585 let IdxFactoryCfgBoostingDapp = 2
8686
8787 let IdxFactoryCfgIdoDapp = 3
8888
8989 let IdxFactoryCfgTeamDapp = 4
9090
9191 let IdxFactoryCfgEmissionDapp = 5
9292
9393 let IdxFactoryCfgRestDapp = 6
9494
9595 let IdxFactoryCfgSlippageDapp = 7
9696
9797 let IdxFactoryCfgGwxRewardDapp = 8
9898
9999 func keyFactoryCfg () = "%s__factoryConfig"
100100
101101
102102 func keyFactoryLp2AssetsMapping (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP)
103103
104104
105105 func keyFactoryLpList () = "%s__lpTokensList"
106106
107107
108108 func keyFactoryLpAssetToPoolContractAddress (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP)
109109
110110
111111 func keyFactoryPoolWeight (contractAddress) = makeString(["%s%s", "poolWeight", contractAddress], SEP)
112112
113113
114114 func readFactoryAddressOrFail () = addressFromStringValue(getStringOrFail(keyFactoryAddress()))
115115
116116
117117 func readLpList () = split(valueOrElse(getString(readFactoryAddressOrFail(), keyFactoryLpList()), ""), SEP)
118118
119119
120120 func readFactoryCfgOrFail (factory) = split(getStringByAddressOrFail(factory, keyFactoryCfg()), SEP)
121121
122122
123123 func getBoostingAddressOrFail (fCfg) = addressFromStringValue(fCfg[IdxFactoryCfgBoostingDapp])
124124
125125
126126 func getEmissionAddressOrFail (fCfg) = addressFromStringValue(fCfg[IdxFactoryCfgEmissionDapp])
127127
128128
129129 func getStakingAddressOrFail (fCfg) = addressFromStringValue(fCfg[IdxFactoryCfgStakingDapp])
130130
131131
132132 func getGwxRewardAddressOrFail (fCfg) = addressFromStringValue(fCfg[IdxFactoryCfgGwxRewardDapp])
133133
134134
135135 func keyBoostCfg () = "%s__config"
136136
137137
138138 func keyBoostingLockParamTotalAmount () = "%s%s__stats__activeTotalLocked"
139139
140140
141141 func keyBoostingStatsLocksDurationSumInBlocks () = "%s%s__stats__locksDurationSumInBlocks"
142142
143143
144144 func keyBoostingStatsLocksCount () = "%s%s__stats__locksCount"
145145
146146
147147 func keyBoostingStatsUsersCount () = "%s%s__stats__activeUsersCount"
148148
149149
150150 func keyUser2NumMapping (userAddress) = makeString(["%s%s%s__mapping__user2num", userAddress], SEP)
151151
152152
153153 func keyNum2UserMapping (num) = makeString(["%s%s%s__mapping__num2user", num], SEP)
154154
155155
156156 func keyLockParamUserAmount (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "amount"], SEP)
157157
158158
159159 func keyLockParamStartBlock (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "start"], SEP)
160160
161161
162162 func keyLockParamDuration (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "duration"], SEP)
163163
164164
165165 func keyLockParamK (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "k"], SEP)
166166
167167
168168 func keyLockParamB (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "b"], SEP)
169169
170170
171171 func keyLockParamByPeriodK (userNum,period) = makeString(["%s%d%s%d__paramByPeriod", userNum, "k", period], SEP)
172172
173173
174174 func keyLockParamByPeriodB (userNum,period) = makeString(["%s%d%s%d__paramByPeriod", userNum, "b", period], SEP)
175175
176176
177177 func keyUserBoostEmissionLastINTEGRAL (userNum) = makeString(["%s%d__userBoostEmissionLastInt", userNum], SEP)
178178
179179
180180 func keyUserMaxBoostINTEGRAL (userNum) = makeString(["%s%d__maxBoostInt", userNum], SEP)
181181
182182
183183 func keyTotalMaxBoostINTEGRAL () = "%s%s__maxBoostInt__total"
184184
185185
186186 func keyUserBoostAvalaibleToClaimTotal (userNum) = makeString(["%s%d__userBoostAvaliableToClaimTotal", userNum], SEP)
187187
188188
189189 func keyUserBoostClaimed (userNum) = makeString(["%s%d__userBoostClaimed", userNum], SEP)
190190
191191
192192 func keyTotalCachedGwx () = "%s%s__gwxCached__total"
193193
194194
195195 func keyStakedByUser (userAddressStr,lpAssetIdStr) = makeString(["%s%s%s__staked", userAddressStr, lpAssetIdStr], SEP)
196196
197197
198198 func keyStakedTotal (lpAssetIdStr) = ("%s%s%s__staked__total__" + lpAssetIdStr)
199199
200200
201201 func keyClaimedByUser (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimed", userAddressStr, lpAssetIdStr], SEP)
202202
203203
204204 func keyClaimedByUserMinReward (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimedMinReward", userAddressStr, lpAssetIdStr], SEP)
205205
206206
207207 func keyClaimedByUserBoostReward (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimedBoostReward", userAddressStr, lpAssetIdStr], SEP)
208208
209209
210210 func readStaked (stakingDapp,key) = valueOrElse(getInteger(stakingDapp, key), 0)
211211
212212
213213 func keyEmissionRatePerBlockCurrent () = "%s%s__ratePerBlock__current"
214214
215215
216216 func keyEmissionRatePerBlockMaxCurrent () = "%s%s__ratePerBlockMax__current"
217217
218218
219219 func keyEmissionStartBlock () = "%s%s__emission__startBlock"
220220
221221
222222 func keyEmissionDurationInBlocks () = "%s%s__emission__duration"
223223
224224
225225 func keyEmissionEndBlock () = "%s%s__emission__endBlock"
226226
227227
228228 func keyAddonAddr () = "%s__addonAddr"
229229
230230
231231 let factoryDapp = readFactoryAddressOrFail()
232232
233233 let factoryCfg = readFactoryCfgOrFail(factoryDapp)
234234
235235 let emissionDapp = getEmissionAddressOrFail(factoryCfg)
236236
237237 let stakingDapp = getStakingAddressOrFail(factoryCfg)
238238
239239 let gwxRewardDapp = getGwxRewardAddressOrFail(factoryCfg)
240240
241241 let boostingDapp = getBoostingAddressOrFail(factoryCfg)
242242
243243 func getPoolInFee (poolAddress) = {
244244 let @ = invoke(factoryDapp, "getInFeeREADONLY", [toString(poolAddress)], nil)
245245 if ($isInstanceOf(@, "Int"))
246246 then @
247247 else throw(($getType(@) + " couldn't be cast to Int"))
248248 }
249249
250250
251251 func getPoolOutFee (poolAddress) = {
252252 let @ = invoke(factoryDapp, "getOutFeeREADONLY", [toString(poolAddress)], nil)
253253 if ($isInstanceOf(@, "Int"))
254254 then @
255255 else throw(($getType(@) + " couldn't be cast to Int"))
256256 }
257257
258258
259259 func internalCurrentRewardRate (lpAssetId) = {
260260 let poolAddressStr = getStringByAddressOrFail(factoryDapp, keyFactoryLpAssetToPoolContractAddress(lpAssetId))
261261 let poolWeightMult = MULT8
262262 let poolWeight = getIntegerValue(factoryDapp, keyFactoryPoolWeight(poolAddressStr))
263263 let wxEmissionPerBlock = getIntOrFail(emissionDapp, keyEmissionRatePerBlockCurrent())
264264 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
271266 let poolWxEmissionPerBlock = (fraction(wxEmissionPerBlock, poolWeight, poolWeightMult) / boostMaxCoeff)
272267 let poolWxEmissionPerBlockMax = fraction(wxEmissionPerBlockMax, poolWeight, poolWeightMult)
273268 let maxFactor = (boostMaxCoeff * MULT8)
274269 let totalLpStaked = getIntOrZero(stakingDapp, keyStakedTotal(lpAssetId))
275270 [poolWxEmissionPerBlock, maxFactor, totalLpStaked]
276271 }
277272
278273
279274 func calcGwxAmountStartREADONLY (lockAmount,lockDuration,maxLockDuration) = {
280275 let coeffX8 = fraction(lockDuration, MULT8, maxLockDuration)
281276 let gWxAmountStart = fraction(lockAmount, coeffX8, MULT8)
282277 [gWxAmountStart]
283278 }
284279
285280
286281 func getKey (addr,key,type) = if ((type == "string"))
287282 then getStringValue(addr, key)
288283 else if ((type == "integer"))
289284 then toString(getIntegerValue(addr, key))
290285 else if ((type == "boolean"))
291286 then toString(getBooleanValue(addr, key))
292287 else throw("unknown type. expected string/integer/boolean")
293288
294289
295290 func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
296291 case s: String =>
297292 fromBase58String(s)
298293 case _: Unit =>
299294 unit
300295 case _ =>
301296 throw("Match error")
302297 }
303298
304299
305300 func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
306301 case s: String =>
307302 fromBase58String(s)
308303 case _: Unit =>
309304 unit
310305 case _ =>
311306 throw("Match error")
312307 }
313308
314309
315310 func mustManager (i) = {
316311 let pd = throw("Permission denied")
317312 match managerPublicKeyOrUnit() {
318313 case pk: ByteVector =>
319314 if ((i.callerPublicKey == pk))
320315 then true
321316 else pd
322317 case _: Unit =>
323318 if ((i.caller == this))
324319 then true
325320 else pd
326321 case _ =>
327322 throw("Match error")
328323 }
329324 }
330325
331326
332327 @Callable(i)
333328 func constructor (factoryAddress) = {
334329 let checkCaller = mustManager(i)
335330 if ((checkCaller == checkCaller))
336331 then [StringEntry(keyFactoryAddress(), factoryAddress)]
337332 else throw("Strict value is not equal to itself.")
338333 }
339334
340335
341336
342337 @Callable(i)
343338 func currentRewardRateREADONLY (lpAssetId) = {
344339 let rewardData = internalCurrentRewardRate(lpAssetId)
345340 let wxEmissionPerBlock = rewardData[0]
346341 let maxFactor = rewardData[1]
347342 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))
355344 }
356345
357346
358347
359348 @Callable(i)
360349 func currentUserRewardRateREADONLY (lpAssetId,userAddress) = {
361350 let rewardData = internalCurrentRewardRate(lpAssetId)
362351 let wxEmissionPerBlock = rewardData[0]
363352 let maxFactor = rewardData[1]
364353 let totalLpStaked = rewardData[2]
365354 let lpStakedByUser = getIntOrZero(stakingDapp, keyStakedByUser(userAddress, lpAssetId))
366355 let userClaimInfo = split(asString(invoke(stakingDapp, "claimWxREADONLY", [lpAssetId, userAddress], nil)), SEP)
367356 let minRewardPart = valueOrErrorMessage(parseInt(userClaimInfo[5]), "couldn't parse minRewardPart")
368357 let boostRewardPart = valueOrErrorMessage(parseInt(userClaimInfo[6]), "couldn't parse boostRewardPart")
369358 let debug = userClaimInfo[7]
370359 let boostingPower = if ((boostRewardPart == 0))
371360 then (1 * MULT8)
372361 else fraction((minRewardPart + boostRewardPart), MULT8, minRewardPart)
373362 $Tuple2(nil, makeString(["%d%d%d%d%d%s", toString(wxEmissionPerBlock), toString(maxFactor), toString(totalLpStaked), toString(lpStakedByUser), toString(boostingPower), debug], SEP))
374363 }
375364
376365
377366
378367 @Callable(i)
379368 func calcBoostBulkInternalREADONLY (currentIter,deltaWxAmountBulk,deltaLockPeriodInBlocksBulk,deltaLpAmountBulk,lpAssetIdOptBulk,userAddressOpt,resAcc) = if ((currentIter == size(deltaWxAmountBulk)))
380369 then $Tuple2(nil, resAcc)
381370 else {
382371 let deltaWxAmount = deltaWxAmountBulk[currentIter]
383372 let deltaLockPeriodInBlocks = deltaLockPeriodInBlocksBulk[currentIter]
384373 let deltaLpAmount = deltaLpAmountBulk[currentIter]
385374 let lpAssetIdOpt = lpAssetIdOptBulk[currentIter]
386375 let info = {
387376 let @ = invoke(this, "calcBoostREADONLY", [deltaWxAmount, deltaLockPeriodInBlocks, deltaLpAmount, lpAssetIdOpt, userAddressOpt], nil)
388377 if ($isInstanceOf(@, "String"))
389378 then @
390379 else throw(($getType(@) + " couldn't be cast to String"))
391380 }
392381 let res = (resAcc :+ info)
393382 let inv = {
394383 let @ = invoke(this, "calcBoostBulkInternalREADONLY", [(currentIter + 1), deltaWxAmountBulk, deltaLockPeriodInBlocksBulk, deltaLpAmountBulk, lpAssetIdOptBulk, userAddressOpt, res], nil)
395384 if ($isInstanceOf(@, "List[Any]"))
396385 then @
397386 else throw(($getType(@) + " couldn't be cast to List[Any]"))
398387 }
399388 if ((inv == inv))
400389 then $Tuple2(nil, inv)
401390 else throw("Strict value is not equal to itself.")
402391 }
403392
404393
405394
406395 @Callable(i)
407396 func calcBoostBulkREADONLY (deltaWxAmount,deltaLockPeriodInBlocks,deltaLpAmount,lpAssetIdOpt,userAddressOpt) = {
408397 let res = invoke(this, "calcBoostBulkInternalREADONLY", [0, deltaWxAmount, deltaLockPeriodInBlocks, deltaLpAmount, lpAssetIdOpt, userAddressOpt, nil], nil)
409398 $Tuple2(nil, res)
410399 }
411400
412401
413402
414403 @Callable(i)
415404 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- }
422405 let mathDapp = gwxRewardDapp
423406 let EMPTYSTR = "empty"
424407 let maxLockDurationInBlocks = parseIntValue(split(getStringByAddressOrFail(boostingDapp, keyBoostCfg()), SEP)[4])
425408 let lpAssetIdStr = if ((lpAssetIdOpt == ""))
426409 then EMPTYSTR
427410 else lpAssetIdOpt
428411 let userAddressStr = if ((userAddressOpt == ""))
429412 then EMPTYSTR
430413 else userAddressOpt
431414 let userNumStr = valueOrElse(getString(boostingDapp, keyUser2NumMapping(userAddressOpt)), EMPTYSTR)
432415 let userAmount = valueOrElse(getInteger(boostingDapp, keyLockParamUserAmount(userNumStr)), 0)
433416 let lockStart = valueOrElse(getInteger(boostingDapp, keyLockParamStartBlock(userNumStr)), height)
434417 let lockDuration = valueOrElse(getInteger(boostingDapp, keyLockParamDuration(userNumStr)), 0)
435418 let lockEnd = (lockStart + lockDuration)
436419 let remainingDuration = max([(lockEnd - height), 0])
437420 let userAmountNew = (userAmount + deltaWxAmount)
438421 let lockDurationNew = min([(remainingDuration + deltaLockPeriodInBlocks), maxLockDurationInBlocks])
439422 let userCurrgWxAmount = asInt(asAnyList(invoke(boostingDapp, "gwxUserInfoREADONLY", [userAddressStr], nil))[0])
440423 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)
441432 let totalCachedGwx = {
442433 let @ = invoke(boostingDapp, "getTotalCachedGwxREADONLY", nil, nil)
443434 if ($isInstanceOf(@, "Int"))
444435 then @
445436 else throw(($getType(@) + " couldn't be cast to Int"))
446437 }
447438 let MULT3 = 1000
448439 let wxEmissionPerBlockX3 = (getIntOrFail(emissionDapp, keyEmissionRatePerBlockCurrent()) * MULT3)
449440 let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
450441 let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
451442 let stakedByUser = readStaked(stakingDapp, stakedByUserKEY)
452443 let stakedTotal = readStaked(stakingDapp, stakedTotalKEY)
444+ let stakedByUserNew = (stakedByUser + deltaLpAmount)
445+ let stakedTotalNew = (stakedTotal + deltaLpAmount)
453446 let poolWeight = if ((lpAssetIdStr != EMPTYSTR))
454447 then {
455448 let poolAddressStr = valueOrErrorMessage(getString(factoryDapp, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr))
456449 getIntegerValue(factoryDapp, keyFactoryPoolWeight(poolAddressStr))
457450 }
458451 else 0
459- let poolWxEmissionPerBlockX3 = fraction(wxEmissionPerBlockX3, poolWeight, (POOLWEIGHTMULT * boostCoeff))
460- let wxPerLpX3 = if ((stakedTotal != 0))
461- then fraction(poolWxEmissionPerBlockX3, MULT8, stakedTotal)
452+ let poolWxEmissionPerBlockX3 = fraction(wxEmissionPerBlockX3, poolWeight, (POOLWEIGHTMULT * 3))
453+ let wxPerLpX3 = if ((stakedTotalNew != 0))
454+ then fraction(poolWxEmissionPerBlockX3, MULT8, stakedTotalNew)
462455 else 0
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))
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))
468461 then (1 * MULT8)
469462 else fraction((userBoostPerBlockX3 + userWxPerBlockX3), MULT8, userWxPerBlockX3)
470- $Tuple2(nil, makeString(["%d%d%s", toString(gWxAmountStartNew), toString(userBoostCoeff), "d"], SEP))
463+ $Tuple2(nil, makeString(["%d%d%s", toString(gWxAmountStartNew), toString(boostCoeff), "d"], SEP))
471464 }
472465
473466
474467
475468 @Callable(i)
476469 func wxEmissionStatsREADONLY () = {
477470 let ONEMULT = toString(MULT8)
478471 let ONE = "1"
479472 let wxEmissionPerBlock = getIntOrFail(emissionDapp, keyEmissionRatePerBlockCurrent())
480473 let emissionStartBlock = getIntOrFail(emissionDapp, keyEmissionStartBlock())
481474 let passedBlocks = if ((emissionStartBlock > height))
482475 then 0
483476 else (height - emissionStartBlock)
484477 let teamEmDuration = (1440 * 365)
485478 let teamEmMax = (201000000 * MULT8)
486479 let teamEm = if ((passedBlocks > teamEmDuration))
487480 then teamEmMax
488481 else fraction(teamEmMax, passedBlocks, teamEmDuration)
489482 let totalWxReleased = ((wxEmissionPerBlock * passedBlocks) + teamEm)
490483 let totalWxLocked = getIntOrZero(boostingDapp, keyBoostingLockParamTotalAmount())
491484 let locksDurationSumInBlocks = getIntOrZero(boostingDapp, keyBoostingStatsLocksDurationSumInBlocks())
492485 let locksCount = getIntOrZero(boostingDapp, keyBoostingStatsLocksCount())
493486 $Tuple2(nil, makeString(["%d%d%d%d", toString(totalWxReleased), toString(totalWxLocked), toString(locksDurationSumInBlocks), toString(locksCount)], SEP))
494487 }
495488
496489
497490
498491 @Callable(i)
499492 func poolStatsREADONLY (lpAsset) = {
500493 let poolAddress = addressFromStringValue(getStringByAddressOrFail(factoryDapp, keyFactoryLpAssetToPoolContractAddress(lpAsset)))
501494 let status = {
502495 let @ = invoke(factoryDapp, "getPoolStatusREADONLY", [toString(poolAddress)], nil)
503496 if ($isInstanceOf(@, "Int"))
504497 then @
505498 else throw(($getType(@) + " couldn't be cast to Int"))
506499 }
507500 let tpl = "%d%d%d%d%d%d%d%d%d%s"
508501 if ((status == 4))
509502 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))
510503 else {
511504 let cfg = asAnyList(invoke(poolAddress, "getPoolConfigWrapperREADONLY", nil, nil))
512505 let lpAssetId = fromBase58String(asString(cfg[idxPoolLPAssetId]))
513506 let amtAssetId = asString(cfg[idxAmtAssetId])
514507 let priceAssetId = asString(cfg[idxPriceAssetId])
515508 let iAmtAssetId = asString(cfg[idxIAmtAssetId])
516509 let iPriceAssetId = asString(cfg[idxIPriceAssetId])
517510 let amtAssetDcm = parseIntValue(asString(cfg[idxAmtAssetDcm]))
518511 let priceAssetDcm = parseIntValue(asString(cfg[idxPriceAssetDcm]))
519512 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
520513 let accAmtAssetBalance = asInt(invoke(poolAddress, "getAccBalanceWrapperREADONLY", [amtAssetId], nil))
521514 let accPriceAssetBalance = asInt(invoke(poolAddress, "getAccBalanceWrapperREADONLY", [priceAssetId], nil))
522515 let pricesList = if ((poolLPBalance == 0))
523516 then [toString(zeroBigInt), toString(zeroBigInt), toString(zeroBigInt)]
524517 else asAnyList(invoke(poolAddress, "calcPricesWrapperREADONLY", [accAmtAssetBalance, accPriceAssetBalance, poolLPBalance], nil))
525518 let curPrice = 0
526519 let lpAmtAssetShare = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [pricesList[1], MULT8], nil))
527520 let lpPriceAssetShare = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [pricesList[2], MULT8], nil))
528521 let poolWeight = getIntegerValue(factoryDapp, keyFactoryPoolWeight(toString(poolAddress)))
529522 let inFee = getPoolInFee(poolAddress)
530523 let outFee = getPoolOutFee(poolAddress)
531524 let poolOneTokenOperationsDisabled = {
532525 let @ = invoke(factoryDapp, "isPoolOneTokenOperationsDisabledREADONLY", [toString(poolAddress)], nil)
533526 if ($isInstanceOf(@, "Boolean"))
534527 then @
535528 else throw(($getType(@) + " couldn't be cast to Boolean"))
536529 }
537530 let poolOneTokenOperationsEnabled = !(poolOneTokenOperationsDisabled)
538531 $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))
539532 }
540533 }
541534
542535
543536
544537 @Callable(i)
545538 func poolEvaluatePutByAmountAssetREADONLY (lpAsset,inAmAssetAmt) = {
546539 let poolAddress = addressFromStringValue(getStringByAddressOrFail(factoryDapp, keyFactoryLpAssetToPoolContractAddress(lpAsset)))
547540 let cfg = asAnyList(invoke(poolAddress, "getPoolConfigWrapperREADONLY", nil, nil))
548541 let lpAssetId = fromBase58String(asString(cfg[idxPoolLPAssetId]))
549542 let amAssetIdStr = asString(cfg[idxAmtAssetId])
550543 let amAssetId = fromBase58String(amAssetIdStr)
551544 let prAssetIdStr = asString(cfg[idxPriceAssetId])
552545 let prAssetId = fromBase58String(prAssetIdStr)
553546 let amtAssetDcm = parseIntValue(asString(cfg[idxAmtAssetDcm]))
554547 let priceAssetDcm = parseIntValue(asString(cfg[idxPriceAssetDcm]))
555548 let poolStatus = asString(cfg[idxPoolStatus])
556549 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
557550 let accAmtAssetBalance = asInt(invoke(poolAddress, "getAccBalanceWrapperREADONLY", [amAssetIdStr], nil))
558551 let accPriceAssetBalance = asInt(invoke(poolAddress, "getAccBalanceWrapperREADONLY", [prAssetIdStr], nil))
559552 let amtAssetAmtX18 = parseBigIntValue(asString(invoke(poolAddress, "toX18WrapperREADONLY", [accAmtAssetBalance, amtAssetDcm], nil)))
560553 let priceAssetAmtX18 = parseBigIntValue(asString(invoke(poolAddress, "toX18WrapperREADONLY", [accPriceAssetBalance, priceAssetDcm], nil)))
561554 let curPriceX18 = if ((poolLPBalance == 0))
562555 then zeroBigInt
563556 else parseBigIntValue(asString(invoke(poolAddress, "calcPriceBigIntWrapperREADONLY", [toString(priceAssetAmtX18), toString(amtAssetAmtX18)], nil)))
564557 let curPrice = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [toString(curPriceX18), MULT8], nil))
565558 let inAmAssetAmtX18 = parseBigIntValue(asString(invoke(poolAddress, "toX18WrapperREADONLY", [inAmAssetAmt, amtAssetDcm], nil)))
566559 let inPrAssetAmtX18 = fraction(inAmAssetAmtX18, curPriceX18, MULT18)
567560 let inPrAssetAmt = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [toString(inPrAssetAmtX18), priceAssetDcm], nil))
568561 let res = invoke(poolAddress, "estimatePutOperationWrapperREADONLY", ["", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false], nil)
569- let $t02263122984 = match res {
562+ let $t02336423717 = match res {
570563 case _ =>
571564 if (if (if ($isInstanceOf($match0._1, "Int"))
572565 then if ($isInstanceOf($match0._3, "Int"))
573566 then if ($isInstanceOf($match0._4, "Int"))
574567 then if ($isInstanceOf($match0._5, "Int"))
575568 then $isInstanceOf($match0._6, "Int")
576569 else false
577570 else false
578571 else false
579572 else false)
580573 then (size($match0) == 13)
581574 else false)
582575 then {
583576 let calcLpAmt = $match0._1
584577 let curPriceCalc = $match0._3
585578 let amBalance = $match0._4
586579 let prBalance = $match0._5
587580 let lpEmission = $match0._6
588581 $Tuple5(calcLpAmt, curPriceCalc, amBalance, prBalance, lpEmission)
589582 }
590583 else throw("Couldn't cast types")
591584 }
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
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
597590 $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))
598591 }
599592
600593
601594
602595 @Callable(i)
603596 func poolEvaluatePutByPriceAssetREADONLY (lpAsset,inPrAssetAmt) = {
604597 let poolAddress = addressFromStringValue(getStringByAddressOrFail(factoryDapp, keyFactoryLpAssetToPoolContractAddress(lpAsset)))
605598 let cfg = asAnyList(invoke(poolAddress, "getPoolConfigWrapperREADONLY", nil, nil))
606599 let lpAssetId = fromBase58String(asString(cfg[idxPoolLPAssetId]))
607600 let amAssetIdStr = asString(cfg[idxAmtAssetId])
608601 let amAssetId = fromBase58String(amAssetIdStr)
609602 let prAssetIdStr = asString(cfg[idxPriceAssetId])
610603 let prAssetId = fromBase58String(prAssetIdStr)
611604 let amtAssetDcm = parseIntValue(asString(cfg[idxAmtAssetDcm]))
612605 let priceAssetDcm = parseIntValue(asString(cfg[idxPriceAssetDcm]))
613606 let poolStatus = asString(cfg[idxPoolStatus])
614607 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
615608 let amBalanceRaw = asInt(invoke(poolAddress, "getAccBalanceWrapperREADONLY", [amAssetIdStr], nil))
616609 let prBalanceRaw = asInt(invoke(poolAddress, "getAccBalanceWrapperREADONLY", [prAssetIdStr], nil))
617610 let amBalanceRawX18 = parseBigIntValue(asString(invoke(poolAddress, "toX18WrapperREADONLY", [amBalanceRaw, amtAssetDcm], nil)))
618611 let prBalanceRawX18 = parseBigIntValue(asString(invoke(poolAddress, "toX18WrapperREADONLY", [prBalanceRaw, priceAssetDcm], nil)))
619612 let curPriceX18 = if ((poolLPBalance == 0))
620613 then zeroBigInt
621614 else parseBigIntValue(asString(invoke(poolAddress, "calcPriceBigIntWrapperREADONLY", [toString(prBalanceRawX18), toString(amBalanceRawX18)], nil)))
622615 let curPrice = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [toString(curPriceX18), MULT8], nil))
623616 let inPrAssetAmtX18 = parseBigIntValue(asString(invoke(poolAddress, "toX18WrapperREADONLY", [inPrAssetAmt, priceAssetDcm], nil)))
624617 let inAmAssetAmtX18 = fraction(inPrAssetAmtX18, MULT18, curPriceX18)
625618 let inAmAssetAmt = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [toString(inAmAssetAmtX18), amtAssetDcm], nil))
626619 let res = invoke(poolAddress, "estimatePutOperationWrapperREADONLY", ["", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false], nil)
627- let $t02555725910 = match res {
620+ let $t02629026643 = match res {
628621 case _ =>
629622 if (if (if ($isInstanceOf($match0._1, "Int"))
630623 then if ($isInstanceOf($match0._3, "Int"))
631624 then if ($isInstanceOf($match0._4, "Int"))
632625 then if ($isInstanceOf($match0._5, "Int"))
633626 then $isInstanceOf($match0._6, "Int")
634627 else false
635628 else false
636629 else false
637630 else false)
638631 then (size($match0) == 13)
639632 else false)
640633 then {
641634 let calcLpAmt = $match0._1
642635 let curPriceCalc = $match0._3
643636 let amBalance = $match0._4
644637 let prBalance = $match0._5
645638 let lpEmission = $match0._6
646639 $Tuple5(calcLpAmt, curPriceCalc, amBalance, prBalance, lpEmission)
647640 }
648641 else throw("Couldn't cast types")
649642 }
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
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
655648 $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))
656649 }
657650
658651
659652
660653 @Callable(i)
661654 func poolEvaluateGetREADONLY (paymentLpAssetId,paymentLpAmt) = {
662655 let poolAddress = addressFromStringValue(getStringByAddressOrFail(factoryDapp, keyFactoryLpAssetToPoolContractAddress(paymentLpAssetId)))
663656 let res = invoke(poolAddress, "estimateGetOperationWrapperREADONLY", ["", paymentLpAssetId, paymentLpAmt, toString(poolAddress)], nil)
664- let $t02660527022 = match res {
657+ let $t02733827755 = match res {
665658 case _ =>
666659 if (if (if ($isInstanceOf($match0._1, "Int"))
667660 then if ($isInstanceOf($match0._2, "Int"))
668661 then if ($isInstanceOf($match0._5, "Int"))
669662 then if ($isInstanceOf($match0._6, "Int"))
670663 then if ($isInstanceOf($match0._7, "Int"))
671664 then if ($isInstanceOf($match0._8, "String"))
672665 then $isInstanceOf($match0._9, "String")
673666 else false
674667 else false
675668 else false
676669 else false
677670 else false
678671 else false)
679672 then (size($match0) == 10)
680673 else false)
681674 then {
682675 let outAmAmt = $match0._1
683676 let outPrAmt = $match0._2
684677 let amBalance = $match0._5
685678 let prBalance = $match0._6
686679 let lpEmission = $match0._7
687680 let curPrice = $match0._8
688681 let poolStatus = $match0._9
689682 $Tuple7(outAmAmt, outPrAmt, amBalance, prBalance, lpEmission, curPrice, poolStatus)
690683 }
691684 else throw("Couldn't cast types")
692685 }
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
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
700693 $Tuple2(nil, makeString(["%d%d%d%d%d%d%d", toString(outAmAmt), toString(outPrAmt), toString(amBalance), toString(prBalance), toString(lpEmission), curPrice, poolStatus], SEP))
701694 }
702695
703696
704697
705698 @Callable(i)
706699 func gwxUserInfoREADONLY (userAddress) = {
707700 let gwxUserInfoLIST = asAnyList(invoke(boostingDapp, "gwxUserInfoREADONLY", [userAddress], nil))
708701 let gwxAmount = asInt(gwxUserInfoLIST[0])
709702 $Tuple2(nil, makeString(["%d", toString(gwxAmount)], SEP))
710703 }
711704
712705
713706
714707 @Callable(i)
715708 func unstakeAndGetOneTknV2 (poolAddress,unstakeAmount,outAssetId,minOutAmount) = {
716709 let inv = invoke(addressFromStringValue(poolAddress), "unstakeAndGetOneTknV2", [unstakeAmount, outAssetId, minOutAmount], nil)
717710 if ((inv == inv))
718711 then $Tuple2(nil, unit)
719712 else throw("Strict value is not equal to itself.")
720713 }
721714
722715
723716
724717 @Callable(i)
725718 func getKeysBulkInternal (currentIter,keys,resAcc) = if ((currentIter == size(keys)))
726719 then $Tuple2(nil, resAcc)
727720 else {
728721 let k = split(keys[currentIter], "++")
729722 let addr = addressFromStringValue(k[0])
730723 let key = k[1]
731724 let type = k[2]
732725 let val = getKey(addr, key, type)
733726 let res = (resAcc :+ val)
734727 let inv = invoke(this, "getKeysBulkInternal", [(currentIter + 1), keys, res], nil)
735728 if ((inv == inv))
736729 then $Tuple2(nil, inv)
737730 else throw("Strict value is not equal to itself.")
738731 }
739732
740733
741734
742735 @Callable(i)
743736 func getKeysBulk (keys) = {
744737 let res = invoke(this, "getKeysBulkInternal", [0, keys, nil], nil)
745738 $Tuple2(nil, res)
746739 }
747740
748741
749742
750743 @Callable(i)
751744 func setManager (pendingManagerPublicKey) = {
752745 let checkCaller = mustManager(i)
753746 if ((checkCaller == checkCaller))
754747 then {
755748 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
756749 if ((checkManagerPublicKey == checkManagerPublicKey))
757750 then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
758751 else throw("Strict value is not equal to itself.")
759752 }
760753 else throw("Strict value is not equal to itself.")
761754 }
762755
763756
764757
765758 @Callable(i)
766759 func confirmManager () = {
767760 let pm = pendingManagerPublicKeyOrUnit()
768761 let hasPM = if (isDefined(pm))
769762 then true
770763 else throw("No pending manager")
771764 if ((hasPM == hasPM))
772765 then {
773766 let checkPM = if ((i.callerPublicKey == value(pm)))
774767 then true
775768 else throw("You are not pending manager")
776769 if ((checkPM == checkPM))
777770 then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
778771 else throw("Strict value is not equal to itself.")
779772 }
780773 else throw("Strict value is not equal to itself.")
781774 }
782775
783776
784777 @Verifier(tx)
785778 func verify () = {
786779 let targetPublicKey = match managerPublicKeyOrUnit() {
787780 case pk: ByteVector =>
788781 pk
789782 case _: Unit =>
790783 tx.senderPublicKey
791784 case _ =>
792785 throw("Match error")
793786 }
794787 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
795788 }
796789

github/deemru/w8io/026f985 
98.31 ms