tx · AvqzzYAY4gCiQcJUhY12DmLWydoTL6VawsuDSpLudfy2

3N6wAa7PMFZJu4Zrmp3avXmMnRTrRpMM9Lh:  -0.04300000 Waves

2023.04.05 14:45 [2521194] smart account 3N6wAa7PMFZJu4Zrmp3avXmMnRTrRpMM9Lh > SELF 0.00000000 Waves

{ "type": 13, "id": "AvqzzYAY4gCiQcJUhY12DmLWydoTL6VawsuDSpLudfy2", "fee": 4300000, "feeAssetId": null, "timestamp": 1680695157518, "version": 2, "chainId": 84, "sender": "3N6wAa7PMFZJu4Zrmp3avXmMnRTrRpMM9Lh", "senderPublicKey": "Cr8D7eozSzJh7XHsYTjBinPpo3SS83BrCGiBAJsjGxBo", "proofs": [ "5eoKNx76qwTMGsSJyu5DtmYUJ31wKCiHJhiVn2TUwpE6zDVWXD9sZEVNGhtcxEnjNgvtW2hJWuzFtMzaMjsGNBMa" ], "script": "base64:BgKMNwgCEgASBQoDAQQBEgcKBQEEAQgBEgMKAQgSABIECgIBBBIDCgEBEgQKAgEEEgQKAggBEgQKAggBEgQKAggBEgUKAwEIARIAEgQKAgEBEgMKAQESBQoDAQEBEgQKAggIEgASABIDCgEIEgUKAwEBARIECgIBARIECgIIARIECgIICBILCgkIAQECAQIIBAQSBgoECAgBCBIAEgMKAQESAwoBARIECgIIASIKbFBkZWNpbWFscyIGc2NhbGU4IgxzY2FsZThCaWdJbnQiB3NjYWxlMTgiCnplcm9CaWdJbnQiBGJpZzAiBGJpZzEiBGJpZzIiC3dhdmVzU3RyaW5nIgNTRVAiClBvb2xBY3RpdmUiD1Bvb2xQdXREaXNhYmxlZCITUG9vbE1hdGNoZXJEaXNhYmxlZCIMUG9vbFNodXRkb3duIg5pZHhQb29sQWRkcmVzcyINaWR4UG9vbFN0YXR1cyIQaWR4UG9vbExQQXNzZXRJZCINaWR4QW10QXNzZXRJZCIPaWR4UHJpY2VBc3NldElkIg5pZHhBbXRBc3NldERjbSIQaWR4UHJpY2VBc3NldERjbSIOaWR4SUFtdEFz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wMIBQJlSAlib2R5Qnl0ZXMJAJEDAggFAmVIBnByb29mcwAACAUCZUgPc2VuZGVyUHVibGljS2V5BAJhTAkA9AMDCAUCZUgJYm9keUJ5dGVzCQCRAwIIBQJlSAZwcm9vZnMAAQUCaWsDAwMFAmFJBQJhSwcFAmFMBwYJAQJhSAQFAmFJBQJhSgUCYUsFAmFMAwkAAQIFAmJUAhRTZXRTY3JpcHRUcmFuc2FjdGlvbgQCZ2YFAmJUAwkA9AMDCAUCaWgJYm9keUJ5dGVzCQCRAwIIBQJpaAZwcm9vZnMAAAUCaWoGBAJpbQkA9gMBCQEFdmFsdWUBCAUCZ2YGc2NyaXB0BAJpbgkA2wQBCQEFdmFsdWUBCQCdCAIFAmFUCQECYUYABAJpbwkA8QcBBQR0aGlzAwkAAAIFAmluBQJpbQkBAiE9AgUCaW8FAmltBwkA9AMDCAUCaWgJYm9keUJ5dGVzCQCRAwIIBQJpaAZwcm9vZnMAAAUCaWo5twPY", "height": 2521194, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8K6sFdr3LaNAbaoLe8AiEz3R59u8yKywmgMpcqTA16Qs Next: 8zoQe5RB7mf8NrwrUV3G4N1vXt37cwqYCdTBW8dpJGrL Diff:
OldNewDifferences
965965 else throw("Exchange result is fewer coins than expected")
966966 if ((checkMin == checkMin))
967967 then {
968- let withdrawState = getWithdrawAssetState(assetOut, amountOut)
969- if ((withdrawState == withdrawState))
970- then $Tuple2((withdrawState ++ [ScriptTransfer(addressFromStringValue(addressTo), amountOut, parseAssetId(assetOut))]), amountOut)
968+ let rebalanceState = rebalanceAsset(assetIn)
969+ if ((rebalanceState == rebalanceState))
970+ then {
971+ let withdrawState = getWithdrawAssetState(assetOut, amountOut)
972+ if ((withdrawState == withdrawState))
973+ then $Tuple2(((withdrawState ++ rebalanceState) ++ [ScriptTransfer(addressFromStringValue(addressTo), amountOut, parseAssetId(assetOut))]), amountOut)
974+ else throw("Strict value is not equal to itself.")
975+ }
971976 else throw("Strict value is not equal to itself.")
972977 }
973978 else throw("Strict value is not equal to itself.")
10601065 else throw("Strict value is not equal to itself.")
10611066 }
10621067 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
1063- let $t04425544717 = refreshKLpInternal(0, 0, 0)
1064- if (($t04425544717 == $t04425544717))
1068+ let $t04432444786 = refreshKLpInternal(0, 0, 0)
1069+ if (($t04432444786 == $t04432444786))
10651070 then {
1066- let updatedKLp = $t04425544717._2
1067- let refreshKLpActions = $t04425544717._1
1071+ let updatedKLp = $t04432444786._2
1072+ let refreshKLpActions = $t04432444786._1
10681073 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10691074 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10701075 then {
11011106 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
11021107 if ((currentKLp == currentKLp))
11031108 then {
1104- let $t04532945394 = refreshKLpInternal(0, 0, 0)
1105- let refreshKLpActions = $t04532945394._1
1106- let updatedKLp = $t04532945394._2
1109+ let $t04539845463 = refreshKLpInternal(0, 0, 0)
1110+ let refreshKLpActions = $t04539845463._1
1111+ let updatedKLp = $t04539845463._2
11071112 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11081113 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11091114 then (state ++ refreshKLpActions)
11501155 then {
11511156 let userAddress = i.caller
11521157 let txId = i.transactionId
1153- let $t04658246734 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
1154- if (($t04658246734 == $t04658246734))
1158+ let $t04665146803 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
1159+ if (($t04665146803 == $t04665146803))
11551160 then {
1156- let paymentInAmountAsset = $t04658246734._5
1157- let bonus = $t04658246734._4
1158- let feeAmount = $t04658246734._3
1159- let commonState = $t04658246734._2
1160- let emitAmountEstimated = $t04658246734._1
1161+ let paymentInAmountAsset = $t04665146803._5
1162+ let bonus = $t04665146803._4
1163+ let feeAmount = $t04665146803._3
1164+ let commonState = $t04665146803._2
1165+ let emitAmountEstimated = $t04665146803._1
11611166 let emitAmount = if (if ((minOutAmount > 0))
11621167 then (minOutAmount > emitAmountEstimated)
11631168 else false)
11771182 let sendFee = if ((feeAmount > 0))
11781183 then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
11791184 else nil
1180- let $t04732047517 = if ((this == feeCollectorAddress))
1185+ let $t04738947586 = if ((this == feeCollectorAddress))
11811186 then $Tuple2(0, 0)
11821187 else if (paymentInAmountAsset)
11831188 then $Tuple2(-(feeAmount), 0)
11841189 else $Tuple2(0, -(feeAmount))
1185- let amountAssetBalanceDelta = $t04732047517._1
1186- let priceAssetBalanceDelta = $t04732047517._2
1187- let $t04752047628 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1188- let refreshKLpActions = $t04752047628._1
1189- let updatedKLp = $t04752047628._2
1190+ let amountAssetBalanceDelta = $t04738947586._1
1191+ let priceAssetBalanceDelta = $t04738947586._2
1192+ let $t04758947697 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1193+ let refreshKLpActions = $t04758947697._1
1194+ let updatedKLp = $t04758947697._2
11901195 let kLp = value(getString(keyKLp))
11911196 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11921197 if ((isUpdatedKLpValid == isUpdatedKLpValid))
12111216
12121217 @Callable(i)
12131218 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
1214- let $t04798348140 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
1215- let emitAmountEstimated = $t04798348140._1
1216- let commonState = $t04798348140._2
1217- let feeAmount = $t04798348140._3
1218- let bonus = $t04798348140._4
1219- let paymentInAmountAsset = $t04798348140._5
1219+ let $t04805248209 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
1220+ let emitAmountEstimated = $t04805248209._1
1221+ let commonState = $t04805248209._2
1222+ let feeAmount = $t04805248209._3
1223+ let bonus = $t04805248209._4
1224+ let paymentInAmountAsset = $t04805248209._5
12201225 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
12211226 }
12221227
12531258 then {
12541259 let userAddress = i.caller
12551260 let txId = i.transactionId
1256- let $t04902549178 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
1257- if (($t04902549178 == $t04902549178))
1261+ let $t04909449247 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
1262+ if (($t04909449247 == $t04909449247))
12581263 then {
1259- let outInAmountAsset = $t04902549178._5
1260- let bonus = $t04902549178._4
1261- let feeAmount = $t04902549178._3
1262- let commonState = $t04902549178._2
1263- let amountEstimated = $t04902549178._1
1264+ let outInAmountAsset = $t04909449247._5
1265+ let bonus = $t04909449247._4
1266+ let feeAmount = $t04909449247._3
1267+ let commonState = $t04909449247._2
1268+ let amountEstimated = $t04909449247._1
12641269 let amount = if (if ((minOutAmount > 0))
12651270 then (minOutAmount > amountEstimated)
12661271 else false)
12761281 let sendFee = if ((feeAmount > 0))
12771282 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
12781283 else nil
1279- let $t04974849995 = {
1284+ let $t04981750064 = {
12801285 let feeAmountForCalc = if ((this == feeCollectorAddress))
12811286 then 0
12821287 else feeAmount
12841289 then $Tuple2(-((amount + feeAmountForCalc)), 0)
12851290 else $Tuple2(0, -((amount + feeAmountForCalc)))
12861291 }
1287- let amountAssetBalanceDelta = $t04974849995._1
1288- let priceAssetBalanceDelta = $t04974849995._2
1289- let $t04999850106 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1290- let refreshKLpActions = $t04999850106._1
1291- let updatedKLp = $t04999850106._2
1292+ let amountAssetBalanceDelta = $t04981750064._1
1293+ let priceAssetBalanceDelta = $t04981750064._2
1294+ let $t05006750175 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1295+ let refreshKLpActions = $t05006750175._1
1296+ let updatedKLp = $t05006750175._2
12921297 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
12931298 if ((isUpdatedKLpValid == isUpdatedKLpValid))
12941299 then $Tuple2(((((commonState ++ withdrawState) ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
13091314
13101315 @Callable(i)
13111316 func getOneTknREADONLY (outAssetId,paymentAmount) = {
1312- let $t05038450540 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
1313- let amountEstimated = $t05038450540._1
1314- let commonState = $t05038450540._2
1315- let feeAmount = $t05038450540._3
1316- let bonus = $t05038450540._4
1317- let outInAmountAsset = $t05038450540._5
1317+ let $t05045350609 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
1318+ let amountEstimated = $t05045350609._1
1319+ let commonState = $t05045350609._2
1320+ let feeAmount = $t05045350609._3
1321+ let bonus = $t05045350609._4
1322+ let outInAmountAsset = $t05045350609._5
13181323 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
13191324 }
13201325
13511356 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
13521357 if ((unstakeInv == unstakeInv))
13531358 then {
1354- let $t05144551596 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1355- if (($t05144551596 == $t05144551596))
1359+ let $t05151451665 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1360+ if (($t05151451665 == $t05151451665))
13561361 then {
1357- let outInAmountAsset = $t05144551596._5
1358- let bonus = $t05144551596._4
1359- let feeAmount = $t05144551596._3
1360- let commonState = $t05144551596._2
1361- let amountEstimated = $t05144551596._1
1362+ let outInAmountAsset = $t05151451665._5
1363+ let bonus = $t05151451665._4
1364+ let feeAmount = $t05151451665._3
1365+ let commonState = $t05151451665._2
1366+ let amountEstimated = $t05151451665._1
13621367 let amount = if (if ((minOutAmount > 0))
13631368 then (minOutAmount > amountEstimated)
13641369 else false)
13741379 let sendFee = if ((feeAmount > 0))
13751380 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
13761381 else nil
1377- let $t05216152408 = {
1382+ let $t05223052477 = {
13781383 let feeAmountForCalc = if ((this == feeCollectorAddress))
13791384 then 0
13801385 else feeAmount
13821387 then $Tuple2(-((amount + feeAmountForCalc)), 0)
13831388 else $Tuple2(0, -((amount + feeAmountForCalc)))
13841389 }
1385- let amountAssetBalanceDelta = $t05216152408._1
1386- let priceAssetBalanceDelta = $t05216152408._2
1387- let $t05241152519 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1388- let refreshKLpActions = $t05241152519._1
1389- let updatedKLp = $t05241152519._2
1390+ let amountAssetBalanceDelta = $t05223052477._1
1391+ let priceAssetBalanceDelta = $t05223052477._2
1392+ let $t05248052588 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1393+ let refreshKLpActions = $t05248052588._1
1394+ let updatedKLp = $t05248052588._2
13901395 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
13911396 if ((isUpdatedKLpValid == isUpdatedKLpValid))
13921397 then $Tuple2(((((commonState ++ withdrawState) ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
14211426 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
14221427 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
14231428 then {
1424- let $t05348653568 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1425- let refreshKLpActions = $t05348653568._1
1426- let updatedKLp = $t05348653568._2
1429+ let $t05355553637 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1430+ let refreshKLpActions = $t05355553637._1
1431+ let updatedKLp = $t05355553637._2
14271432 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
14281433 if ((isUpdatedKLpValid == isUpdatedKLpValid))
14291434 then (state ++ refreshKLpActions)
14551460 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
14561461 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
14571462 then {
1458- let $t05451754598 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1459- let refreshKLpActions = $t05451754598._1
1460- let updatedKLp = $t05451754598._2
1463+ let $t05458654667 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1464+ let refreshKLpActions = $t05458654667._1
1465+ let updatedKLp = $t05458654667._2
14611466 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
14621467 if ((isUpdatedKLpValid == isUpdatedKLpValid))
14631468 then (state ++ refreshKLpActions)
15011506 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
15021507 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
15031508 then {
1504- let $t05572455805 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1505- let refreshKLpActions = $t05572455805._1
1506- let updatedKLp = $t05572455805._2
1509+ let $t05579355874 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1510+ let refreshKLpActions = $t05579355874._1
1511+ let updatedKLp = $t05579355874._2
15071512 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
15081513 if ((isUpdatedKLpValid == isUpdatedKLpValid))
15091514 then (state ++ refreshKLpActions)
15541559 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
15551560 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
15561561 then {
1557- let $t05710057181 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1558- let refreshKLpActions = $t05710057181._1
1559- let updatedKLp = $t05710057181._2
1562+ let $t05716957250 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1563+ let refreshKLpActions = $t05716957250._1
1564+ let updatedKLp = $t05716957250._2
15601565 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
15611566 if ((isUpdatedKLpValid == isUpdatedKLpValid))
15621567 then (state ++ refreshKLpActions)
15911596 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
15921597 then {
15931598 let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
1594- let $t05836858432 = refreshKLpInternal(0, 0, 0)
1595- let kLpUpdateActions = $t05836858432._1
1596- let updatedKLp = $t05836858432._2
1599+ let $t05843758501 = refreshKLpInternal(0, 0, 0)
1600+ let kLpUpdateActions = $t05843758501._1
1601+ let updatedKLp = $t05843758501._2
15971602 let actions = if ((kLp != updatedKLp))
15981603 then kLpUpdateActions
15991604 else throwErr("nothing to refresh")
17681773 match tx {
17691774 case order: Order =>
17701775 let matcherPub = getMatcherPubOrFail()
1771- let $t06709467163 = validateMatcherOrderAllowed(order)
1772- let orderValid = $t06709467163._1
1773- let orderValidInfo = $t06709467163._2
1776+ let $t06716367232 = validateMatcherOrderAllowed(order)
1777+ let orderValid = $t06716367232._1
1778+ let orderValidInfo = $t06716367232._2
17741779 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
17751780 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
17761781 if (if (if (orderValid)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let lPdecimals = 8
55
66 let scale8 = 100000000
77
88 let scale8BigInt = toBigInt(100000000)
99
1010 let scale18 = toBigInt(1000000000000000000)
1111
1212 let zeroBigInt = toBigInt(0)
1313
1414 let big0 = toBigInt(0)
1515
1616 let big1 = toBigInt(1)
1717
1818 let big2 = toBigInt(2)
1919
2020 let wavesString = "WAVES"
2121
2222 let SEP = "__"
2323
2424 let PoolActive = 1
2525
2626 let PoolPutDisabled = 2
2727
2828 let PoolMatcherDisabled = 3
2929
3030 let PoolShutdown = 4
3131
3232 let idxPoolAddress = 1
3333
3434 let idxPoolStatus = 2
3535
3636 let idxPoolLPAssetId = 3
3737
3838 let idxAmtAssetId = 4
3939
4040 let idxPriceAssetId = 5
4141
4242 let idxAmtAssetDcm = 6
4343
4444 let idxPriceAssetDcm = 7
4545
4646 let idxIAmtAssetId = 8
4747
4848 let idxIPriceAssetId = 9
4949
5050 let idxLPAssetDcm = 10
5151
5252 let idxPoolAmtAssetAmt = 1
5353
5454 let idxPoolPriceAssetAmt = 2
5555
5656 let idxPoolLPAssetAmt = 3
5757
5858 let idxFactoryStakingContract = 1
5959
6060 let idxFactorySlippageContract = 7
6161
6262 func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), scale18, toBigInt(origScaleMult))
6363
6464
6565 func toX18BigInt (origVal,origScaleMult) = fraction(origVal, scale18, origScaleMult)
6666
6767
6868 func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), scale18))
6969
7070
7171 func fromX18Round (val,resultScaleMult,round) = toInt(fraction(val, toBigInt(resultScaleMult), scale18, round))
7272
7373
7474 func toScale (amt,resScale,curScale) = fraction(amt, resScale, curScale)
7575
7676
7777 func abs (val) = if ((0 > val))
7878 then -(val)
7979 else val
8080
8181
8282 func absBigInt (val) = if ((zeroBigInt > val))
8383 then -(val)
8484 else val
8585
8686
8787 func swapContract () = "%s__swapContract"
8888
8989
9090 func fc () = "%s__factoryContract"
9191
9292
9393 func mpk () = "%s__managerPublicKey"
9494
9595
9696 func pmpk () = "%s__pendingManagerPublicKey"
9797
9898
9999 func pl () = "%s%s__price__last"
100100
101101
102102 func ph (h,timestamp) = makeString(["%s%s%d%d__price__history", toString(h), toString(timestamp)], SEP)
103103
104104
105105 func pau (userAddress,txId) = ((("%s%s%s__P__" + userAddress) + "__") + txId)
106106
107107
108108 func gau (userAddress,txId) = ((("%s%s%s__G__" + userAddress) + "__") + txId)
109109
110110
111111 func aa () = "%s__amountAsset"
112112
113113
114114 func pa () = "%s__priceAsset"
115115
116116
117117 let keyFee = "%s__fee"
118118
119119 let feeDefault = fraction(10, scale8, 10000)
120120
121121 let fee = valueOrElse(getInteger(this, keyFee), feeDefault)
122122
123123 let keyKLp = makeString(["%s", "kLp"], SEP)
124124
125125 let keyKLpRefreshedHeight = makeString(["%s", "kLpRefreshedHeight"], SEP)
126126
127127 let keyKLpRefreshDelay = makeString(["%s", "refreshKLpDelay"], SEP)
128128
129129 let kLpRefreshDelayDefault = 30
130130
131131 let kLpRefreshDelay = valueOrElse(getInteger(this, keyKLpRefreshDelay), kLpRefreshDelayDefault)
132132
133133 func keyAdditionalBalance (assetId) = makeString(["%s%s", "stakedBalance", assetId], SEP)
134134
135135
136136 func keyStakingAssetBalance (assetId) = makeString(["%s%s", "shareAssetBalance", assetId], SEP)
137137
138138
139139 func getAdditionalBalanceOrZero (assetId) = valueOrElse(getInteger(this, keyAdditionalBalance(assetId)), 0)
140140
141141
142142 func getStakingAssetBalanceOrZero (assetId) = valueOrElse(getInteger(this, keyStakingAssetBalance(assetId)), 0)
143143
144144
145145 func keyFactoryConfig () = "%s__factoryConfig"
146146
147147
148148 func keyMatcherPub () = "%s%s__matcher__publicKey"
149149
150150
151151 func keyMappingPoolContractAddressToPoolAssets (poolContractAddress) = (("%s%s%s__" + poolContractAddress) + "__mappings__poolContract2LpAsset")
152152
153153
154154 func keyPoolConfig (iAmtAsset,iPriceAsset) = (((("%d%d%s__" + iAmtAsset) + "__") + iPriceAsset) + "__config")
155155
156156
157157 func keyMappingsBaseAsset2internalId (baseAssetStr) = ("%s%s%s__mappings__baseAsset2internalId__" + baseAssetStr)
158158
159159
160160 func keyAllPoolsShutdown () = "%s__shutdown"
161161
162162
163163 func keyPoolWeight (contractAddress) = ("%s%s__poolWeight__" + contractAddress)
164164
165165
166166 func keyAllowedLpScriptHash () = "%s__allowedLpScriptHash"
167167
168168
169169 let keyFeeCollectorAddress = "%s__feeCollectorAddress"
170170
171171 func throwOrderError (orderValid,orderValidInfo,senderValid,matcherValid) = throw((((((((("order validation failed: orderValid=" + toString(orderValid)) + " (") + orderValidInfo) + ")") + " senderValid=") + toString(senderValid)) + " matcherValid=") + toString(matcherValid)))
172172
173173
174174 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
175175
176176
177177 func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
178178
179179
180180 func throwErr (msg) = throw(makeString(["lp.ride:", msg], " "))
181181
182182
183183 func fmtErr (msg) = makeString(["lp.ride:", msg], " ")
184184
185185
186186 let factoryContract = addressFromStringValue(getStringOrFail(this, fc()))
187187
188188 let feeCollectorAddress = addressFromStringValue(getStringOrFail(factoryContract, keyFeeCollectorAddress))
189189
190190 let inFee = {
191191 let @ = invoke(factoryContract, "getInFeeREADONLY", [toString(this)], nil)
192192 if ($isInstanceOf(@, "Int"))
193193 then @
194194 else throw(($getType(@) + " couldn't be cast to Int"))
195195 }
196196
197197 let outFee = {
198198 let @ = invoke(factoryContract, "getOutFeeREADONLY", [toString(this)], nil)
199199 if ($isInstanceOf(@, "Int"))
200200 then @
201201 else throw(($getType(@) + " couldn't be cast to Int"))
202202 }
203203
204204 func isGlobalShutdown () = valueOrElse(getBoolean(factoryContract, keyAllPoolsShutdown()), false)
205205
206206
207207 func getMatcherPubOrFail () = fromBase58String(getStringOrFail(factoryContract, keyMatcherPub()))
208208
209209
210210 func getPoolConfig () = {
211211 let amtAsset = getStringOrFail(this, aa())
212212 let priceAsset = getStringOrFail(this, pa())
213213 let iPriceAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(priceAsset))
214214 let iAmtAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(amtAsset))
215215 split(getStringOrFail(factoryContract, keyPoolConfig(toString(iAmtAsset), toString(iPriceAsset))), SEP)
216216 }
217217
218218
219219 func parseAssetId (input) = if ((input == wavesString))
220220 then unit
221221 else fromBase58String(input)
222222
223223
224224 func assetIdToString (input) = if ((input == unit))
225225 then wavesString
226226 else toBase58String(value(input))
227227
228228
229229 func parsePoolConfig (poolConfig) = $Tuple7(addressFromStringValue(poolConfig[idxPoolAddress]), parseIntValue(poolConfig[idxPoolStatus]), fromBase58String(poolConfig[idxPoolLPAssetId]), parseAssetId(poolConfig[idxAmtAssetId]), parseAssetId(poolConfig[idxPriceAssetId]), parseIntValue(poolConfig[idxAmtAssetDcm]), parseIntValue(poolConfig[idxPriceAssetDcm]))
230230
231231
232232 let poolConfigParsed = parsePoolConfig(getPoolConfig())
233233
234234 let $t089629128 = poolConfigParsed
235235
236236 let cfgPoolAddress = $t089629128._1
237237
238238 let cfgPoolStatus = $t089629128._2
239239
240240 let cfgLpAssetId = $t089629128._3
241241
242242 let cfgAmountAssetId = $t089629128._4
243243
244244 let cfgPriceAssetId = $t089629128._5
245245
246246 let cfgAmountAssetDecimals = $t089629128._6
247247
248248 let cfgPriceAssetDecimals = $t089629128._7
249249
250250 func getFactoryConfig () = split(getStringOrFail(factoryContract, keyFactoryConfig()), SEP)
251251
252252
253253 let stakingContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactoryStakingContract]), "incorrect staking address")
254254
255255 let slippageContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactorySlippageContract]), "incorrect staking address")
256256
257257 func dataPutActionInfo (inAmtAssetAmt,inPriceAssetAmt,outLpAmt,price,slippageTolerancePassedByUser,slippageToleranceReal,txHeight,txTimestamp,slipageAmtAssetAmt,slipagePriceAssetAmt) = makeString(["%d%d%d%d%d%d%d%d%d%d", toString(inAmtAssetAmt), toString(inPriceAssetAmt), toString(outLpAmt), toString(price), toString(slippageTolerancePassedByUser), toString(slippageToleranceReal), toString(txHeight), toString(txTimestamp), toString(slipageAmtAssetAmt), toString(slipagePriceAssetAmt)], SEP)
258258
259259
260260 func dataGetActionInfo (outAmtAssetAmt,outPriceAssetAmt,inLpAmt,price,txHeight,txTimestamp) = makeString(["%d%d%d%d%d%d", toString(outAmtAssetAmt), toString(outPriceAssetAmt), toString(inLpAmt), toString(price), toString(txHeight), toString(txTimestamp)], SEP)
261261
262262
263263 func getAccBalance (assetId) = {
264264 let balanceOnPool = if ((assetId == "WAVES"))
265265 then wavesBalance(this).available
266266 else assetBalance(this, fromBase58String(assetId))
267267 let totalBalance = ((balanceOnPool + getAdditionalBalanceOrZero(assetId)) - getStakingAssetBalanceOrZero(assetId))
268268 max([0, totalBalance])
269269 }
270270
271271
272272 func calcPriceBigInt (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18)
273273
274274
275275 func calcPriceBigIntRound (prAmtX18,amAmtX18,round) = fraction(prAmtX18, scale18, amAmtX18, round)
276276
277277
278278 func getRate (proxy) = {
279279 let inv = invoke(proxy, "getRate", nil, nil)
280280 if ((inv == inv))
281281 then match inv {
282282 case r: Int =>
283283 r
284284 case _ =>
285285 throwErr("proxy.getRate() unexpected value")
286286 }
287287 else throw("Strict value is not equal to itself.")
288288 }
289289
290290
291291 func deposit (assetId,amount,stakingAssetId,proxy) = {
292292 let currentAdditionalBalance = getAdditionalBalanceOrZero(assetId)
293293 if ((currentAdditionalBalance == currentAdditionalBalance))
294294 then {
295295 let currentStakingAssetBalance = getStakingAssetBalanceOrZero(stakingAssetId)
296296 if ((currentStakingAssetBalance == currentStakingAssetBalance))
297297 then {
298298 let asset = parseAssetId(assetId)
299299 if ((amount > 0))
300300 then {
301301 let depositInvoke = invoke(proxy, "deposit", nil, [AttachedPayment(asset, amount)])
302302 if ((depositInvoke == depositInvoke))
303303 then match depositInvoke {
304304 case receivedStakingAsset: Int =>
305305 let newAdditionalBalance = (currentAdditionalBalance + amount)
306306 let newStakingAssetBalance = (currentStakingAssetBalance + receivedStakingAsset)
307307 [IntegerEntry(keyAdditionalBalance(assetId), newAdditionalBalance), IntegerEntry(keyStakingAssetBalance(stakingAssetId), newStakingAssetBalance)]
308308 case _ =>
309309 nil
310310 }
311311 else throw("Strict value is not equal to itself.")
312312 }
313313 else nil
314314 }
315315 else throw("Strict value is not equal to itself.")
316316 }
317317 else throw("Strict value is not equal to itself.")
318318 }
319319
320320
321321 func withdraw (assetId,amount,stakingAssetId,proxy,proxyRateMul,profitAddress) = {
322322 let currentAdditionalBalance = getAdditionalBalanceOrZero(assetId)
323323 if ((currentAdditionalBalance == currentAdditionalBalance))
324324 then {
325325 let currentStakingAssetBalance = getStakingAssetBalanceOrZero(stakingAssetId)
326326 if ((currentStakingAssetBalance == currentStakingAssetBalance))
327327 then {
328328 let currentProxyRate = getRate(proxy)
329329 if ((currentProxyRate == currentProxyRate))
330330 then {
331331 let oldRate = fraction(proxyRateMul, currentAdditionalBalance, currentStakingAssetBalance)
332332 let stakingAsset = parseAssetId(stakingAssetId)
333333 let oldSendStakingAmount = fraction(proxyRateMul, amount, oldRate)
334334 let sendStakingAssetAmount = fraction(proxyRateMul, amount, currentProxyRate)
335335 let profitAmount = max([0, (oldSendStakingAmount - sendStakingAssetAmount)])
336336 if ((sendStakingAssetAmount > 0))
337337 then {
338338 let withdrawInvoke = invoke(proxy, "withdraw", nil, [AttachedPayment(stakingAsset, sendStakingAssetAmount)])
339339 if ((withdrawInvoke == withdrawInvoke))
340340 then match withdrawInvoke {
341341 case receivedAssets: Int =>
342342 let newAdditionalBalance = (currentAdditionalBalance - receivedAssets)
343343 let newStakingAssetBalance = ((currentStakingAssetBalance - sendStakingAssetAmount) - profitAmount)
344344 [IntegerEntry(keyAdditionalBalance(assetId), newAdditionalBalance), IntegerEntry(keyStakingAssetBalance(stakingAssetId), newStakingAssetBalance), ScriptTransfer(profitAddress, profitAmount, parseAssetId(stakingAssetId))]
345345 case _ =>
346346 nil
347347 }
348348 else throw("Strict value is not equal to itself.")
349349 }
350350 else nil
351351 }
352352 else throw("Strict value is not equal to itself.")
353353 }
354354 else throw("Strict value is not equal to itself.")
355355 }
356356 else throw("Strict value is not equal to itself.")
357357 }
358358
359359
360360 func getLeaseProxyConfig (assetId) = invoke(factoryContract, "getPoolLeaseConfigREADONLY", [toString(this), assetId], nil)
361361
362362
363363 func rebalanceInternal (targetRatio,assetId,stakingAssetId,minBalance,proxy,proxyRateMul,profitAddress) = {
364364 let currentAdditionalBalance = getAdditionalBalanceOrZero(assetId)
365365 if ((currentAdditionalBalance == currentAdditionalBalance))
366366 then {
367367 let currentStakingAssetBalance = getStakingAssetBalanceOrZero(stakingAssetId)
368368 if ((currentStakingAssetBalance == currentStakingAssetBalance))
369369 then {
370370 let availableBalance = match parseAssetId(assetId) {
371371 case b: ByteVector =>
372372 assetBalance(this, b)
373373 case u: Unit =>
374374 wavesBalance(this).available
375375 case _ =>
376376 throw("Match error")
377377 }
378378 if ((availableBalance == availableBalance))
379379 then {
380380 let wholeBalance = max([0, ((availableBalance + currentAdditionalBalance) - minBalance)])
381381 let targetAdditionalBalance = fraction(targetRatio, wholeBalance, 100)
382382 let diff = (currentAdditionalBalance - targetAdditionalBalance)
383383 if ((diff == 0))
384384 then nil
385385 else if ((0 > diff))
386386 then {
387387 let sendAssetAmount = -(diff)
388388 deposit(assetId, sendAssetAmount, stakingAssetId, proxy)
389389 }
390390 else {
391391 let getAssetAmount = diff
392392 withdraw(assetId, getAssetAmount, stakingAssetId, proxy, proxyRateMul, profitAddress)
393393 }
394394 }
395395 else throw("Strict value is not equal to itself.")
396396 }
397397 else throw("Strict value is not equal to itself.")
398398 }
399399 else throw("Strict value is not equal to itself.")
400400 }
401401
402402
403403 func rebalanceAsset (assetId) = match getLeaseProxyConfig(assetId) {
404404 case a: (Boolean, Int, Int, String, String, Int, String) =>
405405 let $t01547915588 = a
406406 let isLeasable = $t01547915588._1
407407 let leasedRatio = $t01547915588._2
408408 let minBalance = $t01547915588._3
409409 let proxyAddress = $t01547915588._4
410410 let proxyAssetId = $t01547915588._5
411411 let proxyRateMul = $t01547915588._6
412412 let stakingProfitAddress = $t01547915588._7
413413 if (isLeasable)
414414 then rebalanceInternal(leasedRatio, assetId, proxyAssetId, minBalance, addressFromStringValue(proxyAddress), proxyRateMul, addressFromStringValue(stakingProfitAddress))
415415 else nil
416416 case _ =>
417417 throwErr((("[" + assetId) + "] Rebalance error"))
418418 }
419419
420420
421421 func getWithdrawAssetState (assetId,getAmount) = match getLeaseProxyConfig(assetId) {
422422 case a: (Boolean, Int, Int, String, String, Int, String) =>
423423 let $t01618116290 = a
424424 let isLeasable = $t01618116290._1
425425 let leasedRatio = $t01618116290._2
426426 let minBalance = $t01618116290._3
427427 let proxyAddress = $t01618116290._4
428428 let proxyAssetId = $t01618116290._5
429429 let proxyRateMul = $t01618116290._6
430430 let stakingProfitAddress = $t01618116290._7
431431 if (isLeasable)
432432 then {
433433 let newTotalCalcBalance = max([0, ((getAccBalance(assetId) - getAmount) - minBalance)])
434434 if ((newTotalCalcBalance == newTotalCalcBalance))
435435 then {
436436 let newAdditionalBalance = fraction(leasedRatio, newTotalCalcBalance, 100)
437437 if ((newAdditionalBalance == newAdditionalBalance))
438438 then {
439439 let withdrawAmount = max([0, (getAdditionalBalanceOrZero(assetId) - newAdditionalBalance)])
440440 if ((withdrawAmount == withdrawAmount))
441441 then withdraw(assetId, withdrawAmount, proxyAssetId, addressFromStringValue(proxyAddress), proxyRateMul, addressFromStringValue(stakingProfitAddress))
442442 else throw("Strict value is not equal to itself.")
443443 }
444444 else throw("Strict value is not equal to itself.")
445445 }
446446 else throw("Strict value is not equal to itself.")
447447 }
448448 else nil
449449 case _ =>
450450 throwErr((("[" + assetId) + "] getWithdrawAssetState() error"))
451451 }
452452
453453
454454 func privateCalcPrice (amAssetDcm,prAssetDcm,amAmt,prAmt) = {
455455 let amtAssetAmtX18 = toX18(amAmt, amAssetDcm)
456456 let priceAssetAmtX18 = toX18(prAmt, prAssetDcm)
457457 calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
458458 }
459459
460460
461461 func calcPrices (amAmt,prAmt,lpAmt) = {
462462 let cfg = getPoolConfig()
463463 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
464464 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
465465 let priceX18 = privateCalcPrice(amtAssetDcm, priceAssetDcm, amAmt, prAmt)
466466 let amAmtX18 = toX18(amAmt, amtAssetDcm)
467467 let prAmtX18 = toX18(prAmt, priceAssetDcm)
468468 let lpAmtX18 = toX18(lpAmt, scale8)
469469 let lpPriceInAmAssetX18 = calcPriceBigInt(amAmtX18, lpAmtX18)
470470 let lpPriceInPrAssetX18 = calcPriceBigInt(prAmtX18, lpAmtX18)
471471 [priceX18, lpPriceInAmAssetX18, lpPriceInPrAssetX18]
472472 }
473473
474474
475475 func calculatePrices (amAmt,prAmt,lpAmt) = {
476476 let prices = calcPrices(amAmt, prAmt, lpAmt)
477477 [fromX18(prices[0], scale8), fromX18(prices[1], scale8), fromX18(prices[2], scale8)]
478478 }
479479
480480
481481 func estimateGetOperation (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
482482 let cfg = getPoolConfig()
483483 let lpAssetId = cfg[idxPoolLPAssetId]
484484 let amAssetId = cfg[idxAmtAssetId]
485485 let prAssetId = cfg[idxPriceAssetId]
486486 let amAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
487487 let prAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
488488 let poolStatus = cfg[idxPoolStatus]
489489 let lpEmission = valueOrErrorMessage(assetInfo(fromBase58String(lpAssetId)), (("Asset " + lpAssetId) + " doesn't exist")).quantity
490490 if ((lpAssetId != pmtAssetId))
491491 then throw("Invalid asset passed.")
492492 else {
493493 let amBalance = getAccBalance(amAssetId)
494494 let amBalanceX18 = toX18(amBalance, amAssetDcm)
495495 let prBalance = getAccBalance(prAssetId)
496496 let prBalanceX18 = toX18(prBalance, prAssetDcm)
497497 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
498498 let curPrice = fromX18(curPriceX18, scale8)
499499 let pmtLpAmtX18 = toX18(pmtLpAmt, scale8)
500500 let lpEmissionX18 = toX18(lpEmission, scale8)
501501 let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissionX18)
502502 let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissionX18)
503503 let outAmAmt = fromX18Round(outAmAmtX18, amAssetDcm, FLOOR)
504504 let outPrAmt = fromX18Round(outPrAmtX18, prAssetDcm, FLOOR)
505505 let AmAmtWithdrawState = getWithdrawAssetState(amAssetId, outAmAmt)
506506 if ((AmAmtWithdrawState == AmAmtWithdrawState))
507507 then {
508508 let PrAmtWithdrawState = getWithdrawAssetState(prAssetId, outPrAmt)
509509 if ((PrAmtWithdrawState == PrAmtWithdrawState))
510510 then {
511511 let state = if ((txId58 == ""))
512512 then nil
513513 else ((AmAmtWithdrawState ++ PrAmtWithdrawState) ++ [ScriptTransfer(userAddress, outAmAmt, if ((amAssetId == "WAVES"))
514514 then unit
515515 else fromBase58String(amAssetId)), ScriptTransfer(userAddress, outPrAmt, if ((prAssetId == "WAVES"))
516516 then unit
517517 else fromBase58String(prAssetId)), StringEntry(gau(toString(userAddress), txId58), dataGetActionInfo(outAmAmt, outPrAmt, pmtLpAmt, curPrice, height, lastBlock.timestamp)), IntegerEntry(pl(), curPrice), IntegerEntry(ph(height, lastBlock.timestamp), curPrice)])
518518 $Tuple10(outAmAmt, outPrAmt, amAssetId, prAssetId, amBalance, prBalance, lpEmission, curPriceX18, poolStatus, state)
519519 }
520520 else throw("Strict value is not equal to itself.")
521521 }
522522 else throw("Strict value is not equal to itself.")
523523 }
524524 }
525525
526526
527527 func estimatePutOperation (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = {
528528 let cfg = getPoolConfig()
529529 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
530530 let amAssetIdStr = cfg[idxAmtAssetId]
531531 let prAssetIdStr = cfg[idxPriceAssetId]
532532 let iAmtAssetId = cfg[idxIAmtAssetId]
533533 let iPriceAssetId = cfg[idxIPriceAssetId]
534534 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
535535 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
536536 let poolStatus = cfg[idxPoolStatus]
537537 let lpEmission = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
538538 let inAmAssetIdStr = toBase58String(valueOrElse(inAmAssetId, fromBase58String("WAVES")))
539539 let inPrAssetIdStr = toBase58String(valueOrElse(inPrAssetId, fromBase58String("WAVES")))
540540 if (if ((amAssetIdStr != inAmAssetIdStr))
541541 then true
542542 else (prAssetIdStr != inPrAssetIdStr))
543543 then throw("Invalid amt or price asset passed.")
544544 else {
545545 let amBalance = if (isEvaluate)
546546 then getAccBalance(amAssetIdStr)
547547 else (getAccBalance(amAssetIdStr) - inAmAssetAmt)
548548 let prBalance = if (isEvaluate)
549549 then getAccBalance(prAssetIdStr)
550550 else (getAccBalance(prAssetIdStr) - inPrAssetAmt)
551551 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
552552 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
553553 let userPriceX18 = calcPriceBigInt(inPrAssetAmtX18, inAmAssetAmtX18)
554554 let amBalanceX18 = toX18(amBalance, amtAssetDcm)
555555 let prBalanceX18 = toX18(prBalance, priceAssetDcm)
556556 let res = if ((lpEmission == 0))
557557 then {
558558 let curPriceX18 = zeroBigInt
559559 let slippageX18 = zeroBigInt
560560 let lpAmtX18 = pow((inAmAssetAmtX18 * inPrAssetAmtX18), 0, toBigInt(5), 1, 0, DOWN)
561561 $Tuple5(fromX18(lpAmtX18, scale8), fromX18(inAmAssetAmtX18, amtAssetDcm), fromX18(inPrAssetAmtX18, priceAssetDcm), calcPriceBigInt((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18)
562562 }
563563 else {
564564 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
565565 let slippageX18 = fraction(absBigInt((curPriceX18 - userPriceX18)), scale18, curPriceX18)
566566 let slippageToleranceX18 = toX18(slippageTolerance, scale8)
567567 if (if ((curPriceX18 != zeroBigInt))
568568 then (slippageX18 > slippageToleranceX18)
569569 else false)
570570 then throw(((("Price slippage " + toString(slippageX18)) + " exceeded the passed limit of ") + toString(slippageToleranceX18)))
571571 else {
572572 let lpEmissionX18 = toX18(lpEmission, scale8)
573573 let prViaAmX18 = fraction(inAmAssetAmtX18, calcPriceBigIntRound(prBalanceX18, amBalanceX18, CEILING), scale18, CEILING)
574574 let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, calcPriceBigIntRound(prBalanceX18, amBalanceX18, FLOOR), CEILING)
575575 let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18))
576576 then $Tuple2(amViaPrX18, inPrAssetAmtX18)
577577 else $Tuple2(inAmAssetAmtX18, prViaAmX18)
578578 let expAmtAssetAmtX18 = expectedAmts._1
579579 let expPriceAssetAmtX18 = expectedAmts._2
580580 let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18, FLOOR)
581581 $Tuple5(fromX18Round(lpAmtX18, scale8, FLOOR), fromX18Round(expAmtAssetAmtX18, amtAssetDcm, CEILING), fromX18Round(expPriceAssetAmtX18, priceAssetDcm, CEILING), curPriceX18, slippageX18)
582582 }
583583 }
584584 let calcLpAmt = res._1
585585 let calcAmAssetPmt = res._2
586586 let calcPrAssetPmt = res._3
587587 let curPrice = fromX18(res._4, scale8)
588588 let slippageCalc = fromX18(res._5, scale8)
589589 if ((0 >= calcLpAmt))
590590 then throw("Invalid calculations. LP calculated is less than zero.")
591591 else {
592592 let emitLpAmt = if (!(emitLp))
593593 then 0
594594 else calcLpAmt
595595 let amDiff = (inAmAssetAmt - calcAmAssetPmt)
596596 let prDiff = (inPrAssetAmt - calcPrAssetPmt)
597597 let commonState = [IntegerEntry(pl(), curPrice), IntegerEntry(ph(height, lastBlock.timestamp), curPrice), StringEntry(pau(userAddress, txId58), dataPutActionInfo(calcAmAssetPmt, calcPrAssetPmt, emitLpAmt, curPrice, slippageTolerance, slippageCalc, height, lastBlock.timestamp, amDiff, prDiff))]
598598 $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEmission, lpAssetId, poolStatus, commonState, amDiff, prDiff, inAmAssetId, inPrAssetId)
599599 }
600600 }
601601 }
602602
603603
604604 func calcKLp (amountBalance,priceBalance,lpEmission) = {
605605 let amountBalanceX18 = toX18BigInt(amountBalance, toBigInt(cfgAmountAssetDecimals))
606606 let priceBalanceX18 = toX18BigInt(priceBalance, toBigInt(cfgPriceAssetDecimals))
607607 let updatedKLp = fraction(pow((amountBalanceX18 * priceBalanceX18), 0, toBigInt(5), 1, 18, DOWN), big1, lpEmission)
608608 if ((lpEmission == big0))
609609 then big0
610610 else updatedKLp
611611 }
612612
613613
614614 func calcCurrentKLp (amountAssetDelta,priceAssetDelta,lpAssetEmissionDelta) = {
615615 let amountAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) - amountAssetDelta)
616616 let priceAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) - priceAssetDelta)
617617 let lpAssetEmission = (toBigInt(value(assetInfo(cfgLpAssetId)).quantity) - lpAssetEmissionDelta)
618618 let currentKLp = calcKLp(amountAssetBalance, priceAssetBalance, lpAssetEmission)
619619 currentKLp
620620 }
621621
622622
623623 func refreshKLpInternal (amountAssetBalanceDelta,priceAssetBalanceDelta,lpAssetEmissionDelta) = {
624624 let amountAssetBalance = (getAccBalance(assetIdToString(cfgAmountAssetId)) + amountAssetBalanceDelta)
625625 let priceAssetBalance = (getAccBalance(assetIdToString(cfgPriceAssetId)) + priceAssetBalanceDelta)
626626 let lpAssetEmission = (value(assetInfo(cfgLpAssetId)).quantity + lpAssetEmissionDelta)
627627 let updatedKLp = calcKLp(toBigInt(amountAssetBalance), toBigInt(priceAssetBalance), toBigInt(lpAssetEmission))
628628 let actions = [IntegerEntry(keyKLpRefreshedHeight, height), StringEntry(keyKLp, toString(updatedKLp))]
629629 $Tuple2(actions, updatedKLp)
630630 }
631631
632632
633633 func validateUpdatedKLp (oldKLp,updatedKLp) = if ((updatedKLp >= oldKLp))
634634 then true
635635 else throwErr(makeString(["updated KLp lower than current KLp", toString(oldKLp), toString(updatedKLp)], " "))
636636
637637
638638 func validateMatcherOrderAllowed (order) = {
639639 let amountAssetBalance = getAccBalance(assetIdToString(cfgAmountAssetId))
640640 let priceAssetBalance = getAccBalance(assetIdToString(cfgPriceAssetId))
641641 let amountAssetAmount = order.amount
642642 let priceAssetAmount = fraction(order.amount, order.price, scale8, FLOOR)
643643 let $t02837228584 = if ((order.orderType == Buy))
644644 then $Tuple2(amountAssetAmount, -(priceAssetAmount))
645645 else $Tuple2(-(amountAssetAmount), priceAssetAmount)
646646 let amountAssetBalanceDelta = $t02837228584._1
647647 let priceAssetBalanceDelta = $t02837228584._2
648648 if (if (if (isGlobalShutdown())
649649 then true
650650 else (cfgPoolStatus == PoolMatcherDisabled))
651651 then true
652652 else (cfgPoolStatus == PoolShutdown))
653653 then throw("Exchange operations disabled")
654654 else if (if ((order.assetPair.amountAsset != cfgAmountAssetId))
655655 then true
656656 else (order.assetPair.priceAsset != cfgPriceAssetId))
657657 then throw("Wrong order assets.")
658658 else {
659659 let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
660660 let $t02902429124 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
661661 let unusedActions = $t02902429124._1
662662 let kLpNew = $t02902429124._2
663663 let isOrderValid = (kLpNew >= kLp)
664664 let info = makeString(["kLp=", toString(kLp), " kLpNew=", toString(kLpNew), " amountAssetBalance=", toString(amountAssetBalance), " priceAssetBalance=", toString(priceAssetBalance), " amountAssetBalanceDelta=", toString(amountAssetBalanceDelta), " priceAssetBalanceDelta=", toString(priceAssetBalanceDelta), " height=", toString(height)], "")
665665 $Tuple2(isOrderValid, info)
666666 }
667667 }
668668
669669
670670 func commonGet (i) = if ((size(i.payments) != 1))
671671 then throw("exactly 1 payment is expected")
672672 else {
673673 let pmt = value(i.payments[0])
674674 let pmtAssetId = value(pmt.assetId)
675675 let pmtAmt = pmt.amount
676676 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller)
677677 let outAmAmt = res._1
678678 let outPrAmt = res._2
679679 let poolStatus = parseIntValue(res._9)
680680 let state = res._10
681681 if (if (isGlobalShutdown())
682682 then true
683683 else (poolStatus == PoolShutdown))
684684 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
685685 else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state)
686686 }
687687
688688
689689 func commonPut (i,slippageTolerance,emitLp) = if ((size(i.payments) != 2))
690690 then throw("exactly 2 payments are expected")
691691 else {
692692 let amAssetPmt = value(i.payments[0])
693693 let prAssetPmt = value(i.payments[1])
694694 let estPut = estimatePutOperation(toBase58String(i.transactionId), slippageTolerance, amAssetPmt.amount, amAssetPmt.assetId, prAssetPmt.amount, prAssetPmt.assetId, toString(i.caller), false, emitLp)
695695 let poolStatus = parseIntValue(estPut._8)
696696 if (if (if (isGlobalShutdown())
697697 then true
698698 else (poolStatus == PoolPutDisabled))
699699 then true
700700 else (poolStatus == PoolShutdown))
701701 then throw(("Put operation is blocked by admin. Status = " + toString(poolStatus)))
702702 else estPut
703703 }
704704
705705
706706 func emit (amount) = {
707707 let emitInv = invoke(factoryContract, "emit", [amount], nil)
708708 if ((emitInv == emitInv))
709709 then {
710710 let emitInvLegacy = match emitInv {
711711 case legacyFactoryContract: Address =>
712712 invoke(legacyFactoryContract, "emit", [amount], nil)
713713 case _ =>
714714 unit
715715 }
716716 if ((emitInvLegacy == emitInvLegacy))
717717 then amount
718718 else throw("Strict value is not equal to itself.")
719719 }
720720 else throw("Strict value is not equal to itself.")
721721 }
722722
723723
724724 func takeFee (amount,fee) = {
725725 let feeAmount = if ((fee == 0))
726726 then 0
727727 else fraction(amount, fee, scale8)
728728 $Tuple2((amount - feeAmount), feeAmount)
729729 }
730730
731731
732732 func calcPutOneToken (paymentAmountRaw,paymentAssetId,userAddress,txId) = {
733733 let isEval = (txId == unit)
734734 let amountBalanceRaw = getAccBalance(assetIdToString(cfgAmountAssetId))
735735 let priceBalanceRaw = getAccBalance(assetIdToString(cfgPriceAssetId))
736736 let paymentInAmountAsset = if ((paymentAssetId == cfgAmountAssetId))
737737 then true
738738 else if ((paymentAssetId == cfgPriceAssetId))
739739 then false
740740 else throwErr("invalid asset")
741741 let $t03223732530 = if (isEval)
742742 then $Tuple2(amountBalanceRaw, priceBalanceRaw)
743743 else if (paymentInAmountAsset)
744744 then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw)
745745 else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw))
746746 let amountBalanceOld = $t03223732530._1
747747 let priceBalanceOld = $t03223732530._2
748748 let $t03253432683 = if (paymentInAmountAsset)
749749 then $Tuple2(paymentAmountRaw, 0)
750750 else $Tuple2(0, paymentAmountRaw)
751751 let amountAssetAmountRaw = $t03253432683._1
752752 let priceAssetAmountRaw = $t03253432683._2
753753 let amountAssetAmount = takeFee(amountAssetAmountRaw, inFee)._1
754754 let priceAssetAmount = takeFee(priceAssetAmountRaw, inFee)._1
755755 let $t03281532879 = takeFee(paymentAmountRaw, inFee)
756756 let paymentAmount = $t03281532879._1
757757 let feeAmount = $t03281532879._2
758758 let amountBalanceNew = (amountBalanceOld + amountAssetAmount)
759759 let priceBalanceNew = (priceBalanceOld + priceAssetAmount)
760760 let priceNewX18 = calcPriceBigInt(toX18(priceBalanceNew, cfgPriceAssetDecimals), toX18(amountBalanceNew, cfgAmountAssetDecimals))
761761 let priceNew = fromX18(priceNewX18, scale8)
762762 let paymentBalance = if (paymentInAmountAsset)
763763 then amountBalanceOld
764764 else priceBalanceOld
765765 let paymentBalanceBigInt = toBigInt(paymentBalance)
766766 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
767767 let chechSupply = if ((supplyBigInt > big0))
768768 then true
769769 else throwErr("initial deposit requires all coins")
770770 if ((chechSupply == chechSupply))
771771 then {
772772 let depositBigInt = toBigInt(paymentAmount)
773773 let issueAmount = max([0, toInt(((supplyBigInt * (sqrtBigInt((scale18 + ((depositBigInt * scale18) / paymentBalanceBigInt)), 18, 18, DOWN) - scale18)) / scale18))])
774774 let commonState = if (isEval)
775775 then nil
776776 else [IntegerEntry(pl(), priceNew), IntegerEntry(ph(height, lastBlock.timestamp), priceNew), StringEntry(pau(toString(value(userAddress)), toBase58String(value(txId))), dataPutActionInfo(amountAssetAmountRaw, priceAssetAmountRaw, issueAmount, priceNew, 0, 0, height, lastBlock.timestamp, 0, 0))]
777777 let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, cfgPriceAssetDecimals), toX18(amountBalanceOld, cfgAmountAssetDecimals))
778778 let priceOld = fromX18(priceOldX18, scale8)
779779 let loss = {
780780 let $t03456034727 = if (paymentInAmountAsset)
781781 then $Tuple2(amountAssetAmountRaw, amountBalanceOld)
782782 else $Tuple2(priceAssetAmountRaw, priceBalanceOld)
783783 let amount = $t03456034727._1
784784 let balance = $t03456034727._2
785785 let issueAmountBoth = toInt(fraction(supplyBigInt, toBigInt((amount / 2)), toBigInt(balance)))
786786 fraction((issueAmount - issueAmountBoth), scale8, issueAmountBoth)
787787 }
788788 $Tuple5(issueAmount, commonState, feeAmount, loss, paymentInAmountAsset)
789789 }
790790 else throw("Strict value is not equal to itself.")
791791 }
792792
793793
794794 func calcGetOneToken (outAssetId,paymentAmount,paymentAssetId,userAddress,txId) = {
795795 let isEval = (txId == unit)
796796 let cfg = getPoolConfig()
797797 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
798798 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
799799 let checks = [if ((paymentAssetId == cfgLpAssetId))
800800 then true
801801 else throwErr("invalid lp asset")]
802802 if ((checks == checks))
803803 then {
804804 let outInAmountAsset = if ((outAssetId == cfgAmountAssetId))
805805 then true
806806 else if ((outAssetId == cfgPriceAssetId))
807807 then false
808808 else throwErr("invalid asset")
809809 let balanceBigInt = if (outInAmountAsset)
810810 then toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId)))
811811 else toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId)))
812812 let outInAmountAssetDecimals = if (outInAmountAsset)
813813 then amtAssetDcm
814814 else priceAssetDcm
815815 let amBalanceOld = getAccBalance(assetIdToString(cfgAmountAssetId))
816816 let prBalanceOld = getAccBalance(assetIdToString(cfgPriceAssetId))
817817 let outBalance = if (outInAmountAsset)
818818 then amBalanceOld
819819 else prBalanceOld
820820 let outBalanceBigInt = toBigInt(outBalance)
821821 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
822822 let redeemedBigInt = toBigInt(paymentAmount)
823823 let amountRaw = max([0, toInt(((balanceBigInt * (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN))) / scale18))])
824824 let $t03680536861 = takeFee(amountRaw, outFee)
825825 let totalAmount = $t03680536861._1
826826 let feeAmount = $t03680536861._2
827827 let $t03686537091 = if (outInAmountAsset)
828828 then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld)
829829 else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw))
830830 let outAmAmount = $t03686537091._1
831831 let outPrAmount = $t03686537091._2
832832 let amBalanceNew = $t03686537091._3
833833 let prBalanceNew = $t03686537091._4
834834 let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, cfgPriceAssetDecimals), toX18(amBalanceNew, cfgAmountAssetDecimals))
835835 let priceNew = fromX18(priceNewX18, scale8)
836836 let commonState = if (isEval)
837837 then nil
838838 else [StringEntry(gau(toString(value(userAddress)), toBase58String(value(txId))), dataGetActionInfo(outAmAmount, outPrAmount, paymentAmount, priceNew, height, lastBlock.timestamp)), IntegerEntry(pl(), priceNew), IntegerEntry(ph(height, lastBlock.timestamp), priceNew)]
839839 let priceOldX18 = calcPriceBigInt(toX18(prBalanceOld, cfgPriceAssetDecimals), toX18(amBalanceOld, cfgAmountAssetDecimals))
840840 let priceOld = fromX18(priceOldX18, scale8)
841841 let loss = {
842842 let amountBothInPaymentAsset = (toInt(fraction(balanceBigInt, redeemedBigInt, supplyBigInt)) * 2)
843843 fraction((totalAmount - amountBothInPaymentAsset), scale8, amountBothInPaymentAsset)
844844 }
845845 $Tuple5(totalAmount, commonState, feeAmount, loss, outInAmountAsset)
846846 }
847847 else throw("Strict value is not equal to itself.")
848848 }
849849
850850
851851 func managerPublicKeyOrUnit () = match getString(mpk()) {
852852 case s: String =>
853853 fromBase58String(s)
854854 case _: Unit =>
855855 unit
856856 case _ =>
857857 throw("Match error")
858858 }
859859
860860
861861 func pendingManagerPublicKeyOrUnit () = match getString(pmpk()) {
862862 case s: String =>
863863 fromBase58String(s)
864864 case _: Unit =>
865865 unit
866866 case _ =>
867867 throw("Match error")
868868 }
869869
870870
871871 func isManager (i) = match managerPublicKeyOrUnit() {
872872 case pk: ByteVector =>
873873 (i.callerPublicKey == pk)
874874 case _: Unit =>
875875 (i.caller == this)
876876 case _ =>
877877 throw("Match error")
878878 }
879879
880880
881881 func mustManager (i) = {
882882 let pd = throw("Permission denied")
883883 match managerPublicKeyOrUnit() {
884884 case pk: ByteVector =>
885885 if ((i.callerPublicKey == pk))
886886 then true
887887 else pd
888888 case _: Unit =>
889889 if ((i.caller == this))
890890 then true
891891 else pd
892892 case _ =>
893893 throw("Match error")
894894 }
895895 }
896896
897897
898898 @Callable(i)
899899 func rebalance () = (rebalanceAsset(getStringOrFail(this, aa())) ++ rebalanceAsset(getStringOrFail(this, pa())))
900900
901901
902902
903903 @Callable(i)
904904 func calculateAmountOutForSwapREADONLY (cleanAmountIn,isReverse,feePoolAmount) = {
905905 let $t03897739282 = if ((isReverse == false))
906906 then {
907907 let assetOut = getStringOrFail(this, pa())
908908 let assetIn = getStringOrFail(this, aa())
909909 $Tuple2(assetOut, assetIn)
910910 }
911911 else {
912912 let assetOut = getStringOrFail(this, aa())
913913 let assetIn = getStringOrFail(this, pa())
914914 $Tuple2(assetOut, assetIn)
915915 }
916916 let assetOut = $t03897739282._1
917917 let assetIn = $t03897739282._2
918918 let poolAssetInBalance = getAccBalance(assetIn)
919919 let poolAssetOutBalance = getAccBalance(assetOut)
920920 let amountOut = fraction(poolAssetOutBalance, cleanAmountIn, (poolAssetInBalance + cleanAmountIn))
921921 let oldK = (toBigInt(poolAssetInBalance) * toBigInt(poolAssetOutBalance))
922922 let newK = (((toBigInt(getAccBalance(assetIn)) + toBigInt(cleanAmountIn)) + toBigInt(feePoolAmount)) * (toBigInt(getAccBalance(assetOut)) - toBigInt(amountOut)))
923923 let checkK = if ((newK >= oldK))
924924 then true
925925 else throw("new K is fewer error")
926926 if ((checkK == checkK))
927927 then $Tuple2(nil, amountOut)
928928 else throw("Strict value is not equal to itself.")
929929 }
930930
931931
932932
933933 @Callable(i)
934934 func calculateAmountOutForSwapAndSendTokens (cleanAmountIn,isReverse,amountOutMin,addressTo,feePoolAmount) = {
935935 let swapContact = {
936936 let @ = invoke(factoryContract, "getSwapContractREADONLY", nil, nil)
937937 if ($isInstanceOf(@, "String"))
938938 then @
939939 else throw(($getType(@) + " couldn't be cast to String"))
940940 }
941941 let checks = [if ((value(i.payments[0]).amount >= cleanAmountIn))
942942 then true
943943 else throwErr("Wrong amount"), if ((i.caller == addressFromStringValue(swapContact)))
944944 then true
945945 else throwErr("Permission denied")]
946946 if ((checks == checks))
947947 then {
948948 let pmt = value(i.payments[0])
949949 let assetIn = assetIdToString(pmt.assetId)
950950 let assetOut = if ((isReverse == false))
951951 then getStringOrFail(this, pa())
952952 else getStringOrFail(this, aa())
953953 let poolAssetInBalance = (getAccBalance(assetIn) - value(i.payments[0]).amount)
954954 let poolAssetOutBalance = getAccBalance(assetOut)
955955 let amountOut = fraction(poolAssetOutBalance, cleanAmountIn, (poolAssetInBalance + cleanAmountIn))
956956 let oldK = (toBigInt(poolAssetInBalance) * toBigInt(poolAssetOutBalance))
957957 let newK = ((toBigInt(getAccBalance(assetIn)) + toBigInt(feePoolAmount)) * (toBigInt(getAccBalance(assetOut)) - toBigInt(amountOut)))
958958 let checkK = if ((newK >= oldK))
959959 then true
960960 else throw("new K is fewer error")
961961 if ((checkK == checkK))
962962 then {
963963 let checkMin = if ((amountOut >= amountOutMin))
964964 then true
965965 else throw("Exchange result is fewer coins than expected")
966966 if ((checkMin == checkMin))
967967 then {
968- let withdrawState = getWithdrawAssetState(assetOut, amountOut)
969- if ((withdrawState == withdrawState))
970- then $Tuple2((withdrawState ++ [ScriptTransfer(addressFromStringValue(addressTo), amountOut, parseAssetId(assetOut))]), amountOut)
968+ let rebalanceState = rebalanceAsset(assetIn)
969+ if ((rebalanceState == rebalanceState))
970+ then {
971+ let withdrawState = getWithdrawAssetState(assetOut, amountOut)
972+ if ((withdrawState == withdrawState))
973+ then $Tuple2(((withdrawState ++ rebalanceState) ++ [ScriptTransfer(addressFromStringValue(addressTo), amountOut, parseAssetId(assetOut))]), amountOut)
974+ else throw("Strict value is not equal to itself.")
975+ }
971976 else throw("Strict value is not equal to itself.")
972977 }
973978 else throw("Strict value is not equal to itself.")
974979 }
975980 else throw("Strict value is not equal to itself.")
976981 }
977982 else throw("Strict value is not equal to itself.")
978983 }
979984
980985
981986
982987 @Callable(i)
983988 func setManager (pendingManagerPublicKey) = {
984989 let checkCaller = mustManager(i)
985990 if ((checkCaller == checkCaller))
986991 then {
987992 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
988993 if ((checkManagerPublicKey == checkManagerPublicKey))
989994 then [StringEntry(pmpk(), pendingManagerPublicKey)]
990995 else throw("Strict value is not equal to itself.")
991996 }
992997 else throw("Strict value is not equal to itself.")
993998 }
994999
9951000
9961001
9971002 @Callable(i)
9981003 func confirmManager () = {
9991004 let pm = pendingManagerPublicKeyOrUnit()
10001005 let hasPM = if (isDefined(pm))
10011006 then true
10021007 else throw("No pending manager")
10031008 if ((hasPM == hasPM))
10041009 then {
10051010 let checkPM = if ((i.callerPublicKey == value(pm)))
10061011 then true
10071012 else throw("You are not pending manager")
10081013 if ((checkPM == checkPM))
10091014 then [StringEntry(mpk(), toBase58String(value(pm))), DeleteEntry(pmpk())]
10101015 else throw("Strict value is not equal to itself.")
10111016 }
10121017 else throw("Strict value is not equal to itself.")
10131018 }
10141019
10151020
10161021
10171022 @Callable(i)
10181023 func put (slippageTolerance,shouldAutoStake) = if ((0 > slippageTolerance))
10191024 then throw("Invalid slippageTolerance passed")
10201025 else {
10211026 let estPut = commonPut(i, slippageTolerance, true)
10221027 let emitLpAmt = estPut._2
10231028 let lpAssetId = estPut._7
10241029 let state = estPut._9
10251030 let amDiff = estPut._10
10261031 let prDiff = estPut._11
10271032 let amId = estPut._12
10281033 let prId = estPut._13
10291034 let amAssetPmt = toBigInt(value(i.payments[0]).amount)
10301035 let prAssetPmt = toBigInt(value(i.payments[1]).amount)
10311036 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
10321037 if ((currentKLp == currentKLp))
10331038 then {
10341039 let emitInv = invoke(factoryContract, "emit", [emitLpAmt], nil)
10351040 if ((emitInv == emitInv))
10361041 then {
10371042 let emitInvLegacy = match emitInv {
10381043 case legacyFactoryContract: Address =>
10391044 invoke(legacyFactoryContract, "emit", [emitLpAmt], nil)
10401045 case _ =>
10411046 unit
10421047 }
10431048 if ((emitInvLegacy == emitInvLegacy))
10441049 then {
10451050 let slippageAInv = if ((amDiff > 0))
10461051 then invoke(slippageContract, "put", nil, [AttachedPayment(amId, amDiff)])
10471052 else nil
10481053 if ((slippageAInv == slippageAInv))
10491054 then {
10501055 let slippagePInv = if ((prDiff > 0))
10511056 then invoke(slippageContract, "put", nil, [AttachedPayment(prId, prDiff)])
10521057 else nil
10531058 if ((slippagePInv == slippagePInv))
10541059 then {
10551060 let lpTransfer = if (shouldAutoStake)
10561061 then {
10571062 let slpStakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)])
10581063 if ((slpStakeInv == slpStakeInv))
10591064 then nil
10601065 else throw("Strict value is not equal to itself.")
10611066 }
10621067 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
1063- let $t04425544717 = refreshKLpInternal(0, 0, 0)
1064- if (($t04425544717 == $t04425544717))
1068+ let $t04432444786 = refreshKLpInternal(0, 0, 0)
1069+ if (($t04432444786 == $t04432444786))
10651070 then {
1066- let updatedKLp = $t04425544717._2
1067- let refreshKLpActions = $t04425544717._1
1071+ let updatedKLp = $t04432444786._2
1072+ let refreshKLpActions = $t04432444786._1
10681073 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10691074 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10701075 then {
10711076 let reb = invoke(this, "rebalance", nil, nil)
10721077 if ((reb == reb))
10731078 then ((state ++ lpTransfer) ++ refreshKLpActions)
10741079 else throw("Strict value is not equal to itself.")
10751080 }
10761081 else throw("Strict value is not equal to itself.")
10771082 }
10781083 else throw("Strict value is not equal to itself.")
10791084 }
10801085 else throw("Strict value is not equal to itself.")
10811086 }
10821087 else throw("Strict value is not equal to itself.")
10831088 }
10841089 else throw("Strict value is not equal to itself.")
10851090 }
10861091 else throw("Strict value is not equal to itself.")
10871092 }
10881093 else throw("Strict value is not equal to itself.")
10891094 }
10901095
10911096
10921097
10931098 @Callable(i)
10941099 func putForFree (maxSlippage) = if ((0 > maxSlippage))
10951100 then throw("Invalid value passed")
10961101 else {
10971102 let estPut = commonPut(i, maxSlippage, false)
10981103 let state = estPut._9
10991104 let amAssetPmt = toBigInt(value(i.payments[0]).amount)
11001105 let prAssetPmt = toBigInt(value(i.payments[1]).amount)
11011106 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
11021107 if ((currentKLp == currentKLp))
11031108 then {
1104- let $t04532945394 = refreshKLpInternal(0, 0, 0)
1105- let refreshKLpActions = $t04532945394._1
1106- let updatedKLp = $t04532945394._2
1109+ let $t04539845463 = refreshKLpInternal(0, 0, 0)
1110+ let refreshKLpActions = $t04539845463._1
1111+ let updatedKLp = $t04539845463._2
11071112 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11081113 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11091114 then (state ++ refreshKLpActions)
11101115 else throw("Strict value is not equal to itself.")
11111116 }
11121117 else throw("Strict value is not equal to itself.")
11131118 }
11141119
11151120
11161121
11171122 @Callable(i)
11181123 func putOneTkn (minOutAmount,autoStake) = {
11191124 let isPoolOneTokenOperationsDisabled = {
11201125 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
11211126 if ($isInstanceOf(@, "Boolean"))
11221127 then @
11231128 else throw(($getType(@) + " couldn't be cast to Boolean"))
11241129 }
11251130 let isPutDisabled = if (if (if (isGlobalShutdown())
11261131 then true
11271132 else (cfgPoolStatus == PoolPutDisabled))
11281133 then true
11291134 else (cfgPoolStatus == PoolShutdown))
11301135 then true
11311136 else isPoolOneTokenOperationsDisabled
11321137 let checks = [if (if (!(isPutDisabled))
11331138 then true
11341139 else isManager(i))
11351140 then true
11361141 else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1))
11371142 then true
11381143 else throwErr("exactly 1 payment are expected")]
11391144 if ((checks == checks))
11401145 then {
11411146 let payment = i.payments[0]
11421147 let paymentAssetId = payment.assetId
11431148 let paymentAmountRaw = payment.amount
11441149 let currentKLp = if ((paymentAssetId == cfgAmountAssetId))
11451150 then calcCurrentKLp(toBigInt(paymentAmountRaw), toBigInt(0), toBigInt(0))
11461151 else if ((paymentAssetId == cfgPriceAssetId))
11471152 then calcCurrentKLp(toBigInt(0), toBigInt(paymentAmountRaw), toBigInt(0))
11481153 else throwErr("payment asset is not supported")
11491154 if ((currentKLp == currentKLp))
11501155 then {
11511156 let userAddress = i.caller
11521157 let txId = i.transactionId
1153- let $t04658246734 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
1154- if (($t04658246734 == $t04658246734))
1158+ let $t04665146803 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
1159+ if (($t04665146803 == $t04665146803))
11551160 then {
1156- let paymentInAmountAsset = $t04658246734._5
1157- let bonus = $t04658246734._4
1158- let feeAmount = $t04658246734._3
1159- let commonState = $t04658246734._2
1160- let emitAmountEstimated = $t04658246734._1
1161+ let paymentInAmountAsset = $t04665146803._5
1162+ let bonus = $t04665146803._4
1163+ let feeAmount = $t04665146803._3
1164+ let commonState = $t04665146803._2
1165+ let emitAmountEstimated = $t04665146803._1
11611166 let emitAmount = if (if ((minOutAmount > 0))
11621167 then (minOutAmount > emitAmountEstimated)
11631168 else false)
11641169 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
11651170 else emitAmountEstimated
11661171 let emitInv = emit(emitAmount)
11671172 if ((emitInv == emitInv))
11681173 then {
11691174 let lpTransfer = if (autoStake)
11701175 then {
11711176 let stakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(cfgLpAssetId, emitAmount)])
11721177 if ((stakeInv == stakeInv))
11731178 then nil
11741179 else throw("Strict value is not equal to itself.")
11751180 }
11761181 else [ScriptTransfer(i.caller, emitAmount, cfgLpAssetId)]
11771182 let sendFee = if ((feeAmount > 0))
11781183 then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
11791184 else nil
1180- let $t04732047517 = if ((this == feeCollectorAddress))
1185+ let $t04738947586 = if ((this == feeCollectorAddress))
11811186 then $Tuple2(0, 0)
11821187 else if (paymentInAmountAsset)
11831188 then $Tuple2(-(feeAmount), 0)
11841189 else $Tuple2(0, -(feeAmount))
1185- let amountAssetBalanceDelta = $t04732047517._1
1186- let priceAssetBalanceDelta = $t04732047517._2
1187- let $t04752047628 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1188- let refreshKLpActions = $t04752047628._1
1189- let updatedKLp = $t04752047628._2
1190+ let amountAssetBalanceDelta = $t04738947586._1
1191+ let priceAssetBalanceDelta = $t04738947586._2
1192+ let $t04758947697 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1193+ let refreshKLpActions = $t04758947697._1
1194+ let updatedKLp = $t04758947697._2
11901195 let kLp = value(getString(keyKLp))
11911196 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11921197 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11931198 then {
11941199 let reb = invoke(this, "rebalance", nil, nil)
11951200 if ((reb == reb))
11961201 then $Tuple2((((commonState ++ lpTransfer) ++ sendFee) ++ refreshKLpActions), emitAmount)
11971202 else throw("Strict value is not equal to itself.")
11981203 }
11991204 else throw("Strict value is not equal to itself.")
12001205 }
12011206 else throw("Strict value is not equal to itself.")
12021207 }
12031208 else throw("Strict value is not equal to itself.")
12041209 }
12051210 else throw("Strict value is not equal to itself.")
12061211 }
12071212 else throw("Strict value is not equal to itself.")
12081213 }
12091214
12101215
12111216
12121217 @Callable(i)
12131218 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
1214- let $t04798348140 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
1215- let emitAmountEstimated = $t04798348140._1
1216- let commonState = $t04798348140._2
1217- let feeAmount = $t04798348140._3
1218- let bonus = $t04798348140._4
1219- let paymentInAmountAsset = $t04798348140._5
1219+ let $t04805248209 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
1220+ let emitAmountEstimated = $t04805248209._1
1221+ let commonState = $t04805248209._2
1222+ let feeAmount = $t04805248209._3
1223+ let bonus = $t04805248209._4
1224+ let paymentInAmountAsset = $t04805248209._5
12201225 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
12211226 }
12221227
12231228
12241229
12251230 @Callable(i)
12261231 func getOneTkn (outAssetIdStr,minOutAmount) = {
12271232 let isPoolOneTokenOperationsDisabled = {
12281233 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
12291234 if ($isInstanceOf(@, "Boolean"))
12301235 then @
12311236 else throw(($getType(@) + " couldn't be cast to Boolean"))
12321237 }
12331238 let isGetDisabled = if (if (isGlobalShutdown())
12341239 then true
12351240 else (cfgPoolStatus == PoolShutdown))
12361241 then true
12371242 else isPoolOneTokenOperationsDisabled
12381243 let checks = [if (if (!(isGetDisabled))
12391244 then true
12401245 else isManager(i))
12411246 then true
12421247 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1))
12431248 then true
12441249 else throwErr("exactly 1 payment are expected")]
12451250 if ((checks == checks))
12461251 then {
12471252 let outAssetId = parseAssetId(outAssetIdStr)
12481253 let payment = i.payments[0]
12491254 let paymentAssetId = payment.assetId
12501255 let paymentAmount = payment.amount
12511256 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
12521257 if ((currentKLp == currentKLp))
12531258 then {
12541259 let userAddress = i.caller
12551260 let txId = i.transactionId
1256- let $t04902549178 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
1257- if (($t04902549178 == $t04902549178))
1261+ let $t04909449247 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
1262+ if (($t04909449247 == $t04909449247))
12581263 then {
1259- let outInAmountAsset = $t04902549178._5
1260- let bonus = $t04902549178._4
1261- let feeAmount = $t04902549178._3
1262- let commonState = $t04902549178._2
1263- let amountEstimated = $t04902549178._1
1264+ let outInAmountAsset = $t04909449247._5
1265+ let bonus = $t04909449247._4
1266+ let feeAmount = $t04909449247._3
1267+ let commonState = $t04909449247._2
1268+ let amountEstimated = $t04909449247._1
12641269 let amount = if (if ((minOutAmount > 0))
12651270 then (minOutAmount > amountEstimated)
12661271 else false)
12671272 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
12681273 else amountEstimated
12691274 let burnInv = invoke(factoryContract, "burn", [paymentAmount], [AttachedPayment(paymentAssetId, paymentAmount)])
12701275 if ((burnInv == burnInv))
12711276 then {
12721277 let withdrawState = getWithdrawAssetState(outAssetIdStr, amount)
12731278 if ((withdrawState == withdrawState))
12741279 then {
12751280 let assetTransfer = [ScriptTransfer(userAddress, amount, outAssetId)]
12761281 let sendFee = if ((feeAmount > 0))
12771282 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
12781283 else nil
1279- let $t04974849995 = {
1284+ let $t04981750064 = {
12801285 let feeAmountForCalc = if ((this == feeCollectorAddress))
12811286 then 0
12821287 else feeAmount
12831288 if (outInAmountAsset)
12841289 then $Tuple2(-((amount + feeAmountForCalc)), 0)
12851290 else $Tuple2(0, -((amount + feeAmountForCalc)))
12861291 }
1287- let amountAssetBalanceDelta = $t04974849995._1
1288- let priceAssetBalanceDelta = $t04974849995._2
1289- let $t04999850106 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1290- let refreshKLpActions = $t04999850106._1
1291- let updatedKLp = $t04999850106._2
1292+ let amountAssetBalanceDelta = $t04981750064._1
1293+ let priceAssetBalanceDelta = $t04981750064._2
1294+ let $t05006750175 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1295+ let refreshKLpActions = $t05006750175._1
1296+ let updatedKLp = $t05006750175._2
12921297 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
12931298 if ((isUpdatedKLpValid == isUpdatedKLpValid))
12941299 then $Tuple2(((((commonState ++ withdrawState) ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
12951300 else throw("Strict value is not equal to itself.")
12961301 }
12971302 else throw("Strict value is not equal to itself.")
12981303 }
12991304 else throw("Strict value is not equal to itself.")
13001305 }
13011306 else throw("Strict value is not equal to itself.")
13021307 }
13031308 else throw("Strict value is not equal to itself.")
13041309 }
13051310 else throw("Strict value is not equal to itself.")
13061311 }
13071312
13081313
13091314
13101315 @Callable(i)
13111316 func getOneTknREADONLY (outAssetId,paymentAmount) = {
1312- let $t05038450540 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
1313- let amountEstimated = $t05038450540._1
1314- let commonState = $t05038450540._2
1315- let feeAmount = $t05038450540._3
1316- let bonus = $t05038450540._4
1317- let outInAmountAsset = $t05038450540._5
1317+ let $t05045350609 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
1318+ let amountEstimated = $t05045350609._1
1319+ let commonState = $t05045350609._2
1320+ let feeAmount = $t05045350609._3
1321+ let bonus = $t05045350609._4
1322+ let outInAmountAsset = $t05045350609._5
13181323 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
13191324 }
13201325
13211326
13221327
13231328 @Callable(i)
13241329 func unstakeAndGetOneTkn (unstakeAmount,outAssetIdStr,minOutAmount) = {
13251330 let isPoolOneTokenOperationsDisabled = {
13261331 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
13271332 if ($isInstanceOf(@, "Boolean"))
13281333 then @
13291334 else throw(($getType(@) + " couldn't be cast to Boolean"))
13301335 }
13311336 let isGetDisabled = if (if (isGlobalShutdown())
13321337 then true
13331338 else (cfgPoolStatus == PoolShutdown))
13341339 then true
13351340 else isPoolOneTokenOperationsDisabled
13361341 let checks = [if (if (!(isGetDisabled))
13371342 then true
13381343 else isManager(i))
13391344 then true
13401345 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 0))
13411346 then true
13421347 else throwErr("no payments are expected")]
13431348 if ((checks == checks))
13441349 then {
13451350 let outAssetId = parseAssetId(outAssetIdStr)
13461351 let userAddress = i.caller
13471352 let txId = i.transactionId
13481353 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
13491354 if ((currentKLp == currentKLp))
13501355 then {
13511356 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
13521357 if ((unstakeInv == unstakeInv))
13531358 then {
1354- let $t05144551596 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1355- if (($t05144551596 == $t05144551596))
1359+ let $t05151451665 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1360+ if (($t05151451665 == $t05151451665))
13561361 then {
1357- let outInAmountAsset = $t05144551596._5
1358- let bonus = $t05144551596._4
1359- let feeAmount = $t05144551596._3
1360- let commonState = $t05144551596._2
1361- let amountEstimated = $t05144551596._1
1362+ let outInAmountAsset = $t05151451665._5
1363+ let bonus = $t05151451665._4
1364+ let feeAmount = $t05151451665._3
1365+ let commonState = $t05151451665._2
1366+ let amountEstimated = $t05151451665._1
13621367 let amount = if (if ((minOutAmount > 0))
13631368 then (minOutAmount > amountEstimated)
13641369 else false)
13651370 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
13661371 else amountEstimated
13671372 let burnInv = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
13681373 if ((burnInv == burnInv))
13691374 then {
13701375 let withdrawState = getWithdrawAssetState(outAssetIdStr, amount)
13711376 if ((withdrawState == withdrawState))
13721377 then {
13731378 let assetTransfer = [ScriptTransfer(i.caller, amount, outAssetId)]
13741379 let sendFee = if ((feeAmount > 0))
13751380 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
13761381 else nil
1377- let $t05216152408 = {
1382+ let $t05223052477 = {
13781383 let feeAmountForCalc = if ((this == feeCollectorAddress))
13791384 then 0
13801385 else feeAmount
13811386 if (outInAmountAsset)
13821387 then $Tuple2(-((amount + feeAmountForCalc)), 0)
13831388 else $Tuple2(0, -((amount + feeAmountForCalc)))
13841389 }
1385- let amountAssetBalanceDelta = $t05216152408._1
1386- let priceAssetBalanceDelta = $t05216152408._2
1387- let $t05241152519 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1388- let refreshKLpActions = $t05241152519._1
1389- let updatedKLp = $t05241152519._2
1390+ let amountAssetBalanceDelta = $t05223052477._1
1391+ let priceAssetBalanceDelta = $t05223052477._2
1392+ let $t05248052588 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1393+ let refreshKLpActions = $t05248052588._1
1394+ let updatedKLp = $t05248052588._2
13901395 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
13911396 if ((isUpdatedKLpValid == isUpdatedKLpValid))
13921397 then $Tuple2(((((commonState ++ withdrawState) ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
13931398 else throw("Strict value is not equal to itself.")
13941399 }
13951400 else throw("Strict value is not equal to itself.")
13961401 }
13971402 else throw("Strict value is not equal to itself.")
13981403 }
13991404 else throw("Strict value is not equal to itself.")
14001405 }
14011406 else throw("Strict value is not equal to itself.")
14021407 }
14031408 else throw("Strict value is not equal to itself.")
14041409 }
14051410 else throw("Strict value is not equal to itself.")
14061411 }
14071412
14081413
14091414
14101415 @Callable(i)
14111416 func get () = {
14121417 let res = commonGet(i)
14131418 let outAmtAmt = res._1
14141419 let outPrAmt = res._2
14151420 let pmtAmt = res._3
14161421 let pmtAssetId = res._4
14171422 let state = res._5
14181423 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
14191424 if ((currentKLp == currentKLp))
14201425 then {
14211426 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
14221427 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
14231428 then {
1424- let $t05348653568 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1425- let refreshKLpActions = $t05348653568._1
1426- let updatedKLp = $t05348653568._2
1429+ let $t05355553637 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1430+ let refreshKLpActions = $t05355553637._1
1431+ let updatedKLp = $t05355553637._2
14271432 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
14281433 if ((isUpdatedKLpValid == isUpdatedKLpValid))
14291434 then (state ++ refreshKLpActions)
14301435 else throw("Strict value is not equal to itself.")
14311436 }
14321437 else throw("Strict value is not equal to itself.")
14331438 }
14341439 else throw("Strict value is not equal to itself.")
14351440 }
14361441
14371442
14381443
14391444 @Callable(i)
14401445 func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = {
14411446 let res = commonGet(i)
14421447 let outAmAmt = res._1
14431448 let outPrAmt = res._2
14441449 let pmtAmt = res._3
14451450 let pmtAssetId = res._4
14461451 let state = res._5
14471452 if ((noLessThenAmtAsset > outAmAmt))
14481453 then throw(((("noLessThenAmtAsset failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset)))
14491454 else if ((noLessThenPriceAsset > outPrAmt))
14501455 then throw(((("noLessThenPriceAsset failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset)))
14511456 else {
14521457 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
14531458 if ((currentKLp == currentKLp))
14541459 then {
14551460 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
14561461 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
14571462 then {
1458- let $t05451754598 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1459- let refreshKLpActions = $t05451754598._1
1460- let updatedKLp = $t05451754598._2
1463+ let $t05458654667 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1464+ let refreshKLpActions = $t05458654667._1
1465+ let updatedKLp = $t05458654667._2
14611466 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
14621467 if ((isUpdatedKLpValid == isUpdatedKLpValid))
14631468 then (state ++ refreshKLpActions)
14641469 else throw("Strict value is not equal to itself.")
14651470 }
14661471 else throw("Strict value is not equal to itself.")
14671472 }
14681473 else throw("Strict value is not equal to itself.")
14691474 }
14701475 }
14711476
14721477
14731478
14741479 @Callable(i)
14751480 func unstakeAndGet (amount) = {
14761481 let checkPayments = if ((size(i.payments) != 0))
14771482 then throw("No payments are expected")
14781483 else true
14791484 if ((checkPayments == checkPayments))
14801485 then {
14811486 let cfg = getPoolConfig()
14821487 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
14831488 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
14841489 if ((currentKLp == currentKLp))
14851490 then {
14861491 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(lpAssetId), amount], nil)
14871492 if ((unstakeInv == unstakeInv))
14881493 then {
14891494 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller)
14901495 let outAmAmt = res._1
14911496 let outPrAmt = res._2
14921497 let poolStatus = parseIntValue(res._9)
14931498 let state = res._10
14941499 let checkPoolStatus = if (if (isGlobalShutdown())
14951500 then true
14961501 else (poolStatus == PoolShutdown))
14971502 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
14981503 else true
14991504 if ((checkPoolStatus == checkPoolStatus))
15001505 then {
15011506 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
15021507 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
15031508 then {
1504- let $t05572455805 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1505- let refreshKLpActions = $t05572455805._1
1506- let updatedKLp = $t05572455805._2
1509+ let $t05579355874 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1510+ let refreshKLpActions = $t05579355874._1
1511+ let updatedKLp = $t05579355874._2
15071512 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
15081513 if ((isUpdatedKLpValid == isUpdatedKLpValid))
15091514 then (state ++ refreshKLpActions)
15101515 else throw("Strict value is not equal to itself.")
15111516 }
15121517 else throw("Strict value is not equal to itself.")
15131518 }
15141519 else throw("Strict value is not equal to itself.")
15151520 }
15161521 else throw("Strict value is not equal to itself.")
15171522 }
15181523 else throw("Strict value is not equal to itself.")
15191524 }
15201525 else throw("Strict value is not equal to itself.")
15211526 }
15221527
15231528
15241529
15251530 @Callable(i)
15261531 func unstakeAndGetNoLess (unstakeAmount,noLessThenAmountAsset,noLessThenPriceAsset) = {
15271532 let isGetDisabled = if (isGlobalShutdown())
15281533 then true
15291534 else (cfgPoolStatus == PoolShutdown)
15301535 let checks = [if (!(isGetDisabled))
15311536 then true
15321537 else throw("get operation is blocked by admin"), if ((size(i.payments) == 0))
15331538 then true
15341539 else throw("no payments are expected")]
15351540 if ((checks == checks))
15361541 then {
15371542 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
15381543 if ((currentKLp == currentKLp))
15391544 then {
15401545 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
15411546 if ((unstakeInv == unstakeInv))
15421547 then {
15431548 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller)
15441549 let outAmAmt = res._1
15451550 let outPrAmt = res._2
15461551 let state = res._10
15471552 let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset))
15481553 then true
15491554 else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset))
15501555 then true
15511556 else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))]
15521557 if ((checkAmounts == checkAmounts))
15531558 then {
15541559 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
15551560 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
15561561 then {
1557- let $t05710057181 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1558- let refreshKLpActions = $t05710057181._1
1559- let updatedKLp = $t05710057181._2
1562+ let $t05716957250 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1563+ let refreshKLpActions = $t05716957250._1
1564+ let updatedKLp = $t05716957250._2
15601565 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
15611566 if ((isUpdatedKLpValid == isUpdatedKLpValid))
15621567 then (state ++ refreshKLpActions)
15631568 else throw("Strict value is not equal to itself.")
15641569 }
15651570 else throw("Strict value is not equal to itself.")
15661571 }
15671572 else throw("Strict value is not equal to itself.")
15681573 }
15691574 else throw("Strict value is not equal to itself.")
15701575 }
15711576 else throw("Strict value is not equal to itself.")
15721577 }
15731578 else throw("Strict value is not equal to itself.")
15741579 }
15751580
15761581
15771582
15781583 @Callable(i)
15791584 func activate (amtAssetStr,priceAssetStr) = if ((toString(i.caller) != toString(factoryContract)))
15801585 then throw("permissions denied")
15811586 else $Tuple2([StringEntry(aa(), amtAssetStr), StringEntry(pa(), priceAssetStr)], "success")
15821587
15831588
15841589
15851590 @Callable(i)
15861591 func refreshKLp () = {
15871592 let lastRefreshedBlockHeight = valueOrElse(getInteger(keyKLpRefreshedHeight), 0)
15881593 let checkLastRefreshedBlockHeight = if (((height - lastRefreshedBlockHeight) >= kLpRefreshDelay))
15891594 then unit
15901595 else throwErr(makeString([toString(kLpRefreshDelay), " blocks have not passed since the previous call"], ""))
15911596 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
15921597 then {
15931598 let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
1594- let $t05836858432 = refreshKLpInternal(0, 0, 0)
1595- let kLpUpdateActions = $t05836858432._1
1596- let updatedKLp = $t05836858432._2
1599+ let $t05843758501 = refreshKLpInternal(0, 0, 0)
1600+ let kLpUpdateActions = $t05843758501._1
1601+ let updatedKLp = $t05843758501._2
15971602 let actions = if ((kLp != updatedKLp))
15981603 then kLpUpdateActions
15991604 else throwErr("nothing to refresh")
16001605 $Tuple2(actions, toString(updatedKLp))
16011606 }
16021607 else throw("Strict value is not equal to itself.")
16031608 }
16041609
16051610
16061611
16071612 @Callable(i)
16081613 func getPoolConfigWrapperREADONLY () = $Tuple2(nil, getPoolConfig())
16091614
16101615
16111616
16121617 @Callable(i)
16131618 func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId))
16141619
16151620
16161621
16171622 @Callable(i)
16181623 func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = {
16191624 let prices = calcPrices(amAmt, prAmt, lpAmt)
16201625 $Tuple2(nil, [toString(prices[0]), toString(prices[1]), toString(prices[2])])
16211626 }
16221627
16231628
16241629
16251630 @Callable(i)
16261631 func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(toX18(origVal, origScaleMult)))
16271632
16281633
16291634
16301635 @Callable(i)
16311636 func fromX18WrapperREADONLY (val,resultScaleMult) = $Tuple2(nil, fromX18(parseBigIntValue(val), resultScaleMult))
16321637
16331638
16341639
16351640 @Callable(i)
16361641 func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(calcPriceBigInt(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18))))
16371642
16381643
16391644
16401645 @Callable(i)
16411646 func estimatePutOperationWrapperREADONLY (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = $Tuple2(nil, estimatePutOperation(txId58, slippageTolerance, inAmAssetAmt, inAmAssetId, inPrAssetAmt, inPrAssetId, userAddress, isEvaluate, emitLp))
16421647
16431648
16441649
16451650 @Callable(i)
16461651 func estimateGetOperationWrapperREADONLY (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
16471652 let res = estimateGetOperation(txId58, pmtAssetId, pmtLpAmt, addressFromStringValue(userAddress))
16481653 $Tuple2(nil, $Tuple10(res._1, res._2, res._3, res._4, res._5, res._6, res._7, toString(res._8), res._9, res._10))
16491654 }
16501655
16511656
16521657
16531658 @Callable(i)
16541659 func statsREADONLY () = {
16551660 let cfg = getPoolConfig()
16561661 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
16571662 let amtAssetId = cfg[idxAmtAssetId]
16581663 let priceAssetId = cfg[idxPriceAssetId]
16591664 let iAmtAssetId = cfg[idxIAmtAssetId]
16601665 let iPriceAssetId = cfg[idxIPriceAssetId]
16611666 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
16621667 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
16631668 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
16641669 let accAmtAssetBalance = getAccBalance(amtAssetId)
16651670 let accPriceAssetBalance = getAccBalance(priceAssetId)
16661671 let pricesList = if ((poolLPBalance == 0))
16671672 then [zeroBigInt, zeroBigInt, zeroBigInt]
16681673 else calcPrices(accAmtAssetBalance, accPriceAssetBalance, poolLPBalance)
16691674 let curPrice = 0
16701675 let lpAmtAssetShare = fromX18(pricesList[1], scale8)
16711676 let lpPriceAssetShare = fromX18(pricesList[2], scale8)
16721677 let poolWeight = value(getInteger(factoryContract, keyPoolWeight(toString(this))))
16731678 $Tuple2(nil, makeString(["%d%d%d%d%d%d%d", toString(accAmtAssetBalance), toString(accPriceAssetBalance), toString(poolLPBalance), toString(curPrice), toString(lpAmtAssetShare), toString(lpPriceAssetShare), toString(poolWeight)], SEP))
16741679 }
16751680
16761681
16771682
16781683 @Callable(i)
16791684 func evaluatePutByAmountAssetREADONLY (inAmAssetAmt) = {
16801685 let cfg = getPoolConfig()
16811686 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
16821687 let amAssetIdStr = cfg[idxAmtAssetId]
16831688 let amAssetId = fromBase58String(amAssetIdStr)
16841689 let prAssetIdStr = cfg[idxPriceAssetId]
16851690 let prAssetId = fromBase58String(prAssetIdStr)
16861691 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
16871692 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
16881693 let poolStatus = cfg[idxPoolStatus]
16891694 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
16901695 let accAmtAssetBalance = getAccBalance(amAssetIdStr)
16911696 let accPriceAssetBalance = getAccBalance(prAssetIdStr)
16921697 let amtAssetAmtX18 = toX18(accAmtAssetBalance, amtAssetDcm)
16931698 let priceAssetAmtX18 = toX18(accPriceAssetBalance, priceAssetDcm)
16941699 let curPriceX18 = if ((poolLPBalance == 0))
16951700 then zeroBigInt
16961701 else calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
16971702 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
16981703 let inPrAssetAmtX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18)
16991704 let inPrAssetAmt = fromX18(inPrAssetAmtX18, priceAssetDcm)
17001705 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
17011706 let calcLpAmt = estPut._1
17021707 let curPriceCalc = estPut._3
17031708 let amBalance = estPut._4
17041709 let prBalance = estPut._5
17051710 let lpEmission = estPut._6
17061711 $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d", toString(calcLpAmt), toString(fromX18(curPriceX18, scale8)), toString(amBalance), toString(prBalance), toString(lpEmission), poolStatus, toString(inAmAssetAmt), toString(inPrAssetAmt)], SEP))
17071712 }
17081713
17091714
17101715
17111716 @Callable(i)
17121717 func evaluatePutByPriceAssetREADONLY (inPrAssetAmt) = {
17131718 let cfg = getPoolConfig()
17141719 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
17151720 let amAssetIdStr = cfg[idxAmtAssetId]
17161721 let amAssetId = fromBase58String(amAssetIdStr)
17171722 let prAssetIdStr = cfg[idxPriceAssetId]
17181723 let prAssetId = fromBase58String(prAssetIdStr)
17191724 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
17201725 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
17211726 let poolStatus = cfg[idxPoolStatus]
17221727 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
17231728 let amBalanceRaw = getAccBalance(amAssetIdStr)
17241729 let prBalanceRaw = getAccBalance(prAssetIdStr)
17251730 let amBalanceRawX18 = toX18(amBalanceRaw, amtAssetDcm)
17261731 let prBalanceRawX18 = toX18(prBalanceRaw, priceAssetDcm)
17271732 let curPriceX18 = if ((poolLPBalance == 0))
17281733 then zeroBigInt
17291734 else calcPriceBigInt(prBalanceRawX18, amBalanceRawX18)
17301735 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
17311736 let inAmAssetAmtX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
17321737 let inAmAssetAmt = fromX18(inAmAssetAmtX18, amtAssetDcm)
17331738 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
17341739 let calcLpAmt = estPut._1
17351740 let curPriceCalc = estPut._3
17361741 let amBalance = estPut._4
17371742 let prBalance = estPut._5
17381743 let lpEmission = estPut._6
17391744 $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d", toString(calcLpAmt), toString(fromX18(curPriceX18, scale8)), toString(amBalance), toString(prBalance), toString(lpEmission), poolStatus, toString(inAmAssetAmt), toString(inPrAssetAmt)], SEP))
17401745 }
17411746
17421747
17431748
17441749 @Callable(i)
17451750 func evaluateGetREADONLY (paymentLpAssetId,paymentLpAmt) = {
17461751 let res = estimateGetOperation("", paymentLpAssetId, paymentLpAmt, this)
17471752 let outAmAmt = res._1
17481753 let outPrAmt = res._2
17491754 let amBalance = res._5
17501755 let prBalance = res._6
17511756 let lpEmission = res._7
17521757 let curPrice = res._8
17531758 let poolStatus = parseIntValue(res._9)
17541759 $Tuple2(nil, makeString(["%d%d%d%d%d%d%d", toString(outAmAmt), toString(outPrAmt), toString(amBalance), toString(prBalance), toString(lpEmission), toString(curPrice), toString(poolStatus)], SEP))
17551760 }
17561761
17571762
17581763 @Verifier(tx)
17591764 func verify () = {
17601765 let targetPublicKey = match managerPublicKeyOrUnit() {
17611766 case pk: ByteVector =>
17621767 pk
17631768 case _: Unit =>
17641769 tx.senderPublicKey
17651770 case _ =>
17661771 throw("Match error")
17671772 }
17681773 match tx {
17691774 case order: Order =>
17701775 let matcherPub = getMatcherPubOrFail()
1771- let $t06709467163 = validateMatcherOrderAllowed(order)
1772- let orderValid = $t06709467163._1
1773- let orderValidInfo = $t06709467163._2
1776+ let $t06716367232 = validateMatcherOrderAllowed(order)
1777+ let orderValid = $t06716367232._1
1778+ let orderValidInfo = $t06716367232._2
17741779 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
17751780 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
17761781 if (if (if (orderValid)
17771782 then senderValid
17781783 else false)
17791784 then matcherValid
17801785 else false)
17811786 then true
17821787 else throwOrderError(orderValid, orderValidInfo, senderValid, matcherValid)
17831788 case s: SetScriptTransaction =>
17841789 if (sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey))
17851790 then true
17861791 else {
17871792 let newHash = blake2b256(value(s.script))
17881793 let allowedHash = fromBase64String(value(getString(factoryContract, keyAllowedLpScriptHash())))
17891794 let currentHash = scriptHash(this)
17901795 if ((allowedHash == newHash))
17911796 then (currentHash != newHash)
17921797 else false
17931798 }
17941799 case _ =>
17951800 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
17961801 }
17971802 }
17981803

github/deemru/w8io/026f985 
199.75 ms